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
ConstBranchDescription 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< ConstBranchDescription > bd)
 
void resetProductData ()
 
void resetStatus ()
 
std::string const & resolvedModuleLabel () const
 
ProductData const * resolveProduct (ResolveStatus &resolveStatus, bool skipCurrentProcess) const
 
void setPrincipal (Principal *principal)
 
void setProcessHistoryID (ProcessHistoryID const &phid)
 
void setProductDeleted ()
 
void setProductProvenance (ProductProvenance const &prov) const
 
void setProvenance (boost::shared_ptr< BranchMapper > mapper, ProcessHistoryID const &phid, 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 ConstBranchDescription
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< ConstBranchDescription > bd)
 
virtual void resetProductData_ ()
 
virtual std::string const & resolvedModuleLabel_ () const
 
virtual void setPrincipal_ (Principal *principal)
 
virtual void setProcessHistoryID_ (ProcessHistoryID const &phid)
 
virtual void setProductDeleted_ ()
 
virtual void setProvenance_ (boost::shared_ptr< BranchMapper > mapper, ProcessHistoryID const &phid, ProductID const &pid)
 
virtual bool singleProduct_ () const
 
virtual ProductStatusstatus_ () const =0
 

Detailed Description

Definition at line 264 of file ProductHolder.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

edm::ProducedProductHolder::ProducedProductHolder ( )
inline

Definition at line 275 of file ProductHolder.h.

edm::ProducedProductHolder::~ProducedProductHolder ( )
virtual

Definition at line 31 of file ProductHolder.cc.

31 {}

Member Function Documentation

virtual ConstBranchDescription const& edm::ProducedProductHolder::branchDescription_ ( ) const
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 293 of file ProductHolder.h.

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

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

Implements edm::ProductHolderBase.

Definition at line 286 of file ProductHolder.h.

References edm::ProductHolderBase::reallyCheckType().

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

Implements edm::ProductHolderBase.

Definition at line 129 of file ProductHolder.cc.

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

131  {
132  assert(provenance()->productProvenanceValid());
133  assert(status() == Present);
134  setProductProvenance(productProvenance);
135  mergeTheProduct(edp);
136  }
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 144 of file ProductHolder.cc.

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

144  {
145  assert(status() == Present);
146  mergeTheProduct(edp);
147  }
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 321 of file ProductHolder.cc.

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

321  {
322  return provenance()->productProvenance();
323  }
ProductProvenance * productProvenance() const
Definition: Provenance.h:51
Provenance * provenance() const
bool edm::ProducedProductHolder::productUnavailable_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 292 of file ProductHolder.cc.

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

292  {
293  // If unscheduled production, the product is potentially available.
294  if(onDemand()) return false;
295  // The product is available if and only if a product has been put.
296  bool unavailable = !(product() && wrapper().isPresent());
297  return unavailable;
298  }
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:81
bool onDemand() const
Definition: ProductHolder.h:75
bool isPresent() const
Definition: WrapperHolder.h:64
WrapperHolder wrapper() const
Definition: ProductHolder.h:84
bool edm::ProducedProductHolder::productWasDeleted_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 302 of file ProductHolder.cc.

References ProductDeleted, and status().

302  {
303  return status() == ProductDeleted;
304  }
ProductStatus & status() const
bool edm::ProducedProductHolder::putOrMergeProduct_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 139 of file ProductHolder.cc.

References edm::ProductHolderBase::productUnavailable().

139  {
140  return productUnavailable();
141  }
bool productUnavailable() const
Definition: ProductHolder.h:69
void edm::ProducedProductHolder::putProduct_ ( WrapperOwningHolder const &  edp,
ProductProvenance const &  productProvenance 
)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 107 of file ProductHolder.cc.

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

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

Implements edm::ProductHolderBase.

Definition at line 150 of file ProductHolder.cc.

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

150  {
151  if(product()) {
153  << "Attempt to insert more than one product on branch " << branchDescription().branchName() << "\n";
154  }
155  assert(branchDescription().produced());
156  assert(edp.isValid());
157  assert(status() != Present);
158  assert(status() != Uninitialized);
159  if(productData().getInterface() != 0) {
160  assert(productData().getInterface()->sameType(*edp.interface()));
161  }
162  productData().wrapper_ = edp.product();
163  status_() = Present;
164  }
virtual ProductStatus & status_() const =0
ConstBranchDescription const & branchDescription() const
Definition: ProductHolder.h:93
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:81
boost::shared_ptr< void const > wrapper_
Definition: ProductData.h:50
ProductData const & productData() const
Definition: ProductHolder.h:41
eventsetup::produce::Produce produced
Definition: ESProducts.cc:21
std::string const & branchName() const
ProductStatus & status() const
virtual void edm::ProducedProductHolder::resetBranchDescription_ ( boost::shared_ptr< ConstBranchDescription bd)
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 294 of file ProductHolder.h.

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

ProductData const & productData() const
Definition: ProductHolder.h:41
void resetBranchDescription(boost::shared_ptr< ConstBranchDescription > 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 295 of file ProductHolder.h.

References edm::ProductHolderBase::moduleLabel().

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

Implements edm::ProductHolderBase.

Definition at line 334 of file ProductHolder.cc.

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

334  {
336  << "ProducedProductHolder::setPrincipal__() not implemented and should never be called.\n"
337  << "Contact a Framework developer\n";
338  }
void edm::ProducedProductHolder::setProcessHistoryID_ ( ProcessHistoryID const &  phid)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 317 of file ProductHolder.cc.

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

317  {
319  }
void setProcessHistoryID(ProcessHistoryID const &phid)
Definition: Provenance.h:86
Provenance prov_
Definition: ProductData.h:51
ProductData const & productData() const
Definition: ProductHolder.h:41
void edm::ProducedProductHolder::setProductDeleted_ ( )
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 307 of file ProductHolder.cc.

References ProductDeleted, and status().

void edm::ProducedProductHolder::setProvenance_ ( boost::shared_ptr< BranchMapper mapper,
ProcessHistoryID const &  phid,
ProductID const &  pid 
)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 311 of file ProductHolder.cc.

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

311  {
313  productData().prov_.setStore(mapper);
315  }
void setProcessHistoryID(ProcessHistoryID const &phid)
Definition: Provenance.h:86
Provenance prov_
Definition: ProductData.h:51
void setStore(boost::shared_ptr< BranchMapper > store) const
Definition: Provenance.h:84
ProductData const & productData() const
Definition: ProductHolder.h:41
void setProductID(ProductID const &pid)
Definition: Provenance.h:92
bool edm::ProducedProductHolder::singleProduct_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 330 of file ProductHolder.cc.

330  {
331  return true;
332  }
ProductStatus& edm::ProducedProductHolder::status ( void  ) const
inline
virtual ProductStatus& edm::ProducedProductHolder::status_ ( ) const
privatepure virtual