libcryfs/implementations/caching2/Caching2BlockStore.h
Sebastian Messmer fdc14cc66c TODOs
2015-04-15 20:43:21 +02:00

34 lines
835 B
C++

#pragma once
#ifndef BLOCKSTORE_IMPLEMENTATIONS_CACHING2_CACHINGBLOCKSTORE_H_
#define BLOCKSTORE_IMPLEMENTATIONS_CACHING2_CACHINGBLOCKSTORE_H_
#include "../../interface/BlockStore.h"
#include "Cache.h"
namespace blockstore {
namespace caching2 {
//TODO Rename this to CachingBlockStore and the other one to something else
class Caching2BlockStore: public BlockStore {
public:
Caching2BlockStore(std::unique_ptr<BlockStore> baseBlockStore);
std::unique_ptr<Block> create(size_t size) override;
std::unique_ptr<Block> load(const Key &key) override;
void remove(std::unique_ptr<Block> block) override;
uint64_t numBlocks() const override;
void release(std::unique_ptr<Block> block);
private:
std::unique_ptr<BlockStore> _baseBlockStore;
Cache _cache;
DISALLOW_COPY_AND_ASSIGN(Caching2BlockStore);
};
}
}
#endif