2015-01-23 04:39:36 +01:00
|
|
|
#pragma once
|
2015-10-15 13:10:20 +02:00
|
|
|
#ifndef MESSMER_BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATATREESTORE_DATATREESTORE_H_
|
|
|
|
#define MESSMER_BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATATREESTORE_DATATREESTORE_H_
|
2015-01-23 04:39:36 +01:00
|
|
|
|
|
|
|
#include <memory>
|
2015-04-09 15:40:27 +02:00
|
|
|
#include <messmer/cpp-utils/macros.h>
|
2015-06-26 15:59:18 +02:00
|
|
|
#include <messmer/cpp-utils/pointer/unique_ref.h>
|
2015-04-09 20:07:21 +02:00
|
|
|
#include <messmer/blockstore/utils/Key.h>
|
2015-06-26 15:59:18 +02:00
|
|
|
#include <boost/optional.hpp>
|
2015-01-23 04:39:36 +01:00
|
|
|
|
|
|
|
namespace blobstore {
|
|
|
|
namespace onblocks {
|
|
|
|
namespace datanodestore {
|
|
|
|
class DataNodeStore;
|
|
|
|
}
|
|
|
|
namespace datatreestore {
|
|
|
|
class DataTree;
|
|
|
|
|
2015-11-27 14:06:48 +01:00
|
|
|
class DataTreeStore final {
|
2015-01-23 04:39:36 +01:00
|
|
|
public:
|
2015-06-26 15:59:18 +02:00
|
|
|
DataTreeStore(cpputils::unique_ref<datanodestore::DataNodeStore> nodeStore);
|
2015-11-27 14:06:48 +01:00
|
|
|
~DataTreeStore();
|
2015-01-23 04:39:36 +01:00
|
|
|
|
2015-06-26 15:59:18 +02:00
|
|
|
boost::optional<cpputils::unique_ref<DataTree>> load(const blockstore::Key &key);
|
2015-01-23 04:39:36 +01:00
|
|
|
|
2015-06-26 15:59:18 +02:00
|
|
|
cpputils::unique_ref<DataTree> createNewTree();
|
2015-01-23 04:39:36 +01:00
|
|
|
|
2015-06-26 15:59:18 +02:00
|
|
|
void remove(cpputils::unique_ref<DataTree> tree);
|
2015-02-24 22:44:10 +01:00
|
|
|
|
2015-01-23 04:39:36 +01:00
|
|
|
private:
|
2015-06-26 15:59:18 +02:00
|
|
|
cpputils::unique_ref<datanodestore::DataNodeStore> _nodeStore;
|
2015-01-23 04:39:36 +01:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(DataTreeStore);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|