From 7469e92dd71eafc841547a1bab29bee95f8c9387 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Thu, 27 Sep 2018 17:33:05 +0200 Subject: [PATCH] DQMServices/FwkIO: replace auto_ptr removed in strict std=c++17 --- DQMServices/FwkIO/plugins/DQMRootOutputModule.cc | 4 ++-- DQMServices/FwkIO/plugins/DQMRootSource.cc | 8 ++++---- DQMServices/FwkIO/test/DummyFillDQMStore.cc | 2 +- DQMServices/FwkIO/test/DummyReadDQMStore.cc | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/DQMServices/FwkIO/plugins/DQMRootOutputModule.cc b/DQMServices/FwkIO/plugins/DQMRootOutputModule.cc index 471099a7e7a81..022ac978ede8f 100644 --- a/DQMServices/FwkIO/plugins/DQMRootOutputModule.cc +++ b/DQMServices/FwkIO/plugins/DQMRootOutputModule.cc @@ -198,7 +198,7 @@ class DQMRootOutputModule : public edm::one::OutputModule<> { void finishEndFile(); std::string m_fileName; std::string m_logicalFileName; - std::auto_ptr m_file; + std::unique_ptr m_file; std::vector > m_treeHelpers; unsigned int m_run; @@ -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(new TFile(m_fileName.c_str(),"RECREATE", + m_file = std::unique_ptr(new TFile(m_fileName.c_str(),"RECREATE", "1" //This is the file format version number )); diff --git a/DQMServices/FwkIO/plugins/DQMRootSource.cc b/DQMServices/FwkIO/plugins/DQMRootSource.cc index fc12c6d8af403..6a0080c83f50b 100644 --- a/DQMServices/FwkIO/plugins/DQMRootSource.cc +++ b/DQMServices/FwkIO/plugins/DQMRootSource.cc @@ -388,7 +388,7 @@ class DQMRootSource : public edm::InputSource std::list::iterator m_nextIndexItr; std::list::iterator m_presentIndexItr; std::vector m_runlumiToRange; - std::auto_ptr m_file; + std::unique_ptr m_file; std::vector m_trees; std::vector > m_treeReaders; @@ -795,7 +795,7 @@ 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 newFile; + std::unique_ptr 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 @@ -803,7 +803,7 @@ DQMRootSource::setupFile(unsigned int iIndex) // the context, guaranteeing the context is unregistered in the same thread // it was registered in. TDirectory::TContext contextEraser; - newFile = std::auto_ptr(TFile::Open(m_catalog.fileNames()[iIndex].c_str())); + newFile = std::unique_ptr(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 @@ -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(metaDir->Get(kParameterSetTree)); assert(nullptr!=parameterSetTree); diff --git a/DQMServices/FwkIO/test/DummyFillDQMStore.cc b/DQMServices/FwkIO/test/DummyFillDQMStore.cc index 35f3e53a46bc9..64a622ac2b4b1 100644 --- a/DQMServices/FwkIO/test/DummyFillDQMStore.cc +++ b/DQMServices/FwkIO/test/DummyFillDQMStore.cc @@ -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 pOut(new ExampleData2(*pIn)); + std::unique_ptr pOut(new ExampleData2(*pIn)); iEvent.put(pOut); */ diff --git a/DQMServices/FwkIO/test/DummyReadDQMStore.cc b/DQMServices/FwkIO/test/DummyReadDQMStore.cc index eea46cac1a42a..aa3e785075cfa 100644 --- a/DQMServices/FwkIO/test/DummyReadDQMStore.cc +++ b/DQMServices/FwkIO/test/DummyReadDQMStore.cc @@ -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 pOut(new ExampleData2(*pIn)); + std::unique_ptr pOut(new ExampleData2(*pIn)); iEvent.put(pOut); */