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

One atomic piece that may be managed by a SimpleLru chain. More...

Inheritance diagram for SimpleLruPage:
GeomVertexArrayData VertexDataPage

Public Member Functions

 __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)
 

Detailed Description

One atomic piece that may be managed by a SimpleLru chain.

To use this class, inherit from it and override evict_lru().

Member Function Documentation

◆ __init__() [1/2]

__init__ ( const SimpleLruPage  copy)

◆ __init__() [2/2]

__init__ ( int  lru_size)

◆ dequeueLru()

dequeueLru ( )

Removes the page from its SimpleLru.

◆ enqueueLru()

enqueueLru ( SimpleLru  lru)

Adds the page to the LRU for the first time, or marks it recently-accessed if it has already been added.

If lru is NULL, it means to remove this page from its LRU.

◆ evictLru()

evictLru ( )

Evicts the page from the LRU.

Called internally when the LRU determines that it is full. May also be called externally when necessary to explicitly evict the page.

It is legal for this method to either evict the page as requested, do nothing (in which case the eviction will be requested again at the next epoch), or requeue itself on the tail of the queue (in which case the eviction will be requested again much later).

◆ getLru()

SimpleLru getLru ( )

Returns the LRU that manages this page, or NULL if it is not currently managed by any LRU.

◆ getLruSize()

int getLruSize ( )

Returns the size of this page as reported to the LRU, presumably in bytes.

◆ markUsedLru() [1/2]

markUsedLru ( )

To be called when the page is used; this will move it to the tail of the SimpleLru queue it is already on.

This method is const because it's not technically modifying the contents of the page itself.

◆ markUsedLru() [2/2]

markUsedLru ( SimpleLru  lru)

To be called when the page is used; this will move it to the tail of the specified SimpleLru queue.

◆ operator=()

SimpleLruPage operator= ( const SimpleLruPage  copy)

◆ output()

output ( Ostream  out)

◆ setLruSize()

setLruSize ( int  lru_size)

Specifies the size of this page, presumably in bytes, although any unit is possible.

◆ write()

write ( Ostream  out,
int  indent_level 
)