本文整理汇总了C++中dbobject::Ptr::SendStatusUpdate方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::SendStatusUpdate方法的具体用法?C++ Ptr::SendStatusUpdate怎么用?C++ Ptr::SendStatusUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dbobject::Ptr
的用法示例。
在下文中一共展示了Ptr::SendStatusUpdate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VersionChangedHandler
void DbObject::VersionChangedHandler(const ConfigObject::Ptr& object)
{
DbObject::Ptr dbobj = DbObject::GetOrCreateByObject(object);
if (dbobj) {
dbobj->SendConfigUpdate();
dbobj->SendStatusUpdate();
}
}
示例2: StateChangedHandler
void DbObject::StateChangedHandler(const ConfigObject::Ptr& object)
{
DbObject::Ptr dbobj = GetOrCreateByObject(object);
if (!dbobj)
return;
dbobj->SendStatusUpdate();
}
示例3: UpdateAllObjects
void DbConnection::UpdateAllObjects(void)
{
DynamicType::Ptr type;
BOOST_FOREACH(const DynamicType::Ptr& dt, DynamicType::GetTypes()) {
BOOST_FOREACH(const DynamicObject::Ptr& object, dt->GetObjects()) {
DbObject::Ptr dbobj = DbObject::GetOrCreateByObject(object);
if (dbobj) {
if (!GetObjectActive(dbobj))
ActivateObject(dbobj);
dbobj->SendConfigUpdate();
dbobj->SendStatusUpdate();
}
}
}
示例4: 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);
}
}
示例5: 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);
}
}
}
示例6: 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);
}
}
}