This factory provides methods to handle events sources. More...
#include <AbstractEventSourceFactory.h>
Public Member Functions | |
AbstractEventSource * | createEventSource (const std::string &className, const std::string &eventSourceName, const EventSourceType &type) |
Static Public Member Functions | |
static void | deleteEventSources () |
browse the Map of event-sources and remove them. | |
static void | startEventSources () |
browse the Map of event-sources and start them. | |
static void | stopEventSources () |
stops all the event sources in the equipment | |
static AbstractEventSource * | getEventSource (const std::string &className, const std::string &eventSourceName) |
this method returns one particular instance of the event-source by its name and class. throws an exception if the source doesnt exist | |
static bool | eventSourceExists (const std::string &className, const std::string &eventSourceName) |
static void | printConfigAll (FesaStream *fesaStream) |
This method prints, on the fesaStream passed as a parameter, the configuration of this abstract event source. | |
static void | printStateAll (FesaStream *fesaStream, double elapsedTime) |
this method prints, on the fesaStream passed as a parameter, the state of this abstract event source | |
Protected Member Functions | |
virtual AbstractEventSource * | createCustomEventSource (const std::string &eventSourceName)=0 |
This method creates a custom(user-defined) event source. | |
virtual AbstractEventSource * | createOnSubscriptionEventSource (const std::string &eventSourceName)=0 |
This method creates an OnSubscriptionEventSource by name. The implementation of this method is in the generated code, to prevent the RT from permanently including all RDA sources. | |
AbstractEventSourceFactory () | |
virtual | ~AbstractEventSourceFactory () |
Protected Attributes | |
AbstractRealTimeLabObjectFactory * | labFactory_ |
reference to the lab factory to create lab dependent event sources such as the timing event source Is filled in the generated code | |
Private Types | |
typedef const std::string | EventSourceName |
typedef const std::string | ClassName |
typedef const std::pair < EventSourceName, ClassName > | EventSourceKey |
typedef std::map < EventSourceKey, AbstractEventSource * > | EventSourceMap |
Private Member Functions | |
AbstractEventSource * | createTimingEventSource (const std::string &eventSourceName) |
AbstractEventSource * | createTimerEventSource (const std::string &eventSourceName) |
AbstractEventSource * | createOnDemandEventSource (const std::string &className, const std::string &eventSourceName) |
Static Private Member Functions | |
static EventSourceKey | generateKey (const std::string &className, const std::string &eventSourceName) |
Generates an unique key, in order to identify an event-source. | |
Static Private Attributes | |
static EventSourceMap | eventSourceMap_ |
Map which keeps track about all created event sources. |
This factory provides methods to handle events sources.
Definition at line 18 of file AbstractEventSourceFactory.h.
typedef const std::string fesa::AbstractEventSourceFactory::ClassName [private] |
Definition at line 87 of file AbstractEventSourceFactory.h.
typedef const std::pair<EventSourceName,ClassName> fesa::AbstractEventSourceFactory::EventSourceKey [private] |
Definition at line 88 of file AbstractEventSourceFactory.h.
typedef std::map<EventSourceKey, AbstractEventSource*> fesa::AbstractEventSourceFactory::EventSourceMap [private] |
Definition at line 89 of file AbstractEventSourceFactory.h.
typedef const std::string fesa::AbstractEventSourceFactory::EventSourceName [private] |
Definition at line 86 of file AbstractEventSourceFactory.h.
fesa::AbstractEventSourceFactory::AbstractEventSourceFactory | ( | ) | [protected] |
Definition at line 32 of file AbstractEventSourceFactory.cpp.
fesa::AbstractEventSourceFactory::~AbstractEventSourceFactory | ( | ) | [protected, virtual] |
Definition at line 37 of file AbstractEventSourceFactory.cpp.
virtual AbstractEventSource* fesa::AbstractEventSourceFactory::createCustomEventSource | ( | const std::string & | eventSourceName | ) | [protected, pure virtual] |
This method creates a custom(user-defined) event source.
Referenced by createEventSource().
AbstractEventSource * fesa::AbstractEventSourceFactory::createEventSource | ( | const std::string & | className, | |
const std::string & | eventSourceName, | |||
const EventSourceType & | type | |||
) |
Definition at line 41 of file AbstractEventSourceFactory.cpp.
References createCustomEventSource(), createOnDemandEventSource(), createOnSubscriptionEventSource(), createTimerEventSource(), createTimingEventSource(), fesa::CustomSource, eventSourceExists(), eventSourceMap_, FesaErrorAbstractEventSourceNotCreated, FesaErrorEventSourceExists, generateKey(), fesa::OnDemandSource, fesa::OnSubscriptionSource, fesa::TimerSource, and fesa::TimingSource.
Referenced by fesa::RTController::createEventSource().
AbstractEventSource * fesa::AbstractEventSourceFactory::createOnDemandEventSource | ( | const std::string & | className, | |
const std::string & | eventSourceName | |||
) | [private] |
Definition at line 117 of file AbstractEventSourceFactory.cpp.
References fesa::AbstractEquipment::getInstance(), fesa::ProcessConfiguration::getIntValue(), fesa::MsgQueueFactory::getOrCreateMsgQueue(), fesa::AbstractEquipment::getProcessConfiguration(), and fesa::PropertyTag::MSG_NUM_MAX.
Referenced by createEventSource().
virtual AbstractEventSource* fesa::AbstractEventSourceFactory::createOnSubscriptionEventSource | ( | const std::string & | eventSourceName | ) | [protected, pure virtual] |
This method creates an OnSubscriptionEventSource by name. The implementation of this method is in the generated code, to prevent the RT from permanently including all RDA sources.
Referenced by createEventSource().
AbstractEventSource * fesa::AbstractEventSourceFactory::createTimerEventSource | ( | const std::string & | eventSourceName | ) | [private] |
Definition at line 107 of file AbstractEventSourceFactory.cpp.
References FesaErrorWrongEventSourceName, and fesa::TIMER_EVENT_SOURCE_NAME.
Referenced by createEventSource().
AbstractEventSource * fesa::AbstractEventSourceFactory::createTimingEventSource | ( | const std::string & | eventSourceName | ) | [private] |
Definition at line 90 of file AbstractEventSourceFactory.cpp.
References fesa::AbstractRealTimeLabObjectFactory::createTimingEventSource(), fesa::AbstractRealTimeLabObjectFactory::createTimingSimulationEventSource(), FesaErrorWrongEventSourceName, fesa::AbstractEquipment::getInstance(), fesa::AbstractEquipment::getTimingSimulationMode(), labFactory_, and fesa::TIMING_EVENT_SOURCE_NAME.
Referenced by createEventSource().
void fesa::AbstractEventSourceFactory::deleteEventSources | ( | ) | [static] |
browse the Map of event-sources and remove them.
Definition at line 125 of file AbstractEventSourceFactory.cpp.
References eventSourceMap_.
Referenced by fesa::RTController::~RTController().
bool fesa::AbstractEventSourceFactory::eventSourceExists | ( | const std::string & | className, | |
const std::string & | eventSourceName | |||
) | [static] |
Definition at line 171 of file AbstractEventSourceFactory.cpp.
References eventSourceMap_, and generateKey().
Referenced by fesa::RTController::createEventSource(), and createEventSource().
AbstractEventSourceFactory::EventSourceKey fesa::AbstractEventSourceFactory::generateKey | ( | const std::string & | className, | |
const std::string & | eventSourceName | |||
) | [static, private] |
Generates an unique key, in order to identify an event-source.
Definition at line 182 of file AbstractEventSourceFactory.cpp.
References fesa::ON_SUBSCRIPTION_EVENT_SOURCE_NAME, fesa::TIMER_EVENT_SOURCE_NAME, and fesa::TIMING_EVENT_SOURCE_NAME.
Referenced by createEventSource(), eventSourceExists(), and getEventSource().
AbstractEventSource * fesa::AbstractEventSourceFactory::getEventSource | ( | const std::string & | className, | |
const std::string & | eventSourceName | |||
) | [static] |
this method returns one particular instance of the event-source by its name and class. throws an exception if the source doesnt exist
Definition at line 160 of file AbstractEventSourceFactory.cpp.
References eventSourceMap_, FesaErrorEventSourceNotFound, and generateKey().
Referenced by fesa::RTController::createEventSource(), fesa::ServiceLocatorRealtimeSplitImplementation::disableEventSource(), fesa::ServiceLocatorUnsplitImplementation::disableEventSource(), fesa::ServiceLocatorRealtimeSplitImplementation::disableRTEvent(), fesa::ServiceLocatorUnsplitImplementation::disableRTEvent(), fesa::ServiceLocatorRealtimeSplitImplementation::enableEventSource(), fesa::ServiceLocatorUnsplitImplementation::enableEventSource(), fesa::ServiceLocatorRealtimeSplitImplementation::enableRTEvent(), fesa::ServiceLocatorUnsplitImplementation::enableRTEvent(), fesa::ServiceLocatorRealtimeSplitImplementation::isEventEnabled(), and fesa::ServiceLocatorUnsplitImplementation::isEventEnabled().
void fesa::AbstractEventSourceFactory::printConfigAll | ( | FesaStream * | fesaStream | ) | [static] |
This method prints, on the fesaStream passed as a parameter, the configuration of this abstract event source.
fesaStream | in which the information will be printed |
Definition at line 194 of file AbstractEventSourceFactory.cpp.
References eventSourceMap_.
void fesa::AbstractEventSourceFactory::printStateAll | ( | FesaStream * | fesaStream, | |
double | elapsedTime | |||
) | [static] |
this method prints, on the fesaStream passed as a parameter, the state of this abstract event source
fesaStream | in which the information will be printed | |
elapsedTime | interval of time to calculate the frequency of the fired events |
Definition at line 204 of file AbstractEventSourceFactory.cpp.
References eventSourceMap_.
void fesa::AbstractEventSourceFactory::startEventSources | ( | ) | [static] |
browse the Map of event-sources and start them.
Definition at line 135 of file AbstractEventSourceFactory.cpp.
References eventSourceMap_.
Referenced by fesa::RTController::start().
void fesa::AbstractEventSourceFactory::stopEventSources | ( | ) | [static] |
stops all the event sources in the equipment
Definition at line 148 of file AbstractEventSourceFactory.cpp.
References eventSourceMap_.
Referenced by fesa::RTController::~RTController().
AbstractEventSourceFactory::EventSourceMap fesa::AbstractEventSourceFactory::eventSourceMap_ [static, private] |
Map which keeps track about all created event sources.
Definition at line 105 of file AbstractEventSourceFactory.h.
Referenced by createEventSource(), deleteEventSources(), eventSourceExists(), getEventSource(), printConfigAll(), printStateAll(), startEventSources(), and stopEventSources().
reference to the lab factory to create lab dependent event sources such as the timing event source Is filled in the generated code
Definition at line 82 of file AbstractEventSourceFactory.h.
Referenced by createTimingEventSource().