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
......@@ -9,8 +9,7 @@
#include <Poco/DOM/Element.h>
#include <Poco/DOM/NodeList.h>
namespace Mantid {
namespace API {
namespace Mantid::API {
std::shared_ptr<ImplicitFunctionParameterParser>
ImplicitFunctionParameterParserFactoryImpl::create(const std::string &xmlString) const {
......@@ -42,5 +41,4 @@ ImplicitFunctionParameterParserFactoryImpl::createImplicitFunctionParameterParse
}
return paramParser;
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -11,8 +11,7 @@
#include <Poco/DOM/Element.h>
#include <Poco/DOM/NodeList.h>
namespace Mantid {
namespace API {
namespace Mantid::API {
std::shared_ptr<ImplicitFunctionParser> ImplicitFunctionParserFactoryImpl::create(const std::string &xmlString) const {
UNUSED_ARG(xmlString);
......@@ -70,5 +69,4 @@ ImplicitFunctionParserFactoryImpl::createImplicitFunctionParserFromXML(const std
return createImplicitFunctionParserFromXML(pRootElem);
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -8,8 +8,7 @@
#include "MantidAPI/Axis.h"
#include "MantidAPI/MatrixWorkspace_fwd.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
/// Clone the current state
Kernel::IValidator_sptr IncreasingAxisValidator::clone() const {
......@@ -40,5 +39,4 @@ std::string IncreasingAxisValidator::checkValidity(const MatrixWorkspace_sptr &v
return "";
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -13,8 +13,7 @@
#include "MantidIndexing/SpectrumNumber.h"
#include "MantidKernel/WarningSuppressions.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
IndexProperty::IndexProperty(const std::string &name, const IWorkspaceProperty &workspaceProp,
const IndexTypeProperty &indexTypeProp, const Kernel::IValidator_sptr &validator)
: ArrayProperty(name, "", validator), m_workspaceProp(workspaceProp), m_indexTypeProp(indexTypeProp), m_indices(0),
......@@ -121,5 +120,4 @@ const Indexing::IndexInfo &IndexProperty::getIndexInfoFromWorkspace() const {
return wksp->indexInfo();
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -6,8 +6,7 @@
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAPI/IndexTypeProperty.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
IndexTypeProperty::IndexTypeProperty(const std::string &name, const int indexType)
: PropertyWithValue<std::string>(name, "", Kernel::Direction::Input) {
if (indexType & static_cast<int>(IndexType::WorkspaceIndex))
......@@ -71,5 +70,4 @@ IndexTypeProperty &IndexTypeProperty::operator=(API::IndexType type) {
std::string IndexTypeProperty::generatePropertyName(const std::string &name) { return name + "IndexType"; }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -6,13 +6,11 @@
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAPI/InstrumentDataService.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
/**
* Default constructor
*/
InstrumentDataServiceImpl::InstrumentDataServiceImpl()
: Mantid::Kernel::DataService<Mantid::Geometry::Instrument>("InstrumentDataService") {}
} // Namespace API
} // Namespace Mantid
} // namespace Mantid::API
......@@ -11,8 +11,7 @@
#include <list>
#include <memory>
namespace Mantid {
namespace API {
namespace Mantid::API {
using Kernel::Strings::join;
/**
......@@ -57,5 +56,4 @@ std::string InstrumentValidator::checkValidity(const std::shared_ptr<ExperimentI
}
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -10,8 +10,7 @@
#include "MantidAPI/JointDomain.h"
#include <numeric>
namespace Mantid {
namespace API {
namespace Mantid::API {
/// Return the overall size the domain which is a sum of sizes of the
/// member domains.
size_t JointDomain::size() const {
......@@ -31,5 +30,4 @@ const FunctionDomain &JointDomain::getDomain(size_t i) const { return *m_domains
*/
void JointDomain::addDomain(const FunctionDomain_sptr &domain) { m_domains.emplace_back(domain); }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -8,8 +8,7 @@
#include "MantidAPI/LatticeDomain.h"
#include "MantidKernel/Exception.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
LatticeDomain::LatticeDomain(std::vector<Kernel::V3D> hkls) : m_hkls(std::move(hkls)) {}
......@@ -22,5 +21,4 @@ const Kernel::V3D &LatticeDomain::operator[](size_t i) const {
return m_hkls[i];
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -11,8 +11,7 @@
#include "MantidAPI/LinearScale.h"
#include "MantidAPI/TransformScaleFactory.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
DECLARE_TRANSFORMSCALE(LinearScale)
......@@ -33,5 +32,4 @@ void LinearScale::transform(std::vector<double> &gd) {
}
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -7,8 +7,7 @@
#include "MantidAPI/LiveListener.h"
#include "MantidAPI/IAlgorithm.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
/// @copydoc ILiveListener::dataReset
bool LiveListener::dataReset() {
......@@ -30,5 +29,4 @@ void LiveListener::setSpectra(const std::vector<specnum_t> &specList) { UNUSED_A
*/
void LiveListener::setAlgorithm(const IAlgorithm &callingAlgorithm) { this->updatePropertyValues(callingAlgorithm); }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -12,8 +12,7 @@
using std::shared_ptr;
namespace Mantid {
namespace API {
namespace Mantid::API {
namespace {
/// static logger
Kernel::Logger g_log("LiveListenerFactory");
......@@ -121,5 +120,4 @@ ILiveListener *LiveListenerFactoryImpl::createUnwrapped(const std::string &class
throw Kernel::Exception::NotImplementedError("Don't use this method - use the safe one!!!");
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -18,8 +18,7 @@ namespace {
Mantid::Kernel::Logger g_log("LogFilterGenerator");
} // namespace
namespace Mantid {
namespace API {
namespace Mantid::API {
/**
* Constructor
......@@ -145,5 +144,4 @@ Property *LogFilterGenerator::getLogData(const std::string &logName, bool warnIf
}
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -12,8 +12,7 @@
#include <nexus/NeXusFile.hpp>
namespace Mantid {
namespace API {
namespace Mantid::API {
using namespace Kernel;
using namespace Types::Core;
......@@ -565,5 +564,4 @@ template MANTID_API_DLL std::vector<int> LogManager::getPropertyValueAsType(cons
template MANTID_API_DLL std::vector<long> LogManager::getPropertyValueAsType(const std::string &) const;
/** @endcond */
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -14,8 +14,7 @@
#include "MantidAPI/TransformScaleFactory.h"
#include "MantidKernel/Logger.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
namespace {
/// static logger
Kernel::Logger g_log("LogarithmScale");
......@@ -55,5 +54,4 @@ void LogarithmScale::transform(std::vector<double> &gd) {
}
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -11,8 +11,7 @@
using Mantid::Kernel::IValidator_sptr;
namespace Mantid {
namespace API {
namespace Mantid::API {
/** Constructor
*
......@@ -41,5 +40,4 @@ std::string MDFrameValidator::checkValidity(const IMDWorkspace_sptr &workspace)
return "";
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -20,8 +20,7 @@ using namespace Mantid::Kernel;
using namespace Mantid::API;
using namespace Mantid::Geometry;
namespace Mantid {
namespace API {
namespace Mantid::API {
class MDGeometryNotificationHelper {
public:
......@@ -522,5 +521,4 @@ size_t MDGeometry::getNumberTransformsToOriginal() const { return m_transforms_T
*/
size_t MDGeometry::getNumberTransformsFromOriginal() const { return m_transforms_FromOriginal.size(); }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -54,8 +54,7 @@ auto accumulate_if_finite = [](const double accumulator, const double newValue)
};
} // namespace
namespace Mantid {
namespace API {
namespace Mantid::API {
using std::size_t;
using namespace Geometry;
using Kernel::V3D;
......@@ -2112,12 +2111,10 @@ void MatrixWorkspace::rebuildDetectorIDGroupings() {
}
}
} // namespace API
} // Namespace Mantid
} // namespace Mantid::API
///\cond TEMPLATE
namespace Mantid {
namespace Kernel {
namespace Mantid::Kernel {
template <>
MANTID_API_DLL Mantid::API::MatrixWorkspace_sptr
......@@ -2145,7 +2142,6 @@ IPropertyManager::getValue<Mantid::API::MatrixWorkspace_const_sptr>(const std::s
}
}
} // namespace Kernel
} // namespace Mantid
} // namespace Mantid::Kernel
///\endcond TEMPLATE
......@@ -16,8 +16,7 @@
using namespace Mantid::Kernel;
using namespace Mantid::API;
namespace Mantid {
namespace API {
namespace Mantid::API {
//----------------------------------------------------------------------------------------------
/** Constructor
......@@ -286,5 +285,4 @@ bool MatrixWorkspaceMDIterator::isWithinBounds(const size_t /*index*/) const {
throw std::runtime_error("MatrixWorkspaceMDIterator does not implement isWithinBounds");
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -12,9 +12,7 @@
using namespace Mantid::PhysicalConstants;
namespace Mantid {
namespace API {
namespace MuParserUtils {
namespace Mantid::API::MuParserUtils {
// The constant names below try to follow the naming scheme of the
// scipy.constants Python module.
......@@ -56,6 +54,4 @@ void MANTID_API_DLL extraOneVarFunctions(mu::Parser &parser) {
}
}
} // namespace MuParserUtils
} // namespace API
} // namespace Mantid
} // namespace Mantid::API::MuParserUtils
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