Class HsmEventDispatcherGLibmm

Public Member Functions

 
virtual boolstart ()
 See IHsmEventDispatcher::start()
 
virtual voidstop ()
 Stop dispatching events.
 
virtual voidemitEvent (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

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:

Not following these rules will result in an occasional SIGSEGV crash (usually when deleting dispatcher instance). Unless you really have to, it’s always better to reuse a single dispatcher instance for multiple HSMs instead of creating/deleting multiple ones (they will anyway handle events sequentially since they use same Glib main loop).

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.