Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:04

0001 /*----------------------------------------------------------------------
0002 ----------------------------------------------------------------------*/
0003 #include "DataFormats/Common/interface/ProductData.h"
0004 
0005 #include "DataFormats/Provenance/interface/ProductID.h"
0006 #include "DataFormats/Common/interface/WrapperBase.h"
0007 #include "FWCore/Utilities/interface/do_nothing_deleter.h"
0008 
0009 #include <algorithm>
0010 
0011 namespace edm {
0012   ProductData::ProductData() : wrapper_(), prov_() {}
0013 
0014   ProductData::ProductData(std::shared_ptr<BranchDescription const> bd) : wrapper_(), prov_(bd, ProductID()) {}
0015 
0016   // For use by FWLite
0017   ProductData::ProductData(WrapperBase* product, Provenance const& prov)
0018       : wrapper_(product, do_nothing_deleter()), prov_(prov) {}
0019 
0020   void ProductData::resetBranchDescription(std::shared_ptr<BranchDescription const> bd) {
0021     prov_.setBranchDescription(bd);
0022   }
0023 
0024   void ProductData::setWrapper(std::unique_ptr<WrapperBase> iValue) { wrapper_ = std::move(iValue); }
0025 
0026   //Not const thread-safe update
0027   void ProductData::unsafe_setWrapper(std::unique_ptr<WrapperBase> iValue) const { wrapper_ = std::move(iValue); }
0028 
0029   void ProductData::unsafe_setWrapper(std::shared_ptr<WrapperBase const> iValue) const { wrapper_ = std::move(iValue); }
0030 }  // namespace edm