Panda3D
|
A block of bytes that holds one or more VertexDataBlocks. More...
#include <pandadoc.hpp>
Public Types | |
enum | RamClass { RC_resident = 0 , RC_compressed = 1 , RC_disk = 2 , RC_end_of_list = 3 } |
Public Member Functions | |
VertexDataBlock | alloc (int size) |
Allocates a new block. More... | |
VertexDataBook | getBook () |
Returns a pointer to the book that owns this page. More... | |
VertexDataBlock | getFirstBlock () |
Returns a pointer to the first allocated block, or NULL if there are no allocated blocks. More... | |
VertexDataPage::RamClass | getPendingRamClass () |
Returns the pending ram class of the array. More... | |
VertexDataPage::RamClass | getRamClass () |
Returns the current ram class of the array. More... | |
output (Ostream out) | |
requestResident () | |
Ensures that the page will become resident soon. More... | |
bool | saveToDisk () |
Writes the page to disk, but does not evict it from memory or affect its LRU status. More... | |
write (Ostream out, int indent_level) | |
![]() | |
__init__ (int max_size, Mutex lock) | |
__init__ (SimpleAllocator from) | |
Move constructor. More... | |
SimpleAllocatorBlock | alloc (int size, int alignment) |
Allocates a new block. More... | |
int | getContiguous () |
Returns an upper-bound estimate of the size of the largest contiguous block that may be allocated. More... | |
SimpleAllocatorBlock | getFirstBlock () |
Returns a pointer to the first allocated block, or NULL if there are no allocated blocks. More... | |
int | getMaxSize () |
Returns the available space for allocated objects. More... | |
int | getTotalSize () |
Returns the total size of allocated objects. More... | |
bool | isEmpty () |
Returns true if there are no blocks allocated on this page, or false if there is at least one. More... | |
output (Ostream out) | |
setMaxSize (int max_size) | |
Changes the available space for allocated objects. More... | |
write (Ostream out) | |
![]() | |
__init__ (const SimpleLruPage copy) | |
__init__ (int lru_size) | |
dequeueLru () | |
Removes the page from its SimpleLru. More... | |
enqueueLru (SimpleLru lru) | |
Adds the page to the LRU for the first time, or marks it recently-accessed if it has already been added. More... | |
evictLru () | |
Evicts the page from the LRU. More... | |
SimpleLru | getLru () |
Returns the LRU that manages this page, or NULL if it is not currently managed by any LRU. More... | |
int | getLruSize () |
Returns the size of this page as reported to the LRU, presumably in bytes. More... | |
markUsedLru () | |
To be called when the page is used; this will move it to the tail of the SimpleLru queue it is already on. More... | |
markUsedLru (SimpleLru lru) | |
To be called when the page is used; this will move it to the tail of the specified SimpleLru queue. More... | |
SimpleLruPage | operator= (const SimpleLruPage copy) |
output (Ostream out) | |
setLruSize (int lru_size) | |
Specifies the size of this page, presumably in bytes, although any unit is possible. More... | |
write (Ostream out, int indent_level) | |
Static Public Member Functions | |
static | flushThreads () |
Waits for all of the pending thread tasks to finish before returning. More... | |
static TypeHandle | getClassType () |
static SimpleLru | getGlobalLru (VertexDataPage::RamClass rclass) |
Returns a pointer to the global LRU object that manages the VertexDataPage's with the indicated RamClass. More... | |
static int | getNumPendingReads () |
Returns the number of read requests that are waiting to be serviced by a thread. More... | |
static int | getNumPendingWrites () |
Returns the number of write requests that are waiting to be serviced by a thread. More... | |
static int | getNumThreads () |
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). More... | |
static SimpleLru | getPendingLru () |
Returns a pointer to the global LRU object that manages the VertexDataPage's that are pending processing by the thread. More... | |
static VertexDataSaveFile | getSaveFile () |
Returns the global VertexDataSaveFile that will be used to save vertex data buffers to disk when necessary. More... | |
static | stopThreads () |
Call this to stop the paging threads, if they were started. More... | |
Public Attributes | |
VertexDataSaveFile | save_file |
Returns the global VertexDataSaveFile that will be used to save vertex data buffers to disk when necessary. More... | |
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.
enum RamClass |
VertexDataBlock alloc | ( | int | size | ) |
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.
|
static |
Waits for all of the pending thread tasks to finish before returning.
VertexDataBook getBook | ( | ) |
Returns a pointer to the book that owns this page.
|
static |
VertexDataBlock getFirstBlock | ( | ) |
Returns a pointer to the first allocated block, or NULL if there are no allocated blocks.
|
static |
Returns a pointer to the global LRU object that manages the VertexDataPage's with the indicated RamClass.
|
static |
Returns the number of read requests that are waiting to be serviced by a thread.
|
static |
Returns the number of write requests that are waiting to be serviced by a thread.
|
static |
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 |
Returns a pointer to the global LRU object that manages the VertexDataPage's that are pending processing by the thread.
VertexDataPage::RamClass getPendingRamClass | ( | ) |
Returns the pending ram class of the array.
If this is different from get_ram_class(), this page has been queued to be processed by the thread. Eventually the page will be set to this ram class.
VertexDataPage::RamClass getRamClass | ( | ) |
Returns the current ram class of the array.
If this is other than RC_resident, the array data is not resident in memory.
|
static |
Returns the global VertexDataSaveFile that will be used to save vertex data buffers to disk when necessary.
output | ( | Ostream | out | ) |
requestResident | ( | ) |
Ensures that the page will become resident soon.
Future calls to get_page_data() will eventually return non-NULL.
bool saveToDisk | ( | ) |
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 |
Call this to stop the paging threads, if they were started.
This may block until all of the pending tasks have been completed.
write | ( | Ostream | out, |
int | indent_level | ||
) |
VertexDataSaveFile save_file |
Returns the global VertexDataSaveFile that will be used to save vertex data buffers to disk when necessary.