The Gaudi Framework  v29r0 (ff2e7097)
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/AlgTool.h"
14 #include "GaudiKernel/JobHistory.h"
15 
16 #include <iostream>
17 
18 using std::ostream;
19 using std::endl;
20 
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 
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 
99 {
100 
101  rhs.dump( lhs, false );
102 
103  return lhs;
104 }
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:49
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:88
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:20
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:139
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