DRAMA C++ Intro   Class Hierarchy   Alphabetical List of types   List of Classes   File List   Class Member Index   File Members Index   Related Pages  

Public Member Functions | Protected Member Functions | List of all members
GitEnum Class Referenceabstract

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

#include <Git.h>

Inheritance diagram for GitEnum:
Git GitResetType

Public Member Functions

virtual ~GitEnum ()
 Destructor. 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)
 Get the value of the object from an SDS struture. More...
 

Protected Member Functions

virtual void SetValue (const unsigned int)=0
 Set the value of the object. More...
 
virtual const char *const * Lookup ()=0
 Return a pointer to an array of enum strings equivalents. More...
 

Additional Inherited Members

- Public Types inherited from Git
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
}
 

Detailed Description

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

This is an abstract class used for cases where we want to fetch a STRING action argument which must then be converted to an enum type.

This is a virtual class - the user must provide a class which inherits this class and provides an implementation of the GitEnum::SetValue and GitEnum::Lookup functions.

See also
GitArgGetS()

Constructor & Destructor Documentation

virtual GitEnum::~GitEnum ( )
inlinevirtual

Destructor.

Member Function Documentation

void GitEnum::Get ( const SdsId Id,
const char *const  Name,
const int  Position,
StatusType *  status,
const char *  Default = 0,
const int  Flags = Git::Upper|Git::Abbrev 
)
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.

Parameters
IdThe SDS structure.
NameThe name of the item within the structure.
PositionIf the item does not exist by the name, then presume this position.
statusInherited status
DefaultThe default value.
FlagsWhich GIT Flags to apply

Referenced by GitResetType::GitResetType().

virtual const char* const* GitEnum::Lookup ( )
protectedpure virtual

Return a pointer to an array of enum strings equivalents.

The integer index of the string in this array is passed to GitEnum::SetValue when the value is set

Returns
a pointer to a array of pointer to char, which is a character array to be passed to GitArgGetS(). This array contains the list of strings to be accepted with a terminating null. When a string is recongized, SetValue is called with it's index.
virtual void GitEnum::SetValue ( const unsigned  int)
protectedpure virtual

Set the value of the object.

This function must be provided by inheritors. It is invoked when GitEnum:: wants to set the value of the object using an integer of the index of the string in the look up array. It should set the object value to the enum equivalent of this value or an invalid value if the value is invalid.


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

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 doxygen 1.8.10