#pragma once #ifndef BLOCKSTORE_IMPLEMENTATIONS_CACHING2_CACHINGBLOCKSTORE_H_ #define BLOCKSTORE_IMPLEMENTATIONS_CACHING2_CACHINGBLOCKSTORE_H_ #include "../../interface/BlockStore.h" #include "CacheEntry.h" namespace blockstore { namespace caching2 { class Caching2BlockStore: public BlockStore { public: Caching2BlockStore(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; std::map _cachedBlocks; DISALLOW_COPY_AND_ASSIGN(Caching2BlockStore); }; } } #endif