#include <OMKInputConnectionEventListener.h>
Inheritance diagram for OMK::InputConnectionEventListener< T >:
Public Member Functions | |
InputConnectionEventListener (SimulatedObject &owner, Input< T > *associatedInput) | |
constructor | |
virtual | ~InputConnectionEventListener () |
destructor | |
virtual void | registerEvents () |
redefine to register the event emitted by the control parameter when new values are suggested | |
virtual bool | processEvent (Event *event) |
process the suggested changes | |
Protected Attributes | |
Input< T > * | _associatedInput |
the control parameter this event listener is montoring the change of |
Definition at line 36 of file OMKInputConnectionEventListener.h.
OMK::InputConnectionEventListener< T >::InputConnectionEventListener | ( | SimulatedObject & | owner, | |
Input< T > * | associatedInput | |||
) |
constructor
owner | owner of the event listener associatedInput input this event listener is listening in behalf of |
Definition at line 66 of file OMKInputConnectionEventListener.h.
References OMK::EventListener::_owner, and OMK::SimulatedObject::addEventListener().
00069 : EventListener( owner ), 00070 _associatedInput( associatedInput ) 00071 { 00072 _owner.addEventListener( *this ) ; 00073 }
OMK::InputConnectionEventListener< T >::~InputConnectionEventListener | ( | ) | [virtual] |
void OMK::InputConnectionEventListener< T >::registerEvents | ( | ) | [virtual] |
redefine to register the event emitted by the control parameter when new values are suggested
Reimplemented from OMK::EventListener.
Definition at line 85 of file OMKInputConnectionEventListener.h.
References OMK::InputConnectionEventListener< T >::_associatedInput, OMK::EventListener::_owner, and OMK::SimulatedObject::registerEventListenerForEvent().
00086 { 00087 _owner.registerEventListenerForEvent( 00088 *this, _associatedInput->getConnectionEventId() ) ; 00089 _owner.registerEventListenerForEvent( 00090 *this, _associatedInput->getConnectionToControlParameterEventId() ) ; 00091 }
bool OMK::InputConnectionEventListener< T >::processEvent | ( | Event * | event | ) | [virtual] |
process the suggested changes
Implements OMK::EventListener.
Definition at line 96 of file OMKInputConnectionEventListener.h.
References OMK::InputConnectionEventListener< T >::_associatedInput, OMK::Event::eventId, OMASSERT, OMK::Event::sender, and OMK::ValuedEvent< UserType >::value.
00097 { 00098 ValuedEvent< Name > * realEvent = 00099 dynamic_cast< ValuedEvent< Name > *>( event ) ; 00100 OMASSERT( realEvent != 0 ) ; 00101 if( realEvent->eventId == _associatedInput->getConnectionEventId() ) 00102 { 00103 _associatedInput->connect( realEvent->sender, realEvent->value ) ; 00104 } 00105 else 00106 { 00107 _associatedInput->connectToControlParameter( realEvent->sender, 00108 realEvent->value ) ; 00109 } 00110 return true ; 00111 }
Input< T >* OMK::InputConnectionEventListener< T >::_associatedInput [protected] |
the control parameter this event listener is montoring the change of
Definition at line 57 of file OMKInputConnectionEventListener.h.
Referenced by OMK::InputConnectionEventListener< T >::processEvent(), and OMK::InputConnectionEventListener< T >::registerEvents().
Documentation generated on Mon Jun 9 11:46:02 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |