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
0dc60051
Commit
0dc60051
authored
Jun 19, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify extend syntax for typed actors
parent
669853bf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
5 deletions
+13
-5
libcaf_core/caf/typed_actor.hpp
libcaf_core/caf/typed_actor.hpp
+2
-3
libcaf_core/test/typed_spawn.cpp
libcaf_core/test/typed_spawn.cpp
+9
-0
libcaf_io/src/middleman.cpp
libcaf_io/src/middleman.cpp
+1
-1
libcaf_riac
libcaf_riac
+1
-1
No files found.
libcaf_core/caf/typed_actor.hpp
View file @
0dc60051
...
@@ -69,10 +69,9 @@ class typed_actor
...
@@ -69,10 +69,9 @@ class typed_actor
public:
public:
/// Creates a new `typed_actor` type by extending this one with `Es...`.
template
<
class
...
Es
>
template
<
class
...
Es
>
struct
extend
{
using
extend
=
typed_actor
<
Sigs
...,
Es
...
>
;
using
type
=
typed_actor
<
Sigs
...,
Es
...
>
;
};
/// Identifies the behavior type actors of this kind use
/// Identifies the behavior type actors of this kind use
/// for their behavior stack.
/// for their behavior stack.
...
...
libcaf_core/test/typed_spawn.cpp
View file @
0dc60051
...
@@ -36,6 +36,15 @@ using passed_atom = caf::atom_constant<caf::atom("passed")>;
...
@@ -36,6 +36,15 @@ using passed_atom = caf::atom_constant<caf::atom("passed")>;
namespace
{
namespace
{
// check invariants of type system
using
dummy1
=
typed_actor
<
reacts_to
<
int
,
int
>
,
replies_to
<
double
>::
with
<
double
>>
;
using
dummy2
=
dummy1
::
extend
<
reacts_to
<
ok_atom
>>
;
static_assert
(
std
::
is_convertible
<
dummy2
,
dummy1
>::
value
,
"handle not assignable to narrower definition"
);
/******************************************************************************
/******************************************************************************
* simple request/response test *
* simple request/response test *
******************************************************************************/
******************************************************************************/
...
...
libcaf_io/src/middleman.cpp
View file @
0dc60051
...
@@ -145,7 +145,7 @@ using middleman_actor_base = middleman_actor::extend<
...
@@ -145,7 +145,7 @@ using middleman_actor_base = middleman_actor::extend<
reacts_to
<
ok_atom
,
int64_t
>
,
reacts_to
<
ok_atom
,
int64_t
>
,
reacts_to
<
ok_atom
,
int64_t
,
actor_addr
>
,
reacts_to
<
ok_atom
,
int64_t
,
actor_addr
>
,
reacts_to
<
error_atom
,
int64_t
,
std
::
string
>
reacts_to
<
error_atom
,
int64_t
,
std
::
string
>
>
::
type
;
>
;
class
middleman_actor_impl
:
public
middleman_actor_base
::
base
{
class
middleman_actor_impl
:
public
middleman_actor_base
::
base
{
public:
public:
...
...
libcaf_riac
@
ad014ee3
Subproject commit
d153409e50f536ff362f7597dfcd2e4670782b6b
Subproject commit
ad014ee333ad0fc1a5c63031d1c123740a4c046d
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