A class which reads Enumerated values from a SDS argument structures. More...
#include <gittpl.h>
Public Member Functions | |
Enum () | |
Default contructor for the object. More... | |
Enum (EnumType InitialValue) | |
Constructor with initial value supplied. More... | |
Enum (const SdsId &Id, const char *const Name, const int Position, StatusType *status, const char *Default=0, const int Flags=Git::Upper|Git::Abbrev) | |
Constructor which contructs the values from an SDS type. More... | |
void | Get (const SdsId &Id, const char *const Name, const int Position, StatusType *status, const char *Default=0, const int Flags=Git::Upper|Git::Abbrev|Git::KeepErr) |
Get the value of the object from an SDS struture. More... | |
operator EnumType () const | |
Return the underlying value of this object. More... | |
operator const char * () const | |
Return the underlying value of this object as a string. More... | |
virtual | ~Enum () |
Destructor. More... | |
Additional Inherited Members | |
![]() | |
enum | { Upper =GIT_M_ARG_UPPER, Lower =GIT_M_ARG_UPPER, KeepErr =GIT_M_ARG_KEEPERR, Abbrev = GIT_M_ARG_ABBREV, LastBit =GIT_M_ARG_LASTBIT } |
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.
This is an alternative approach to GitEnum. GitTpl::Enum is a template class. Two template arguments are required - "LookupClass" and "EnumType". The former must be a sub-class of Git::EnumLookupClass. The later is a normally simple enum type - it mus be possible to cast this class from an integer and cast back to an integer from this class.
LookupClass | A sub-class of GitTpl::EnumLookupClass with GetMaxValue() and GetStringArray() implemented. |
EnumType | The underlyting enumerated value. Must be possible to cast to and from an int. Must have values for 0 through to LookupClass->GetMaxValue()+1 inclusive. |
|
inline |
Default contructor for the object.
This will set the value of the object to be the invalid value, obtained by setting the value to the lookup class's GetMaxValue() value + 1.
|
inline |
Constructor with initial value supplied.
The initial value must be one of the values in the enum type.
InitialValue | The initial value for the objects. |
|
inline |
Constructor which contructs the values from an SDS type.
Id | The SDS structure. |
Name | The name of the item within the structure. |
Position | If the item does not exist by the name, then presume this position. |
status | Inherited status |
Default | The default value. |
Flags | Which GIT Flags to apply |
|
inlinevirtual |
Destructor.
|
inline |
Get the value of the object from an SDS struture.
This is the function which is used to set the value of the object. It is passed an SDS structure and looks for the item within that structure.
Id | The SDS structure. |
Name | The name of the item within the structure. |
Position | If the item does not exist by the name, then presume this position. |
status | Inherited status |
Default | The default value. If not specified use 0 (first enum val) |
Flags | Which GIT Flags to apply. If not specified, then Git::Upper|Git::Abbrev|Git::KeepErr is specified. |
|
inline |
Return the underlying value of this object as a string.
|
inline |
Return the underlying value of this object.
Click here for the DRAMA home page and here for the AAO home page.
For more information, contact tjf@aao.gov.au Generated on Mon Feb 22 2016 13:58:31 for AAO DRAMA C++ Interfaces by