The Gaudi Framework  master (37c0b60a)
AlgToolHistory.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
12 //
13 // GaudiHistory/AlgToolHistory.cpp
14 //
15 // Contains history information for an AlgTool
16 //
17 //
18 // @author: Charles Leggett
19 //
21 
22 #include <GaudiKernel/AlgTool.h>
24 #include <GaudiKernel/JobHistory.h>
25 
26 #include <iostream>
27 
28 using std::endl;
29 using std::ostream;
30 
32  : m_type( alg.type() )
33  , m_version( "UNKNOWN" )
34  , m_name( alg.name() )
35  , m_tool( &alg )
36  , m_properties( alg.getProperties() )
37  , m_jobHistory( job ) {}
38 
39 //**********************************************************************
40 
42  const PropertyList& props,
43  const JobHistory* job )
44  : m_type( std::move( algType ) ) // FIXME type_info???
45  , m_version( std::move( algVersion ) )
46  , m_name( std::move( algName ) )
47  , m_tool( tool )
48  , m_properties( props )
49  , m_jobHistory( job ) {}
50 
51 //**********************************************************************
52 
54 
55  static const CLID CLID_AlgToolHistory = 171959758; // from `clid AlgToolHistory`
56  return CLID_AlgToolHistory;
57 }
58 
59 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
60 
61 std::ostream& AlgToolHistory::dump( std::ostream& ost, const bool isXML, int ind ) const {
62 
63  if ( !isXML ) {
64 
65  ost << "Name: " << algtool_name() << endl;
66  ost << "Type: " << algtool_type() << endl;
67  ost << "Version: " << algtool_version() << endl;
68  ost << "Parent: " << algtool_instance()->name() << endl;
69 
70  // Properties
71  ost << "Properties: [" << endl;
72 
73  for ( const auto& iprop : properties() ) {
74  iprop->fillStream( ost );
75  ost << endl;
76  }
77  ost << "]" << endl;
78 
79  } else {
80 
81  ind += 2;
82  indent( ost, ind );
83  ost << "<COMPONENT name=\"" << algtool_name() << "\" class=\"" << convert_string( algtool_type() )
84  << "\" version=\"" << convert_string( algtool_version() ) << "\" parent=\""
85  << convert_string( algtool_instance()->name() ) << "\">" << endl;
86 
87  for ( const auto& iprop : properties() ) {
88 
89  indent( ost, ind + 2 );
90  ost << "<PROPERTY name=\"" << iprop->name() << "\" value=\"" << convert_string( iprop->toString() )
91  << "\" documentation=\"" << convert_string( iprop->documentation() ) << "\">" << endl;
92  }
93 
94  indent( ost, ind );
95  ost << "</COMPONENT>" << endl;
96  }
97  return ost;
98 }
std::string
STL class.
AlgToolHistory::name
const std::string & name() const override
Definition: AlgToolHistory.h:83
AlgToolHistory::properties
const PropertyList & properties() const override
Definition: AlgToolHistory.h:76
AlgToolHistory::algtool_version
const std::string & algtool_version() const
Definition: AlgToolHistory.h:67
std::vector< Gaudi::Details::PropertyBase * >
check_ParticleID.props
props
Definition: check_ParticleID.py:21
AlgToolHistory::algtool_name
const std::string & algtool_name() const
Definition: AlgToolHistory.h:70
AlgToolHistory::algtool_instance
const AlgTool * algtool_instance() const
Definition: AlgToolHistory.h:73
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:67
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:81
bug_34121.tool
tool
Definition: bug_34121.py:18
std::ostream
STL class.
HistoryObj::indent
virtual void indent(std::ostream &, int) const
Definition: HistoryObj.cpp:56
AlgToolHistory::algtool_type
const std::string & algtool_type() const
Definition: AlgToolHistory.h:64
HistoryObj::convert_string
static std::string convert_string(const std::string &)
Definition: HistoryObj.cpp:30
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
JobHistory.h
AlgToolHistory::classID
static const CLID & classID()
Definition: AlgToolHistory.cpp:53
AlgToolHistory.h
gaudirun.type
type
Definition: gaudirun.py:160
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
std::endl
T endl(T... args)
AlgTool
Definition: AlgTool.h:62
std
STL namespace.
JobHistory
Definition: JobHistory.h:33
AlgTool.h
AlgToolHistory::dump
std::ostream & dump(std::ostream &, bool isXML, int indent) const override
Definition: AlgToolHistory.cpp:61
AlgToolHistory::AlgToolHistory
AlgToolHistory(const AlgTool &alg, const JobHistory *job)
Definition: AlgToolHistory.cpp:31