CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

edm::Wrapper< T > Class Template Reference

#include <Wrapper.h>

Inheritance diagram for edm::Wrapper< T >:
edm::EDProduct

List of all members.

Public Types

typedef T value_type
typedef T wrapped_type

Public Member Functions

T const * operator-> () const
T const * product () const
 Wrapper ()
 Wrapper (std::auto_ptr< T > ptr)
 Wrapper (T *)
virtual ~Wrapper ()

Static Public Member Functions

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
virtual void do_fillView (ProductID const &id, std::vector< void const * > &pointers, helper_vector_ptr &helpers) const
virtual void do_setPtr (std::type_info const &iToType, unsigned long iIndex, void const *&oPtr) const
virtual std::type_info const & dynamicTypeInfo_ () const
virtual bool hasIsProductEqual_ () const
virtual bool isMergeable_ () const
virtual bool isPresent_ () const
virtual bool isProductEqual_ (EDProduct const *newProduct) const
virtual bool mergeProduct_ (EDProduct const *newProduct)
Wrapper< T > & operator= (Wrapper< T > const &)
 Wrapper (Wrapper< T > const &rh)

Private Attributes

T obj
bool present

Detailed Description

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

Definition at line 28 of file Wrapper.h.


Member Typedef Documentation

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

Definition at line 30 of file Wrapper.h.

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

Definition at line 31 of file Wrapper.h.


Constructor & Destructor Documentation

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

Definition at line 32 of file Wrapper.h.

: EDProduct(), present(false), obj() {}
template<typename T >
edm::Wrapper< T >::Wrapper ( std::auto_ptr< T ptr) [explicit]

Definition at line 271 of file Wrapper.h.

References edm::Wrapper< T >::obj, edm::Wrapper< T >::present, and relativeConstraints::value.

                                        :
    EDProduct(),
    present(ptr.get() != 0),
    obj() {
    if (present) {
      // The following will call swap if T has such a function,
      // and use assignment if T has no such function.
      typename boost::mpl::if_c<detail::has_swap_function<T>::value,
        DoSwap<T>,
        DoAssign<T> >::type swap_or_assign;
      swap_or_assign(obj, *ptr);
    }
  }
template<typename T>
virtual edm::Wrapper< T >::~Wrapper ( ) [inline, virtual]

Definition at line 34 of file Wrapper.h.

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

REFLEX must call the following constructor the constructor takes ownership of T*

Definition at line 286 of file Wrapper.h.

References edm::Wrapper< T >::obj, edm::Wrapper< T >::present, cond::rpcobtemp::temp, and relativeConstraints::value.

                            :
  EDProduct(),
  present(ptr != 0),
  obj() {
     std::auto_ptr<T> temp(ptr);
     if (present) {
        // The following will call swap if T has such a function,
        // and use assignment if T has no such function.
        typename boost::mpl::if_c<detail::has_swap_function<T>::value,
        DoSwap<T>,
        DoAssign<T> >::type swap_or_assign;
        swap_or_assign(obj, *ptr);
     }

  }
template<typename T>
edm::Wrapper< T >::Wrapper ( Wrapper< T > const &  rh) [private]

Member Function Documentation

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 [private, virtual]

Implements edm::EDProduct.

Definition at line 160 of file Wrapper.h.

References VarParsing::obj, and relativeConstraints::value.

                                                                           {
    typename boost::mpl::if_c<has_setPtr<T>::value,
    DoSetPtr<T>,
    DoNotSetPtr<T> >::type maybe_filler;
    maybe_filler(this->obj,iToType,iIndices,oPtr);
  }
template<typename T >
void edm::Wrapper< T >::do_fillView ( ProductID const &  id,
std::vector< void const * > &  pointers,
helper_vector_ptr helpers 
) const [inline, private, virtual]

Implements edm::EDProduct.

Definition at line 104 of file Wrapper.h.

References VarParsing::obj, and relativeConstraints::value.

                                                                 {
    typename boost::mpl::if_c<has_fillView<T>::value,
    DoFillView<T>,
    DoNotFillView<T> >::type maybe_filler;
    maybe_filler(obj, id, pointers, helpers);
  }
template<typename T >
void edm::Wrapper< T >::do_setPtr ( std::type_info const &  iToType,
unsigned long  iIndex,
void const *&  oPtr 
) const [inline, private, virtual]

Implements edm::EDProduct.

Definition at line 150 of file Wrapper.h.

References VarParsing::obj, and relativeConstraints::value.

                                                      {
    typename boost::mpl::if_c<has_setPtr<T>::value,
    DoSetPtr<T>,
    DoNotSetPtr<T> >::type maybe_filler;
    maybe_filler(this->obj,iToType,iIndex,oPtr);
  }
template<typename T>
virtual std::type_info const& edm::Wrapper< T >::dynamicTypeInfo_ ( ) const [inline, private, virtual]

Implements edm::EDProduct.

Definition at line 48 of file Wrapper.h.

{ return typeid(T);}
template<typename T >
bool edm::Wrapper< T >::hasIsProductEqual_ ( ) const [private, virtual]

Reimplemented from edm::EDProduct.

Definition at line 322 of file Wrapper.h.

References VarParsing::obj, and relativeConstraints::value.

                                            {
    typename boost::mpl::if_c<detail::has_isProductEqual_function<T>::value,
      DoHasIsProductEqual<T>,
      DoNotHasIsProductEqual<T> >::type has_is_equal;
    return has_is_equal(obj);
  }
template<typename T >
bool edm::Wrapper< T >::isMergeable_ ( ) const [private, virtual]

Reimplemented from edm::EDProduct.

Definition at line 304 of file Wrapper.h.

References VarParsing::obj, and relativeConstraints::value.

                                      {
    typename boost::mpl::if_c<detail::has_mergeProduct_function<T>::value,
      IsMergeable<T>,
      IsNotMergeable<T> >::type is_mergeable;
    return is_mergeable(obj);
  }
template<typename T>
virtual bool edm::Wrapper< T >::isPresent_ ( ) const [inline, private, virtual]

Reimplemented from edm::EDProduct.

Definition at line 47 of file Wrapper.h.

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

{return present;}
template<typename T >
bool edm::Wrapper< T >::isProductEqual_ ( EDProduct const *  newProduct) const [private, virtual]

Reimplemented from edm::EDProduct.

Definition at line 330 of file Wrapper.h.

References compareJSON::const, edm::Wrapper< T >::obj, VarParsing::obj, and relativeConstraints::value.

                                                                    {
    Wrapper<T> const* wrappedNewProduct = dynamic_cast<Wrapper<T> const*>(newProduct);
    if (wrappedNewProduct == 0) return false;
    typename boost::mpl::if_c<detail::has_isProductEqual_function<T>::value,
      DoIsProductEqual<T>,
      DoNotIsProductEqual<T> >::type is_equal;
    return is_equal(obj, wrappedNewProduct->obj);
  }
template<typename T >
bool edm::Wrapper< T >::mergeProduct_ ( EDProduct const *  newProduct) [private, virtual]

Reimplemented from edm::EDProduct.

Definition at line 312 of file Wrapper.h.

References compareJSON::const, edm::Wrapper< T >::obj, VarParsing::obj, and relativeConstraints::value.

                                                            {
    Wrapper<T> const* wrappedNewProduct = dynamic_cast<Wrapper<T> const*>(newProduct);
    if (wrappedNewProduct == 0) return false;
    typename boost::mpl::if_c<detail::has_mergeProduct_function<T>::value,
      DoMergeProduct<T>,
      DoNotMergeProduct<T> >::type merge_product;
    return merge_product(obj, wrappedNewProduct->obj);
  }
template<typename T>
T const* edm::Wrapper< T >::operator-> ( ) const [inline]

Definition at line 36 of file Wrapper.h.

References edm::Wrapper< T >::product().

{return product();}
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 ( ) [inline, static]

Definition at line 39 of file Wrapper.h.

{ return typeid(T);}
template<typename T>
static std::type_info const& edm::Wrapper< T >::typeInfo ( ) [inline, static]

Member Data Documentation

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