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>
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
| ||||
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. | ||||
RTScheduler * | createAction (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. | ||||
RTScheduler * | findScheduler (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_ |
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.
fesa::RTController::RTController | ( | ) |
constructor
Definition at line 36 of file RTController.cpp.
fesa::RTController::~RTController | ( | ) | [virtual] |
destructor
Definition at line 42 of file RTController.cpp.
References fesa::AbstractEventSourceFactory::deleteEventSources(), schedulersCol_, and fesa::AbstractEventSourceFactory::stopEventSources().
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] |
Creates an action and associates it with the proper RT scheduler, returns the RT scheduler.
Definition at line 253 of file RTController.cpp.
References fesa::RTActionConfig::actionName_, fesa::RTScheduler::addRTAction(), fesa::RTSchedulingUnitInfo::className_, fesa::AbstractRTActionFactory::createRTAction(), fesa::RTActionConfig::deviceCol_, fesa::DIAGNOSTIC_LAYER, fesa::RTActionConfig::eventName_, FesaErrorRTActionNameNotFound, FesaErrorRTFactoryNotFound, findScheduler(), fesa::RTScheduler::getName(), fesa::AbstractAction::getName(), fesa::AbstractRTDeviceClass::getRTActionFactory(), fesa::RTLayerInfo::layerName_, fesa::RTSchedulingUnitInfo::name_, fesa::RTLayerInfo::queueSize_, and fesa::RTLayerInfo::schedulingUnitRefCol_.
Referenced by createRTActionConfig().
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
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] |
Creates RT action configs (actions, event sources) for every event configuration and device collection in the given scheduling unit.
Definition at line 183 of file RTController.cpp.
References fesa::RTActionConfig::actionName_, fesa::RTSchedulingUnitInfo::actionName_, fesa::RTActionConfig::automaticallyNotifiedPropertiesCol_, fesa::RTSchedulingUnitInfo::className_, fesa::RTActionConfig::className_, createAction(), createEventSource(), fesa::RTActionConfig::eventName_, fesa::RTSchedulingUnitInfo::eventName_, fesa::RTActionConfig::eventSourceName_, FesaErrorRTActionNameNotFound, fesa::AbstractDeviceClass::getDeviceFactory(), fesa::EventsMappingLoader::getEventElementCol(), fesa::AbstractRTDeviceClass::getEventSourceFactory(), fesa::AbstractDeviceFactory::getGlobalDevice(), fesa::AbstractDeviceClass::getName(), fesa::RTActionConfig::globalDevice_, fesa::RTActionConfig::isGlobalPropertyToBeNotified_, fesa::RTActionConfig::manuallyNotifiedPropertiesCol_, fesa::RTSchedulingUnitInfo::name_, schedulingUnitWithEmptyDevCol_, fesa::RTSchedulingUnitInfo::selectionCriterion_, and fesa::RTActionConfig::selectionCriterion_.
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 | ( | ) |
This method creates the RT schedulers configuration filling the map for the schedulers and events
FesaException. |
Definition at line 67 of file RTController.cpp.
References assertSchedulingUnitsConfig(), createSchedulers(), FesaErrorNothingToDoForRTSide, FesaErrorOpenXMLFile, fesa::AbstractRTEquipment::fillRTSchedulerInfo(), fesa::AbstractComponentEquipment::getDeviceClassCol(), fesa::AbstractEquipment::getDeviceDataFileName(), fesa::NotificationIDManager::getInstance(), fesa::AbstractEquipment::getInstance(), fesa::AbstractRTEquipment::getInstance(), fesa::AbstractDeviceClass::getName(), fesa::AbstractEquipment::isClassOptional(), fesa::NotificationIDManager::save(), and schedulersCol_.
Referenced by fesa::AbstractRTEquipment::initialize().
void fesa::RTController::printConfigAll | ( | FesaStream * | fesaStream | ) |
this method prints the configuration of the controller in the stream passed by argument
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
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().
fesa::RTController::schedulersCol_ [protected] |
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().