|
Hybrid ICN (hICN) plugin
v21.06-rc0-4-g18fa668
|
Maintains an LRU for the content store. More...

Go to the source code of this file.
Typedefs | |
| typedef struct list_lru_entry | ListLruEntry |
| typedef struct list_lru | ListLru |
Functions | |
| void | listLRU_EntryDestroy (ListLruEntry **entryPtr) |
| void | listLRU_EntryMoveToHead (ListLruEntry *entry) |
| void * | listLRU_EntryGetData (ListLruEntry *entry) |
| ListLru * | listLRU_Create () |
| void | listLRU_Destroy (ListLru **listPtr) |
| size_t | listLRU_Length (const ListLru *lru) |
| ListLruEntry * | listLRU_NewHeadEntry (ListLru *lru, void *data) |
| ListLruEntry * | listLRU_PopTail (ListLru *list) |
Maintains an LRU for the content store.
An LRU list is make up of LRU entries. The entries are bound to the list. The user of the list is reponsible for knowing when there's too many things and wants to remove one. The LRU list will grow without bound otherwise.
The LRU list is meant to be used as an auxiliary data structure, not the primary storage of data elements.
| ListLru* listLRU_Create | ( | ) |
@function listLRU_Create @abstract Creates a new Least-Recently-Used list
| void listLRU_Destroy | ( | ListLru ** | listPtr | ) |
@function listLRU_Destroy @abstract Destroys a list and frees all the elements in it
| void listLRU_EntryDestroy | ( | ListLruEntry ** | entryPtr | ) |
@function lruEntry_Destroy @abstract Destroys and element. This will also remove it from the list.
| void* listLRU_EntryGetData | ( | ListLruEntry * | entry | ) |
@function lruEntry_GetData @abstract Returns the user-supplied opaque data when the entry was created
| void listLRU_EntryMoveToHead | ( | ListLruEntry * | entry | ) |
@function listLRU_EntryMoveToHead @abstract move an element to head
| size_t listLRU_Length | ( | const ListLru * | lru | ) |
Returns the number of items in the list
| [in] | lru | An allocated ListLru |
| number | The number of items in the LRU list |
| ListLruEntry* listLRU_NewHeadEntry | ( | ListLru * | lru, |
| void * | data | ||
| ) |
@function listLRU_NewHeadEntry @abstract Creates a new entry for the list. It is inserted at the head of the list.
| ListLruEntry* listLRU_PopTail | ( | ListLru * | list | ) |
@function listLRU_PopTail @abstract Removes the tail element from the list and returns it to the user @discussion Pops the tail element. The user should examine its data to destroy their tail object, then call LruEntry_Destroy() to free the LRU entry.
1.8.17