Mantid
Loading...
Searching...
No Matches
ArrayProperty.cpp
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 +
8
9// PropertyWithValue Definition
10#include "MantidKernel/DllConfig.h"
13
14namespace Mantid::Kernel {
22template <typename T>
23ArrayProperty<T>::ArrayProperty(const std::string &name, std::vector<T> vec, const IValidator_sptr &validator,
24 const unsigned int direction)
25 : PropertyWithValue<std::vector<T>>(name, std::move(vec), validator, direction) {}
26
35template <typename T>
36ArrayProperty<T>::ArrayProperty(const std::string &name, const IValidator_sptr &validator, const unsigned int direction)
37 : PropertyWithValue<std::vector<T>>(name, std::vector<T>(), validator, direction) {}
38
46template <typename T>
47ArrayProperty<T>::ArrayProperty(const std::string &name, const unsigned int direction)
48 : PropertyWithValue<std::vector<T>>(name, std::vector<T>(), IValidator_sptr(new NullValidator), direction) {}
49
65template <typename T>
66ArrayProperty<T>::ArrayProperty(const std::string &name, const std::string &values, const IValidator_sptr &validator,
67 const unsigned int direction)
68 : PropertyWithValue<std::vector<T>>(name, std::vector<T>(), values, validator, direction) {}
69
70template <typename T>
72
74template <typename T> ArrayProperty<T> *ArrayProperty<T>::clone() const { return new ArrayProperty<T>(*this); }
75
76template <typename T> void ArrayProperty<T>::visualStudioC4661Workaround() {}
77
79// export macro not needed for int32_t due to explicit specialization in header.
80template class ArrayProperty<int32_t>;
81
82template class MANTID_KERNEL_DLL ArrayProperty<uint32_t>;
83template class MANTID_KERNEL_DLL ArrayProperty<int64_t>;
84template class MANTID_KERNEL_DLL ArrayProperty<uint64_t>;
85template class MANTID_KERNEL_DLL ArrayProperty<bool>;
86template class MANTID_KERNEL_DLL ArrayProperty<float>;
87template class MANTID_KERNEL_DLL ArrayProperty<double>;
88template class MANTID_KERNEL_DLL ArrayProperty<std::string>;
89
90template class MANTID_KERNEL_DLL ArrayProperty<std::vector<int32_t>>;
91template class MANTID_KERNEL_DLL ArrayProperty<std::vector<uint32_t>>;
92template class MANTID_KERNEL_DLL ArrayProperty<std::vector<int64_t>>;
93template class MANTID_KERNEL_DLL ArrayProperty<std::vector<uint64_t>>;
94template class MANTID_KERNEL_DLL ArrayProperty<std::vector<float>>;
95template class MANTID_KERNEL_DLL ArrayProperty<std::vector<double>>;
96template class MANTID_KERNEL_DLL ArrayProperty<std::vector<std::string>>;
97
98#if defined(_WIN32) || defined(__clang__) && defined(__APPLE__)
99template class MANTID_KERNEL_DLL ArrayProperty<long>;
100template class MANTID_KERNEL_DLL ArrayProperty<unsigned long>;
101template class MANTID_KERNEL_DLL ArrayProperty<std::vector<long>>;
102template class MANTID_KERNEL_DLL ArrayProperty<std::vector<unsigned long>>;
103#endif
104
106
107template <> MANTID_KERNEL_DLL void ArrayProperty<int>::visualStudioC4661Workaround() {}
108
109} // namespace Mantid::Kernel
std::string name
Definition Run.cpp:60
std::vector< T > const * vec
Support for a property that holds an array of values.
ArrayProperty< T > * clone() const override
'Virtual copy constructor'
ArrayProperty(const std::string &name, std::vector< T > vec, const IValidator_sptr &validator=nullptr, const unsigned int direction=Direction::Input)
Constructor.
NullValidator is a validator that doesn't.
The concrete, templated class for properties.
std::shared_ptr< IValidator > IValidator_sptr
A shared_ptr to an IValidator.
STL namespace.