-
Notifications
You must be signed in to change notification settings - Fork 1
/
TraceRecord.hh
41 lines (29 loc) · 870 Bytes
/
TraceRecord.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// A simple class that reads from a FILE stream into a set of fields
// that can be accessed publicly. The intent is to hide the details
// of reading the trace format, which is why all of the data members
// that store trace information are made public.
#if !defined (_TRACERECORD_HH)
#define _TRACERECORD_HH
#include <stdio.h>
#include "zlib.h"
class TraceRecord {
public:
TraceRecord(unsigned int initTracePageSize);
~TraceRecord();
void read(gzFile inputFile, char tag);
bool compulsory;
char fetchedPageNumber[5];
void* fetchedImage;
void* fixedFetchedImage;
bool evicted;
bool dirty;
char evictedPageNumber[5];
void* evictedImage;
void* fixedEvictedImage;
private:
void readPageImage(gzFile inputFile,
void* returnImage,
void* fixedReturnImage);
const unsigned int tracePageSize;
};
#endif // _TRACERECORD_HH