more work to get rid of raw pointers.

This commit is contained in:
2023-10-17 16:35:54 +02:00
parent ff9245fd28
commit ca742a064f
8 changed files with 89 additions and 239 deletions

View File

@@ -200,13 +200,7 @@ int dump_header_root(const std::string fileName, const bool summary, const bool
std::cout << std::endl << "-------------------" << std::endl << std::endl;
} else { // MusrRoot
// invoke the MusrRoot header object
header = std::unique_ptr<TMusrRunHeader>(new TMusrRunHeader(fileName.c_str(), true)); // read quite
if (header == nullptr) {
std::cerr << std::endl << "**ERROR** Couldn't invoke MusrRoot RunHeader in file:" << fileName;
std::cerr << std::endl;
f.Close();
return 1;
}
header = std::make_unique<TMusrRunHeader>(fileName.c_str(), true); // read quite
// try to populate the MusrRoot header object
if (!header->ExtractAll(folder)) {
@@ -320,14 +314,7 @@ int dump_header_root(const std::string fileName, const bool summary, const bool
int dump_header_nexus(const std::string fileName, const bool counts) {
#ifdef PNEXUS_ENABLED
std::unique_ptr<PNeXus> nxs_file = std::unique_ptr<PNeXus>(new PNeXus(fileName.c_str()));
if (nxs_file == nullptr) {
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke NeXus file object." << std::endl;
std::cerr << std::endl;
return 1;
}
std::unique_ptr<PNeXus> nxs_file = std::make_unique<PNeXus>(fileName.c_str());
if (nxs_file->IsValid(false)) {
nxs_file->Dump(counts);
@@ -930,8 +917,8 @@ int main(int argc, char *argv[])
// invoke the startup handler in order to get the default search paths to the data files
// read startup file
char startup_path_name[128];
std::unique_ptr<TSAXParser> saxParser = std::unique_ptr<TSAXParser>(new TSAXParser());
std::unique_ptr<PStartupHandler> startupHandler = std::unique_ptr<PStartupHandler>(new PStartupHandler());
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
std::unique_ptr<PStartupHandler> startupHandler = std::make_unique<PStartupHandler>();
if (!startupHandler->StartupFileFound()) {
std::cerr << std::endl << ">> musrfit **WARNING** couldn't find " << startupHandler->GetStartupFilePath().Data();
std::cerr << std::endl;