panda3d.core.VertexDataPage

from panda3d.core import VertexDataPage
class VertexDataPage

Bases: SimpleAllocator, SimpleLruPage

A block of bytes that holds one or more VertexDataBlocks. The entire page may be paged out, in the form of in-memory compression or to an on-disk cache file, if necessary.

Inheritance diagram

Inheritance diagram of VertexDataPage

getRamClass() → RamClass

Returns the current ram class of the array. If this is other than RC_resident, the array data is not resident in memory.

Return type

RamClass

getPendingRamClass() → RamClass

Returns the pending ram class of the array. If this is different from getRamClass(), this page has been queued to be processed by the thread. Eventually the page will be set to this ram class.

Return type

RamClass

requestResident() → None

Ensures that the page will become resident soon. Future calls to get_page_data() will eventually return non-NULL.

alloc(size: size_t) → VertexDataBlock

Allocates a new block. Returns NULL if a block of the requested size cannot be allocated.

To free the allocated block, call block->free(), or simply delete the block pointer.

Return type

VertexDataBlock

getFirstBlock() → VertexDataBlock

Returns a pointer to the first allocated block, or NULL if there are no allocated blocks.

Return type

VertexDataBlock

getBook() → VertexDataBook

Returns a pointer to the book that owns this page.

Return type

VertexDataBook

static getGlobalLru(rclass: RamClass) → SimpleLru

Returns a pointer to the global LRU object that manages the VertexDataPage’s with the indicated RamClass.

Return type

SimpleLru

static getPendingLru() → SimpleLru

Returns a pointer to the global LRU object that manages the VertexDataPage’s that are pending processing by the thread.

Return type

SimpleLru

static getSaveFile() → VertexDataSaveFile

Returns the global VertexDataSaveFile that will be used to save vertex data buffers to disk when necessary.

Return type

VertexDataSaveFile

saveToDisk() → bool

Writes the page to disk, but does not evict it from memory or affect its LRU status. If it gets evicted later without having been modified, it will not need to write itself to disk again.

static getNumThreads() → int

Returns the number of threads that have been spawned to service vertex paging requests, or 0 if no threads have been spawned (which may mean either that all paging requests will be handled by the main thread, or simply that no paging requests have yet been issued).

static getNumPendingReads() → int

Returns the number of read requests that are waiting to be serviced by a thread.

static getNumPendingWrites() → int

Returns the number of write requests that are waiting to be serviced by a thread.

static stopThreads() → None

Call this to stop the paging threads, if they were started. This may block until all of the pending tasks have been completed.

static flushThreads() → None

Waits for all of the pending thread tasks to finish before returning.

output(out: ostream) → None
write(out: ostream, indent_level: int) → None
static getClassType() → TypeHandle
Return type

TypeHandle

property save_file

Returns the global VertexDataSaveFile that will be used to save vertex data buffers to disk when necessary.

Return type

VertexDataSaveFile

enum RamClass

These are used to indicate the current residency state of the page, which may or may not have been temporarily evicted to satisfy memory requirements.

enumerator RC_resident = 0
enumerator RC_compressed = 1
enumerator RC_disk = 2
enumerator RC_end_of_list = 3

list marker; do not use