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 <aspect/blackboard.h>
27
#include <aspect/blocked_timing.h>
28
#include <aspect/clock.h>
29
#include <aspect/configurable.h>
30
#include <aspect/logging.h>
31
#include <core/threading/thread.h>
32
#ifdef HAVE_TF
33
# include <aspect/tf.h>
34
#endif
35
#include <blackboard/interface_listener.h>
36
#include <utils/system/fam.h>
37
38
#include <cstdlib>
39
#include <string>
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
}
// namespace fawkes
50
51
class
LuaAgentPeriodicExecutionThread
:
public
fawkes::Thread
,
52
public
fawkes::BlockedTimingAspect
,
53
public
fawkes::LoggingAspect
,
54
public
fawkes::BlackBoardAspect
,
55
public
fawkes::ConfigurableAspect
,
56
#ifdef HAVE_TF
57
public
fawkes::TransformAspect
,
58
#endif
59
public
fawkes::ClockAspect
60
{
61
public
:
62
LuaAgentPeriodicExecutionThread
();
63
virtual
~LuaAgentPeriodicExecutionThread
();
64
65
virtual
void
init
();
66
virtual
void
loop
();
67
virtual
void
finalize
();
68
69
/** Stub to see name in backtrace for easier debugging. @see Thread::run() */
70
protected
:
71
virtual
void
72
run
()
73
{
74
Thread::run();
75
}
76
77
private
:
/* methods */
78
void
init_failure_cleanup();
79
void
process_agdbg_messages();
80
81
private
:
/* members */
82
fawkes::ComponentLogger
*clog_;
83
84
// config values
85
std::string cfg_agent_;
86
bool
cfg_watch_files_;
87
88
fawkes::SkillerInterface
* skiller_if_;
89
fawkes::SkillerDebugInterface
*agdbg_if_;
90
91
fawkes::LuaContext
* lua_;
92
fawkes::LuaInterfaceImporter
*lua_ifi_;
93
};
94
95
#endif
LuaAgentPeriodicExecutionThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition:
periodic_exec_thread.h:71
fawkes::LuaContext
Definition:
context.h:47
fawkes::ComponentLogger
Definition:
component.h:39
fawkes::LuaInterfaceImporter
Definition:
interface_importer.h:45
LuaAgentPeriodicExecutionThread::init
virtual void init()
Initialize the thread.
Definition:
periodic_exec_thread.cpp:90
LuaAgentPeriodicExecutionThread::LuaAgentPeriodicExecutionThread
LuaAgentPeriodicExecutionThread()
Constructor.
Definition:
periodic_exec_thread.cpp:50
fawkes::BlockedTimingAspect
Definition:
blocked_timing.h:54
LuaAgentPeriodicExecutionThread::loop
virtual void loop()
Code to execute in the thread.
Definition:
periodic_exec_thread.cpp:219
LuaAgentPeriodicExecutionThread::~LuaAgentPeriodicExecutionThread
virtual ~LuaAgentPeriodicExecutionThread()
Destructor.
Definition:
periodic_exec_thread.cpp:58
fawkes::BlackBoardAspect
Definition:
blackboard.h:36
fawkes
fawkes::LoggingAspect
Definition:
logging.h:36
fawkes::SkillerDebugInterface
Definition:
SkillerDebugInterface.h:37
fawkes::TransformAspect
Definition:
tf.h:41
LuaAgentPeriodicExecutionThread::finalize
virtual void finalize()
Finalize the thread.
Definition:
periodic_exec_thread.cpp:167
LuaAgentPeriodicExecutionThread
Definition:
periodic_exec_thread.h:50
fawkes::SkillerInterface
Definition:
SkillerInterface.h:37
fawkes::Thread
Definition:
thread.h:44
fawkes::ConfigurableAspect
Definition:
configurable.h:36
fawkes::ClockAspect
Definition:
clock.h:38
src
plugins
luaagent
periodic_exec_thread.h
Generated by
1.8.16