aboutsummaryrefslogtreecommitdiff
path: root/src/libjin-lua/common/l_reference.h
blob: 4c4756f5d0ac006e0502da71e67edc96732db176 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef __JIN_COMMON_REFERENCE_H
#define __JIN_COMMON_REFERENCE_H

#include "common/je_lua.h"

namespace JinEngine
{
	namespace Lua
	{

		///
		/// This class wraps the reference functionality built into Lua, which allows C++ code to refer to Lua 
		/// variables.
		///
		class LuaRef
		{
		public: 
			///
			///
			///
			LuaRef(lua_State* L, int i);

			///
			///
			///
			~LuaRef();

			///
			///
			///
			void unref();

			///
			/// Push value onto the stack.
			///
			void push();

		private:
			///
			///
			///
			lua_State* const mL;

			///
			///
			///
			int mIndex; 

		};

	} // namespace Lua
} // namespace JinEngine

#endif // __JIN_COMMON_REFERENCE_H