Fawkes API  Fawkes Development Version
blocked_timing.h
1 
2 /***************************************************************************
3  * blocked_timing.h - Blocked timing aspect for Fawkes
4  *
5  * Created: Thu Jan 11 16:49:25 2007
6  * Copyright 2006-2010 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. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __ASPECT_BLOCKED_TIMING_H_
25 #define __ASPECT_BLOCKED_TIMING_H_
26 
27 #include <aspect/aspect.h>
28 
29 namespace fawkes {
30 #if 0 /* just to make Emacs auto-indent happy */
31 }
32 #endif
33 
34 class BlockedTimingAspect : public virtual Aspect
35 {
36  public:
37  /** Type to define at which hook the thread is woken up.
38  * See FawkesMainThread for information when and in which order the hooks
39  * are called.
40  * @see FawkesMainThread::loop()
41  */
42  typedef enum {
43  WAKEUP_HOOK_PRE_LOOP, /**< before each loop */
44  WAKEUP_HOOK_SENSOR_ACQUIRE, /**< sensor acquisition thread,
45  * acquire data from sensor */
46  WAKEUP_HOOK_SENSOR_PREPARE, /**< sensor data preparation thread,
47  * convert acquired data to usable format */
48  WAKEUP_HOOK_SENSOR_PROCESS, /**< sensor data processing thread */
49  WAKEUP_HOOK_WORLDSTATE, /**< world state thread */
50  WAKEUP_HOOK_THINK, /**< think thread (agent) */
51  WAKEUP_HOOK_SKILL, /**< skill thread (skill module) */
52  WAKEUP_HOOK_ACT, /**< act thread (motor module etc.) */
53  WAKEUP_HOOK_ACT_EXEC, /**< act execution thread */
54  WAKEUP_HOOK_POST_LOOP /**< run after loop */
55  } WakeupHook;
56 
57  BlockedTimingAspect(WakeupHook wakeup_hook);
58  virtual ~BlockedTimingAspect();
59 
60  static const char * blocked_timing_hook_to_string(WakeupHook hook);
61 
62  WakeupHook blockedTimingAspectHook() const;
63 
64  private:
65  WakeupHook __wakeup_hook;
66 };
67 
68 } // end namespace fawkes
69 
70 #endif
act thread (motor module etc.)
Fawkes aspect base class.
Definition: aspect.h:34
sensor data preparation thread, convert acquired data to usable format
Fawkes library namespace.
Thread aspect to use blocked timing.
WakeupHook
Type to define at which hook the thread is woken up.
static const char * blocked_timing_hook_to_string(WakeupHook hook)
Get string for wakeup hook.
virtual ~BlockedTimingAspect()
Virtual empty destructor.
BlockedTimingAspect(WakeupHook wakeup_hook)
Constructor.
WakeupHook blockedTimingAspectHook() const
Get the wakeup hook.
sensor acquisition thread, acquire data from sensor