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

ArMode Class Reference

#include <ArMode.h>

Inheritance diagram for ArMode:

ArModeActs ArModeCamera ArModeGripper ArModeSonar ArModeTCM2 ArModeTeleop ArModeUnguardedTeleop ArModeWander List of all members.

Detailed Description

A class for different modes, mostly as related to keyboard input.

Each mode is going to need to add its keys to the keyHandler... each mode should only use the keys 1-0, the arrow keys (movement), the space bar (stop), z (zoom in), x (zoom out), and e (exercise)... then when its activate is called by that key handler it needs to first deactivate the ourActiveMode (if its not itself, in which case its done) then add its key handling stuff... activate and deactivate will need to add and remove their user tasks (or call the base class activate/deactivate to do it) as well as the key handling things for their other part of modes. This mode will ALWAYS bind help to /, ?, h, and H when the first instance of an ArMode is made.


Public Member Functions

virtual void activate (void)=0
 The function called when the mode is activated, subclass must provide.
 ArMode (ArRobot *robot, const char *name, char key, char key2)
 Constructor.
bool baseActivate (void)
bool baseDeactivate (void)
virtual void deactivate (void)=0
 The function called when the mode is deactivated, subclass must provide.
char getKey (void)
 An internal function to get the first key this is bound to.
char getKey2 (void)
 An internal function to get the second key this is bound to.
const char * getName (void)
 Gets the name of the mode.
virtual void help (void)
 The mode's help print out... subclass must provide if needed.
virtual void userTask (void)
 The ArMode's user task, don't need one, subclass must provide if needed.
virtual ~ArMode ()
 Destructor.

Static Public Member Functions

static void baseHelp (void)
 This is the base help function, its internal, bound to ? and h and H.

Protected Member Functions

void addKeyHandler (int keyToHandle, ArFunctor *functor)
void remKeyHandler (ArFunctor *functor)

Protected Attributes

ArFunctorC< ArModemyActivateCB
ArFunctorC< ArModemyDeactivateCB
char myKey
char myKey2
std::string myName
ArRobotmyRobot
ArFunctorC< ArModemyUserTaskCB

Static Protected Attributes

static ArModeourActiveMode = NULL
static ArGlobalFunctorourHelpCB = NULL
static std::list< ArMode * > ourModes


Constructor & Destructor Documentation

ArMode::ArMode ArRobot robot,
const char *  name,
char  key,
char  key2
 

Constructor.

Parameters:
robot the robot we're attaching to
name the name of this mode
key the primary key to switch to this mode on... it can be '\0' if you don't want to use this
key2 an alternative key to switch to this mode on... it can be '\0' if you don't want a second alternative key


Member Function Documentation

bool ArMode::baseActivate void   ) 
 

The base activation, it MUST be called by inheriting classes, and inheriting classes MUST return if this returns false

bool ArMode::baseDeactivate void   ) 
 

The base deactivation, it MUST be called by inheriting classes, and inheriting classes MUST return if this returns false

virtual void ArMode::help void   )  [inline, virtual]
 

The mode's help print out... subclass must provide if needed.

This is called as soon as a mode is activated, and should give directions on to what keys do what and what this mode will do


The documentation for this class was generated from the following files:
Generated on Thu Jan 7 10:34:42 2010 for Aria by  doxygen 1.4.2