#pragma once #ifndef BLOCKSTORE_IMPLEMENTATIONS_CACHING_CACHINGBLOCKSTORE_H_ #define BLOCKSTORE_IMPLEMENTATIONS_CACHING_CACHINGBLOCKSTORE_H_ #include #include "../../interface/BlockStore.h" #include "CachedBlockRef.h" namespace blockstore { namespace caching { //TODO Check that this blockstore allows parallel destructing of blocks (otherwise we won't encrypt blocks in parallel) class CachingBlockStore: public BlockStore { public: CachingBlockStore(std::unique_ptr baseBlockStore); std::unique_ptr create(size_t size) override; std::unique_ptr load(const Key &key) override; void remove(std::unique_ptr block) override; uint64_t numBlocks() const override; private: std::unique_ptr _baseBlockStore; cachingstore::CachingStore _cachingStore; DISALLOW_COPY_AND_ASSIGN(CachingBlockStore); }; } } #endif