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).
std::string specialization.
A task will create an object of this type to create an array of string parameters.
An example of the use of this class is shown below.
class MyTaskClass : public drama::Task { public: drama::ArrayParameter<std::string> my_par; // Declare array parameter ... // Task Constructor - creates parameter. MyTaskClass() : drama::Task("MYTASKNAME"), my_par(TaskPtr(), "PARNAME", 6,) { ... // 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, unsigned strLen=100, const std::string initVal="") | |
Construct a parameter of a given name which is an array of scalar items. | |
virtual | ~ArrayParameter () |
Array Parameter Destructor. | |
void | Fill (const std::string &filler, bool updateMonitors=true) |
Fill the array parameter value with a fixed value for all elements. | |
std::string | Get (size_t index) const |
Return a single value from an array parameter. | |
virtual std::string | operator[] (size_t index) const |
Return a single item from the Array parameter. | |
template<class ContainerType , typename std::enable_if< std::is_base_of< std::string, typename ContainerType::value_type >::value >::type * = nullptr> | |
void | Set (const ContainerType &vals, bool updateMonitors=true) |
Set the value of the parameter to the specified value. | |
void | Set (size_t index, const std::string &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