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
35af5369
Commit
35af5369
authored
Aug 24, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow URI-formatted group identifiers
parent
2776da90
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
libcaf_core/caf/group_manager.hpp
libcaf_core/caf/group_manager.hpp
+5
-0
libcaf_core/src/group.cpp
libcaf_core/src/group.cpp
+1
-1
libcaf_core/src/group_manager.cpp
libcaf_core/src/group_manager.cpp
+12
-0
No files found.
libcaf_core/caf/group_manager.hpp
View file @
35af5369
...
...
@@ -53,6 +53,11 @@ public:
// -- observers --------------------------------------------------------------
/// Get a handle to the group associated with given URI scheme.
/// @threadsafe
/// @experimental
expected
<
group
>
get
(
std
::
string
group_uri
)
const
;
/// Get a handle to the group associated with
/// `identifier` from the module `mod_name`.
/// @threadsafe
...
...
libcaf_core/src/group.cpp
View file @
35af5369
...
...
@@ -85,7 +85,7 @@ std::string to_string(const group& x) {
if
(
x
==
invalid_group
)
return
"<invalid-group>"
;
std
::
string
result
=
x
.
get
()
->
module
().
name
();
result
+=
"
/
"
;
result
+=
"
:
"
;
result
+=
x
.
get
()
->
identifier
();
return
result
;
}
...
...
libcaf_core/src/group_manager.cpp
View file @
35af5369
...
...
@@ -469,6 +469,18 @@ group group_manager::anonymous() const {
return
*
get_module
(
"local"
)
->
get
(
id
);
}
expected
<
group
>
group_manager
::
get
(
std
::
string
group_uri
)
const
{
CAF_LOG_TRACE
(
CAF_ARG
(
module_name
)
<<
CAF_ARG
(
group_identifier
));
// URI parsing is pretty much a brute-force approach, no actual validation yet
auto
p
=
group_uri
.
find
(
':'
);
if
(
p
==
std
::
string
::
npos
)
return
sec
::
invalid_argument
;
auto
group_id
=
group_uri
.
substr
(
p
+
1
);
// erase all but the scheme part from the URI and use that as module name
group_uri
.
erase
(
p
);
return
get
(
group_uri
,
group_id
);
}
expected
<
group
>
group_manager
::
get
(
const
std
::
string
&
module_name
,
const
std
::
string
&
group_identifier
)
const
{
CAF_LOG_TRACE
(
CAF_ARG
(
module_name
)
<<
CAF_ARG
(
group_identifier
));
...
...
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