CMS 3D CMS Logo

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  bool insertMapped(value_type&& v);
42 
44  void clear();
45 
46  struct key_hash {
47  std::size_t operator()(key_type const& iKey) const{
48  return iKey.smallHash();
49  }
50  };
51  private:
52  tbb::concurrent_unordered_map<key_type,value_type,key_hash> m_map;
53  };
54 
55 }
56 
57 #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
tbb::concurrent_unordered_map< key_type, value_type, key_hash > m_map
int k[5][pyjets_maxn]
size_t smallHash() const
returns a short hash which can be used with hashing containers
Definition: Hash.h:224
HLT enums.
static ParentageRegistry * instance()
bool insertMapped(value_type const &v)