Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
BBLogReplayBlockedTimingThread Class Reference

BlackBoard log replay blocked timing thread. More...

#include "logreplay_bt_thread.h"

Inheritance diagram for BBLogReplayBlockedTimingThread:

List of all members.

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.
- Public Member Functions inherited from BBLogReplayThread
 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.
- Public Member Functions inherited from fawkes::Thread
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.
- Public Member Functions inherited from fawkes::LoggingAspect
 LoggingAspect ()
 Constructor.
virtual ~LoggingAspect ()
 Virtual empty Destructor.
void init_LoggingAspect (Logger *logger)
 Set the logger.
- Public Member Functions inherited from fawkes::Aspect
const std::list< const char * > & get_aspects () const
 Get list of aspect names attached to a aspected thread.
- Public Member Functions inherited from fawkes::ConfigurableAspect
 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).
- Public Member Functions inherited from fawkes::ClockAspect
 ClockAspect ()
 Constructor.
virtual ~ClockAspect ()
 Virtual empty destructor.
void init_ClockAspect (Clock *clock)
 Set the clock.
- Public Member Functions inherited from fawkes::BlackBoardAspect
 BlackBoardAspect ()
 Constructor.
virtual ~BlackBoardAspect ()
 Virtual empty destructor.
void init_BlackBoardAspect (BlackBoard *bb)
 Init BlackBoard aspect.
- Public Member Functions inherited from fawkes::BlockedTimingAspect
 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

- Public Types inherited from fawkes::BlockedTimingAspect
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 Public Member Functions inherited from fawkes::BlockedTimingAspect
static const char * blocked_timing_hook_to_string (WakeupHook hook)
 Get string for wakeup hook.

Detailed Description

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.

Author:
Masrur Doostdar
Tim Niemueller

Definition at line 31 of file logreplay_bt_thread.h.


Constructor & Destructor Documentation

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.

Parameters:
hookmain loop hook to register for
logfile_namefilename of the log to be replayed
logdirdirectory containing the logfile
scenarioID of the log scenario
grace_periodtime in seconds that desired offset and loop offset may diverge to still write the new data
loop_replayspecifies if the replay should be looped
non_blockingdo 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().


Member Function Documentation

virtual void BBLogReplayBlockedTimingThread::run ( )
inlineprotectedvirtual

Stub to see name in backtrace for easier debugging.

See also:
Thread::run()

Reimplemented from BBLogReplayThread.

Definition at line 45 of file logreplay_bt_thread.h.


The documentation for this class was generated from the following files: