A temporary file to hold the vertex data that has been evicted from memory and written to disk. More...
#include "vertexDataSaveFile.h"
Public Member Functions | |
VertexDataSaveFile (const Filename &directory, const std::string &prefix, size_t max_size) | |
size_t | get_total_file_size () const |
Returns the amount of space consumed by the save file, including unused portions. More... | |
size_t | get_used_file_size () const |
Returns the amount of space within the save file that is currently in use. More... | |
bool | is_valid () const |
Returns true if the save file was successfully created and is ready for use, false if there was an error. More... | |
PT (VertexDataSaveBlock) write_data(const unsigned char *data | |
bool | read_data (unsigned char *data, size_t size, VertexDataSaveBlock *block) |
Reads a block of data from the file, and returns true on success, false on failure. More... | |
Public Member Functions inherited from SimpleAllocator | |
SimpleAllocator (size_t max_size, Mutex &lock) | |
SimpleAllocator (SimpleAllocator &&from) noexcept | |
Move constructor. More... | |
SimpleAllocatorBlock * | alloc (size_t size, size_t alignment=1) |
Allocates a new block. More... | |
size_t | get_contiguous () const |
Returns an upper-bound estimate of the size of the largest contiguous block that may be allocated. More... | |
SimpleAllocatorBlock * | get_first_block () const |
Returns a pointer to the first allocated block, or NULL if there are no allocated blocks. More... | |
size_t | get_max_size () const |
Returns the available space for allocated objects. More... | |
size_t | get_total_size () const |
Returns the total size of allocated objects. More... | |
bool | is_empty () const |
Returns true if there are no blocks allocated on this page, or false if there is at least one. More... | |
void | output (std::ostream &out) const |
void | set_max_size (size_t max_size) |
Changes the available space for allocated objects. More... | |
void | write (std::ostream &out) const |
Public Attributes | |
size_t bool | compressed |
size_t | size |
A temporary file to hold the vertex data that has been evicted from memory and written to disk.
All vertex data arrays are written into one large flat file.
Definition at line 36 of file vertexDataSaveFile.h.
|
inline |
Returns the amount of space consumed by the save file, including unused portions.
Definition at line 28 of file vertexDataSaveFile.I.
|
inline |
Returns the amount of space within the save file that is currently in use.
Definition at line 36 of file vertexDataSaveFile.I.
References SimpleAllocator::get_total_size().
|
inline |
Returns true if the save file was successfully created and is ready for use, false if there was an error.
Definition at line 19 of file vertexDataSaveFile.I.
bool VertexDataSaveFile::read_data | ( | unsigned char * | data, |
size_t | size, | ||
VertexDataSaveBlock * | block | ||
) |
Reads a block of data from the file, and returns true on success, false on failure.
Definition at line 276 of file vertexDataSaveFile.cxx.