#pragma once #ifndef BLOCKSTORE_IMPLEMENTATIONS_INMEMORY_INMEMORYBLOCKSTORE_H_ #define BLOCKSTORE_IMPLEMENTATIONS_INMEMORY_INMEMORYBLOCKSTORE_H_ #include "../../interface/helpers/BlockStoreWithRandomKeys.h" #include #include #include namespace blockstore { namespace inmemory { class InMemoryBlock; class InMemoryBlockStore: public BlockStoreWithRandomKeys { public: InMemoryBlockStore(); std::unique_ptr tryCreate(const Key &key, Data data) override; std::unique_ptr load(const Key &key) override; void remove(std::unique_ptr block) override; uint64_t numBlocks() const override; private: std::map _blocks; DISALLOW_COPY_AND_ASSIGN(InMemoryBlockStore); }; } } #endif