|
ADS
Algorithms and Data Structures
|
Files of records on a real disk, for the algorithms whose data do not fit in the internal memory and are read and written by sequential scans only (e.g., the searches with delayed duplicate detection, whose open and closed lists are kept on the disk): where TwoLevelMemory.h simulates the model of Aggarwal and Vitter to count its I/Os, these files are on the file system of the machine, and what they cost is the time of the disk. More...
#include "ADS/Contract.h"#include <cstddef>#include <cstdint>#include <filesystem>#include <string>#include <type_traits>#include <vector>#include "ADS/external/impl/RecordFile.tpp"Go to the source code of this file.
Classes | |
| class | ADS::RecordFile< T > |
| a file of records of a trivially copyable type on the disk More... | |
| class | ADS::RecordWriter< T > |
| appends to a RecordFile through a buffer of records, the file opened only to write the buffer More... | |
| class | ADS::TempDirectory |
| a directory of its own, removed with what it holds at its destruction More... | |
Namespaces | |
| namespace | ADS |
Files of records on a real disk, for the algorithms whose data do not fit in the internal memory and are read and written by sequential scans only (e.g., the searches with delayed duplicate detection, whose open and closed lists are kept on the disk): where TwoLevelMemory.h simulates the model of Aggarwal and Vitter to count its I/Os, these files are on the file system of the machine, and what they cost is the time of the disk.
A scan of \( n \) records through a buffer of \( b \) records makes \( \lceil n / b \rceil \) reads of the system, and the writer as many writes; with buffers of some MB each read and each write moves a large contiguous piece of the file, which is what a disk (or an SSD) does at its best throughput [see Theory of external memory]. An error of the file system (a file that cannot be opened, a disk that is full) throws std::runtime_error with the name of the file.
The contracts [see Contract.h]: a buffer of at least one record; a pointer to the records to append unless there are none; the size of a file grows by the records appended. The functions are defined in RecordFile.tpp.