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
a0d0ab45
Commit
a0d0ab45
authored
Mar 18, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable conversion from typed views to handles
parent
6b0cb27c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
CHANGELOG.md
CHANGELOG.md
+3
-0
libcaf_core/caf/typed_actor.hpp
libcaf_core/caf/typed_actor.hpp
+10
-0
libcaf_core/caf/typed_actor_pointer.hpp
libcaf_core/caf/typed_actor_pointer.hpp
+5
-1
No files found.
CHANGELOG.md
View file @
a0d0ab45
...
...
@@ -91,6 +91,9 @@ is based on [Keep a Changelog](https://keepachangelog.com).
already did.
-
The
`typed_actor_view`
decorator lacked several member functions such as
`link_to`
,
`send_exit`
, etc. These are now available.
-
Constructing a
`typed_actor`
handle from a pointer view failed du to a missing
constructor overload. This (explicit) overload now exists and the conversion
should work as expected.
## [0.17.5] - Unreleased
...
...
libcaf_core/caf/typed_actor.hpp
View file @
a0d0ab45
...
...
@@ -31,6 +31,7 @@
#include "caf/make_actor.hpp"
#include "caf/replies_to.hpp"
#include "caf/stateful_actor.hpp"
#include "caf/typed_actor_view_base.hpp"
#include "caf/typed_behavior.hpp"
#include "caf/typed_response_promise.hpp"
...
...
@@ -148,6 +149,15 @@ public:
CAF_ASSERT
(
ptr
!=
nullptr
);
}
// Enable `handle_type{self}` for typed actor views.
template
<
class
T
,
class
=
std
::
enable_if_t
<
std
::
is_base_of
<
typed_actor_view_base
,
T
>
::
value
>>
explicit
typed_actor
(
T
ptr
)
:
ptr_
(
ptr
.
internal_ptr
())
{
static_assert
(
detail
::
tl_subset_of
<
signatures
,
typename
T
::
signatures
>::
value
,
"Cannot assign T to incompatible handle type"
);
}
template
<
class
...
Ts
>
typed_actor
&
operator
=
(
const
typed_actor
<
Ts
...
>&
other
)
{
static_assert
(
...
...
libcaf_core/caf/typed_actor_pointer.hpp
View file @
a0d0ab45
...
...
@@ -24,7 +24,7 @@
namespace
caf
{
template
<
class
...
Sigs
>
class
typed_actor_pointer
{
class
typed_actor_pointer
:
public
typed_actor_view_base
{
public:
/// Stores the template parameter pack.
using
signatures
=
detail
::
type_list
<
Sigs
...
>
;
...
...
@@ -45,6 +45,10 @@ public:
// nop
}
typed_actor_pointer
(
const
typed_actor_pointer
&
)
=
default
;
typed_actor_pointer
&
operator
=
(
const
typed_actor_pointer
&
)
=
default
;
typed_actor_view
<
Sigs
...
>*
operator
->
()
{
return
&
view_
;
}
...
...
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