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

GitEnum Class Reference

#include <Git.h>

Inheritance diagram for GitEnum:

Git GitResetType List of all members.

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()


Public Methods

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


Protected Methods

virtual void SetValue (const unsigned int)=0
 Set the value of the object.

virtual const char *const * Lookup ()=0
 Return a pointer to an array of enum strings equivalents.


Constructor & Destructor Documentation

virtual GitEnum::~GitEnum   [inline, virtual]
 

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:
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

virtual const char* const* GitEnum::Lookup   [protected, pure 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 [protected, pure 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@aaoepp.aao.gov.au 

Generated on Tue Nov 3 09:09:56 2009 for AAO DRAMA C++ Interfaces by doxygen 1.2.18