#include <FileReprBase.hpp>
Inheritance diagram for FileReprBase:
Public Types | |
enum | Mode { READ, WRITE } |
Public Member Functions | |
FileReprBase (const params_t *par) | |
~FileReprBase () | |
void | rewind () |
It rewinds the file to the beginning. | |
void | flush () |
It flushes the low-level buffer. | |
std::streamsize | readFromFile (char *buffer, std::streamsize buffer_size) |
This method reads in a block of characters from the file and places it in a buffer. | |
void | writeToFile (const char *buffer, std::streamsize n) |
This method writes out a block of characters to the file. | |
Protected Attributes | |
char * | file_buffer |
the low-level buffer | |
std::streamsize | file_buffer_size |
the size of the lowest level buffer | |
Mode | mode |
operating mode | |
Classes | |
class | params_t |
The parameter class of the IO constructor. More... |
There are many ways of representing a file in C++. We created an IO framework where the file representation is changeable. This way we could test the efficacy of the different solutions. Our experiment showed that file descriptor-based representation is the fastest.
Definition at line 17 of file FileReprBase.hpp.
|
Definition at line 20 of file FileReprBase.hpp. |
|
Definition at line 45 of file FileReprBase.hpp. References file_buffer, FileReprBase::params_t::file_buffer_size, FileReprBase::params_t::mode, and mode. |
|
Definition at line 52 of file FileReprBase.hpp. References file_buffer. |
|
It flushes the low-level buffer.
Reimplemented in FDRepr, FILERepr, and StreamRepr. Definition at line 63 of file FileReprBase.hpp. |
|
This method reads in a block of characters from the file and places it in a buffer.
Reimplemented in FDRepr, FILERepr, and StreamRepr. Definition at line 74 of file FileReprBase.hpp. |
|
It rewinds the file to the beginning. Obviously this method makes sense when the file is opened for reading. Reimplemented in FDRepr, FILERepr, and StreamRepr. Definition at line 60 of file FileReprBase.hpp. |
|
This method writes out a block of characters to the file.
Reimplemented in FDRepr, FILERepr, and StreamRepr. Definition at line 84 of file FileReprBase.hpp. |
|
the low-level buffer
Definition at line 89 of file FileReprBase.hpp. Referenced by FDRepr::FDRepr(), FILERepr::FILERepr(), FileReprBase(), FDRepr::flush(), StreamRepr::StreamRepr(), FDRepr::writeToFile(), and ~FileReprBase(). |
|
the size of the lowest level buffer
Definition at line 91 of file FileReprBase.hpp. Referenced by FDRepr::FDRepr(), and FDRepr::flush(). |
|
operating mode
Definition at line 93 of file FileReprBase.hpp. Referenced by SimpleOutputTester::doTest(), FileReprBase(), and FDRepr::~FDRepr(). |