Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::Kernel::BoundedValidator< TYPE > Class Template Referencefinal

BoundedValidator is a validator that requires the values to be between upper or lower bounds, or both. More...

#include <Kernel/BoundedValidator.h>

Inheritance diagram for Mantid::Kernel::BoundedValidator< TYPE >:

Public Member Functions

 BoundedValidator () noexcept
 No-arg Constructor. More...
 
 BoundedValidator (const TYPE &lowerBound, const TYPE &upperBound, bool exclusive=false) noexcept
 Constructor. More...
 
void clearBounds () noexcept
 Clear both bounds (lower and upper) at the same time. More...
 
void clearLower () noexcept
 Clear lower bound value. More...
 
void clearUpper () noexcept
 Clear upper bound value. More...
 
IValidator_sptr clone () const override
 Clone the current state. More...
 
bool hasLower () const noexcept
 Return if it has a lower bound. More...
 
bool hasUpper () const noexcept
 Return if it has a lower bound. More...
 
bool isLowerExclusive () const noexcept
 Check if lower bound is exclusive. More...
 
bool isUpperExclusive () const noexcept
 Check if upper bound is exclusive. More...
 
TYPE lower () const noexcept
 Return the lower bound value. More...
 
void setBounds (const TYPE &lower, const TYPE &upper) noexcept
 Set both bounds (lower and upper) at the same time. More...
 
void setError (const std::string &value)
 
void setError (const TYPE &value)
 Set the allowed error. More...
 
void setExclusive (const bool exclusive) noexcept
 Set both the upper and lower bounds to be exclusive. More...
 
void setLower (const TYPE &value) noexcept
 Set lower bound value. More...
 
void setLowerExclusive (const bool exclusive) noexcept
 Set the lower bound to be exclusive. More...
 
void setUpper (const TYPE &value) noexcept
 Set upper bound value. More...
 
void setUpperExclusive (const bool exclusive) noexcept
 Set the upper bound to be exclusive. More...
 
TYPE upper () const noexcept
 Return the upper bound value. More...
 

Private Member Functions

std::string checkValidity (const TYPE &value) const override
 Checks that the value is within any upper and lower limits. More...
 
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 More...
 
bool m_hasError
 Has an error set true/false. More...
 
bool m_hasLowerBound
 Has a lower bound set true/false. More...
 
bool m_hasUpperBound
 Has a upper bound set true/false. More...
 
TYPE m_lowerBound
 the lower bound More...
 
bool m_lowerExclusive
 Lower bound is exclusive. More...
 
TYPE m_upperBound
 the upper bound More...
 
bool m_upperExclusive
 Upper bound is exclusive. More...
 

Detailed Description

template<class TYPE>
class Mantid::Kernel::BoundedValidator< TYPE >

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.

Author
Nick Draper, Tessella Support Services plc
Date
28/11/2007

Definition at line 32 of file BoundedValidator.h.

Constructor & Destructor Documentation

◆ BoundedValidator() [1/2]

template<class TYPE >
Mantid::Kernel::BoundedValidator< TYPE >::BoundedValidator ( )
inlinenoexcept

No-arg Constructor.

Definition at line 35 of file BoundedValidator.h.

◆ BoundedValidator() [2/2]

template<class TYPE >
Mantid::Kernel::BoundedValidator< TYPE >::BoundedValidator ( const TYPE lowerBound,
const TYPE upperBound,
bool  exclusive = false 
)
inlinenoexcept

Constructor.

Parameters
lowerBound:: The lower bounding value
upperBound:: The upper bounding value
exclusive:: make bounds exclusive (default inclusive)

Definition at line 44 of file BoundedValidator.h.

Member Function Documentation

◆ checkValidity()

template<class TYPE >
std::string Mantid::Kernel::BoundedValidator< TYPE >::checkValidity ( const TYPE value) const
inlineoverrideprivate

Checks that the value is within any upper and lower limits.

Parameters
value:: The value to test
Returns
An error message to display to users or an empty string on no error

Definition at line 141 of file BoundedValidator.h.

References error, and value.

◆ clearBounds()

template<class TYPE >
void Mantid::Kernel::BoundedValidator< TYPE >::clearBounds ( )
inlinenoexcept

Clear both bounds (lower and upper) at the same time.

Definition at line 101 of file BoundedValidator.h.

◆ clearLower()

template<class TYPE >
void Mantid::Kernel::BoundedValidator< TYPE >::clearLower ( )
inlinenoexcept

Clear lower bound value.

Definition at line 84 of file BoundedValidator.h.

◆ clearUpper()

template<class TYPE >
void Mantid::Kernel::BoundedValidator< TYPE >::clearUpper ( )
inlinenoexcept

Clear upper bound value.

Definition at line 89 of file BoundedValidator.h.

◆ clone()

template<class TYPE >
IValidator_sptr Mantid::Kernel::BoundedValidator< TYPE >::clone ( ) const
inlineoverride

Clone the current state.

Definition at line 113 of file BoundedValidator.h.

◆ errorAdjustment() [1/3]

double Mantid::Kernel::BoundedValidator< double >::errorAdjustment ( const double &  boundingValue,
const int  boundID 
) const
inlineprivate

Definition at line 177 of file BoundedValidator.h.

◆ errorAdjustment() [2/3]

int Mantid::Kernel::BoundedValidator< int >::errorAdjustment ( const int &  boundingValue,
const int  boundID 
) const
inlineprivate

Definition at line 182 of file BoundedValidator.h.

◆ errorAdjustment() [3/3]

template<class TYPE >
TYPE Mantid::Kernel::BoundedValidator< TYPE >::errorAdjustment ( const TYPE boundingValue,
const int  boundID 
) const
inlineprivate

Definition at line 166 of file BoundedValidator.h.

◆ hasLower()

template<class TYPE >
bool Mantid::Kernel::BoundedValidator< TYPE >::hasLower ( ) const
inlinenoexcept

Return if it has a lower bound.

Definition at line 49 of file BoundedValidator.h.

◆ hasUpper()

template<class TYPE >
bool Mantid::Kernel::BoundedValidator< TYPE >::hasUpper ( ) const
inlinenoexcept

Return if it has a lower bound.

Definition at line 51 of file BoundedValidator.h.

◆ isLowerExclusive()

template<class TYPE >
bool Mantid::Kernel::BoundedValidator< TYPE >::isLowerExclusive ( ) const
inlinenoexcept

Check if lower bound is exclusive.

Definition at line 57 of file BoundedValidator.h.

◆ isUpperExclusive()

template<class TYPE >
bool Mantid::Kernel::BoundedValidator< TYPE >::isUpperExclusive ( ) const
inlinenoexcept

Check if upper bound is exclusive.

Definition at line 59 of file BoundedValidator.h.

◆ lower()

template<class TYPE >
TYPE Mantid::Kernel::BoundedValidator< TYPE >::lower ( ) const
inlinenoexcept

Return the lower bound value.

Definition at line 53 of file BoundedValidator.h.

◆ setBounds()

template<class TYPE >
void Mantid::Kernel::BoundedValidator< TYPE >::setBounds ( const TYPE lower,
const TYPE upper 
)
inlinenoexcept

Set both bounds (lower and upper) at the same time.

Definition at line 95 of file BoundedValidator.h.

References lower, and upper.

◆ setError() [1/2]

void Mantid::Kernel::BoundedValidator< std::string >::setError ( const std::string &  value)
inline

Definition at line 172 of file BoundedValidator.h.

References value.

◆ setError() [2/2]

template<class TYPE >
void Mantid::Kernel::BoundedValidator< TYPE >::setError ( const TYPE value)
inline

Set the allowed error.

Definition at line 107 of file BoundedValidator.h.

References value.

◆ setExclusive()

template<class TYPE >
void Mantid::Kernel::BoundedValidator< TYPE >::setExclusive ( const bool  exclusive)
inlinenoexcept

Set both the upper and lower bounds to be exclusive.

Definition at line 66 of file BoundedValidator.h.

◆ setLower()

template<class TYPE >
void Mantid::Kernel::BoundedValidator< TYPE >::setLower ( const TYPE value)
inlinenoexcept

Set lower bound value.

Definition at line 72 of file BoundedValidator.h.

References value.

Referenced by Mantid::CurveFitting::Functions::BSpline::resetValidators().

◆ setLowerExclusive()

template<class TYPE >
void Mantid::Kernel::BoundedValidator< TYPE >::setLowerExclusive ( const bool  exclusive)
inlinenoexcept

Set the lower bound to be exclusive.

Definition at line 61 of file BoundedValidator.h.

◆ setUpper()

template<class TYPE >
void Mantid::Kernel::BoundedValidator< TYPE >::setUpper ( const TYPE value)
inlinenoexcept

Set upper bound value.

Definition at line 78 of file BoundedValidator.h.

References value.

Referenced by Mantid::CurveFitting::Functions::BSpline::resetValidators().

◆ setUpperExclusive()

template<class TYPE >
void Mantid::Kernel::BoundedValidator< TYPE >::setUpperExclusive ( const bool  exclusive)
inlinenoexcept

Set the upper bound to be exclusive.

Definition at line 63 of file BoundedValidator.h.

◆ upper()

template<class TYPE >
TYPE Mantid::Kernel::BoundedValidator< TYPE >::upper ( ) const
inlinenoexcept

Return the upper bound value.

Definition at line 55 of file BoundedValidator.h.

Member Data Documentation

◆ m_error

template<class TYPE >
TYPE Mantid::Kernel::BoundedValidator< TYPE >::m_error
private

the allowed error

Definition at line 131 of file BoundedValidator.h.

◆ m_hasError

template<class TYPE >
bool Mantid::Kernel::BoundedValidator< TYPE >::m_hasError
private

Has an error set true/false.

Definition at line 133 of file BoundedValidator.h.

◆ m_hasLowerBound

template<class TYPE >
bool Mantid::Kernel::BoundedValidator< TYPE >::m_hasLowerBound
private

Has a lower bound set true/false.

Definition at line 119 of file BoundedValidator.h.

◆ m_hasUpperBound

template<class TYPE >
bool Mantid::Kernel::BoundedValidator< TYPE >::m_hasUpperBound
private

Has a upper bound set true/false.

Definition at line 121 of file BoundedValidator.h.

◆ m_lowerBound

template<class TYPE >
TYPE Mantid::Kernel::BoundedValidator< TYPE >::m_lowerBound
private

the lower bound

Definition at line 127 of file BoundedValidator.h.

◆ m_lowerExclusive

template<class TYPE >
bool Mantid::Kernel::BoundedValidator< TYPE >::m_lowerExclusive
private

Lower bound is exclusive.

Definition at line 123 of file BoundedValidator.h.

◆ m_upperBound

template<class TYPE >
TYPE Mantid::Kernel::BoundedValidator< TYPE >::m_upperBound
private

the upper bound

Definition at line 129 of file BoundedValidator.h.

◆ m_upperExclusive

template<class TYPE >
bool Mantid::Kernel::BoundedValidator< TYPE >::m_upperExclusive
private

Upper bound is exclusive.

Definition at line 125 of file BoundedValidator.h.


The documentation for this class was generated from the following file: