MarlinMT  0.1.0
marlinmt::validator Namespace Reference

Functions

template<typename T >
constexpr ValidatorFunctionT< T > notInfinity ()
 Validator function checking for non-infinite values. More...
 
template<typename T >
constexpr ValidatorFunctionT< std::vector< T > > forEach (ValidatorFunctionT< T > func)
 Apply a validator on each element of the vector. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > greater (T limit)
 Validator function checking for the value to be greater than a limit. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > greaterEqual (T limit)
 Validator function checking for the value to be greater or equal to a limit. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > less (T limit)
 Validator function checking for the value to be less than a limit. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > lessEqual (T limit)
 Validator function checking for the value to be less or equal to a limit. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > inRange (T low, T high)
 Validator function checking for the value to be within a specific range, boundaries included Only valid is the operator < is defined for the input type. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > sizeModulo (std::size_t mod)
 Validator function checking for the value to have a size multiple of the input value Only valid if the input type has a method size() (containers, string, etc...) More...
 
template<typename T >
constexpr ValidatorFunctionT< T > expectSize (std::size_t s)
 Validator function checking for the value to have an exact size. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > notEmpty ()
 Validator function checking for the value to be non-empty. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > combineOr (ValidatorFunctionT< T > lhs, ValidatorFunctionT< T > rhs)
 Create a combination of two validator function with 'or' combination. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > combineAnd (ValidatorFunctionT< T > lhs, ValidatorFunctionT< T > rhs)
 Create a combination of two validator function with 'and' combination. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > constraints (std::set< T > cnsts)
 Create a validator checking for the value that is constrained to the input list. More...
 

Function Documentation

◆ combineAnd()

template<typename T >
constexpr ValidatorFunctionT<T> marlinmt::validator::combineAnd ( ValidatorFunctionT< T >  lhs,
ValidatorFunctionT< T >  rhs 
)

Create a combination of two validator function with 'and' combination.

Returns a new validator function containing the combination

Parameters
lhsthe first validator
rhsthe second validator

Definition at line 168 of file Validator.h.

References marlinmt::book::Flags::value().

◆ combineOr()

template<typename T >
constexpr ValidatorFunctionT<T> marlinmt::validator::combineOr ( ValidatorFunctionT< T >  lhs,
ValidatorFunctionT< T >  rhs 
)

Create a combination of two validator function with 'or' combination.

Returns a new validator function containing the combination

Parameters
lhsthe first validator
rhsthe second validator

Definition at line 154 of file Validator.h.

References marlinmt::book::Flags::value().

◆ constraints()

template<typename T >
constexpr ValidatorFunctionT<T> marlinmt::validator::constraints ( std::set< T >  cnsts)

Create a validator checking for the value that is constrained to the input list.

Parameters
cnststhe input list of constraints

Definition at line 180 of file Validator.h.

References marlinmt::book::Flags::value().

◆ expectSize()

template<typename T >
constexpr ValidatorFunctionT<T> marlinmt::validator::expectSize ( std::size_t  s)
inline

Validator function checking for the value to have an exact size.

Only valid if the input type has a method size()

Parameters
sthe exact size to check

Definition at line 129 of file Validator.h.

References marlinmt::book::Flags::value().

◆ forEach()

template<typename T >
constexpr ValidatorFunctionT<std::vector<T> > marlinmt::validator::forEach ( ValidatorFunctionT< T >  func)

Apply a validator on each element of the vector.

Only valid for vector type validation.

Parameters
functhe validator function to apply on each element of the vector

Definition at line 35 of file Validator.h.

References marlinmt::book::Flags::value().

◆ greater()

template<typename T >
constexpr ValidatorFunctionT<T> marlinmt::validator::greater ( limit)

Validator function checking for the value to be greater than a limit.

Only valid is the operator > is defined for the input type

Parameters
limitthe limit value

Definition at line 48 of file Validator.h.

References marlinmt::book::Flags::value().

◆ greaterEqual()

template<typename T >
constexpr ValidatorFunctionT<T> marlinmt::validator::greaterEqual ( limit)

Validator function checking for the value to be greater or equal to a limit.

Only valid is the operator >= is defined for the input type

Parameters
limitthe limit value

Definition at line 61 of file Validator.h.

References marlinmt::book::Flags::value().

◆ inRange()

template<typename T >
constexpr ValidatorFunctionT<T> marlinmt::validator::inRange ( low,
high 
)

Validator function checking for the value to be within a specific range, boundaries included Only valid is the operator < is defined for the input type.

Parameters
lowthe lower boundary value
highthe higer boundary value

Definition at line 102 of file Validator.h.

References marlinmt::book::Flags::value().

◆ less()

template<typename T >
constexpr ValidatorFunctionT<T> marlinmt::validator::less ( limit)

Validator function checking for the value to be less than a limit.

Only valid is the operator < is defined for the input type

Parameters
limitthe limit value

Definition at line 74 of file Validator.h.

References marlinmt::book::Flags::value().

◆ lessEqual()

template<typename T >
constexpr ValidatorFunctionT<T> marlinmt::validator::lessEqual ( limit)

Validator function checking for the value to be less or equal to a limit.

Only valid is the operator <= is defined for the input type

Parameters
limitthe limit value

Definition at line 87 of file Validator.h.

References marlinmt::book::Flags::value().

◆ notEmpty()

template<typename T >
constexpr ValidatorFunctionT<T> marlinmt::validator::notEmpty ( )
inline

Validator function checking for the value to be non-empty.

Only valid if the input type has a method empty()

Definition at line 140 of file Validator.h.

References marlinmt::book::Flags::value().

◆ notInfinity()

template<typename T >
constexpr ValidatorFunctionT<T> marlinmt::validator::notInfinity ( )

Validator function checking for non-infinite values.

Works for scalar values where std::numeric_limits<T>::has_infinity is defined.

Definition at line 21 of file Validator.h.

References marlinmt::book::Flags::value().

◆ sizeModulo()

template<typename T >
constexpr ValidatorFunctionT<T> marlinmt::validator::sizeModulo ( std::size_t  mod)

Validator function checking for the value to have a size multiple of the input value Only valid if the input type has a method size() (containers, string, etc...)

Parameters
modthe modulo to apply

Definition at line 116 of file Validator.h.

References marlinmt::book::Flags::value().