Commit 128f15ef authored by David Fairbrother's avatar David Fairbrother
Browse files

Modernise from nested namespaces

Modernises the codebase from nested workspaces to modern form. E.g.:

namespace A{
namespace B {}
}

Becomes
namespace A::B{
}

This will allow us to specify in the coding standards to prefer the
simple form instead
parent ad00f750
...@@ -11,8 +11,7 @@ ...@@ -11,8 +11,7 @@
#include <memory> #include <memory>
#include <sstream> #include <sstream>
namespace Mantid { namespace Mantid::API {
namespace API {
/// Default constructor. Sets up an empty list of valid values. /// Default constructor. Sets up an empty list of valid values.
ADSValidator::ADSValidator(const bool allowMultiSelection, const bool isOptional) ADSValidator::ADSValidator(const bool allowMultiSelection, const bool isOptional)
...@@ -68,5 +67,4 @@ std::vector<std::string> ADSValidator::allowedValues() const { ...@@ -68,5 +67,4 @@ std::vector<std::string> ADSValidator::allowedValues() const {
return vals; return vals;
} }
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
// SPDX - License - Identifier: GPL - 3.0 + // SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAPI/Algorithm.h" #include "MantidAPI/Algorithm.h"
namespace Mantid { namespace Mantid::API {
namespace API {
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
/** The actions to be performed by the algorithm on a dataset. This method is /** The actions to be performed by the algorithm on a dataset. This method is
* invoked for top level algorithms by the application manager. * invoked for top level algorithms by the application manager.
...@@ -20,5 +19,4 @@ namespace API { ...@@ -20,5 +19,4 @@ namespace API {
* @return true if executed successfully. * @return true if executed successfully.
*/ */
bool Algorithm::execute() { return executeInternal(); } bool Algorithm::execute() { return executeInternal(); }
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -17,8 +17,7 @@ ...@@ -17,8 +17,7 @@
#include "MantidKernel/StringTokenizer.h" #include "MantidKernel/StringTokenizer.h"
namespace Mantid { namespace Mantid::API {
namespace API {
namespace { namespace {
/// static logger instance /// static logger instance
Kernel::Logger g_log("AlgorithmFactory"); Kernel::Logger g_log("AlgorithmFactory");
...@@ -441,5 +440,4 @@ std::shared_ptr<Algorithm> AlgorithmFactoryImpl::createAlgorithm(const std::stri ...@@ -441,5 +440,4 @@ std::shared_ptr<Algorithm> AlgorithmFactoryImpl::createAlgorithm(const std::stri
return Kernel::DynamicFactory<Algorithm>::create(createName(name, version)); return Kernel::DynamicFactory<Algorithm>::create(createName(name, version));
} }
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -17,8 +17,7 @@ template <typename Observer> void modifyObserver(const bool turnOn, bool &isObse ...@@ -17,8 +17,7 @@ template <typename Observer> void modifyObserver(const bool turnOn, bool &isObse
} }
} // namespace } // namespace
namespace Mantid { namespace Mantid::API {
namespace API {
AlgorithmFactoryObserver::AlgorithmFactoryObserver() AlgorithmFactoryObserver::AlgorithmFactoryObserver()
: m_updateObserver(*this, &AlgorithmFactoryObserver::_updateHandle) {} : m_updateObserver(*this, &AlgorithmFactoryObserver::_updateHandle) {}
...@@ -63,5 +62,4 @@ void AlgorithmFactoryObserver::_updateHandle(AlgorithmFactoryUpdateNotification_ ...@@ -63,5 +62,4 @@ void AlgorithmFactoryObserver::_updateHandle(AlgorithmFactoryUpdateNotification_
this->updateHandle(); this->updateHandle();
} }
} // namespace API } // namespace Mantid::API
} // namespace Mantid \ No newline at end of file
\ No newline at end of file
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
namespace Mantid { namespace Mantid::API {
namespace API {
/// Constructor /// Constructor
AlgorithmHasProperty::AlgorithmHasProperty(std::string propName) : m_propName(std::move(propName)) {} AlgorithmHasProperty::AlgorithmHasProperty(std::string propName) : m_propName(std::move(propName)) {}
...@@ -46,5 +45,4 @@ std::string AlgorithmHasProperty::checkValidity(const std::shared_ptr<IAlgorithm ...@@ -46,5 +45,4 @@ std::string AlgorithmHasProperty::checkValidity(const std::shared_ptr<IAlgorithm
return message; return message;
} }
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
#include <sstream> #include <sstream>
#include <utility> #include <utility>
namespace Mantid { namespace Mantid::API {
namespace API {
using Kernel::Property; using Kernel::Property;
using Kernel::PropertyHistories; using Kernel::PropertyHistories;
...@@ -289,5 +288,4 @@ void AlgorithmHistory::saveNexus(::NeXus::File *file, int &algCount) const { ...@@ -289,5 +288,4 @@ void AlgorithmHistory::saveNexus(::NeXus::File *file, int &algCount) const {
} }
file->closeGroup(); file->closeGroup();
} }
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
#include "MantidAPI/AlgorithmFactory.h" #include "MantidAPI/AlgorithmFactory.h"
#include "MantidKernel/ConfigService.h" #include "MantidKernel/ConfigService.h"
namespace Mantid { namespace Mantid::API {
namespace API {
namespace { namespace {
/// static logger /// static logger
Kernel::Logger g_log("AlgorithmManager"); Kernel::Logger g_log("AlgorithmManager");
...@@ -187,5 +186,4 @@ size_t AlgorithmManagerImpl::removeFinishedAlgorithms() { ...@@ -187,5 +186,4 @@ size_t AlgorithmManagerImpl::removeFinishedAlgorithms() {
} }
void AlgorithmManagerImpl::shutdown() { clear(); } void AlgorithmManagerImpl::shutdown() { clear(); }
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
#include "MantidAPI/AlgorithmManager.h" #include "MantidAPI/AlgorithmManager.h"
#include "MantidAPI/AlgorithmObserver.h" #include "MantidAPI/AlgorithmObserver.h"
namespace Mantid { namespace Mantid::API {
namespace API {
/// Default constructor. Notification handlers are not connected to any /// Default constructor. Notification handlers are not connected to any
/// algorithm /// algorithm
...@@ -180,5 +179,4 @@ void AlgorithmObserver::_startingHandle(const Poco::AutoPtr<AlgorithmStartingNot ...@@ -180,5 +179,4 @@ void AlgorithmObserver::_startingHandle(const Poco::AutoPtr<AlgorithmStartingNot
this->startingHandle(pNf->getAlgorithm()); this->startingHandle(pNf->getAlgorithm());
} }
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
namespace Mantid { namespace Mantid::API {
namespace API {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Public member functions // Public member functions
...@@ -101,5 +100,4 @@ std::string AlgorithmProperty::setBaseValue(const AlgorithmProperty::HeldType &a ...@@ -101,5 +100,4 @@ std::string AlgorithmProperty::setBaseValue(const AlgorithmProperty::HeldType &a
return message; return message;
} }
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
#include <iterator> #include <iterator>
#include <sstream> #include <sstream>
namespace Mantid { namespace Mantid::API {
namespace API {
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// Nested class methods // Nested class methods
...@@ -372,5 +371,4 @@ void AnalysisDataServiceImpl::verifyName(const std::string &name, const std::sha ...@@ -372,5 +371,4 @@ void AnalysisDataServiceImpl::verifyName(const std::string &name, const std::sha
} }
} }
} // Namespace API } // namespace Mantid::API
} // Namespace Mantid
...@@ -17,8 +17,7 @@ template <typename Observer> void modifyObserver(const bool turnOn, bool &isObse ...@@ -17,8 +17,7 @@ template <typename Observer> void modifyObserver(const bool turnOn, bool &isObse
} }
} // namespace } // namespace
namespace Mantid { namespace Mantid::API {
namespace API {
AnalysisDataServiceObserver::AnalysisDataServiceObserver() AnalysisDataServiceObserver::AnalysisDataServiceObserver()
: m_addObserver(*this, &AnalysisDataServiceObserver::_addHandle), : m_addObserver(*this, &AnalysisDataServiceObserver::_addHandle),
...@@ -291,5 +290,4 @@ void AnalysisDataServiceObserver::_groupUpdateHandle( ...@@ -291,5 +290,4 @@ void AnalysisDataServiceObserver::_groupUpdateHandle(
this->groupUpdateHandle(pNf->objectName(), pNf->object()); this->groupUpdateHandle(pNf->objectName(), pNf->object());
} }
} // namespace API } // namespace Mantid::API
} // namespace Mantid \ No newline at end of file
\ No newline at end of file
...@@ -9,10 +9,8 @@ ...@@ -9,10 +9,8 @@
//---------------------------------------------------------------------- //----------------------------------------------------------------------
#include "MantidAPI/ArchiveSearchFactory.h" #include "MantidAPI/ArchiveSearchFactory.h"
namespace Mantid { namespace Mantid::API {
namespace API {
/// Default constructor /// Default constructor
ArchiveSearchFactoryImpl::ArchiveSearchFactoryImpl() {} ArchiveSearchFactoryImpl::ArchiveSearchFactoryImpl() {}
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
#include "MantidKernel/Unit.h" #include "MantidKernel/Unit.h"
#include "MantidKernel/UnitFactory.h" #include "MantidKernel/UnitFactory.h"
namespace Mantid { namespace Mantid::API {
namespace API {
using std::size_t; using std::size_t;
...@@ -63,5 +62,4 @@ specnum_t Axis::spectraNo(const std::size_t &index) const { ...@@ -63,5 +62,4 @@ specnum_t Axis::spectraNo(const std::size_t &index) const {
throw std::domain_error("Cannot call spectraNo() on a non-spectra axis."); throw std::domain_error("Cannot call spectraNo() on a non-spectra axis.");
} }
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
#include "MantidKernel/Exception.h" #include "MantidKernel/Exception.h"
#include "MantidKernel/VectorHelper.h" #include "MantidKernel/VectorHelper.h"
namespace Mantid { namespace Mantid::API {
namespace API {
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
/** /**
...@@ -97,5 +96,4 @@ std::string BinEdgeAxis::label(const std::size_t &index) const { ...@@ -97,5 +96,4 @@ std::string BinEdgeAxis::label(const std::size_t &index) const {
} }
return formatLabel(((*this)(index) + (*this)(index + 1)) / 2); return formatLabel(((*this)(index) + (*this)(index + 1)) / 2);
} }
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
// SPDX - License - Identifier: GPL - 3.0 + // SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAPI/BoostOptionalToAlgorithmProperty.h" #include "MantidAPI/BoostOptionalToAlgorithmProperty.h"
namespace Mantid { namespace Mantid::API {
namespace API {
template <> template <>
std::string checkForMandatoryInstrumentDefault(Mantid::API::Algorithm *const alg, const std::string &propName, std::string checkForMandatoryInstrumentDefault(Mantid::API::Algorithm *const alg, const std::string &propName,
const Mantid::Geometry::Instrument_const_sptr &instrument, const Mantid::Geometry::Instrument_const_sptr &instrument,
...@@ -43,5 +42,4 @@ checkForOptionalInstrumentDefault(Mantid::API::Algorithm *const alg, const std:: ...@@ -43,5 +42,4 @@ checkForOptionalInstrumentDefault(Mantid::API::Algorithm *const alg, const std::
return boost::optional<std::string>(algProperty->value()); return boost::optional<std::string>(algProperty->value());
} }
} }
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -27,8 +27,7 @@ using namespace Mantid::Kernel; ...@@ -27,8 +27,7 @@ using namespace Mantid::Kernel;
using Mantid::Kernel::Strings::convert; using Mantid::Kernel::Strings::convert;
using Mantid::Kernel::VectorHelper::splitStringIntoVector; using Mantid::Kernel::VectorHelper::splitStringIntoVector;
namespace Mantid { namespace Mantid::API {
namespace API {
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
/** create new box controller from the existing one. Drops file-based state if /** create new box controller from the existing one. Drops file-based state if
...@@ -287,6 +286,4 @@ void BoxController::setFileBacked(const std::shared_ptr<IBoxControllerIO> &newFi ...@@ -287,6 +286,4 @@ void BoxController::setFileBacked(const std::shared_ptr<IBoxControllerIO> &newFi
this->m_fileIO = newFileIO; this->m_fileIO = newFileIO;
} }
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
using namespace Mantid::Kernel; using namespace Mantid::Kernel;
namespace Mantid { namespace Mantid::API {
namespace API {
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
/** Add Box-controller-specific properties to this algorithm /** Add Box-controller-specific properties to this algorithm
...@@ -145,5 +144,4 @@ void BoxControllerSettingsAlgorithm::setBoxController(const BoxController_sptr & ...@@ -145,5 +144,4 @@ void BoxControllerSettingsAlgorithm::setBoxController(const BoxController_sptr &
bc->resetNumBoxes(); bc->resetNumBoxes();
} }
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -14,8 +14,7 @@ ...@@ -14,8 +14,7 @@
#include <map> #include <map>
#include <memory> #include <memory>
namespace Mantid { namespace Mantid::API {
namespace API {
/** /**
* Logs the user into the catalog if session details are valid. * Logs the user into the catalog if session details are valid.
* This is used here as we need to obtain the session for a specific catalog * This is used here as we need to obtain the session for a specific catalog
...@@ -106,5 +105,4 @@ std::vector<CatalogSession_sptr> CatalogManagerImpl::getActiveSessions() { ...@@ -106,5 +105,4 @@ std::vector<CatalogSession_sptr> CatalogManagerImpl::getActiveSessions() {
/// @returns An unsigned value indicating the number of active sessions /// @returns An unsigned value indicating the number of active sessions
size_t CatalogManagerImpl::numberActiveSessions() const { return m_activeCatalogs.size(); } size_t CatalogManagerImpl::numberActiveSessions() const { return m_activeCatalogs.size(); }
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
#include "MantidAPI/CatalogSession.h" #include "MantidAPI/CatalogSession.h"
#include "MantidKernel/Logger.h" #include "MantidKernel/Logger.h"
namespace Mantid { namespace Mantid::API {
namespace API {
/** /**
* Initialise the related catalog session variables. * Initialise the related catalog session variables.
* @param sessionID :: The session ID generated from logging into the catalog. * @param sessionID :: The session ID generated from logging into the catalog.
...@@ -43,5 +42,4 @@ const std::string &CatalogSession::getSoapEndpoint() const { return m_endpoint; ...@@ -43,5 +42,4 @@ const std::string &CatalogSession::getSoapEndpoint() const { return m_endpoint;
* @return The facility used to create the catalog. * @return The facility used to create the catalog.
*/ */
const std::string &CatalogSession::getFacility() const { return m_facility; } const std::string &CatalogSession::getFacility() const { return m_facility; }
} // namespace API } // namespace Mantid::API
} // namespace Mantid
...@@ -11,8 +11,7 @@ ...@@ -11,8 +11,7 @@
#include <stdexcept> #include <stdexcept>
namespace Mantid { namespace Mantid::API {
namespace API {
/* /*
There are some strict parameters that the function arguements must adhere to. There are some strict parameters that the function arguements must adhere to.
...@@ -80,5 +79,4 @@ void Citation::saveNexus(::NeXus::File *file, const std::string &group) { ...@@ -80,5 +79,4 @@ void Citation::saveNexus(::NeXus::File *file, const std::string &group) {
file->closeGroup(); file->closeGroup();
} }
} // namespace API } // namespace Mantid::API
} // namespace Mantid \ No newline at end of file
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment