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

ArrayLenghtValidator : Validate length of an array property. More...

#include <ArrayLengthValidator.h>

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

Public Member Functions

 ArrayLengthValidator ()
 No arg constructor. More...
 
 ArrayLengthValidator (const size_t len)
 Constructor. More...
 
 ArrayLengthValidator (const size_t lenmin, const size_t lenmax)
 Constructor. More...
 
void clearLength ()
 Clear the length. More...
 
void clearLengthMax ()
 Clear maximum. More...
 
void clearLengthMin ()
 Clear minimum. More...
 
IValidator_sptr clone () const override
 Clone function. More...
 
const size_t & getLength () const
 Return the length. More...
 
const size_t & getMaxLength () const
 Return the maximum length. More...
 
const size_t & getMinLength () const
 Return the minimum length. More...
 
bool hasLength () const
 Return if it has a length. More...
 
bool hasMaxLength () const
 Return if it has a length. More...
 
bool hasMinLength () const
 Return if it has a length. More...
 
void setLength (const size_t &value)
 Set length. More...
 
void setLengthMax (const size_t &value)
 Set length max. More...
 
void setLengthMin (const size_t &value)
 Set length min. More...
 
 ~ArrayLengthValidator () override
 Destructor. More...
 

Private Member Functions

std::string checkValidity (const std::vector< TYPE > &value) const override
 Private function to check validity. More...
 

Private Attributes

size_t m_arraySize
 private variable containing the size of the array More...
 
size_t m_arraySizeMax
 private variable containing the size max of the array More...
 
size_t m_arraySizeMin
 private variable containing the minimum size of the array More...
 
bool m_hasArraySize
 private variable, true if size is set, false if not More...
 
bool m_hasArraySizeMax
 private variable, true if size max is set, false if not More...
 
bool m_hasArraySizeMin
 private variable, true if min size is set, false if not More...
 

Detailed Description

template<typename TYPE>
class Mantid::Kernel::ArrayLengthValidator< TYPE >

ArrayLenghtValidator : Validate length of an array property.

Definition at line 21 of file ArrayLengthValidator.h.

Constructor & Destructor Documentation

◆ ArrayLengthValidator() [1/3]

No arg constructor.

Definition at line 20 of file ArrayLengthValidator.cpp.

◆ ArrayLengthValidator() [2/3]

template<typename TYPE >
Mantid::Kernel::ArrayLengthValidator< TYPE >::ArrayLengthValidator ( const size_t  len)

Constructor.

Parameters
len,:the legth of the array

Definition at line 28 of file ArrayLengthValidator.cpp.

◆ ArrayLengthValidator() [3/3]

template<typename TYPE >
Mantid::Kernel::ArrayLengthValidator< TYPE >::ArrayLengthValidator ( const size_t  lenmin,
const size_t  lenmax 
)

Constructor.

Parameters
lenmin,:the minimum legth of the array
lenmax,:the maximum legth of the array

Definition at line 37 of file ArrayLengthValidator.cpp.

◆ ~ArrayLengthValidator()

template<typename TYPE >
Mantid::Kernel::ArrayLengthValidator< TYPE >::~ArrayLengthValidator ( )
overridedefault

Destructor.

Member Function Documentation

◆ checkValidity()

template<typename TYPE >
std::string Mantid::Kernel::ArrayLengthValidator< TYPE >::checkValidity ( const std::vector< TYPE > &  value) const
overrideprivate

Private function to check validity.

Returns
a string. The string is emty if everything is OK, otherwise returns the error

Definition at line 153 of file ArrayLengthValidator.cpp.

References value.

◆ clearLength()

template<typename TYPE >
void Mantid::Kernel::ArrayLengthValidator< TYPE >::clearLength

Clear the length.

Function to unset the length.

It sets m_hasArraySize to false, and the m_arraySize to 0

Definition at line 117 of file ArrayLengthValidator.cpp.

◆ clearLengthMax()

template<typename TYPE >
void Mantid::Kernel::ArrayLengthValidator< TYPE >::clearLengthMax

Clear maximum.

Function to unset the maximum length.

It sets m_hasArraySizeMax to false, and the m_arraySizeMax to 0

Definition at line 135 of file ArrayLengthValidator.cpp.

◆ clearLengthMin()

template<typename TYPE >
void Mantid::Kernel::ArrayLengthValidator< TYPE >::clearLengthMin

Clear minimum.

Function to unset the minimum length.

It sets m_hasArraySizeMin to false, and the m_arraySizeMin to 0

Definition at line 126 of file ArrayLengthValidator.cpp.

◆ clone()

template<typename TYPE >
IValidator_sptr Mantid::Kernel::ArrayLengthValidator< TYPE >::clone
override

Clone function.

Returns
a clone of the validator

Definition at line 144 of file ArrayLengthValidator.cpp.

◆ getLength()

template<typename TYPE >
const size_t & Mantid::Kernel::ArrayLengthValidator< TYPE >::getLength

Return the length.

Function to retun the set length.

Returns
m_arraySize

Definition at line 68 of file ArrayLengthValidator.cpp.

◆ getMaxLength()

template<typename TYPE >
const size_t & Mantid::Kernel::ArrayLengthValidator< TYPE >::getMaxLength

Return the maximum length.

Function to retun the set maximum length.

Returns
m_arraySize

Definition at line 80 of file ArrayLengthValidator.cpp.

◆ getMinLength()

template<typename TYPE >
const size_t & Mantid::Kernel::ArrayLengthValidator< TYPE >::getMinLength

Return the minimum length.

Function to retun the set minimum length.

Returns
m_arraySize

Definition at line 74 of file ArrayLengthValidator.cpp.

◆ hasLength()

template<typename TYPE >
bool Mantid::Kernel::ArrayLengthValidator< TYPE >::hasLength

Return if it has a length.

Check if length is set.

Returns
true/false

Definition at line 50 of file ArrayLengthValidator.cpp.

◆ hasMaxLength()

template<typename TYPE >
bool Mantid::Kernel::ArrayLengthValidator< TYPE >::hasMaxLength

Return if it has a length.

Check if maximum length is set.

Returns
true/false

Definition at line 62 of file ArrayLengthValidator.cpp.

◆ hasMinLength()

template<typename TYPE >
bool Mantid::Kernel::ArrayLengthValidator< TYPE >::hasMinLength

Return if it has a length.

Check if minimum length is set.

Returns
true/false

Definition at line 56 of file ArrayLengthValidator.cpp.

◆ setLength()

template<typename TYPE >
void Mantid::Kernel::ArrayLengthValidator< TYPE >::setLength ( const size_t &  value)

Set length.

Function to set the length.

It will automatically clear the minimum and maximum

Parameters
value,:size_t type

Definition at line 87 of file ArrayLengthValidator.cpp.

References value.

◆ setLengthMax()

template<typename TYPE >
void Mantid::Kernel::ArrayLengthValidator< TYPE >::setLengthMax ( const size_t &  value)

Set length max.

Function to set the maximum length.

It will automatically clear the set length

Parameters
value,:size_t type

Definition at line 107 of file ArrayLengthValidator.cpp.

References value.

◆ setLengthMin()

template<typename TYPE >
void Mantid::Kernel::ArrayLengthValidator< TYPE >::setLengthMin ( const size_t &  value)

Set length min.

Function to set the minimum length.

It will automatically clear the set length

Parameters
value,:size_t type

Definition at line 98 of file ArrayLengthValidator.cpp.

References value.

Member Data Documentation

◆ m_arraySize

template<typename TYPE >
size_t Mantid::Kernel::ArrayLengthValidator< TYPE >::m_arraySize
private

private variable containing the size of the array

Definition at line 58 of file ArrayLengthValidator.h.

◆ m_arraySizeMax

template<typename TYPE >
size_t Mantid::Kernel::ArrayLengthValidator< TYPE >::m_arraySizeMax
private

private variable containing the size max of the array

Definition at line 66 of file ArrayLengthValidator.h.

◆ m_arraySizeMin

template<typename TYPE >
size_t Mantid::Kernel::ArrayLengthValidator< TYPE >::m_arraySizeMin
private

private variable containing the minimum size of the array

Definition at line 62 of file ArrayLengthValidator.h.

◆ m_hasArraySize

template<typename TYPE >
bool Mantid::Kernel::ArrayLengthValidator< TYPE >::m_hasArraySize
private

private variable, true if size is set, false if not

Definition at line 60 of file ArrayLengthValidator.h.

◆ m_hasArraySizeMax

template<typename TYPE >
bool Mantid::Kernel::ArrayLengthValidator< TYPE >::m_hasArraySizeMax
private

private variable, true if size max is set, false if not

Definition at line 68 of file ArrayLengthValidator.h.

◆ m_hasArraySizeMin

template<typename TYPE >
bool Mantid::Kernel::ArrayLengthValidator< TYPE >::m_hasArraySizeMin
private

private variable, true if min size is set, false if not

Definition at line 64 of file ArrayLengthValidator.h.


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