当前位置: 首页>>代码示例>>C++>>正文


C++ EventType::get_name方法代码示例

本文整理汇总了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;
}
开发者ID:ben-sangster,项目名称:dmz,代码行数:62,代码来源:dmzRuntimeToConfig.cpp

示例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;
}
开发者ID:ben-sangster,项目名称:dmz,代码行数:37,代码来源:dmzRuntimeInit.cpp

示例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;
}
开发者ID:Andais,项目名称:dmz,代码行数:36,代码来源:dmzEventModuleBasic.cpp


注:本文中的EventType::get_name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。