本文整理汇总了C++中configobject::Ptr::IsActive方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::IsActive方法的具体用法?C++ Ptr::IsActive怎么用?C++ Ptr::IsActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类configobject::Ptr
的用法示例。
在下文中一共展示了Ptr::IsActive方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ObjectHandler
void CheckerComponent::ObjectHandler(const ConfigObject::Ptr& object)
{
Checkable::Ptr checkable = dynamic_pointer_cast<Checkable>(object);
if (!checkable)
return;
Zone::Ptr zone = Zone::GetByName(checkable->GetZoneName());
bool same_zone = (!zone || Zone::GetLocalZone() == zone);
{
boost::mutex::scoped_lock lock(m_Mutex);
if (object->IsActive() && !object->IsPaused() && same_zone) {
if (m_PendingCheckables.find(checkable) != m_PendingCheckables.end())
return;
m_IdleCheckables.insert(GetCheckableScheduleInfo(checkable));
} else {
m_IdleCheckables.erase(checkable);
m_PendingCheckables.erase(checkable);
}
m_CV.notify_all();
}
}
示例2: UpdateObject
void DbConnection::UpdateObject(const ConfigObject::Ptr& object)
{
if (!GetConnected())
return;
DbObject::Ptr dbobj = DbObject::GetOrCreateByObject(object);
if (dbobj) {
bool active = object->IsActive();
if (active) {
ActivateObject(dbobj);
dbobj->SendConfigUpdate();
dbobj->SendStatusUpdate();
} else
DeactivateObject(dbobj);
}
}
示例3: UpdateObject
void DbConnection::UpdateObject(const ConfigObject::Ptr& object)
{
if (!GetConnected())
return;
DbObject::Ptr dbobj = DbObject::GetOrCreateByObject(object);
if (dbobj) {
bool dbActive = GetObjectActive(dbobj);
bool active = object->IsActive();
if (active && !dbActive) {
ActivateObject(dbobj);
dbobj->SendConfigUpdate();
dbobj->SendStatusUpdate();
} else if (!active) {
/* Deactivate the deleted object no matter
* which state it had in the database.
*/
DeactivateObject(dbobj);
}
}
}
示例4: UpdateObject
void DbConnection::UpdateObject(const ConfigObject::Ptr& object)
{
if (!GetConnected() || Application::IsShuttingDown())
return;
DbObject::Ptr dbobj = DbObject::GetOrCreateByObject(object);
if (dbobj) {
bool dbActive = GetObjectActive(dbobj);
bool active = object->IsActive();
if (active) {
if (!dbActive)
ActivateObject(dbobj);
Dictionary::Ptr configFields = dbobj->GetConfigFields();
String configHash = dbobj->CalculateConfigHash(configFields);
ASSERT(configHash.GetLength() <= 64);
configFields->Set("config_hash", configHash);
String cachedHash = GetConfigHash(dbobj);
if (cachedHash != configHash) {
dbobj->SendConfigUpdateHeavy(configFields);
dbobj->SendStatusUpdate();
} else {
dbobj->SendConfigUpdateLight();
}
} else if (!active) {
/* Deactivate the deleted object no matter
* which state it had in the database.
*/
DeactivateObject(dbobj);
}
}
}