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
b1009986
Commit
b1009986
authored
Nov 09, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve inject DSL macro
parent
5ccca5da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
libcaf_test/caf/test/dsl.hpp
libcaf_test/caf/test/dsl.hpp
+13
-13
No files found.
libcaf_test/caf/test/dsl.hpp
View file @
b1009986
...
...
@@ -458,24 +458,24 @@ public:
void
with
(
Ts
...
xs
)
{
if
(
dest_
==
nullptr
)
CAF_FAIL
(
"missing .to() in inject() statement"
);
auto
msg
=
caf
::
make_message
(
std
::
move
(
xs
)...);
if
(
src_
==
nullptr
)
caf
::
anon_send
(
caf
::
actor_cast
<
caf
::
actor
>
(
dest_
),
xs
...
);
caf
::
anon_send
(
caf
::
actor_cast
<
caf
::
actor
>
(
dest_
),
msg
);
else
caf
::
send_as
(
caf
::
actor_cast
<
caf
::
actor
>
(
src_
),
caf
::
actor_cast
<
caf
::
actor
>
(
dest_
),
xs
...);
CAF_REQUIRE
(
sched_
.
prioritize
(
dest_
));
caf
::
actor_cast
<
caf
::
actor
>
(
dest_
),
msg
);
if
(
!
sched_
.
prioritize
(
dest_
))
CAF_FAIL
(
"inject: failed to schedule destination actor"
);
auto
dest_ptr
=
&
sched_
.
next_job
<
caf
::
abstract_actor
>
();
auto
ptr
=
dest_ptr
->
peek_at_next_mailbox_element
();
CAF_REQUIRE
(
ptr
!=
nullptr
);
CAF_REQUIRE_EQUAL
(
ptr
->
sender
,
src_
);
// TODO: replace this workaround with the make_tuple() line when dropping
// support for GCC 4.8.
std
::
tuple
<
Ts
...
>
tmp
{
std
::
move
(
xs
)...};
using
namespace
caf
::
detail
;
elementwise_compare_inspector
<
decltype
(
tmp
)
>
inspector
{
tmp
};
auto
ys
=
extract
<
Ts
...
>
(
dest_
);
auto
ys_indices
=
get_indices
(
ys
);
CAF_REQUIRE
(
apply_args
(
inspector
,
ys_indices
,
ys
));
if
(
ptr
==
nullptr
)
CAF_FAIL
(
"inject: failed to get next message from destination actor"
);
if
(
ptr
->
sender
!=
src_
)
CAF_FAIL
(
"inject: found unexpected sender for the next message"
);
if
(
ptr
->
payload
.
cptr
()
!=
msg
.
cptr
())
CAF_FAIL
(
"inject: found unexpected message => "
<<
ptr
->
payload
<<
" !! "
<<
msg
);
msg
.
reset
();
// drop local reference before running the actor
run_once
();
}
...
...
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