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 (boost::shared_ptr< BranchDescription const > bd, Principal *principal)
 
bool productIsUnavailable () const
 
void setProduct (WrapperOwningHolder const &prod) const
 
void setProductUnavailable () const
 
virtual ~InputProductHolder ()
 
- 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 &) const
 
virtual ProductData const & getProductData () const
 
virtual ProductDatagetProductData ()
 
virtual void mergeProduct_ (WrapperOwningHolder const &edp, ProductProvenance &productProvenance)
 
virtual void mergeProduct_ (WrapperOwningHolder const &edp) const
 
virtual bool onDemand_ () 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 void resetStatus_ ()
 
virtual std::string const & resolvedModuleLabel_ () const
 
virtual ProductData const * resolveProduct_ (ResolveStatus &resolveStatus, bool skipCurrentProcess, ModuleCallingContext const *mcc) 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 void swap_ (ProductHolderBase &rhs)
 

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

Constructor & Destructor Documentation

edm::InputProductHolder::InputProductHolder ( boost::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
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 247 of file ProductHolder.h.

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

247 {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::InputProductHolder::checkType_ ( WrapperOwningHolder const &  ) const
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 238 of file ProductHolder.h.

238 {}
virtual ProductData const& edm::InputProductHolder::getProductData ( ) const
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 244 of file ProductHolder.h.

References productData_.

244 {return productData_;}
virtual ProductData& edm::InputProductHolder::getProductData ( )
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 245 of file ProductHolder.h.

References productData_.

245 {return productData_;}
void edm::InputProductHolder::mergeProduct_ ( WrapperOwningHolder const &  edp,
ProductProvenance productProvenance 
)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 183 of file ProductHolder.cc.

185  {
186  assert(nullptr);
187  }
void edm::InputProductHolder::mergeProduct_ ( WrapperOwningHolder const &  edp) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 190 of file ProductHolder.cc.

References edm::ProductHolderBase::mergeTheProduct().

190  {
191  mergeTheProduct(edp);
192  }
void mergeTheProduct(WrapperOwningHolder const &edp) const
virtual bool edm::InputProductHolder::onDemand_ ( ) const
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 241 of file ProductHolder.h.

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

Definition at line 222 of file ProductHolder.h.

References productIsUnavailable_.

Referenced by productUnavailable_().

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

Implements edm::ProductHolderBase.

Definition at line 252 of file ProductHolder.cc.

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

252  {
253  return provenance()->productProvenance();
254  }
ProductProvenance * productProvenance() const
Definition: Provenance.h:49
Provenance * provenance() const
bool edm::InputProductHolder::productUnavailable_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 278 of file ProductHolder.cc.

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

278  {
279  if(productIsUnavailable()) {
280  return true;
281  }
282  // If there is a product, we know if it is real or a dummy.
283  if(product()) {
284  bool unavailable = !(wrapper().isPresent());
285  if(unavailable) {
287  }
288  return unavailable;
289  }
290  return false;
291  }
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:83
bool productIsUnavailable() const
void setProductUnavailable() const
bool isPresent() const
Definition: WrapperHolder.h:64
WrapperHolder wrapper() const
Definition: ProductHolder.h:86
virtual bool edm::InputProductHolder::productWasDeleted_ ( ) const
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 243 of file ProductHolder.h.

References productHasBeenDeleted_.

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

Implements edm::ProductHolderBase.

Definition at line 195 of file ProductHolder.cc.

References edm::ProductHolderBase::product().

195  {
196  return(!product());
197  }
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:83
void edm::InputProductHolder::putProduct_ ( WrapperOwningHolder const &  edp,
ProductProvenance const &  productProvenance 
)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 172 of file ProductHolder.cc.

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

174  {
175  assert(!product());
176  assert(!provenance()->productProvenanceValid());
177  setProductProvenance(productProvenance);
178  assert(provenance()->productProvenanceValid());
179  setProduct(edp);
180  }
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:83
Provenance * provenance() const
void setProductProvenance(ProductProvenance const &prov) const
void setProduct(WrapperOwningHolder const &prod) const
void edm::InputProductHolder::putProduct_ ( WrapperOwningHolder const &  edp) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 200 of file ProductHolder.cc.

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

200  {
201  assert(!product());
202  setProduct(edp);
203  }
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:83
void setProduct(WrapperOwningHolder const &prod) const
virtual void edm::InputProductHolder::resetBranchDescription_ ( boost::shared_ptr< BranchDescription const >  bd)
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 248 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::InputProductHolder::resetProductData_ ( )
privatevirtual
virtual void edm::InputProductHolder::resetStatus_ ( )
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 239 of file ProductHolder.h.

References productHasBeenDeleted_, and productIsUnavailable_.

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

Implements edm::ProductHolderBase.

Definition at line 249 of file ProductHolder.h.

References edm::ProductHolderBase::moduleLabel().

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

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  }
void readFromSource(ProductHolderBase const &phb, ModuleCallingContext const *mcc) const
Definition: Principal.h:184
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:83
bool productWasDeleted() const
Definition: ProductHolder.h:80
void throwProductDeletedException() const
bool productUnavailable() const
Definition: ProductHolder.h:71
void edm::InputProductHolder::setPrincipal_ ( Principal principal)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 265 of file ProductHolder.cc.

References cmsRelvalreport::principal(), and principal_.

265  {
267  }
void edm::InputProductHolder::setProcessHistory_ ( ProcessHistory const &  ph)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 248 of file ProductHolder.cc.

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

248  {
250  }
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::InputProductHolder::setProduct ( WrapperOwningHolder const &  prod) const

Definition at line 233 of file ProductHolder.cc.

References edm::ProductData::getInterface(), edm::WrapperHolder::interface(), edm::WrapperHolder::isPresent(), edm::WrapperHolder::isValid(), edm::WrapperOwningHolder::product(), edm::ProductHolderBase::product(), edm::ProductHolderBase::productData(), edm::WrapperInterfaceBase::sameType(), setProductUnavailable(), and edm::ProductData::wrapper_.

Referenced by putProduct_().

233  {
234  assert (!product());
235  if(!prod.isValid() || !prod.isPresent()) {
237  }
238  assert(!prod.isValid() || productData().getInterface()->sameType(*prod.interface()));
239  productData().wrapper_ = prod.product();
240  }
WrapperInterfaceBase const * getInterface() const
Definition: ProductData.h:25
bool sameType(WrapperInterfaceBase const &other) const
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:83
boost::shared_ptr< void const > wrapper_
Definition: ProductData.h:50
ProductData const & productData() const
Definition: ProductHolder.h:42
void setProductUnavailable() const
virtual void edm::InputProductHolder::setProductDeleted_ ( )
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 246 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_ ( boost::shared_ptr< ProductProvenanceRetriever provRetriever,
ProcessHistory const &  ph,
ProductID const &  pid 
)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 242 of file ProductHolder.cc.

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

242  {
244  productData().prov_.setStore(provRetriever);
246  }
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::InputProductHolder::singleProduct_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 261 of file ProductHolder.cc.

261  {
262  return true;
263  }
virtual void edm::InputProductHolder::swap_ ( ProductHolderBase rhs)
inlineprivatevirtual

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
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
InputProductHolder(boost::shared_ptr< BranchDescription const > bd, Principal *principal)

Member Data Documentation

Principal* edm::InputProductHolder::principal_
private

Definition at line 260 of file ProductHolder.h.

Referenced by resolveProduct_(), and setPrincipal_().

ProductData edm::InputProductHolder::productData_
private

Definition at line 257 of file ProductHolder.h.

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

bool edm::InputProductHolder::productHasBeenDeleted_
mutableprivate

Definition at line 259 of file ProductHolder.h.

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

bool edm::InputProductHolder::productIsUnavailable_
mutableprivate

Definition at line 258 of file ProductHolder.h.

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