Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

BehaviorSwitchControlBase Class Reference

#include <BehaviorSwitchControl.h>

Inheritance diagram for BehaviorSwitchControlBase:

List of all members.


Detailed Description

Holds some utility classes and functions for BehaviorSwitchControl which shouldn't be stored in a templated class.

Definition at line 13 of file BehaviorSwitchControl.h.


Public Member Functions

 BehaviorSwitchControlBase (const std::string &n, BehaviorBase *beh, BehaviorGroup *bg=NULL)
 constructor
 BehaviorSwitchControlBase (BehaviorBase *beh, BehaviorGroup *bg=NULL)
 constructor, behavior must not be NULL
virtual ~BehaviorSwitchControlBase ()
 destructor
virtual BehaviorSwitchControlBasestart ()
 activates the behavior, handy for making start-up behaviors that you can turn off again with the Controller
virtual BehaviorSwitchControlBasestop ()
 stops the behavior
virtual BehaviorSwitchControlBasetoggle ()
 toggles the behavior
virtual ControlBasetakeInput (const std::string &msg)
 called when the user has supplied a text string (may or may not have been prompted by doReadStdIn()! May not even be active yet - the user can direct the same input to a set of hilighted menus)
virtual ControlBaseactivate (MotionManager::MC_ID display, Socket *gui)
 tells the current behavior (if there is one) to stop then loads its own
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
virtual bool isRunning () const
 Returns true if the associated behavior is running.

Protected Member Functions

virtual void stopother ()
 Stops the "other" guy's behavior - if behgrp is NULL, stops ourselves.
virtual void startmine ()
 Starts our behavior.
virtual void notifyGroupMembers ()
 updates other members in the group that the current behavior stopped -- do not call if behgrp is NULL
virtual void behaviorStopped ()
 called by notifyGroupMembers if mybeh was destructed when stopped

Protected Attributes

BehaviorGroupbehgrp
 the behavior group this belongs to. Uses this to track the "current" behavior
BehaviorBasemybeh
 used to store the behavior. If retained and non-NULL, will be valid. However, if not retained, only valid if equals behgrp->curBehavior

Private Member Functions

 BehaviorSwitchControlBase (const BehaviorSwitchControlBase &)
 shouldn't copy these
BehaviorSwitchControlBase operator= (const BehaviorSwitchControlBase &)
 shouldn't assign these

Classes

class  BehaviorGroup
 A simple utility class to allow the BehaviorSwitchControl's to be able to deactivate the current behavior when a new one becomes active. More...

Constructor & Destructor Documentation

BehaviorSwitchControlBase::BehaviorSwitchControlBase ( const std::string &  n,
BehaviorBase beh,
BehaviorGroup bg = NULL 
) [inline]

constructor

Definition at line 34 of file BehaviorSwitchControl.h.

BehaviorSwitchControlBase::BehaviorSwitchControlBase ( BehaviorBase beh,
BehaviorGroup bg = NULL 
) [inline]

constructor, behavior must not be NULL

Definition at line 55 of file BehaviorSwitchControl.h.

virtual BehaviorSwitchControlBase::~BehaviorSwitchControlBase (  )  [inline, virtual]

destructor

Definition at line 74 of file BehaviorSwitchControl.h.

BehaviorSwitchControlBase::BehaviorSwitchControlBase ( const BehaviorSwitchControlBase  )  [private]

shouldn't copy these


Member Function Documentation

virtual BehaviorSwitchControlBase* BehaviorSwitchControlBase::start (  )  [inline, virtual]

activates the behavior, handy for making start-up behaviors that you can turn off again with the Controller

If you start twice without stopping (ie it's already running), shouldn't do anything

Definition at line 89 of file BehaviorSwitchControl.h.

Referenced by BehaviorSwitchActivatorControl::activate(), and Aibo3DControllerBehavior::DoStart().

virtual BehaviorSwitchControlBase* BehaviorSwitchControlBase::stop (  )  [inline, virtual]

virtual BehaviorSwitchControlBase* BehaviorSwitchControlBase::toggle (  )  [inline, virtual]

toggles the behavior

Definition at line 95 of file BehaviorSwitchControl.h.

Referenced by activate(), and BehaviorSwitchActivatorControl::activate().

virtual ControlBase* BehaviorSwitchControlBase::takeInput ( const std::string &  msg  )  [inline, virtual]

called when the user has supplied a text string (may or may not have been prompted by doReadStdIn()! May not even be active yet - the user can direct the same input to a set of hilighted menus)

The value which is returned is then activate()ed and pushed on the Controller's stack

Reimplemented from ControlBase.

Definition at line 97 of file BehaviorSwitchControl.h.

virtual ControlBase* BehaviorSwitchControlBase::activate ( MotionManager::MC_ID  display,
Socket gui 
) [inline, virtual]

tells the current behavior (if there is one) to stop then loads its own

Returns:
NULL unless there are submenus

Reimplemented from ControlBase.

Definition at line 108 of file BehaviorSwitchControl.h.

virtual std::string BehaviorSwitchControlBase::getName (  )  const [inline, virtual]

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

Reimplemented from ControlBase.

Reimplemented in BehaviorSwitchControl< B, Al >.

Definition at line 117 of file BehaviorSwitchControl.h.

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

virtual std::string BehaviorSwitchControlBase::getDescription (  )  const [inline, virtual]

returns a short description of what the control does

Reimplemented from ControlBase.

Reimplemented in BehaviorSwitchControl< B, Al >.

Definition at line 122 of file BehaviorSwitchControl.h.

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

virtual bool BehaviorSwitchControlBase::isRunning (  )  const [inline, virtual]

Returns true if the associated behavior is running.

Reimplemented in BehaviorSwitchControl< B, Al >.

Definition at line 129 of file BehaviorSwitchControl.h.

Referenced by Aibo3DControllerBehavior::DoStart(), BehaviorSwitchControl< B, Al >::isRunning(), start(), stop(), takeInput(), and toggle().

virtual void BehaviorSwitchControlBase::stopother (  )  [inline, protected, virtual]

Stops the "other" guy's behavior - if behgrp is NULL, stops ourselves.

Definition at line 138 of file BehaviorSwitchControl.h.

Referenced by BehaviorSwitchControl< B, Al >::isRunning(), start(), stop(), and toggle().

virtual void BehaviorSwitchControlBase::startmine (  )  [inline, protected, virtual]

Starts our behavior.

Reimplemented in BehaviorSwitchControl< B, Al >.

Definition at line 154 of file BehaviorSwitchControl.h.

Referenced by start(), takeInput(), and toggle().

virtual void BehaviorSwitchControlBase::notifyGroupMembers (  )  [inline, protected, virtual]

updates other members in the group that the current behavior stopped -- do not call if behgrp is NULL

Definition at line 161 of file BehaviorSwitchControl.h.

Referenced by BehaviorSwitchControlBase(), and stopother().

virtual void BehaviorSwitchControlBase::behaviorStopped (  )  [inline, protected, virtual]

called by notifyGroupMembers if mybeh was destructed when stopped

Reimplemented in BehaviorSwitchControl< B, Al >.

Definition at line 167 of file BehaviorSwitchControl.h.

Referenced by stopother().

BehaviorSwitchControlBase BehaviorSwitchControlBase::operator= ( const BehaviorSwitchControlBase  )  [private]

shouldn't assign these


Member Data Documentation


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

Tekkotsu v4.0
Generated Thu Nov 22 00:58:11 2007 by Doxygen 1.5.4