# SimpleLru

from pandac.PandaModules import SimpleLru

Class : SimpleLru
Description : An implementation of a very simple LRU algorithm. Also see AdaptiveLru.

## Inheritance:

SimpleLru: LinkedListNode Namable
LinkedListNode:
Namable:

## Methods of SimpleLru:

SimpleLru (Constructor)
beginEpoch
considerEvict
countActiveSize
evictTo
getMaxSize
getTotalSize
output
setMaxSize
validate
write

## Methods of Namable:

Namable (Constructor)
clearName
getClassType
getName
hasName
operator =
output
setName

SimpleLru SimpleLru::SimpleLru(string const &name, unsigned int max_size); Description:

beginEpoch void SimpleLru::begin_epoch(void); Description: 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 void SimpleLru::consider_evict(void); Description: Evicts a sequence of objects if the queue is full.

countActiveSize unsigned int SimpleLru::count_active_size(void) const; Description: Returns the total size of the pages that were enqueued since the last call to begin_epoch().

evictTo void SimpleLru::evict_to(unsigned int target_size); Description: Evicts a sequence of objects until the queue fits within the indicated target size, regardless of its normal max size.

getMaxSize unsigned int SimpleLru::get_max_size(void) const; Description: Returns the max size of all objects that are allowed to be active on the LRU.

getTotalSize unsigned int SimpleLru::get_total_size(void) const; Description: Returns the total size of all objects currently active on the LRU.

output void SimpleLru::output(ostream &out) const; Description:

setMaxSize void SimpleLru::set_max_size(unsigned int max_size); Description: 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 SimpleLru::validate(void); Description: Checks that the LRU is internally self-consistent. Returns true if successful, false if there is some problem.

write void SimpleLru::write(ostream &out, int indent_level) const; Description:

Namable Namable::Namable(string const &initial_name = ("")); Description:

clearName void Namable::clear_name(void); Description: Resets the Namable's name to empty.

getClassType static TypeHandle Namable::get_class_type(void); Undocumented function.

getName string const &Namable::get_name(void) const; Description:

hasName bool Namable::has_name(void) const; Description: Returns true if the Namable has a nonempty name set, false if the name is empty.

operator = Namable &Namable::operator =(Namable const &other); Description:

output void Namable::output(ostream &out) const; In the absence of any definition to the contrary, outputting a Namable will write out its name. Description: Outputs the Namable. This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.

setName void Namable::set_name(string const &name); Description: