Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

BehaviorSwitchControlBase Class Reference

#include <BehaviorSwitchControl.h>

Inheritance diagram for BehaviorSwitchControlBase:

Inheritance graph
[legend]
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...


Member Function Documentation

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

Definition at line 108 of file BehaviorSwitchControl.h.

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


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

Tekkotsu v3.0
Generated Fri May 11 20:07:46 2007 by Doxygen 1.4.7