Ocean
Ocean::KdTree< T >::Node Class Reference

This class defines a node of the k-d tree. More...

Public Member Functions

 Node ()=default
 Creates an empty node. More...
 
 ~Node ()=default
 Destructs a node. More...
 
 Node (const T *value)
 Creates a new node with given value. More...
 
Nodeleft ()
 Returns the left child of this node. More...
 
Noderight ()
 Returns the right child of this node. More...
 
const T * value ()
 Returns value of this node. More...
 
void setLeft (std::unique_ptr< Node > &&left)
 Sets the left child of this node. More...
 
void setRight (std::unique_ptr< Node > &&right)
 Sets the right child of this node. More...
 
 operator bool () const
 Returns whether this node holds a valid value. More...
 

Protected Attributes

const T * value_ = nullptr
 Node value. More...
 
std::unique_ptr< Nodeleft_ = nullptr
 Left node. More...
 
std::unique_ptr< Noderight_ = nullptr
 Right node. More...
 

Detailed Description

template<typename T>
class Ocean::KdTree< T >::Node

This class defines a node of the k-d tree.

Constructor & Destructor Documentation

◆ Node() [1/2]

template<typename T >
Ocean::KdTree< T >::Node::Node ( )
default

Creates an empty node.

◆ ~Node()

template<typename T >
Ocean::KdTree< T >::Node::~Node ( )
default

Destructs a node.

◆ Node() [2/2]

template<typename T >
Ocean::KdTree< T >::Node::Node ( const T *  value)
inlineexplicit

Creates a new node with given value.

Parameters
valueNode value

Member Function Documentation

◆ left()

template<typename T >
KdTree< T >::Node * Ocean::KdTree< T >::Node::left
inline

Returns the left child of this node.

Returns
Left child

◆ operator bool()

template<typename T >
Ocean::KdTree< T >::Node::operator bool
inlineexplicit

Returns whether this node holds a valid value.

Returns
True, if so

◆ right()

template<typename T >
KdTree< T >::Node * Ocean::KdTree< T >::Node::right
inline

Returns the right child of this node.

Returns
Right child

◆ setLeft()

template<typename T >
void Ocean::KdTree< T >::Node::setLeft ( std::unique_ptr< Node > &&  left)
inline

Sets the left child of this node.

Parameters
leftThe left child

◆ setRight()

template<typename T >
void Ocean::KdTree< T >::Node::setRight ( std::unique_ptr< Node > &&  right)
inline

Sets the right child of this node.

Parameters
rightThe right child

◆ value()

template<typename T >
const T * Ocean::KdTree< T >::Node::value
inline

Returns value of this node.

Returns
Node value

Field Documentation

◆ left_

template<typename T >
std::unique_ptr<Node> Ocean::KdTree< T >::Node::left_ = nullptr
protected

Left node.

◆ right_

template<typename T >
std::unique_ptr<Node> Ocean::KdTree< T >::Node::right_ = nullptr
protected

Right node.

◆ value_

template<typename T >
const T* Ocean::KdTree< T >::Node::value_ = nullptr
protected

Node value.


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