| Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
Transition Class Reference#include <Transition.h>
Inheritance diagram for Transition: ![]() Detailed DescriptionRepresents a transition between StateNodes.This is an abstract class - you'll want to subclass it to put conditions on the transitions. Transitions are "smart" - they are behaviors in and of themselves and can listen for events and use the standard DoStart/DoStop interface. Based on the events they receive, they can fire() themselves and cause a state transition. DoStart() will be called when this transition is 'active' - it should listen/monitor for the transition it represents until DoStop() is called. If the conditions are satisified for a transition, you should call fire() to do the appropriate notifications. Also note that a transition can have multiple sources and destinations. See fire(). When setting up, the flow of additions follows the flow of control. In other words, you add a transition to a source, and you add a destination to a transition. This makes the code simpler because it doesn't have to worry about recursive looping depending whether the source was added to the transition or the transition was added to the source. Confusing? Exactly.
A template file is available at project
Definition at line 38 of file Transition.h.
Constructor & Destructor Documentation
constructor, pass your subclass type name as a string for the default name
Definition at line 62 of file Transition.h.
constructor, specify destination StateNode (ignores NULL)
Definition at line 64 of file Transition.h.
constructor, pass your subclass type name as a string for the default name, and a separate instance name
Definition at line 68 of file Transition.h.
constructor, specify names and destination StateNode (ignores NULL)
Definition at line 70 of file Transition.h.
Member Function Documentation
if destination is non-null, add it to the destination list
Reimplemented in RandomTrans. Definition at line 50 of file Transition.h. Referenced by RandomTrans::addDestination(), and Transition().
if source is non-null, add it to the source list Only StateNodes should be calling this - you add a transition to a source, not a source to a transition.
Definition at line 82 of file Transition.h.
call this when the transition should be made, base class version simply calls StateNode::DoStop() on each active of srcs and StateNode::DoStart() on each inactive of dsts, but you can override.
Reimplemented in RandomTrans. Definition at line 7 of file Transition.cc. Referenced by VisualTargetTrans::processEvent(), VisualTargetCloseTrans::processEvent(), TimeOutTrans::processEvent(), TextMsgTrans::processEvent(), SignalTrans< T >::processEvent(), NullTrans::processEvent(), EventTrans::processEvent(), ConnectionMadeTrans::processEvent(), CompletionTrans::processEvent(), and CompareTrans< T >::processEvent().
returns a const reference to the current destination list
Definition at line 52 of file Transition.h.
returns a user-modifiable reference to the current destination list
Definition at line 51 of file Transition.h.
If instanceName == className, will autogenerate a name incorporating source and destination names.
Reimplemented from BehaviorBase. Definition at line 28 of file Transition.cc. Referenced by fire(), and RandomTrans::fire().
returns a user-modifiable reference to the current source list
Definition at line 47 of file Transition.h. Referenced by CompletionTrans::DoStart(), and CompletionTrans::processEvent().
set a sound file to be played upon activation; you might want to preload this in the parent node; empty string to turn off
Definition at line 54 of file Transition.h.
Friends And Related Function Documentation
Definition at line 39 of file Transition.h.
Member Data Documentation
the node being transitioned to
Definition at line 85 of file Transition.h. Referenced by addDestination(), fire(), RandomTrans::fire(), getDestinations(), getName(), and operator=().
sound to play on transitioning
Definition at line 86 of file Transition.h. Referenced by fire(), RandomTrans::fire(), getSound(), operator=(), and setSound().
the node being transitioned from
Definition at line 84 of file Transition.h. Referenced by addSource(), SignalTrans< T >::DoStart(), fire(), RandomTrans::fire(), getName(), getSources(), and operator=().
The documentation for this class was generated from the following files: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Tekkotsu v3.0 |
Generated Wed Oct 4 00:05:16 2006 by Doxygen 1.4.7 |