2014-12-09 18:53:11 +01:00
|
|
|
#pragma once
|
2014-12-13 17:48:02 +01:00
|
|
|
#ifndef BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATANODESTORE_DATAINNERNODE_H_
|
|
|
|
#define BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_DATANODESTORE_DATAINNERNODE_H_
|
2014-12-09 18:53:11 +01:00
|
|
|
|
2015-01-22 23:37:03 +01:00
|
|
|
#include "DataNode.h"
|
2015-02-25 22:30:48 +01:00
|
|
|
#include "DataInnerNode_ChildEntry.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-09 18:53:11 +01:00
|
|
|
|
|
|
|
class DataInnerNode: public DataNode {
|
|
|
|
public:
|
2015-02-20 19:46:52 +01:00
|
|
|
static std::unique_ptr<DataInnerNode> InitializeNewNode(std::unique_ptr<blockstore::Block> block, const DataNode &first_child_key);
|
|
|
|
|
2015-01-24 22:27:14 +01:00
|
|
|
DataInnerNode(DataNodeView block);
|
2014-12-09 18:53:11 +01:00
|
|
|
virtual ~DataInnerNode();
|
|
|
|
|
2015-02-25 22:30:48 +01:00
|
|
|
using ChildEntry = DataInnerNode_ChildEntry;
|
|
|
|
|
|
|
|
uint32_t maxStoreableChildren() const;
|
2014-12-10 23:34:36 +01:00
|
|
|
|
2015-02-20 19:46:52 +01:00
|
|
|
uint8_t depth() const;
|
2014-12-10 23:34:36 +01:00
|
|
|
|
2015-01-23 02:41:55 +01:00
|
|
|
ChildEntry *getChild(unsigned int index);
|
|
|
|
const ChildEntry *getChild(unsigned int index) const;
|
|
|
|
|
2014-12-13 17:43:02 +01:00
|
|
|
uint32_t numChildren() const;
|
2015-01-23 02:41:55 +01:00
|
|
|
|
|
|
|
void addChild(const DataNode &child_key);
|
2015-01-23 03:05:55 +01:00
|
|
|
|
2015-02-22 19:30:42 +01:00
|
|
|
void removeLastChild();
|
|
|
|
|
2015-01-23 03:05:55 +01:00
|
|
|
ChildEntry *LastChild();
|
|
|
|
const ChildEntry *LastChild() const;
|
|
|
|
|
2015-01-23 04:39:36 +01:00
|
|
|
private:
|
|
|
|
|
2015-01-23 03:05:55 +01:00
|
|
|
ChildEntry *ChildrenBegin();
|
|
|
|
ChildEntry *ChildrenEnd();
|
|
|
|
const ChildEntry *ChildrenBegin() const;
|
|
|
|
const ChildEntry *ChildrenEnd() const;
|
2014-12-09 18:53:11 +01:00
|
|
|
};
|
|
|
|
|
2014-12-13 19:17:08 +01:00
|
|
|
}
|
2014-12-09 18:53:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|