Panda3D
|
An implementation of a very simple LRU algorithm. More...
#include <pandadoc.hpp>
Public Member Functions | |
__init__ (str name, int max_size) | |
beginEpoch () | |
Marks the end of the previous epoch and the beginning of the next one. | |
considerEvict () | |
Evicts a sequence of objects if the queue is full. | |
int | countActiveSize () |
Returns the total size of the pages that were enqueued since the last call to begin_epoch(). | |
evictTo (int target_size) | |
Evicts a sequence of objects until the queue fits within the indicated target size, regardless of its normal max size. | |
int | getMaxSize () |
Returns the max size of all objects that are allowed to be active on the LRU. | |
int | getTotalSize () |
Returns the total size of all objects currently active on the LRU. | |
output (Ostream out) | |
setMaxSize (int max_size) | |
Changes the max size of all objects that are allowed to be active on the LRU. | |
bool | validate () |
Checks that the LRU is internally self-consistent. | |
write (Ostream out, int indent_level) | |
![]() | |
__init__ (const Namable) | |
__init__ (str initial_name) | |
clearName () | |
Resets the Namable's name to empty. | |
str | getName () |
bool | hasName () |
Returns true if the Namable has a nonempty name set, false if the name is empty. | |
output (Ostream out) | |
Outputs the Namable. | |
setName (str name) | |
Additional Inherited Members | |
![]() | |
static TypeHandle | getClassType () |
![]() | |
const String | name |
An implementation of a very simple LRU algorithm.
Also see AdaptiveLru.
__init__ | ( | str | name, |
int | max_size ) |
beginEpoch | ( | ) |
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.
considerEvict | ( | ) |
Evicts a sequence of objects if the queue is full.
int countActiveSize | ( | ) |
Returns the total size of the pages that were enqueued since the last call to begin_epoch().
evictTo | ( | int | target_size | ) |
Evicts a sequence of objects until the queue fits within the indicated target size, regardless of its normal max size.
int getMaxSize | ( | ) |
Returns the max size of all objects that are allowed to be active on the LRU.
int getTotalSize | ( | ) |
Returns the total size of all objects currently active on the LRU.
output | ( | Ostream | out | ) |
setMaxSize | ( | int | max_size | ) |
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.
bool validate | ( | ) |
Checks that the LRU is internally self-consistent.
Returns true if successful, false if there is some problem.
write | ( | Ostream | out, |
int | indent_level ) |