KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
kamping::measurements::internal::TreeNode< DerivedNode > Class Template Reference

Object representing a node in a tree. The class is not meant to be used on its own but to encapsulate the basic "tree-node behaviour" (e.g. management of children nodes etc.) for other specialised node classes like TimerTreeNode via CRTP paradigm. More...

#include <measurement_utils.hpp>

Inheritance diagram for kamping::measurements::internal::TreeNode< DerivedNode >:

Public Member Functions

 TreeNode ()
 Constructs node without pointer to parent and empty name.
 
 TreeNode (std::string const &name)
 Constructs node without pointer to parent.
 
 TreeNode (std::string const &name, DerivedNode *parent)
 Constructs node pointer to parent.
 
autofind_or_insert (std::string const &name)
 Searches the node's children for a node with the given name. If there is no such child a new node is inserted.
 
autoparent_ptr ()
 Access to the parent pointer.
 
auto constchildren () const
 Access to the node's children.
 
auto constname () const
 Access to the node's children.
 

Detailed Description

template<typename DerivedNode>
class kamping::measurements::internal::TreeNode< DerivedNode >

Object representing a node in a tree. The class is not meant to be used on its own but to encapsulate the basic "tree-node behaviour" (e.g. management of children nodes etc.) for other specialised node classes like TimerTreeNode via CRTP paradigm.

Template Parameters
DerivedNodeSpecialised node type for which the basisc "tree node behaviour" is encapsulated.

Constructor & Destructor Documentation

◆ TreeNode() [1/2]

template<typename DerivedNode >
kamping::measurements::internal::TreeNode< DerivedNode >::TreeNode ( std::string const & name)
inline

Constructs node without pointer to parent.

Parameters
nameName associated with this node.

◆ TreeNode() [2/2]

template<typename DerivedNode >
kamping::measurements::internal::TreeNode< DerivedNode >::TreeNode ( std::string const & name,
DerivedNode * parent )
inline

Constructs node pointer to parent.

Parameters
nameName associated with this node.
parentPointer to this node's parent pointer.

Member Function Documentation

◆ children()

Access to the node's children.

Returns
Return a reference to the node's children.

◆ find_or_insert()

template<typename DerivedNode >
auto & kamping::measurements::internal::TreeNode< DerivedNode >::find_or_insert ( std::string const & name)
inline

Searches the node's children for a node with the given name. If there is no such child a new node is inserted.

Parameters
nameName of the child which is searched.
Returns
Reference to the node with the given name.

◆ name()

Access to the node's children.

Returns
Return a reference to the node's children.

◆ parent_ptr()

Access to the parent pointer.

Returns
Reference to the parent pointer.

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