The Gaudi Framework  master (37c0b60a)
AlgorithmHistory.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 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 #ifndef GAUDIKERNEL_ALGORITHMHISTORY_H
12 #define GAUDIKERNEL_ALGORITHMHISTORY_H
13 
14 // An object of this class carries the history information
15 // which is specific to a Gaudi algorithm.
16 
17 #include <GaudiKernel/HistoryObj.h>
19 
20 #include <iosfwd>
21 #include <string>
22 #include <typeinfo>
23 #include <vector>
24 
25 namespace Gaudi {
26  class Algorithm;
27 }
28 class JobHistory;
29 
39 
40 public: // typedefs
41  // List of subalgorithm histories. This may change.
43 
44 private: // data
45  // Algorithm full type.
47 
48  // Algorithm version.
50 
51  // Algorithm name.
53 
54  // Algorithm
56 
57  // Properties.
59 
60  // Subalgorithm histories.
62 
63  // Link to jobHistory
65 
66 public: // functions
67  // Constructor from the algorithm.
68  explicit AlgorithmHistory( const Gaudi::Algorithm& alg, const JobHistory* job );
69 
70  // All-fields Constructor for persistency
71  explicit AlgorithmHistory( std::string algVersion, std::string algName, std::string algType,
72  const PropertyList& props, const HistoryList& subHists );
73  // Destructor.
74  virtual ~AlgorithmHistory();
75 
76  // Class IDs
77  const CLID& clID() const override { return classID(); }
78  static const CLID& classID();
79 
80  // Return the algorithm type.
81  const std::string& algorithm_type() const { return m_algorithm_type; }
82 
83  // Return the algorithm version.
84  const std::string& algorithm_version() const { return m_algorithm_version; }
85 
86  // Return the algorithm name.
87  const std::string& algorithm_name() const { return m_algorithm_name; }
88 
89  // The actual algorithm
90  const Gaudi::Algorithm* algorithm() const { return m_algorithm; }
91 
92  // Return the algorithm properties.
93  const PropertyList& properties() const override { return m_properties; }
94 
95  // Return the subalgorithm histories.
96  const HistoryList& subalgorithm_histories() const { return m_subalgorithm_histories; }
97 
98  // Return the jobHistory
99  const JobHistory* jobHistory() const { return m_jobHistory; }
100 
101  std::ostream& dump( std::ostream&, bool isXML, int indent ) const override;
102 
103  const std::string& name() const override { return algorithm_name(); }
104  const std::string& type() const override { return algorithm_type(); }
105  const std::string& version() const override { return algorithm_version(); }
106 
107  // Output stream.
108  friend std::ostream& operator<<( std::ostream& lhs, const AlgorithmHistory& rhs ) {
109  return rhs.dump( lhs, false, 0 );
110  }
111 };
112 
113 #endif
AlgorithmHistory::algorithm
const Gaudi::Algorithm * algorithm() const
Definition: AlgorithmHistory.h:90
HistoryObj::classID
static const CLID & classID()
Definition: HistoryObj.cpp:65
AlgorithmHistory::properties
const PropertyList & properties() const override
Definition: AlgorithmHistory.h:93
std::string
STL class.
AlgorithmHistory::name
const std::string & name() const override
Definition: AlgorithmHistory.h:103
AlgorithmHistory::type
const std::string & type() const override
Definition: AlgorithmHistory.h:104
AlgorithmHistory::algorithm_name
const std::string & algorithm_name() const
Definition: AlgorithmHistory.h:87
AlgorithmHistory::algorithm_version
const std::string & algorithm_version() const
Definition: AlgorithmHistory.h:84
std::vector< const AlgorithmHistory * >
check_ParticleID.props
props
Definition: check_ParticleID.py:21
Algorithm
Alias for backward compatibility.
Definition: Algorithm.h:58
AlgorithmHistory::clID
const CLID & clID() const override
Retrieve reference to class definition structure.
Definition: AlgorithmHistory.h:77
AlgorithmHistory::m_algorithm_type
std::string m_algorithm_type
Definition: AlgorithmHistory.h:46
AlgorithmHistory::dump
std::ostream & dump(std::ostream &, bool isXML, int indent) const override
Definition: AlgorithmHistory.cpp:78
AlgorithmHistory::m_properties
PropertyList m_properties
Definition: AlgorithmHistory.h:58
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:81
AlgorithmHistory::m_algorithm_version
std::string m_algorithm_version
Definition: AlgorithmHistory.h:49
HistoryObj
Definition: HistoryObj.h:31
AlgorithmHistory
Definition: AlgorithmHistory.h:38
AlgorithmHistory::m_algorithm_name
std::string m_algorithm_name
Definition: AlgorithmHistory.h:52
IVersHistoryObj.h
std::ostream
STL class.
Gaudi::Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:90
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
IVersHistoryObj
Definition: IVersHistoryObj.h:28
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition: __init__.py:1
AlgorithmHistory::operator<<
friend std::ostream & operator<<(std::ostream &lhs, const AlgorithmHistory &rhs)
Definition: AlgorithmHistory.h:108
AlgorithmHistory::HistoryList
std::vector< const AlgorithmHistory * > HistoryList
Definition: AlgorithmHistory.h:42
HistoryObj::dump
virtual std::ostream & dump(std::ostream &, bool isXML=false, int indent=0) const =0
AlgorithmHistory::m_subalgorithm_histories
HistoryList m_subalgorithm_histories
Definition: AlgorithmHistory.h:61
AlgorithmHistory::m_jobHistory
const JobHistory * m_jobHistory
Definition: AlgorithmHistory.h:64
AlgorithmHistory::jobHistory
const JobHistory * jobHistory() const
Definition: AlgorithmHistory.h:99
AlgorithmHistory::version
const std::string & version() const override
Definition: AlgorithmHistory.h:105
HistoryObj.h
AlgorithmHistory::subalgorithm_histories
const HistoryList & subalgorithm_histories() const
Definition: AlgorithmHistory.h:96
JobHistory
Definition: JobHistory.h:33
AlgorithmHistory::m_algorithm
const Gaudi::Algorithm * m_algorithm
Definition: AlgorithmHistory.h:55
AlgorithmHistory::algorithm_type
const std::string & algorithm_type() const
Definition: AlgorithmHistory.h:81
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81