diff options
author | chai <chaifix@163.com> | 2019-03-19 23:06:27 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-03-19 23:06:27 +0800 |
commit | 1497dccd63a84b7ee2b229b1ad9c5c02718f2a78 (patch) | |
tree | f8d1bff50da13e126d08c7345653e002e293202d /Source/3rdParty/Luax/luax_ref.cpp | |
parent | 5e2a973516e0729b225da9de0b03015dc5854ac4 (diff) |
*rename
Diffstat (limited to 'Source/3rdParty/Luax/luax_ref.cpp')
-rw-r--r-- | Source/3rdParty/Luax/luax_ref.cpp | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/Source/3rdParty/Luax/luax_ref.cpp b/Source/3rdParty/Luax/luax_ref.cpp deleted file mode 100644 index 544861d..0000000 --- a/Source/3rdParty/Luax/luax_ref.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "luax_runtime.h" -#include "luax_ref.h" - -namespace Luax -{ - - LuaxRef::LuaxRef(int mode) - : mRefID(LUA_NOREF) - , mMode(mode) - { - } - - LuaxRef::~LuaxRef() - { - } - - LuaxRef::operator bool() - { - return (mRefID != LUA_NOREF); - } - - bool LuaxRef::PushRef(LuaxState& state) - { - assert(mRefID != LUA_NOREF); - - LuaxRuntime& runtime = LuaxRuntime::Get(); - - if (mMode == STRONG_REF) - { - LuaxRefTable& table = runtime[state.GetHandle()].strongRefTable; - table.PushRef(state, mRefID); - } - else if (mMode == WEAK_REF) - { - LuaxRefTable& table = runtime[state.GetHandle()].weakRefTable; - table.PushRef(state, mRefID); - } - else - { - return false; - } - } - - void LuaxRef::SetRef(LuaxState& state, int idx) - { - LuaxRuntime& runtime = LuaxRuntime::Get(); - if (mMode == STRONG_REF) - { - LuaxRefTable& table = runtime[state.GetHandle()].strongRefTable; - mRefID = table.Ref(state, idx); - } - else if (mMode == WEAK_REF) - { - LuaxRefTable& table = runtime[state.GetHandle()].weakRefTable; - mRefID = table.Ref(state, idx); - } - } - - LuaxStrongRef::LuaxStrongRef() - : LuaxRef(STRONG_REF) - { - } - - LuaxWeakRef::LuaxWeakRef() - : LuaxRef(WEAK_REF) - { - } - -} |