2015-02-17 00:23:33 +01:00
|
|
|
#include <messmer/blockstore/interface/BlockStore.h>
|
|
|
|
#include <messmer/blockstore/utils/BlockStoreUtils.h>
|
2015-01-24 01:24:37 +01:00
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
using std::unique_ptr;
|
|
|
|
|
|
|
|
namespace blockstore {
|
|
|
|
namespace utils {
|
|
|
|
|
2015-01-24 22:27:14 +01:00
|
|
|
unique_ptr<Block> copyToNewBlock(BlockStore *blockStore, const Block &block) {
|
2015-01-24 01:24:37 +01:00
|
|
|
auto newBlock = blockStore->create(block.size());
|
2015-01-24 22:27:14 +01:00
|
|
|
std::memcpy(newBlock->data(), block.data(), block.size());
|
2015-01-24 01:24:37 +01:00
|
|
|
return newBlock;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|