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

#include "ProductProvenance.h"

Classes

struct  Transients
 

Public Member Functions

 ProductProvenance ()=default
 
 ProductProvenance (ProductID pid)
 
 ProductProvenance (ProductID pid, ProductStatus status)
 
 ProductProvenance (ProductID pid, ProductStatus status, std::shared_ptr< Parentage > parentagePtr)
 
 ProductProvenance (ProductID pid, ProductStatus status, ParentageID const &id)
 
 ProductProvenance (ProductID pid, ProductStatus status, std::vector< ProductID > const &parents)
 
void write (std::ostream &os) const
 
ProductID productID () const
 
ProductStatus const & productStatus () const
 
ParentageID const & parentageID () const
 
Parentage const & parentage () const
 
void setStatus (ProductStatus status) const
 
void setPresent () const
 
void setNotPresent () const
 
bool noParentage () const
 

Private Member Functions

std::shared_ptr< Parentage > & parentagePtr () const
 

Private Attributes

ProductID productID_ {}
 
ProductStatus productStatus_ {productstatus::uninitialized()}
 
ParentageID parentageID_ {}
 
Transient< Transientstransients_ {}
 

Detailed Description

Definition at line 31 of file ProductProvenance.h.

Constructor & Destructor Documentation

art::ProductProvenance::ProductProvenance ( )
default
art::ProductProvenance::ProductProvenance ( ProductID  pid)
explicit

Definition at line 10 of file ProductProvenance.cc.

art::ProductProvenance::ProductProvenance ( ProductID  pid,
ProductStatus  status 
)

Definition at line 12 of file ProductProvenance.cc.

References productStatus_.

art::ProductProvenance::ProductProvenance ( ProductID  pid,
ProductStatus  status,
std::shared_ptr< Parentage parentagePtr 
)

Definition at line 23 of file ProductProvenance.cc.

References art::thread_safe_registry_via_id< K, M >::emplace(), parentageID_, parentagePtr(), and productStatus_.

26  : productID_{pid}, productStatus_{status}, parentageID_{pPtr->id()}
27  {
28  parentagePtr() = pPtr;
30  }
std::shared_ptr< Parentage > & parentagePtr() const
ProductStatus productStatus_
static auto emplace(value_type const &value)
art::ProductProvenance::ProductProvenance ( ProductID  pid,
ProductStatus  status,
ParentageID const &  id 
)

Definition at line 17 of file ProductProvenance.cc.

References parentageID_, and productStatus_.

art::ProductProvenance::ProductProvenance ( ProductID  pid,
ProductStatus  status,
std::vector< ProductID > const &  parents 
)

Definition at line 32 of file ProductProvenance.cc.

References art::thread_safe_registry_via_id< K, M >::emplace(), parentageID_, parentagePtr(), and productStatus_.

35  : productID_{pid}, productStatus_{status}
36  {
37  parentagePtr() = std::make_shared<Parentage>();
38  parentagePtr()->parents() = parents;
39  parentageID_ = parentagePtr()->id();
41  }
std::shared_ptr< Parentage > & parentagePtr() const
ProductStatus productStatus_
static auto emplace(value_type const &value)

Member Function Documentation

bool art::ProductProvenance::noParentage ( ) const
inline

Definition at line 77 of file ProductProvenance.h.

References transients_.

Referenced by art::operator==(), and write().

78  {
79  return transients_.get().noParentage_;
80  }
Transient< Transients > transients_
Parentage const & art::ProductProvenance::parentage ( ) const

Definition at line 44 of file ProductProvenance.cc.

References art::thread_safe_registry_via_id< K, M >::get(), parentageID_, and parentagePtr().

Referenced by art::detail::KeptProvenance::insertAncestors(), art::markAncestors(), art::Provenance::parentage(), and parentageID().

45  {
46  if (!parentagePtr()) {
47  parentagePtr() = std::make_shared<Parentage>();
49  parentageID_, *parentagePtr()); // Filled only if successful retrieval
50  }
51  return *parentagePtr();
52  }
std::shared_ptr< Parentage > & parentagePtr() const
static collection_type const & get()
ParentageID const& art::ProductProvenance::parentageID ( ) const
inline

Definition at line 63 of file ProductProvenance.h.

References parentage(), and parentageID_.

Referenced by art::operator==(), and write().

64  {
65  return parentageID_;
66  }
std::shared_ptr<Parentage>& art::ProductProvenance::parentagePtr ( ) const
inlineprivate

Definition at line 90 of file ProductProvenance.h.

References transients_.

Referenced by parentage(), and ProductProvenance().

91  {
92  return transients_.get().parentagePtr_;
93  }
Transient< Transients > transients_
ProductID art::ProductProvenance::productID ( ) const
inline

Definition at line 53 of file ProductProvenance.h.

References productID_.

Referenced by art::operator<(), art::operator==(), art::detail::KeptProvenance::setStatus(), and write().

54  {
55  return productID_;
56  }
ProductStatus const& art::ProductProvenance::productStatus ( ) const
inline

Definition at line 58 of file ProductProvenance.h.

References productStatus_.

Referenced by art::operator==(), art::Provenance::productStatus(), setNotPresent(), setPresent(), and write().

59  {
60  return productStatus_;
61  }
ProductStatus productStatus_
void art::ProductProvenance::setNotPresent ( ) const

Definition at line 64 of file ProductProvenance.cc.

References art::productstatus::dropped(), art::productstatus::neverCreated(), productStatus(), setStatus(), and art::productstatus::unknown().

Referenced by setStatus().

65  {
67  return;
69  return;
72  }
ProductStatus unknown()
Definition: ProductStatus.h:31
ProductStatus const & productStatus() const
void setStatus(ProductStatus status) const
ProductStatus dropped()
Definition: ProductStatus.h:26
ProductStatus neverCreated()
Definition: ProductStatus.h:21
void art::ProductProvenance::setPresent ( ) const

Definition at line 55 of file ProductProvenance.cc.

References art::productstatus::present(), productStatus(), setStatus(), and art::productstatus::unknown().

Referenced by setStatus().

56  {
58  return;
61  }
ProductStatus unknown()
Definition: ProductStatus.h:31
ProductStatus const & productStatus() const
void setStatus(ProductStatus status) const
ProductStatus present()
Definition: ProductStatus.h:16
void art::ProductProvenance::setStatus ( ProductStatus  status) const
inline

Definition at line 69 of file ProductProvenance.h.

References productStatus_, setNotPresent(), and setPresent().

Referenced by setNotPresent(), and setPresent().

70  {
71  productStatus_ = status;
72  }
ProductStatus productStatus_
void art::ProductProvenance::write ( std::ostream &  os) const

Definition at line 75 of file ProductProvenance.cc.

References noParentage(), parentageID(), productID(), and productStatus().

Referenced by art::operator<<(), and art::Provenance::write().

76  {
77  os << "product ID = " << productID() << '\n';
78  os << "product status = " << static_cast<int>(productStatus()) << '\n';
79  if (!noParentage()) {
80  os << "entry description ID = " << parentageID() << '\n';
81  }
82  }
ProductID productID() const
ProductStatus const & productStatus() const
ParentageID const & parentageID() const

Member Data Documentation

ParentageID art::ProductProvenance::parentageID_ {}
private

Definition at line 97 of file ProductProvenance.h.

Referenced by parentage(), parentageID(), and ProductProvenance().

ProductID art::ProductProvenance::productID_ {}
private

Definition at line 95 of file ProductProvenance.h.

Referenced by productID().

ProductStatus art::ProductProvenance::productStatus_ {productstatus::uninitialized()}
mutableprivate

Definition at line 96 of file ProductProvenance.h.

Referenced by ProductProvenance(), productStatus(), and setStatus().

Transient<Transients> art::ProductProvenance::transients_ {}
mutableprivate

Definition at line 98 of file ProductProvenance.h.

Referenced by noParentage(), and parentagePtr().


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