CMS 3D CMS Logo

ProcessHistory.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_ProcessHistory_h
2 #define DataFormats_Provenance_ProcessHistory_h
3 
6 
7 #include <iosfwd>
8 #include <string>
9 #include <utility>
10 #include <vector>
11 
12 namespace edm {
14  public:
16  typedef std::vector<value_type> collection_type;
17 
18  typedef collection_type::iterator iterator;
19  typedef collection_type::const_iterator const_iterator;
20 
21  typedef collection_type::reverse_iterator reverse_iterator;
22  typedef collection_type::const_reverse_iterator const_reverse_iterator;
23 
25  typedef collection_type::const_reference const_reference;
26 
28 
31  explicit ProcessHistory(collection_type const& vec) : data_(vec), transient_() {}
32 
33  template <typename... Args>
34  void emplace_back(Args&&... args) {
35  data_.emplace_back(std::forward<Args>(args)...);
36  phid() = ProcessHistoryID();
37  }
38 
40  data_.insert(data_.begin(), t);
41  phid() = ProcessHistoryID();
42  }
44  data_.push_back(t);
45  phid() = ProcessHistoryID();
46  }
48  data_.swap(other.data_);
49  phid().swap(other.phid());
50  }
51  bool empty() const { return data_.empty(); }
52  size_type size() const { return data_.size(); }
53  size_type capacity() const { return data_.capacity(); }
54  void reserve(size_type n) { data_.reserve(n); }
55 
58 
59  reference at(size_type i) { return data_.at(i); }
60  const_reference at(size_type i) const { return data_.at(i); }
61 
62  const_iterator begin() const { return data_.begin(); }
63  const_iterator end() const { return data_.end(); }
64 
65  const_reverse_iterator rbegin() const { return data_.rbegin(); }
66  const_reverse_iterator rend() const { return data_.rend(); }
67 
68  // iterator begin() {return data_.begin();}
69  // iterator end() {return data_.end();}
70 
71  // reverse_iterator rbegin() {return data_.rbegin();}
72  // reverse_iterator rend() {return data_.rend();}
73 
74  collection_type const& data() const { return data_; }
75  ProcessHistoryID id() const;
77 
78  // Return true, and fill in config appropriately, if the a process
79  // with the given name is recorded in this ProcessHistory. Return
80  // false, and do not modify config, if process with the given name
81  // is not found.
83 
84  void clear() {
85  data_.clear();
86  phid() = ProcessHistoryID();
87  }
88 
90 
92 
93  struct Transients {
94  Transients() : phid_() {}
95  void reset() { phid_.reset(); }
97  };
98 
99  private:
103  };
104 
105  // Free swap function
106  inline void swap(ProcessHistory& a, ProcessHistory& b) { a.swap(b); }
107 
108  inline bool operator==(ProcessHistory const& a, ProcessHistory const& b) { return a.data() == b.data(); }
109 
110  inline bool operator!=(ProcessHistory const& a, ProcessHistory const& b) { return !(a == b); }
111 
112  bool isAncestor(ProcessHistory const& a, ProcessHistory const& b);
113 
114  inline bool isDescendant(ProcessHistory const& a, ProcessHistory const& b) { return isAncestor(b, a); }
115 
116  std::ostream& operator<<(std::ostream& ost, ProcessHistory const& ph);
117 } // namespace edm
118 
119 #endif
writedatasetfile.args
args
Definition: writedatasetfile.py:18
edm::ProcessHistory::transient_
Transients transient_
Definition: ProcessHistory.h:102
ProcessHistoryID.h
edm::ProcessHistory::Transients::phid_
ProcessHistoryID phid_
Definition: ProcessHistory.h:96
edm::ProcessHistory::ProcessHistory
ProcessHistory(collection_type const &vec)
Definition: ProcessHistory.h:31
edm::ProcessHistory::value_type
ProcessConfiguration value_type
Definition: ProcessHistory.h:15
edm::ProcessHistory::rend
const_reverse_iterator rend() const
Definition: ProcessHistory.h:66
mps_fire.i
i
Definition: mps_fire.py:428
edm::ProcessHistory::initializeTransients
void initializeTransients()
Definition: ProcessHistory.h:91
edm::ProcessHistory::ProcessHistory
ProcessHistory()
Definition: ProcessHistory.h:29
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
edm::Hash::swap
void swap(Hash< I > &other)
Definition: Hash.h:181
ProducerES_cfi.ProcessHistory
ProcessHistory
Definition: ProducerES_cfi.py:14
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ProcessHistory::rbegin
const_reverse_iterator rbegin() const
Definition: ProcessHistory.h:65
edm::swap
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
edm::ProcessHistory::id
ProcessHistoryID id() const
Definition: ProcessHistory.cc:10
edm::ProcessHistory::getConfigurationForProcess
bool getConfigurationForProcess(std::string const &name, ProcessConfiguration &config) const
Definition: ProcessHistory.cc:34
edm::ProcessHistory::const_reverse_iterator
collection_type::const_reverse_iterator const_reverse_iterator
Definition: ProcessHistory.h:22
edm::isDescendant
bool isDescendant(ProcessHistory const &a, ProcessHistory const &b)
Definition: ProcessHistory.h:114
edm::ProcessHistory::at
reference at(size_type i)
Definition: ProcessHistory.h:59
edm::ProcessHistory::push_front
void push_front(const_reference t)
Definition: ProcessHistory.h:39
edm::operator<<
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
Definition: HLTGlobalStatus.h:106
config
Definition: config.py:1
edm::ProcessHistory::const_reference
collection_type::const_reference const_reference
Definition: ProcessHistory.h:25
edm::ProcessHistory::swap
void swap(ProcessHistory &other)
Definition: ProcessHistory.h:47
edm::operator!=
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
Definition: debugging_allocator.h:75
edm::ProcessHistory::operator[]
const_reference operator[](size_type i) const
Definition: ProcessHistory.h:57
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
edm::ProcessHistory::Transients
Definition: ProcessHistory.h:93
edm::ProcessHistory::size_type
collection_type::size_type size_type
Definition: ProcessHistory.h:27
edm::isAncestor
bool isAncestor(ProcessHistory const &a, ProcessHistory const &b)
Definition: ProcessHistory.cc:53
ProcessConfiguration.h
edm::operator==
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
Definition: debugging_allocator.h:72
edm::ProcessHistory::clear
void clear()
Definition: ProcessHistory.h:84
edm::ProcessHistory::Transients::Transients
Transients()
Definition: ProcessHistory.h:94
edm::ProcessHistory::operator[]
reference operator[](size_type i)
Definition: ProcessHistory.h:56
edm::Hash< ProcessHistoryType >
edm::ProcessHistory::collection_type
std::vector< value_type > collection_type
Definition: ProcessHistory.h:16
trackingPlots.other
other
Definition: trackingPlots.py:1460
edm::ProcessHistory::at
const_reference at(size_type i) const
Definition: ProcessHistory.h:60
edm::ProcessHistory::capacity
size_type capacity() const
Definition: ProcessHistory.h:53
b
double b
Definition: hdecay.h:118
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ProcessHistory::size
size_type size() const
Definition: ProcessHistory.h:52
a
double a
Definition: hdecay.h:119
edm::ProcessHistory::empty
bool empty() const
Definition: ProcessHistory.h:51
edm::ProcessHistory::const_iterator
collection_type::const_iterator const_iterator
Definition: ProcessHistory.h:19
edm::ProcessHistory::iterator
collection_type::iterator iterator
Definition: ProcessHistory.h:18
edm::ProcessHistory::data_
collection_type data_
Definition: ProcessHistory.h:101
edm::ProcessHistory::reverse_iterator
collection_type::reverse_iterator reverse_iterator
Definition: ProcessHistory.h:21
RecoTauValidation_cfi.reference
reference
Definition: RecoTauValidation_cfi.py:234
edm::ProcessHistory::end
const_iterator end() const
Definition: ProcessHistory.h:63
edm::ProcessHistory::ProcessHistory
ProcessHistory(size_type n)
Definition: ProcessHistory.h:30
edm::ProcessHistory::reference
collection_type::reference reference
Definition: ProcessHistory.h:24
edm::ProcessHistory::emplace_back
void emplace_back(Args &&... args)
Definition: ProcessHistory.h:34
edm::ProcessHistory::data
collection_type const & data() const
Definition: ProcessHistory.h:74
edm::ProcessHistory::setProcessHistoryID
ProcessHistoryID setProcessHistoryID()
Definition: ProcessHistory.cc:27
edm::ProcessHistory::phid
ProcessHistoryID & phid()
Definition: ProcessHistory.h:100
edm::ProcessHistoryID
Hash< ProcessHistoryType > ProcessHistoryID
Definition: ProcessHistoryID.h:8
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ProcessHistory::reserve
void reserve(size_type n)
Definition: ProcessHistory.h:54
edm::ProcessHistory::Transients::reset
void reset()
Definition: ProcessHistory.h:95
edm::ProcessHistory::begin
const_iterator begin() const
Definition: ProcessHistory.h:62
edm::ProcessHistory
Definition: ProcessHistory.h:13
edm::Hash::reset
void reset()
Definition: Hash.h:136
edm::ProcessHistory::reduce
ProcessHistory & reduce()
Definition: ProcessHistory.cc:45
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::ProcessHistory::push_back
void push_back(const_reference t)
Definition: ProcessHistory.h:43
edm::ProcessConfiguration
Definition: ProcessConfiguration.h:14