| The Gaudi Framework v27r1

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