#include <RefCore.h>
Public Member Functions | |
WrapperBase const * | getProductPtr (std::type_info const &type, EDProductGetter const *prodGetter) const |
WrapperBase const * | getThinnedProductPtr (std::type_info const &type, unsigned int &thinnedKey, EDProductGetter const *prodGetter) const |
ProductID | id () const |
bool | isAvailable () const |
bool | isNonnull () const |
bool | isNull () const |
bool | isThinnedAvailable (unsigned int thinnedKey, EDProductGetter const *prodGetter) const |
bool | isTransient () const |
int | isTransientInt () const |
void | nullPointerForTransientException (std::type_info const &type) const |
bool | operator! () const |
RefCore & | operator= (RefCore const &) |
RefCore & | operator= (RefCore &&)=default |
EDProductGetter const * | productGetter () const |
void | productNotFoundException (std::type_info const &type) const |
void const * | productPtr () const |
void | pushBackItem (RefCore const &productToBeInserted, bool checkPointer) |
void | pushBackRefItem (RefCore const &productToBeInserted) |
RefCore () | |
RefCore (ProductID const &theId, void const *prodPtr, EDProductGetter const *prodGetter, bool transient) | |
RefCore (RefCore const &) | |
RefCore (RefCore &&iOther) | |
void | setProductGetter (EDProductGetter const *prodGetter) const |
void | setProductPtr (void const *prodPtr) const |
void | swap (RefCore &) |
WrapperBase const * | tryToGetProductPtr (std::type_info const &type, EDProductGetter const *prodGetter) const |
bool | tryToSetProductPtrForFirstTime (void const *prodPtr) const |
void | wrongTypeException (std::type_info const &expectedType, std::type_info const &actualType) const |
Private Member Functions | |
bool | cachePtrIsInvalid () const |
RefCore (void const *iCache, ProcessIndex iProcessIndex, ProductIndex iProductIndex) | |
void | setCacheIsProductGetter (EDProductGetter const *iGetter) const |
void | setCacheIsProductPtr (const void *iItem) const |
void | setId (ProductID const &iId) |
void | setTransient () |
Private Attributes | |
std::atomic< void const * > | cachePtr_ |
ProcessIndex | processIndex_ |
ProductIndex | productIndex_ |
Friends | |
class | RefCoreWithIndex |
edm::RefCore::RefCore | ( | ProductID const & | theId, |
void const * | prodPtr, | ||
EDProductGetter const * | prodGetter, | ||
bool | transient | ||
) |
Definition at line 34 of file RefCore.cc.
References setCacheIsProductGetter(), and setTransient().
edm::RefCore::RefCore | ( | RefCore const & | iOther | ) |
Definition at line 47 of file RefCore.cc.
|
inlineprivate |
|
inlineprivate |
Definition at line 115 of file RefCore.h.
References cachePtr_, and edm::refcoreimpl::kCacheIsProductPtrMask.
Referenced by getProductPtr(), pushBackItem(), and tryToGetProductPtr().
WrapperBase const * edm::RefCore::getProductPtr | ( | std::type_info const & | type, |
EDProductGetter const * | prodGetter | ||
) | const |
Definition at line 60 of file RefCore.cc.
References assert(), cachePtrIsInvalid(), edm::WrapperBase::dynamicTypeInfo(), edm::EDProductGetter::getIt(), id(), isTransient(), edm::ProductID::isValid(), productNotFoundException(), throwInvalidRefFromNoCache(), throwInvalidRefFromNullOrInvalidRef(), and wrongTypeException().
Referenced by edm::refcore::getProduct_(), edm::RefCoreWithIndex::getProductPtr(), and edm::refcore::getProductWithCoreFromRef_().
WrapperBase const * edm::RefCore::getThinnedProductPtr | ( | std::type_info const & | type, |
unsigned int & | thinnedKey, | ||
EDProductGetter const * | prodGetter | ||
) | const |
Definition at line 114 of file RefCore.cc.
References edm::WrapperBase::dynamicTypeInfo(), edm::EDProductGetter::getThinnedProduct(), id(), productNotFoundException(), and wrongTypeException().
Referenced by edm::refcore::getThinnedProduct_().
|
inline |
Definition at line 42 of file RefCore.h.
References ID_IMPL.
Referenced by bitPackRefInfo(), edm::Ptr< PileUpPFCandidate >::getData_(), getProductPtr(), getThinnedProductPtr(), edm::PtrVectorBase::id(), edm::RefToBaseProd< reco::GsfElectronCore >::id(), edm::RefVector< JetEisolAssociationCollection >::id(), edm::RefProd< reco::CastorEgammaCollection >::id(), edm::Ptr< PileUpPFCandidate >::id(), edm::Ref< L1GctEmCandCollection >::id(), edm::Ref< std::vector< E >, typename refhelper::ValueTrait< std::vector< E > >::value, typename refhelper::FindTrait< std::vector< E >, typename refhelper::ValueTrait< std::vector< E > >::value >::value >::id(), isAvailable(), isThinnedAvailable(), edm::RefCoreStreamer::operator()(), edm::operator<(), edm::operator==(), productNotFoundException(), pushBackItem(), pushBackRefItem(), reco::TrackExtraBase::recHitRef(), tryToGetProductPtr(), and wrongTypeException().
bool edm::RefCore::isAvailable | ( | ) | const |
Definition at line 168 of file RefCore.cc.
References id(), edm::ProductID::isValid(), productGetter(), and productPtr().
Referenced by edm::PtrVectorBase::isAvailable(), edm::RefCoreWithIndex::isAvailable(), edm::RefVector< C, T, F >::isAvailable(), and edm::RefProd< reco::CastorEgammaCollection >::isAvailable().
|
inline |
Definition at line 67 of file RefCore.h.
References ISNONNULL_IMPL.
Referenced by edm::PtrVectorBase::isNonnull(), edm::RefToBaseProd< reco::GsfElectronCore >::isNonnull(), edm::RefProd< reco::CastorEgammaCollection >::isNonnull(), isNull(), pushBackItem(), and pushBackRefItem().
|
inline |
Definition at line 64 of file RefCore.h.
References isNonnull().
Referenced by operator!(), pushBackItem(), and pushBackRefItem().
bool edm::RefCore::isThinnedAvailable | ( | unsigned int | thinnedKey, |
EDProductGetter const * | prodGetter | ||
) | const |
Definition at line 129 of file RefCore.cc.
References edm::EDProductGetter::getThinnedProduct(), id(), edm::ProductID::isValid(), and productPtr().
Referenced by edm::refitem::IsThinnedAvailableImpl< C, unsigned int >::isThinnedAvailable_().
|
inline |
Definition at line 99 of file RefCore.h.
References ISTRANSIENT_IMPL.
Referenced by edm::getProduct(), edm::refcore::getProduct_(), getProductPtr(), edm::getProductWithCoreFromRef(), edm::getThinnedProduct(), edm::refitem::IsThinnedAvailableImpl< C, unsigned int >::isThinnedAvailable_(), edm::PtrVectorBase::isTransient(), edm::RefVector< JetEisolAssociationCollection >::isTransient(), edm::RefProd< reco::CastorEgammaCollection >::isTransient(), edm::Ptr< PileUpPFCandidate >::isTransient(), edm::Ref< L1GctEmCandCollection >::isTransient(), edm::Ref< std::vector< E >, typename refhelper::ValueTrait< std::vector< E > >::value, typename refhelper::FindTrait< std::vector< E >, typename refhelper::ValueTrait< std::vector< E > >::value >::value >::isTransient(), isTransientInt(), edm::RefCoreStreamer::operator()(), edm::operator<(), edm::operator==(), pushBackItem(), pushBackRefItem(), tryToGetProductPtr(), and edm::tryToGetProductWithCoreFromRef().
|
inline |
void edm::RefCore::nullPointerForTransientException | ( | std::type_info const & | type | ) | const |
Definition at line 160 of file RefCore.cc.
References Exception, and edm::errors::InvalidReference.
Referenced by edm::getProduct(), edm::getProductWithCoreFromRef(), edm::getThinnedProduct(), edm::RefCoreWithIndex::nullPointerForTransientException(), and edm::tryToGetProductWithCoreFromRef().
|
inline |
|
inline |
Definition at line 77 of file RefCore.h.
References PRODUCTGETTER_IMPL.
Referenced by edm::getProduct(), edm::refitem::GetRefPtrImpl< C, T, F, KEY >::getRefPtr_(), edm::refitem::GetRefPtrImpl< C, T, F, unsigned int >::getRefPtr_(), isAvailable(), edm::refitem::IsThinnedAvailableImpl< C, unsigned int >::isThinnedAvailable_(), edm::PtrVectorBase::productGetter(), edm::RefToBaseProd< reco::GsfElectronCore >::productGetter(), edm::RefVector< JetEisolAssociationCollection >::productGetter(), edm::RefProd< reco::CastorEgammaCollection >::productGetter(), edm::Ptr< PileUpPFCandidate >::productGetter(), edm::Ref< L1GctEmCandCollection >::productGetter(), edm::Ref< std::vector< E >, typename refhelper::ValueTrait< std::vector< E > >::value, typename refhelper::FindTrait< std::vector< E >, typename refhelper::ValueTrait< std::vector< E > >::value >::value >::productGetter(), pushBackItem(), pushBackRefItem(), and edm::RefToBaseProd< T >::RefToBaseProd().
void edm::RefCore::productNotFoundException | ( | std::type_info const & | type | ) | const |
Definition at line 140 of file RefCore.cc.
References Exception, id(), and edm::errors::ProductNotFound.
Referenced by edm::Ptr< PileUpPFCandidate >::getData_(), getProductPtr(), getThinnedProductPtr(), and edm::RefCoreWithIndex::productNotFoundException().
|
inline |
If productPtr is not 0 then productGetter will be 0 since only one is available at a time
Definition at line 45 of file RefCore.h.
References PRODUCTPTR_IMPL.
Referenced by edm::getProduct(), edm::refitem::GetRefPtrImpl< C, T, F, KEY >::getRefPtr_(), edm::refitem::GetRefPtrImpl< C, T, F, unsigned int >::getRefPtr_(), edm::RefToBaseProd< reco::GsfElectronCore >::hasCache(), edm::RefProd< reco::CastorEgammaCollection >::hasCache(), edm::Ptr< PileUpPFCandidate >::hasProductCache(), edm::Ref< L1GctEmCandCollection >::hasProductCache(), edm::Ref< std::vector< E >, typename refhelper::ValueTrait< std::vector< E > >::value, typename refhelper::FindTrait< std::vector< E >, typename refhelper::ValueTrait< std::vector< E > >::value >::value >::hasProductCache(), isAvailable(), isThinnedAvailable(), edm::refitem::IsThinnedAvailableImpl< C, unsigned int >::isThinnedAvailable_(), edm::operator<(), edm::operator==(), edm::RefVectorBase< key_type >::pushBack(), pushBackItem(), reco::TrackExtraBase::recHitRef(), edm::Ref< C, T, F >::Ref(), edm::RefToBaseProd< T >::RefToBaseProd(), reco::PFCandidate::storeRefInfo(), and edm::RefToBaseProd< reco::GsfElectronCore >::viewPtr().
void edm::RefCore::pushBackItem | ( | RefCore const & | productToBeInserted, |
bool | checkPointer | ||
) |
Definition at line 193 of file RefCore.cc.
References cachePtrIsInvalid(), Exception, id(), edm::errors::InvalidReference, isNonnull(), isNull(), isTransient(), productGetter(), productPtr(), setId(), setProductGetter(), setProductPtr(), and setTransient().
Referenced by edm::PtrVectorBase::push_back_base(), edm::RefCoreWithIndex::pushBackItem(), and reco::TrackExtraBase::setHits().
void edm::RefCore::pushBackRefItem | ( | RefCore const & | productToBeInserted | ) |
Definition at line 242 of file RefCore.cc.
References Exception, id(), edm::errors::InvalidReference, isNonnull(), isNull(), isTransient(), productGetter(), setId(), setProductGetter(), and setTransient().
Referenced by edm::RefVectorBase< key_type >::pushBack().
|
inlineprivate |
Definition at line 113 of file RefCore.h.
References SETCACHEISPRODUCTGETTER_IMPL.
Referenced by RefCore(), and setProductGetter().
|
inlineprivate |
Definition at line 112 of file RefCore.h.
References SETCACHEISPRODUCTPTR_IMPL.
Referenced by setProductPtr().
|
private |
Definition at line 184 of file RefCore.cc.
References edm::refcoreimpl::kCacheIsProductPtrBit, edm::refcoreimpl::kTransientBit, edm::ProductID::processIndex(), processIndex_, edm::ProductID::productIndex(), and productIndex_.
Referenced by pushBackItem(), pushBackRefItem(), and edm::RefCoreWithIndex::setId().
void edm::RefCore::setProductGetter | ( | EDProductGetter const * | prodGetter | ) | const |
Definition at line 179 of file RefCore.cc.
References setCacheIsProductGetter().
Referenced by pushBackItem(), pushBackRefItem(), edm::RefCoreWithIndex::setProductGetter(), and edm::PtrVectorBase::setProductGetter().
|
inline |
This function is 'const' even though it changes an internal value becuase it is meant to be used as a way to store in a thread-safe way a cache of a value. This allows classes which use the RefCore to not have to declare it 'mutable'
Definition at line 51 of file RefCore.h.
References setCacheIsProductPtr().
Referenced by edm::RefVector< JetEisolAssociationCollection >::at(), edm::refitem::findRefItem(), edm::Ptr< PileUpPFCandidate >::getData_(), edm::refcore::getProduct_(), edm::RefVector< JetEisolAssociationCollection >::operator[](), edm::Ptr< PileUpPFCandidate >::Ptr(), pushBackItem(), and edm::RefToBaseProd< T >::RefToBaseProd().
|
inlineprivate |
Definition at line 111 of file RefCore.h.
References SETTRANSIENT_IMPL.
Referenced by pushBackItem(), pushBackRefItem(), and RefCore().
|
inline |
Definition at line 157 of file RefCore.h.
References cachePtr_, processIndex_, productIndex_, and std::swap().
Referenced by edm::RefVectorBase< key_type >::swap(), edm::PtrVectorBase::swap(), and edm::swap().
WrapperBase const * edm::RefCore::tryToGetProductPtr | ( | std::type_info const & | type, |
EDProductGetter const * | prodGetter | ||
) | const |
Definition at line 96 of file RefCore.cc.
References assert(), cachePtrIsInvalid(), edm::WrapperBase::dynamicTypeInfo(), edm::EDProductGetter::getIt(), id(), isTransient(), edm::ProductID::isValid(), throwInvalidRefFromNoCache(), throwInvalidRefFromNullOrInvalidRef(), and wrongTypeException().
Referenced by edm::refcore::tryToGetProductWithCoreFromRef_().
|
inline |
This function is 'const' even though it changes an internal value becuase it is meant to be used as a way to store in a thread-safe way a cache of a value. This allows classes which use the RefCore to not have to declare it 'mutable'
Definition at line 59 of file RefCore.h.
References cachePtr_, and edm::refcoreimpl::tryToSetCacheItemForFirstTime().
void edm::RefCore::wrongTypeException | ( | std::type_info const & | expectedType, |
std::type_info const & | actualType | ||
) | const |
Definition at line 150 of file RefCore.cc.
References Exception, id(), and edm::errors::InvalidReference.
Referenced by edm::refcore::getProduct_(), getProductPtr(), edm::refcore::getProductWithCoreFromRef_(), getThinnedProductPtr(), tryToGetProductPtr(), and edm::RefCoreWithIndex::wrongTypeException().
|
friend |
|
mutableprivate |
Definition at line 122 of file RefCore.h.
Referenced by cachePtrIsInvalid(), operator=(), swap(), and tryToSetProductPtrForFirstTime().
|
private |
Definition at line 131 of file RefCore.h.
Referenced by operator=(), setId(), and swap().
|
private |
Definition at line 132 of file RefCore.h.
Referenced by operator=(), setId(), and swap().