cxxtools::EventSource Class Reference

Sends Events to receivers in other threads. More...

#include <cxxtools/eventsource.h>

Inheritance diagram for cxxtools::EventSource:
cxxtools::NonCopyable

Public Member Functions

 EventSource ()
 ~EventSource ()
void send (const cxxtools::Event &ev)
void connect (EventSink &sink)
void disconnect (EventSink &sink)
template<typename EventT >
void subscribe (EventSink &sink)
template<typename EventT >
void unsubscribe (EventSink &sink)

Friends

class EventSink

Additional Inherited Members

- Protected Member Functions inherited from cxxtools::NonCopyable
 NonCopyable ()

Detailed Description

Sends Events to receivers in other threads.

The Signal class is not thread-safe and can only be used for intra-thread communication. To pass Events between different threads use an EventSource instead. Thread-safety only refers to the usage of the EventSource itself (connection, disconnecting...) and not the slot. Construction and destruction must always occur in isolation.

Constructor & Destructor Documentation

cxxtools::EventSource::EventSource ( )
cxxtools::EventSource::~EventSource ( )

Member Function Documentation

void cxxtools::EventSource::connect ( EventSink sink)
void cxxtools::EventSource::disconnect ( EventSink sink)
void cxxtools::EventSource::send ( const cxxtools::Event ev)
template<typename EventT >
void cxxtools::EventSource::subscribe ( EventSink sink)
inline
template<typename EventT >
void cxxtools::EventSource::unsubscribe ( EventSink sink)
inline

Friends And Related Function Documentation

friend class EventSink
friend

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