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 <aspect/blackboard.h>
29#include <aspect/blocked_timing.h>
30#include <aspect/clock.h>
31#include <aspect/configurable.h>
32#include <aspect/logging.h>
33#include <core/threading/thread.h>
34
35#include <map>
36#include <string>
37
38namespace xabsl {
39class Engine;
40}
41
42namespace fawkes {
43class Time;
44class ObjectPositionInterface;
45class SkillerInterface;
46} // namespace fawkes
47
51
58{
59public:
61
62 virtual void init();
63 virtual void finalize();
64 virtual void once();
65 virtual void loop();
66
67 unsigned long int current_time();
68
69 /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
70protected:
71 virtual void
73 {
74 Thread::run();
75 }
76
77private:
78 xabsl::Engine * xe_;
80
81 fawkes::Time *now_;
82
83 fawkes::SkillerInterface * skiller_if_;
86
89
90 std::map<std::string, XabslSkillWrapper *> wrappers_;
91 std::map<std::string, XabslSkillWrapper *>::iterator wit_;
92};
93
94#endif
Xabsl Engine Thread.
Definition: engine_thread.h:58
virtual void once()
Execute an action exactly once.
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition: engine_thread.h:72
virtual void init()
Initialize the thread.
virtual void loop()
Code to execute in the thread.
virtual void finalize()
Finalize the thread.
XabslEngineThread()
Constructor.
unsigned long int current_time()
Get current time.
File input class for Xabsl integration.
Definition: xabsl_tools.h:47
Logging error handler for XABSL integration.
Definition: xabsl_tools.h:35
Xabsl Skill Wrapper.
Definition: skill_wrapper.h:34
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Thread aspect to use blocked timing.
Thread aspect that allows to obtain the current time from the clock.
Definition: clock.h:34
Thread aspect to access configuration data.
Definition: configurable.h:33
Thread aspect to log output.
Definition: logging.h:33
ObjectPositionInterface Fawkes BlackBoard Interface.
SkillerInterface Fawkes BlackBoard Interface.
Thread class encapsulation of pthreads.
Definition: thread.h:46
A class for handling time.
Definition: time.h:93
Fawkes library namespace.