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


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

本文整理汇总了C++中EventType::become_parent方法的典型用法代码示例。如果您正苦于以下问题:C++ EventType::become_parent方法的具体用法?C++ EventType::become_parent怎么用?C++ EventType::become_parent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EventType的用法示例。


在下文中一共展示了EventType::become_parent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: current

// Event Observer Interface
void
dmz::AudioPluginEventSimple::close_event (
      const Handle EventHandle,
      const EventType &Type,
      const EventLocalityEnum Locality) {

   EventType current (Type);
   EventStruct *es (0);

   while (!es && current) {

      es = _eventTable.lookup (current.get_handle ());

      if (!es) { current.become_parent (); }
   }
  
   if (es && es->sound) {

      EventModule *eventMod (get_event_module ());

      if (_audioMod && eventMod) {

         Vector pos;

         if (eventMod->lookup_position (EventHandle, _defaultEventHandle, pos)) {

            SoundInit init;
            SoundAttributes attributes;
            attributes.set_position (pos);
            _audioMod->play_sound (es->sound, init, attributes);
         }
      }
   }
}
开发者ID:Andais,项目名称:dmz,代码行数:35,代码来源:dmzAudioPluginEventSimple.cpp

示例2: event

// RenderPluginEventOSG Interface
dmz::RenderPluginEventOSG::TypeStruct *
dmz::RenderPluginEventOSG::_get_type (
      const Handle EventHandle,
      const EventType &Type) {

   TypeStruct *result (0);

   EventModule *module = get_event_module ();

   TypeTable *table (0);

   EventType event (Type);

   while (event && !result) {

      TypeTable *table = _get_type_table (Type);

      if (table) {

         ObjectType current;

         if (module) {

            module->lookup_object_type (EventHandle, table->TypeAttr, current);
         }

         const ObjectType Start (current);

         while (current && !result) {

            result = table->map.lookup (current.get_handle ());

            if (!result) {

               result = _create_type (EventHandle, event, current, *table);
            }

            if (!result) { current.become_parent (); }
         }

         if (result && (current != Start)) {

            table->map.store (Start.get_handle (), result);
         }
      }

      if (!result) { event.become_parent (); }
   }

   return result;
}
开发者ID:ben-sangster,项目名称:dmz,代码行数:52,代码来源:dmzRenderPluginEventOSG.cpp

示例3: result

dmz::Boolean
dmz::NetModulePacketCodecBasic::encode_event (
      const EventType &Type,
      const Handle EventHandle,
      Marshal &outData) {

   Boolean result (False);

   EncodeEventStruct *ees (_eventTypeTable.lookup (Type.get_handle ()));

   if (!ees) {

      EventType current (Type); current.become_parent ();

      while (!ees && current) {

         ees = _eventTypeTable.lookup (current.get_handle ());
         current.become_parent ();
      }
   }

   if (ees && _headerCodec) {

      const Int32 Place (outData.get_place ());
      if (_headerCodec->write_header (ees->PacketID, outData)) {

         if (ees->codec.encode_event (EventHandle, outData)) {

            outData.set_place (Place);
            result = _headerCodec->write_header (ees->PacketID, outData);
         }
      }
   }

   return result;
}
开发者ID:Andais,项目名称:dmz,代码行数:36,代码来源:dmzNetModulePacketCodecBasic.cpp

示例4: result

/*!

\brief Tests if event type is stored in set.
\param[in] Type EventType to use in test.
\return Returns dmz::True if the \a Type or one of its parents is contained in the set.

*/
dmz::Boolean
dmz::EventTypeSet::contains_type (const EventType &Type) const {

   Boolean result (False);

   EventType current (Type);

   Boolean done (current ? False : True);

   while (!done) {

      if (_state.table.lookup (current.get_handle ())) { result = done = True; }
      else { current.become_parent (); if (!current) { done = True; } }
   }

   return result;
}
开发者ID:ben-sangster,项目名称:dmz,代码行数:24,代码来源:dmzRuntimeEventType.cpp

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

示例6: current

void
dmz::EventModuleBasic::_close_event (EventStruct &event) {

   EventType current (event.type);

   while (current) {

      EventObserverStruct *eos (_createTable.lookup (current.get_handle ()));

      if (eos) {

         HashTableHandleIterator it;

         EventObserver *obs (eos->get_first (it));

         while (obs) {

            obs->create_event (event.handle, event.type, event.locality);
            obs = eos->get_next (it);
         }
      }

      current.become_parent ();
   }

   event.closed = True;
   event.closeTime = _time.get_frame_time ();

   current = event.type;

   while (current) {

      EventObserverStruct *eos (_closeTable.lookup (current.get_handle ()));

      if (eos) {

         HashTableHandleIterator it;

         EventObserver *obs (eos->get_first (it));

         while (obs) {

            obs->close_event (event.handle, event.type, event.locality);
            obs = eos->get_next (it);
         }
      }

      current.become_parent ();
   }

   // Move to end of the table.
   if (_eventTable.remove (event.handle)) {

      if (!_eventTable.store (event.handle, &event)) {

         _log.error << "Internal error: Failed to save event: " << event.handle
            << " of type: " << event.type.get_name () << endl;
         _eventCache = 0; delete &event;
      }
   }
}
开发者ID:Andais,项目名称:dmz,代码行数:61,代码来源:dmzEventModuleBasic.cpp


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