RSB
0.19.0
|
Maps scopes to sets of sinks of type T. More...
#include <ScopeDispatcher.h>
Public Member Functions | |
bool | empty () const |
Indicates whether there are scopes with associated sinks. More... | |
size_t | size () const |
Returns number of scopes with associated sinks. More... | |
void | addSink (const Scope &scope, const T &sink) |
Associates sink with scope. More... | |
void | removeSink (const Scope &scope, const T &sink) |
Removes sink from the list of sinks associated to scope. More... | |
void | mapSinks (const Scope &scope, boost::function< void(const T &)> function) const |
Calls function for each sink associated to scope-scopes of scope. More... | |
void | mapAllSinks (boost::function< void(const T &)> function) const |
Calls function for each sink in the dispatcher. More... | |
Protected Types | |
typedef std::list< T > | SinkList |
typedef std::map< Scope, SinkList > | SinkMap |
Protected Attributes | |
SinkMap | sinks |
Maps scopes to sets of sinks of type T.
Sinks are usually objects to which events are dispatched based on their scopes.
Definition at line 51 of file ScopeDispatcher.h.
|
protected |
Definition at line 145 of file ScopeDispatcher.h.
|
protected |
Definition at line 146 of file ScopeDispatcher.h.
|
inline |
Associates sink with scope.
scope | The scope with which sink should be associated. |
sink | The sink which should be added to the list of sinks associated to scope. |
Definition at line 79 of file ScopeDispatcher.h.
Referenced by rsb::transport::socket::BusImpl::addSink().
|
inline |
Indicates whether there are scopes with associated sinks.
Definition at line 59 of file ScopeDispatcher.h.
Referenced by rsb::transport::socket::BusImpl::~BusImpl().
|
inline |
Calls function for each sink in the dispatcher.
function | The function that should be called for each sink. |
Definition at line 134 of file ScopeDispatcher.h.
|
inline |
Calls function for each sink associated to scope-scopes of scope.
Relevant sinks are computed by taking the union of the sinks respectively associated to all super-scopes of scope.
scope | Determines relevant sinks. |
function | The function that should be called for each relevant sink. |
Definition at line 112 of file ScopeDispatcher.h.
|
inline |
Removes sink from the list of sinks associated to scope.
scope | The scope from which sink should be removed. |
sink | The sink which should be removed from the list of sinks associated to scope. |
Definition at line 90 of file ScopeDispatcher.h.
|
inline |
Returns number of scopes with associated sinks.
Definition at line 68 of file ScopeDispatcher.h.
Referenced by rsb::transport::socket::BusImpl::printContents(), and rsb::transport::socket::BusImpl::~BusImpl().
|
protected |
Definition at line 148 of file ScopeDispatcher.h.
Referenced by rsb::eventprocessing::ScopeDispatcher< boost::weak_ptr< InConnector > >::addSink(), rsb::eventprocessing::ScopeDispatcher< boost::weak_ptr< InConnector > >::empty(), rsb::eventprocessing::ScopeDispatcher< boost::weak_ptr< InConnector > >::mapAllSinks(), rsb::eventprocessing::WeakScopeDispatcher< InConnector >::mapAllSinks(), rsb::eventprocessing::ScopeDispatcher< boost::weak_ptr< InConnector > >::mapSinks(), rsb::eventprocessing::WeakScopeDispatcher< InConnector >::mapSinks(), rsb::eventprocessing::ScopeDispatcher< boost::weak_ptr< InConnector > >::removeSink(), rsb::eventprocessing::WeakScopeDispatcher< InConnector >::removeSink(), and rsb::eventprocessing::ScopeDispatcher< boost::weak_ptr< InConnector > >::size().