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

void connectTo (ProductResolverBase const &iOther, Principal const *iParentPrincipal) 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, ServiceToken const &token, 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, MergeableRunProductMetadata const *mergeableRunProductMetadata=nullptr) const
 
void putProduct (std::unique_ptr< WrapperBase > edp) const
 
void resetBranchDescription (std::shared_ptr< BranchDescription const > bd)
 
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, MergeableRunProductMetadata const *mergeableRunProductMetadata) const
 
void setMergeableRunProductMetadata (MergeableRunProductMetadata const *mrpm)
 
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

BranchDescription const & branchDescription_ () const override
 
void prefetchAsync_ (WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
 
ProductProvenance const * productProvenancePtr_ () const override
 
bool productResolved_ () const final
 
bool productUnavailable_ () const override
 
bool productWasDeleted_ () const override
 
bool productWasFetchedAndIsValid_ (bool iSkipCurrentProcess) const override
 
Provenance const * provenance_ () const final
 
void putOrMergeProduct_ (std::unique_ptr< WrapperBase > prod, MergeableRunProductMetadata const *mergeableRunProductMetadata) const final
 
void putProduct_ (std::unique_ptr< WrapperBase > edp) const override
 
void resetBranchDescription_ (std::shared_ptr< BranchDescription const > bd) override
 
void resetProductData_ (bool deleteEarly) override
 
std::string const & resolvedModuleLabel_ () const override
 
Resolution resolveProduct_ (Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
 
void setProcessHistory_ (ProcessHistory const &ph) override
 
void setProvenance_ (ProductProvenanceRetriever const *provRetriever, ProcessHistory const &ph, ProductID const &pid) override
 
bool singleProduct_ () const override
 
void throwNullRealProduct () const
 
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 256 of file ProductResolvers.h.

Member Typedef Documentation

Definition at line 258 of file ProductResolvers.h.

Constructor & Destructor Documentation

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

Definition at line 259 of file ProductResolvers.h.

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

Member Function Documentation

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

Implements edm::ProductResolverBase.

Definition at line 298 of file ProductResolvers.h.

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

Implements edm::ProductResolverBase.

Definition at line 261 of file ProductResolvers.h.

261  {
262  realProduct_ = &iOther;
263  parentPrincipal_ = iParentPrincipal;
264  };
ProductResolverBase const * realProduct_
void edm::ParentProcessProductResolver::prefetchAsync_ ( WaitingTask waitTask,
Principal const &  principal,
bool  skipCurrentProcess,
ServiceToken const &  token,
SharedResourcesAcquirer sra,
ModuleCallingContext const *  mcc 
) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 274 of file ProductResolvers.h.

279  {
280  skipCurrentProcess = false;
281  realProduct_->prefetchAsync( waitTask, *parentPrincipal_, skipCurrentProcess, token, sra, mcc);
282  }
void prefetchAsync(WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
ProductResolverBase const * realProduct_
ProductProvenance const * edm::ParentProcessProductResolver::productProvenancePtr_ ( ) const
overrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 666 of file ProductResolvers.cc.

666  {
667  return provRetriever_? provRetriever_->branchIDToProvenance(bd_->originalBranchID()): nullptr;
668  }
std::shared_ptr< BranchDescription const > bd_
ProductProvenanceRetriever const * provRetriever_
ProductProvenance const * branchIDToProvenance(BranchID const &bid) const
bool edm::ParentProcessProductResolver::productResolved_ ( ) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 289 of file ProductResolvers.h.

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

Implements edm::ProductResolverBase.

Definition at line 288 of file ProductResolvers.h.

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

Implements edm::ProductResolverBase.

Definition at line 290 of file ProductResolvers.h.

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

Implements edm::ProductResolverBase.

Definition at line 291 of file ProductResolvers.h.

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

291  {
292  iSkipCurrentProcess = false;
293  return realProduct_->productWasFetchedAndIsValid(iSkipCurrentProcess);
294  }
ProductResolverBase const * realProduct_
bool productWasFetchedAndIsValid(bool iSkipCurrentProcess) const
Provenance const* edm::ParentProcessProductResolver::provenance_ ( ) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 300 of file ProductResolvers.h.

300  {return realProduct_->provenance();
301  }
Provenance const * provenance() const
ProductResolverBase const * realProduct_
void edm::ParentProcessProductResolver::putOrMergeProduct_ ( std::unique_ptr< WrapperBase prod,
MergeableRunProductMetadata const *  mergeableRunProductMetadata 
) const
finalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 683 of file ProductResolvers.cc.

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

683  {
685  << "ParentProcessProductResolver::putOrMergeProduct_(std::unique_ptr<WrapperBase> edp, MergeableRunProductMetadata const*) not implemented and should never be called.\n"
686  << "Contact a Framework developer\n";
687  }
void edm::ParentProcessProductResolver::putProduct_ ( std::unique_ptr< WrapperBase edp) const
overrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 677 of file ProductResolvers.cc.

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

677  {
679  << "ParentProcessProductResolver::putProduct_() not implemented and should never be called.\n"
680  << "Contact a Framework developer\n";
681  }
void edm::ParentProcessProductResolver::resetBranchDescription_ ( std::shared_ptr< BranchDescription const >  bd)
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 299 of file ProductResolvers.h.

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

Implements edm::ProductResolverBase.

Definition at line 670 of file ProductResolvers.cc.

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

Implements edm::ProductResolverBase.

Definition at line 267 of file ProductResolvers.h.

270  {
271  skipCurrentProcess = false;
272  return realProduct_->resolveProduct(*parentPrincipal_, skipCurrentProcess, sra, mcc);
273  }
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 663 of file ProductResolvers.cc.

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

Implements edm::ProductResolverBase.

Definition at line 659 of file ProductResolvers.cc.

659  {
660  provRetriever_ = provRetriever;
661  }
ProductProvenanceRetriever const * provRetriever_
bool edm::ParentProcessProductResolver::singleProduct_ ( ) const
overrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 673 of file ProductResolvers.cc.

673  {
674  return true;
675  }
void edm::ParentProcessProductResolver::throwNullRealProduct ( ) const
private

Definition at line 689 of file ProductResolvers.cc.

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

689  {
690  // In principle, this ought to be fixed. I noticed one hits this error
691  // when in a SubProcess and calling the Event::getProvenance function
692  // with a BranchID to a branch from an earlier SubProcess or the top
693  // level process and this branch is not kept in this SubProcess. It might
694  // be possible to hit this in other contexts. I say it ought to be
695  // fixed because one does not encounter this issue if the SubProcesses
696  // are split into genuinely different processes (in principle that
697  // ought to give identical behavior and results). No user has ever
698  // reported this issue which has been around for some time and it was only
699  // noticed when testing some rare corner cases after modifying Core code.
700  // After discussing this with Chris we decided that at least for the moment
701  // there are higher priorities than fixing this ... I converted it so it
702  // causes an exception instead of a seg fault. The issue that may need to
703  // be addressed someday is how ProductResolvers for non-kept branches are
704  // connected to earlier SubProcesses.
706  << "ParentProcessProductResolver::throwNullRealProduct RealProduct pointer not set in this context.\n"
707  << "Contact a Framework developer\n";
708  }
bool edm::ParentProcessProductResolver::unscheduledWasNotRun_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 283 of file ProductResolvers.h.

283  {
286  return false;
287  }
ProductResolverBase const * realProduct_

Member Data Documentation

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

Definition at line 311 of file ProductResolvers.h.

Principal const* edm::ParentProcessProductResolver::parentPrincipal_
private

Definition at line 313 of file ProductResolvers.h.

ProductProvenanceRetriever const* edm::ParentProcessProductResolver::provRetriever_
private

Definition at line 312 of file ProductResolvers.h.

ProductResolverBase const* edm::ParentProcessProductResolver::realProduct_
private

Definition at line 310 of file ProductResolvers.h.