| Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
#include <StateNode.h>
Inheritance diagram for StateNode:

Override setup() to setup your own Transition and StateNode network.
Definition at line 12 of file StateNode.h.
Public Member Functions | |
| StateNode () | |
| constructor | |
| StateNode (const char *n, StateNode *p=NULL) | |
| constructor, pass a name to use, calls setName(n) | |
| virtual | ~StateNode () |
| destructor, removes references to its outgoing transitions (be careful of incoming ones - they're still around!), and calls RemoveReference() on subnodes | |
| virtual void | addTransition (Transition *trans) |
| Adds the specified StateTransition to the transition table. | |
| std::vector< Transition * > & | getTransitions () |
| Returns the std::vector of transitions so you can modify them yourself if need be. | |
| virtual StateNode * | addNode (StateNode *node) |
| Adds a StateNode to nodes so it can be automatically dereferenced later, returns what it's passed (for convenience), calls AddReference() on node. | |
| std::vector< StateNode * > & | getNodes () |
| Returns the std::vector of nodes so you can modify them yourself if need be. | |
| void | setRetain (bool f) |
| Sets the retain flag - if not retained, will RemoveReference() subnodes upon DoStop() and recreate them on DoStart (by calling setup()) - may be too expensive to be worth saving memory... | |
| virtual void | DoStart () |
| Transitions should call this when you are entering the state, so it can enable its transitions. | |
| virtual void | setup () |
| This is called by DoStart() when you should setup the network of subnodes. | |
| virtual void | DoStop () |
| Transitions should call this when you are leaving the state, so it can disable its transitions. | |
| virtual void | teardown () |
| This is called by DoStop() when you should destruct subnodes. | |
| void | setName (const std::string &n) |
| set name to n. Makes a copy of n, so you can throw it away later. | |
| virtual std::string | getName () const |
| returns name of StateNode | |
| virtual std::string | getDescription () const |
| returns name again (you should override this for top-level nodes to give users better descriptions) | |
Protected Member Functions | |
| virtual void | transitionTo (StateNode *n) |
| called by a subnode when it is being DoStart()'ed | |
| virtual void | transitionFrom (StateNode *n) |
| called by a subnode when it is being DoStop()'ed | |
Protected Attributes | |
| StateNode * | parent |
| pointer to the machine that contains this node | |
| std::vector< Transition * > | transitions |
| a vector of outgoing transitions | |
| bool | issetup |
| this is set to true if the network has been setup but not destroyed (i.e. don't need to call setupSubNodes again) | |
| bool | retain |
| this is set to true if the network should be retained between activations. Otherwise it's dereferenced upon DoStop(). (or at least RemoveReference() is called on subnodes) | |
| std::vector< StateNode * > | nodes |
| vector of StateNodes, just so they can be dereferenced again on DoStop() (unless retained) or ~StateNode() | |
| std::string | name |
| holds the name of the Node/Machine | |
Private Member Functions | |
| StateNode (const StateNode &node) | |
| don't call this | |
| StateNode | operator= (const StateNode &node) |
| don't call this | |
|
|
constructor
Definition at line 15 of file StateNode.h. References issetup, name, nodes, parent, retain, and transitions. |
|
||||||||||||
|
constructor, pass a name to use, calls setName(n)
Definition at line 18 of file StateNode.h. References issetup, name, nodes, parent, retain, setName(), and transitions. |
Here is the call graph for this function:

|
|
destructor, removes references to its outgoing transitions (be careful of incoming ones - they're still around!), and calls RemoveReference() on subnodes
Definition at line 5 of file StateNode.cc. References ASSERT, BehaviorBase::isActive(), issetup, nodes, and transitions. |
Here is the call graph for this function:

|
|
don't call this
|
|
|
Adds a StateNode to nodes so it can be automatically dereferenced later, returns what it's passed (for convenience), calls AddReference() on node.
Definition at line 32 of file StateNode.h. References ReferenceCounter::AddReference(), and nodes. |
Here is the call graph for this function:

|
|
Adds the specified StateTransition to the transition table.
Definition at line 16 of file StateNode.cc. References ReferenceCounter::AddReference(), and transitions. |
Here is the call graph for this function:

|
|
Transitions should call this when you are entering the state, so it can enable its transitions.
Reimplemented from BehaviorBase. Reimplemented in BanditMachine, BanditMachine::PressNode, BanditMachine::DecideNode, BanditMachine::WaitNode, ExploreMachine, WalkToTargetMachine, WorldModel2Behavior, WorldModel2Behavior::WalkNode, WorldModel2Behavior::GawkNode, WorldModel2Behavior::WaitNode, OutputNode, and WalkNode. Definition at line 21 of file StateNode.cc. References EventBase::activateETID, BehaviorBase::DoStart(), erouter, getName(), issetup, parent, EventRouter::postEvent(), setup(), EventBase::stateMachineEGID, transitions, and transitionTo(). |
Here is the call graph for this function:

|
|
Transitions should call this when you are leaving the state, so it can disable its transitions. for(int i=0; i<1000; i++) Reimplemented from BehaviorBase. Reimplemented in BanditMachine, BanditMachine::PressNode, BanditMachine::WaitNode, ExploreMachine, WalkToTargetMachine, WorldModel2Behavior, WorldModel2Behavior::WalkNode, WorldModel2Behavior::GawkNode, WorldModel2Behavior::WaitNode, and WalkNode. Definition at line 35 of file StateNode.cc. References ASSERT, EventBase::deactivateETID, BehaviorBase::DoStop(), erouter, getName(), issetup, nodes, EventRouter::postEvent(), retain, EventBase::stateMachineEGID, teardown(), and transitions. |
Here is the call graph for this function:

|
|
returns name again (you should override this for top-level nodes to give users better descriptions)
Reimplemented from BehaviorBase. Definition at line 59 of file StateNode.h. References name. |
|
|
returns name of StateNode
Implements BehaviorBase. Definition at line 56 of file StateNode.h. References name. |
|
|
Returns the std::vector of nodes so you can modify them yourself if need be.
Definition at line 35 of file StateNode.h. References nodes. |
|
|
Returns the std::vector of transitions so you can modify them yourself if need be.
Definition at line 29 of file StateNode.h. References transitions. |
|
|
don't call this
|
|
|
set name to n. Makes a copy of n, so you can throw it away later.
Definition at line 73 of file StateNode.cc. References name. |
|
|
Sets the retain flag - if not retained, will RemoveReference() subnodes upon DoStop() and recreate them on DoStart (by calling setup()) - may be too expensive to be worth saving memory...
Definition at line 38 of file StateNode.h. References retain. |
|
|
This is called by DoStart() when you should setup the network of subnodes.
Reimplemented in BanditMachine, ExploreMachine, WalkToTargetMachine, and WorldModel2Behavior. Definition at line 44 of file StateNode.h. References issetup. |
|
|
This is called by DoStop() when you should destruct subnodes.
Reimplemented in ExploreMachine, and WalkNode. Definition at line 50 of file StateNode.h. References issetup. |
|
|
called by a subnode when it is being DoStop()'ed
Definition at line 81 of file StateNode.cc. |
|
|
called by a subnode when it is being DoStart()'ed
Definition at line 77 of file StateNode.cc. |
|
|
this is set to true if the network has been setup but not destroyed (i.e. don't need to call setupSubNodes again)
Definition at line 76 of file StateNode.h. |
|
|
holds the name of the Node/Machine
Definition at line 84 of file StateNode.h. |
|
|
vector of StateNodes, just so they can be dereferenced again on DoStop() (unless retained) or ~StateNode()
Definition at line 80 of file StateNode.h. |
|
|
pointer to the machine that contains this node
Definition at line 70 of file StateNode.h. |
|
|
this is set to true if the network should be retained between activations. Otherwise it's dereferenced upon DoStop(). (or at least RemoveReference() is called on subnodes)
Definition at line 78 of file StateNode.h. |
|
|
a vector of outgoing transitions
Definition at line 72 of file StateNode.h. |
|
Tekkotsu v1.5 |
Generated Fri Oct 10 15:57:53 2003 by Doxygen 1.3.4 |