本文整理汇总了C++中EventType::get_handle方法的典型用法代码示例。如果您正苦于以下问题:C++ EventType::get_handle方法的具体用法?C++ EventType::get_handle怎么用?C++ EventType::get_handle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventType
的用法示例。
在下文中一共展示了EventType::get_handle方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: result
dmz::Boolean
dmz::EventModuleBasic::release_event_observer (
const EventType &Type,
const Mask &CallbackMask,
EventObserver &observer) {
Boolean result (False);
const Handle ObsHandle (observer.get_event_observer_handle ());
SubscriptionStruct *sub (_subscriptionTable.lookup (ObsHandle));
if (sub) {
if (CallbackMask & CreateMask) {
EventObserverStruct *eos (sub->createTable.remove (Type.get_handle ()));
if (eos) { eos->remove (ObsHandle); }
}
if (CallbackMask & CloseMask) {
EventObserverStruct *eos (sub->closeTable.remove (Type.get_handle ()));
if (eos) { eos->remove (ObsHandle); }
}
result = True;
}
return result;
}
示例2: 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);
}
}
}
}
示例3: result
/*!
\brief Removes event type with the given unique handle.
\param[in] TypeHandle Unique handle of event type to remove from the set.
\param[in] context Pointer to runtime context.
\return Returns dmz::True if event type was successfully remove from the set.
*/
dmz::Boolean
dmz::EventTypeSet::remove_event_type (const Handle TypeHandle, RuntimeContext *context) {
Boolean result (False);
EventType tmp (TypeHandle, context);
EventType *ptr (_state.table.remove (tmp.get_handle ()));
if (ptr) { delete ptr; ptr = 0; result = True; }
return result;
}
示例4:
// Event Observer Interface
void
dmz::RenderPluginEventOSG::close_event (
const Handle EventHandle,
const EventType &Type,
const EventLocalityEnum Locality) {
const Handle TypeHandle = Type.get_handle ();
if (!_ignore.contains (TypeHandle)) {
TypeStruct *ts = _get_type (EventHandle, Type);
if (ts) { _create_event (EventHandle, *ts); }
}
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
}
}
示例8:
/*!
\brief Tests if exact event type is stored in set.
\param[in] Type EventType to use in test.
\return Returns dmz::True if the \a Type is contained in the set.
*/
dmz::Boolean
dmz::EventTypeSet::contains_exact_type (const EventType &Type) const {
return _state.table.lookup (Type.get_handle ()) != 0;
}
示例9: Name
void
dmz::NetModulePacketCodecBasic::_discover_codec (const Plugin *PluginPtr) {
const String Name (PluginPtr ? PluginPtr->get_plugin_name () : "");
NetExtPacketCodecObject *objCodec (NetExtPacketCodecObject::cast (PluginPtr));
NetExtPacketCodecEvent *eventCodec (NetExtPacketCodecEvent::cast (PluginPtr));
if (Name && (objCodec || eventCodec)) {
PacketStruct *hs (_packetTable.lookup (Name));
if (hs) {
DecodeStruct *ds (0);
if (objCodec) { ds = new DecodeStruct (hs->PacketID, *objCodec); }
else if (eventCodec) { ds = new DecodeStruct (hs->PacketID, *eventCodec); }
if (ds && _decodeTable.store (hs->PacketID, ds)) {
if (objCodec && hs->objects.get_count ()) {
EncodeObjectStruct *eos (
new EncodeObjectStruct (hs->PacketID, *objCodec));
if (eos && _objEncodeTable.store (hs->PacketID, eos)) {
ObjectTypeIterator it;
ObjectType type;
Boolean found (hs->objects.get_first (it, type));
while (found) {
_objTypeTable.store (type.get_handle (), eos);
found = hs->objects.get_next (it, type);
}
}
else if (eos) { delete eos; eos = 0; }
}
else if (eventCodec && hs->events.get_count ()) {
EncodeEventStruct *ees (
new EncodeEventStruct (hs->PacketID, *eventCodec));
if (ees && _eventEncodeTable.store (hs->PacketID, ees)) {
EventTypeIterator it;
EventType type;
Boolean found (hs->events.get_first (it, type));
while (found) {
_eventTypeTable.store (type.get_handle (), ees);
found = hs->events.get_next (it, type);
}
}
else if (ees) { delete ees; ees = 0; }
}
}
else if (ds) {
delete ds; ds = 0;
}
}
}
}