From 7270cd95294d53180641b05784258df1e29f90d2 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 15 Nov 2020 11:56:49 +0800 Subject: *lua BindToLua --- Runtime/Scripting/LuaBindVM.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Runtime/Scripting/LuaBindVM.h') diff --git a/Runtime/Scripting/LuaBindVM.h b/Runtime/Scripting/LuaBindVM.h index dcff44f..287f906 100644 --- a/Runtime/Scripting/LuaBindVM.h +++ b/Runtime/Scripting/LuaBindVM.h @@ -15,18 +15,18 @@ namespace LuaBind /// /// 单个lua_state相关的context。是一系列代理的集合,拷贝也没关系,主要是为了节约内存。 /// - class LuaBindVM + class VM { public: /// /// 根据global_State拿到虚拟机。 /// - static LuaBindVM* TryGetVM(global_State* gState); - static LuaBindVM* TryGetVM(lua_State* state); + static VM* TryGetVM(global_State* gState); + static VM* TryGetVM(lua_State* state); - LuaBindVM(); - ~LuaBindVM(); + VM(); + ~VM(); /// /// 创建虚拟机后,需要手动调用Setup函数,初始化一些虚拟机状态。 @@ -35,19 +35,19 @@ namespace LuaBind lua_State* GetMainThread(); lua_State* CreateThread(); - LuaBindState GetMainState(); + State GetMainState(); - LuaBindRefTable& GetStrongRefTable(); - LuaBindRefTable& GetWeakRefTable(); + RefTable& GetStrongRefTable(); + RefTable& GetWeakRefTable(); private: - typedef std::map VMap; + typedef std::map VMap; static VMap VMs; // 通过global_State索引虚拟机,为了方便 - LuaBindRefTable mStrongRefTable; // _LUA_BIND_STRONGREF_TABLE - LuaBindRefTable mWeakRefTable; // _LUA_BIND_WEAKREF_TABLE + RefTable mStrongRefTable; // _LUA_BIND_STRONGREF_TABLE + RefTable mWeakRefTable; // _LUA_BIND_WEAKREF_TABLE global_State* mGlobalState; // 虚拟机的global_State,由当前虚拟机的所有线程共享 lua_State* mMainThread; // 主线程 -- cgit v1.1-26-g67d0