Fawkes API  Fawkes Development Version
fawkesutils_tolua.cpp
1 /*
2 ** Lua binding: fawkesutils
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 */
29 TOLUA_API int tolua_fawkesutils_open (lua_State* tolua_S);
30 
31 #include <utils/kalman/kalman_1d.h>
32 #include <utils/time/clock.h>
33 #include <utils/time/time.h>
34 
35 /* function to release collected object via destructor */
36 #ifdef __cplusplus
37 
38 static int tolua_collect_fawkes__KalmanFilter1D (lua_State* tolua_S)
39 {
40  fawkes::KalmanFilter1D* self = (fawkes::KalmanFilter1D*) tolua_tousertype(tolua_S,1,0);
41  Mtolua_delete(self);
42  return 0;
43 }
44 
45 static int tolua_collect_fawkes__Time (lua_State* tolua_S)
46 {
47  fawkes::Time* self = (fawkes::Time*) tolua_tousertype(tolua_S,1,0);
48  Mtolua_delete(self);
49  return 0;
50 }
51 #endif
52 
53 
54 /* function to register type */
55 static void tolua_reg_types (lua_State* tolua_S)
56 {
57  tolua_usertype(tolua_S,"fawkes::KalmanFilter1D");
58  tolua_usertype(tolua_S,"timeval");
59  tolua_usertype(tolua_S,"fawkes::Clock");
60  tolua_usertype(tolua_S,"fawkes::Time");
61 }
62 
63 /* method: new of class fawkes::KalmanFilter1D */
64 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_KalmanFilter1D_new00
65 static int tolua_fawkesutils_fawkes_KalmanFilter1D_new00(lua_State* tolua_S)
66 {
67 #ifndef TOLUA_RELEASE
68  tolua_Error tolua_err;
69  if (
70  !tolua_isusertable(tolua_S,1,"fawkes::KalmanFilter1D",0,&tolua_err) ||
71  !tolua_isnumber(tolua_S,2,1,&tolua_err) ||
72  !tolua_isnumber(tolua_S,3,1,&tolua_err) ||
73  !tolua_isnumber(tolua_S,4,1,&tolua_err) ||
74  !tolua_isnumber(tolua_S,5,1,&tolua_err) ||
75  !tolua_isnoobj(tolua_S,6,&tolua_err)
76  )
77  goto tolua_lerror;
78  else
79 #endif
80  {
81  float noise_x = ((float) tolua_tonumber(tolua_S,2,1.0));
82  float noise_z = ((float) tolua_tonumber(tolua_S,3,1.0));
83  float mu = ((float) tolua_tonumber(tolua_S,4,0.0));
84  float sig = ((float) tolua_tonumber(tolua_S,5,1.0));
85  bool exc_caught = false;
86  try {
87  {
88  fawkes::KalmanFilter1D* tolua_ret = (fawkes::KalmanFilter1D*) Mtolua_new((fawkes::KalmanFilter1D)(noise_x,noise_z,mu,sig));
89  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::KalmanFilter1D");
90  }
91  } catch (fawkes::Exception &e) {
92  exc_caught = true;
93  lua_pushstring(tolua_S, e.what_no_backtrace());
94  }
95  catch (std::exception &e) {
96  exc_caught = true;
97  lua_pushstring(tolua_S, e.what());
98  }
99  if (exc_caught) lua_error(tolua_S);
100 
101  }
102  return 1;
103 #ifndef TOLUA_RELEASE
104  tolua_lerror:
105  tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
106  return 0;
107 #endif
108 }
109 #endif //#ifndef TOLUA_DISABLE
110 
111 /* method: new_local of class fawkes::KalmanFilter1D */
112 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_KalmanFilter1D_new00_local
113 static int tolua_fawkesutils_fawkes_KalmanFilter1D_new00_local(lua_State* tolua_S)
114 {
115 #ifndef TOLUA_RELEASE
116  tolua_Error tolua_err;
117  if (
118  !tolua_isusertable(tolua_S,1,"fawkes::KalmanFilter1D",0,&tolua_err) ||
119  !tolua_isnumber(tolua_S,2,1,&tolua_err) ||
120  !tolua_isnumber(tolua_S,3,1,&tolua_err) ||
121  !tolua_isnumber(tolua_S,4,1,&tolua_err) ||
122  !tolua_isnumber(tolua_S,5,1,&tolua_err) ||
123  !tolua_isnoobj(tolua_S,6,&tolua_err)
124  )
125  goto tolua_lerror;
126  else
127 #endif
128  {
129  float noise_x = ((float) tolua_tonumber(tolua_S,2,1.0));
130  float noise_z = ((float) tolua_tonumber(tolua_S,3,1.0));
131  float mu = ((float) tolua_tonumber(tolua_S,4,0.0));
132  float sig = ((float) tolua_tonumber(tolua_S,5,1.0));
133  bool exc_caught = false;
134  try {
135  {
136  fawkes::KalmanFilter1D* tolua_ret = (fawkes::KalmanFilter1D*) Mtolua_new((fawkes::KalmanFilter1D)(noise_x,noise_z,mu,sig));
137  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::KalmanFilter1D");
138  tolua_register_gc(tolua_S,lua_gettop(tolua_S));
139  }
140  } catch (fawkes::Exception &e) {
141  exc_caught = true;
142  lua_pushstring(tolua_S, e.what_no_backtrace());
143  }
144  catch (std::exception &e) {
145  exc_caught = true;
146  lua_pushstring(tolua_S, e.what());
147  }
148  if (exc_caught) lua_error(tolua_S);
149 
150  }
151  return 1;
152 #ifndef TOLUA_RELEASE
153  tolua_lerror:
154  tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
155  return 0;
156 #endif
157 }
158 #endif //#ifndef TOLUA_DISABLE
159 
160 /* method: delete of class fawkes::KalmanFilter1D */
161 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_KalmanFilter1D_delete00
162 static int tolua_fawkesutils_fawkes_KalmanFilter1D_delete00(lua_State* tolua_S)
163 {
164 #ifndef TOLUA_RELEASE
165  tolua_Error tolua_err;
166  if (
167  !tolua_isusertype(tolua_S,1,"fawkes::KalmanFilter1D",0,&tolua_err) ||
168  !tolua_isnoobj(tolua_S,2,&tolua_err)
169  )
170  goto tolua_lerror;
171  else
172 #endif
173  {
174  fawkes::KalmanFilter1D* self = (fawkes::KalmanFilter1D*) tolua_tousertype(tolua_S,1,0);
175 #ifndef TOLUA_RELEASE
176  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'delete'", NULL);
177 #endif
178  bool exc_caught = false;
179  try {
180  Mtolua_delete(self);
181  } catch (fawkes::Exception &e) {
182  exc_caught = true;
183  lua_pushstring(tolua_S, e.what_no_backtrace());
184  }
185  catch (std::exception &e) {
186  exc_caught = true;
187  lua_pushstring(tolua_S, e.what());
188  }
189  if (exc_caught) lua_error(tolua_S);
190 
191  }
192  return 0;
193 #ifndef TOLUA_RELEASE
194  tolua_lerror:
195  tolua_error(tolua_S,"#ferror in function 'delete'.",&tolua_err);
196  return 0;
197 #endif
198 }
199 #endif //#ifndef TOLUA_DISABLE
200 
201 /* method: filter of class fawkes::KalmanFilter1D */
202 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_KalmanFilter1D_filter00
203 static int tolua_fawkesutils_fawkes_KalmanFilter1D_filter00(lua_State* tolua_S)
204 {
205 #ifndef TOLUA_RELEASE
206  tolua_Error tolua_err;
207  if (
208  !tolua_isusertype(tolua_S,1,"fawkes::KalmanFilter1D",0,&tolua_err) ||
209  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
210  !tolua_isnoobj(tolua_S,3,&tolua_err)
211  )
212  goto tolua_lerror;
213  else
214 #endif
215  {
216  fawkes::KalmanFilter1D* self = (fawkes::KalmanFilter1D*) tolua_tousertype(tolua_S,1,0);
217  float observe = ((float) tolua_tonumber(tolua_S,2,0));
218 #ifndef TOLUA_RELEASE
219  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'filter'", NULL);
220 #endif
221  bool exc_caught = false;
222  try {
223  {
224  self->filter(observe);
225  }
226  } catch (fawkes::Exception &e) {
227  exc_caught = true;
228  lua_pushstring(tolua_S, e.what_no_backtrace());
229  }
230  catch (std::exception &e) {
231  exc_caught = true;
232  lua_pushstring(tolua_S, e.what());
233  }
234  if (exc_caught) lua_error(tolua_S);
235 
236  }
237  return 0;
238 #ifndef TOLUA_RELEASE
239  tolua_lerror:
240  tolua_error(tolua_S,"#ferror in function 'filter'.",&tolua_err);
241  return 0;
242 #endif
243 }
244 #endif //#ifndef TOLUA_DISABLE
245 
246 /* method: filter of class fawkes::KalmanFilter1D */
247 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_KalmanFilter1D_filter01
248 static int tolua_fawkesutils_fawkes_KalmanFilter1D_filter01(lua_State* tolua_S)
249 {
250  tolua_Error tolua_err;
251  if (
252  !tolua_isusertype(tolua_S,1,"fawkes::KalmanFilter1D",0,&tolua_err) ||
253  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
254  !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
255  !tolua_isnumber(tolua_S,4,0,&tolua_err) ||
256  !tolua_isnoobj(tolua_S,5,&tolua_err)
257  )
258  goto tolua_lerror;
259  else
260  {
261  fawkes::KalmanFilter1D* self = (fawkes::KalmanFilter1D*) tolua_tousertype(tolua_S,1,0);
262  float observe = ((float) tolua_tonumber(tolua_S,2,0));
263  float mu = ((float) tolua_tonumber(tolua_S,3,0));
264  float sig = ((float) tolua_tonumber(tolua_S,4,0));
265 #ifndef TOLUA_RELEASE
266  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'filter'", NULL);
267 #endif
268  bool exc_caught = false;
269  try {
270  {
271  self->filter(observe,mu,sig);
272  tolua_pushnumber(tolua_S,(lua_Number)mu);
273  tolua_pushnumber(tolua_S,(lua_Number)sig);
274  }
275  } catch (fawkes::Exception &e) {
276  exc_caught = true;
277  lua_pushstring(tolua_S, e.what_no_backtrace());
278  }
279  catch (std::exception &e) {
280  exc_caught = true;
281  lua_pushstring(tolua_S, e.what());
282  }
283  if (exc_caught) lua_error(tolua_S);
284 
285  }
286  return 2;
287 tolua_lerror:
288  return tolua_fawkesutils_fawkes_KalmanFilter1D_filter00(tolua_S);
289 }
290 #endif //#ifndef TOLUA_DISABLE
291 
292 /* method: predict of class fawkes::KalmanFilter1D */
293 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_KalmanFilter1D_predict00
294 static int tolua_fawkesutils_fawkes_KalmanFilter1D_predict00(lua_State* tolua_S)
295 {
296 #ifndef TOLUA_RELEASE
297  tolua_Error tolua_err;
298  if (
299  !tolua_isusertype(tolua_S,1,"const fawkes::KalmanFilter1D",0,&tolua_err) ||
300  !tolua_isnoobj(tolua_S,2,&tolua_err)
301  )
302  goto tolua_lerror;
303  else
304 #endif
305  {
306  const fawkes::KalmanFilter1D* self = (const fawkes::KalmanFilter1D*) tolua_tousertype(tolua_S,1,0);
307 #ifndef TOLUA_RELEASE
308  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'predict'", NULL);
309 #endif
310  bool exc_caught = false;
311  try {
312  {
313  float tolua_ret = (float) self->predict();
314  tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
315  }
316  } catch (fawkes::Exception &e) {
317  exc_caught = true;
318  lua_pushstring(tolua_S, e.what_no_backtrace());
319  }
320  catch (std::exception &e) {
321  exc_caught = true;
322  lua_pushstring(tolua_S, e.what());
323  }
324  if (exc_caught) lua_error(tolua_S);
325 
326  }
327  return 1;
328 #ifndef TOLUA_RELEASE
329  tolua_lerror:
330  tolua_error(tolua_S,"#ferror in function 'predict'.",&tolua_err);
331  return 0;
332 #endif
333 }
334 #endif //#ifndef TOLUA_DISABLE
335 
336 /* method: predict of class fawkes::KalmanFilter1D */
337 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_KalmanFilter1D_predict01
338 static int tolua_fawkesutils_fawkes_KalmanFilter1D_predict01(lua_State* tolua_S)
339 {
340  tolua_Error tolua_err;
341  if (
342  !tolua_isusertype(tolua_S,1,"const fawkes::KalmanFilter1D",0,&tolua_err) ||
343  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
344  !tolua_isnoobj(tolua_S,3,&tolua_err)
345  )
346  goto tolua_lerror;
347  else
348  {
349  const fawkes::KalmanFilter1D* self = (const fawkes::KalmanFilter1D*) tolua_tousertype(tolua_S,1,0);
350  float vel = ((float) tolua_tonumber(tolua_S,2,0));
351 #ifndef TOLUA_RELEASE
352  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'predict'", NULL);
353 #endif
354  bool exc_caught = false;
355  try {
356  {
357  float tolua_ret = (float) self->predict(vel);
358  tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
359  }
360  } catch (fawkes::Exception &e) {
361  exc_caught = true;
362  lua_pushstring(tolua_S, e.what_no_backtrace());
363  }
364  catch (std::exception &e) {
365  exc_caught = true;
366  lua_pushstring(tolua_S, e.what());
367  }
368  if (exc_caught) lua_error(tolua_S);
369 
370  }
371  return 1;
372 tolua_lerror:
373  return tolua_fawkesutils_fawkes_KalmanFilter1D_predict00(tolua_S);
374 }
375 #endif //#ifndef TOLUA_DISABLE
376 
377 /* method: predict of class fawkes::KalmanFilter1D */
378 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_KalmanFilter1D_predict02
379 static int tolua_fawkesutils_fawkes_KalmanFilter1D_predict02(lua_State* tolua_S)
380 {
381  tolua_Error tolua_err;
382  if (
383  !tolua_isusertype(tolua_S,1,"const fawkes::KalmanFilter1D",0,&tolua_err) ||
384  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
385  !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
386  !tolua_isnumber(tolua_S,4,0,&tolua_err) ||
387  !tolua_isnoobj(tolua_S,5,&tolua_err)
388  )
389  goto tolua_lerror;
390  else
391  {
392  const fawkes::KalmanFilter1D* self = (const fawkes::KalmanFilter1D*) tolua_tousertype(tolua_S,1,0);
393  float vel = ((float) tolua_tonumber(tolua_S,2,0));
394  int steps = ((int) tolua_tonumber(tolua_S,3,0));
395  float noise_z = ((float) tolua_tonumber(tolua_S,4,0));
396 #ifndef TOLUA_RELEASE
397  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'predict'", NULL);
398 #endif
399  bool exc_caught = false;
400  try {
401  {
402  float tolua_ret = (float) self->predict(vel,steps,noise_z);
403  tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
404  }
405  } catch (fawkes::Exception &e) {
406  exc_caught = true;
407  lua_pushstring(tolua_S, e.what_no_backtrace());
408  }
409  catch (std::exception &e) {
410  exc_caught = true;
411  lua_pushstring(tolua_S, e.what());
412  }
413  if (exc_caught) lua_error(tolua_S);
414 
415  }
416  return 1;
417 tolua_lerror:
418  return tolua_fawkesutils_fawkes_KalmanFilter1D_predict01(tolua_S);
419 }
420 #endif //#ifndef TOLUA_DISABLE
421 
422 /* method: predict of class fawkes::KalmanFilter1D */
423 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_KalmanFilter1D_predict03
424 static int tolua_fawkesutils_fawkes_KalmanFilter1D_predict03(lua_State* tolua_S)
425 {
426  tolua_Error tolua_err;
427  if (
428  !tolua_isusertype(tolua_S,1,"const fawkes::KalmanFilter1D",0,&tolua_err) ||
429  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
430  !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
431  !tolua_isnumber(tolua_S,4,0,&tolua_err) ||
432  !tolua_isnumber(tolua_S,5,0,&tolua_err) ||
433  !tolua_isnoobj(tolua_S,6,&tolua_err)
434  )
435  goto tolua_lerror;
436  else
437  {
438  const fawkes::KalmanFilter1D* self = (const fawkes::KalmanFilter1D*) tolua_tousertype(tolua_S,1,0);
439  float mu = ((float) tolua_tonumber(tolua_S,2,0));
440  float vel = ((float) tolua_tonumber(tolua_S,3,0));
441  int steps = ((int) tolua_tonumber(tolua_S,4,0));
442  float noise_z = ((float) tolua_tonumber(tolua_S,5,0));
443 #ifndef TOLUA_RELEASE
444  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'predict'", NULL);
445 #endif
446  bool exc_caught = false;
447  try {
448  {
449  float tolua_ret = (float) self->predict(mu,vel,steps,noise_z);
450  tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
451  }
452  } catch (fawkes::Exception &e) {
453  exc_caught = true;
454  lua_pushstring(tolua_S, e.what_no_backtrace());
455  }
456  catch (std::exception &e) {
457  exc_caught = true;
458  lua_pushstring(tolua_S, e.what());
459  }
460  if (exc_caught) lua_error(tolua_S);
461 
462  }
463  return 1;
464 tolua_lerror:
465  return tolua_fawkesutils_fawkes_KalmanFilter1D_predict02(tolua_S);
466 }
467 #endif //#ifndef TOLUA_DISABLE
468 
469 /* method: instance of class fawkes::Clock */
470 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_instance00
471 static int tolua_fawkesutils_fawkes_Clock_instance00(lua_State* tolua_S)
472 {
473 #ifndef TOLUA_RELEASE
474  tolua_Error tolua_err;
475  if (
476  !tolua_isusertable(tolua_S,1,"fawkes::Clock",0,&tolua_err) ||
477  !tolua_isnoobj(tolua_S,2,&tolua_err)
478  )
479  goto tolua_lerror;
480  else
481 #endif
482  {
483  bool exc_caught = false;
484  try {
485  {
487  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Clock");
488  }
489  } catch (fawkes::Exception &e) {
490  exc_caught = true;
491  lua_pushstring(tolua_S, e.what_no_backtrace());
492  }
493  catch (std::exception &e) {
494  exc_caught = true;
495  lua_pushstring(tolua_S, e.what());
496  }
497  if (exc_caught) lua_error(tolua_S);
498 
499  }
500  return 1;
501 #ifndef TOLUA_RELEASE
502  tolua_lerror:
503  tolua_error(tolua_S,"#ferror in function 'instance'.",&tolua_err);
504  return 0;
505 #endif
506 }
507 #endif //#ifndef TOLUA_DISABLE
508 
509 /* method: finalize of class fawkes::Clock */
510 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_finalize00
511 static int tolua_fawkesutils_fawkes_Clock_finalize00(lua_State* tolua_S)
512 {
513 #ifndef TOLUA_RELEASE
514  tolua_Error tolua_err;
515  if (
516  !tolua_isusertable(tolua_S,1,"fawkes::Clock",0,&tolua_err) ||
517  !tolua_isnoobj(tolua_S,2,&tolua_err)
518  )
519  goto tolua_lerror;
520  else
521 #endif
522  {
523  bool exc_caught = false;
524  try {
525  {
527  }
528  } catch (fawkes::Exception &e) {
529  exc_caught = true;
530  lua_pushstring(tolua_S, e.what_no_backtrace());
531  }
532  catch (std::exception &e) {
533  exc_caught = true;
534  lua_pushstring(tolua_S, e.what());
535  }
536  if (exc_caught) lua_error(tolua_S);
537 
538  }
539  return 0;
540 #ifndef TOLUA_RELEASE
541  tolua_lerror:
542  tolua_error(tolua_S,"#ferror in function 'finalize'.",&tolua_err);
543  return 0;
544 #endif
545 }
546 #endif //#ifndef TOLUA_DISABLE
547 
548 /* method: is_ext_default_timesource of class fawkes::Clock */
549 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_is_ext_default_timesource00
550 static int tolua_fawkesutils_fawkes_Clock_is_ext_default_timesource00(lua_State* tolua_S)
551 {
552 #ifndef TOLUA_RELEASE
553  tolua_Error tolua_err;
554  if (
555  !tolua_isusertype(tolua_S,1,"const fawkes::Clock",0,&tolua_err) ||
556  !tolua_isnoobj(tolua_S,2,&tolua_err)
557  )
558  goto tolua_lerror;
559  else
560 #endif
561  {
562  const fawkes::Clock* self = (const fawkes::Clock*) tolua_tousertype(tolua_S,1,0);
563 #ifndef TOLUA_RELEASE
564  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'is_ext_default_timesource'", NULL);
565 #endif
566  bool exc_caught = false;
567  try {
568  {
569  bool tolua_ret = (bool) self->is_ext_default_timesource();
570  tolua_pushboolean(tolua_S,(bool)tolua_ret);
571  }
572  } catch (fawkes::Exception &e) {
573  exc_caught = true;
574  lua_pushstring(tolua_S, e.what_no_backtrace());
575  }
576  catch (std::exception &e) {
577  exc_caught = true;
578  lua_pushstring(tolua_S, e.what());
579  }
580  if (exc_caught) lua_error(tolua_S);
581 
582  }
583  return 1;
584 #ifndef TOLUA_RELEASE
585  tolua_lerror:
586  tolua_error(tolua_S,"#ferror in function 'is_ext_default_timesource'.",&tolua_err);
587  return 0;
588 #endif
589 }
590 #endif //#ifndef TOLUA_DISABLE
591 
592 /* method: has_ext_timesource of class fawkes::Clock */
593 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_has_ext_timesource00
594 static int tolua_fawkesutils_fawkes_Clock_has_ext_timesource00(lua_State* tolua_S)
595 {
596 #ifndef TOLUA_RELEASE
597  tolua_Error tolua_err;
598  if (
599  !tolua_isusertype(tolua_S,1,"const fawkes::Clock",0,&tolua_err) ||
600  !tolua_isnoobj(tolua_S,2,&tolua_err)
601  )
602  goto tolua_lerror;
603  else
604 #endif
605  {
606  const fawkes::Clock* self = (const fawkes::Clock*) tolua_tousertype(tolua_S,1,0);
607 #ifndef TOLUA_RELEASE
608  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'has_ext_timesource'", NULL);
609 #endif
610  bool exc_caught = false;
611  try {
612  {
613  bool tolua_ret = (bool) self->has_ext_timesource();
614  tolua_pushboolean(tolua_S,(bool)tolua_ret);
615  }
616  } catch (fawkes::Exception &e) {
617  exc_caught = true;
618  lua_pushstring(tolua_S, e.what_no_backtrace());
619  }
620  catch (std::exception &e) {
621  exc_caught = true;
622  lua_pushstring(tolua_S, e.what());
623  }
624  if (exc_caught) lua_error(tolua_S);
625 
626  }
627  return 1;
628 #ifndef TOLUA_RELEASE
629  tolua_lerror:
630  tolua_error(tolua_S,"#ferror in function 'has_ext_timesource'.",&tolua_err);
631  return 0;
632 #endif
633 }
634 #endif //#ifndef TOLUA_DISABLE
635 
636 /* method: ext_to_realtime of class fawkes::Clock */
637 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_ext_to_realtime00
638 static int tolua_fawkesutils_fawkes_Clock_ext_to_realtime00(lua_State* tolua_S)
639 {
640 #ifndef TOLUA_RELEASE
641  tolua_Error tolua_err;
642  if (
643  !tolua_isusertype(tolua_S,1,"fawkes::Clock",0,&tolua_err) ||
644  (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const fawkes::Time",0,&tolua_err)) ||
645  !tolua_isnoobj(tolua_S,3,&tolua_err)
646  )
647  goto tolua_lerror;
648  else
649 #endif
650  {
651  fawkes::Clock* self = (fawkes::Clock*) tolua_tousertype(tolua_S,1,0);
652  const fawkes::Time* t = ((const fawkes::Time*) tolua_tousertype(tolua_S,2,0));
653 #ifndef TOLUA_RELEASE
654  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'ext_to_realtime'", NULL);
655 #endif
656  bool exc_caught = false;
657  try {
658  {
659  fawkes::Time tolua_ret = (fawkes::Time) self->ext_to_realtime(*t);
660  {
661 #ifdef __cplusplus
662  void* tolua_obj = Mtolua_new((fawkes::Time)(tolua_ret));
663  tolua_pushusertype(tolua_S,tolua_obj,"fawkes::Time");
664  tolua_register_gc(tolua_S,lua_gettop(tolua_S));
665 #else
666  void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(fawkes::Time));
667  tolua_pushusertype(tolua_S,tolua_obj,"fawkes::Time");
668  tolua_register_gc(tolua_S,lua_gettop(tolua_S));
669 #endif
670  }
671  }
672  } catch (fawkes::Exception &e) {
673  exc_caught = true;
674  lua_pushstring(tolua_S, e.what_no_backtrace());
675  }
676  catch (std::exception &e) {
677  exc_caught = true;
678  lua_pushstring(tolua_S, e.what());
679  }
680  if (exc_caught) lua_error(tolua_S);
681 
682  }
683  return 1;
684 #ifndef TOLUA_RELEASE
685  tolua_lerror:
686  tolua_error(tolua_S,"#ferror in function 'ext_to_realtime'.",&tolua_err);
687  return 0;
688 #endif
689 }
690 #endif //#ifndef TOLUA_DISABLE
691 
692 /* method: get_time of class fawkes::Clock */
693 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_get_time00
694 static int tolua_fawkesutils_fawkes_Clock_get_time00(lua_State* tolua_S)
695 {
696 #ifndef TOLUA_RELEASE
697  tolua_Error tolua_err;
698  if (
699  !tolua_isusertype(tolua_S,1,"const fawkes::Clock",0,&tolua_err) ||
700  (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"fawkes::Time",0,&tolua_err)) ||
701  !tolua_isnoobj(tolua_S,3,&tolua_err)
702  )
703  goto tolua_lerror;
704  else
705 #endif
706  {
707  const fawkes::Clock* self = (const fawkes::Clock*) tolua_tousertype(tolua_S,1,0);
708  fawkes::Time* time = ((fawkes::Time*) tolua_tousertype(tolua_S,2,0));
709 #ifndef TOLUA_RELEASE
710  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'get_time'", NULL);
711 #endif
712  bool exc_caught = false;
713  try {
714  {
715  self->get_time(*time);
716  }
717  } catch (fawkes::Exception &e) {
718  exc_caught = true;
719  lua_pushstring(tolua_S, e.what_no_backtrace());
720  }
721  catch (std::exception &e) {
722  exc_caught = true;
723  lua_pushstring(tolua_S, e.what());
724  }
725  if (exc_caught) lua_error(tolua_S);
726 
727  }
728  return 0;
729 #ifndef TOLUA_RELEASE
730  tolua_lerror:
731  tolua_error(tolua_S,"#ferror in function 'get_time'.",&tolua_err);
732  return 0;
733 #endif
734 }
735 #endif //#ifndef TOLUA_DISABLE
736 
737 /* method: get_time of class fawkes::Clock */
738 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_get_time01
739 static int tolua_fawkesutils_fawkes_Clock_get_time01(lua_State* tolua_S)
740 {
741  tolua_Error tolua_err;
742  if (
743  !tolua_isusertype(tolua_S,1,"const fawkes::Clock",0,&tolua_err) ||
744  (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"fawkes::Time",0,&tolua_err)) ||
745  !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
746  !tolua_isnoobj(tolua_S,4,&tolua_err)
747  )
748  goto tolua_lerror;
749  else
750  {
751  const fawkes::Clock* self = (const fawkes::Clock*) tolua_tousertype(tolua_S,1,0);
752  fawkes::Time* time = ((fawkes::Time*) tolua_tousertype(tolua_S,2,0));
753  fawkes::Clock::TimesourceSelector sel = ((fawkes::Clock::TimesourceSelector) (int) tolua_tonumber(tolua_S,3,0));
754 #ifndef TOLUA_RELEASE
755  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'get_time'", NULL);
756 #endif
757  bool exc_caught = false;
758  try {
759  {
760  self->get_time(*time,sel);
761  }
762  } catch (fawkes::Exception &e) {
763  exc_caught = true;
764  lua_pushstring(tolua_S, e.what_no_backtrace());
765  }
766  catch (std::exception &e) {
767  exc_caught = true;
768  lua_pushstring(tolua_S, e.what());
769  }
770  if (exc_caught) lua_error(tolua_S);
771 
772  }
773  return 0;
774 tolua_lerror:
775  return tolua_fawkesutils_fawkes_Clock_get_time00(tolua_S);
776 }
777 #endif //#ifndef TOLUA_DISABLE
778 
779 /* method: get_time of class fawkes::Clock */
780 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_get_time02
781 static int tolua_fawkesutils_fawkes_Clock_get_time02(lua_State* tolua_S)
782 {
783  tolua_Error tolua_err;
784  if (
785  !tolua_isusertype(tolua_S,1,"const fawkes::Clock",0,&tolua_err) ||
786  !tolua_isusertype(tolua_S,2,"fawkes::Time",0,&tolua_err) ||
787  !tolua_isnoobj(tolua_S,3,&tolua_err)
788  )
789  goto tolua_lerror;
790  else
791  {
792  const fawkes::Clock* self = (const fawkes::Clock*) tolua_tousertype(tolua_S,1,0);
793  fawkes::Time* time = ((fawkes::Time*) tolua_tousertype(tolua_S,2,0));
794 #ifndef TOLUA_RELEASE
795  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'get_time'", NULL);
796 #endif
797  bool exc_caught = false;
798  try {
799  {
800  self->get_time(time);
801  }
802  } catch (fawkes::Exception &e) {
803  exc_caught = true;
804  lua_pushstring(tolua_S, e.what_no_backtrace());
805  }
806  catch (std::exception &e) {
807  exc_caught = true;
808  lua_pushstring(tolua_S, e.what());
809  }
810  if (exc_caught) lua_error(tolua_S);
811 
812  }
813  return 0;
814 tolua_lerror:
815  return tolua_fawkesutils_fawkes_Clock_get_time01(tolua_S);
816 }
817 #endif //#ifndef TOLUA_DISABLE
818 
819 /* method: get_time of class fawkes::Clock */
820 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_get_time03
821 static int tolua_fawkesutils_fawkes_Clock_get_time03(lua_State* tolua_S)
822 {
823  tolua_Error tolua_err;
824  if (
825  !tolua_isusertype(tolua_S,1,"const fawkes::Clock",0,&tolua_err) ||
826  !tolua_isusertype(tolua_S,2,"fawkes::Time",0,&tolua_err) ||
827  !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
828  !tolua_isnoobj(tolua_S,4,&tolua_err)
829  )
830  goto tolua_lerror;
831  else
832  {
833  const fawkes::Clock* self = (const fawkes::Clock*) tolua_tousertype(tolua_S,1,0);
834  fawkes::Time* time = ((fawkes::Time*) tolua_tousertype(tolua_S,2,0));
835  fawkes::Clock::TimesourceSelector sel = ((fawkes::Clock::TimesourceSelector) (int) tolua_tonumber(tolua_S,3,0));
836 #ifndef TOLUA_RELEASE
837  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'get_time'", NULL);
838 #endif
839  bool exc_caught = false;
840  try {
841  {
842  self->get_time(time,sel);
843  }
844  } catch (fawkes::Exception &e) {
845  exc_caught = true;
846  lua_pushstring(tolua_S, e.what_no_backtrace());
847  }
848  catch (std::exception &e) {
849  exc_caught = true;
850  lua_pushstring(tolua_S, e.what());
851  }
852  if (exc_caught) lua_error(tolua_S);
853 
854  }
855  return 0;
856 tolua_lerror:
857  return tolua_fawkesutils_fawkes_Clock_get_time02(tolua_S);
858 }
859 #endif //#ifndef TOLUA_DISABLE
860 
861 /* method: get_time of class fawkes::Clock */
862 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_get_time04
863 static int tolua_fawkesutils_fawkes_Clock_get_time04(lua_State* tolua_S)
864 {
865  tolua_Error tolua_err;
866  if (
867  !tolua_isusertype(tolua_S,1,"const fawkes::Clock",0,&tolua_err) ||
868  !tolua_isusertype(tolua_S,2,"timeval",0,&tolua_err) ||
869  !tolua_isnoobj(tolua_S,3,&tolua_err)
870  )
871  goto tolua_lerror;
872  else
873  {
874  const fawkes::Clock* self = (const fawkes::Clock*) tolua_tousertype(tolua_S,1,0);
875  struct timeval* tv = ((struct timeval*) tolua_tousertype(tolua_S,2,0));
876 #ifndef TOLUA_RELEASE
877  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'get_time'", NULL);
878 #endif
879  bool exc_caught = false;
880  try {
881  {
882  self->get_time(tv);
883  }
884  } catch (fawkes::Exception &e) {
885  exc_caught = true;
886  lua_pushstring(tolua_S, e.what_no_backtrace());
887  }
888  catch (std::exception &e) {
889  exc_caught = true;
890  lua_pushstring(tolua_S, e.what());
891  }
892  if (exc_caught) lua_error(tolua_S);
893 
894  }
895  return 0;
896 tolua_lerror:
897  return tolua_fawkesutils_fawkes_Clock_get_time03(tolua_S);
898 }
899 #endif //#ifndef TOLUA_DISABLE
900 
901 /* method: get_time of class fawkes::Clock */
902 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_get_time05
903 static int tolua_fawkesutils_fawkes_Clock_get_time05(lua_State* tolua_S)
904 {
905  tolua_Error tolua_err;
906  if (
907  !tolua_isusertype(tolua_S,1,"const fawkes::Clock",0,&tolua_err) ||
908  !tolua_isusertype(tolua_S,2,"timeval",0,&tolua_err) ||
909  !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
910  !tolua_isnoobj(tolua_S,4,&tolua_err)
911  )
912  goto tolua_lerror;
913  else
914  {
915  const fawkes::Clock* self = (const fawkes::Clock*) tolua_tousertype(tolua_S,1,0);
916  struct timeval* tv = ((struct timeval*) tolua_tousertype(tolua_S,2,0));
917  fawkes::Clock::TimesourceSelector sel = ((fawkes::Clock::TimesourceSelector) (int) tolua_tonumber(tolua_S,3,0));
918 #ifndef TOLUA_RELEASE
919  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'get_time'", NULL);
920 #endif
921  bool exc_caught = false;
922  try {
923  {
924  self->get_time(tv,sel);
925  }
926  } catch (fawkes::Exception &e) {
927  exc_caught = true;
928  lua_pushstring(tolua_S, e.what_no_backtrace());
929  }
930  catch (std::exception &e) {
931  exc_caught = true;
932  lua_pushstring(tolua_S, e.what());
933  }
934  if (exc_caught) lua_error(tolua_S);
935 
936  }
937  return 0;
938 tolua_lerror:
939  return tolua_fawkesutils_fawkes_Clock_get_time04(tolua_S);
940 }
941 #endif //#ifndef TOLUA_DISABLE
942 
943 /* method: get_systime of class fawkes::Clock */
944 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_get_systime00
945 static int tolua_fawkesutils_fawkes_Clock_get_systime00(lua_State* tolua_S)
946 {
947 #ifndef TOLUA_RELEASE
948  tolua_Error tolua_err;
949  if (
950  !tolua_isusertype(tolua_S,1,"const fawkes::Clock",0,&tolua_err) ||
951  !tolua_isusertype(tolua_S,2,"timeval",0,&tolua_err) ||
952  !tolua_isnoobj(tolua_S,3,&tolua_err)
953  )
954  goto tolua_lerror;
955  else
956 #endif
957  {
958  const fawkes::Clock* self = (const fawkes::Clock*) tolua_tousertype(tolua_S,1,0);
959  struct timeval* tv = ((struct timeval*) tolua_tousertype(tolua_S,2,0));
960 #ifndef TOLUA_RELEASE
961  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'get_systime'", NULL);
962 #endif
963  bool exc_caught = false;
964  try {
965  {
966  self->get_systime(tv);
967  }
968  } catch (fawkes::Exception &e) {
969  exc_caught = true;
970  lua_pushstring(tolua_S, e.what_no_backtrace());
971  }
972  catch (std::exception &e) {
973  exc_caught = true;
974  lua_pushstring(tolua_S, e.what());
975  }
976  if (exc_caught) lua_error(tolua_S);
977 
978  }
979  return 0;
980 #ifndef TOLUA_RELEASE
981  tolua_lerror:
982  tolua_error(tolua_S,"#ferror in function 'get_systime'.",&tolua_err);
983  return 0;
984 #endif
985 }
986 #endif //#ifndef TOLUA_DISABLE
987 
988 /* method: get_systime of class fawkes::Clock */
989 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_get_systime01
990 static int tolua_fawkesutils_fawkes_Clock_get_systime01(lua_State* tolua_S)
991 {
992  tolua_Error tolua_err;
993  if (
994  !tolua_isusertype(tolua_S,1,"const fawkes::Clock",0,&tolua_err) ||
995  (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"fawkes::Time",0,&tolua_err)) ||
996  !tolua_isnoobj(tolua_S,3,&tolua_err)
997  )
998  goto tolua_lerror;
999  else
1000  {
1001  const fawkes::Clock* self = (const fawkes::Clock*) tolua_tousertype(tolua_S,1,0);
1002  fawkes::Time* time = ((fawkes::Time*) tolua_tousertype(tolua_S,2,0));
1003 #ifndef TOLUA_RELEASE
1004  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'get_systime'", NULL);
1005 #endif
1006  bool exc_caught = false;
1007  try {
1008  {
1009  self->get_systime(*time);
1010  }
1011  } catch (fawkes::Exception &e) {
1012  exc_caught = true;
1013  lua_pushstring(tolua_S, e.what_no_backtrace());
1014  }
1015  catch (std::exception &e) {
1016  exc_caught = true;
1017  lua_pushstring(tolua_S, e.what());
1018  }
1019  if (exc_caught) lua_error(tolua_S);
1020 
1021  }
1022  return 0;
1023 tolua_lerror:
1024  return tolua_fawkesutils_fawkes_Clock_get_systime00(tolua_S);
1025 }
1026 #endif //#ifndef TOLUA_DISABLE
1027 
1028 /* method: get_systime of class fawkes::Clock */
1029 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_get_systime02
1030 static int tolua_fawkesutils_fawkes_Clock_get_systime02(lua_State* tolua_S)
1031 {
1032  tolua_Error tolua_err;
1033  if (
1034  !tolua_isusertype(tolua_S,1,"const fawkes::Clock",0,&tolua_err) ||
1035  !tolua_isusertype(tolua_S,2,"fawkes::Time",0,&tolua_err) ||
1036  !tolua_isnoobj(tolua_S,3,&tolua_err)
1037  )
1038  goto tolua_lerror;
1039  else
1040  {
1041  const fawkes::Clock* self = (const fawkes::Clock*) tolua_tousertype(tolua_S,1,0);
1042  fawkes::Time* time = ((fawkes::Time*) tolua_tousertype(tolua_S,2,0));
1043 #ifndef TOLUA_RELEASE
1044  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'get_systime'", NULL);
1045 #endif
1046  bool exc_caught = false;
1047  try {
1048  {
1049  self->get_systime(time);
1050  }
1051  } catch (fawkes::Exception &e) {
1052  exc_caught = true;
1053  lua_pushstring(tolua_S, e.what_no_backtrace());
1054  }
1055  catch (std::exception &e) {
1056  exc_caught = true;
1057  lua_pushstring(tolua_S, e.what());
1058  }
1059  if (exc_caught) lua_error(tolua_S);
1060 
1061  }
1062  return 0;
1063 tolua_lerror:
1064  return tolua_fawkesutils_fawkes_Clock_get_systime01(tolua_S);
1065 }
1066 #endif //#ifndef TOLUA_DISABLE
1067 
1068 /* method: now of class fawkes::Clock */
1069 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_now00
1070 static int tolua_fawkesutils_fawkes_Clock_now00(lua_State* tolua_S)
1071 {
1072 #ifndef TOLUA_RELEASE
1073  tolua_Error tolua_err;
1074  if (
1075  !tolua_isusertype(tolua_S,1,"const fawkes::Clock",0,&tolua_err) ||
1076  !tolua_isnoobj(tolua_S,2,&tolua_err)
1077  )
1078  goto tolua_lerror;
1079  else
1080 #endif
1081  {
1082  const fawkes::Clock* self = (const fawkes::Clock*) tolua_tousertype(tolua_S,1,0);
1083 #ifndef TOLUA_RELEASE
1084  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'now'", NULL);
1085 #endif
1086  bool exc_caught = false;
1087  try {
1088  {
1089  fawkes::Time tolua_ret = (fawkes::Time) self->now();
1090  {
1091 #ifdef __cplusplus
1092  void* tolua_obj = Mtolua_new((fawkes::Time)(tolua_ret));
1093  tolua_pushusertype(tolua_S,tolua_obj,"fawkes::Time");
1094  tolua_register_gc(tolua_S,lua_gettop(tolua_S));
1095 #else
1096  void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(fawkes::Time));
1097  tolua_pushusertype(tolua_S,tolua_obj,"fawkes::Time");
1098  tolua_register_gc(tolua_S,lua_gettop(tolua_S));
1099 #endif
1100  }
1101  }
1102  } catch (fawkes::Exception &e) {
1103  exc_caught = true;
1104  lua_pushstring(tolua_S, e.what_no_backtrace());
1105  }
1106  catch (std::exception &e) {
1107  exc_caught = true;
1108  lua_pushstring(tolua_S, e.what());
1109  }
1110  if (exc_caught) lua_error(tolua_S);
1111 
1112  }
1113  return 1;
1114 #ifndef TOLUA_RELEASE
1115  tolua_lerror:
1116  tolua_error(tolua_S,"#ferror in function 'now'.",&tolua_err);
1117  return 0;
1118 #endif
1119 }
1120 #endif //#ifndef TOLUA_DISABLE
1121 
1122 /* method: elapsed of class fawkes::Clock */
1123 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_elapsed00
1124 static int tolua_fawkesutils_fawkes_Clock_elapsed00(lua_State* tolua_S)
1125 {
1126 #ifndef TOLUA_RELEASE
1127  tolua_Error tolua_err;
1128  if (
1129  !tolua_isusertype(tolua_S,1,"const fawkes::Clock",0,&tolua_err) ||
1130  !tolua_isusertype(tolua_S,2,"fawkes::Time",0,&tolua_err) ||
1131  !tolua_isnoobj(tolua_S,3,&tolua_err)
1132  )
1133  goto tolua_lerror;
1134  else
1135 #endif
1136  {
1137  const fawkes::Clock* self = (const fawkes::Clock*) tolua_tousertype(tolua_S,1,0);
1138  fawkes::Time* t = ((fawkes::Time*) tolua_tousertype(tolua_S,2,0));
1139 #ifndef TOLUA_RELEASE
1140  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'elapsed'", NULL);
1141 #endif
1142  bool exc_caught = false;
1143  try {
1144  {
1145  float tolua_ret = (float) self->elapsed(t);
1146  tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
1147  }
1148  } catch (fawkes::Exception &e) {
1149  exc_caught = true;
1150  lua_pushstring(tolua_S, e.what_no_backtrace());
1151  }
1152  catch (std::exception &e) {
1153  exc_caught = true;
1154  lua_pushstring(tolua_S, e.what());
1155  }
1156  if (exc_caught) lua_error(tolua_S);
1157 
1158  }
1159  return 1;
1160 #ifndef TOLUA_RELEASE
1161  tolua_lerror:
1162  tolua_error(tolua_S,"#ferror in function 'elapsed'.",&tolua_err);
1163  return 0;
1164 #endif
1165 }
1166 #endif //#ifndef TOLUA_DISABLE
1167 
1168 /* method: sys_elapsed of class fawkes::Clock */
1169 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Clock_sys_elapsed00
1170 static int tolua_fawkesutils_fawkes_Clock_sys_elapsed00(lua_State* tolua_S)
1171 {
1172 #ifndef TOLUA_RELEASE
1173  tolua_Error tolua_err;
1174  if (
1175  !tolua_isusertype(tolua_S,1,"const fawkes::Clock",0,&tolua_err) ||
1176  !tolua_isusertype(tolua_S,2,"fawkes::Time",0,&tolua_err) ||
1177  !tolua_isnoobj(tolua_S,3,&tolua_err)
1178  )
1179  goto tolua_lerror;
1180  else
1181 #endif
1182  {
1183  const fawkes::Clock* self = (const fawkes::Clock*) tolua_tousertype(tolua_S,1,0);
1184  fawkes::Time* t = ((fawkes::Time*) tolua_tousertype(tolua_S,2,0));
1185 #ifndef TOLUA_RELEASE
1186  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'sys_elapsed'", NULL);
1187 #endif
1188  bool exc_caught = false;
1189  try {
1190  {
1191  float tolua_ret = (float) self->sys_elapsed(t);
1192  tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
1193  }
1194  } catch (fawkes::Exception &e) {
1195  exc_caught = true;
1196  lua_pushstring(tolua_S, e.what_no_backtrace());
1197  }
1198  catch (std::exception &e) {
1199  exc_caught = true;
1200  lua_pushstring(tolua_S, e.what());
1201  }
1202  if (exc_caught) lua_error(tolua_S);
1203 
1204  }
1205  return 1;
1206 #ifndef TOLUA_RELEASE
1207  tolua_lerror:
1208  tolua_error(tolua_S,"#ferror in function 'sys_elapsed'.",&tolua_err);
1209  return 0;
1210 #endif
1211 }
1212 #endif //#ifndef TOLUA_DISABLE
1213 
1214 /* get function: tv_sec of class timeval */
1215 #ifndef TOLUA_DISABLE_tolua_get_timeval_tv_sec
1216 static int tolua_get_timeval_tv_sec(lua_State* tolua_S)
1217 {
1218  timeval* self = (timeval*) tolua_tousertype(tolua_S,1,0);
1219 #ifndef TOLUA_RELEASE
1220  if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'tv_sec'",NULL);
1221 #endif
1222  tolua_pushnumber(tolua_S,(lua_Number)self->tv_sec);
1223  return 1;
1224 }
1225 #endif //#ifndef TOLUA_DISABLE
1226 
1227 /* set function: tv_sec of class timeval */
1228 #ifndef TOLUA_DISABLE_tolua_set_timeval_tv_sec
1229 static int tolua_set_timeval_tv_sec(lua_State* tolua_S)
1230 {
1231  timeval* self = (timeval*) tolua_tousertype(tolua_S,1,0);
1232 #ifndef TOLUA_RELEASE
1233  tolua_Error tolua_err;
1234  if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'tv_sec'",NULL);
1235  if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
1236  tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
1237 #endif
1238  self->tv_sec = ((long int) tolua_tonumber(tolua_S,2,0))
1239 ;
1240  return 0;
1241 }
1242 #endif //#ifndef TOLUA_DISABLE
1243 
1244 /* get function: tv_usec of class timeval */
1245 #ifndef TOLUA_DISABLE_tolua_get_timeval_tv_usec
1246 static int tolua_get_timeval_tv_usec(lua_State* tolua_S)
1247 {
1248  timeval* self = (timeval*) tolua_tousertype(tolua_S,1,0);
1249 #ifndef TOLUA_RELEASE
1250  if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'tv_usec'",NULL);
1251 #endif
1252  tolua_pushnumber(tolua_S,(lua_Number)self->tv_usec);
1253  return 1;
1254 }
1255 #endif //#ifndef TOLUA_DISABLE
1256 
1257 /* set function: tv_usec of class timeval */
1258 #ifndef TOLUA_DISABLE_tolua_set_timeval_tv_usec
1259 static int tolua_set_timeval_tv_usec(lua_State* tolua_S)
1260 {
1261  timeval* self = (timeval*) tolua_tousertype(tolua_S,1,0);
1262 #ifndef TOLUA_RELEASE
1263  tolua_Error tolua_err;
1264  if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'tv_usec'",NULL);
1265  if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
1266  tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
1267 #endif
1268  self->tv_usec = ((long int) tolua_tonumber(tolua_S,2,0))
1269 ;
1270  return 0;
1271 }
1272 #endif //#ifndef TOLUA_DISABLE
1273 
1274 /* method: new of class fawkes::Time */
1275 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_new00
1276 static int tolua_fawkesutils_fawkes_Time_new00(lua_State* tolua_S)
1277 {
1278 #ifndef TOLUA_RELEASE
1279  tolua_Error tolua_err;
1280  if (
1281  !tolua_isusertable(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
1282  !tolua_isnoobj(tolua_S,2,&tolua_err)
1283  )
1284  goto tolua_lerror;
1285  else
1286 #endif
1287  {
1288  bool exc_caught = false;
1289  try {
1290  {
1291  fawkes::Time* tolua_ret = (fawkes::Time*) Mtolua_new((fawkes::Time)());
1292  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Time");
1293  }
1294  } catch (fawkes::Exception &e) {
1295  exc_caught = true;
1296  lua_pushstring(tolua_S, e.what_no_backtrace());
1297  }
1298  catch (std::exception &e) {
1299  exc_caught = true;
1300  lua_pushstring(tolua_S, e.what());
1301  }
1302  if (exc_caught) lua_error(tolua_S);
1303 
1304  }
1305  return 1;
1306 #ifndef TOLUA_RELEASE
1307  tolua_lerror:
1308  tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
1309  return 0;
1310 #endif
1311 }
1312 #endif //#ifndef TOLUA_DISABLE
1313 
1314 /* method: new_local of class fawkes::Time */
1315 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_new00_local
1316 static int tolua_fawkesutils_fawkes_Time_new00_local(lua_State* tolua_S)
1317 {
1318 #ifndef TOLUA_RELEASE
1319  tolua_Error tolua_err;
1320  if (
1321  !tolua_isusertable(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
1322  !tolua_isnoobj(tolua_S,2,&tolua_err)
1323  )
1324  goto tolua_lerror;
1325  else
1326 #endif
1327  {
1328  bool exc_caught = false;
1329  try {
1330  {
1331  fawkes::Time* tolua_ret = (fawkes::Time*) Mtolua_new((fawkes::Time)());
1332  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Time");
1333  tolua_register_gc(tolua_S,lua_gettop(tolua_S));
1334  }
1335  } catch (fawkes::Exception &e) {
1336  exc_caught = true;
1337  lua_pushstring(tolua_S, e.what_no_backtrace());
1338  }
1339  catch (std::exception &e) {
1340  exc_caught = true;
1341  lua_pushstring(tolua_S, e.what());
1342  }
1343  if (exc_caught) lua_error(tolua_S);
1344 
1345  }
1346  return 1;
1347 #ifndef TOLUA_RELEASE
1348  tolua_lerror:
1349  tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
1350  return 0;
1351 #endif
1352 }
1353 #endif //#ifndef TOLUA_DISABLE
1354 
1355 /* method: new of class fawkes::Time */
1356 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_new01
1357 static int tolua_fawkesutils_fawkes_Time_new01(lua_State* tolua_S)
1358 {
1359  tolua_Error tolua_err;
1360  if (
1361  !tolua_isusertable(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
1362  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
1363  !tolua_isnoobj(tolua_S,3,&tolua_err)
1364  )
1365  goto tolua_lerror;
1366  else
1367  {
1368  long ms = ((long) tolua_tonumber(tolua_S,2,0));
1369  bool exc_caught = false;
1370  try {
1371  {
1372  fawkes::Time* tolua_ret = (fawkes::Time*) Mtolua_new((fawkes::Time)(ms));
1373  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Time");
1374  }
1375  } catch (fawkes::Exception &e) {
1376  exc_caught = true;
1377  lua_pushstring(tolua_S, e.what_no_backtrace());
1378  }
1379  catch (std::exception &e) {
1380  exc_caught = true;
1381  lua_pushstring(tolua_S, e.what());
1382  }
1383  if (exc_caught) lua_error(tolua_S);
1384 
1385  }
1386  return 1;
1387 tolua_lerror:
1388  return tolua_fawkesutils_fawkes_Time_new00(tolua_S);
1389 }
1390 #endif //#ifndef TOLUA_DISABLE
1391 
1392 /* method: new_local of class fawkes::Time */
1393 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_new01_local
1394 static int tolua_fawkesutils_fawkes_Time_new01_local(lua_State* tolua_S)
1395 {
1396  tolua_Error tolua_err;
1397  if (
1398  !tolua_isusertable(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
1399  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
1400  !tolua_isnoobj(tolua_S,3,&tolua_err)
1401  )
1402  goto tolua_lerror;
1403  else
1404  {
1405  long ms = ((long) tolua_tonumber(tolua_S,2,0));
1406  bool exc_caught = false;
1407  try {
1408  {
1409  fawkes::Time* tolua_ret = (fawkes::Time*) Mtolua_new((fawkes::Time)(ms));
1410  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Time");
1411  tolua_register_gc(tolua_S,lua_gettop(tolua_S));
1412  }
1413  } catch (fawkes::Exception &e) {
1414  exc_caught = true;
1415  lua_pushstring(tolua_S, e.what_no_backtrace());
1416  }
1417  catch (std::exception &e) {
1418  exc_caught = true;
1419  lua_pushstring(tolua_S, e.what());
1420  }
1421  if (exc_caught) lua_error(tolua_S);
1422 
1423  }
1424  return 1;
1425 tolua_lerror:
1426  return tolua_fawkesutils_fawkes_Time_new00_local(tolua_S);
1427 }
1428 #endif //#ifndef TOLUA_DISABLE
1429 
1430 /* method: new of class fawkes::Time */
1431 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_new02
1432 static int tolua_fawkesutils_fawkes_Time_new02(lua_State* tolua_S)
1433 {
1434  tolua_Error tolua_err;
1435  if (
1436  !tolua_isusertable(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
1437  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
1438  !tolua_isnoobj(tolua_S,3,&tolua_err)
1439  )
1440  goto tolua_lerror;
1441  else
1442  {
1443  float sec = ((float) tolua_tonumber(tolua_S,2,0));
1444  bool exc_caught = false;
1445  try {
1446  {
1447  fawkes::Time* tolua_ret = (fawkes::Time*) Mtolua_new((fawkes::Time)(sec));
1448  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Time");
1449  }
1450  } catch (fawkes::Exception &e) {
1451  exc_caught = true;
1452  lua_pushstring(tolua_S, e.what_no_backtrace());
1453  }
1454  catch (std::exception &e) {
1455  exc_caught = true;
1456  lua_pushstring(tolua_S, e.what());
1457  }
1458  if (exc_caught) lua_error(tolua_S);
1459 
1460  }
1461  return 1;
1462 tolua_lerror:
1463  return tolua_fawkesutils_fawkes_Time_new01(tolua_S);
1464 }
1465 #endif //#ifndef TOLUA_DISABLE
1466 
1467 /* method: new_local of class fawkes::Time */
1468 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_new02_local
1469 static int tolua_fawkesutils_fawkes_Time_new02_local(lua_State* tolua_S)
1470 {
1471  tolua_Error tolua_err;
1472  if (
1473  !tolua_isusertable(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
1474  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
1475  !tolua_isnoobj(tolua_S,3,&tolua_err)
1476  )
1477  goto tolua_lerror;
1478  else
1479  {
1480  float sec = ((float) tolua_tonumber(tolua_S,2,0));
1481  bool exc_caught = false;
1482  try {
1483  {
1484  fawkes::Time* tolua_ret = (fawkes::Time*) Mtolua_new((fawkes::Time)(sec));
1485  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Time");
1486  tolua_register_gc(tolua_S,lua_gettop(tolua_S));
1487  }
1488  } catch (fawkes::Exception &e) {
1489  exc_caught = true;
1490  lua_pushstring(tolua_S, e.what_no_backtrace());
1491  }
1492  catch (std::exception &e) {
1493  exc_caught = true;
1494  lua_pushstring(tolua_S, e.what());
1495  }
1496  if (exc_caught) lua_error(tolua_S);
1497 
1498  }
1499  return 1;
1500 tolua_lerror:
1501  return tolua_fawkesutils_fawkes_Time_new01_local(tolua_S);
1502 }
1503 #endif //#ifndef TOLUA_DISABLE
1504 
1505 /* method: new of class fawkes::Time */
1506 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_new03
1507 static int tolua_fawkesutils_fawkes_Time_new03(lua_State* tolua_S)
1508 {
1509  tolua_Error tolua_err;
1510  if (
1511  !tolua_isusertable(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
1512  !tolua_isusertype(tolua_S,2,"fawkes::Clock",0,&tolua_err) ||
1513  !tolua_isnoobj(tolua_S,3,&tolua_err)
1514  )
1515  goto tolua_lerror;
1516  else
1517  {
1518  fawkes::Clock* clock = ((fawkes::Clock*) tolua_tousertype(tolua_S,2,0));
1519  bool exc_caught = false;
1520  try {
1521  {
1522  fawkes::Time* tolua_ret = (fawkes::Time*) Mtolua_new((fawkes::Time)(clock));
1523  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Time");
1524  }
1525  } catch (fawkes::Exception &e) {
1526  exc_caught = true;
1527  lua_pushstring(tolua_S, e.what_no_backtrace());
1528  }
1529  catch (std::exception &e) {
1530  exc_caught = true;
1531  lua_pushstring(tolua_S, e.what());
1532  }
1533  if (exc_caught) lua_error(tolua_S);
1534 
1535  }
1536  return 1;
1537 tolua_lerror:
1538  return tolua_fawkesutils_fawkes_Time_new02(tolua_S);
1539 }
1540 #endif //#ifndef TOLUA_DISABLE
1541 
1542 /* method: new_local of class fawkes::Time */
1543 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_new03_local
1544 static int tolua_fawkesutils_fawkes_Time_new03_local(lua_State* tolua_S)
1545 {
1546  tolua_Error tolua_err;
1547  if (
1548  !tolua_isusertable(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
1549  !tolua_isusertype(tolua_S,2,"fawkes::Clock",0,&tolua_err) ||
1550  !tolua_isnoobj(tolua_S,3,&tolua_err)
1551  )
1552  goto tolua_lerror;
1553  else
1554  {
1555  fawkes::Clock* clock = ((fawkes::Clock*) tolua_tousertype(tolua_S,2,0));
1556  bool exc_caught = false;
1557  try {
1558  {
1559  fawkes::Time* tolua_ret = (fawkes::Time*) Mtolua_new((fawkes::Time)(clock));
1560  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Time");
1561  tolua_register_gc(tolua_S,lua_gettop(tolua_S));
1562  }
1563  } catch (fawkes::Exception &e) {
1564  exc_caught = true;
1565  lua_pushstring(tolua_S, e.what_no_backtrace());
1566  }
1567  catch (std::exception &e) {
1568  exc_caught = true;
1569  lua_pushstring(tolua_S, e.what());
1570  }
1571  if (exc_caught) lua_error(tolua_S);
1572 
1573  }
1574  return 1;
1575 tolua_lerror:
1576  return tolua_fawkesutils_fawkes_Time_new02_local(tolua_S);
1577 }
1578 #endif //#ifndef TOLUA_DISABLE
1579 
1580 /* method: new of class fawkes::Time */
1581 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_new04
1582 static int tolua_fawkesutils_fawkes_Time_new04(lua_State* tolua_S)
1583 {
1584  tolua_Error tolua_err;
1585  if (
1586  !tolua_isusertable(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
1587  (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const fawkes::Time",0,&tolua_err)) ||
1588  !tolua_isnoobj(tolua_S,3,&tolua_err)
1589  )
1590  goto tolua_lerror;
1591  else
1592  {
1593  const fawkes::Time* t = ((const fawkes::Time*) tolua_tousertype(tolua_S,2,0));
1594  bool exc_caught = false;
1595  try {
1596  {
1597  fawkes::Time* tolua_ret = (fawkes::Time*) Mtolua_new((fawkes::Time)(*t));
1598  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Time");
1599  }
1600  } catch (fawkes::Exception &e) {
1601  exc_caught = true;
1602  lua_pushstring(tolua_S, e.what_no_backtrace());
1603  }
1604  catch (std::exception &e) {
1605  exc_caught = true;
1606  lua_pushstring(tolua_S, e.what());
1607  }
1608  if (exc_caught) lua_error(tolua_S);
1609 
1610  }
1611  return 1;
1612 tolua_lerror:
1613  return tolua_fawkesutils_fawkes_Time_new03(tolua_S);
1614 }
1615 #endif //#ifndef TOLUA_DISABLE
1616 
1617 /* method: new_local of class fawkes::Time */
1618 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_new04_local
1619 static int tolua_fawkesutils_fawkes_Time_new04_local(lua_State* tolua_S)
1620 {
1621  tolua_Error tolua_err;
1622  if (
1623  !tolua_isusertable(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
1624  (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const fawkes::Time",0,&tolua_err)) ||
1625  !tolua_isnoobj(tolua_S,3,&tolua_err)
1626  )
1627  goto tolua_lerror;
1628  else
1629  {
1630  const fawkes::Time* t = ((const fawkes::Time*) tolua_tousertype(tolua_S,2,0));
1631  bool exc_caught = false;
1632  try {
1633  {
1634  fawkes::Time* tolua_ret = (fawkes::Time*) Mtolua_new((fawkes::Time)(*t));
1635  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Time");
1636  tolua_register_gc(tolua_S,lua_gettop(tolua_S));
1637  }
1638  } catch (fawkes::Exception &e) {
1639  exc_caught = true;
1640  lua_pushstring(tolua_S, e.what_no_backtrace());
1641  }
1642  catch (std::exception &e) {
1643  exc_caught = true;
1644  lua_pushstring(tolua_S, e.what());
1645  }
1646  if (exc_caught) lua_error(tolua_S);
1647 
1648  }
1649  return 1;
1650 tolua_lerror:
1651  return tolua_fawkesutils_fawkes_Time_new03_local(tolua_S);
1652 }
1653 #endif //#ifndef TOLUA_DISABLE
1654 
1655 /* method: new of class fawkes::Time */
1656 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_new05
1657 static int tolua_fawkesutils_fawkes_Time_new05(lua_State* tolua_S)
1658 {
1659  tolua_Error tolua_err;
1660  if (
1661  !tolua_isusertable(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
1662  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
1663  !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
1664  !tolua_isnoobj(tolua_S,4,&tolua_err)
1665  )
1666  goto tolua_lerror;
1667  else
1668  {
1669  long sec = ((long) tolua_tonumber(tolua_S,2,0));
1670  long usec = ((long) tolua_tonumber(tolua_S,3,0));
1671  bool exc_caught = false;
1672  try {
1673  {
1674  fawkes::Time* tolua_ret = (fawkes::Time*) Mtolua_new((fawkes::Time)(sec,usec));
1675  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Time");
1676  }
1677  } catch (fawkes::Exception &e) {
1678  exc_caught = true;
1679  lua_pushstring(tolua_S, e.what_no_backtrace());
1680  }
1681  catch (std::exception &e) {
1682  exc_caught = true;
1683  lua_pushstring(tolua_S, e.what());
1684  }
1685  if (exc_caught) lua_error(tolua_S);
1686 
1687  }
1688  return 1;
1689 tolua_lerror:
1690  return tolua_fawkesutils_fawkes_Time_new04(tolua_S);
1691 }
1692 #endif //#ifndef TOLUA_DISABLE
1693 
1694 /* method: new_local of class fawkes::Time */
1695 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_new05_local
1696 static int tolua_fawkesutils_fawkes_Time_new05_local(lua_State* tolua_S)
1697 {
1698  tolua_Error tolua_err;
1699  if (
1700  !tolua_isusertable(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
1701  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
1702  !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
1703  !tolua_isnoobj(tolua_S,4,&tolua_err)
1704  )
1705  goto tolua_lerror;
1706  else
1707  {
1708  long sec = ((long) tolua_tonumber(tolua_S,2,0));
1709  long usec = ((long) tolua_tonumber(tolua_S,3,0));
1710  bool exc_caught = false;
1711  try {
1712  {
1713  fawkes::Time* tolua_ret = (fawkes::Time*) Mtolua_new((fawkes::Time)(sec,usec));
1714  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Time");
1715  tolua_register_gc(tolua_S,lua_gettop(tolua_S));
1716  }
1717  } catch (fawkes::Exception &e) {
1718  exc_caught = true;
1719  lua_pushstring(tolua_S, e.what_no_backtrace());
1720  }
1721  catch (std::exception &e) {
1722  exc_caught = true;
1723  lua_pushstring(tolua_S, e.what());
1724  }
1725  if (exc_caught) lua_error(tolua_S);
1726 
1727  }
1728  return 1;
1729 tolua_lerror:
1730  return tolua_fawkesutils_fawkes_Time_new04_local(tolua_S);
1731 }
1732 #endif //#ifndef TOLUA_DISABLE
1733 
1734 /* method: new of class fawkes::Time */
1735 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_new06
1736 static int tolua_fawkesutils_fawkes_Time_new06(lua_State* tolua_S)
1737 {
1738  tolua_Error tolua_err;
1739  if (
1740  !tolua_isusertable(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
1741  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
1742  !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
1743  !tolua_isusertype(tolua_S,4,"fawkes::Clock",0,&tolua_err) ||
1744  !tolua_isnoobj(tolua_S,5,&tolua_err)
1745  )
1746  goto tolua_lerror;
1747  else
1748  {
1749  long sec = ((long) tolua_tonumber(tolua_S,2,0));
1750  long usec = ((long) tolua_tonumber(tolua_S,3,0));
1751  fawkes::Clock* clock = ((fawkes::Clock*) tolua_tousertype(tolua_S,4,0));
1752  bool exc_caught = false;
1753  try {
1754  {
1755  fawkes::Time* tolua_ret = (fawkes::Time*) Mtolua_new((fawkes::Time)(sec,usec,clock));
1756  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Time");
1757  }
1758  } catch (fawkes::Exception &e) {
1759  exc_caught = true;
1760  lua_pushstring(tolua_S, e.what_no_backtrace());
1761  }
1762  catch (std::exception &e) {
1763  exc_caught = true;
1764  lua_pushstring(tolua_S, e.what());
1765  }
1766  if (exc_caught) lua_error(tolua_S);
1767 
1768  }
1769  return 1;
1770 tolua_lerror:
1771  return tolua_fawkesutils_fawkes_Time_new05(tolua_S);
1772 }
1773 #endif //#ifndef TOLUA_DISABLE
1774 
1775 /* method: new_local of class fawkes::Time */
1776 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_new06_local
1777 static int tolua_fawkesutils_fawkes_Time_new06_local(lua_State* tolua_S)
1778 {
1779  tolua_Error tolua_err;
1780  if (
1781  !tolua_isusertable(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
1782  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
1783  !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
1784  !tolua_isusertype(tolua_S,4,"fawkes::Clock",0,&tolua_err) ||
1785  !tolua_isnoobj(tolua_S,5,&tolua_err)
1786  )
1787  goto tolua_lerror;
1788  else
1789  {
1790  long sec = ((long) tolua_tonumber(tolua_S,2,0));
1791  long usec = ((long) tolua_tonumber(tolua_S,3,0));
1792  fawkes::Clock* clock = ((fawkes::Clock*) tolua_tousertype(tolua_S,4,0));
1793  bool exc_caught = false;
1794  try {
1795  {
1796  fawkes::Time* tolua_ret = (fawkes::Time*) Mtolua_new((fawkes::Time)(sec,usec,clock));
1797  tolua_pushusertype(tolua_S,(void*)tolua_ret,"fawkes::Time");
1798  tolua_register_gc(tolua_S,lua_gettop(tolua_S));
1799  }
1800  } catch (fawkes::Exception &e) {
1801  exc_caught = true;
1802  lua_pushstring(tolua_S, e.what_no_backtrace());
1803  }
1804  catch (std::exception &e) {
1805  exc_caught = true;
1806  lua_pushstring(tolua_S, e.what());
1807  }
1808  if (exc_caught) lua_error(tolua_S);
1809 
1810  }
1811  return 1;
1812 tolua_lerror:
1813  return tolua_fawkesutils_fawkes_Time_new05_local(tolua_S);
1814 }
1815 #endif //#ifndef TOLUA_DISABLE
1816 
1817 /* method: delete of class fawkes::Time */
1818 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_delete00
1819 static int tolua_fawkesutils_fawkes_Time_delete00(lua_State* tolua_S)
1820 {
1821 #ifndef TOLUA_RELEASE
1822  tolua_Error tolua_err;
1823  if (
1824  !tolua_isusertype(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
1825  !tolua_isnoobj(tolua_S,2,&tolua_err)
1826  )
1827  goto tolua_lerror;
1828  else
1829 #endif
1830  {
1831  fawkes::Time* self = (fawkes::Time*) tolua_tousertype(tolua_S,1,0);
1832 #ifndef TOLUA_RELEASE
1833  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'delete'", NULL);
1834 #endif
1835  bool exc_caught = false;
1836  try {
1837  Mtolua_delete(self);
1838  } catch (fawkes::Exception &e) {
1839  exc_caught = true;
1840  lua_pushstring(tolua_S, e.what_no_backtrace());
1841  }
1842  catch (std::exception &e) {
1843  exc_caught = true;
1844  lua_pushstring(tolua_S, e.what());
1845  }
1846  if (exc_caught) lua_error(tolua_S);
1847 
1848  }
1849  return 0;
1850 #ifndef TOLUA_RELEASE
1851  tolua_lerror:
1852  tolua_error(tolua_S,"#ferror in function 'delete'.",&tolua_err);
1853  return 0;
1854 #endif
1855 }
1856 #endif //#ifndef TOLUA_DISABLE
1857 
1858 /* method: in_sec of class fawkes::Time */
1859 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_in_sec00
1860 static int tolua_fawkesutils_fawkes_Time_in_sec00(lua_State* tolua_S)
1861 {
1862 #ifndef TOLUA_RELEASE
1863  tolua_Error tolua_err;
1864  if (
1865  !tolua_isusertype(tolua_S,1,"const fawkes::Time",0,&tolua_err) ||
1866  !tolua_isnoobj(tolua_S,2,&tolua_err)
1867  )
1868  goto tolua_lerror;
1869  else
1870 #endif
1871  {
1872  const fawkes::Time* self = (const fawkes::Time*) tolua_tousertype(tolua_S,1,0);
1873 #ifndef TOLUA_RELEASE
1874  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'in_sec'", NULL);
1875 #endif
1876  bool exc_caught = false;
1877  try {
1878  {
1879  float tolua_ret = (float) self->in_sec();
1880  tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
1881  }
1882  } catch (fawkes::Exception &e) {
1883  exc_caught = true;
1884  lua_pushstring(tolua_S, e.what_no_backtrace());
1885  }
1886  catch (std::exception &e) {
1887  exc_caught = true;
1888  lua_pushstring(tolua_S, e.what());
1889  }
1890  if (exc_caught) lua_error(tolua_S);
1891 
1892  }
1893  return 1;
1894 #ifndef TOLUA_RELEASE
1895  tolua_lerror:
1896  tolua_error(tolua_S,"#ferror in function 'in_sec'.",&tolua_err);
1897  return 0;
1898 #endif
1899 }
1900 #endif //#ifndef TOLUA_DISABLE
1901 
1902 /* method: in_msec of class fawkes::Time */
1903 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_in_msec00
1904 static int tolua_fawkesutils_fawkes_Time_in_msec00(lua_State* tolua_S)
1905 {
1906 #ifndef TOLUA_RELEASE
1907  tolua_Error tolua_err;
1908  if (
1909  !tolua_isusertype(tolua_S,1,"const fawkes::Time",0,&tolua_err) ||
1910  !tolua_isnoobj(tolua_S,2,&tolua_err)
1911  )
1912  goto tolua_lerror;
1913  else
1914 #endif
1915  {
1916  const fawkes::Time* self = (const fawkes::Time*) tolua_tousertype(tolua_S,1,0);
1917 #ifndef TOLUA_RELEASE
1918  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'in_msec'", NULL);
1919 #endif
1920  bool exc_caught = false;
1921  try {
1922  {
1923  long tolua_ret = (long) self->in_msec();
1924  tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
1925  }
1926  } catch (fawkes::Exception &e) {
1927  exc_caught = true;
1928  lua_pushstring(tolua_S, e.what_no_backtrace());
1929  }
1930  catch (std::exception &e) {
1931  exc_caught = true;
1932  lua_pushstring(tolua_S, e.what());
1933  }
1934  if (exc_caught) lua_error(tolua_S);
1935 
1936  }
1937  return 1;
1938 #ifndef TOLUA_RELEASE
1939  tolua_lerror:
1940  tolua_error(tolua_S,"#ferror in function 'in_msec'.",&tolua_err);
1941  return 0;
1942 #endif
1943 }
1944 #endif //#ifndef TOLUA_DISABLE
1945 
1946 /* method: in_usec of class fawkes::Time */
1947 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_in_usec00
1948 static int tolua_fawkesutils_fawkes_Time_in_usec00(lua_State* tolua_S)
1949 {
1950 #ifndef TOLUA_RELEASE
1951  tolua_Error tolua_err;
1952  if (
1953  !tolua_isusertype(tolua_S,1,"const fawkes::Time",0,&tolua_err) ||
1954  !tolua_isnoobj(tolua_S,2,&tolua_err)
1955  )
1956  goto tolua_lerror;
1957  else
1958 #endif
1959  {
1960  const fawkes::Time* self = (const fawkes::Time*) tolua_tousertype(tolua_S,1,0);
1961 #ifndef TOLUA_RELEASE
1962  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'in_usec'", NULL);
1963 #endif
1964  bool exc_caught = false;
1965  try {
1966  {
1967  long tolua_ret = (long) self->in_usec();
1968  tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
1969  }
1970  } catch (fawkes::Exception &e) {
1971  exc_caught = true;
1972  lua_pushstring(tolua_S, e.what_no_backtrace());
1973  }
1974  catch (std::exception &e) {
1975  exc_caught = true;
1976  lua_pushstring(tolua_S, e.what());
1977  }
1978  if (exc_caught) lua_error(tolua_S);
1979 
1980  }
1981  return 1;
1982 #ifndef TOLUA_RELEASE
1983  tolua_lerror:
1984  tolua_error(tolua_S,"#ferror in function 'in_usec'.",&tolua_err);
1985  return 0;
1986 #endif
1987 }
1988 #endif //#ifndef TOLUA_DISABLE
1989 
1990 /* method: get_timeval of class fawkes::Time */
1991 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_get_timeval00
1992 static int tolua_fawkesutils_fawkes_Time_get_timeval00(lua_State* tolua_S)
1993 {
1994 #ifndef TOLUA_RELEASE
1995  tolua_Error tolua_err;
1996  if (
1997  !tolua_isusertype(tolua_S,1,"const fawkes::Time",0,&tolua_err) ||
1998  !tolua_isnoobj(tolua_S,2,&tolua_err)
1999  )
2000  goto tolua_lerror;
2001  else
2002 #endif
2003  {
2004  const fawkes::Time* self = (const fawkes::Time*) tolua_tousertype(tolua_S,1,0);
2005 #ifndef TOLUA_RELEASE
2006  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'get_timeval'", NULL);
2007 #endif
2008  bool exc_caught = false;
2009  try {
2010  {
2011  const timeval* tolua_ret = (const timeval*) self->get_timeval();
2012  tolua_pushusertype(tolua_S,(void*)tolua_ret,"const timeval");
2013  }
2014  } catch (fawkes::Exception &e) {
2015  exc_caught = true;
2016  lua_pushstring(tolua_S, e.what_no_backtrace());
2017  }
2018  catch (std::exception &e) {
2019  exc_caught = true;
2020  lua_pushstring(tolua_S, e.what());
2021  }
2022  if (exc_caught) lua_error(tolua_S);
2023 
2024  }
2025  return 1;
2026 #ifndef TOLUA_RELEASE
2027  tolua_lerror:
2028  tolua_error(tolua_S,"#ferror in function 'get_timeval'.",&tolua_err);
2029  return 0;
2030 #endif
2031 }
2032 #endif //#ifndef TOLUA_DISABLE
2033 
2034 /* method: set_time of class fawkes::Time */
2035 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_set_time00
2036 static int tolua_fawkesutils_fawkes_Time_set_time00(lua_State* tolua_S)
2037 {
2038 #ifndef TOLUA_RELEASE
2039  tolua_Error tolua_err;
2040  if (
2041  !tolua_isusertype(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
2042  !tolua_isusertype(tolua_S,2,"const timeval",0,&tolua_err) ||
2043  !tolua_isnoobj(tolua_S,3,&tolua_err)
2044  )
2045  goto tolua_lerror;
2046  else
2047 #endif
2048  {
2049  fawkes::Time* self = (fawkes::Time*) tolua_tousertype(tolua_S,1,0);
2050  const timeval* tv = ((const timeval*) tolua_tousertype(tolua_S,2,0));
2051 #ifndef TOLUA_RELEASE
2052  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'set_time'", NULL);
2053 #endif
2054  bool exc_caught = false;
2055  try {
2056  {
2057  self->set_time(tv);
2058  }
2059  } catch (fawkes::Exception &e) {
2060  exc_caught = true;
2061  lua_pushstring(tolua_S, e.what_no_backtrace());
2062  }
2063  catch (std::exception &e) {
2064  exc_caught = true;
2065  lua_pushstring(tolua_S, e.what());
2066  }
2067  if (exc_caught) lua_error(tolua_S);
2068 
2069  }
2070  return 0;
2071 #ifndef TOLUA_RELEASE
2072  tolua_lerror:
2073  tolua_error(tolua_S,"#ferror in function 'set_time'.",&tolua_err);
2074  return 0;
2075 #endif
2076 }
2077 #endif //#ifndef TOLUA_DISABLE
2078 
2079 /* method: set_time of class fawkes::Time */
2080 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_set_time01
2081 static int tolua_fawkesutils_fawkes_Time_set_time01(lua_State* tolua_S)
2082 {
2083  tolua_Error tolua_err;
2084  if (
2085  !tolua_isusertype(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
2086  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
2087  !tolua_isnoobj(tolua_S,3,&tolua_err)
2088  )
2089  goto tolua_lerror;
2090  else
2091  {
2092  fawkes::Time* self = (fawkes::Time*) tolua_tousertype(tolua_S,1,0);
2093  long ms = ((long) tolua_tonumber(tolua_S,2,0));
2094 #ifndef TOLUA_RELEASE
2095  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'set_time'", NULL);
2096 #endif
2097  bool exc_caught = false;
2098  try {
2099  {
2100  self->set_time(ms);
2101  }
2102  } catch (fawkes::Exception &e) {
2103  exc_caught = true;
2104  lua_pushstring(tolua_S, e.what_no_backtrace());
2105  }
2106  catch (std::exception &e) {
2107  exc_caught = true;
2108  lua_pushstring(tolua_S, e.what());
2109  }
2110  if (exc_caught) lua_error(tolua_S);
2111 
2112  }
2113  return 0;
2114 tolua_lerror:
2115  return tolua_fawkesutils_fawkes_Time_set_time00(tolua_S);
2116 }
2117 #endif //#ifndef TOLUA_DISABLE
2118 
2119 /* method: set_time of class fawkes::Time */
2120 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_set_time02
2121 static int tolua_fawkesutils_fawkes_Time_set_time02(lua_State* tolua_S)
2122 {
2123  tolua_Error tolua_err;
2124  if (
2125  !tolua_isusertype(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
2126  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
2127  !tolua_isnoobj(tolua_S,3,&tolua_err)
2128  )
2129  goto tolua_lerror;
2130  else
2131  {
2132  fawkes::Time* self = (fawkes::Time*) tolua_tousertype(tolua_S,1,0);
2133  float sec = ((float) tolua_tonumber(tolua_S,2,0));
2134 #ifndef TOLUA_RELEASE
2135  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'set_time'", NULL);
2136 #endif
2137  bool exc_caught = false;
2138  try {
2139  {
2140  self->set_time(sec);
2141  }
2142  } catch (fawkes::Exception &e) {
2143  exc_caught = true;
2144  lua_pushstring(tolua_S, e.what_no_backtrace());
2145  }
2146  catch (std::exception &e) {
2147  exc_caught = true;
2148  lua_pushstring(tolua_S, e.what());
2149  }
2150  if (exc_caught) lua_error(tolua_S);
2151 
2152  }
2153  return 0;
2154 tolua_lerror:
2155  return tolua_fawkesutils_fawkes_Time_set_time01(tolua_S);
2156 }
2157 #endif //#ifndef TOLUA_DISABLE
2158 
2159 /* method: set_time of class fawkes::Time */
2160 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_set_time03
2161 static int tolua_fawkesutils_fawkes_Time_set_time03(lua_State* tolua_S)
2162 {
2163  tolua_Error tolua_err;
2164  if (
2165  !tolua_isusertype(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
2166  (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const fawkes::Time",0,&tolua_err)) ||
2167  !tolua_isnoobj(tolua_S,3,&tolua_err)
2168  )
2169  goto tolua_lerror;
2170  else
2171  {
2172  fawkes::Time* self = (fawkes::Time*) tolua_tousertype(tolua_S,1,0);
2173  const fawkes::Time* t = ((const fawkes::Time*) tolua_tousertype(tolua_S,2,0));
2174 #ifndef TOLUA_RELEASE
2175  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'set_time'", NULL);
2176 #endif
2177  bool exc_caught = false;
2178  try {
2179  {
2180  self->set_time(*t);
2181  }
2182  } catch (fawkes::Exception &e) {
2183  exc_caught = true;
2184  lua_pushstring(tolua_S, e.what_no_backtrace());
2185  }
2186  catch (std::exception &e) {
2187  exc_caught = true;
2188  lua_pushstring(tolua_S, e.what());
2189  }
2190  if (exc_caught) lua_error(tolua_S);
2191 
2192  }
2193  return 0;
2194 tolua_lerror:
2195  return tolua_fawkesutils_fawkes_Time_set_time02(tolua_S);
2196 }
2197 #endif //#ifndef TOLUA_DISABLE
2198 
2199 /* method: add of class fawkes::Time */
2200 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_add00
2201 static int tolua_fawkesutils_fawkes_Time_add00(lua_State* tolua_S)
2202 {
2203 #ifndef TOLUA_RELEASE
2204  tolua_Error tolua_err;
2205  if (
2206  !tolua_isusertype(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
2207  !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
2208  !tolua_isnoobj(tolua_S,3,&tolua_err)
2209  )
2210  goto tolua_lerror;
2211  else
2212 #endif
2213  {
2214  fawkes::Time* self = (fawkes::Time*) tolua_tousertype(tolua_S,1,0);
2215  float seconds = ((float) tolua_tonumber(tolua_S,2,0));
2216 #ifndef TOLUA_RELEASE
2217  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'add'", NULL);
2218 #endif
2219  bool exc_caught = false;
2220  try {
2221  {
2222  self->add(seconds);
2223  }
2224  } catch (fawkes::Exception &e) {
2225  exc_caught = true;
2226  lua_pushstring(tolua_S, e.what_no_backtrace());
2227  }
2228  catch (std::exception &e) {
2229  exc_caught = true;
2230  lua_pushstring(tolua_S, e.what());
2231  }
2232  if (exc_caught) lua_error(tolua_S);
2233 
2234  }
2235  return 0;
2236 #ifndef TOLUA_RELEASE
2237  tolua_lerror:
2238  tolua_error(tolua_S,"#ferror in function 'add'.",&tolua_err);
2239  return 0;
2240 #endif
2241 }
2242 #endif //#ifndef TOLUA_DISABLE
2243 
2244 /* method: stamp of class fawkes::Time */
2245 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_stamp00
2246 static int tolua_fawkesutils_fawkes_Time_stamp00(lua_State* tolua_S)
2247 {
2248 #ifndef TOLUA_RELEASE
2249  tolua_Error tolua_err;
2250  if (
2251  !tolua_isusertype(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
2252  !tolua_isnoobj(tolua_S,2,&tolua_err)
2253  )
2254  goto tolua_lerror;
2255  else
2256 #endif
2257  {
2258  fawkes::Time* self = (fawkes::Time*) tolua_tousertype(tolua_S,1,0);
2259 #ifndef TOLUA_RELEASE
2260  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'stamp'", NULL);
2261 #endif
2262  bool exc_caught = false;
2263  try {
2264  {
2265  fawkes::Time& tolua_ret = (fawkes::Time&) self->stamp();
2266  tolua_pushusertype(tolua_S,(void*)&tolua_ret,"fawkes::Time");
2267  }
2268  } catch (fawkes::Exception &e) {
2269  exc_caught = true;
2270  lua_pushstring(tolua_S, e.what_no_backtrace());
2271  }
2272  catch (std::exception &e) {
2273  exc_caught = true;
2274  lua_pushstring(tolua_S, e.what());
2275  }
2276  if (exc_caught) lua_error(tolua_S);
2277 
2278  }
2279  return 1;
2280 #ifndef TOLUA_RELEASE
2281  tolua_lerror:
2282  tolua_error(tolua_S,"#ferror in function 'stamp'.",&tolua_err);
2283  return 0;
2284 #endif
2285 }
2286 #endif //#ifndef TOLUA_DISABLE
2287 
2288 /* method: operator+ of class fawkes::Time */
2289 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time__add00
2290 static int tolua_fawkesutils_fawkes_Time__add00(lua_State* tolua_S)
2291 {
2292 #ifndef TOLUA_RELEASE
2293  tolua_Error tolua_err;
2294  if (
2295  !tolua_isusertype(tolua_S,1,"const fawkes::Time",0,&tolua_err) ||
2296  (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const fawkes::Time",0,&tolua_err)) ||
2297  !tolua_isnoobj(tolua_S,3,&tolua_err)
2298  )
2299  goto tolua_lerror;
2300  else
2301 #endif
2302  {
2303  const fawkes::Time* self = (const fawkes::Time*) tolua_tousertype(tolua_S,1,0);
2304  const fawkes::Time* t = ((const fawkes::Time*) tolua_tousertype(tolua_S,2,0));
2305 #ifndef TOLUA_RELEASE
2306  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'operator+'", NULL);
2307 #endif
2308  bool exc_caught = false;
2309  try {
2310  {
2311  fawkes::Time tolua_ret = (fawkes::Time) self->operator+(*t);
2312  {
2313 #ifdef __cplusplus
2314  void* tolua_obj = Mtolua_new((fawkes::Time)(tolua_ret));
2315  tolua_pushusertype(tolua_S,tolua_obj,"fawkes::Time");
2316  tolua_register_gc(tolua_S,lua_gettop(tolua_S));
2317 #else
2318  void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(fawkes::Time));
2319  tolua_pushusertype(tolua_S,tolua_obj,"fawkes::Time");
2320  tolua_register_gc(tolua_S,lua_gettop(tolua_S));
2321 #endif
2322  }
2323  }
2324  } catch (fawkes::Exception &e) {
2325  exc_caught = true;
2326  lua_pushstring(tolua_S, e.what_no_backtrace());
2327  }
2328  catch (std::exception &e) {
2329  exc_caught = true;
2330  lua_pushstring(tolua_S, e.what());
2331  }
2332  if (exc_caught) lua_error(tolua_S);
2333 
2334  }
2335  return 1;
2336 #ifndef TOLUA_RELEASE
2337  tolua_lerror:
2338  tolua_error(tolua_S,"#ferror in function '.add'.",&tolua_err);
2339  return 0;
2340 #endif
2341 }
2342 #endif //#ifndef TOLUA_DISABLE
2343 
2344 /* method: operator- of class fawkes::Time */
2345 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time__sub00
2346 static int tolua_fawkesutils_fawkes_Time__sub00(lua_State* tolua_S)
2347 {
2348 #ifndef TOLUA_RELEASE
2349  tolua_Error tolua_err;
2350  if (
2351  !tolua_isusertype(tolua_S,1,"const fawkes::Time",0,&tolua_err) ||
2352  !tolua_isusertype(tolua_S,2,"const fawkes::Time",0,&tolua_err) ||
2353  !tolua_isnoobj(tolua_S,3,&tolua_err)
2354  )
2355  goto tolua_lerror;
2356  else
2357 #endif
2358  {
2359  const fawkes::Time* self = (const fawkes::Time*) tolua_tousertype(tolua_S,1,0);
2360  const fawkes::Time* t = ((const fawkes::Time*) tolua_tousertype(tolua_S,2,0));
2361 #ifndef TOLUA_RELEASE
2362  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'operator-'", NULL);
2363 #endif
2364  bool exc_caught = false;
2365  try {
2366  {
2367  float tolua_ret = (float) self->operator-(t);
2368  tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
2369  }
2370  } catch (fawkes::Exception &e) {
2371  exc_caught = true;
2372  lua_pushstring(tolua_S, e.what_no_backtrace());
2373  }
2374  catch (std::exception &e) {
2375  exc_caught = true;
2376  lua_pushstring(tolua_S, e.what());
2377  }
2378  if (exc_caught) lua_error(tolua_S);
2379 
2380  }
2381  return 1;
2382 #ifndef TOLUA_RELEASE
2383  tolua_lerror:
2384  tolua_error(tolua_S,"#ferror in function '.sub'.",&tolua_err);
2385  return 0;
2386 #endif
2387 }
2388 #endif //#ifndef TOLUA_DISABLE
2389 
2390 /* method: str of class fawkes::Time */
2391 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_str00
2392 static int tolua_fawkesutils_fawkes_Time_str00(lua_State* tolua_S)
2393 {
2394 #ifndef TOLUA_RELEASE
2395  tolua_Error tolua_err;
2396  if (
2397  !tolua_isusertype(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
2398  !tolua_isnoobj(tolua_S,2,&tolua_err)
2399  )
2400  goto tolua_lerror;
2401  else
2402 #endif
2403  {
2404  fawkes::Time* self = (fawkes::Time*) tolua_tousertype(tolua_S,1,0);
2405 #ifndef TOLUA_RELEASE
2406  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'str'", NULL);
2407 #endif
2408  bool exc_caught = false;
2409  try {
2410  {
2411  const char* tolua_ret = (const char*) self->str();
2412  tolua_pushstring(tolua_S,(const char*)tolua_ret);
2413  }
2414  } catch (fawkes::Exception &e) {
2415  exc_caught = true;
2416  lua_pushstring(tolua_S, e.what_no_backtrace());
2417  }
2418  catch (std::exception &e) {
2419  exc_caught = true;
2420  lua_pushstring(tolua_S, e.what());
2421  }
2422  if (exc_caught) lua_error(tolua_S);
2423 
2424  }
2425  return 1;
2426 #ifndef TOLUA_RELEASE
2427  tolua_lerror:
2428  tolua_error(tolua_S,"#ferror in function 'str'.",&tolua_err);
2429  return 0;
2430 #endif
2431 }
2432 #endif //#ifndef TOLUA_DISABLE
2433 
2434 /* method: str_r of class fawkes::Time */
2435 #ifndef TOLUA_DISABLE_tolua_fawkesutils_fawkes_Time_str_r00
2436 static int tolua_fawkesutils_fawkes_Time_str_r00(lua_State* tolua_S)
2437 {
2438 #ifndef TOLUA_RELEASE
2439  tolua_Error tolua_err;
2440  if (
2441  !tolua_isusertype(tolua_S,1,"fawkes::Time",0,&tolua_err) ||
2442  !tolua_isstring(tolua_S,2,0,&tolua_err) ||
2443  !tolua_isnoobj(tolua_S,3,&tolua_err)
2444  )
2445  goto tolua_lerror;
2446  else
2447 #endif
2448  {
2449  fawkes::Time* self = (fawkes::Time*) tolua_tousertype(tolua_S,1,0);
2450  char* s = ((char*) tolua_tostring(tolua_S,2,0));
2451 #ifndef TOLUA_RELEASE
2452  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'str_r'", NULL);
2453 #endif
2454  bool exc_caught = false;
2455  try {
2456  {
2457  self->str_r(s);
2458  }
2459  } catch (fawkes::Exception &e) {
2460  exc_caught = true;
2461  lua_pushstring(tolua_S, e.what_no_backtrace());
2462  }
2463  catch (std::exception &e) {
2464  exc_caught = true;
2465  lua_pushstring(tolua_S, e.what());
2466  }
2467  if (exc_caught) lua_error(tolua_S);
2468 
2469  }
2470  return 0;
2471 #ifndef TOLUA_RELEASE
2472  tolua_lerror:
2473  tolua_error(tolua_S,"#ferror in function 'str_r'.",&tolua_err);
2474  return 0;
2475 #endif
2476 }
2477 #endif //#ifndef TOLUA_DISABLE
2478 
2479 /* Open function */
2480 TOLUA_API int tolua_fawkesutils_open (lua_State* tolua_S)
2481 {
2482  tolua_open(tolua_S);
2483  tolua_reg_types(tolua_S);
2484  tolua_module(tolua_S,NULL,0);
2485  tolua_beginmodule(tolua_S,NULL);
2486  tolua_module(tolua_S,"fawkes",0);
2487  tolua_beginmodule(tolua_S,"fawkes");
2488  #ifdef __cplusplus
2489  tolua_cclass(tolua_S,"KalmanFilter1D","fawkes::KalmanFilter1D","",tolua_collect_fawkes__KalmanFilter1D);
2490  #else
2491  tolua_cclass(tolua_S,"KalmanFilter1D","fawkes::KalmanFilter1D","",NULL);
2492  #endif
2493  tolua_beginmodule(tolua_S,"KalmanFilter1D");
2494  tolua_function(tolua_S,"new",tolua_fawkesutils_fawkes_KalmanFilter1D_new00);
2495  tolua_function(tolua_S,"new_local",tolua_fawkesutils_fawkes_KalmanFilter1D_new00_local);
2496  tolua_function(tolua_S,".call",tolua_fawkesutils_fawkes_KalmanFilter1D_new00_local);
2497  tolua_function(tolua_S,"delete",tolua_fawkesutils_fawkes_KalmanFilter1D_delete00);
2498  tolua_function(tolua_S,"filter",tolua_fawkesutils_fawkes_KalmanFilter1D_filter00);
2499  tolua_function(tolua_S,"filter",tolua_fawkesutils_fawkes_KalmanFilter1D_filter01);
2500  tolua_function(tolua_S,"predict",tolua_fawkesutils_fawkes_KalmanFilter1D_predict00);
2501  tolua_function(tolua_S,"predict",tolua_fawkesutils_fawkes_KalmanFilter1D_predict01);
2502  tolua_function(tolua_S,"predict",tolua_fawkesutils_fawkes_KalmanFilter1D_predict02);
2503  tolua_function(tolua_S,"predict",tolua_fawkesutils_fawkes_KalmanFilter1D_predict03);
2504  tolua_endmodule(tolua_S);
2505  tolua_endmodule(tolua_S);
2506  tolua_module(tolua_S,"fawkes",0);
2507  tolua_beginmodule(tolua_S,"fawkes");
2508  tolua_cclass(tolua_S,"Clock","fawkes::Clock","",NULL);
2509  tolua_beginmodule(tolua_S,"Clock");
2510  tolua_constant(tolua_S,"DEFAULT",fawkes::Clock::DEFAULT);
2511  tolua_constant(tolua_S,"REALTIME",fawkes::Clock::REALTIME);
2512  tolua_constant(tolua_S,"EXTERNAL",fawkes::Clock::EXTERNAL);
2513  tolua_function(tolua_S,"instance",tolua_fawkesutils_fawkes_Clock_instance00);
2514  tolua_function(tolua_S,"finalize",tolua_fawkesutils_fawkes_Clock_finalize00);
2515  tolua_function(tolua_S,"is_ext_default_timesource",tolua_fawkesutils_fawkes_Clock_is_ext_default_timesource00);
2516  tolua_function(tolua_S,"has_ext_timesource",tolua_fawkesutils_fawkes_Clock_has_ext_timesource00);
2517  tolua_function(tolua_S,"ext_to_realtime",tolua_fawkesutils_fawkes_Clock_ext_to_realtime00);
2518  tolua_function(tolua_S,"get_time",tolua_fawkesutils_fawkes_Clock_get_time00);
2519  tolua_function(tolua_S,"get_time",tolua_fawkesutils_fawkes_Clock_get_time01);
2520  tolua_function(tolua_S,"get_time",tolua_fawkesutils_fawkes_Clock_get_time02);
2521  tolua_function(tolua_S,"get_time",tolua_fawkesutils_fawkes_Clock_get_time03);
2522  tolua_function(tolua_S,"get_time",tolua_fawkesutils_fawkes_Clock_get_time04);
2523  tolua_function(tolua_S,"get_time",tolua_fawkesutils_fawkes_Clock_get_time05);
2524  tolua_function(tolua_S,"get_systime",tolua_fawkesutils_fawkes_Clock_get_systime00);
2525  tolua_function(tolua_S,"get_systime",tolua_fawkesutils_fawkes_Clock_get_systime01);
2526  tolua_function(tolua_S,"get_systime",tolua_fawkesutils_fawkes_Clock_get_systime02);
2527  tolua_function(tolua_S,"now",tolua_fawkesutils_fawkes_Clock_now00);
2528  tolua_function(tolua_S,"elapsed",tolua_fawkesutils_fawkes_Clock_elapsed00);
2529  tolua_function(tolua_S,"sys_elapsed",tolua_fawkesutils_fawkes_Clock_sys_elapsed00);
2530  tolua_endmodule(tolua_S);
2531  tolua_endmodule(tolua_S);
2532  tolua_cclass(tolua_S,"timeval","timeval","",NULL);
2533  tolua_beginmodule(tolua_S,"timeval");
2534  tolua_variable(tolua_S,"tv_sec",tolua_get_timeval_tv_sec,tolua_set_timeval_tv_sec);
2535  tolua_variable(tolua_S,"tv_usec",tolua_get_timeval_tv_usec,tolua_set_timeval_tv_usec);
2536  tolua_endmodule(tolua_S);
2537  tolua_module(tolua_S,"fawkes",0);
2538  tolua_beginmodule(tolua_S,"fawkes");
2539  #ifdef __cplusplus
2540  tolua_cclass(tolua_S,"Time","fawkes::Time","",tolua_collect_fawkes__Time);
2541  #else
2542  tolua_cclass(tolua_S,"Time","fawkes::Time","",NULL);
2543  #endif
2544  tolua_beginmodule(tolua_S,"Time");
2545  tolua_function(tolua_S,"new",tolua_fawkesutils_fawkes_Time_new00);
2546  tolua_function(tolua_S,"new_local",tolua_fawkesutils_fawkes_Time_new00_local);
2547  tolua_function(tolua_S,".call",tolua_fawkesutils_fawkes_Time_new00_local);
2548  tolua_function(tolua_S,"new",tolua_fawkesutils_fawkes_Time_new01);
2549  tolua_function(tolua_S,"new_local",tolua_fawkesutils_fawkes_Time_new01_local);
2550  tolua_function(tolua_S,".call",tolua_fawkesutils_fawkes_Time_new01_local);
2551  tolua_function(tolua_S,"new",tolua_fawkesutils_fawkes_Time_new02);
2552  tolua_function(tolua_S,"new_local",tolua_fawkesutils_fawkes_Time_new02_local);
2553  tolua_function(tolua_S,".call",tolua_fawkesutils_fawkes_Time_new02_local);
2554  tolua_function(tolua_S,"new",tolua_fawkesutils_fawkes_Time_new03);
2555  tolua_function(tolua_S,"new_local",tolua_fawkesutils_fawkes_Time_new03_local);
2556  tolua_function(tolua_S,".call",tolua_fawkesutils_fawkes_Time_new03_local);
2557  tolua_function(tolua_S,"new",tolua_fawkesutils_fawkes_Time_new04);
2558  tolua_function(tolua_S,"new_local",tolua_fawkesutils_fawkes_Time_new04_local);
2559  tolua_function(tolua_S,".call",tolua_fawkesutils_fawkes_Time_new04_local);
2560  tolua_function(tolua_S,"new",tolua_fawkesutils_fawkes_Time_new05);
2561  tolua_function(tolua_S,"new_local",tolua_fawkesutils_fawkes_Time_new05_local);
2562  tolua_function(tolua_S,".call",tolua_fawkesutils_fawkes_Time_new05_local);
2563  tolua_function(tolua_S,"new",tolua_fawkesutils_fawkes_Time_new06);
2564  tolua_function(tolua_S,"new_local",tolua_fawkesutils_fawkes_Time_new06_local);
2565  tolua_function(tolua_S,".call",tolua_fawkesutils_fawkes_Time_new06_local);
2566  tolua_function(tolua_S,"delete",tolua_fawkesutils_fawkes_Time_delete00);
2567  tolua_function(tolua_S,"in_sec",tolua_fawkesutils_fawkes_Time_in_sec00);
2568  tolua_function(tolua_S,"in_msec",tolua_fawkesutils_fawkes_Time_in_msec00);
2569  tolua_function(tolua_S,"in_usec",tolua_fawkesutils_fawkes_Time_in_usec00);
2570  tolua_function(tolua_S,"get_timeval",tolua_fawkesutils_fawkes_Time_get_timeval00);
2571  tolua_function(tolua_S,"set_time",tolua_fawkesutils_fawkes_Time_set_time00);
2572  tolua_function(tolua_S,"set_time",tolua_fawkesutils_fawkes_Time_set_time01);
2573  tolua_function(tolua_S,"set_time",tolua_fawkesutils_fawkes_Time_set_time02);
2574  tolua_function(tolua_S,"set_time",tolua_fawkesutils_fawkes_Time_set_time03);
2575  tolua_function(tolua_S,"add",tolua_fawkesutils_fawkes_Time_add00);
2576  tolua_function(tolua_S,"stamp",tolua_fawkesutils_fawkes_Time_stamp00);
2577  tolua_function(tolua_S,".add",tolua_fawkesutils_fawkes_Time__add00);
2578  tolua_function(tolua_S,".sub",tolua_fawkesutils_fawkes_Time__sub00);
2579  tolua_function(tolua_S,"str",tolua_fawkesutils_fawkes_Time_str00);
2580  tolua_function(tolua_S,"str_r",tolua_fawkesutils_fawkes_Time_str_r00);
2581  tolua_endmodule(tolua_S);
2582  tolua_endmodule(tolua_S);
2583  tolua_endmodule(tolua_S);
2584  return 1;
2585 }
2586 
2587 
2588 extern "C" {
2589 #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
2590  TOLUA_API int luaopen_fawkesutils (lua_State* tolua_S) {
2591  return tolua_fawkesutils_open(tolua_S);
2592 };
2593 #endif
2594 }
2595 
2596 
This is supposed to be the central clock in Fawkes.
Definition: clock.h:35
TimesourceSelector
Select the time source.
Definition: clock.h:38
@ DEFAULT
select the default time source
Definition: clock.h:39
@ REALTIME
select the system time source
Definition: clock.h:40
@ EXTERNAL
select the external time source
Definition: clock.h:41
static void finalize()
Finalize.
Definition: clock.cpp:74
bool is_ext_default_timesource() const
Checks whether the external time source is the default time soucre.
Definition: clock.cpp:136
bool has_ext_timesource() const
Check whether an external time source is registered.
Definition: clock.cpp:319
static Clock * instance()
Clock initializer.
Definition: clock.cpp:63
Time ext_to_realtime(const Time &t)
Convert a time given w.r.t.
Definition: clock.cpp:278
Base class for exceptions in Fawkes.
Definition: exception.h:36
virtual const char * what_no_backtrace() const noexcept
Get primary string (does not implicitly print the back trace).
Definition: exception.cpp:663
One-dimensional Kalman filter implementation for single-precision floats.
Definition: kalman_1d.h:29
float predict() const
Predicts the next position based on the past observations.
Definition: kalman_1d.cpp:82
A class for handling time.
Definition: time.h:93
Time & stamp()
Set this time to the current time.
Definition: time.cpp:704
double in_sec() const
Convet time to seconds.
Definition: time.cpp:219
const timeval * get_timeval() const
Obtain the timeval where the time is stored.
Definition: time.h:112
long in_usec() const
Convert the stored time into micro-seconds.
Definition: time.cpp:237
const char * str(bool utc=false) const
Output function.
Definition: time.cpp:790
long in_msec() const
Convert the stored time into milli-seconds.
Definition: time.cpp:228