diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/MDEWLoadingPresenter.h b/Vates/VatesAPI/inc/MantidVatesAPI/MDEWLoadingPresenter.h index 7b3b1ebb2f8ba9b94b658f8ec6530b760094581e..618e7d938b2773147cc431bbe08a49cea52ae84e 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/MDEWLoadingPresenter.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/MDEWLoadingPresenter.h @@ -61,7 +61,7 @@ namespace Mantid /*--------------------------------------------------------------------------- Common/shared operations and members for all MDEW file-type loading. ---------------------------------------------------------------------------*/ - MDLoadingView* m_view; + std::unique_ptr<MDLoadingView> m_view; Mantid::Geometry::MDGeometryBuilderXML<Mantid::Geometry::NoDimensionPolicy> xmlBuilder; Mantid::Geometry::IMDDimension_sptr tDimension; diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/MDHWLoadingPresenter.h b/Vates/VatesAPI/inc/MantidVatesAPI/MDHWLoadingPresenter.h index 682c7b81f0731379a4f3a96e6206cf81a9d8119a..5de80a7565d0e5b4acef86398aef4f2efd393b95 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/MDHWLoadingPresenter.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/MDHWLoadingPresenter.h @@ -65,7 +65,7 @@ protected: /*--------------------------------------------------------------------------- Common/shared operations and members for all MDHW file-type loading. ---------------------------------------------------------------------------*/ - MDLoadingView *m_view; + std::unique_ptr<MDLoadingView> m_view; Mantid::Geometry::MDGeometryBuilderXML<Mantid::Geometry::NoDimensionPolicy> xmlBuilder; diff --git a/Vates/VatesAPI/src/EventNexusLoadingPresenter.cpp b/Vates/VatesAPI/src/EventNexusLoadingPresenter.cpp index 1501c4fe6529238bf4df1804fbc9bff6139e1ddf..18141371a9ca0d4ef268f4c1c921dffb2223bf31 100644 --- a/Vates/VatesAPI/src/EventNexusLoadingPresenter.cpp +++ b/Vates/VatesAPI/src/EventNexusLoadingPresenter.cpp @@ -33,7 +33,7 @@ namespace Mantid { throw std::invalid_argument("File name is an empty string."); } - if (NULL == this->m_view) + if (nullptr == this->m_view) { throw std::invalid_argument("View is NULL."); } @@ -168,11 +168,8 @@ namespace Mantid throw std::runtime_error("Does not have a 4th Dimension, so can be no T-axis"); } - ///Destructor - EventNexusLoadingPresenter::~EventNexusLoadingPresenter() - { - delete m_view; - } + /// Destructor + EventNexusLoadingPresenter::~EventNexusLoadingPresenter() {} /** Executes any meta-data loading required. diff --git a/Vates/VatesAPI/src/MDEWEventNexusLoadingPresenter.cpp b/Vates/VatesAPI/src/MDEWEventNexusLoadingPresenter.cpp index 79592b54bd18a6dfb3934b6c4b6cb3be35a78970..b9e513cf9a657f5f632cc2fad36080ab85821287 100644 --- a/Vates/VatesAPI/src/MDEWEventNexusLoadingPresenter.cpp +++ b/Vates/VatesAPI/src/MDEWEventNexusLoadingPresenter.cpp @@ -30,7 +30,7 @@ namespace Mantid { throw std::invalid_argument("File name is an empty string."); } - if(NULL == this->m_view) + if(nullptr == this->m_view) { throw std::invalid_argument("View is NULL."); } @@ -135,16 +135,13 @@ namespace Mantid AnalysisDataService::Instance().remove("MD_EVENT_WS_ID"); } - ///Destructor - MDEWEventNexusLoadingPresenter::~MDEWEventNexusLoadingPresenter() - { - delete m_view; - } + /// Destructor + MDEWEventNexusLoadingPresenter::~MDEWEventNexusLoadingPresenter() {} - /* - Getter for the workspace type name. - @return Workspace Type Name - */ + /* +Getter for the workspace type name. +@return Workspace Type Name +*/ std::string MDEWEventNexusLoadingPresenter::getWorkspaceTypeName() { return m_wsTypeName; diff --git a/Vates/VatesAPI/src/MDEWInMemoryLoadingPresenter.cpp b/Vates/VatesAPI/src/MDEWInMemoryLoadingPresenter.cpp index 4dbaf48cbfc4108a7225a72d79f5f991237be28d..8ccdcee01eb4e08db17742e9c11a88706186cab3 100644 --- a/Vates/VatesAPI/src/MDEWInMemoryLoadingPresenter.cpp +++ b/Vates/VatesAPI/src/MDEWInMemoryLoadingPresenter.cpp @@ -33,7 +33,7 @@ namespace Mantid { throw std::invalid_argument("The repository is NULL"); } - if(NULL == m_view) + if(nullptr == m_view) { throw std::invalid_argument("View is NULL."); } @@ -127,16 +127,13 @@ namespace Mantid this->extractMetadata(eventWs); } - ///Destructor - MDEWInMemoryLoadingPresenter::~MDEWInMemoryLoadingPresenter() - { - delete m_view; - } + /// Destructor + MDEWInMemoryLoadingPresenter::~MDEWInMemoryLoadingPresenter() {} - /* - Getter for the workspace type name. - @return Workspace Type Name - */ + /* + Getter for the workspace type name. + @return Workspace Type Name + */ std::string MDEWInMemoryLoadingPresenter::getWorkspaceTypeName() { return m_wsTypeName; diff --git a/Vates/VatesAPI/src/MDHWInMemoryLoadingPresenter.cpp b/Vates/VatesAPI/src/MDHWInMemoryLoadingPresenter.cpp index cd33892016a552eaa9ad50da8706884293732f4d..f276e40e97c9fe24da17927987ffbddac33525a6 100644 --- a/Vates/VatesAPI/src/MDHWInMemoryLoadingPresenter.cpp +++ b/Vates/VatesAPI/src/MDHWInMemoryLoadingPresenter.cpp @@ -32,7 +32,7 @@ MDHWInMemoryLoadingPresenter::MDHWInMemoryLoadingPresenter( if (NULL == repository) { throw std::invalid_argument("The repository is NULL"); } - if (NULL == m_view) { + if (nullptr == m_view) { throw std::invalid_argument("View is NULL."); } } @@ -138,7 +138,7 @@ void MDHWInMemoryLoadingPresenter::executeLoadMetadata() { } /// Destructor -MDHWInMemoryLoadingPresenter::~MDHWInMemoryLoadingPresenter() { delete m_view; } +MDHWInMemoryLoadingPresenter::~MDHWInMemoryLoadingPresenter() {} /* * Getter for the workspace type name. diff --git a/Vates/VatesAPI/src/MDHWNexusLoadingPresenter.cpp b/Vates/VatesAPI/src/MDHWNexusLoadingPresenter.cpp index eec4a5a3b109997953895099faaf9fbbb78300cf..42fd16b2b8a23e90b0d48dff23e06ccb1519653d 100644 --- a/Vates/VatesAPI/src/MDHWNexusLoadingPresenter.cpp +++ b/Vates/VatesAPI/src/MDHWNexusLoadingPresenter.cpp @@ -30,7 +30,7 @@ MDHWNexusLoadingPresenter::MDHWNexusLoadingPresenter(MDLoadingView* view, const { throw std::invalid_argument("File name is an empty string."); } - if(NULL == this->m_view) + if(nullptr == this->m_view) { throw std::invalid_argument("View is NULL."); } @@ -113,10 +113,7 @@ void MDHWNexusLoadingPresenter::executeLoadMetadata() * Destructor * @return */ -MDHWNexusLoadingPresenter::~MDHWNexusLoadingPresenter() -{ - delete m_view; -} +MDHWNexusLoadingPresenter::~MDHWNexusLoadingPresenter() {} /** * Getter for the workspace type name. diff --git a/Vates/VatesAPI/src/SQWLoadingPresenter.cpp b/Vates/VatesAPI/src/SQWLoadingPresenter.cpp index 7e51bd61e9fdca7df18444499b3b213ed9480cf1..d4483dce2b18d0131d3ea6a35f27e929565bff75 100644 --- a/Vates/VatesAPI/src/SQWLoadingPresenter.cpp +++ b/Vates/VatesAPI/src/SQWLoadingPresenter.cpp @@ -27,7 +27,7 @@ namespace Mantid { throw std::invalid_argument("File name is an empty string."); } - if(NULL == this->m_view) + if(nullptr == this->m_view) { throw std::invalid_argument("View is NULL."); } @@ -162,10 +162,7 @@ namespace Mantid } ///Destructor - SQWLoadingPresenter::~SQWLoadingPresenter() - { - delete m_view; - } + SQWLoadingPresenter::~SQWLoadingPresenter() {} /* Getter for the workspace type name.