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
aa804fe9
Commit
aa804fe9
authored
Apr 15, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename parameters in proxy_registry, close #551
parent
2e8f7c9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
18 deletions
+16
-18
libcaf_core/caf/proxy_registry.hpp
libcaf_core/caf/proxy_registry.hpp
+8
-10
libcaf_core/src/proxy_registry.cpp
libcaf_core/src/proxy_registry.cpp
+8
-8
No files found.
libcaf_core/caf/proxy_registry.hpp
View file @
aa804fe9
...
...
@@ -37,15 +37,13 @@ namespace caf {
/// in the same namespace to exchange messages.
class
proxy_registry
{
public:
using
key_type
=
node_id
;
/// Responsible for creating proxy actors.
class
backend
{
public:
virtual
~
backend
();
/// Creates a new proxy instance.
virtual
strong_actor_ptr
make_proxy
(
key_type
,
actor_id
)
=
0
;
virtual
strong_actor_ptr
make_proxy
(
node_id
,
actor_id
)
=
0
;
virtual
execution_unit
*
registry_context
()
=
0
;
};
...
...
@@ -73,23 +71,23 @@ public:
using
proxy_map
=
std
::
map
<
actor_id
,
strong_actor_ptr
>
;
/// Returns the number of proxies for `node`.
size_t
count_proxies
(
const
key_type
&
node
);
size_t
count_proxies
(
const
node_id
&
node
);
/// Returns the proxy instance identified by `node` and `aid`.
strong_actor_ptr
get
(
const
key_type
&
node
,
actor_id
aid
);
strong_actor_ptr
get
(
const
node_id
&
node
,
actor_id
aid
);
/// Returns the proxy instance identified by `node` and `aid`
/// or creates a new (default) proxy instance.
strong_actor_ptr
get_or_put
(
const
key_type
&
nid
,
actor_id
aid
);
strong_actor_ptr
get_or_put
(
const
node_id
&
nid
,
actor_id
aid
);
/// Returns all known proxies.
std
::
vector
<
strong_actor_ptr
>
get_all
(
const
key_type
&
node
);
std
::
vector
<
strong_actor_ptr
>
get_all
(
const
node_id
&
node
);
/// Deletes all proxies for `node`.
void
erase
(
const
key_type
&
nid
);
void
erase
(
const
node_id
&
nid
);
/// Deletes the proxy with id `aid` for `n
ode
`.
void
erase
(
const
key_type
&
inf
,
actor_id
aid
,
/// Deletes the proxy with id `aid` for `n
id
`.
void
erase
(
const
node_id
&
nid
,
actor_id
aid
,
error
rsn
=
exit_reason
::
remote_link_unreachable
);
/// Queries whether there are any proxies left.
...
...
libcaf_core/src/proxy_registry.cpp
View file @
aa804fe9
...
...
@@ -46,12 +46,12 @@ proxy_registry::~proxy_registry() {
clear
();
}
size_t
proxy_registry
::
count_proxies
(
const
key_type
&
node
)
{
size_t
proxy_registry
::
count_proxies
(
const
node_id
&
node
)
{
auto
i
=
proxies_
.
find
(
node
);
return
(
i
!=
proxies_
.
end
())
?
i
->
second
.
size
()
:
0
;
}
strong_actor_ptr
proxy_registry
::
get
(
const
key_type
&
node
,
actor_id
aid
)
{
strong_actor_ptr
proxy_registry
::
get
(
const
node_id
&
node
,
actor_id
aid
)
{
auto
&
submap
=
proxies_
[
node
];
auto
i
=
submap
.
find
(
aid
);
if
(
i
!=
submap
.
end
())
...
...
@@ -59,7 +59,7 @@ strong_actor_ptr proxy_registry::get(const key_type& node, actor_id aid) {
return
nullptr
;
}
strong_actor_ptr
proxy_registry
::
get_or_put
(
const
key_type
&
nid
,
actor_id
aid
)
{
strong_actor_ptr
proxy_registry
::
get_or_put
(
const
node_id
&
nid
,
actor_id
aid
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
nid
)
<<
CAF_ARG
(
aid
));
auto
&
result
=
proxies_
[
nid
][
aid
];
if
(
!
result
)
...
...
@@ -67,7 +67,7 @@ strong_actor_ptr proxy_registry::get_or_put(const key_type& nid, actor_id aid) {
return
result
;
}
std
::
vector
<
strong_actor_ptr
>
proxy_registry
::
get_all
(
const
key_type
&
node
)
{
std
::
vector
<
strong_actor_ptr
>
proxy_registry
::
get_all
(
const
node_id
&
node
)
{
std
::
vector
<
strong_actor_ptr
>
result
;
auto
i
=
proxies_
.
find
(
node
);
if
(
i
!=
proxies_
.
end
())
...
...
@@ -80,7 +80,7 @@ bool proxy_registry::empty() const {
return
proxies_
.
empty
();
}
void
proxy_registry
::
erase
(
const
key_type
&
nid
)
{
void
proxy_registry
::
erase
(
const
node_id
&
nid
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
nid
));
auto
i
=
proxies_
.
find
(
nid
);
if
(
i
==
proxies_
.
end
())
...
...
@@ -90,9 +90,9 @@ void proxy_registry::erase(const key_type& nid) {
proxies_
.
erase
(
i
);
}
void
proxy_registry
::
erase
(
const
key_type
&
inf
,
actor_id
aid
,
error
rsn
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
inf
)
<<
CAF_ARG
(
aid
));
auto
i
=
proxies_
.
find
(
inf
);
void
proxy_registry
::
erase
(
const
node_id
&
nid
,
actor_id
aid
,
error
rsn
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
nid
)
<<
CAF_ARG
(
aid
));
auto
i
=
proxies_
.
find
(
nid
);
if
(
i
!=
proxies_
.
end
())
{
auto
&
submap
=
i
->
second
;
auto
j
=
submap
.
find
(
aid
);
...
...
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