Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00026 #ifndef __TIMEBASEDTEXT_H__
00027 #define __TIMEBASEDTEXT_H__
00028
00029
00030 #include <time.h>
00031 #include <inttypes.h>
00032 #include <sys/time.h>
00033
00034 #include <linklist.h>
00035
00036 class RTClock;
00037
00038 class TBTEntry;
00039
00040
00059 class TBT {
00060
00061 public:
00062 TBT();
00063 ~TBT();
00064
00080 int init();
00081
00082
00083
00084
00085 void append(uint64_t key);
00086 uint64_t getkey();
00087 int position;
00088
00089
00090
00091
00092 int load(char *filename);
00093 int save_bin(char *filename);
00094
00095
00096 int load_ascii(char *filename);
00097 int save_ascii(char *filename);
00098
00099
00100 int save_html(char *filename);
00101
00102 int save_doku(char *filename);
00103
00104
00105 void clear();
00106
00108
00109 Linklist *buffer;
00110
00111 bool quit;
00112
00113 bool rtc;
00114 RTClock *clock;
00115
00116
00117 private:
00118
00119 void compute_delta(TBTEntry *tbt);
00121
00122 uint64_t now;
00123 uint64_t past;
00124
00125 struct timespec psleep;
00126 struct timeval gettime;
00127
00128 };
00129
00130
00152 class TBTEntry : public Entry {
00153 public:
00154 TBTEntry();
00155 ~TBTEntry();
00156
00166 uint64_t key;
00167 uint64_t msec;
00168
00170
00181 bool parse_uint64(void *buf);
00182 bool parse_ascii(char *buf);
00183
00184 int render_uint64(void *buf);
00185 int render_ascii(void *buf);
00186 int render_html(void *buf);
00187
00189 };
00190
00191
00192 #endif