a file of items on the disk of the model, in blocks of \( B \) items
More...
#include <ADS/external/TwoLevelMemory.h>
|
| | DiskFile (TwoLevelMemory &mem) |
| | an empty file
|
| | DiskFile (TwoLevelMemory &mem, std::vector< T > items) |
| | the file of the items, laid out with no I/O: the input of a problem
|
| | DiskFile (DiskFile &&) noexcept=default |
| | the file moved, no I/O
|
| DiskFile & | operator= (DiskFile &&other) |
| | a rename on the disk, no I/O
|
| | DiskFile (const DiskFile &)=delete |
| | no copy, which would duplicate the file without paying its I/Os
|
| DiskFile & | operator= (const DiskFile &)=delete |
| | no copy, which would duplicate the file without paying its I/Os
|
| TwoLevelMemory & | memory (void) const |
| | the memory of the model that the file is on
|
| std::size_t | size (void) const |
| | the number of items of the file
|
| bool | empty (void) const |
| | whether the file has no item
|
| std::size_t | blocks (void) const |
| | the blocks of the file, \( \lceil \mathrm{size}() / B \rceil \)
|
| std::size_t | readBlock (std::size_t b, T *dest) const |
| | one read: the block \( b \) copied to dest, which has room for \( B \) items; the number of its items
|
| void | appendBlock (const T *src, std::size_t n) |
| | one write: the \( n \) items of src appended as a new block
|
| void | clear (void) |
| | empties the file, no I/O
|
| const std::vector< T > & | contents (void) const |
| | the items, no I/O: for the checks, not for the algorithms
|
template<class T>
class ADS::DiskFile< T >
a file of items on the disk of the model, in blocks of \( B \) items
◆ size_type
◆ value_type
◆ DiskFile() [1/4]
◆ DiskFile() [2/4]
the file of the items, laid out with no I/O: the input of a problem
◆ DiskFile() [3/4]
◆ DiskFile() [4/4]
no copy, which would duplicate the file without paying its I/Os
◆ appendBlock()
template<class T>
| void ADS::DiskFile< T >::appendBlock |
( |
const T * | src, |
|
|
std::size_t | n ) |
one write: the \( n \) items of src appended as a new block
- Precondition
- \( 1 \le n \le B \), and size() a multiple of \( B \)
◆ blocks()
the blocks of the file, \( \lceil \mathrm{size}() / B \rceil \)
◆ clear()
◆ contents()
template<class T>
| const std::vector< T > & ADS::DiskFile< T >::contents |
( |
void | | ) |
const |
|
nodiscard |
the items, no I/O: for the checks, not for the algorithms
◆ empty()
whether the file has no item
◆ memory()
the memory of the model that the file is on
◆ operator=() [1/2]
no copy, which would duplicate the file without paying its I/Os
◆ operator=() [2/2]
a rename on the disk, no I/O
- Precondition
- the two files share the memory
◆ readBlock()
template<class T>
| std::size_t ADS::DiskFile< T >::readBlock |
( |
std::size_t | b, |
|
|
T * | dest ) const |
one read: the block \( b \) copied to dest, which has room for \( B \) items; the number of its items
- Precondition
- \( b \) is below blocks()
◆ size()
the number of items of the file
The documentation for this class was generated from the following file: