Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
STL-like map container that only keeps the N elements with the highest value. More...
#include <limitedmap.h>
Public Types | |
typedef K | key_type |
typedef V | mapped_type |
typedef std::pair< const key_type, mapped_type > | value_type |
typedef std::unordered_map< K, V, Hash >::const_iterator | const_iterator |
typedef std::unordered_map< K, V, Hash >::size_type | size_type |
Public Member Functions | |
unordered_limitedmap (size_type nMaxSizeIn, size_type nPruneAfterSizeIn=0) | |
const_iterator | begin () const |
const_iterator | end () const |
size_type | size () const |
bool | empty () const |
const_iterator | find (const key_type &k) const |
size_type | count (const key_type &k) const |
void | insert (const value_type &x) |
void | insert_or_update (const value_type &x) |
void | erase (const key_type &k) |
void | update (const_iterator itIn, const mapped_type &v) |
size_type | max_size () const |
size_type | max_size (size_type nMaxSizeIn, size_type nPruneAfterSizeIn=0) |
void | prune () |
Protected Types | |
typedef std::unordered_map< K, V, Hash >::iterator | iterator |
Protected Attributes | |
std::unordered_map< K, V, Hash > | map |
size_type | nMaxSize |
size_type | nPruneAfterSize |
Detailed Description
template<typename K, typename V, typename Hash = std::hash<K>>
class unordered_limitedmap< K, V, Hash >
STL-like map container that only keeps the N elements with the highest value.
Definition at line 18 of file limitedmap.h.
Member Typedef Documentation
◆ const_iterator
typedef std::unordered_map<K, V, Hash>::const_iterator unordered_limitedmap< K, V, Hash >::const_iterator |
Definition at line 24 of file limitedmap.h.
◆ iterator
|
protected |
Definition at line 29 of file limitedmap.h.
◆ key_type
typedef K unordered_limitedmap< K, V, Hash >::key_type |
Definition at line 21 of file limitedmap.h.
◆ mapped_type
typedef V unordered_limitedmap< K, V, Hash >::mapped_type |
Definition at line 22 of file limitedmap.h.
◆ size_type
typedef std::unordered_map<K, V, Hash>::size_type unordered_limitedmap< K, V, Hash >::size_type |
Definition at line 25 of file limitedmap.h.
◆ value_type
typedef std::pair<const key_type, mapped_type> unordered_limitedmap< K, V, Hash >::value_type |
Definition at line 23 of file limitedmap.h.
Constructor & Destructor Documentation
◆ unordered_limitedmap()
|
inlineexplicit |
Definition at line 34 of file limitedmap.h.
Member Function Documentation
◆ begin()
|
inline |
Definition at line 45 of file limitedmap.h.
◆ count()
|
inline |
Definition at line 50 of file limitedmap.h.
◆ empty()
|
inline |
Definition at line 48 of file limitedmap.h.
◆ end()
|
inline |
Definition at line 46 of file limitedmap.h.
Referenced by CBlockTreeDB::HasTxIndex().
◆ erase()
|
inline |
Definition at line 65 of file limitedmap.h.
◆ find()
|
inline |
Definition at line 49 of file limitedmap.h.
Referenced by CBlockTreeDB::HasTxIndex().
◆ insert()
|
inline |
Definition at line 51 of file limitedmap.h.
Referenced by CBlockTreeDB::HasTxIndex().
◆ insert_or_update()
|
inline |
Definition at line 57 of file limitedmap.h.
Referenced by CBlockTreeDB::ReadTxIndex(), and CBlockTreeDB::WriteTxIndex().
◆ max_size() [1/2]
|
inline |
Definition at line 79 of file limitedmap.h.
◆ max_size() [2/2]
|
inline |
Definition at line 80 of file limitedmap.h.
◆ prune()
|
inline |
Definition at line 93 of file limitedmap.h.
Referenced by unordered_limitedmap< uint256, bool >::insert(), unordered_limitedmap< uint256, bool >::insert_or_update(), and unordered_limitedmap< uint256, bool >::max_size().
◆ size()
|
inline |
Definition at line 47 of file limitedmap.h.
◆ update()
|
inline |
Definition at line 69 of file limitedmap.h.
Member Data Documentation
◆ map
|
protected |
Definition at line 28 of file limitedmap.h.
Referenced by unordered_limitedmap< uint256, bool >::begin(), unordered_limitedmap< uint256, bool >::count(), unordered_limitedmap< uint256, bool >::empty(), unordered_limitedmap< uint256, bool >::end(), unordered_limitedmap< uint256, bool >::erase(), unordered_limitedmap< uint256, bool >::find(), unordered_limitedmap< uint256, bool >::insert(), unordered_limitedmap< uint256, bool >::insert_or_update(), unordered_limitedmap< uint256, bool >::prune(), unordered_limitedmap< uint256, bool >::size(), and unordered_limitedmap< uint256, bool >::update().
◆ nMaxSize
|
protected |
Definition at line 30 of file limitedmap.h.
Referenced by unordered_limitedmap< uint256, bool >::max_size(), unordered_limitedmap< uint256, bool >::prune(), and unordered_limitedmap< uint256, bool >::unordered_limitedmap().
◆ nPruneAfterSize
|
protected |
Definition at line 31 of file limitedmap.h.
Referenced by unordered_limitedmap< uint256, bool >::max_size(), unordered_limitedmap< uint256, bool >::prune(), and unordered_limitedmap< uint256, bool >::unordered_limitedmap().
The documentation for this class was generated from the following file:
- src/limitedmap.h