| The Gaudi Framework v28r2p1 (f1a77ff4)

- 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 }
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:28
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:125
AlgToolHistory::properties
const PropertyList & properties() const override
Definition: AlgToolHistory.h:69
HistoryObj::indent
virtual void indent(std::ostream &, int) const
Definition: HistoryObj.cpp:43
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:50
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:99
AlgToolHistory::dump
void dump(std::ostream &, const bool isXML=false, int indent=0) const override
Definition: AlgToolHistory.cpp:60
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:21
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:144
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