7#include <boost/asio.hpp>
8#include <boost/signals2.hpp>
9#include <boost/exception/diagnostic_information.hpp>
23 template<
typename InputIterator>
25 while (first != last) {
46 template<
typename Data,
typename DispatchPolicy>
64 if (_handle.connected()) {
79 using handle_type = boost::signals2::connection;
88 handle(handle_type&& _handle)
89 :_handle(
std::move(_handle))
108 template<
typename Callback>
110 return handle(_signal.connect(cb));
121 auto set_dispatcher(
const DispatchPolicy& policy ) -> std::enable_if_t<std::is_copy_constructible<DispatchPolicy>::value,
void>
123 _signal.set_combiner(policy);
130 auto connections = _signal.num_slots();
131 return connections > 0;
139 virtual ~channel() =
default;
159 return reinterpret_cast<channel*
>(ptr.get());
171 boost::signals2::signal<void(
const Data&), DispatchPolicy> _signal;
182 template<
typename Tag,
typename Data,
typename DispatchPolicy = drop_exceptions >
188 template <
typename...Ts>
193 template <
typename T>
197#pragma pop_macro("N")
handle(handle &&)=default
handle & operator=(handle &&rhs)=default
handle(const handle &)=delete
handle subscribe(Callback cb)
void publish(int priority, const Data &data)
auto set_dispatcher(const DispatchPolicy &policy) -> std::enable_if_t< std::is_copy_constructible< DispatchPolicy >::value, void >
std::true_type is_channel_decl_impl(const channel_decl< Ts... > *)
decltype(is_channel_decl_impl(std::declval< T * >())) is_channel_decl
std::unique_ptr< void, void(*)(void *)> erased_channel_ptr
result_type operator()(InputIterator first, InputIterator last)
drop_exceptions()=default