1 #ifndef FWCore_Framework_ProductResolvers_h 2 #define FWCore_Framework_ProductResolvers_h 26 class MergeableRunProductMetadata;
27 class ProductProvenanceRetriever;
29 class ModuleCallingContext;
46 enum class ProductStatus { ProductSet, NotPut, ResolveFailed, ResolveNotRun, ProductDeleted };
51 theStatus_(iDefaultStatus),
52 defaultStatus_(iDefaultStatus) {}
61 void setProduct(std::unique_ptr<WrapperBase> edp)
const;
66 template <
bool callResolver,
typename FUNC>
67 Resolution resolveProductImpl(FUNC resolver)
const;
74 virtual bool isFromCurrentProcess()
const = 0;
87 productData_.resetBranchDescription(bd);
112 bool isFromCurrentProcess()
const final;
115 bool skipCurrentProcess,
120 bool skipCurrentProcess,
124 void putProduct_(std::unique_ptr<WrapperBase> edp)
const override;
144 assert(bd->produced());
148 void putProduct_(std::unique_ptr<WrapperBase> edp)
const override;
151 bool isFromCurrentProcess()
const final;
163 bool skipCurrentProcess,
168 bool skipCurrentProcess,
174 void putProduct_(std::unique_ptr<WrapperBase> edp)
const override;
191 bool skipCurrentProcess,
196 bool skipCurrentProcess,
218 realProduct_.connectTo(iOther, iParentPrincipal);
223 bool skipCurrentProcess,
226 return realProduct_.resolveProduct(principal, skipCurrentProcess, sra, mcc);
230 bool skipCurrentProcess,
234 realProduct_.prefetchAsync(waitTask, principal, skipCurrentProcess, token, sra, mcc);
241 return realProduct_.productWasFetchedAndIsValid(iSkipCurrentProcess);
244 void putProduct_(std::unique_ptr<WrapperBase> edp)
const override;
261 std::shared_ptr<BranchDescription const>
bd_;
286 return realProduct_.productWasFetchedAndIsValid(iSkipCurrentProcess);
288 void putProduct_(std::unique_ptr<WrapperBase> edp)
const final;
292 return *productData_.branchDescription();
296 productData_.resetBranchDescription(bd);
332 bool skipCurrentProcess,
337 bool skipCurrentProcess,
354 bool skipCurrentProcess,
359 bool skipCurrentProcess,
374 realProduct_ = &iOther;
375 parentPrincipal_ = iParentPrincipal;
380 bool skipCurrentProcess,
383 skipCurrentProcess =
false;
384 return realProduct_->resolveProduct(*parentPrincipal_, skipCurrentProcess, sra, mcc);
388 bool skipCurrentProcess,
392 skipCurrentProcess =
false;
393 realProduct_->prefetchAsync(waitTask, *parentPrincipal_, skipCurrentProcess, token, sra, mcc);
397 return realProduct_->unscheduledWasNotRun();
398 throwNullRealProduct();
405 iSkipCurrentProcess =
false;
406 return realProduct_->productWasFetchedAndIsValid(iSkipCurrentProcess);
409 void putProduct_(std::unique_ptr<WrapperBase> edp)
const override;
423 void throwNullRealProduct()
const;
426 std::shared_ptr<BranchDescription const>
bd_;
435 std::vector<bool>
const& ambiguous,
440 void tryPrefetchResolverAsync(
unsigned int iProcessingIndex,
442 bool skipCurrentProcess,
447 bool dataValidFromResolver(
unsigned int iProcessingIndex,
449 bool iSkipCurrentProcess) const;
451 void prefetchFailed(
unsigned int iProcessingIndex,
453 bool iSkipCurrentProcess,
454 std::exception_ptr iExceptPtr) const;
457 unsigned int unsetIndexValue() const;
459 bool skipCurrentProcess,
464 bool skipCurrentProcess,
492 bool skipCurrentProcess,
496 void setCache(
bool skipCurrentProcess,
ProductResolverIndex index, std::exception_ptr exceptionPtr)
const;
519 bool skipCurrentProcess,
524 bool skipCurrentProcess,
534 void putProduct_(std::unique_ptr<WrapperBase> edp)
const override;
bool productResolved_() const final
bool unscheduledWasNotRun_() const override
DataManagingOrAliasProductResolver const & realProduct() const
Provenance const * provenance() const
WaitingTaskList & waitingTasks() const
void connectTo(ProductResolverBase const &iOther, Principal const *iParentPrincipal) final
virtual bool productWasFetchedAndIsValid_(bool iSkipCurrentProcess) const =0
unsigned int ProductResolverIndex
SwitchProducerProductResolver(std::shared_ptr< BranchDescription const > bd, DataManagingOrAliasProductResolver &realProduct)
bool singleProduct_() const final
virtual std::string const & resolvedModuleLabel_() const =0
bool productWasDeleted_() const final
ProductProvenance const * productProvenancePtr_() const final
AliasProductResolver(std::shared_ptr< BranchDescription const > bd, DataManagingOrAliasProductResolver &realProduct)
ParentProcessProductResolver(std::shared_ptr< BranchDescription const > bd)
WaitingTaskList m_waitingTasks
ProducedProductResolver::ProductStatus ProductStatus
std::string const & resolvedModuleLabel_() const override
ProductStatus const defaultStatus_
std::shared_ptr< BranchDescription const > bd_
bool productUnavailable_() const override
bool productWasFetchedAndIsValid_(bool iSkipCurrentProcess) const final
UnscheduledProductResolver(std::shared_ptr< BranchDescription const > bd)
void resetBranchDescription_(std::shared_ptr< BranchDescription const > bd) final
virtual void resetBranchDescription_(std::shared_ptr< BranchDescription const > bd)=0
DataManagingOrAliasProductResolver()
std::atomic< bool > prefetchRequested_
ProductStatus status() const
bool unscheduledWasNotRun_() const final
Provenance const * provenance_() const final
virtual void setupUnscheduled(UnscheduledConfigurator const &)
virtual ProductProvenance const * productProvenancePtr_() const =0
std::string const & resolvedModuleLabel_() const final
virtual void putProduct_(std::unique_ptr< WrapperBase > edp) const =0
virtual void prefetchAsync_(WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const =0
bool unscheduledWasNotRun_() const final
DataManagingProductResolver(std::shared_ptr< BranchDescription const > bd, ProductStatus iDefaultStatus)
WaitingTaskList skippingWaitingTasks_
ProductProvenance const * productProvenance() const
Provenance const * provenance_() const final
ProducedProductResolver(std::shared_ptr< BranchDescription const > bd, ProductStatus iDefaultStatus)
std::atomic< bool > prefetchRequested_
ProductProvenanceRetriever const * provRetriever_
Resolution resolveProduct_(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
WaitingTaskList waitingTasks_
DataManagingOrAliasProductResolver & realProduct_
virtual void setProvenance_(ProductProvenanceRetriever const *provRetriever, ProcessHistory const &ph, ProductID const &pid)=0
std::string const & resolvedModuleLabel_() const override
void resetBranchDescription_(std::shared_ptr< BranchDescription const > bd) override
bool productUnavailable_() const override
Principal const * parentPrincipal_
static void throwProductDeletedException(ProductID const &pid, edm::EventPrincipal::ConstProductResolverPtr const phb)
BranchDescription const & branchDescription_() const override
WaitingTaskList waitingTasks_
ProducedProductResolver::ProductStatus ProductStatus
virtual void connectTo(ProductResolverBase const &, Principal const *)=0
UnscheduledAuxiliary const * aux_
ProductResolverBase const * realProduct_
void setProcessHistory_(ProcessHistory const &ph) final
void connectTo(ProductResolverBase const &iOther, Principal const *iParentPrincipal) final
virtual BranchDescription const & branchDescription_() const =0
std::atomic< unsigned int > lastSkipCurrentCheckIndex_
std::atomic< bool > prefetchRequested_
bool productWasDeleted_() const override
SwitchAliasProductResolver(std::shared_ptr< BranchDescription const > bd, DataManagingOrAliasProductResolver &realProduct)
bool productUnavailable_() const final
BranchDescription const & branchDescription_() const final
void resetBranchDescription_(std::shared_ptr< BranchDescription const > bd) override
std::atomic< bool > prefetchRequested_
virtual void putOrMergeProduct_(std::unique_ptr< WrapperBase > edp, MergeableRunProductMetadata const *mergeableRunProductMetadata) const =0
std::atomic< unsigned int > lastCheckIndex_
bool unscheduledWasNotRun_() const override
virtual bool productResolved_() const =0
bool unscheduledWasNotRun_() const override
ProducedProductResolver::ProductStatus ProductStatus
bool productResolved_() const final
std::atomic< bool > skippingPrefetchRequested_
std::atomic< ProductStatus > theStatus_
std::vector< bool > ambiguous_
bool productWasFetchedAndIsValid_(bool iSkipCurrentProcess) const final
Resolution resolveProduct_(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
virtual void setMergeableRunProductMetadata_(MergeableRunProductMetadata const *)
bool unscheduledWasNotRun_() const override
virtual void retrieveAndMerge_(Principal const &principal, MergeableRunProductMetadata const *mergeableRunProductMetadata) const
virtual bool unscheduledWasNotRun_() const =0
ProductStatus defaultStatus() const
BranchDescription const & branchDescription_() const final
BranchDescription const & branchDescription_() const override
DataManagingOrAliasProductResolver & realProduct_
std::string const & resolvedModuleLabel_() const final
std::vector< ProductResolverIndex > matchingHolders_
bool productWasFetchedAndIsValid_(bool iSkipCurrentProcess) const override
bool productWasDeleted_() const override
void resetBranchDescription_(std::shared_ptr< BranchDescription const > bd) final
ProducedProductResolver::ProductStatus ProductStatus
virtual Provenance const * provenance_() const =0
void prefetchAsync_(WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
ProductData const & getProductData() const
Provenance const * provenance_() const final
void resetProductData_(bool deleteEarly) override=0
std::shared_ptr< BranchDescription const > bd_
virtual bool productUnavailable_() const =0
void prefetchAsync_(WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
virtual bool singleProduct_() const =0
std::atomic< bool > & prefetchRequested() const
std::string const & resolvedModuleLabel_() const override
PuttableProductResolver(std::shared_ptr< BranchDescription const > bd)
Provenance const * provenance_() const final
SingleChoiceNoProcessProductResolver(ProductResolverIndex iChoice)
virtual Resolution resolveProduct_(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const =0
WaitingTaskList waitingTasks_
std::string const & moduleLabel() const
virtual void setProcessHistory_(ProcessHistory const &ph)=0
virtual bool productWasDeleted_() const =0
ProductStatus status() const
ProductResolverIndex realResolverIndex_
void setFailedStatus() const