#include "DataTreeStore.h" #include "../datanodestore/DataNodeStore.h" #include "../datanodestore/DataLeafNode.h" #include "DataTree.h" using std::unique_ptr; using std::make_unique; using blobstore::onblocks::datanodestore::DataNodeStore; using blobstore::onblocks::datanodestore::DataNode; namespace blobstore { namespace onblocks { namespace datatreestore { DataTreeStore::DataTreeStore(unique_ptr nodeStore) : _nodeStore(std::move(nodeStore)) { } DataTreeStore::~DataTreeStore() { } unique_ptr DataTreeStore::load(const blockstore::Key &key) { return make_unique(_nodeStore.get(), _nodeStore->load(key)); } unique_ptr DataTreeStore::createNewTree() { unique_ptr newleaf = _nodeStore->createNewLeafNode(); return make_unique(_nodeStore.get(), std::move(newleaf)); } } } }