summaryrefslogtreecommitdiff
path: root/Runtime/Lua/LuaBind/LuaBindUtility.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-10-23 00:31:25 +0800
committerchai <chaifix@163.com>2021-10-23 00:31:25 +0800
commitdf0444f85f9bf623cc886e1632e624ef20cb0f1b (patch)
tree4aff1454312540f137bb318349b48e58d9b06d80 /Runtime/Lua/LuaBind/LuaBindUtility.h
parent4dafefe46a72ba47468b13d011f8299055081b0f (diff)
-member table
Diffstat (limited to 'Runtime/Lua/LuaBind/LuaBindUtility.h')
-rw-r--r--Runtime/Lua/LuaBind/LuaBindUtility.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/Runtime/Lua/LuaBind/LuaBindUtility.h b/Runtime/Lua/LuaBind/LuaBindUtility.h
index fd39f47..94f2e9c 100644
--- a/Runtime/Lua/LuaBind/LuaBindUtility.h
+++ b/Runtime/Lua/LuaBind/LuaBindUtility.h
@@ -3,18 +3,18 @@
// 导出native接口
-// RegisterClass 注册类的方法和成员,比如枚举、常量等到class table GetFactoryName 获得工厂的类名,
+// RegisterClass 注册类的方法和成员,比如枚举、常量等到class table GetNativeClassName 获得工厂的类名,
// 同时用来避免注册时错误注册为了singleton,通过编译时报错避免
-#define LUA_BIND_DECL_FACTORY(type, ...) \
+#define LUA_BIND_DECL_CLASS(type, ...) \
friend class ::State; \
friend class ::NativeClass<type,##__VA_ARGS__>; \
static void RegisterClass(::State&); \
static void RegisterPostprocess(::State&); \
- static const char* GetFactoryName() { return #type; };\
+ static const char* GetNativeClassName() { return #type; };\
static const char* GetClassName() { return #type; };
// 作为基类的抽象工厂类可以使用此宏,注册一个入口,在派生类的注册函数中调用,注册基类的这些方法。
-#define LUA_BIND_DECL_ABSTRACT_FACTORY() \
+#define LUA_BIND_DECL_ABSTRACT_CLASS() \
static void RegisterClass(::State&);\
static void RegisterPostprocess(::State&)
@@ -30,8 +30,8 @@
#define LUA_BIND_POSTPROCESS(type) void type::RegisterPostprocess(::State& state)
// 用来注册的宏。之前这里忘了用可变宏,导致没有luaclastable ref没有注册对。
-#define LUA_BIND_REGISTER_FACTORY(state, param) state.RegisterFactory<param>()
-#define LUA_BIND_REGISTER_ABSTRACT_FACTORY(state, type) type::RegisterPostprocess(state)
+#define LUA_BIND_REGISTER_CLASS(state, param) state.RegisterNativeClass<param>()
+#define LUA_BIND_REGISTER_ABSTRACT_CLASS(state, type) type::RegisterPostprocess(state)
#define LUA_BIND_REGISTER_METHODS(state, ...) \
do{ \
luaL_Reg __m[] = {__VA_ARGS__,{0, 0}}; \