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, Principal *principal)
 
virtual ~NoProcessProductHolder ()
 
- Public Member Functions inherited from edm::ProductHolderBase
ConstBranchDescription const & branchDescription () const
 
void checkType (WrapperOwningHolder const &prod) const
 
void deleteProduct ()
 
void mergeProduct (WrapperOwningHolder const &edp, ProductProvenance &productProvenance)
 
void mergeProduct (WrapperOwningHolder const &edp) const
 
void mergeTheProduct (WrapperOwningHolder const &edp) const
 
std::string const & moduleLabel () const
 
bool onDemand () const
 
ProductHolderBaseoperator= (ProductHolderBase const &)=delete
 
std::string const & processName () const
 
boost::shared_ptr< void const > product () const
 
ProductData const & productData () const
 
ProductDataproductData ()
 
 ProductHolderBase ()
 
 ProductHolderBase (ProductHolderBase const &)=delete
 
ProductID const & productID () const
 
std::string const & productInstanceName () const
 
ProductProvenanceproductProvenancePtr () const
 
TypeID productType () const
 
bool productUnavailable () const
 
bool productWasDeleted () const
 
Provenanceprovenance () const
 
bool provenanceAvailable () const
 
bool putOrMergeProduct () const
 
void putProduct (WrapperOwningHolder const &edp, ProductProvenance const &productProvenance)
 
void putProduct (WrapperOwningHolder const &edp) const
 
void reallyCheckType (WrapperOwningHolder const &prod) const
 
void resetBranchDescription (boost::shared_ptr< ConstBranchDescription > bd)
 
void resetProductData ()
 
void resetStatus ()
 
std::string const & resolvedModuleLabel () const
 
ProductData const * resolveProduct (ResolveStatus &resolveStatus, bool skipCurrentProcess) const
 
void setPrincipal (Principal *principal)
 
void setProcessHistoryID (ProcessHistoryID const &phid)
 
void setProductDeleted ()
 
void setProductProvenance (ProductProvenance const &prov) const
 
void setProvenance (boost::shared_ptr< BranchMapper > mapper, ProcessHistoryID const &phid, ProductID const &pid)
 
bool singleProduct () const
 
void swap (ProductHolderBase &rhs)
 
void throwProductDeletedException () const
 
WrapperHolder wrapper () const
 
void write (std::ostream &os) const
 
virtual ~ProductHolderBase ()
 

Private Member Functions

virtual ConstBranchDescription
const & 
branchDescription_ () const
 
virtual void checkType_ (WrapperOwningHolder const &prod) const
 
virtual ProductData const & getProductData () const
 
virtual ProductDatagetProductData ()
 
virtual void mergeProduct_ (WrapperOwningHolder const &edp, ProductProvenance &productProvenance)
 
virtual void mergeProduct_ (WrapperOwningHolder const &edp) const
 
virtual bool onDemand_ () const
 
virtual ProductProvenanceproductProvenancePtr_ () const
 
virtual bool productUnavailable_ () const
 
virtual bool productWasDeleted_ () const
 
virtual bool putOrMergeProduct_ () const
 
virtual void putProduct_ (WrapperOwningHolder const &edp, ProductProvenance const &productProvenance)
 
virtual void putProduct_ (WrapperOwningHolder const &edp) const
 
virtual void resetBranchDescription_ (boost::shared_ptr< ConstBranchDescription > bd)
 
virtual void resetProductData_ ()
 
virtual void resetStatus_ ()
 
virtual std::string const & resolvedModuleLabel_ () const
 
virtual ProductData const * resolveProduct_ (ResolveStatus &resolveStatus, bool skipCurrentProcess) const
 
virtual void setPrincipal_ (Principal *principal)
 
virtual void setProcessHistoryID_ (ProcessHistoryID const &phid)
 
virtual void setProductDeleted_ ()
 
virtual void setProvenance_ (boost::shared_ptr< BranchMapper > mapper, ProcessHistoryID const &phid, ProductID const &pid)
 
virtual bool singleProduct_ () const
 
virtual void swap_ (ProductHolderBase &rhs)
 

Private Attributes

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

Detailed Description

Definition at line 429 of file ProductHolder.h.

Member Typedef Documentation

Definition at line 431 of file ProductHolder.h.

Constructor & Destructor Documentation

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

Definition at line 384 of file ProductHolder.cc.

References ambiguous_, and matchingHolders_.

386  :
387  matchingHolders_(matchingHolders),
388  ambiguous_(ambiguous),
390  assert(ambiguous_.size() == matchingHolders_.size());
391  }
std::vector< ProductHolderIndex > matchingHolders_
std::vector< bool > ambiguous_
edm::NoProcessProductHolder::~NoProcessProductHolder ( )
virtual

Definition at line 36 of file ProductHolder.cc.

36 {}

Member Function Documentation

ConstBranchDescription const & edm::NoProcessProductHolder::branchDescription_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 543 of file ProductHolder.cc.

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

543  {
545  << "NoProcessProductHolder::branchDescription_() not implemented and should never be called.\n"
546  << "Contact a Framework developer\n";
547  }
void edm::NoProcessProductHolder::checkType_ ( WrapperOwningHolder const &  prod) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 531 of file ProductHolder.cc.

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

531  {
533  << "NoProcessProductHolder::checkType_() not implemented and should never be called.\n"
534  << "Contact a Framework developer\n";
535  }
ProductData const & edm::NoProcessProductHolder::getProductData ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 393 of file ProductHolder.cc.

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

393  {
395  << "NoProcessProductHolder::getProductData() not implemented and should never be called.\n"
396  << "Contact a Framework developer\n";
397  }
ProductData & edm::NoProcessProductHolder::getProductData ( )
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 399 of file ProductHolder.cc.

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

399  {
401  << "NoProcessProductHolder::getProductData() not implemented and should never be called.\n"
402  << "Contact a Framework developer\n";
403  }
void edm::NoProcessProductHolder::mergeProduct_ ( WrapperOwningHolder const &  edp,
ProductProvenance productProvenance 
)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 513 of file ProductHolder.cc.

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

513  {
515  << "NoProcessProductHolder::mergeProduct_() not implemented and should never be called.\n"
516  << "Contact a Framework developer\n";
517  }
void edm::NoProcessProductHolder::mergeProduct_ ( WrapperOwningHolder const &  edp) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 519 of file ProductHolder.cc.

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

519  {
521  << "NoProcessProductHolder::mergeProduct_() not implemented and should never be called.\n"
522  << "Contact a Framework developer\n";
523  }
bool edm::NoProcessProductHolder::onDemand_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 483 of file ProductHolder.cc.

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

483  {
485  << "NoProcessProductHolder::onDemand_() not implemented and should never be called.\n"
486  << "Contact a Framework developer\n";
487  }
ProductProvenance * edm::NoProcessProductHolder::productProvenancePtr_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 466 of file ProductHolder.cc.

466  {
467  return nullptr;
468  }
bool edm::NoProcessProductHolder::productUnavailable_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 489 of file ProductHolder.cc.

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

489  {
491  << "NoProcessProductHolder::productUnavailable_() not implemented and should never be called.\n"
492  << "Contact a Framework developer\n";
493  }
bool edm::NoProcessProductHolder::productWasDeleted_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 495 of file ProductHolder.cc.

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

495  {
497  << "NoProcessProductHolder::productWasDeleted_() not implemented and should never be called.\n"
498  << "Contact a Framework developer\n";
499  }
bool edm::NoProcessProductHolder::putOrMergeProduct_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 525 of file ProductHolder.cc.

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

525  {
527  << "NoProcessProductHolder::putOrMergeProduct_() not implemented and should never be called.\n"
528  << "Contact a Framework developer\n";
529  }
void edm::NoProcessProductHolder::putProduct_ ( WrapperOwningHolder const &  edp,
ProductProvenance const &  productProvenance 
)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 501 of file ProductHolder.cc.

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

501  {
503  << "NoProcessProductHolder::putProduct_() not implemented and should never be called.\n"
504  << "Contact a Framework developer\n";
505  }
void edm::NoProcessProductHolder::putProduct_ ( WrapperOwningHolder const &  edp) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 507 of file ProductHolder.cc.

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

507  {
509  << "NoProcessProductHolder::putProduct_() not implemented and should never be called.\n"
510  << "Contact a Framework developer\n";
511  }
void edm::NoProcessProductHolder::resetBranchDescription_ ( boost::shared_ptr< ConstBranchDescription bd)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 549 of file ProductHolder.cc.

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

549  {
551  << "NoProcessProductHolder::resetBranchDescription_() not implemented and should never be called.\n"
552  << "Contact a Framework developer\n";
553  }
void edm::NoProcessProductHolder::resetProductData_ ( )
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 470 of file ProductHolder.cc.

470  {
471  }
void edm::NoProcessProductHolder::resetStatus_ ( )
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 457 of file ProductHolder.cc.

457  {
458  }
virtual std::string const& edm::NoProcessProductHolder::resolvedModuleLabel_ ( ) const
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 454 of file ProductHolder.h.

References edm::ProductHolderBase::moduleLabel().

454 {return moduleLabel();}
std::string const & moduleLabel() const
ProductData const * edm::NoProcessProductHolder::resolveProduct_ ( ResolveStatus resolveStatus,
bool  skipCurrentProcess 
) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 405 of file ProductHolder.cc.

References edm::ProductHolderBase::Ambiguous, ambiguous_, edm::Principal::getProductByIndex(), gen::k, edm::Principal::lookupProcessOrder(), matchingHolders_, principal_, edm::ProductHolderIndexInvalid, edm::ProductHolderBase::ProductNotFound, and edm::ProductHolderBase::resolveProduct().

405  {
406  std::vector<unsigned int> const& lookupProcessOrder = principal_->lookupProcessOrder();
407  for(unsigned int k : lookupProcessOrder) {
408  assert(k < ambiguous_.size());
409  if(k == 0) break; // Done
410  if(ambiguous_[k]) {
411  resolveStatus = Ambiguous;
412  return nullptr;
413  }
415  ProductHolderBase const* productHolder = principal_->getProductByIndex(matchingHolders_[k], false, false);
416  ProductData const* pd = productHolder->resolveProduct(resolveStatus, skipCurrentProcess);
417  if(pd != nullptr) return pd;
418  }
419  }
420  resolveStatus = ProductNotFound;
421  return nullptr;
422  }
ConstProductPtr getProductByIndex(ProductHolderIndex const &oid, bool resolveProd, bool fillOnDemand) const
Definition: Principal.cc:408
std::vector< ProductHolderIndex > matchingHolders_
std::vector< unsigned int > const & lookupProcessOrder() const
Definition: Principal.h:171
int k[5][pyjets_maxn]
std::vector< bool > ambiguous_
void edm::NoProcessProductHolder::setPrincipal_ ( Principal principal)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 477 of file ProductHolder.cc.

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

477  {
479  << "NoProcessProductHolder::setPrincipal__() not implemented and should never be called.\n"
480  << "Contact a Framework developer\n";
481  }
void edm::NoProcessProductHolder::setProcessHistoryID_ ( ProcessHistoryID const &  phid)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 463 of file ProductHolder.cc.

463  {
464  }
void edm::NoProcessProductHolder::setProductDeleted_ ( )
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 537 of file ProductHolder.cc.

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

537  {
539  << "NoProcessProductHolder::setProductDeleted_() not implemented and should never be called.\n"
540  << "Contact a Framework developer\n";
541  }
void edm::NoProcessProductHolder::setProvenance_ ( boost::shared_ptr< BranchMapper mapper,
ProcessHistoryID const &  phid,
ProductID const &  pid 
)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 460 of file ProductHolder.cc.

460  {
461  }
bool edm::NoProcessProductHolder::singleProduct_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 473 of file ProductHolder.cc.

473  {
474  return false;
475  }
void edm::NoProcessProductHolder::swap_ ( ProductHolderBase rhs)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 450 of file ProductHolder.cc.

References ambiguous_, matchingHolders_, principal_, and std::swap().

450  {
451  NoProcessProductHolder& other = dynamic_cast<NoProcessProductHolder&>(rhs);
452  ambiguous_.swap(other.ambiguous_);
453  matchingHolders_.swap(other.matchingHolders_);
454  std::swap(principal_, other.principal_);
455  }
std::vector< ProductHolderIndex > matchingHolders_
NoProcessProductHolder(std::vector< ProductHolderIndex > const &matchingHolders, std::vector< bool > const &ambiguous, Principal *principal)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< bool > ambiguous_

Member Data Documentation

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

Definition at line 463 of file ProductHolder.h.

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

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

Definition at line 462 of file ProductHolder.h.

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

Principal* edm::NoProcessProductHolder::principal_
private

Definition at line 464 of file ProductHolder.h.

Referenced by resolveProduct_(), and swap_().