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
ba2382d6
Commit
ba2382d6
authored
Feb 20, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid repeated map lookups
parent
41dc4ac4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
26 deletions
+22
-26
libcaf_core/src/incoming_stream_multiplexer.cpp
libcaf_core/src/incoming_stream_multiplexer.cpp
+9
-13
libcaf_core/src/outgoing_stream_multiplexer.cpp
libcaf_core/src/outgoing_stream_multiplexer.cpp
+13
-13
No files found.
libcaf_core/src/incoming_stream_multiplexer.cpp
View file @
ba2382d6
...
@@ -94,34 +94,30 @@ void incoming_stream_multiplexer::operator()(stream_msg::ack_batch&) {
...
@@ -94,34 +94,30 @@ void incoming_stream_multiplexer::operator()(stream_msg::ack_batch&) {
void
incoming_stream_multiplexer
::
operator
()(
stream_msg
::
close
&
)
{
void
incoming_stream_multiplexer
::
operator
()(
stream_msg
::
close
&
)
{
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
CAF_ASSERT
(
current_stream_state_
!=
streams_
.
end
());
CAF_ASSERT
(
current_stream_state_
!=
streams_
.
end
());
auto
i
=
streams_
.
find
(
current_stream_msg_
->
sid
);
if
(
i
!=
streams_
.
end
())
{
forward_to_downstream
();
forward_to_downstream
();
streams_
.
erase
(
i
);
streams_
.
erase
(
current_stream_state_
);
}
}
}
void
incoming_stream_multiplexer
::
operator
()(
stream_msg
::
abort
&
x
)
{
void
incoming_stream_multiplexer
::
operator
()(
stream_msg
::
abort
&
x
)
{
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
CAF_ASSERT
(
current_stream_state_
!=
streams_
.
end
());
CAF_ASSERT
(
current_stream_state_
!=
streams_
.
end
());
auto
i
=
streams_
.
find
(
current_stream_msg_
->
sid
);
if
(
current_stream_state_
->
second
.
prev_stage
==
self_
->
current_sender
())
if
(
i
!=
streams_
.
end
())
{
fail
(
x
.
reason
,
nullptr
,
current_stream_state_
->
second
.
next_stage
);
if
(
i
->
second
.
prev_stage
==
self_
->
current_sender
())
fail
(
x
.
reason
,
nullptr
,
i
->
second
.
next_stage
);
else
else
fail
(
x
.
reason
,
i
->
second
.
prev_stage
);
fail
(
x
.
reason
,
current_stream_state_
->
second
.
prev_stage
);
streams_
.
erase
(
i
);
streams_
.
erase
(
current_stream_state_
);
}
}
}
void
incoming_stream_multiplexer
::
operator
()(
stream_msg
::
downstream_failed
&
)
{
void
incoming_stream_multiplexer
::
operator
()(
stream_msg
::
downstream_failed
&
)
{
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
CAF_ASSERT
(
current_stream_state_
!=
streams_
.
end
());
CAF_ASSERT
(
current_stream_state_
!=
streams_
.
end
());
// TODO: implement me
}
}
void
incoming_stream_multiplexer
::
operator
()(
stream_msg
::
upstream_failed
&
)
{
void
incoming_stream_multiplexer
::
operator
()(
stream_msg
::
upstream_failed
&
)
{
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
CAF_ASSERT
(
current_stream_state_
!=
streams_
.
end
());
CAF_ASSERT
(
current_stream_state_
!=
streams_
.
end
());
// TODO: implement me
}
}
void
incoming_stream_multiplexer
::
forward_to_upstream
()
{
void
incoming_stream_multiplexer
::
forward_to_upstream
()
{
...
...
libcaf_core/src/outgoing_stream_multiplexer.cpp
View file @
ba2382d6
...
@@ -97,31 +97,31 @@ void outgoing_stream_multiplexer::operator()(stream_msg::ack_batch&) {
...
@@ -97,31 +97,31 @@ void outgoing_stream_multiplexer::operator()(stream_msg::ack_batch&) {
void
outgoing_stream_multiplexer
::
operator
()(
stream_msg
::
close
&
)
{
void
outgoing_stream_multiplexer
::
operator
()(
stream_msg
::
close
&
)
{
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
auto
i
=
streams_
.
find
(
current_stream_msg_
->
sid
);
CAF_ASSERT
(
current_stream_state_
!=
streams_
.
end
());
if
(
i
!=
streams_
.
end
())
{
forward_to_downstream
();
forward_to_downstream
();
streams_
.
erase
(
i
);
streams_
.
erase
(
current_stream_state_
);
}
}
}
void
outgoing_stream_multiplexer
::
operator
()(
stream_msg
::
abort
&
x
)
{
void
outgoing_stream_multiplexer
::
operator
()(
stream_msg
::
abort
&
x
)
{
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
auto
i
=
streams_
.
find
(
current_stream_msg_
->
sid
);
CAF_ASSERT
(
current_stream_state_
!=
streams_
.
end
());
if
(
i
!=
streams_
.
end
())
{
if
(
current_stream_state_
->
second
.
prev_stage
==
self_
->
current_sender
())
if
(
i
->
second
.
prev_stage
==
self_
->
current_sender
())
fail
(
x
.
reason
,
nullptr
,
current_stream_state_
->
second
.
next_stage
);
fail
(
x
.
reason
,
nullptr
,
i
->
second
.
next_stage
);
else
else
fail
(
x
.
reason
,
i
->
second
.
prev_stage
);
fail
(
x
.
reason
,
current_stream_state_
->
second
.
prev_stage
);
streams_
.
erase
(
i
);
streams_
.
erase
(
current_stream_state_
);
}
}
}
void
outgoing_stream_multiplexer
::
operator
()(
stream_msg
::
downstream_failed
&
)
{
void
outgoing_stream_multiplexer
::
operator
()(
stream_msg
::
downstream_failed
&
)
{
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
CAF_ASSERT
(
current_stream_state_
!=
streams_
.
end
());
// TODO: implement me
}
}
void
outgoing_stream_multiplexer
::
operator
()(
stream_msg
::
upstream_failed
&
)
{
void
outgoing_stream_multiplexer
::
operator
()(
stream_msg
::
upstream_failed
&
)
{
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
CAF_ASSERT
(
current_stream_msg_
!=
nullptr
);
CAF_ASSERT
(
current_stream_state_
!=
streams_
.
end
());
// TODO: implement me
}
}
void
outgoing_stream_multiplexer
::
forward_to_upstream
()
{
void
outgoing_stream_multiplexer
::
forward_to_upstream
()
{
...
...
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