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
ef2a704b
Commit
ef2a704b
authored
Feb 08, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Map legacy 'app-identifier' to the new option
parent
da0b256f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
libcaf_core/caf/actor_system_config.hpp
libcaf_core/caf/actor_system_config.hpp
+4
-0
libcaf_core/src/actor_system_config.cpp
libcaf_core/src/actor_system_config.cpp
+26
-1
No files found.
libcaf_core/caf/actor_system_config.hpp
View file @
ef2a704b
...
@@ -339,6 +339,10 @@ private:
...
@@ -339,6 +339,10 @@ private:
static
std
::
string
render_pec
(
uint8_t
,
atom_value
,
const
message
&
);
static
std
::
string
render_pec
(
uint8_t
,
atom_value
,
const
message
&
);
void
extract_config_file_path
(
string_list
&
args
);
void
extract_config_file_path
(
string_list
&
args
);
/// Adjusts the content of the configuration, e.g., for ensuring backwards
/// compatibility with older options.
error
adjust_content
();
};
};
/// @private
/// @private
...
...
libcaf_core/src/actor_system_config.cpp
View file @
ef2a704b
...
@@ -111,6 +111,7 @@ actor_system_config::actor_system_config()
...
@@ -111,6 +111,7 @@ actor_system_config::actor_system_config()
"either 'default' or 'asio' (if available)"
)
"either 'default' or 'asio' (if available)"
)
.
add
<
std
::
vector
<
string
>>
(
"app-identifiers"
,
.
add
<
std
::
vector
<
string
>>
(
"app-identifiers"
,
"valid application identifiers of this node"
)
"valid application identifiers of this node"
)
.
add
<
string
>
(
"app-identifier"
,
"DEPRECATED: use app-identifiers instead"
)
.
add
<
bool
>
(
"enable-automatic-connections"
,
.
add
<
bool
>
(
"enable-automatic-connections"
,
"enables automatic connection management"
)
"enables automatic connection management"
)
.
add
<
size_t
>
(
"max-consecutive-reads"
,
.
add
<
size_t
>
(
"max-consecutive-reads"
,
...
@@ -276,7 +277,7 @@ error actor_system_config::parse(string_list args, std::istream& ini) {
...
@@ -276,7 +277,7 @@ error actor_system_config::parse(string_list args, std::istream& ini) {
std
::
cout
<<
std
::
flush
;
std
::
cout
<<
std
::
flush
;
cli_helptext_printed
=
true
;
cli_helptext_printed
=
true
;
}
}
return
none
;
return
adjust_content
()
;
}
}
error
actor_system_config
::
parse
(
string_list
args
,
const
char
*
ini_file_cstr
)
{
error
actor_system_config
::
parse
(
string_list
args
,
const
char
*
ini_file_cstr
)
{
...
@@ -303,6 +304,11 @@ actor_system_config::add_error_category(atom_value x, error_renderer y) {
...
@@ -303,6 +304,11 @@ actor_system_config::add_error_category(atom_value x, error_renderer y) {
actor_system_config
&
actor_system_config
::
set_impl
(
string_view
name
,
actor_system_config
&
actor_system_config
::
set_impl
(
string_view
name
,
config_value
value
)
{
config_value
value
)
{
if
(
name
==
"middleman.app-identifier"
)
{
// TODO: Print a warning with 0.18 and remove this code with 0.19.
value
.
convert_to_list
();
return
set_impl
(
"middleman.app-identifiers"
,
std
::
move
(
value
));
}
auto
opt
=
custom_options_
.
qualified_name_lookup
(
name
);
auto
opt
=
custom_options_
.
qualified_name_lookup
(
name
);
if
(
opt
!=
nullptr
&&
opt
->
check
(
value
)
==
none
)
{
if
(
opt
!=
nullptr
&&
opt
->
check
(
value
)
==
none
)
{
opt
->
store
(
value
);
opt
->
store
(
value
);
...
@@ -378,6 +384,25 @@ void actor_system_config::extract_config_file_path(string_list& args) {
...
@@ -378,6 +384,25 @@ void actor_system_config::extract_config_file_path(string_list& args) {
args
.
erase
(
i
);
args
.
erase
(
i
);
}
}
error
actor_system_config
::
adjust_content
()
{
// TODO: Print a warning to STDERR if 'app-identifier' is present with 0.18
// and remove this code with 0.19.
auto
i
=
content
.
find
(
"middleman"
);
if
(
i
!=
content
.
end
())
{
if
(
auto
mm
=
get_if
<
settings
>
(
&
i
->
second
))
{
auto
j
=
mm
->
find
(
"app-identifier"
);
if
(
j
!=
mm
->
end
())
{
if
(
!
mm
->
contains
(
"app-identifiers"
))
{
j
->
second
.
convert_to_list
();
mm
->
emplace
(
"app-identifiers"
,
std
::
move
(
j
->
second
));
}
mm
->
container
().
erase
(
j
);
}
}
}
return
none
;
}
const
settings
&
content
(
const
actor_system_config
&
cfg
)
{
const
settings
&
content
(
const
actor_system_config
&
cfg
)
{
return
cfg
.
content
;
return
cfg
.
content
;
}
}
...
...
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