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
dfd900c8
Commit
dfd900c8
authored
Nov 01, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate review feedback, fix flag handling
parent
d52371cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
15 deletions
+10
-15
libcaf_core/caf/stream_manager.hpp
libcaf_core/caf/stream_manager.hpp
+8
-13
libcaf_core/src/stream_manager.cpp
libcaf_core/src/stream_manager.cpp
+2
-2
No files found.
libcaf_core/caf/stream_manager.hpp
View file @
dfd900c8
...
@@ -47,12 +47,12 @@ public:
...
@@ -47,12 +47,12 @@ public:
/// outbound paths exist.
/// outbound paths exist.
static
constexpr
int
is_continuous_flag
=
0x0001
;
static
constexpr
int
is_continuous_flag
=
0x0001
;
/// Denotes whether the stream is about to stop, only sending
already
/// Denotes whether the stream is about to stop, only sending
buffered
///
buffered
elements.
/// elements.
static
constexpr
int
is_shutting_down_flag
=
0x0002
;
static
constexpr
int
is_shutting_down_flag
=
0x0002
;
/// Denotes whether the manager has
already stopped. Calling member function
s
/// Denotes whether the manager has
stopped. Calling member functions such a
s
/// s
uch as s
top() or abort() on it no longer has any effect.
/// stop() or abort() on it no longer has any effect.
static
constexpr
int
is_stopped_flag
=
0x0004
;
static
constexpr
int
is_stopped_flag
=
0x0004
;
// -- member types -----------------------------------------------------------
// -- member types -----------------------------------------------------------
...
@@ -147,14 +147,9 @@ public:
...
@@ -147,14 +147,9 @@ public:
// -- properties -------------------------------------------------------------
// -- properties -------------------------------------------------------------
/// Returns whether this stream is shutting down.
/// Returns whether this stream is neither shutting down nor has stopped.
bool
shutting_down
()
const
noexcept
{
bool
running
()
const
noexcept
{
return
getf
(
is_shutting_down_flag
);
return
getf
(
is_shutting_down_flag
|
is_stopped_flag
)
==
0
;
}
/// Returns whether this manager has already stopped.
bool
stopped
()
const
noexcept
{
return
getf
(
is_stopped_flag
);
}
}
/// Returns whether this stream remains open even if no in- or outbound paths
/// Returns whether this stream remains open even if no in- or outbound paths
...
@@ -167,7 +162,7 @@ public:
...
@@ -167,7 +162,7 @@ public:
/// Sets whether this stream remains open even if no in- or outbound paths
/// Sets whether this stream remains open even if no in- or outbound paths
/// exist.
/// exist.
void
continuous
(
bool
x
)
noexcept
{
void
continuous
(
bool
x
)
noexcept
{
if
(
!
shutting_down
())
{
if
(
running
())
{
if
(
x
)
if
(
x
)
setf
(
is_continuous_flag
);
setf
(
is_continuous_flag
);
else
else
...
...
libcaf_core/src/stream_manager.cpp
View file @
dfd900c8
...
@@ -125,7 +125,7 @@ void stream_manager::handle(stream_slots slots, upstream_msg::forced_drop& x) {
...
@@ -125,7 +125,7 @@ void stream_manager::handle(stream_slots slots, upstream_msg::forced_drop& x) {
void
stream_manager
::
stop
(
error
reason
)
{
void
stream_manager
::
stop
(
error
reason
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
reason
));
CAF_LOG_TRACE
(
CAF_ARG
(
reason
));
if
(
stopped
(
))
if
(
getf
(
is_stopped_flag
))
return
;
return
;
flags_
=
is_stopped_flag
;
flags_
=
is_stopped_flag
;
if
(
reason
)
if
(
reason
)
...
@@ -138,7 +138,7 @@ void stream_manager::stop(error reason) {
...
@@ -138,7 +138,7 @@ void stream_manager::stop(error reason) {
void
stream_manager
::
shutdown
()
{
void
stream_manager
::
shutdown
()
{
CAF_LOG_TRACE
(
""
);
CAF_LOG_TRACE
(
""
);
if
(
getf
(
is_shutting_down_flag
|
is_stopped_flag
))
if
(
!
running
(
))
return
;
return
;
flags_
=
is_shutting_down_flag
;
flags_
=
is_shutting_down_flag
;
CAF_LOG_DEBUG
(
"emit shutdown messages on"
CAF_LOG_DEBUG
(
"emit shutdown messages on"
...
...
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