diff options
author | chai <chaifix@163.com> | 2021-10-17 23:05:01 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-17 23:05:01 +0800 |
commit | 7c8c68d79343d04be382334c15a73d079450857c (patch) | |
tree | 9aaacc042f0b7eeb4123c07dcc5f49c14fd8026c /Runtime/Scripting/LuaBindRef.h | |
parent | 6e73ca6ada8a41692809dae5db89c8db0675ce1e (diff) |
*misc
Diffstat (limited to 'Runtime/Scripting/LuaBindRef.h')
-rw-r--r-- | Runtime/Scripting/LuaBindRef.h | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/Runtime/Scripting/LuaBindRef.h b/Runtime/Scripting/LuaBindRef.h deleted file mode 100644 index 7628547..0000000 --- a/Runtime/Scripting/LuaBindRef.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __LUA_BIND_REF_H__ -#define __LUA_BIND_REF_H__ - -#include "LuaBindConfig.h" -#include "LuaBindState.h" - -namespace LuaBind -{ - - /// - /// 引用,存在LUA_REGISTRYINDEX下面的两个表里 - /// - class Ref - { - public: - - enum RefMode - { - STRONG_REF, - WEAK_REF - }; - - Ref(int mode = STRONG_REF); - virtual ~Ref(); - - operator bool(); - - void SetRef(State& state, int idx); - bool PushRef(State& state); - - int GetRefID(); - - private: - - int mRefID; // luaL_ref - int mMode; // strong or weak - - }; - - /// - /// 强引用,在LUA_REGISTRYINDEX["_LUA_BIND_STRONGREF_TABLE"]里,保证lua object不会被回收。 - /// - class StrongRef: public Ref - { - public: - StrongRef(); - - }; - - /// - /// 弱引用,在LUA_REGISTRYINDEX["_LUA_BIND_WEAKREF_TABLE"]里,不影响lua object的回收,只是作为一个方便取lua object的映射。 - /// - class WeakRef : public Ref - { - public: - WeakRef(); - - }; - -} - -#endif
\ No newline at end of file |