Skip to content
Snippets Groups Projects
Commit 38810e36 authored by Gemma Guest's avatar Gemma Guest
Browse files

Add namespace for the ISISReflectometry GUI

Recent changes mean the classes now have shorter names so the namespace ensures will will not have any clashes with other GUIs.

Re #26535
parent da917eb0
No related merge requests found
Showing
with 41 additions and 1 deletion
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
Clipboard::Clipboard() : m_subtrees(boost::none), m_subtreeRoots(boost::none) {} Clipboard::Clipboard() : m_subtrees(boost::none), m_subtreeRoots(boost::none) {}
...@@ -156,5 +157,6 @@ Clipboard::mutableSubtreeRoots() { ...@@ -156,5 +157,6 @@ Clipboard::mutableSubtreeRoots() {
bool containsGroups(Clipboard const &clipboard) { bool containsGroups(Clipboard const &clipboard) {
return containsGroups(clipboard.subtreeRoots()); return containsGroups(clipboard.subtreeRoots());
} }
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
class Clipboard { class Clipboard {
public: public:
...@@ -67,6 +68,7 @@ private: ...@@ -67,6 +68,7 @@ private:
}; };
bool containsGroups(Clipboard const &clipboard); bool containsGroups(Clipboard const &clipboard);
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
#endif // MANTID_CUSTOMINTERFACES_CLIPBOARD_H_ #endif // MANTID_CUSTOMINTERFACES_CLIPBOARD_H_
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
template <typename T> boost::optional<T> first(std::vector<T> const &values) { template <typename T> boost::optional<T> first(std::vector<T> const &values) {
if (values.size() > 0) if (values.size() > 0)
...@@ -39,6 +40,7 @@ public: ...@@ -39,6 +40,7 @@ public:
return boost::none; return boost::none;
} }
}; };
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
#endif // MANTID_ISISREFLECTOMETRY_FIRST_H #endif // MANTID_ISISREFLECTOMETRY_FIRST_H
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "GetInstrumentParameter.h" #include "GetInstrumentParameter.h"
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
std::vector<std::string> InstrumentParameter<std::string>::get( std::vector<std::string> InstrumentParameter<std::string>::get(
Mantid::Geometry::Instrument_const_sptr instrument, Mantid::Geometry::Instrument_const_sptr instrument,
...@@ -69,5 +70,6 @@ std::string const &InstrumentParameterTypeMissmatch::expectedType() const { ...@@ -69,5 +70,6 @@ std::string const &InstrumentParameterTypeMissmatch::expectedType() const {
std::string const &InstrumentParameterTypeMissmatch::originalMessage() const { std::string const &InstrumentParameterTypeMissmatch::originalMessage() const {
return m_originalMessage; return m_originalMessage;
} }
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <vector> #include <vector>
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
template <typename T> class InstrumentParameter; template <typename T> class InstrumentParameter;
template <> class InstrumentParameter<std::string> { template <> class InstrumentParameter<std::string> {
...@@ -131,6 +132,7 @@ auto getInstrumentParameter(Mantid::Geometry::Instrument_const_sptr instrument, ...@@ -131,6 +132,7 @@ auto getInstrumentParameter(Mantid::Geometry::Instrument_const_sptr instrument,
std::declval<std::string const &>())) { std::declval<std::string const &>())) {
return InstrumentParameter<T>::get(instrument, parameterName); return InstrumentParameter<T>::get(instrument, parameterName);
} }
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
#endif // MANTID_ISISREFLECTOMETRY_GETINSTRUMENTPARAMETER_H #endif // MANTID_ISISREFLECTOMETRY_GETINSTRUMENTPARAMETER_H
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
template <typename Container, typename Predicate> template <typename Container, typename Predicate>
boost::optional<int> indexOf(Container const &container, Predicate pred) { boost::optional<int> indexOf(Container const &container, Predicate pred) {
...@@ -30,6 +31,7 @@ boost::optional<int> indexOfValue(Container const &container, ValueType value) { ...@@ -30,6 +31,7 @@ boost::optional<int> indexOfValue(Container const &container, ValueType value) {
else else
return boost::none; return boost::none;
} }
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
#endif // MANTID_ISISREFLECTOMETRY_INDEXOF_H #endif // MANTID_ISISREFLECTOMETRY_INDEXOF_H
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "InstrumentParameters.h" #include "InstrumentParameters.h"
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
InstrumentParameters::InstrumentParameters( InstrumentParameters::InstrumentParameters(
Mantid::Geometry::Instrument_const_sptr instrument) Mantid::Geometry::Instrument_const_sptr instrument)
: m_instrument(std::move(instrument)) {} : m_instrument(std::move(instrument)) {}
...@@ -32,5 +33,6 @@ bool InstrumentParameters::hasMissingValues() const { ...@@ -32,5 +33,6 @@ bool InstrumentParameters::hasMissingValues() const {
std::string const &MissingInstrumentParameterValue::parameterName() const { std::string const &MissingInstrumentParameterValue::parameterName() const {
return m_parameterName; return m_parameterName;
} }
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
template <typename T> template <typename T>
boost::optional<T> boost::optional<T>
...@@ -133,6 +134,7 @@ private: ...@@ -133,6 +134,7 @@ private:
std::vector<InstrumentParameterTypeMissmatch> m_typeErrors; std::vector<InstrumentParameterTypeMissmatch> m_typeErrors;
std::vector<MissingInstrumentParameterValue> m_missingValueErrors; std::vector<MissingInstrumentParameterValue> m_missingValueErrors;
}; };
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
#endif // MANTID_ISISREFLECTOMETRY_INSTRUMENTPARAMETERS_H #endif // MANTID_ISISREFLECTOMETRY_INSTRUMENTPARAMETERS_H
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
template <typename Container, typename Transform, template <typename Container, typename Transform,
typename Out = typename std::result_of< typename Out = typename std::result_of<
...@@ -42,6 +43,7 @@ std::string optionalToString(boost::optional<T> maybeValue) { ...@@ -42,6 +43,7 @@ std::string optionalToString(boost::optional<T> maybeValue) {
}) })
.get_value_or(std::string()); .get_value_or(std::string());
} }
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
#endif // MANTID_ISISREFLECTOMETRY_MAP_H #endif // MANTID_ISISREFLECTOMETRY_MAP_H
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
OptionDefaults::OptionDefaults( OptionDefaults::OptionDefaults(
Mantid::Geometry::Instrument_const_sptr instrument) Mantid::Geometry::Instrument_const_sptr instrument)
...@@ -57,5 +58,6 @@ std::string OptionDefaults::getString(std::string const &propertyName, ...@@ -57,5 +58,6 @@ std::string OptionDefaults::getString(std::string const &propertyName,
std::string const &parameterName) const { std::string const &parameterName) const {
return getValue<std::string>(propertyName, parameterName); return getValue<std::string>(propertyName, parameterName);
} }
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
/** @class OptionDefaults /** @class OptionDefaults
...@@ -78,6 +79,7 @@ T OptionDefaults::getValue(std::string const &propertyName, ...@@ -78,6 +79,7 @@ T OptionDefaults::getValue(std::string const &propertyName,
return Mantid::API::checkForMandatoryInstrumentDefault<T>( return Mantid::API::checkForMandatoryInstrumentDefault<T>(
m_algorithm.get(), propertyName, m_instrument, parameterName); m_algorithm.get(), propertyName, m_instrument, parameterName);
} }
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
#endif // MANTID_ISISREFLECTOMETRY_OPTIONDEFAULTS_H #endif // MANTID_ISISREFLECTOMETRY_OPTIONDEFAULTS_H
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
bool isEntirelyWhitespace(std::string const &string) { bool isEntirelyWhitespace(std::string const &string) {
return std::all_of(string.cbegin(), string.cend(), return std::all_of(string.cbegin(), string.cend(),
...@@ -70,5 +71,6 @@ boost::optional<int> parseNonNegativeInt(std::string string) { ...@@ -70,5 +71,6 @@ boost::optional<int> parseNonNegativeInt(std::string string) {
else else
return boost::none; return boost::none;
} }
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
MANTIDQT_ISISREFLECTOMETRY_DLL boost::optional<double> MANTIDQT_ISISREFLECTOMETRY_DLL boost::optional<double>
parseDouble(std::string string); parseDouble(std::string string);
...@@ -56,6 +57,7 @@ parseList(std::string commaSeparatedValues, ParseItemFunction parseItem) { ...@@ -56,6 +57,7 @@ parseList(std::string commaSeparatedValues, ParseItemFunction parseItem) {
return std::vector<ParsedItem>(); return std::vector<ParsedItem>();
} }
} }
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
#endif // MANTID_CUSTOMINTERFACES_PARSE_H_ #endif // MANTID_CUSTOMINTERFACES_PARSE_H_
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <cstddef> #include <cstddef>
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
template <std::size_t N> class QWidgetGroup { template <std::size_t N> class QWidgetGroup {
public: public:
QWidgetGroup() : m_widgets() {} QWidgetGroup() : m_widgets() {}
...@@ -36,6 +37,7 @@ QWidgetGroup<sizeof...(Ts)> makeQWidgetGroup(Ts... widgets) { ...@@ -36,6 +37,7 @@ QWidgetGroup<sizeof...(Ts)> makeQWidgetGroup(Ts... widgets) {
return QWidgetGroup<sizeof...(Ts)>( return QWidgetGroup<sizeof...(Ts)>(
std::array<QWidget *, sizeof...(Ts)>({{widgets...}})); std::array<QWidget *, sizeof...(Ts)>({{widgets...}}));
} }
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
#endif // MANTID_ISISREFLECTOMETRY_QWIDGETGROUP_H #endif // MANTID_ISISREFLECTOMETRY_QWIDGETGROUP_H
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
template <typename Validated, typename Error = boost::blank> template <typename Validated, typename Error = boost::blank>
class ValidationResult { class ValidationResult {
...@@ -69,6 +70,7 @@ ValidationResult<Validated, Error>::validElseNone() const { ...@@ -69,6 +70,7 @@ ValidationResult<Validated, Error>::validElseNone() const {
else else
return boost::none; return boost::none;
} }
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
#endif // MANTID_ISISREFLECTOMETRY_RESULT_H #endif // MANTID_ISISREFLECTOMETRY_RESULT_H
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
template <class... Containers> template <class... Containers>
auto zip_range(Containers &... containers) auto zip_range(Containers &... containers)
...@@ -20,6 +21,7 @@ auto zip_range(Containers &... containers) ...@@ -20,6 +21,7 @@ auto zip_range(Containers &... containers)
return {boost::make_zip_iterator(boost::make_tuple(containers.begin()...)), return {boost::make_zip_iterator(boost::make_tuple(containers.begin()...)),
boost::make_zip_iterator(boost::make_tuple(containers.end()...))}; boost::make_zip_iterator(boost::make_tuple(containers.end()...))};
} }
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
#endif // MANTID_ISISREFLECTOMETRY_ZIPRANGE_H #endif // MANTID_ISISREFLECTOMETRY_ZIPRANGE_H
...@@ -11,12 +11,13 @@ ...@@ -11,12 +11,13 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
namespace AlgorithmProperties {
using API::IConfiguredAlgorithm_sptr; using API::IConfiguredAlgorithm_sptr;
using Mantid::API::IAlgorithm_sptr; using Mantid::API::IAlgorithm_sptr;
using Mantid::API::Workspace_sptr; using Mantid::API::Workspace_sptr;
namespace AlgorithmProperties {
std::string boolToString(bool value) { return value ? "1" : "0"; } std::string boolToString(bool value) { return value ? "1" : "0"; }
void update(std::string const &property, std::string const &value, void update(std::string const &property, std::string const &value,
...@@ -77,5 +78,6 @@ std::string getOutputWorkspace(IAlgorithm_sptr algorithm, ...@@ -77,5 +78,6 @@ std::string getOutputWorkspace(IAlgorithm_sptr algorithm,
return workspaceName; return workspaceName;
} }
} // namespace AlgorithmProperties } // namespace AlgorithmProperties
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
namespace AlgorithmProperties { namespace AlgorithmProperties {
using AlgorithmRuntimeProps = std::map<std::string, std::string>; using AlgorithmRuntimeProps = std::map<std::string, std::string>;
...@@ -61,6 +62,7 @@ void update(std::string const &property, std::vector<VALUE_TYPE> const &values, ...@@ -61,6 +62,7 @@ void update(std::string const &property, std::vector<VALUE_TYPE> const &values,
update(property, value, properties); update(property, value, properties);
} }
} // namespace AlgorithmProperties } // namespace AlgorithmProperties
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
using API::IConfiguredAlgorithm_sptr; using API::IConfiguredAlgorithm_sptr;
using Mantid::API::IAlgorithm_sptr; using Mantid::API::IAlgorithm_sptr;
...@@ -26,5 +27,6 @@ void BatchJobAlgorithm::updateItem() { ...@@ -26,5 +27,6 @@ void BatchJobAlgorithm::updateItem() {
if (m_item) if (m_item)
m_updateFunction(m_algorithm, *m_item); m_updateFunction(m_algorithm, *m_item);
} }
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
namespace MantidQt { namespace MantidQt {
namespace CustomInterfaces { namespace CustomInterfaces {
namespace ISISReflectometry {
/** /**
* The BatchJobAlgorithm class overrides ConfiguredAlgorithm so that * The BatchJobAlgorithm class overrides ConfiguredAlgorithm so that
...@@ -41,6 +42,7 @@ private: ...@@ -41,6 +42,7 @@ private:
}; };
using BatchJobAlgorithm_sptr = boost::shared_ptr<BatchJobAlgorithm>; using BatchJobAlgorithm_sptr = boost::shared_ptr<BatchJobAlgorithm>;
} // namespace ISISReflectometry
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment