CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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>
7  class RefProd;
8  namespace reftobase {
9 
10  struct RefKey {
11  template <typename REF>
12  static size_t key(const REF& r) {
13  return r.key();
14  }
15  };
16 
17  struct RefProdKey {
18  template <typename REF>
19  static size_t key(const REF& r) {
21  "attempting get key from a RefToBase containing a RefProd.\n"
22  "You can use key only with RefToBase containing a Ref.");
23  return 0;
24  }
25  };
26 
27  template <typename REF>
28  struct RefKeyTrait {
29  typedef RefKey type;
30  };
31 
32  template <typename C>
33  struct RefKeyTrait<RefProd<C> > {
34  typedef RefProdKey type;
35  };
36  } // namespace reftobase
37 } // namespace edm
38 
39 #endif
static size_t key(const REF &r)
Definition: RefKeyTrait.h:19
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition: EDMException.cc:84
edm::RefProd< Container > RefProd
static size_t key(const REF &r)
Definition: RefKeyTrait.h:12