diff options
Diffstat (limited to 'Runtime/Scripting/LuaBindVM.cpp')
-rw-r--r-- | Runtime/Scripting/LuaBindVM.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Runtime/Scripting/LuaBindVM.cpp b/Runtime/Scripting/LuaBindVM.cpp index ce68a80..b50a5e1 100644 --- a/Runtime/Scripting/LuaBindVM.cpp +++ b/Runtime/Scripting/LuaBindVM.cpp @@ -4,9 +4,9 @@ namespace LuaBind { - LuaBindVM::VMap LuaBindVM::VMs; // 通过线程查找虚拟机,为了方便 + VM::VMap VM::VMs; // 通过线程查找虚拟机,为了方便 - LuaBindVM* LuaBindVM::TryGetVM(global_State* gState) + VM* VM::TryGetVM(global_State* gState) { auto it = VMs.find(gState); if (it != VMs.end()) @@ -15,12 +15,12 @@ namespace LuaBind return nullptr; } - LuaBindVM* LuaBindVM::TryGetVM(lua_State* state) + VM* VM::TryGetVM(lua_State* state) { return TryGetVM(G(state)); } - LuaBindVM::LuaBindVM() + VM::VM() : mStrongRefTable() , mWeakRefTable() { @@ -28,17 +28,17 @@ namespace LuaBind assert(mMainThread); mGlobalState = G(mMainThread); - VMs.insert(std::pair<global_State*, LuaBindVM*>(mGlobalState, this)); + VMs.insert(std::pair<global_State*, VM*>(mGlobalState, this)); } - LuaBindVM::~LuaBindVM() + VM::~VM() { VMs.erase(mGlobalState); lua_close(mMainThread); } // 初始化context - void LuaBindVM::Setup() + void VM::Setup() { LUA_BIND_STATE(mMainThread); @@ -46,29 +46,29 @@ namespace LuaBind mWeakRefTable.Init(state, "_LUA_BIND_WEAKREF_TABLE", "v"); } - lua_State* LuaBindVM::CreateThread() + lua_State* VM::CreateThread() { lua_State* thread = lua_newthread(mMainThread); assert(thread); return thread; } - lua_State* LuaBindVM::GetMainThread() + lua_State* VM::GetMainThread() { return mMainThread; } - LuaBindState LuaBindVM::GetMainState() + State VM::GetMainState() { return mMainThread; } - LuaBindRefTable& LuaBindVM::GetStrongRefTable() + RefTable& VM::GetStrongRefTable() { return mStrongRefTable; } - LuaBindRefTable& LuaBindVM::GetWeakRefTable() + RefTable& VM::GetWeakRefTable() { return mWeakRefTable; } |