hexed 0.3.0
 
Loading...
Searching...
No Matches
hexed::Stopwatch_tree Class Reference

A tree structure of Stopwatch objects. More...

#include <Stopwatch_tree.hpp>

Public Member Functions

 Stopwatch_tree (std::string work_unit_name_arg, std::map< std::string, Stopwatch_tree > init_children={})
 
std::string report () const
 returns a string with a human-readable summary of the timing data
 
Stopwatch_treeoperator[] (std::string name)
 shortcut to access the child named name
 
Stopwatch_treeemplace (std::string name, std::string work_unit)
 Adds a child with specified name and work_unit_name.
 

Public Attributes

Stopwatch stopwatch
 
std::map< std::string, Stopwatch_treechildren
 
int work_units_completed = 0
 
std::string work_unit_name
 

Detailed Description

A tree structure of Stopwatch objects.

Can acquire a hierarchical breakdown of the time spent on nested tasks and display it in a human-readable format.

Member Function Documentation

◆ emplace()

Stopwatch_tree & hexed::Stopwatch_tree::emplace ( std::string name,
std::string work_unit )

Adds a child with specified name and work_unit_name.

Child must not already exist. Returns a reference to the constructed child.

Member Data Documentation

◆ children

std::map<std::string, Stopwatch_tree> hexed::Stopwatch_tree::children
Deprecated
Direct access to children is deprecated. Prefer insertion with Stopwatch_tree::emplace and access with Stopwatch_tree::operator[].

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