Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

ArActionGroup Class Reference

Class for groups of actions to accomplish one thing. More...

#include <ArActionGroup.h>

Inheritance diagram for ArActionGroup:

ArActionGroupColorFollow ArActionGroupInput ArActionGroupRatioDrive ArActionGroupRatioDriveUnsafe ArActionGroupStop ArActionGroupTeleop ArActionGroupUnguardedTeleop ArActionGroupWander List of all members.

Public Member Functions

virtual void activate (void)
 Activates all the actions in this group.
virtual void activateExclusive (void)
 Activates all the actions in this group and deactivates all others.
virtual void addAction (ArAction *action, int priority)
 Adds the action to the robot this group uses with the given priority.
 ArActionGroup (ArRobot *robot)
 Constructor.
virtual void deactivate (void)
 Deactivates all the actions in this group.
virtual std::list< ArAction * > * getActionList (void)
 Gets the action list (use this to delete actions after doing removeActions).
virtual void remAction (ArAction *action)
 Removes the action from the robot this group uses.
virtual void removeActions (void)
 Removes all the actions in this group from the robot.
virtual ~ArActionGroup ()
 Destructor, it also deletes the actions in its group.

Protected Attributes

std::list< ArAction * > myActions
ArRobotmyRobot

Detailed Description

Class for groups of actions to accomplish one thing.

This class is used to have a group of ArActions and turn them on and off in aggregate... this is so that you can say have a group of like 5 behaviors for teleop or wander, and just turn 'em all on and off at once. Note that the destructor by default will delete the actions added to the group, this is controlled with a flag to the constructor though, so you can have it how you want.... this is nice though so you can just do addAction(new ArActionWhatever(blah, blah, blah), 90); and not worry about the deletion (since the destructor will do it), just delete the group... if for some reason (I'd advise against it) you are using one action in multiple groups, don't use this feature, ie pass in false to the constructor for it or you'll wind up with a crash when the action is deleted by both groups (again, you should probably only have an action in one group).

Definition at line 54 of file ArActionGroup.h.


Constructor & Destructor Documentation

ArActionGroup::ArActionGroup ArRobot robot  ) 
 

Constructor.

Parameters:
robot The robot that this action group is attached to
deleteActionsOnDestruction if this is true then when the destructor is called the actions that this group has will be deleted

Definition at line 42 of file ArActionGroup.cpp.


Member Function Documentation

void ArActionGroup::addAction ArAction action,
int  priority
[virtual]
 

Adds the action to the robot this group uses with the given priority.

Parameters:
action the action to add to the robot
priority the priority to give the action
See also:
ArRobot::addAction

Definition at line 58 of file ArActionGroup.cpp.

References ArRobot::addAction(), and ArLog::log().

void ArActionGroup::remAction ArAction action  )  [virtual]
 

Removes the action from the robot this group uses.

Parameters:
action the action to remove from the robot
See also:
ArRobot::remAction

Definition at line 74 of file ArActionGroup.cpp.

References ArLog::log(), and ArRobot::remAction().


The documentation for this class was generated from the following files:
Generated on Wed Oct 19 12:56:40 2005 for Aria by  doxygen 1.4.0