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

定时器参数结构体。 More...

#include <nprotocol.h>

Public Attributes

int m_type = 0
 定时器类型,参见 E_ACTOR_TIMER 枚举
int64_t m_timerid = 0
 定时器唯一标识符,用于后续查询和取消
int64_t m_ms = 0
 当前墙钟时间(毫秒),用于计算触发时间
int m_count = 1
 总触发次数;<=0 表示无限次循环触发
std::function< int64_t(int64_t)> m_intervalms = nullptr
 计算下一次触发间隔的回调函数,参数为当前时间戳,返回下次间隔毫秒数
std::shared_ptr< void > m_parm = nullptr
 可选的用户自定义参数,可在定时器回调中获取
int64_t m_triggerms = 0
 当前触发的绝对时间(毫秒时间戳)

Detailed Description

定时器参数结构体。

封装了定时器的所有配置参数,用于创建和管理各种类型的定时任务。 支持一次性触发和循环触发两种模式。


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