|
ngl_server 1.0
基于 Actor 模型的 C++ 服务器框架
|
Lua函数绑定辅助类。 More...
#include <luafunction.h>
Public Member Functions | |
| luafunction (lua_State *aL, const char *ascriptpath, const char *afunction) | |
| 构造函数。 | |
| template<typename ... TARGS> | |
| bool | set_call (const TARGS &... args) |
| 设置调用参数。 | |
| template<typename ... TARGS> | |
| bool | set_return (TARGS &... args) |
| 设置返回值处理。 | |
| bool | call () |
| 执行Lua函数调用。 | |
Lua函数绑定辅助类。
封装Lua函数调用,提供类型安全的参数传递和返回值处理。 简化C++与Lua脚本之间的交互。
|
inline |
构造函数。
| aL | Lua状态机指针 |
| ascriptpath | 脚本文件路径 |
| afunction | 函数名称 |
|
inline |
执行Lua函数调用。
调用Lua函数并处理返回值。包括:
|
inline |
设置调用参数。
将C++参数推送到Lua栈中,并设置调用参数数量。
| TARGS | 参数类型包 |
| args | 参数值 |
|
inline |
设置返回值处理。
设置返回值数量和返回值处理函数。
| TARGS | 返回值类型包 |
| args | 返回值引用 |