summaryrefslogtreecommitdiff
path: root/Runtime/Scripting/LuaBindRefTable.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-11-15 11:56:49 +0800
committerchai <chaifix@163.com>2020-11-15 11:56:49 +0800
commit7270cd95294d53180641b05784258df1e29f90d2 (patch)
tree171554d5caed0adea988c785d3714d08595ba1f3 /Runtime/Scripting/LuaBindRefTable.h
parentd2e4b2839bc7ce874370ff4c52dcfdadf666ff52 (diff)
*lua BindToLua
Diffstat (limited to 'Runtime/Scripting/LuaBindRefTable.h')
-rw-r--r--Runtime/Scripting/LuaBindRefTable.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/Runtime/Scripting/LuaBindRefTable.h b/Runtime/Scripting/LuaBindRefTable.h
index 95a21f9..1cc2af3 100644
--- a/Runtime/Scripting/LuaBindRefTable.h
+++ b/Runtime/Scripting/LuaBindRefTable.h
@@ -6,12 +6,12 @@
namespace LuaBind
{
- class LuaBindState;
+ class State;
///
/// ref table 管理,对strong ref table和weak ref table两个table的代理。
///
- class LuaBindRefTable
+ class RefTable
{
public:
@@ -21,12 +21,12 @@ namespace LuaBind
WEAK_VALUE = 1 << 1
};
- LuaBindRefTable();
- ~LuaBindRefTable();
+ RefTable();
+ ~RefTable();
inline operator bool() { return mState; };
- void Init(LuaBindState& state, cc8* name, cc8* mode = nullptr);
+ void Init(State& state, cc8* name, cc8* mode = nullptr);
bool IsKeyWeak();
bool IsValueWeak();
@@ -34,27 +34,27 @@ namespace LuaBind
///
/// 对stack[idx]的实体在此ref table中增加一个引用,并返回refID
///
- int Ref(LuaBindState& state, int idx);
- void Unref(LuaBindState& state, int refID);
+ int Ref(State& state, int idx);
+ void Unref(State& state, int refID);
///
/// 将此 ref table 放在栈顶
///
- void PushRefTable(LuaBindState& state);
+ void PushRefTable(State& state);
///
/// 将 reftable[refID] 放在栈顶
///
- void PushRef(LuaBindState& state, int refID);
+ void PushRef(State& state, int refID);
///
/// 清空 ref table,表还留在LUA_REGISTRYINDEX[mName]
///
- void Clear(LuaBindState& state);
+ void Clear(State& state);
private:
- friend class LuaBindState;
+ friend class State;
lua_State* mState; // 用来做一些确认工作
cc8* mName; // ref table的名称