Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

BehaviorSwitchControl< B, Al > Class Template Reference

Allows proper switching between major behaviors, calling doStart and doStop. More...

#include <BehaviorSwitchControl.h>

Inheritance diagram for BehaviorSwitchControl< B, Al >:

Detailed Description

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
class BehaviorSwitchControl< B, Al >

Allows proper switching between major behaviors, calling doStart and doStop.

Definition at line 119 of file BehaviorSwitchControl.h.

List of all members.

Public Member Functions

 BehaviorSwitchControl (const std::string &n, bool retain=false)
 constructor, can use this to toggle a single behavior on and off
 BehaviorSwitchControl (B *beh, BehaviorGroup *bg=NULL)
 constructor, if you want to use an already constructed behavior
 BehaviorSwitchControl (const std::string &n, B *beh, BehaviorGroup *bg=NULL, bool retain=false)
 constructor, if you want to use an already constructed behavior, but unretain it if it's stopped (if not retaining, will start beh if it's not already started)
 BehaviorSwitchControl (const std::string &n, BehaviorGroup *bg, bool retain=false)
 constructor, needs to know what group its in and whether to retain its behavior
virtual ~BehaviorSwitchControl ()
 destructor
virtual std::string getName () const
 adds a status to the name: - if in memory, # if running
virtual std::string getDescription () const
 returns a short description of what the control does

Protected Member Functions

virtual void startmine ()
 Starts our behavior.
virtual bool isRunning () const
 adds a check to see if behavior has stopped itself -- if so, remove startref
virtual bool isValid () const
 Returns true if mybeh is pointing to a valid object.
virtual void behaviorStopped ()
 called by notifyGroupMembers if mybeh was destructed when stopped

Protected Attributes

bool retained
 true if the behavior should be generated once and retained after doStop. Otherwise, a new one is generated each time it is started
BehaviorBasestartref
 true if a reference was added (and still current) from calling doStart

Private Member Functions

 BehaviorSwitchControl (const BehaviorSwitchControl &)
 shouldn't call this
BehaviorSwitchControl operator= (const BehaviorSwitchControl &)
 shouldn't call this

Constructor & Destructor Documentation

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
BehaviorSwitchControl< B, Al >::BehaviorSwitchControl ( const std::string &  n,
bool  retain = false 
)

constructor, can use this to toggle a single behavior on and off

Definition at line 122 of file BehaviorSwitchControl.h.

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
BehaviorSwitchControl< B, Al >::BehaviorSwitchControl ( B *  beh,
BehaviorGroup bg = NULL 
)

constructor, if you want to use an already constructed behavior

Definition at line 126 of file BehaviorSwitchControl.h.

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
BehaviorSwitchControl< B, Al >::BehaviorSwitchControl ( const std::string &  n,
B *  beh,
BehaviorGroup bg = NULL,
bool  retain = false 
)

constructor, if you want to use an already constructed behavior, but unretain it if it's stopped (if not retaining, will start beh if it's not already started)

Definition at line 130 of file BehaviorSwitchControl.h.

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
BehaviorSwitchControl< B, Al >::BehaviorSwitchControl ( const std::string &  n,
BehaviorGroup bg,
bool  retain = false 
)

constructor, needs to know what group its in and whether to retain its behavior

Definition at line 142 of file BehaviorSwitchControl.h.

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
virtual BehaviorSwitchControl< B, Al >::~BehaviorSwitchControl (  )  [virtual]

destructor

Definition at line 147 of file BehaviorSwitchControl.h.

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
BehaviorSwitchControl< B, Al >::BehaviorSwitchControl ( const BehaviorSwitchControl< B, Al > &   )  [private]

shouldn't call this


Member Function Documentation

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
virtual void BehaviorSwitchControl< B, Al >::behaviorStopped (  )  [protected, virtual]

called by notifyGroupMembers if mybeh was destructed when stopped

Reimplemented from BehaviorSwitchControlBase.

Definition at line 204 of file BehaviorSwitchControl.h.

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
virtual std::string BehaviorSwitchControl< B, Al >::getDescription (  )  const [virtual]

returns a short description of what the control does

Reimplemented from BehaviorSwitchControlBase.

Definition at line 161 of file BehaviorSwitchControl.h.

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
virtual std::string BehaviorSwitchControl< B, Al >::getName (  )  const [virtual]

adds a status to the name: - if in memory, # if running

Reimplemented from BehaviorSwitchControlBase.

Definition at line 155 of file BehaviorSwitchControl.h.

Referenced by BehaviorSwitchControl< B, Al >::startmine().

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
virtual bool BehaviorSwitchControl< B, Al >::isRunning (  )  const [protected, virtual]

adds a check to see if behavior has stopped itself -- if so, remove startref

Reimplemented from BehaviorSwitchControlBase.

Definition at line 189 of file BehaviorSwitchControl.h.

Referenced by BehaviorSwitchControl< B, Al >::isValid().

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
virtual bool BehaviorSwitchControl< B, Al >::isValid (  )  const [protected, virtual]

Returns true if mybeh is pointing to a valid object.

Definition at line 198 of file BehaviorSwitchControl.h.

Referenced by BehaviorSwitchControl< B, Al >::getDescription(), and BehaviorSwitchControl< B, Al >::getName().

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
BehaviorSwitchControl BehaviorSwitchControl< B, Al >::operator= ( const BehaviorSwitchControl< B, Al > &   )  [private]

shouldn't call this

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
virtual void BehaviorSwitchControl< B, Al >::startmine (  )  [protected, virtual]

Starts our behavior.

Reimplemented from BehaviorSwitchControlBase.

Definition at line 170 of file BehaviorSwitchControl.h.

Referenced by BehaviorSwitchControl< B, Al >::BehaviorSwitchControl().


Member Data Documentation

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
bool BehaviorSwitchControl< B, Al >::retained [protected]

true if the behavior should be generated once and retained after doStop. Otherwise, a new one is generated each time it is started

Definition at line 213 of file BehaviorSwitchControl.h.

Referenced by BehaviorSwitchControl< B, Al >::behaviorStopped(), BehaviorSwitchControl< B, Al >::BehaviorSwitchControl(), BehaviorSwitchControl< B, Al >::isValid(), BehaviorSwitchControl< B, Al >::startmine(), and BehaviorSwitchControl< B, Al >::~BehaviorSwitchControl().

template<class B, class Al = typename Factory0Arg<B>::template Factory<B>>
BehaviorBase* BehaviorSwitchControl< B, Al >::startref [protected]

true if a reference was added (and still current) from calling doStart

Definition at line 214 of file BehaviorSwitchControl.h.

Referenced by BehaviorSwitchControl< B, Al >::behaviorStopped(), BehaviorSwitchControl< B, Al >::isRunning(), and BehaviorSwitchControl< B, Al >::startmine().


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

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