Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
MCNode< T, mcName, mcDesc, completes > Class Template Reference#include <MCNode.h>
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>
A generic wrapper for any MotionCommand, note that some functions are provided by the MCNodeBase common base class, namely MCNodeBase::setMC() and MCNodeBase::getMC_ID().
|
Public Member Functions | |
MCNode () | |
default constructor, use type name as instance name | |
MCNode (const std::string &nm) | |
constructor, take an instance name | |
virtual | ~MCNode () |
destructor | |
virtual MMAccessor< T > | getMC () |
reveal the MotionCommand through an MMAccessor | |
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 (const std::string &class_name, const std::string &node_name) | |
constructor for subclasses (which would need to provide a different class 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) |
MMAccessor< T > MCNode< T, mcName, mcDesc, completes >::getMC | ( | ) | [inline, 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 99 of file MCNode.h.
Referenced by WalkEngineNode< W, mcName, mcDesc >::updateWMC().
static std::string MCNode< T, mcName, mcDesc, completes >::getClassDescription | ( | ) | [inline, 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 81 of file MCNode.h.
Referenced by MCNode< HeadPointerMC, defHeadPointerNodeName, defHeadPointerNodeDesc, true >::getDescription().
virtual std::string MCNode< T, mcName, mcDesc, completes >::getDescription | ( | ) | const [inline, 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.
SharedObject< T > & MCNode< T, mcName, mcDesc, completes >::getPrivateMC | ( | ) | [inline, 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 110 of file MCNode.h.
Referenced by MCNode< T, mcName, mcDesc, completes >::getMC(), and LedNode::getPrivateMC().
Tekkotsu v4.0 |
Generated Thu Nov 22 00:58:31 2007 by Doxygen 1.5.4 |