LDA++
Public Member Functions | List of all members
ldaplusplus::events::SameThreadEventDispatcher Class Reference

#include <Events.hpp>

Inheritance diagram for ldaplusplus::events::SameThreadEventDispatcher:
ldaplusplus::events::ThreadSafeEventDispatcher ldaplusplus::events::EventDispatcherInterface

Public Member Functions

virtual void dispatch (std::shared_ptr< Event > event) override
 
- Public Member Functions inherited from ldaplusplus::events::ThreadSafeEventDispatcher
virtual void add_listener (std::shared_ptr< EventListenerInterface > listener) override
 
virtual void remove_listener (std::shared_ptr< EventListenerInterface > listener) override
 
void process_events ()
 
- Public Member Functions inherited from ldaplusplus::events::EventDispatcherInterface
std::shared_ptr< EventListenerInterfaceadd_listener (std::function< void(std::shared_ptr< Event >)> listener)
 
template<class ListenerType , typename... Args>
std::shared_ptr< EventListenerInterfaceadd_listener (Args...args)
 
template<class EventType , typename... Args>
void dispatch (Args...args)
 

Detailed Description

SameThreadEventDispatcher dispatches immediately any events that are dispatched from the thread in which it was created and only allows process_events to be called from that thread.

It is thread safe.

Member Function Documentation

void ldaplusplus::events::SameThreadEventDispatcher::dispatch ( std::shared_ptr< Event event)
overridevirtual

Call the on_event() function of every listener passing this event as a parameter.

The interface doesn't define when the on_event function will be called and it is not guaranteed that upon return of the dispatch function all listeners will be notified.

Parameters
eventThe event to be sent to the listeners

Reimplemented from ldaplusplus::events::ThreadSafeEventDispatcher.


The documentation for this class was generated from the following files: