libcryfs/interface/BlockStore.h

27 lines
595 B
C
Raw Normal View History

2014-12-09 17:19:59 +01:00
#pragma once
#ifndef FSPP_BLOCKSTORE_BLOCKSTORE_H_
#define FSPP_BLOCKSTORE_BLOCKSTORE_H_
2015-02-17 00:23:33 +01:00
#include <messmer/blockstore/interface/Block.h>
2014-12-09 17:19:59 +01:00
#include <string>
#include <memory>
namespace blockstore {
class BlockStore {
public:
virtual ~BlockStore() {}
virtual std::unique_ptr<Block> create(size_t size) = 0;
2014-12-09 17:19:59 +01:00
//TODO Use boost::optional (if key doesn't exist)
// Return nullptr if block with this key doesn't exists
virtual std::unique_ptr<Block> load(const Key &key) = 0;
virtual void remove(std::unique_ptr<Block> block) = 0;
2015-02-23 21:07:07 +01:00
virtual uint64_t numBlocks() const = 0;
2014-12-09 17:19:59 +01:00
};
}
#endif