CMS 3D CMS Logo

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

edm::RefToBaseProd< T > Class Template Reference

#include <RefToBaseProd.h>

List of all members.

Public Types

typedef View< Tproduct_type

Public Member Functions

product_type const * get () const
bool hasCache () const
 Checks if product is in memory.
ProductID id () const
 Accessor for product ID.
bool isNonnull () const
 Checks for non-null.
bool isNull () const
 Checks for null.
bool operator! () const
 Checks for null.
product_type const & operator* () const
 Dereference operator.
product_type const * operator-> () const
 Member dereference operator.
RefToBaseProd< T > & operator= (const RefToBaseProd< T > &other)
product_type const * product () const
EDProductGetter const * productGetter () const
 Accessor for product getter.
template<class HandleC >
 RefToBaseProd (HandleC const &handle)
 General purpose constructor from handle-like object.
 RefToBaseProd (const View< T > &)
 RefToBaseProd (RefToBase< T > const &ref)
 Constructor from RefToBase.
template<typename C , typename F >
 RefToBaseProd (Ref< C, T, F > const &ref)
 Constructor from Ref<C,T,F>
 RefToBaseProd (const RefToBaseProd< T > &)
template<typename C >
 RefToBaseProd (const RefProd< C > &)
 RefToBaseProd ()
 Default constructor needed for reading from persistent store. Not for direct use.
 RefToBaseProd (Handle< View< T > > const &handle)
void swap (RefToBaseProd< T > &)
 ~RefToBaseProd ()
 Destructor.

Private Member Functions

RefCore const & refCore () const
View< T > const * viewPtr () const

Private Attributes

RefCore product_

Detailed Description

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

Definition at line 22 of file RefToBaseProd.h.


Member Typedef Documentation

template<typename T>
typedef View<T> edm::RefToBaseProd< T >::product_type

Definition at line 24 of file RefToBaseProd.h.


Constructor & Destructor Documentation

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

Default constructor needed for reading from persistent store. Not for direct use.

Definition at line 27 of file RefToBaseProd.h.

: product_(){}
template<typename T >
template<class HandleC >
edm::RefToBaseProd< T >::RefToBaseProd ( HandleC const &  handle) [inline, explicit]

General purpose constructor from handle-like object.

Definition at line 238 of file RefToBaseProd.h.

References edm::RefToBaseProd< T >::product_, edm::detail::reallyFillView(), and edm::RefCore::setProductPtr().

                                                       :
    product_(handle.id(), handle.product(), 0, false) {
    std::vector<void const*> pointers;
    typedef typename refhelper::RefToBaseProdTrait<typename HandleC::element_type>::ref_vector_type ref_vector;
    typedef reftobase::RefVectorHolder<ref_vector> holder_type;
    helper_vector_ptr helpers(new holder_type);
    detail::reallyFillView(* handle, handle.id(), pointers, * helpers);
    product_.setProductPtr(new View<T>(pointers, helpers));
  }
template<typename T >
edm::RefToBaseProd< T >::RefToBaseProd ( Handle< View< T > > const &  handle) [inline, explicit]

Definition at line 132 of file RefToBaseProd.h.

References patZpeak::handle, edm::RefToBaseProd< T >::product_, and edm::RefCore::setProductPtr().

                                                                :
    product_(handle->id(), 0, handle->productGetter(), false){
    product_.setProductPtr(new View<T>(* handle));
    assert(handle->productGetter() == 0);
  }
template<typename T >
template<typename C , typename F >
edm::RefToBaseProd< T >::RefToBaseProd ( Ref< C, T, F > const &  ref) [inline, explicit]

Constructor from Ref<C,T,F>

Constructor from Ref.

Definition at line 252 of file RefToBaseProd.h.

References edm::Ref< C, T, F >::id(), edm::Ref< C, T, F >::product(), edm::RefToBaseProd< T >::product_, edm::detail::reallyFillView(), and edm::RefCore::setProductPtr().

                                                         :
      product_(ref.id(),
               ref.hasProductCache() ? ref.product() : 0,
               ref.productGetter(),
               false) {
    std::vector<void const*> pointers;
    typedef typename refhelper::RefToBaseProdTrait<C>::ref_vector_type ref_vector;
    typedef reftobase::RefVectorHolder<ref_vector> holder_type;
    helper_vector_ptr helpers(new holder_type);
    detail::reallyFillView(* ref.product(), ref.id(), pointers, * helpers);
    product_.setProductPtr(new View<T>(pointers, helpers));
  }
template<typename T >
edm::RefToBaseProd< T >::RefToBaseProd ( RefToBase< T > const &  ref) [inline, explicit]

Constructor from RefToBase.

Definition at line 268 of file RefToBaseProd.h.

References edm::RefToBase< T >::holder_, edm::RefToBase< T >::id(), edm::reftobase::BaseHolder< T >::makeVectorBaseHolder(), edm::RefToBase< T >::product(), edm::RefToBaseProd< T >::product_, and edm::RefCore::setProductPtr().

                                                         :
    product_(ref.id(),
             ref.hasProductCache() ? ref.product() : 0,
             ref.productGetter(),
             false) {
    std::vector<void const*> pointers;
    helper_vector_ptr helpers(ref.holder_->makeVectorBaseHolder().release());
    helpers->reallyFillView(ref.product(), ref.id(), pointers);
    product_.setProductPtr(new View<T>(pointers, helpers));
  }
template<typename T >
edm::RefToBaseProd< T >::RefToBaseProd ( const View< T > &  view) [inline, explicit]

Definition at line 140 of file RefToBaseProd.h.

References edm::RefToBaseProd< T >::product_, and edm::RefCore::setProductPtr().

                                                     :
    product_(view.id(), 0, view.productGetter(), false) {
      product_.setProductPtr(new View<T>(view));
  }
template<typename T >
edm::RefToBaseProd< T >::RefToBaseProd ( const RefToBaseProd< T > &  ref) [inline]

Definition at line 147 of file RefToBaseProd.h.

References edm::RefToBaseProd< T >::product_, edm::RefCore::setProductPtr(), and edm::RefToBaseProd< T >::viewPtr().

                                                             :
    product_(ref.product_) {
      product_.setProductPtr(ref.viewPtr() ? (new View<T>(* ref)) : 0);
  }
template<typename T >
template<typename C >
edm::RefToBaseProd< T >::RefToBaseProd ( const RefProd< C > &  ref) [inline]

Definition at line 225 of file RefToBaseProd.h.

References edm::RefProd< C >::id(), edm::RefProd< C >::product(), edm::RefToBaseProd< T >::product_, edm::detail::reallyFillView(), and edm::RefCore::setProductPtr().

                                                       :
    product_(ref.refCore()) {
    std::vector<void const*> pointers;
    typedef typename refhelper::RefToBaseProdTrait<C>::ref_vector_type ref_vector;
    typedef reftobase::RefVectorHolder<ref_vector> holder_type;
    helper_vector_ptr helpers(new holder_type);
    detail::reallyFillView(* ref.product(), ref.id(), pointers, * helpers);
    product_.setProductPtr(new View<T>(pointers, helpers));
  }
template<typename T>
edm::RefToBaseProd< T >::~RefToBaseProd ( ) [inline]

Destructor.

Definition at line 47 of file RefToBaseProd.h.

References edm::RefToBaseProd< T >::viewPtr().

{ delete viewPtr();}

Member Function Documentation

template<typename T>
product_type const* edm::RefToBaseProd< T >::get ( void  ) const [inline]

Returns C++ pointer to the product Will attempt to retrieve product

Definition at line 57 of file RefToBaseProd.h.

References edm::RefToBaseProd< T >::isNull(), and edm::RefToBaseProd< T >::operator->().

                                    {
      return isNull() ? 0 : this->operator->();
    }
template<typename T>
bool edm::RefToBaseProd< T >::hasCache ( ) const [inline]

Checks if product is in memory.

Definition at line 83 of file RefToBaseProd.h.

References edm::RefToBaseProd< T >::product_, and edm::RefCore::productPtr().

{return product_.productPtr() != 0;}
template<typename T>
ProductID edm::RefToBaseProd< T >::id ( void  ) const [inline]

Accessor for product ID.

Definition at line 77 of file RefToBaseProd.h.

References edm::RefCore::id(), and edm::RefToBaseProd< T >::product_.

Referenced by edm::RefToBaseProd< T >::isNonnull().

{return product_.id();}
template<typename T>
bool edm::RefToBaseProd< T >::isNonnull ( ) const [inline]

Checks for non-null.

Definition at line 71 of file RefToBaseProd.h.

References edm::RefToBaseProd< T >::id(), and edm::ProductID::isValid().

Referenced by edm::RefToBaseProd< T >::isNull().

{return id().isValid(); }
template<typename T>
bool edm::RefToBaseProd< T >::isNull ( ) const [inline]
template<typename T>
bool edm::RefToBaseProd< T >::operator! ( ) const [inline]

Checks for null.

Definition at line 74 of file RefToBaseProd.h.

References edm::RefToBaseProd< T >::isNull().

{return isNull(); }
template<typename T >
View< T > const & edm::RefToBaseProd< T >::operator* ( ) const [inline]

Dereference operator.

Definition at line 163 of file RefToBaseProd.h.

                                                   {
    return * operator->();
  }
template<typename T >
View< T > const * edm::RefToBaseProd< T >::operator-> ( ) const [inline]

Member dereference operator.

Definition at line 170 of file RefToBaseProd.h.

References edm::WrapperHolder::fillView(), edm::ProductID::id(), edm::errors::InvalidReference, and edm::Exception::throwThis().

Referenced by edm::RefToBaseProd< T >::get(), and edm::RefToBaseProd< T >::product().

                                                    {
    if(product_.productPtr() == 0) {
      if(product_.isNull()) {
        Exception::throwThis(errors::InvalidReference,
          "attempting get view from a null RefToBaseProd.\n");
      }
      ProductID tId = product_.id();
      std::vector<void const*> pointers;
      helper_vector_ptr helpers;
      WrapperHolder it = product_.productGetter()->getIt(tId);
      it.fillView(tId, pointers, helpers);
      product_.setProductPtr((new View<T>(pointers, helpers)));
    }
    return viewPtr();
  }
template<typename T >
RefToBaseProd< T > & edm::RefToBaseProd< T >::operator= ( const RefToBaseProd< T > &  other) [inline]

Definition at line 154 of file RefToBaseProd.h.

References edm::swap(), and cond::rpcobtemp::temp.

                                                                             {
    RefToBaseProd<T> temp(other);
    this->swap(temp);
    return *this;
  }
template<typename T>
product_type const* edm::RefToBaseProd< T >::product ( ) const [inline]

Returns C++ pointer to the product Will attempt to retrieve product

Definition at line 63 of file RefToBaseProd.h.

References edm::RefToBaseProd< T >::isNull(), and edm::RefToBaseProd< T >::operator->().

                                        {
      return isNull() ? 0 : this->operator->();
    }
template<typename T>
EDProductGetter const* edm::RefToBaseProd< T >::productGetter ( ) const [inline]

Accessor for product getter.

Definition at line 80 of file RefToBaseProd.h.

References edm::RefToBaseProd< T >::product_, and edm::RefCore::productGetter().

{return product_.productGetter();}
template<typename T>
RefCore const& edm::RefToBaseProd< T >::refCore ( ) const [inline, private]

Definition at line 93 of file RefToBaseProd.h.

References edm::RefToBaseProd< T >::product_.

Referenced by edm::operator==().

                                   {
      return product_;
    }
template<typename T >
void edm::RefToBaseProd< T >::swap ( RefToBaseProd< T > &  other) [inline]

Definition at line 188 of file RefToBaseProd.h.

References edm::RefToBaseProd< T >::product_, and edm::swap().

Referenced by edm::swap().

                                                     {
    std::swap(product_, other.product_);
  }
template<typename T>
View<T> const* edm::RefToBaseProd< T >::viewPtr ( ) const [inline, private]

Definition at line 97 of file RefToBaseProd.h.

References edm::RefToBaseProd< T >::product_, and edm::RefCore::productPtr().

Referenced by edm::RefToBaseProd< T >::RefToBaseProd(), and edm::RefToBaseProd< T >::~RefToBaseProd().

                                   {
      return reinterpret_cast<const View<T>*>(product_.productPtr());
    }

Member Data Documentation

template<typename T>
RefCore edm::RefToBaseProd< T >::product_ [mutable, private]