Panda3D
|
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 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. | |
size_t | get_used_file_size () const |
Returns the amount of space within the save file that is currently in use. | |
bool | is_valid () const |
Returns true if the save file was successfully created and is ready for use, false if there was an error. | |
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. | |
Public Attributes | |
size_t bool | compressed |
size_t | size |
Protected Member Functions | |
virtual SimpleAllocatorBlock * | make_block (size_t start, size_t size) |
Creates a new SimpleAllocatorBlock object. |
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 37 of file vertexDataSaveFile.h.
size_t VertexDataSaveFile::get_total_file_size | ( | ) | const [inline] |
Returns the amount of space consumed by the save file, including unused portions.
Definition at line 35 of file vertexDataSaveFile.I.
Referenced by GraphicsEngine::render_frame().
size_t VertexDataSaveFile::get_used_file_size | ( | ) | const [inline] |
Returns the amount of space within the save file that is currently in use.
Definition at line 46 of file vertexDataSaveFile.I.
References SimpleAllocator::get_total_size().
Referenced by GraphicsEngine::render_frame().
bool VertexDataSaveFile::is_valid | ( | ) | const [inline] |
Returns true if the save file was successfully created and is ready for use, false if there was an error.
Definition at line 24 of file vertexDataSaveFile.I.
SimpleAllocatorBlock * VertexDataSaveFile::make_block | ( | size_t | start, |
size_t | size | ||
) | [protected, virtual] |
Creates a new SimpleAllocatorBlock object.
Override this function to specialize the block type returned.
Reimplemented from SimpleAllocator.
Definition at line 356 of file vertexDataSaveFile.cxx.
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 274 of file vertexDataSaveFile.cxx.
References Thread::consider_yield(), Thread::force_yield(), Thread::get_current_thread(), ClockObject::get_global_clock(), ClockObject::get_real_time(), SimpleAllocatorBlock::get_size(), and SimpleAllocatorBlock::get_start().