Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
bd80271c
Commit
bd80271c
authored
Oct 17, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve documentation
parent
3d2fda9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
libcaf_core/caf/config_value_adaptor_field.hpp
libcaf_core/caf/config_value_adaptor_field.hpp
+20
-2
No files found.
libcaf_core/caf/config_value_adaptor_field.hpp
View file @
bd80271c
...
...
@@ -26,13 +26,31 @@ namespace caf {
/// Describes a field of type T of an adaptor.
template
<
class
T
>
struct
config_value_adaptor_field
{
/// Type of the field.
using
value_type
=
T
;
using
predicate_function
=
bool
(
*
)(
const
T
&
);
/// Predicate function for .
using
predicate_function
=
bool
(
*
)(
const
value_type
&
);
/// Name of the field in configuration files and on the CLI.
string_view
name
;
optional
<
T
>
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.
optional
<
value_type
>
default_value
;
/// If set, makes the field only accept values that pass this predicate.
predicate_function
predicate
;
};
/// Convenience function for creating a `config_value_adaptor_field`.
/// @param name name of the field in configuration files and on the CLI.
/// @param default_value if set, provides a fallback value if the user does not
/// provide a value.
/// @param predicate if set, restricts what values the field accepts.
/// @returns a `config_value_adaptor_field` object, constructed from given
/// arguments.
/// @relates config_value_adaptor_field
template
<
class
T
>
config_value_adaptor_field
<
T
>
make_config_value_adaptor_field
(
string_view
name
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment