| The Gaudi Framework v32r1 (f65d50dc)

AlgToolHistory.cpp
Go to the documentation of this file.
1 //
3 // GaudiHistory/AlgToolHistory.cpp
4 //
5 // Contains history information for an AlgTool
6 //
7 //
8 // @author: Charles Leggett
9 //
11
12 #include "GaudiKernel/AlgToolHistory.h"
13 #include "GaudiKernel/AlgTool.h"
14 #include "GaudiKernel/JobHistory.h"
15
16 #include <iostream>
17
18 using std::endl;
19 using std::ostream;
20
21 AlgToolHistory::AlgToolHistory( const AlgTool& alg, const JobHistory* job )
22 : m_type( alg.type() )
23 , m_version( "UNKNOWN" )
24 , m_name( alg.name() )
25 , m_tool( &alg )
26 , m_properties( alg.getProperties() )
27 , m_jobHistory( job ) {}
28
29 //**********************************************************************
30
31 AlgToolHistory::AlgToolHistory( const std::string& algVersion, const std::string& algName, const std::string& algType,
32 const AlgTool* tool, const PropertyList& props,
33 const JobHistory* job )
34 : m_type( algType )
35 , // FIXME type_info???
36 m_version( algVersion )
37 , m_name( algName )
38 , m_tool( tool )
39 , m_properties( props )
40 , m_jobHistory( job ) {}
41
42 //**********************************************************************
43
44 const CLID& AlgToolHistory::classID() {
45
46 static const CLID CLID_AlgToolHistory = 171959758; // from `clid AlgToolHistory`
47 return CLID_AlgToolHistory;
48 }
49
50 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
51
52 void AlgToolHistory::dump( std::ostream& ost, const bool isXML, int ind ) const {
53
54 if ( !isXML ) {
55
56 ost << "Name: " << algtool_name() << endl;
57 ost << "Type: " << algtool_type() << endl;
58 ost << "Version: " << algtool_version() << endl;
59 ost << "Parent: " << algtool_instance()->name() << endl;
60
61 // Properties
62 ost << "Properties: [" << endl;
63
64 for ( const auto& iprop : properties() ) {
65 iprop->fillStream( ost );
66 ost << endl;
67 }
68 ost << "]" << endl;
69
70 } else {
71
72 ind += 2;
73 indent( ost, ind );
74 ost << "<COMPONENT name=\"" << algtool_name() << "\" class=\"" << convert_string( algtool_type() )
75 << "\" version=\"" << convert_string( algtool_version() ) << "\" parent=\""
76 << convert_string( algtool_instance()->name() ) << "\">" << endl;
77
78 for ( const auto& iprop : properties() ) {
79
80 indent( ost, ind + 2 );
81 ost << "<PROPERTY name=\"" << iprop->name() << "\" value=\"" << convert_string( iprop->toString() )
82 << "\" documentation=\"" << convert_string( iprop->documentation() ) << "\">" << endl;
83 }
84
85 indent( ost, ind );
86 ost << "</COMPONENT>" << endl;
87 }
88 }
89
90 //**********************************************************************
91
92 ostream& operator<<( ostream& lhs, const AlgToolHistory& rhs ) {
93
94 rhs.dump( lhs, false );
95
96 return lhs;
97 }
AlgToolHistory::properties
const PropertyList & properties() const override
Definition: AlgToolHistory.h:66
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
AlgToolHistory::algtool_name
const std::string & algtool_name() const
Definition: AlgToolHistory.h:60
AlgToolHistory::algtool_version
const std::string & algtool_version() const
Definition: AlgToolHistory.h:57
AlgToolHistory::name
const std::string & name() const override
Definition: AlgToolHistory.h:73
AlgTool.h
std::endl
T endl(T... args)
JobHistory
JobHistory class definition.
Definition: JobHistory.h:22
AlgToolHistory::algtool_instance
const AlgTool * algtool_instance() const
Definition: AlgToolHistory.h:63
std::string
STL class.
JobHistory.h
AlgToolHistory::algtool_type
const std::string & algtool_type() const
Definition: AlgToolHistory.h:54
AlgToolHistory.h
gaudirun.type
type
Definition: gaudirun.py:142
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
AlgToolHistory::classID
static const CLID & classID()
Definition: AlgToolHistory.cpp:44
HistoryObj::indent
virtual void indent(std::ostream &, int) const
Definition: HistoryObj.cpp:46
AlgToolHistory
AlgToolHistory class definition.
Definition: AlgToolHistory.h:22
std::vector< Gaudi::Details::PropertyBase * >
HistoryObj::convert_string
static std::string convert_string(const std::string &)
Definition: HistoryObj.cpp:20
AlgTool
Base class from which all the concrete tool classes should be derived.
Definition: AlgTool.h:47
AlgToolHistory::dump
void dump(std::ostream &, const bool isXML=false, int indent=0) const override
Definition: AlgToolHistory.cpp:52
AlgToolHistory::AlgToolHistory
AlgToolHistory(const AlgTool &alg, const JobHistory *job)
Definition: AlgToolHistory.cpp:21
operator<<
ostream & operator<<(ostream &lhs, const AlgToolHistory &rhs)
Definition: AlgToolHistory.cpp:92
std::ostream
STL class.
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:58