Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

MCNode< T, mcName, mcDesc, completes > Class Template Reference

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(). More...

#include <MCNode.h>

Inheritance diagram for MCNode< T, mcName, mcDesc, completes >:

Detailed Description

template<class T, const char * mcName = MCNodeBase::defName, const char * mcDesc = MCNodeBase::defDesc, bool completes = true>
class MCNode< T, mcName, mcDesc, completes >

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().

Definition at line 81 of file MCNode.h.

List of all members.

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)

Constructor & Destructor Documentation

template<class T, const char * mcName = MCNodeBase::defName, const char * mcDesc = MCNodeBase::defDesc, bool completes = true>
MCNode< T, mcName, mcDesc, completes >::MCNode (  ) 

default constructor

Definition at line 84 of file MCNode.h.

template<class T, const char * mcName = MCNodeBase::defName, const char * mcDesc = MCNodeBase::defDesc, bool completes = true>
MCNode< T, mcName, mcDesc, completes >::MCNode ( const std::string &  nm  )  [explicit]

constructor, take an instance name

Definition at line 89 of file MCNode.h.

template<class T, const char * mcName = MCNodeBase::defName, const char * mcDesc = MCNodeBase::defDesc, bool completes = true>
MCNode< T, mcName, mcDesc, completes >::MCNode ( const char *  nm  )  [explicit]

constructor, take an instance name

Definition at line 94 of file MCNode.h.

template<class T, const char * mcName = MCNodeBase::defName, const char * mcDesc = MCNodeBase::defDesc, bool completes = true>
virtual MCNode< T, mcName, mcDesc, completes >::~MCNode (  )  [virtual]

destructor

Definition at line 99 of file MCNode.h.

template<class T, const char * mcName = MCNodeBase::defName, const char * mcDesc = MCNodeBase::defDesc, bool completes = true>
MCNode< T, mcName, mcDesc, completes >::MCNode ( bool  subCompletes  )  [explicit, protected]

Definition at line 115 of file MCNode.h.

template<class T, const char * mcName = MCNodeBase::defName, const char * mcDesc = MCNodeBase::defDesc, bool completes = true>
MCNode< T, mcName, mcDesc, completes >::MCNode ( const std::string &  nm,
bool  subCompletes 
) [protected]

constructor, take an instance name

Definition at line 118 of file MCNode.h.


Member Function Documentation

template<class T, const char * mcName = MCNodeBase::defName, const char * mcDesc = MCNodeBase::defDesc, bool completes = true>
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().

template<class T, const char * mcName = MCNodeBase::defName, const char * mcDesc = MCNodeBase::defDesc, bool completes = true>
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.

Definition at line 112 of file MCNode.h.

template<class T , const char * mcName, const char * mcDesc, bool completes>
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().

template<class T , const char * mcName, const char * mcDesc, bool completes>
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().

template<class T , const char * mcName, const char * mcDesc, bool completes>
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 >.

Definition at line 153 of file MCNode.h.

template<class T , const char * mcName, const char * mcDesc, bool completes>
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.

Definition at line 147 of file MCNode.h.


The documentation for this class was generated from the following file:

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:12 2016 by Doxygen 1.6.3