CatapultServer  v0.5.0.1 (Elephant)
catapult::tree::TreeNodePath Class Reference

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
 

Detailed Description

Represents a path in a tree.

Constructor & Destructor Documentation

◆ TreeNodePath() [1/3]

catapult::tree::TreeNodePath::TreeNodePath ( )

Creates a default path.

Here is the caller graph for this function:

◆ TreeNodePath() [2/3]

template<typename TKey >
catapult::tree::TreeNodePath::TreeNodePath ( TKey  key)
inlineexplicit

Creates a path from key.

◆ TreeNodePath() [3/3]

catapult::tree::TreeNodePath::TreeNodePath ( const std::vector< uint8_t > &  path,
size_t  offset,
size_t  size 
)
private

Member Function Documentation

◆ empty()

bool catapult::tree::TreeNodePath::empty ( ) const

Returns true if this path is empty.

Here is the caller graph for this function:

◆ Join() [1/2]

TreeNodePath catapult::tree::TreeNodePath::Join ( const TreeNodePath lhs,
const TreeNodePath rhs 
)
static

Joins lhs and rhs into a new path.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Join() [2/2]

TreeNodePath catapult::tree::TreeNodePath::Join ( const TreeNodePath lhs,
uint8_t  nibble,
const TreeNodePath rhs 
)
static

Joins lhs, nibble and rhs into a new path.

Here is the call graph for this function:

◆ nibbleAt()

uint8_t catapult::tree::TreeNodePath::nibbleAt ( size_t  index) const

Gets the nibble at index.

Here is the caller graph for this function:

◆ operator!=()

bool catapult::tree::TreeNodePath::operator!= ( const TreeNodePath rhs) const

Returns true if this path is not equal to rhs.

◆ operator==()

bool catapult::tree::TreeNodePath::operator== ( const TreeNodePath rhs) const

Returns true if this path is equal to rhs.

Here is the call graph for this function:

◆ size()

size_t catapult::tree::TreeNodePath::size ( ) const

Gets the number of nibbles in this path.

Here is the caller graph for this function:

◆ subpath() [1/2]

TreeNodePath catapult::tree::TreeNodePath::subpath ( size_t  offset) const

Creates a subpath starting at nibble offset.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subpath() [2/2]

TreeNodePath catapult::tree::TreeNodePath::subpath ( size_t  offset,
size_t  size 
) const

Creates a subpath starting at nibble offset composed of size nibbles.

Here is the call graph for this function:

Member Data Documentation

◆ m_adjustment

size_t catapult::tree::TreeNodePath::m_adjustment
private

◆ m_path

std::vector<uint8_t> catapult::tree::TreeNodePath::m_path
private

◆ m_size

size_t catapult::tree::TreeNodePath::m_size
private

The documentation for this class was generated from the following files: