Mantid
Loading...
Searching...
No Matches
FunctionBrowserUtils.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
10
11#include <QString>
12
13#include <string>
14#include <vector>
15
16namespace MantidQt {
17namespace MantidWidgets {
18
19using namespace Mantid::API;
20
28EXPORT_OPT_MANTIDQT_COMMON std::pair<std::string, std::string> splitParameterName(std::string const &parameterName);
29
36
39EXPORT_OPT_MANTIDQT_COMMON std::pair<std::string, int> splitFunctionPrefix(std::string const &prefix);
40
43EXPORT_OPT_MANTIDQT_COMMON std::pair<std::string, std::pair<std::string, std::string>>
44splitConstraintString(const std::string &constraint);
45
47EXPORT_OPT_MANTIDQT_COMMON bool isNumber(std::string const &str);
48
50EXPORT_OPT_MANTIDQT_COMMON std::vector<std::string> splitStringBy(std::string const &str, std::string const &delimiter);
51
53EXPORT_OPT_MANTIDQT_COMMON std::size_t getFunctionIndexAt(std::string const &parameter, std::size_t const &index);
54
56 bool &m_ref;
58
59public:
60 ScopedFalse(bool &variable) : m_ref(variable), m_oldValue(variable) { m_ref = false; }
62};
63
64} // namespace MantidWidgets
65} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition DllOption.h:15
std::map< DeltaEMode::Type, std::string > index
EXPORT_OPT_MANTIDQT_COMMON std::pair< std::string, std::pair< std::string, std::string > > splitConstraintString(const std::string &constraint)
Split a constraint definition into a parameter name and a pair of bounds, for example -1 < f0....
EXPORT_OPT_MANTIDQT_COMMON std::pair< std::string, int > splitFunctionPrefix(std::string const &prefix)
Split a function (eg f0.f3.f1.) into the parent prefix (f0.f3.) and the index of the child function (...
EXPORT_OPT_MANTIDQT_COMMON bool isNumber(std::string const &str)
Checks if a string contains a number, or whether it contains characters.
EXPORT_OPT_MANTIDQT_COMMON std::size_t getFunctionIndexAt(std::string const &parameter, std::size_t const &index)
Returns the function index found at index of a parameter.
EXPORT_OPT_MANTIDQT_COMMON IFunction_sptr getFunctionWithPrefix(std::string const &prefix, const IFunction_sptr &fun)
Get a child function of a parent function whose parameters start with a given prefix.
EXPORT_OPT_MANTIDQT_COMMON std::vector< std::string > splitStringBy(std::string const &str, std::string const &delimiter)
Splits the string by the given delimiters.
EXPORT_OPT_MANTIDQT_COMMON std::pair< std::string, std::string > splitParameterName(std::string const &parameterName)
Split a qualified parameter name into function index and local parameter name.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
std::shared_ptr< IFunction > IFunction_sptr
shared pointer to the function base class
Definition IFunction.h:743