2014-12-09 18:53:11 +01:00
|
|
|
#pragma once
|
2014-12-13 17:48:02 +01:00
|
|
|
#ifndef BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATANODESTORE_DATANODE_H_
|
|
|
|
#define BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATANODESTORE_DATANODE_H_
|
2014-12-09 18:53:11 +01:00
|
|
|
|
2015-01-22 23:37:03 +01:00
|
|
|
#include "DataNodeView.h"
|
2015-04-25 02:55:34 +02:00
|
|
|
#include <messmer/cpp-utils/data/Data.h>
|
2014-12-09 18:53:11 +01:00
|
|
|
|
|
|
|
namespace blobstore {
|
|
|
|
namespace onblocks {
|
2014-12-13 19:17:08 +01:00
|
|
|
namespace datanodestore {
|
2014-12-13 17:43:02 +01:00
|
|
|
class DataNodeStore;
|
2015-01-24 00:54:27 +01:00
|
|
|
class DataInnerNode;
|
2014-12-09 18:53:11 +01:00
|
|
|
|
|
|
|
class DataNode {
|
|
|
|
public:
|
|
|
|
virtual ~DataNode();
|
|
|
|
|
2014-12-13 19:17:08 +01:00
|
|
|
const blockstore::Key &key() const;
|
2014-12-13 17:43:02 +01:00
|
|
|
|
|
|
|
uint8_t depth() const;
|
2014-12-09 18:53:11 +01:00
|
|
|
|
2015-01-24 00:54:27 +01:00
|
|
|
static std::unique_ptr<DataInnerNode> convertToNewInnerNode(std::unique_ptr<DataNode> node, const DataNode &first_child);
|
|
|
|
|
2015-01-28 01:02:32 +01:00
|
|
|
void flush() const;
|
|
|
|
|
2014-12-09 18:53:11 +01:00
|
|
|
protected:
|
2015-01-24 22:27:14 +01:00
|
|
|
DataNode(DataNodeView block);
|
2014-12-09 18:53:11 +01:00
|
|
|
|
2014-12-13 17:43:02 +01:00
|
|
|
DataNodeView &node();
|
|
|
|
const DataNodeView &node() const;
|
2015-01-24 01:59:42 +01:00
|
|
|
friend class DataNodeStore;
|
2014-12-13 17:43:02 +01:00
|
|
|
|
|
|
|
private:
|
2014-12-10 16:48:00 +01:00
|
|
|
DataNodeView _node;
|
2014-12-13 17:43:02 +01:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(DataNode);
|
2014-12-09 18:53:11 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2014-12-13 19:17:08 +01:00
|
|
|
}
|
2014-12-09 18:53:11 +01:00
|
|
|
|
2014-12-10 16:48:00 +01:00
|
|
|
|
2014-12-09 18:53:11 +01:00
|
|
|
#endif
|