Fawkes API  Fawkes Development Version
engine_thread.h
1 
2 /***************************************************************************
3  * engine_thread.h - Thread driving the XABSL Engine
4  *
5  * Created: Thu Aug 07 14:49:11 2008
6  * Copyright 2006-2008 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_XABSL_ENGINE_THREAD_H_
24 #define __PLUGINS_XABSL_ENGINE_THREAD_H_
25 
26 #include "iface_field_wrapper.h"
27 
28 #include <core/threading/thread.h>
29 #include <aspect/blocked_timing.h>
30 #include <aspect/logging.h>
31 #include <aspect/configurable.h>
32 #include <aspect/clock.h>
33 #include <aspect/blackboard.h>
34 
35 #include <map>
36 #include <string>
37 
38 namespace xabsl {
39  class Engine;
40 }
41 
42 namespace fawkes {
43  class Time;
44  class ObjectPositionInterface;
45  class SkillerInterface;
46 }
47 
50 class XabslSkillWrapper;
51 
53 : public fawkes::Thread,
55  public fawkes::LoggingAspect,
57  public fawkes::ClockAspect,
59 {
60  public:
62 
63  virtual void init();
64  virtual void finalize();
65  virtual void once();
66  virtual void loop();
67 
68  unsigned long int current_time();
69 
70  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
71  protected: virtual void run() { Thread::run(); }
72 
73  private:
74  xabsl::Engine *__xe;
76 
77  fawkes::Time *__now;
78 
79  fawkes::SkillerInterface *__skiller_if;
80  fawkes::ObjectPositionInterface *__wm_ball_if;
81  fawkes::ObjectPositionInterface *__wm_ball_w_if;
82 
85 
86  std::map<std::string, XabslSkillWrapper *> __wrappers;
87  std::map<std::string, XabslSkillWrapper *>::iterator __wit;
88 };
89 
90 
91 #endif
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Thread aspect that allows to obtain the current time from the clock.
Definition: clock.h:36
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition: engine_thread.h:71
ObjectPositionInterface Fawkes BlackBoard Interface.
Fawkes library namespace.
A class for handling time.
Definition: time.h:91
Thread class encapsulation of pthreads.
Definition: thread.h:42
File input class for Xabsl integration.
Definition: xabsl_tools.h:47
Thread aspect to use blocked timing.
Xabsl Engine Thread.
Definition: engine_thread.h:52
Thread aspect to log output.
Definition: logging.h:35
Thread aspect to access configuration data.
Definition: configurable.h:35
SkillerInterface Fawkes BlackBoard Interface.
Logging error handler for XABSL integration.
Definition: xabsl_tools.h:34
Xabsl Skill Wrapper.
Definition: skill_wrapper.h:33