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"
49 #include "internal/List.hpp"
50 #include <vector>
51 #include <boost/function.hpp>
52 
53 #include "rtt-config.h"
55 
56 namespace RTT
57 {
58 
69  class RTT_API ExecutionEngine
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 
210 
215 
220 
225 
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
def process(fin, fout)
Definition: svn2log.py:220
A class for running a certain piece of code in a thread.
internal::MWSRQueue< base::PortInterface * > * port_queue
An object oriented wrapper around a condition variable.
Definition: Condition.hpp:60
internal::MWSRQueue< base::ExecutableInterface * > * f_queue
base::TaskCore * getTaskCore() const
internal::MWSRQueue< base::DisposableInterface * > * mqueue
An object that is executable and is freed after execution.
base::TaskCore * taskc
An object oriented wrapper around a non recursive mutex.
Definition: Mutex.hpp:92
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:53


rtt
Author(s): RTT Developers
autogenerated on Tue Jun 25 2019 19:33:24