30#ifndef PT_SYSTEM_EVENTSOURCE_H
31#define PT_SYSTEM_EVENTSOURCE_H
33#include <Pt/System/Api.h>
34#include <Pt/System/Mutex.h>
35#include <Pt/System/EventSink.h>
63 friend class EventSink;
88 template <
typename EventT>
96 template <
typename EventT>
107 void subscribe(
EventSink& sink,
const std::type_info& ti);
110 void unsubscribe(
EventSink& sink,
const std::type_info& ti);
115 typedef std::multimap<
const std::type_info*,
117 CompareEventTypeInfo > SinkMap;
121 mutable SinkMap _sinks;
122 mutable Sentry* _sentry;
Base class for typed events.
Definition Event.h:66
NonCopyable()
Default constructor.
Definition NonCopyable.h:63
Receiver for events.
Definition EventSink.h:56
void disconnect(EventSink &sink)
Disonnect from an EventSink.
void subscribe(EventSink &sink)
Send events of a certain type to the sink.
Definition EventSource.h:89
void connect(EventSink &sink)
Connect to an EventSink.
EventSource()
Default Constructor.
~EventSource()
Destructor.
void send(const Pt::Event &ev)
Send the event to all connected sinks.
void unsubscribe(EventSink &sink)
Do not send events of a certain type to the sink anymore.
Definition EventSource.h:97
Recursive mutual exclusion device.
Definition Mutex.h:190
System programming
Definition Connection.h:26
Core module.
Definition Allocator.h:33