libcryfs/implementations/onblocks/BlobStoreOnBlocks.cpp

40 lines
973 B
C++
Raw Normal View History

2015-02-17 00:40:34 +01:00
#include "datanodestore/DataLeafNode.h"
#include "datanodestore/DataNodeStore.h"
#include "datatreestore/DataTreeStore.h"
#include "datatreestore/DataTree.h"
2014-12-09 17:56:48 +01:00
#include "BlobStoreOnBlocks.h"
#include "BlobOnBlocks.h"
using std::unique_ptr;
using std::make_unique;
using blockstore::BlockStore;
using blockstore::Key;
namespace blobstore {
namespace onblocks {
using datanodestore::DataNodeStore;
using datatreestore::DataTreeStore;
constexpr size_t BlobStoreOnBlocks::BLOCKSIZE_BYTES;
2014-12-09 17:56:48 +01:00
BlobStoreOnBlocks::BlobStoreOnBlocks(unique_ptr<BlockStore> blockStore)
: _dataTreeStore(make_unique<DataTreeStore>(make_unique<DataNodeStore>(std::move(blockStore), BLOCKSIZE_BYTES))) {
}
BlobStoreOnBlocks::~BlobStoreOnBlocks() {
}
unique_ptr<Blob> BlobStoreOnBlocks::create() {
return make_unique<BlobOnBlocks>(_dataTreeStore->createNewTree());
2014-12-09 17:56:48 +01:00
}
unique_ptr<Blob> BlobStoreOnBlocks::load(const Key &key) {
return make_unique<BlobOnBlocks>(_dataTreeStore->load(key));
2014-12-09 17:56:48 +01:00
}
}
}