Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Types | Public Member Functions | Static Public Member Functions
VertexDataPage Class Reference

A block of bytes that holds one or more VertexDataBlocks. More...

Inheritance diagram for VertexDataPage:
SimpleAllocator SimpleLruPage LinkedListNode LinkedListNode

List of all members.

Public Types

enum  RamClass { RCResident = 0, RCCompressed = 1, RCDisk = 2, RCEndOfList = 3 }

Public Member Functions

VertexDataBlock alloc (unsigned int size)
 Allocates a new block.
VertexDataBook getBook ()
 Returns a pointer to the book that owns this page.
VertexDataBlock getFirstBlock ()
 Returns a pointer to the first allocated block, or NULL if there are no allocated blocks.
RamClass getPendingRamClass ()
 Returns the pending ram class of the array.
RamClass getRamClass ()
 Returns the current ram class of the array.
 output (ostream out)
 requestResident ()
 Ensures that the page will become resident soon.
bool saveToDisk ()
 Writes the page to disk, but does not evict it from memory or affect its LRU status.
 write (ostream out, int indent_level)

Static Public Member Functions

static flushThreads ()
 Waits for all of the pending thread tasks to finish before returning.
static TypeHandle getClassType ()
static SimpleLru getGlobalLru (RamClass rclass)
 Returns a pointer to the global LRU object that manages the VertexDataPage's with the indicated RamClass.
static int getNumPendingReads ()
 Returns the number of read requests that are waiting to be serviced by a thread.
static int getNumPendingWrites ()
 Returns the number of write requests that are waiting to be serviced by a thread.
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).
static SimpleLru getPendingLru ()
 Returns a pointer to the global LRU object that manages the VertexDataPage's that are pending processing by the thread.
static VertexDataSaveFile getSaveFile ()
 Returns the global VertexDataSaveFile that will be used to save vertex data buffers to disk when necessary.
static stopThreads ()
 Call this to stop the paging threads, if they were started.

Detailed Description

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.


Member Enumeration Documentation

enum RamClass
Enumerator:
RCResident 
RCCompressed 
RCDisk 
RCEndOfList 

Member Function Documentation

VertexDataBlock alloc ( unsigned 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.

Reimplemented from SimpleAllocator.

static flushThreads ( ) [static]

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

Returns a pointer to the book that owns this page.

static TypeHandle getClassType ( ) [static]

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

Reimplemented from SimpleAllocator.

static SimpleLru getGlobalLru ( RamClass  rclass) [static]

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

static int getNumPendingReads ( ) [static]

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

static int getNumPendingWrites ( ) [static]

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

static int getNumThreads ( ) [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 SimpleLru getPendingLru ( ) [static]

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

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.

Returns the current ram class of the array.

If this is other than RC_resident, the array data is not resident in memory.

static VertexDataSaveFile getSaveFile ( ) [static]

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

output ( ostream  out)

Reimplemented from SimpleLruPage.

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 stopThreads ( ) [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 
)

Reimplemented from SimpleLruPage.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties