BehaviorBase Class Reference#include <BehaviorBase.h>
Inheritance diagram for BehaviorBase:
[legend]List of all members.
Detailed Description
The basis from which all other Behaviors should inherit.
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 (RemoveReference()), and thus may deletex if zero; Don't forget to 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 on an individual basis) By default simply returns getClassDescription().
|
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 & Destructor Documentation
BehaviorBase::BehaviorBase |
( |
|
) |
[inline] |
|
BehaviorBase::BehaviorBase |
( |
const BehaviorBase & |
b |
) |
[inline] |
|
|
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. |
Member Function Documentation
virtual void BehaviorBase::DoStart |
( |
|
) |
[inline, virtual] |
|
|
By default, merely adds to the reference counter (through AddReference()); Note you should still call this from your overriding methods.
Reimplemented in Controller, FreeMemReportControl, AlanBehavior, AutoGetupBehavior, BanditMachine, BanditMachine::PressNode, BanditMachine::DecideNode, BanditMachine::WaitNode, BatteryMonitorBehavior, CameraBehavior, ChaseBallBehavior, CrashTestBehavior, DriveMeBehavior, ExploreMachine, FollowHeadBehavior, HeadLevelBehavior, HelloWorldBehavior, MCRepeater, PaceTargetsMachine, RelaxBehavior, SimpleChaseBallBehavior, SoundTestBehavior, StareAtBallBehavior, ToggleHeadLightBehavior, WalkToTargetMachine, WorldStateVelDaemon, Aibo3DControllerBehavior, EStopControllerBehavior, HeadPointControllerBehavior, RawCamBehavior, SegCamBehavior, ViewWMVarsBehavior, WalkControllerBehavior, WMMonitorBehavior, WorldStateSerializerBehavior, GroupNode, OutputNode, PlayMotionSequenceNode< SIZE >, WalkNode, StateNode, CompareTrans< T >, SmoothCompareTrans< T >, TimeOutTrans, VisualTargetCloseTrans, VisualTargetTrans, EventGeneratorBase, and StartupBehavior.
Definition at line 30 of file BehaviorBase.h.
Referenced by BehaviorActivatorControl::activate(), BehaviorSwitchControl< B, Al >::BehaviorSwitchControl(), WorldStateVelDaemon::DoStart(), WorldStateSerializerBehavior::DoStart(), WMMonitorBehavior::DoStart(), WalkControllerBehavior::DoStart(), VisualTargetTrans::DoStart(), VisualTargetCloseTrans::DoStart(), ViewWMVarsBehavior::DoStart(), ToggleHeadLightBehavior::DoStart(), TimeOutTrans::DoStart(), StateNode::DoStart(), StartupBehavior::DoStart(), StareAtBallBehavior::DoStart(), SoundTestBehavior::DoStart(), SimpleChaseBallBehavior::DoStart(), SegCamBehavior::DoStart(), RelaxBehavior::DoStart(), RawCamBehavior::DoStart(), MCRepeater::DoStart(), HelloWorldBehavior::DoStart(), HeadPointControllerBehavior::DoStart(), HeadLevelBehavior::DoStart(), FreeMemReportControl::DoStart(), FollowHeadBehavior::DoStart(), EventGeneratorBase::DoStart(), EStopControllerBehavior::DoStart(), DriveMeBehavior::DoStart(), CrashTestBehavior::DoStart(), Controller::DoStart(), CompareTrans< T >::DoStart(), ChaseBallBehavior::DoStart(), CameraBehavior::DoStart(), BatteryMonitorBehavior::DoStart(), AutoGetupBehavior::DoStart(), AlanBehavior::DoStart(), Aibo3DControllerBehavior::DoStart(), BehaviorSwitchControl< B, Al >::startmine(), and BehaviorSwitchControlBase::startmine(). |
virtual void BehaviorBase::DoStop |
( |
|
) |
[inline, virtual] |
|
|
By default, subtracts from the reference counter (RemoveReference()), and thus may deletex if zero; Don't forget to still call this when you override this; Warning: call this at the end of your DoStop(), not beginning (it might delete this ).
Reimplemented in Controller, FreeMemReportControl, AlanBehavior, AutoGetupBehavior, BanditMachine, BanditMachine::PressNode, BanditMachine::WaitNode, BatteryMonitorBehavior, CameraBehavior, ChaseBallBehavior, DriveMeBehavior, ExploreMachine, FollowHeadBehavior, HeadLevelBehavior, MCRepeater, RelaxBehavior, SimpleChaseBallBehavior, SoundTestBehavior, StareAtBallBehavior, ToggleHeadLightBehavior, WalkToTargetMachine, WorldStateVelDaemon, Aibo3DControllerBehavior, EStopControllerBehavior, HeadPointControllerBehavior, RawCamBehavior, SegCamBehavior, ViewWMVarsBehavior, WalkControllerBehavior, WMMonitorBehavior, WorldStateSerializerBehavior, PlayMotionSequenceNode< SIZE >, WalkNode, StateNode, CompareTrans< T >, TimeOutTrans, VisualTargetCloseTrans, VisualTargetTrans, EventGeneratorBase, and StartupBehavior.
Definition at line 39 of file BehaviorBase.h.
Referenced by BehaviorActivatorControl::activate(), HelloWorldBehavior::DoStart(), WorldStateVelDaemon::DoStop(), WorldStateSerializerBehavior::DoStop(), WMMonitorBehavior::DoStop(), WalkControllerBehavior::DoStop(), VisualTargetTrans::DoStop(), VisualTargetCloseTrans::DoStop(), ViewWMVarsBehavior::DoStop(), TimeOutTrans::DoStop(), StateNode::DoStop(), StartupBehavior::DoStop(), StareAtBallBehavior::DoStop(), SoundTestBehavior::DoStop(), SimpleChaseBallBehavior::DoStop(), SegCamBehavior::DoStop(), RelaxBehavior::DoStop(), RawCamBehavior::DoStop(), MCRepeater::DoStop(), HeadPointControllerBehavior::DoStop(), HeadLevelBehavior::DoStop(), FreeMemReportControl::DoStop(), FollowHeadBehavior::DoStop(), EventGeneratorBase::DoStop(), EStopControllerBehavior::DoStop(), DriveMeBehavior::DoStop(), Controller::DoStop(), CompareTrans< T >::DoStop(), ChaseBallBehavior::DoStop(), CameraBehavior::DoStop(), BatteryMonitorBehavior::DoStop(), AutoGetupBehavior::DoStop(), AlanBehavior::DoStop(), Aibo3DControllerBehavior::DoStop(), BehaviorSwitchControl< B, Al >::stopother(), BehaviorSwitchControlBase::stopother(), ~BehaviorBase(), and BehaviorSwitchControlBase::BehaviorGroup::~BehaviorGroup(). |
std::string BehaviorBase::getClassDescription |
( |
|
) |
[inline, static] |
|
|
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(). |
virtual std::string BehaviorBase::getDescription |
( |
|
) |
const [inline, virtual] |
|
virtual std::string BehaviorBase::getName |
( |
|
) |
const [pure virtual] |
|
|
Identifies the behavior in menus and such.
Implemented in Controller, FreeMemReportControl, AlanBehavior, AutoGetupBehavior, BatteryMonitorBehavior, CameraBehavior, ChaseBallBehavior, CrashTestBehavior, DriveMeBehavior, FollowHeadBehavior, HeadLevelBehavior, HelloWorldBehavior, MCRepeater, RelaxBehavior, SimpleChaseBallBehavior, SoundTestBehavior, StareAtBallBehavior, ToggleHeadLightBehavior, WorldStateVelDaemon, Aibo3DControllerBehavior, EStopControllerBehavior, HeadPointControllerBehavior, RawCamBehavior, SegCamBehavior, ViewWMVarsBehavior, WalkControllerBehavior, WMMonitorBehavior, WorldStateSerializerBehavior, StateNode, CompareTrans< T >, SmoothCompareTrans< T >, TimeOutTrans, VisualTargetCloseTrans, VisualTargetTrans, EventGeneratorBase, and StartupBehavior.
Referenced by BehaviorSwitchControlBase::getName(). |
virtual bool BehaviorBase::isActive |
( |
|
) |
const [inline, virtual] |
|
|
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=(). |
virtual void BehaviorBase::processEvent |
( |
const EventBase & |
|
) |
[inline, virtual] |
|
|
By defining here, allows you to get away with not supplying a processEvent() function for the EventListener interface. By default, does nothing.
Implements EventListener.
Reimplemented in Controller, FreeMemReportControl, AlanBehavior, AutoGetupBehavior, BanditMachine::WaitNode, BatteryMonitorBehavior, CameraBehavior, ChaseBallBehavior, DriveMeBehavior, ExploreMachine, FollowHeadBehavior, HeadLevelBehavior, MCRepeater, SimpleChaseBallBehavior, SoundTestBehavior, StareAtBallBehavior, WalkToTargetMachine, WorldStateVelDaemon, EStopControllerBehavior, HeadPointControllerBehavior, RawCamBehavior, SegCamBehavior, WalkControllerBehavior, WMMonitorBehavior, WorldStateSerializerBehavior, PlayMotionSequenceNode< SIZE >, CompareTrans< T >, SmoothCompareTrans< T >, TimeOutTrans, VisualTargetCloseTrans, VisualTargetTrans, StartupBehavior, BallDetectionGenerator, CDTGenerator, FilterBankGenerator, InterleavedYUVGenerator, JPEGGenerator, RawCameraGenerator, RegionGenerator, RLEGenerator, and SegmentedColorGenerator.
Definition at line 48 of file BehaviorBase.h. |
Member Data Documentation
The documentation for this class was generated from the following file:
|