模板化协议处理类,支持Lua绑定和协议映射。
More...
#include <tprotocol.h>
|
| static bool | set_customs_index (int32_t acustoms) |
| | 在注册块运行前设置下一个自定义协议ID基数。
|
| template<typename ... ARGS> |
| static void | tp_customs (int32_t aprotocolnum=-1, int32_t ahigh=0) |
| | 注册一个或多个自定义C++协议。
|
| template<typename ... ARGS> |
| static void | tp_customs_script (int32_t aprotocolnum=-1, int32_t ahigh=0) |
| | 注册一个或多个自定义协议并为其暴露脚本发送桥接。
|
| template<typename T> |
| static bool | init_protobufs () |
| | 从xmlprotocol元数据延迟解析protobuf支持的协议ID。
|
| template<typename T> |
| static info * | get () |
| | 解析C++类型的元数据块,如需要则延迟创建。
|
|
static info * | get (const char *aname) |
|
template<typename T, typename ... TAGES> |
| static bool | set_hightvalue (int32_t ahightlevel) |
|
template<typename T> |
| static i32_protocolnum | protocol () |
|
static info * | get (i32_protocolnum aprotocol) |
|
static const char * | name (i32_protocolnum aprotocol) |
|
static std::optional< int32_t > | highvalue (i32_protocolnum aprotocol) |
|
static void | allprotocol (std::map< i32_protocolnum, std::string > &amap) |
模板化协议处理类,支持Lua绑定和协议映射。
提供基于模板的协议处理函数注册、协议名称到处理函数的映射, 以及支持Lua脚本绑定的协议处理机制。
◆ get()
template<typename T>
| info * ngl::tprotocol::get |
( |
| ) |
|
|
inlinestatic |
解析C++类型的元数据块,如需要则延迟创建。
- Template Parameters
-
- Returns
- 协议信息指针,失败返回nullptr。
◆ init_protobufs()
template<typename T>
| bool ngl::tprotocol::init_protobufs |
( |
| ) |
|
|
inlinestatic |
从xmlprotocol元数据延迟解析protobuf支持的协议ID。
- Template Parameters
-
- Returns
- 解析成功返回true,失败返回false。
◆ set_customs_index()
| bool ngl::tprotocol::set_customs_index |
( |
int32_t | acustoms | ) |
|
|
inlinestatic |
在注册块运行前设置下一个自定义协议ID基数。
- Parameters
-
- Returns
- 始终返回true。
◆ tp_customs()
template<typename ... ARGS>
| void ngl::tprotocol::tp_customs |
( |
int32_t | aprotocolnum = -1, |
|
|
int32_t | ahigh = 0 ) |
|
inlinestatic |
注册一个或多个自定义C++协议。
- Template Parameters
-
- Parameters
-
| aprotocolnum | 协议ID,-1表示自动分配。 |
| ahigh | 优先级值。 |
◆ tp_customs_script()
template<typename ... ARGS>
| void ngl::tprotocol::tp_customs_script |
( |
int32_t | aprotocolnum = -1, |
|
|
int32_t | ahigh = 0 ) |
|
inlinestatic |
注册一个或多个自定义协议并为其暴露脚本发送桥接。
- Template Parameters
-
- Parameters
-
| aprotocolnum | 协议ID,-1表示自动分配。 |
| ahigh | 优先级值。 |
The documentation for this class was generated from the following files: