#pragma once #ifndef BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATANODESTORE_DATANODESTORE_H_ #define BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATANODESTORE_DATANODESTORE_H_ #include #include "messmer/cpp-utils/macros.h" namespace blockstore{ class Block; class BlockStore; class Key; } namespace blobstore { namespace onblocks { namespace datanodestore { class DataNode; class DataLeafNode; class DataInnerNode; class DataNodeStore { public: DataNodeStore(std::unique_ptr blockstore); virtual ~DataNodeStore(); static constexpr uint8_t MAX_DEPTH = 10; std::unique_ptr load(const blockstore::Key &key); std::unique_ptr createNewLeafNode(); std::unique_ptr createNewInnerNode(const DataNode &first_child); std::unique_ptr createNewNodeAsCopyFrom(const DataNode &source); private: std::unique_ptr load(std::unique_ptr block); std::unique_ptr _blockstore; DISALLOW_COPY_AND_ASSIGN(DataNodeStore); }; } } } #endif