Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
logreplay_thread.h
1
2
/***************************************************************************
3
* logreplay_thread.h - BB Log Replay Thread
4
*
5
* Created: Wed Feb 17 01:53:00 2010
6
* Copyright 2010 Tim Niemueller [www.niemueller.de]
7
* 2010 Masrur Doostdar <doostdar@kbsg.rwth-aachen.de>
8
*
9
****************************************************************************/
10
11
/* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; either version 2 of the License, or
14
* (at your option) any later version.
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 file in the doc directory.
22
*/
23
24
#ifndef __PLUGINS_BBLOGGER_LOGREPLAY_THREAD_H_
25
#define __PLUGINS_BBLOGGER_LOGREPLAY_THREAD_H_
26
27
#include "bblogfile.h"
28
29
#include <core/threading/thread.h>
30
#include <aspect/logging.h>
31
#include <aspect/configurable.h>
32
#include <aspect/blackboard.h>
33
#include <aspect/clock.h>
34
#include <core/utils/lock_queue.h>
35
36
#include <cstdio>
37
38
namespace
fawkes {
39
class
BlackBoard;
40
class
Logger;
41
class
Time;
42
}
43
44
class
BBLogReplayThread
45
:
public
fawkes::Thread
,
46
public
fawkes::LoggingAspect
,
47
public
fawkes::ConfigurableAspect
,
48
public
fawkes::ClockAspect
,
49
public
fawkes::BlackBoardAspect
50
{
51
public
:
52
BBLogReplayThread
(
const
char
*logfile_name,
53
const
char
*logdir,
54
const
char
*scenario,
55
float
grace_period,
56
bool
loop_replay,
57
bool
non_blocking =
false
,
58
const
char
*thread_name =
"BBLogReplayThread"
,
59
fawkes::Thread::OpMode
th_opmode = Thread::OPMODE_CONTINUOUS);
60
virtual
~BBLogReplayThread
();
61
62
virtual
void
init
();
63
virtual
void
finalize
();
64
virtual
void
loop
();
65
virtual
void
once
();
66
67
/** Stub to see name in backtrace for easier debugging. @see Thread::run() */
68
protected
:
virtual
void
run
() {
Thread::run
(); }
69
70
private
:
71
char
*__scenario;
72
char
*__filename;
73
char
*__logdir;
74
char
*__logfile_name;
75
float
__cfg_grace_period;
76
bool
__cfg_non_blocking;
77
bool
__cfg_loop_replay;
78
79
BBLogFile
*__logfile;
80
81
fawkes::Time
__last_offset;
82
fawkes::Time
__offsetdiff;
83
fawkes::Time
__loopdiff;
84
fawkes::Time
__waittime;
85
fawkes::Time
__last_loop;
86
fawkes::Time
__now;
87
fawkes::Interface
*__interface;
88
};
89
90
91
#endif
src
plugins
bblogger
logreplay_thread.h
Generated by
1.8.1.1