19 #include <core/exception.h> 29 TOLUA_API
int tolua_fawkesblackboard_open (lua_State* tolua_S);
31 #include <blackboard/blackboard.h> 36 static void tolua_reg_types (lua_State* tolua_S)
38 tolua_usertype(tolua_S,
"fawkes::Interface");
39 tolua_usertype(tolua_S,
"fawkes::BlackBoard");
43 #ifndef TOLUA_DISABLE_tolua_fawkesblackboard_fawkes_BlackBoard_open_for_reading_generic00 44 static int tolua_fawkesblackboard_fawkes_BlackBoard_open_for_reading_generic00(lua_State* tolua_S)
47 tolua_Error tolua_err;
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)
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));
62 if (!
self) tolua_error(tolua_S,
"invalid 'self' in function 'open_for_reading'", NULL);
64 bool exc_caught =
false;
68 tolua_pushusertype(tolua_S,(
void*)tolua_ret,
"fawkes::Interface");
74 catch (std::exception &e) {
76 lua_pushstring(tolua_S, e.what());
78 if (exc_caught) lua_error(tolua_S);
84 tolua_error(tolua_S,
"#ferror in function 'open_for_reading_generic'.",&tolua_err);
88 #endif //#ifndef TOLUA_DISABLE 91 #ifndef TOLUA_DISABLE_tolua_fawkesblackboard_fawkes_BlackBoard_open_for_writing_generic00 92 static int tolua_fawkesblackboard_fawkes_BlackBoard_open_for_writing_generic00(lua_State* tolua_S)
95 tolua_Error tolua_err;
97 !tolua_isusertype(tolua_S,1,
"fawkes::BlackBoard",0,&tolua_err) ||
98 !tolua_isstring(tolua_S,2,0,&tolua_err) ||
99 !tolua_isstring(tolua_S,3,0,&tolua_err) ||
100 !tolua_isnoobj(tolua_S,4,&tolua_err)
107 const char* interface_type = ((
const char*) tolua_tostring(tolua_S,2,0));
108 const char* identifier = ((
const char*) tolua_tostring(tolua_S,3,0));
109 #ifndef TOLUA_RELEASE 110 if (!
self) tolua_error(tolua_S,
"invalid 'self' in function 'open_for_writing'", NULL);
112 bool exc_caught =
false;
116 tolua_pushusertype(tolua_S,(
void*)tolua_ret,
"fawkes::Interface");
122 catch (std::exception &e) {
124 lua_pushstring(tolua_S, e.what());
126 if (exc_caught) lua_error(tolua_S);
130 #ifndef TOLUA_RELEASE 132 tolua_error(tolua_S,
"#ferror in function 'open_for_writing_generic'.",&tolua_err);
136 #endif //#ifndef TOLUA_DISABLE 139 #ifndef TOLUA_DISABLE_tolua_fawkesblackboard_fawkes_BlackBoard_close_generic00 140 static int tolua_fawkesblackboard_fawkes_BlackBoard_close_generic00(lua_State* tolua_S)
142 #ifndef TOLUA_RELEASE 143 tolua_Error tolua_err;
145 !tolua_isusertype(tolua_S,1,
"fawkes::BlackBoard",0,&tolua_err) ||
146 !tolua_isusertype(tolua_S,2,
"fawkes::Interface",0,&tolua_err) ||
147 !tolua_isnoobj(tolua_S,3,&tolua_err)
155 #ifndef TOLUA_RELEASE 156 if (!
self) tolua_error(tolua_S,
"invalid 'self' in function 'close'", NULL);
158 bool exc_caught =
false;
161 self->close(interface);
167 catch (std::exception &e) {
169 lua_pushstring(tolua_S, e.what());
171 if (exc_caught) lua_error(tolua_S);
175 #ifndef TOLUA_RELEASE 177 tolua_error(tolua_S,
"#ferror in function 'close_generic'.",&tolua_err);
181 #endif //#ifndef TOLUA_DISABLE 184 #ifndef TOLUA_DISABLE_tolua_fawkesblackboard_fawkes_BlackBoard_is_alive00 185 static int tolua_fawkesblackboard_fawkes_BlackBoard_is_alive00(lua_State* tolua_S)
187 #ifndef TOLUA_RELEASE 188 tolua_Error tolua_err;
190 !tolua_isusertype(tolua_S,1,
"const fawkes::BlackBoard",0,&tolua_err) ||
191 !tolua_isnoobj(tolua_S,2,&tolua_err)
198 #ifndef TOLUA_RELEASE 199 if (!
self) tolua_error(tolua_S,
"invalid 'self' in function 'is_alive'", NULL);
201 bool exc_caught =
false;
204 bool tolua_ret = (bool) self->is_alive();
205 tolua_pushboolean(tolua_S,(
bool)tolua_ret);
211 catch (std::exception &e) {
213 lua_pushstring(tolua_S, e.what());
215 if (exc_caught) lua_error(tolua_S);
219 #ifndef TOLUA_RELEASE 221 tolua_error(tolua_S,
"#ferror in function 'is_alive'.",&tolua_err);
225 #endif //#ifndef TOLUA_DISABLE 228 #ifndef TOLUA_DISABLE_tolua_fawkesblackboard_fawkes_BlackBoard_try_aliveness_restore00 229 static int tolua_fawkesblackboard_fawkes_BlackBoard_try_aliveness_restore00(lua_State* tolua_S)
231 #ifndef TOLUA_RELEASE 232 tolua_Error tolua_err;
234 !tolua_isusertype(tolua_S,1,
"fawkes::BlackBoard",0,&tolua_err) ||
235 !tolua_isnoobj(tolua_S,2,&tolua_err)
242 #ifndef TOLUA_RELEASE 243 if (!
self) tolua_error(tolua_S,
"invalid 'self' in function 'try_aliveness_restore'", NULL);
245 bool exc_caught =
false;
248 bool tolua_ret = (bool) self->try_aliveness_restore();
249 tolua_pushboolean(tolua_S,(
bool)tolua_ret);
255 catch (std::exception &e) {
257 lua_pushstring(tolua_S, e.what());
259 if (exc_caught) lua_error(tolua_S);
263 #ifndef TOLUA_RELEASE 265 tolua_error(tolua_S,
"#ferror in function 'try_aliveness_restore'.",&tolua_err);
269 #endif //#ifndef TOLUA_DISABLE 272 TOLUA_API
int tolua_fawkesblackboard_open (lua_State* tolua_S)
275 tolua_reg_types(tolua_S);
276 tolua_module(tolua_S,NULL,0);
277 tolua_beginmodule(tolua_S,NULL);
278 tolua_module(tolua_S,
"fawkes",0);
279 tolua_beginmodule(tolua_S,
"fawkes");
280 tolua_cclass(tolua_S,
"BlackBoard",
"fawkes::BlackBoard",
"",NULL);
281 tolua_beginmodule(tolua_S,
"BlackBoard");
282 tolua_function(tolua_S,
"open_for_reading_generic",tolua_fawkesblackboard_fawkes_BlackBoard_open_for_reading_generic00);
283 tolua_function(tolua_S,
"open_for_writing_generic",tolua_fawkesblackboard_fawkes_BlackBoard_open_for_writing_generic00);
284 tolua_function(tolua_S,
"close_generic",tolua_fawkesblackboard_fawkes_BlackBoard_close_generic00);
285 tolua_function(tolua_S,
"is_alive",tolua_fawkesblackboard_fawkes_BlackBoard_is_alive00);
286 tolua_function(tolua_S,
"try_aliveness_restore",tolua_fawkesblackboard_fawkes_BlackBoard_try_aliveness_restore00);
287 tolua_endmodule(tolua_S);
290 int top = lua_gettop(tolua_S);
291 static const unsigned char B[] = {
292 10,102,117,110, 99,116,105,111,110, 32,102, 97,119,107,101,
293 115, 46, 66,108, 97, 99,107, 66,111, 97,114,100, 58,111,112,
294 101,110, 95,102,111,114, 95,114,101, 97,100,105,110,103, 40,
295 105,110,116,101,114,102, 97, 99,101, 95,116,121,112,101, 44,
296 32,105,100,101,110,116,105,102,105,101,114, 41, 10,114,101,
297 113,117,105,114,101, 40, 34,105,110,116,101,114,102, 97, 99,
298 101,115, 46, 34, 46, 46,105,110,116,101,114,102, 97, 99,101,
299 95,116,121,112,101, 41, 10,108,111, 99, 97,108, 32,105,110,
300 116,101,114,102, 97, 99,101, 32, 61, 32,115,101,108,102, 58,
301 111,112,101,110, 95,102,111,114, 95,114,101, 97,100,105,110,
302 103, 95,103,101,110,101,114,105, 99, 40,105,110,116,101,114,
303 102, 97, 99,101, 95,116,121,112,101, 44, 32,105,100,101,110,
304 116,105,102,105,101,114, 41, 10,114,101,116,117,114,110, 32,
305 116,111,108,117, 97, 46, 99, 97,115,116, 40,105,110,116,101,
306 114,102, 97, 99,101, 44, 32, 34,102, 97,119,107,101,115, 58,
307 58, 34, 32, 46, 46, 32,105,110,116,101,114,102, 97, 99,101,
308 58,116,121,112,101, 40, 41, 41, 10,101,110,100, 10,102,117,
309 110, 99,116,105,111,110, 32,102, 97,119,107,101,115, 46, 66,
310 108, 97, 99,107, 66,111, 97,114,100, 58,111,112,101,110, 95,
311 102,111,114, 95,119,114,105,116,105,110,103, 40,105,110,116,
312 101,114,102, 97, 99,101, 95,116,121,112,101, 44, 32,105,100,
313 101,110,116,105,102,105,101,114, 41, 10,114,101,113,117,105,
314 114,101, 40, 34,105,110,116,101,114,102, 97, 99,101,115, 46,
315 34, 46, 46,105,110,116,101,114,102, 97, 99,101, 95,116,121,
316 112,101, 41, 10,108,111, 99, 97,108, 32,105,110,116,101,114,
317 102, 97, 99,101, 32, 61, 32,115,101,108,102, 58,111,112,101,
318 110, 95,102,111,114, 95,119,114,105,116,105,110,103, 95,103,
319 101,110,101,114,105, 99, 40,105,110,116,101,114,102, 97, 99,
320 101, 95,116,121,112,101, 44, 32,105,100,101,110,116,105,102,
321 105,101,114, 41, 10,114,101,116,117,114,110, 32,116,111,108,
322 117, 97, 46, 99, 97,115,116, 40,105,110,116,101,114,102, 97,
323 99,101, 44, 32, 34,102, 97,119,107,101,115, 58, 58, 34, 32,
324 46, 46, 32,105,110,116,101,114,102, 97, 99,101, 58,116,121,
325 112,101, 40, 41, 41, 10,101,110,100, 10,102,117,110, 99,116,
326 105,111,110, 32,102, 97,119,107,101,115, 46, 66,108, 97, 99,
327 107, 66,111, 97,114,100, 58, 99,108,111,115,101, 40,105,110,
328 116,101,114,102, 97, 99,101, 41, 10,108,111, 99, 97,108, 32,
329 103,101,110, 95,105,110,116,101,114,102, 97, 99,101, 32, 61,
330 32,116,111,108,117, 97, 46, 99, 97,115,116, 40,105,110,116,
331 101,114,102, 97, 99,101, 44, 32, 34,102, 97,119,107,101,115,
332 58, 58, 73,110,116,101,114,102, 97, 99,101, 34, 41, 10,115,
333 101,108,102, 58, 99,108,111,115,101, 95,103,101,110,101,114,
334 105, 99, 40,103,101,110, 95,105,110,116,101,114,102, 97, 99,
335 101, 41, 10,101,110,100, 32, 45, 45, 45, 45,32
337 tolua_dobuffer(tolua_S,(
char*)B,
sizeof(B),
"tolua: embedded Lua code 1");
338 lua_settop(tolua_S, top);
341 tolua_endmodule(tolua_S);
342 tolua_endmodule(tolua_S);
348 #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501 349 TOLUA_API
int luaopen_fawkesblackboard (lua_State* tolua_S) {
350 return tolua_fawkesblackboard_open(tolua_S);
Base class for all Fawkes BlackBoard interfaces.
Base class for exceptions in Fawkes.
virtual const char * what_no_backtrace() const
Get primary string (does not implicitly print the back trace).
The BlackBoard abstract class.