Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
MCNode< T, mcName, mcDesc, completes > Class Template ReferenceA generic wrapper for any MotionCommand. Note that some functions are provided by the MCNodeBase common base class, namely MCNodeBase::setMC() and MCNodeBase::getMC_ID(). More...
Inheritance diagram for MCNode< T, mcName, mcDesc, completes >:
Detailed Descriptiontemplate<class T, const char * mcName = MCNodeBase::defName, const char * mcDesc = MCNodeBase::defDesc, bool completes = true>
|
Public Member Functions | |
MCNode () | |
default constructor | |
MCNode (const std::string &nm) | |
constructor, take an instance name | |
MCNode (const char *nm) | |
constructor, take an instance name | |
virtual | ~MCNode () |
destructor | |
virtual MMAccessor< T > | getMC () |
reveal the MotionCommand through an MMAccessor | |
virtual void | preStart () |
Adds the motion command to the motion manager, but stops it from running until the user has a chance to program it. | |
virtual void | postStart () |
Adds a listener and then starts the motion command. | |
virtual std::string | getDescription () const |
Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis). | |
Static Public Member Functions | |
static std::string | getClassDescription () |
Gives a short description of what this class of behaviors does... you should override this (but don't have to). | |
Protected Member Functions | |
MCNode (bool subCompletes) | |
MCNode (const std::string &nm, bool subCompletes) | |
constructor, take an instance name | |
virtual SharedObject< T > & | getPrivateMC () |
returns reference to mc or a new SharedObject<T> if mc is currently NULL (so it will always return a valid value) |
static std::string MCNode< T, mcName, mcDesc, completes >::getClassDescription | ( | ) | [static] |
Gives a short description of what this class of behaviors does... you should override this (but don't have to).
If you do override this, also consider overriding getDescription() to return it
Reimplemented from MCNodeBase.
Reimplemented in LedNode.
Definition at line 111 of file MCNode.h.
Referenced by MCNode< ArmMC, defArmNodeName, defArmNodeDesc, true >::getDescription().
virtual std::string MCNode< T, mcName, mcDesc, completes >::getDescription | ( | ) | const [virtual] |
Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).
By default simply returns getName(), because any calls from a BehaviorBase function to getClassDescription() are going to call BehaviorBase::getClassDescription(), not ~YourSubClass~getClassDescription(), because static functions can't be virtual in C++ (doh!)
This means that getDescription called on a pointer to a BehaviorBase of unknown subtype would always return an empty string, which is pretty useless. So instead we return the name in this situation. If you want getDescription to return getClassDescription, you'll have to override it in your subclass to do so.
Reimplemented from MCNodeBase.
Reimplemented in LedNode.
MMAccessor< T > MCNode< T, mcName, mcDesc, completes >::getMC | ( | ) | [virtual] |
reveal the MotionCommand through an MMAccessor
This is a no-op if the motion command hasn't been added to motion manager yet, and enforces mutual exclusion if it has
Definition at line 129 of file MCNode.h.
Referenced by MCNode< T, mcName, mcDesc, completes >::postStart(), and MCNode< T, mcName, mcDesc, completes >::preStart().
SharedObject< T > & MCNode< T, mcName, mcDesc, completes >::getPrivateMC | ( | ) | [protected, virtual] |
returns reference to mc or a new SharedObject<T> if mc is currently NULL (so it will always return a valid value)
if a particular motion command needs some initial setup besides the default constructor, overriding this function is a good opportunity to do so
Implements MCNodeBase.
Reimplemented in LedNode.
Definition at line 140 of file MCNode.h.
Referenced by MCNode< T, mcName, mcDesc, completes >::getMC(), and MCNode< T, mcName, mcDesc, completes >::postStart().
void MCNode< T, mcName, mcDesc, completes >::postStart | ( | ) | [virtual] |
Adds a listener and then starts the motion command.
Reimplemented from BehaviorBase.
Reimplemented in DynamicMotionSequenceNode, MotionSequenceNode< SIZE >, WalkNode, and WaypointEngineNode< W, mcName, mcDesc >.
void MCNode< T, mcName, mcDesc, completes >::preStart | ( | ) | [virtual] |
Adds the motion command to the motion manager, but stops it from running until the user has a chance to program it.
Reimplemented from BehaviorBase.
Reimplemented in DynamicMotionSequenceNode, MotionSequenceNode< SIZE >, PIDNode, PostureNode, WalkNode, and DualCoding::Pilot::SetOdometryMachine::TurnHead.
Tekkotsu v5.1CVS |
Generated Mon May 9 04:59:12 2016 by Doxygen 1.6.3 |