NIM 跨平台 C++ SDK
载入中...
搜索中...
未找到
nim::CallbackProxy类 参考

#include <callback_proxy.h>

静态 Public 成员函数

template<typename TCallback , typename TDoCall >
static auto DoSafeCallback (const void *callback, const TDoCall &closure, bool delete_callback=false) -> decltype(closure((*(TCallback *)(callback))))
 
template<class F , class... Args, class = typename std::enable_if<!std::is_member_function_pointer<F>::value>::type>
static auto Invoke (F &&f, Args &&... args) -> decltype(f(std::forward< Args >(args)...))
 
template<class R , class C , class... DArgs, class P , class... Args>
static R Invoke (R(C::*f)(DArgs...) const, P &&p, Args &&... args)
 
template<class R , class C , class... DArgs, class P , class... Args>
static R Invoke (R(C::*f)(DArgs...), P &&p, Args &&... args)
 

静态 Public 属性

static std::function< void(const std::function< void()> &)> docallback_async_ = nullptr
 

静态 Protected 成员函数

template<typename TR >
static TR Run (const CallbackProxyClosure< TR > &task)
 
template<>
void Run (const CallbackProxyClosure< void > &task)
 
template<>
void Run (const CallbackProxyClosure< void > &task)
 

Private 类型

template<typename TR = void>
using CallbackProxyClosure = std::function<TR(void)>
 

成员类型定义说明

◆ CallbackProxyClosure

template<typename TR = void>
using nim::CallbackProxy::CallbackProxyClosure = std::function<TR(void)>
private

成员函数说明

◆ DoSafeCallback()

template<typename TCallback , typename TDoCall >
static auto nim::CallbackProxy::DoSafeCallback ( const void * callback,
const TDoCall & closure,
bool delete_callback = false ) -> decltype(closure((*(TCallback*)(callback))))
inlinestatic

◆ Invoke() [1/3]

template<class F , class... Args, class = typename std::enable_if<!std::is_member_function_pointer<F>::value>::type>
static auto nim::CallbackProxy::Invoke ( F && f,
Args &&... args ) -> decltype(f(std::forward<Args>(args)...))
inlinestatic

◆ Invoke() [2/3]

template<class R , class C , class... DArgs, class P , class... Args>
static R nim::CallbackProxy::Invoke ( R(C::*)(DArgs...) const f,
P && p,
Args &&... args )
inlinestatic

◆ Invoke() [3/3]

template<class R , class C , class... DArgs, class P , class... Args>
static R nim::CallbackProxy::Invoke ( R(C::*)(DArgs...) f,
P && p,
Args &&... args )
inlinestatic

◆ Run() [1/3]

template<typename TR >
static TR nim::CallbackProxy::Run ( const CallbackProxyClosure< TR > & task)
inlinestaticprotected

◆ Run() [2/3]

template<>
void nim::CallbackProxy::Run ( const CallbackProxyClosure< void > & task)
staticprotected

◆ Run() [3/3]

template<>
void nim::CallbackProxy::Run ( const CallbackProxyClosure< void > & task)
staticprotected

类成员变量说明

◆ docallback_async_

std::function< void(const std::function< void()> &)> nim::CallbackProxy::docallback_async_ = nullptr
static

该类的文档由以下文件生成: