7#include <boost/signals2.hpp>
8#include <boost/exception/diagnostic_information.hpp>
18 template<
typename FunctionSig>
21 template<
typename Ret,
typename ... Args>
35 template<
typename InputIterator>
36 Ret
operator()(InputIterator first, InputIterator last) {
38 while (first != last) {
46 err += boost::current_exception_diagnostic_information();
52 throw std::length_error(std::string(
"No Result Available, All providers returned exceptions[") + err +
"]");
56 template<
typename ... Args>
70 template<
typename InputIterator>
71 void operator()(InputIterator first, InputIterator last) {
74 while (first != last) {
82 err += boost::current_exception_diagnostic_information();
88 throw std::length_error(std::string(
"No Result Available, All providers returned exceptions[") + err +
"]");
96 template<
typename FunctionSig>
99 template<
typename Ret,
typename ... Args>
112 template<
typename InputIterator>
118 template<
typename ... Args>
131 template<
typename InputIterator>
138 template<
typename FunctionSig,
typename DispatchPolicy>
141 template<
typename Ret,
typename ...Args,
typename DispatchPolicy>
144 using signal_type = boost::signals2::signal<Ret(Args...), DispatchPolicy>;
157 return _signal(std::forward<Args>(args)...);
163 template<
typename ...Args,
typename DispatchPolicy>
166 using signal_type = boost::signals2::signal<void(Args...), DispatchPolicy>;
179 _signal(std::forward<Args>(args)...);
196 template<
typename FunctionSig,
typename DispatchPolicy>
214 if (_handle.connected()) {
215 _handle.disconnect();
229 using handle_type = boost::signals2::connection;
238 handle(handle_type&& _handle)
239 :_handle(
std::move(_handle))
279 return reinterpret_cast<method*
>(ptr.get());
300 template<
typename Tag,
typename FunctionSig,
template <
typename>
class DispatchPolicy =
first_success_policy>
306 template <
typename Tag,
typename FunctionSig,
template <
typename>
class DispatchPolicy>
311 template <
typename T>
317#pragma pop_macro("N")
Ret operator()(Args &&... args)
boost::signals2::signal< Ret(Args...), DispatchPolicy > signal_type
boost::signals2::signal< void(Args...), DispatchPolicy > signal_type
void operator()(Args &&... args)
handle(handle &&)=default
handle & operator=(handle &&rhs)=default
handle(const handle &)=delete
static erased_method_ptr make_unique()
static method * get_method(erased_method_ptr &ptr)
handle register_provider(T provider, int priority=0)
static void deleter(void *erased_method_ptr)
virtual ~method()=default
std::true_type is_method_decl_impl(const method_decl< Tag, FunctionSig, DispatchPolicy > *)
decltype(is_method_decl_impl(std::declval< T * >())) is_method_decl
std::unique_ptr< void, void(*)(void *)> erased_method_ptr
#define T(meth, val, expected)
Ret operator()(InputIterator first, InputIterator)
void operator()(InputIterator first, InputIterator)
Ret operator()(InputIterator first, InputIterator last)
void operator()(InputIterator first, InputIterator last)