libcryfs/implementations/inmemory/InMemoryBlock.h

33 lines
708 B
C
Raw Normal View History

2014-12-09 17:19:59 +01:00
#pragma once
2015-10-15 13:09:21 +02:00
#ifndef MESSMER_BLOCKSTORE_IMPLEMENTATIONS_INMEMORY_INMEMORYBLOCK_H_
#define MESSMER_BLOCKSTORE_IMPLEMENTATIONS_INMEMORY_INMEMORYBLOCK_H_
2014-12-09 17:19:59 +01:00
#include "../../interface/Block.h"
#include <messmer/cpp-utils/data/Data.h>
2014-12-09 17:19:59 +01:00
namespace blockstore {
namespace inmemory {
class InMemoryBlockStore;
class InMemoryBlock: public Block {
public:
InMemoryBlock(const Key &key, cpputils::Data size);
2014-12-09 17:19:59 +01:00
InMemoryBlock(const InMemoryBlock &rhs);
virtual ~InMemoryBlock();
const void *data() const override;
void write(const void *source, uint64_t offset, uint64_t size) override;
2014-12-09 17:19:59 +01:00
void flush() override;
size_t size() const override;
private:
std::shared_ptr<cpputils::Data> _data;
2014-12-09 17:19:59 +01:00
};
}
}
#endif