CMS 3D CMS Logo

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

#include <ProductHolder.h>

Inheritance diagram for edm::NoProcessProductHolder:
edm::ProductHolderBase

Public Types

typedef
ProducedProductHolder::ProductStatus 
ProductStatus
 
- Public Types inherited from edm::ProductHolderBase
enum  ResolveStatus { ProductFound, ProductNotFound, Ambiguous }
 

Public Member Functions

 NoProcessProductHolder (std::vector< ProductHolderIndex > const &matchingHolders, std::vector< bool > const &ambiguous)
 
virtual ~NoProcessProductHolder ()
 
- Public Member Functions inherited from edm::ProductHolderBase
BranchDescription const & branchDescription () const
 
void checkType (WrapperBase const &prod) const
 
void mergeProduct (std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance) const
 
void mergeProduct (std::unique_ptr< WrapperBase > edp) const
 
void mergeTheProduct (std::unique_ptr< WrapperBase > edp) const
 
std::string const & moduleLabel () const
 
bool onDemand () const
 
ProductHolderBaseoperator= (ProductHolderBase const &)=delete
 
std::string const & processName () const
 
WrapperBase const * product () const
 
WrapperBaseproduct ()
 
ProductData const & productData () const
 
ProductDataproductData ()
 
 ProductHolderBase ()
 
 ProductHolderBase (ProductHolderBase const &)=delete
 
ProductID const & productID () const
 
std::string const & productInstanceName () const
 
ProductProvenance const * productProvenancePtr () const
 
TypeID productType () const
 
bool productUnavailable () const
 
bool productWasDeleted () const
 
Provenance const * provenance () const
 
bool provenanceAvailable () const
 
bool putOrMergeProduct () const
 
void putProduct (std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance) const
 
void putProduct (std::unique_ptr< WrapperBase > edp) const
 
void reallyCheckType (WrapperBase const &prod) const
 
void resetBranchDescription (std::shared_ptr< BranchDescription const > bd)
 
void resetProductData ()
 
void resetStatus ()
 
std::string const & resolvedModuleLabel () const
 
ProductData const * resolveProduct (ResolveStatus &resolveStatus, Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
void setProcessHistory (ProcessHistory const &ph)
 
void setProductDeleted ()
 
void setProvenance (ProductProvenanceRetriever const *provRetriever, ProcessHistory const &ph, ProductID const &pid)
 
bool singleProduct () const
 
void swap (ProductHolderBase &rhs)
 
void throwProductDeletedException () const
 
void unsafe_deleteProduct () const
 
void write (std::ostream &os) const
 
virtual ~ProductHolderBase ()
 

Private Member Functions

virtual BranchDescription const & branchDescription_ () const override
 
virtual void checkType_ (WrapperBase const &prod) const override
 
virtual ProductData const & getProductData () const override
 
virtual ProductDatagetProductData () override
 
virtual void mergeProduct_ (std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance) const override
 
virtual void mergeProduct_ (std::unique_ptr< WrapperBase > edp) const override
 
virtual bool onDemand_ () const override
 
virtual ProductProvenance const * productProvenancePtr_ () const override
 
virtual bool productUnavailable_ () const override
 
virtual bool productWasDeleted_ () const override
 
virtual bool putOrMergeProduct_ () const override
 
virtual void putProduct_ (std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance) const override
 
virtual void putProduct_ (std::unique_ptr< WrapperBase > edp) const override
 
virtual void resetBranchDescription_ (std::shared_ptr< BranchDescription const > bd) override
 
virtual void resetProductData_ () override
 
virtual void resetStatus_ () override
 
virtual std::string const & resolvedModuleLabel_ () const override
 
virtual ProductData const * resolveProduct_ (ResolveStatus &resolveStatus, Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
 
virtual void setProcessHistory_ (ProcessHistory const &ph) override
 
virtual void setProductDeleted_ () const override
 
virtual void setProvenance_ (ProductProvenanceRetriever const *provRetriever, ProcessHistory const &ph, ProductID const &pid) override
 
virtual bool singleProduct_ () const override
 
virtual void swap_ (ProductHolderBase &rhs) override
 

Private Attributes

std::vector< bool > ambiguous_
 
std::vector< ProductHolderIndexmatchingHolders_
 

Detailed Description

Definition at line 447 of file ProductHolder.h.

Member Typedef Documentation

Definition at line 449 of file ProductHolder.h.

Constructor & Destructor Documentation

edm::NoProcessProductHolder::NoProcessProductHolder ( std::vector< ProductHolderIndex > const &  matchingHolders,
std::vector< bool > const &  ambiguous 
)

Definition at line 366 of file ProductHolder.cc.

References ambiguous_, assert(), and matchingHolders_.

367  :
368  matchingHolders_(matchingHolders),
369  ambiguous_(ambiguous) {
370  assert(ambiguous_.size() == matchingHolders_.size());
371  }
std::vector< ProductHolderIndex > matchingHolders_
assert(m_qm.get())
std::vector< bool > ambiguous_
edm::NoProcessProductHolder::~NoProcessProductHolder ( )
virtual

Definition at line 36 of file ProductHolder.cc.

36 {}

Member Function Documentation

BranchDescription const & edm::NoProcessProductHolder::branchDescription_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 515 of file ProductHolder.cc.

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

515  {
517  << "NoProcessProductHolder::branchDescription_() not implemented and should never be called.\n"
518  << "Contact a Framework developer\n";
519  }
void edm::NoProcessProductHolder::checkType_ ( WrapperBase const &  prod) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 503 of file ProductHolder.cc.

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

503  {
505  << "NoProcessProductHolder::checkType_() not implemented and should never be called.\n"
506  << "Contact a Framework developer\n";
507  }
ProductData const & edm::NoProcessProductHolder::getProductData ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 373 of file ProductHolder.cc.

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

373  {
375  << "NoProcessProductHolder::getProductData() not implemented and should never be called.\n"
376  << "Contact a Framework developer\n";
377  }
ProductData & edm::NoProcessProductHolder::getProductData ( )
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 379 of file ProductHolder.cc.

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

379  {
381  << "NoProcessProductHolder::getProductData() not implemented and should never be called.\n"
382  << "Contact a Framework developer\n";
383  }
void edm::NoProcessProductHolder::mergeProduct_ ( std::unique_ptr< WrapperBase edp,
ProductProvenance const &  productProvenance 
) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 485 of file ProductHolder.cc.

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

485  {
487  << "NoProcessProductHolder::mergeProduct_() not implemented and should never be called.\n"
488  << "Contact a Framework developer\n";
489  }
void edm::NoProcessProductHolder::mergeProduct_ ( std::unique_ptr< WrapperBase edp) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 491 of file ProductHolder.cc.

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

491  {
493  << "NoProcessProductHolder::mergeProduct_() not implemented and should never be called.\n"
494  << "Contact a Framework developer\n";
495  }
bool edm::NoProcessProductHolder::onDemand_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 455 of file ProductHolder.cc.

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

455  {
457  << "NoProcessProductHolder::onDemand_() not implemented and should never be called.\n"
458  << "Contact a Framework developer\n";
459  }
ProductProvenance const * edm::NoProcessProductHolder::productProvenancePtr_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 444 of file ProductHolder.cc.

444  {
445  return nullptr;
446  }
bool edm::NoProcessProductHolder::productUnavailable_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 461 of file ProductHolder.cc.

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

461  {
463  << "NoProcessProductHolder::productUnavailable_() not implemented and should never be called.\n"
464  << "Contact a Framework developer\n";
465  }
bool edm::NoProcessProductHolder::productWasDeleted_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 467 of file ProductHolder.cc.

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

467  {
469  << "NoProcessProductHolder::productWasDeleted_() not implemented and should never be called.\n"
470  << "Contact a Framework developer\n";
471  }
bool edm::NoProcessProductHolder::putOrMergeProduct_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 497 of file ProductHolder.cc.

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

497  {
499  << "NoProcessProductHolder::putOrMergeProduct_() not implemented and should never be called.\n"
500  << "Contact a Framework developer\n";
501  }
void edm::NoProcessProductHolder::putProduct_ ( std::unique_ptr< WrapperBase edp,
ProductProvenance const &  productProvenance 
) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 473 of file ProductHolder.cc.

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

473  {
475  << "NoProcessProductHolder::putProduct_() not implemented and should never be called.\n"
476  << "Contact a Framework developer\n";
477  }
void edm::NoProcessProductHolder::putProduct_ ( std::unique_ptr< WrapperBase edp) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 479 of file ProductHolder.cc.

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

479  {
481  << "NoProcessProductHolder::putProduct_() not implemented and should never be called.\n"
482  << "Contact a Framework developer\n";
483  }
void edm::NoProcessProductHolder::resetBranchDescription_ ( std::shared_ptr< BranchDescription const >  bd)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 521 of file ProductHolder.cc.

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

521  {
523  << "NoProcessProductHolder::resetBranchDescription_() not implemented and should never be called.\n"
524  << "Contact a Framework developer\n";
525  }
void edm::NoProcessProductHolder::resetProductData_ ( )
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 448 of file ProductHolder.cc.

448  {
449  }
void edm::NoProcessProductHolder::resetStatus_ ( )
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 435 of file ProductHolder.cc.

435  {
436  }
virtual std::string const& edm::NoProcessProductHolder::resolvedModuleLabel_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 475 of file ProductHolder.h.

References edm::ProductHolderBase::moduleLabel().

475 {return moduleLabel();}
std::string const & moduleLabel() const
ProductData const * edm::NoProcessProductHolder::resolveProduct_ ( ResolveStatus resolveStatus,
Principal const &  principal,
bool  skipCurrentProcess,
SharedResourcesAcquirer sra,
ModuleCallingContext const *  mcc 
) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 385 of file ProductHolder.cc.

References edm::ProductHolderBase::Ambiguous, ambiguous_, assert(), edm::Principal::getProductHolderByIndex(), relval_2017::k, edm::Principal::lookupProcessOrder(), matchingHolders_, edm::ProductHolderIndexInvalid, edm::ProductHolderBase::ProductNotFound, and edm::ProductHolderBase::resolveProduct().

389  {
390  std::vector<unsigned int> const& lookupProcessOrder = principal.lookupProcessOrder();
391  for(unsigned int k : lookupProcessOrder) {
392  assert(k < ambiguous_.size());
393  if(k == 0) break; // Done
394  if(ambiguous_[k]) {
395  resolveStatus = Ambiguous;
396  return nullptr;
397  }
399  ProductHolderBase const* productHolder = principal.getProductHolderByIndex(matchingHolders_[k]);
400  ProductData const* pd = productHolder->resolveProduct(resolveStatus, principal, skipCurrentProcess, sra, mcc);
401  if(pd != nullptr) return pd;
402  }
403  }
404  resolveStatus = ProductNotFound;
405  return nullptr;
406  }
std::vector< ProductHolderIndex > matchingHolders_
assert(m_qm.get())
std::vector< bool > ambiguous_
void edm::NoProcessProductHolder::setProcessHistory_ ( ProcessHistory const &  ph)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 441 of file ProductHolder.cc.

441  {
442  }
void edm::NoProcessProductHolder::setProductDeleted_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 509 of file ProductHolder.cc.

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

509  {
511  << "NoProcessProductHolder::setProductDeleted_() not implemented and should never be called.\n"
512  << "Contact a Framework developer\n";
513  }
void edm::NoProcessProductHolder::setProvenance_ ( ProductProvenanceRetriever const *  provRetriever,
ProcessHistory const &  ph,
ProductID const &  pid 
)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 438 of file ProductHolder.cc.

438  {
439  }
bool edm::NoProcessProductHolder::singleProduct_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 451 of file ProductHolder.cc.

451  {
452  return false;
453  }
void edm::NoProcessProductHolder::swap_ ( ProductHolderBase rhs)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 429 of file ProductHolder.cc.

References ambiguous_, and matchingHolders_.

429  {
430  NoProcessProductHolder& other = dynamic_cast<NoProcessProductHolder&>(rhs);
431  ambiguous_.swap(other.ambiguous_);
432  matchingHolders_.swap(other.matchingHolders_);
433  }
std::vector< ProductHolderIndex > matchingHolders_
NoProcessProductHolder(std::vector< ProductHolderIndex > const &matchingHolders, std::vector< bool > const &ambiguous)
std::vector< bool > ambiguous_

Member Data Documentation

std::vector<bool> edm::NoProcessProductHolder::ambiguous_
private

Definition at line 483 of file ProductHolder.h.

Referenced by NoProcessProductHolder(), resolveProduct_(), and swap_().

std::vector<ProductHolderIndex> edm::NoProcessProductHolder::matchingHolders_
private

Definition at line 482 of file ProductHolder.h.

Referenced by NoProcessProductHolder(), resolveProduct_(), and swap_().