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

ArArg.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 ARARG_H
00027 #define ARARG_H
00028 
00029 #include "ariaTypedefs.h"
00030 #include "ariaUtil.h"
00031 #include "ArFunctor.h"
00032 
00033 class ArArgumentBuilder;
00034 
00036 
00044 class ArArg
00045 {
00046 public:
00047   typedef enum 
00048   { 
00049     INVALID, 
00050     INT, 
00051     DOUBLE, 
00052     STRING, 
00053     BOOL, 
00054     POSE, 
00055     FUNCTOR, 
00056     DESCRIPTION_HOLDER, 
00057     
00058     LAST_TYPE = DESCRIPTION_HOLDER  
00059   } Type;
00060 
00061 
00062   enum {
00063     TYPE_COUNT = LAST_TYPE + 1 
00064   };
00065 
00067   AREXPORT ArArg();
00069   AREXPORT ArArg(const char * name, int *pointer, 
00070          const char * description = "", 
00071          int minInt = INT_MIN, 
00072          int maxInt = INT_MAX); 
00074   AREXPORT ArArg(const char * name, double *pointer,
00075          const char * description = "", 
00076          double minDouble = -HUGE_VAL,
00077          double maxDouble = HUGE_VAL); 
00079   AREXPORT ArArg(const char * name, bool *pointer,
00080          const char * description = ""); 
00082   AREXPORT ArArg(const char * name, ArPose *pointer,
00083          const char * description = ""); 
00085   AREXPORT ArArg(const char *name, char *pointer, 
00086          const char *description,
00087          size_t maxStrLen);
00089   AREXPORT ArArg(const char *name, 
00090          ArRetFunctor1<bool, ArArgumentBuilder *> *setFunctor, 
00091          ArRetFunctor<const std::list<ArArgumentBuilder *> *> *getFunctor,
00092          const char *description);
00094   AREXPORT ArArg(const char *description);
00096   AREXPORT ArArg(const ArArg & arg);
00098   AREXPORT ArArg &operator=(const ArArg &arg);
00100   AREXPORT virtual ~ArArg();
00101 
00103   AREXPORT Type getType(void) const;
00105   AREXPORT const char *getName(void) const;
00107   AREXPORT const char *getDescription(void) const;
00109   AREXPORT bool setInt(int val);
00111   AREXPORT bool setDouble(double val);
00113   AREXPORT bool setBool(bool val);
00115   AREXPORT bool setPose(ArPose pose);
00117   AREXPORT bool setString(const char *str);
00119   AREXPORT bool setArgWithFunctor(ArArgumentBuilder *argument);
00121   AREXPORT int getInt(void) const; 
00123   AREXPORT double getDouble(void) const;
00125   AREXPORT bool getBool(void) const;
00127   AREXPORT ArPose getPose(void) const;
00129   AREXPORT const char *getString(void) const;
00131   AREXPORT const std::list<ArArgumentBuilder *> *getArgsWithFunctor(void) const;
00133   AREXPORT void log(void) const;
00135   AREXPORT int getMinInt(void) const;
00137   AREXPORT int getMaxInt(void) const;
00139   AREXPORT double getMinDouble(void) const;
00141   AREXPORT double getMaxDouble(void) const;
00143   AREXPORT bool getConfigPrioritySet(void) const;
00145   AREXPORT ArPriority::Priority getConfigPriority(void) const;
00147   AREXPORT void setConfigPriority(ArPriority::Priority priority);
00148 
00149 private:
00151   AREXPORT void clear(void);
00152 
00153 protected:
00154 
00155   ArArg::Type myType;
00156   std::string myName;
00157   std::string myDescription;
00158   int *myIntPointer;
00159   int myMinInt, myMaxInt;
00160   double *myDoublePointer;
00161   double myMinDouble, myMaxDouble;
00162   bool *myBoolPointer;
00163   ArPose *myPosePointer;
00164   char *myStringPointer;
00165   size_t myMaxStrLen;
00166   bool myConfigPrioritySet;
00167   ArPriority::Priority myConfigPriority;
00168   ArRetFunctor1<bool, ArArgumentBuilder *> *mySetFunctor;
00169   ArRetFunctor<const std::list<ArArgumentBuilder *> *> *myGetFunctor;
00170 };
00171 
00172 #endif // ARARGUMENT_H

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