CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
edm::SwitchBaseProductResolver Class Reference

#include <ProductResolvers.h>

Inheritance diagram for edm::SwitchBaseProductResolver:
edm::DataManagingOrAliasProductResolver edm::ProductResolverBase edm::SwitchAliasProductResolver edm::SwitchProducerProductResolver

Public Types

using ProductStatus = DataManagingProductResolver::ProductStatus
 

Public Member Functions

void connectTo (ProductResolverBase const &iOther, Principal const *iParentPrincipal) final
 
void setupUnscheduled (UnscheduledConfigurator const &iConfigure) final
 
 SwitchBaseProductResolver (std::shared_ptr< BranchDescription const > bd, DataManagingOrAliasProductResolver &realProduct)
 
- Public Member Functions inherited from edm::DataManagingOrAliasProductResolver
 DataManagingOrAliasProductResolver ()
 
- Public Member Functions inherited from edm::ProductResolverBase
BranchDescription const & branchDescription () const
 
std::string const & moduleLabel () const
 
ProductResolverBaseoperator= (ProductResolverBase const &)=delete
 
void prefetchAsync (WaitingTaskHolder 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 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 setProductID (ProductID const &pid)
 
void setProductProvenanceRetriever (ProductProvenanceRetriever const *provRetriever)
 
bool singleProduct () const
 
StableProvenance const * stableProvenance () const
 
void unsafe_deleteProduct () const
 
bool unscheduledWasNotRun () const
 
void write (std::ostream &os) const
 
virtual ~ProductResolverBase ()
 

Protected Member Functions

std::atomic< bool > & prefetchRequested () const
 
DataManagingOrAliasProductResolver
const & 
realProduct () const
 
void resetProductData_ (bool deleteEarly) override
 
Resolution resolveProductImpl (Resolution) const
 
void unsafe_setWrapperAndProvenance () const
 
WaitingTaskListwaitingTasks () const
 
Workerworker () const
 

Private Member Functions

BranchDescription const & branchDescription_ () const final
 
ProductData const & getProductData () const final
 
ProductProvenance const * productProvenancePtr_ () const final
 
bool productResolved_ () const final
 
bool productWasDeleted_ () const final
 
bool productWasFetchedAndIsValid_ (bool iSkipCurrentProcess) const final
 
Provenance const * provenance_ () const final
 
void resetBranchDescription_ (std::shared_ptr< BranchDescription const > bd) final
 
std::string const & resolvedModuleLabel_ () const final
 
void setProductID_ (ProductID const &pid) final
 
void setProductProvenanceRetriever_ (ProductProvenanceRetriever const *provRetriever) final
 
bool singleProduct_ () const final
 

Private Attributes

ParentageID parentageID_
 
std::atomic< bool > prefetchRequested_
 
ProductData productData_
 
DataManagingOrAliasProductResolverrealProduct_
 
WaitingTaskList waitingTasks_
 
Workerworker_ = nullptr
 

Detailed Description

Definition at line 308 of file ProductResolvers.h.

Member Typedef Documentation

Definition at line 310 of file ProductResolvers.h.

Constructor & Destructor Documentation

edm::SwitchBaseProductResolver::SwitchBaseProductResolver ( std::shared_ptr< BranchDescription const >  bd,
DataManagingOrAliasProductResolver realProduct 
)

Definition at line 618 of file ProductResolvers.cc.

References edm::ProductResolverBase::branchDescription(), edm::Parentage::id(), edm::ParentageRegistry::insertMapped(), edm::ParentageRegistry::instance(), edm::BranchDescription::originalBranchID(), AlCaHLTBitMon_ParallelJobs::p, parentageID_, and edm::Parentage::setParents().

621  // Parentage of this branch is always the same by construction, so we can compute the ID just "once" here.
622  Parentage p;
623  p.setParents(std::vector<BranchID>{realProduct.branchDescription().originalBranchID()});
624  parentageID_ = p.id();
626  }
DataManagingOrAliasProductResolver const & realProduct() const
std::atomic< bool > prefetchRequested_
DataManagingOrAliasProductResolver & realProduct_
def move
Definition: eostools.py:511
BranchDescription const & branchDescription() const
BranchID const & originalBranchID() const
static ParentageRegistry * instance()
bool insertMapped(value_type const &v)

Member Function Documentation

BranchDescription const& edm::SwitchBaseProductResolver::branchDescription_ ( ) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 332 of file ProductResolvers.h.

References edm::ProductData::branchDescription(), and edm::DataManagingProductResolver::productData_.

332  {
334  ;
335  }
std::shared_ptr< BranchDescription const > const & branchDescription() const
Definition: ProductData.h:29
void edm::SwitchBaseProductResolver::connectTo ( ProductResolverBase const &  iOther,
Principal const *  iParentPrincipal 
)
finalvirtual

Implements edm::ProductResolverBase.

Definition at line 628 of file ProductResolvers.cc.

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

628  {
630  << "SwitchBaseProductResolver::connectTo() not implemented and should never be called.\n"
631  << "Contact a Framework developer\n";
632  }
ProductData const& edm::SwitchBaseProductResolver::getProductData ( ) const
inlinefinalprivatevirtual
std::atomic<bool>& edm::SwitchBaseProductResolver::prefetchRequested ( ) const
inlineprotected
ProductProvenance const* edm::SwitchBaseProductResolver::productProvenancePtr_ ( ) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 343 of file ProductResolvers.h.

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

343 { return provenance()->productProvenance(); }
Provenance const * provenance() const
ProductProvenance const * productProvenance() const
Definition: Provenance.cc:24
bool edm::SwitchBaseProductResolver::productResolved_ ( ) const
finalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 644 of file ProductResolvers.cc.

644  {
645  // SwitchProducer will never put anything in the event, and
646  // "false" will make Event::commit_() to call putProduct() with
647  // null unique_ptr<WrapperBase> to signal that the produce() was
648  // run.
649  return false;
650  }
bool edm::SwitchBaseProductResolver::productWasDeleted_ ( ) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 328 of file ProductResolvers.h.

328 { return realProduct_.productWasDeleted(); }
DataManagingOrAliasProductResolver & realProduct_
bool edm::SwitchBaseProductResolver::productWasFetchedAndIsValid_ ( bool  iSkipCurrentProcess) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 329 of file ProductResolvers.h.

329  {
330  return realProduct_.productWasFetchedAndIsValid(iSkipCurrentProcess);
331  }
DataManagingOrAliasProductResolver & realProduct_
bool productWasFetchedAndIsValid(bool iSkipCurrentProcess) const
Provenance const* edm::SwitchBaseProductResolver::provenance_ ( ) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 339 of file ProductResolvers.h.

References edm::DataManagingProductResolver::productData_, and edm::ProductData::provenance().

339 { return &productData_.provenance(); }
Provenance const & provenance() const
Definition: ProductData.h:33
DataManagingOrAliasProductResolver const& edm::SwitchBaseProductResolver::realProduct ( ) const
inlineprotected
void edm::SwitchBaseProductResolver::resetBranchDescription_ ( std::shared_ptr< BranchDescription const >  bd)
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 336 of file ProductResolvers.h.

References edm::DataManagingProductResolver::productData_, and edm::ProductData::resetBranchDescription().

336  {
338  }
void resetBranchDescription(std::shared_ptr< BranchDescription const > bd)
Definition: ProductData.cc:20
void edm::SwitchBaseProductResolver::resetProductData_ ( bool  deleteEarly)
overrideprotectedvirtual

Implements edm::DataManagingOrAliasProductResolver.

Reimplemented in edm::SwitchProducerProductResolver.

Definition at line 661 of file ProductResolvers.cc.

References prefetchRequested_, productData_, realProduct_, edm::WaitingTaskList::reset(), edm::ProductData::resetProductData(), edm::DataManagingOrAliasProductResolver::resetProductData_(), and waitingTasks_.

Referenced by edm::SwitchProducerProductResolver::resetProductData_().

661  {
663  realProduct_.resetProductData_(deleteEarly);
664  if (not deleteEarly) {
665  prefetchRequested_ = false;
667  }
668  }
std::atomic< bool > prefetchRequested_
void reset()
Resets access to the resource so that added tasks will wait.
DataManagingOrAliasProductResolver & realProduct_
void resetProductData()
Definition: ProductData.h:52
void resetProductData_(bool deleteEarly) override=0
std::string const& edm::SwitchBaseProductResolver::resolvedModuleLabel_ ( ) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 340 of file ProductResolvers.h.

References edm::ProductResolverBase::moduleLabel().

340 { return moduleLabel(); }
std::string const & moduleLabel() const
ProductResolverBase::Resolution edm::SwitchBaseProductResolver::resolveProductImpl ( Resolution  res) const
protected

Definition at line 638 of file ProductResolvers.cc.

References edm::ProductResolverBase::Resolution::data(), productData_, and Resolution.

Referenced by edm::SwitchProducerProductResolver::resolveProduct_(), and edm::SwitchAliasProductResolver::resolveProduct_().

638  {
639  if (res.data() == nullptr)
640  return res;
641  return Resolution(&productData_);
642  }
void edm::SwitchBaseProductResolver::setProductID_ ( ProductID const &  pid)
finalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 656 of file ProductResolvers.cc.

References productData_, and edm::ProductData::setProductID().

656  {
657  // insertIntoSet is const, so let's exploit that to fake the getting of the "input" product
659  }
void setProductID(ProductID const &pid)
Definition: ProductData.h:58
void edm::SwitchBaseProductResolver::setProductProvenanceRetriever_ ( ProductProvenanceRetriever const *  provRetriever)
finalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 652 of file ProductResolvers.cc.

References productData_, and edm::ProductData::setProvenance().

652  {
653  productData_.setProvenance(provRetriever);
654  }
void setProvenance(ProductProvenanceLookup const *provRetriever)
Definition: ProductData.h:56
void edm::SwitchBaseProductResolver::setupUnscheduled ( UnscheduledConfigurator const &  iConfigure)
finalvirtual

Reimplemented from edm::ProductResolverBase.

Definition at line 634 of file ProductResolvers.cc.

References edm::ProductResolverBase::branchDescription(), edm::UnscheduledConfigurator::findWorker(), edm::ProductResolverBase::moduleLabel(), and worker_.

634  {
635  worker_ = iConfigure.findWorker(branchDescription().moduleLabel());
636  }
BranchDescription const & branchDescription() const
std::string const & moduleLabel() const
bool edm::SwitchBaseProductResolver::singleProduct_ ( ) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 345 of file ProductResolvers.h.

345 { return true; }
void edm::SwitchBaseProductResolver::unsafe_setWrapperAndProvenance ( ) const
protected

Definition at line 670 of file ProductResolvers.cc.

References edm::ProductResolverBase::branchDescription(), getProductData(), edm::ProductProvenanceLookup::insertIntoSet(), parentageID_, productData_, edm::ProductData::provenance(), realProduct(), edm::Provenance::store(), and edm::ProductData::unsafe_setWrapper().

Referenced by edm::SwitchProducerProductResolver::prefetchAsync_(), edm::SwitchAliasProductResolver::prefetchAsync_(), and edm::SwitchProducerProductResolver::putProduct().

670  {
671  // update provenance
672  productData_.provenance().store()->insertIntoSet(ProductProvenance(branchDescription().branchID(), parentageID_));
673  // Use the Wrapper of the pointed-to resolver, but the provenance of this resolver
674  productData_.unsafe_setWrapper(realProduct().getProductData().sharedConstWrapper());
675  }
ProductData const & getProductData() const final
Provenance const & provenance() const
Definition: ProductData.h:33
ProductProvenanceLookup const * store() const
Definition: Provenance.h:60
DataManagingOrAliasProductResolver const & realProduct() const
void unsafe_setWrapper(std::unique_ptr< WrapperBase > iValue) const
Definition: ProductData.cc:27
void insertIntoSet(ProductProvenance provenanceProduct) const
BranchDescription const & branchDescription() const
WaitingTaskList& edm::SwitchBaseProductResolver::waitingTasks ( ) const
inlineprotected
Worker* edm::SwitchBaseProductResolver::worker ( ) const
inlineprotected

Definition at line 320 of file ProductResolvers.h.

Referenced by edm::SwitchProducerProductResolver::prefetchAsync_().

320 { return worker_; }

Member Data Documentation

ParentageID edm::SwitchBaseProductResolver::parentageID_
private
std::atomic<bool> edm::SwitchBaseProductResolver::prefetchRequested_
mutableprivate

Definition at line 353 of file ProductResolvers.h.

Referenced by resetProductData_().

ProductData edm::SwitchBaseProductResolver::productData_
private
DataManagingOrAliasProductResolver& edm::SwitchBaseProductResolver::realProduct_
private

Definition at line 348 of file ProductResolvers.h.

Referenced by resetProductData_().

WaitingTaskList edm::SwitchBaseProductResolver::waitingTasks_
mutableprivate

Definition at line 352 of file ProductResolvers.h.

Referenced by resetProductData_().

Worker* edm::SwitchBaseProductResolver::worker_ = nullptr
private

Definition at line 351 of file ProductResolvers.h.

Referenced by setupUnscheduled().