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
edm::ProductHolderBase Class Referenceabstract

#include <ProductHolder.h>

Inheritance diagram for edm::ProductHolderBase:
edm::AliasProductHolder edm::InputProductHolder edm::NoProcessProductHolder edm::ProducedProductHolder edm::ScheduledProductHolder edm::SourceProductHolder edm::UnscheduledProductHolder

Public Types

enum  ResolveStatus { ProductFound, ProductNotFound, Ambiguous }
 

Public Member Functions

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

Detailed Description

Definition at line 30 of file ProductHolder.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

edm::ProductHolderBase::ProductHolderBase ( )

Definition at line 27 of file ProductHolder.cc.

27 {}
edm::ProductHolderBase::~ProductHolderBase ( )
virtual

Definition at line 29 of file ProductHolder.cc.

29 {}
edm::ProductHolderBase::ProductHolderBase ( ProductHolderBase const &  )
delete

Member Function Documentation

ConstBranchDescription const& edm::ProductHolderBase::branchDescription ( ) const
inline
virtual ConstBranchDescription const& edm::ProductHolderBase::branchDescription_ ( ) const
privatepure virtual
void edm::ProductHolderBase::checkType ( WrapperOwningHolder const &  prod) const
inline

Definition at line 166 of file ProductHolder.h.

References checkType_().

Referenced by edm::AliasProductHolder::checkType_(), edm::Principal::checkUniquenessAndType(), and edm::Principal::putOrMerge().

166  {
167  checkType_(prod);
168  }
virtual void checkType_(WrapperOwningHolder const &prod) const =0
virtual void edm::ProductHolderBase::checkType_ ( WrapperOwningHolder const &  prod) const
privatepure virtual
void edm::ProductHolderBase::deleteProduct ( )
inline

Definition at line 63 of file ProductHolder.h.

References getProductData(), edm::ProductData::resetProductData(), and setProductDeleted_().

Referenced by edm::Principal::deleteProduct().

63  {
66  }
virtual ProductData const & getProductData() const =0
void resetProductData()
Definition: ProductData.h:40
virtual void setProductDeleted_()=0
virtual ProductData const& edm::ProductHolderBase::getProductData ( ) const
privatepure virtual
virtual ProductData& edm::ProductHolderBase::getProductData ( )
privatepure virtual
void edm::ProductHolderBase::mergeProduct ( WrapperOwningHolder const &  edp,
ProductProvenance productProvenance 
)
inline

Definition at line 153 of file ProductHolder.h.

References mergeProduct_().

Referenced by edm::AliasProductHolder::mergeProduct_(), and edm::Principal::putOrMerge().

153  {
154  mergeProduct_(edp, productProvenance);
155  }
virtual void mergeProduct_(WrapperOwningHolder const &edp, ProductProvenance &productProvenance)=0
void edm::ProductHolderBase::mergeProduct ( WrapperOwningHolder const &  edp) const
inline

Definition at line 157 of file ProductHolder.h.

References mergeProduct_().

157  {
158  mergeProduct_(edp);
159  }
virtual void mergeProduct_(WrapperOwningHolder const &edp, ProductProvenance &productProvenance)=0
virtual void edm::ProductHolderBase::mergeProduct_ ( WrapperOwningHolder const &  edp,
ProductProvenance productProvenance 
)
privatepure virtual
virtual void edm::ProductHolderBase::mergeProduct_ ( WrapperOwningHolder const &  edp) const
privatepure virtual
void edm::ProductHolderBase::mergeTheProduct ( WrapperOwningHolder const &  edp) const

Definition at line 201 of file ProductHolder.cc.

References branchDescription(), edm::ConstBranchDescription::className(), edm::WrapperHolder::hasIsProductEqual(), edm::WrapperHolder::isProductEqual(), edm::WrapperHolder::mergeProduct(), moduleLabel(), processName(), productInstanceName(), edm::WrapperHolder::wrapper(), and wrapper().

Referenced by edm::InputProductHolder::mergeProduct_(), and edm::ProducedProductHolder::mergeProduct_().

201  {
202  if(wrapper().isMergeable()) {
203  wrapper().mergeProduct(edp.wrapper());
204  } else if(wrapper().hasIsProductEqual()) {
205  if(!wrapper().isProductEqual(edp.wrapper())) {
206  LogError("RunLumiMerging")
207  << "ProductHolderBase::mergeTheProduct\n"
208  << "Two run/lumi products for the same run/lumi which should be equal are not\n"
209  << "Using the first, ignoring the second\n"
210  << "className = " << branchDescription().className() << "\n"
211  << "moduleLabel = " << moduleLabel() << "\n"
212  << "instance = " << productInstanceName() << "\n"
213  << "process = " << processName() << "\n";
214  }
215  } else {
216  LogWarning("RunLumiMerging")
217  << "ProductHolderBase::mergeTheProduct\n"
218  << "Run/lumi product has neither a mergeProduct nor isProductEqual function\n"
219  << "Using the first, ignoring the second in merge\n"
220  << "className = " << branchDescription().className() << "\n"
221  << "moduleLabel = " << moduleLabel() << "\n"
222  << "instance = " << productInstanceName() << "\n"
223  << "process = " << processName() << "\n";
224  }
225  }
ConstBranchDescription const & branchDescription() const
Definition: ProductHolder.h:93
bool mergeProduct(void const *newProduct)
Definition: WrapperHolder.h:57
std::string const & moduleLabel() const
bool isProductEqual(void const *newProduct) const
Definition: WrapperHolder.h:60
bool hasIsProductEqual() const
Definition: WrapperHolder.h:53
std::string const & processName() const
std::string const & className() const
std::string const & productInstanceName() const
WrapperHolder wrapper() const
Definition: ProductHolder.h:84
std::string const& edm::ProductHolderBase::moduleLabel ( ) const
inline
bool edm::ProductHolderBase::onDemand ( ) const
inline
virtual bool edm::ProductHolderBase::onDemand_ ( ) const
privatepure virtual
ProductHolderBase& edm::ProductHolderBase::operator= ( ProductHolderBase const &  )
delete
std::string const& edm::ProductHolderBase::processName ( ) const
inline

Definition at line 115 of file ProductHolder.h.

References branchDescription(), and edm::ConstBranchDescription::processName().

Referenced by mergeTheProduct(), and throwProductDeletedException().

115 {return branchDescription().processName();}
std::string const & processName() const
ConstBranchDescription const & branchDescription() const
Definition: ProductHolder.h:93
boost::shared_ptr<void const> edm::ProductHolderBase::product ( ) const
inline
ProductData const& edm::ProductHolderBase::productData ( ) const
inline
ProductData& edm::ProductHolderBase::productData ( )
inline

Definition at line 45 of file ProductHolder.h.

References getProductData().

45  {
46  return getProductData();
47  }
virtual ProductData const & getProductData() const =0
ProductID const& edm::ProductHolderBase::productID ( ) const
inline

Definition at line 135 of file ProductHolder.h.

References getProductData(), edm::Provenance::productID(), and edm::ProductData::prov_.

Referenced by write().

135 {return getProductData().prov_.productID();}
Provenance prov_
Definition: ProductData.h:51
virtual ProductData const & getProductData() const =0
ProductID const & productID() const
Definition: Provenance.h:88
std::string const& edm::ProductHolderBase::productInstanceName ( ) const
inline

Definition at line 112 of file ProductHolder.h.

References branchDescription(), and edm::ConstBranchDescription::productInstanceName().

Referenced by mergeTheProduct(), and throwProductDeletedException().

ConstBranchDescription const & branchDescription() const
Definition: ProductHolder.h:93
std::string const & productInstanceName() const
ProductProvenance* edm::ProductHolderBase::productProvenancePtr ( ) const
inline

Definition at line 87 of file ProductHolder.h.

References productProvenancePtr_().

87 { return productProvenancePtr_(); }
virtual ProductProvenance * productProvenancePtr_() const =0
virtual ProductProvenance* edm::ProductHolderBase::productProvenancePtr_ ( ) const
privatepure virtual
TypeID edm::ProductHolderBase::productType ( ) const

Definition at line 353 of file ProductHolder.cc.

References wrapper().

353  {
354  return TypeID(wrapper().interface()->wrappedTypeInfo());
355  }
WrapperHolder wrapper() const
Definition: ProductHolder.h:84
bool edm::ProductHolderBase::productUnavailable ( ) const
inline
virtual bool edm::ProductHolderBase::productUnavailable_ ( ) const
privatepure virtual
bool edm::ProductHolderBase::productWasDeleted ( ) const
inline
virtual bool edm::ProductHolderBase::productWasDeleted_ ( ) const
privatepure virtual
Provenance * edm::ProductHolderBase::provenance ( ) const
bool edm::ProductHolderBase::provenanceAvailable ( ) const

Definition at line 341 of file ProductHolder.cc.

References branchDescription(), edm::WrapperHolder::isPresent(), edm::es::produced, product(), and wrapper().

341  {
342  // If this product is from a the current process,
343  // the provenance is available if and only if a product has been put.
344  if(branchDescription().produced()) {
345  return product() && wrapper().isPresent();
346  }
347  // If this product is from a prior process, the provenance is available,
348  // although the per event part may have been dropped.
349  return true;
350  }
ConstBranchDescription const & branchDescription() const
Definition: ProductHolder.h:93
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:81
eventsetup::produce::Produce produced
Definition: ESProducts.cc:21
bool isPresent() const
Definition: WrapperHolder.h:64
WrapperHolder wrapper() const
Definition: ProductHolder.h:84
bool edm::ProductHolderBase::putOrMergeProduct ( ) const
inline

Definition at line 148 of file ProductHolder.h.

References putOrMergeProduct_().

Referenced by edm::Principal::putOrMerge(), and edm::AliasProductHolder::putOrMergeProduct_().

148  {
149  return putOrMergeProduct_();
150  }
virtual bool putOrMergeProduct_() const =0
virtual bool edm::ProductHolderBase::putOrMergeProduct_ ( ) const
privatepure virtual
void edm::ProductHolderBase::putProduct ( WrapperOwningHolder const &  edp,
ProductProvenance const &  productProvenance 
)
inline

Definition at line 138 of file ProductHolder.h.

References putProduct_().

Referenced by edm::EventPrincipal::put(), edm::EventPrincipal::putOnRead(), edm::Principal::putOrMerge(), edm::AliasProductHolder::putProduct_(), and edm::EventPrincipal::resolveProduct_().

138  {
139  putProduct_(edp, productProvenance);
140  }
virtual void putProduct_(WrapperOwningHolder const &edp, ProductProvenance const &productProvenance)=0
void edm::ProductHolderBase::putProduct ( WrapperOwningHolder const &  edp) const
inline

Definition at line 143 of file ProductHolder.h.

References putProduct_().

143  {
144  putProduct_(edp);
145  }
virtual void putProduct_(WrapperOwningHolder const &edp, ProductProvenance const &productProvenance)=0
virtual void edm::ProductHolderBase::putProduct_ ( WrapperOwningHolder const &  edp,
ProductProvenance const &  productProvenance 
)
privatepure virtual
virtual void edm::ProductHolderBase::putProduct_ ( WrapperOwningHolder const &  edp) const
privatepure virtual
void edm::ProductHolderBase::reallyCheckType ( WrapperOwningHolder const &  prod) const

Definition at line 358 of file ProductHolder.cc.

References branchDescription(), edm::ConstBranchDescription::branchName(), edm::ConstBranchDescription::className(), edm::WrapperHolder::dynamicTypeInfo(), edm::errors::EventCorruption, edm::hlt::Exception, and edm::ConstBranchDescription::unwrappedTypeID().

Referenced by edm::ProducedProductHolder::checkType_().

358  {
359  // Check if the types match.
360  TypeID typeID(prod.dynamicTypeInfo());
361  if(typeID != branchDescription().unwrappedTypeID()) {
362  // Types do not match.
364  << "Product on branch " << branchDescription().branchName() << " is of wrong type.\n"
365  << "It is supposed to be of type " << branchDescription().className() << ".\n"
366  << "It is actually of type " << typeID.className() << ".\n";
367  }
368  }
ConstBranchDescription const & branchDescription() const
Definition: ProductHolder.h:93
std::string const & className() const
std::string const & branchName() const
void edm::ProductHolderBase::resetBranchDescription ( boost::shared_ptr< ConstBranchDescription bd)
inline

Definition at line 101 of file ProductHolder.h.

References resetBranchDescription_().

Referenced by edm::Principal::adjustToNewProductRegistry().

virtual void resetBranchDescription_(boost::shared_ptr< ConstBranchDescription > bd)=0
virtual void edm::ProductHolderBase::resetBranchDescription_ ( boost::shared_ptr< ConstBranchDescription bd)
privatepure virtual
void edm::ProductHolderBase::resetProductData ( )
inline

Definition at line 61 of file ProductHolder.h.

References resetProductData_().

61 { resetProductData_(); }
virtual void resetProductData_()=0
virtual void edm::ProductHolderBase::resetProductData_ ( )
privatepure virtual
void edm::ProductHolderBase::resetStatus ( )
inline
virtual void edm::ProductHolderBase::resetStatus_ ( )
privatepure virtual
std::string const& edm::ProductHolderBase::resolvedModuleLabel ( ) const
inline

Definition at line 109 of file ProductHolder.h.

References resolvedModuleLabel_().

Referenced by edm::EventPrincipal::resolveProduct_().

109 {return resolvedModuleLabel_();}
virtual std::string const & resolvedModuleLabel_() const =0
virtual std::string const& edm::ProductHolderBase::resolvedModuleLabel_ ( ) const
privatepure virtual
ProductData const* edm::ProductHolderBase::resolveProduct ( ResolveStatus resolveStatus,
bool  skipCurrentProcess 
) const
inline

Definition at line 49 of file ProductHolder.h.

References resolveProduct_().

Referenced by edm::AliasProductHolder::resolveProduct_(), and edm::NoProcessProductHolder::resolveProduct_().

49  {
50  return resolveProduct_(resolveStatus, skipCurrentProcess);
51  }
virtual ProductData const * resolveProduct_(ResolveStatus &resolveStatus, bool skipCurrentProcess) const =0
virtual ProductData const* edm::ProductHolderBase::resolveProduct_ ( ResolveStatus resolveStatus,
bool  skipCurrentProcess 
) const
privatepure virtual
void edm::ProductHolderBase::setPrincipal ( Principal principal)
inline

Definition at line 98 of file ProductHolder.h.

References setPrincipal_().

virtual void setPrincipal_(Principal *principal)=0
virtual void edm::ProductHolderBase::setPrincipal_ ( Principal principal)
privatepure virtual
void edm::ProductHolderBase::setProcessHistoryID ( ProcessHistoryID const &  phid)
inline

Definition at line 124 of file ProductHolder.h.

References setProcessHistoryID_().

124 { setProcessHistoryID_(phid); }
virtual void setProcessHistoryID_(ProcessHistoryID const &phid)=0
virtual void edm::ProductHolderBase::setProcessHistoryID_ ( ProcessHistoryID const &  phid)
privatepure virtual
void edm::ProductHolderBase::setProductDeleted ( )
inline

Definition at line 57 of file ProductHolder.h.

References setProductDeleted_().

Referenced by edm::AliasProductHolder::setProductDeleted_().

57  {
59  }
virtual void setProductDeleted_()=0
virtual void edm::ProductHolderBase::setProductDeleted_ ( )
privatepure virtual
void edm::ProductHolderBase::setProductProvenance ( ProductProvenance const &  prov) const

Definition at line 265 of file ProductHolder.cc.

References productData(), edm::ProductData::prov_, and edm::Provenance::setProductProvenance().

Referenced by edm::ProducedProductHolder::mergeProduct_(), edm::InputProductHolder::putProduct_(), and edm::ProducedProductHolder::putProduct_().

265  {
267  }
Provenance prov_
Definition: ProductData.h:51
ProductData const & productData() const
Definition: ProductHolder.h:41
void setProductProvenance(ProductProvenance const &prov) const
Definition: Provenance.cc:125
void edm::ProductHolderBase::setProvenance ( boost::shared_ptr< BranchMapper mapper,
ProcessHistoryID const &  phid,
ProductID const &  pid 
)
inline

Definition at line 121 of file ProductHolder.h.

References setProvenance_().

121 { setProvenance_(mapper, phid, pid); }
virtual void setProvenance_(boost::shared_ptr< BranchMapper > mapper, ProcessHistoryID const &phid, ProductID const &pid)=0
virtual void edm::ProductHolderBase::setProvenance_ ( boost::shared_ptr< BranchMapper mapper,
ProcessHistoryID const &  phid,
ProductID const &  pid 
)
privatepure virtual
bool edm::ProductHolderBase::singleProduct ( ) const
inline

Definition at line 96 of file ProductHolder.h.

References singleProduct_().

Referenced by edm::RunPrincipal::readImmediate(), and edm::LuminosityBlockPrincipal::readImmediate().

96 {return singleProduct_();}
virtual bool singleProduct_() const =0
virtual bool edm::ProductHolderBase::singleProduct_ ( ) const
privatepure virtual
void edm::ProductHolderBase::swap ( ProductHolderBase rhs)
inline

Definition at line 170 of file ProductHolder.h.

References swap_().

Referenced by edm::swap(), and edm::AliasProductHolder::swap_().

170 {swap_(rhs);}
virtual void swap_(ProductHolderBase &rhs)=0
virtual void edm::ProductHolderBase::swap_ ( ProductHolderBase rhs)
privatepure virtual
void edm::ProductHolderBase::throwProductDeletedException ( ) const

Definition at line 14 of file ProductHolder.cc.

References branchDescription(), cppFunctionSkipper::exception, moduleLabel(), processName(), productInstanceName(), and edm::ConstBranchDescription::unwrappedTypeID().

Referenced by edm::InputProductHolder::resolveProduct_(), edm::ScheduledProductHolder::resolveProduct_(), edm::UnscheduledProductHolder::resolveProduct_(), and edm::SourceProductHolder::resolveProduct_().

14  {
16  exception << "ProductHolderBase::resolveProduct_: The product matching all criteria was already deleted\n"
17  << "Looking for type: " << branchDescription().unwrappedTypeID() << "\n"
18  << "Looking for module label: " << moduleLabel() << "\n"
19  << "Looking for productInstanceName: " << productInstanceName() << "\n"
20  << (processName().empty() ? "" : "Looking for process: ") << processName() << "\n"
21  << "This means there is a configuration error.\n"
22  << "The module which is asking for this data must be configured to state that it will read this data.";
23  throw exception;
24 
25  }
ConstBranchDescription const & branchDescription() const
Definition: ProductHolder.h:93
std::string const & moduleLabel() const
std::string const & processName() const
std::string const & productInstanceName() const
WrapperHolder edm::ProductHolderBase::wrapper ( ) const
inline
void edm::ProductHolderBase::write ( std::ostream &  os) const

Definition at line 376 of file ProductHolder.cc.

References productID(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by pkg.AbstractPkg::generate(), and edm::operator<<().

376  {
377  // This is grossly inadequate. It is also not critical for the
378  // first pass.
379  os << std::string("ProductHolder for product with ID: ")
380  << productID();
381  }
ProductID const & productID() const