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::ProducedProductHolder Class Referenceabstract

#include <ProductHolder.h>

Inheritance diagram for edm::ProducedProductHolder:
edm::ProductHolderBase edm::ScheduledProductHolder edm::SourceProductHolder edm::UnscheduledProductHolder

Public Types

enum  ProductStatus {
  Present = 0, NotRun = 3, NotCompleted = 4, NotPut = 5,
  UnscheduledNotRun = 6, ProductDeleted =7, Uninitialized = 0xff
}
 
- Public Types inherited from edm::ProductHolderBase
enum  ResolveStatus { ProductFound, ProductNotFound, Ambiguous }
 

Public Member Functions

 ProducedProductHolder ()
 
void producerCompleted ()
 
void producerStarted ()
 
ProductStatusstatus () const
 
virtual ~ProducedProductHolder ()
 
- 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 &prod) const 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 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 std::string const & resolvedModuleLabel_ () 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 ProductStatusstatus_ () const =0
 

Detailed Description

Definition at line 269 of file ProductHolder.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

edm::ProducedProductHolder::ProducedProductHolder ( )
inline

Definition at line 280 of file ProductHolder.h.

edm::ProducedProductHolder::~ProducedProductHolder ( )
virtual

Definition at line 31 of file ProductHolder.cc.

31 {}

Member Function Documentation

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

Implements edm::ProductHolderBase.

Definition at line 298 of file ProductHolder.h.

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

298 {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::ProducedProductHolder::checkType_ ( WrapperBase const &  prod) const
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 291 of file ProductHolder.h.

References edm::ProductHolderBase::reallyCheckType().

291  {
293  }
void reallyCheckType(WrapperBase const &prod) const
void edm::ProducedProductHolder::mergeProduct_ ( std::unique_ptr< WrapperBase edp,
ProductProvenance const &  productProvenance 
) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 139 of file ProductHolder.cc.

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

141  {
142  assert(status() == Present);
144  }
assert(m_qm.get())
def move
Definition: eostools.py:510
void mergeTheProduct(std::unique_ptr< WrapperBase > edp) const
ProductStatus & status() const
void edm::ProducedProductHolder::mergeProduct_ ( std::unique_ptr< WrapperBase edp) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 152 of file ProductHolder.cc.

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

152  {
153  assert(status() == Present);
155  }
assert(m_qm.get())
def move
Definition: eostools.py:510
void mergeTheProduct(std::unique_ptr< WrapperBase > edp) const
ProductStatus & status() const
void edm::ProducedProductHolder::producerCompleted ( )
void edm::ProducedProductHolder::producerStarted ( )
ProductProvenance const * edm::ProducedProductHolder::productProvenancePtr_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 309 of file ProductHolder.cc.

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

309  {
310  return provenance()->productProvenance();
311  }
ProductProvenance const * productProvenance() const
Definition: Provenance.cc:28
Provenance const * provenance() const
bool edm::ProducedProductHolder::productUnavailable_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 282 of file ProductHolder.cc.

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

282  {
283  // If unscheduled production, the product is potentially available.
284  if(onDemand()) return false;
285  // The product is available if and only if a product has been put.
286  bool unavailable = !(product() && product()->isPresent());
287  return unavailable;
288  }
WrapperBase const * product() const
Definition: ProductHolder.h:85
bool isPresent() const
Definition: WrapperBase.h:22
bool onDemand() const
Definition: ProductHolder.h:79
bool edm::ProducedProductHolder::productWasDeleted_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 292 of file ProductHolder.cc.

References ProductDeleted, and status().

292  {
293  return status() == ProductDeleted;
294  }
ProductStatus & status() const
bool edm::ProducedProductHolder::putOrMergeProduct_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 147 of file ProductHolder.cc.

References edm::ProductHolderBase::productUnavailable().

147  {
148  return productUnavailable();
149  }
bool productUnavailable() const
Definition: ProductHolder.h:73
void edm::ProducedProductHolder::putProduct_ ( std::unique_ptr< WrapperBase edp,
ProductProvenance const &  productProvenance 
) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 123 of file ProductHolder.cc.

References assert(), edm::ProductHolderBase::branchDescription(), edm::BranchDescription::branchName(), Exception, edm::errors::InsertFailure, eostools::move(), Present, edm::es::produced, edm::ProductHolderBase::product(), edm::ProductHolderBase::productData(), status(), status_(), Uninitialized, and edm::ProductData::unsafe_setWrapper().

125  {
126  if(product()) {
128  << "Attempt to insert more than one product on branch " << branchDescription().branchName() << "\n";
129  }
131  assert(edp.get() != nullptr);
132  assert(status() != Present);
134  productData().unsafe_setWrapper(std::move(edp)); // ProductHolder takes ownership
135  status_() = Present;
136  }
virtual ProductStatus & status_() const =0
std::string const & branchName() const
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
BranchDescription const & branchDescription() const
Definition: ProductHolder.h:93
def move
Definition: eostools.py:510
ProductData const & productData() const
Definition: ProductHolder.h:41
eventsetup::produce::Produce produced
Definition: ESProducts.cc:20
ProductStatus & status() const
void edm::ProducedProductHolder::putProduct_ ( std::unique_ptr< WrapperBase edp) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 158 of file ProductHolder.cc.

References assert(), edm::ProductHolderBase::branchDescription(), edm::BranchDescription::branchName(), Exception, edm::errors::InsertFailure, eostools::move(), Present, edm::es::produced, edm::ProductHolderBase::product(), edm::ProductHolderBase::productData(), status(), status_(), Uninitialized, and edm::ProductData::unsafe_setWrapper().

158  {
159  if(product()) {
161  << "Attempt to insert more than one product on branch " << branchDescription().branchName() << "\n";
162  }
164  assert(edp.get() != nullptr);
165  assert(status() != Present);
167  productData().unsafe_setWrapper(std::move(edp)); // ProductHolder takes ownership
168  status_() = Present;
169  }
virtual ProductStatus & status_() const =0
std::string const & branchName() const
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
BranchDescription const & branchDescription() const
Definition: ProductHolder.h:93
def move
Definition: eostools.py:510
ProductData const & productData() const
Definition: ProductHolder.h:41
eventsetup::produce::Produce produced
Definition: ESProducts.cc:20
ProductStatus & status() const
virtual void edm::ProducedProductHolder::resetBranchDescription_ ( std::shared_ptr< BranchDescription const >  bd)
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 299 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::ProducedProductHolder::resetProductData_ ( )
overrideprivatevirtual
virtual std::string const& edm::ProducedProductHolder::resolvedModuleLabel_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 300 of file ProductHolder.h.

References edm::ProductHolderBase::moduleLabel().

300 {return moduleLabel();}
std::string const & moduleLabel() const
void edm::ProducedProductHolder::setProcessHistory_ ( ProcessHistory const &  ph)
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 305 of file ProductHolder.cc.

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

305  {
307  }
void setProcessHistory(ProcessHistory const &ph)
Definition: ProductData.h:59
ProductData const & productData() const
Definition: ProductHolder.h:41
void edm::ProducedProductHolder::setProductDeleted_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 297 of file ProductHolder.cc.

References ProductDeleted, and status().

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

Implements edm::ProductHolderBase.

Definition at line 301 of file ProductHolder.cc.

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

301  {
302  productData().setProvenance(provRetriever,ph,pid);
303  }
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::ProducedProductHolder::singleProduct_ ( ) const
overrideprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 318 of file ProductHolder.cc.

318  {
319  return true;
320  }
ProductStatus& edm::ProducedProductHolder::status ( void  ) const
inline
virtual ProductStatus& edm::ProducedProductHolder::status_ ( ) const
privatepure virtual