"docs/git@code.ornl.gov:mantidproject/mantid.git" did not exist on "2b5209e4d3583eda6a7153f6948650f806de86c2"
Newer
Older
Gigg, Martyn Anthony
committed
//------------------------------------------
// Includes
//------------------------------------------
#include "MantidKernel/MandatoryValidator.h"
Gigg, Martyn Anthony
committed
#include "MantidKernel/EmptyValues.h"
Gigg, Martyn Anthony
committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
namespace Mantid {
namespace Kernel {
namespace Detail {
/**
* Specialization of checkIsEmpty for string
* @param value :: A string object
* @return True if the string is considered empty
*/
template <> DLLExport bool checkIsEmpty(const std::string &value) {
return value.empty();
}
/**
* Specialization of checkIsEmpty for double values
* @param value :: A double
* @return True if the value is considered empty, see EmptyValues.h
*/
template <> DLLExport bool checkIsEmpty(const double &value) {
if (std::fabs(value - Mantid::EMPTY_DBL()) < 1e-08)
return true;
else
return false;
}
/**
* Specialization of checkIsEmpty for int
* @param value :: A int value
* @return True if the value is considered empty, see EmptyValues.h
*/
template <> DLLExport bool checkIsEmpty(const int &value) {
return (value == Mantid::EMPTY_INT());
}
/**
* Specialization of checkIsEmpty for long
* @param value :: A long value
* @return True if the value is considered empty, see EmptyValues.h
*/
template <> DLLExport bool checkIsEmpty(const long &value) {
return (value == Mantid::EMPTY_LONG());
}
}
}