AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
Public Member Functions | List of all members
drama::gitarg::Enum< LookupClass, EnumType > Class Template Reference

Detailed Description

template<typename LookupClass, typename EnumType>
class drama::gitarg::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. 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.

See also
GitArgGetS()
Template Parameters
LookupClassA sub-class of drama::gitarg::EnumLookupClass with GetMaxValue() and GetStringArray() implemented.
EnumTypeThe 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.
 
Enumoperator= (const EnumType &rhs)
 Allow an item of the underlying EnumType to be assigned to this object.
 

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