LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
art::RefCore Class Reference

#include "RefCore.h"

Classes

struct  RefCoreTransients
 

Public Member Functions

 RefCore ()=default
 
 RefCore (ProductID const theId, void const *prodPtr, EDProductGetter const *prodGetter)
 
bool isNonnull () const
 
bool isNull () const
 
bool operator! () const
 
bool isAvailable () const
 
ProductID id () const
 
void const * productPtr () const
 
EDProductGetter const * productGetter () const
 
void setProductPtr (void const *prodPtr) const
 
void setProductGetter (EDProductGetter const *prodGetter) const
 
void swap (RefCore &other)
 

Private Attributes

ProductID id_ {}
 
RefCoreTransients transients_ {}
 

Detailed Description

Definition at line 28 of file RefCore.h.

Constructor & Destructor Documentation

art::RefCore::RefCore ( )
default
art::RefCore::RefCore ( ProductID const  theId,
void const *  prodPtr,
EDProductGetter const *  prodGetter 
)
inline

Definition at line 69 of file RefCore.h.

References transients_.

72  : id_{id}, transients_{prodPtr, prodGetter}
73 {}
RefCoreTransients transients_
Definition: RefCore.h:66
ProductID id_
Definition: RefCore.h:65

Member Function Documentation

auto art::RefCore::id ( ) const
inline

Definition at line 93 of file RefCore.h.

References id_.

Referenced by art::Ptr< T >::getData_(), art::Ptr< T >::id(), art::operator<(), art::operator==(), and art::PtrVectorBase::updateCore().

94 {
95  return id_;
96 }
ProductID id_
Definition: RefCore.h:65
bool art::RefCore::isAvailable ( ) const

Definition at line 15 of file RefCore.cc.

References art::EDProductGetter::getIt(), id_, art::EDProductGetter::isReady(), art::ProductID::isValid(), productGetter(), and productPtr().

Referenced by art::Ptr< T >::isAvailable().

16 {
17  return productPtr() != nullptr ||
18  (id_.isValid() && productGetter() != 0 && productGetter()->isReady() &&
19  productGetter()->getIt() != nullptr);
20 }
virtual EDProduct const * getIt() const =0
EDProductGetter const * productGetter() const
Definition: RefCore.h:105
virtual bool isReady() const =0
bool isValid() const
Definition: ProductID.h:33
ProductID id_
Definition: RefCore.h:65
void const * productPtr() const
Definition: RefCore.h:99
bool art::RefCore::isNonnull ( ) const
inline

Definition at line 76 of file RefCore.h.

References id_, and art::ProductID::isValid().

Referenced by isNull().

77 {
78  return id_.isValid();
79 }
bool isValid() const
Definition: ProductID.h:33
ProductID id_
Definition: RefCore.h:65
bool art::RefCore::isNull ( ) const
inline

Definition at line 82 of file RefCore.h.

References isNonnull().

Referenced by operator!(), art::Ptr< T >::Ptr(), and art::PtrVectorBase::updateCore().

83 {
84  return !isNonnull();
85 }
bool isNonnull() const
Definition: RefCore.h:76
bool art::RefCore::operator! ( ) const
inline

Definition at line 87 of file RefCore.h.

References isNull().

88 {
89  return isNull();
90 }
bool isNull() const
Definition: RefCore.h:82
auto art::RefCore::productGetter ( ) const
inline

Definition at line 105 of file RefCore.h.

References art::RefCore::RefCoreTransients::prodGetter_, and transients_.

Referenced by isAvailable(), art::Ptr< T >::productGetter(), and art::PtrVectorBase::updateCore().

106 {
107  return transients_.prodGetter_;
108 }
RefCoreTransients transients_
Definition: RefCore.h:66
EDProductGetter const * prodGetter_
Definition: RefCore.h:57
void const * art::RefCore::productPtr ( ) const
inline

Definition at line 99 of file RefCore.h.

References art::RefCore::RefCoreTransients::itemPtr_, and transients_.

Referenced by art::Ptr< T >::hasCache(), isAvailable(), art::Ptr< T >::operator->(), and art::PtrVectorBase::updateCore().

100 {
101  return transients_.itemPtr_;
102 }
RefCoreTransients transients_
Definition: RefCore.h:66
void art::RefCore::setProductGetter ( EDProductGetter const *  prodGetter) const
inline

Definition at line 117 of file RefCore.h.

References art::RefCore::RefCoreTransients::prodGetter_, and transients_.

Referenced by art::PtrVectorBase::updateCore().

118 {
119  transients_.prodGetter_ = prodGetter;
120 }
RefCoreTransients transients_
Definition: RefCore.h:66
EDProductGetter const * prodGetter_
Definition: RefCore.h:57
void art::RefCore::setProductPtr ( void const *  prodPtr) const
inline

Definition at line 111 of file RefCore.h.

References art::RefCore::RefCoreTransients::itemPtr_, and transients_.

Referenced by art::Ptr< T >::getData_(), and art::PtrVectorBase::updateCore().

112 {
113  transients_.itemPtr_ = prodPtr;
114 }
RefCoreTransients transients_
Definition: RefCore.h:66
void art::RefCore::swap ( RefCore other)
inline

Definition at line 123 of file RefCore.h.

References id_, art::swap(), and transients_.

Referenced by art::swap().

124 {
125  using std::swap;
126  swap(id_, other.id_);
127  swap(transients_, other.transients_);
128 }
void swap(art::RefCore &, art::RefCore &)
Definition: RefCore.h:155
void swap(RefCore &other)
Definition: RefCore.h:123
RefCoreTransients transients_
Definition: RefCore.h:66
ProductID id_
Definition: RefCore.h:65

Member Data Documentation

ProductID art::RefCore::id_ {}
private

Definition at line 65 of file RefCore.h.

Referenced by id(), isAvailable(), isNonnull(), and swap().

RefCoreTransients art::RefCore::transients_ {}
private

Definition at line 66 of file RefCore.h.

Referenced by productGetter(), productPtr(), RefCore(), setProductGetter(), setProductPtr(), and swap().


The documentation for this class was generated from the following files: