Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move away from boost shared_ptrs #27841

Merged
merged 6 commits into from
Sep 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void AlignmentMonitorAsAnalyzer::analyze(const edm::Event& iEvent, const edm::Ev
edm::ESHandle<PTrackerParameters> ptp;
iSetup.get<PTrackerParametersRcd>().get(ptp);
TrackerGeomBuilderFromGeometricDet trackerBuilder;
boost::shared_ptr<TrackerGeometry> theTracker(trackerBuilder.build(&(*theGeometricDet), *ptp, tTopo));
std::shared_ptr<TrackerGeometry> theTracker(trackerBuilder.build(&(*theGeometricDet), *ptp, tTopo));

edm::ESHandle<MuonDDDConstants> mdc;
iSetup.get<MuonNumberingRecord>().get(mdc);
Expand Down
4 changes: 2 additions & 2 deletions Alignment/MuonAlignment/test/TestRotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ void TestRotation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet
DTGeometryBuilderFromDDD DTGeometryBuilder;
CSCGeometryBuilderFromDDD CSCGeometryBuilder;

theDTGeometry = boost::shared_ptr<DTGeometry>( DTGeometryBuilder.build( &(*cpv) ) );
theCSCGeometry = boost::shared_ptr<CSCGeometry>( CSCGeometryBuilder.build( &(*cpv) ) );
theDTGeometry = std::shared_ptr<DTGeometry>( DTGeometryBuilder.build( &(*cpv) ) );
theCSCGeometry = std::shared_ptr<CSCGeometry>( CSCGeometryBuilder.build( &(*cpv) ) );

AlignableMuon* theAlignableMuon = new AlignableMuon( &(*theDTGeometry) , &(*theCSCGeometry) );
*/
Expand Down
4 changes: 2 additions & 2 deletions Alignment/MuonAlignment/test/TestTranslation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ void TestTranslation::analyze(const edm::Event& iEvent, const edm::EventSetup& i
DTGeometryBuilderFromDDD DTGeometryBuilder;
CSCGeometryBuilderFromDDD CSCGeometryBuilder;

theDTGeometry = boost::shared_ptr<DTGeometry>( DTGeometryBuilder.build( &(*cpv) ) );
theCSCGeometry = boost::shared_ptr<CSCGeometry>( CSCGeometryBuilder.build( &(*cpv) ) );
theDTGeometry = std::shared_ptr<DTGeometry>( DTGeometryBuilder.build( &(*cpv) ) );
theCSCGeometry = std::shared_ptr<CSCGeometry>( CSCGeometryBuilder.build( &(*cpv) ) );

AlignableMuon* theAlignableMuon = new AlignableMuon( &(*theDTGeometry) , &(*theCSCGeometry) );
*/
Expand Down
1 change: 0 additions & 1 deletion CalibCalorimetry/HcalTPGAlgos/interface/HcalEmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <vector>
#include <cstring>
#include <fstream>
#include <boost/shared_ptr.hpp>

#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"

Expand Down
1 change: 0 additions & 1 deletion CalibCalorimetry/HcalTPGAlgos/interface/XMLDOMBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
// Created: Thu Sep 27 01:46:46 CEST 2007
//

#include <boost/shared_ptr.hpp>
#include <string>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/sax/HandlerBase.hpp>
Expand Down
10 changes: 5 additions & 5 deletions CalibFormats/CaloTPG/interface/CaloTPGTranscoder.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef CALIBFORMATS_CALOTPG_CALOTPGTRANSCODER_H
#define CALIBFORMATS_CALOTPG_CALOTPGTRANSCODER_H 1

#include <boost/shared_ptr.hpp>
#include "DataFormats/HcalDetId/interface/HcalTrigTowerDetId.h"
#include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h"
#include "DataFormats/HcalDigi/interface/HcalTriggerPrimitiveSample.h"
#include "DataFormats/EcalDigi/interface/EcalTriggerPrimitiveSample.h"
#include <memory>

class HcalTPGCompressor;
class EcalTPGCompressor;
Expand Down Expand Up @@ -52,12 +52,12 @@ class CaloTPGTranscoder {

virtual double hcaletValue(const int& ieta, const int& iphi, const int& version, const int& compressedValue) const = 0;
virtual double hcaletValue(const HcalTrigTowerDetId& hid, const HcalTriggerPrimitiveSample& hc) const = 0;
boost::shared_ptr<const HcalTPGCompressor> getHcalCompressor() const { return hccompress_; }
boost::shared_ptr<const EcalTPGCompressor> getEcalCompressor() const { return eccompress_; }
std::shared_ptr<const HcalTPGCompressor> getHcalCompressor() const { return hccompress_; }
std::shared_ptr<const EcalTPGCompressor> getEcalCompressor() const { return eccompress_; }

private:
boost::shared_ptr<const HcalTPGCompressor> hccompress_;
boost::shared_ptr<const EcalTPGCompressor> eccompress_;
std::shared_ptr<const HcalTPGCompressor> hccompress_;
std::shared_ptr<const EcalTPGCompressor> eccompress_;
};

#endif
3 changes: 1 addition & 2 deletions CalibTracker/SiStripQuality/interface/SiStripQualityHistos.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#ifndef SiStripQualityHistos_H
#define SiStripQualityHistos_H

#include "boost/shared_ptr.hpp"
#include <ext/hash_map>
#include "TH1F.h"

namespace SiStrip {
typedef __gnu_cxx::hash_map<unsigned int, boost::shared_ptr<TH1F> > QualityHistosMap;
typedef __gnu_cxx::hash_map<unsigned int, std::shared_ptr<TH1F> > QualityHistosMap;
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

#include "CalibFormats/SiStripObjects/interface/SiStripQuality.h"

#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/TrackerRecHit2D/interface/ProjectedSiStripRecHit2D.h"
#include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h"
#include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
#include "Geometry/Records/interface/TrackerTopologyRcd.h"
#include <iostream>
#include <fstream>
#include <iostream>
#include <memory>
#include <sstream>

//Insert here the include to the algos
Expand Down Expand Up @@ -129,7 +130,7 @@ void SiStripQualityHotStripIdentifier::bookHistos() {
SiStrip::QualityHistosMap::iterator ref = ClusterPositionHistoMap.find(it->first);
if (ref == ClusterPositionHistoMap.end()) {
ClusterPositionHistoMap[it->first] =
boost::shared_ptr<TH1F>(new TH1F(hname, hname, it->second.nApvs * 128, -0.5, it->second.nApvs * 128 - 0.5));
std::make_shared<TH1F>(hname, hname, it->second.nApvs * 128, -0.5, it->second.nApvs * 128 - 0.5);
} else
edm::LogError("SiStripQualityHotStripIdentifier")
<< " [SiStripQualityHotStripIdentifier::bookHistos] DetId " << it->first
Expand Down
2 changes: 1 addition & 1 deletion Calibration/IsolatedParticles/plugins/IsoTrig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ void IsoTrig::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
<< mybxlumi;
if (!triggerResults.isValid()) {
edm::LogWarning("IsoTrack") << "Error! Can't get the product triggerResults";
// boost::shared_ptr<cms::Exception> const & error = triggerResults.whyFailed();
// std::shared_ptr<cms::Exception> const & error = triggerResults.whyFailed();
// edm::LogWarning(error->category()) << error->what();
} else {
std::vector<std::string> modules;
Expand Down
9 changes: 3 additions & 6 deletions CaloOnlineTools/HcalOnlineDb/interface/LMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
Description: interface to the HCAL logical map

Usage:
#include <boost/boost::shared_ptr.hpp>

boost::shared_ptr<LMap> the_map(new LMap);
std::shared_ptr<LMap> the_map(new LMap);
the_map -> read( "your-accessor-string", "optional map type" );

*/
Expand All @@ -25,7 +23,6 @@
#include <vector>
#include <cstring>
#include <fstream>
#include <boost/shared_ptr.hpp>

#include "CaloOnlineTools/HcalOnlineDb/interface/ConfigurationDatabase.hh"
#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
Expand Down Expand Up @@ -77,7 +74,7 @@ class LMap {

private:
class impl;
boost::shared_ptr<impl> p_impl;
std::shared_ptr<impl> p_impl;
};

class EMap {
Expand Down Expand Up @@ -135,7 +132,7 @@ class LMap_test {
int test_read(std::string accessor, std::string type = "HBEF");

private:
boost::shared_ptr<LMap> _lmap;
std::shared_ptr<LMap> _lmap;
};

class EMap_test {
Expand Down
13 changes: 6 additions & 7 deletions CommonTools/Utils/src/BinarySelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,20 @@
#include "CommonTools/Utils/src/SelectorBase.h"
#include "CommonTools/Utils/src/ExpressionBase.h"
#include "CommonTools/Utils/src/ComparisonBase.h"
#include <boost/shared_ptr.hpp>

namespace reco {
namespace parser {
struct BinarySelector : public SelectorBase {
BinarySelector(boost::shared_ptr<ExpressionBase> lhs,
boost::shared_ptr<ComparisonBase> cmp,
boost::shared_ptr<ExpressionBase> rhs)
BinarySelector(std::shared_ptr<ExpressionBase> lhs,
std::shared_ptr<ComparisonBase> cmp,
std::shared_ptr<ExpressionBase> rhs)
: lhs_(lhs), cmp_(cmp), rhs_(rhs) {}
bool operator()(const edm::ObjectWithDict& o) const override {
return cmp_->compare(lhs_->value(o), rhs_->value(o));
}
boost::shared_ptr<ExpressionBase> lhs_;
boost::shared_ptr<ComparisonBase> cmp_;
boost::shared_ptr<ExpressionBase> rhs_;
std::shared_ptr<ExpressionBase> lhs_;
std::shared_ptr<ComparisonBase> cmp_;
std::shared_ptr<ExpressionBase> rhs_;
};
} // namespace parser
} // namespace reco
Expand Down
7 changes: 3 additions & 4 deletions CommonTools/Utils/src/BinarySelectorSetter.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "CommonTools/Utils/src/ExpressionStack.h"
#include "CommonTools/Utils/src/BinarySelector.h"
#include "CommonTools/Utils/interface/Exception.h"
#include <boost/shared_ptr.hpp>

namespace reco {
namespace parser {
Expand All @@ -30,11 +29,11 @@ namespace reco {
if (cmpStack_.empty())
throw Exception(begin) << "Grammar error: empty comparator stack. Please contact developer."
<< "\"";
boost::shared_ptr<ExpressionBase> rhs = expStack_.back();
std::shared_ptr<ExpressionBase> rhs = expStack_.back();
expStack_.pop_back();
boost::shared_ptr<ExpressionBase> lhs = expStack_.back();
std::shared_ptr<ExpressionBase> lhs = expStack_.back();
expStack_.pop_back();
boost::shared_ptr<ComparisonBase> comp = cmpStack_.back();
std::shared_ptr<ComparisonBase> comp = cmpStack_.back();
cmpStack_.pop_back();
#ifdef BOOST_SPIRIT_DEBUG
BOOST_SPIRIT_DEBUG_OUT << "pushing binary selector" << std::endl;
Expand Down
3 changes: 2 additions & 1 deletion CommonTools/Utils/src/ComparisonSetter.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <iostream>
#include <string>
#endif
#include <memory>

namespace reco {
namespace parser {
Expand All @@ -33,7 +34,7 @@ namespace reco {
#ifdef BOOST_SPIRIT_DEBUG
BOOST_SPIRIT_DEBUG_OUT << "pushing comparison: " << cmp_out<CompT>::value << std::endl;
#endif
stack_.push_back(boost::shared_ptr<ComparisonBase>(new Comparison<CompT>()));
stack_.push_back(std::shared_ptr<ComparisonBase>(new Comparison<CompT>()));
}

private:
Expand Down
5 changes: 3 additions & 2 deletions CommonTools/Utils/src/ComparisonStack.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
* \version $Revision: 1.2 $
*
*/
#include <boost/shared_ptr.hpp>

#include <vector>
#include <memory>

namespace reco {
namespace parser {
struct ComparisonBase;
typedef std::vector<boost::shared_ptr<ComparisonBase> > ComparisonStack;
typedef std::vector<std::shared_ptr<ComparisonBase> > ComparisonStack;
} // namespace parser
} // namespace reco

Expand Down
5 changes: 3 additions & 2 deletions CommonTools/Utils/src/ExpressionBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
* adapted by Luca Lista, INFN
*
*/
#include <boost/shared_ptr.hpp>

#include <vector>
#include <memory>

namespace edm {
class ObjectWithDict;
Expand All @@ -21,7 +22,7 @@ namespace reco {
virtual ~ExpressionBase() {}
virtual double value(const edm::ObjectWithDict&) const = 0;
};
typedef boost::shared_ptr<ExpressionBase> ExpressionPtr;
typedef std::shared_ptr<ExpressionBase> ExpressionPtr;
} // namespace parser
} // namespace reco

Expand Down
5 changes: 3 additions & 2 deletions CommonTools/Utils/src/ExpressionPtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
* \version $Revision: 1.2 $
*
*/
#include <boost/shared_ptr.hpp>

#include <memory>

namespace reco {
namespace parser {
struct ExpressionBase;
typedef boost::shared_ptr<ExpressionBase> ExpressionPtr;
typedef std::shared_ptr<ExpressionBase> ExpressionPtr;
} // namespace parser
} // namespace reco

Expand Down
8 changes: 4 additions & 4 deletions CommonTools/Utils/src/ExpressionSelectorSetter.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "CommonTools/Utils/src/ExpressionNumber.h"
#include "CommonTools/Utils/src/Comparison.h"
#include "CommonTools/Utils/interface/Exception.h"
#include <boost/shared_ptr.hpp>

#include <functional>

namespace reco {
Expand All @@ -30,10 +30,10 @@ namespace reco {
if (expStack_.empty())
throw Exception(begin) << "Grammar error: empty expression stack. Please contact developer."
<< "\"";
boost::shared_ptr<ExpressionBase> rhs = expStack_.back();
std::shared_ptr<ExpressionBase> rhs = expStack_.back();
expStack_.pop_back();
boost::shared_ptr<ExpressionBase> lhs(new ExpressionNumber(0.0));
boost::shared_ptr<ComparisonBase> comp(new Comparison<std::not_equal_to<double> >());
std::shared_ptr<ExpressionBase> lhs(new ExpressionNumber(0.0));
std::shared_ptr<ComparisonBase> comp(new Comparison<std::not_equal_to<double> >());
#ifdef BOOST_SPIRIT_DEBUG
BOOST_SPIRIT_DEBUG_OUT << "pushing expression selector" << std::endl;
#endif
Expand Down
5 changes: 3 additions & 2 deletions CommonTools/Utils/src/ExpressionStack.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
* \version $Revision: 1.2 $
*
*/
#include <boost/shared_ptr.hpp>

#include <vector>
#include <memory>

namespace reco {
namespace parser {
struct ExpressionBase;

typedef std::vector<boost::shared_ptr<ExpressionBase> > ExpressionStack;
typedef std::vector<std::shared_ptr<ExpressionBase> > ExpressionStack;
} // namespace parser
} // namespace reco

Expand Down
4 changes: 2 additions & 2 deletions CommonTools/Utils/src/ExpressionVarSetter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ void ExpressionVarSetter::push(const char *begin, const char *end) const {
<< methStack_.back().returnTypeName() << "\" which is not convertible to double.";
}

exprStack_.push_back(boost::shared_ptr<ExpressionBase>(new ExpressionVar(methStack_, retType)));
exprStack_.push_back(std::shared_ptr<ExpressionBase>(new ExpressionVar(methStack_, retType)));
methStack_.clear();
typeStack_.resize(1);
}

void ExpressionVarSetter::lazyPush(const char *begin, const char *end) const {
exprStack_.push_back(boost::shared_ptr<ExpressionBase>(new ExpressionLazyVar(lazyMethStack_)));
exprStack_.push_back(std::shared_ptr<ExpressionBase>(new ExpressionLazyVar(lazyMethStack_)));
lazyMethStack_.clear();
typeStack_.resize(1);
}
1 change: 0 additions & 1 deletion CommonTools/Utils/src/MethodInvoker.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "FWCore/Reflection/interface/ObjectWithDict.h"
#include "FWCore/Utilities/interface/TypeID.h"

#include <boost/shared_ptr.hpp>
#include <boost/utility.hpp>

#include <map>
Expand Down
5 changes: 3 additions & 2 deletions CommonTools/Utils/src/SelectorPtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
* \version $Revision: 1.2 $
*
*/
#include <boost/shared_ptr.hpp>

#include <memory>

namespace reco {
namespace parser {
class SelectorBase;
typedef boost::shared_ptr<SelectorBase> SelectorPtr;
typedef std::shared_ptr<SelectorBase> SelectorPtr;
} // namespace parser
} // namespace reco

Expand Down