LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::RefCore Class Reference

#include "RefCore.h"

Classes

struct  RefCoreTransients
 

Public Member Functions

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

Private Attributes

ProductID id_ {}
 
RefCoreTransients transients_ {}
 

Detailed Description

Definition at line 11 of file RefCore.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file RefCore.cc.

References transients_.

20  : id_{id}, transients_{prodPtr, prodGetter}
21  {}
RefCoreTransients transients_
Definition: RefCore.h:71
ProductID id_
Definition: RefCore.h:70

Member Function Documentation

constexpr ProductID art::RefCore::id ( ) const
inlinenoexcept
bool art::RefCore::isAvailable ( ) const

Definition at line 24 of file RefCore.cc.

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

Referenced by art::ProductPtr< T >::isAvailable(), art::ProductPtr< T >::operator bool(), and operator!().

25  {
26  if (productPtr()) {
27  return true;
28  }
29  return id_.isValid() && productGetter() != nullptr &&
30  productGetter()->getIt() != nullptr;
31  }
EDProduct const * getIt() const
EDProductGetter const * productGetter() const noexcept
Definition: RefCore.cc:41
constexpr bool isValid() const noexcept
Definition: ProductID.h:34
ProductID id_
Definition: RefCore.h:70
void const * productPtr() const noexcept
Definition: RefCore.cc:34
constexpr bool art::RefCore::isNonnull ( ) const
inlinenoexcept

Definition at line 28 of file RefCore.h.

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

Referenced by art::PtrVectorBase::isNonnull(), and isNull().

29  {
30  return id_.isValid();
31  }
constexpr bool isValid() const noexcept
Definition: ProductID.h:34
ProductID id_
Definition: RefCore.h:70
constexpr bool art::RefCore::isNull ( ) const
inlinenoexcept

Definition at line 33 of file RefCore.h.

References isNonnull().

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

34  {
35  return !isNonnull();
36  }
constexpr bool isNonnull() const noexcept
Definition: RefCore.h:28
constexpr bool art::RefCore::operator! ( ) const
inlinenoexcept

Definition at line 38 of file RefCore.h.

References isAvailable(), and isNull().

39  {
40  return isNull();
41  }
constexpr bool isNull() const noexcept
Definition: RefCore.h:33
EDProductGetter const * art::RefCore::productGetter ( ) const
noexcept

Definition at line 41 of file RefCore.cc.

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

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

42  {
43  return transients_.prodGetter_;
44  }
RefCoreTransients transients_
Definition: RefCore.h:71
EDProductGetter const * prodGetter_
Definition: RefCore.h:19
void const * art::RefCore::productPtr ( ) const
noexcept
void art::RefCore::setProductGetter ( EDProductGetter const *  prodGetter)
noexcept

Definition at line 57 of file RefCore.cc.

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

Referenced by id(), and art::PtrVectorBase::updateCore().

58  {
59  transients_.prodGetter_ = prodGetter;
60  }
RefCoreTransients transients_
Definition: RefCore.h:71
EDProductGetter const * prodGetter_
Definition: RefCore.h:19
void art::RefCore::setProductPtr ( void const *  prodPtr) const
noexcept

Definition at line 48 of file RefCore.cc.

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

Referenced by id(), art::ProductPtr< T >::operator->(), and art::PtrVectorBase::updateCore().

49  {
50  transients_.itemPtr_ = prodPtr;
51  }
RefCoreTransients transients_
Definition: RefCore.h:71
void art::RefCore::swap ( RefCore other)

Definition at line 63 of file RefCore.cc.

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

Referenced by id(), art::operator<(), and art::swap().

64  {
65  std::swap(id_, other.id_);
66  std::swap(transients_, other.transients_);
67  }
RefCoreTransients transients_
Definition: RefCore.h:71
ProductID id_
Definition: RefCore.h:70
void swap(RefCore &lhs, RefCore &rhs)
Definition: RefCore.cc:70

Member Data Documentation

ProductID art::RefCore::id_ {}
private

Definition at line 70 of file RefCore.h.

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

RefCoreTransients art::RefCore::transients_ {}
private

Definition at line 71 of file RefCore.h.

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


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