CMS 3D CMS Logo

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

◆ ProductStatus

Definition at line 310 of file ProductResolvers.h.

Constructor & Destructor Documentation

◆ SwitchBaseProductResolver()

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

Definition at line 626 of file ProductResolvers.cc.

629  // Parentage of this branch is always the same by construction, so we can compute the ID just "once" here.
630  Parentage p;
631  p.setParents(std::vector<BranchID>{realProduct.branchDescription().originalBranchID()});
632  parentageID_ = p.id();
634  }

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

Member Function Documentation

◆ branchDescription_()

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

Implements edm::ProductResolverBase.

Definition at line 332 of file ProductResolvers.h.

332  {
334  ;
335  }

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

◆ connectTo()

void edm::SwitchBaseProductResolver::connectTo ( ProductResolverBase const &  iOther,
Principal const *  iParentPrincipal 
)
finalvirtual

Implements edm::ProductResolverBase.

Definition at line 636 of file ProductResolvers.cc.

636  {
638  << "SwitchBaseProductResolver::connectTo() not implemented and should never be called.\n"
639  << "Contact a Framework developer\n";
640  }

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

◆ getProductData()

ProductData const& edm::SwitchBaseProductResolver::getProductData ( ) const
inlinefinalprivatevirtual

◆ prefetchRequested()

std::atomic<bool>& edm::SwitchBaseProductResolver::prefetchRequested ( ) const
inlineprotected

◆ productProvenancePtr_()

ProductProvenance const* edm::SwitchBaseProductResolver::productProvenancePtr_ ( ) const
inlinefinalprivatevirtual

◆ productResolved_()

bool edm::SwitchBaseProductResolver::productResolved_ ( ) const
finalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 652 of file ProductResolvers.cc.

652  {
653  // SwitchProducer will never put anything in the event, and
654  // "false" will make Event::commit_() to call putProduct() with
655  // null unique_ptr<WrapperBase> to signal that the produce() was
656  // run.
657  return false;
658  }

◆ productWasDeleted_()

bool edm::SwitchBaseProductResolver::productWasDeleted_ ( ) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 328 of file ProductResolvers.h.

328 { return realProduct_.productWasDeleted(); }

◆ productWasFetchedAndIsValid_()

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  }

◆ provenance_()

Provenance const* edm::SwitchBaseProductResolver::provenance_ ( ) const
inlinefinalprivatevirtual

◆ realProduct()

DataManagingOrAliasProductResolver const& edm::SwitchBaseProductResolver::realProduct ( ) const
inlineprotected

◆ resetBranchDescription_()

void edm::SwitchBaseProductResolver::resetBranchDescription_ ( std::shared_ptr< BranchDescription const >  bd)
inlinefinalprivatevirtual

◆ resetProductData_()

void edm::SwitchBaseProductResolver::resetProductData_ ( bool  deleteEarly)
overrideprotectedvirtual

◆ resolvedModuleLabel_()

std::string const& edm::SwitchBaseProductResolver::resolvedModuleLabel_ ( ) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 340 of file ProductResolvers.h.

340 { return moduleLabel(); }

References edm::ProductResolverBase::moduleLabel().

◆ resolveProductImpl()

ProductResolverBase::Resolution edm::SwitchBaseProductResolver::resolveProductImpl ( Resolution  res) const
protected

Definition at line 646 of file ProductResolvers.cc.

646  {
647  if (res.data() == nullptr)
648  return res;
649  return Resolution(&productData_);
650  }

References productData_, and Resolution.

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

◆ setProductID_()

void edm::SwitchBaseProductResolver::setProductID_ ( ProductID const &  pid)
finalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 664 of file ProductResolvers.cc.

664  {
665  // insertIntoSet is const, so let's exploit that to fake the getting of the "input" product
667  }

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

◆ setProductProvenanceRetriever_()

void edm::SwitchBaseProductResolver::setProductProvenanceRetriever_ ( ProductProvenanceRetriever const *  provRetriever)
finalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 660 of file ProductResolvers.cc.

660  {
661  productData_.setProvenance(provRetriever);
662  }

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

◆ setupUnscheduled()

void edm::SwitchBaseProductResolver::setupUnscheduled ( UnscheduledConfigurator const &  iConfigure)
finalvirtual

◆ singleProduct_()

bool edm::SwitchBaseProductResolver::singleProduct_ ( ) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 345 of file ProductResolvers.h.

345 { return true; }

◆ unsafe_setWrapperAndProvenance()

void edm::SwitchBaseProductResolver::unsafe_setWrapperAndProvenance ( ) const
protected

◆ waitingTasks()

WaitingTaskList& edm::SwitchBaseProductResolver::waitingTasks ( ) const
inlineprotected

◆ worker()

Worker* edm::SwitchBaseProductResolver::worker ( ) const
inlineprotected

Definition at line 320 of file ProductResolvers.h.

320 { return worker_; }

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

Member Data Documentation

◆ parentageID_

ParentageID edm::SwitchBaseProductResolver::parentageID_
private

◆ prefetchRequested_

std::atomic<bool> edm::SwitchBaseProductResolver::prefetchRequested_
mutableprivate

Definition at line 353 of file ProductResolvers.h.

Referenced by resetProductData_().

◆ productData_

ProductData edm::SwitchBaseProductResolver::productData_
private

◆ realProduct_

DataManagingOrAliasProductResolver& edm::SwitchBaseProductResolver::realProduct_
private

Definition at line 348 of file ProductResolvers.h.

Referenced by resetProductData_().

◆ waitingTasks_

WaitingTaskList edm::SwitchBaseProductResolver::waitingTasks_
mutableprivate

Definition at line 352 of file ProductResolvers.h.

Referenced by resetProductData_().

◆ worker_

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

Definition at line 351 of file ProductResolvers.h.

Referenced by setupUnscheduled().

edm::ProductResolverBase::provenance
Provenance const * provenance() const
Definition: ProductResolverBase.cc:31
edm::errors::LogicError
Definition: EDMException.h:37
deep_tau::DeepTauBase::BasicDiscriminator
BasicDiscriminator
Definition: DeepTauBase.h:115
edm::Provenance::productProvenance
ProductProvenance const * productProvenance() const
Definition: Provenance.cc:24
edm::SwitchBaseProductResolver::waitingTasks_
WaitingTaskList waitingTasks_
Definition: ProductResolvers.h:352
edm::ParentageRegistry::instance
static ParentageRegistry * instance()
Definition: ParentageRegistry.cc:5
edm::Provenance::store
ProductProvenanceLookup const * store() const
Definition: Provenance.h:60
edm::ProductData::provenance
Provenance const & provenance() const
Definition: ProductData.h:33
edm::WaitingTaskList::reset
void reset()
Resets access to the resource so that added tasks will wait.
Definition: WaitingTaskList.cc:53
edm::ProductProvenanceLookup::insertIntoSet
void insertIntoSet(ProductProvenance provenanceProduct) const
Definition: ProductProvenanceLookup.cc:42
edm::SwitchBaseProductResolver::worker_
Worker * worker_
Definition: ProductResolvers.h:351
edm::ProductData::resetBranchDescription
void resetBranchDescription(std::shared_ptr< BranchDescription const > bd)
Definition: ProductData.cc:20
edm::BranchDescription::originalBranchID
BranchID const & originalBranchID() const
Definition: BranchDescription.h:77
edm::SwitchBaseProductResolver::realProduct
DataManagingOrAliasProductResolver const & realProduct() const
Definition: ProductResolvers.h:321
edm::SwitchBaseProductResolver::realProduct_
DataManagingOrAliasProductResolver & realProduct_
Definition: ProductResolvers.h:348
Resolution
Definition: trackSplitPlot.h:33
edm::ProductData::setProvenance
void setProvenance(ProductProvenanceLookup const *provRetriever)
Definition: ProductData.h:56
edm::SwitchBaseProductResolver::prefetchRequested_
std::atomic< bool > prefetchRequested_
Definition: ProductResolvers.h:353
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::SwitchBaseProductResolver::productData_
ProductData productData_
Definition: ProductResolvers.h:350
edm::DataManagingOrAliasProductResolver::resetProductData_
void resetProductData_(bool deleteEarly) override=0
edm::ProductResolverBase::productWasFetchedAndIsValid
bool productWasFetchedAndIsValid(bool iSkipCurrentProcess) const
Definition: ProductResolverBase.h:102
res
Definition: Electron.h:6
edm::ProductResolverBase::moduleLabel
std::string const & moduleLabel() const
Definition: ProductResolverBase.h:119
edm::ParentageRegistry::insertMapped
bool insertMapped(value_type const &v)
Definition: ParentageRegistry.cc:25
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ProductResolverBase::branchDescription
BranchDescription const & branchDescription() const
Definition: ProductResolverBase.h:110
edm::SwitchBaseProductResolver::getProductData
ProductData const & getProductData() const final
Definition: ProductResolvers.h:344
edm::ProductData::branchDescription
std::shared_ptr< BranchDescription const > const & branchDescription() const
Definition: ProductData.h:29
Exception
Definition: hltDiff.cc:245
edm::SwitchBaseProductResolver::parentageID_
ParentageID parentageID_
Definition: ProductResolvers.h:355
edm::ProductResolverBase::productWasDeleted
bool productWasDeleted() const
Definition: ProductResolverBase.h:100
edm::ProductData::resetProductData
void resetProductData()
Definition: ProductData.h:52
edm::ProductData::setProductID
void setProductID(ProductID const &pid)
Definition: ProductData.h:58
edm::ProductData::unsafe_setWrapper
void unsafe_setWrapper(std::unique_ptr< WrapperBase > iValue) const
Definition: ProductData.cc:27