From 8d8c4ff1664625e7428d0d31cd798d9321680cb2 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 14 Mar 2019 09:08:07 +0800 Subject: *luax --- Source/3rdParty/Luax/luax_ref.h | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'Source/3rdParty/Luax/luax_ref.h') diff --git a/Source/3rdParty/Luax/luax_ref.h b/Source/3rdParty/Luax/luax_ref.h index 759a314..7b484e9 100644 --- a/Source/3rdParty/Luax/luax_ref.h +++ b/Source/3rdParty/Luax/luax_ref.h @@ -1,6 +1,9 @@ #ifndef __LUAX_REF_H__ #define __LUAX_REF_H__ +#include "luax_config.h" +#include "luax_state.h" + namespace Luax { @@ -13,13 +16,24 @@ namespace Luax enum { - STRONG, - WEAK + STRONG_REF, + WEAK_REF }; + + LuaxRef(int mode = STRONG_REF); + virtual ~LuaxRef(); + + operator bool(); + + void SetRef(LuaxState& state, int idx); + bool PushRef(LuaxState& state); + + int GetRefID(); private: - int mRefID; // = luaL_ref + int mRefID; // luaL_ref + int mMode; // strong or weak }; @@ -28,6 +42,8 @@ namespace Luax /// class LuaxStrongRef: public LuaxRef { + public: + LuaxStrongRef(); }; @@ -36,6 +52,8 @@ namespace Luax /// class LuaxWeakRef : public LuaxRef { + public: + LuaxWeakRef(); }; -- cgit v1.1-26-g67d0