00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __PLUGINS_LUAAGENT_EXEC_THREAD_H_
00024 #define __PLUGINS_LUAAGENT_EXEC_THREAD_H_
00025
00026 #include <core/threading/thread.h>
00027 #include <aspect/blocked_timing.h>
00028 #include <aspect/logging.h>
00029 #include <aspect/configurable.h>
00030 #include <aspect/clock.h>
00031 #include <aspect/blackboard.h>
00032 #include <utils/system/fam.h>
00033 #include <blackboard/interface_listener.h>
00034
00035 #include <string>
00036 #include <cstdlib>
00037
00038 namespace fawkes {
00039 class ComponentLogger;
00040 class Mutex;
00041 class LuaContext;
00042 class LuaInterfaceImporter;
00043 class Interface;
00044 class SkillerInterface;
00045 class SkillerDebugInterface;
00046 }
00047
00048 class LuaAgentExecutionThread
00049 : public fawkes::Thread,
00050 public fawkes::BlockedTimingAspect,
00051 public fawkes::LoggingAspect,
00052 public fawkes::BlackBoardAspect,
00053 public fawkes::ConfigurableAspect,
00054 public fawkes::ClockAspect
00055 {
00056 public:
00057 LuaAgentExecutionThread();
00058 virtual ~LuaAgentExecutionThread();
00059
00060 virtual void init();
00061 virtual void loop();
00062 virtual void finalize();
00063
00064
00065 protected: virtual void run() { Thread::run(); }
00066
00067 private:
00068 void init_failure_cleanup();
00069 void process_agdbg_messages();
00070
00071 private:
00072 fawkes::ComponentLogger *__clog;
00073
00074
00075 std::string __cfg_agent;
00076 bool __cfg_watch_files;
00077
00078 fawkes::SkillerInterface *__skiller_if;
00079 fawkes::SkillerDebugInterface *__agdbg_if;
00080
00081 fawkes::LuaContext *__lua;
00082 fawkes::LuaInterfaceImporter *__lua_ifi;
00083 };
00084
00085 #endif