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

BranchDescription 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< BranchDescription const > bd)
 
void resetProductData ()
 
void resetStatus ()
 
std::string const & resolvedModuleLabel () const
 
ProductData const * resolveProduct (ResolveStatus &resolveStatus, bool skipCurrentProcess, ModuleCallingContext const *mcc) const
 
void setPrincipal (Principal *principal)
 
void setProcessHistory (ProcessHistory const &ph)
 
void setProductDeleted ()
 
void setProductProvenance (ProductProvenance const &prov) const
 
void setProvenance (boost::shared_ptr< ProductProvenanceRetriever > provRetriever, ProcessHistory const &ph, 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 BranchDescription 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< BranchDescription const > 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, ModuleCallingContext const *mcc) const =0
 
virtual void setPrincipal_ (Principal *principal)=0
 
virtual void setProcessHistory_ (ProcessHistory const &ph)=0
 
virtual void setProductDeleted_ ()=0
 
virtual void setProvenance_ (boost::shared_ptr< ProductProvenanceRetriever > provRetriever, ProcessHistory const &ph, ProductID const &pid)=0
 
virtual bool singleProduct_ () const =0
 
virtual void swap_ (ProductHolderBase &rhs)=0
 

Detailed Description

Definition at line 31 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

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

Definition at line 168 of file ProductHolder.h.

References checkType_().

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

168  {
169  checkType_(prod);
170  }
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 65 of file ProductHolder.h.

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

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

65  {
68  }
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 155 of file ProductHolder.h.

References mergeProduct_().

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

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

Definition at line 159 of file ProductHolder.h.

References mergeProduct_().

159  {
160  mergeProduct_(edp);
161  }
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 206 of file ProductHolder.cc.

References branchDescription(), edm::BranchDescription::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_().

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

Definition at line 77 of file ProductHolder.h.

References onDemand_().

Referenced by edm::AliasProductHolder::onDemand_(), and edm::ProducedProductHolder::productUnavailable_().

77 {return onDemand_();}
virtual bool onDemand_() const =0
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 117 of file ProductHolder.h.

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

Referenced by mergeTheProduct(), and throwProductDeletedException().

117 {return branchDescription().processName();}
std::string const & processName() const
BranchDescription const & branchDescription() const
Definition: ProductHolder.h:95
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 46 of file ProductHolder.h.

References getProductData().

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

Definition at line 137 of file ProductHolder.h.

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

Referenced by write().

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

Definition at line 114 of file ProductHolder.h.

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

Referenced by mergeTheProduct(), and throwProductDeletedException().

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

Definition at line 89 of file ProductHolder.h.

References productProvenancePtr_().

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

Definition at line 358 of file ProductHolder.cc.

References wrapper().

358  {
359  return TypeID(wrapper().interface()->wrappedTypeInfo());
360  }
WrapperHolder wrapper() const
Definition: ProductHolder.h:86
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 346 of file ProductHolder.cc.

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

346  {
347  // If this product is from a the current process,
348  // the provenance is available if and only if a product has been put.
349  if(branchDescription().produced()) {
350  return product() && wrapper().isPresent();
351  }
352  // If this product is from a prior process, the provenance is available,
353  // although the per event part may have been dropped.
354  return true;
355  }
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:83
BranchDescription const & branchDescription() const
Definition: ProductHolder.h:95
eventsetup::produce::Produce produced
Definition: ESProducts.cc:20
bool isPresent() const
Definition: WrapperHolder.h:64
WrapperHolder wrapper() const
Definition: ProductHolder.h:86
bool edm::ProductHolderBase::putOrMergeProduct ( ) const
inline

Definition at line 150 of file ProductHolder.h.

References putOrMergeProduct_().

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

150  {
151  return putOrMergeProduct_();
152  }
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 140 of file ProductHolder.h.

References putProduct_().

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

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

Definition at line 145 of file ProductHolder.h.

References putProduct_().

145  {
146  putProduct_(edp);
147  }
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 363 of file ProductHolder.cc.

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

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

363  {
364  // Check if the types match.
365  TypeID typeID(prod.dynamicTypeInfo());
366  if(typeID != branchDescription().unwrappedTypeID()) {
367  // Types do not match.
369  << "Product on branch " << branchDescription().branchName() << " is of wrong type.\n"
370  << "It is supposed to be of type " << branchDescription().className() << ".\n"
371  << "It is actually of type " << typeID.className() << ".\n";
372  }
373  }
std::string const & branchName() const
BranchDescription const & branchDescription() const
Definition: ProductHolder.h:95
std::string const & className() const
TypeID unwrappedTypeID() const
void edm::ProductHolderBase::resetBranchDescription ( boost::shared_ptr< BranchDescription const >  bd)
inline

Definition at line 103 of file ProductHolder.h.

References resetBranchDescription_().

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

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

Definition at line 63 of file ProductHolder.h.

References resetProductData_().

63 { 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 111 of file ProductHolder.h.

References resolvedModuleLabel_().

111 {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,
ModuleCallingContext const *  mcc 
) const
inline

Definition at line 50 of file ProductHolder.h.

References resolveProduct_().

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

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

Definition at line 100 of file ProductHolder.h.

References setPrincipal_().

virtual void setPrincipal_(Principal *principal)=0
virtual void edm::ProductHolderBase::setPrincipal_ ( Principal principal)
privatepure virtual
void edm::ProductHolderBase::setProcessHistory ( ProcessHistory const &  ph)
inline

Definition at line 126 of file ProductHolder.h.

References setProcessHistory_().

126 { setProcessHistory_(ph); }
virtual void setProcessHistory_(ProcessHistory const &ph)=0
virtual void edm::ProductHolderBase::setProcessHistory_ ( ProcessHistory const &  ph)
privatepure virtual
void edm::ProductHolderBase::setProductDeleted ( )
inline

Definition at line 59 of file ProductHolder.h.

References setProductDeleted_().

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

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

Definition at line 270 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_().

270  {
272  }
Provenance prov_
Definition: ProductData.h:51
ProductData const & productData() const
Definition: ProductHolder.h:42
void setProductProvenance(ProductProvenance const &prov) const
Definition: Provenance.cc:78
void edm::ProductHolderBase::setProvenance ( boost::shared_ptr< ProductProvenanceRetriever provRetriever,
ProcessHistory const &  ph,
ProductID const &  pid 
)
inline

Definition at line 123 of file ProductHolder.h.

References setProvenance_().

123 { setProvenance_(provRetriever, ph, pid); }
tuple pid
Definition: sysUtil.py:22
virtual void setProvenance_(boost::shared_ptr< ProductProvenanceRetriever > provRetriever, ProcessHistory const &ph, ProductID const &pid)=0
virtual void edm::ProductHolderBase::setProvenance_ ( boost::shared_ptr< ProductProvenanceRetriever provRetriever,
ProcessHistory const &  ph,
ProductID const &  pid 
)
privatepure virtual
bool edm::ProductHolderBase::singleProduct ( ) const
inline

Definition at line 98 of file ProductHolder.h.

References singleProduct_().

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

98 {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 172 of file ProductHolder.h.

References swap_().

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

172 {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::BranchDescription::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  }
std::string const & moduleLabel() const
BranchDescription const & branchDescription() const
Definition: ProductHolder.h:95
TypeID unwrappedTypeID() 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 381 of file ProductHolder.cc.

References productID(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

381  {
382  // This is grossly inadequate. It is also not critical for the
383  // first pass.
384  os << std::string("ProductHolder for product with ID: ")
385  << productID();
386  }
ProductID const & productID() const