Simplified XF 1.1.0
|
Dispatcher used in an IDF (no underlying OS). More...
#include <dispatcher.h>
Public Member Functions | |
void | pushEvent (XFEvent *pEvent) override |
Adds event to the events queue. More... | |
void | scheduleTimeout (int timeoutId, int interval, interface::XFBehavior *pBehavior) override |
Adds a new timeout to be handled. More... | |
void | unscheduleTimeout (int timeoutId, interface::XFBehavior *pBehavior) override |
Removes all timeouts corresponding the given parameters. More... | |
void | executeOnce () override |
Executes once the dispatcher. More... | |
int | execute (const void *param=nullptr) override |
Main loop of the dispatcher. Implements event loop processing. More... | |
Protected Member Functions | |
void | dispatchEvent (const XFEvent *pEvent) const override |
Dispatches the event to the corresponding behavioral part. More... | |
![]() | |
XFDispatcher ()=default | |
Protected Attributes | |
XFEventQueue | events_ |
Queue holding events waiting to get dispatched. | |
interface::XFMutex * | pMutex_ |
Mutex to protect event queue. | |
Friends | |
class | interface::XFDispatcher |
Additional Inherited Members | |
![]() | |
static XFDispatcher * | getInstance () |
Returns a pointer to the single instance of XFDispatcher. | |
Dispatcher used in an IDF (no underlying OS).
The dispatcher can be used when an IDF on a bare-metal embedded system is needed.
Only one instance of XFDispatcher is allowed (singleton pattern). It is the interface::XFDispatcher class providing the single instance of the XFDispatcher class (see interface::XFDispatcher::getInstance()).
|
virtual |
Reimplemented from interface::XFDispatcher.
|
overrideprotectedvirtual |
Dispatches the event to the corresponding behavioral part.
For example the state machine which should process the event.
pEvent | The event to dispatch |
Implements interface::XFDispatcher.
|
overridevirtual |
Main loop of the dispatcher. Implements event loop processing.
Implements interface::XFDispatcher.
|
overridevirtual |
Executes once the dispatcher.
Usually, this method must not be called explicitly. The standard way to call the dispatcher is to call execute().
This method can be called by the Thread (or main function) if it must perform concurrent (non-XF related) tasks in addition.
When using this method start() must not be called.
Implements interface::XFDispatcher.
|
overridevirtual |
Adds event to the events queue.
Implements interface::XFDispatcher.
|
overridevirtual |
Adds a new timeout to be handled.
The dispatcher will forward the timeout information to the timeout manager which is responsible to handle all timeouts.
Implements interface::XFDispatcher.
|
overridevirtual |
Removes all timeouts corresponding the given parameters.
Implements interface::XFDispatcher.