Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

Map like container that keeps the N most recently added items. More...

#include <cachemultimap.h>

Public Types

typedef Size size_type
 
typedef CacheItem< K, V > item_t
 
typedef std::list< item_tlist_t
 
typedef list_t::iterator list_it
 
typedef list_t::const_iterator list_cit
 
typedef std::map< V, list_itit_map_t
 
typedef it_map_t::iterator it_map_it
 
typedef it_map_t::const_iterator it_map_cit
 
typedef std::map< K, it_map_tmap_t
 
typedef map_t::iterator map_it
 
typedef map_t::const_iterator map_cit
 

Public Member Functions

 CacheMultiMap (size_type nMaxSizeIn=0)
 
 CacheMultiMap (const CacheMap< K, V > &other)
 
void Clear ()
 
void SetMaxSize (size_type nMaxSizeIn)
 
size_type GetMaxSize () const
 
size_type GetSize () const
 
bool Insert (const K &key, const V &value)
 
bool HasKey (const K &key) const
 
bool Get (const K &key, V &value) const
 
bool GetAll (const K &key, std::vector< V > &vecValues)
 
void GetKeys (std::vector< K > &vecKeys)
 
void Erase (const K &key)
 
void Erase (const K &key, const V &value)
 
const list_tGetItemList () const
 
CacheMap< K, V > & operator= (const CacheMap< K, V > &other)
 
template<typename Stream , typename Operation >
void SerializationOp (Stream &s, Operation ser_action)
 

Public Attributes

 ADD_SERIALIZE_METHODS
 

Private Member Functions

void PruneLast ()
 
void RebuildIndex ()
 

Private Attributes

size_type nMaxSize
 
list_t listItems
 
map_t mapIndex
 

Detailed Description

template<typename K, typename V, typename Size = uint32_t>
class CacheMultiMap< K, V, Size >

Map like container that keeps the N most recently added items.

Definition at line 21 of file cachemultimap.h.

Member Typedef Documentation

◆ it_map_cit

template<typename K, typename V, typename Size = uint32_t>
typedef it_map_t::const_iterator CacheMultiMap< K, V, Size >::it_map_cit

Definition at line 38 of file cachemultimap.h.

◆ it_map_it

template<typename K, typename V, typename Size = uint32_t>
typedef it_map_t::iterator CacheMultiMap< K, V, Size >::it_map_it

Definition at line 36 of file cachemultimap.h.

◆ it_map_t

template<typename K, typename V, typename Size = uint32_t>
typedef std::map<V,list_it> CacheMultiMap< K, V, Size >::it_map_t

Definition at line 34 of file cachemultimap.h.

◆ item_t

template<typename K, typename V, typename Size = uint32_t>
typedef CacheItem<K,V> CacheMultiMap< K, V, Size >::item_t

Definition at line 26 of file cachemultimap.h.

◆ list_cit

template<typename K, typename V, typename Size = uint32_t>
typedef list_t::const_iterator CacheMultiMap< K, V, Size >::list_cit

Definition at line 32 of file cachemultimap.h.

◆ list_it

template<typename K, typename V, typename Size = uint32_t>
typedef list_t::iterator CacheMultiMap< K, V, Size >::list_it

Definition at line 30 of file cachemultimap.h.

◆ list_t

template<typename K, typename V, typename Size = uint32_t>
typedef std::list<item_t> CacheMultiMap< K, V, Size >::list_t

Definition at line 28 of file cachemultimap.h.

◆ map_cit

template<typename K, typename V, typename Size = uint32_t>
typedef map_t::const_iterator CacheMultiMap< K, V, Size >::map_cit

Definition at line 44 of file cachemultimap.h.

◆ map_it

template<typename K, typename V, typename Size = uint32_t>
typedef map_t::iterator CacheMultiMap< K, V, Size >::map_it

Definition at line 42 of file cachemultimap.h.

◆ map_t

template<typename K, typename V, typename Size = uint32_t>
typedef std::map<K, it_map_t> CacheMultiMap< K, V, Size >::map_t

Definition at line 40 of file cachemultimap.h.

◆ size_type

template<typename K, typename V, typename Size = uint32_t>
typedef Size CacheMultiMap< K, V, Size >::size_type

Definition at line 24 of file cachemultimap.h.

Constructor & Destructor Documentation

◆ CacheMultiMap() [1/2]

template<typename K, typename V, typename Size = uint32_t>
CacheMultiMap< K, V, Size >::CacheMultiMap ( size_type  nMaxSizeIn = 0)
inline

Definition at line 54 of file cachemultimap.h.

◆ CacheMultiMap() [2/2]

template<typename K, typename V, typename Size = uint32_t>
CacheMultiMap< K, V, Size >::CacheMultiMap ( const CacheMap< K, V > &  other)
inline

Definition at line 60 of file cachemultimap.h.

Member Function Documentation

◆ Clear()

template<typename K, typename V, typename Size = uint32_t>
void CacheMultiMap< K, V, Size >::Clear ( )
inline

Definition at line 68 of file cachemultimap.h.

Referenced by CGovernanceManager::Clear().

◆ Erase() [1/2]

template<typename K, typename V, typename Size = uint32_t>
void CacheMultiMap< K, V, Size >::Erase ( const K &  key)
inline

◆ Erase() [2/2]

template<typename K, typename V, typename Size = uint32_t>
void CacheMultiMap< K, V, Size >::Erase ( const K &  key,
const V &  value 
)
inline

Definition at line 162 of file cachemultimap.h.

◆ Get()

template<typename K, typename V, typename Size = uint32_t>
bool CacheMultiMap< K, V, Size >::Get ( const K &  key,
V &  value 
) const
inline

Definition at line 113 of file cachemultimap.h.

◆ GetAll()

template<typename K, typename V, typename Size = uint32_t>
bool CacheMultiMap< K, V, Size >::GetAll ( const K &  key,
std::vector< V > &  vecValues 
)
inline

Definition at line 125 of file cachemultimap.h.

Referenced by CGovernanceManager::CheckOrphanVotes().

◆ GetItemList()

template<typename K, typename V, typename Size = uint32_t>
const list_t& CacheMultiMap< K, V, Size >::GetItemList ( ) const
inline

Definition at line 183 of file cachemultimap.h.

Referenced by CGovernanceManager::CleanOrphanObjects().

◆ GetKeys()

template<typename K, typename V, typename Size = uint32_t>
void CacheMultiMap< K, V, Size >::GetKeys ( std::vector< K > &  vecKeys)
inline

Definition at line 140 of file cachemultimap.h.

Referenced by CGovernanceManager::RequestOrphanObjects().

◆ GetMaxSize()

template<typename K, typename V, typename Size = uint32_t>
size_type CacheMultiMap< K, V, Size >::GetMaxSize ( ) const
inline

Definition at line 79 of file cachemultimap.h.

◆ GetSize()

template<typename K, typename V, typename Size = uint32_t>
size_type CacheMultiMap< K, V, Size >::GetSize ( ) const
inline

Definition at line 83 of file cachemultimap.h.

◆ HasKey()

template<typename K, typename V, typename Size = uint32_t>
bool CacheMultiMap< K, V, Size >::HasKey ( const K &  key) const
inline

Definition at line 108 of file cachemultimap.h.

◆ Insert()

template<typename K, typename V, typename Size = uint32_t>
bool CacheMultiMap< K, V, Size >::Insert ( const K &  key,
const V &  value 
)
inline

Definition at line 87 of file cachemultimap.h.

Referenced by CGovernanceManager::ProcessVote().

◆ operator=()

template<typename K, typename V, typename Size = uint32_t>
CacheMap<K,V>& CacheMultiMap< K, V, Size >::operator= ( const CacheMap< K, V > &  other)
inline

Definition at line 187 of file cachemultimap.h.

◆ PruneLast()

template<typename K, typename V, typename Size = uint32_t>
void CacheMultiMap< K, V, Size >::PruneLast ( )
inlineprivate

Definition at line 208 of file cachemultimap.h.

Referenced by CacheMultiMap< uint256, vote_time_pair_t >::Insert().

◆ RebuildIndex()

template<typename K, typename V, typename Size = uint32_t>
void CacheMultiMap< K, V, Size >::RebuildIndex ( )
inlineprivate

◆ SerializationOp()

template<typename K, typename V, typename Size = uint32_t>
template<typename Stream , typename Operation >
void CacheMultiMap< K, V, Size >::SerializationOp ( Stream &  s,
Operation  ser_action 
)
inline

Definition at line 198 of file cachemultimap.h.

◆ SetMaxSize()

template<typename K, typename V, typename Size = uint32_t>
void CacheMultiMap< K, V, Size >::SetMaxSize ( size_type  nMaxSizeIn)
inline

Definition at line 74 of file cachemultimap.h.

Member Data Documentation

◆ ADD_SERIALIZE_METHODS

template<typename K, typename V, typename Size = uint32_t>
CacheMultiMap< K, V, Size >::ADD_SERIALIZE_METHODS

Definition at line 195 of file cachemultimap.h.

◆ listItems

◆ mapIndex

◆ nMaxSize


The documentation for this class was generated from the following file:
Released under the MIT license