profiler  0.0
molpro::profiler::detail::TreePath Struct Reference

Utility for storing a node as a path from root to that node and corresponding Counter. More...

#include <report.h>

Collaboration diagram for molpro::profiler::detail::TreePath:

Public Member Functions

 TreePath (std::shared_ptr< Node< Counter >> node, bool cumulative)
 Processes path from root nodes into list of strings and copies Counter accounting for cumulative effects. More...
 

Static Public Member Functions

static std::list< TreePathconvert_tree_to_paths (const std::shared_ptr< Node< Counter >> &root, bool cumulative, SortBy sort_by)
 Performs Depth-First-Search and converts the whole tree to a list of TreePath objects. More...
 

Public Attributes

Counter counter
 copy of the counter object with cumulative effects or lack of them already accounted More...
 
std::list< std::string > path
 concatenation of names from root to the node More...
 
size_t depth = 0
 depth of the node (root is 0) More...
 

Detailed Description

Utility for storing a node as a path from root to that node and corresponding Counter.

Constructor & Destructor Documentation

◆ TreePath()

molpro::profiler::detail::TreePath::TreePath ( std::shared_ptr< Node< Counter >>  node,
bool  cumulative 
)
explicit

Processes path from root nodes into list of strings and copies Counter accounting for cumulative effects.

Member Function Documentation

◆ convert_tree_to_paths()

std::list< TreePath > molpro::profiler::detail::TreePath::convert_tree_to_paths ( const std::shared_ptr< Node< Counter >> &  root,
bool  cumulative,
SortBy  sort_by 
)
static

Performs Depth-First-Search and converts the whole tree to a list of TreePath objects.

The counter is processed so that all data is either cumulative or not. Particularly, wall time and operation count have to be taken care of.

All children are added in an ordered fashion based on sort_by.

Parameters
rootroot node
cumulativewhether to use cumulative times and operation counts
sort_bywhat parameter to sort by

Member Data Documentation

◆ counter

Counter molpro::profiler::detail::TreePath::counter

copy of the counter object with cumulative effects or lack of them already accounted

◆ depth

size_t molpro::profiler::detail::TreePath::depth = 0

depth of the node (root is 0)

◆ path

std::list<std::string> molpro::profiler::detail::TreePath::path

concatenation of names from root to the node