Belle II Software  release-08-01-10
DynTree< AProperties, ASubPropertiesFactory >::Node Class Reference

Class for a node in the tree. More...

#include <DynTree.h>

Inheritance diagram for DynTree< AProperties, ASubPropertiesFactory >::Node:
Collaboration diagram for DynTree< AProperties, ASubPropertiesFactory >::Node:

Public Types

using Tree = This
 Type of the tree containing this node.
 
using Properties = AProperties
 Type of the Properties.
 
using Children = std::vector< Node >
 Type of the container of the children of the node.
 

Public Member Functions

ChildrengetChildren ()
 Getter for the children. More...
 
const ChildrengetChildren () const
 Const getter for the children. More...
 
void createChildren ()
 Creates the children of the node.
 
template<class AWalker >
void walk (AWalker &walker)
 Calls the walker with each node starting with the top node and continues depth first The walker can signal to skip the children if false is returned.
 
template<class AWalker , class APriorityMeasure >
void walk (AWalker &walker, APriorityMeasure &priority)
 Calls the walker with each node starting with the top node and continues depth first The walker can signal to skip the children if false is returned. More...
 
int getLevel () const
 Get the level of the node.
 
NodegetParent ()
 Getter of the node one up the hierarchy. More...
 
const NodegetParent () const
 Const getter of the node one up the hierarchy. More...
 
TreegetTree () const
 Getter for the tree containing this node.
 

Public Attributes

friend Tree
 Allow the tree access to the node constructor to create the top node.
 

Private Member Functions

void unlink ()
 Remove to node from the tree hierachy.
 

Private Attributes

Treem_tree = nullptr
 Reference to the tree that contains this node.
 
Childrenm_children = nullptr
 Children that are created only if needed.
 
int m_level = 0
 Level of the node within the tree.
 
Nodem_parent = nullptr
 Parent in the tree hierachy of this node.
 

Detailed Description

template<class AProperties, class ASubPropertiesFactory>
class Belle2::TrackFindingCDC::DynTree< AProperties, ASubPropertiesFactory >::Node

Class for a node in the tree.

Definition at line 48 of file DynTree.h.

Member Function Documentation

◆ getChildren() [1/2]

Children* getChildren ( )
inline

Getter for the children.

Get the dynamically created children. Returns nullptr if they have not yet been created

Definition at line 78 of file DynTree.h.

79  { return m_children; }
Children * m_children
Children that are created only if needed.
Definition: DynTree.h:210

◆ getChildren() [2/2]

const Children* getChildren ( ) const
inline

Const getter for the children.

Get the dynamically created children. Returns nullptr if they have not yet been created

Definition at line 85 of file DynTree.h.

◆ getParent() [1/2]

Node* getParent ( )
inline

Getter of the node one up the hierarchy.

Usually the highest node of level 0 has no parent. Return nullptr in this case.

Definition at line 194 of file DynTree.h.

◆ getParent() [2/2]

const Node* getParent ( ) const
inline

Const getter of the node one up the hierarchy.

Usually the highest node of level 0 has no parent. Return nullptr in this case.

Definition at line 200 of file DynTree.h.

◆ walk()

void walk ( AWalker &  walker,
APriorityMeasure &  priority 
)
inline

Calls the walker with each node starting with the top node and continues depth first The walker can signal to skip the children if false is returned.

Additionally this version allows for a priority measure that determines which child is traversed first.

Definition at line 139 of file DynTree.h.


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