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 @@
#include <memory>
#include <sstream>
namespace Mantid {
namespace API {
namespace Mantid::API {
/// Default constructor. Sets up an empty list of valid values.
ADSValidator::ADSValidator(const bool allowMultiSelection, const bool isOptional)
......@@ -68,5 +67,4 @@ std::vector<std::string> ADSValidator::allowedValues() const {
return vals;
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -6,8 +6,7 @@
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAPI/Algorithm.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
//---------------------------------------------------------------------------------------------
/** The actions to be performed by the algorithm on a dataset. This method is
* invoked for top level algorithms by the application manager.
......@@ -20,5 +19,4 @@ namespace API {
* @return true if executed successfully.
*/
bool Algorithm::execute() { return executeInternal(); }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -17,8 +17,7 @@
#include "MantidKernel/StringTokenizer.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
namespace {
/// static logger instance
Kernel::Logger g_log("AlgorithmFactory");
......@@ -441,5 +440,4 @@ std::shared_ptr<Algorithm> AlgorithmFactoryImpl::createAlgorithm(const std::stri
return Kernel::DynamicFactory<Algorithm>::create(createName(name, version));
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -17,8 +17,7 @@ template <typename Observer> void modifyObserver(const bool turnOn, bool &isObse
}
} // namespace
namespace Mantid {
namespace API {
namespace Mantid::API {
AlgorithmFactoryObserver::AlgorithmFactoryObserver()
: m_updateObserver(*this, &AlgorithmFactoryObserver::_updateHandle) {}
......@@ -63,5 +62,4 @@ void AlgorithmFactoryObserver::_updateHandle(AlgorithmFactoryUpdateNotification_
this->updateHandle();
}
} // namespace API
} // namespace Mantid
\ No newline at end of file
} // namespace Mantid::API
\ No newline at end of file
......@@ -10,8 +10,7 @@
#include <memory>
#include <utility>
namespace Mantid {
namespace API {
namespace Mantid::API {
/// Constructor
AlgorithmHasProperty::AlgorithmHasProperty(std::string propName) : m_propName(std::move(propName)) {}
......@@ -46,5 +45,4 @@ std::string AlgorithmHasProperty::checkValidity(const std::shared_ptr<IAlgorithm
return message;
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -23,8 +23,7 @@
#include <sstream>
#include <utility>
namespace Mantid {
namespace API {
namespace Mantid::API {
using Kernel::Property;
using Kernel::PropertyHistories;
......@@ -289,5 +288,4 @@ void AlgorithmHistory::saveNexus(::NeXus::File *file, int &algCount) const {
}
file->closeGroup();
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -12,8 +12,7 @@
#include "MantidAPI/AlgorithmFactory.h"
#include "MantidKernel/ConfigService.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
namespace {
/// static logger
Kernel::Logger g_log("AlgorithmManager");
......@@ -187,5 +186,4 @@ size_t AlgorithmManagerImpl::removeFinishedAlgorithms() {
}
void AlgorithmManagerImpl::shutdown() { clear(); }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -12,8 +12,7 @@
#include "MantidAPI/AlgorithmManager.h"
#include "MantidAPI/AlgorithmObserver.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
/// Default constructor. Notification handlers are not connected to any
/// algorithm
......@@ -180,5 +179,4 @@ void AlgorithmObserver::_startingHandle(const Poco::AutoPtr<AlgorithmStartingNot
this->startingHandle(pNf->getAlgorithm());
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -16,8 +16,7 @@
#include <memory>
#include <utility>
namespace Mantid {
namespace API {
namespace Mantid::API {
//-----------------------------------------------------------------------------
// Public member functions
......@@ -101,5 +100,4 @@ std::string AlgorithmProperty::setBaseValue(const AlgorithmProperty::HeldType &a
return message;
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -9,8 +9,7 @@
#include <iterator>
#include <sstream>
namespace Mantid {
namespace API {
namespace Mantid::API {
//-------------------------------------------------------------------------
// Nested class methods
......@@ -372,5 +371,4 @@ void AnalysisDataServiceImpl::verifyName(const std::string &name, const std::sha
}
}
} // Namespace API
} // Namespace Mantid
} // namespace Mantid::API
......@@ -17,8 +17,7 @@ template <typename Observer> void modifyObserver(const bool turnOn, bool &isObse
}
} // namespace
namespace Mantid {
namespace API {
namespace Mantid::API {
AnalysisDataServiceObserver::AnalysisDataServiceObserver()
: m_addObserver(*this, &AnalysisDataServiceObserver::_addHandle),
......@@ -291,5 +290,4 @@ void AnalysisDataServiceObserver::_groupUpdateHandle(
this->groupUpdateHandle(pNf->objectName(), pNf->object());
}
} // namespace API
} // namespace Mantid
\ No newline at end of file
} // namespace Mantid::API
\ No newline at end of file
......@@ -9,10 +9,8 @@
//----------------------------------------------------------------------
#include "MantidAPI/ArchiveSearchFactory.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
/// Default constructor
ArchiveSearchFactoryImpl::ArchiveSearchFactoryImpl() {}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -9,8 +9,7 @@
#include "MantidKernel/Unit.h"
#include "MantidKernel/UnitFactory.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
using std::size_t;
......@@ -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.");
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -8,8 +8,7 @@
#include "MantidKernel/Exception.h"
#include "MantidKernel/VectorHelper.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
//----------------------------------------------------------------------------------------------
/**
......@@ -97,5 +96,4 @@ std::string BinEdgeAxis::label(const std::size_t &index) const {
}
return formatLabel(((*this)(index) + (*this)(index + 1)) / 2);
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -6,8 +6,7 @@
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAPI/BoostOptionalToAlgorithmProperty.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
template <>
std::string checkForMandatoryInstrumentDefault(Mantid::API::Algorithm *const alg, const std::string &propName,
const Mantid::Geometry::Instrument_const_sptr &instrument,
......@@ -43,5 +42,4 @@ checkForOptionalInstrumentDefault(Mantid::API::Algorithm *const alg, const std::
return boost::optional<std::string>(algProperty->value());
}
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -27,8 +27,7 @@ using namespace Mantid::Kernel;
using Mantid::Kernel::Strings::convert;
using Mantid::Kernel::VectorHelper::splitStringIntoVector;
namespace Mantid {
namespace API {
namespace Mantid::API {
//-----------------------------------------------------------------------------------
/** 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
this->m_fileIO = newFileIO;
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -15,8 +15,7 @@
using namespace Mantid::Kernel;
namespace Mantid {
namespace API {
namespace Mantid::API {
//----------------------------------------------------------------------------------------------
/** Add Box-controller-specific properties to this algorithm
......@@ -145,5 +144,4 @@ void BoxControllerSettingsAlgorithm::setBoxController(const BoxController_sptr &
bc->resetNumBoxes();
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -14,8 +14,7 @@
#include <map>
#include <memory>
namespace Mantid {
namespace API {
namespace Mantid::API {
/**
* 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
......@@ -106,5 +105,4 @@ std::vector<CatalogSession_sptr> CatalogManagerImpl::getActiveSessions() {
/// @returns An unsigned value indicating the number of active sessions
size_t CatalogManagerImpl::numberActiveSessions() const { return m_activeCatalogs.size(); }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -9,8 +9,7 @@
#include "MantidAPI/CatalogSession.h"
#include "MantidKernel/Logger.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
/**
* Initialise the related catalog session variables.
* @param sessionID :: The session ID generated from logging into the catalog.
......@@ -43,5 +42,4 @@ const std::string &CatalogSession::getSoapEndpoint() const { return m_endpoint;
* @return The facility used to create the catalog.
*/
const std::string &CatalogSession::getFacility() const { return m_facility; }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -11,8 +11,7 @@
#include <stdexcept>
namespace Mantid {
namespace API {
namespace Mantid::API {
/*
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) {
file->closeGroup();
}
} // namespace API
} // namespace Mantid
\ No newline at end of file
} // namespace Mantid::API
\ No newline at end of file
Markdown is supported
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