SimpleLru

from panda3d.core import SimpleLru
class SimpleLru

Bases:

Bases: LinkedListNode, Namable

An implementation of a very simple LRU algorithm. Also see AdaptiveLru.

Inheritance diagram

Inheritance diagram of SimpleLru

__init__(name: str, max_size: int)
begin_epoch()

Marks the end of the previous epoch and the beginning of the next one. This will evict any objects that are pending eviction, and also update any internal bookkeeping.

consider_evict()

Evicts a sequence of objects if the queue is full.

count_active_size() int

Returns the total size of the pages that were enqueued since the last call to begin_epoch().

evict_to(target_size: int)

Evicts a sequence of objects until the queue fits within the indicated target size, regardless of its normal max size.

get_max_size() int

Returns the max size of all objects that are allowed to be active on the LRU.

get_total_size() int

Returns the total size of all objects currently active on the LRU.

output(out: ostream)
set_max_size(max_size: int)

Changes the max size of all objects that are allowed to be active on the LRU.

If the size is (size_t)-1, there is no limit.

validate() bool

Checks that the LRU is internally self-consistent. Returns true if successful, false if there is some problem.

write(out: ostream, indent_level: int)