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
67fcb31b
Commit
67fcb31b
authored
Mar 05, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `stream_scatterer::{take => remove}_path`
parent
cb652868
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
17 deletions
+20
-17
libcaf_core/caf/fused_scatterer.hpp
libcaf_core/caf/fused_scatterer.hpp
+4
-3
libcaf_core/caf/invalid_stream_scatterer.hpp
libcaf_core/caf/invalid_stream_scatterer.hpp
+2
-1
libcaf_core/caf/stream_scatterer.hpp
libcaf_core/caf/stream_scatterer.hpp
+2
-1
libcaf_core/caf/stream_scatterer_impl.hpp
libcaf_core/caf/stream_scatterer_impl.hpp
+2
-1
libcaf_core/src/invalid_stream_scatterer.cpp
libcaf_core/src/invalid_stream_scatterer.cpp
+2
-3
libcaf_core/src/stream_manager.cpp
libcaf_core/src/stream_manager.cpp
+3
-2
libcaf_core/src/stream_scatterer_impl.cpp
libcaf_core/src/stream_scatterer_impl.cpp
+5
-6
No files found.
libcaf_core/caf/fused_scatterer.hpp
View file @
67fcb31b
...
@@ -168,13 +168,14 @@ public:
...
@@ -168,13 +168,14 @@ public:
return
result
;
return
result
;
}
}
unique_path_ptr
take_path
(
stream_slot
slot
)
noexcept
override
{
bool
remove_path
(
stream_slot
slot
,
error
reason
,
bool
silent
)
noexcept
override
{
auto
i
=
paths_
.
find
(
slot
);
auto
i
=
paths_
.
find
(
slot
);
if
(
i
==
paths_
.
end
())
if
(
i
==
paths_
.
end
())
return
nullptr
;
return
false
;
auto
owner
=
i
->
second
.
owner
;
auto
owner
=
i
->
second
.
owner
;
paths_
.
erase
(
i
);
paths_
.
erase
(
i
);
return
owner
->
take_path
(
slo
t
);
return
owner
->
remove_path
(
slot
,
std
::
move
(
reason
),
silen
t
);
}
}
path_ptr
path
(
stream_slot
slot
)
noexcept
override
{
path_ptr
path
(
stream_slot
slot
)
noexcept
override
{
...
...
libcaf_core/caf/invalid_stream_scatterer.hpp
View file @
67fcb31b
...
@@ -34,7 +34,8 @@ public:
...
@@ -34,7 +34,8 @@ public:
path_ptr
add_path
(
stream_slots
slots
,
strong_actor_ptr
target
)
override
;
path_ptr
add_path
(
stream_slots
slots
,
strong_actor_ptr
target
)
override
;
unique_path_ptr
take_path
(
stream_slot
slots
)
noexcept
override
;
bool
remove_path
(
stream_slot
slots
,
error
reason
,
bool
silent
)
noexcept
override
;
path_ptr
path
(
stream_slot
slots
)
noexcept
override
;
path_ptr
path
(
stream_slot
slots
)
noexcept
override
;
...
...
libcaf_core/caf/stream_scatterer.hpp
View file @
67fcb31b
...
@@ -120,7 +120,8 @@ public:
...
@@ -120,7 +120,8 @@ public:
virtual
path_ptr
add_path
(
stream_slots
slots
,
strong_actor_ptr
target
)
=
0
;
virtual
path_ptr
add_path
(
stream_slots
slots
,
strong_actor_ptr
target
)
=
0
;
/// Removes a path from the scatterer and returns it.
/// Removes a path from the scatterer and returns it.
virtual
unique_path_ptr
take_path
(
stream_slot
slots
)
noexcept
=
0
;
virtual
bool
remove_path
(
stream_slot
slots
,
error
reason
,
bool
silent
)
noexcept
=
0
;
/// Returns the path associated to `slots` or `nullptr`.
/// Returns the path associated to `slots` or `nullptr`.
virtual
path_ptr
path
(
stream_slot
slots
)
noexcept
=
0
;
virtual
path_ptr
path
(
stream_slot
slots
)
noexcept
=
0
;
...
...
libcaf_core/caf/stream_scatterer_impl.hpp
View file @
67fcb31b
...
@@ -61,7 +61,8 @@ public:
...
@@ -61,7 +61,8 @@ public:
path_ptr
add_path
(
stream_slots
slots
,
strong_actor_ptr
target
)
override
;
path_ptr
add_path
(
stream_slots
slots
,
strong_actor_ptr
target
)
override
;
unique_path_ptr
take_path
(
stream_slot
slots
)
noexcept
override
;
bool
remove_path
(
stream_slot
slots
,
error
reason
,
bool
silent
)
noexcept
override
;
path_ptr
path
(
stream_slot
slots
)
noexcept
override
;
path_ptr
path
(
stream_slot
slots
)
noexcept
override
;
...
...
libcaf_core/src/invalid_stream_scatterer.cpp
View file @
67fcb31b
...
@@ -42,9 +42,8 @@ auto invalid_stream_scatterer::add_path(stream_slots, strong_actor_ptr)
...
@@ -42,9 +42,8 @@ auto invalid_stream_scatterer::add_path(stream_slots, strong_actor_ptr)
return
nullptr
;
return
nullptr
;
}
}
auto
invalid_stream_scatterer
::
take_path
(
stream_slot
)
noexcept
bool
invalid_stream_scatterer
::
remove_path
(
stream_slot
,
error
,
bool
)
noexcept
{
->
unique_path_ptr
{
return
false
;
return
unique_path_ptr
{
nullptr
};
}
}
auto
invalid_stream_scatterer
::
path
(
stream_slot
)
noexcept
->
path_ptr
{
auto
invalid_stream_scatterer
::
path
(
stream_slot
)
noexcept
->
path_ptr
{
...
...
libcaf_core/src/stream_manager.cpp
View file @
67fcb31b
...
@@ -83,11 +83,12 @@ void stream_manager::handle(stream_slots slots, upstream_msg::ack_batch& x) {
...
@@ -83,11 +83,12 @@ void stream_manager::handle(stream_slots slots, upstream_msg::ack_batch& x) {
}
}
void
stream_manager
::
handle
(
stream_slots
slots
,
upstream_msg
::
drop
&
)
{
void
stream_manager
::
handle
(
stream_slots
slots
,
upstream_msg
::
drop
&
)
{
out
().
take_path
(
slots
.
receiver
);
error
tmp
;
out
().
remove_path
(
slots
.
receiver
,
std
::
move
(
tmp
),
true
);
}
}
void
stream_manager
::
handle
(
stream_slots
slots
,
upstream_msg
::
forced_drop
&
x
)
{
void
stream_manager
::
handle
(
stream_slots
slots
,
upstream_msg
::
forced_drop
&
x
)
{
if
(
out
().
path
(
slots
.
receiver
)
!=
nullptr
)
if
(
out
().
remove_path
(
slots
.
receiver
,
x
.
reason
,
true
)
)
abort
(
std
::
move
(
x
.
reason
));
abort
(
std
::
move
(
x
.
reason
));
}
}
...
...
libcaf_core/src/stream_scatterer_impl.cpp
View file @
67fcb31b
...
@@ -49,16 +49,15 @@ size_t stream_scatterer_impl::num_paths() const noexcept {
...
@@ -49,16 +49,15 @@ size_t stream_scatterer_impl::num_paths() const noexcept {
return
paths_
.
size
();
return
paths_
.
size
();
}
}
auto
stream_scatterer_impl
::
take_path
(
stream_slot
slot
)
noexcept
bool
stream_scatterer_impl
::
remove_path
(
stream_slot
slot
,
error
reason
,
->
unique_path_ptr
{
bool
silent
)
noexcept
{
unique_path_ptr
result
;
auto
i
=
paths_
.
find
(
slot
);
auto
i
=
paths_
.
find
(
slot
);
if
(
i
!=
paths_
.
end
())
{
if
(
i
!=
paths_
.
end
())
{
about_to_erase
(
i
->
second
.
get
(),
true
,
nullptr
);
about_to_erase
(
i
->
second
.
get
(),
silent
,
&
reason
);
result
.
swap
(
i
->
second
);
paths_
.
erase
(
i
);
paths_
.
erase
(
i
);
return
true
;
}
}
return
result
;
return
false
;
}
}
auto
stream_scatterer_impl
::
path
(
stream_slot
slot
)
noexcept
->
path_ptr
{
auto
stream_scatterer_impl
::
path
(
stream_slot
slot
)
noexcept
->
path_ptr
{
...
...
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