From 1497dccd63a84b7ee2b229b1ad9c5c02718f2a78 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 19 Mar 2019 23:06:27 +0800 Subject: *rename --- Source/3rdParty/Luax/luax_runtime.cpp | 89 ----------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 Source/3rdParty/Luax/luax_runtime.cpp (limited to 'Source/3rdParty/Luax/luax_runtime.cpp') diff --git a/Source/3rdParty/Luax/luax_runtime.cpp b/Source/3rdParty/Luax/luax_runtime.cpp deleted file mode 100644 index b45d36a..0000000 --- a/Source/3rdParty/Luax/luax_runtime.cpp +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef __LUAX_RUNTIME_H_ -#define __LUAX_RUNTIME_H_ - -#include "luax_runtime.h" - -using namespace std; - -namespace Luax -{ - - LuaxRuntime* LuaxRuntime::mRuntime = nullptr; - - LuaxRuntime::LuaxRuntime() {}; - LuaxRuntime::~LuaxRuntime() {}; - - LuaxRuntime& LuaxRuntime::Get() - { - if (mRuntime == nullptr) - mRuntime = new LuaxRuntime(); - - return *mRuntime; - } - - lua_State* LuaxRuntime::Open() - { - lua_State* L = lua_open(); - assert(L); - - // 1) ¼ÓÈë - mContexts.insert(pair(L, LuaxContext(L))); - // 2) ³õʼ»¯context - (*this)[L].Setup(); - - return L; - } - - void LuaxRuntime::Close(lua_State* L) - { - map::iterator it = mContexts.find(L); - if (it != mContexts.end()) - { - lua_close(it->second.state); - mContexts.erase(it); - } - } - - bool LuaxRuntime::HasLuaxState(lua_State* L) - { - map::iterator it = mContexts.find(L); - return it != mContexts.end(); - } - - LuaxState& LuaxRuntime::GetLuaxState(lua_State* L) - { - map::iterator it = mContexts.find(L); - if (it != mContexts.end()) - { - return it->second.state; - } - } - - LuaxRefTable& LuaxRuntime::GetStrongRefTable(lua_State* L) - { - map::iterator it = mContexts.find(L); - if (it != mContexts.end()) - { - return it->second.strongRefTable; - } - } - - LuaxRefTable& LuaxRuntime::GetWeaksRefTable(lua_State* L) - { - map::iterator it = mContexts.find(L); - if (it != mContexts.end()) - { - return it->second.weakRefTable; - } - } - - LuaxContext& LuaxRuntime::operator[](lua_State* L) - { - map::iterator it = mContexts.find(L); - assert(it != mContexts.end()); - return it->second; - } - -} - -#endif \ No newline at end of file -- cgit v1.1-26-g67d0