ngl_server 1.0
基于 Actor 模型的 C++ 服务器框架
ngl::tools::wheel_parm Struct Reference

轮子类前向声明 More...

#include <tools_time_wheel.h>

Public Attributes

int64_t m_timerstart = 0
 定时器启动时间(毫秒)
int64_t m_ms = 0
 延迟时间(毫秒),插入后变为绝对到期时间
std::function< int64_t(int64_t)> m_intervalms = nullptr
 间隔计算函数
int m_count = 0
 触发次数,<=0 表示"永远重复"
void * m_pram = nullptr
 用户自定义数据指针
std::function< void(const wheel_node *)> m_fun = nullptr
 定时器回调函数

Detailed Description

轮子类前向声明

时间轮定时器参数

定义定时器的触发条件、回调函数和用户数据。

Member Data Documentation

◆ m_fun

std::function<void(const wheel_node*)> ngl::tools::wheel_parm::m_fun = nullptr

定时器回调函数

Parameters
node时间轮节点指针

◆ m_intervalms

std::function<int64_t(int64_t)> ngl::tools::wheel_parm::m_intervalms = nullptr

间隔计算函数

返回正间隔值会重新调度定时器。返回 <= 0 会在当前触发后停止重复调度。

Parameters
当前时间
Returns
下次触发的间隔(毫秒)

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