#ifndef MESSMER_BLOCKSTORE_TEST_IMPLEMENTATIONS_SYNCHRONIZED_OPENBLOCKLIST_H_ #define MESSMER_BLOCKSTORE_TEST_IMPLEMENTATIONS_SYNCHRONIZED_OPENBLOCKLIST_H_ #include #include #include #include #include "../../utils/Key.h" #include namespace blockstore { class Block; namespace synchronized { class OpenBlockList { public: OpenBlockList(); virtual ~OpenBlockList(); std::unique_ptr insert(std::unique_ptr block); std::unique_ptr acquire(const Key &key, std::function ()> loader); void release(std::unique_ptr block); private: std::set _openBlocks; std::map>> _wantedBlocks; std::future> _addPromiseForBlock(const Key &key); }; } } #endif