#include <FullHistoryToReducedHistoryMap.h>
Public Member Functions | |
FullHistoryToReducedHistoryMap () | |
ProcessHistoryID const & | reduceProcessHistoryID (ProcessHistoryID const &fullID) |
Use to obtain reduced ProcessHistoryID's from full ProcessHistoryID's. | |
Private Types | |
typedef std::map < ProcessHistoryID, ProcessHistoryID > | Map |
Private Member Functions | |
FullHistoryToReducedHistoryMap (FullHistoryToReducedHistoryMap const &) | |
FullHistoryToReducedHistoryMap & | operator= (FullHistoryToReducedHistoryMap const &) |
Private Attributes | |
Map | cache_ |
Map::const_iterator | previous_ |
Definition at line 35 of file FullHistoryToReducedHistoryMap.h.
typedef std::map<ProcessHistoryID, ProcessHistoryID> edm::FullHistoryToReducedHistoryMap::Map [private] |
Definition at line 47 of file FullHistoryToReducedHistoryMap.h.
edm::FullHistoryToReducedHistoryMap::FullHistoryToReducedHistoryMap | ( | ) |
Definition at line 8 of file FullHistoryToReducedHistoryMap.cc.
References cache_, edm::ProcessHistory::id(), previous_, and query::result.
{ // Put in the conversion for the ID of an empty process history. // It always maps onto itself, often is needed, and gives // us something valid to initialize the iterator with. That removes // the need to check for its validity and also for the validity // of the fullID argument to the reduce function, because the invalid // ProcessHistoryID is strangely also defined as the ID of the empty // Process History (maybe that should be fixed ...). ProcessHistory ph; std::pair<ProcessHistoryID, ProcessHistoryID> newEntry(ph.id(), ph.id()); std::pair<Map::iterator, bool> result = cache_.insert(newEntry); previous_ = result.first; }
edm::FullHistoryToReducedHistoryMap::FullHistoryToReducedHistoryMap | ( | FullHistoryToReducedHistoryMap const & | ) | [private] |
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_, Exception, edm::detail::ThreadSafeRegistry< KEY, T, E >::getMapped(), edm::ProcessHistory::id(), instance, edm::errors::LogicError, previous_, edm::ProcessHistory::reduce(), PhysicsTools::registry, and query::result.
Referenced by edm::SubProcess::beginRun(), and edm::IndexIntoFile::reduceProcessHistoryIDs().
{ if (previous_->first == fullID) return previous_->second; Map::const_iterator iter = cache_.find(fullID); if (iter != cache_.end()) { previous_ = iter; return iter->second; } ProcessHistoryRegistry* registry = ProcessHistoryRegistry::instance(); ProcessHistory ph; if (!registry->getMapped(fullID, ph)) { throw Exception(errors::LogicError) << "FullHistoryToReducedHistoryMap::reduceProcessHistoryID\n" << "ProcessHistory not found in registry\n" << "Contact a Framework developer\n"; } ph.reduce(); std::pair<ProcessHistoryID, ProcessHistoryID> newEntry(fullID, ph.id()); std::pair<Map::iterator, bool> result = cache_.insert(newEntry); previous_ = result.first; return result.first->second; }
Definition at line 48 of file FullHistoryToReducedHistoryMap.h.
Referenced by FullHistoryToReducedHistoryMap(), and reduceProcessHistoryID().
Map::const_iterator edm::FullHistoryToReducedHistoryMap::previous_ [private] |
Definition at line 49 of file FullHistoryToReducedHistoryMap.h.
Referenced by FullHistoryToReducedHistoryMap(), and reduceProcessHistoryID().