Skip to content

Commit

Permalink
Merge pull request #24702 from gartung/DQMServices-FwkIO-strictcxx17
Browse files Browse the repository at this point in the history
DQMServices/FwkIO: replace auto_ptr removed in strict std=c++17
  • Loading branch information
cmsbuild authored Oct 1, 2018
2 parents 978a6c8 + 7469e92 commit 794bb1f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions DQMServices/FwkIO/plugins/DQMRootOutputModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class DQMRootOutputModule : public edm::one::OutputModule<> {
void finishEndFile();
std::string m_fileName;
std::string m_logicalFileName;
std::auto_ptr<TFile> m_file;
std::unique_ptr<TFile> m_file;
std::vector<boost::shared_ptr<TreeHelperBase> > m_treeHelpers;

unsigned int m_run;
Expand Down Expand Up @@ -325,7 +325,7 @@ DQMRootOutputModule::openFile(edm::FileBlock const&)
{
//NOTE: I need to also set the I/O performance settings

m_file = std::auto_ptr<TFile>(new TFile(m_fileName.c_str(),"RECREATE",
m_file = std::unique_ptr<TFile>(new TFile(m_fileName.c_str(),"RECREATE",
"1" //This is the file format version number
));

Expand Down
8 changes: 4 additions & 4 deletions DQMServices/FwkIO/plugins/DQMRootSource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ class DQMRootSource : public edm::InputSource
std::list<unsigned int>::iterator m_nextIndexItr;
std::list<unsigned int>::iterator m_presentIndexItr;
std::vector<RunLumiToRange> m_runlumiToRange;
std::auto_ptr<TFile> m_file;
std::unique_ptr<TFile> m_file;
std::vector<TTree*> m_trees;
std::vector<boost::shared_ptr<TreeReaderBase> > m_treeReaders;

Expand Down Expand Up @@ -795,15 +795,15 @@ DQMRootSource::setupFile(unsigned int iIndex)
logFileAction(" Initiating request to open file ", m_catalog.fileNames()[iIndex].c_str());
m_presentlyOpenFileIndex = iIndex;
m_file.reset();
std::auto_ptr<TFile> newFile;
std::unique_ptr<TFile> newFile;
try {
// ROOT's context management implicitly assumes that a file is opened and
// closed on the same thread. To avoid the problem, we declare a local
// TContext object; when it goes out of scope, its destructor unregisters
// the context, guaranteeing the context is unregistered in the same thread
// it was registered in.
TDirectory::TContext contextEraser;
newFile = std::auto_ptr<TFile>(TFile::Open(m_catalog.fileNames()[iIndex].c_str()));
newFile = std::unique_ptr<TFile>(TFile::Open(m_catalog.fileNames()[iIndex].c_str()));

//Since ROOT6, we can not propagate an exception through ROOT's plugin
// system so we trap them and then pull from this function
Expand Down Expand Up @@ -851,7 +851,7 @@ DQMRootSource::setupFile(unsigned int iIndex)
}
else {return false;}
}
m_file = newFile; //passed all tests so now we want to use this file
m_file = std::move(newFile); //passed all tests so now we want to use this file
TTree* parameterSetTree = dynamic_cast<TTree*>(metaDir->Get(kParameterSetTree));
assert(nullptr!=parameterSetTree);

Expand Down
2 changes: 1 addition & 1 deletion DQMServices/FwkIO/test/DummyFillDQMStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ DummyFillDQMStore::analyze(edm::Event const& iEvent, edm::EventSetup const& iSet
//Use the ExampleData to create an ExampleData2 which
// is put into the Event
std::auto_ptr<ExampleData2> pOut(new ExampleData2(*pIn));
std::unique_ptr<ExampleData2> pOut(new ExampleData2(*pIn));
iEvent.put(pOut);
*/

Expand Down
2 changes: 1 addition & 1 deletion DQMServices/FwkIO/test/DummyReadDQMStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ DummyReadDQMStore::analyze(edm::Event const& iEvent, edm::EventSetup const& iSet
//Use the ExampleData to create an ExampleData2 which
// is put into the Event
std::auto_ptr<ExampleData2> pOut(new ExampleData2(*pIn));
std::unique_ptr<ExampleData2> pOut(new ExampleData2(*pIn));
iEvent.put(pOut);
*/

Expand Down

0 comments on commit 794bb1f

Please sign in to comment.