fesa::RTController Class Reference

this class configures the real time process. It creates the event sources, actions, and schedulers and configures those elements so that the real time part is ready. The class is also responsible for starting the event sources and schedulers More...

#include <RTController.h>

List of all members.

Public Member Functions

 RTController ()
 constructor
virtual ~RTController ()
 destructor
void start ()
 This method starts all the schedulers and event sources.
void printConfigAll (FesaStream *fesaStream)
 this method prints the configuration of the controller in the stream passed by argument
void printStateAll (FesaStream *fesaStream, double elapsedTime)
 this method prints the state of the controller into the stream passed by argument
void initialize ()
 This method creates the RT schedulers configuration filling the map for the schedulers and events

Exceptions:
FesaException. 

Protected Attributes

std::map< const std::string,
RTScheduler * > 
schedulersCol_
 list of schedulers

Private Member Functions

void createSchedulers (std::vector< RTLayerInfo * > &layerInfoCol, AbstractRTDeviceClass *pRTDeviceClass, const std::string instanceFile)
 This method uses the structures passed by argument to create the schedulers.
void createRTActionConfig (AbstractRTEquipment::RTLayerInfoCol &layerInfoCol, AbstractRTDeviceClass *pRTDeviceClass, RTSchedulingUnitInfo *schedulingUnit, AbstractRTDeviceClass::RTActionInfoCol &actionInfoCol, EventsMappingLoader &eventsManager)
 Creates RT action configs (actions, event sources) for every event configuration and device collection in the given scheduling unit.
RTSchedulercreateAction (AbstractRTEquipment::RTLayerInfoCol &layerInfoCol, AbstractRTDeviceClass *pRTDeviceClass, RTSchedulingUnitInfo *schedulingUnit, RTActionConfig &actionConfig, std::set< AbstractDevice * > *deviceCollection)
 Creates an action and associates it with the proper RT scheduler, returns the RT scheduler.
RTSchedulerfindScheduler (const std::string &schedulerName, uint32_t queueSize)
 Returns the scheduler matching the given name and queue size.
void createEventSource (const std::string &eventSourceName, boost::shared_ptr< fesa::EventElement > &element, RTScheduler *currentScheduler, AbstractEventSourceFactory *eventSourceFactory)
 this method creates an abstract event source with the event information passed as argument and links the event source to the current scheduler
void assertSchedulingUnitsConfig (const std::vector< RTSchedulingUnitRef > schedulingUnits)
 Asserts that all the given scheduling units (typ. from a layer) are used.

Private Attributes

std::vector< std::string > schedulingUnitWithEmptyDevCol_

Detailed Description

this class configures the real time process. It creates the event sources, actions, and schedulers and configures those elements so that the real time part is ready. The class is also responsible for starting the event sources and schedulers

Definition at line 39 of file RTController.h.


Constructor & Destructor Documentation

fesa::RTController::RTController (  ) 

constructor

Definition at line 36 of file RTController.cpp.

fesa::RTController::~RTController (  )  [virtual]

Member Function Documentation

void fesa::RTController::assertSchedulingUnitsConfig ( const std::vector< RTSchedulingUnitRef schedulingUnits  )  [private]

Asserts that all the given scheduling units (typ. from a layer) are used.

Definition at line 113 of file RTController.cpp.

References fesa::RTSchedulingUnitRef::className_, FesaErrorSchedulingUnitNotFound, fesa::RTSchedulingUnitRef::found_, fesa::RTSchedulingUnitRef::name_, and schedulingUnitWithEmptyDevCol_.

Referenced by initialize().

RTScheduler * fesa::RTController::createAction ( AbstractRTEquipment::RTLayerInfoCol layerInfoCol,
AbstractRTDeviceClass pRTDeviceClass,
RTSchedulingUnitInfo schedulingUnit,
RTActionConfig actionConfig,
std::set< AbstractDevice * > *  deviceCollection 
) [private]
void fesa::RTController::createEventSource ( const std::string &  eventSourceName,
boost::shared_ptr< fesa::EventElement > &  element,
RTScheduler currentScheduler,
AbstractEventSourceFactory eventSourceFactory 
) [private]

this method creates an abstract event source with the event information passed as argument and links the event source to the current scheduler

Parameters:
eventElement that contains the info
currentScheduler to which the event source will be attached

Definition at line 376 of file RTController.cpp.

References fesa::AbstractEventSource::addRTScheduler(), fesa::AbstractEventSourceFactory::createEventSource(), fesa::AbstractEventSourceFactory::eventSourceExists(), and fesa::AbstractEventSourceFactory::getEventSource().

Referenced by createRTActionConfig().

void fesa::RTController::createRTActionConfig ( AbstractRTEquipment::RTLayerInfoCol layerInfoCol,
AbstractRTDeviceClass pRTDeviceClass,
RTSchedulingUnitInfo schedulingUnit,
AbstractRTDeviceClass::RTActionInfoCol actionInfoCol,
EventsMappingLoader eventsManager 
) [private]
void fesa::RTController::createSchedulers ( std::vector< RTLayerInfo * > &  layerInfoCol,
AbstractRTDeviceClass pRTDeviceClass,
const std::string  instanceFile 
) [private]

This method uses the structures passed by argument to create the schedulers.

Referenced by initialize().

RTScheduler * fesa::RTController::findScheduler ( const std::string &  schedulerName,
uint32_t  queueSize 
) [private]

Returns the scheduler matching the given name and queue size.

Definition at line 324 of file RTController.cpp.

References schedulersCol_.

Referenced by createAction().

void fesa::RTController::initialize (  ) 
void fesa::RTController::printConfigAll ( FesaStream fesaStream  ) 

this method prints the configuration of the controller in the stream passed by argument

Parameters:
fesaStream in which the configuration will be printed

Definition at line 392 of file RTController.cpp.

References schedulersCol_.

Referenced by fesa::AbstractRTEquipment::printConfigAll(), and fesa::AbstractRTEquipment::start().

void fesa::RTController::printStateAll ( FesaStream fesaStream,
double  elapsedTime 
)

this method prints the state of the controller into the stream passed by argument

Parameters:
fesaStream in which the state will be printed
elapsedTime to calculate the frequency of the events

Definition at line 407 of file RTController.cpp.

References schedulersCol_.

Referenced by fesa::AbstractRTEquipment::printStateAll().

void fesa::RTController::start (  ) 

This method starts all the schedulers and event sources.

Definition at line 342 of file RTController.cpp.

References FesaErrorNoDiagnosticLayerFound, schedulersCol_, and fesa::AbstractEventSourceFactory::startEventSources().

Referenced by fesa::AbstractRTEquipment::start().


Member Data Documentation

list of schedulers

Definition at line 84 of file RTController.h.

Referenced by findScheduler(), initialize(), printConfigAll(), printStateAll(), start(), and ~RTController().

std::vector<std::string> fesa::RTController::schedulingUnitWithEmptyDevCol_ [private]

Definition at line 126 of file RTController.h.

Referenced by assertSchedulingUnitsConfig(), and createRTActionConfig().


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

Generated on 18 Jan 2013 for Fesa by  doxygen 1.6.1