2014-12-09 17:19:59 +01:00
|
|
|
#pragma once
|
|
|
|
#ifndef BLOCKSTORE_IMPLEMENTATIONS_INMEMORY_INMEMORYBLOCK_H_
|
|
|
|
#define BLOCKSTORE_IMPLEMENTATIONS_INMEMORY_INMEMORYBLOCK_H_
|
|
|
|
|
2015-02-17 00:23:33 +01:00
|
|
|
#include <messmer/blockstore/interface/Block.h>
|
|
|
|
#include <messmer/blockstore/utils/Data.h>
|
2014-12-09 17:19:59 +01:00
|
|
|
|
|
|
|
namespace blockstore {
|
|
|
|
namespace inmemory {
|
|
|
|
class InMemoryBlockStore;
|
|
|
|
|
|
|
|
class InMemoryBlock: public Block {
|
|
|
|
public:
|
2015-01-24 22:08:41 +01:00
|
|
|
InMemoryBlock(const Key &key, size_t size);
|
2014-12-09 17:19:59 +01:00
|
|
|
InMemoryBlock(const InMemoryBlock &rhs);
|
|
|
|
virtual ~InMemoryBlock();
|
|
|
|
|
|
|
|
void *data() override;
|
|
|
|
const void *data() const override;
|
|
|
|
|
|
|
|
void flush() override;
|
|
|
|
|
|
|
|
size_t size() const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::shared_ptr<Data> _data;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|