# SimpleLruPage

from pandac.PandaModules import SimpleLruPage

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

## Inheritance:

SimpleLruPage: LinkedListNode
LinkedListNode:

## Methods of SimpleLruPage:

dequeueLru
enqueueLru
evictLru
getLru
getLruSize
markUsedLru
operator =
setLruSize

dequeueLru void SimpleLruPage::dequeue_lru(void); Description: Removes the page from its SimpleLru.

enqueueLru void SimpleLruPage::enqueue_lru(SimpleLru *lru); Description: Adds the page to the tail of the SimpleLru. When it reaches the head, it will be the next to be evicted.

evictLru virtual void SimpleLruPage::evict_lru(void); Description: 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).

getLru SimpleLru *SimpleLruPage::get_lru(void) const; Description: Returns the LRU that manages this page, or NULL if it is not currently managed by any LRU.

getLruSize unsigned int SimpleLruPage::get_lru_size(void) const; Description: Returns the size of this page as reported to the LRU, presumably in bytes.

markUsedLru void SimpleLruPage::mark_used_lru(void) const; Description: 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. Description: To be called when the page is used; this will move it to the tail of the specified SimpleLru queue.

operator = void SimpleLruPage::operator =(SimpleLruPage const &copy); Description:

setLruSize void SimpleLruPage::set_lru_size(unsigned int lru_size); Description: Specifies the size of this page, presumably in bytes, although any unit is possible.