Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
Transition Class ReferenceRepresents a transition between StateNodes. More...
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 40 of file Transition.h.
Constructor & Destructor Documentation
destructor Definition at line 10 of file Transition.cc.
constructor, specify destination StateNode (ignores NULL) Definition at line 82 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 86 of file Transition.h.
constructor, specify names and destination StateNode (ignores NULL) Definition at line 88 of file Transition.h.
copy constructor, just in case you need it Definition at line 92 of file Transition.h. Member Function Documentation
if destination is non-null, add it to the destination list Reimplemented in RandomTrans. Definition at line 55 of file Transition.h. Referenced by DualCoding::Pilot::GoToShapeMachine::setup(), DualCoding::Pilot::SetVelocityMachine::setup(), DualCoding::Pilot::WaypointWalkMachine::setup(), DualCoding::Pilot::WalkMachine::setup(), KoduInterpreter::setup(), KoduInterpreter::DropActionRunner::ExecuteDrop::setup(), KoduInterpreter::InitializeAgent::setup(), Grasper::CloseTheGripper::setup(), Grasper::OpenTheGripper::setup(), 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 101 of file Transition.h. Referenced by StateNode::addTransition().
performs firing, stopping sources and activating destination Definition at line 60 of file Transition.cc.
Call this to fire with an event to be stored into the destinations' 'event' member while their start() is called. Definition at line 38 of file Transition.cc.
Call this when the transition should be made, will forward on to doFire(). Reimplemented in RandomTrans. Definition at line 25 of file Transition.cc. Referenced by VisualTargetTrans::doEvent(), VisualTargetCloseTrans::doEvent(), TimeOutTrans::doEvent(), TextMsgTrans::doEvent(), SignalTrans< T >::doEvent(), PilotTrans::doEvent(), NullTrans::doEvent(), GrasperTrans::doEvent(), EventTrans::doEvent(), ConnectionMadeTrans::doEvent(), CompletionTrans::doEvent(), and CompareTrans< T >::doEvent().
Definition at line 55 of file Transition.cc. Referenced by fire().
returns a const reference to the current destination list Definition at line 57 of file Transition.h.
returns a user-modifiable reference to the current destination list Definition at line 56 of file Transition.h. Referenced by EventLogger::processStateMachineEvent().
If instanceName == className, will autogenerate a name incorporating source and destination names. Reimplemented from BehaviorBase. Definition at line 150 of file Transition.cc. Referenced by doFire(), fire(), RandomTrans::fire(), EventLogger::processStateMachineEvent(), and ~Transition().
returns the current sound file Definition at line 60 of file Transition.h.
returns a const reference to the current source list Definition at line 53 of file Transition.h.
returns a user-modifiable reference to the current source list Definition at line 52 of file Transition.h. Referenced by CompletionTrans::doEvent(), CompletionTrans::postStart(), and EventLogger::processStateMachineEvent().
assignment operator (only does shallow copy) Definition at line 95 of file Transition.h.
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 59 of file Transition.h.
set the text to be spoken upon activation Definition at line 62 of file Transition.h.
Definition at line 137 of file Transition.cc. Referenced by fire().
cancel buffered firing if deactivated (perhaps by transition which fired from earlier in the queue Reimplemented from BehaviorBase. Reimplemented in CompletionTrans. Definition at line 19 of file Transition.cc. Referenced by doFire(), and RandomTrans::fire(). Friends And Related Function Documentation
Definition at line 41 of file Transition.h. Member Data Documentation
the node being transitioned to Definition at line 104 of file Transition.h. Referenced by addDestination(), doFire(), RandomTrans::fire(), getDestinations(), getName(), and operator=().
Definition at line 107 of file Transition.h. Referenced by doFire(), fire(), stop(), and ~Transition().
List of currently active transitions. Hopefully prevents re-entrant issues. Definition at line 77 of file Transition.h. Referenced by doFire(), fire(), fireDownCallStack(), showFiring(), stop(), and ~Transition().
sound to play on transitioning Definition at line 105 of file Transition.h. Referenced by doFire(), RandomTrans::fire(), getSound(), operator=(), and setSound().
text to speak on transitioning Definition at line 106 of file Transition.h. Referenced by doFire(), operator=(), and setSpeechText().
the node being transitioned from Definition at line 103 of file Transition.h. Referenced by addSource(), doFire(), RandomTrans::fire(), getName(), getSources(), operator=(), SignalTrans< T >::postStart(), PilotTrans::postStart(), and GrasperTrans::postStart(). The documentation for this class was generated from the following files: |
Tekkotsu v5.1CVS |
Generated Mon May 9 04:59:17 2016 by Doxygen 1.6.3 |