CatapultServer  v0.5.0.1 (Elephant)
CacheChangesStorage.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "CacheChanges.h"
23 
24 namespace catapult {
25  namespace io {
26  class InputStream;
27  class OutputStream;
28  }
29 }
30 
31 namespace catapult { namespace cache {
32 
35  public:
36  virtual ~CacheChangesStorage() = default;
37 
38  public:
40  virtual void saveAll(const CacheChanges& changes, io::OutputStream& output) const = 0;
41 
43  virtual std::unique_ptr<const MemoryCacheChanges> loadAll(io::InputStream& input) const = 0;
44 
46  virtual void apply(const CacheChanges& changes) const = 0;
47  };
48 }}
catapult::cache::CacheChangesStorage
Interface for loading and saving cache changes.
Definition: CacheChangesStorage.h:34
catapult::cache::CacheChanges
Provides common view of aggregate cache changes.
Definition: CacheChanges.h:111
catapult::io::InputStream
Reader interface.
Definition: Stream.h:27
catapult::cache::CacheChangesStorage::saveAll
virtual void saveAll(const CacheChanges &changes, io::OutputStream &output) const =0
Saves cache changes to output.
catapult::cache::CacheChangesStorage::apply
virtual void apply(const CacheChanges &changes) const =0
Applies cache changes to the underlying cache.
catapult::cache::CacheChangesStorage::~CacheChangesStorage
virtual ~CacheChangesStorage()=default
CacheChanges.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::io::OutputStream
Writer interface.
Definition: Stream.h:41
catapult::cache::CacheChangesStorage::loadAll
virtual std::unique_ptr< const MemoryCacheChanges > loadAll(io::InputStream &input) const =0
Loads cache changes from input.