cumbia-qtcontrols 1.x
Qt widgets on top of the cumbia C++ library
Public Member Functions | List of all members
CuControlsWriterA Class Referenceabstract

abstract class defining an interface for cumbia-qtcontrols writers More...

#include <cucontrolswriter_abs.h>

Public Member Functions

 CuControlsWriterA (Cumbia *c, CuDataListener *l)
 
virtual ~CuControlsWriterA ()
 
virtual QString target () const =0
 returns the name of the target More...
 
virtual void clearTarget ()=0
 
virtual void setTarget (const QString &s)=0
 connect the specified target to the control system engine. More...
 
virtual void execute ()=0
 execute the target specified with setTarget More...
 
virtual void sendData (const CuData &d)=0
 send data to the writer More...
 
virtual void getData (CuData &d_ino) const =0
 get data from the writer More...
 
CuVariant getArgs () const
 returns the arguments set with setArgs More...
 
void setArgs (const CuVariant &args)
 sets the value that can be used as input argument More...
 
Cumbia * getCumbia () const
 returns a pointer to the Cumbia implementation that was passed to the class constructor More...
 
CuDataListener * getDataListener () const
 return the CuDataListener that was specified in the constructor. More...
 
CuData getConfiguration () const
 returns the CuData previously saved with saveConfiguration More...
 
void saveConfiguration (const CuData &da)
 when writer configuration is fetched (e.g. from a database), it can be saved in order to avoid database calls during the execution More...
 

Detailed Description

abstract class defining an interface for cumbia-qtcontrols writers

This abstract class defines an interface for writers. cumbia-qtcontrols writers do not know about the engine used to connect and write to the control system.

The method getCumbia returns a pointer to the Cumbia engine currently used by the writer. getDataListener returns a pointer to the CuDataListener that is listening for updates (usually, write errors). The CuDataListener and the Cumbia engine are passed to CuControlsWriterA in the constructor. The setArgs and getArgs methods set and return a CuVariant that can be used to provide input arguments for the write operations.

All the other methods are pure virtual ones that must be implemented by the subclass.

Constructor & Destructor Documentation

◆ CuControlsWriterA()

CuControlsWriterA::CuControlsWriterA ( Cumbia *  c,
CuDataListener *  l 
)
inline

the class constructor initialises the writer.

Parameters
ca pointer to the Cumbia instance in use.
la CuDataListener that will receive updates.
Note both parameters must be not null

◆ ~CuControlsWriterA()

virtual CuControlsWriterA::~CuControlsWriterA ( )
inlinevirtual

Member Function Documentation

◆ clearTarget()

virtual void CuControlsWriterA::clearTarget ( )
pure virtual

◆ execute()

virtual void CuControlsWriterA::execute ( )
pure virtual

execute the target specified with setTarget

Subclasses will execute the write operation in this method, according to the control system specific engine

Referenced by QuCheckBox::checkboxClicked(), QuButton::execute(), QuApplyNumeric::execute(), QuWriter::execute(), and QuWriter::onUpdate().

◆ getArgs()

CuVariant CuControlsWriterA::getArgs ( ) const
inline

returns the arguments set with setArgs

Returns
a CuVariant storing the value(s) that can be used as input argument(s) by execute
See also
execute
CuVariant

◆ getConfiguration()

CuData CuControlsWriterA::getConfiguration ( ) const
inline

returns the CuData previously saved with saveConfiguration

Writers will typically load configuration from a database at creation time and store it across following execute calls.

See also
saveConfiguration

◆ getCumbia()

Cumbia * CuControlsWriterA::getCumbia ( ) const
inline

returns a pointer to the Cumbia implementation that was passed to the class constructor

Returns
a pointer to the Cumbia implementation used by the writer

◆ getData()

virtual void CuControlsWriterA::getData ( CuData &  d_ino) const
pure virtual

get data from the writer

Parameters
d_inoa bundle of key/value pairs defining the data to send to the writer and containing the results filled by the writer once the function returns

Referenced by CuContext::getData().

◆ getDataListener()

CuDataListener * CuControlsWriterA::getDataListener ( ) const
inline

return the CuDataListener that was specified in the constructor.

Returns
the CuDataListener that receives new data updates.

◆ saveConfiguration()

void CuControlsWriterA::saveConfiguration ( const CuData &  da)
inline

when writer configuration is fetched (e.g. from a database), it can be saved in order to avoid database calls during the execution

Parameters
daconfiguration data

Referenced by QuApplyNumeric::onUpdate(), and QuButton::onUpdate().

◆ sendData()

virtual void CuControlsWriterA::sendData ( const CuData &  d)
pure virtual

send data to the writer

Parameters
da bundle of key/value pairs defining the data to send to the writer
See also
getData

Referenced by CuContext::sendData().

◆ setArgs()

void CuControlsWriterA::setArgs ( const CuVariant &  args)
inline

sets the value that can be used as input argument

Returns
a CuVariant storing the value that can be used as input argument by execute
See also
execute

Referenced by QuCheckBox::checkboxClicked(), QuButton::execute(), QuApplyNumeric::execute(), QuWriter::execute(), and QuWriter::onUpdate().

◆ setTarget()

virtual void CuControlsWriterA::setTarget ( const QString &  s)
pure virtual

connect the specified target to the control system engine.

Parameters
sthe name of the target. The syntax depends on the engine.

Subclasses can check the parameter to ensure that its form is valid.

Referenced by CuEngineHotSwitch::hot_switch(), QuCheckBox::setSource(), QmlWriterBackend::setTarget(), QuApplyNumeric::setTarget(), QuButton::setTarget(), QuWriter::setTarget(), QuComboBox::setTarget(), QuLineEdit::setTarget(), QuDoubleSpinBox::setTarget(), and QuSpinBox::setTarget().

◆ target()

virtual QString CuControlsWriterA::target ( ) const
pure virtual

returns the name of the target

Returns
the name of the target configured with setTarget.

If wildcards were used in setTarget, target will return the complete target, with the substitutions.

Referenced by CuContext::disposeWriter(), CuContext::findWriter(), CuEngineHotSwitch::hot_switch(), QmlWriterBackend::setTarget(), QmlWriterBackend::target(), QuApplyNumeric::target(), QuComboBox::target(), QuDoubleSpinBox::target(), QuLineEdit::target(), QuSpinBox::target(), and QuWriter::target().


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