CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FullHistoryToReducedHistoryMap.cc
Go to the documentation of this file.
5 
6 namespace edm {
7 
9  // Put in the conversion for the ID of an empty process history.
10  // It always maps onto itself, often is needed, and gives
11  // us something valid to initialize the iterator with. That removes
12  // the need to check for its validity and also for the validity
13  // of the fullID argument to the reduce function, because the invalid
14  // ProcessHistoryID is strangely also defined as the ID of the empty
15  // Process History (maybe that should be fixed ...).
16  ProcessHistory ph;
17  std::pair<ProcessHistoryID, ProcessHistoryID> newEntry(ph.id(), ph.id());
18  std::pair<Map::iterator, bool> result = cache_.insert(newEntry);
19  previous_ = result.first;
20  }
21 
22  ProcessHistoryID const&
24  if (previous_->first == fullID) return previous_->second;
25  Map::const_iterator iter = cache_.find(fullID);
26  if (iter != cache_.end()) {
27  previous_ = iter;
28  return iter->second;
29  }
31  ProcessHistory ph;
32  if (!registry->getMapped(fullID, ph)) {
34  << "FullHistoryToReducedHistoryMap::reduceProcessHistoryID\n"
35  << "ProcessHistory not found in registry\n"
36  << "Contact a Framework developer\n";
37  }
38  ph.reduce();
39  std::pair<ProcessHistoryID, ProcessHistoryID> newEntry(fullID, ph.id());
40  std::pair<Map::iterator, bool> result = cache_.insert(newEntry);
41  previous_ = result.first;
42  return result.first->second;
43  }
44 }
ProcessHistoryID const & reduceProcessHistoryID(ProcessHistoryID const &fullID)
Use to obtain reduced ProcessHistoryID&#39;s from full ProcessHistoryID&#39;s.
static ThreadSafeRegistry * instance()
bool getMapped(key_type const &k, value_type &result) const
tuple result
Definition: query.py:137
static Interceptor::Registry registry("Interceptor")
ProcessHistoryID id() const