AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
Public Types | Public Member Functions | Friends | List of all members
drama::Parameter< SDS_T > Class Template Reference

Detailed Description

template<typename SDS_T>
class drama::Parameter< SDS_T >

The class Parameter is used to implement DRAMA parameters containing primitive items.

A task will create an object of this type to create a parameter. The template argument is a primitive data type supported by the SDS library, one of char, short, unsigned short, INT32, UINT32, INT64, UINT64, float or double. std::string is also supported. Complex SDS items can be created using the drama::sds::Id specialization.

An example of the use of this class is shown below.

   class MyTaskClass : public drama::Task {
   public:
       drama::Parameter<double> my_par; // Declare double parameter 
   ...
   // Task Constructor - creates parameter.
   MyTaskClass() : drama::Task("MYTASKNAME"), 
                   my_par(TaskPtr(), "MY_PARAM", 111.1) {
       ...
       // Read parameter
       double v = my_par;
       // Write parameter.
       my_par = 2.0;
       ...
     }
   };

Template Parameters
SDS_TThe primitive data type of the parameter.
Author
Tony Farrell, AAO $Revision$ $Date$
Examples
monitor1.cpp.

#include "parameter.hh"

Public Types

typedef Parameter< SDS_Tclass_type
 The type of this template instantiation.
 

Public Member Functions

 Parameter (std::weak_ptr< Task > task, const std::string &name, const SDS_T &initVal)
 Construct a parameter of a given name.
 
virtual ~Parameter ()
 Parameter Destructor.
 
 operator SDS_T () const
 Return the current value of the parameter.
 
template<typename T >
bool operator!= (T &&rhs) const
 Overload the != operator.
 
class_typeoperator= (SDS_T val)
 Set the value of the parameter to the specified value.
 
template<typename T >
bool operator== (T &&rhs) const
 Overload the == operator.
 

Friends

template<typename T >
bool operator!= (T &&lhs, const Parameter &p)
 Overload the != operator.
 
template<typename T >
bool operator== (T &&lhs, const Parameter &p)
 Overload the == operator.
 

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