|
|
| Node (const T &_data) |
| | Custom constructor.
|
| |
|
| Node () |
| | Default constructor.
|
| |
|
| ~Node ()=default |
| | Default-generated destructor.
|
| |
|
| Node (const T &_data, Node< T > *_parent) noexcept |
| | Copy constructor.
|
| |
| | Node (const std::unique_ptr< Node< T >> &ptn, Node< T > *_parent) |
| | Helper recursive function that, starting from a Node and its parent, copy all the tree recursively. More...
|
| |
| void | print () |
| | Move constructor. More...
|
| |
|
|
T | data |
| | Data to be stored in the Node.
|
| |
|
std::unique_ptr< Node< T > > | left |
| | Unique pointer to the left child.
|
| |
|
std::unique_ptr< Node< T > > | right |
| | Unique pointer to the right child.
|
| |
|
Node< T > * | parent |
| | Raw pointer to the parent Node.
|
| |
◆ Node()
template<typename T >
| Node< T >::Node |
( |
const std::unique_ptr< Node< T >> & |
ptn, |
|
|
Node< T > * |
_parent |
|
) |
| |
|
inline |
Helper recursive function that, starting from a Node and its parent, copy all the tree recursively.
- Parameters
-
| ptn | Reference to a unique_ptr to a Node |
| _parent | Raw pointer to the parent Node This function exploit the std::make_unique() function, to construct an object of type Node and wraps it into a unique_ptr. |
◆ print()
template<typename T >
| void Node< T >::print |
( |
| ) |
|
|
inline |
Move constructor.
Simple void function that prints a Node. Used just for testing.
The documentation for this struct was generated from the following file: