The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
AlgToolHistory.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11#include <GaudiKernel/AlgTool.h>
14
15#include <iostream>
16
17using std::endl;
18using std::ostream;
19
21 : m_type( alg.type() )
22 , m_version( "UNKNOWN" )
23 , m_name( alg.name() )
24 , m_tool( &alg )
25 , m_properties( alg.getProperties() )
26 , m_jobHistory( job ) {}
27
28AlgToolHistory::AlgToolHistory( std::string algVersion, std::string algName, std::string algType, const AlgTool* tool,
29 const PropertyList& props,
30 const JobHistory* job )
31 : m_type( std::move( algType ) ) // FIXME type_info???
32 , m_version( std::move( algVersion ) )
33 , m_name( std::move( algName ) )
34 , m_tool( tool )
35 , m_properties( props )
36 , m_jobHistory( job ) {}
37
39
40 static const CLID CLID_AlgToolHistory = 171959758; // from `clid AlgToolHistory`
41 return CLID_AlgToolHistory;
42}
43
44/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
45
46std::ostream& AlgToolHistory::dump( std::ostream& ost, const bool isXML, int ind ) const {
47
48 if ( !isXML ) {
49
50 ost << "Name: " << algtool_name() << endl;
51 ost << "Type: " << algtool_type() << endl;
52 ost << "Version: " << algtool_version() << endl;
53 ost << "Parent: " << algtool_instance()->name() << endl;
54
55 // Properties
56 ost << "Properties: [" << endl;
57
58 for ( const auto& iprop : properties() ) {
59 iprop->fillStream( ost );
60 ost << endl;
61 }
62 ost << "]" << endl;
63
64 } else {
65
66 ind += 2;
67 indent( ost, ind );
68 ost << "<COMPONENT name=\"" << algtool_name() << "\" class=\"" << convert_string( algtool_type() )
69 << "\" version=\"" << convert_string( algtool_version() ) << "\" parent=\""
70 << convert_string( algtool_instance()->name() ) << "\">" << endl;
71
72 for ( const auto& iprop : properties() ) {
73
74 indent( ost, ind + 2 );
75 ost << "<PROPERTY name=\"" << iprop->name() << "\" value=\"" << convert_string( iprop->toString() )
76 << "\" documentation=\"" << convert_string( iprop->documentation() ) << "\">" << endl;
77 }
78
79 indent( ost, ind );
80 ost << "</COMPONENT>" << endl;
81 }
82 return ost;
83}
unsigned int CLID
Class ID definition.
Definition ClassID.h:16
PropertyList m_properties
std::ostream & dump(std::ostream &, bool isXML, int indent) const override
std::string m_type
std::string m_version
const std::string & type() const override
const std::string & algtool_type() const
const JobHistory * m_jobHistory
static const CLID & classID()
const std::string & algtool_name() const
const AlgTool * m_tool
AlgToolHistory(const AlgTool &alg, const JobHistory *job)
std::string m_name
const PropertyList & properties() const override
const std::string & name() const override
const std::string & algtool_version() const
const AlgTool * algtool_instance() const
Base class from which all the concrete tool classes should be derived.
Definition AlgTool.h:55
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition AlgTool.cpp:72
virtual void indent(std::ostream &, int) const
static std::string convert_string(const std::string &)
std::vector< Gaudi::Details::PropertyBase * > PropertyList
JobHistory class definition.
Definition JobHistory.h:32
STL namespace.