CAF 0.17.6
|
Describes a field of type T of an adaptor. More...
#include <config_value_adaptor_field.hpp>
Public Types | |
using | value_type = T |
Type of the field. | |
using | predicate_function = bool(*)(const value_type &) |
Predicate function for verifying user input. | |
Public Attributes | |
string_view | name |
Name of the field in configuration files and on the CLI. | |
optional< value_type > | default_value |
If set, makes the field optional in configuration files and on the CLI by assigning the default whenever the user provides no value. | |
predicate_function | predicate |
If set, makes the field only accept values that pass this predicate. | |
Related Functions | |
(Note that these are not member functions.) | |
template<class T > | |
config_value_adaptor_field< T > | make_config_value_adaptor_field (string_view name, optional< T > default_value=none, bool(*predicate)(const T &)=nullptr) |
Convenience function for creating a config_value_adaptor_field . More... | |
Describes a field of type T of an adaptor.
|
related |
Convenience function for creating a config_value_adaptor_field
.
name | name of the field in configuration files and on the CLI. |
default_value | if set, provides a fallback value if the user does not provide a value. |
predicate | if set, restricts what values the field accepts. |
config_value_adaptor_field
object, constructed from given arguments.