summaryrefslogtreecommitdiff
path: root/Runtime/Scripting/LuaBindRefTable.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-10-17 23:05:01 +0800
committerchai <chaifix@163.com>2021-10-17 23:05:01 +0800
commit7c8c68d79343d04be382334c15a73d079450857c (patch)
tree9aaacc042f0b7eeb4123c07dcc5f49c14fd8026c /Runtime/Scripting/LuaBindRefTable.h
parent6e73ca6ada8a41692809dae5db89c8db0675ce1e (diff)
*misc
Diffstat (limited to 'Runtime/Scripting/LuaBindRefTable.h')
-rw-r--r--Runtime/Scripting/LuaBindRefTable.h67
1 files changed, 0 insertions, 67 deletions
diff --git a/Runtime/Scripting/LuaBindRefTable.h b/Runtime/Scripting/LuaBindRefTable.h
deleted file mode 100644
index 1cc2af3..0000000
--- a/Runtime/Scripting/LuaBindRefTable.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef __LUA_BIND_REFTABLE_H__
-#define __LUA_BIND_REFTABLE_H__
-
-#include "LuaBindConfig.h"
-
-namespace LuaBind
-{
-
- class State;
-
- ///
- /// ref table 管理,对strong ref table和weak ref table两个table的代理。
- ///
- class RefTable
- {
- public:
-
- enum
- {
- WEAK_KEY = 1,
- WEAK_VALUE = 1 << 1
- };
-
- RefTable();
- ~RefTable();
-
- inline operator bool() { return mState; };
-
- void Init(State& state, cc8* name, cc8* mode = nullptr);
-
- bool IsKeyWeak();
- bool IsValueWeak();
-
- ///
- /// 对stack[idx]的实体在此ref table中增加一个引用,并返回refID
- ///
- int Ref(State& state, int idx);
- void Unref(State& state, int refID);
-
- ///
- /// 将此 ref table 放在栈顶
- ///
- void PushRefTable(State& state);
-
- ///
- /// 将 reftable[refID] 放在栈顶
- ///
- void PushRef(State& state, int refID);
-
- ///
- /// 清空 ref table,表还留在LUA_REGISTRYINDEX[mName]
- ///
- void Clear(State& state);
-
- private:
-
- friend class State;
-
- lua_State* mState; // 用来做一些确认工作
- cc8* mName; // ref table的名称
- int mMode; // ref table的类型
-
- };
-
-}
-
-#endif \ No newline at end of file