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
......@@ -21,9 +21,7 @@
//#include <cstdlib>
#include <iterator>
namespace Mantid {
namespace API {
namespace Mantid::API {
using Mantid::Kernel::ConfigService;
using Mantid::Kernel::DirectoryValidator;
......@@ -401,5 +399,4 @@ std::string FileProperty::setSaveProperty(const std::string &propValue) {
}
return errorMsg;
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -11,8 +11,7 @@
#include <stdexcept>
namespace Mantid {
namespace API {
namespace Mantid::API {
FuncMinimizerFactoryImpl::FuncMinimizerFactoryImpl() : Kernel::DynamicFactory<IFuncMinimizer>() {
// we need to make sure the library manager has been loaded before we
......@@ -61,5 +60,4 @@ std::shared_ptr<IFuncMinimizer> FuncMinimizerFactoryImpl::createMinimizer(const
return minimizer;
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -9,8 +9,7 @@
//----------------------------------------------------------------------
#include "MantidAPI/FunctionDomain1D.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
/// The constructor
FunctionDomain1D::FunctionDomain1D(const double *x, size_t n) : m_data(x), m_n(n), m_peakRadius(0) {}
......@@ -173,5 +172,4 @@ FunctionDomain1DHistogram::FunctionDomain1DHistogram(std::vector<double>::const_
/// Get the leftmost boundary
double FunctionDomain1DHistogram::leftBoundary() const { return m_bins.front(); }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -10,8 +10,7 @@
#include "MantidAPI/FunctionDomainGeneral.h"
#include "MantidAPI/Column.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
/// Return the number of arguments in the domain
size_t FunctionDomainGeneral::size() const { return m_columns.empty() ? 0 : m_columns.front()->size(); }
......@@ -36,5 +35,4 @@ void FunctionDomainGeneral::addColumn(const std::shared_ptr<Column> &column) {
/// @param i :: Index of a column to get.
std::shared_ptr<Column> FunctionDomainGeneral::getColumn(size_t i) const { return m_columns.at(i); }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -12,8 +12,7 @@
#include <stdexcept>
namespace Mantid {
namespace API {
namespace Mantid::API {
/**
* Create a domain form a IMDWorkspace.
......@@ -70,5 +69,4 @@ const IMDIterator *FunctionDomainMD::getNextIterator() const {
/// Returns the pointer to the original workspace
IMDWorkspace_const_sptr FunctionDomainMD::getWorkspace() const { return m_workspace; }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -21,8 +21,7 @@
#include <boost/lexical_cast.hpp>
#include <sstream>
namespace Mantid {
namespace API {
namespace Mantid::API {
FunctionFactoryImpl::FunctionFactoryImpl() : Kernel::DynamicFactory<IFunction>() {
// we need to make sure the library manager has been loaded before we
......@@ -404,5 +403,4 @@ void FunctionFactoryImpl::unsubscribe(const std::string &className) {
Kernel::DynamicFactory<IFunction>::unsubscribe(className);
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -10,8 +10,7 @@
#include "MantidAPI/IConstraint.h"
#include "MantidAPI/ParameterTie.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
using namespace Kernel;
......@@ -340,5 +339,4 @@ IConstraint *FunctionGenerator::getConstraint(size_t i) const {
return constraint;
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -11,8 +11,7 @@
#include "MantidAPI/ParameterReference.h"
#include "MantidAPI/ParameterTie.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
void FunctionParameterDecorator::setDecoratedFunction(const std::string &wrappedFunctionName) {
IFunction_sptr fn = FunctionFactory::Instance().createFunction(wrappedFunctionName);
......@@ -312,5 +311,4 @@ void FunctionParameterDecorator::beforeDecoratedFunctionSet(const IFunction_sptr
void FunctionParameterDecorator::setDecoratedFunctionPrivate(const IFunction_sptr &fn) { m_wrappedFunction = fn; }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -10,8 +10,7 @@
#include <json/value.h>
namespace Mantid {
namespace API {
namespace Mantid::API {
/** Constructor.
* Sets the property names but initialises the function pointer to null.
* @param name :: The name to assign to the property
......@@ -126,5 +125,4 @@ bool FunctionProperty::isDefault() const { return m_value == std::shared_ptr<IFu
/// @return A populated PropertyHistory for this class
const Kernel::PropertyHistory FunctionProperty::createHistory() const { return Kernel::PropertyHistory(this); }
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -11,8 +11,7 @@
#include <algorithm>
#include <functional>
namespace Mantid {
namespace API {
namespace Mantid::API {
/// Constructor.
/// @param n :: A number of values to store.
......@@ -221,5 +220,4 @@ void FunctionValues::setFitDataFromCalculated(const FunctionValues &values) {
m_data.assign(values.m_calculated.begin(), values.m_calculated.end());
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -13,8 +13,7 @@
#include "MantidAPI/GridDomain.h"
#include "MantidKernel/Logger.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
namespace {
/// static logger
Kernel::Logger g_log("GridDomain");
......@@ -53,5 +52,4 @@ void GridDomain::reScale(const std::string &scaling) {
grid->reScale(scaling);
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -13,8 +13,7 @@
#include "MantidAPI/ITransformScale.h"
#include "MantidAPI/TransformScaleFactory.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
void GridDomain1D::initialize(double &startX, double &endX, size_t &n, const std::string &scaling) {
m_points.resize(n);
......@@ -29,5 +28,4 @@ void GridDomain1D::reScale(const std::string &scaling) {
m_scaling = scaling;
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -20,8 +20,7 @@
using namespace Poco::XML;
namespace Mantid {
namespace API {
namespace Mantid::API {
//----------------------------------------------------------------------------------------------
/** Constructor without field direction
......@@ -269,5 +268,4 @@ ITableWorkspace_sptr Grouping::toTable() const {
*/
Grouping::~Grouping() = default;
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -5,7 +5,3 @@
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAPI/HistoWorkspace.h"
namespace Mantid {
namespace API {}
} // namespace Mantid
......@@ -7,8 +7,7 @@
#include "MantidAPI/HistogramValidator.h"
#include "MantidAPI/MatrixWorkspace.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
/** Constructor
*
......@@ -41,5 +40,4 @@ std::string HistogramValidator::checkValidity(const MatrixWorkspace_sptr &value)
}
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -11,11 +11,9 @@
#include "MantidAPI/HistoryItem.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
HistoryItem::HistoryItem(AlgorithmHistory_const_sptr algHist)
: m_algorithmHistory(std::move(algHist)), m_unrolled(false) {}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -11,8 +11,7 @@
#include <algorithm>
#include <iterator>
namespace Mantid {
namespace API {
namespace Mantid::API {
HistoryView::HistoryView(const WorkspaceHistory &wsHist) : m_wsHist(wsHist), m_historyItems() {
// add all of the top level algorithms to the view by default
......@@ -189,5 +188,4 @@ void HistoryView::filterBetweenExecDate(Mantid::Types::Core::DateAndTime start,
m_historyItems.erase(lastItem, m_historyItems.end());
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -12,8 +12,7 @@
#include "MantidAPI/IDomainCreator.h"
#include "MantidAPI/Workspace.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
/**
* @param manager :: A property manager which has information about the data
......@@ -76,5 +75,4 @@ void IDomainCreator::initFunction(API::IFunction_sptr function) {
}
}
} // namespace API
} // namespace Mantid
} // namespace Mantid::API
......@@ -6,7 +6,3 @@
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidAPI/IEventList.h"
#include "MantidKernel/System.h"
namespace Mantid {
namespace API {} // namespace API
} // namespace Mantid
......@@ -9,8 +9,7 @@
//----------------------------------------------------------------------
#include "MantidAPI/IFuncMinimizer.h"
namespace Mantid {
namespace API {
namespace Mantid::API {
/**
* Do minimization of the set function.
......@@ -44,5 +43,4 @@ bool IFuncMinimizer::minimize(size_t maxIterations) {
return success;
}
} // 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