#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 &&iOther) noexcept |
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) noexcept | |
void | setProductGetter (EDProductGetter const *prodGetter) const |
void | setProductPtr (void const *prodPtr) const |
void | swap (RefCore &) noexcept |
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 |
~RefCore () noexcept | |
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 |
|
inline |
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 | ) |
|
inlinenoexcept |
|
inlineprivate |
|
inlineprivate |
Definition at line 121 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 61 of file RefCore.cc.
References 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(), edm::refcore::getProductWithCoreFromRef_(), and productGetter().
WrapperBase const * edm::RefCore::getThinnedProductPtr | ( | std::type_info const & | type, |
unsigned int & | thinnedKey, | ||
EDProductGetter const * | prodGetter | ||
) | const |
Definition at line 115 of file RefCore.cc.
References edm::WrapperBase::dynamicTypeInfo(), edm::EDProductGetter::getThinnedProduct(), id(), productNotFoundException(), and wrongTypeException().
Referenced by edm::refcore::getThinnedProduct_(), and productGetter().
|
inline |
Definition at line 49 of file RefCore.h.
References ID_IMPL.
Referenced by bitPackRefInfo(), edm::Ptr< reco::Muon >::getData_(), getProductPtr(), getThinnedProductPtr(), edm::PtrVectorBase::id(), edm::RefToBaseProd< T >::id(), edm::RefVector< std::vector< math::PtEtaPhiELorentzVectorD > >::id(), edm::RefProd< Phase2TrackerCluster1Ds >::id(), edm::Ptr< reco::Muon >::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::RefToBaseProd< T >::operator->(), edm::operator<(), edm::operator==(), productNotFoundException(), pushBackItem(), pushBackRefItem(), reco::TrackExtraBase::recHitRef(), tryToGetProductPtr(), and wrongTypeException().
bool edm::RefCore::isAvailable | ( | ) | const |
Definition at line 169 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(), edm::RefProd< Phase2TrackerCluster1Ds >::isAvailable(), edm::Ref< C, T, F >::isAvailable(), 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 >::isAvailable(), and operator!().
|
inline |
Definition at line 74 of file RefCore.h.
References ISNONNULL_IMPL.
Referenced by edm::PtrVectorBase::isNonnull(), edm::RefToBaseProd< T >::isNonnull(), edm::RefProd< Phase2TrackerCluster1Ds >::isNonnull(), isNull(), pushBackItem(), and pushBackRefItem().
|
inline |
Definition at line 71 of file RefCore.h.
References isNonnull().
Referenced by operator!(), edm::RefToBaseProd< T >::operator->(), pushBackItem(), and pushBackRefItem().
bool edm::RefCore::isThinnedAvailable | ( | unsigned int | thinnedKey, |
EDProductGetter const * | prodGetter | ||
) | const |
Definition at line 130 of file RefCore.cc.
References edm::EDProductGetter::getThinnedProduct(), id(), edm::ProductID::isValid(), and productPtr().
Referenced by edm::refitem::IsThinnedAvailableImpl< C, unsigned int >::isThinnedAvailable_(), and productGetter().
|
inline |
Definition at line 106 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< std::vector< math::PtEtaPhiELorentzVectorD > >::isTransient(), edm::RefProd< Phase2TrackerCluster1Ds >::isTransient(), edm::Ptr< reco::Muon >::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 |
Definition at line 108 of file RefCore.h.
References isTransient(), pushBackItem(), and pushBackRefItem().
void edm::RefCore::nullPointerForTransientException | ( | std::type_info const & | type | ) | const |
Definition at line 161 of file RefCore.cc.
References Exception, and edm::errors::InvalidReference.
Referenced by edm::getProduct(), edm::getProductWithCoreFromRef(), edm::getThinnedProduct(), edm::RefCoreWithIndex::nullPointerForTransientException(), productGetter(), and edm::tryToGetProductWithCoreFromRef().
|
inline |
Definition at line 53 of file RefCore.cc.
References cachePtr_, processIndex_, and productIndex_.
Referenced by RefCore().
|
inline |
Definition at line 84 of file RefCore.h.
References getProductPtr(), getThinnedProductPtr(), isThinnedAvailable(), noexcept, nullPointerForTransientException(), PRODUCTGETTER_IMPL, productNotFoundException(), setProductGetter(), swap(), tryToGetProductPtr(), and wrongTypeException().
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::RefToBaseProd< T >::operator->(), edm::PtrVectorBase::productGetter(), edm::RefToBaseProd< T >::productGetter(), edm::RefVector< std::vector< math::PtEtaPhiELorentzVectorD > >::productGetter(), edm::RefProd< Phase2TrackerCluster1Ds >::productGetter(), edm::Ptr< reco::Muon >::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(), and pushBackRefItem().
void edm::RefCore::productNotFoundException | ( | std::type_info const & | type | ) | const |
Definition at line 141 of file RefCore.cc.
References Exception, id(), and edm::errors::ProductNotFound.
Referenced by edm::Ptr< reco::Muon >::getData_(), getProductPtr(), getThinnedProductPtr(), productGetter(), 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 52 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< T >::hasCache(), edm::RefProd< Phase2TrackerCluster1Ds >::hasCache(), edm::RefVector< std::vector< math::PtEtaPhiELorentzVectorD > >::hasProductCache(), edm::Ptr< reco::Muon >::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::Ptr< T >::operator*(), edm::Ptr< T >::operator->(), edm::operator<(), edm::operator==(), edm::RefVectorBase< key_type >::pushBack(), pushBackItem(), reco::TrackExtraBase::recHitRef(), edm::RefToBaseProd< T >::RefToBaseProd(), reco::PFCandidate::storeRefInfo(), and edm::RefToBaseProd< T >::viewPtr().
void edm::RefCore::pushBackItem | ( | RefCore const & | productToBeInserted, |
bool | checkPointer | ||
) |
Definition at line 194 of file RefCore.cc.
References cachePtrIsInvalid(), Exception, id(), edm::errors::InvalidReference, isNonnull(), isNull(), isTransient(), productGetter(), productPtr(), setId(), setProductGetter(), setProductPtr(), and setTransient().
Referenced by isTransientInt(), edm::PtrVectorBase::push_back_base(), edm::RefCoreWithIndex::pushBackItem(), and reco::TrackExtraBase::setHits().
void edm::RefCore::pushBackRefItem | ( | RefCore const & | productToBeInserted | ) |
Definition at line 243 of file RefCore.cc.
References Exception, id(), edm::errors::InvalidReference, isNonnull(), isNull(), isTransient(), productGetter(), setId(), setProductGetter(), and setTransient().
Referenced by isTransientInt().
|
inlineprivate |
Definition at line 120 of file RefCore.h.
References SETCACHEISPRODUCTGETTER_IMPL.
Referenced by RefCore(), and setProductGetter().
|
inlineprivate |
Definition at line 119 of file RefCore.h.
References SETCACHEISPRODUCTPTR_IMPL.
Referenced by setProductPtr().
|
private |
Definition at line 185 of file RefCore.cc.
References edm::refcoreimpl::kCacheIsProductPtrBit, edm::refcoreimpl::kTransientBit, edm::ProductID::processIndex(), processIndex_, edm::ProductID::productIndex(), and productIndex_.
Referenced by pushBackItem(), pushBackRefItem(), RefCore(), and edm::RefCoreWithIndex::setId().
void edm::RefCore::setProductGetter | ( | EDProductGetter const * | prodGetter | ) | const |
Definition at line 180 of file RefCore.cc.
References setCacheIsProductGetter().
Referenced by productGetter(), pushBackItem(), pushBackRefItem(), edm::PtrVectorBase::setProductGetter(), and edm::RefCoreWithIndex::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 58 of file RefCore.h.
References setCacheIsProductPtr().
Referenced by edm::RefVector< std::vector< math::PtEtaPhiELorentzVectorD > >::at(), edm::refitem::findRefItem(), edm::Ptr< reco::Muon >::getData_(), edm::refcore::getProduct_(), edm::RefVector< std::vector< math::PtEtaPhiELorentzVectorD > >::operator[](), edm::Ptr< reco::Muon >::Ptr(), pushBackItem(), and edm::RefToBaseProd< T >::RefToBaseProd().
|
inlineprivate |
Definition at line 118 of file RefCore.h.
References SETTRANSIENT_IMPL.
Referenced by pushBackItem(), pushBackRefItem(), and RefCore().
|
inlinenoexcept |
Definition at line 157 of file RefCore.h.
References cachePtr_, trackingPlots::other, processIndex_, productIndex_, and std::swap().
Referenced by productGetter(), edm::PtrVectorBase::swap(), and edm::swap().
WrapperBase const * edm::RefCore::tryToGetProductPtr | ( | std::type_info const & | type, |
EDProductGetter const * | prodGetter | ||
) | const |
Definition at line 97 of file RefCore.cc.
References cachePtrIsInvalid(), edm::WrapperBase::dynamicTypeInfo(), edm::EDProductGetter::getIt(), id(), isTransient(), edm::ProductID::isValid(), throwInvalidRefFromNoCache(), throwInvalidRefFromNullOrInvalidRef(), and wrongTypeException().
Referenced by productGetter(), and 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 66 of file RefCore.h.
References cachePtr_, and edm::refcoreimpl::tryToSetCacheItemForFirstTime().
Referenced by edm::RefToBaseProd< T >::operator->().
void edm::RefCore::wrongTypeException | ( | std::type_info const & | expectedType, |
std::type_info const & | actualType | ||
) | const |
Definition at line 151 of file RefCore.cc.
References Exception, id(), and edm::errors::InvalidReference.
Referenced by edm::refcore::getProduct_(), getProductPtr(), edm::refcore::getProductWithCoreFromRef_(), getThinnedProductPtr(), productGetter(), tryToGetProductPtr(), and edm::RefCoreWithIndex::wrongTypeException().
|
friend |
|
mutableprivate |
Definition at line 126 of file RefCore.h.
Referenced by cachePtrIsInvalid(), operator=(), RefCore(), edm::RefCoreWithIndex::RefCoreWithIndex(), swap(), and tryToSetProductPtrForFirstTime().
|
private |
Definition at line 132 of file RefCore.h.
Referenced by operator=(), setId(), and swap().
|
private |
Definition at line 133 of file RefCore.h.
Referenced by operator=(), setId(), and swap().