CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 //#include <boost/static_assert.hpp>
6 
7 namespace edm {
8  namespace reftobase {
9  class RefVectorHolderBase;
10  template <typename T> class BaseVectorHolder;
11 
12  template <typename T, typename REF>
14  static std::auto_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::auto_ptr<BaseVectorHolder<T> >();
21  }
22  static std::auto_ptr<RefVectorHolderBase> makeVectorBaseHolder() {
24  "InvalidHolderToVector: trying to use RefToBase built with "
25  "an internal type. RefToBase should be built passing an "
26  "object of type edm::Ref<C>. This exception should never "
27  "be thrown if a RefToBase was built from a RefProd<C>.");
28  return std::auto_ptr<RefVectorHolderBase>();
29  }
30  };
31 
32  template<typename T, typename REF>
34  // BOOST_STATIC_ASSERT(sizeof(REF) == 0);
36  };
37 
38  template <typename REF>
40  static std::auto_ptr<RefVectorHolderBase> makeVectorHolder() {
42  "InvalidRefHolderToRefVector: trying to use RefToBaseVector built with "
43  "an internal type. RefToBase should be built passing an "
44  "object of type edm::RefVector<C>");
45  return std::auto_ptr<RefVectorHolderBase>();
46  }
47  static std::auto_ptr<RefVectorHolderBase> makeVectorBaseHolder() {
49  "InvalidRefHolderToRefVector: trying to use RefToBaseVector built with "
50  "an internal type. RefToBase should be built passing an "
51  "object of type edm::RefVector<C>");
52  return std::auto_ptr<RefVectorHolderBase>();
53  }
54  };
55 
56  template<typename REF>
58  // BOOST_STATIC_ASSERT(sizeof(REF) == 0);
60  };
61 
62  }
63 }
64 
65 #endif
static std::auto_ptr< RefVectorHolderBase > makeVectorBaseHolder()
static std::auto_ptr< RefVectorHolderBase > makeVectorBaseHolder()
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
InvalidRefHolderToRefVector< REF > type
static std::auto_ptr< RefVectorHolderBase > makeVectorHolder()
static std::auto_ptr< BaseVectorHolder< T > > makeVectorHolder()
InvalidHolderToVector< T, REF > type