cumbia-tango 1.x
C++ multi threaded library based on cumbia and the Tango control system
Public Types | Public Member Functions | List of all members
CuTangoActionI Class Referenceabstract

an interface for a Tango action, typically a reader or a writer are implementors More...

#include <cutangoactioni.h>

Inheritance diagram for CuTangoActionI:
Inheritance graph
[legend]

Public Types

enum  Type {
  ActionUnknown = -1 , Reader = 0 , Writer , ReaderConfig ,
  WriterConfig , TaDb
}
 list of types of actions More...
 

Public Member Functions

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...
 

Detailed Description

an interface for a Tango action, typically a reader or a writer are implementors

A CuTangoActionI describes what readers or writers usually do. They do actions, and they must adhere to this interface that requires to

Examples
CuTReader and CuTWriter implementations.

Member Enumeration Documentation

◆ Type

list of types of actions

the implementors must return one of these values in getType

Enumerator
ActionUnknown 
Reader 
Writer 
ReaderConfig 
WriterConfig 
TaDb 

Constructor & Destructor Documentation

◆ ~CuTangoActionI()

CuTangoActionI::~CuTangoActionI ( )
virtual

virtual destructor, to make compilers happy

Member Function Documentation

◆ addDataListener()

virtual void CuTangoActionI::addDataListener ( CuDataListener *  l)
pure virtual

insert a CuDataListener to the list of listeners of data updates

Parameters
la CuDataListener that receives notifications when data is ready, through CuDataListener::onUpdate

Implemented in CuTaDb, CuTConfiguration, CuTReader, and CuTWriter.

Referenced by CumbiaTango::addAction().

◆ dataListenersCount()

virtual size_t CuTangoActionI::dataListenersCount ( )
pure virtual

return the number of registered data listeners

Returns
the number of data listeners currently installed

Implemented in CuTaDb, CuTConfiguration, CuTReader, and CuTWriter.

◆ getData()

virtual void CuTangoActionI::getData ( CuData &  d_inout) const
pure virtual

subclasses will implement the necessary code to analyze the request stored in the input argument and fill it in with output data

Parameters
dataa 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.
note
getData must be synchronous: it's called with input arguments (d_inout) and they are filled in within the same method in the same thread. Asynchronous data fetch from an activity executed in a separate thread can be accomplished by sendData in combination with CuDataListener::onUpdate. There, received data will have to be recognised as coming from a specific request and treated accordingly.

Implemented in CuTaDb, CuTConfiguration, CuTWriter, and CuTReader.

◆ getSource()

virtual TSource CuTangoActionI::getSource ( ) const
pure virtual

return a TSource object that stores information about the Tango source

Returns
TSource, an object storing information on the Tango source

Implemented in CuTaDb, CuTConfiguration, CuTReader, and CuTWriter.

Referenced by CuPollingService::actionRegistered(), CuPoller::registerAction(), and CuPoller::unregisterAction().

◆ getType()

virtual Type CuTangoActionI::getType ( ) const
pure virtual

returns the type of CuTangoActionI implemented

Returns
one of the values from the Type enum

Implemented in CuTaDb, CuTConfiguration, CuTReader, and CuTWriter.

◆ removeDataListener()

virtual void CuTangoActionI::removeDataListener ( CuDataListener *  l)
pure virtual

remove a CuDataListener from the list of listeners of data updates

Parameters
la CuDataListener that will be removed from the list of listeners

Implemented in CuTaDb, CuTConfiguration, CuTReader, and CuTWriter.

Referenced by CumbiaTango::unlinkListener().

◆ sendData()

virtual void CuTangoActionI::sendData ( const CuData &  data)
pure virtual

subclasses will implement the necessary code to set data on themselves or to the activities

Parameters
dataa 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

Send a request and receive a response <em>asynchronously</em>
Use sendData in conjunction with CuDataListener::onUpdate, as described in the getData documentation.

Implemented in CuTaDb, CuTConfiguration, CuTReader, and CuTWriter.

◆ start()

void CuTangoActionI::start ( )
pure virtual

the method where activities are created and registered

This is the place where activities are created and registered to Cumbia through the method Cumbia::registerActivity.

Examples
See also Cumbia::registerActivity

Implemented in CuTaDb, CuTConfiguration, CuTReader, and CuTWriter.

References start().

Referenced by CumbiaTango::addAction(), and start().

◆ stop()

void CuTangoActionI::stop ( )
pure virtual

the method where activities are unregistered from Cumbia

This is the place where activities are unregistered from Cumbia by the Cumbia::unregisterActivity method

Examples
See also Cumbia::unregisterActivity

Implemented in CuTaDb, CuTConfiguration, CuTReader, and CuTWriter.

References stop().

Referenced by stop().


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