summaryrefslogtreecommitdiff
path: root/Source/3rdParty/Luax/luax_state.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-01-13 09:36:13 +0800
committerchai <chaifix@163.com>2019-01-13 09:36:13 +0800
commit2fb6b09dcf2ceb09cf021adb4a89f4c1255d5558 (patch)
tree7d8045be6920b532319f07d27d39bd4a2765044b /Source/3rdParty/Luax/luax_state.h
parent63b5a5fab9e41a2644ab43f23d661dd5f804cf1c (diff)
+luax
Diffstat (limited to 'Source/3rdParty/Luax/luax_state.h')
-rw-r--r--Source/3rdParty/Luax/luax_state.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/3rdParty/Luax/luax_state.h b/Source/3rdParty/Luax/luax_state.h
new file mode 100644
index 0000000..7b6338f
--- /dev/null
+++ b/Source/3rdParty/Luax/luax_state.h
@@ -0,0 +1,27 @@
+#ifndef __LUAX_STATE_H__
+#define __LUAX_STATE_H__
+
+namespace Luax
+{
+
+ class LuaxState
+ {
+ public:
+ LuaxState(lua_State* state) : mState(state){};
+ ~LuaxState() {};
+
+ inline operator lua_State*() { return mState; };
+ operator bool();
+ inline lua_State* operator ->() { return mState; };
+ inline lua_State& operator *() { return *mState; };
+
+ private:
+ void* operator new(size_t size);
+
+ lua_State* mState;
+
+ };
+
+}
+
+#endif \ No newline at end of file