#include <Reference_Reader.hh>
Inheritance diagram for Reference_Reader:
Public Methods | |
Reference_Reader () | |
The default constructor. | |
Reference_Reader (const char *const reference_trace_pathname) | |
The common constructor. | |
virtual | ~Reference_Reader () |
The deconstructor. | |
virtual void | read (reference_record_s *const reference_record)=0 |
Read the next record from the reference trace. | |
Protected Attributes | |
FILE * | reference_stream |
The reference trace input stream. | |
char | buffer [BUFFER_SIZE] |
A buffer used for input and parsing. |
This abstract class is a simple one. It will open and close the file, and provide the ability to rewind that file. It does not define how the file is read, but rather provides the method that a subclass must define in order to read a specific reference trace format.
Definition at line 49 of file Reference_Reader.hh.
|
The default constructor. Intended for subclasses that do not open a single file, and therefore choose not to use the provided file stream data member. Definition at line 60 of file Reference_Reader.hh.
00060 {} |
|
The common constructor.
Definition at line 33 of file Reference_Reader.cc.
00033 { 00034 00035 // Attempt to open the trace file. 00036 reference_stream = fopen(reference_trace_pathname, "r"); 00037 00038 // Did the reference trace open correctly? 00039 if (reference_stream == NULL) { 00040 00041 // No. Emit the error and exit. 00042 perror("Failed opening reference trace"); 00043 exit(1); 00044 00045 } 00046 } // Reference_Reader |
|
The deconstructor. Deconstruct a Reference_Reader. Close the reference trace file. Definition at line 52 of file Reference_Reader.cc. References reference_stream.
00052 { 00053 00054 // Was the reference stream opened? (A subclass is not required to 00055 // use this data member.) 00056 if (reference_stream != NULL) { 00057 00058 // Yes. Attempt to close it, ensuring success. 00059 int reference_result = fclose(reference_stream); 00060 if (reference_result == EOF) { 00061 perror("Failed closing reference trace"); 00062 exit(1); 00063 } 00064 00065 } 00066 } // ~Consumer |
|
Read the next record from the reference trace.
Implemented in Binary_Raw_Reader, Instruction_Reduced_Reader, Page_Reduced_Reader, and Text_Raw_Reader. Referenced by Consumer::merge(), and Consumer::synchronize(). |
|
A buffer used for input and parsing.
Definition at line 102 of file Reference_Reader.hh. Referenced by Text_Raw_Reader::read(). |
|
The reference trace input stream.
Definition at line 99 of file Reference_Reader.hh. Referenced by ~Reference_Reader(). |