NAGASH 0.9.8
Next Generation Analysis System
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
NAGASH::ResultGroup Class Reference

Used to manipulate a group of Result objects., especially inside NAGASH::Job. More...

#include "NAGASH/ResultGroup.h"

Public Member Functions

 ResultGroup ()=delete
 
 ResultGroup (std::shared_ptr< MSGTool > MSG, std::shared_ptr< ConfigTool > c)
 Constructor.
 
 ~ResultGroup ()=default
 
void AddResult (std::shared_ptr< Result > result)
 Add a result to the group.
 
template<typename R , typename... Args>
std::shared_ptr< R > BookResult (const TString &name, const TString &fname="", Args &&...args)
 Book a result in this ResultGroup.
 
template<typename R >
std::shared_ptr< R > Get (const TString &name)
 Get the result with the given name. If the given name is not find, the search will turn to fuzzy search mode, see MapTool::FindMostSimilar().
 
void Merge (std::shared_ptr< ResultGroup > subGroup)
 Merge two ResultGroup into one.
 
void Write ()
 Write all the results inside, i.e. call Result::WriteToFile() for each result.
 

Private Attributes

std::shared_ptr< ConfigToolconfig
 
MapTool maptool
 
std::shared_ptr< MSGToolmsg
 
std::map< TString, std::shared_ptr< Result > > ResultMap
 

Detailed Description

Used to manipulate a group of Result objects., especially inside NAGASH::Job.

Definition at line 19 of file ResultGroup.h.

Constructor & Destructor Documentation

◆ ResultGroup() [1/2]

NAGASH::ResultGroup::ResultGroup ( std::shared_ptr< MSGTool MSG,
std::shared_ptr< ConfigTool c 
)
inline

Constructor.

Parameters
MSGgiven NAGASH::MSGTool.
cgiven NAGASH::ConfigTool.

Definition at line 25 of file ResultGroup.h.

◆ ResultGroup() [2/2]

NAGASH::ResultGroup::ResultGroup ( )
delete

◆ ~ResultGroup()

NAGASH::ResultGroup::~ResultGroup ( )
default

Member Function Documentation

◆ AddResult()

void ResultGroup::AddResult ( std::shared_ptr< Result result)

Add a result to the group.

Parameters
resultthe pointer of the result.

Definition at line 11 of file ResultGroup.cxx.

◆ BookResult()

template<typename R , typename... Args>
std::shared_ptr< R > NAGASH::ResultGroup::BookResult ( const TString &  rname,
const TString &  fname = "",
Args &&...  args 
)
inline

Book a result in this ResultGroup.

Template Parameters
Rthe type of the result.
...Argstypes of other arguments to construct the result. Can be automatically deduced.
Parameters
rnamethe name of the result.
fnamethe output file name of the result.
...argsother arguments to construct the result.
Returns

Definition at line 58 of file ResultGroup.h.

◆ Get()

template<typename R >
std::shared_ptr< R > NAGASH::ResultGroup::Get ( const TString &  name)
inline

Get the result with the given name. If the given name is not find, the search will turn to fuzzy search mode, see MapTool::FindMostSimilar().

Template Parameters
Rtype of the result.
Parameters
namename of the result.
Returns
the pointer of the result. Will return nullptr if the result does not exist.

Definition at line 85 of file ResultGroup.h.

◆ Merge()

void ResultGroup::Merge ( std::shared_ptr< ResultGroup subGroup)

Merge two ResultGroup into one.

Parameters
subGroupthe ResultGroup to be merged into this one.

Definition at line 28 of file ResultGroup.cxx.

◆ Write()

void ResultGroup::Write ( )

Write all the results inside, i.e. call Result::WriteToFile() for each result.

Definition at line 58 of file ResultGroup.cxx.

Member Data Documentation

◆ config

std::shared_ptr<ConfigTool> NAGASH::ResultGroup::config
private

Definition at line 45 of file ResultGroup.h.

◆ maptool

MapTool NAGASH::ResultGroup::maptool
private

Definition at line 46 of file ResultGroup.h.

◆ msg

std::shared_ptr<MSGTool> NAGASH::ResultGroup::msg
private

Definition at line 47 of file ResultGroup.h.

◆ ResultMap

std::map<TString, std::shared_ptr<Result> > NAGASH::ResultGroup::ResultMap
private

Definition at line 44 of file ResultGroup.h.


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