fesa-core  5.0.1
fesa::RTAction< DeviceType > Class Template Reference

This class extends the AbstractRTAction and adds the deviceType parameter template. Specific real time actions will inherit from this class, replacing the template parameter for a specific device class. More...

#include <RTAction.h>

Inheritance diagram for fesa::RTAction< DeviceType >:
fesa::AbstractRTAction fesa::HasMetrics

Public Member Functions

 RTAction (RTActionConfig &rtActionConfig, const AbstractServiceLocator *serviceLocator, const std::map< std::string, const AbstractServiceLocator * > &serviceLocatorRelatedClasses)
 
virtual ~RTAction ()
 
virtual void printConfig (FesaStream *configStream)
 this method prints the action configuration into the stream passed by argument More...
 
virtual void printState (std::ostream &stream, double elapsedTime)
 this method prints the actual state of the action (frequency of the completed actions) into the stream passed by argument More...
 
- Public Member Functions inherited from fesa::AbstractRTAction
 AbstractRTAction (RTActionConfig &rtActionConfig, const AbstractServiceLocator *serviceLocator, const std::map< std::string, const AbstractServiceLocator * > &serviceLocatorRelatedClasses)
 Stores the RT action configuration. More...
 
virtual ~AbstractRTAction ()
 destructor
 
void executeAction (RTEvent *event)
 This method will be called by the scheduler when the event arrives. More...
 
virtual void execute (RTEvent *event)=0
 this method contains the logic of the real time action More...
 
- Public Member Functions inherited from fesa::AbstractAction
void sendManualNotification (const MultiplexingContext *context) const
 this method sends a manual notification message in order to notify the properties and devices specified in the message
 
void resetManualNotification () const
 Clears any registered properties/devices for the manual notification.
 
void disableAutomaticNotification ()
 
void enableAutomaticNotification ()
 
bool isAutomaticNotificationDisabled () const
 
- Public Member Functions inherited from fesa::HasMetrics
 HasMetrics (const std::string &componentName)
 

Protected Member Functions

std::vector< DeviceType * > getFilteredDeviceCollection (const RTEvent *event)
 Filters the device collection depending on the RT event payload: if there is no payload, returns the original device collection if the device in the payload is not in the collection, returns an empty vector if the device in the payload is in in the collection, returns a vector with this device only. More...
 
- Protected Member Functions inherited from fesa::AbstractRTAction
void releaseSettingFieldsReadLock ()
 
- Protected Member Functions inherited from fesa::AbstractAction
virtual void registerManualNotification (const std::string aPropertyName, const std::string aDeviceName)
 Adds a property/device pair for the manual notification.
 
- Protected Member Functions inherited from fesa::HasMetrics
template<typename T >
void registerMetric (const std::string &name, T &value)
 
template<typename T >
void registerMetric (const std::string &name, boost::atomic< T > &value)
 

Protected Attributes

std::vector< DeviceType * > deviceCol_
 list of devices for this real time action
 
- Protected Attributes inherited from fesa::AbstractRTAction
std::string logicalEventName_
 name of the logical-event that fires the action
 
std::string concreteEventName_
 name of the concrete-event that fires the action
 
std::string selectionCriterion_
 selection criterion to select devices used for notification
 
std::string eventSourceName_
 event source name (timing, timingSim, timer, user, <custom-name>)
 
std::vector< AbstractDevice * > abstractDeviceCol_
 set of devices to which the real time action has access
 
DiagnosticsDefs::DiagStateCounter completedActionCount_
 number of completed actions
 
uint32_t abortedActionCount_
 number of real time actions aborted
 
- Protected Attributes inherited from fesa::AbstractAction
std::string name_
 name of the action
 
std::string className_
 name of the FESA-class, which controls this action
 
NotificationProducertheNotificationProducer_
 the notification producer is used to send properties' notifications to the server side
 
std::set< std::string > automaticallyNotifiedPropertiesCol_
 list of properties that will be notified automatically, after the action has finished
 

Detailed Description

template<typename DeviceType>
class fesa::RTAction< DeviceType >

This class extends the AbstractRTAction and adds the deviceType parameter template. Specific real time actions will inherit from this class, replacing the template parameter for a specific device class.

Constructor & Destructor Documentation

template<typename DeviceType >
fesa::RTAction< DeviceType >::RTAction ( RTActionConfig rtActionConfig,
const AbstractServiceLocator *  serviceLocator,
const std::map< std::string, const AbstractServiceLocator * > &  serviceLocatorRelatedClasses 
)

Constructor

Parameters
rtActionConfigcontains all the necessary values to configure the action
template<typename DeviceType >
fesa::RTAction< DeviceType >::~RTAction ( )
virtual

destructor

Member Function Documentation

template<typename DeviceType >
std::vector< DeviceType * > fesa::RTAction< DeviceType >::getFilteredDeviceCollection ( const RTEvent event)
protected

Filters the device collection depending on the RT event payload: if there is no payload, returns the original device collection if the device in the payload is not in the collection, returns an empty vector if the device in the payload is in in the collection, returns a vector with this device only.

To avoid copying the device collection, use like this: const std::vector<Device*>& deviceCol = getFilteredDeviceCollection(event);

Parameters
eventthat triggers the execution of the RT action
template<typename DeviceType >
void fesa::RTAction< DeviceType >::printConfig ( FesaStream *  configStream)
virtual

this method prints the action configuration into the stream passed by argument

Parameters
configStreamin which the information will be printed

Implements fesa::AbstractRTAction.

template<typename DeviceType >
void fesa::RTAction< DeviceType >::printState ( std::ostream &  stream,
double  elapsedTime 
)
virtual

this method prints the actual state of the action (frequency of the completed actions) into the stream passed by argument

Parameters
fesaStreamin which the information will be printed

Implements fesa::AbstractRTAction.


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