CatapultServer  v0.5.0.1 (Elephant)
BlockDifficultyCacheSubCachePlugin.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "BlockDifficultyCache.h"
25 
26 namespace catapult { namespace cache {
27 
29  class BlockDifficultyCacheSummaryCacheStorage : public CacheStorageAdapter<BlockDifficultyCache, BlockDifficultyCacheStorage> {
30  public:
32 
33  public:
34  void saveSummary(const CatapultCacheDelta& cacheDelta, io::OutputStream& output) const override;
35  };
36 
38  class BlockDifficultyCacheSubCachePlugin : public SubCachePluginAdapter<BlockDifficultyCache, BlockDifficultyCacheStorage> {
39  public:
41  explicit BlockDifficultyCacheSubCachePlugin(uint64_t difficultyHistorySize);
42 
43  public:
44  std::unique_ptr<CacheStorage> createStorage() override;
45  };
46 }}
catapult::io::OutputStream::flush
virtual void flush()=0
BlockDifficultyCache.h
catapult::cache::CatapultCacheDelta::sub
const TCache::CacheDeltaType & sub() const
Gets a specific sub cache delta view.
Definition: CatapultCacheDelta.h:47
catapult::cache::BlockDifficultyCacheSubCachePlugin::createStorage
std::unique_ptr< CacheStorage > createStorage() override
Returns a cache storage based on this cache.
Definition: BlockDifficultyCacheSubCachePlugin.cpp:41
catapult::cache::BlockDifficultyCacheStorage
Policy for saving and loading block difficulty cache data.
Definition: BlockDifficultyCacheStorage.h:28
catapult::cache::CatapultCacheDelta
Delta on top of a catapult cache.
Definition: CatapultCacheDelta.h:31
catapult::cache::BlockDifficultyCacheSummaryCacheStorage::saveSummary
void saveSummary(const CatapultCacheDelta &cacheDelta, io::OutputStream &output) const override
Saves cache (summary) data from cacheDelta to output.
Definition: BlockDifficultyCacheSubCachePlugin.cpp:25
catapult::cache::BlockDifficultyCacheStorage::Save
static void Save(const ValueType &info, io::OutputStream &output)
Saves info to output.
Definition: BlockDifficultyCacheStorage.cpp:27
catapult::cache::SubCachePluginAdapter< BlockDifficultyCache, BlockDifficultyCacheStorage >::cache
BlockDifficultyCache & cache()
Gets a typed reference to the underlying cache.
Definition: SubCachePluginAdapter.h:91
catapult::cache::CacheStorageAdapter
A CacheStorage implementation that wraps a cache and associated storage traits.
Definition: CacheStorageAdapter.h:31
catapult::cache::BlockDifficultyCacheSummaryCacheStorage
CacheStorage implementation for saving and loading summary block difficulty cache data.
Definition: BlockDifficultyCacheSubCachePlugin.h:29
SubCachePluginAdapter.h
catapult::cache::BlockDifficultyCacheSubCachePlugin
Specialized block difficulty cache sub cache plugin.
Definition: BlockDifficultyCacheSubCachePlugin.h:38
catapult::io::Write64
void Write64(TIo &output, uint64_t value)
Writes value into output.
Definition: PodIoUtils.h:36
BlockDifficultyCacheStorage.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::cache::BlockDifficultyCacheSubCachePlugin::BlockDifficultyCacheSubCachePlugin
BlockDifficultyCacheSubCachePlugin(uint64_t difficultyHistorySize)
Creates a plugin around difficultyHistorySize.
Definition: BlockDifficultyCacheSubCachePlugin.cpp:36
catapult::cache::BlockDifficultyCache
Synchronized cache composed of block difficulty information.
Definition: BlockDifficultyCache.h:45
catapult::io::OutputStream
Writer interface.
Definition: Stream.h:41
catapult::cache::SubCachePluginAdapter
A SubCachePlugin implementation that wraps a SynchronizedCache.
Definition: SubCachePluginAdapter.h:32
BlockDifficultyCacheSubCachePlugin.h