CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions
edm::ProducedProductHolder Class Referenceabstract

#include <ProductHolder.h>

Inheritance diagram for edm::ProducedProductHolder:
edm::ProductHolderBase edm::ScheduledProductHolder edm::SourceProductHolder edm::UnscheduledProductHolder

Public Types

enum  ProductStatus {
  Present = 0, NotRun = 3, NotCompleted = 4, NotPut = 5,
  UnscheduledNotRun = 6, ProductDeleted =7, Uninitialized = 0xff
}
 
- Public Types inherited from edm::ProductHolderBase
enum  ResolveStatus { ProductFound, ProductNotFound, Ambiguous }
 

Public Member Functions

 ProducedProductHolder ()
 
void producerCompleted ()
 
void producerStarted ()
 
ProductStatusstatus () const
 
virtual ~ProducedProductHolder ()
 
- Public Member Functions inherited from edm::ProductHolderBase
BranchDescription const & branchDescription () const
 
void checkType (WrapperBase const &prod) const
 
void deleteProduct ()
 
void mergeProduct (std::unique_ptr< WrapperBase > edp, ProductProvenance &productProvenance)
 
void mergeProduct (std::unique_ptr< WrapperBase > edp) const
 
void mergeTheProduct (std::unique_ptr< WrapperBase > edp) const
 
std::string const & moduleLabel () const
 
bool onDemand () const
 
ProductHolderBaseoperator= (ProductHolderBase const &)=delete
 
std::string const & processName () const
 
WrapperBaseproduct () const
 
ProductData const & productData () const
 
ProductDataproductData ()
 
 ProductHolderBase ()
 
 ProductHolderBase (ProductHolderBase const &)=delete
 
ProductID const & productID () const
 
std::string const & productInstanceName () const
 
ProductProvenanceproductProvenancePtr () const
 
TypeID productType () const
 
bool productUnavailable () const
 
bool productWasDeleted () const
 
Provenanceprovenance () const
 
bool provenanceAvailable () const
 
bool putOrMergeProduct () const
 
void putProduct (std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance)
 
void putProduct (std::unique_ptr< WrapperBase > edp) const
 
void reallyCheckType (WrapperBase const &prod) const
 
void resetBranchDescription (std::shared_ptr< BranchDescription const > bd)
 
void resetProductData ()
 
void resetStatus ()
 
std::string const & resolvedModuleLabel () const
 
ProductData const * resolveProduct (ResolveStatus &resolveStatus, bool skipCurrentProcess, ModuleCallingContext const *mcc) const
 
void setPrincipal (Principal *principal)
 
void setProcessHistory (ProcessHistory const &ph)
 
void setProductDeleted ()
 
void setProductProvenance (ProductProvenance const &prov) const
 
void setProvenance (std::shared_ptr< ProductProvenanceRetriever > provRetriever, ProcessHistory const &ph, ProductID const &pid)
 
bool singleProduct () const
 
void swap (ProductHolderBase &rhs)
 
void throwProductDeletedException () const
 
void write (std::ostream &os) const
 
virtual ~ProductHolderBase ()
 

Private Member Functions

virtual BranchDescription const & branchDescription_ () const override
 
virtual void checkType_ (WrapperBase const &prod) const override
 
virtual void mergeProduct_ (std::unique_ptr< WrapperBase > edp, ProductProvenance &productProvenance) override
 
virtual void mergeProduct_ (std::unique_ptr< WrapperBase > edp) const override
 
virtual ProductProvenanceproductProvenancePtr_ () const override
 
virtual bool productUnavailable_ () const override
 
virtual bool productWasDeleted_ () const override
 
virtual bool putOrMergeProduct_ () const override
 
virtual void putProduct_ (std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance) override
 
virtual void putProduct_ (std::unique_ptr< WrapperBase > edp) const override
 
virtual void resetBranchDescription_ (std::shared_ptr< BranchDescription const > bd) override
 
virtual void resetProductData_ () override
 
virtual std::string const & resolvedModuleLabel_ () const override
 
virtual void setPrincipal_ (Principal *principal) override
 
virtual void setProcessHistory_ (ProcessHistory const &ph) override
 
virtual void setProductDeleted_ () override
 
virtual void setProvenance_ (std::shared_ptr< ProductProvenanceRetriever > provRetriever, ProcessHistory const &ph, ProductID const &pid) override
 
virtual bool singleProduct_ () const override
 
virtual ProductStatusstatus_ () const =0
 

Detailed Description

Definition at line 263 of file ProductHolder.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

edm::ProducedProductHolder::ProducedProductHolder ( )
inline

Definition at line 274 of file ProductHolder.h.

edm::ProducedProductHolder::~ProducedProductHolder ( )
virtual

Definition at line 31 of file ProductHolder.cc.

31 {}

Member Function Documentation

virtual BranchDescription const& edm::ProducedProductHolder::branchDescription_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 292 of file ProductHolder.h.

References edm::ProductData::branchDescription(), and edm::ProductHolderBase::productData().

292 {return *productData().branchDescription();}
std::shared_ptr< BranchDescription const > const & branchDescription() const
Definition: ProductData.h:25
ProductData const & productData() const
Definition: ProductHolder.h:40
virtual void edm::ProducedProductHolder::checkType_ ( WrapperBase const &  prod) const
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 285 of file ProductHolder.h.

References edm::ProductHolderBase::reallyCheckType().

285  {
287  }
void reallyCheckType(WrapperBase const &prod) const
void edm::ProducedProductHolder::mergeProduct_ ( std::unique_ptr< WrapperBase edp,
ProductProvenance productProvenance 
)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 131 of file ProductHolder.cc.

References assert(), edm::ProductHolderBase::mergeTheProduct(), Present, edm::ProductHolderBase::provenance(), edm::ProductHolderBase::setProductProvenance(), and status().

133  {
134  assert(provenance()->productProvenanceValid());
135  assert(status() == Present);
136  setProductProvenance(productProvenance);
137  mergeTheProduct(std::move(edp));
138  }
assert(m_qm.get())
Provenance * provenance() const
void setProductProvenance(ProductProvenance const &prov) const
void mergeTheProduct(std::unique_ptr< WrapperBase > edp) const
ProductStatus & status() const
void edm::ProducedProductHolder::mergeProduct_ ( std::unique_ptr< WrapperBase edp) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 146 of file ProductHolder.cc.

References assert(), edm::ProductHolderBase::mergeTheProduct(), Present, and status().

146  {
147  assert(status() == Present);
148  mergeTheProduct(std::move(edp));
149  }
assert(m_qm.get())
void mergeTheProduct(std::unique_ptr< WrapperBase > edp) const
ProductStatus & status() const
void edm::ProducedProductHolder::producerCompleted ( )
void edm::ProducedProductHolder::producerStarted ( )
ProductProvenance * edm::ProducedProductHolder::productProvenancePtr_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 319 of file ProductHolder.cc.

References edm::Provenance::productProvenance(), and edm::ProductHolderBase::provenance().

319  {
320  return provenance()->productProvenance();
321  }
ProductProvenance * productProvenance() const
Definition: Provenance.h:49
Provenance * provenance() const
bool edm::ProducedProductHolder::productUnavailable_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 290 of file ProductHolder.cc.

References edm::WrapperBase::isPresent(), edm::ProductHolderBase::onDemand(), and edm::ProductHolderBase::product().

290  {
291  // If unscheduled production, the product is potentially available.
292  if(onDemand()) return false;
293  // The product is available if and only if a product has been put.
294  bool unavailable = !(product() && product()->isPresent());
295  return unavailable;
296  }
WrapperBase * product() const
Definition: ProductHolder.h:81
bool isPresent() const
Definition: WrapperBase.h:22
bool onDemand() const
Definition: ProductHolder.h:75
bool edm::ProducedProductHolder::productWasDeleted_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 300 of file ProductHolder.cc.

References ProductDeleted, and status().

300  {
301  return status() == ProductDeleted;
302  }
ProductStatus & status() const
bool edm::ProducedProductHolder::putOrMergeProduct_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 141 of file ProductHolder.cc.

References edm::ProductHolderBase::productUnavailable().

141  {
142  return productUnavailable();
143  }
bool productUnavailable() const
Definition: ProductHolder.h:69
void edm::ProducedProductHolder::putProduct_ ( std::unique_ptr< WrapperBase edp,
ProductProvenance const &  productProvenance 
)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 112 of file ProductHolder.cc.

References assert(), edm::ProductHolderBase::branchDescription(), edm::BranchDescription::branchName(), Exception, edm::errors::InsertFailure, Present, edm::es::produced, edm::ProductHolderBase::product(), edm::ProductHolderBase::productData(), edm::ProductHolderBase::provenance(), edm::ProductHolderBase::setProductProvenance(), status(), status_(), Uninitialized, and edm::ProductData::wrapper_.

114  {
115  if(product()) {
117  << "Attempt to insert more than one product on branch " << branchDescription().branchName() << "\n";
118  }
120  assert(edp.get() != nullptr);
121  assert(!provenance()->productProvenanceValid());
122  assert(status() != Present);
124  setProductProvenance(productProvenance);
125  assert(provenance()->productProvenanceValid());
126  productData().wrapper_ = std::move(edp); // ProductHolder takes ownership
127  status_() = Present;
128  }
virtual ProductStatus & status_() const =0
std::string const & branchName() const
WrapperBase * product() const
Definition: ProductHolder.h:81
assert(m_qm.get())
Provenance * provenance() const
BranchDescription const & branchDescription() const
Definition: ProductHolder.h:90
std::shared_ptr< WrapperBase > wrapper_
Definition: ProductData.h:46
ProductData const & productData() const
Definition: ProductHolder.h:40
void setProductProvenance(ProductProvenance const &prov) const
eventsetup::produce::Produce produced
Definition: ESProducts.cc:20
ProductStatus & status() const
void edm::ProducedProductHolder::putProduct_ ( std::unique_ptr< WrapperBase edp) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 152 of file ProductHolder.cc.

References assert(), edm::ProductHolderBase::branchDescription(), edm::BranchDescription::branchName(), Exception, edm::errors::InsertFailure, Present, edm::es::produced, edm::ProductHolderBase::product(), edm::ProductHolderBase::productData(), status(), status_(), Uninitialized, and edm::ProductData::wrapper_.

152  {
153  if(product()) {
155  << "Attempt to insert more than one product on branch " << branchDescription().branchName() << "\n";
156  }
158  assert(edp.get() != nullptr);
159  assert(status() != Present);
161  productData().wrapper_ = std::move(edp); // ProductHolder takes ownership
162  status_() = Present;
163  }
virtual ProductStatus & status_() const =0
std::string const & branchName() const
WrapperBase * product() const
Definition: ProductHolder.h:81
assert(m_qm.get())
BranchDescription const & branchDescription() const
Definition: ProductHolder.h:90
std::shared_ptr< WrapperBase > wrapper_
Definition: ProductData.h:46
ProductData const & productData() const
Definition: ProductHolder.h:40
eventsetup::produce::Produce produced
Definition: ESProducts.cc:20
ProductStatus & status() const
virtual void edm::ProducedProductHolder::resetBranchDescription_ ( std::shared_ptr< BranchDescription const >  bd)
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 293 of file ProductHolder.h.

References edm::ProductHolderBase::productData(), and edm::ProductData::resetBranchDescription().

void resetBranchDescription(std::shared_ptr< BranchDescription const > bd)
Definition: ProductData.cc:26
ProductData const & productData() const
Definition: ProductHolder.h:40
void edm::ProducedProductHolder::resetProductData_ ( )
overrideprivatevirtual
virtual std::string const& edm::ProducedProductHolder::resolvedModuleLabel_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 294 of file ProductHolder.h.

References edm::ProductHolderBase::moduleLabel().

294 {return moduleLabel();}
std::string const & moduleLabel() const
void edm::ProducedProductHolder::setPrincipal_ ( Principal principal)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 332 of file ProductHolder.cc.

References Exception, and edm::errors::LogicError.

332  {
334  << "ProducedProductHolder::setPrincipal__() not implemented and should never be called.\n"
335  << "Contact a Framework developer\n";
336  }
void edm::ProducedProductHolder::setProcessHistory_ ( ProcessHistory const &  ph)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 315 of file ProductHolder.cc.

References edm::ProductHolderBase::productData(), edm::ProductData::prov_, and edm::Provenance::setProcessHistory().

315  {
317  }
Provenance prov_
Definition: ProductData.h:47
ProductData const & productData() const
Definition: ProductHolder.h:40
void setProcessHistory(ProcessHistory const &ph)
Definition: Provenance.h:76
void edm::ProducedProductHolder::setProductDeleted_ ( )
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 305 of file ProductHolder.cc.

References ProductDeleted, and status().

void edm::ProducedProductHolder::setProvenance_ ( std::shared_ptr< ProductProvenanceRetriever provRetriever,
ProcessHistory const &  ph,
ProductID const &  pid 
)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 309 of file ProductHolder.cc.

References edm::ProductHolderBase::productData(), edm::ProductData::prov_, edm::Provenance::setProcessHistory(), edm::Provenance::setProductID(), and edm::Provenance::setStore().

309  {
311  productData().prov_.setStore(provRetriever);
313  }
Provenance prov_
Definition: ProductData.h:47
ProductData const & productData() const
Definition: ProductHolder.h:40
tuple pid
Definition: sysUtil.py:22
void setProductID(ProductID const &pid)
Definition: Provenance.h:82
void setStore(std::shared_ptr< ProductProvenanceRetriever > store) const
Definition: Provenance.h:74
void setProcessHistory(ProcessHistory const &ph)
Definition: Provenance.h:76
bool edm::ProducedProductHolder::singleProduct_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 328 of file ProductHolder.cc.

328  {
329  return true;
330  }
ProductStatus& edm::ProducedProductHolder::status ( void  ) const
inline
virtual ProductStatus& edm::ProducedProductHolder::status_ ( ) const
privatepure virtual