#include <TimerEventSource.h>
Private Member Functions | |
TimerEventSource () | |
constructor | |
~TimerEventSource () | |
destructor | |
void | connect (boost::shared_ptr< fesa::EventElement > &eventElement) |
fill the timer information with the information from the instance document | |
RTEvent * | wait () |
this method returns a real time event source according to the periods provided in the instance document | |
RTEvent * | fireNextEvent () |
this method fires the first event in the queue | |
Private Attributes | |
int64_t | totalDelay_ |
contains the number of ms that have passed since the event source started | |
std::vector< std::string > | eventNamesCol_ |
lists of the events that can be fired by this event source | |
std::vector< int32_t > | eventDelaysCol_ |
period of each event. This period defines the time that the abstract event source has to wait before firing the same event again | |
std::vector< int64_t > | eventTotalDelaysCol_ |
each entry contains the time in ms at which the event will be fired. Those ms are relative to the totalDelay, which contains the ms that have passed since the event source started for instance if an entry contains 120 and the total delay is 60, then the event will be fired in 60 ms | |
std::deque< int32_t > | eventsToFire_ |
std::vector< int32_t > | eventsFired_ |
number of times that each event has been fired | |
Friends | |
class | AbstractRealTimeLabObjectFactory |
class | AbstractEventSourceFactory |
Definition at line 30 of file TimerEventSource.h.
fesa::TimerEventSource::TimerEventSource | ( | ) | [private] |
constructor
Definition at line 38 of file TimerEventSource.cpp.
fesa::TimerEventSource::~TimerEventSource | ( | ) | [private] |
destructor
Definition at line 44 of file TimerEventSource.cpp.
void fesa::TimerEventSource::connect | ( | boost::shared_ptr< fesa::EventElement > & | eventElement | ) | [private, virtual] |
fill the timer information with the information from the instance document
eventElement | that contains the information from the instance document |
Implements fesa::AbstractEventSource.
Definition at line 48 of file TimerEventSource.cpp.
References eventDelaysCol_, eventNamesCol_, eventsFired_, eventTotalDelaysCol_, FesaErrorWrongTimerPeriod, and fesa::TIMER_TAG_PERIOD.
RTEvent * fesa::TimerEventSource::fireNextEvent | ( | ) | [private] |
this method fires the first event in the queue
Definition at line 117 of file TimerEventSource.cpp.
References eventNamesCol_, eventsFired_, eventsToFire_, and fesa::AbstractEventSource::RTEvent.
Referenced by wait().
RTEvent * fesa::TimerEventSource::wait | ( | ) | [private, virtual] |
this method returns a real time event source according to the periods provided in the instance document
Implements fesa::AbstractEventSource.
Definition at line 65 of file TimerEventSource.cpp.
References eventDelaysCol_, eventsToFire_, eventTotalDelaysCol_, fireNextEvent(), and totalDelay_.
friend class AbstractEventSourceFactory [friend] |
Reimplemented from fesa::AbstractEventSource.
Definition at line 38 of file TimerEventSource.h.
friend class AbstractRealTimeLabObjectFactory [friend] |
Definition at line 37 of file TimerEventSource.h.
std::vector<int32_t> fesa::TimerEventSource::eventDelaysCol_ [private] |
period of each event. This period defines the time that the abstract event source has to wait before firing the same event again
Definition at line 81 of file TimerEventSource.h.
std::vector<std::string> fesa::TimerEventSource::eventNamesCol_ [private] |
lists of the events that can be fired by this event source
Definition at line 73 of file TimerEventSource.h.
Referenced by connect(), and fireNextEvent().
fesa::TimerEventSource::eventsFired_ [private] |
number of times that each event has been fired
Definition at line 109 of file TimerEventSource.h.
Referenced by connect(), and fireNextEvent().
std::deque<int32_t> fesa::TimerEventSource::eventsToFire_ [private] |
Definition at line 98 of file TimerEventSource.h.
Referenced by fireNextEvent(), and wait().
std::vector<int64_t> fesa::TimerEventSource::eventTotalDelaysCol_ [private] |
each entry contains the time in ms at which the event will be fired. Those ms are relative to the totalDelay, which contains the ms that have passed since the event source started for instance if an entry contains 120 and the total delay is 60, then the event will be fired in 60 ms
Definition at line 90 of file TimerEventSource.h.
fesa::TimerEventSource::totalDelay_ [private] |
contains the number of ms that have passed since the event source started
Definition at line 67 of file TimerEventSource.h.
Referenced by wait().