CatapultServer
v0.5.0.1 (Elephant)
|
Represents a path in a tree. More...
Public Member Functions | |
TreeNodePath () | |
Creates a default path. More... | |
template<typename TKey > | |
TreeNodePath (TKey key) | |
Creates a path from key. More... | |
bool | empty () const |
Returns true if this path is empty. More... | |
size_t | size () const |
Gets the number of nibbles in this path. More... | |
uint8_t | nibbleAt (size_t index) const |
Gets the nibble at index. More... | |
bool | operator== (const TreeNodePath &rhs) const |
Returns true if this path is equal to rhs. More... | |
bool | operator!= (const TreeNodePath &rhs) const |
Returns true if this path is not equal to rhs. More... | |
TreeNodePath | subpath (size_t offset) const |
Creates a subpath starting at nibble offset. More... | |
TreeNodePath | subpath (size_t offset, size_t size) const |
Creates a subpath starting at nibble offset composed of size nibbles. More... | |
Static Public Member Functions | |
static TreeNodePath | Join (const TreeNodePath &lhs, const TreeNodePath &rhs) |
Joins lhs and rhs into a new path. More... | |
static TreeNodePath | Join (const TreeNodePath &lhs, uint8_t nibble, const TreeNodePath &rhs) |
Joins lhs, nibble and rhs into a new path. More... | |
Private Member Functions | |
TreeNodePath (const std::vector< uint8_t > &path, size_t offset, size_t size) | |
Private Attributes | |
size_t | m_size |
size_t | m_adjustment |
std::vector< uint8_t > | m_path |
Represents a path in a tree.
catapult::tree::TreeNodePath::TreeNodePath | ( | ) |
Creates a default path.
|
inlineexplicit |
Creates a path from key.
|
private |
bool catapult::tree::TreeNodePath::empty | ( | ) | const |
Returns true
if this path is empty.
|
static |
Joins lhs and rhs into a new path.
|
static |
Joins lhs, nibble and rhs into a new path.
uint8_t catapult::tree::TreeNodePath::nibbleAt | ( | size_t | index | ) | const |
Gets the nibble at index.
bool catapult::tree::TreeNodePath::operator!= | ( | const TreeNodePath & | rhs | ) | const |
Returns true
if this path is not equal to rhs.
bool catapult::tree::TreeNodePath::operator== | ( | const TreeNodePath & | rhs | ) | const |
Returns true
if this path is equal to rhs.
size_t catapult::tree::TreeNodePath::size | ( | ) | const |
Gets the number of nibbles in this path.
TreeNodePath catapult::tree::TreeNodePath::subpath | ( | size_t | offset | ) | const |
Creates a subpath starting at nibble offset.
TreeNodePath catapult::tree::TreeNodePath::subpath | ( | size_t | offset, |
size_t | size | ||
) | const |
Creates a subpath starting at nibble offset composed of size nibbles.
|
private |
|
private |
|
private |