CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::Wrapper< T > Class Template Reference

#include <BasicHandle.h>

Inheritance diagram for edm::Wrapper< T >:
edm::WrapperBase edm::ViewTypeChecker

Public Types

typedef T value_type
 
typedef T wrapped_type
 

Public Member Functions

T const * operator-> () const
 
T const * product () const
 
 Wrapper ()
 
 Wrapper (std::unique_ptr< T > ptr)
 
 Wrapper (T *)
 
virtual ~Wrapper ()
 
- Public Member Functions inherited from edm::WrapperBase
std::type_info const & dynamicTypeInfo () const
 
void fillPtrVector (std::type_info const &iToType, std::vector< unsigned long > const &iIndicies, std::vector< void const * > &oPtr) const
 
void fillView (ProductID const &id, std::vector< void const * > &view, FillViewHelperVector &helpers) const
 
bool hasIsProductEqual () const
 
bool isMergeable () const
 
bool isPresent () const
 
bool isProductEqual (WrapperBase const *newProduct) const
 
bool mergeProduct (WrapperBase const *newProduct)
 
bool sameType (WrapperBase const &other) const
 
void setPtr (std::type_info const &iToType, unsigned long iIndex, void const *&oPtr) const
 
std::type_info const & wrappedTypeInfo () const
 
 WrapperBase ()
 
virtual ~WrapperBase ()
 
- Public Member Functions inherited from edm::ViewTypeChecker
std::type_info const & memberTypeInfo () const
 
std::type_info const & valueTypeInfo () const
 
 ViewTypeChecker ()
 
virtual ~ViewTypeChecker ()
 

Static Public Member Functions

static short Class_Version ()
 
static std::type_info const & productTypeInfo ()
 
static std::type_info const & typeInfo ()
 

Private Member Functions

virtual void do_fillPtrVector (std::type_info const &iToType, std::vector< unsigned long > const &iIndices, std::vector< void const * > &oPtr) const override
 
virtual void do_fillView (ProductID const &id, std::vector< void const * > &pointers, FillViewHelperVector &helpers) const override
 
virtual void do_setPtr (std::type_info const &iToType, unsigned long iIndex, void const *&oPtr) const override
 
virtual std::type_info const & dynamicTypeInfo_ () const override
 
virtual bool hasIsProductEqual_ () const override
 
virtual bool isMergeable_ () const override
 
virtual bool isPresent_ () const override
 
virtual bool isProductEqual_ (WrapperBase const *newProduct) const override
 
virtual std::type_info const & memberTypeInfo_ () const override
 
virtual bool mergeProduct_ (WrapperBase const *newProduct) override
 
Wrapper< T > & operator= (Wrapper< T > const &)
 
virtual std::type_info const & valueTypeInfo_ () const override
 
virtual std::type_info const & wrappedTypeInfo_ () const override
 
 Wrapper (Wrapper< T > const &rh)
 

Private Attributes

T obj
 
bool present
 

Detailed Description

template<typename T>
class edm::Wrapper< T >

Definition at line 41 of file BasicHandle.h.

Member Typedef Documentation

template<typename T>
typedef T edm::Wrapper< T >::value_type

Definition at line 27 of file Wrapper.h.

template<typename T>
typedef T edm::Wrapper< T >::wrapped_type

Definition at line 28 of file Wrapper.h.

Constructor & Destructor Documentation

template<typename T>
edm::Wrapper< T >::Wrapper ( )
inline
template<typename T>
edm::Wrapper< T >::Wrapper ( std::unique_ptr< T ptr)
explicit

Definition at line 84 of file Wrapper.h.

References edm::Wrapper< T >::obj, edm::Wrapper< T >::present, and edm::swap_or_assign().

84  :
85  WrapperBase(),
86  present(ptr.get() != 0),
87  obj() {
88  if (present) {
89  // The following will call swap if T has such a function,
90  // and use assignment if T has no such function.
91  swap_or_assign(obj, *ptr);
92  }
93  }
void swap_or_assign(T &a, T &b)
Definition: Wrapper.h:79
bool present
Definition: Wrapper.h:73
template<typename T>
virtual edm::Wrapper< T >::~Wrapper ( )
inlinevirtual

Definition at line 31 of file Wrapper.h.

31 {}
template<typename T>
edm::Wrapper< T >::Wrapper ( T ptr)

Definition at line 96 of file Wrapper.h.

References edm::Wrapper< T >::obj, edm::Wrapper< T >::present, edm::swap_or_assign(), and groupFilesInBlocks::temp.

96  :
97  WrapperBase(),
98  present(ptr != 0),
99  obj() {
100  std::unique_ptr<T> temp(ptr);
101  if (present) {
102  // The following will call swap if T has such a function,
103  // and use assignment if T has no such function.
104  swap_or_assign(obj, *ptr);
105  }
106  }
void swap_or_assign(T &a, T &b)
Definition: Wrapper.h:79
bool present
Definition: Wrapper.h:73
template<typename T>
edm::Wrapper< T >::Wrapper ( Wrapper< T > const &  rh)
private

Member Function Documentation

template<typename T>
static short edm::Wrapper< T >::Class_Version ( )
inlinestatic

Definition at line 43 of file Wrapper.h.

45 :
46  virtual bool isPresent_() const override {return present;}
virtual bool isPresent_() const override
Definition: Wrapper.h:46
bool present
Definition: Wrapper.h:73
template<typename T>
virtual void edm::Wrapper< T >::do_fillPtrVector ( std::type_info const &  iToType,
std::vector< unsigned long > const &  iIndices,
std::vector< void const * > &  oPtr 
) const
overrideprivatevirtual
template<typename T>
virtual void edm::Wrapper< T >::do_fillView ( ProductID const &  id,
std::vector< void const * > &  pointers,
FillViewHelperVector helpers 
) const
overrideprivatevirtual
template<typename T>
virtual void edm::Wrapper< T >::do_setPtr ( std::type_info const &  iToType,
unsigned long  iIndex,
void const *&  oPtr 
) const
overrideprivatevirtual
template<typename T>
virtual std::type_info const& edm::Wrapper< T >::dynamicTypeInfo_ ( ) const
inlineoverrideprivatevirtual

Implements edm::WrapperBase.

Definition at line 47 of file Wrapper.h.

47 {return typeid(T);}
long double T
template<typename T >
bool edm::Wrapper< T >::hasIsProductEqual_ ( ) const
inlineoverrideprivatevirtual

Implements edm::WrapperBase.

Definition at line 136 of file Wrapper.h.

Referenced by edm::Wrapper< L1GctEmCandCollection >::wrappedTypeInfo_().

136  {
137  return detail::getHasIsProductEqual<T>()();
138  }
template<typename T >
bool edm::Wrapper< T >::isMergeable_ ( ) const
inlineoverrideprivatevirtual

Implements edm::WrapperBase.

Definition at line 122 of file Wrapper.h.

Referenced by edm::Wrapper< L1GctEmCandCollection >::wrappedTypeInfo_().

122  {
123  return detail::getHasMergeFunction<T>()();
124  }
template<typename T>
virtual bool edm::Wrapper< T >::isPresent_ ( ) const
inlineoverrideprivatevirtual

Reimplemented from edm::WrapperBase.

Definition at line 46 of file Wrapper.h.

46 {return present;}
bool present
Definition: Wrapper.h:73
template<typename T >
bool edm::Wrapper< T >::isProductEqual_ ( WrapperBase const *  newProduct) const
inlineoverrideprivatevirtual

Implements edm::WrapperBase.

Definition at line 142 of file Wrapper.h.

References edm::Wrapper< T >::obj.

Referenced by edm::Wrapper< L1GctEmCandCollection >::wrappedTypeInfo_().

142  {
143  Wrapper<T> const* wrappedNewProduct = dynamic_cast<Wrapper<T> const*>(newProduct);
144  assert(wrappedNewProduct != nullptr);
145  return detail::doIsProductEqual<T>()(obj, wrappedNewProduct->obj);
146  }
template<typename T >
std::type_info const & edm::Wrapper< T >::memberTypeInfo_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ViewTypeChecker.

Definition at line 116 of file Wrapper.h.

Referenced by edm::Wrapper< L1GctEmCandCollection >::wrappedTypeInfo_().

116  {
117  return detail::getMemberType<T>()();
118  }
template<typename T >
bool edm::Wrapper< T >::mergeProduct_ ( WrapperBase const *  newProduct)
inlineoverrideprivatevirtual

Implements edm::WrapperBase.

Definition at line 128 of file Wrapper.h.

References edm::Wrapper< T >::obj.

Referenced by edm::Wrapper< L1GctEmCandCollection >::wrappedTypeInfo_().

128  {
129  Wrapper<T> const* wrappedNewProduct = dynamic_cast<Wrapper<T> const*>(newProduct);
130  assert(wrappedNewProduct != nullptr);
131  return detail::doMergeProduct<T>()(obj, wrappedNewProduct->obj);
132  }
template<typename T>
T const* edm::Wrapper< T >::operator-> ( ) const
inline

Definition at line 33 of file Wrapper.h.

33 {return product();}
T const * product() const
Definition: Wrapper.h:32
template<typename T>
Wrapper<T>& edm::Wrapper< T >::operator= ( Wrapper< T > const &  )
private
template<typename T>
T const* edm::Wrapper< T >::product ( ) const
inline
template<typename T>
static std::type_info const& edm::Wrapper< T >::productTypeInfo ( )
inlinestatic

Definition at line 36 of file Wrapper.h.

36 {return typeid(T);}
long double T
template<typename T>
static std::type_info const& edm::Wrapper< T >::typeInfo ( )
inlinestatic

Definition at line 37 of file Wrapper.h.

Referenced by fwlite::Scanner< Collection >::Scanner().

37 {return typeid(Wrapper<T>);}
template<typename T >
std::type_info const & edm::Wrapper< T >::valueTypeInfo_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ViewTypeChecker.

Definition at line 110 of file Wrapper.h.

Referenced by edm::Wrapper< L1GctEmCandCollection >::wrappedTypeInfo_().

110  {
111  return detail::getValueType<T>()();
112  }
template<typename T>
virtual std::type_info const& edm::Wrapper< T >::wrappedTypeInfo_ ( ) const
inlineoverrideprivatevirtual

Implements edm::WrapperBase.

Definition at line 48 of file Wrapper.h.

48 {return typeid(Wrapper<T>);}

Member Data Documentation

template<typename T>
T edm::Wrapper< T >::obj
private
template<typename T>
bool edm::Wrapper< T >::present
private