CMS 3D CMS Logo

ProcessHistoryRegistry.cc
Go to the documentation of this file.
3 
4 #include <cassert>
5 namespace edm {
7  // insert the mapping for an empty process history
8  extra_.insert(std::pair<ProcessHistoryID, ProcessHistoryID>(ProcessHistory().id(), ProcessHistory().reduce().id()));
9  }
10 
11  bool
13  ProcessHistoryID id = processHistory.id();
14  bool newlyAdded = (data_.find(id) == data_.end());
15  if(newlyAdded) {
16  data_.insert(std::pair<ProcessHistoryID, ProcessHistory>(id, processHistory));
17  ProcessHistory toBeReduced(processHistory);
18  extra_.insert(std::pair<ProcessHistoryID, ProcessHistoryID>(id, toBeReduced.reduce().id()));
19  }
20  return newlyAdded;
21  }
22 
23  ProcessHistoryID const&
25  auto const& iter = extra_.find(fullID);
26  assert(iter != extra_.end());
27  return iter->second;
28  }
29 
30  bool
32  auto const& iter = data_.find(key);
33  bool found = (iter != data_.end());
34  if(found) {
35  value = iter->second;
36  }
37  return found;
38  }
39 
40  ProcessHistory const*
42  auto const& iter = data_.find(key);
43  if(iter == data_.end()) {
44  return nullptr;
45  }
46  return &iter->second;
47  }
48 }
ProcessHistory & reduce()
bool getMapped(ProcessHistoryID const &key, ProcessHistory &value) const
bool registerProcessHistory(ProcessHistory const &processHistory)
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
Definition: value.py:1
std::map< ProcessHistoryID, ProcessHistoryID > extra_
HLT enums.
ProcessHistoryID id() const