Mantid
Loading...
Searching...
No Matches
MandatoryValidator.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 +
7//------------------------------------------
8// Includes
9//------------------------------------------
13#include <cmath>
14
15namespace Mantid::Kernel::Detail {
21template <> DLLExport bool checkIsEmpty(const std::string &value) { return value.empty(); }
27template <> DLLExport bool checkIsEmpty(const double &value) { return std::fabs(value - Mantid::EMPTY_DBL()) < 1e-08; }
33template <> DLLExport bool checkIsEmpty(const int &value) { return (value == Mantid::EMPTY_INT()); }
39template <> DLLExport bool checkIsEmpty(const long &value) {
40 // 32 bit for Windows and Clang, 64 bit for GCC
41 return (value == Mantid::EMPTY_LONG());
42}
43#if defined(_WIN32) || defined(__clang__) && defined(__APPLE__)
49template <> DLLExport bool checkIsEmpty(const int64_t &value) { return (value == Mantid::EMPTY_INT64()); }
50#endif
56template <> DLLExport bool checkIsEmpty(const OptionalBool &value) { return (value.getValue() == OptionalBool::Unset); }
57} // namespace Mantid::Kernel::Detail
double value
The value of the point.
Definition: FitMW.cpp:51
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Definition: System.h:53
OptionalBool : Tri-state bool.
Definition: OptionalBool.h:25
DLLExport bool checkIsEmpty(const T &)
Forward declare checking function.
constexpr int EMPTY_INT() noexcept
Returns what we consider an "empty" integer within a property.
Definition: EmptyValues.h:25
constexpr long EMPTY_LONG() noexcept
Returns what we consider an "empty" long within a property.
Definition: EmptyValues.h:31
constexpr int64_t EMPTY_INT64() noexcept
Returns what we consider an "empty" int64_t within a property.
Definition: EmptyValues.h:37
constexpr double EMPTY_DBL() noexcept
Returns what we consider an "empty" double within a property.
Definition: EmptyValues.h:43