Mantid
Loading...
Searching...
No Matches
ParameterInfo.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2026 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
8
9#include "MantidGeometry/DllConfig.h"
12
13#include <cstddef>
14#include <map>
15#include <memory>
16#include <set>
17#include <string>
18
19namespace Mantid {
20namespace Geometry {
21
22class ComponentInfo;
23
33class MANTID_GEOMETRY_DLL ParameterInfo {
34public:
45 std::multimap<std::string, std::shared_ptr<Parameter>, Kernel::CaseInsensitiveStringComparator>;
46
49 void add(size_t const componentIndex, std::shared_ptr<Parameter> const &parameter);
50
54 bool addFittingParameter(size_t const componentIndex, std::shared_ptr<Parameter> const &parameter,
55 std::string const &fittingFunction);
56
61 void insert(size_t const componentIndex, std::shared_ptr<Parameter> const &parameter);
62
64 bool contains(size_t const componentIndex, std::string const &name, std::string const &type = "") const;
65
67 std::shared_ptr<Parameter> get(size_t const componentIndex, std::string const &name,
68 std::string const &type = "") const;
69
71 std::shared_ptr<Parameter> getByType(size_t const componentIndex, std::string const &type) const;
72
74 std::shared_ptr<Parameter> getRecursive(ComponentInfo const &componentInfo, size_t const componentIndex,
75 std::string const &name, std::string const &type = "") const;
76
78 std::shared_ptr<Parameter> getRecursiveByType(ComponentInfo const &componentInfo, size_t const componentIndex,
79 std::string const &type) const;
80
83 std::shared_ptr<Parameter> getRecursiveFittingParameter(ComponentInfo const &componentInfo,
84 size_t const componentIndex, std::string const &name,
85 std::string const &fittingFunction) const;
86
89 std::set<std::string> names(size_t const componentIndex) const;
90
93 ComponentParameters const &parameters(size_t const componentIndex) const;
94
96 void clearParametersByName(std::string const &name);
97
99 void clearParametersByName(size_t const componentIndex, std::string const &name);
100
102 void clear();
103
104 bool empty() const;
105
107 size_t size() const;
108
109 size_t getMemorySize() const;
110
113 auto begin() const { return m_store.begin(); }
114 auto end() const { return m_store.end(); }
115
116private:
117 std::map<size_t, ComponentParameters> m_store;
118};
119
120} // namespace Geometry
121} // namespace Mantid
std::string name
Definition Run.cpp:60
ComponentInfo : Provides a component centric view on to the instrument.
ParameterInfo : the named parameters of an instrument, addressed by component index.
auto begin() const
Iteration over (component index, parameters) pairs, in ascending component-index order.
std::multimap< std::string, std::shared_ptr< Parameter >, Kernel::CaseInsensitiveStringComparator > ComponentParameters
Parameters of a single component, ordered by name.
std::map< size_t, ComponentParameters > m_store
Helper class which provides the Collimation Length for SANS instruments.
Functor to provide a case insensitive string comparator.