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 
12  //make sure the process history ID is cached
13  auto tmp = processHistory;
14  ProcessHistoryID id = tmp.setProcessHistoryID();
15  bool newlyAdded = (data_.find(id) == data_.end());
16  if (newlyAdded) {
17  data_.emplace(id, tmp);
18  extra_.emplace(std::move(id), tmp.reduce().id());
19  }
20  return newlyAdded;
21  }
22 
24  auto const& iter = extra_.find(fullID);
25  assert(iter != extra_.end());
26  return iter->second;
27  }
28 
30  auto const& iter = data_.find(key);
31  bool found = (iter != data_.end());
32  if (found) {
33  value = iter->second;
34  }
35  return found;
36  }
37 
39  auto const& iter = data_.find(key);
40  if (iter == data_.end()) {
41  return nullptr;
42  }
43  return &iter->second;
44  }
45 } // namespace edm
bool registerProcessHistory(ProcessHistory const &processHistory)
assert(be >=bs)
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
Definition: value.py:1
std::map< ProcessHistoryID, ProcessHistoryID > extra_
bool getMapped(ProcessHistoryID const &key, ProcessHistory &value) const
HLT enums.
tmp
align.sh
Definition: createJobs.py:716
def move(src, dest)
Definition: eostools.py:511