CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
WrapperHolder.h
Go to the documentation of this file.
1 #ifndef DataFormats_Common_WrapperHolder_h
2 #define DataFormats_Common_WrapperHolder_h
3 
4 /*----------------------------------------------------------------------
5 
6 ----------------------------------------------------------------------*/
7 
10 
11 #include <typeinfo>
12 #include <vector>
13 
14 namespace edm {
15  class WrapperHolder {
16  public:
19  void operator()(void const* wrapper) const;
21  };
22 
23  WrapperHolder();
24 
26 
27  bool isValid() const {
28  return wrapper_ != 0 && interface_ != 0;
29  }
30 
31  void fillView(ProductID const& id,
32  std::vector<void const*>& view,
33  helper_vector_ptr& helpers) const {
34  interface_->fillView(wrapper(), id, view, helpers);
35  }
36 
37  void setPtr(std::type_info const& iToType,
38  unsigned long iIndex,
39  void const*& oPtr) const {
40  interface_->setPtr(wrapper(), iToType, iIndex, oPtr);
41  }
42 
43  void fillPtrVector(std::type_info const& iToType,
44  std::vector<unsigned long> const& iIndicies,
45  std::vector<void const*>& oPtr) const {
46  interface_->fillPtrVector(wrapper(), iToType, iIndicies, oPtr);
47  }
48 
49  bool isMergeable() const {
50  return interface_->isMergeable(wrapper());
51  }
52 
53  bool hasIsProductEqual() const {
55  }
56 
57  bool mergeProduct(void const* newProduct) {
58  return interface_->mergeProduct(const_cast<void *>(wrapper()), newProduct);}
59 
60  bool isProductEqual(void const* newProduct) const {
61  return interface_->isProductEqual(wrapper(), newProduct);
62  }
63 
64  bool isPresent() const {
65  return interface_->isPresent(wrapper());
66  }
67 
68  std::type_info const& dynamicTypeInfo() const {
69  return interface_->dynamicTypeInfo();
70  }
71 
72  std::type_info const& wrappedTypeInfo() const {
73  return interface_->wrappedTypeInfo();
74  }
75 
76  void const* wrapper() const {
77  return wrapper_;
78  }
79 
81  return interface_;
82  }
83 
84  void reset() {
85  interface_ = 0;
86  wrapper_ = 0;
87  }
88 
89  private:
90  void const* wrapper_;
92  };
93 
94 }
95 #endif
EDProductDeleter(WrapperInterfaceBase const *interface)
WrapperInterfaceBase const * interface_
Definition: WrapperHolder.h:20
bool isProductEqual(void const *me, void const *newProduct) const
boost::shared_ptr< reftobase::RefVectorHolderBase > helper_vector_ptr
Definition: EDProductfwd.h:46
void operator()(void const *wrapper) const
std::type_info const & dynamicTypeInfo() const
Definition: WrapperHolder.h:68
WrapperInterfaceBase const * interface_
Definition: WrapperHolder.h:91
bool mergeProduct(void const *newProduct)
Definition: WrapperHolder.h:57
std::type_info const & dynamicTypeInfo() const
bool mergeProduct(void *me, void const *newProduct) const
void const * wrapper_
Definition: WrapperHolder.h:90
bool isProductEqual(void const *newProduct) const
Definition: WrapperHolder.h:60
std::type_info const & wrappedTypeInfo() const
WrapperInterfaceBase const * interface() const
Definition: WrapperHolder.h:80
bool hasIsProductEqual() const
Definition: WrapperHolder.h:53
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 fillPtrVector(std::type_info const &iToType, std::vector< unsigned long > const &iIndicies, std::vector< void const * > &oPtr) const
Definition: WrapperHolder.h:43
void fillView(ProductID const &id, std::vector< void const * > &view, helper_vector_ptr &helpers) const
Definition: WrapperHolder.h:31
void setPtr(std::type_info const &iToType, unsigned long iIndex, void const *&oPtr) const
Definition: WrapperHolder.h:37
std::type_info const & wrappedTypeInfo() const
Definition: WrapperHolder.h:72
bool isMergeable() const
Definition: WrapperHolder.h:49
void setPtr(void const *me, std::type_info const &iToType, unsigned long iIndex, void const *&oPtr) const
bool isValid() const
Definition: WrapperHolder.h:27
bool isPresent() const
Definition: WrapperHolder.h:64
void const * wrapper() const
Definition: WrapperHolder.h:76
bool isPresent(void const *me) const
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