| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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::ostream;
19 using std::endl;
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 //**********************************************************************
32
33 AlgToolHistory::AlgToolHistory( const std::string& algVersion, const std::string& algName, const std::string& algType,
34 const AlgTool* tool, const PropertyList& props,
35 const JobHistory* job )
36 : m_type( algType )
37 , // FIXME type_info???
38 m_version( algVersion )
39 , m_name( algName )
40 , m_tool( tool )
41 , m_properties( props )
42 , m_jobHistory( job )
43 {
44 }
45
46 //**********************************************************************
47
48 const CLID& AlgToolHistory::classID()
49 {
50
51 static const CLID CLID_AlgToolHistory = 171959758; // from `clid AlgToolHistory`
52 return CLID_AlgToolHistory;
53 }
54
55 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
56
57 void AlgToolHistory::dump( std::ostream& ost, const bool isXML, int ind ) const
58 {
59
60 if ( !isXML ) {
61
62 ost << "Name: " << algtool_name() << endl;
63 ost << "Type: " << algtool_type() << endl;
64 ost << "Version: " << algtool_version() << endl;
65 ost << "Parent: " << algtool_instance()->name() << endl;
66
67 // Properties
68 ost << "Properties: [" << endl;
69
70 for ( const auto& iprop : properties() ) {
71 iprop->fillStream( ost );
72 ost << endl;
73 }
74 ost << "]" << endl;
75
76 } else {
77
78 ind += 2;
79 indent( ost, ind );
80 ost << "<COMPONENT name=\"" << algtool_name() << "\" class=\"" << convert_string( algtool_type() )
81 << "\" version=\"" << convert_string( algtool_version() ) << "\" parent=\""
82 << convert_string( algtool_instance()->name() ) << "\">" << endl;
83
84 for ( const auto& iprop : properties() ) {
85
86 indent( ost, ind + 2 );
87 ost << "<PROPERTY name=\"" << iprop->name() << "\" value=\"" << convert_string( iprop->toString() )
88 << "\" documentation=\"" << convert_string( iprop->documentation() ) << "\">" << endl;
89 }
90
91 indent( ost, ind );
92 ost << "</COMPONENT>" << endl;
93 }
94 }
95
96 //**********************************************************************
97
98 ostream& operator<<( ostream& lhs, const AlgToolHistory& rhs )
99 {
100
101 rhs.dump( lhs, false );
102
103 return lhs;
104 }
AlgToolHistory::m_version
std::string m_version
Definition: AlgToolHistory.h:29
AlgToolHistory::m_jobHistory
const JobHistory * m_jobHistory
Definition: AlgToolHistory.h:41
AlgToolHistory::m_name
std::string m_name
Definition: AlgToolHistory.h:32
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
AlgToolHistory::m_properties
PropertyList m_properties
Definition: AlgToolHistory.h:38
AlgToolHistory::algtool_instance
const AlgTool * algtool_instance() const
Definition: AlgToolHistory.h:66
AlgTool.h
std::endl
T endl(T...args)
JobHistory
JobHistory class definition.
Definition: JobHistory.h:22
AlgToolHistory::m_type
std::string m_type
Definition: AlgToolHistory.h:26
std::string
STL class.
JobHistory.h
AlgToolHistory.h
AlgToolHistory::m_tool
const AlgTool * m_tool
Definition: AlgToolHistory.h:35
gaudirun.type
type
Definition: gaudirun.py:133
AlgToolHistory::properties
const PropertyList & properties() const override
Definition: AlgToolHistory.h:69
HistoryObj::indent
virtual void indent(std::ostream &, int) const
Definition: HistoryObj.cpp:49
AlgToolHistory::algtool_type
const std::string & algtool_type() const
Definition: AlgToolHistory.h:57
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
AlgToolHistory::classID
static const CLID & classID()
Definition: AlgToolHistory.cpp:48
AlgToolHistory
AlgToolHistory class definition.
Definition: AlgToolHistory.h:21
DataObject::operator<<
friend std::ostream & operator<<(std::ostream &s, const DataObject &obj)
Output operator (ASCII)
Definition: DataObject.h:88
AlgToolHistory::dump
void dump(std::ostream &, const bool isXML=false, int indent=0) const override
Definition: AlgToolHistory.cpp:57
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:63
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:48
AlgToolHistory::name
const std::string & name() const override
Definition: AlgToolHistory.h:76
m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:139
AlgToolHistory::algtool_version
const std::string & algtool_version() const
Definition: AlgToolHistory.h:60
AlgToolHistory::AlgToolHistory
AlgToolHistory(const AlgTool &alg, const JobHistory *job)
Definition: AlgToolHistory.cpp:21
getProperties
const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const override
get all properties
std::ostream
STL class.
AlgToolHistory::algtool_name
const std::string & algtool_name() const
Definition: AlgToolHistory.h:63