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
433ad433
Commit
433ad433
authored
Oct 29, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify arguments when spawning remote actors
parent
51035124
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
libcaf_core/caf/experimental/announce_actor_type.hpp
libcaf_core/caf/experimental/announce_actor_type.hpp
+23
-0
No files found.
libcaf_core/caf/experimental/announce_actor_type.hpp
View file @
433ad433
...
@@ -57,6 +57,26 @@ void dyn_spawn_prepare_message(message& msg, T* self, selfptr_mode_token) {
...
@@ -57,6 +57,26 @@ void dyn_spawn_prepare_message(message& msg, T* self, selfptr_mode_token) {
msg
=
message
{
detail
::
message_data
::
cow_ptr
{
std
::
move
(
ptr
)}}
+
tmp
;
msg
=
message
{
detail
::
message_data
::
cow_ptr
{
std
::
move
(
ptr
)}}
+
tmp
;
}
}
template
<
class
Args
>
struct
message_verifier
;
template
<
>
struct
message_verifier
<
detail
::
type_list
<>>
{
bool
operator
()(
message
&
msg
,
void_mode_token
)
{
return
msg
.
empty
();
}
};
template
<
class
T
,
class
...
Ts
>
struct
message_verifier
<
detail
::
type_list
<
T
,
Ts
...
>>
{
bool
operator
()(
message
&
msg
,
void_mode_token
)
{
return
msg
.
match_elements
<
T
,
Ts
...
>
();
}
bool
operator
()(
message
&
msg
,
selfptr_mode_token
)
{
return
msg
.
match_elements
<
Ts
...
>
();
}
};
template
<
class
F
>
template
<
class
F
>
spawn_fun
make_spawn_fun
(
F
fun
)
{
spawn_fun
make_spawn_fun
(
F
fun
)
{
return
[
fun
](
message
msg
)
->
spawn_result
{
return
[
fun
](
message
msg
)
->
spawn_result
{
...
@@ -64,6 +84,9 @@ spawn_fun make_spawn_fun(F fun) {
...
@@ -64,6 +84,9 @@ spawn_fun make_spawn_fun(F fun) {
using
impl
=
typename
trait
::
impl
;
using
impl
=
typename
trait
::
impl
;
using
behavior_t
=
typename
trait
::
behavior_type
;
using
behavior_t
=
typename
trait
::
behavior_type
;
spawn_mode_token
<
trait
::
mode
>
tk
;
spawn_mode_token
<
trait
::
mode
>
tk
;
message_verifier
<
typename
trait
::
arg_types
>
mv
;
if
(
!
mv
(
msg
,
tk
))
return
{};
auto
ptr
=
make_counted
<
impl
>
();
auto
ptr
=
make_counted
<
impl
>
();
dyn_spawn_prepare_message
<
impl
>
(
msg
,
ptr
.
get
(),
tk
);
dyn_spawn_prepare_message
<
impl
>
(
msg
,
ptr
.
get
(),
tk
);
ptr
->
initial_behavior_fac
([
=
](
local_actor
*
)
->
behavior
{
ptr
->
initial_behavior_fac
([
=
](
local_actor
*
)
->
behavior
{
...
...
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