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
5634c340
Commit
5634c340
authored
Nov 01, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add for_each_option to config class, relates #619
parent
d86049a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
libcaf_core/caf/actor_system_config.hpp
libcaf_core/caf/actor_system_config.hpp
+10
-0
libcaf_core/src/actor_system_config.cpp
libcaf_core/src/actor_system_config.cpp
+6
-9
No files found.
libcaf_core/caf/actor_system_config.hpp
View file @
5634c340
...
@@ -332,6 +332,16 @@ public:
...
@@ -332,6 +332,16 @@ public:
error_renderer_map
error_renderers
;
error_renderer_map
error_renderers
;
// -- convenience functions --------------------------------------------------
template
<
class
F
>
void
for_each_option
(
F
f
)
const
{
const
option_vector
*
all_options
[]
=
{
&
options_
,
&
custom_options_
};
for
(
auto
&
opt_vec
:
all_options
)
for
(
auto
&
opt
:
*
opt_vec
)
f
(
*
opt
);
}
// -- utility for caf-run ----------------------------------------------------
// -- utility for caf-run ----------------------------------------------------
// Config parameter for individual actor types.
// Config parameter for individual actor types.
...
...
libcaf_core/src/actor_system_config.cpp
View file @
5634c340
...
@@ -438,16 +438,13 @@ actor_system_config& actor_system_config::parse(message& args,
...
@@ -438,16 +438,13 @@ actor_system_config& actor_system_config::parse(message& args,
if
(
res
.
opts
.
count
(
"caf#dump-config"
)
!=
0u
)
{
if
(
res
.
opts
.
count
(
"caf#dump-config"
)
!=
0u
)
{
cli_helptext_printed
=
true
;
cli_helptext_printed
=
true
;
std
::
string
category
;
std
::
string
category
;
option_vector
*
all_options
[]
=
{
&
options_
,
&
custom_options_
};
for_each_option
([
&
](
const
config_option
&
x
)
{
for
(
auto
&
opt_vec
:
all_options
)
{
if
(
category
!=
x
.
category
())
{
for
(
auto
&
opt
:
*
opt_vec
)
{
category
=
x
.
category
();
if
(
category
!=
opt
->
category
())
{
cout
<<
"["
<<
category
<<
"]"
<<
endl
;
category
=
opt
->
category
();
cout
<<
"["
<<
category
<<
"]"
<<
endl
;
}
cout
<<
opt
->
name
()
<<
"="
<<
opt
->
to_string
()
<<
endl
;
}
}
}
cout
<<
x
.
name
()
<<
"="
<<
x
.
to_string
()
<<
endl
;
});
}
}
return
*
this
;
return
*
this
;
}
}
...
...
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