Class HsmEventDispatcherGLibmm
Defined in File HsmEventDispatcherGLibmm.hpp
Public Member Functions
virtual bool | start () |
See IHsmEventDispatcher::start() | |
virtual void | stop () |
Stop dispatching events. | |
virtual void | emitEvent (const HandlerID_t handlerID) |
See IHsmEventDispatcher::emitEvent() | |
static std::shared_ptr<HsmEventDispatcherGLibmm> | create (const size_t eventsCacheSize = (10)) |
Create dispatcher instance. | |
static std::shared_ptr<HsmEventDispatcherGLibmm> | create (const Glib::RefPtr<Glib::MainContext> &context, const size_t eventsCacheSize = (10)) |
Create dispatcher instance. | |
Inheritance Relationships
Base Type
public hsmcpp::HsmEventDispatcherBase
(Class HsmEventDispatcherBase)
Class Documentation
-
class HsmEventDispatcherGLibmm : public hsmcpp::HsmEventDispatcherBase
HsmEventDispatcherGLibmm provides dispatcher implementation based on Glibmm library.
HsmEventDispatcherGLibmm implementation is based on Glib::Dispatcher class so it has to follow the same rules. Most important ones are:
HsmEventDispatcherGLibmm must be constructred and destroyed in the receiver thread (the thread in whose main loop it will execute its connected slots)
registerEventHandler() must be called from the same thread where dispatcher was created for more details see https://developer.gnome.org/gtkmm-tutorial/stable/sec-using-glib-dispatcher.html.en
See HsmEventDispatcherGlibmm for details.
Public Functions
-
virtual bool start() override
See IHsmEventDispatcher::start()
Not Thread Safe
Thread safety is not required by HierarchicalStateMachine::initialize() which uses this API.
-
virtual void stop() override
Stop dispatching events.
Future calls to dispatchEvents() will have no effect.
Remark
Operation is performed asynchronously. It does not interrupt currently handled event, but will cancel all other pending events.
Concurrency
thread-safe
-
virtual void emitEvent(const HandlerID_t handlerID) override
See IHsmEventDispatcher::emitEvent()
Concurrency
thread-safe
Public Static Functions
-
static std::shared_ptr<HsmEventDispatcherGLibmm> create(const size_t eventsCacheSize = (10))
Create dispatcher instance.
Not Thread Safe
Must be called inside the main GLib MainContext. The Dispatcher object must be deleted in the main GLib context.
- Parameters
eventsCacheSize – size of the queue preallocated for delayed events
- Returns
New dispatcher instance.
-
static std::shared_ptr<HsmEventDispatcherGLibmm> create(const Glib::RefPtr<Glib::MainContext> &context, const size_t eventsCacheSize = (10))
Create dispatcher instance.
Not Thread Safe
Must be called inside the same GLib context provided in a context. The Dispatcher object must be deleted in the same GLib context as a context .
- Parameters
context – custom GLib context to use for dispatcher.
eventsCacheSize – size of the queue preallocated for delayed events
- Returns
New dispatcher instance.