Raven Core  3.0.0
P2P Digital Currency
Public Types | Public Member Functions | Private Attributes | List of all members
CLRUCache< cache_key_t, cache_value_t > Class Template Reference

#include <assettypes.h>

Public Types

typedef std::pair< cache_key_t, cache_value_t > key_value_pair_t
 
typedef std::list< key_value_pair_t >::iterator list_iterator_t
 

Public Member Functions

 CLRUCache (size_t max_size)
 
 CLRUCache ()
 
void Put (const cache_key_t &key, const cache_value_t &value)
 
void Erase (const cache_key_t &key)
 
const cache_value_t & Get (const cache_key_t &key)
 
bool Exists (const cache_key_t &key) const
 
size_t Size () const
 
void Clear ()
 
void SetNull ()
 
size_t MaxSize () const
 
void SetSize (const size_t size)
 
const std::unordered_map< cache_key_t, list_iterator_t > & GetItemsMap ()
 
const std::list< key_value_pair_t > & GetItemsList ()
 
 CLRUCache (const CLRUCache &cache)
 

Private Attributes

std::list< key_value_pair_tcacheItemsList
 
std::unordered_map< cache_key_t, list_iterator_tcacheItemsMap
 
size_t maxSize
 

Detailed Description

template<typename cache_key_t, typename cache_value_t>
class CLRUCache< cache_key_t, cache_value_t >

Definition at line 539 of file assettypes.h.

Member Typedef Documentation

◆ key_value_pair_t

template<typename cache_key_t, typename cache_value_t>
typedef std::pair<cache_key_t, cache_value_t> CLRUCache< cache_key_t, cache_value_t >::key_value_pair_t

Definition at line 542 of file assettypes.h.

◆ list_iterator_t

template<typename cache_key_t, typename cache_value_t>
typedef std::list<key_value_pair_t>::iterator CLRUCache< cache_key_t, cache_value_t >::list_iterator_t

Definition at line 543 of file assettypes.h.

Constructor & Destructor Documentation

◆ CLRUCache() [1/3]

template<typename cache_key_t, typename cache_value_t>
CLRUCache< cache_key_t, cache_value_t >::CLRUCache ( size_t  max_size)
inline

Definition at line 545 of file assettypes.h.

◆ CLRUCache() [2/3]

template<typename cache_key_t, typename cache_value_t>
CLRUCache< cache_key_t, cache_value_t >::CLRUCache ( )
inline

Definition at line 548 of file assettypes.h.

◆ CLRUCache() [3/3]

template<typename cache_key_t, typename cache_value_t>
CLRUCache< cache_key_t, cache_value_t >::CLRUCache ( const CLRUCache< cache_key_t, cache_value_t > &  cache)
inline

Definition at line 642 of file assettypes.h.

Member Function Documentation

◆ Clear()

template<typename cache_key_t, typename cache_value_t>
void CLRUCache< cache_key_t, cache_value_t >::Clear ( )
inline

Definition at line 608 of file assettypes.h.

◆ Erase()

template<typename cache_key_t, typename cache_value_t>
void CLRUCache< cache_key_t, cache_value_t >::Erase ( const cache_key_t &  key)
inline

Definition at line 573 of file assettypes.h.

◆ Exists()

template<typename cache_key_t, typename cache_value_t>
bool CLRUCache< cache_key_t, cache_value_t >::Exists ( const cache_key_t &  key) const
inline

Definition at line 597 of file assettypes.h.

◆ Get()

template<typename cache_key_t, typename cache_value_t>
const cache_value_t& CLRUCache< cache_key_t, cache_value_t >::Get ( const cache_key_t &  key)
inline

Definition at line 583 of file assettypes.h.

◆ GetItemsList()

template<typename cache_key_t, typename cache_value_t>
const std::list<key_value_pair_t>& CLRUCache< cache_key_t, cache_value_t >::GetItemsList ( )
inline

Definition at line 636 of file assettypes.h.

◆ GetItemsMap()

template<typename cache_key_t, typename cache_value_t>
const std::unordered_map<cache_key_t, list_iterator_t>& CLRUCache< cache_key_t, cache_value_t >::GetItemsMap ( )
inline

Definition at line 631 of file assettypes.h.

◆ MaxSize()

template<typename cache_key_t, typename cache_value_t>
size_t CLRUCache< cache_key_t, cache_value_t >::MaxSize ( ) const
inline

Definition at line 620 of file assettypes.h.

◆ Put()

template<typename cache_key_t, typename cache_value_t>
void CLRUCache< cache_key_t, cache_value_t >::Put ( const cache_key_t &  key,
const cache_value_t &  value 
)
inline

Definition at line 553 of file assettypes.h.

◆ SetNull()

template<typename cache_key_t, typename cache_value_t>
void CLRUCache< cache_key_t, cache_value_t >::SetNull ( )
inline

Definition at line 614 of file assettypes.h.

◆ SetSize()

template<typename cache_key_t, typename cache_value_t>
void CLRUCache< cache_key_t, cache_value_t >::SetSize ( const size_t  size)
inline

Definition at line 626 of file assettypes.h.

◆ Size()

template<typename cache_key_t, typename cache_value_t>
size_t CLRUCache< cache_key_t, cache_value_t >::Size ( ) const
inline

Definition at line 602 of file assettypes.h.

Member Data Documentation

◆ cacheItemsList

template<typename cache_key_t, typename cache_value_t>
std::list<key_value_pair_t> CLRUCache< cache_key_t, cache_value_t >::cacheItemsList
private

Definition at line 650 of file assettypes.h.

◆ cacheItemsMap

template<typename cache_key_t, typename cache_value_t>
std::unordered_map<cache_key_t, list_iterator_t> CLRUCache< cache_key_t, cache_value_t >::cacheItemsMap
private

Definition at line 651 of file assettypes.h.

◆ maxSize

template<typename cache_key_t, typename cache_value_t>
size_t CLRUCache< cache_key_t, cache_value_t >::maxSize
private

Definition at line 652 of file assettypes.h.


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