AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
|
The class ArrayParameter is used to implement DRAMA parameters containing arrays of primitive items (one dimension only).
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.
An example of the use of this class is shown below.
class MyTaskClass : public drama::Task { public: drama::ArrayParameter<INT32> my_par; // Declare array parameter ... // Task Constructor - creates parameter. MyTaskClass() : drama::Task("MYTASKNAME"), my_par(TaskPtr(), "PARNAME", 5, 0) { ... // Read parameter - returns an std::vector<INT32> auto parVal = my_par.Get(); // Write parameter. my_par.Set(parVal); ... } };
SDS_T | The primitive data type of the parameter. |
#include "parameter.hh"
Public Member Functions | |
ArrayParameter (std::weak_ptr< Task > task, const std::string &name, unsigned nElements, const SDS_T initVal) | |
Construct a parameter of a given name which is an array of scalar items. | |
virtual | ~ArrayParameter () |
Array Parameter Destructor. | |
template<typename F > | |
void | Fill (const F filler, bool updateMonitors=true) |
Fill the array parameter value with a fixed value for all elements. | |
SDS_T | Get (size_t index) const |
Return a single value from an array parameter. | |
SDS_T | operator[] (size_t index) const |
Return a single item from the Array parameter. | |
template<class ContainerType > | |
void | Set (const ContainerType &vals) |
Set the value of the parameter to the specified value. | |
void | Set (size_t index, SDS_T val, bool updateMonitors=true) |
Set the value of the parameter to the specified value. | |
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