summaryrefslogtreecommitdiff
path: root/Runtime/Lua/LuaBind/LuaBindLFunction.h
blob: 0d4a8a88f56fef8c29e9ebcdee1c7dc25e38830d (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
#pragma once 
#include "LuaBindInvoker.h"

namespace LuaBind
{
    struct LuaFunction
    {
        const char* method; // full name 

		LuaFunction(const char* func=NULL);
		void operator = (const char* func);

		void AddInt(State& state, int n);
		void AddFloat(State& state, float n);
		void AddNil(State& state);
		void AddBool(State& state, bool b);
		void AddString(State& state, const char* str);
		void AddTable(State& state, INativeTable& tb);
		template<class T>
		void AddUserdata(State& state, NativeClass<T>& udata) {
			udata.PushUserdata(state);
			++argc;
		}

		void Invoke(State& state, int nReturns = 0);

	private:
		int argc;
    };

}