AAO DRAMA/DRAMA2 C++ 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 user 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(this, "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. More... | |
Public Member Functions | |
Parameter (std::weak_ptr< Task > task, const std::string &name, const SDS_T &initVal) | |
Construct a parameter of a given name. More... | |
virtual | ~Parameter () |
Parameter Destructor. More... | |
operator SDS_T () const | |
Return the current value of the parameter. More... | |
class_type & | operator= (SDS_T val) |
Set the value of the parameter to the specified value. More... | |
typedef Parameter<SDS_T> drama::Parameter< SDS_T >::class_type |
The type of this template instantiation.
|
inline |
Construct a parameter of a given name.
|
inlinevirtual |
Parameter Destructor.
Does not actually delete the parameter, just prevents internal access via this object. Parameters are actually deleted when the DRAMA task shuts down.
|
inline |
Return the current value of the parameter.
|
inline |
Set the value of the parameter to the specified value.
Any monitors of the parameter are updated.
val | The new value for the parameter. |
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 15:57:52 for AAO DRAMA/DRAMA2 C++ Interface by