|
TARAXA
|
#include <util.hpp>

Public Types | |
| using | UnsafeStatusTable = std::unordered_map< K, V > |
Public Member Functions | |
| StatusTable (size_t capacity=10000) | |
| std::pair< V, bool > | get (K const &hash) |
| unsigned long | size () const |
| bool | insert (K const &hash, V status) |
| void | update (K const &hash, V status) |
| bool | update (K const &hash, V status, V expected_status) |
| void | clear () |
| bool | erase (K const &hash) |
| UnsafeStatusTable | getThreadUnsafeCopy () const |
Private Types | |
| using | Element = std::list< std::pair< K, V > > |
Private Member Functions | |
| void | clearOldData () |
Private Attributes | |
| size_t | capacity_ |
| std::shared_mutex | shared_mutex_ |
| std::unordered_map< K, typename std::list< std::pair< K, V > >::iterator > | status_ |
| std::list< std::pair< K, V > > | lru_ |
simple thread_safe hash LRU
|
private |
| using taraxa::StatusTable< K, V >::UnsafeStatusTable = std::unordered_map<K, V> |
|
inline |
|
inline |
|
inlineprivate |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
|
mutableprivate |
|
private |