SimpleLruPage

from panda3d.core import SimpleLruPage
class SimpleLruPage

Bases:

Bases: LinkedListNode

One atomic piece that may be managed by a SimpleLru chain. To use this class, inherit from it and override evict_lru().

Inheritance diagram

Inheritance diagram of SimpleLruPage

__init__(copy: SimpleLruPage)
__init__(lru_size: int)
assign(copy: SimpleLruPage) SimpleLruPage
dequeue_lru()

Removes the page from its SimpleLru.

enqueue_lru(lru: SimpleLru)

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.

evict_lru()

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

get_lru() SimpleLru

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

get_lru_size() int

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

mark_used_lru()

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.

mark_used_lru(lru: SimpleLru)

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

output(out: ostream)
set_lru_size(lru_size: int)

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

write(out: ostream, indent_level: int)