libcryfs/implementations/testfake/FakeBlock.h

38 lines
819 B
C
Raw Normal View History

#pragma once
2015-10-15 13:09:21 +02:00
#ifndef MESSMER_BLOCKSTORE_IMPLEMENTATIONS_TESTFAKE_FAKEBLOCK_H_
#define MESSMER_BLOCKSTORE_IMPLEMENTATIONS_TESTFAKE_FAKEBLOCK_H_
#include "../../interface/Block.h"
#include <messmer/cpp-utils/data/Data.h>
2015-02-17 00:23:33 +01:00
#include "messmer/cpp-utils/macros.h"
namespace blockstore {
namespace testfake {
class FakeBlockStore;
class FakeBlock: public Block {
public:
FakeBlock(FakeBlockStore *store, const Key &key, std::shared_ptr<cpputils::Data> data, bool dirty);
virtual ~FakeBlock();
const void *data() const override;
void write(const void *source, uint64_t offset, uint64_t size) override;
void flush() override;
size_t size() const override;
private:
FakeBlockStore *_store;
std::shared_ptr<cpputils::Data> _data;
bool _dataChanged;
DISALLOW_COPY_AND_ASSIGN(FakeBlock);
};
}
}
#endif