libcryfs/implementations/parallelaccess/ParallelAccessBlockStore.h

35 lines
1.2 KiB
C
Raw Normal View History

#pragma once
2015-10-15 13:09:21 +02:00
#ifndef MESSMER_BLOCKSTORE_IMPLEMENTATIONS_PARALLELACCESS_PARALLELACCESSBLOCKSTORE_H_
#define MESSMER_BLOCKSTORE_IMPLEMENTATIONS_PARALLELACCESS_PARALLELACCESSBLOCKSTORE_H_
#include <messmer/parallelaccessstore/ParallelAccessStore.h>
#include "BlockRef.h"
#include "../../interface/BlockStore.h"
#include <messmer/cpp-utils/pointer/unique_ref.h>
namespace blockstore {
namespace parallelaccess {
2015-04-15 21:46:15 +02:00
//TODO Check that this blockstore allows parallel destructing of blocks (otherwise we won't encrypt blocks in parallel)
class ParallelAccessBlockStore: public BlockStore {
public:
explicit ParallelAccessBlockStore(cpputils::unique_ref<BlockStore> baseBlockStore);
Key createKey() override;
boost::optional<cpputils::unique_ref<Block>> tryCreate(const Key &key, cpputils::Data data) override;
boost::optional<cpputils::unique_ref<Block>> load(const Key &key) override;
void remove(cpputils::unique_ref<Block> block) override;
uint64_t numBlocks() const override;
private:
cpputils::unique_ref<BlockStore> _baseBlockStore;
2015-04-16 15:01:59 +02:00
parallelaccessstore::ParallelAccessStore<Block, BlockRef, Key> _parallelAccessStore;
DISALLOW_COPY_AND_ASSIGN(ParallelAccessBlockStore);
};
}
}
#endif