diff options
Diffstat (limited to 'source/external/Luax/luax_class.hpp')
-rw-r--r-- | source/external/Luax/luax_class.hpp | 79 |
1 files changed, 1 insertions, 78 deletions
diff --git a/source/external/Luax/luax_class.hpp b/source/external/Luax/luax_class.hpp index fd9f75a..12eb268 100644 --- a/source/external/Luax/luax_class.hpp +++ b/source/external/Luax/luax_class.hpp @@ -13,88 +13,13 @@ #include "luax_memberref.h" #include "luax_cfunctions.h" #include "luax_watchdog.h" +#include "luax_utility.h" namespace Luax { class LuaxVM; -/// -/// RegisterLuaxClass עķͳԱö١ȵclass table -/// LuaxGetFactoryName ùͬʱעʱעΪsingletonͨ -/// ʱ -/// -#define LUAX_DECL_FACTORY(type, ...) \ - friend class Luax::LuaxState; \ - friend class Luax::LuaxNativeClass<type,##__VA_ARGS__>; \ - static void RegisterLuaxClass(Luax::LuaxState&); \ - static void RegisterLuaxPostprocess(Luax::LuaxState&); \ - static const char* GetLuaxFactoryName() { return #type; };\ - static const char* GetLuaxClassName() { return #type; };\ - static bool IsLuaxClassSingleton() { return false; } - -/// -/// Ϊijʹô˺꣬עһڣעắеãעЩ -/// -/// -#define LUAX_DECL_ABSTRACT_FACTORY() \ - static void RegisterLuaxClass(Luax::LuaxState&);\ - static void RegisterLuaxPostprocess(Luax::LuaxState&) - -/// -/// RegisterLuaxClass עķͳԱö١ȵclass table -/// LuaxGetSingletonName õ -/// -#define LUAX_DECL_SINGLETON(type, ...) \ - friend class Luax::LuaxState; \ - friend class Luax::LuaxNativeClass<type,##__VA_ARGS__>; \ - static void RegisterLuaxClass(Luax::LuaxState&); \ - static void RegisterLuaxPostprocess(Luax::LuaxState&); \ - static const char* GetLuaxSingletonName() { return #type; }; \ - static const char* GetLuaxClassName() { return #type; }; \ - static bool IsLuaxClassSingleton() { return true; } - -#define LUAX_DECL_METHOD(mtd) static int mtd(lua_State* L) - -#define LUAX_DECL_ENUM(e, under_line_index) - -/// -/// ʵֵĺꡣһL -/// -#define LUAX_IMPL_METHOD(type, f) int type::f(lua_State* L) - -/// -/// Ӧóʵֵӿڡһstate -/// -#define LUAX_REGISTRY(type) void type::RegisterLuaxClass(Luax::LuaxState& state) -#define LUAX_POSTPROCESS(type) void type::RegisterLuaxPostprocess(Luax::LuaxState& state) - -/// -/// עĺꡣ֮ǰÿɱ꣬ûluaclastable refûעԡ -/// -#define LUAX_REGISTER_FACTORY(state, param) state.RegisterFactory<param>() -#define LUAX_REGISTER_SINGLETON(state, param) state.RegisterSingleton<param>() -#define LUAX_REGISTER_ABSTRACT_FACTORY(state, type) type::RegisterLuaxPostprocess(state) -#define LUAX_REGISTER_METHODS(state, ...) \ - do{ \ - luaL_Reg __m[] = {__VA_ARGS__,{0, 0}}; \ - state.RegisterMethods(__m); \ - }while(0) -#define LUAX_REGISTER_ENUM(state, name, ...) \ - do{ \ - Luax::LuaxEnum __e[] = {__VA_ARGS__,{0, 0}}; \ - state.RegisterEnum(name, __e); \ - }while(0) - -#define LUAX_PREPARE(L, T) \ - LUAX_STATE(L); \ - T* self = state.GetUserdata<T>(1); - -#define LUAX_INHERIT(state, type) type::RegisterLuaxClass(state) - -#define luaxport private - - /// /// ࣬Ϊʵֶ̬ҪЩӿڵⲿҪ̳д֮࣬оͻ /// öӦʵķע̳дʱʵķʵLuaxNativeClassУʵֻ @@ -244,9 +169,7 @@ namespace Luax /// LuaxWeakRef mUserdata; - /// /// ͨɾ - /// LuaxWatchDog mWatchDog; #if LUAX_PROFILER |