Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

SignalTrans< T > Class Template Reference

causes a transition if a DataEvent<T> from stateSignalEGID occurs, and checks for a specific value if one is specified More...

#include <SignalTrans.h>

Inheritance diagram for SignalTrans< T >:

Detailed Description

template<class T>
class SignalTrans< T >

causes a transition if a DataEvent<T> from stateSignalEGID occurs, and checks for a specific value if one is specified

This allows a state node to signal a transition to another state in a clean symbolic way. Only the transition itself needs to know the address of the destination node. The value passed in the DataEvent will be supplied to the destination node's doStart method. A SignalTrans with no value supplied acts like a default case and will fire if no other SignalTrans fires first.

Definition at line 19 of file SignalTrans.h.

List of all members.

Public Member Functions

 SignalTrans (StateNode *destination)
 Constructor.
 SignalTrans (StateNode *destination, const T &value)
 Constructor.
 SignalTrans (const std::string &name, StateNode *destination)
 Constructor.
 SignalTrans (const std::string &name, StateNode *destination, const T &value)
 Constructor.
virtual void postStart ()
 Called by start() after the doStart(), allows superclasses to complete initialization.
virtual void doEvent ()
 Delegate function for event processing, the event itself is pointed to (only for the duration of the doEvent() call!) by event.
 SignalTrans (const SignalTrans< T > &src)
 Copy constructor required in case we're storing a pointer.
SignalTrans< T > & operator= (const SignalTrans< T > &src)
 Assignment operator required in case we're storing a pointer.

Protected Attributes

val
 value to compare against
bool valueSupplied
 true if a value was supplied in the constructor
DataEvent< T > savedEvent
 Copy of current event to be used after timer expires.

Constructor & Destructor Documentation

template<class T>
SignalTrans< T >::SignalTrans ( StateNode destination  ) 

Constructor.

Definition at line 22 of file SignalTrans.h.

template<class T>
SignalTrans< T >::SignalTrans ( StateNode destination,
const T &  value 
)

Constructor.

Definition at line 27 of file SignalTrans.h.

template<class T>
SignalTrans< T >::SignalTrans ( const std::string &  name,
StateNode destination 
)

Constructor.

Definition at line 32 of file SignalTrans.h.

template<class T>
SignalTrans< T >::SignalTrans ( const std::string &  name,
StateNode destination,
const T &  value 
)

Constructor.

Definition at line 37 of file SignalTrans.h.

template<class T>
SignalTrans< T >::SignalTrans ( const SignalTrans< T > &  src  ) 

Copy constructor required in case we're storing a pointer.


Member Function Documentation

template<class T>
virtual void SignalTrans< T >::doEvent (  )  [virtual]

Delegate function for event processing, the event itself is pointed to (only for the duration of the doEvent() call!) by event.

Default implementation watches for 'private' text message events (those forwarded by a BehaviorSwitchControl from ControllerGUI input) and will publically rebroadcast them. The idea is that your own processEvent gets first dibs, but if the behavior doesn't handle the text message, it will be handed off for others.

Reimplemented from BehaviorBase.

Definition at line 47 of file SignalTrans.h.

template<class T>
SignalTrans<T>& SignalTrans< T >::operator= ( const SignalTrans< T > &  src  ) 

Assignment operator required in case we're storing a pointer.

Definition at line 77 of file SignalTrans.h.

template<class T>
virtual void SignalTrans< T >::postStart (  )  [virtual]

Called by start() after the doStart(), allows superclasses to complete initialization.

For robustness to future change, subclasses should be sure to call the superclass implementation.

Reimplemented from BehaviorBase.

Definition at line 41 of file SignalTrans.h.


Member Data Documentation

template<class T>
DataEvent<T> SignalTrans< T >::savedEvent [protected]

Copy of current event to be used after timer expires.

Definition at line 86 of file SignalTrans.h.

Referenced by SignalTrans< T >::doEvent().

template<class T>
T SignalTrans< T >::val [protected]

value to compare against

Definition at line 84 of file SignalTrans.h.

Referenced by SignalTrans< T >::doEvent(), and SignalTrans< T >::operator=().

template<class T>
bool SignalTrans< T >::valueSupplied [protected]

true if a value was supplied in the constructor

Definition at line 85 of file SignalTrans.h.

Referenced by SignalTrans< T >::doEvent(), and SignalTrans< T >::operator=().


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

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:16 2016 by Doxygen 1.6.3