28 #ifndef YSL_INC_Core_Task_h_
29 #define YSL_INC_Core_Task_h_ 1
32 #include YFM_YSLib_Core_YApplication
41 template<
typename _fCallable>
55 template<
typename _fCallable>
69 template<
typename _fCallable>
72 static_assert(std::is_object<_fCallable>::value,
73 "Callable object type is needed.");
82 template<
typename _fUpdater>
92 DefCvt(const ynothrow, const Callable&, *this)
#define yforward(_expr)
根据参数类型使用 std::forward 传递对应参数。
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
void Renew(_fCallable update, Priority prior=Messaging::NormalPriority)
按更新条件和优先级通过消息队列部署任务。
virtual DefDeDtor(GAutoTask) DefCvt(ynothrow
yconstexpr Priority NormalPriority(0x80)
默认消息优先级。
#define DefCvt(_q, _t,...)
GAutoTask(_fUpdater f, Priority prior=NormalPriority)
void PostTask(_fCallable &&f, Messaging::Priority prior=Messaging::NormalPriority)
通过消息队列部署后任务。