1 | |
2 | |
3 | |
4 | |
5 | |
6 | #ifndef __cplusplus201103L |
7 | #include <stdlib.h> |
8 | #endif |
9 | #include <string.h> |
10 | |
11 | #include <tolua++.h> |
12 | |
13 | #include "/home/jenkins/workspace/orxonox_qc_trunk_checks/src/modules/dialog/DialogManager.h" |
14 | |
15 | #include "core/LuaState.h" |
16 | int tolua_Dialog_open(lua_State* tolua_S); |
17 | static orxonox::ToluaBindingsHelper initialiser(&tolua_Dialog_open, "Dialog"); |
18 | |
19 | #ifdef ORXONOX_RELEASE |
20 | # define TOLUA_RELEASE |
21 | #endif |
22 | |
23 | |
24 | static void tolua_reg_types (lua_State* tolua_S) |
25 | { |
26 | tolua_usertype(tolua_S,"orxonox::DialogManager"); |
27 | } |
28 | |
29 | |
30 | #ifndef TOLUA_DISABLE_tolua_Dialog_orxonox_DialogManager_getInstance00 |
31 | static int tolua_Dialog_orxonox_DialogManager_getInstance00(lua_State* tolua_S) |
32 | { |
33 | #ifndef TOLUA_RELEASE |
34 | tolua_Error tolua_err; |
35 | if ( |
36 | !tolua_isusertable(tolua_S,1,"orxonox::DialogManager",0,&tolua_err) || |
37 | !tolua_isnoobj(tolua_S,2,&tolua_err) |
38 | ) |
39 | goto tolua_lerror; |
40 | else |
41 | #endif |
42 | { |
43 | { |
44 | orxonox::DialogManager& tolua_ret = (orxonox::DialogManager&) orxonox::DialogManager::getInstance(); |
45 | tolua_pushusertype(tolua_S,(void*)&tolua_ret,"orxonox::DialogManager"); |
46 | } |
47 | } |
48 | return 1; |
49 | #ifndef TOLUA_RELEASE |
50 | tolua_lerror: |
51 | tolua_error(tolua_S,"#ferror in function 'getInstance'.",&tolua_err); |
52 | return 0; |
53 | #endif |
54 | } |
55 | #endif //#ifndef TOLUA_DISABLE |
56 | |
57 | |
58 | #ifndef TOLUA_DISABLE_tolua_Dialog_orxonox_DialogManager_getQuestion00 |
59 | static int tolua_Dialog_orxonox_DialogManager_getQuestion00(lua_State* tolua_S) |
60 | { |
61 | #ifndef TOLUA_RELEASE |
62 | tolua_Error tolua_err; |
63 | if ( |
64 | !tolua_isusertype(tolua_S,1,"orxonox::DialogManager",0,&tolua_err) || |
65 | !tolua_isnoobj(tolua_S,2,&tolua_err) |
66 | ) |
67 | goto tolua_lerror; |
68 | else |
69 | #endif |
70 | { |
71 | orxonox::DialogManager* self = (orxonox::DialogManager*) tolua_tousertype(tolua_S,1,0); |
72 | #ifndef TOLUA_RELEASE |
73 | if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getQuestion'",NULL__null); |
74 | #endif |
75 | { |
76 | std::string tolua_ret = (std::string) self->getQuestion(); |
77 | tolua_pushcppstring(tolua_S,(const char*)tolua_ret)tolua_pushstring(tolua_S,(const char*)tolua_ret.c_str()); |
78 | } |
79 | } |
80 | return 1; |
81 | #ifndef TOLUA_RELEASE |
82 | tolua_lerror: |
83 | tolua_error(tolua_S,"#ferror in function 'getQuestion'.",&tolua_err); |
84 | return 0; |
85 | #endif |
86 | } |
87 | #endif //#ifndef TOLUA_DISABLE |
88 | |
89 | |
90 | #ifndef TOLUA_DISABLE_tolua_Dialog_orxonox_DialogManager_getSize00 |
91 | static int tolua_Dialog_orxonox_DialogManager_getSize00(lua_State* tolua_S) |
92 | { |
93 | #ifndef TOLUA_RELEASE |
94 | tolua_Error tolua_err; |
95 | if ( |
96 | !tolua_isusertype(tolua_S,1,"orxonox::DialogManager",0,&tolua_err) || |
97 | !tolua_isnoobj(tolua_S,2,&tolua_err) |
98 | ) |
99 | goto tolua_lerror; |
100 | else |
101 | #endif |
102 | { |
103 | orxonox::DialogManager* self = (orxonox::DialogManager*) tolua_tousertype(tolua_S,1,0); |
104 | #ifndef TOLUA_RELEASE |
105 | if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getSize'",NULL__null); |
106 | #endif |
107 | { |
108 | int tolua_ret = (int) self->getSize(); |
109 | tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); |
110 | } |
111 | } |
112 | return 1; |
113 | #ifndef TOLUA_RELEASE |
114 | tolua_lerror: |
115 | tolua_error(tolua_S,"#ferror in function 'getSize'.",&tolua_err); |
116 | return 0; |
117 | #endif |
118 | } |
119 | #endif //#ifndef TOLUA_DISABLE |
120 | |
121 | |
122 | #ifndef TOLUA_DISABLE_tolua_Dialog_orxonox_DialogManager_getAnswer00 |
123 | static int tolua_Dialog_orxonox_DialogManager_getAnswer00(lua_State* tolua_S) |
124 | { |
125 | #ifndef TOLUA_RELEASE |
126 | tolua_Error tolua_err; |
127 | if ( |
128 | !tolua_isusertype(tolua_S,1,"orxonox::DialogManager",0,&tolua_err) || |
129 | !tolua_isnumber(tolua_S,2,0,&tolua_err) || |
130 | !tolua_isnoobj(tolua_S,3,&tolua_err) |
131 | ) |
132 | goto tolua_lerror; |
133 | else |
134 | #endif |
135 | { |
136 | orxonox::DialogManager* self = (orxonox::DialogManager*) tolua_tousertype(tolua_S,1,0); |
137 | int index = ((int) tolua_tonumber(tolua_S,2,0)); |
138 | #ifndef TOLUA_RELEASE |
139 | if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getAnswer'",NULL__null); |
140 | #endif |
141 | { |
142 | std::string tolua_ret = (std::string) self->getAnswer(index); |
143 | tolua_pushcppstring(tolua_S,(const char*)tolua_ret)tolua_pushstring(tolua_S,(const char*)tolua_ret.c_str()); |
144 | } |
145 | } |
146 | return 1; |
147 | #ifndef TOLUA_RELEASE |
148 | tolua_lerror: |
149 | tolua_error(tolua_S,"#ferror in function 'getAnswer'.",&tolua_err); |
150 | return 0; |
151 | #endif |
152 | } |
153 | #endif //#ifndef TOLUA_DISABLE |
154 | |
155 | |
156 | #ifndef TOLUA_DISABLE_tolua_Dialog_orxonox_DialogManager_getPerson00 |
157 | static int tolua_Dialog_orxonox_DialogManager_getPerson00(lua_State* tolua_S) |
158 | { |
159 | #ifndef TOLUA_RELEASE |
160 | tolua_Error tolua_err; |
161 | if ( |
162 | !tolua_isusertype(tolua_S,1,"orxonox::DialogManager",0,&tolua_err) || |
163 | !tolua_isnoobj(tolua_S,2,&tolua_err) |
164 | ) |
165 | goto tolua_lerror; |
166 | else |
167 | #endif |
168 | { |
169 | orxonox::DialogManager* self = (orxonox::DialogManager*) tolua_tousertype(tolua_S,1,0); |
170 | #ifndef TOLUA_RELEASE |
171 | if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getPerson'",NULL__null); |
172 | #endif |
173 | { |
174 | std::string tolua_ret = (std::string) self->getPerson(); |
175 | tolua_pushcppstring(tolua_S,(const char*)tolua_ret)tolua_pushstring(tolua_S,(const char*)tolua_ret.c_str()); |
176 | } |
177 | } |
178 | return 1; |
179 | #ifndef TOLUA_RELEASE |
180 | tolua_lerror: |
181 | tolua_error(tolua_S,"#ferror in function 'getPerson'.",&tolua_err); |
182 | return 0; |
183 | #endif |
184 | } |
185 | #endif //#ifndef TOLUA_DISABLE |
186 | |
187 | |
188 | #ifndef TOLUA_DISABLE_tolua_Dialog_orxonox_DialogManager_endtest00 |
189 | static int tolua_Dialog_orxonox_DialogManager_endtest00(lua_State* tolua_S) |
190 | { |
191 | #ifndef TOLUA_RELEASE |
192 | tolua_Error tolua_err; |
193 | if ( |
| |
194 | !tolua_isusertype(tolua_S,1,"orxonox::DialogManager",0,&tolua_err) || |
195 | !tolua_isnumber(tolua_S,2,0,&tolua_err) || |
196 | !tolua_isnoobj(tolua_S,3,&tolua_err) |
197 | ) |
198 | goto tolua_lerror; |
199 | else |
200 | #endif |
201 | { |
202 | orxonox::DialogManager* self = (orxonox::DialogManager*) tolua_tousertype(tolua_S,1,0); |
| |
203 | int index = ((int) tolua_tonumber(tolua_S,2,0)); |
204 | #ifndef TOLUA_RELEASE |
205 | if (!self) tolua_error(tolua_S,"invalid 'self' in function 'endtest'",NULL__null); |
| |
| |
206 | #endif |
207 | { |
208 | bool tolua_ret = (bool) self->endtest(index); |
| 5 | | Called C++ object pointer is null |
|
209 | tolua_pushboolean(tolua_S,(bool)tolua_ret); |
210 | } |
211 | } |
212 | return 1; |
213 | #ifndef TOLUA_RELEASE |
214 | tolua_lerror: |
215 | tolua_error(tolua_S,"#ferror in function 'endtest'.",&tolua_err); |
216 | return 0; |
217 | #endif |
218 | } |
219 | #endif //#ifndef TOLUA_DISABLE |
220 | |
221 | |
222 | #ifndef TOLUA_DISABLE_tolua_Dialog_orxonox_DialogManager_update00 |
223 | static int tolua_Dialog_orxonox_DialogManager_update00(lua_State* tolua_S) |
224 | { |
225 | #ifndef TOLUA_RELEASE |
226 | tolua_Error tolua_err; |
227 | if ( |
228 | !tolua_isusertype(tolua_S,1,"orxonox::DialogManager",0,&tolua_err) || |
229 | !tolua_isnumber(tolua_S,2,0,&tolua_err) || |
230 | !tolua_isnoobj(tolua_S,3,&tolua_err) |
231 | ) |
232 | goto tolua_lerror; |
233 | else |
234 | #endif |
235 | { |
236 | orxonox::DialogManager* self = (orxonox::DialogManager*) tolua_tousertype(tolua_S,1,0); |
237 | int index = ((int) tolua_tonumber(tolua_S,2,0)); |
238 | #ifndef TOLUA_RELEASE |
239 | if (!self) tolua_error(tolua_S,"invalid 'self' in function 'update'",NULL__null); |
240 | #endif |
241 | { |
242 | self->update(index); |
243 | } |
244 | } |
245 | return 0; |
246 | #ifndef TOLUA_RELEASE |
247 | tolua_lerror: |
248 | tolua_error(tolua_S,"#ferror in function 'update'.",&tolua_err); |
249 | return 0; |
250 | #endif |
251 | } |
252 | #endif //#ifndef TOLUA_DISABLE |
253 | |
254 | |
255 | int tolua_Dialog_open (lua_State* tolua_S) |
256 | { |
257 | tolua_open(tolua_S); |
258 | tolua_reg_types(tolua_S); |
259 | tolua_module(tolua_S,NULL__null,0); |
260 | tolua_beginmodule(tolua_S,NULL__null); |
261 | tolua_module(tolua_S,"orxonox",0); |
262 | tolua_beginmodule(tolua_S,"orxonox"); |
263 | tolua_cclass(tolua_S,"DialogManager","orxonox::DialogManager","",NULL__null); |
264 | tolua_beginmodule(tolua_S,"DialogManager"); |
265 | tolua_function(tolua_S,"getInstance",tolua_Dialog_orxonox_DialogManager_getInstance00); |
266 | tolua_function(tolua_S,"getQuestion",tolua_Dialog_orxonox_DialogManager_getQuestion00); |
267 | tolua_function(tolua_S,"getSize",tolua_Dialog_orxonox_DialogManager_getSize00); |
268 | tolua_function(tolua_S,"getAnswer",tolua_Dialog_orxonox_DialogManager_getAnswer00); |
269 | tolua_function(tolua_S,"getPerson",tolua_Dialog_orxonox_DialogManager_getPerson00); |
270 | tolua_function(tolua_S,"endtest",tolua_Dialog_orxonox_DialogManager_endtest00); |
271 | tolua_function(tolua_S,"update",tolua_Dialog_orxonox_DialogManager_update00); |
272 | tolua_endmodule(tolua_S); |
273 | tolua_endmodule(tolua_S); |
274 | tolua_endmodule(tolua_S); |
275 | return 1; |
276 | } |
277 | |
278 | |
279 | #if defined(LUA_VERSION_NUM501) && LUA_VERSION_NUM501 >= 501 |
280 | int luaopen_Dialog (lua_State* tolua_S) { |
281 | return tolua_Dialog_open(tolua_S); |
282 | }; |
283 | #endif |
284 | |