Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PsInputConnectionEventListener< Type > Class Template Reference

the base event listener for reacting to proposed connections by objects other than the owner of the concerned input the last suggested connection arriving to the object is enacted More...

#include <PsInputConnectionEventListener.h>

Inheritance diagram for PsInputConnectionEventListener< Type >:

Inheritance graph
[legend]
Collaboration diagram for PsInputConnectionEventListener< Type >:

Collaboration graph
[legend]
List of all members.

Public Methods

 PsInputConnectionEventListener (PsSimulatedObject &owner, PsInput< Type > *associatedInput)
 constructor

virtual ~PsInputConnectionEventListener ()
 destructor

virtual void registerEvents ()
 redefine to register the event emitted by the control parameter when new values are suggested

virtual bool processEvent (PsEvent *event)
 process the suggested changes


Protected Attributes

PsInput< Type > * _associatedInput
 the control parameter this event listener is montoring the change of


Detailed Description

template<typename Type>
class PsInputConnectionEventListener< Type >

the base event listener for reacting to proposed connections by objects other than the owner of the concerned input the last suggested connection arriving to the object is enacted

Author:
David Margery (last revision by )
Version:
1.1 (revision )

Definition at line 30 of file PsInputConnectionEventListener.h.


Constructor & Destructor Documentation

template<typename Type>
PsInputConnectionEventListener< Type >::PsInputConnectionEventListener PsSimulatedObject   owner,
PsInput< Type > *    associatedInput
 

constructor

Parameters:
owner owner of the event listener associatedInput input this event listener is listening in behalf of

Definition at line 59 of file PsInputConnectionEventListener.h.

00061                                                                :
00062    PsEventListener ( owner ),
00063    _associatedInput( associatedInput )
00064 {
00065 
}

template<typename Type>
PsInputConnectionEventListener< Type >::~PsInputConnectionEventListener   [virtual]
 

destructor

Definition at line 71 of file PsInputConnectionEventListener.h.

00073 {
00074 


Member Function Documentation

template<typename Type>
bool PsInputConnectionEventListener< Type >::processEvent PsEvent   event [virtual]
 

process the suggested changes

Implements PsEventListener.

Definition at line 86 of file PsInputConnectionEventListener.h.

References PsInputConnectionEventListener< Type >::_associatedInput, PsEvent::eventId, PsEvent::sender, and PsValuedEvent< UserType >::value.

00088 {
00089    PsValuedEvent<PsName > * realEvent = dynamic_cast<PsValuedEvent<PsName > *>(event) ;
00090    assert ( realEvent != NULL );
00091    if ( realEvent->eventId == _associatedInput->getConnectionEventId() )
00092       {
00093          _associatedInput-> connect ( realEvent->sender, realEvent->value ) ; 
00094       }
00095    else
00096       {
00097          _associatedInput-> connectToControlParameter ( realEvent->sender, realEvent->value ) ; 
00098       }
00099    return true ;

template<typename Type>
void PsInputConnectionEventListener< Type >::registerEvents   [virtual]
 

redefine to register the event emitted by the control parameter when new values are suggested

Reimplemented from PsEventListener.

Definition at line 78 of file PsInputConnectionEventListener.h.

References PsInputConnectionEventListener< Type >::_associatedInput, PsEventListener::_owner, and PsSimulatedObject::registerEventListenerForEvent().

00080 {
00081    _owner.registerEventListenerForEvent ( *this, _associatedInput->getConnectionEventId() ) ;
00082    _owner.registerEventListenerForEvent ( *this, _associatedInput->getConnectionToControlParameterEventId() ) ;


Member Data Documentation

template<typename Type>
PsInput<Type>* PsInputConnectionEventListener< Type >::_associatedInput [protected]
 

the control parameter this event listener is montoring the change of

Definition at line 51 of file PsInputConnectionEventListener.h.

Referenced by PsInputConnectionEventListener< Type >::processEvent(), and PsInputConnectionEventListener< Type >::registerEvents().


The documentation for this class was generated from the following file:
logo OpenMask

Documentation generated on Mon Nov 25 15:26:05 2002

Generated with doxygen 1.2.12 by Dimitri van Heesch ,   1997-2001