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 <Product.h>

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

Public Types

typedef T value_type
 
typedef T wrapped_type
 

Public Member Functions

TbareProduct ()
 
T const * operator-> () const
 
T const * product () const
 
 Wrapper ()
 
template<typename... Args>
 Wrapper (Emplace, Args &&... args)
 
template<typename... Args>
 Wrapper (Emplace, Args &&...)
 
 Wrapper (std::unique_ptr< T > ptr)
 
 Wrapper (T *)
 
 ~Wrapper () override
 
- 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 hasSwap () 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
 
void swapProduct (WrapperBase *newProduct)
 
std::shared_ptr< soa::TableExaminerBasetableExaminer () const
 
std::type_info const & wrappedTypeInfo () const
 
 WrapperBase ()
 
 ~WrapperBase () override
 
- 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

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

Private Attributes

T obj
 
bool present
 

Detailed Description

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

Definition at line 10 of file Product.h.

Member Typedef Documentation

◆ value_type

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

Definition at line 26 of file Wrapper.h.

◆ wrapped_type

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

Definition at line 27 of file Wrapper.h.

Constructor & Destructor Documentation

◆ Wrapper() [1/6]

template<typename T>
edm::Wrapper< T >::Wrapper ( )
inline

Definition at line 28 of file Wrapper.h.

28 : WrapperBase(), present(false), obj() {}

◆ Wrapper() [2/6]

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

Definition at line 84 of file Wrapper.h.

84  : WrapperBase(), present(ptr.get() != nullptr), obj() {
85  if (present) {
86  obj = std::move(*ptr);
87  }
88  }

◆ Wrapper() [3/6]

template<typename T>
template<typename... Args>
edm::Wrapper< T >::Wrapper ( Emplace  ,
Args &&  ... 
)
explicit

◆ ~Wrapper()

template<typename T>
edm::Wrapper< T >::~Wrapper ( )
inlineoverride

Definition at line 33 of file Wrapper.h.

33 {}

◆ Wrapper() [4/6]

template<typename T>
edm::Wrapper< T >::Wrapper ( T ptr)

Definition at line 95 of file Wrapper.h.

95  : WrapperBase(), present(ptr != 0), obj() {
96  std::unique_ptr<T> temp(ptr);
97  if (present) {
98  obj = std::move(*ptr);
99  }
100  }

◆ Wrapper() [5/6]

template<typename T>
edm::Wrapper< T >::Wrapper ( Wrapper< T > const &  rh)
privatedelete

◆ Wrapper() [6/6]

template<typename T>
template<typename... Args>
edm::Wrapper< T >::Wrapper ( Emplace  ,
Args &&...  args 
)

Definition at line 92 of file Wrapper.h.

92 : WrapperBase(), present(true), obj(std::forward<Args>(args)...) {}

Member Function Documentation

◆ bareProduct()

template<typename T>
T& edm::Wrapper< T >::bareProduct ( )
inline

Definition at line 37 of file Wrapper.h.

37 { return obj; }

◆ Class_Version()

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

Definition at line 47 of file Wrapper.h.

49 :
50  bool isPresent_() const override { return present; }

◆ do_fillPtrVector()

template<typename T>
void edm::Wrapper< T >::do_fillPtrVector ( std::type_info const &  iToType,
std::vector< unsigned long > const &  iIndices,
std::vector< void const * > &  oPtr 
) const
overrideprivatevirtual

Implements edm::WrapperBase.

◆ do_fillView()

template<typename T>
void edm::Wrapper< T >::do_fillView ( ProductID const &  id,
std::vector< void const * > &  pointers,
FillViewHelperVector helpers 
) const
overrideprivatevirtual

Implements edm::WrapperBase.

◆ do_setPtr()

template<typename T>
void edm::Wrapper< T >::do_setPtr ( std::type_info const &  iToType,
unsigned long  iIndex,
void const *&  oPtr 
) const
overrideprivatevirtual

Implements edm::WrapperBase.

◆ dynamicTypeInfo_()

template<typename T>
std::type_info const& edm::Wrapper< T >::dynamicTypeInfo_ ( ) const
inlineoverrideprivatevirtual

Implements edm::WrapperBase.

Definition at line 51 of file Wrapper.h.

51 { return typeid(T); }

◆ hasIsProductEqual_()

template<typename T >
bool edm::Wrapper< T >::hasIsProductEqual_ ( ) const
inlineoverrideprivatevirtual

Implements edm::WrapperBase.

Definition at line 125 of file Wrapper.h.

125  {
126  return detail::getHasIsProductEqual<T>()();
127  }

◆ hasSwap_()

template<typename T >
bool edm::Wrapper< T >::hasSwap_ ( ) const
inlineoverrideprivatevirtual

Implements edm::WrapperBase.

Definition at line 137 of file Wrapper.h.

137  {
138  return detail::getHasSwapFunction<T>()();
139  }

◆ isMergeable_()

template<typename T >
bool edm::Wrapper< T >::isMergeable_ ( ) const
inlineoverrideprivatevirtual

Implements edm::WrapperBase.

Definition at line 113 of file Wrapper.h.

113  {
114  return detail::getHasMergeFunction<T>()();
115  }

◆ isPresent_()

template<typename T>
bool edm::Wrapper< T >::isPresent_ ( ) const
inlineoverrideprivatevirtual

Reimplemented from edm::WrapperBase.

Definition at line 50 of file Wrapper.h.

50 { return present; }

◆ isProductEqual_()

template<typename T >
bool edm::Wrapper< T >::isProductEqual_ ( WrapperBase const *  newProduct) const
inlineoverrideprivatevirtual

Implements edm::WrapperBase.

Definition at line 130 of file Wrapper.h.

130  {
131  Wrapper<T> const* wrappedNewProduct = dynamic_cast<Wrapper<T> const*>(newProduct);
132  assert(wrappedNewProduct != nullptr);
133  return detail::doIsProductEqual<T>()(obj, wrappedNewProduct->obj);
134  }

◆ memberTypeInfo_()

template<typename T >
std::type_info const & edm::Wrapper< T >::memberTypeInfo_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ViewTypeChecker.

Definition at line 108 of file Wrapper.h.

108  {
109  return detail::getMemberType<T>()();
110  }

◆ mergeProduct_()

template<typename T >
bool edm::Wrapper< T >::mergeProduct_ ( WrapperBase const *  newProduct)
inlineoverrideprivatevirtual

Implements edm::WrapperBase.

Definition at line 118 of file Wrapper.h.

118  {
119  Wrapper<T> const* wrappedNewProduct = dynamic_cast<Wrapper<T> const*>(newProduct);
120  assert(wrappedNewProduct != nullptr);
121  return detail::doMergeProduct<T>()(obj, wrappedNewProduct->obj);
122  }

◆ operator->()

template<typename T>
T const* edm::Wrapper< T >::operator-> ( ) const
inline

Definition at line 35 of file Wrapper.h.

35 { return product(); }

◆ operator=()

template<typename T>
Wrapper<T>& edm::Wrapper< T >::operator= ( Wrapper< T > const &  )
privatedelete

◆ product()

template<typename T>
T const* edm::Wrapper< T >::product ( ) const
inline

Definition at line 34 of file Wrapper.h.

34 { return (present ? &obj : nullptr); }

Referenced by edm::Wrapper< math::XYZVectorD >::operator->().

◆ productTypeInfo()

template<typename T>
static std::type_info const& edm::Wrapper< T >::productTypeInfo ( )
inlinestatic

Definition at line 40 of file Wrapper.h.

40 { return typeid(T); }

◆ swapProduct_()

template<typename T >
void edm::Wrapper< T >::swapProduct_ ( WrapperBase newProduct)
inlineoverrideprivatevirtual

Implements edm::WrapperBase.

Definition at line 142 of file Wrapper.h.

142  {
143  Wrapper<T>* wrappedNewProduct = dynamic_cast<Wrapper<T>*>(newProduct);
144  assert(wrappedNewProduct != nullptr);
145  detail::doSwapProduct<T>()(obj, wrappedNewProduct->obj);
146  }

◆ tableExaminer_()

template<typename T >
std::shared_ptr< edm::soa::TableExaminerBase > edm::Wrapper< T >::tableExaminer_ ( ) const
inlineoverrideprivatevirtual

Implements edm::WrapperBase.

Definition at line 157 of file Wrapper.h.

157  {
159  }

◆ typeInfo()

template<typename T>
static std::type_info const& edm::Wrapper< T >::typeInfo ( )
inlinestatic

◆ valueTypeInfo_()

template<typename T >
std::type_info const & edm::Wrapper< T >::valueTypeInfo_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ViewTypeChecker.

Definition at line 103 of file Wrapper.h.

103  {
104  return detail::getValueType<T>()();
105  }

◆ wrappedTypeInfo_()

template<typename T>
std::type_info const& edm::Wrapper< T >::wrappedTypeInfo_ ( ) const
inlineoverrideprivatevirtual

Implements edm::WrapperBase.

Definition at line 52 of file Wrapper.h.

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

Member Data Documentation

◆ obj

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

◆ present

template<typename T>
bool edm::Wrapper< T >::present
private
writedatasetfile.args
args
Definition: writedatasetfile.py:18
cms::cuda::assert
assert(be >=bs)
watchdog.const
const
Definition: watchdog.py:83
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::Wrapper::product
T const * product() const
Definition: Wrapper.h:34
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::WrapperBase::WrapperBase
WrapperBase()
Definition: WrapperBase.cc:10
T
long double T
Definition: Basic3DVectorLD.h:48
edm::Wrapper::isPresent_
bool isPresent_() const override
Definition: Wrapper.h:50
edm::Wrapper::present
bool present
Definition: Wrapper.h:79
edm::Wrapper::obj
T obj
Definition: Wrapper.h:80
edm::soa::MakeTableExaminer::make
static std::shared_ptr< edm::soa::TableExaminerBase > make(void const *)
Definition: Wrapper.h:151