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
15715406
Commit
15715406
authored
Nov 07, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix type checking in fan_out_request
parent
467a9c77
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
libcaf_core/caf/policy/fan_in_responses.hpp
libcaf_core/caf/policy/fan_in_responses.hpp
+4
-2
libcaf_core/caf/policy/single_response.hpp
libcaf_core/caf/policy/single_response.hpp
+3
-0
libcaf_core/caf/response_handle.hpp
libcaf_core/caf/response_handle.hpp
+3
-3
No files found.
libcaf_core/caf/policy/fan_in_responses.hpp
View file @
15715406
...
...
@@ -147,6 +147,10 @@ public:
using
message_id_list
=
std
::
vector
<
message_id
>
;
template
<
class
Fun
>
using
type_checker
=
detail
::
type_checker
<
response_type
,
detail
::
fan_in_responses_helper_t
<
detail
::
decay_t
<
Fun
>>>
;
explicit
fan_in_responses
(
message_id_list
ids
)
:
ids_
(
std
::
move
(
ids
))
{
CAF_ASSERT
(
ids_
.
size
()
<=
static_cast
<
size_t
>
(
std
::
numeric_limits
<
int
>::
max
()));
...
...
@@ -174,7 +178,6 @@ public:
void
receive
(
Self
*
self
,
F
&&
f
,
G
&&
g
)
const
{
using
helper_type
=
detail
::
fan_in_responses_helper_t
<
detail
::
decay_t
<
F
>>
;
helper_type
helper
{
ids_
.
size
(),
std
::
forward
<
F
>
(
f
)};
detail
::
type_checker
<
ResponseType
,
helper_type
>::
check
();
auto
error_handler
=
[
&
](
error
&
err
)
{
if
(
*
helper
.
pending
>
0
)
{
*
helper
.
pending
=
0
;
...
...
@@ -200,7 +203,6 @@ private:
using
helper_type
=
fan_in_responses_helper_t
<
decay_t
<
F
>>
;
using
error_handler_type
=
fan_in_responses_error_handler
<
decay_t
<
OnError
>>
;
helper_type
helper
{
ids_
.
size
(),
std
::
move
(
f
)};
type_checker
<
ResponseType
,
helper_type
>::
check
();
error_handler_type
err_helper
{
std
::
forward
<
OnError
>
(
g
),
helper
.
pending
};
return
{
std
::
move
(
helper
),
...
...
libcaf_core/caf/policy/single_response.hpp
View file @
15715406
...
...
@@ -39,6 +39,9 @@ public:
using
response_type
=
ResponseType
;
template
<
class
Fun
>
using
type_checker
=
detail
::
type_checker
<
response_type
,
Fun
>
;
explicit
single_response
(
message_id
mid
)
noexcept
:
mid_
(
mid
)
{
// nop
}
...
...
libcaf_core/caf/response_handle.hpp
View file @
15715406
...
...
@@ -80,7 +80,7 @@ public:
static_assert
(
std
::
is_same
<
void
,
result_type
>::
value
,
"response handlers are not allowed to have a return "
"type other than void"
);
detail
::
type_checker
<
response_type
,
F
>::
check
();
policy_type
::
template
type_checker
<
F
>
::
check
();
policy_
.
await
(
self_
,
std
::
move
(
f
),
std
::
move
(
g
));
}
...
...
@@ -103,7 +103,7 @@ public:
static_assert
(
std
::
is_same
<
void
,
result_type
>::
value
,
"response handlers are not allowed to have a return "
"type other than void"
);
detail
::
type_checker
<
response_type
,
F
>::
check
();
policy_type
::
template
type_checker
<
F
>
::
check
();
policy_
.
then
(
self_
,
std
::
move
(
f
),
std
::
move
(
g
));
}
...
...
@@ -128,7 +128,7 @@ public:
static_assert
(
std
::
is_same
<
void
,
result_type
>::
value
,
"response handlers are not allowed to have a return "
"type other than void"
);
detail
::
type_checker
<
response_type
,
F
>::
check
();
policy_type
::
template
type_checker
<
F
>
::
check
();
policy_
.
receive
(
self_
,
std
::
move
(
f
),
std
::
move
(
g
));
}
...
...
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