CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::ParentProcessProductResolver Class Reference

#include <ProductResolvers.h>

Inheritance diagram for edm::ParentProcessProductResolver:
edm::ProductResolverBase

Public Types

typedef ProducedProductResolver::ProductStatus ProductStatus
 

Public Member Functions

virtual void connectTo (ProductResolverBase const &iOther, Principal const *iParentPrincipal) override final
 
 ParentProcessProductResolver (std::shared_ptr< BranchDescription const > bd)
 
- Public Member Functions inherited from edm::ProductResolverBase
BranchDescription const & branchDescription () const
 
std::string const & moduleLabel () const
 
ProductResolverBaseoperator= (ProductResolverBase const &)=delete
 
void prefetchAsync (WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
std::string const & processName () const
 
ProductID const & productID () const
 
std::string const & productInstanceName () const
 
ProductProvenance const * productProvenancePtr () const
 
bool productResolved () const
 
 ProductResolverBase ()
 
 ProductResolverBase (ProductResolverBase const &)=delete
 
TypeID productType () const
 
bool productUnavailable () const
 
bool productWasDeleted () const
 
bool productWasFetchedAndIsValid (bool iSkipCurrentProcess) const
 
Provenance const * provenance () const
 
bool provenanceAvailable () const
 
void putOrMergeProduct (std::unique_ptr< WrapperBase > edp) const
 
void putProduct (std::unique_ptr< WrapperBase > edp) const
 
void resetBranchDescription (std::shared_ptr< BranchDescription const > bd)
 
virtual void resetFailedFromThisProcess ()
 
void resetProductData ()
 
std::string const & resolvedModuleLabel () const
 
Resolution resolveProduct (Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
void retrieveAndMerge (Principal const &principal) const
 
void setProcessHistory (ProcessHistory const &ph)
 
void setProvenance (ProductProvenanceRetriever const *provRetriever, ProcessHistory const &ph, ProductID const &pid)
 
virtual void setupUnscheduled (UnscheduledConfigurator const &)
 
bool singleProduct () const
 
StableProvenance const * stableProvenance () const
 
void unsafe_deleteProduct () const
 
bool unscheduledWasNotRun () const
 
void write (std::ostream &os) const
 
virtual ~ProductResolverBase ()
 

Private Member Functions

virtual BranchDescription const & branchDescription_ () const override
 
virtual void prefetchAsync_ (WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
 
virtual ProductProvenance const * productProvenancePtr_ () const override
 
virtual bool productResolved_ () const override final
 
virtual bool productUnavailable_ () const override
 
virtual bool productWasDeleted_ () const override
 
virtual bool productWasFetchedAndIsValid_ (bool iSkipCurrentProcess) const override
 
virtual Provenance const * provenance_ () const override final
 
virtual void putOrMergeProduct_ (std::unique_ptr< WrapperBase > prod) const override final
 
virtual void putProduct_ (std::unique_ptr< WrapperBase > edp) const override
 
virtual void resetBranchDescription_ (std::shared_ptr< BranchDescription const > bd) override
 
virtual void resetProductData_ (bool deleteEarly) override
 
virtual std::string const & resolvedModuleLabel_ () const override
 
virtual Resolution resolveProduct_ (Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
 
virtual void setProcessHistory_ (ProcessHistory const &ph) override
 
virtual void setProvenance_ (ProductProvenanceRetriever const *provRetriever, ProcessHistory const &ph, ProductID const &pid) override
 
virtual bool singleProduct_ () const override
 
void throwNullRealProduct () const
 
virtual bool unscheduledWasNotRun_ () const override
 

Private Attributes

std::shared_ptr< BranchDescription const > bd_
 
Principal const * parentPrincipal_
 
ProductProvenanceRetriever const * provRetriever_
 
ProductResolverBase const * realProduct_
 

Detailed Description

Definition at line 250 of file ProductResolvers.h.

Member Typedef Documentation

Definition at line 252 of file ProductResolvers.h.

Constructor & Destructor Documentation

edm::ParentProcessProductResolver::ParentProcessProductResolver ( std::shared_ptr< BranchDescription const >  bd)
inlineexplicit

Definition at line 253 of file ProductResolvers.h.

253 : ProductResolverBase(), realProduct_(nullptr), bd_(bd), provRetriever_(nullptr), parentPrincipal_(nullptr) {}
std::shared_ptr< BranchDescription const > bd_
ProductProvenanceRetriever const * provRetriever_
ProductResolverBase const * realProduct_

Member Function Documentation

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

Implements edm::ProductResolverBase.

Definition at line 291 of file ProductResolvers.h.

291 {return *bd_;}
std::shared_ptr< BranchDescription const > bd_
virtual void edm::ParentProcessProductResolver::connectTo ( ProductResolverBase const &  iOther,
Principal const *  iParentPrincipal 
)
inlinefinaloverridevirtual

Implements edm::ProductResolverBase.

Definition at line 255 of file ProductResolvers.h.

255  {
256  realProduct_ = &iOther;
257  parentPrincipal_ = iParentPrincipal;
258  };
ProductResolverBase const * realProduct_
virtual void edm::ParentProcessProductResolver::prefetchAsync_ ( WaitingTask waitTask,
Principal const &  principal,
bool  skipCurrentProcess,
SharedResourcesAcquirer sra,
ModuleCallingContext const *  mcc 
) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 268 of file ProductResolvers.h.

272  {
273  skipCurrentProcess = false;
274  realProduct_->prefetchAsync( waitTask, *parentPrincipal_, skipCurrentProcess, sra, mcc);
275  }
void prefetchAsync(WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
ProductResolverBase const * realProduct_
ProductProvenance const * edm::ParentProcessProductResolver::productProvenancePtr_ ( ) const
overrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 593 of file ProductResolvers.cc.

593  {
594  return provRetriever_? provRetriever_->branchIDToProvenance(bd_->originalBranchID()): nullptr;
595  }
std::shared_ptr< BranchDescription const > bd_
ProductProvenanceRetriever const * provRetriever_
ProductProvenance const * branchIDToProvenance(BranchID const &bid) const
virtual bool edm::ParentProcessProductResolver::productResolved_ ( ) const
inlinefinaloverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 282 of file ProductResolvers.h.

282 { return realProduct_->productResolved(); }
ProductResolverBase const * realProduct_
virtual bool edm::ParentProcessProductResolver::productUnavailable_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 281 of file ProductResolvers.h.

281 {return realProduct_->productUnavailable();}
ProductResolverBase const * realProduct_
virtual bool edm::ParentProcessProductResolver::productWasDeleted_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 283 of file ProductResolvers.h.

283 {return realProduct_->productWasDeleted();}
ProductResolverBase const * realProduct_
virtual bool edm::ParentProcessProductResolver::productWasFetchedAndIsValid_ ( bool  iSkipCurrentProcess) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 284 of file ProductResolvers.h.

References parseEventContent::prod, edm::DataManagingProductResolver::putOrMergeProduct_(), and edm::ProductResolverBase::putProduct_().

284  {
285  iSkipCurrentProcess = false;
286  return realProduct_->productWasFetchedAndIsValid(iSkipCurrentProcess);
287  }
ProductResolverBase const * realProduct_
bool productWasFetchedAndIsValid(bool iSkipCurrentProcess) const
virtual Provenance const* edm::ParentProcessProductResolver::provenance_ ( ) const
inlinefinaloverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 293 of file ProductResolvers.h.

293  {return realProduct_->provenance();
294  }
Provenance const * provenance() const
ProductResolverBase const * realProduct_
void edm::ParentProcessProductResolver::putOrMergeProduct_ ( std::unique_ptr< WrapperBase prod) const
finaloverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 610 of file ProductResolvers.cc.

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

610  {
612  << "ParentProcessProductResolver::putOrMergeProduct_(std::unique_ptr<WrapperBase> edp) not implemented and should never be called.\n"
613  << "Contact a Framework developer\n";
614  }
void edm::ParentProcessProductResolver::putProduct_ ( std::unique_ptr< WrapperBase edp) const
overrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 604 of file ProductResolvers.cc.

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

604  {
606  << "ParentProcessProductResolver::putProduct_() not implemented and should never be called.\n"
607  << "Contact a Framework developer\n";
608  }
virtual void edm::ParentProcessProductResolver::resetBranchDescription_ ( std::shared_ptr< BranchDescription const >  bd)
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 292 of file ProductResolvers.h.

292 {bd_ = bd;}
std::shared_ptr< BranchDescription const > bd_
void edm::ParentProcessProductResolver::resetProductData_ ( bool  deleteEarly)
overrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 597 of file ProductResolvers.cc.

597  {
598  }
virtual std::string const& edm::ParentProcessProductResolver::resolvedModuleLabel_ ( ) const
inlineoverrideprivatevirtual
virtual Resolution edm::ParentProcessProductResolver::resolveProduct_ ( Principal const &  principal,
bool  skipCurrentProcess,
SharedResourcesAcquirer sra,
ModuleCallingContext const *  mcc 
) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 261 of file ProductResolvers.h.

264  {
265  skipCurrentProcess = false;
266  return realProduct_->resolveProduct(*parentPrincipal_, skipCurrentProcess, sra, mcc);
267  }
Resolution resolveProduct(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
ProductResolverBase const * realProduct_
void edm::ParentProcessProductResolver::setProcessHistory_ ( ProcessHistory const &  ph)
overrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 590 of file ProductResolvers.cc.

590  {
591  }
void edm::ParentProcessProductResolver::setProvenance_ ( ProductProvenanceRetriever const *  provRetriever,
ProcessHistory const &  ph,
ProductID const &  pid 
)
overrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 586 of file ProductResolvers.cc.

586  {
587  provRetriever_ = provRetriever;
588  }
ProductProvenanceRetriever const * provRetriever_
bool edm::ParentProcessProductResolver::singleProduct_ ( ) const
overrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 600 of file ProductResolvers.cc.

600  {
601  return true;
602  }
void edm::ParentProcessProductResolver::throwNullRealProduct ( ) const
private

Definition at line 616 of file ProductResolvers.cc.

References Exception, edm::errors::LogicError, and edm::NoProcessProductResolver::NoProcessProductResolver().

616  {
617  // In principle, this ought to be fixed. I noticed one hits this error
618  // when in a SubProcess and calling the Event::getProvenance function
619  // with a BranchID to a branch from an earlier SubProcess or the top
620  // level process and this branch is not kept in this SubProcess. It might
621  // be possible to hit this in other contexts. I say it ought to be
622  // fixed because one does not encounter this issue if the SubProcesses
623  // are split into genuinely different processes (in principle that
624  // ought to give identical behavior and results). No user has ever
625  // reported this issue which has been around for some time and it was only
626  // noticed when testing some rare corner cases after modifying Core code.
627  // After discussing this with Chris we decided that at least for the moment
628  // there are higher priorities than fixing this ... I converted it so it
629  // causes an exception instead of a seg fault. The issue that may need to
630  // be addressed someday is how ProductResolvers for non-kept branches are
631  // connected to earlier SubProcesses.
633  << "ParentProcessProductResolver::throwNullRealProduct RealProduct pointer not set in this context.\n"
634  << "Contact a Framework developer\n";
635  }
virtual bool edm::ParentProcessProductResolver::unscheduledWasNotRun_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 276 of file ProductResolvers.h.

276  {
279  return false;
280  }
ProductResolverBase const * realProduct_

Member Data Documentation

std::shared_ptr<BranchDescription const> edm::ParentProcessProductResolver::bd_
private

Definition at line 304 of file ProductResolvers.h.

Principal const* edm::ParentProcessProductResolver::parentPrincipal_
private

Definition at line 306 of file ProductResolvers.h.

ProductProvenanceRetriever const* edm::ParentProcessProductResolver::provRetriever_
private

Definition at line 305 of file ProductResolvers.h.

ProductResolverBase const* edm::ParentProcessProductResolver::realProduct_
private

Definition at line 303 of file ProductResolvers.h.