本文整理汇总了C++中EventType::get_config方法的典型用法代码示例。如果您正苦于以下问题:C++ EventType::get_config方法的具体用法?C++ EventType::get_config怎么用?C++ EventType::get_config使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventType
的用法示例。
在下文中一共展示了EventType::get_config方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: current
/*!
\brief Finds Config.
\details Looks for Config up the EventType tree until Config is found or the root
EventType is reached. Uses dmz::Config::lookup_all_config_merged().
\param[in] Name String containing the name of the Config data to find.
\param[out] type EventType that the Config was found in.
\return Returns a Config object. The Config object will be empty if the named Config
can not be found.
*/
dmz::Config
dmz::EventType::find_config (const String &Name, EventType &type) const {
Config result;
EventType current (_context);
while (current) {
if (current.get_config ().lookup_all_config_merged (Name, result)) {
type = current;
current.set_type_context (0);
}
else { current.become_parent (); }
}
return result;
}
示例2: result
/*!
\brief Serializes the EventType definitions in a RuntimeContext and stores the result
in a Config object.
\ingroup Runtime
\details Format of the returned Config object:
\code
<runtime>
<event-type name="String" parent="String"/>
</runtime>
\endcode
- \b event-type.name String containing the name of the EventType.
- \b event-type.parent String containing the name of the parent EventType.
- \b event-type.* Config data of the EventType.
\param[in] context Pointer to the RuntimeContext to serialize.
\return Returns a Config object containing the serialized EventType definitions in the
RuntimeContext.
*/
dmz::Config
dmz::runtime_event_types_to_config (RuntimeContext *context) {
RuntimeContextDefinitions *defs = (context ? context->get_definitions_context () : 0);
Config result (RuntimeName);
if (defs) {
defs->ref ();
const EventType RootEventType = Definitions (context).get_root_event_type ();
HashTableHandleIterator it;
ObjectType *otype (0);
EventType *etype (0);
while (defs->eventHandleTable.get_next (it, etype)) {
if (RootEventType != *etype) {
Config data ("event-type");
data.store_attribute ("name", etype->get_name ());
EventType parent = etype->get_parent ();
if (parent != RootEventType) {
data.store_attribute ("parent", parent.get_name ());
}
data.add_children (etype->get_config ());
result.add_config (data);
}
}
defs->unref ();
}
return result;
}