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

DQMServices/FwkIO: replace auto_ptr removed in strict std=c++17 #24702

Merged
merged 1 commit into from
Oct 1, 2018
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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