|
libxr
1.0
Want to be the best embedded framework
|
回调函数封装块,提供参数绑定与擦除调用入口 / Callback block with bound argument and erased invoke entry More...
#include <libxr_cb.hpp>
Public Types | |
| using | FunctionType = void (*)(bool, ArgType, Args...) |
| 回调函数类型定义 / Callback function type definition | |
Public Types inherited from LibXR::CallbackBlockHeader< Args... > | |
| using | InvokeFunType |
Public Member Functions | |
| CallbackBlock (FunctionType fun, ArgType &&arg) | |
| 构造回调块,绑定回调函数与参数 / Construct a callback block with bound function and argument | |
| CallbackBlock (const CallbackBlock &other)=delete | |
| 禁用拷贝构造与拷贝赋值 / Copy construction and copy assignment are disabled | |
| CallbackBlock & | operator= (const CallbackBlock &other)=delete |
Static Public Member Functions | |
| static void | InvokeThunk (void *cb_block, bool in_isr, Args... args) |
Protected Member Functions | |
| void | Invoke (bool in_isr, Args... args) |
Protected Attributes | |
| FunctionType | fun_ |
| 绑定的回调函数 / Bound callback function | |
| ArgType | arg_ |
| 绑定的参数 / Bound argument | |
Additional Inherited Members | |
Data Fields inherited from LibXR::CallbackBlockHeader< Args... > | |
| InvokeFunType | run_fun_ |
回调函数封装块,提供参数绑定与擦除调用入口 / Callback block with bound argument and erased invoke entry
| ArgType | 绑定的第一个参数类型 / Type of the first bound argument |
| Args | 额外的参数类型列表 / Additional argument types |
Definition at line 29 of file libxr_cb.hpp.
| using LibXR::CallbackBlock< ArgType, Args >::FunctionType = void (*)(bool, ArgType, Args...) |
回调函数类型定义 / Callback function type definition
Definition at line 35 of file libxr_cb.hpp.
|
inline |
构造回调块,绑定回调函数与参数 / Construct a callback block with bound function and argument
工厂层已经把 fun 收窄到了当前块真实需要的函数指针类型,因此这里不再保留 额外的模板参数做二次推导。 The factory has already narrowed fun to the exact function-pointer type required by this block, so there is no need to keep another template parameter here.
| fun | 需要调用的回调函数 / Callback function to be invoked |
| arg | 绑定的参数值 / Bound argument value |
Definition at line 49 of file libxr_cb.hpp.
|
inlineprotected |
Definition at line 67 of file libxr_cb.hpp.
|
inlinestatic |
Definition at line 60 of file libxr_cb.hpp.
|
protected |
绑定的参数 / Bound argument
Definition at line 77 of file libxr_cb.hpp.
|
protected |
绑定的回调函数 / Bound callback function
Definition at line 76 of file libxr_cb.hpp.