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< ConstBranchDescription > bd, Principal *principal)
 
bool productIsUnavailable () const
 
void setProduct (WrapperOwningHolder const &prod) const
 
void setProductUnavailable () const
 
virtual ~InputProductHolder ()
 
- 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 &) 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< ConstBranchDescription > bd)
 
virtual void resetProductData_ ()
 
virtual void resetStatus_ ()
 
virtual std::string const & resolvedModuleLabel_ () const
 
virtual ProductData const * resolveProduct_ (ResolveStatus &resolveStatus, bool skipCurrentProcess) 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 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 208 of file ProductHolder.h.

Constructor & Destructor Documentation

edm::InputProductHolder::InputProductHolder ( boost::shared_ptr< ConstBranchDescription bd,
Principal principal 
)
inlineexplicit
edm::InputProductHolder::~InputProductHolder ( )
virtual

Definition at line 30 of file ProductHolder.cc.

30 {}

Member Function Documentation

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

Implements edm::ProductHolderBase.

Definition at line 243 of file ProductHolder.h.

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

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

Implements edm::ProductHolderBase.

Definition at line 234 of file ProductHolder.h.

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

Implements edm::ProductHolderBase.

Definition at line 240 of file ProductHolder.h.

References productData_.

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

Implements edm::ProductHolderBase.

Definition at line 241 of file ProductHolder.h.

References productData_.

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

Implements edm::ProductHolderBase.

Definition at line 178 of file ProductHolder.cc.

180  {
181  assert(nullptr);
182  }
void edm::InputProductHolder::mergeProduct_ ( WrapperOwningHolder const &  edp) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 185 of file ProductHolder.cc.

References edm::ProductHolderBase::mergeTheProduct().

185  {
186  mergeTheProduct(edp);
187  }
void mergeTheProduct(WrapperOwningHolder const &edp) const
virtual bool edm::InputProductHolder::onDemand_ ( ) const
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 237 of file ProductHolder.h.

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

Definition at line 219 of file ProductHolder.h.

References productIsUnavailable_.

Referenced by productUnavailable_().

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

Implements edm::ProductHolderBase.

Definition at line 247 of file ProductHolder.cc.

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

247  {
248  return provenance()->productProvenance();
249  }
ProductProvenance * productProvenance() const
Definition: Provenance.h:51
Provenance * provenance() const
bool edm::InputProductHolder::productUnavailable_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 273 of file ProductHolder.cc.

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

273  {
274  if(productIsUnavailable()) {
275  return true;
276  }
277  // If there is a product, we know if it is real or a dummy.
278  if(product()) {
279  bool unavailable = !(wrapper().isPresent());
280  if(unavailable) {
282  }
283  return unavailable;
284  }
285  return false;
286  }
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:81
bool productIsUnavailable() const
void setProductUnavailable() const
bool isPresent() const
Definition: WrapperHolder.h:64
WrapperHolder wrapper() const
Definition: ProductHolder.h:84
virtual bool edm::InputProductHolder::productWasDeleted_ ( ) const
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 239 of file ProductHolder.h.

References productHasBeenDeleted_.

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

Implements edm::ProductHolderBase.

Definition at line 190 of file ProductHolder.cc.

References edm::ProductHolderBase::product().

190  {
191  return(!product());
192  }
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:81
void edm::InputProductHolder::putProduct_ ( WrapperOwningHolder const &  edp,
ProductProvenance const &  productProvenance 
)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 167 of file ProductHolder.cc.

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

169  {
170  assert(!product());
171  assert(!provenance()->productProvenanceValid());
172  setProductProvenance(productProvenance);
173  assert(provenance()->productProvenanceValid());
174  setProduct(edp);
175  }
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:81
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 195 of file ProductHolder.cc.

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

195  {
196  assert(!product());
197  setProduct(edp);
198  }
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:81
void setProduct(WrapperOwningHolder const &prod) const
virtual void edm::InputProductHolder::resetBranchDescription_ ( boost::shared_ptr< ConstBranchDescription bd)
inlineprivatevirtual

Implements edm::ProductHolderBase.

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

Implements edm::ProductHolderBase.

Definition at line 235 of file ProductHolder.h.

References productHasBeenDeleted_, and productIsUnavailable_.

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

Implements edm::ProductHolderBase.

Definition at line 245 of file ProductHolder.h.

References edm::ProductHolderBase::moduleLabel().

245 {return moduleLabel();}
std::string const & moduleLabel() const
ProductData const * edm::InputProductHolder::resolveProduct_ ( ResolveStatus resolveStatus,
bool  skipCurrentProcess 
) 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::resolveProduct(), and edm::ProductHolderBase::throwProductDeletedException().

39  {
40  if(productWasDeleted()) {
42  }
43  if(!productUnavailable()) {
44  principal_->resolveProduct(*this, false);
45  // If the product is a dummy filler, product holder will now be marked unavailable.
46  if(product() && !productUnavailable()) {
47  // Found the match
48  resolveStatus = ProductFound;
49  return &productData_;
50  }
51  }
52  resolveStatus = ProductNotFound;
53  return nullptr;
54  }
void resolveProduct(ProductHolderBase const &phb, bool fillOnDemand) const
Definition: Principal.h:167
boost::shared_ptr< void const > product() const
Definition: ProductHolder.h:81
bool productWasDeleted() const
Definition: ProductHolder.h:78
void throwProductDeletedException() const
bool productUnavailable() const
Definition: ProductHolder.h:69
void edm::InputProductHolder::setPrincipal_ ( Principal principal)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 260 of file ProductHolder.cc.

References cmsRelvalreport::principal(), and principal_.

260  {
262  }
void edm::InputProductHolder::setProcessHistoryID_ ( ProcessHistoryID const &  phid)
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 243 of file ProductHolder.cc.

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

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

Definition at line 228 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_().

228  {
229  assert (!product());
230  if(!prod.isValid() || !prod.isPresent()) {
232  }
233  assert(!prod.isValid() || productData().getInterface()->sameType(*prod.interface()));
234  productData().wrapper_ = prod.product();
235  }
WrapperInterfaceBase const * getInterface() const
Definition: ProductData.h:25
bool sameType(WrapperInterfaceBase const &other) const
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
void setProductUnavailable() const
virtual void edm::InputProductHolder::setProductDeleted_ ( )
inlineprivatevirtual

Implements edm::ProductHolderBase.

Definition at line 242 of file ProductHolder.h.

References productHasBeenDeleted_.

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

Definition at line 220 of file ProductHolder.h.

References productIsUnavailable_.

Referenced by productUnavailable_(), and setProduct().

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

Implements edm::ProductHolderBase.

Definition at line 237 of file ProductHolder.cc.

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

237  {
239  productData().prov_.setStore(mapper);
241  }
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::InputProductHolder::singleProduct_ ( ) const
privatevirtual

Implements edm::ProductHolderBase.

Definition at line 256 of file ProductHolder.cc.

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

Implements edm::ProductHolderBase.

Definition at line 223 of file ProductHolder.h.

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

223  {
224  InputProductHolder& other = dynamic_cast<InputProductHolder&>(rhs);
225  edm::swap(productData_, other.productData_);
226  std::swap(productIsUnavailable_, other.productIsUnavailable_);
227  }
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
InputProductHolder(boost::shared_ptr< ConstBranchDescription > bd, Principal *principal)

Member Data Documentation

Principal* edm::InputProductHolder::principal_
private

Definition at line 256 of file ProductHolder.h.

Referenced by resolveProduct_(), and setPrincipal_().

ProductData edm::InputProductHolder::productData_
private

Definition at line 253 of file ProductHolder.h.

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

bool edm::InputProductHolder::productHasBeenDeleted_
mutableprivate

Definition at line 255 of file ProductHolder.h.

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

bool edm::InputProductHolder::productIsUnavailable_
mutableprivate

Definition at line 254 of file ProductHolder.h.

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