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
5b4d38ad
Commit
5b4d38ad
authored
Nov 22, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add convenience functions for config_value_map
parent
cce7fec0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
libcaf_core/caf/config_value.hpp
libcaf_core/caf/config_value.hpp
+9
-1
libcaf_core/src/config_value.cpp
libcaf_core/src/config_value.cpp
+11
-0
No files found.
libcaf_core/caf/config_value.hpp
View file @
5b4d38ad
...
...
@@ -549,11 +549,19 @@ void put_impl(dictionary<config_value::dictionary>& dict, string_view key,
/// @param value New value for given `key`.
template
<
class
T
>
void
put
(
dictionary
<
config_value
::
dictionary
>&
dict
,
string_view
key
,
T
&&
value
)
{
T
&&
value
)
{
config_value
tmp
{
std
::
forward
<
T
>
(
value
)};
put_impl
(
dict
,
key
,
tmp
);
}
/// Inserts a new list named `name` into the dictionary `xs` and returns
/// a reference to it. Overrides existing entries with the same name.
config_value
::
list
&
put_list
(
config_value
::
dictionary
&
xs
,
std
::
string
name
);
/// Inserts a new list named `name` into the dictionary `xs` and returns
/// a reference to it. Overrides existing entries with the same name.
config_value
::
dictionary
&
put_dictionary
(
config_value
::
dictionary
&
xs
,
std
::
string
name
);
/// @relates config_value
bool
operator
<
(
const
config_value
&
x
,
const
config_value
&
y
);
...
...
libcaf_core/src/config_value.cpp
View file @
5b4d38ad
...
...
@@ -190,5 +190,16 @@ void put_impl(dictionary<config_value::dictionary>& dict, string_view key,
put_impl
(
dict
[
category
],
path
,
value
);
}
config_value
::
list
&
put_list
(
config_value
::
dictionary
&
xs
,
std
::
string
name
)
{
auto
i
=
xs
.
insert_or_assign
(
std
::
move
(
name
),
config_value
::
list
{});
return
get
<
config_value
::
list
>
(
i
.
first
->
second
);
}
config_value
::
dictionary
&
put_dictionary
(
config_value
::
dictionary
&
xs
,
std
::
string
name
)
{
auto
i
=
xs
.
insert_or_assign
(
std
::
move
(
name
),
config_value
::
dictionary
{});
return
get
<
config_value
::
dictionary
>
(
i
.
first
->
second
);
}
}
// namespace caf
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