TARAXA
|
#include <cache.hpp>
Public Types | |
using | GetterFn = std::function< Value(uint64_t)> |
using | DataMap = std::map< uint64_t, Value > |
Public Member Functions | |
ValueByBlockCache (const ValueByBlockCache &)=delete | |
ValueByBlockCache (ValueByBlockCache &&)=delete | |
ValueByBlockCache & | operator= (const ValueByBlockCache &)=delete |
ValueByBlockCache & | operator= (ValueByBlockCache &&)=delete |
ValueByBlockCache (uint64_t blocks_to_save, GetterFn &&getter_fn) | |
void | append (uint64_t block_num, Value value) const |
Value | get (uint64_t block_num) const |
Value | last () const |
uint64_t | lastBlockNum () const |
Protected Attributes | |
const uint64_t | kBlocksToKeep |
GetterFn | getter_fn_ |
std::shared_mutex | mutex_ |
DataMap | data_by_block_ |
using taraxa::ValueByBlockCache< Value >::DataMap = std::map<uint64_t, Value> |
using taraxa::ValueByBlockCache< Value >::GetterFn = std::function<Value(uint64_t)> |
|
delete |
|
delete |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
delete |
|
delete |
|
mutableprotected |
|
protected |
|
protected |
|
mutableprotected |