AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
Public Member Functions | List of all members
drama::ParSys Class Reference

Detailed Description

A DRAMA 2 C++ Interface to the DRAMA Simple DITS Parameter System (SDP).

This class provides an interfaces to constructing, putting and fetching data from simple the SDP parameter system.

The only context kept in the object is a pointer to the DRAMA task, to allow the methods to take the DRAMA lock as needed.

#include "parsys.hh"

Public Member Functions

 ParSys (std::weak_ptr< Task > dramaTask)
 Create an object to access the parameter system.
 
void Create (const std::string &name, const std::string &value)
 Create a string parameter.
 
template<typename T >
void Create (const std::string &name, T value)
 Create primitive parameter.
 
void CreateItem (sds::Id &item)
 Create a new parameter by inserting an SDS item.
 
sds::Id CreateSds (const std::string &name, SdsCodeType code, const std::string &extra="")
 Create a parameters as an raw SDS item.
 
bool Exists (const std::string &name) const
 Does a parameter of a given name exist?
 
template<typename T >
void Get (const std::string &name, T *value) const
 Fetch primitive value from parameter.
 
double GetDouble (const std::string &name) const
 If the Parameter contains scalar value, convert it to a double.
 
int GetInt (const std::string &name) const
 If the Parameter contains scalar value, convert it to integer.
 
long GetLong (const std::string &name) const
 If the Parameter contains scalar value, convert it to long integer.
 
std::string GetString (const std::string &name) const
 If the Parameter contains scalar value or a character string convert it to a string.
 
unsigned int GetUInt (const std::string &name) const
 If the Parameter contains scalar value, convert it to an unsigned integer.
 
unsigned long GetULong (const std::string &name) const
 If the Parameter contains scalar value, convert it to an unsigned long integer.
 
void Put (const std::string &name, const char *value)
 Insert a char * (string) value into the parameter.
 
void Put (const std::string &name, const std::string &value)
 Insert a string value into the parameter.
 
template<typename T >
void Put (const std::string &name, T value)
 Update parameter from primitive value.
 
void PutSdsCvt (const std::string &name, const sds::Id &value)
 Put an SDS item a named parameter.
 
void PutSdsReplaceByCopy (const std::string &name, const sds::Id &value, const bool create=true)
 Put a SDS item a named parameter - replacing the existing item.
 
void PutSdsReplaceByInsert (const std::string &name, sds::Id *value, const bool create=true)
 Put a SDS item a named parameter - replacing the existing value.
 
void Update (const std::string &name)
 Indicate a parameter value has been updated by other means.
 

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