Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
VertexDataSaveFile Class Reference

A temporary file to hold the vertex data that has been evicted from memory and written to disk. More...

#include "vertexDataSaveFile.h"

Inheritance diagram for VertexDataSaveFile:
SimpleAllocator LinkedListNode

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.
 
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 Member Functions inherited from SimpleAllocator
 SimpleAllocator (SimpleAllocator &&from) noexcept
 Move constructor.
 
 SimpleAllocator (size_t max_size, Mutex &lock)
 
SimpleAllocatorBlockalloc (size_t size, size_t alignment=1)
 Allocates a new block.
 
size_t get_contiguous () const
 Returns an upper-bound estimate of the size of the largest contiguous block that may be allocated.
 
SimpleAllocatorBlockget_first_block () const
 Returns a pointer to the first allocated block, or NULL if there are no allocated blocks.
 
size_t get_max_size () const
 Returns the available space for allocated objects.
 
size_t get_total_size () const
 Returns the total size of allocated objects.
 
bool is_empty () const
 Returns true if there are no blocks allocated on this page, or false if there is at least one.
 
void output (std::ostream &out) const
 
void set_max_size (size_t max_size)
 Changes the available space for allocated objects.
 
void write (std::ostream &out) const
 

Public Attributes

size_t bool compressed
 
size_t size
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ VertexDataSaveFile()

VertexDataSaveFile::VertexDataSaveFile ( const Filename & directory,
const std::string & prefix,
size_t max_size )

Definition at line 37 of file vertexDataSaveFile.cxx.

◆ ~VertexDataSaveFile()

VertexDataSaveFile::~VertexDataSaveFile ( )

Definition at line 170 of file vertexDataSaveFile.cxx.

Member Function Documentation

◆ get_total_file_size()

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 27 of file vertexDataSaveFile.I.

Referenced by GraphicsEngine::render_frame().

◆ get_used_file_size()

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 35 of file vertexDataSaveFile.I.

References SimpleAllocator::get_total_size().

Referenced by GraphicsEngine::render_frame().

◆ is_valid()

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 18 of file vertexDataSaveFile.I.

◆ read_data()

bool VertexDataSaveFile::read_data ( unsigned char * data,
size_t size,
VertexDataSaveBlock * block )

Member Data Documentation

◆ compressed

size_t bool VertexDataSaveFile::compressed

Definition at line 50 of file vertexDataSaveFile.h.

◆ size

size_t VertexDataSaveFile::size

Definition at line 49 of file vertexDataSaveFile.h.


The documentation for this class was generated from the following files: