CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lru::LruCache< Key, Value >::ListEntryHead< T > Class Template Reference
Inheritance diagram for lru::LruCache< Key, Value >::ListEntryHead< T >:
Collaboration diagram for lru::LruCache< Key, Value >::ListEntryHead< T >:

Public Member Functions

 ListEntryHead (ConcreteMemoryAllocator *allocator)
 
virtual ~ListEntryHead ()
 
void clear ()
 
bool IsListHead () const
 
bool IsEmpty () const
 
ListEntryContent< T > * PushBack (T content)
 
PopFront ()
 
void MoveToBack (ListEntryContent< T > *entry)
 
void RemoveFromList ()
 
- Public Member Functions inherited from lru::LruCache< Key, Value >::ListEntry< T >
 ListEntry ()
 
 ListEntry (const ListEntry< T > &other)
 
virtual ~ListEntry ()
 
bool IsLonely () const
 

Private Member Functions

Pop (ListEntry< T > *popped_entry)
 

Private Attributes

ConcreteMemoryAllocatorallocator_
 

Additional Inherited Members

- Public Attributes inherited from lru::LruCache< Key, Value >::ListEntry< T >
ListEntry< T > * next
 
ListEntry< T > * prev
 
- Protected Member Functions inherited from lru::LruCache< Key, Value >::ListEntry< T >
void InsertAsSuccessor (ListEntryContent< T > *entry)
 
void InsertAsPredecessor (ListEntryContent< T > *entry)
 

Detailed Description

template<class Key, class Value>
template<class T>
class lru::LruCache< Key, Value >::ListEntryHead< T >

Specialized ListEntry to form a list head. Every list has exactly one list head which is also the entry point in the list. It is used to manipulate the list.

Definition at line 110 of file lru.h.

Constructor & Destructor Documentation

template<class Key, class Value>
template<class T>
lru::LruCache< Key, Value >::ListEntryHead< T >::ListEntryHead ( ConcreteMemoryAllocator allocator)
inlineexplicit

Definition at line 414 of file lru.h.

template<class Key, class Value>
template<class T>
virtual lru::LruCache< Key, Value >::ListEntryHead< T >::~ListEntryHead ( )
inlinevirtual

Definition at line 417 of file lru.h.

Member Function Documentation

template<class Key, class Value>
template<class T>
void lru::LruCache< Key, Value >::ListEntryHead< T >::clear ( )
inline

Remove all entries from the list. ListEntry objects are deleted but contained data keeps available

Definition at line 425 of file lru.h.

Referenced by lru::LruCache< shash::Any, MemoryBuffer >::Drop(), and lru::LruCache< Key, Value >::ListEntryHead< fuse_ino_t >::~ListEntryHead().

Here is the caller graph for this function:

template<class Key, class Value>
template<class T>
bool lru::LruCache< Key, Value >::ListEntryHead< T >::IsEmpty ( ) const
inline

Definition at line 441 of file lru.h.

Referenced by lru::LruCache< Key, Value >::ListEntryHead< fuse_ino_t >::PopFront().

Here is the caller graph for this function:

template<class Key, class Value>
template<class T>
bool lru::LruCache< Key, Value >::ListEntryHead< T >::IsListHead ( ) const
inlinevirtual

Checks if the ListEntry is the list head

Returns
true if ListEntry is list head otherwise false

Implements lru::LruCache< Key, Value >::ListEntry< T >.

Definition at line 440 of file lru.h.

template<class Key, class Value>
template<class T>
void lru::LruCache< Key, Value >::ListEntryHead< T >::MoveToBack ( ListEntryContent< T > *  entry)
inline

Take a list entry out of it's list and reinsert at the end of this list.

Parameters
theListEntry to be moved to the end of this list

Definition at line 469 of file lru.h.

Referenced by lru::LruCache< shash::Any, MemoryBuffer >::Touch().

Here is the caller graph for this function:

template<class Key, class Value>
template<class T>
T lru::LruCache< Key, Value >::ListEntryHead< T >::Pop ( ListEntry< T > *  popped_entry)
inlineprivate

Pop a ListEntry from the list (arbitrary position). The given ListEntry is removed from the list, deleted and it's data content is returned

Parameters
popped_entrythe entry to be popped
Returns
the data object of the popped ListEntry

Definition at line 489 of file lru.h.

Referenced by lru::LruCache< Key, Value >::ListEntryHead< fuse_ino_t >::PopFront().

Here is the caller graph for this function:

template<class Key, class Value>
template<class T>
T lru::LruCache< Key, Value >::ListEntryHead< T >::PopFront ( )
inline

Pop the first object of the list. The object is returned and removed from the list

Returns
the data object which resided in the first list entry

Definition at line 460 of file lru.h.

Referenced by lru::LruCache< shash::Any, MemoryBuffer >::DeleteOldest().

Here is the caller graph for this function:

template<class Key, class Value>
template<class T>
ListEntryContent<T>* lru::LruCache< Key, Value >::ListEntryHead< T >::PushBack ( content)
inline

Push a new data object to the end of the list.

Parameters
thedata object to insert
Returns
the ListEntryContent structure wrapped around the data object

Definition at line 448 of file lru.h.

Referenced by lru::LruCache< shash::Any, MemoryBuffer >::Insert().

Here is the caller graph for this function:

template<class Key, class Value>
template<class T>
void lru::LruCache< Key, Value >::ListEntryHead< T >::RemoveFromList ( )
inlinevirtual

See ListEntry base class

Implements lru::LruCache< Key, Value >::ListEntry< T >.

Definition at line 479 of file lru.h.

Member Data Documentation


The documentation for this class was generated from the following file: