CMS 3D CMS Logo

AssociationMapHelpers.h
Go to the documentation of this file.
1 #ifndef DataFormats_Common_AssociationMapKeyVal_h
2 #define DataFormats_Common_AssociationMapKeyVal_h
3 /*
4  *
5  * helper classes for AssociationMap
6  *
7  * \author Luca Lista, INFN
8  *
9  *
10  */
12 
13 #include <utility>
14 
15 namespace edm {
16 
17  class EDProductGetter;
18 
19  namespace helpers {
20  template<typename K, typename V>
21  struct KeyVal {
22  typedef K key_type;
23  typedef V value_type;
24  KeyVal() : key(), val() { }
25  KeyVal(const K & k, const V & v) : key(k), val(v) { }
26  template<typename K_, typename V_>
27  KeyVal(K_&& k, V_&& v) : key(std::forward<K_>(k)),val(std::forward<V_>(v)){}
28 
29  KeyVal(EDProductGetter const* getter) : key(ProductID(), getter), val(ProductID(), getter) { }
30 
31  K key;
32  V val;
33  };
34 
35  template<typename K>
36  struct Key {
37  typedef K key_type;
38  Key() { }
39  Key(const K & k) : key(k) { }
40  template<typename K_>
41  Key(K_&& k) : key(std::forward<K_>(k)) { }
42 
43  Key(EDProductGetter const* getter) : key(ProductID(), getter) { }
44 
45  K key;
46  };
47 
49  template<typename RP, typename R>
50  void checkRef(const RP & rp, const R & r) {
51  if (rp.id() != r.id()) {
53  }
54  }
55  }
56 }
57 
58 #endif
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
KeyVal(const K &k, const V &v)
int k[5][pyjets_maxn]
Key(EDProductGetter const *getter)
HLT enums.
void checkRef(const RP &rp, const R &r)
throw if r hasn&#39;t the same id as rp
KeyVal(EDProductGetter const *getter)