Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
rtt
ExecutionEngine.hpp
Go to the documentation of this file.
1
/***************************************************************************
2
tag: Peter Soetens Wed Jan 18 14:11:40 CET 2006 ExecutionEngine.hpp
3
4
ExecutionEngine.hpp - description
5
-------------------
6
begin : Wed January 18 2006
7
copyright : (C) 2006 Peter Soetens
8
email : peter.soetens@mech.kuleuven.be
9
10
***************************************************************************
11
* This library is free software; you can redistribute it and/or *
12
* modify it under the terms of the GNU General Public *
13
* License as published by the Free Software Foundation; *
14
* version 2 of the License. *
15
* *
16
* As a special exception, you may use this file as part of a free *
17
* software library without restriction. Specifically, if other files *
18
* instantiate templates or use macros or inline functions from this *
19
* file, or you compile this file and link it with other files to *
20
* produce an executable, this file does not by itself cause the *
21
* resulting executable to be covered by the GNU General Public *
22
* License. This exception does not however invalidate any other *
23
* reasons why the executable file might be covered by the GNU General *
24
* Public License. *
25
* *
26
* This library is distributed in the hope that it will be useful, *
27
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
28
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
29
* Lesser General Public License for more details. *
30
* *
31
* You should have received a copy of the GNU General Public *
32
* License along with this library; if not, write to the Free Software *
33
* Foundation, Inc., 59 Temple Place, *
34
* Suite 330, Boston, MA 02111-1307 USA *
35
* *
36
***************************************************************************/
37
38
39
#ifndef ORO_EXECUTION_ENGINE_HPP
40
#define ORO_EXECUTION_ENGINE_HPP
41
42
#include "
os/Mutex.hpp
"
43
#include "
os/MutexLock.hpp
"
44
#include "
os/Condition.hpp
"
45
#include "
base/RunnableInterface.hpp
"
46
#include "
base/ActivityInterface.hpp
"
47
#include "
base/DisposableInterface.hpp
"
48
#include "
base/ExecutableInterface.hpp
"
49
#include "
internal/List.hpp
"
50
#include <vector>
51
#include <boost/function.hpp>
52
53
#include "rtt-config.h"
54
#include "
internal/rtt-internal-fwd.hpp
"
55
56
namespace
RTT
57
{
58
69
class
RTT_API
ExecutionEngine
70
:
public
base::RunnableInterface
71
{
72
public
:
79
ExecutionEngine
(
base::TaskCore
* owner = 0);
80
81
~
ExecutionEngine
();
82
87
base::TaskCore
* getParent();
88
93
base::TaskCore
*
getTaskCore
()
const
{
return
taskc; }
94
105
virtual
bool
process
(
base::DisposableInterface
* c);
106
114
virtual
bool
process
(
base::PortInterface
* port);
115
124
virtual
bool
runFunction(
base::ExecutableInterface
* f);
125
131
virtual
bool
removeFunction(
base::ExecutableInterface
* f);
132
138
virtual
bool
removeSelfFunction(
base::ExecutableInterface
* f);
139
149
void
waitForMessages(
const
boost::function<
bool
(
void
)>& pred);
150
159
bool
stopTask(
base::TaskCore
* task);
160
161
165
void
setExceptionTask();
166
174
bool
isSelf()
const
;
175
176
protected
:
190
void
waitForMessagesInternal( boost::function<
bool
(
void
)>
const
& pred);
191
204
void
waitAndProcessMessages(boost::function<
bool
(
void
)>
const
& pred);
205
209
base::TaskCore
*
taskc
;
210
214
internal::MWSRQueue<base::DisposableInterface*>
*
mqueue
;
215
219
internal::MWSRQueue<base::PortInterface*>
*
port_queue
;
220
224
internal::MWSRQueue<base::ExecutableInterface*>
*
f_queue
;
225
226
os::Mutex
msg_lock
;
227
os::Condition
msg_cond
;
228
229
void
processMessages();
230
void
processPortCallbacks();
231
void
processFunctions();
232
void
processHooks();
233
234
virtual
bool
initialize();
235
240
virtual
void
step();
241
242
virtual
void
work(
RunnableInterface::WorkReason
reason);
243
244
virtual
bool
breakLoop();
245
246
virtual
void
finalize();
247
248
virtual
bool
hasWork();
249
};
250
251
}
252
#endif
RTT::ExecutionEngine::msg_cond
os::Condition msg_cond
Definition:
ExecutionEngine.hpp:227
List.hpp
ExecutableInterface.hpp
RTT::base::TaskCore
Definition:
TaskCore.hpp:54
RTT::ExecutionEngine::msg_lock
os::Mutex msg_lock
Definition:
ExecutionEngine.hpp:226
DisposableInterface.hpp
svn2log.process
def process(fin, fout)
Definition:
svn2log.py:220
RTT::base::RunnableInterface
A class for running a certain piece of code in a thread.
Definition:
RunnableInterface.hpp:69
Mutex.hpp
RTT::ExecutionEngine::port_queue
internal::MWSRQueue< base::PortInterface * > * port_queue
Definition:
ExecutionEngine.hpp:219
RTT::os::Condition
An object oriented wrapper around a condition variable.
Definition:
Condition.hpp:60
RTT::ExecutionEngine::f_queue
internal::MWSRQueue< base::ExecutableInterface * > * f_queue
Definition:
ExecutionEngine.hpp:224
RTT::base::RunnableInterface::WorkReason
WorkReason
Definition:
RunnableInterface.hpp:76
RTT::ExecutionEngine
Definition:
ExecutionEngine.hpp:69
RTT::ExecutionEngine::getTaskCore
base::TaskCore * getTaskCore() const
Definition:
ExecutionEngine.hpp:93
RTT::ExecutionEngine::mqueue
internal::MWSRQueue< base::DisposableInterface * > * mqueue
Definition:
ExecutionEngine.hpp:214
RunnableInterface.hpp
RTT::base::DisposableInterface
An object that is executable and is freed after execution.
Definition:
DisposableInterface.hpp:53
RTT::internal::MWSRQueue
Definition:
MWSRQueue.hpp:66
ActivityInterface.hpp
rtt-internal-fwd.hpp
MutexLock.hpp
RTT::ExecutionEngine::taskc
base::TaskCore * taskc
Definition:
ExecutionEngine.hpp:209
RTT::base::ExecutableInterface
Definition:
ExecutableInterface.hpp:60
RTT::os::Mutex
An object oriented wrapper around a non recursive mutex.
Definition:
Mutex.hpp:92
Condition.hpp
RTT
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition:
Activity.cpp:53
RTT::base::PortInterface
Definition:
PortInterface.hpp:59
rtt
Author(s): RTT Developers
autogenerated on Tue Jun 25 2019 19:33:24