#include <OMKEventListener.h>
Inheritance diagram for OMK::EventListener:
Public Member Functions | |
EventListener (SimulatedObject &owner) | |
constructor | |
virtual | ~EventListener () |
Destructor. | |
virtual void | registerEvents () |
Registration method. | |
virtual bool | processEvent (Event *event)=0 |
process an event : | |
virtual void | prepareEventProcessing (const std::list< Event * > &, std::list< Event * >::const_iterator) |
called before processEvent, in case the event listener has to take more than one event into account | |
Protected Attributes | |
SimulatedObject & | _owner |
the simulated object the event listener is acting in hehalf of |
The event listeners are added to an object, which is its owner.
When the event listener is deleted it calls unregisterEventListener to inform its owner that it is no more available.
At the end of its live, during its destruction the object deletes all the remaining event listeners. So an event listener can be delete at any time.
Definition at line 41 of file OMKEventListener.h.
EventListener::EventListener | ( | SimulatedObject & | owner | ) |
constructor
owner | : the simulated object this event listener is reacting in behalf of |
Definition at line 24 of file OMKEventListener.cpp.
00024 : 00025 _owner ( owner ) 00026 { 00027 }
EventListener::~EventListener | ( | ) | [virtual] |
Destructor.
The destructor unregister the event listener near the object with a call to unregisterEventListener. So when the one which declares the event listener delete it, the object removes any link to this event listener.
Definition at line 30 of file OMKEventListener.cpp.
References _owner, and OMK::SimulatedObject::unregisterEventListener().
00031 { 00032 _owner.unregisterEventListener( *this ); 00033 }
void EventListener::registerEvents | ( | ) | [virtual] |
Registration method.
This member function is used by the owner of the event listener to know which events are taken in charge. To register the events id the event listener calls registerEventListenerForEvent method of its owner, like this:
void MyEventListener::registerEvents() { _owner.registerEventListenerForEvent( *this, myEventId ) ; }
Reimplemented in OMK::ChangedControlParameterEventListener< T >, OMK::EventListenerCallBack< CallerClass >, OMK::ValuedEventListenerCallBack< CallerClass, PrmType >, OMK::InputConnectionEventListener< T >, OMK::Inp::InputCreatorListener, OMK::InputConnectionEventListener< ModelType >, OMK::InputConnectionEventListener< OMK::Type::SimpleTypeT< bool > >, OMK::InputConnectionEventListener< OMK::Type::SimpleTypeT< float > >, OMK::InputConnectionEventListener< OMK::Type::SimpleTypeT< T > >, OMK::InputConnectionEventListener< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputConnectionEventListener< PrmType >, OMK::InputConnectionEventListener< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputConnectionEventListener< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputConnectionEventListener< OMK::Type::SimpleTypeT< Type > >.
Definition at line 40 of file OMKEventListener.cpp.
Referenced by OMK::SimulatedObject::addEventListener().
process an event :
Implemented in OMK::ChangedControlParameterEventListener< T >, OMK::EventListenerCallBack< CallerClass >, OMK::ValuedEventListenerCallBack< CallerClass, PrmType >, OMK::InputConnectionEventListener< T >, OMK::Inp::InputCreatorListener, OMK::InputConnectionEventListener< ModelType >, OMK::InputConnectionEventListener< OMK::Type::SimpleTypeT< bool > >, OMK::InputConnectionEventListener< OMK::Type::SimpleTypeT< float > >, OMK::InputConnectionEventListener< OMK::Type::SimpleTypeT< T > >, OMK::InputConnectionEventListener< OMK::Type::SimpleTypeT< PrmType > >, OMK::InputConnectionEventListener< PrmType >, OMK::InputConnectionEventListener< OMK::Type::SimpleTypeT< OMK::Type::Transform > >, OMK::InputConnectionEventListener< OMK::Type::SimpleTypeT< HBT::PostureData > >, and OMK::InputConnectionEventListener< OMK::Type::SimpleTypeT< Type > >.
void EventListener::prepareEventProcessing | ( | const std::list< Event * > & | , | |
std::list< Event * >::const_iterator | ||||
) | [virtual] |
called before processEvent, in case the event listener has to take more than one event into account
Definition at line 35 of file OMKEventListener.cpp.
SimulatedObject& OMK::EventListener::_owner [protected] |
the simulated object the event listener is acting in hehalf of
Definition at line 85 of file OMKEventListener.h.
Referenced by OMK::ChangedControlParameterEventListener< T >::ChangedControlParameterEventListener(), OMK::EventListenerCallBack< CallerClass >::EventListenerCallBack(), OMK::InputConnectionEventListener< T >::InputConnectionEventListener(), OMK::ValuedEventListenerCallBack< CallerClass, PrmType >::processEvent(), OMK::ValuedEventListenerCallBack< CallerClass, PrmType >::registerEvents(), OMK::Inp::InputCreatorListener::registerEvents(), OMK::InputConnectionEventListener< T >::registerEvents(), OMK::EventListenerCallBack< CallerClass >::registerEvents(), OMK::ChangedControlParameterEventListener< T >::registerEvents(), OMK::ValuedEventListenerCallBack< CallerClass, PrmType >::ValuedEventListenerCallBack(), and ~EventListener().
Documentation generated on Mon Jun 9 11:46:01 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |