CMS 3D CMS Logo

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

#include <ProductHolder.h>

Inheritance diagram for edm::InputProductHolder:
edm::ProductHolderBase

Public Member Functions

 InputProductHolder (std::shared_ptr< BranchDescription const > bd, Principal *principal)
 
bool productIsUnavailable () const
 
void setProduct (std::unique_ptr< WrapperBase > prod) const
 
void setProductUnavailable () const
 
virtual ~InputProductHolder ()
 
- Public Member Functions inherited from edm::ProductHolderBase
BranchDescription const & branchDescription () const
 
void checkType (WrapperBase const &prod) const
 
void deleteProduct ()
 
void mergeProduct (std::unique_ptr< WrapperBase > edp, ProductProvenance &productProvenance)
 
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
 
WrapperBaseproduct () 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 (std::unique_ptr< WrapperBase > edp, ProductProvenance const &productProvenance)
 
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, 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 (std::shared_ptr< ProductProvenanceRetriever > provRetriever, ProcessHistory const &ph, ProductID const &pid)
 
bool singleProduct () const
 
void swap (ProductHolderBase &rhs)
 
void throwProductDeletedException () const
 
void write (std::ostream &os) const
 
virtual ~ProductHolderBase ()
 

Private Member Functions

virtual BranchDescription const & branchDescription_ () const override
 
virtual void checkType_ (WrapperBase const &) const override
 
virtual ProductData const & getProductData () const override
 
virtual ProductDatagetProductData () override
 
virtual void mergeProduct_ (std::unique_ptr< WrapperBase > edp, ProductProvenance &productProvenance) override
 
virtual void mergeProduct_ (std::unique_ptr< WrapperBase > edp) const override
 
virtual bool onDemand_ () const override
 
virtual ProductProvenanceproductProvenancePtr_ () 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) 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, bool skipCurrentProcess, ModuleCallingContext const *mcc) const override
 
virtual void setPrincipal_ (Principal *principal) override
 
virtual void setProcessHistory_ (ProcessHistory const &ph) override
 
virtual void setProductDeleted_ () override
 
virtual void setProvenance_ (std::shared_ptr< ProductProvenanceRetriever > provRetriever, ProcessHistory const &ph, ProductID const &pid) override
 
virtual bool singleProduct_ () const override
 
virtual void swap_ (ProductHolderBase &rhs) override
 

Private Attributes

Principalprincipal_
 
ProductData productData_
 
bool productHasBeenDeleted_
 
bool productIsUnavailable_
 

Additional Inherited Members

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

Detailed Description

Definition at line 206 of file ProductHolder.h.

Constructor & Destructor Documentation

edm::InputProductHolder::InputProductHolder ( std::shared_ptr< BranchDescription const >  bd,
Principal principal 
)
inlineexplicit
edm::InputProductHolder::~InputProductHolder ( )
virtual

Definition at line 30 of file ProductHolder.cc.

30 {}

Member Function Documentation

virtual BranchDescription const& edm::InputProductHolder::branchDescription_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 242 of file ProductHolder.h.

References edm::ProductData::branchDescription(), and edm::ProductHolderBase::productData().

242 {return *productData().branchDescription();}
std::shared_ptr< BranchDescription const > const & branchDescription() const
Definition: ProductData.h:25
ProductData const & productData() const
Definition: ProductHolder.h:40
virtual void edm::InputProductHolder::checkType_ ( WrapperBase const &  ) const
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 233 of file ProductHolder.h.

233 {}
virtual ProductData const& edm::InputProductHolder::getProductData ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 239 of file ProductHolder.h.

References productData_.

239 {return productData_;}
virtual ProductData& edm::InputProductHolder::getProductData ( )
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 240 of file ProductHolder.h.

References productData_.

240 {return productData_;}
void edm::InputProductHolder::mergeProduct_ ( std::unique_ptr< WrapperBase edp,
ProductProvenance productProvenance 
)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 177 of file ProductHolder.cc.

References assert().

179  {
180  assert(nullptr);
181  }
assert(m_qm.get())
void edm::InputProductHolder::mergeProduct_ ( std::unique_ptr< WrapperBase edp) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 184 of file ProductHolder.cc.

References edm::ProductHolderBase::mergeTheProduct().

184  {
185  mergeTheProduct(std::move(edp));
186  }
void mergeTheProduct(std::unique_ptr< WrapperBase > edp) const
virtual bool edm::InputProductHolder::onDemand_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 236 of file ProductHolder.h.

236 {return false;}
bool edm::InputProductHolder::productIsUnavailable ( ) const
inline

Definition at line 217 of file ProductHolder.h.

References productIsUnavailable_.

Referenced by productUnavailable_().

ProductProvenance * edm::InputProductHolder::productProvenancePtr_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 245 of file ProductHolder.cc.

References edm::Provenance::productProvenance(), and edm::ProductHolderBase::provenance().

245  {
246  return provenance()->productProvenance();
247  }
ProductProvenance * productProvenance() const
Definition: Provenance.h:49
Provenance * provenance() const
bool edm::InputProductHolder::productUnavailable_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 271 of file ProductHolder.cc.

References edm::WrapperBase::isPresent(), edm::ProductHolderBase::product(), productIsUnavailable(), and setProductUnavailable().

271  {
272  if(productIsUnavailable()) {
273  return true;
274  }
275  // If there is a product, we know if it is real or a dummy.
276  if(product()) {
277  bool unavailable = !(product()->isPresent());
278  if(unavailable) {
280  }
281  return unavailable;
282  }
283  return false;
284  }
WrapperBase * product() const
Definition: ProductHolder.h:81
bool isPresent() const
Definition: WrapperBase.h:22
bool productIsUnavailable() const
void setProductUnavailable() const
virtual bool edm::InputProductHolder::productWasDeleted_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 238 of file ProductHolder.h.

References productHasBeenDeleted_.

bool edm::InputProductHolder::putOrMergeProduct_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 189 of file ProductHolder.cc.

References edm::ProductHolderBase::product().

189  {
190  return(!product());
191  }
WrapperBase * product() const
Definition: ProductHolder.h:81
void edm::InputProductHolder::putProduct_ ( std::unique_ptr< WrapperBase edp,
ProductProvenance const &  productProvenance 
)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 166 of file ProductHolder.cc.

References assert(), edm::ProductHolderBase::product(), edm::ProductHolderBase::provenance(), setProduct(), and edm::ProductHolderBase::setProductProvenance().

168  {
169  assert(!product());
170  assert(!provenance()->productProvenanceValid());
171  setProductProvenance(productProvenance);
172  assert(provenance()->productProvenanceValid());
173  setProduct(std::move(edp));
174  }
void setProduct(std::unique_ptr< WrapperBase > prod) const
WrapperBase * product() const
Definition: ProductHolder.h:81
assert(m_qm.get())
Provenance * provenance() const
void setProductProvenance(ProductProvenance const &prov) const
void edm::InputProductHolder::putProduct_ ( std::unique_ptr< WrapperBase edp) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 194 of file ProductHolder.cc.

References assert(), edm::ProductHolderBase::product(), and setProduct().

194  {
195  assert(!product());
196  setProduct(std::move(edp));
197  }
void setProduct(std::unique_ptr< WrapperBase > prod) const
WrapperBase * product() const
Definition: ProductHolder.h:81
assert(m_qm.get())
virtual void edm::InputProductHolder::resetBranchDescription_ ( std::shared_ptr< BranchDescription const >  bd)
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 243 of file ProductHolder.h.

References edm::ProductHolderBase::productData(), and edm::ProductData::resetBranchDescription().

void resetBranchDescription(std::shared_ptr< BranchDescription const > bd)
Definition: ProductData.cc:26
ProductData const & productData() const
Definition: ProductHolder.h:40
void edm::InputProductHolder::resetProductData_ ( )
overrideprivatevirtual
virtual void edm::InputProductHolder::resetStatus_ ( )
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 234 of file ProductHolder.h.

References productHasBeenDeleted_, and productIsUnavailable_.

virtual std::string const& edm::InputProductHolder::resolvedModuleLabel_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 244 of file ProductHolder.h.

References edm::ProductHolderBase::moduleLabel().

244 {return moduleLabel();}
std::string const & moduleLabel() const
ProductData const * edm::InputProductHolder::resolveProduct_ ( ResolveStatus resolveStatus,
bool  skipCurrentProcess,
ModuleCallingContext const *  mcc 
) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 39 of file ProductHolder.cc.

References principal_, edm::ProductHolderBase::product(), productData_, edm::ProductHolderBase::ProductFound, edm::ProductHolderBase::ProductNotFound, edm::ProductHolderBase::productUnavailable(), edm::ProductHolderBase::productWasDeleted(), edm::Principal::readFromSource(), and edm::ProductHolderBase::throwProductDeletedException().

40  {
41  if(productWasDeleted()) {
43  }
44  if(!productUnavailable()) {
45  principal_->readFromSource(*this, mcc);
46  // If the product is a dummy filler, product holder will now be marked unavailable.
47  if(product() && !productUnavailable()) {
48  // Found the match
49  resolveStatus = ProductFound;
50  return &productData_;
51  }
52  }
53  resolveStatus = ProductNotFound;
54  return nullptr;
55  }
WrapperBase * product() const
Definition: ProductHolder.h:81
void readFromSource(ProductHolderBase const &phb, ModuleCallingContext const *mcc) const
Definition: Principal.h:182
bool productWasDeleted() const
Definition: ProductHolder.h:78
void throwProductDeletedException() const
bool productUnavailable() const
Definition: ProductHolder.h:69
void edm::InputProductHolder::setPrincipal_ ( Principal principal)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 258 of file ProductHolder.cc.

References cmsRelvalreport::principal(), and principal_.

258  {
260  }
void edm::InputProductHolder::setProcessHistory_ ( ProcessHistory const &  ph)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 241 of file ProductHolder.cc.

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

241  {
243  }
Provenance prov_
Definition: ProductData.h:47
ProductData const & productData() const
Definition: ProductHolder.h:40
void setProcessHistory(ProcessHistory const &ph)
Definition: Provenance.h:76
void edm::InputProductHolder::setProduct ( std::unique_ptr< WrapperBase prod) const

Definition at line 227 of file ProductHolder.cc.

References assert(), edm::ProductHolderBase::product(), edm::ProductHolderBase::productData(), setProductUnavailable(), and edm::ProductData::wrapper_.

Referenced by putProduct_().

227  {
228  assert (!product());
229  if(prod.get() == nullptr || !prod->isPresent()) {
231  }
232  productData().wrapper_ = std::move(prod); // ProductHolder takes ownership
233  }
WrapperBase * product() const
Definition: ProductHolder.h:81
assert(m_qm.get())
std::shared_ptr< WrapperBase > wrapper_
Definition: ProductData.h:46
ProductData const & productData() const
Definition: ProductHolder.h:40
void setProductUnavailable() const
virtual void edm::InputProductHolder::setProductDeleted_ ( )
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 241 of file ProductHolder.h.

References productHasBeenDeleted_.

void edm::InputProductHolder::setProductUnavailable ( ) const
inline

Definition at line 218 of file ProductHolder.h.

References productIsUnavailable_.

Referenced by productUnavailable_(), and setProduct().

void edm::InputProductHolder::setProvenance_ ( std::shared_ptr< ProductProvenanceRetriever provRetriever,
ProcessHistory const &  ph,
ProductID const &  pid 
)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 235 of file ProductHolder.cc.

References edm::ProductHolderBase::productData(), edm::ProductData::prov_, edm::Provenance::setProcessHistory(), edm::Provenance::setProductID(), and edm::Provenance::setStore().

235  {
237  productData().prov_.setStore(provRetriever);
239  }
Provenance prov_
Definition: ProductData.h:47
ProductData const & productData() const
Definition: ProductHolder.h:40
tuple pid
Definition: sysUtil.py:22
void setProductID(ProductID const &pid)
Definition: Provenance.h:82
void setStore(std::shared_ptr< ProductProvenanceRetriever > store) const
Definition: Provenance.h:74
void setProcessHistory(ProcessHistory const &ph)
Definition: Provenance.h:76
bool edm::InputProductHolder::singleProduct_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 254 of file ProductHolder.cc.

254  {
255  return true;
256  }
virtual void edm::InputProductHolder::swap_ ( ProductHolderBase rhs)
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 221 of file ProductHolder.h.

References productData_, productIsUnavailable_, edm::swap(), and std::swap().

221  {
222  InputProductHolder& other = dynamic_cast<InputProductHolder&>(rhs);
223  edm::swap(productData_, other.productData_);
224  std::swap(productIsUnavailable_, other.productIsUnavailable_);
225  }
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:116
InputProductHolder(std::shared_ptr< BranchDescription const > bd, Principal *principal)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)

Member Data Documentation

Principal* edm::InputProductHolder::principal_
private

Definition at line 255 of file ProductHolder.h.

Referenced by resolveProduct_(), and setPrincipal_().

ProductData edm::InputProductHolder::productData_
private

Definition at line 252 of file ProductHolder.h.

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

bool edm::InputProductHolder::productHasBeenDeleted_
mutableprivate

Definition at line 254 of file ProductHolder.h.

Referenced by productWasDeleted_(), resetStatus_(), and setProductDeleted_().

bool edm::InputProductHolder::productIsUnavailable_
mutableprivate

Definition at line 253 of file ProductHolder.h.

Referenced by productIsUnavailable(), resetStatus_(), setProductUnavailable(), and swap_().