CatapultServer  v0.5.0.1 (Elephant)
CacheStorage.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "CacheStorageInclude.h"
23 #include <string>
24 
25 namespace catapult {
26  namespace cache {
27  class CatapultCacheDelta;
28  class CatapultCacheView;
29  }
30 }
31 
32 namespace catapult { namespace cache {
33 
35  class CacheStorage {
36  public:
37  virtual ~CacheStorage() = default;
38 
39  public:
41  virtual const std::string& name() const = 0;
42 
43  public:
45  virtual void saveAll(const CatapultCacheView& cacheView, io::OutputStream& output) const = 0;
46 
48  virtual void saveSummary(const CatapultCacheDelta& cacheDelta, io::OutputStream& output) const = 0;
49 
51  virtual void loadAll(io::InputStream& input, size_t batchSize) = 0;
52  };
53 }}
CacheStorageInclude.h
catapult::cache::CatapultCacheDelta
Delta on top of a catapult cache.
Definition: CatapultCacheDelta.h:31
catapult::cache::CacheStorage::saveAll
virtual void saveAll(const CatapultCacheView &cacheView, io::OutputStream &output) const =0
Saves cache data from cacheView to output.
catapult::io::InputStream
Reader interface.
Definition: Stream.h:27
catapult::cache::CacheStorage
Interface for loading and saving cache data.
Definition: CacheStorage.h:35
catapult::cache::CacheStorage::saveSummary
virtual void saveSummary(const CatapultCacheDelta &cacheDelta, io::OutputStream &output) const =0
Saves cache (summary) data from cacheDelta to output.
catapult::cache::CatapultCacheView
Locked view on top of the catapult cache.
Definition: CatapultCacheView.h:36
catapult::cache::CacheStorage::loadAll
virtual void loadAll(io::InputStream &input, size_t batchSize)=0
Loads cache data from input in batches of batchSize.
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::cache::CacheStorage::name
virtual const std::string & name() const =0
Gets the cache name.
catapult::io::OutputStream
Writer interface.
Definition: Stream.h:41
catapult::cache::CacheStorage::~CacheStorage
virtual ~CacheStorage()=default