CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 

Static Public Member Functions

static ParentageRegistryinstance ()
 

Private Attributes

tbb::concurrent_unordered_map
< key_type, value_type,
key_hash
m_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 newFWLiteAna::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  }
tuple result
Definition: query.py:137
tbb::concurrent_unordered_map< key_type, value_type, key_hash > m_map
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 newFWLiteAna::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
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::EventProcessor::init(), edm::ProductProvenance::ProductProvenance(), edm::RootFile::readEntryDescriptionTree(), edm::RootFile::readParentageTree(), 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
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 51 of file ParentageRegistry.h.

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