AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
|
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; ... } };
SDS_T | The primitive data type of the parameter. |
#include "parameter.hh"
Public Types | |
typedef Parameter< SDS_T > | class_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_type & | operator= (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. | |
Click here for the DRAMA home page and here for the AAO home page.
For more information, contact tony.farrell@mq.edu.au
Generated on Thu Dec 12 2024 23:07:35 for AAO DRAMA/DRAMA2 C++ Interface by 1.9.8