|
Mantid
|
BoundedValidator is a validator that requires the values to be between upper or lower bounds, or both. More...
#include <Kernel/BoundedValidator.h>
Public Member Functions | |
| BoundedValidator () noexcept | |
| No-arg Constructor. | |
| BoundedValidator (const TYPE &lowerBound, const TYPE &upperBound, bool exclusive=false) noexcept | |
| Constructor. | |
| void | clearBounds () noexcept |
| Clear both bounds (lower and upper) at the same time. | |
| void | clearLower () noexcept |
| Clear lower bound value. | |
| void | clearUpper () noexcept |
| Clear upper bound value. | |
| IValidator_sptr | clone () const override |
| Clone the current state. | |
| bool | hasLower () const noexcept |
| Return if it has a lower bound. | |
| bool | hasUpper () const noexcept |
| Return if it has a lower bound. | |
| bool | isLowerExclusive () const noexcept |
| Check if lower bound is exclusive. | |
| bool | isUpperExclusive () const noexcept |
| Check if upper bound is exclusive. | |
| const TYPE & | lower () const noexcept |
| Return the lower bound value. | |
| void | setBounds (const TYPE &lower, const TYPE &upper) noexcept |
| Set both bounds (lower and upper) at the same time. | |
| void | setError (const std::string &value) |
| void | setError (const TYPE &value) |
| Set the allowed error. | |
| void | setExclusive (const bool exclusive) noexcept |
| Set both the upper and lower bounds to be exclusive. | |
| void | setLower (const TYPE &value) noexcept |
| Set lower bound value. | |
| void | setLowerExclusive (const bool exclusive) noexcept |
| Set the lower bound to be exclusive. | |
| void | setUpper (const TYPE &value) noexcept |
| Set upper bound value. | |
| void | setUpperExclusive (const bool exclusive) noexcept |
| Set the upper bound to be exclusive. | |
| const TYPE & | upper () const noexcept |
| Return the upper bound value. | |
Private Member Functions | |
| std::string | checkValidity (const TYPE &value) const override |
| Checks that the value is within any upper and lower limits. | |
| double | errorAdjustment (const double &boundingValue, const int boundID) const |
| int | errorAdjustment (const int &boundingValue, const int boundID) const |
| TYPE | errorAdjustment (const TYPE &boundingValue, const int boundID) const |
Private Attributes | |
| TYPE | m_error |
| the allowed error | |
| bool | m_hasError |
| Has an error set true/false. | |
| bool | m_hasLowerBound |
| Has a lower bound set true/false. | |
| bool | m_hasUpperBound |
| Has a upper bound set true/false. | |
| TYPE | m_lowerBound |
| the lower bound | |
| bool | m_lowerExclusive |
| Lower bound is exclusive. | |
| TYPE | m_upperBound |
| the upper bound | |
| bool | m_upperExclusive |
| Upper bound is exclusive. | |
BoundedValidator is a validator that requires the values to be between upper or lower bounds, or both.
It offers both inclusive or exclusive bounds. By default the validator uses inclusive bounds.
Definition at line 32 of file BoundedValidator.h.
|
inlinenoexcept |
No-arg Constructor.
Definition at line 35 of file BoundedValidator.h.
|
inlinenoexcept |
Constructor.
| lowerBound | :: The lower bounding value |
| upperBound | :: The upper bounding value |
| exclusive | :: make bounds exclusive (default inclusive) |
Definition at line 44 of file BoundedValidator.h.
|
inlineoverrideprivate |
Checks that the value is within any upper and lower limits.
| value | :: The value to test |
Definition at line 141 of file BoundedValidator.h.
References error, Mantid::Kernel::BoundedValidator< TYPE >::errorAdjustment(), Mantid::Kernel::BoundedValidator< TYPE >::m_error, Mantid::Kernel::BoundedValidator< TYPE >::m_hasError, Mantid::Kernel::BoundedValidator< TYPE >::m_hasLowerBound, Mantid::Kernel::BoundedValidator< TYPE >::m_hasUpperBound, Mantid::Kernel::BoundedValidator< TYPE >::m_lowerBound, Mantid::Kernel::BoundedValidator< TYPE >::m_lowerExclusive, Mantid::Kernel::BoundedValidator< TYPE >::m_upperBound, Mantid::Kernel::BoundedValidator< TYPE >::m_upperExclusive, and value.
|
inlinenoexcept |
Clear both bounds (lower and upper) at the same time.
Definition at line 101 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::clearLower(), and Mantid::Kernel::BoundedValidator< TYPE >::clearUpper().
|
inlinenoexcept |
Clear lower bound value.
Definition at line 84 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::m_hasLowerBound, and Mantid::Kernel::BoundedValidator< TYPE >::m_lowerBound.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::clearBounds().
|
inlinenoexcept |
Clear upper bound value.
Definition at line 89 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::m_hasUpperBound, and Mantid::Kernel::BoundedValidator< TYPE >::m_upperBound.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::clearBounds().
|
inlineoverride |
Clone the current state.
Definition at line 113 of file BoundedValidator.h.
|
inlineprivate |
Definition at line 177 of file BoundedValidator.h.
|
inlineprivate |
Definition at line 182 of file BoundedValidator.h.
|
inlineprivate |
Definition at line 166 of file BoundedValidator.h.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::checkValidity().
|
inlinenoexcept |
Return if it has a lower bound.
Definition at line 49 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::m_hasLowerBound.
|
inlinenoexcept |
Return if it has a lower bound.
Definition at line 51 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::m_hasUpperBound.
|
inlinenoexcept |
Check if lower bound is exclusive.
Definition at line 57 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::m_lowerExclusive.
|
inlinenoexcept |
Check if upper bound is exclusive.
Definition at line 59 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::m_upperExclusive.
|
inlinenoexcept |
Return the lower bound value.
Definition at line 53 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::m_lowerBound.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::setBounds().
|
inlinenoexcept |
Set both bounds (lower and upper) at the same time.
Definition at line 95 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::lower(), Mantid::Kernel::BoundedValidator< TYPE >::setLower(), Mantid::Kernel::BoundedValidator< TYPE >::setUpper(), and Mantid::Kernel::BoundedValidator< TYPE >::upper().
|
inline |
Definition at line 172 of file BoundedValidator.h.
References value.
|
inline |
Set the allowed error.
Definition at line 107 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::m_error, Mantid::Kernel::BoundedValidator< TYPE >::m_hasError, and value.
|
inlinenoexcept |
Set both the upper and lower bounds to be exclusive.
Definition at line 66 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::setLowerExclusive(), and Mantid::Kernel::BoundedValidator< TYPE >::setUpperExclusive().
|
inlinenoexcept |
Set lower bound value.
Definition at line 72 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::m_hasLowerBound, Mantid::Kernel::BoundedValidator< TYPE >::m_lowerBound, and value.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::setBounds().
|
inlinenoexcept |
Set the lower bound to be exclusive.
Definition at line 61 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::m_lowerExclusive.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::setExclusive().
|
inlinenoexcept |
Set upper bound value.
Definition at line 78 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::m_hasUpperBound, Mantid::Kernel::BoundedValidator< TYPE >::m_upperBound, and value.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::setBounds().
|
inlinenoexcept |
Set the upper bound to be exclusive.
Definition at line 63 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::m_upperExclusive.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::setExclusive().
|
inlinenoexcept |
Return the upper bound value.
Definition at line 55 of file BoundedValidator.h.
References Mantid::Kernel::BoundedValidator< TYPE >::m_upperBound.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::setBounds().
|
private |
the allowed error
Definition at line 131 of file BoundedValidator.h.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::checkValidity(), and Mantid::Kernel::BoundedValidator< TYPE >::setError().
|
private |
Has an error set true/false.
Definition at line 133 of file BoundedValidator.h.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::checkValidity(), and Mantid::Kernel::BoundedValidator< TYPE >::setError().
|
private |
Has a lower bound set true/false.
Definition at line 119 of file BoundedValidator.h.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::checkValidity(), Mantid::Kernel::BoundedValidator< TYPE >::clearLower(), Mantid::Kernel::BoundedValidator< TYPE >::hasLower(), and Mantid::Kernel::BoundedValidator< TYPE >::setLower().
|
private |
Has a upper bound set true/false.
Definition at line 121 of file BoundedValidator.h.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::checkValidity(), Mantid::Kernel::BoundedValidator< TYPE >::clearUpper(), Mantid::Kernel::BoundedValidator< TYPE >::hasUpper(), and Mantid::Kernel::BoundedValidator< TYPE >::setUpper().
|
private |
the lower bound
Definition at line 127 of file BoundedValidator.h.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::checkValidity(), Mantid::Kernel::BoundedValidator< TYPE >::clearLower(), Mantid::Kernel::BoundedValidator< TYPE >::lower(), and Mantid::Kernel::BoundedValidator< TYPE >::setLower().
|
private |
Lower bound is exclusive.
Definition at line 123 of file BoundedValidator.h.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::checkValidity(), Mantid::Kernel::BoundedValidator< TYPE >::isLowerExclusive(), and Mantid::Kernel::BoundedValidator< TYPE >::setLowerExclusive().
|
private |
the upper bound
Definition at line 129 of file BoundedValidator.h.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::checkValidity(), Mantid::Kernel::BoundedValidator< TYPE >::clearUpper(), Mantid::Kernel::BoundedValidator< TYPE >::setUpper(), and Mantid::Kernel::BoundedValidator< TYPE >::upper().
|
private |
Upper bound is exclusive.
Definition at line 125 of file BoundedValidator.h.
Referenced by Mantid::Kernel::BoundedValidator< TYPE >::checkValidity(), Mantid::Kernel::BoundedValidator< TYPE >::isUpperExclusive(), and Mantid::Kernel::BoundedValidator< TYPE >::setUpperExclusive().