CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ParentageRegistry.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_ParentageRegistry_h
2 #define DataFormats_Provenance_ParentageRegistry_h
3 
4 #include "tbb/concurrent_unordered_map.h"
5 
8 
9 
10 // Note that this registry is *not* directly persistable. The contents
11 // are persisted, but not the container.
12 namespace edm
13 {
15  public:
18 
19  static ParentageRegistry* instance();
20 
26  bool getMapped(key_type const& k, value_type& result) const;
27 
31  value_type const* getMapped(key_type const& k) const;
32 
40  bool insertMapped(value_type const& v);
41 
43  void clear();
44 
45  struct key_hash {
46  std::size_t operator()(key_type const& iKey) const{
47  return iKey.smallHash();
48  }
49  };
50  private:
51  tbb::concurrent_unordered_map<key_type,value_type,key_hash> m_map;
52  };
53 
54 }
55 
56 #endif
void clear()
Not thread safe.
edm::ParentageID key_type
bool getMapped(key_type const &k, value_type &result) const
std::size_t operator()(key_type const &iKey) const
tuple result
Definition: query.py:137
tbb::concurrent_unordered_map< key_type, value_type, key_hash > m_map
size_t smallHash() const
returns a short hash which can be used with hashing containers
Definition: Hash.h:220
static ParentageRegistry * instance()
bool insertMapped(value_type const &v)