Fawkes API Fawkes Development Version
control_thread.h
1
2/***************************************************************************
3 * control_thread.h - Fawkes ECLiPSe Control Thread
4 *
5 * Created: Wed Jul 15 15:05:57 2009
6 * Copyright 2009 Daniel Beck
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_ECLIPSE_CLP_CONTROL_THREAD_H_
24#define _PLUGINS_ECLIPSE_CLP_CONTROL_THREAD_H_
25
26#include <aspect/blackboard.h>
27#include <aspect/blocked_timing.h>
28#include <aspect/configurable.h>
29#include <aspect/logging.h>
30#include <core/threading/thread.h>
31#include <interfaces/EclipseDebuggerInterface.h>
32#include <interfaces/ExitSimulationInterface.h>
33
34namespace fawkes {
35class TestInterface;
36}
37
39
45{
46public:
48 virtual ~AgentControlThread();
49
50 virtual void init();
51 virtual bool prepare_finalize_user();
52 virtual void finalize();
53 virtual void loop();
54
55private:
56 EclipseAgentThread *m_eclipse_thread;
57
58 fawkes::TestInterface * m_test_iface;
61
62 bool allow_shutdown_;
63 std::string fawkes_path_;
64 std::string simulation_shutdown_script_;
65};
66
67#endif /* PLUGINS_ECLIPSE_CLP_CONTROL_THREAD_H__ */
This thread controls the agent thread by sending signals.
virtual void loop()
Code to execute in the thread.
virtual bool prepare_finalize_user()
Prepare finalization user implementation.
virtual void init()
Initialize the thread.
virtual ~AgentControlThread()
Destructor.
AgentControlThread(EclipseAgentThread *eclipse_thread)
Constructor.
virtual void finalize()
Finalize the thread.
This thread creates an ECLiPSe context in which the ECLiPSe interpreter and the program are loaded.
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Thread aspect to use blocked timing.
Thread aspect to access configuration data.
Definition: configurable.h:33
EclipseDebuggerInterface Fawkes BlackBoard Interface.
ExitSimulationInterface Fawkes BlackBoard Interface.
Thread aspect to log output.
Definition: logging.h:33
TestInterface Fawkes BlackBoard Interface.
Definition: TestInterface.h:34
Thread class encapsulation of pthreads.
Definition: thread.h:46
Fawkes library namespace.