CMS 3D CMS Logo

HolderToVectorTrait.h
Go to the documentation of this file.
1 #ifndef DataFormats_Common_HolderToVectorTrait_h
2 #define DataFormats_Common_HolderToVectorTrait_h
4 #include <memory>
5 
6 namespace edm {
7  namespace reftobase {
8  class RefVectorHolderBase;
9  template <typename T>
10  class BaseVectorHolder;
11 
12  template <typename T, typename REF>
14  static std::unique_ptr<BaseVectorHolder<T> > makeVectorHolder() {
16  "InvalidHolderToVector: trying to use RefToBase built with "
17  "an internal type. RefToBase should be built passing an "
18  "object of type edm::Ref<C>. This exception should never "
19  "be thrown if a RefToBase was built from a RefProd<C>.");
20  return std::unique_ptr<BaseVectorHolder<T> >();
21  }
22  };
23 
24  template <typename T, typename REF>
26  // static_assert(sizeof(REF) == 0);
28  };
29 
30  template <typename REF>
32  static std::unique_ptr<RefVectorHolderBase> makeVectorHolder() {
34  "InvalidRefHolderToRefVector: trying to use RefToBaseVector built with "
35  "an internal type. RefToBase should be built passing an "
36  "object of type edm::RefVector<C>");
37  return std::unique_ptr<RefVectorHolderBase>();
38  }
39  };
40 
41  template <typename REF>
43  // static_assert(sizeof(REF) == 0);
45  };
46 
47  } // namespace reftobase
48 } // namespace edm
49 
50 //Handle specialization here
54 
55 #endif
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition: EDMException.cc:83
static std::unique_ptr< RefVectorHolderBase > makeVectorHolder()
static std::unique_ptr< BaseVectorHolder< T > > makeVectorHolder()
InvalidRefHolderToRefVector< REF > type
HLT enums.
InvalidHolderToVector< T, REF > type