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
74793044
Commit
74793044
authored
Apr 06, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix spawning brokers from composed behaviors
parent
16035ab8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
49 deletions
+9
-49
libcaf_core/caf/composable_behavior_based_actor.hpp
libcaf_core/caf/composable_behavior_based_actor.hpp
+1
-1
libcaf_core/caf/infer_handle.hpp
libcaf_core/caf/infer_handle.hpp
+8
-48
No files found.
libcaf_core/caf/composable_behavior_based_actor.hpp
View file @
74793044
...
...
@@ -33,7 +33,7 @@ class composable_behavior_based_actor : public stateful_actor<State, Base> {
"State is abstract, please make sure to override all "
"virtual operator() member functions"
);
using
super
=
stateful_actor
<
State
,
typename
State
::
actor_b
ase
>
;
using
super
=
stateful_actor
<
State
,
B
ase
>
;
composable_behavior_based_actor
(
actor_config
&
cfg
)
:
super
(
cfg
)
{
// nop
...
...
libcaf_core/caf/infer_handle.hpp
View file @
74793044
...
...
@@ -81,8 +81,8 @@ struct infer_handle_from_fun_impl<behavior, Impl*, true> {
};
// statically typed actor returning a behavior
template
<
class
...
Sigs
,
class
FirstArg
>
struct
infer_handle_from_fun_impl
<
typed_behavior
<
Sigs
...
>
,
FirstArg
,
false
>
{
template
<
class
...
Sigs
,
class
Impl
>
struct
infer_handle_from_fun_impl
<
typed_behavior
<
Sigs
...
>
,
Impl
,
false
>
{
using
type
=
typed_actor
<
Sigs
...
>
;
using
impl
=
typed_event_based_actor
<
Sigs
...
>
;
using
behavior_type
=
typed_behavior
<
Sigs
...
>
;
...
...
@@ -90,53 +90,13 @@ struct infer_handle_from_fun_impl<typed_behavior<Sigs...>, FirstArg, false> {
};
// statically typed actor with self pointer
template
<
class
Result
,
class
...
Sigs
>
struct
infer_handle_from_fun_impl
<
Result
,
typed_event_based_actor
<
Sigs
...
>*
,
true
>
{
template
<
class
...
Sigs
,
class
Impl
>
struct
infer_handle_from_fun_impl
<
typed_behavior
<
Sigs
...
>
,
Impl
*
,
true
>
{
static_assert
(
std
::
is_base_of
<
typed_event_based_actor
<
Sigs
...
>
,
Impl
>::
value
||
std
::
is_base_of
<
io
::
typed_broker
<
Sigs
...
>
,
Impl
>::
value
,
"Self pointer does not match the returned behavior type."
);
using
type
=
typed_actor
<
Sigs
...
>
;
using
impl
=
typed_event_based_actor
<
Sigs
...
>
;
using
behavior_type
=
typed_behavior
<
Sigs
...
>
;
static
constexpr
spawn_mode
mode
=
spawn_mode
::
function_with_selfptr
;
};
// statically typed stateful actor with self pointer
template
<
class
Result
,
class
State
,
class
...
Sigs
>
struct
infer_handle_from_fun_impl
<
Result
,
stateful_actor
<
State
,
typed_event_based_actor
<
Sigs
...
>
>*
,
true
>
{
using
type
=
typed_actor
<
Sigs
...
>
;
using
impl
=
stateful_actor
<
State
,
typed_event_based_actor
<
Sigs
...
>>
;
using
behavior_type
=
typed_behavior
<
Sigs
...
>
;
static
constexpr
spawn_mode
mode
=
spawn_mode
::
function_with_selfptr
;
};
// statically typed broker with self pointer
template
<
class
Result
,
class
...
Sigs
>
struct
infer_handle_from_fun_impl
<
Result
,
io
::
typed_broker
<
Sigs
...
>*
,
true
>
{
using
type
=
typed_actor
<
Sigs
...
>
;
using
impl
=
io
::
typed_broker
<
Sigs
...
>
;
using
behavior_type
=
typed_behavior
<
Sigs
...
>
;
static
constexpr
spawn_mode
mode
=
spawn_mode
::
function_with_selfptr
;
};
// statically typed stateful broker with self pointer
template
<
class
Result
,
class
State
,
class
...
Sigs
>
struct
infer_handle_from_fun_impl
<
Result
,
stateful_actor
<
State
,
io
::
typed_broker
<
Sigs
...
>
>*
,
true
>
{
using
type
=
typed_actor
<
Sigs
...
>
;
using
impl
=
stateful_actor
<
State
,
io
::
typed_broker
<
Sigs
...
>
>
;
using
impl
=
Impl
;
using
behavior_type
=
typed_behavior
<
Sigs
...
>
;
static
constexpr
spawn_mode
mode
=
spawn_mode
::
function_with_selfptr
;
};
...
...
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