Representation of an event source in the system. Event sources are responsible for firing events and sending them to the right scheduler.
More...
#include <AbstractEventSource.h>
|
virtual void | enable () |
| Enable the event source activity (for all of the related events)
- Exceptions
-
|
|
virtual void | disable () |
| Disable the event source activity (for all of the related events)
- Exceptions
-
|
|
bool | isEnabled () const |
| Check if the source is enabled.
|
|
void | printConfig (FesaStream &fesaStream) const |
| Print the event source configuration. More...
|
|
void | printState (std::ostream &stream, double elapsedTime) const |
| Print the event source state. More...
|
|
virtual | ~AbstractEventSource () |
| Destructor.
|
|
const std::string & | getName () const |
| Retrieve the name of the event source. More...
|
|
EventSourceType | getType () const |
| Retrieve the type of the event source. More...
|
|
uint32_t | getEvtSrcPriority () const |
| Retrieve the priority of the thread in which the event source runs. More...
|
|
uint32_t | getEvtSrcID () const |
| Retrieve the event source's thread ID. More...
|
|
bool | hasConcreteEvent (const std::string &eventName) const |
| Checks if the event name given exists in the list of events triggered by this event source.
|
|
virtual | ~Thread () |
| Destructor.
|
|
void | setDetachState (int32_t state) |
| Modify the detach state of the thread. More...
|
|
void | start (bool blockingMode, const std::string &threadName, bool permanent=true) |
|
virtual void | stop () |
| Stop the thread.
|
|
int | join (void **status) |
|
bool | isRunning () const |
| Check if the thread is running. More...
|
|
pthread_t | getID () const |
| Get the process ID. More...
|
|
int32_t | getPriority () const |
| Get the priority of the thread. More...
|
|
cpu_set_t | getAffinity () const |
| Get the affinity of the thread.
|
|
void | setPriority (int32_t priority) |
| Set the priority of the thread. More...
|
|
void | setAffinity (cpu_set_t affinity) |
| Set the affinity of the thread. More...
|
|
ThreadType | getThreadType () const |
|
| HasMetrics (const std::string &componentName) |
|
|
| AbstractEventSource (const std::string &eventSourceName, EventSourceType type, const std::string &className, const boost::shared_ptr< Diagnostics > &diagnostics) |
| Constructor. More...
|
|
void | run () |
| In a continuous loop, the source will wait for new events, and post them to the scheduler whenever they occur. All exceptions from underlying methods will be cought and logged at this level. This method is blocking.
|
|
virtual void | addEvent (const boost::shared_ptr< fesa::EventElement > &eventElement, const boost::shared_ptr< LogicalEvent > &logicalEvent) |
| Add an event to the event map of this source. More...
|
|
virtual void | wait (boost::shared_ptr< RTEvent > &eventToFire)=0 |
| This method has to be overridden by the concrete event source in order to fire the RTEvent This method is blocking. More...
|
|
virtual void | connect (const boost::shared_ptr< fesa::EventElement > &eventElement)=0 |
| Connect will be triggered, whenever a new concrete event was added to the event map. It is up to each derived event source to perform the right actions.
|
|
template<typename T > |
void | registerMetric (const std::string &name, T &value) |
|
template<typename T > |
void | registerMetric (const std::string &name, boost::atomic< T > &value) |
|
Representation of an event source in the system. Event sources are responsible for firing events and sending them to the right scheduler.
fesa::AbstractEventSource::AbstractEventSource |
( |
const std::string & |
eventSourceName, |
|
|
EventSourceType |
type, |
|
|
const std::string & |
className, |
|
|
const boost::shared_ptr< Diagnostics > & |
diagnostics |
|
) |
| |
|
protected |
Constructor.
- Parameters
-
eventSourceName | The name of the event source |
type | The type of the event source |
className | The FESA class the event source belongs to. It should be empty for event sources that are unique per DU, i.e. timer, timing, and on-subsctiption |
diagnostics | The diagnostics object to be used for logging in event sources |
void fesa::AbstractEventSource::addEvent |
( |
const boost::shared_ptr< fesa::EventElement > & |
eventElement, |
|
|
const boost::shared_ptr< LogicalEvent > & |
logicalEvent |
|
) |
| |
|
protectedvirtual |
Add an event to the event map of this source.
- Parameters
-
eventElement | The concrete event which will be fired by this source |
logicalEvent | The logical event which will be triggered, when the concrete event was fired |
uint32_t fesa::AbstractEventSource::getEvtSrcID |
( |
| ) |
const |
Retrieve the event source's thread ID.
- Returns
- The event source's thread ID
uint32_t fesa::AbstractEventSource::getEvtSrcPriority |
( |
| ) |
const |
Retrieve the priority of the thread in which the event source runs.
- Returns
- The current priority of the event source's thread
const std::string & fesa::AbstractEventSource::getName |
( |
| ) |
const |
Retrieve the name of the event source.
- Returns
- The name of the event source
EventSourceType fesa::AbstractEventSource::getType |
( |
| ) |
const |
Retrieve the type of the event source.
- Returns
- The type of the event source
void fesa::AbstractEventSource::printConfig |
( |
FesaStream & |
fesaStream | ) |
const |
Print the event source configuration.
- Parameters
-
fesaStream | Output stream in which the configuration will be shown |
void fesa::AbstractEventSource::printState |
( |
std::ostream & |
stream, |
|
|
double |
elapsedTime |
|
) |
| const |
Print the event source state.
- Parameters
-
fesaStream | Output stream in which the state will be shown |
virtual void fesa::AbstractEventSource::wait |
( |
boost::shared_ptr< RTEvent > & |
eventToFire | ) |
|
|
protectedpure virtual |
This method has to be overridden by the concrete event source in order to fire the RTEvent This method is blocking.
- Parameters
-
eventToFire | The event which will be fired when the method returns |
The documentation for this class was generated from the following files:
- AbstractEventSource.h
- AbstractEventSource.cpp