2015-04-16 13:59:52 +02:00
|
|
|
#ifndef MESSMER_BLOCKSTORE_IMPLEMENTATIONS_PARALLELACCESS_PARALLELACCESSBLOCKSTOREADAPTER_H_
|
|
|
|
#define MESSMER_BLOCKSTORE_IMPLEMENTATIONS_PARALLELACCESS_PARALLELACCESSBLOCKSTOREADAPTER_H_
|
2015-04-02 18:19:05 +02:00
|
|
|
|
|
|
|
#include <messmer/cpp-utils/macros.h>
|
|
|
|
#include <messmer/cachingstore/CachingStore.h>
|
|
|
|
#include "../../interface/BlockStore.h"
|
|
|
|
|
|
|
|
namespace blockstore {
|
2015-04-16 13:59:52 +02:00
|
|
|
namespace parallelaccess {
|
2015-04-02 18:19:05 +02:00
|
|
|
|
2015-04-16 13:59:52 +02:00
|
|
|
class ParallelAccessBlockStoreAdapter: public cachingstore::CachingBaseStore<Block, Key> {
|
2015-04-02 18:19:05 +02:00
|
|
|
public:
|
2015-04-16 13:59:52 +02:00
|
|
|
ParallelAccessBlockStoreAdapter(BlockStore *baseBlockStore)
|
2015-04-02 18:19:05 +02:00
|
|
|
:_baseBlockStore(std::move(baseBlockStore)) {
|
|
|
|
}
|
|
|
|
|
|
|
|
std::unique_ptr<Block> loadFromBaseStore(const Key &key) override {
|
|
|
|
return _baseBlockStore->load(key);
|
|
|
|
}
|
|
|
|
|
|
|
|
void removeFromBaseStore(std::unique_ptr<Block> block) override {
|
|
|
|
return _baseBlockStore->remove(std::move(block));
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
BlockStore *_baseBlockStore;
|
|
|
|
|
2015-04-16 13:59:52 +02:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(ParallelAccessBlockStoreAdapter);
|
2015-04-02 18:19:05 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|