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 | List of all members
GitTpl::Real< MinVal, MaxVal, DefaultVal > Class Template Reference

A class which reads real values from an SDS argument structure. More...

#include <gittpl.h>

Inheritance diagram for GitTpl::Real< MinVal, MaxVal, DefaultVal >:
GitReal Git

Public Member Functions

 Real (const double def=(double) DefaultVal)
 Simple constructor with a default value specified. More...
 
 Real (const SdsId &Id, const char *const Name, const int Position, StatusType *const status, const double Default=(double) DefaultVal, const int Flags=Git::KeepErr)
 Constructor with the initial value set from an SDS structure. More...
 
- Public Member Functions inherited from GitReal
 GitReal (const double def=0.0)
 Simple constructor with a default value specified. More...
 
 GitReal (const SdsId &Id, const char *const Name, const int Position, StatusType *const status, const double Default=0.0, const int Flags=0)
 Constructor with the initial value set from an SDS structure. More...
 
virtual ~GitReal ()
 Destructor. More...
 
virtual void Get (const SdsId &Id, const char *const Name, const int Position, StatusType *const status, const double Default=0.0, const int Flags=0)
 Get the value of the object from an SDS struture. More...
 
 operator double () const
 Conversion operators - given GitReal, return a double. More...
 
 operator float () const
 Conversion operators - given GitReal, return a float. 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

template<long int MinVal, long int MaxVal, long int DefaultVal = 0>
class GitTpl::Real< MinVal, MaxVal, DefaultVal >

A class which reads real values from an SDS argument structure.

A C++ class which provides an interface to GitArgGetD() . It Implements a double type which includes the operation Get, to fetch its value from an SDS structure. There is also a constructor which does the Get operation.

This class inherits GitReal and uses template arguments to specify the range.

It should be noted that as templates don't access double arguments, the template parameters which specify the range must be long ints, limiting the range you can use. If you need a greater range or non-integer range limits, you must use GitReal directly, but in many cases this verison will probably suffice.

See also
GitArgGetD()
Parameters
MinValueThe minimum value acceptable in a Get operation.
MaxValueThe maximum value acceptable in a Get operation.
DefaultValThe default value for the item. This is NOT validated against the range and hence can be used to set it to a identifible particular value, if desired. Defaults to zero.

Constructor & Destructor Documentation

template<long int MinVal, long int MaxVal, long int DefaultVal = 0>
GitTpl::Real< MinVal, MaxVal, DefaultVal >::Real ( const double  def = (double)DefaultVal)
inline

Simple constructor with a default value specified.

Parameters
defThe default value to use. If not specified, uses "DefaultVal"
template<long int MinVal, long int MaxVal, long int DefaultVal = 0>
GitTpl::Real< MinVal, MaxVal, DefaultVal >::Real ( const SdsId Id,
const char *const  Name,
const int  Position,
StatusType *const  status,
const double  Default = (double)DefaultVal,
const int  Flags = Git::KeepErr 
)
inline

Constructor with the initial value set from an SDS 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. If not specified, uses "DefaultVal".
FlagsWhich GIT Flags to apply. If not specified, Git::KeepErr is used.

References GitReal::Get().


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