#include <DataFormats/Common/interface/RefToBaseProd.h>
Public Types | |
typedef View< T > | product_type |
Public Member Functions | |
product_type const * | get () const |
Returns C++ pointer to the product Will attempt to retrieve product. | |
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. | |
product_type const & | operator * () const |
Dereference operator. | |
bool | operator! () const |
Checks for null. | |
product_type const * | operator-> () const |
Member dereference operator. | |
RefToBaseProd< T > & | operator= (const RefToBaseProd< T > &other) |
product_type const * | product () const |
Returns C++ pointer to the product Will attempt to retrieve product. | |
EDProductGetter const * | productGetter () const |
Accessor for product getter. | |
RefCore const & | refCore () const |
template<typename C> | |
RefToBaseProd (const RefProd< C > &) | |
RefToBaseProd (const RefToBaseProd< T > &) | |
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 (Handle< View< T > > const &handle) | |
template<class HandleC> | |
RefToBaseProd (HandleC const &handle) | |
General purpose constructor from handle-like object. | |
RefToBaseProd () | |
Default constructor needed for reading from persistent store. Not for direct use. | |
void | swap (RefToBaseProd< T > &) |
~RefToBaseProd () | |
Destructor. | |
Private Member Functions | |
View< T > const * | viewPtr () const |
Private Attributes | |
RefCore | product_ |
ConstPtrCache | viewCache_ |
Definition at line 22 of file RefToBaseProd.h.
typedef View<T> edm::RefToBaseProd< T >::product_type |
Definition at line 24 of file RefToBaseProd.h.
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.
00027 : product_(), viewCache_(0) {}
edm::RefToBaseProd< T >::RefToBaseProd | ( | HandleC const & | handle | ) | [inline, explicit] |
General purpose constructor from handle-like object.
Definition at line 233 of file RefToBaseProd.h.
References edm::ConstPtrCache::ptr_, edm::detail::reallyFillView(), and edm::RefToBaseProd< T >::viewCache_.
00233 : 00234 product_(handle.id(), handle.product(), 0, false) { 00235 std::vector<void const*> pointers; 00236 typedef typename refhelper::RefToBaseProdTrait<typename HandleC::element_type>::ref_vector_type ref_vector; 00237 typedef reftobase::RefVectorHolder<ref_vector> holder_type; 00238 helper_vector_ptr helpers( new holder_type ); 00239 detail::reallyFillView( * handle, handle.id(), pointers, * helpers ); 00240 viewCache_.ptr_=( new View<T>( pointers, helpers ) ); 00241 }
edm::RefToBaseProd< T >::RefToBaseProd | ( | Handle< View< T > > const & | handle | ) | [inline, explicit] |
Definition at line 128 of file RefToBaseProd.h.
00128 : 00129 product_(handle->id(), 0, handle->productGetter(), false ), 00130 viewCache_( new View<T>( * handle ) ) { 00131 assert( handle->productGetter() == 0 ); 00132 }
edm::RefToBaseProd< T >::RefToBaseProd | ( | Ref< C, T, F > const & | ref | ) | [inline, explicit] |
Constructor from Ref<C,T,F>.
Constructor from Ref.
Definition at line 247 of file RefToBaseProd.h.
References edm::Ref< C, T, F >::id(), edm::Ref< C, T, F >::product(), edm::ConstPtrCache::ptr_, edm::detail::reallyFillView(), and edm::RefToBaseProd< T >::viewCache_.
00247 : 00248 product_(ref.id(), 00249 ref.hasProductCache() ? ref.product() : 0, 00250 ref.productGetter(), 00251 false) { 00252 std::vector<void const*> pointers; 00253 typedef typename refhelper::RefToBaseProdTrait<C>::ref_vector_type ref_vector; 00254 typedef reftobase::RefVectorHolder<ref_vector> holder_type; 00255 helper_vector_ptr helpers( new holder_type ); 00256 detail::reallyFillView( * ref.product(), ref.id(), pointers, * helpers ); 00257 viewCache_.ptr_=( new View<T>( pointers, helpers ) ); 00258 }
edm::RefToBaseProd< T >::RefToBaseProd | ( | RefToBase< T > const & | ref | ) | [inline, explicit] |
Constructor from RefToBase.
Definition at line 263 of file RefToBaseProd.h.
References edm::RefToBase< T >::holder_, edm::RefToBase< T >::id(), edm::RefToBase< T >::product(), edm::ConstPtrCache::ptr_, and edm::RefToBaseProd< T >::viewCache_.
00263 : 00264 product_(ref.id(), 00265 ref.hasProductCache() ? ref.product() : 0, 00266 ref.productGetter(), 00267 false) { 00268 std::vector<void const*> pointers; 00269 helper_vector_ptr helpers( ref.holder_->makeVectorBaseHolder().release() ); 00270 helpers->reallyFillView( ref.product(), ref.id(), pointers ); 00271 viewCache_.ptr_=( new View<T>( pointers, helpers ) ); 00272 }
edm::RefToBaseProd< T >::RefToBaseProd | ( | const View< T > & | view | ) | [inline, explicit] |
Definition at line 136 of file RefToBaseProd.h.
00136 : 00137 product_( view.id(), 0, view.productGetter(), false ), 00138 viewCache_( new View<T>( view ) ) { 00139 }
edm::RefToBaseProd< T >::RefToBaseProd | ( | const RefToBaseProd< T > & | ref | ) | [inline] |
Definition at line 143 of file RefToBaseProd.h.
00143 : 00144 product_( ref.product_ ), 00145 viewCache_( ref.viewPtr() ? (new View<T>( * ref ) ) : 0 ) { 00146 }
edm::RefToBaseProd< T >::RefToBaseProd | ( | const RefProd< C > & | ref | ) | [inline] |
Definition at line 220 of file RefToBaseProd.h.
References edm::RefProd< C >::id(), edm::RefProd< C >::product(), edm::ConstPtrCache::ptr_, edm::detail::reallyFillView(), and edm::RefToBaseProd< T >::viewCache_.
00220 : 00221 product_( ref.refCore() ) { 00222 std::vector<void const*> pointers; 00223 typedef typename refhelper::RefToBaseProdTrait<C>::ref_vector_type ref_vector; 00224 typedef reftobase::RefVectorHolder<ref_vector> holder_type; 00225 helper_vector_ptr helpers( new holder_type ); 00226 detail::reallyFillView( * ref.product(), ref.id(), pointers, * helpers ); 00227 viewCache_.ptr_=( new View<T>( pointers, helpers ) ); 00228 }
edm::RefToBaseProd< T >::~RefToBaseProd | ( | ) | [inline] |
Destructor.
Definition at line 47 of file RefToBaseProd.h.
References edm::RefToBaseProd< T >::viewPtr().
00047 { delete viewPtr();}
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->().
00057 { 00058 return isNull() ? 0 : this->operator->(); 00059 }
bool edm::RefToBaseProd< T >::hasCache | ( | ) | const [inline] |
Checks if product is in memory.
Definition at line 87 of file RefToBaseProd.h.
References edm::RefToBaseProd< T >::product_, and edm::RefCore::productPtr().
00087 {return product_.productPtr() != 0;}
ProductID edm::RefToBaseProd< T >::id | ( | void | ) | const [inline] |
Accessor for product ID.
Definition at line 81 of file RefToBaseProd.h.
References edm::RefCore::id(), and edm::RefToBaseProd< T >::product_.
Referenced by edm::RefToBaseProd< T >::isNonnull().
00081 {return product_.id();}
bool edm::RefToBaseProd< T >::isNonnull | ( | ) | const [inline] |
Checks for non-null.
Definition at line 75 of file RefToBaseProd.h.
References edm::RefToBaseProd< T >::id(), and edm::ProductID::isValid().
Referenced by edm::RefToBaseProd< T >::isNull().
00075 {return id().isValid(); }
bool edm::RefToBaseProd< T >::isNull | ( | ) | const [inline] |
Checks for null.
Definition at line 72 of file RefToBaseProd.h.
References edm::RefToBaseProd< T >::isNonnull().
Referenced by edm::RefToBaseProd< T >::get(), edm::RefToBaseProd< T >::operator!(), and edm::RefToBaseProd< T >::product().
00072 {return !isNonnull(); }
View< T > const & edm::RefToBaseProd< T >::operator * | ( | ) | const [inline] |
Dereference operator.
Definition at line 159 of file RefToBaseProd.h.
References edm::RefToBaseProd< T >::operator->().
00159 { 00160 return * operator->(); 00161 }
bool edm::RefToBaseProd< T >::operator! | ( | ) | const [inline] |
Checks for null.
Definition at line 78 of file RefToBaseProd.h.
References edm::RefToBaseProd< T >::isNull().
00078 {return isNull(); }
View< T > const * edm::RefToBaseProd< T >::operator-> | ( | ) | const [inline] |
Member dereference operator.
Definition at line 166 of file RefToBaseProd.h.
References edm::EDProduct::fillView(), edm::EDProductGetter::getIt(), edm::RefCore::id(), edm::errors::InvalidReference, edm::RefCore::isNull(), edm::RefToBaseProd< T >::product_, edm::RefCore::productGetter(), edm::ConstPtrCache::ptr_, edm::RefToBaseProd< T >::viewCache_, and edm::RefToBaseProd< T >::viewPtr().
Referenced by edm::RefToBaseProd< T >::get(), edm::RefToBaseProd< T >::operator *(), and edm::RefToBaseProd< T >::product().
00166 { 00167 if ( viewCache_.ptr_ == 0 ) { 00168 if ( product_.isNull() ) 00169 throw edm::Exception(errors::InvalidReference) 00170 << "attempting get view from a null RefToBaseProd.\n"; 00171 ProductID id = product_.id(); 00172 std::vector<void const*> pointers; 00173 helper_vector_ptr helpers; 00174 product_.productGetter()->getIt(id)->fillView(id, pointers, helpers); 00175 viewCache_.ptr_ =( new View<T>( pointers, helpers ) ); 00176 } 00177 return viewPtr(); 00178 }
RefToBaseProd< T > & edm::RefToBaseProd< T >::operator= | ( | const RefToBaseProd< T > & | other | ) | [inline] |
Definition at line 150 of file RefToBaseProd.h.
References edm::RefToBaseProd< T >::swap(), and pyDBSRunClass::temp.
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->().
00063 { 00064 return isNull() ? 0 : this->operator->(); 00065 }
EDProductGetter const* edm::RefToBaseProd< T >::productGetter | ( | ) | const [inline] |
Accessor for product getter.
Definition at line 84 of file RefToBaseProd.h.
References edm::RefToBaseProd< T >::product_, and edm::RefCore::productGetter().
00084 {return product_.productGetter();}
RefCore const& edm::RefToBaseProd< T >::refCore | ( | ) | const [inline] |
Definition at line 67 of file RefToBaseProd.h.
References edm::RefToBaseProd< T >::product_.
Referenced by edm::operator==().
00067 { 00068 return product_; 00069 }
void edm::RefToBaseProd< T >::swap | ( | RefToBaseProd< T > & | other | ) | [inline] |
Definition at line 182 of file RefToBaseProd.h.
References edm::RefToBaseProd< T >::product_, edm::ConstPtrCache::ptr_, std::swap(), and edm::RefToBaseProd< T >::viewCache_.
Referenced by edm::RefToBaseProd< T >::operator=(), and edm::swap().
00182 { 00183 std::swap( product_, other.product_ ); 00184 std::swap( viewCache_.ptr_, other.viewCache_.ptr_); 00185 }
View<T> const* edm::RefToBaseProd< T >::viewPtr | ( | ) | const [inline, private] |
Definition at line 94 of file RefToBaseProd.h.
References edm::ConstPtrCache::ptr_, and edm::RefToBaseProd< T >::viewCache_.
Referenced by edm::RefToBaseProd< T >::operator->(), and edm::RefToBaseProd< T >::~RefToBaseProd().
00094 { 00095 return reinterpret_cast<const View<T>*>(viewCache_.ptr_); 00096 }
RefCore edm::RefToBaseProd< T >::product_ [private] |
Definition at line 97 of file RefToBaseProd.h.
Referenced by edm::RefToBaseProd< T >::hasCache(), edm::RefToBaseProd< T >::id(), edm::RefToBaseProd< T >::operator->(), edm::RefToBaseProd< T >::productGetter(), edm::RefToBaseProd< T >::refCore(), and edm::RefToBaseProd< T >::swap().
ConstPtrCache edm::RefToBaseProd< T >::viewCache_ [mutable, private] |
Definition at line 98 of file RefToBaseProd.h.
Referenced by edm::RefToBaseProd< T >::operator->(), edm::RefToBaseProd< T >::RefToBaseProd(), edm::RefToBaseProd< T >::swap(), and edm::RefToBaseProd< T >::viewPtr().