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

Represents a tree node. More...

Collaboration diagram for catapult::tree::TreeNode:

Public Member Functions

 TreeNode ()
 Creates an empty tree node. More...
 
 TreeNode (const LeafTreeNode &node)
 Creates a tree node from a leaf node. More...
 
 TreeNode (const BranchTreeNode &node)
 Creates a tree node from a branch node. More...
 
bool empty () const
 Returns true if this node represents an empty node. More...
 
bool isBranch () const
 Returns true if this node represents a branch node. More...
 
bool isLeaf () const
 Returns true if this node represents a leaf node. More...
 
const TreeNodePathpath () const
 Gets the node path. More...
 
const Hash256hash () const
 Gets the hash representation of this node. More...
 
void setPath (const TreeNodePath &path)
 Sets the node path. More...
 
const LeafTreeNodeasLeafNode () const
 Gets a leaf node interface to this node. More...
 
const BranchTreeNodeasBranchNode () const
 Gets a branch node interface to this node. More...
 
TreeNode copy () const
 Creates a copy of this node. More...
 

Private Attributes

TreeNodePath m_emptyPath
 
Hash256 m_emptyHash
 
std::unique_ptr< LeafTreeNodem_pLeafNode
 
std::unique_ptr< BranchTreeNodem_pBranchNode
 

Detailed Description

Represents a tree node.

Constructor & Destructor Documentation

◆ TreeNode() [1/3]

catapult::tree::TreeNode::TreeNode ( )

Creates an empty tree node.

Here is the caller graph for this function:

◆ TreeNode() [2/3]

catapult::tree::TreeNode::TreeNode ( const LeafTreeNode node)
explicit

Creates a tree node from a leaf node.

◆ TreeNode() [3/3]

catapult::tree::TreeNode::TreeNode ( const BranchTreeNode node)
explicit

Creates a tree node from a branch node.

Member Function Documentation

◆ asBranchNode()

const BranchTreeNode & catapult::tree::TreeNode::asBranchNode ( ) const

Gets a branch node interface to this node.

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

◆ asLeafNode()

const LeafTreeNode & catapult::tree::TreeNode::asLeafNode ( ) const

Gets a leaf node interface to this node.

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

◆ copy()

TreeNode catapult::tree::TreeNode::copy ( ) const

Creates a copy of this node.

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

◆ empty()

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

Returns true if this node represents an empty node.

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

◆ hash()

const Hash256 & catapult::tree::TreeNode::hash ( ) const

Gets the hash representation of this node.

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

◆ isBranch()

bool catapult::tree::TreeNode::isBranch ( ) const

Returns true if this node represents a branch node.

Here is the caller graph for this function:

◆ isLeaf()

bool catapult::tree::TreeNode::isLeaf ( ) const

Returns true if this node represents a leaf node.

Here is the caller graph for this function:

◆ path()

const TreeNodePath & catapult::tree::TreeNode::path ( ) const

Gets the node path.

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

◆ setPath()

void catapult::tree::TreeNode::setPath ( const TreeNodePath path)

Sets the node path.

Here is the call graph for this function:

Member Data Documentation

◆ m_emptyHash

Hash256 catapult::tree::TreeNode::m_emptyHash
private

◆ m_emptyPath

TreeNodePath catapult::tree::TreeNode::m_emptyPath
private

◆ m_pBranchNode

std::unique_ptr<BranchTreeNode> catapult::tree::TreeNode::m_pBranchNode
private

◆ m_pLeafNode

std::unique_ptr<LeafTreeNode> catapult::tree::TreeNode::m_pLeafNode
private

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