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
......@@ -41,8 +41,7 @@
#include <sstream>
#include <utility>
namespace Mantid {
namespace API {
namespace Mantid::API {
using namespace Geometry;
namespace {
......@@ -1508,12 +1507,10 @@ void IFunction::sortTies() {
}
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
///\cond TEMPLATE
namespace Mantid {
namespace Kernel {
namespace Mantid::Kernel {
template <>
MANTID_API_DLL std::shared_ptr<Mantid::API::IFunction>
......@@ -1540,6 +1537,5 @@ IPropertyManager::getValue<std::shared_ptr<const Mantid::API::IFunction>>(const
}
}
} // namespace Kernel
} // namespace Mantid
} // namespace Mantid::Kernel
///\endcond TEMPLATE
......@@ -29,8 +29,7 @@
#include <sstream>
namespace Mantid {
namespace API {
namespace Mantid::API {
using namespace Geometry;
/// init logger
......@@ -117,5 +116,4 @@ void IFunction1D::histogramDerivative1D(Jacobian *jacobian, double left, const d
throw Kernel::Exception::NotImplementedError("Integration is not implemented for this function.");
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -6,8 +6,7 @@
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAPI/IFunction1DSpectrum.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
Kernel::Logger IFunction1DSpectrum::g_log("IFunction1DSpectrum");
......@@ -33,5 +32,4 @@ void IFunction1DSpectrum::functionDeriv1DSpectrum(const FunctionDomain1DSpectrum
calNumericalDeriv(domain, jacobian);
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -6,8 +6,7 @@
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAPI/IFunctionGeneral.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
Kernel::Logger IFunctionGeneral::g_log("IFunctionGeneral");
......@@ -38,5 +37,4 @@ size_t IFunctionGeneral::getValuesSize(const FunctionDomain &domain) const {
size_t IFunctionGeneral::getDefaultDomainSize() const { return 0; }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -25,8 +25,7 @@
#include <iterator>
#include <sstream>
namespace Mantid {
namespace API {
namespace Mantid::API {
using namespace Geometry;
/// Virtual copy constructor
......@@ -125,8 +124,7 @@ void IFunctionMD::useAllDimensions(IMDWorkspace_const_sptr workspace) {
this->initDimensions();
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
//#include "MantidAPI/ParamFunction.h"
//#include "MantidKernel/VMD.h"
......
......@@ -10,8 +10,7 @@
#include "MantidAPI/IFunctionMW.h"
#include "MantidAPI/MatrixWorkspace.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
using namespace Geometry;
/** Initialize the function providing it the workspace
......@@ -33,5 +32,4 @@ void IFunctionMW::setMatrixWorkspace(std::shared_ptr<const API::MatrixWorkspace>
*/
std::shared_ptr<const API::MatrixWorkspace> IFunctionMW::getMatrixWorkspace() const { return m_workspace.lock(); }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -7,13 +7,11 @@
#include "MantidAPI/IJournal.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
IJournal::~IJournal() = default;
IJournal::IJournal(IJournal &&rhs) = default;
IJournal &IJournal::operator=(IJournal &&rhs) = default;
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -6,8 +6,7 @@
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAPI/ILatticeFunction.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
using namespace Geometry;
......@@ -62,5 +61,4 @@ void ILatticeFunction::functionDerivLattice(const LatticeDomain &latticeDomain,
throw Kernel::Exception::NotImplementedError("FunctionLatticeDeriv is not implemented for this function.");
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -13,8 +13,7 @@
using Mantid::coord_t;
using namespace Mantid::Geometry;
namespace Mantid {
namespace API {
namespace Mantid::API {
//-----------------------------------------------------------------------------------------------
/** Empty constructor */
......@@ -60,12 +59,9 @@ const std::string IMDEventWorkspace::toString() const {
//-----------------------------------------------------------------------------------------------
} // namespace API
} // namespace Mantid::API
} // namespace Mantid
namespace Mantid {
namespace Kernel {
namespace Mantid::Kernel {
/** In order to be able to cast PropertyWithValue classes correctly a definition
* for the PropertyWithValue<IMDEventWorkspace> is required */
template <>
......@@ -105,5 +101,4 @@ IPropertyManager::getValue<Mantid::API::IMDEventWorkspace_const_sptr>(const std:
}
}
} // namespace Kernel
} // namespace Mantid
} // namespace Mantid::Kernel
......@@ -16,8 +16,7 @@
using namespace Mantid::Kernel;
using namespace Mantid::API;
namespace Mantid {
namespace API {
namespace Mantid::API {
//----------------------------------------------------------------------------------------------
......@@ -29,11 +28,9 @@ const std::string IMDHistoWorkspace::toString() const {
return os.str();
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
namespace Mantid {
namespace Kernel {
namespace Mantid::Kernel {
/** In order to be able to cast PropertyWithValue classes correctly a definition
* for the PropertyWithValue<IMDEventWorkspace> is required */
template <>
......@@ -64,5 +61,4 @@ IPropertyManager::getValue<Mantid::API::IMDHistoWorkspace_const_sptr>(const std:
}
}
} // namespace Kernel
} // namespace Mantid
} // namespace Mantid::Kernel
......@@ -9,8 +9,7 @@
//----------------------------------------------------------------------
#include "MantidAPI/IMDIterator.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
/** Default constructor */
IMDIterator::IMDIterator() : m_normalization(Mantid::API::VolumeNormalization) {}
......@@ -25,5 +24,4 @@ void IMDIterator::setNormalization(Mantid::API::MDNormalization normalization) {
*/
Mantid::API::MDNormalization IMDIterator::getNormalization() const { return m_normalization; }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -16,8 +16,7 @@
using Mantid::Kernel::VMD;
namespace Mantid {
namespace API {
namespace Mantid::API {
//-----------------------------------------------------------------------------------------------
/** Default constructor */
IMDWorkspace::IMDWorkspace(const Parallel::StorageMode storageMode)
......@@ -182,11 +181,9 @@ MDNormalization IMDWorkspace::displayNormalization() const { return NoNormalizat
none for the generic case, but overriden elsewhere.
*/
MDNormalization IMDWorkspace::displayNormalizationHisto() const { return NoNormalization; }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
namespace Mantid {
namespace Kernel {
namespace Mantid::Kernel {
/** In order to be able to cast PropertyWithValue classes correctly a definition
* for the PropertyWithValue<IMDEventWorkspace> is required */
template <>
......@@ -217,5 +214,4 @@ IPropertyManager::getValue<Mantid::API::IMDWorkspace_const_sptr>(const std::stri
}
}
} // namespace Kernel
} // namespace Mantid
} // namespace Mantid::Kernel
......@@ -6,10 +6,8 @@
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAPI/IPawleyFunction.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
/// Default constructor
IPawleyFunction::IPawleyFunction() : FunctionParameterDecorator() {}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -20,8 +20,7 @@
#include <limits>
#include <memory>
namespace Mantid {
namespace API {
namespace Mantid::API {
namespace {
......@@ -273,5 +272,4 @@ void IPeakFunction::functionDerivLocal(Jacobian *jacobian, const double *xValues
this->calcNumericalDerivative1D(jacobian, std::move(evalMethod), xValues, nData);
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -11,8 +11,7 @@
#include "MantidKernel/ConfigService.h"
#include "MantidKernel/IPropertyManager.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
using namespace Kernel;
......@@ -28,14 +27,11 @@ const std::string IPeaksWorkspace::toString() const {
return os.str();
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
///\cond TEMPLATE
namespace Mantid {
namespace Kernel {
namespace Mantid::Kernel {
template <>
MANTID_API_DLL Mantid::API::IPeaksWorkspace_sptr
......@@ -63,7 +59,6 @@ IPropertyManager::getValue<Mantid::API::IPeaksWorkspace_const_sptr>(const std::s
}
}
} // namespace Kernel
} // namespace Mantid
} // namespace Mantid::Kernel
///\endcond TEMPLATE
......@@ -17,8 +17,7 @@
const double IGNOREDCHANGE = 1.0E-9;
namespace Mantid {
namespace API {
namespace Mantid::API {
int IPowderDiffPeakFunction::s_peakRadius = 5;
......@@ -254,5 +253,4 @@ std::complex<double> E1(std::complex<double> z) {
return exp_e1;
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -9,8 +9,7 @@
#include "MantidHistogramData/Histogram.h"
#include "MantidKernel/System.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
/** Constructor with spectrum number
* @param specNo :: spectrum # of the spectrum
......@@ -212,5 +211,4 @@ void ISpectrum::copyDataInto(SpectrumTester & /*unused*/) const {
throw std::runtime_error("Incompatible types in ISpectrum::copyDataFrom");
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -8,8 +8,7 @@
#include "MantidAPI/AnalysisDataService.h"
#include "MantidKernel/IPropertyManager.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
/// Returns a clone of the workspace
/// @param colNames :: Names of the column to clone. If empty clone
......@@ -96,12 +95,10 @@ void ITableWorkspace::sort(std::vector<std::pair<std::string, bool>> &criteria)
"returns true. Please contact the developers.");
}
} // namespace API
} // Namespace Mantid
} // namespace Mantid::API
///\cond TEMPLATE
namespace Mantid {
namespace Kernel {
namespace Mantid::Kernel {
template <>
MANTID_API_DLL API::ITableWorkspace_sptr
IPropertyManager::getValue<API::ITableWorkspace_sptr>(const std::string &name) const {
......@@ -128,7 +125,6 @@ IPropertyManager::getValue<API::ITableWorkspace_const_sptr>(const std::string &n
}
}
} // namespace Kernel
} // namespace Mantid
} // namespace Mantid::Kernel
///\endcond TEMPLATE
......@@ -12,8 +12,7 @@
#include <algorithm>
namespace Mantid {
namespace API {
namespace Mantid::API {
using std::size_t;
......@@ -135,5 +134,4 @@ void ImmutableCompositeFunction::addDefaultConstraints(const std::string &constr
CompositeFunction::addConstraints(constraints, true);
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -15,8 +15,7 @@
#include <Poco/Path.h>
#include <boost/scoped_ptr.hpp>
namespace Mantid {
namespace API {
namespace Mantid::API {
Mantid::Geometry::MDImplicitFunction_sptr ImplicitFunctionFactoryImpl::create(const std::string &className) const {
UNUSED_ARG(className);
......@@ -47,5 +46,4 @@ ImplicitFunctionFactoryImpl::createUnwrapped(const std::string &processXML) cons
boost::scoped_ptr<ImplicitFunctionBuilder> functionBuilder(funcParser->createFunctionBuilder(pInstructionsXML));
return functionBuilder->create();
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
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