#include <ArArg.h>
This is designed to be easy to add another type to the arguments... All you have to do to do so, is add an enum to the Type enum, add a newType getNewType(void), add a void setNewType(newType nt), and add a case statement for the newType to ArArg::print. You should probably also add an
Public Types | |
enum | { TYPE_COUNT = LAST_TYPE + 1 } |
enum | Type { INVALID, INT, DOUBLE, STRING, BOOL, POSE, FUNCTOR, DESCRIPTION_HOLDER, LAST_TYPE = DESCRIPTION_HOLDER } |
Public Member Functions | |
ArArg (const ArArg &arg) | |
Copy constructor. | |
ArArg (const char *description) | |
Constructor for just holding a description (for ArConfig). | |
ArArg (const char *name, ArRetFunctor1< bool, ArArgumentBuilder * > *setFunctor, ArRetFunctor< const std::list< ArArgumentBuilder * > * > *getFunctor, const char *description) | |
Constructor for making an argument that has functors to handle things. | |
ArArg (const char *name, char *pointer, const char *description, size_t maxStrLen) | |
Constructor for making an argument of a string. | |
ArArg (const char *name, ArPose *pointer, const char *description="") | |
Constructor for making a position argument. | |
ArArg (const char *name, bool *pointer, const char *description="") | |
Constructor for making a boolean argument. | |
ArArg (const char *name, double *pointer, const char *description="", double minDouble=-HUGE_VAL, double maxDouble=HUGE_VAL) | |
Constructor for making a double argument. | |
ArArg (const char *name, int *pointer, const char *description="", int minInt=INT_MIN, int maxInt=INT_MAX) | |
Constructor for making an integer argument. | |
ArArg () | |
Default empty contructor. | |
const std::list< ArArgumentBuilder * > * | getArgsWithFunctor (void) const |
Gets the argument value, which is a list of argumentbuilders here. | |
bool | getBool (void) const |
Gets the argument value, for bool arguments. | |
ArPriority::Priority | getConfigPriority (void) const |
Gets the priority (only used by ArConfig). | |
bool | getConfigPrioritySet (void) const |
Gets if the config priority is set. | |
const char * | getDescription (void) const |
Gets the long description of the argument. | |
double | getDouble (void) const |
Gets the argument value, for double arguments. | |
int | getInt (void) const |
Gets the argument value, for int arguments. | |
double | getMaxDouble (void) const |
Gets the maximum double value. | |
int | getMaxInt (void) const |
Gets the maximum int value. | |
double | getMinDouble (void) const |
Gets the minimum double value. | |
int | getMinInt (void) const |
Gets the minimum int value. | |
const char * | getName (void) const |
Gets the name of the argument. | |
ArPose | getPose (void) const |
Gets the argument value, for pose arguments. | |
const char * | getString (void) const |
Gets the argument value, for string arguments. | |
Type | getType (void) const |
Gets the type of the argument. | |
void | log (void) const |
Logs the type, name, and value of this argument. | |
ArArg & | operator= (const ArArg &arg) |
Assignment operator. | |
bool | setArgWithFunctor (ArArgumentBuilder *argument) |
Sets the argument by calling the setFunctor callback. | |
bool | setBool (bool val) |
Sets the argument value, for bool arguments. | |
void | setConfigPriority (ArPriority::Priority priority) |
Sets the priority (only used by ArConfig). | |
bool | setDouble (double val) |
Sets the argument value, for double arguments. | |
bool | setInt (int val) |
Sets the argument value, for int arguments. | |
bool | setPose (ArPose pose) |
Sets the argument value, for ArPose arguments. | |
bool | setString (const char *str) |
Sets the argument value for ArArgumentBuilder arguments. | |
virtual | ~ArArg () |
Destructor. | |
Protected Attributes | |
bool * | myBoolPointer |
ArPriority::Priority | myConfigPriority |
bool | myConfigPrioritySet |
std::string | myDescription |
double * | myDoublePointer |
ArRetFunctor< const std::list< ArArgumentBuilder * > * > * | myGetFunctor |
int * | myIntPointer |
double | myMaxDouble |
int | myMaxInt |
size_t | myMaxStrLen |
double | myMinDouble |
int | myMinInt |
std::string | myName |
ArPose * | myPosePointer |
ArRetFunctor1< bool, ArArgumentBuilder * > * | mySetFunctor |
char * | myStringPointer |
ArArg::Type | myType |
|
|
|
|
|
Constructor for making an argument that has functors to handle things. This constructor is for the functor type of argument, this is for cases that need to be complicated and have more than one argument value per name, such as the sonar in a config file, and where this data needs to be used to construct compound data structures rather than single variables.
|
|
Gets the priority (only used by ArConfig). The priority of this argument when used in ArConfig. |
|
Gets if the config priority is set. If this is true then the config priority is set and you can use getConfigPriority. |
|
Gets the type of the argument.
|
|
Sets the priority (only used by ArConfig). The priority of this argument when used in ArConfig. |