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

ArAction.h

00001 /*
00002 MobileRobots Advanced Robotics Interface for Applications (ARIA)
00003 Copyright (C) 2004, 2005 ActivMedia Robotics LLC
00004 Copyright (C) 2006, 2007 MobileRobots Inc.
00005 
00006      This program is free software; you can redistribute it and/or modify
00007      it under the terms of the GNU General Public License as published by
00008      the Free Software Foundation; either version 2 of the License, or
00009      (at your option) any later version.
00010 
00011      This program is distributed in the hope that it will be useful,
00012      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014      GNU General Public License for more details.
00015 
00016      You should have received a copy of the GNU General Public License
00017      along with this program; if not, write to the Free Software
00018      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 If you wish to redistribute ARIA under different terms, contact 
00021 MobileRobots for information about a commercial version of ARIA at 
00022 robots@mobilerobots.com or 
00023 MobileRobots Inc, 19 Columbia Drive, Amherst, NH 03031; 800-639-9481
00024 */
00025 
00026 #ifndef ARACTION_H
00027 #define ARACTION_H
00028 
00029 #include "ariaTypedefs.h"
00030 #include "ArArg.h"
00031 #include "ArActionDesired.h"
00032 #include <map>
00033 #include <string>
00034 
00035 class ArRobot;
00036 
00060 class ArAction
00061 {
00062 public:
00064   AREXPORT ArAction(const char * name, const char * description = "");
00066   AREXPORT virtual ~ArAction();
00068   AREXPORT virtual bool isActive(void) const;
00070   AREXPORT virtual void activate(void);
00072   AREXPORT virtual void deactivate(void);
00074 
00088   AREXPORT virtual ArActionDesired *fire(ArActionDesired currentDesired) = 0;
00090   AREXPORT virtual void setRobot(ArRobot *robot);
00092   AREXPORT virtual int getNumArgs(void) const;
00093 #ifndef SWIG
00094 
00097   AREXPORT virtual const ArArg *getArg(int number) const;
00098 #endif // SWIG
00099 
00100   AREXPORT virtual ArArg *getArg(int number);
00102   AREXPORT virtual const char *getName(void) const;
00104   AREXPORT virtual const char *getDescription(void) const;
00106   AREXPORT virtual ArActionDesired *getDesired(void) { return NULL; }
00108   AREXPORT virtual const ArActionDesired *getDesired(void) const { return NULL; }
00110   AREXPORT virtual void log(bool verbose = true) const;
00111 
00113   AREXPORT ArRobot* getRobot() const { return myRobot; }
00114 
00115 protected:  
00117   AREXPORT void setNextArgument(ArArg const &arg);
00118 
00120   ArRobot *myRobot;
00121 
00122   // These are mostly for internal use by ArAction, not subclasses:
00123   bool myIsActive;
00124   int myNumArgs;
00125   std::map<int, ArArg> myArgumentMap;
00126   std::string myName;
00127   std::string myDescription;
00128 };
00129 
00130 
00131 #endif //ARACTION_H

Generated on Tue Feb 20 10:51:38 2007 for Aria by  doxygen 1.4.0