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 (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
 
virtual void checkType_ (WrapperOwningHolder const &prod) const
 
virtual void mergeProduct_ (WrapperOwningHolder const &edp, ProductProvenance &productProvenance)
 
virtual void mergeProduct_ (WrapperOwningHolder const &edp) const
 
virtual ProductProvenanceproductProvenancePtr_ () const
 
virtual bool productUnavailable_ () const
 
virtual bool productWasDeleted_ () const
 
virtual bool putOrMergeProduct_ () const
 
virtual void putProduct_ (WrapperOwningHolder const &edp, ProductProvenance const &productProvenance)
 
virtual void putProduct_ (WrapperOwningHolder const &edp) const
 
virtual void resetBranchDescription_ (boost::shared_ptr< BranchDescription const > bd)
 
virtual void resetProductData_ ()
 
virtual std::string const & resolvedModuleLabel_ () const
 
virtual void setPrincipal_ (Principal *principal)
 
virtual void setProcessHistory_ (ProcessHistory const &ph)
 
virtual void setProductDeleted_ ()
 
virtual void setProvenance_ (boost::shared_ptr< ProductProvenanceRetriever > provRetriever, ProcessHistory const &ph, ProductID const &pid)
 
virtual bool singleProduct_ () const
 
virtual ProductStatusstatus_ () const =0
 

Detailed Description

Definition at line 268 of file ProductHolder.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

edm::ProducedProductHolder::ProducedProductHolder ( )
inline

Definition at line 279 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
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 297 of file ProductHolder.h.

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

297 {return *productData().branchDescription();}
ProductData const & productData() const
Definition: ProductHolder.h:42
boost::shared_ptr< BranchDescription const > const & branchDescription() const
Definition: ProductData.h:29
virtual void edm::ProducedProductHolder::checkType_ ( WrapperOwningHolder const &  prod) const
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 290 of file ProductHolder.h.

References edm::ProductHolderBase::reallyCheckType().

290  {
292  }
void reallyCheckType(WrapperOwningHolder const &prod) const
void edm::ProducedProductHolder::mergeProduct_ ( WrapperOwningHolder const &  edp,
ProductProvenance productProvenance 
)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 134 of file ProductHolder.cc.

References edm::ProductHolderBase::mergeTheProduct(), Present, edm::ProductHolderBase::provenance(), edm::ProductHolderBase::setProductProvenance(), and status().

136  {
137  assert(provenance()->productProvenanceValid());
138  assert(status() == Present);
139  setProductProvenance(productProvenance);
140  mergeTheProduct(edp);
141  }
Provenance * provenance() const
void mergeTheProduct(WrapperOwningHolder const &edp) const
void setProductProvenance(ProductProvenance const &prov) const
ProductStatus & status() const
void edm::ProducedProductHolder::mergeProduct_ ( WrapperOwningHolder const &  edp) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 149 of file ProductHolder.cc.

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

149  {
150  assert(status() == Present);
151  mergeTheProduct(edp);
152  }
void mergeTheProduct(WrapperOwningHolder const &edp) const
ProductStatus & status() const
void edm::ProducedProductHolder::producerCompleted ( )
void edm::ProducedProductHolder::producerStarted ( )
ProductProvenance * edm::ProducedProductHolder::productProvenancePtr_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 326 of file ProductHolder.cc.

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

326  {
327  return provenance()->productProvenance();
328  }
ProductProvenance * productProvenance() const
Definition: Provenance.h:49
Provenance * provenance() const
bool edm::ProducedProductHolder::productUnavailable_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 297 of file ProductHolder.cc.

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

297  {
298  // If unscheduled production, the product is potentially available.
299  if(onDemand()) return false;
300  // The product is available if and only if a product has been put.
301  bool unavailable = !(product() && wrapper().isPresent());
302  return unavailable;
303  }
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:83
bool onDemand() const
Definition: ProductHolder.h:77
bool isPresent() const
Definition: WrapperHolder.h:64
WrapperHolder wrapper() const
Definition: ProductHolder.h:86
bool edm::ProducedProductHolder::productWasDeleted_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 307 of file ProductHolder.cc.

References ProductDeleted, and status().

307  {
308  return status() == ProductDeleted;
309  }
ProductStatus & status() const
bool edm::ProducedProductHolder::putOrMergeProduct_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 144 of file ProductHolder.cc.

References edm::ProductHolderBase::productUnavailable().

144  {
145  return productUnavailable();
146  }
bool productUnavailable() const
Definition: ProductHolder.h:71
void edm::ProducedProductHolder::putProduct_ ( WrapperOwningHolder const &  edp,
ProductProvenance const &  productProvenance 
)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 112 of file ProductHolder.cc.

References edm::ProductHolderBase::branchDescription(), edm::BranchDescription::branchName(), edm::hlt::Exception, edm::errors::InsertFailure, edm::WrapperHolder::interface(), edm::WrapperHolder::isValid(), Present, edm::es::produced, edm::WrapperOwningHolder::product(), edm::ProductHolderBase::product(), edm::ProductHolderBase::productData(), edm::ProductHolderBase::provenance(), edm::ProductHolderBase::setProductProvenance(), status(), status_(), Uninitialized, and edm::ProductData::wrapper_.

114  {
115  if(product()) {
117  << "Attempt to insert more than one product on branch " << branchDescription().branchName() << "\n";
118  }
119  assert(branchDescription().produced());
120  assert(edp.isValid());
121  assert(!provenance()->productProvenanceValid());
122  assert(status() != Present);
123  assert(status() != Uninitialized);
124  setProductProvenance(productProvenance);
125  assert(provenance()->productProvenanceValid());
126  if(productData().getInterface() != 0) {
127  assert(productData().getInterface()->sameType(*edp.interface()));
128  }
129  productData().wrapper_ = edp.product();
130  status_() = Present;
131  }
virtual ProductStatus & status_() const =0
std::string const & branchName() const
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:83
Provenance * provenance() const
BranchDescription const & branchDescription() const
Definition: ProductHolder.h:95
boost::shared_ptr< void const > wrapper_
Definition: ProductData.h:50
ProductData const & productData() const
Definition: ProductHolder.h:42
void setProductProvenance(ProductProvenance const &prov) const
eventsetup::produce::Produce produced
Definition: ESProducts.cc:20
ProductStatus & status() const
void edm::ProducedProductHolder::putProduct_ ( WrapperOwningHolder const &  edp) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 155 of file ProductHolder.cc.

References edm::ProductHolderBase::branchDescription(), edm::BranchDescription::branchName(), edm::hlt::Exception, edm::errors::InsertFailure, edm::WrapperHolder::interface(), edm::WrapperHolder::isValid(), Present, edm::es::produced, edm::WrapperOwningHolder::product(), edm::ProductHolderBase::product(), edm::ProductHolderBase::productData(), status(), status_(), Uninitialized, and edm::ProductData::wrapper_.

155  {
156  if(product()) {
158  << "Attempt to insert more than one product on branch " << branchDescription().branchName() << "\n";
159  }
160  assert(branchDescription().produced());
161  assert(edp.isValid());
162  assert(status() != Present);
163  assert(status() != Uninitialized);
164  if(productData().getInterface() != 0) {
165  assert(productData().getInterface()->sameType(*edp.interface()));
166  }
167  productData().wrapper_ = edp.product();
168  status_() = Present;
169  }
virtual ProductStatus & status_() const =0
std::string const & branchName() const
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:83
BranchDescription const & branchDescription() const
Definition: ProductHolder.h:95
boost::shared_ptr< void const > wrapper_
Definition: ProductData.h:50
ProductData const & productData() const
Definition: ProductHolder.h:42
eventsetup::produce::Produce produced
Definition: ESProducts.cc:20
ProductStatus & status() const
virtual void edm::ProducedProductHolder::resetBranchDescription_ ( boost::shared_ptr< BranchDescription const >  bd)
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 298 of file ProductHolder.h.

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

ProductData const & productData() const
Definition: ProductHolder.h:42
void resetBranchDescription(boost::shared_ptr< BranchDescription const > bd)
Definition: ProductData.cc:26
void edm::ProducedProductHolder::resetProductData_ ( )
privatevirtual
virtual std::string const& edm::ProducedProductHolder::resolvedModuleLabel_ ( ) const
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 299 of file ProductHolder.h.

References edm::ProductHolderBase::moduleLabel().

299 {return moduleLabel();}
std::string const & moduleLabel() const
void edm::ProducedProductHolder::setPrincipal_ ( Principal principal)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 339 of file ProductHolder.cc.

References edm::hlt::Exception, and edm::errors::LogicError.

339  {
341  << "ProducedProductHolder::setPrincipal__() not implemented and should never be called.\n"
342  << "Contact a Framework developer\n";
343  }
void edm::ProducedProductHolder::setProcessHistory_ ( ProcessHistory const &  ph)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 322 of file ProductHolder.cc.

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

322  {
324  }
Provenance prov_
Definition: ProductData.h:51
ProductData const & productData() const
Definition: ProductHolder.h:42
void setProcessHistory(ProcessHistory const &ph)
Definition: Provenance.h:76
void edm::ProducedProductHolder::setProductDeleted_ ( )
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 312 of file ProductHolder.cc.

References ProductDeleted, and status().

void edm::ProducedProductHolder::setProvenance_ ( boost::shared_ptr< ProductProvenanceRetriever provRetriever,
ProcessHistory const &  ph,
ProductID const &  pid 
)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 316 of file ProductHolder.cc.

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

316  {
318  productData().prov_.setStore(provRetriever);
320  }
void setStore(boost::shared_ptr< ProductProvenanceRetriever > store) const
Definition: Provenance.h:74
Provenance prov_
Definition: ProductData.h:51
ProductData const & productData() const
Definition: ProductHolder.h:42
tuple pid
Definition: sysUtil.py:22
void setProductID(ProductID const &pid)
Definition: Provenance.h:82
void setProcessHistory(ProcessHistory const &ph)
Definition: Provenance.h:76
bool edm::ProducedProductHolder::singleProduct_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 335 of file ProductHolder.cc.

335  {
336  return true;
337  }
ProductStatus& edm::ProducedProductHolder::status ( void  ) const
inline
virtual ProductStatus& edm::ProducedProductHolder::status_ ( ) const
privatepure virtual