cumbia-tango 1.x
C++ multi threaded library based on cumbia and the Tango control system
|
Read Tango device, attribute and class properties. More...
#include <cutdbpropertyreader.h>
Public Member Functions | |
CuTDbPropertyReader (const std::string &id, CumbiaTango *cumbia_t) | |
The class constructor. More... | |
virtual | ~CuTDbPropertyReader () |
void | get (const std::vector< CuData > &in_data) |
Get a list of device, class or attribute properties from the Tango database. More... | |
void | cancel () |
CuTDbPropertyReader::cancel tries to unregister the activity and removes all listeners. More... | |
void | addListener (CuDataListener *l) |
register a CuDataListener that will be notified when data is ready. More... | |
void | removeListener (CuDataListener *l) |
CuTDbPropertyReader::removeListener removes the given listener. More... | |
void | deleteLater () |
CuTDbPropertyReader::deleteLater schedule object auto destruction. More... | |
void | onProgress (int step, int total, const CuData &data) |
void | onResult (const CuData &data) |
CuData | getToken () const |
void | onResult (const std::vector< CuData > &datalist) |
Read Tango device, attribute and class properties.
CuTDbPropertyReader fetches properties from the Tango database and provides a notification through the CuThreadListener interface when data is available. Data is retrieved in a separate thread.
CuTDbPropertyReader::CuTDbPropertyReader | ( | const std::string & | id, |
CumbiaTango * | cumbia_t | ||
) |
The class constructor.
id | any identifier as a std string |
cumbia_tango | a reference to a CumbiaTango instance, necessary to configure the property reader activity with proper CuThreadsEventBridgeFactory_I and CuThreadFactoryImplI implementations. |
|
virtual |
void CuTDbPropertyReader::addListener | ( | CuDataListener * | l | ) |
register a CuDataListener that will be notified when data is ready.
void CuTDbPropertyReader::cancel | ( | ) |
CuTDbPropertyReader::cancel tries to unregister the activity and removes all listeners.
Listeners can be deleted after cancel is called, since onUpdate will not be invoked after. Nonetheless, cancel is not enough to ensure this object can be safely deleted. If you intend to cancel and delete the CuTDbPropertyReader, call deleteLater after cancel.
void CuTDbPropertyReader::deleteLater | ( | ) |
CuTDbPropertyReader::deleteLater schedule object auto destruction.
If the result has already been delivered, the object is immediately deleted. This object will be deleted right after result delivery otherwise.
void CuTDbPropertyReader::get | ( | const std::vector< CuData > & | in_data | ) |
Get a list of device, class or attribute properties from the Tango database.
in_data | a list of CuData bundles defining the properties to fetch. |
Every element of in_data describes the property you want to get.
To get a device property you must put into the CuData bundle the following key/value pairs:
The three following key/values must be set:
CuData must be configured as follows:
There is a cumbia tutorial dedicated to getting properties from the Tango database: Writing an activity to read Tango device, attribute and class properties.
CuData CuTDbPropertyReader::getToken | ( | ) | const |
void CuTDbPropertyReader::onProgress | ( | int | step, |
int | total, | ||
const CuData & | data | ||
) |
This is not used
void CuTDbPropertyReader::onResult | ( | const CuData & | data | ) |
void CuTDbPropertyReader::onResult | ( | const std::vector< CuData > & | datalist | ) |
void CuTDbPropertyReader::removeListener | ( | CuDataListener * | l | ) |
CuTDbPropertyReader::removeListener removes the given listener.
l | a pointer to the listener to be removed |