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
12
13namespace Mantid::Kernel {
21template <typename T>
22ArrayProperty<T>::ArrayProperty(const std::string &name, std::vector<T> vec, const IValidator_sptr &validator,
23 const unsigned int direction)
24 : PropertyWithValue<std::vector<T>>(name, std::move(vec), validator, direction) {}
25
34template <typename T>
35ArrayProperty<T>::ArrayProperty(const std::string &name, const IValidator_sptr &validator, const unsigned int direction)
36 : PropertyWithValue<std::vector<T>>(name, std::vector<T>(), validator, direction) {}
37
45template <typename T>
46ArrayProperty<T>::ArrayProperty(const std::string &name, const unsigned int direction)
47 : PropertyWithValue<std::vector<T>>(name, std::vector<T>(), IValidator_sptr(new NullValidator), direction) {}
48
64template <typename T>
65ArrayProperty<T>::ArrayProperty(const std::string &name, const std::string &values, const IValidator_sptr &validator,
66 const unsigned int direction)
67 : PropertyWithValue<std::vector<T>>(name, std::vector<T>(), values, validator, direction) {}
68
69template <typename T>
71
73template <typename T> ArrayProperty<T> *ArrayProperty<T>::clone() const { return new ArrayProperty<T>(*this); }
74
75template <typename T> void ArrayProperty<T>::visualStudioC4661Workaround() {}
76
78// export macro not needed for int32_t due to explicit specialization in header.
79template class ArrayProperty<int32_t>;
80
84template class DLLExport ArrayProperty<bool>;
85template class DLLExport ArrayProperty<float>;
86template class DLLExport ArrayProperty<double>;
88
96
97#if defined(_WIN32) || defined(__clang__) && defined(__APPLE__)
98template class DLLExport ArrayProperty<long>;
102#endif
103
105
106template <> MANTID_KERNEL_DLL void ArrayProperty<int>::visualStudioC4661Workaround() {}
107
108} // namespace Mantid::Kernel
std::string name
Definition Run.cpp:60
std::vector< T > const * vec
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Definition System.h:33
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=IValidator_sptr(new NullValidator), 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.
Definition IValidator.h:26
STL namespace.