All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
13 #include "GaudiKernel/JobHistory.h"
14 #include "GaudiKernel/AlgTool.h"
15 
16 #include <iostream>
17 
18 using std::ostream;
19 using std::endl;
20 
22 :
23  m_type(alg.type()),
24  m_version("UNKNOWN"),
25  m_name(alg.name()),
26  m_tool( &alg ),
28  m_jobHistory(job)
29 {
30 }
31 
32 //**********************************************************************
33 
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 
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 
107 
108  rhs.dump(lhs,false);
109 
110  return lhs;
111 }
std::string m_version
const JobHistory * m_jobHistory
std::string m_name
PropertyList m_properties
const AlgTool * algtool_instance() const
T endl(T...args)
JobHistory class definition.
Definition: JobHistory.h:22
std::string m_type
STL class.
const AlgTool * m_tool
const PropertyList & properties() const override
virtual void indent(std::ostream &, int) const
Definition: HistoryObj.cpp:43
const std::string & algtool_type() const
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
static const CLID & classID()
AlgToolHistory class definition.
friend std::ostream & operator<<(std::ostream &s, const DataObject &obj)
Output operator (ASCII)
Definition: DataObject.h:99
void dump(std::ostream &, const bool isXML=false, int indent=0) const override
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:63
static std::string convert_string(const std::string &)
Definition: HistoryObj.cpp:21
Base class from which all the concrete tool classes should be derived.
Definition: AlgTool.h:48
const std::string & name() const override
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:144
const std::string & algtool_version() const
AlgToolHistory(const AlgTool &alg, const JobHistory *job)
const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const override
get all properties
STL class.
const std::string & algtool_name() const