MarlinMT  0.1.0
Validator.h File Reference
#include <type_traits>
#include <limits>
#include <cmath>
#include <functional>

Go to the source code of this file.

Namespaces

 marlinmt
 
 marlinmt::validator
 

Typedefs

template<typename T >
using marlinmt::ValidatorFunctionT = std::function< bool(const T &)>
 

Functions

template<typename T >
constexpr ValidatorFunctionT< T > marlinmt::validator::notInfinity ()
 Validator function checking for non-infinite values. More...
 
template<typename T >
constexpr ValidatorFunctionT< std::vector< T > > marlinmt::validator::forEach (ValidatorFunctionT< T > func)
 Apply a validator on each element of the vector. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > marlinmt::validator::greater (T limit)
 Validator function checking for the value to be greater than a limit. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > marlinmt::validator::greaterEqual (T limit)
 Validator function checking for the value to be greater or equal to a limit. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > marlinmt::validator::less (T limit)
 Validator function checking for the value to be less than a limit. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > marlinmt::validator::lessEqual (T limit)
 Validator function checking for the value to be less or equal to a limit. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > marlinmt::validator::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 > 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...) More...
 
template<typename T >
constexpr ValidatorFunctionT< T > marlinmt::validator::expectSize (std::size_t s)
 Validator function checking for the value to have an exact size. More...
 
template<typename T >
constexpr ValidatorFunctionT< T > marlinmt::validator::notEmpty ()
 Validator function checking for the value to be non-empty. More...
 
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. More...
 
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. More...
 
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. More...