Base Framework
Public Member Functions | List of all members
BinaryNode< TYPE > Class Template Reference

Binary node. More...

#include <base/collection/BinaryNode.h>

Public Member Functions

 BinaryNode (BinaryNode *_parent, NullPtr left, NullPtr right, const TYPE &_value)
 
 BinaryNode (BinaryNode *_parent, NullPtr left, NullPtr right, TYPE &&_value)
 
 BinaryNode (BinaryNode *_parent, BinaryNode *_left, BinaryNode *_right, const TYPE &_value)
 
 BinaryNode (BinaryNode *_parent, BinaryNode *_left, BinaryNode *_right, TYPE &&_value)
 
BinaryNodegetParent () const noexcept
 
void setParent (BinaryNode *parent) noexcept
 
BinaryNodegetLeft () const noexcept
 
void setLeft (BinaryNode *left) noexcept
 
BinaryNodegetRight () const noexcept
 
void setRight (BinaryNode *right) noexcept
 
TYPE & getValue () noexcept
 
const TYPE & getValue () const noexcept
 
void setValue (const TYPE &value)
 
void setValue (TYPE &&value)
 

Detailed Description

template<class TYPE>
class BinaryNode< TYPE >

Binary node.

A binary linked node. This class is used by the binary tree collection.

See also
BinaryTree
Version
1.0

Constructor & Destructor Documentation

◆ BinaryNode() [1/4]

template<class TYPE >
BinaryNode< TYPE >::BinaryNode ( BinaryNode< TYPE > *  _parent,
NullPtr  left,
NullPtr  right,
const TYPE &  _value 
)
inline

Initializes a binary node.

Parameters
parentThe parent node of this node.
valueThe value to be associated with the node.

◆ BinaryNode() [2/4]

template<class TYPE >
BinaryNode< TYPE >::BinaryNode ( BinaryNode< TYPE > *  _parent,
NullPtr  left,
NullPtr  right,
TYPE &&  _value 
)
inline

Initializes a binary node.

Parameters
parentThe parent node of this node.
valueThe value to be associated with the node.

◆ BinaryNode() [3/4]

template<class TYPE >
BinaryNode< TYPE >::BinaryNode ( BinaryNode< TYPE > *  _parent,
BinaryNode< TYPE > *  _left,
BinaryNode< TYPE > *  _right,
const TYPE &  _value 
)
inline

Initializes a binary node.

Parameters
parentThe parent node of this node.
leftThe left child node.
rightThe right child node.
valueThe value to be associated with the node.

◆ BinaryNode() [4/4]

template<class TYPE >
BinaryNode< TYPE >::BinaryNode ( BinaryNode< TYPE > *  _parent,
BinaryNode< TYPE > *  _left,
BinaryNode< TYPE > *  _right,
TYPE &&  _value 
)
inline

Initializes a binary node.

Parameters
parentThe parent node of this node.
leftThe left child node.
rightThe right child node.
valueThe value to be associated with the node.

Member Function Documentation

◆ getLeft()

template<class TYPE >
BinaryNode* BinaryNode< TYPE >::getLeft ( ) const
inlinenoexcept

Returns the left child node.

◆ getParent()

template<class TYPE >
BinaryNode* BinaryNode< TYPE >::getParent ( ) const
inlinenoexcept

Returns the parent node.

◆ getRight()

template<class TYPE >
BinaryNode* BinaryNode< TYPE >::getRight ( ) const
inlinenoexcept

Returns the right child node.

◆ getValue() [1/2]

template<class TYPE >
const TYPE& BinaryNode< TYPE >::getValue ( ) const
inlinenoexcept

Returns the value of the node.

◆ getValue() [2/2]

template<class TYPE >
TYPE& BinaryNode< TYPE >::getValue ( )
inlinenoexcept

Returns the value of the node.

◆ setLeft()

template<class TYPE >
void BinaryNode< TYPE >::setLeft ( BinaryNode< TYPE > *  left)
inlinenoexcept

Sets the left child node.

◆ setParent()

template<class TYPE >
void BinaryNode< TYPE >::setParent ( BinaryNode< TYPE > *  parent)
inlinenoexcept

Sets the parent node.

◆ setRight()

template<class TYPE >
void BinaryNode< TYPE >::setRight ( BinaryNode< TYPE > *  right)
inlinenoexcept

Sets the right child node.

◆ setValue() [1/2]

template<class TYPE >
void BinaryNode< TYPE >::setValue ( const TYPE &  value)
inline

Sets the value of the node.

◆ setValue() [2/2]

template<class TYPE >
void BinaryNode< TYPE >::setValue ( TYPE &&  value)
inline

Sets the value of the node.