SeqAn3 3.4.0-rc.4
The Modern C++ library for sequence analysis.
|
A helper struct to chain validators recursively via the pipe operator. More...
Public Types | |
using | option_value_type = std::common_type_t< typename validator1_type::option_value_type, typename validator2_type::option_value_type > |
The underlying type in both validators. | |
Public Member Functions | |
std::string | get_help_page_message () const |
Returns a message that can be appended to the (positional) options help page info. | |
template<typename cmp_type > requires std::invocable<validator1_type, cmp_type const> && std::invocable<validator2_type, cmp_type const> | |
void | operator() (cmp_type const &cmp) const |
Calls the operator() of each validator on the value cmp. | |
Constructors, destructor and assignment | |
validator_chain_adaptor ()=delete | |
Deleted. | |
validator_chain_adaptor (validator_chain_adaptor const &pf)=default | |
Defaulted. | |
validator_chain_adaptor & | operator= (validator_chain_adaptor const &pf)=default |
Defaulted. | |
validator_chain_adaptor (validator_chain_adaptor &&)=default | |
Defaulted. | |
validator_chain_adaptor & | operator= (validator_chain_adaptor &&)=default |
Defaulted. | |
validator_chain_adaptor (validator1_type vali1_, validator2_type vali2_) | |
Constructing from two validators. | |
~validator_chain_adaptor ()=default | |
The destructor. | |
Private Attributes | |
validator1_type | vali1 |
The first validator in the chain. | |
validator2_type | vali2 |
The second validator in the chain. | |
Additional Inherited Members | |
![]() | |
using | option_value_type |
The type of value on which the validator is called on. | |
void | operator() (option_value_type const &cmp) const |
Validates the value 'cmp' and throws a seqan3::validation_error on failure. | |
A helper struct to chain validators recursively via the pipe operator.
Note that both validators must operate on the same option_value_type in order to avoid unexpected behaviour and ensure that the seqan3::argument_parser::add_option call is well-formed. (add_option(val, ...., validator) requires that val is of same type as validator::option_value_type).
|
no-apiinline |
Constructing from two validators.
[in] | vali1_ | Some validator to be chained to vali2_. |
[in] | vali2_ | Another validator to be chained to vali1_. |
|
no-apiinline |
Returns a message that can be appended to the (positional) options help page info.
Implements validator.
|
no-apiinline |
Calls the operator() of each validator on the value cmp.
cmp_type | The type of value to validate; must be invokable with each of the validator members. |
[in] | cmp | The value to validate. |
This function delegates to the validation of both of the chained validators by calling their operator() one after the other. The behaviour depends on the chained validators which may throw on input error.