test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
WrapperInterfaceBase.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_WrapperInterfaceBase_h
2 #define DataFormats_Provenance_WrapperInterfaceBase_h
3 
4 /*----------------------------------------------------------------------
5 
6 WrapperInterfaceBase: The base class of all things that will be inserted into the Event.
7 /
8 ----------------------------------------------------------------------*/
9 #include "boost/shared_ptr.hpp"
10 
11 #include <typeinfo>
12 #include <vector>
13 
14 namespace edm {
15  class ProductID;
16  namespace reftobase {
17  class RefVectorHolderBase;
18  }
19  typedef boost::shared_ptr<reftobase::RefVectorHolderBase> helper_vector_ptr;
21  public:
23  virtual ~WrapperInterfaceBase();
24 
25  void deleteProduct(void const* me) const {
26  deleteProduct_(me);
27  }
28 
29  void fillView(void const* me,
30  ProductID const& id,
31  std::vector<void const*>& view,
32  helper_vector_ptr& helpers) const;
33 
34  void setPtr(void const* me,
35  std::type_info const& iToType,
36  unsigned long iIndex,
37  void const*& oPtr) const;
38 
39  void fillPtrVector(void const* me,
40  std::type_info const& iToType,
41  std::vector<unsigned long> const& iIndicies,
42  std::vector<void const*>& oPtr) const;
43 
44  bool isMergeable(void const* me) const {
45  return isMergeable_(me);
46  }
47 
48  bool hasIsProductEqual(void const* me) const {
49  return hasIsProductEqual_(me);
50  }
51 
52  bool mergeProduct(void* me, void const* newProduct) const {
53  return mergeProduct_(me, newProduct);
54  }
55 
56  bool isProductEqual(void const* me, void const* newProduct) const {
57  return isProductEqual_(me, newProduct);
58  }
59 
60  bool isPresent(void const* me) const {
61  return isPresent_(me);
62  }
63 
64  std::type_info const& dynamicTypeInfo() const {
65  return dynamicTypeInfo_();
66  }
67 
68  bool sameType(WrapperInterfaceBase const & other) const {
69  return other.dynamicTypeInfo()==dynamicTypeInfo();
70  }
71 
72  std::type_info const& wrappedTypeInfo() const {
73  return wrappedTypeInfo_();
74  }
75 
76  private:
77  virtual void deleteProduct_(void const* me) const = 0;
78 
79  virtual void do_fillView(void const* me,
80  ProductID const& id,
81  std::vector<void const*>& pointers,
82  helper_vector_ptr& helpers) const = 0;
83 
84  virtual void do_setPtr(void const* me,
85  std::type_info const& iToType,
86  unsigned long iIndex,
87  void const*& oPtr) const = 0;
88 
89  virtual void do_fillPtrVector(void const* me,
90  std::type_info const& iToType,
91  std::vector<unsigned long> const& iIndicies,
92  std::vector<void const*>& oPtr) const = 0;
93 
94  virtual bool isMergeable_(void const* me) const = 0;
95 
96  virtual bool hasIsProductEqual_(void const* me) const = 0;
97 
98  virtual bool mergeProduct_(void* me, void const* newProduct) const = 0;
99 
100  virtual bool isProductEqual_(void const* me, void const* newProduct) const = 0;
101 
102  virtual std::type_info const& dynamicTypeInfo_() const = 0;
103 
104  virtual std::type_info const& wrappedTypeInfo_() const = 0;
105 
106  virtual bool isPresent_(void const* me) const = 0;
107  };
108 }
109 #endif
bool isProductEqual(void const *me, void const *newProduct) const
bool sameType(WrapperInterfaceBase const &other) const
boost::shared_ptr< reftobase::RefVectorHolderBase > helper_vector_ptr
Definition: EDProductfwd.h:46
virtual void do_fillPtrVector(void const *me, std::type_info const &iToType, std::vector< unsigned long > const &iIndicies, std::vector< void const * > &oPtr) const =0
std::type_info const & dynamicTypeInfo() const
bool mergeProduct(void *me, void const *newProduct) const
virtual void do_setPtr(void const *me, std::type_info const &iToType, unsigned long iIndex, void const *&oPtr) const =0
virtual void do_fillView(void const *me, ProductID const &id, std::vector< void const * > &pointers, helper_vector_ptr &helpers) const =0
virtual bool isProductEqual_(void const *me, void const *newProduct) const =0
std::type_info const & wrappedTypeInfo() const
virtual void deleteProduct_(void const *me) const =0
virtual bool hasIsProductEqual_(void const *me) const =0
bool isMergeable(void const *me) const
void fillView(void const *me, ProductID const &id, std::vector< void const * > &view, helper_vector_ptr &helpers) const
void deleteProduct(void const *me) const
virtual bool mergeProduct_(void *me, void const *newProduct) const =0
virtual bool isMergeable_(void const *me) const =0
void setPtr(void const *me, std::type_info const &iToType, unsigned long iIndex, void const *&oPtr) const
virtual std::type_info const & dynamicTypeInfo_() const =0
virtual std::type_info const & wrappedTypeInfo_() const =0
bool isPresent(void const *me) const
virtual bool isPresent_(void const *me) const =0
void fillPtrVector(void const *me, std::type_info const &iToType, std::vector< unsigned long > const &iIndicies, std::vector< void const * > &oPtr) const
bool hasIsProductEqual(void const *me) const