The Gaudi Framework  master (d98a2936)
DataHistory.h
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 #pragma once
12 
13 // History for an event data object.
14 
15 #include <GaudiKernel/HistoryObj.h>
16 
17 #include <GaudiKernel/ClassID.h>
18 #include <GaudiKernel/StatusCode.h>
19 #include <iostream>
20 #include <string>
21 #include <vector>
22 
23 class AlgorithmHistory;
24 
33 
34 public:
35  class DataHistoryOrder final {
36  public:
37  bool operator()( const DataHistory& lhs, const DataHistory& rhs ) const {
38  return std::tie( lhs.m_dataClassID, lhs.m_dataKey, lhs.m_algHist ) <
39  std::tie( rhs.m_dataClassID, rhs.m_dataKey, rhs.m_algHist );
40  }
41  bool operator()( const DataHistory* lhs, const DataHistory* rhs ) const { return ( *this )( *lhs, *rhs ); }
42  };
43 
44  DataHistory( const CLID& id, std::string key, AlgorithmHistory* alg );
45 
46  const CLID& clID() const override { return DataHistory::classID(); }
47  static const CLID& classID();
48 
49  const std::string& dataKey() const { return m_dataKey; }
50  const CLID& dataClassID() const { return m_dataClassID; }
51 
52  AlgorithmHistory* algorithmHistory() const { return m_algHist; }
53 
54  std::ostream& dump( std::ostream&, const bool isXML, int indent ) const override;
55  friend std::ostream& operator<<( std::ostream& lhs, const DataHistory& rhs ) { return rhs.dump( lhs, false, 0 ); }
56 
57 private:
59  std::string m_dataKey;
61  std::string m_dummy = "none";
62 };
HistoryObj::classID
static const CLID & classID()
Definition: HistoryObj.cpp:44
DataHistory::DataHistoryOrder::operator()
bool operator()(const DataHistory *lhs, const DataHistory *rhs) const
Definition: DataHistory.h:41
DataHistory::algorithmHistory
AlgorithmHistory * algorithmHistory() const
Definition: DataHistory.h:52
DataHistory::DataHistoryOrder
Definition: DataHistory.h:35
DataHistory::classID
static const CLID & classID()
Definition: DataHistory.cpp:21
DataHistory::m_algHist
AlgorithmHistory * m_algHist
Definition: DataHistory.h:60
ClassID.h
DataHistory::clID
const CLID & clID() const override
Retrieve reference to class definition structure.
Definition: DataHistory.h:46
DataHistory::DataHistoryOrder::operator()
bool operator()(const DataHistory &lhs, const DataHistory &rhs) const
Definition: DataHistory.h:37
StatusCode.h
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:81
HistoryObj
Definition: HistoryObj.h:30
AlgorithmHistory
Definition: AlgorithmHistory.h:37
DataHistory::dump
std::ostream & dump(std::ostream &, const bool isXML, int indent) const override
Definition: DataHistory.cpp:27
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:16
DataHistory::m_dataClassID
CLID m_dataClassID
Definition: DataHistory.h:58
HistoryObj::dump
virtual std::ostream & dump(std::ostream &, bool isXML=false, int indent=0) const =0
DataHistory::dataClassID
const CLID & dataClassID() const
Definition: DataHistory.h:50
DataHistory::operator<<
friend std::ostream & operator<<(std::ostream &lhs, const DataHistory &rhs)
Definition: DataHistory.h:55
HistoryObj.h
DataHistory::dataKey
const std::string & dataKey() const
Definition: DataHistory.h:49
DataHistory
Definition: DataHistory.h:32
DataHistory::m_dataKey
std::string m_dataKey
Definition: DataHistory.h:59
ProduceConsume.key
key
Definition: ProduceConsume.py:84
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:49