AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
|
A class which reads Enumerated values from a SDS argument structures.
This is an template class used for cases where we want to fetch a STRING action argument which must then be converted to an enum type. That is, the string is a representation of an enumerated value.
drama::gitarg::Enum is a template class. Two template arguments are required - "LookupClass" and "EnumType". The former must be a sub-class of drama::gitarg::EnumLookupClass. The later is a normally simple enum type - it must be possible to cast this class from an integer and cast back to an integer from this class.
LookupClass | A sub-class of drama::gitarg::EnumLookupClass with GetMaxValue() and GetStringArray() implemented. |
EnumType | The underlying enumerated type. Must be possible to cast to and from an int. Must have values for 0 through to LookupClass->GetMaxValue()+1 inclusive (no gaps), where GetMaxValues()+1 is used to indicate an invalid value. |
#include "gitarg.hh"
Public Member Functions | |
Enum () | |
Default contructor for the object. | |
Enum (const sds::Id &Id, const std::string &Name="Argument1", const int Position=1, const std::string &Default="", const Flags flags=Flags::Upper|Flags::Abbrev|Flags::KeepErr) | |
Constructor which constructs the value from an item in an SDS structure. | |
Enum (drama::thread::TAction *taction, const sds::Id &Id, const std::string &Name="Argument1", const int Position=1, const std::string &Default="", const Flags flags=Flags::Upper|Flags::Abbrev|Flags::KeepErr) | |
Constructor which constructs the value from an item in an SDS structure. | |
Enum (EnumType InitialValue) | |
Constructor with initial value supplied. | |
virtual | ~Enum () |
Destructor. | |
void | Get (const sds::Id &Id, const std::string &Name="Argument1", const int Position=1, const std::string &Default="", const Flags flags=Flags::Upper|Flags::Abbrev|Flags::KeepErr) |
Get the value of the object from an SDS structure. | |
operator EnumType () const | |
Return the underlying value of this object. | |
operator std::string () const | |
Return the underlying value of this object as a string. | |
Enum & | operator= (const EnumType &rhs) |
Allow an item of the underlying EnumType to be assigned to this object. | |
Click here for the DRAMA home page and here for the AAO home page.
For more information, contact tony.farrell@mq.edu.au
Generated on Thu Dec 12 2024 23:07:35 for AAO DRAMA/DRAMA2 C++ Interface by 1.9.8