AAO DRAMA C++ Interface (Old style)
DRAMA C++, Depreciated, don't use for new code
Public Types | Public Member Functions | List of all members
GitTpl::Enum< LookupClass, EnumType > Class Template Reference

A class which reads Enumerated values from a SDS argument structures. More...

#include <gittpl.h>

Inheritance diagram for GitTpl::Enum< LookupClass, EnumType >:
Git

Public Types

enum  {
  Upper =GIT_M_ARG_UPPER , Lower =GIT_M_ARG_LOWER , KeepErr =GIT_M_ARG_KEEPERR , Abbrev = GIT_M_ARG_ABBREV ,
  LastBit =GIT_M_ARG_LASTBIT , KeepValErr =GIT_M_ARG_KEEPVALERR
}
 

Public Member Functions

 Enum ()
 Default contructor for the object.
 
 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.
 
 Enum (EnumType InitialValue)
 Constructor with initial value supplied.
 
virtual ~Enum ()
 Destructor.
 
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.
 
 operator const char * () const
 Return the underlying value of this object as a string.
 
 operator EnumType () const
 Return the underlying value of this object.
 

Detailed Description

template<typename LookupClass, typename EnumType>
class GitTpl::Enum< LookupClass, EnumType >

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.

See also
GitArgGetS()
Parameters
LookupClassA sub-class of GitTpl::EnumLookupClass with GetMaxValue() and GetStringArray() implemented.
EnumTypeThe underlyting enumerated value. Must be possible to cast to and from an int. Must have values for 0 through to LookupClass->GetMaxValue()+1 inclusive.

The documentation for this class was generated from the following file: