18template <
typename TYPE>
20 : TypedValidator<std::vector<TYPE>>(), m_actualValidator(abv.m_actualValidator) {}
27template <
typename TYPE>
29 : TypedValidator<std::vector<TYPE>>(), m_actualValidator(lowerBound, upperBound) {}
31template <
typename TYPE>
33 : TypedValidator<std::vector<TYPE>>(), m_actualValidator(lowerBound, upperBound, exclusive) {}
39template <
typename TYPE>
41 : TypedValidator<std::vector<TYPE>>(), m_actualValidator(bv) {}
48 return std::make_shared<ArrayBoundedValidator<TYPE>>(*this);
59 std::ostringstream
error;
62 typename std::vector<TYPE>::const_iterator it;
63 std::size_t
index = 0;
64 for (it =
value.begin(); it !=
value.end(); ++it) {
65 std::string retval = m_actualValidator.isValid(*it);
66 if (!retval.empty()) {
67 error <<
"At index " <<
index <<
": " << retval;
76 return m_actualValidator.hasLower();
80 return m_actualValidator.hasUpper();
88 return m_actualValidator.isLowerExclusive();
92 return m_actualValidator.isUpperExclusive();
96 m_actualValidator.setLowerExclusive(exclusive);
100 m_actualValidator.setUpperExclusive(exclusive);
105 m_actualValidator.setLowerExclusive(exclusive);
106 m_actualValidator.setUpperExclusive(exclusive);
110 m_actualValidator.setLower(
value);
114 m_actualValidator.setUpper(
value);
122 m_actualValidator.setError(
value);
129#if defined(_WIN32) || defined(__clang__) && defined(__APPLE__)
double value
The value of the point.
std::map< DeltaEMode::Type, std::string > index
Kernel/ArrayBoundedValidator.h.
TYPE upper() const noexcept
Return the upper bound value.
bool isLowerExclusive() const noexcept
void setError(const TYPE &value) noexcept
Set the allowed error.
void setUpperExclusive(const bool exclusive) noexcept
Set the upper bound to be exclusive.
ArrayBoundedValidator()=default
void setLower(const TYPE &value) noexcept
Set lower bound value.
IValidator_sptr clone() const override
Clone the current state.
bool isUpperExclusive() const noexcept
Check if upper bound is exclusive.
void clearUpper() noexcept
Clear upper bound value.
bool hasLower() const noexcept
Return if it has a lower bound.
TYPE lower() const noexcept
Return the lower bound value.
std::string checkValidity(const std::vector< TYPE > &value) const override
Function that actually does the work of checking the validity of the array elements.
void clearLower() noexcept
Clear lower bound value.
void setLowerExclusive(const bool exclusive) noexcept
Set the lower bound to be exclusive.
bool hasUpper() const noexcept
Return if it has a lower bound.
void setExclusive(const bool exclusive) noexcept
Set both the upper and lower bounds to be exclusive.
void setUpper(const TYPE &value) noexcept
Set upper bound value.
BoundedValidator is a validator that requires the values to be between upper or lower bounds,...
std::shared_ptr< IValidator > IValidator_sptr
A shared_ptr to an IValidator.