panda3d.core.SimpleLru¶

from panda3d.core import SimpleLru

class SimpleLru

Bases: LinkedListNode, Namable

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

Inheritance diagram

__init__(name: str, max_size: size_t) → None
getTotalSize() → size_t

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

Return type

size_t

getMaxSize() → size_t

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

Return type

size_t

setMaxSize(max_size: size_t) → None

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.

countActiveSize() → size_t

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

Return type

size_t

considerEvict() → None

Evicts a sequence of objects if the queue is full.

evictTo(target_size: size_t) → None

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

beginEpoch() → None

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.

validate() → bool

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

output(out: ostream) → None
write(out: ostream, indent_level: int) → None