libcryfs/implementations/onblocks/datatreestore/DataTreeStore.h

41 lines
953 B
C
Raw Normal View History

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>
#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;
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);
~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-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