Fawkes API Fawkes Development Version
fawkesblackboard_tolua.cpp
1/*
2** Lua binding: fawkesblackboard
3** Generated automatically by tolua++-1.0.92
4*/
5/* This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version. A runtime exception applies to
9 * this software (see LICENSE.GPL_WRE file mentioned below for details).
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Library General Public License for more details.
15 *
16 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
17 */
18
19#include <core/exception.h>
20
21#ifndef __cplusplus
22#include "stdlib.h"
23#endif
24#include "string.h"
25
26#include "tolua++.h"
27
28/* Exported function */
29TOLUA_API int tolua_fawkesblackboard_open (lua_State* tolua_S);
30
31#include <blackboard/blackboard.h>
32#include <list>
33#include <string>
34
35/* function to register type */
36static void tolua_reg_types (lua_State* tolua_S)
37{
38 tolua_usertype(tolua_S,"fawkes::Interface");
39 tolua_usertype(tolua_S,"fawkes::BlackBoard");
40}
41
42/* method: open_for_reading of class fawkes::BlackBoard */
43#ifndef TOLUA_DISABLE_tolua_fawkesblackboard_fawkes_BlackBoard_open_for_reading_generic00
44static int tolua_fawkesblackboard_fawkes_BlackBoard_open_for_reading_generic00(lua_State* tolua_S)
45{
46#ifndef TOLUA_RELEASE
47 tolua_Error tolua_err;
48 if (
49 !tolua_isusertype(tolua_S,1,"fawkes::BlackBoard",0,&tolua_err) ||
50 !tolua_isstring(tolua_S,2,0,&tolua_err) ||
51 !tolua_isstring(tolua_S,3,0,&tolua_err) ||
52 !tolua_isnoobj(tolua_S,4,&tolua_err)
53 )
54 goto tolua_lerror;
55 else
56#endif
57 {
58 fawkes::BlackBoard* self = (fawkes::BlackBoard*) tolua_tousertype(tolua_S,1,0);
59 const char* interface_type = ((const char*) tolua_tostring(tolua_S,2,0));
60 const char* identifier = ((const char*) tolua_tostring(tolua_S,3,0));
61#ifndef TOLUA_RELEASE
62 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'open_for_reading'",NULL);
63#endif
64 {
65 fawkes::Interface* tolua_ret = (fawkes::Interface*) self->open_for_reading(interface_type,identifier);
66 tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Interface");
67 }
68 }
69 return 1;
70#ifndef TOLUA_RELEASE
71 tolua_lerror:
72 tolua_error(tolua_S,"#ferror in function 'open_for_reading_generic'.",&tolua_err);
73 return 0;
74#endif
75}
76#endif //#ifndef TOLUA_DISABLE
77
78/* method: open_for_writing of class fawkes::BlackBoard */
79#ifndef TOLUA_DISABLE_tolua_fawkesblackboard_fawkes_BlackBoard_open_for_writing_generic00
80static int tolua_fawkesblackboard_fawkes_BlackBoard_open_for_writing_generic00(lua_State* tolua_S)
81{
82#ifndef TOLUA_RELEASE
83 tolua_Error tolua_err;
84 if (
85 !tolua_isusertype(tolua_S,1,"fawkes::BlackBoard",0,&tolua_err) ||
86 !tolua_isstring(tolua_S,2,0,&tolua_err) ||
87 !tolua_isstring(tolua_S,3,0,&tolua_err) ||
88 !tolua_isnoobj(tolua_S,4,&tolua_err)
89 )
90 goto tolua_lerror;
91 else
92#endif
93 {
94 fawkes::BlackBoard* self = (fawkes::BlackBoard*) tolua_tousertype(tolua_S,1,0);
95 const char* interface_type = ((const char*) tolua_tostring(tolua_S,2,0));
96 const char* identifier = ((const char*) tolua_tostring(tolua_S,3,0));
97#ifndef TOLUA_RELEASE
98 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'open_for_writing'",NULL);
99#endif
100 {
101 fawkes::Interface* tolua_ret = (fawkes::Interface*) self->open_for_writing(interface_type,identifier);
102 tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Interface");
103 }
104 }
105 return 1;
106#ifndef TOLUA_RELEASE
107 tolua_lerror:
108 tolua_error(tolua_S,"#ferror in function 'open_for_writing_generic'.",&tolua_err);
109 return 0;
110#endif
111}
112#endif //#ifndef TOLUA_DISABLE
113
114/* method: close of class fawkes::BlackBoard */
115#ifndef TOLUA_DISABLE_tolua_fawkesblackboard_fawkes_BlackBoard_close_generic00
116static int tolua_fawkesblackboard_fawkes_BlackBoard_close_generic00(lua_State* tolua_S)
117{
118#ifndef TOLUA_RELEASE
119 tolua_Error tolua_err;
120 if (
121 !tolua_isusertype(tolua_S,1,"fawkes::BlackBoard",0,&tolua_err) ||
122 !tolua_isusertype(tolua_S,2,"fawkes::Interface",0,&tolua_err) ||
123 !tolua_isnoobj(tolua_S,3,&tolua_err)
124 )
125 goto tolua_lerror;
126 else
127#endif
128 {
129 fawkes::BlackBoard* self = (fawkes::BlackBoard*) tolua_tousertype(tolua_S,1,0);
130 fawkes::Interface* interface = ((fawkes::Interface*) tolua_tousertype(tolua_S,2,0));
131#ifndef TOLUA_RELEASE
132 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'close'",NULL);
133#endif
134 {
135 self->close(interface);
136 }
137 }
138 return 0;
139#ifndef TOLUA_RELEASE
140 tolua_lerror:
141 tolua_error(tolua_S,"#ferror in function 'close_generic'.",&tolua_err);
142 return 0;
143#endif
144}
145#endif //#ifndef TOLUA_DISABLE
146
147/* method: is_alive of class fawkes::BlackBoard */
148#ifndef TOLUA_DISABLE_tolua_fawkesblackboard_fawkes_BlackBoard_is_alive00
149static int tolua_fawkesblackboard_fawkes_BlackBoard_is_alive00(lua_State* tolua_S)
150{
151#ifndef TOLUA_RELEASE
152 tolua_Error tolua_err;
153 if (
154 !tolua_isusertype(tolua_S,1,"const fawkes::BlackBoard",0,&tolua_err) ||
155 !tolua_isnoobj(tolua_S,2,&tolua_err)
156 )
157 goto tolua_lerror;
158 else
159#endif
160 {
161 const fawkes::BlackBoard* self = (const fawkes::BlackBoard*) tolua_tousertype(tolua_S,1,0);
162#ifndef TOLUA_RELEASE
163 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'is_alive'",NULL);
164#endif
165 {
166 bool tolua_ret = (bool) self->is_alive();
167 tolua_pushboolean(tolua_S,(bool)tolua_ret);
168 }
169 }
170 return 1;
171#ifndef TOLUA_RELEASE
172 tolua_lerror:
173 tolua_error(tolua_S,"#ferror in function 'is_alive'.",&tolua_err);
174 return 0;
175#endif
176}
177#endif //#ifndef TOLUA_DISABLE
178
179/* method: try_aliveness_restore of class fawkes::BlackBoard */
180#ifndef TOLUA_DISABLE_tolua_fawkesblackboard_fawkes_BlackBoard_try_aliveness_restore00
181static int tolua_fawkesblackboard_fawkes_BlackBoard_try_aliveness_restore00(lua_State* tolua_S)
182{
183#ifndef TOLUA_RELEASE
184 tolua_Error tolua_err;
185 if (
186 !tolua_isusertype(tolua_S,1,"fawkes::BlackBoard",0,&tolua_err) ||
187 !tolua_isnoobj(tolua_S,2,&tolua_err)
188 )
189 goto tolua_lerror;
190 else
191#endif
192 {
193 fawkes::BlackBoard* self = (fawkes::BlackBoard*) tolua_tousertype(tolua_S,1,0);
194#ifndef TOLUA_RELEASE
195 if (!self) tolua_error(tolua_S,"invalid 'self' in function 'try_aliveness_restore'",NULL);
196#endif
197 {
198 bool tolua_ret = (bool) self->try_aliveness_restore();
199 tolua_pushboolean(tolua_S,(bool)tolua_ret);
200 }
201 }
202 return 1;
203#ifndef TOLUA_RELEASE
204 tolua_lerror:
205 tolua_error(tolua_S,"#ferror in function 'try_aliveness_restore'.",&tolua_err);
206 return 0;
207#endif
208}
209#endif //#ifndef TOLUA_DISABLE
210
211/* Open function */
212TOLUA_API int tolua_fawkesblackboard_open (lua_State* tolua_S)
213{
214 tolua_open(tolua_S);
215 tolua_reg_types(tolua_S);
216 tolua_module(tolua_S,NULL,0);
217 tolua_beginmodule(tolua_S,NULL);
218 tolua_module(tolua_S,"fawkes",0);
219 tolua_beginmodule(tolua_S,"fawkes");
220 tolua_cclass(tolua_S,"BlackBoard","fawkes::BlackBoard","",NULL);
221 tolua_beginmodule(tolua_S,"BlackBoard");
222 tolua_function(tolua_S,"open_for_reading_generic",tolua_fawkesblackboard_fawkes_BlackBoard_open_for_reading_generic00);
223 tolua_function(tolua_S,"open_for_writing_generic",tolua_fawkesblackboard_fawkes_BlackBoard_open_for_writing_generic00);
224 tolua_function(tolua_S,"close_generic",tolua_fawkesblackboard_fawkes_BlackBoard_close_generic00);
225 tolua_function(tolua_S,"is_alive",tolua_fawkesblackboard_fawkes_BlackBoard_is_alive00);
226 tolua_function(tolua_S,"try_aliveness_restore",tolua_fawkesblackboard_fawkes_BlackBoard_try_aliveness_restore00);
227 tolua_endmodule(tolua_S);
228
229 { /* begin embedded lua code */
230 int top = lua_gettop(tolua_S);
231 static unsigned char B[] = {
232 10,102,117,110, 99,116,105,111,110, 32,102, 97,119,107,101,
233 115, 46, 66,108, 97, 99,107, 66,111, 97,114,100, 58,111,112,
234 101,110, 95,102,111,114, 95,114,101, 97,100,105,110,103, 40,
235 105,110,116,101,114,102, 97, 99,101, 95,116,121,112,101, 44,
236 32,105,100,101,110,116,105,102,105,101,114, 41, 10,114,101,
237 113,117,105,114,101, 40, 34,105,110,116,101,114,102, 97, 99,
238 101,115, 46, 34, 46, 46,105,110,116,101,114,102, 97, 99,101,
239 95,116,121,112,101, 41, 10,108,111, 99, 97,108, 32,105,110,
240 116,101,114,102, 97, 99,101, 32, 61, 32,115,101,108,102, 58,
241 111,112,101,110, 95,102,111,114, 95,114,101, 97,100,105,110,
242 103, 95,103,101,110,101,114,105, 99, 40,105,110,116,101,114,
243 102, 97, 99,101, 95,116,121,112,101, 44, 32,105,100,101,110,
244 116,105,102,105,101,114, 41, 10,114,101,116,117,114,110, 32,
245 116,111,108,117, 97, 46, 99, 97,115,116, 40,105,110,116,101,
246 114,102, 97, 99,101, 44, 32, 34,102, 97,119,107,101,115, 58,
247 58, 34, 32, 46, 46, 32,105,110,116,101,114,102, 97, 99,101,
248 58,116,121,112,101, 40, 41, 41, 10,101,110,100, 10,102,117,
249 110, 99,116,105,111,110, 32,102, 97,119,107,101,115, 46, 66,
250 108, 97, 99,107, 66,111, 97,114,100, 58,111,112,101,110, 95,
251 102,111,114, 95,119,114,105,116,105,110,103, 40,105,110,116,
252 101,114,102, 97, 99,101, 95,116,121,112,101, 44, 32,105,100,
253 101,110,116,105,102,105,101,114, 41, 10,114,101,113,117,105,
254 114,101, 40, 34,105,110,116,101,114,102, 97, 99,101,115, 46,
255 34, 46, 46,105,110,116,101,114,102, 97, 99,101, 95,116,121,
256 112,101, 41, 10,108,111, 99, 97,108, 32,105,110,116,101,114,
257 102, 97, 99,101, 32, 61, 32,115,101,108,102, 58,111,112,101,
258 110, 95,102,111,114, 95,119,114,105,116,105,110,103, 95,103,
259 101,110,101,114,105, 99, 40,105,110,116,101,114,102, 97, 99,
260 101, 95,116,121,112,101, 44, 32,105,100,101,110,116,105,102,
261 105,101,114, 41, 10,114,101,116,117,114,110, 32,116,111,108,
262 117, 97, 46, 99, 97,115,116, 40,105,110,116,101,114,102, 97,
263 99,101, 44, 32, 34,102, 97,119,107,101,115, 58, 58, 34, 32,
264 46, 46, 32,105,110,116,101,114,102, 97, 99,101, 58,116,121,
265 112,101, 40, 41, 41, 10,101,110,100, 10,102,117,110, 99,116,
266 105,111,110, 32,102, 97,119,107,101,115, 46, 66,108, 97, 99,
267 107, 66,111, 97,114,100, 58, 99,108,111,115,101, 40,105,110,
268 116,101,114,102, 97, 99,101, 41, 10,108,111, 99, 97,108, 32,
269 103,101,110, 95,105,110,116,101,114,102, 97, 99,101, 32, 61,
270 32,116,111,108,117, 97, 46, 99, 97,115,116, 40,105,110,116,
271 101,114,102, 97, 99,101, 44, 32, 34,102, 97,119,107,101,115,
272 58, 58, 73,110,116,101,114,102, 97, 99,101, 34, 41, 10,115,
273 101,108,102, 58, 99,108,111,115,101, 95,103,101,110,101,114,
274 105, 99, 40,103,101,110, 95,105,110,116,101,114,102, 97, 99,
275 101, 41, 10,101,110,100, 32,32
276 };
277 tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code 1");
278 lua_settop(tolua_S, top);
279 } /* end of embedded lua code */
280
281 tolua_endmodule(tolua_S);
282 tolua_endmodule(tolua_S);
283 return 1;
284}
285
286
287extern "C" {
288#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
289 TOLUA_API int luaopen_fawkesblackboard (lua_State* tolua_S) {
290 return tolua_fawkesblackboard_open(tolua_S);
291};
292#endif
293}
294
295
The BlackBoard abstract class.
Definition: blackboard.h:46
virtual bool is_alive() const noexcept=0
Check if the BlackBoard is still alive.
virtual Interface * open_for_reading(const char *interface_type, const char *identifier, const char *owner=NULL)=0
Open interface for reading.
virtual bool try_aliveness_restore() noexcept=0
Try to restore the aliveness of the BlackBoard instance.
virtual Interface * open_for_writing(const char *interface_type, const char *identifier, const char *owner=NULL)=0
Open interface for writing.
virtual void close(Interface *interface)=0
Close interface.
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:80