The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::statistics::ReportStatisticsHierTree< NodeT, LeafNodeT > Class Template Reference

Helper class used to build up a "report statistics hierarchy tree", where the template types are: More...

#include <ReportStatisticsHierTree.hpp>

Public Types

typedef std::pair< LeafNodeT *, const StatisticInstance * > LeafNodeSI
 

Public Member Functions

 ReportStatisticsHierTree (const Report *r)
 
std::vector< LeafNodeSI > buildFrom (std::shared_ptr< NodeT > &root, std::vector< std::string > *si_locations=nullptr) const
 
std::vector< LeafNodeSI > buildFrom (NodeT *root, std::vector< std::string > *si_locations=nullptr) const
 

Detailed Description

template<class NodeT, class LeafNodeT = NodeT>
class sparta::statistics::ReportStatisticsHierTree< NodeT, LeafNodeT >

Helper class used to build up a "report statistics hierarchy tree", where the template types are:

NodeT     -- This is the class you want instantiated for each
             sparta::Report node (which includes subreports)
LeafNodeT -- This is the class you want instantiated for each
             sparta::StatisticInstance (at the leaves / no children)

For example: ReportStatisticHierTree<BigNode, LittleNode> tree(r);

 // where the report 'r' looks like:

                 r
     -------------------------
     |           |           |
    top      scheduler      meta
  -------      |   |
   |   |      tix mss
  foo bar

In this use case, your hiearchy tree would be created as:

 BigNode 'r'
    - children_:
           BigNode 'top'
              - children_:
                     LittleNode 'foo'
                     LittleNode 'bar'
           BigNode 'scheduler'
              - children_:
                     LittleNode 'tix'
                     LittleNode 'mss'
           LittleNode 'meta'

Definition at line 47 of file ReportStatisticsHierTree.hpp.

Member Typedef Documentation

◆ LeafNodeSI

template<class NodeT , class LeafNodeT = NodeT>
typedef std::pair<LeafNodeT*, const StatisticInstance*> sparta::statistics::ReportStatisticsHierTree< NodeT, LeafNodeT >::LeafNodeSI

Definition at line 56 of file ReportStatisticsHierTree.hpp.

Constructor & Destructor Documentation

◆ ReportStatisticsHierTree()

template<class NodeT , class LeafNodeT = NodeT>
sparta::statistics::ReportStatisticsHierTree< NodeT, LeafNodeT >::ReportStatisticsHierTree ( const Report *  r)
inlineexplicit

Definition at line 50 of file ReportStatisticsHierTree.hpp.

Member Function Documentation

◆ buildFrom() [1/2]

template<class NodeT , class LeafNodeT = NodeT>
std::vector< LeafNodeSI > sparta::statistics::ReportStatisticsHierTree< NodeT, LeafNodeT >::buildFrom ( NodeT *  root,
std::vector< std::string > *  si_locations = nullptr 
) const
inline

Inspect the Report for all SI's, and build the hierarchy tree for this report. Optionally pass in 'si_locations' if you want the tree builder to get the "CSV header equivalent" SI location/ name that would appear above the SI values in the .csv file.

Definition at line 71 of file ReportStatisticsHierTree.hpp.

◆ buildFrom() [2/2]

template<class NodeT , class LeafNodeT = NodeT>
std::vector< LeafNodeSI > sparta::statistics::ReportStatisticsHierTree< NodeT, LeafNodeT >::buildFrom ( std::shared_ptr< NodeT > &  root,
std::vector< std::string > *  si_locations = nullptr 
) const
inline

Inspect the Report for all SI's, and build the hierarchy tree for this report. Optionally pass in 'si_locations' if you want the tree builder to get the "CSV header equivalent" SI location/ name that would appear above the SI values in the .csv file.

Definition at line 62 of file ReportStatisticsHierTree.hpp.

Here is the call graph for this function:

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