Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * blocked_timing.h - Blocked timing aspect for Fawkes 00004 * 00005 * Created: Thu Jan 11 16:49:25 2007 00006 * Copyright 2006-2010 Tim Niemueller [www.niemueller.de] 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. A runtime exception applies to 00014 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Library General Public License for more details. 00020 * 00021 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00022 */ 00023 00024 #ifndef __ASPECT_BLOCKED_TIMING_H_ 00025 #define __ASPECT_BLOCKED_TIMING_H_ 00026 00027 #include <aspect/aspect.h> 00028 00029 namespace fawkes { 00030 #if 0 /* just to make Emacs auto-indent happy */ 00031 } 00032 #endif 00033 00034 class BlockedTimingAspect : public virtual Aspect 00035 { 00036 public: 00037 /** Type to define at which hook the thread is woken up. 00038 * See FawkesMainThread for information when and in which order the hooks 00039 * are called. 00040 * @see FawkesMainThread::loop() 00041 */ 00042 typedef enum { 00043 WAKEUP_HOOK_PRE_LOOP, /**< before each loop */ 00044 WAKEUP_HOOK_SENSOR_ACQUIRE, /**< sensor acquisition thread, 00045 * acquire data from sensor */ 00046 WAKEUP_HOOK_SENSOR_PREPARE, /**< sensor data preparation thread, 00047 * convert acquired data to usable format */ 00048 WAKEUP_HOOK_SENSOR_PROCESS, /**< sensor data processing thread */ 00049 WAKEUP_HOOK_WORLDSTATE, /**< world state thread */ 00050 WAKEUP_HOOK_THINK, /**< think thread (agent) */ 00051 WAKEUP_HOOK_SKILL, /**< skill thread (skill module) */ 00052 WAKEUP_HOOK_ACT, /**< act thread (motor module etc.) */ 00053 WAKEUP_HOOK_ACT_EXEC, /**< act execution thread */ 00054 WAKEUP_HOOK_POST_LOOP /**< run after loop */ 00055 } WakeupHook; 00056 00057 BlockedTimingAspect(WakeupHook wakeup_hook); 00058 virtual ~BlockedTimingAspect(); 00059 00060 static const char * blocked_timing_hook_to_string(WakeupHook hook); 00061 00062 WakeupHook blockedTimingAspectHook() const; 00063 00064 private: 00065 WakeupHook __wakeup_hook; 00066 }; 00067 00068 } // end namespace fawkes 00069 00070 #endif