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
0543d006
Commit
0543d006
authored
Aug 31, 2016
by
Dominik Charousset
Committed by
GitHub
Aug 31, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #503 from ufownl/fix_compile_error
Fix compile error
parents
fc60f8a7
05e6d767
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
libcaf_core/caf/mixin/sender.hpp
libcaf_core/caf/mixin/sender.hpp
+1
-1
libcaf_core/test/typed_spawn.cpp
libcaf_core/test/typed_spawn.cpp
+22
-0
No files found.
libcaf_core/caf/mixin/sender.hpp
View file @
0543d006
...
@@ -71,7 +71,7 @@ public:
...
@@ -71,7 +71,7 @@ public:
"statically typed actors; use anon_send() or request() when "
"statically typed actors; use anon_send() or request() when "
"communicating with dynamically typed actors"
);
"communicating with dynamically typed actors"
);
static_assert
(
res_t
::
valid
,
"receiver does not accept given message"
);
static_assert
(
res_t
::
valid
,
"receiver does not accept given message"
);
static_assert
(
std
::
is_same
<
typename
res_t
::
type
,
type_list
<>
>::
value
static_assert
(
is_void_response
<
typename
res_t
::
type
>::
value
||
response_type_unbox
<
||
response_type_unbox
<
signatures_of_t
<
Subtype
>
,
signatures_of_t
<
Subtype
>
,
typename
res_t
::
type
typename
res_t
::
type
...
...
libcaf_core/test/typed_spawn.cpp
View file @
0543d006
...
@@ -260,6 +260,8 @@ maybe_string_delegator(maybe_string_actor::pointer self, maybe_string_actor x) {
...
@@ -260,6 +260,8 @@ maybe_string_delegator(maybe_string_actor::pointer self, maybe_string_actor x) {
using
int_actor
=
typed_actor
<
replies_to
<
int
>::
with
<
int
>>
;
using
int_actor
=
typed_actor
<
replies_to
<
int
>::
with
<
int
>>
;
using
float_actor
=
typed_actor
<
reacts_to
<
float
>>
;
int_actor
::
behavior_type
int_fun
()
{
int_actor
::
behavior_type
int_fun
()
{
return
{
return
{
[](
int
i
)
{
return
i
*
i
;
}
[](
int
i
)
{
return
i
*
i
;
}
...
@@ -297,6 +299,25 @@ behavior foo2(event_based_actor* self) {
...
@@ -297,6 +299,25 @@ behavior foo2(event_based_actor* self) {
};
};
}
}
float_actor
::
behavior_type
float_fun
(
float_actor
::
pointer
self
)
{
return
{
[
=
](
float
a
)
{
CAF_CHECK_EQUAL
(
a
,
1.0
f
);
self
->
quit
(
exit_reason
::
user_shutdown
);
}
};
}
int_actor
::
behavior_type
foo3
(
int_actor
::
pointer
self
)
{
auto
b
=
self
->
spawn
<
linked
>
(
float_fun
);
self
->
send
(
b
,
1.0
f
);
return
{
[
=
](
int
)
{
return
0
;
}
};
}
struct
fixture
{
struct
fixture
{
actor_system_config
cfg
;
actor_system_config
cfg
;
actor_system
system
;
actor_system
system
;
...
@@ -452,6 +473,7 @@ CAF_TEST(sending_typed_actors) {
...
@@ -452,6 +473,7 @@ CAF_TEST(sending_typed_actors) {
CAF_CHECK_EQUAL
(
i
,
100
);
CAF_CHECK_EQUAL
(
i
,
100
);
}
}
);
);
self
->
spawn
(
foo3
);
}
}
CAF_TEST
(
sending_typed_actors_and_down_msg
)
{
CAF_TEST
(
sending_typed_actors_and_down_msg
)
{
...
...
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