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

#include "ProductMetaData.h"

Public Member Functions

 ProductMetaData (ProductMetaData const &)=delete
 
ProductMetaDataoperator= (ProductMetaData const &)=delete
 
ProductList const & productList () const
 
void printBranchDescriptions (std::ostream &os) const
 
bool productProduced (BranchType const which) const
 
InputTag inputTag (art::ProductID const pid) const
 

Static Public Member Functions

static ProductMetaData const & instance ()
 

Private Member Functions

 ProductMetaData (MasterProductRegistry const &mpr)
 

Static Private Member Functions

static void create_instance (MasterProductRegistry const &mpr)
 

Private Attributes

cet::exempt_ptr< MasterProductRegistry const > mpr_
 

Static Private Attributes

static ProductMetaData const * me = nullptr
 

Friends

class EventProcessor
 
class ::MPRGlobalTestFixture
 

Detailed Description

Definition at line 30 of file ProductMetaData.h.

Constructor & Destructor Documentation

art::ProductMetaData::ProductMetaData ( MasterProductRegistry const &  mpr)
inlineprivate

Definition at line 52 of file ProductMetaData.h.

Referenced by create_instance().

52 : mpr_{&mpr} {}
cet::exempt_ptr< MasterProductRegistry const > mpr_
art::ProductMetaData::ProductMetaData ( ProductMetaData const &  )
delete

Member Function Documentation

static void art::ProductMetaData::create_instance ( MasterProductRegistry const &  mpr)
inlinestaticprivate

Definition at line 56 of file ProductMetaData.h.

References art::errors::LogicError, me, and ProductMetaData().

Referenced by art::EventProcessor::EventProcessor().

57  {
58  if (me) {
60  << "ProductMetaData::create_instance called more than once.";
61  }
62  me = new ProductMetaData(mpr);
63  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
static ProductMetaData const * me
ProductMetaData(MasterProductRegistry const &mpr)
InputTag art::ProductMetaData::inputTag ( art::ProductID const  pid) const
inline

Definition at line 98 of file ProductMetaData.h.

References mpr_.

99  {
100  for (auto const& pr : mpr_->productList()) {
101  auto const& pd = pr.second;
102  if (pd.productID() == pid) {
103  return pd.inputTag();
104  }
105  }
106  return art::InputTag{};
107  }
cet::exempt_ptr< MasterProductRegistry const > mpr_
static ProductMetaData const& art::ProductMetaData::instance ( )
inlinestatic

Definition at line 40 of file ProductMetaData.h.

References art::errors::LogicError, and me.

Referenced by art::EventPrincipal::EventPrincipal(), art::DataViewImpl::getProductDescription(), art::MixOp< PROD, OPROD >::outgoingProductID(), art::RunPrincipal::RunPrincipal(), art::RootOutput::startEndFile(), art::SubRunPrincipal::SubRunPrincipal(), art::ProvenanceCheckerOutput::write(), write_product_node(), and art::RootOutputFile::writeProductDescriptionRegistry().

41  {
42  if (!me) {
43  throw Exception(errors::LogicError) << "ProductMetaData::instance "
44  "called before the sole "
45  "instance was created.";
46  }
47  return *me;
48  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
static ProductMetaData const * me
ProductMetaData& art::ProductMetaData::operator= ( ProductMetaData const &  )
delete
void art::ProductMetaData::printBranchDescriptions ( std::ostream &  os) const
inline

Definition at line 84 of file ProductMetaData.h.

References mpr_.

Referenced by art::operator<<().

85  {
86  mpr_->print(os);
87  }
cet::exempt_ptr< MasterProductRegistry const > mpr_
ProductList const& art::ProductMetaData::productList ( ) const
inline

Definition at line 77 of file ProductMetaData.h.

References mpr_.

Referenced by art::DataViewImpl::getProductDescription(), art::MixOp< PROD, OPROD >::outgoingProductID(), and art::ProvenanceCheckerOutput::write().

78  {
79  return mpr_->productList();
80  }
cet::exempt_ptr< MasterProductRegistry const > mpr_
bool art::ProductMetaData::productProduced ( BranchType const  which) const
inline

Definition at line 92 of file ProductMetaData.h.

References mpr_.

93  {
94  return mpr_->productProduced(which);
95  }
cet::exempt_ptr< MasterProductRegistry const > mpr_

Friends And Related Function Documentation

friend class ::MPRGlobalTestFixture
friend

Definition at line 35 of file ProductMetaData.h.

friend class EventProcessor
friend

Definition at line 32 of file ProductMetaData.h.

Member Data Documentation

ProductMetaData const * art::ProductMetaData::me = nullptr
staticprivate

Definition at line 67 of file ProductMetaData.h.

Referenced by create_instance(), and instance().

cet::exempt_ptr<MasterProductRegistry const> art::ProductMetaData::mpr_
private

Definition at line 110 of file ProductMetaData.h.

Referenced by inputTag(), printBranchDescriptions(), productList(), and productProduced().


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