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)
 
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 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 &) 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

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 211 of file ProductHolder.h.

Constructor & Destructor Documentation

edm::InputProductHolder::InputProductHolder ( std::shared_ptr< BranchDescription const >  bd)
inlineexplicit

Definition at line 213 of file ProductHolder.h.

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 250 of file ProductHolder.h.

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

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

Implements edm::ProductHolderBase.

Definition at line 241 of file ProductHolder.h.

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

Implements edm::ProductHolderBase.

Definition at line 247 of file ProductHolder.h.

References productData_.

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

Implements edm::ProductHolderBase.

Definition at line 248 of file ProductHolder.h.

References productData_.

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

Implements edm::ProductHolderBase.

Definition at line 180 of file ProductHolder.cc.

References assert().

182  {
183  assert(nullptr);
184  }
assert(m_qm.get())
void edm::InputProductHolder::mergeProduct_ ( std::unique_ptr< WrapperBase edp) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 187 of file ProductHolder.cc.

References edm::ProductHolderBase::mergeTheProduct(), and eostools::move().

187  {
189  }
def move
Definition: eostools.py:510
void mergeTheProduct(std::unique_ptr< WrapperBase > edp) const
virtual bool edm::InputProductHolder::onDemand_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 244 of file ProductHolder.h.

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

Definition at line 222 of file ProductHolder.h.

References productIsUnavailable_.

Referenced by productUnavailable_().

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

Implements edm::ProductHolderBase.

Definition at line 246 of file ProductHolder.cc.

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

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

Implements edm::ProductHolderBase.

Definition at line 263 of file ProductHolder.cc.

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

263  {
264  if(productIsUnavailable()) {
265  return true;
266  }
267  // If there is a product, we know if it is real or a dummy.
268  if(product()) {
269  bool unavailable = !(product()->isPresent());
270  if(unavailable) {
272  }
273  return unavailable;
274  }
275  return false;
276  }
WrapperBase const * product() const
Definition: ProductHolder.h:85
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 246 of file ProductHolder.h.

References productHasBeenDeleted_.

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

Implements edm::ProductHolderBase.

Definition at line 192 of file ProductHolder.cc.

References edm::ProductHolderBase::product().

192  {
193  return(!product());
194  }
WrapperBase const * product() const
Definition: ProductHolder.h:85
void edm::InputProductHolder::putProduct_ ( std::unique_ptr< WrapperBase edp,
ProductProvenance const &  productProvenance 
) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 172 of file ProductHolder.cc.

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

174  {
175  assert(!product());
176  setProduct(std::move(edp));
177  }
void setProduct(std::unique_ptr< WrapperBase > prod) const
WrapperBase const * product() const
Definition: ProductHolder.h:85
assert(m_qm.get())
def move
Definition: eostools.py:510
void edm::InputProductHolder::putProduct_ ( std::unique_ptr< WrapperBase edp) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 197 of file ProductHolder.cc.

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

197  {
198  assert(!product());
199  setProduct(std::move(edp));
200  }
void setProduct(std::unique_ptr< WrapperBase > prod) const
WrapperBase const * product() const
Definition: ProductHolder.h:85
assert(m_qm.get())
def move
Definition: eostools.py:510
virtual void edm::InputProductHolder::resetBranchDescription_ ( std::shared_ptr< BranchDescription const >  bd)
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 251 of file ProductHolder.h.

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

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

Implements edm::ProductHolderBase.

Definition at line 242 of file ProductHolder.h.

References productHasBeenDeleted_, and productIsUnavailable_.

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

Implements edm::ProductHolderBase.

Definition at line 252 of file ProductHolder.h.

References edm::ProductHolderBase::moduleLabel().

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

Implements edm::ProductHolderBase.

Definition at line 39 of file ProductHolder.cc.

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

43  {
44  if(productWasDeleted()) {
46  }
47  if(!productUnavailable()) {
48  principal.readFromSource(*this, mcc);
49  // If the product is a dummy filler, product holder will now be marked unavailable.
50  if(product() && !productUnavailable()) {
51  // Found the match
52  resolveStatus = ProductFound;
53  return &productData_;
54  }
55  }
56  resolveStatus = ProductNotFound;
57  return nullptr;
58  }
WrapperBase const * product() const
Definition: ProductHolder.h:85
bool productWasDeleted() const
Definition: ProductHolder.h:82
void throwProductDeletedException() const
bool productUnavailable() const
Definition: ProductHolder.h:73
void edm::InputProductHolder::setProcessHistory_ ( ProcessHistory const &  ph)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 242 of file ProductHolder.cc.

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

242  {
244  }
void setProcessHistory(ProcessHistory const &ph)
Definition: ProductData.h:59
ProductData const & productData() const
Definition: ProductHolder.h:41
void edm::InputProductHolder::setProduct ( std::unique_ptr< WrapperBase prod) const

Definition at line 230 of file ProductHolder.cc.

References assert(), eostools::move(), edm::ProductHolderBase::product(), edm::ProductHolderBase::productData(), setProductUnavailable(), and edm::ProductData::unsafe_setWrapper().

Referenced by putProduct_().

230  {
231  assert (!product());
232  if(prod.get() == nullptr || !prod->isPresent()) {
234  }
235  productData().unsafe_setWrapper(std::move(prod)); // ProductHolder takes ownership
236  }
WrapperBase const * product() const
Definition: ProductHolder.h:85
assert(m_qm.get())
void unsafe_setWrapper(std::unique_ptr< WrapperBase > iValue) const
Definition: ProductData.cc:36
def move
Definition: eostools.py:510
ProductData const & productData() const
Definition: ProductHolder.h:41
void setProductUnavailable() const
virtual void edm::InputProductHolder::setProductDeleted_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 249 of file ProductHolder.h.

References productHasBeenDeleted_.

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

Definition at line 223 of file ProductHolder.h.

References productIsUnavailable_.

Referenced by productUnavailable_(), and setProduct().

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

Implements edm::ProductHolderBase.

Definition at line 238 of file ProductHolder.cc.

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

238  {
239  productData().setProvenance(provRetriever,ph,pid);
240  }
void setProvenance(ProductProvenanceRetriever const *provRetriever, ProcessHistory const &ph, ProductID const &pid)
Definition: ProductData.h:63
ProductData const & productData() const
Definition: ProductHolder.h:41
tuple pid
Definition: sysUtil.py:22
bool edm::InputProductHolder::singleProduct_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 255 of file ProductHolder.cc.

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

Implements edm::ProductHolderBase.

Definition at line 226 of file ProductHolder.h.

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

226  {
227  InputProductHolder& other = dynamic_cast<InputProductHolder&>(rhs);
228  edm::swap(productData_, other.productData_);
229  std::swap(productIsUnavailable_, other.productIsUnavailable_);
230  }
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:116
InputProductHolder(std::shared_ptr< BranchDescription const > bd)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)

Member Data Documentation

ProductData edm::InputProductHolder::productData_
private

Definition at line 259 of file ProductHolder.h.

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

bool edm::InputProductHolder::productHasBeenDeleted_
mutableprivate

Definition at line 261 of file ProductHolder.h.

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

bool edm::InputProductHolder::productIsUnavailable_
mutableprivate

Definition at line 260 of file ProductHolder.h.

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