Fawkes API  Fawkes Development Version
periodic_exec_thread.h
1 
2 /***************************************************************************
3  * periodic_exec_thread.h - Fawkes LuaAgent: Periodic Execution Thread
4  *
5  * Created: Thu Jan 01 11:12:13 2009
6  * Copyright 2006-2011 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __PLUGINS_LUAAGENT_PERIODIC_EXEC_THREAD_H_
24 #define __PLUGINS_LUAAGENT_PERIODIC_EXEC_THREAD_H_
25 
26 #include <core/threading/thread.h>
27 #include <aspect/blocked_timing.h>
28 #include <aspect/logging.h>
29 #include <aspect/configurable.h>
30 #include <aspect/clock.h>
31 #include <aspect/blackboard.h>
32 #ifdef HAVE_TF
33 # include <aspect/tf.h>
34 #endif
35 #include <utils/system/fam.h>
36 #include <blackboard/interface_listener.h>
37 
38 #include <string>
39 #include <cstdlib>
40 
41 namespace fawkes {
42  class ComponentLogger;
43  class Mutex;
44  class LuaContext;
45  class LuaInterfaceImporter;
46  class Interface;
47  class SkillerInterface;
48  class SkillerDebugInterface;
49 }
50 
52 : public fawkes::Thread,
54  public fawkes::LoggingAspect,
57 #ifdef HAVE_TF
59 #endif
60  public fawkes::ClockAspect
61 {
62  public:
65 
66  virtual void init();
67  virtual void loop();
68  virtual void finalize();
69 
70  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
71  protected: virtual void run() { Thread::run(); }
72 
73  private: /* methods */
74  void init_failure_cleanup();
75  void process_agdbg_messages();
76 
77  private: /* members */
79 
80  // config values
81  std::string __cfg_agent;
82  bool __cfg_watch_files;
83 
84  fawkes::SkillerInterface *__skiller_if;
86 
87  fawkes::LuaContext *__lua;
89 };
90 
91 #endif
SkillerDebugInterface Fawkes BlackBoard Interface.
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Thread aspect that allows to obtain the current time from the clock.
Definition: clock.h:36
LuaAgent Periodic Execution Thread.
Fawkes library namespace.
virtual void run()
Code to execute in the thread.
Definition: thread.cpp:939
Thread class encapsulation of pthreads.
Definition: thread.h:42
Thread aspect to access the transform system.
Definition: tf.h:42
Thread aspect to use blocked timing.
Lua interface importer.
Lua C++ wrapper.
Definition: context.h:47
Thread aspect to log output.
Definition: logging.h:35
Component logger.
Definition: component.h:35
Thread aspect to access configuration data.
Definition: configurable.h:35
SkillerInterface Fawkes BlackBoard Interface.
virtual void run()
Stub to see name in backtrace for easier debugging.