CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
edm::ParentageRegistry Class Reference

#include <ParentageRegistry.h>

Classes

struct  key_hash
 

Public Types

typedef edm::ParentageID key_type
 
typedef edm::Parentage value_type
 

Public Member Functions

void clear ()
 Not thread safe. More...
 
bool getMapped (key_type const &k, value_type &result) const
 
value_type const * getMapped (key_type const &k) const
 
bool insertMapped (value_type const &v)
 
bool insertMapped (value_type &&v)
 

Static Public Member Functions

static ParentageRegistryinstance ()
 

Private Attributes

tbb::concurrent_unordered_map< key_type, value_type, key_hashm_map
 

Detailed Description

Definition at line 14 of file ParentageRegistry.h.

Member Typedef Documentation

Definition at line 16 of file ParentageRegistry.h.

Definition at line 17 of file ParentageRegistry.h.

Member Function Documentation

void edm::ParentageRegistry::clear ( void  )
bool edm::ParentageRegistry::getMapped ( key_type const &  k,
value_type result 
) const

Retrieve the value_type object with the given key. If we return 'true', then 'result' carries the value_type object. If we return 'false, no matching key was found, and the value of 'result' is undefined.

Definition at line 11 of file ParentageRegistry.cc.

References runEdmFileComparison::found, and m_map.

Referenced by ProvenanceDumper::addAncestors(), edm::PoolOutputModule::fillDependencyGraph(), edm::ProductProvenance::parentage(), edm::StreamSerializer::serializeEvent(), ProvenanceDumper::work_(), and edm::RootOutputFile::writeParentageRegistry().

12  {
13  auto it = m_map.find(k);
14  bool found = it != m_map.end();
15  if(found) {
16  result = it->second;
17  }
18  return found;
19  }
tbb::concurrent_unordered_map< key_type, value_type, key_hash > m_map
int k[5][pyjets_maxn]
ParentageRegistry::value_type const * edm::ParentageRegistry::getMapped ( key_type const &  k) const

Retrieve a pointer to the value_type object with the given key. If there is no object associated with the given key 0 is returned.

Definition at line 22 of file ParentageRegistry.cc.

References runEdmFileComparison::found, and m_map.

23  {
24  auto it = m_map.find(k);
25  bool found = it != m_map.end();
26  return found? &(it->second) : static_cast<value_type const*>(nullptr);
27  }
tbb::concurrent_unordered_map< key_type, value_type, key_hash > m_map
int k[5][pyjets_maxn]
bool edm::ParentageRegistry::insertMapped ( value_type const &  v)

Insert the given value_type object into the registry. If there was already a value_type object with the same key, we don't change it. This should be OK, since it should have the same contents if the key is the same. Return 'true' if we really added the new value_type object, and 'false' if the value_type object was already present.

Definition at line 30 of file ParentageRegistry.cc.

References edm::Parentage::id(), m_map, and findQualityFiles::v.

Referenced by edm::Event::commit_aux(), edm::EventProcessor::init(), edm::ProductProvenance::ProductProvenance(), edm::RootFile::readEntryDescriptionTree(), edm::RootFile::readParentageTree(), edm::SwitchBaseProductResolver::SwitchBaseProductResolver(), and ProvenanceDumper::work_().

30  {
31  return m_map.insert(std::make_pair(v.id(),v)).second;
32  }
tbb::concurrent_unordered_map< key_type, value_type, key_hash > m_map
bool edm::ParentageRegistry::insertMapped ( value_type &&  v)

Definition at line 35 of file ParentageRegistry.cc.

References m_map, eostools::move(), edm::second(), and findQualityFiles::v.

35  {
36  return m_map.emplace(v.id(),std::move(v)).second;
37  }
U second(std::pair< T, U > const &p)
tbb::concurrent_unordered_map< key_type, value_type, key_hash > m_map
def move(src, dest)
Definition: eostools.py:511
ParentageRegistry * edm::ParentageRegistry::instance ( )
static

Member Data Documentation

tbb::concurrent_unordered_map<key_type,value_type,key_hash> edm::ParentageRegistry::m_map
private

Definition at line 52 of file ParentageRegistry.h.

Referenced by clear(), getMapped(), and insertMapped().