Template Class DiskFile
Defined in File TwoLevelMemory.h
Class Documentation
-
template<class T>
class DiskFile a file of items on the disk of the model, in blocks of B items
Public Functions
-
explicit 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 &operator=(DiskFile &&other)
a rename on the disk, no I/O
- Pre:
the two files share the memory
-
TwoLevelMemory &memory(void) const
-
std::size_t size(void) const
-
bool empty(void) const
-
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
- Pre:
b < blocks()
-
void appendBlock(const T *src, std::size_t n)
one write: the n items of src appended as a new block
- Pre:
1 <= n <= B and size() a multiple of B
-
void clear(void)
empties the file, no I/O
-
explicit DiskFile(TwoLevelMemory &mem)