The Gaudi Framework  v33r0 (d5ea422b)
AlgorithmHistory.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 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( const std::string& algVersion, const std::string& algName, const 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  void dump( std::ostream&, const bool isXML = false, int indent = 0 ) 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 
108 // Output stream.
110 
111 #endif
const std::string & algorithm_version() const
const std::string & algorithm_type() const
const std::string & name() const override
const std::string & type() const override
static const CLID & classID()
Definition: HistoryObj.cpp:65
virtual void dump(std::ostream &, const bool isXML=false, int indent=0) const =0
AlgorithmHistory class definition.
std::vector< const AlgorithmHistory * > HistoryList
Base class for History Objects.
Definition: HistoryObj.h:31
std::string m_algorithm_type
std::string m_algorithm_version
JobHistory class definition.
Definition: JobHistory.h:32
HistoryList m_subalgorithm_histories
STL class.
const std::string & algorithm_name() const
PropertyList m_properties
const Gaudi::Algorithm * algorithm() const
const PropertyList & properties() const override
std::string m_algorithm_name
const std::string & version() const override
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
Alias for backward compatibility.
Definition: Algorithm.h:66
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:89
const HistoryList & subalgorithm_histories() const
const JobHistory * jobHistory() const
Interface for Versioned History Objects.
#define GAUDI_API
Definition: Kernel.h:81
STL class.
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1
const Gaudi::Algorithm * m_algorithm
const CLID & clID() const override
Retrieve reference to class definition structure.
const JobHistory * m_jobHistory
GAUDI_API std::ostream & operator<<(std::ostream &lhs, const AlgorithmHistory &rhs)