aboutsummaryrefslogtreecommitdiff
path: root/src/lua/common/je_lua_function.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-12 21:58:05 +0800
committerchai <chaifix@163.com>2018-11-12 21:58:05 +0800
commitaf62f267a24091a16cbafe844d59cdbd4e78f5b1 (patch)
tree3862cee497b30a9c54761c7cd60c5de5af4a78d3 /src/lua/common/je_lua_function.h
parent72e45f0062d727cedd576d1e1251f6722454a119 (diff)
*使用int做状态机key
Diffstat (limited to 'src/lua/common/je_lua_function.h')
-rw-r--r--src/lua/common/je_lua_function.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/lua/common/je_lua_function.h b/src/lua/common/je_lua_function.h
new file mode 100644
index 0000000..a2d5ccc
--- /dev/null
+++ b/src/lua/common/je_lua_function.h
@@ -0,0 +1,46 @@
+#ifndef __JIN_COMMON_FUNCTION_H
+#define __JIN_COMMON_FUNCTION_H
+
+#include <vector>
+
+#include "libjin/jin.h"
+#include "../luax.h"
+#include "je_lua_reference.h"
+
+namespace JinEngine
+{
+ namespace Lua
+ {
+
+ class LuaFunc
+ {
+ public:
+ LuaFunc(lua_State* L);
+ ~LuaFunc();
+
+ ///
+ ///
+ ///
+ void setFunc(int i, uint nresults);
+
+ ///
+ ///
+ ///
+ void pushParam(int i);
+
+ ///
+ ///
+ ///
+ uint call();
+
+ private:
+ LuaRef* mLuaFunc;
+ std::vector<LuaRef*> mParams;
+ lua_State* mL;
+ uint mNResults;
+ };
+
+ } // namespace Lua
+} // namespace JinEngine
+
+#endif // __JIN_COMMON_REFERENCE_H \ No newline at end of file