CatapultServer  v0.5.0.1 (Elephant)
NamespaceCacheSubCachePlugin.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "NamespaceCache.h"
23 #include "NamespaceCacheStorage.h"
25 
26 namespace catapult { namespace cache {
27 
29  class NamespaceCacheSummaryCacheStorage : public SummaryCacheStorage<NamespaceCache> {
30  public:
32 
33  public:
34  void saveAll(const CatapultCacheView& cacheView, io::OutputStream& output) const override;
35 
36  void saveSummary(const CatapultCacheDelta& cacheDelta, io::OutputStream& output) const override;
37 
38  void loadAll(io::InputStream& input, size_t) override;
39  };
40 
43 
46  public:
49  };
50 }}
catapult::cache::NamespaceCache
Synchronized cache composed of namespace information.
Definition: NamespaceCache.h:71
catapult::io::OutputStream::flush
virtual void flush()=0
NamespaceCache.h
catapult::cache::CatapultCacheDelta::sub
const TCache::CacheDeltaType & sub() const
Gets a specific sub cache delta view.
Definition: CatapultCacheDelta.h:47
catapult::cache::CatapultCacheDelta
Delta on top of a catapult cache.
Definition: CatapultCacheDelta.h:31
NamespaceCacheSubCachePlugin.h
catapult::cache::SummaryCacheStorage
CacheStorage implementation for saving and loading summary cache data.
Definition: SummaryAwareSubCachePluginAdapter.h:28
catapult::cache::SummaryCacheStorage< NamespaceCache >::cache
const NamespaceCache & cache() const
Gets a typed const reference to the underlying cache.
Definition: SummaryAwareSubCachePluginAdapter.h:43
catapult::cache::NamespaceCacheSubCachePlugin
Specialized namespace cache sub cache plugin.
Definition: NamespaceCacheSubCachePlugin.h:45
catapult::io::InputStream
Reader interface.
Definition: Stream.h:27
catapult::cache::NamespaceCacheSummaryCacheStorage::loadAll
void loadAll(io::InputStream &input, size_t) override
Loads cache data from input in batches of batchSize.
Definition: NamespaceCacheSubCachePlugin.cpp:36
catapult::io::Write64
void Write64(TIo &output, uint64_t value)
Writes value into output.
Definition: PodIoUtils.h:36
catapult::cache::CatapultCacheView
Locked view on top of the catapult cache.
Definition: CatapultCacheView.h:36
catapult::cache::CacheConfiguration
Cache configuration.
Definition: CacheConfiguration.h:37
catapult::cache::NamespaceCacheSummaryCacheStorage
CacheStorage implementation for saving and loading summary namespace cache data.
Definition: NamespaceCacheSubCachePlugin.h:29
catapult::cache::NamespaceCacheSummaryCacheStorage::saveSummary
void saveSummary(const CatapultCacheDelta &cacheDelta, io::OutputStream &output) const override
Saves cache (summary) data from cacheDelta to output.
Definition: NamespaceCacheSubCachePlugin.cpp:29
CATAPULT_THROW_INVALID_ARGUMENT
#define CATAPULT_THROW_INVALID_ARGUMENT(MESSAGE)
Macro used to throw a catapult invalid argument.
Definition: exceptions.h:179
SummaryAwareSubCachePluginAdapter.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::io::Read64
auto Read64(TIo &input)
Reads value from input.
Definition: PodIoUtils.h:66
catapult::cache::NamespaceCacheTypes::Options
Custom sub view options.
Definition: NamespaceCacheTypes.h:87
catapult::cache::NamespaceCacheSummaryCacheStorage::saveAll
void saveAll(const CatapultCacheView &cacheView, io::OutputStream &output) const override
Saves cache data from cacheView to output.
Definition: NamespaceCacheSubCachePlugin.cpp:25
catapult::cache::NamespaceCacheSubCachePlugin::NamespaceCacheSubCachePlugin
NamespaceCacheSubCachePlugin(const CacheConfiguration &config, const NamespaceCacheTypes::Options &options)
Creates a plugin around config and options.
Definition: NamespaceCacheSubCachePlugin.cpp:42
NamespaceCacheStorage.h
catapult::io::OutputStream
Writer interface.
Definition: Stream.h:41
catapult::cache::SummaryAwareSubCachePluginAdapter
Specialized sub cache plugin adapter that provides proper handling of summary cache state.
Definition: SummaryAwareSubCachePluginAdapter.h:59
catapult::cache::SynchronizedCacheWithInit::init
void init(TArgs &&... args)
Initializes the underlying cache with args.
Definition: SynchronizedCache.h:288