The Gaudi Framework
master (1a7a3838)
Toggle main menu visibility
Loading...
Searching...
No Matches
AlgorithmHistory.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 <
Gaudi/Algorithm.h
>
12
#include <
GaudiKernel/AlgorithmHistory.h
>
13
#include <
GaudiKernel/JobHistory.h
>
14
#include <assert.h>
15
#include <iostream>
16
17
using
std::endl;
18
using
std::ostream;
19
using
std::vector;
20
21
AlgorithmHistory::AlgorithmHistory
(
const
Gaudi::Algorithm
& alg,
const
JobHistory
* job )
22
:
m_algorithm_type
(
System
::typeinfoName( typeid( alg ) ) )
23
,
m_algorithm_version
( alg.
version
() )
24
,
m_algorithm_name
( alg.
name
() )
25
,
m_algorithm
( &alg )
26
,
m_properties
( alg.getProperties() )
27
,
m_jobHistory
( job ) {}
28
29
AlgorithmHistory::AlgorithmHistory
( std::string algVersion, std::string algName, std::string algType,
30
const
PropertyList
& props,
31
const
HistoryList
& subHists )
32
:
m_algorithm_type
(
std
::move( algType ) )
// FIXME type_info???
33
,
m_algorithm_version
(
std
::move( algVersion ) )
34
,
m_algorithm_name
(
std
::move( algName ) )
35
,
m_algorithm
( nullptr )
36
,
m_properties
( props )
37
,
m_subalgorithm_histories
( subHists )
38
,
m_jobHistory
( nullptr ) {}
39
40
AlgorithmHistory::~AlgorithmHistory
() {
41
for
(
auto
& i :
m_subalgorithm_histories
)
delete
i;
42
}
43
44
const
CLID
&
AlgorithmHistory::classID
() {
45
static
const
CLID
CLID_AlgorithmHistory = 56809101;
// from `clid AlgorithmHistory`
46
return
CLID_AlgorithmHistory;
47
}
48
49
std::ostream&
AlgorithmHistory::dump
( std::ostream& ost,
const
bool
isXML,
int
ind )
const
{
50
51
if
( !isXML ) {
52
ost <<
"Type: "
<<
algorithm_type
() << endl;
53
ost <<
"Name: "
<<
algorithm_name
() << endl;
54
ost <<
"Version: "
<<
algorithm_version
() << endl;
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
}
else
{
64
ind += 2;
65
indent
( ost, ind );
66
ost <<
"<COMPONENT name=\""
<<
algorithm_name
() <<
"\" class=\""
<<
convert_string
(
algorithm_type
() )
67
<<
"\" version=\""
<<
algorithm_version
() <<
"\">"
<< std::endl;
68
69
for
(
const
auto
& iprop :
properties
() ) {
70
indent
( ost, ind + 2 );
71
ost <<
"<PROPERTY name=\""
<< iprop->name() <<
"\" value=\""
<<
convert_string
( iprop->toString() )
72
<<
"\" documentation=\""
<<
convert_string
( iprop->documentation() ) <<
"\">"
<< std::endl;
73
}
74
75
indent
( ost, ind );
76
ost <<
"</COMPONENT>"
<< std::endl;
77
}
78
return
ost;
79
}
AlgorithmHistory.h
CLID
unsigned int CLID
Class ID definition.
Definition
ClassID.h:16
Algorithm.h
JobHistory.h
AlgorithmHistory::algorithm_name
const std::string & algorithm_name() const
Definition
AlgorithmHistory.h:86
AlgorithmHistory::m_algorithm_name
std::string m_algorithm_name
Definition
AlgorithmHistory.h:51
AlgorithmHistory::name
const std::string & name() const override
Definition
AlgorithmHistory.h:102
AlgorithmHistory::classID
static const CLID & classID()
Definition
AlgorithmHistory.cpp:44
AlgorithmHistory::m_jobHistory
const JobHistory * m_jobHistory
Definition
AlgorithmHistory.h:63
AlgorithmHistory::~AlgorithmHistory
virtual ~AlgorithmHistory()
Definition
AlgorithmHistory.cpp:40
AlgorithmHistory::algorithm_version
const std::string & algorithm_version() const
Definition
AlgorithmHistory.h:83
AlgorithmHistory::version
const std::string & version() const override
Definition
AlgorithmHistory.h:104
AlgorithmHistory::properties
const PropertyList & properties() const override
Definition
AlgorithmHistory.h:92
AlgorithmHistory::m_algorithm_version
std::string m_algorithm_version
Definition
AlgorithmHistory.h:48
AlgorithmHistory::HistoryList
std::vector< const AlgorithmHistory * > HistoryList
Definition
AlgorithmHistory.h:41
AlgorithmHistory::dump
std::ostream & dump(std::ostream &, bool isXML, int indent) const override
Definition
AlgorithmHistory.cpp:49
AlgorithmHistory::AlgorithmHistory
AlgorithmHistory(const Gaudi::Algorithm &alg, const JobHistory *job)
Definition
AlgorithmHistory.cpp:21
AlgorithmHistory::m_algorithm
const Gaudi::Algorithm * m_algorithm
Definition
AlgorithmHistory.h:54
AlgorithmHistory::algorithm_type
const std::string & algorithm_type() const
Definition
AlgorithmHistory.h:80
AlgorithmHistory::m_subalgorithm_histories
HistoryList m_subalgorithm_histories
Definition
AlgorithmHistory.h:60
AlgorithmHistory::m_properties
PropertyList m_properties
Definition
AlgorithmHistory.h:57
AlgorithmHistory::m_algorithm_type
std::string m_algorithm_type
Definition
AlgorithmHistory.h:45
Gaudi::Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition
Algorithm.h:87
HistoryObj::indent
virtual void indent(std::ostream &, int) const
Definition
HistoryObj.cpp:37
HistoryObj::convert_string
static std::string convert_string(const std::string &)
Definition
HistoryObj.cpp:14
IVersHistoryObj::PropertyList
std::vector< Gaudi::Details::PropertyBase * > PropertyList
Definition
IVersHistoryObj.h:29
JobHistory
JobHistory class definition.
Definition
JobHistory.h:32
System
Note: OS specific details for environment resolution.
Definition
Environment.h:25
std
STL namespace.
GaudiKernel
src
Lib
AlgorithmHistory.cpp
Generated on
for The Gaudi Framework by
1.17.0