Fawkes API
Fawkes Development Version
|
BlackBoard log replay blocked timing thread. More...
#include "logreplay_bt_thread.h"
Public Member Functions | |
BBLogReplayBlockedTimingThread (fawkes::BlockedTimingAspect::WakeupHook hook, const char *logfile_name, const char *logdir, const char *scenario, float grace_period, bool loop_replay, bool non_blocking) | |
Constructor. | |
![]() | |
BBLogReplayThread (const char *logfile_name, const char *logdir, const char *scenario, float grace_period, bool loop_replay, bool non_blocking=false, const char *thread_name="BBLogReplayThread", fawkes::Thread::OpMode th_opmode=Thread::OPMODE_CONTINUOUS) | |
Constructor. | |
virtual | ~BBLogReplayThread () |
Destructor. | |
virtual void | init () |
Initialize the thread. | |
virtual void | finalize () |
Finalize the thread. | |
virtual void | loop () |
Code to execute in the thread. | |
virtual void | once () |
Execute an action exactly once. | |
![]() | |
virtual | ~Thread () |
Virtual destructor. | |
bool | prepare_finalize () |
Prepare finalization. | |
virtual bool | prepare_finalize_user () |
Prepare finalization user implementation. | |
void | cancel_finalize () |
Cancel finalization. | |
void | start (bool wait=true) |
Call this method to start the thread. | |
void | cancel () |
Cancel a thread. | |
void | join () |
Join the thread. | |
void | detach () |
Detach the thread. | |
void | kill (int sig) |
Send signal to a thread. | |
bool | operator== (const Thread &thread) |
Check if two threads are the same. | |
void | wakeup () |
Wake up thread. | |
void | wakeup (Barrier *barrier) |
Wake up thread and wait for barrier afterwards. | |
void | wait_loop_done () |
Wait for the current loop iteration to finish. | |
OpMode | opmode () const |
Get operation mode. | |
pthread_t | thread_id () const |
Get ID of thread. | |
bool | started () const |
Check if thread has been started. | |
bool | cancelled () const |
Check if thread has been cancelled. | |
bool | detached () const |
Check if thread has been detached. | |
bool | running () const |
Check if the thread is running. | |
bool | waiting () const |
Check if thread is currently waiting for wakeup. | |
const char * | name () const |
Get name of thread. | |
void | set_flags (uint32_t flags) |
Set all flags in one go. | |
void | set_flag (uint32_t flag) |
Set flag for the thread. | |
void | unset_flag (uint32_t flag) |
Unset flag. | |
bool | flagged_bad () const |
Check if FLAG_BAD was set. | |
void | set_delete_on_exit (bool del) |
Set whether the thread should be deleted on exit. | |
void | set_prepfin_hold (bool hold) |
Hold prepare_finalize(). | |
void | add_notification_listener (ThreadNotificationListener *notification_listener) |
Add notification listener. | |
void | remove_notification_listener (ThreadNotificationListener *notification_listener) |
Remove notification listener. | |
![]() | |
LoggingAspect () | |
Constructor. | |
virtual | ~LoggingAspect () |
Virtual empty Destructor. | |
void | init_LoggingAspect (Logger *logger) |
Set the logger. | |
![]() | |
const std::list< const char * > & | get_aspects () const |
Get list of aspect names attached to a aspected thread. | |
![]() | |
ConfigurableAspect () | |
Constructor. | |
virtual | ~ConfigurableAspect () |
Virtual empty Destructor. | |
void | init_ConfigurableAspect (Configuration *config) |
Set the configuration It is guaranteed that this is called for a configurable thread before Thread::start() is called (when running regularly inside Fawkes). | |
![]() | |
ClockAspect () | |
Constructor. | |
virtual | ~ClockAspect () |
Virtual empty destructor. | |
void | init_ClockAspect (Clock *clock) |
Set the clock. | |
![]() | |
BlackBoardAspect () | |
Constructor. | |
virtual | ~BlackBoardAspect () |
Virtual empty destructor. | |
void | init_BlackBoardAspect (BlackBoard *bb) |
Init BlackBoard aspect. | |
![]() | |
BlockedTimingAspect (WakeupHook wakeup_hook) | |
Constructor. | |
virtual | ~BlockedTimingAspect () |
Virtual empty destructor. | |
WakeupHook | blockedTimingAspectHook () const |
Get the wakeup hook. |
Protected Member Functions | |
virtual void | run () |
Stub to see name in backtrace for easier debugging. |
Additional Inherited Members | |
![]() | |
enum | WakeupHook { WAKEUP_HOOK_PRE_LOOP, WAKEUP_HOOK_SENSOR_ACQUIRE, WAKEUP_HOOK_SENSOR_PREPARE, WAKEUP_HOOK_SENSOR_PROCESS, WAKEUP_HOOK_WORLDSTATE, WAKEUP_HOOK_THINK, WAKEUP_HOOK_SKILL, WAKEUP_HOOK_ACT, WAKEUP_HOOK_ACT_EXEC, WAKEUP_HOOK_POST_LOOP } |
Type to define at which hook the thread is woken up. More... | |
![]() | |
static const char * | blocked_timing_hook_to_string (WakeupHook hook) |
Get string for wakeup hook. |
BlackBoard log replay blocked timing thread.
This thread basically does the same task as the BBLogReplayThread, with the difference that this thread operates in blocked timing mode and integrates into the Fawkes main loop. It will replay one data set per loop and will block the loop until the data is ready. This is most useful to replay sensor logs of sensors, which are integrated into the main loop and thus influence timing also on the real data system.
Definition at line 31 of file logreplay_bt_thread.h.
BBLogReplayBlockedTimingThread::BBLogReplayBlockedTimingThread | ( | fawkes::BlockedTimingAspect::WakeupHook | hook, |
const char * | logfile_name, | ||
const char * | logdir, | ||
const char * | scenario, | ||
float | grace_period, | ||
bool | loop_replay, | ||
bool | non_blocking | ||
) |
Constructor.
hook | main loop hook to register for |
logfile_name | filename of the log to be replayed |
logdir | directory containing the logfile |
scenario | ID of the log scenario |
grace_period | time in seconds that desired offset and loop offset may diverge to still write the new data |
loop_replay | specifies if the replay should be looped |
non_blocking | do not block the main loop if not enough time has elapsed to replay new data but just wait for the next cycle. This is ignored in continuous thread mode as it could cause busy waiting. |
Definition at line 52 of file logreplay_bt_thread.cpp.
References fawkes::Thread::set_name(), and fawkes::Thread::set_prepfin_conc_loop().
|
inlineprotectedvirtual |
Stub to see name in backtrace for easier debugging.
Reimplemented from BBLogReplayThread.
Definition at line 45 of file logreplay_bt_thread.h.