CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
edm::FullHistoryToReducedHistoryMap Class Reference

#include <FullHistoryToReducedHistoryMap.h>

Public Member Functions

 FullHistoryToReducedHistoryMap ()
 
ProcessHistoryID const & reduceProcessHistoryID (ProcessHistoryID const &fullID)
 Use to obtain reduced ProcessHistoryID's from full ProcessHistoryID's. More...
 

Private Types

typedef std::map
< ProcessHistoryID,
ProcessHistoryID
Map
 

Private Member Functions

 FullHistoryToReducedHistoryMap (FullHistoryToReducedHistoryMap const &)
 
FullHistoryToReducedHistoryMapoperator= (FullHistoryToReducedHistoryMap const &)
 

Private Attributes

Map cache_
 
Map::const_iterator previous_
 

Detailed Description

Definition at line 35 of file FullHistoryToReducedHistoryMap.h.

Member Typedef Documentation

Definition at line 47 of file FullHistoryToReducedHistoryMap.h.

Constructor & Destructor Documentation

edm::FullHistoryToReducedHistoryMap::FullHistoryToReducedHistoryMap ( )

Definition at line 8 of file FullHistoryToReducedHistoryMap.cc.

References cache_, edm::ProcessHistory::id(), previous_, and query::result.

8  {
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  }
tuple result
Definition: query.py:137
edm::FullHistoryToReducedHistoryMap::FullHistoryToReducedHistoryMap ( FullHistoryToReducedHistoryMap const &  )
private

Member Function Documentation

FullHistoryToReducedHistoryMap& edm::FullHistoryToReducedHistoryMap::operator= ( FullHistoryToReducedHistoryMap const &  )
private
ProcessHistoryID const & edm::FullHistoryToReducedHistoryMap::reduceProcessHistoryID ( ProcessHistoryID const &  fullID)

Use to obtain reduced ProcessHistoryID's from full ProcessHistoryID's.

Definition at line 23 of file FullHistoryToReducedHistoryMap.cc.

References cache_, edm::hlt::Exception, edm::detail::ThreadSafeRegistry< KEY, T, E >::getMapped(), edm::ProcessHistory::id(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), edm::errors::LogicError, previous_, edm::ProcessHistory::reduce(), PhysicsTools::registry, and query::result.

Referenced by edm::SubProcess::beginRun(), and edm::IndexIntoFile::reduceProcessHistoryIDs().

23  {
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  }
static ThreadSafeRegistry * instance()
edm::detail::ThreadSafeRegistry< edm::ProcessHistoryID, edm::ProcessHistory, edm::FullHistoryToReducedHistoryMap > ProcessHistoryRegistry
tuple result
Definition: query.py:137
static Interceptor::Registry registry("Interceptor")

Member Data Documentation

Map edm::FullHistoryToReducedHistoryMap::cache_
private
Map::const_iterator edm::FullHistoryToReducedHistoryMap::previous_
private