veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
altintegration::EthashCache Struct Referenceabstract

Detailed Description

Definition at line 13 of file ethash_cache_provider.hpp.

+ Inheritance diagram for altintegration::EthashCache:
+ Collaboration diagram for altintegration::EthashCache:

Public Member Functions

virtual bool get (uint64_t epoch, std::shared_ptr< CacheEntry > out) const =0
 
virtual void insert (uint64_t epoch, std::shared_ptr< CacheEntry > value)=0
 
std::shared_ptr< CacheEntrygetOrDefault (uint64_t epoch, std::function< std::shared_ptr< CacheEntry >()> factory) override
 
void clear () override
 
virtual std::shared_ptr< CacheEntrygetOrDefault (uint64_t epoch, std::function< std::shared_ptr< CacheEntry >()> factory)=0
 
virtual void clear ()=0
 

Member Function Documentation

◆ clear()

void altintegration::EthashCache::clear ( )
inlineoverridevirtual

Implements altintegration::EthashCacheI.

Definition at line 34 of file ethash_cache_provider.hpp.

34{}

◆ getOrDefault()

std::shared_ptr< CacheEntry > altintegration::EthashCache::getOrDefault ( uint64_t  epoch,
std::function< std::shared_ptr< CacheEntry >()>  factory 
)
inlineoverridevirtual

Implements altintegration::EthashCacheI.

Definition at line 22 of file ethash_cache_provider.hpp.

24 {
25 std::shared_ptr<CacheEntry> value;
26 if (!get(epoch, value)) {
27 value = factory();
28 insert(epoch, value);
29 }
30
31 return value;
32 }

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