test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RefKeyTrait.h
Go to the documentation of this file.
1 #ifndef DataFormats_Common_RefKeyTrait_h
2 #define DataFormats_Common_RefKeyTrait_h
4 
5 namespace edm {
6  template <typename C> class RefProd;
7  namespace reftobase {
8 
9  struct RefKey {
10  template<typename REF>
11  static size_t key( const REF & r ) {
12  return r.key();
13  }
14  };
15 
16  struct RefProdKey {
17  template<typename REF>
18  static size_t key( const REF & r ) {
20  "attempting get key from a RefToBase containing a RefProd.\n"
21  "You can use key only with RefToBase containing a Ref.");
22  return 0;
23  }
24  };
25 
26  template<typename REF>
27  struct RefKeyTrait {
28  typedef RefKey type;
29  };
30 
31  template<typename C>
32  struct RefKeyTrait<RefProd<C> > {
33  typedef RefProdKey type;
34  };
35  }
36 }
37 
38 #endif
static size_t key(const REF &r)
Definition: RefKeyTrait.h:18
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
edm::RefProd< Container > RefProd
static size_t key(const REF &r)
Definition: RefKeyTrait.h:11