Panda3D
Public Member Functions | List of all members
VertexDataBook Class Reference

A collection of VertexDataPages, which can be used to allocate new VertexDataBlock objects. More...

Public Member Functions

 __init__ (int block_size)
 
VertexDataBlock alloc (int size)
 Allocates and returns a new VertexDataBuffer of the requested size. More...
 
int countAllocatedSize ()
 Returns the total size of all bytes allocated within pages owned by this book. More...
 
int countAllocatedSize (VertexDataPage::RamClass ram_class)
 Returns the total size of all bytes allocated within pages owned by this book that have the indicated ram class. More...
 
int countTotalPageSize ()
 Returns the total size of all bytes owned by all pages owned by this book. More...
 
int countTotalPageSize (VertexDataPage::RamClass ram_class)
 Returns the total size of all bytes owned by all pages owned by this book that have the indicated ram class. More...
 
int getNumPages ()
 Returns the number of pages created for the book. More...
 
 saveToDisk ()
 Writes all pages to disk immediately, just in case they get evicted later. More...
 

Detailed Description

A collection of VertexDataPages, which can be used to allocate new VertexDataBlock objects.

Member Function Documentation

◆ __init__()

__init__ ( int  block_size)

◆ alloc()

VertexDataBlock alloc ( int  size)

Allocates and returns a new VertexDataBuffer of the requested size.

◆ countAllocatedSize() [1/2]

int countAllocatedSize ( )

Returns the total size of all bytes allocated within pages owned by this book.

◆ countAllocatedSize() [2/2]

int countAllocatedSize ( VertexDataPage::RamClass  ram_class)

Returns the total size of all bytes allocated within pages owned by this book that have the indicated ram class.

◆ countTotalPageSize() [1/2]

int countTotalPageSize ( )

Returns the total size of all bytes owned by all pages owned by this book.

◆ countTotalPageSize() [2/2]

int countTotalPageSize ( VertexDataPage::RamClass  ram_class)

Returns the total size of all bytes owned by all pages owned by this book that have the indicated ram class.

◆ getNumPages()

int getNumPages ( )

Returns the number of pages created for the book.

◆ saveToDisk()

saveToDisk ( )

Writes all pages to disk immediately, just in case they get evicted later.

It makes sense to make this call just before taking down a loading screen, to minimize chugs from saving pages inadvertently later.