Wire Sysio Wire Sysion 1.0.0
|
#include <channel.hpp>
Classes | |
class | handle |
Public Member Functions | |
void | publish (int priority, const Data &data) |
template<typename Callback > | |
handle | subscribe (Callback cb) |
auto | set_dispatcher (const DispatchPolicy &policy) -> std::enable_if_t< std::is_copy_constructible< DispatchPolicy >::value, void > |
bool | has_subscribers () |
Friends | |
class | appbase::application |
A channel is a loosely bound asynchronous data pub/sub concept.
This removes the need to tightly couple different plugins in the application for the use-case of sending data around
Data passed to a channel is copied, consider using a shared_ptr if the use-case allows it
Data | - the type of data to publish |
Definition at line 47 of file channel.hpp.
|
inline |
Returns whether or not there are subscribers
Definition at line 129 of file channel.hpp.
void appbase::channel< Data, DispatchPolicy >::publish | ( | int | priority, |
const Data & | data ) |
Publish data to a channel. This data is copied on publish.
priority | - the priority to use for post |
data | - the data to publish |
Definition at line 335 of file application.hpp.
|
inline |
set the dispatcher according to the DispatchPolicy this can be used to set a stateful dispatcher
This method is only available when the DispatchPolicy is copy constructible due to implementation details
policy | - the DispatchPolicy to copy |
Definition at line 121 of file channel.hpp.
|
inline |
subscribe to data on a channel
Callback | the type of the callback (functor|lambda) |
cb | the callback |
Definition at line 109 of file channel.hpp.
|
friend |
Definition at line 173 of file channel.hpp.