本文整理汇总了C++中EventType::get_name方法的典型用法代码示例。如果您正苦于以下问题:C++ EventType::get_name方法的具体用法?C++ EventType::get_name怎么用?C++ EventType::get_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventType
的用法示例。
在下文中一共展示了EventType::get_name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: if
//! Gets root event type.
dmz::EventType
dmz::Definitions::get_root_event_type () const {
EventType result;
if (_state.context && _state.defs) {
EventType *ptr (_state.defs->eventNameTable.lookup (LocalRootEventTypeName));
if (!ptr) {
TypeContext *rootTypeContext = new TypeContext (
LocalRootEventTypeName,
_state.context,
0,
0);
if (rootTypeContext) {
ptr = new EventType (rootTypeContext);
if (ptr && _state.defs->eventNameTable.store (ptr->get_name (), ptr)) {
_state.defs->eventHandleTable.store (ptr->get_handle (), ptr);
}
else if (ptr) { delete ptr; ptr = 0; }
rootTypeContext->unref ();
}
}
if (ptr) { result = *ptr; }
}
return result;
}
示例3: result
dmz::Handle
dmz::EventModuleBasic::create_event (
const EventType &Type,
const EventLocalityEnum Locality) {
Handle result (0);
if (Type && (Locality != EventLocalityUnknown)) {
EventStruct *event (_recycleList);
if (event) { _recycleList = _recycleList->next; event->next = 0; event->reset (); }
else { event = new EventStruct; }
if (event) {
result = event->get_handle (Type.get_name (), _PluginInfoData.get_context ());
if (result) {
if (_eventTable.store (result, event)) {
event->type = Type;
event->locality = Locality;
}
else {
result = 0;
event->next = _recycleList; _recycleList = event;
}
}
}
}
return result;
}