1 #ifndef LIBFILEZILLA_INVOKER_HEADER
2 #define LIBFILEZILLA_INVOKER_HEADER
13 struct invoker_event_type{};
16 typedef simple_event<invoker_event_type, std::function<void()>> invoker_event;
19 class FZ_PUBLIC_SYMBOL thread_invoker final :
public event_handler
22 thread_invoker(event_loop& loop);
23 virtual ~thread_invoker();
25 virtual void operator()(event_base
const& ev)
override;
38 return [handler = thread_invoker(loop), cf = std::forward<F>(f)](
auto &&... args)
mutable -> decltype(f(std::forward<decltype(args)>(args)...), void())
40 auto cb = [cf = std::move(cf), targs = std::make_tuple(std::forward<decltype(args)>(args)...)] {
54 typedef std::function<void(std::function<
void()>)> invoker_factory;
74 return [inv, cf = std::forward<F>(f)](
auto &&... args)
mutable -> decltype(f(std::forward<decltype(args)>(args)...), void())
76 auto cb = [cf = std::move(cf), targs = std::make_tuple(std::forward<decltype(args)>(args)...)] {