|
Mantid
|
LambdaValidator provides a quick way to create custom validation objects using a validator function or lambda expression. More...
#include <LambdaValidator.h>
Public Member Functions | |
| IValidator_sptr | clone () const override |
| LambdaValidator () | |
| LambdaValidator (const ValidatorFunction &validatorFunction) | |
| void | setValidatorFunction (const ValidatorFunction &validatorFunction) |
Private Types | |
| using | ValidatorFunction = std::function< std::string(ParamType)> |
Private Member Functions | |
| std::string | checkValidity (const ParamType &value) const override |
Private Attributes | |
| ValidatorFunction | m_validatorFunction |
LambdaValidator provides a quick way to create custom validation objects using a validator function or lambda expression.
The class uses TypedValidator to extract the parameter type and then pass it to the vaildtor function.
The function used for validation should accept one parameter, the variable to be validated, and returns an error string (empty string for no error).
Definition at line 23 of file LambdaValidator.h.
|
private |
Definition at line 24 of file LambdaValidator.h.
|
inline |
Definition at line 27 of file LambdaValidator.h.
References Mantid::Geometry::x.
|
inline |
Definition at line 29 of file LambdaValidator.h.
|
inlineoverrideprivate |
Definition at line 36 of file LambdaValidator.h.
References value.
|
inlineoverride |
Definition at line 31 of file LambdaValidator.h.
|
inline |
Definition at line 33 of file LambdaValidator.h.
|
private |
Definition at line 38 of file LambdaValidator.h.