本文整理汇总了C++中configobject::Ptr::GetZone方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::GetZone方法的具体用法?C++ Ptr::GetZone怎么用?C++ Ptr::GetZone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类configobject::Ptr
的用法示例。
在下文中一共展示了Ptr::GetZone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CanAccessObject
bool Zone::CanAccessObject(const ConfigObject::Ptr& object)
{
Zone::Ptr object_zone;
if (object->GetReflectionType() == Zone::TypeInstance)
object_zone = static_pointer_cast<Zone>(object);
else
object_zone = static_pointer_cast<Zone>(object->GetZone());
if (!object_zone)
object_zone = Zone::GetLocalZone();
return object_zone->IsChildOf(this);
}
示例2: SyncRelayMessage
void ApiListener::SyncRelayMessage(const MessageOrigin::Ptr& origin,
const ConfigObject::Ptr& secobj, const Dictionary::Ptr& message, bool log)
{
double ts = Utility::GetTime();
message->Set("ts", ts);
Log(LogNotice, "ApiListener")
<< "Relaying '" << message->Get("method") << "' message";
if (origin && origin->FromZone)
message->Set("originZone", origin->FromZone->GetName());
Zone::Ptr target_zone;
if (secobj) {
if (secobj->GetReflectionType() == Zone::TypeInstance)
target_zone = static_pointer_cast<Zone>(secobj);
else
target_zone = static_pointer_cast<Zone>(secobj->GetZone());
}
if (!target_zone)
target_zone = Zone::GetLocalZone();
Endpoint::Ptr master = GetMaster();
bool need_log = !RelayMessageOne(target_zone, origin, message, master);
for (const Zone::Ptr& zone : target_zone->GetAllParents()) {
if (!RelayMessageOne(zone, origin, message, master))
need_log = true;
}
if (log && need_log)
PersistMessage(message, secobj);
}