The Gaudi Framework  master (37c0b60a)
JobHistory.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 
12 #ifndef GAUDIKERNEL_JOBHISTORY_H
13 #define GAUDIKERNEL_JOBHISTORY_H
14 
15 #include <Gaudi/Property.h>
16 #include <GaudiKernel/HistoryObj.h>
18 
19 #include <ctime>
20 #include <iosfwd>
21 #include <memory>
22 #include <string>
23 #include <utility>
24 #include <vector>
25 
33 class GAUDI_API JobHistory : public HistoryObj, virtual public IVersHistoryObj {
34 
35 public:
37 
38 private: // data
42 
47 
49 
52 
54  time_t m_start_time;
55 
56 public: // functions
57  // Constructor.
58  JobHistory();
59  JobHistory( const std::string& rel, const std::string& os, const std::string& host, const std::string& dir,
60  const std::string& osver, const std::string& mach, const std::string& cmtconfig, const time_t& time );
61 
62  // Destructor.
63  virtual ~JobHistory();
64 
65  // Class IDs
66  const CLID& clID() const override { return classID(); }
67  static const CLID& classID();
68 
69  // add a global property
70  void addProperty( const std::string& key, const std::string& value );
71 
72  // Return the job history data.
73  const std::string& release_version() const { return m_release_version; }
74  const std::string& os() const { return m_osname; }
75  const std::string& hostname() const { return m_hostname; }
76  const std::string& os_version() const { return m_os_version; }
77  const std::string& machine() const { return m_machine; }
78  const std::string& dir() const { return m_dir; }
79  const std::string& cmtconfig() const { return m_cmtconfig; }
80  const std::vector<std::string>& environment() const { return m_environ; }
81  const PropertyList& properties() const override { return m_props; }
82  const PropertyPairList& propertyPairs() const { return m_ppl; }
83  time_t start_time() const { return m_start_time; }
84 
85  std::ostream& dump( std::ostream&, bool isXML, int indent ) const override;
86 
87  const std::string& name() const override { return m_machine; }
88  const std::string& version() const override { return m_release_version; }
89  const std::string& type() const override { return m_osname; }
90 
91  // Output stream.
92  friend std::ostream& operator<<( std::ostream& lhs, const JobHistory& rhs ) { return rhs.dump( lhs, false, 0 ); }
93 };
94 
95 #endif
HistoryObj::classID
static const CLID & classID()
Definition: HistoryObj.cpp:65
std::string
STL class.
JobHistory::properties
const PropertyList & properties() const override
Definition: JobHistory.h:81
JobHistory::os
const std::string & os() const
Definition: JobHistory.h:74
JobHistory::environment
const std::vector< std::string > & environment() const
Definition: JobHistory.h:80
std::vector
STL class.
JobHistory::dump
std::ostream & dump(std::ostream &, bool isXML, int indent) const override
Definition: JobHistory.cpp:106
JobHistory::m_props
PropertyList m_props
Definition: JobHistory.h:50
JobHistory::m_machine
std::string m_machine
Definition: JobHistory.h:46
JobHistory::machine
const std::string & machine() const
Definition: JobHistory.h:77
JobHistory::cmtconfig
const std::string & cmtconfig() const
Definition: JobHistory.h:79
JobHistory::operator<<
friend std::ostream & operator<<(std::ostream &lhs, const JobHistory &rhs)
Definition: JobHistory.h:92
JobHistory::dir
const std::string & dir() const
Definition: JobHistory.h:78
JobHistory::m_dir
std::string m_dir
Definition: JobHistory.h:40
JobHistory::type
const std::string & type() const override
Definition: JobHistory.h:89
HistoryObj
Definition: HistoryObj.h:31
JobHistory::m_CVSid
std::vector< std::string > m_CVSid
Definition: JobHistory.h:53
JobHistory::name
const std::string & name() const override
Definition: JobHistory.h:87
IVersHistoryObj.h
JobHistory::PropertyPairList
std::vector< std::pair< std::string, std::unique_ptr< Gaudi::Property< std::string > > > > PropertyPairList
Definition: JobHistory.h:36
std::ostream
STL class.
JobHistory::m_os_version
std::string m_os_version
Definition: JobHistory.h:45
JobHistory::m_osname
std::string m_osname
Definition: JobHistory.h:43
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
IVersHistoryObj
Definition: IVersHistoryObj.h:28
plotSpeedupsPyRoot.time
time
Definition: plotSpeedupsPyRoot.py:180
JobHistory::os_version
const std::string & os_version() const
Definition: JobHistory.h:76
HistoryObj::dump
virtual std::ostream & dump(std::ostream &, bool isXML=false, int indent=0) const =0
JobHistory::m_environ
std::vector< std::string > m_environ
Definition: JobHistory.h:48
JobHistory::clID
const CLID & clID() const override
Retrieve reference to class definition structure.
Definition: JobHistory.h:66
JobHistory::hostname
const std::string & hostname() const
Definition: JobHistory.h:75
JobHistory::start_time
time_t start_time() const
Definition: JobHistory.h:83
HistoryObj.h
JobHistory::m_ppl
PropertyPairList m_ppl
Definition: JobHistory.h:51
JobHistory::m_hostname
std::string m_hostname
Definition: JobHistory.h:44
JobHistory
Definition: JobHistory.h:33
JobHistory::m_release_version
std::string m_release_version
Definition: JobHistory.h:39
JobHistory::release_version
const std::string & release_version() const
Definition: JobHistory.h:73
JobHistory::propertyPairs
const PropertyPairList & propertyPairs() const
Definition: JobHistory.h:82
JobHistory::version
const std::string & version() const override
Definition: JobHistory.h:88
JobHistory::m_cmtconfig
std::string m_cmtconfig
Definition: JobHistory.h:41
JobHistory::~JobHistory
virtual ~JobHistory()
ProduceConsume.key
key
Definition: ProduceConsume.py:84
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
JobHistory::m_start_time
time_t m_start_time
Definition: JobHistory.h:54
Property.h