rllib
1
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
lib
rlhistorylogger.h
Go to the documentation of this file.
1
/***************************************************************************
2
rlhistorylogger.h - description
3
-------------------
4
begin : Wed Dec 06 2006
5
copyright : (C) 2006 by R. Lehrig
6
email : lehrig@t-online.de
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This library is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as *
13
* published by the Free Software Foundation *
14
* *
15
***************************************************************************/
16
#ifndef _RL_HISTORY_LOGGER_H_
17
#define _RL_HISTORY_LOGGER_H_
18
19
#include "
rldefine.h
"
20
#include "
rltime.h
"
21
#include "
rlthread.h
"
22
#include <stdio.h>
23
24
typedef
struct
_rlHistoryLogLine_
25
{
26
_rlHistoryLogLine_
*
next
;
27
char
*
line
;
28
}
rlHistoryLogLine
;
29
35
class
rlHistoryLogger
36
{
37
public
:
38
rlHistoryLogger
(
const
char
*csvName,
int
maxHoursPerFile,
int
maxLinesInMemory=100);
39
virtual
~rlHistoryLogger
();
40
int
pushLine
(
const
char
*text);
41
const
char
*
firstLine
();
42
const
char
*
nextLine
();
43
rlMutex
mutex
;
44
int
debug
;
45
private
:
46
int
pushLineToMemory
(
const
char
*line);
47
int
pushLineToFile
(
const
char
*line);
48
int
openFile
();
49
rlHistoryLogLine
*
first_line
,*
current_line
;
50
rlTime
time
,
file_start_time
,
time_diff
;
51
FILE *
fout
;
52
int
max_hours_per_file
,
max_lines_in_memory
,
current_file
;
53
char
*
csv_name
, *
csv_file_name
;
54
};
55
#endif
Generated by
1.8.2