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 
34 namespace fawkes {
35 class TestInterface;
36 }
37 
38 class EclipseAgentThread;
39 
45 {
46 public:
47  AgentControlThread(EclipseAgentThread *eclipse_thread);
48  virtual ~AgentControlThread();
49 
50  virtual void init();
51  virtual bool prepare_finalize_user();
52  virtual void finalize();
53  virtual void loop();
54 
55 private:
56  EclipseAgentThread *m_eclipse_thread;
57 
58  fawkes::TestInterface * m_test_iface;
59  fawkes::ExitSimulationInterface * m_exit_iface;
60  fawkes::EclipseDebuggerInterface *m_debug_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__ */
AgentControlThread::AgentControlThread
AgentControlThread(EclipseAgentThread *eclipse_thread)
Constructor.
Definition: control_thread.cpp:43
fawkes::ExitSimulationInterface
ExitSimulationInterface Fawkes BlackBoard Interface.
Definition: ExitSimulationInterface.h:34
AgentControlThread::prepare_finalize_user
virtual bool prepare_finalize_user()
Prepare finalization user implementation.
Definition: control_thread.cpp:95
AgentControlThread::finalize
virtual void finalize()
Finalize the thread.
Definition: control_thread.cpp:103
AgentControlThread::~AgentControlThread
virtual ~AgentControlThread()
Destructor.
Definition: control_thread.cpp:51
fawkes::BlockedTimingAspect
Thread aspect to use blocked timing.
Definition: blocked_timing.h:51
EclipseAgentThread
This thread creates an ECLiPSe context in which the ECLiPSe interpreter and the program are loaded.
Definition: eclipse_thread.h:45
AgentControlThread::loop
virtual void loop()
Code to execute in the thread.
Definition: control_thread.cpp:114
fawkes::BlackBoardAspect
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
fawkes
Fawkes library namespace.
fawkes::LoggingAspect
Thread aspect to log output.
Definition: logging.h:33
fawkes::EclipseDebuggerInterface
EclipseDebuggerInterface Fawkes BlackBoard Interface.
Definition: EclipseDebuggerInterface.h:34
AgentControlThread
This thread controls the agent thread by sending signals.
Definition: control_thread.h:45
AgentControlThread::init
virtual void init()
Initialize the thread.
Definition: control_thread.cpp:56
fawkes::Thread
Thread class encapsulation of pthreads.
Definition: thread.h:46
fawkes::ConfigurableAspect
Thread aspect to access configuration data.
Definition: configurable.h:33
fawkes::TestInterface
TestInterface Fawkes BlackBoard Interface.
Definition: TestInterface.h:34