Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
#include <BehaviorBase.h>
Inheritance diagram for BehaviorBase:
Makes use of ReferenceCounter so that behaviors can automatically delete themselves if wanted
Make sure your own DoStart and DoStop call BehaviorBase::DoStart (or Stop) to allow this behavior... otherwise you'll get memory leaks
Definition at line 12 of file BehaviorBase.h.
Public Member Functions | |
BehaviorBase () | |
constructor | |
BehaviorBase (const BehaviorBase &b) | |
copy constructor; assumes subclass handles copying approriately - i.e. if b is active, the copy will be as well, even though DoStart was never called.. | |
BehaviorBase & | operator= (const BehaviorBase &b) |
assignment operator; assumes subclass handles assignment appropriately - i.e. if b is active, the copy will be as well, even though DoStart was never called.. | |
virtual | ~BehaviorBase () |
destructor - if is active when deleted, will call DoStop() first | |
virtual void | DoStart () |
By default, merely adds to the reference counter (through AddReference()); Note you should still call this from your overriding methods. | |
virtual void | DoStop () |
By default, subtracts from the reference counter, and deletes if zero; Note you should still call this when you override this; Warning call this at the end of your DoStop(), not beginning (it might delete this ). | |
virtual void | processEvent (const EventBase &) |
By defining here, allows you to get away with not supplying a processEvent() function for the EventListener interface. By default, does nothing. | |
virtual std::string | getName () const =0 |
Identifies the behavior in menus and such. | |
virtual std::string | getDescription () const |
Gives a short description of what this particular instantiation does (in case a more specific description is needed). | |
virtual bool | isActive () const |
Returns true if the behavior is currently running. | |
Static Public Member Functions | |
std::string | getClassDescription () |
Gives a short description of what this class of behaviors does... you should override this (but don't have to). | |
Protected Attributes | |
bool | started |
true when the behavior is active |
|
constructor
Definition at line 15 of file BehaviorBase.h. |
|
copy constructor; assumes subclass handles copying approriately - i.e. if b is active, the copy will be as well, even though DoStart was never called..
Definition at line 17 of file BehaviorBase.h. |
|
destructor - if is active when deleted, will call DoStop() first
Definition at line 22 of file BehaviorBase.h. |
|
|
|
Gives a short description of what this class of behaviors does... you should override this (but don't have to).
Reimplemented in Controller, AlanBehavior, AutoGetupBehavior, BanditMachine, BatteryMonitorBehavior, CameraBehavior, ChaseBallBehavior, CrashTestBehavior, DriveMeBehavior, FollowHeadBehavior, HeadLevelBehavior, HelloWorldBehavior, MCRepeater, SoundTestBehavior, StareAtBallBehavior, ToggleHeadLightBehavior, WalkToTargetMachine, WorldStateVelDaemon, Aibo3DControllerBehavior, EStopControllerBehavior, HeadPointControllerBehavior, RawCamBehavior, SegCamBehavior, ViewWMVarsBehavior, WalkControllerBehavior, WMMonitorBehavior, WorldStateSerializerBehavior, StartupBehavior, BallDetectionGenerator, CDTGenerator, InterleavedYUVGenerator, JPEGGenerator, RawCameraGenerator, RegionGenerator, RLEGenerator, and SegmentedColorGenerator. Definition at line 65 of file BehaviorBase.h. Referenced by getDescription(). |
|
Gives a short description of what this particular instantiation does (in case a more specific description is needed).
Reimplemented in StateNode. Definition at line 68 of file BehaviorBase.h. Referenced by BehaviorSwitchControl< B, Al >::getDescription(), and BehaviorSwitchControlBase::getDescription(). |
|
|
Returns true if the behavior is currently running.
Definition at line 71 of file BehaviorBase.h. Referenced by BehaviorActivatorControl::activate(), BehaviorSwitchControl< B, Al >::BehaviorSwitchControl(), FreeMemReportControl::getName(), BehaviorSwitchControlBase::getName(), BehaviorSwitchControlBase::isRunning(), PlayMotionSequenceNode< SIZE >::setFile(), BehaviorSwitchControl< B, Al >::startmine(), BehaviorSwitchControl< B, Al >::stopother(), BehaviorSwitchControlBase::stopother(), FollowHeadBehavior::~FollowHeadBehavior(), and StateNode::~StateNode(). |
|
assignment operator; assumes subclass handles assignment appropriately - i.e. if b is active, the copy will be as well, even though DoStart was never called..
Definition at line 19 of file BehaviorBase.h. Referenced by Transition::operator=(). |
|
|
true when the behavior is active
Definition at line 74 of file BehaviorBase.h. Referenced by BehaviorBase(), DoStart(), DoStop(), isActive(), operator=(), and ~BehaviorBase(). |
Tekkotsu v2.0 |
Generated Wed Jan 21 03:23:04 2004 by Doxygen 1.3.4 |