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