cumbia-tango 1.x
C++ multi threaded library based on cumbia and the Tango control system
|
#include <cutwriter.h>
Public Member Functions | |
CuTWriter (const TSource &src, CumbiaTango *ct, const CuData &conf, const CuData &options=CuData(), const CuData &tag=CuData()) | |
virtual | ~CuTWriter () |
void | setWriteValue (const CuVariant &wval) |
set the value that will be written after start is called More... | |
void | setConfiguration (const CuData &db_conf) |
Set database configuration. More... | |
void | setOptions (const CuData &options) |
void | setTag (const CuData &tag) |
void | onProgress (int step, int total, const CuData &data) |
void | onResult (const CuData &data) |
calls onUpdate on all listeners and deletes itself afterwards More... | |
void | onResult (const std::vector< CuData > &datalist) |
unused. To comply with interface More... | |
CuData | getToken () const |
TSource | getSource () const |
return a TSource object that stores information about the Tango source More... | |
Type | getType () const |
returns the type of CuTangoActionI implemented More... | |
void | addDataListener (CuDataListener *l) |
insert a CuDataListener to the list of listeners of data updates More... | |
void | removeDataListener (CuDataListener *l) |
remove a CuDataListener from the list of listeners of data updates More... | |
size_t | dataListenersCount () |
return the number of registered data listeners More... | |
void | start () |
creates and registers a CuWriteActivity to trigger a write operation on the Tango control system More... | |
void | stop () |
the method where activities are unregistered from Cumbia More... | |
void | sendData (const CuData &data) |
subclasses will implement the necessary code to set data on themselves or to the activities More... | |
void | getData (CuData &d_inout) const |
subclasses will implement the necessary code to analyze the request stored in the input argument and fill it in with output data More... | |
Public Member Functions inherited from CuTangoActionI | |
virtual | ~CuTangoActionI () |
virtual destructor, to make compilers happy More... | |
virtual TSource | getSource () const =0 |
return a TSource object that stores information about the Tango source More... | |
virtual Type | getType () const =0 |
returns the type of CuTangoActionI implemented More... | |
virtual void | addDataListener (CuDataListener *l)=0 |
insert a CuDataListener to the list of listeners of data updates More... | |
virtual void | removeDataListener (CuDataListener *l)=0 |
remove a CuDataListener from the list of listeners of data updates More... | |
virtual size_t | dataListenersCount ()=0 |
return the number of registered data listeners More... | |
virtual void | start ()=0 |
the method where activities are created and registered More... | |
virtual void | stop ()=0 |
the method where activities are unregistered from Cumbia More... | |
virtual void | sendData (const CuData &data)=0 |
subclasses will implement the necessary code to set data on themselves or to the activities More... | |
virtual void | getData (CuData &d_inout) const =0 |
subclasses will implement the necessary code to analyze the request stored in the input argument and fill it in with output data More... | |
Additional Inherited Members | |
Public Types inherited from CuTangoActionI | |
enum | Type { ActionUnknown = -1 , Reader = 0 , Writer , ReaderConfig , WriterConfig , TaDb } |
list of types of actions More... | |
CuTWriter::CuTWriter | ( | const TSource & | src, |
CumbiaTango * | ct, | ||
const CuData & | conf, | ||
const CuData & | options = CuData() , |
||
const CuData & | tag = CuData() |
||
) |
|
virtual |
|
virtual |
insert a CuDataListener to the list of listeners of data updates
l | a CuDataListener that receives notifications when data is ready, through CuDataListener::onUpdate |
Implements CuTangoActionI.
|
virtual |
return the number of registered data listeners
Implements CuTangoActionI.
|
virtual |
subclasses will implement the necessary code to analyze the request stored in the input argument and fill it in with output data
data | a CuData compiled with the necessary fields accepted by the specific implementation as input argument. data will contain additional output fields filled in by the method when it returns. |
Implements CuTangoActionI.
|
virtual |
return a TSource object that stores information about the Tango source
Implements CuTangoActionI.
CuData CuTWriter::getToken | ( | ) | const |
|
virtual |
returns the type of CuTangoActionI implemented
Implements CuTangoActionI.
References CuTangoActionI::Writer.
Referenced by onResult().
void CuTWriter::onProgress | ( | int | step, |
int | total, | ||
const CuData & | data | ||
) |
this method is currently void
void CuTWriter::onResult | ( | const CuData & | data | ) |
calls onUpdate on all listeners and deletes itself afterwards
data | CuData with the result to be delivered to every CuDataListener |
References getType().
void CuTWriter::onResult | ( | const std::vector< CuData > & | datalist | ) |
unused. To comply with interface
|
virtual |
remove a CuDataListener from the list of listeners of data updates
l | a CuDataListener that will be removed from the list of listeners |
Implements CuTangoActionI.
References stop().
|
virtual |
subclasses will implement the necessary code to set data on themselves or to the activities
data | a CuData compiled with the necessary fields accepted by the specific implementation |
The data can be set locally on the object implementing this interface or can be forwarded to the activity by means of Cumbia::postEvent carrying an argument derived from CuActivityEvent. See CuTReader::sendData for an example
Implements CuTangoActionI.
void CuTWriter::setConfiguration | ( | const CuData & | db_conf | ) |
Set database configuration.
db_conf | data of type "property" obtained from a |
void CuTWriter::setOptions | ( | const CuData & | options | ) |
void CuTWriter::setTag | ( | const CuData & | tag | ) |
void CuTWriter::setWriteValue | ( | const CuVariant & | write_val | ) |
set the value that will be written after start is called
write_val | a const reference to a CuVariant containing the value to write when start is called |
Referenced by CuTangoWriterFactory::create().
|
virtual |
creates and registers a CuWriteActivity to trigger a write operation on the Tango control system
This method
Implements CuTangoActionI.
References CuDeviceFactoryService::CuDeviceFactoryServiceType, and TSource::SrcCmd.
|
virtual |
the method where activities are unregistered from Cumbia
This is the place where activities are unregistered from Cumbia by the Cumbia::unregisterActivity method
Implements CuTangoActionI.
Referenced by removeDataListener().