Btk
Btk::Impl::AsyncInvoker< HasSignal, Callable, Args > Struct Template Reference

The AsyncInvoker. More...

#include <async.hpp>

Inheritance diagram for Btk::Impl::AsyncInvoker< HasSignal, Callable, Args >:
Collaboration diagram for Btk::Impl::AsyncInvoker< HasSignal, Callable, Args >:

Public Types

using result_type = std::invoke_result_t< Callable, Args... >
 The result type. More...
 

Public Member Functions

 AsyncInvoker (Callable &&_callable, Args &&..._args)
 
result_type invoke ()
 Invoke the callable. More...
 
void run ()
 Run the invoker. More...
 
template<class T = std::enable_if<HasSignal>>
void emit ()
 Emit the signal impl. More...
 
- Public Member Functions inherited from Btk::Impl::AsyncBase< HasSignal, Callable, Args... >
 AsyncBase (Args &&...args)
 Construct a new Async Base object. More...
 
- Public Member Functions inherited from Btk::Impl::AsyncResultHolder< std::invoke_result_t< Callable, Args... > >
void cleanup ()
 
void store (T &&t)
 

Static Public Member Functions

static void Run (void *__self)
 The main entry for invoker. More...
 
template<class T = std::enable_if<HasSignal>>
static void EmitSignal (void *__self)
 Emit Signal in main thread. More...
 

Public Attributes

Callable callable
 The signal. More...
 
- Public Attributes inherited from Btk::Impl::AsyncResultHolder< std::invoke_result_t< Callable, Args... > >
union Btk::Impl::AsyncResultHolder::Data data
 

Static Public Attributes

static constexpr bool signal_has_args = not std::is_same<result_type,void>()
 Is the signal has args. More...
 
- Static Public Attributes inherited from Btk::Impl::AsyncBase< HasSignal, Callable, Args... >
static constexpr int has_signal
 

Detailed Description

template<bool HasSignal, class Callable, class ... Args>
struct Btk::Impl::AsyncInvoker< HasSignal, Callable, Args >

The AsyncInvoker.

Template Parameters
CallableThe callable type
ArgsThe args types

Member Typedef Documentation

◆ result_type

template<bool HasSignal, class Callable , class ... Args>
using Btk::Impl::AsyncInvoker< HasSignal, Callable, Args >::result_type = std::invoke_result_t<Callable,Args...>

The result type.

Member Function Documentation

◆ emit()

template<bool HasSignal, class Callable , class ... Args>
template<class T = std::enable_if<HasSignal>>
void Btk::Impl::AsyncInvoker< HasSignal, Callable, Args >::emit ( )
inline

Emit the signal impl.

◆ EmitSignal()

template<bool HasSignal, class Callable , class ... Args>
template<class T = std::enable_if<HasSignal>>
static void Btk::Impl::AsyncInvoker< HasSignal, Callable, Args >::EmitSignal ( void *  __self)
inlinestatic

Emit Signal in main thread.

Parameters
__selfThe invoker ptr

◆ invoke()

template<bool HasSignal, class Callable , class ... Args>
result_type Btk::Impl::AsyncInvoker< HasSignal, Callable, Args >::invoke ( )
inline

Invoke the callable.

Returns
The callable's result

◆ run()

template<bool HasSignal, class Callable , class ... Args>
void Btk::Impl::AsyncInvoker< HasSignal, Callable, Args >::run ( )
inline

Run the invoker.

◆ Run()

template<bool HasSignal, class Callable , class ... Args>
static void Btk::Impl::AsyncInvoker< HasSignal, Callable, Args >::Run ( void *  __self)
inlinestatic

The main entry for invoker.

Parameters
__selfThe invoker's ptr

Member Data Documentation

◆ callable

template<bool HasSignal, class Callable , class ... Args>
Callable Btk::Impl::AsyncInvoker< HasSignal, Callable, Args >::callable

The signal.

Note
It will be emit after exec

◆ signal_has_args

template<bool HasSignal, class Callable , class ... Args>
constexpr bool Btk::Impl::AsyncInvoker< HasSignal, Callable, Args >::signal_has_args = not std::is_same<result_type,void>()
static

Is the signal has args.


The documentation for this struct was generated from the following file: