summaryrefslogtreecommitdiff
path: root/Source/3rdParty/Luax/luax_ref.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/3rdParty/Luax/luax_ref.h')
-rw-r--r--Source/3rdParty/Luax/luax_ref.h24
1 files changed, 21 insertions, 3 deletions
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();
};