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
bddecb9c
Commit
bddecb9c
authored
Mar 09, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coding style nitpicks
parent
b950901e
Changes
39
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
353 additions
and
383 deletions
+353
-383
libcaf_core/caf/behavior.hpp
libcaf_core/caf/behavior.hpp
+7
-7
libcaf_core/caf/blocking_actor.hpp
libcaf_core/caf/blocking_actor.hpp
+6
-6
libcaf_core/caf/check_typed_input.hpp
libcaf_core/caf/check_typed_input.hpp
+7
-7
libcaf_core/caf/detail/apply_args.hpp
libcaf_core/caf/detail/apply_args.hpp
+14
-14
libcaf_core/caf/detail/behavior_impl.hpp
libcaf_core/caf/detail/behavior_impl.hpp
+18
-18
libcaf_core/caf/detail/default_uniform_type_info.hpp
libcaf_core/caf/detail/default_uniform_type_info.hpp
+5
-5
libcaf_core/caf/detail/embedded.hpp
libcaf_core/caf/detail/embedded.hpp
+3
-3
libcaf_core/caf/detail/intrusive_partitioned_list.hpp
libcaf_core/caf/detail/intrusive_partitioned_list.hpp
+4
-4
libcaf_core/caf/detail/memory.hpp
libcaf_core/caf/detail/memory.hpp
+6
-6
libcaf_core/caf/detail/optional_message_visitor.hpp
libcaf_core/caf/detail/optional_message_visitor.hpp
+2
-2
libcaf_core/caf/detail/pair_storage.hpp
libcaf_core/caf/detail/pair_storage.hpp
+11
-11
libcaf_core/caf/detail/type_traits.hpp
libcaf_core/caf/detail/type_traits.hpp
+9
-14
libcaf_core/caf/event_based_actor.hpp
libcaf_core/caf/event_based_actor.hpp
+1
-1
libcaf_core/caf/local_actor.hpp
libcaf_core/caf/local_actor.hpp
+47
-47
libcaf_core/caf/mailbox_element.hpp
libcaf_core/caf/mailbox_element.hpp
+4
-4
libcaf_core/caf/match_case.hpp
libcaf_core/caf/match_case.hpp
+12
-12
libcaf_core/caf/message.hpp
libcaf_core/caf/message.hpp
+8
-8
libcaf_core/caf/message_builder.hpp
libcaf_core/caf/message_builder.hpp
+3
-3
libcaf_core/caf/message_handler.hpp
libcaf_core/caf/message_handler.hpp
+6
-6
libcaf_core/caf/mixin/behavior_stack_based.hpp
libcaf_core/caf/mixin/behavior_stack_based.hpp
+2
-2
libcaf_core/caf/mixin/functor_based.hpp
libcaf_core/caf/mixin/functor_based.hpp
+4
-4
libcaf_core/caf/mixin/sync_sender.hpp
libcaf_core/caf/mixin/sync_sender.hpp
+62
-62
libcaf_core/caf/policy/not_prioritizing.hpp
libcaf_core/caf/policy/not_prioritizing.hpp
+2
-2
libcaf_core/caf/response_handle.hpp
libcaf_core/caf/response_handle.hpp
+6
-6
libcaf_core/caf/send.hpp
libcaf_core/caf/send.hpp
+29
-29
libcaf_core/caf/spawn.hpp
libcaf_core/caf/spawn.hpp
+9
-9
libcaf_core/caf/spawn_fwd.hpp
libcaf_core/caf/spawn_fwd.hpp
+9
-9
libcaf_core/caf/typed_actor.hpp
libcaf_core/caf/typed_actor.hpp
+20
-19
libcaf_core/caf/typed_behavior.hpp
libcaf_core/caf/typed_behavior.hpp
+8
-20
libcaf_core/caf/typed_event_based_actor.hpp
libcaf_core/caf/typed_event_based_actor.hpp
+6
-6
libcaf_core/src/abstract_coordinator.cpp
libcaf_core/src/abstract_coordinator.cpp
+2
-2
libcaf_io/caf/io/broker.hpp
libcaf_io/caf/io/broker.hpp
+4
-4
libcaf_io/caf/io/network/default_multiplexer.hpp
libcaf_io/caf/io/network/default_multiplexer.hpp
+2
-2
libcaf_io/caf/io/publish.hpp
libcaf_io/caf/io/publish.hpp
+2
-2
libcaf_io/caf/io/remote_actor.hpp
libcaf_io/caf/io/remote_actor.hpp
+5
-19
libcaf_io/caf/io/spawn_io.hpp
libcaf_io/caf/io/spawn_io.hpp
+2
-2
libcaf_io/src/default_multiplexer.cpp
libcaf_io/src/default_multiplexer.cpp
+1
-1
libcaf_io/src/middleman.cpp
libcaf_io/src/middleman.cpp
+3
-3
unit_testing/test_match.cpp
unit_testing/test_match.cpp
+2
-2
No files found.
libcaf_core/caf/behavior.hpp
View file @
bddecb9c
...
@@ -59,9 +59,9 @@ class behavior {
...
@@ -59,9 +59,9 @@ class behavior {
* The list of arguments can contain match expressions, message handlers,
* The list of arguments can contain match expressions, message handlers,
* and up to one timeout (if set, the timeout has to be the last argument).
* and up to one timeout (if set, the timeout has to be the last argument).
*/
*/
template
<
class
V
,
class
...
V
s
>
template
<
class
T
,
class
...
T
s
>
behavior
(
V
v
,
Vs
...
v
s
)
{
behavior
(
T
x
,
Ts
...
x
s
)
{
assign
(
std
::
move
(
v
),
std
::
move
(
v
s
)...);
assign
(
std
::
move
(
x
),
std
::
move
(
x
s
)...);
}
}
/**
/**
...
@@ -75,10 +75,10 @@ class behavior {
...
@@ -75,10 +75,10 @@ class behavior {
/**
/**
* Assigns new handlers.
* Assigns new handlers.
*/
*/
template
<
class
...
V
s
>
template
<
class
...
T
s
>
void
assign
(
Vs
...
v
s
)
{
void
assign
(
Ts
...
x
s
)
{
static_assert
(
sizeof
...(
V
s
)
>
0
,
"assign() called without arguments"
);
static_assert
(
sizeof
...(
T
s
)
>
0
,
"assign() called without arguments"
);
m_impl
=
detail
::
make_behavior
(
v
s
...);
m_impl
=
detail
::
make_behavior
(
x
s
...);
}
}
void
assign
(
intrusive_ptr
<
detail
::
behavior_impl
>
ptr
)
{
void
assign
(
intrusive_ptr
<
detail
::
behavior_impl
>
ptr
)
{
...
...
libcaf_core/caf/blocking_actor.hpp
View file @
bddecb9c
...
@@ -237,12 +237,12 @@ class blocking_actor::functor_based : public blocking_actor {
...
@@ -237,12 +237,12 @@ class blocking_actor::functor_based : public blocking_actor {
using
act_fun
=
std
::
function
<
void
(
blocking_actor
*
)
>
;
using
act_fun
=
std
::
function
<
void
(
blocking_actor
*
)
>
;
template
<
class
F
,
class
...
Ts
>
template
<
class
F
,
class
...
Ts
>
functor_based
(
F
f
,
Ts
&&
...
v
s
)
{
functor_based
(
F
f
,
Ts
&&
...
x
s
)
{
using
trait
=
typename
detail
::
get_callable_trait
<
F
>::
type
;
using
trait
=
typename
detail
::
get_callable_trait
<
F
>::
type
;
using
arg0
=
typename
detail
::
tl_head
<
typename
trait
::
arg_types
>::
type
;
using
arg0
=
typename
detail
::
tl_head
<
typename
trait
::
arg_types
>::
type
;
blocking_actor
*
dummy
=
nullptr
;
blocking_actor
*
dummy
=
nullptr
;
std
::
integral_constant
<
bool
,
std
::
is_same
<
arg0
,
blocking_actor
*>::
value
>
tk
;
std
::
integral_constant
<
bool
,
std
::
is_same
<
arg0
,
blocking_actor
*>::
value
>
tk
;
create
(
dummy
,
tk
,
f
,
std
::
forward
<
Ts
>
(
v
s
)...);
create
(
dummy
,
tk
,
f
,
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
void
cleanup
(
uint32_t
reason
);
void
cleanup
(
uint32_t
reason
);
...
@@ -254,13 +254,13 @@ class blocking_actor::functor_based : public blocking_actor {
...
@@ -254,13 +254,13 @@ class blocking_actor::functor_based : public blocking_actor {
void
create
(
blocking_actor
*
,
act_fun
);
void
create
(
blocking_actor
*
,
act_fun
);
template
<
class
Actor
,
typename
F
,
class
...
Ts
>
template
<
class
Actor
,
typename
F
,
class
...
Ts
>
void
create
(
Actor
*
dummy
,
std
::
true_type
,
F
f
,
Ts
&&
...
v
s
)
{
void
create
(
Actor
*
dummy
,
std
::
true_type
,
F
f
,
Ts
&&
...
x
s
)
{
create
(
dummy
,
std
::
bind
(
f
,
std
::
placeholders
::
_1
,
std
::
forward
<
Ts
>
(
v
s
)...));
create
(
dummy
,
std
::
bind
(
f
,
std
::
placeholders
::
_1
,
std
::
forward
<
Ts
>
(
x
s
)...));
}
}
template
<
class
Actor
,
typename
F
,
class
...
Ts
>
template
<
class
Actor
,
typename
F
,
class
...
Ts
>
void
create
(
Actor
*
dummy
,
std
::
false_type
,
F
f
,
Ts
&&
...
v
s
)
{
void
create
(
Actor
*
dummy
,
std
::
false_type
,
F
f
,
Ts
&&
...
x
s
)
{
std
::
function
<
void
()
>
fun
=
std
::
bind
(
f
,
std
::
forward
<
Ts
>
(
v
s
)...);
std
::
function
<
void
()
>
fun
=
std
::
bind
(
f
,
std
::
forward
<
Ts
>
(
x
s
)...);
create
(
dummy
,
[
fun
](
Actor
*
)
{
fun
();
});
create
(
dummy
,
[
fun
](
Actor
*
)
{
fun
();
});
}
}
...
...
libcaf_core/caf/check_typed_input.hpp
View file @
bddecb9c
...
@@ -28,21 +28,21 @@
...
@@ -28,21 +28,21 @@
namespace
caf
{
namespace
caf
{
/**
/**
* Checks whether `R` does support an input of type `{
L
s...}` via a
* Checks whether `R` does support an input of type `{
T
s...}` via a
* static assertion (always returns 0).
* static assertion (always returns 0).
*/
*/
template
<
class
...
Rs
,
class
...
L
s
>
template
<
class
...
Sigs
,
class
...
T
s
>
void
check_typed_input
(
const
typed_actor
<
R
s
...
>&
,
void
check_typed_input
(
const
typed_actor
<
Sig
s
...
>&
,
const
detail
::
type_list
<
L
s
...
>&
)
{
const
detail
::
type_list
<
T
s
...
>&
)
{
static_assert
(
detail
::
tl_find
<
static_assert
(
detail
::
tl_find
<
detail
::
type_list
<
L
s
...
>
,
detail
::
type_list
<
T
s
...
>
,
atom_value
atom_value
>::
value
==
-
1
,
>::
value
==
-
1
,
"atom(...) notation is not sufficient for static type "
"atom(...) notation is not sufficient for static type "
"checking, please use atom_constant instead in this context"
);
"checking, please use atom_constant instead in this context"
);
static_assert
(
detail
::
tl_find_if
<
static_assert
(
detail
::
tl_find_if
<
detail
::
type_list
<
R
s
...
>
,
detail
::
type_list
<
Sig
s
...
>
,
detail
::
input_is
<
detail
::
type_list
<
L
s
...
>>::
template
eval
detail
::
input_is
<
detail
::
type_list
<
T
s
...
>>::
template
eval
>
::
value
>=
0
,
>
::
value
>=
0
,
"typed actor does not support given input"
);
"typed actor does not support given input"
);
}
}
...
...
libcaf_core/caf/detail/apply_args.hpp
View file @
bddecb9c
...
@@ -31,8 +31,8 @@ namespace detail {
...
@@ -31,8 +31,8 @@ namespace detail {
// this utterly useless function works around a bug in Clang that causes
// this utterly useless function works around a bug in Clang that causes
// the compiler to reject the trailing return type of apply_args because
// the compiler to reject the trailing return type of apply_args because
// "get" is not defined (it's found during ADL)
// "get" is not defined (it's found during ADL)
template
<
long
Pos
,
class
...
V
s
>
template
<
long
Pos
,
class
...
T
s
>
typename
tl_at
<
type_list
<
Vs
...
>
,
Pos
>::
type
get
(
const
type_list
<
V
s
...
>&
);
typename
tl_at
<
type_list
<
Ts
...
>
,
Pos
>::
type
get
(
const
type_list
<
T
s
...
>&
);
template
<
class
F
,
long
...
Is
,
class
Tuple
>
template
<
class
F
,
long
...
Is
,
class
Tuple
>
auto
apply_args
(
F
&
f
,
detail
::
int_list
<
Is
...
>
,
Tuple
&&
tup
)
auto
apply_args
(
F
&
f
,
detail
::
int_list
<
Is
...
>
,
Tuple
&&
tup
)
...
@@ -40,22 +40,22 @@ auto apply_args(F& f, detail::int_list<Is...>, Tuple&& tup)
...
@@ -40,22 +40,22 @@ auto apply_args(F& f, detail::int_list<Is...>, Tuple&& tup)
return
f
(
get
<
Is
>
(
tup
)...);
return
f
(
get
<
Is
>
(
tup
)...);
}
}
template
<
class
F
,
class
Tuple
,
class
...
V
s
>
template
<
class
F
,
class
Tuple
,
class
...
T
s
>
auto
apply_args_prefixed
(
F
&
f
,
detail
::
int_list
<>
,
Tuple
&
,
Vs
&&
...
v
s
)
auto
apply_args_prefixed
(
F
&
f
,
detail
::
int_list
<>
,
Tuple
&
,
Ts
&&
...
x
s
)
->
decltype
(
f
(
std
::
forward
<
Vs
>
(
v
s
)...))
{
->
decltype
(
f
(
std
::
forward
<
Ts
>
(
x
s
)...))
{
return
f
(
std
::
forward
<
Vs
>
(
v
s
)...);
return
f
(
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
template
<
class
F
,
long
...
Is
,
class
Tuple
,
class
...
V
s
>
template
<
class
F
,
long
...
Is
,
class
Tuple
,
class
...
T
s
>
auto
apply_args_prefixed
(
F
&
f
,
detail
::
int_list
<
Is
...
>
,
Tuple
&
tup
,
Vs
&&
...
v
s
)
auto
apply_args_prefixed
(
F
&
f
,
detail
::
int_list
<
Is
...
>
,
Tuple
&
tup
,
Ts
&&
...
x
s
)
->
decltype
(
f
(
std
::
forward
<
Vs
>
(
v
s
)...,
get
<
Is
>
(
tup
)...))
{
->
decltype
(
f
(
std
::
forward
<
Ts
>
(
x
s
)...,
get
<
Is
>
(
tup
)...))
{
return
f
(
std
::
forward
<
Vs
>
(
v
s
)...,
get
<
Is
>
(
tup
)...);
return
f
(
std
::
forward
<
Ts
>
(
x
s
)...,
get
<
Is
>
(
tup
)...);
}
}
template
<
class
F
,
long
...
Is
,
class
Tuple
,
class
...
V
s
>
template
<
class
F
,
long
...
Is
,
class
Tuple
,
class
...
T
s
>
auto
apply_args_suffxied
(
F
&
f
,
detail
::
int_list
<
Is
...
>
,
Tuple
&
tup
,
Vs
&&
...
v
s
)
auto
apply_args_suffxied
(
F
&
f
,
detail
::
int_list
<
Is
...
>
,
Tuple
&
tup
,
Ts
&&
...
x
s
)
->
decltype
(
f
(
get
<
Is
>
(
tup
)...,
std
::
forward
<
Vs
>
(
v
s
)...))
{
->
decltype
(
f
(
get
<
Is
>
(
tup
)...,
std
::
forward
<
Ts
>
(
x
s
)...))
{
return
f
(
get
<
Is
>
(
tup
)...,
std
::
forward
<
Vs
>
(
v
s
)...);
return
f
(
get
<
Is
>
(
tup
)...,
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
}
// namespace detail
}
// namespace detail
...
...
libcaf_core/caf/detail/behavior_impl.hpp
View file @
bddecb9c
...
@@ -194,53 +194,53 @@ struct join_std_tuples<T> {
...
@@ -194,53 +194,53 @@ struct join_std_tuples<T> {
using
type
=
T
;
using
type
=
T
;
};
};
template
<
class
...
Ts
,
class
...
Us
,
class
...
Rs
>
template
<
class
...
Prefix
,
class
...
Infix
,
class
...
Suffix
>
struct
join_std_tuples
<
std
::
tuple
<
Ts
...
>
,
std
::
tuple
<
Us
...
>
,
Rs
...
>
struct
join_std_tuples
<
std
::
tuple
<
Prefix
...
>
,
std
::
tuple
<
Infix
...
>
,
Suffix
...
>
:
join_std_tuples
<
std
::
tuple
<
Ts
...,
Us
...
>
,
Rs
...
>
{
:
join_std_tuples
<
std
::
tuple
<
Prefix
...,
Infix
...
>
,
Suffix
...
>
{
// nop
// nop
};
};
// this function reorganizes its arguments to shift the timeout definition
// this function reorganizes its arguments to shift the timeout definition
// to the front (receives it at the tail)
// to the front (receives it at the tail)
template
<
class
R
,
class
F
,
class
...
V
s
>
template
<
class
R
,
class
F
,
class
...
T
s
>
intrusive_ptr
<
R
>
make_behavior_ra
(
timeout_definition
<
F
>&
td
ef
,
intrusive_ptr
<
R
>
make_behavior_ra
(
timeout_definition
<
F
>&
td
,
tail_argument_token
&
,
Vs
...
v
s
)
{
tail_argument_token
&
,
Ts
...
x
s
)
{
return
make_behavior_eor
<
R
>
(
std
::
tuple_cat
(
to_match_case_tuple
(
vs
)...),
tdef
);
return
make_behavior_eor
<
R
>
(
std
::
tuple_cat
(
to_match_case_tuple
(
xs
)...),
td
);
}
}
template
<
class
R
,
class
...
V
s
>
template
<
class
R
,
class
...
T
s
>
intrusive_ptr
<
R
>
make_behavior_ra
(
tail_argument_token
&
,
Vs
...
v
s
)
{
intrusive_ptr
<
R
>
make_behavior_ra
(
tail_argument_token
&
,
Ts
...
x
s
)
{
return
make_behavior_eor
<
R
>
(
std
::
tuple_cat
(
to_match_case_tuple
(
v
s
)...));
return
make_behavior_eor
<
R
>
(
std
::
tuple_cat
(
to_match_case_tuple
(
x
s
)...));
}
}
// for some reason, this call is ambigious on GCC without enable_if
// for some reason, this call is ambigious on GCC without enable_if
template
<
class
R
,
class
V
,
class
...
V
s
>
template
<
class
R
,
class
V
,
class
...
T
s
>
typename
std
::
enable_if
<
typename
std
::
enable_if
<
!
std
::
is_same
<
V
,
tail_argument_token
>::
value
,
!
std
::
is_same
<
V
,
tail_argument_token
>::
value
,
intrusive_ptr
<
R
>
intrusive_ptr
<
R
>
>::
type
>::
type
make_behavior_ra
(
V
&
v
,
Vs
&
...
v
s
)
{
make_behavior_ra
(
V
&
v
,
Ts
&
...
x
s
)
{
return
make_behavior_ra
<
R
>
(
v
s
...,
v
);
return
make_behavior_ra
<
R
>
(
x
s
...,
v
);
}
}
// this function reorganizes its arguments to shift the timeout definition
// this function reorganizes its arguments to shift the timeout definition
// to the front (receives it at the tail)
// to the front (receives it at the tail)
template
<
class
...
V
s
>
template
<
class
...
T
s
>
intrusive_ptr
<
intrusive_ptr
<
default_behavior_impl
<
default_behavior_impl
<
typename
join_std_tuples
<
typename
join_std_tuples
<
typename
lift_to_mctuple
<
V
s
>::
type
...
typename
lift_to_mctuple
<
T
s
>::
type
...
>::
type
>::
type
>>
>>
make_behavior
(
Vs
&
...
v
s
)
{
make_behavior
(
Ts
&
...
x
s
)
{
using
result_type
=
using
result_type
=
default_behavior_impl
<
default_behavior_impl
<
typename
join_std_tuples
<
typename
join_std_tuples
<
typename
lift_to_mctuple
<
V
s
>::
type
...
typename
lift_to_mctuple
<
T
s
>::
type
...
>::
type
>::
type
>
;
>
;
tail_argument_token
eoa
;
tail_argument_token
eoa
;
return
make_behavior_ra
<
result_type
>
(
v
s
...,
eoa
);
return
make_behavior_ra
<
result_type
>
(
x
s
...,
eoa
);
}
}
using
behavior_impl_ptr
=
intrusive_ptr
<
behavior_impl
>
;
using
behavior_impl_ptr
=
intrusive_ptr
<
behavior_impl
>
;
...
...
libcaf_core/caf/detail/default_uniform_type_info.hpp
View file @
bddecb9c
...
@@ -570,12 +570,12 @@ class default_uniform_type_info : public detail::abstract_uniform_type_info<T> {
...
@@ -570,12 +570,12 @@ class default_uniform_type_info : public detail::abstract_uniform_type_info<T> {
std
::
vector
<
uniform_type_info_ptr
>
m_members
;
std
::
vector
<
uniform_type_info_ptr
>
m_members
;
};
};
template
<
class
...
R
s
>
template
<
class
...
Sig
s
>
class
default_uniform_type_info
<
typed_actor
<
R
s
...
>>
:
class
default_uniform_type_info
<
typed_actor
<
Sig
s
...
>>
:
public
detail
::
abstract_uniform_type_info
<
typed_actor
<
R
s
...
>>
{
public
detail
::
abstract_uniform_type_info
<
typed_actor
<
Sig
s
...
>>
{
public:
public:
using
super
=
detail
::
abstract_uniform_type_info
<
typed_actor
<
R
s
...
>>
;
using
super
=
detail
::
abstract_uniform_type_info
<
typed_actor
<
Sig
s
...
>>
;
using
handle_type
=
typed_actor
<
R
s
...
>
;
using
handle_type
=
typed_actor
<
Sig
s
...
>
;
default_uniform_type_info
(
std
::
string
tname
)
:
super
(
std
::
move
(
tname
))
{
default_uniform_type_info
(
std
::
string
tname
)
:
super
(
std
::
move
(
tname
))
{
sub_uti
=
uniform_typeid
<
actor
>
();
sub_uti
=
uniform_typeid
<
actor
>
();
...
...
libcaf_core/caf/detail/embedded.hpp
View file @
bddecb9c
...
@@ -29,9 +29,9 @@ namespace detail {
...
@@ -29,9 +29,9 @@ namespace detail {
template
<
class
Base
>
template
<
class
Base
>
class
embedded
final
:
public
Base
{
class
embedded
final
:
public
Base
{
public:
public:
template
<
class
...
V
s
>
template
<
class
...
T
s
>
embedded
(
intrusive_ptr
<
ref_counted
>
storage
,
Vs
&&
...
v
s
)
embedded
(
intrusive_ptr
<
ref_counted
>
storage
,
Ts
&&
...
x
s
)
:
Base
(
std
::
forward
<
Vs
>
(
v
s
)...),
:
Base
(
std
::
forward
<
Ts
>
(
x
s
)...),
m_storage
(
std
::
move
(
storage
))
{
m_storage
(
std
::
move
(
storage
))
{
// nop
// nop
}
}
...
...
libcaf_core/caf/detail/intrusive_partitioned_list.hpp
View file @
bddecb9c
...
@@ -200,8 +200,8 @@ class intrusive_partitioned_list {
...
@@ -200,8 +200,8 @@ class intrusive_partitioned_list {
insert
(
second_end
(),
val
);
insert
(
second_end
(),
val
);
}
}
template
<
class
Actor
,
class
...
V
s
>
template
<
class
Actor
,
class
...
T
s
>
bool
invoke
(
Actor
*
self
,
iterator
first
,
iterator
last
,
Vs
&
...
v
s
)
{
bool
invoke
(
Actor
*
self
,
iterator
first
,
iterator
last
,
Ts
&
...
x
s
)
{
pointer
prev
=
first
->
prev
;
pointer
prev
=
first
->
prev
;
pointer
next
=
first
->
next
;
pointer
next
=
first
->
next
;
auto
move_on
=
[
&
](
bool
first_valid
)
{
auto
move_on
=
[
&
](
bool
first_valid
)
{
...
@@ -214,12 +214,12 @@ class intrusive_partitioned_list {
...
@@ -214,12 +214,12 @@ class intrusive_partitioned_list {
while
(
first
!=
last
)
{
while
(
first
!=
last
)
{
std
::
unique_ptr
<
value_type
,
deleter_type
>
tmp
{
first
.
ptr
};
std
::
unique_ptr
<
value_type
,
deleter_type
>
tmp
{
first
.
ptr
};
// since this function can be called recursively during
// since this function can be called recursively during
// self->invoke_message(tmp,
v
s...), we have to remove the
// self->invoke_message(tmp,
x
s...), we have to remove the
// element from the list proactively and put it back in if
// element from the list proactively and put it back in if
// it's safe, i.e., if invoke_message returned im_skipped
// it's safe, i.e., if invoke_message returned im_skipped
prev
->
next
=
next
;
prev
->
next
=
next
;
next
->
prev
=
prev
;
next
->
prev
=
prev
;
switch
(
self
->
invoke_message
(
tmp
,
v
s
...))
{
switch
(
self
->
invoke_message
(
tmp
,
x
s
...))
{
case
policy
:
:
im_dropped
:
case
policy
:
:
im_dropped
:
move_on
(
false
);
move_on
(
false
);
break
;
break
;
...
...
libcaf_core/caf/detail/memory.hpp
View file @
bddecb9c
...
@@ -64,10 +64,10 @@ class basic_memory_cache;
...
@@ -64,10 +64,10 @@ class basic_memory_cache;
template
<
class
T
>
template
<
class
T
>
struct
rc_storage
:
public
ref_counted
{
struct
rc_storage
:
public
ref_counted
{
T
instance
;
T
instance
;
template
<
class
...
V
s
>
template
<
class
...
T
s
>
rc_storage
(
Vs
&&
...
v
s
)
rc_storage
(
Ts
&&
...
x
s
)
:
instance
(
intrusive_ptr
<
ref_counted
>
(
this
,
false
),
:
instance
(
intrusive_ptr
<
ref_counted
>
(
this
,
false
),
std
::
forward
<
Vs
>
(
v
s
)...)
{
std
::
forward
<
Ts
>
(
x
s
)...)
{
CAF_REQUIRE
(
get_reference_count
()
>=
1
);
CAF_REQUIRE
(
get_reference_count
()
>=
1
);
}
}
};
};
...
@@ -190,8 +190,8 @@ class memory {
...
@@ -190,8 +190,8 @@ class memory {
public:
public:
// Allocates storage, initializes a new object, and returns the new instance.
// Allocates storage, initializes a new object, and returns the new instance.
template
<
class
T
,
class
...
V
s
>
template
<
class
T
,
class
...
T
s
>
static
T
*
create
(
Vs
&&
...
v
s
)
{
static
T
*
create
(
Ts
&&
...
x
s
)
{
using
embedded_t
=
using
embedded_t
=
typename
std
::
conditional
<
typename
std
::
conditional
<
T
::
memory_cache_flag
==
needs_embedding
,
T
::
memory_cache_flag
==
needs_embedding
,
...
@@ -201,7 +201,7 @@ class memory {
...
@@ -201,7 +201,7 @@ class memory {
auto
mc
=
get_or_set_cache_map_entry
<
T
>
();
auto
mc
=
get_or_set_cache_map_entry
<
T
>
();
auto
es
=
mc
->
new_embedded_storage
();
auto
es
=
mc
->
new_embedded_storage
();
auto
ptr
=
reinterpret_cast
<
embedded_t
*>
(
es
.
second
);
auto
ptr
=
reinterpret_cast
<
embedded_t
*>
(
es
.
second
);
new
(
ptr
)
embedded_t
(
std
::
move
(
es
.
first
),
std
::
forward
<
Vs
>
(
v
s
)...);
new
(
ptr
)
embedded_t
(
std
::
move
(
es
.
first
),
std
::
forward
<
Ts
>
(
x
s
)...);
return
ptr
;
return
ptr
;
}
}
...
...
libcaf_core/caf/detail/optional_message_visitor.hpp
View file @
bddecb9c
...
@@ -105,8 +105,8 @@ class optional_message_visitor : public static_visitor<optional<message>> {
...
@@ -105,8 +105,8 @@ class optional_message_visitor : public static_visitor<optional<message>> {
optional_message_visitor_enable_tpl
<
T
>::
value
,
optional_message_visitor_enable_tpl
<
T
>::
value
,
opt_msg
opt_msg
>::
type
>::
type
operator
()(
T
&
v
,
Ts
&
...
v
s
)
const
{
operator
()(
T
&
x
,
Ts
&
...
x
s
)
const
{
return
make_message
(
std
::
move
(
v
),
std
::
move
(
v
s
)...);
return
make_message
(
std
::
move
(
x
),
std
::
move
(
x
s
)...);
}
}
template
<
class
T
>
template
<
class
T
>
...
...
libcaf_core/caf/detail/pair_storage.hpp
View file @
bddecb9c
...
@@ -57,27 +57,27 @@ class pair_storage {
...
@@ -57,27 +57,27 @@ class pair_storage {
union
{
embedded
<
FirstType
>
first
;
};
union
{
embedded
<
FirstType
>
first
;
};
union
{
embedded
<
SecondType
>
second
;
};
union
{
embedded
<
SecondType
>
second
;
};
template
<
class
...
V
s
>
template
<
class
...
T
s
>
pair_storage
(
intrusive_ptr
<
ref_counted
>
storage
,
pair_storage
(
intrusive_ptr
<
ref_counted
>
storage
,
std
::
integral_constant
<
size_t
,
0
>
,
Vs
&&
...
v
s
)
std
::
integral_constant
<
size_t
,
0
>
,
Ts
&&
...
x
s
)
:
first
(
storage
),
:
first
(
storage
),
second
(
std
::
move
(
storage
),
std
::
forward
<
Vs
>
(
v
s
)...)
{
second
(
std
::
move
(
storage
),
std
::
forward
<
Ts
>
(
x
s
)...)
{
// nop
// nop
}
}
template
<
class
V0
,
class
...
V
s
>
template
<
class
T
,
class
...
T
s
>
pair_storage
(
intrusive_ptr
<
ref_counted
>
storage
,
pair_storage
(
intrusive_ptr
<
ref_counted
>
storage
,
std
::
integral_constant
<
size_t
,
1
>
,
V0
&&
v0
,
Vs
&&
...
v
s
)
std
::
integral_constant
<
size_t
,
1
>
,
T
&&
x
,
Ts
&&
...
x
s
)
:
first
(
storage
,
std
::
forward
<
V0
>
(
v0
)),
:
first
(
storage
,
std
::
forward
<
T
>
(
x
)),
second
(
std
::
move
(
storage
),
std
::
forward
<
Vs
>
(
v
s
)...)
{
second
(
std
::
move
(
storage
),
std
::
forward
<
Ts
>
(
x
s
)...)
{
// nop
// nop
}
}
template
<
class
V0
,
class
V1
,
class
...
V
s
>
template
<
class
T0
,
class
T1
,
class
...
T
s
>
pair_storage
(
intrusive_ptr
<
ref_counted
>
storage
,
pair_storage
(
intrusive_ptr
<
ref_counted
>
storage
,
std
::
integral_constant
<
size_t
,
2
>
,
V0
&&
v0
,
V1
&&
v1
,
Vs
&&
...
v
s
)
std
::
integral_constant
<
size_t
,
2
>
,
T0
&&
x0
,
T1
&&
x1
,
Ts
&&
...
x
s
)
:
first
(
storage
,
std
::
forward
<
V0
>
(
v0
),
std
::
forward
<
V1
>
(
v
1
)),
:
first
(
storage
,
std
::
forward
<
T0
>
(
x0
),
std
::
forward
<
T1
>
(
x
1
)),
second
(
std
::
move
(
storage
),
std
::
forward
<
Vs
>
(
v
s
)...)
{
second
(
std
::
move
(
storage
),
std
::
forward
<
Ts
>
(
x
s
)...)
{
// nop
// nop
}
}
...
...
libcaf_core/caf/detail/type_traits.hpp
View file @
bddecb9c
...
@@ -41,17 +41,12 @@ struct conjunction;
...
@@ -41,17 +41,12 @@ struct conjunction;
template
<
>
template
<
>
struct
conjunction
<>
{
struct
conjunction
<>
{
static
constexpr
bool
value
=
false
;
static
constexpr
bool
value
=
true
;
};
template
<
bool
V0
>
struct
conjunction
<
V0
>
{
static
constexpr
bool
value
=
V0
;
};
};
template
<
bool
V0
,
bool
V1
,
bool
...
V
s
>
template
<
bool
X
,
bool
...
X
s
>
struct
conjunction
<
V0
,
V1
,
V
s
...
>
{
struct
conjunction
<
X
,
X
s
...
>
{
static
constexpr
bool
value
=
V0
&&
conjunction
<
V1
,
V
s
...
>::
value
;
static
constexpr
bool
value
=
X
&&
conjunction
<
X
s
...
>::
value
;
};
};
/**
/**
...
@@ -60,16 +55,16 @@ struct conjunction<V0, V1, Vs...> {
...
@@ -60,16 +55,16 @@ struct conjunction<V0, V1, Vs...> {
template
<
bool
...
BoolConstants
>
template
<
bool
...
BoolConstants
>
struct
disjunction
;
struct
disjunction
;
template
<
bool
V0
,
bool
...
Vs
>
struct
disjunction
<
V0
,
Vs
...
>
{
static
constexpr
bool
value
=
V0
||
disjunction
<
Vs
...
>::
value
;
};
template
<
>
template
<
>
struct
disjunction
<>
{
struct
disjunction
<>
{
static
constexpr
bool
value
=
false
;
static
constexpr
bool
value
=
false
;
};
};
template
<
bool
X
,
bool
...
Xs
>
struct
disjunction
<
X
,
Xs
...
>
{
static
constexpr
bool
value
=
X
||
disjunction
<
Xs
...
>::
value
;
};
/**
/**
* Equal to std::is_same<T, anything>.
* Equal to std::is_same<T, anything>.
*/
*/
...
...
libcaf_core/caf/event_based_actor.hpp
View file @
bddecb9c
...
@@ -70,7 +70,7 @@ class event_based_actor::functor_based : public extend<event_based_actor>::
...
@@ -70,7 +70,7 @@ class event_based_actor::functor_based : public extend<event_based_actor>::
with
<
mixin
::
functor_based
>
{
with
<
mixin
::
functor_based
>
{
public:
public:
template
<
class
...
Ts
>
template
<
class
...
Ts
>
functor_based
(
Ts
&&
...
vs
)
:
combined_type
(
std
::
forward
<
Ts
>
(
v
s
)...)
{
functor_based
(
Ts
&&
...
xs
)
:
combined_type
(
std
::
forward
<
Ts
>
(
x
s
)...)
{
// nop
// nop
}
}
behavior
make_behavior
()
override
;
behavior
make_behavior
()
override
;
...
...
libcaf_core/caf/local_actor.hpp
View file @
bddecb9c
...
@@ -70,35 +70,35 @@ class local_actor : public abstract_actor {
...
@@ -70,35 +70,35 @@ class local_actor : public abstract_actor {
* spawn untyped actors *
* spawn untyped actors *
****************************************************************************/
****************************************************************************/
template
<
class
T
,
spawn_options
Os
=
no_spawn_options
,
class
...
V
s
>
template
<
class
T
,
spawn_options
Os
=
no_spawn_options
,
class
...
T
s
>
actor
spawn
(
Vs
&&
...
v
s
)
{
actor
spawn
(
Ts
&&
...
x
s
)
{
constexpr
auto
os
=
make_unbound
(
Os
);
constexpr
auto
os
=
make_unbound
(
Os
);
auto
res
=
spawn_class
<
T
,
os
>
(
host
(),
empty_before_launch_callback
{},
auto
res
=
spawn_class
<
T
,
os
>
(
host
(),
empty_before_launch_callback
{},
std
::
forward
<
Vs
>
(
v
s
)...);
std
::
forward
<
Ts
>
(
x
s
)...);
return
eval_opts
(
Os
,
std
::
move
(
res
));
return
eval_opts
(
Os
,
std
::
move
(
res
));
}
}
template
<
spawn_options
Os
=
no_spawn_options
,
class
...
V
s
>
template
<
spawn_options
Os
=
no_spawn_options
,
class
...
T
s
>
actor
spawn
(
Vs
&&
...
v
s
)
{
actor
spawn
(
Ts
&&
...
x
s
)
{
constexpr
auto
os
=
make_unbound
(
Os
);
constexpr
auto
os
=
make_unbound
(
Os
);
auto
res
=
spawn_functor
<
os
>
(
host
(),
empty_before_launch_callback
{},
auto
res
=
spawn_functor
<
os
>
(
host
(),
empty_before_launch_callback
{},
std
::
forward
<
Vs
>
(
v
s
)...);
std
::
forward
<
Ts
>
(
x
s
)...);
return
eval_opts
(
Os
,
std
::
move
(
res
));
return
eval_opts
(
Os
,
std
::
move
(
res
));
}
}
template
<
class
T
,
spawn_options
Os
,
class
...
V
s
>
template
<
class
T
,
spawn_options
Os
,
class
...
T
s
>
actor
spawn_in_group
(
const
group
&
grp
,
Vs
&&
...
v
s
)
{
actor
spawn_in_group
(
const
group
&
grp
,
Ts
&&
...
x
s
)
{
constexpr
auto
os
=
make_unbound
(
Os
);
constexpr
auto
os
=
make_unbound
(
Os
);
auto
res
=
spawn_class
<
T
,
os
>
(
host
(),
group_subscriber
{
grp
},
auto
res
=
spawn_class
<
T
,
os
>
(
host
(),
group_subscriber
{
grp
},
std
::
forward
<
Vs
>
(
v
s
)...);
std
::
forward
<
Ts
>
(
x
s
)...);
return
eval_opts
(
Os
,
std
::
move
(
res
));
return
eval_opts
(
Os
,
std
::
move
(
res
));
}
}
template
<
spawn_options
Os
=
no_spawn_options
,
class
...
V
s
>
template
<
spawn_options
Os
=
no_spawn_options
,
class
...
T
s
>
actor
spawn_in_group
(
const
group
&
grp
,
Vs
&&
...
v
s
)
{
actor
spawn_in_group
(
const
group
&
grp
,
Ts
&&
...
x
s
)
{
constexpr
auto
os
=
make_unbound
(
Os
);
constexpr
auto
os
=
make_unbound
(
Os
);
auto
res
=
spawn_functor
<
os
>
(
host
(),
group_subscriber
{
grp
},
auto
res
=
spawn_functor
<
os
>
(
host
(),
group_subscriber
{
grp
},
std
::
forward
<
Vs
>
(
v
s
)...);
std
::
forward
<
Ts
>
(
x
s
)...);
return
eval_opts
(
Os
,
std
::
move
(
res
));
return
eval_opts
(
Os
,
std
::
move
(
res
));
}
}
...
@@ -106,30 +106,30 @@ class local_actor : public abstract_actor {
...
@@ -106,30 +106,30 @@ class local_actor : public abstract_actor {
* spawn typed actors *
* spawn typed actors *
****************************************************************************/
****************************************************************************/
template
<
class
T
,
spawn_options
Os
=
no_spawn_options
,
class
...
V
s
>
template
<
class
T
,
spawn_options
Os
=
no_spawn_options
,
class
...
T
s
>
typename
actor_handle_from_signature_list
<
typename
actor_handle_from_signature_list
<
typename
T
::
signatures
typename
T
::
signatures
>::
type
>::
type
spawn_typed
(
Vs
&&
...
v
s
)
{
spawn_typed
(
Ts
&&
...
x
s
)
{
constexpr
auto
os
=
make_unbound
(
Os
);
constexpr
auto
os
=
make_unbound
(
Os
);
auto
res
=
spawn_class
<
T
,
os
>
(
host
(),
empty_before_launch_callback
{},
auto
res
=
spawn_class
<
T
,
os
>
(
host
(),
empty_before_launch_callback
{},
std
::
forward
<
Vs
>
(
v
s
)...);
std
::
forward
<
Ts
>
(
x
s
)...);
return
eval_opts
(
Os
,
std
::
move
(
res
));
return
eval_opts
(
Os
,
std
::
move
(
res
));
}
}
template
<
spawn_options
Os
=
no_spawn_options
,
typename
F
,
class
...
V
s
>
template
<
spawn_options
Os
=
no_spawn_options
,
typename
F
,
class
...
T
s
>
typename
infer_typed_actor_handle
<
typename
infer_typed_actor_handle
<
typename
detail
::
get_callable_trait
<
F
>::
result_type
,
typename
detail
::
get_callable_trait
<
F
>::
result_type
,
typename
detail
::
tl_head
<
typename
detail
::
tl_head
<
typename
detail
::
get_callable_trait
<
F
>::
arg_types
typename
detail
::
get_callable_trait
<
F
>::
arg_types
>::
type
>::
type
>::
type
>::
type
spawn_typed
(
F
fun
,
Vs
&&
...
v
s
)
{
spawn_typed
(
F
fun
,
Ts
&&
...
x
s
)
{
constexpr
auto
os
=
make_unbound
(
Os
);
constexpr
auto
os
=
make_unbound
(
Os
);
auto
res
=
caf
::
spawn_typed_functor
<
os
>
(
host
(),
auto
res
=
caf
::
spawn_typed_functor
<
os
>
(
host
(),
empty_before_launch_callback
{},
empty_before_launch_callback
{},
std
::
move
(
fun
),
std
::
move
(
fun
),
std
::
forward
<
Vs
>
(
v
s
)...);
std
::
forward
<
Ts
>
(
x
s
)...);
return
eval_opts
(
Os
,
std
::
move
(
res
));
return
eval_opts
(
Os
,
std
::
move
(
res
));
}
}
...
@@ -138,43 +138,43 @@ class local_actor : public abstract_actor {
...
@@ -138,43 +138,43 @@ class local_actor : public abstract_actor {
****************************************************************************/
****************************************************************************/
/**
/**
* Sends `{
v
s...} to `dest` using the priority `mp`.
* Sends `{
x
s...} to `dest` using the priority `mp`.
*/
*/
template
<
class
...
V
s
>
template
<
class
...
T
s
>
void
send
(
message_priority
mp
,
const
channel
&
dest
,
Vs
&&
...
v
s
)
{
void
send
(
message_priority
mp
,
const
channel
&
dest
,
Ts
&&
...
x
s
)
{
static_assert
(
sizeof
...(
Vs
)
>
0
,
"sizeof...(V
s) == 0"
);
static_assert
(
sizeof
...(
Ts
)
>
0
,
"sizeof...(T
s) == 0"
);
send_impl
(
mp
,
actor_cast
<
abstract_channel
*>
(
dest
),
std
::
forward
<
Vs
>
(
v
s
)...);
send_impl
(
mp
,
actor_cast
<
abstract_channel
*>
(
dest
),
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
/**
/**
* Sends `{
v
s...} to `dest` using normal priority.
* Sends `{
x
s...} to `dest` using normal priority.
*/
*/
template
<
class
...
V
s
>
template
<
class
...
T
s
>
void
send
(
const
channel
&
dest
,
Vs
&&
...
v
s
)
{
void
send
(
const
channel
&
dest
,
Ts
&&
...
x
s
)
{
send
(
message_priority
::
normal
,
dest
,
std
::
forward
<
Vs
>
(
v
s
)...);
send
(
message_priority
::
normal
,
dest
,
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
/**
/**
* Sends `{
v
s...} to `dest` using the priority `mp`.
* Sends `{
x
s...} to `dest` using the priority `mp`.
*/
*/
template
<
class
...
Ts
,
class
...
V
s
>
template
<
class
...
Sigs
,
class
...
T
s
>
void
send
(
message_priority
mp
,
const
typed_actor
<
Ts
...
>&
dest
,
Vs
&&
...
v
s
)
{
void
send
(
message_priority
mp
,
const
typed_actor
<
Sigs
...
>&
dest
,
Ts
&&
...
x
s
)
{
using
token
=
using
token
=
detail
::
type_list
<
detail
::
type_list
<
typename
detail
::
implicit_conversions
<
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
V
s
>::
type
typename
std
::
decay
<
T
s
>::
type
>::
type
...
>
;
>::
type
...
>
;
token
tk
;
token
tk
;
check_typed_input
(
dest
,
tk
);
check_typed_input
(
dest
,
tk
);
send_impl
(
mp
,
actor_cast
<
abstract_channel
*>
(
dest
),
std
::
forward
<
Vs
>
(
v
s
)...);
send_impl
(
mp
,
actor_cast
<
abstract_channel
*>
(
dest
),
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
/**
/**
* Sends `{
v
s...} to `dest` using normal priority.
* Sends `{
x
s...} to `dest` using normal priority.
*/
*/
template
<
class
...
Ts
,
class
...
V
s
>
template
<
class
...
Sigs
,
class
...
T
s
>
void
send
(
const
typed_actor
<
Ts
...
>&
dest
,
Vs
&&
...
v
s
)
{
void
send
(
const
typed_actor
<
Sigs
...
>&
dest
,
Ts
&&
...
x
s
)
{
send
(
message_priority
::
normal
,
dest
,
std
::
forward
<
Vs
>
(
v
s
)...);
send
(
message_priority
::
normal
,
dest
,
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
/**
/**
...
@@ -194,19 +194,19 @@ class local_actor : public abstract_actor {
...
@@ -194,19 +194,19 @@ class local_actor : public abstract_actor {
* Sends a message to `dest` that is delayed by `rel_time`
* Sends a message to `dest` that is delayed by `rel_time`
* using the priority `mp`.
* using the priority `mp`.
*/
*/
template
<
class
...
V
s
>
template
<
class
...
T
s
>
void
delayed_send
(
message_priority
mp
,
const
channel
&
dest
,
void
delayed_send
(
message_priority
mp
,
const
channel
&
dest
,
const
duration
&
rtime
,
Vs
&&
...
v
s
)
{
const
duration
&
rtime
,
Ts
&&
...
x
s
)
{
delayed_send_impl
(
mp
,
dest
,
rtime
,
make_message
(
std
::
forward
<
Vs
>
(
v
s
)...));
delayed_send_impl
(
mp
,
dest
,
rtime
,
make_message
(
std
::
forward
<
Ts
>
(
x
s
)...));
}
}
/**
/**
* Sends a message to `dest` that is delayed by `rel_time`.
* Sends a message to `dest` that is delayed by `rel_time`.
*/
*/
template
<
class
...
V
s
>
template
<
class
...
T
s
>
void
delayed_send
(
const
channel
&
dest
,
const
duration
&
rtime
,
Vs
&&
...
v
s
)
{
void
delayed_send
(
const
channel
&
dest
,
const
duration
&
rtime
,
Ts
&&
...
x
s
)
{
delayed_send_impl
(
message_priority
::
normal
,
dest
,
rtime
,
delayed_send_impl
(
message_priority
::
normal
,
dest
,
rtime
,
make_message
(
std
::
forward
<
Vs
>
(
v
s
)...));
make_message
(
std
::
forward
<
Ts
>
(
x
s
)...));
}
}
/****************************************************************************
/****************************************************************************
...
@@ -501,17 +501,17 @@ class local_actor : public abstract_actor {
...
@@ -501,17 +501,17 @@ class local_actor : public abstract_actor {
/** @endcond */
/** @endcond */
private:
private:
template
<
class
V
,
class
...
V
s
>
template
<
class
T
,
class
...
T
s
>
typename
std
::
enable_if
<
typename
std
::
enable_if
<
!
std
::
is_same
<
typename
std
::
decay
<
V
>::
type
,
message
>::
value
!
std
::
is_same
<
typename
std
::
decay
<
T
>::
type
,
message
>::
value
>::
type
>::
type
send_impl
(
message_priority
mp
,
abstract_channel
*
dest
,
V
&&
v
,
Vs
&&
...
v
s
)
{
send_impl
(
message_priority
mp
,
abstract_channel
*
dest
,
T
&&
x
,
Ts
&&
...
x
s
)
{
if
(
!
dest
)
{
if
(
!
dest
)
{
return
;
return
;
}
}
dest
->
enqueue
(
mailbox_element
::
make_joint
(
address
(),
message_id
::
make
(
mp
),
dest
->
enqueue
(
mailbox_element
::
make_joint
(
address
(),
message_id
::
make
(
mp
),
std
::
forward
<
V
>
(
v
),
std
::
forward
<
T
>
(
x
),
std
::
forward
<
Vs
>
(
v
s
)...),
std
::
forward
<
Ts
>
(
x
s
)...),
host
());
host
());
}
}
...
...
libcaf_core/caf/mailbox_element.hpp
View file @
bddecb9c
...
@@ -64,18 +64,18 @@ class mailbox_element : public memory_managed {
...
@@ -64,18 +64,18 @@ class mailbox_element : public memory_managed {
static
unique_ptr
make
(
actor_addr
sender
,
message_id
id
,
message
msg
);
static
unique_ptr
make
(
actor_addr
sender
,
message_id
id
,
message
msg
);
template
<
class
...
V
s
>
template
<
class
...
T
s
>
static
unique_ptr
make_joint
(
actor_addr
sender
,
message_id
id
,
Vs
&&
...
v
s
)
{
static
unique_ptr
make_joint
(
actor_addr
sender
,
message_id
id
,
Ts
&&
...
x
s
)
{
using
value_storage
=
using
value_storage
=
detail
::
tuple_vals
<
detail
::
tuple_vals
<
typename
unbox_message_element
<
typename
unbox_message_element
<
typename
detail
::
strip_and_convert
<
V
s
>::
type
typename
detail
::
strip_and_convert
<
T
s
>::
type
>::
type
...
>::
type
...
>
;
>
;
std
::
integral_constant
<
size_t
,
2
>
tk
;
std
::
integral_constant
<
size_t
,
2
>
tk
;
using
storage
=
detail
::
pair_storage
<
mailbox_element
,
value_storage
>
;
using
storage
=
detail
::
pair_storage
<
mailbox_element
,
value_storage
>
;
auto
ptr
=
detail
::
memory
::
create
<
storage
>
(
tk
,
std
::
move
(
sender
),
id
,
auto
ptr
=
detail
::
memory
::
create
<
storage
>
(
tk
,
std
::
move
(
sender
),
id
,
std
::
forward
<
Vs
>
(
v
s
)...);
std
::
forward
<
Ts
>
(
x
s
)...);
ptr
->
first
.
msg
.
reset
(
&
(
ptr
->
second
),
false
);
ptr
->
first
.
msg
.
reset
(
&
(
ptr
->
second
),
false
);
return
unique_ptr
{
&
(
ptr
->
first
)};
return
unique_ptr
{
&
(
ptr
->
first
)};
}
}
...
...
libcaf_core/caf/match_case.hpp
View file @
bddecb9c
...
@@ -95,14 +95,14 @@ struct has_none {
...
@@ -95,14 +95,14 @@ struct has_none {
return
false
;
return
false
;
}
}
template
<
class
V
,
class
...
V
s
>
template
<
class
T
,
class
...
T
s
>
bool
operator
()(
const
V
&
,
const
Vs
&
...
v
s
)
const
{
bool
operator
()(
const
T
&
,
const
Ts
&
...
x
s
)
const
{
return
(
*
this
)(
v
s
...);
return
(
*
this
)(
x
s
...);
}
}
template
<
class
V
,
class
...
V
s
>
template
<
class
T
,
class
...
T
s
>
bool
operator
()(
const
optional
<
V
>&
v
,
const
Vs
&
...
v
s
)
const
{
bool
operator
()(
const
optional
<
T
>&
x
,
const
Ts
&
...
x
s
)
const
{
return
!
v
||
(
*
this
)(
v
s
...);
return
!
x
||
(
*
this
)(
x
s
...);
}
}
};
};
...
@@ -113,9 +113,9 @@ class lfinvoker {
...
@@ -113,9 +113,9 @@ class lfinvoker {
// nop
// nop
}
}
template
<
class
...
V
s
>
template
<
class
...
T
s
>
typename
detail
::
get_callable_trait
<
F
>::
result_type
operator
()(
Vs
&&
...
v
s
)
{
typename
detail
::
get_callable_trait
<
F
>::
result_type
operator
()(
Ts
&&
...
x
s
)
{
return
m_fun
(
unopt
(
std
::
forward
<
Vs
>
(
v
s
))...);
return
m_fun
(
unopt
(
std
::
forward
<
Ts
>
(
x
s
))...);
}
}
private:
private:
...
@@ -129,9 +129,9 @@ class lfinvoker<true, F> {
...
@@ -129,9 +129,9 @@ class lfinvoker<true, F> {
// nop
// nop
}
}
template
<
class
...
V
s
>
template
<
class
...
T
s
>
unit_t
operator
()(
Vs
&&
...
v
s
)
{
unit_t
operator
()(
Ts
&&
...
x
s
)
{
m_fun
(
unopt
(
std
::
forward
<
Vs
>
(
v
s
))...);
m_fun
(
unopt
(
std
::
forward
<
Ts
>
(
x
s
))...);
return
unit
;
return
unit
;
}
}
...
...
libcaf_core/caf/message.hpp
View file @
bddecb9c
...
@@ -343,8 +343,8 @@ class message {
...
@@ -343,8 +343,8 @@ class message {
struct
move_from_tuple_helper
{
struct
move_from_tuple_helper
{
template
<
class
...
Ts
>
template
<
class
...
Ts
>
inline
message
operator
()(
Ts
&
...
v
s
)
{
inline
message
operator
()(
Ts
&
...
x
s
)
{
return
make_message
(
std
::
move
(
v
s
)...);
return
make_message
(
std
::
move
(
x
s
)...);
}
}
};
};
...
@@ -442,24 +442,24 @@ struct unbox_message_element<atom_constant<V>> {
...
@@ -442,24 +442,24 @@ struct unbox_message_element<atom_constant<V>> {
};
};
/**
/**
* Returns a new `message` containing the values `(
v, v
s...)`.
* Returns a new `message` containing the values `(
x, x
s...)`.
* @relates message
* @relates message
*/
*/
template
<
class
V
,
class
...
V
s
>
template
<
class
V
,
class
...
T
s
>
typename
std
::
enable_if
<
typename
std
::
enable_if
<
!
std
::
is_same
<
message
,
typename
std
::
decay
<
V
>::
type
>::
value
!
std
::
is_same
<
message
,
typename
std
::
decay
<
V
>::
type
>::
value
||
(
sizeof
...(
V
s
)
>
0
),
||
(
sizeof
...(
T
s
)
>
0
),
message
message
>::
type
>::
type
make_message
(
V
&&
v
,
Vs
&&
...
v
s
)
{
make_message
(
V
&&
x
,
Ts
&&
...
x
s
)
{
using
storage
using
storage
=
detail
::
tuple_vals
<
typename
unbox_message_element
<
=
detail
::
tuple_vals
<
typename
unbox_message_element
<
typename
detail
::
strip_and_convert
<
V
>::
type
typename
detail
::
strip_and_convert
<
V
>::
type
>::
type
,
>::
type
,
typename
unbox_message_element
<
typename
unbox_message_element
<
typename
detail
::
strip_and_convert
<
V
s
>::
type
typename
detail
::
strip_and_convert
<
T
s
>::
type
>::
type
...
>
;
>::
type
...
>
;
auto
ptr
=
make_counted
<
storage
>
(
std
::
forward
<
V
>
(
v
),
std
::
forward
<
Vs
>
(
v
s
)...);
auto
ptr
=
make_counted
<
storage
>
(
std
::
forward
<
V
>
(
x
),
std
::
forward
<
Ts
>
(
x
s
)...);
return
message
{
detail
::
message_data
::
cow_ptr
{
std
::
move
(
ptr
)}};
return
message
{
detail
::
message_data
::
cow_ptr
{
std
::
move
(
ptr
)}};
}
}
...
...
libcaf_core/caf/message_builder.hpp
View file @
bddecb9c
...
@@ -71,11 +71,11 @@ class message_builder {
...
@@ -71,11 +71,11 @@ class message_builder {
}
}
/**
/**
* Adds `
what
` to the elements of the buffer.
* Adds `
x
` to the elements of the buffer.
*/
*/
template
<
class
T
>
template
<
class
T
>
message_builder
&
append
(
T
what
)
{
message_builder
&
append
(
T
x
)
{
return
append_impl
<
T
>
(
std
::
move
(
what
));
return
append_impl
<
T
>
(
std
::
move
(
x
));
}
}
/**
/**
...
...
libcaf_core/caf/message_handler.hpp
View file @
bddecb9c
...
@@ -84,17 +84,17 @@ class message_handler {
...
@@ -84,17 +84,17 @@ class message_handler {
* functors, or other message handlers.
* functors, or other message handlers.
*/
*/
template
<
class
T
,
class
...
Ts
>
template
<
class
T
,
class
...
Ts
>
message_handler
(
const
T
&
v
,
Ts
&&
...
v
s
)
{
message_handler
(
const
T
&
v
,
Ts
&&
...
x
s
)
{
assign
(
v
,
std
::
forward
<
Ts
>
(
v
s
)...);
assign
(
v
,
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
/**
/**
* Assigns new message handlers.
* Assigns new message handlers.
*/
*/
template
<
class
...
V
s
>
template
<
class
...
T
s
>
void
assign
(
Vs
...
v
s
)
{
void
assign
(
Ts
...
x
s
)
{
static_assert
(
sizeof
...(
V
s
)
>
0
,
"assign without arguments called"
);
static_assert
(
sizeof
...(
T
s
)
>
0
,
"assign without arguments called"
);
m_impl
=
detail
::
make_behavior
(
v
s
...);
m_impl
=
detail
::
make_behavior
(
x
s
...);
}
}
/**
/**
...
...
libcaf_core/caf/mixin/behavior_stack_based.hpp
View file @
bddecb9c
...
@@ -41,8 +41,8 @@ class behavior_stack_based_impl : public Base {
...
@@ -41,8 +41,8 @@ class behavior_stack_based_impl : public Base {
nonblocking_response_handle_tag
>
;
nonblocking_response_handle_tag
>
;
template
<
class
...
Ts
>
template
<
class
...
Ts
>
behavior_stack_based_impl
(
Ts
&&
...
v
s
)
behavior_stack_based_impl
(
Ts
&&
...
x
s
)
:
Base
(
std
::
forward
<
Ts
>
(
v
s
)...),
:
Base
(
std
::
forward
<
Ts
>
(
x
s
)...),
m_timeout_id
(
0
)
{
m_timeout_id
(
0
)
{
// nop
// nop
}
}
...
...
libcaf_core/caf/mixin/functor_based.hpp
View file @
bddecb9c
...
@@ -39,12 +39,12 @@ class functor_based : public Base {
...
@@ -39,12 +39,12 @@ class functor_based : public Base {
}
}
template
<
class
F
,
class
...
Ts
>
template
<
class
F
,
class
...
Ts
>
functor_based
(
F
f
,
Ts
&&
...
v
s
)
{
functor_based
(
F
f
,
Ts
&&
...
x
s
)
{
init
(
std
::
move
(
f
),
std
::
forward
<
Ts
>
(
v
s
)...);
init
(
std
::
move
(
f
),
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
template
<
class
F
,
class
...
Ts
>
template
<
class
F
,
class
...
Ts
>
void
init
(
F
f
,
Ts
&&
...
v
s
)
{
void
init
(
F
f
,
Ts
&&
...
x
s
)
{
using
trait
=
typename
detail
::
get_callable_trait
<
F
>::
type
;
using
trait
=
typename
detail
::
get_callable_trait
<
F
>::
type
;
using
arg_types
=
typename
trait
::
arg_types
;
using
arg_types
=
typename
trait
::
arg_types
;
using
result_type
=
typename
trait
::
result_type
;
using
result_type
=
typename
trait
::
result_type
;
...
@@ -54,7 +54,7 @@ class functor_based : public Base {
...
@@ -54,7 +54,7 @@ class functor_based : public Base {
typename
detail
::
tl_head
<
arg_types
>::
type
,
pointer
>::
value
;
typename
detail
::
tl_head
<
arg_types
>::
type
,
pointer
>::
value
;
std
::
integral_constant
<
bool
,
returns_behavior
>
token1
;
std
::
integral_constant
<
bool
,
returns_behavior
>
token1
;
std
::
integral_constant
<
bool
,
uses_first_arg
>
token2
;
std
::
integral_constant
<
bool
,
uses_first_arg
>
token2
;
set
(
token1
,
token2
,
std
::
move
(
f
),
std
::
forward
<
Ts
>
(
v
s
)...);
set
(
token1
,
token2
,
std
::
move
(
f
),
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
protected:
protected:
...
...
libcaf_core/caf/mixin/sync_sender.hpp
View file @
bddecb9c
This diff is collapsed.
Click to expand it.
libcaf_core/caf/policy/not_prioritizing.hpp
View file @
bddecb9c
...
@@ -51,8 +51,8 @@ class not_prioritizing {
...
@@ -51,8 +51,8 @@ class not_prioritizing {
self
->
mailbox
().
cache
().
push_second_back
(
ptr
.
release
());
self
->
mailbox
().
cache
().
push_second_back
(
ptr
.
release
());
}
}
template
<
class
Actor
,
class
...
V
s
>
template
<
class
Actor
,
class
...
T
s
>
bool
invoke_from_cache
(
Actor
*
self
,
V
s
&
...
args
)
{
bool
invoke_from_cache
(
Actor
*
self
,
T
s
&
...
args
)
{
auto
&
cache
=
self
->
mailbox
().
cache
();
auto
&
cache
=
self
->
mailbox
().
cache
();
auto
i
=
cache
.
second_begin
();
auto
i
=
cache
.
second_begin
();
auto
e
=
cache
.
second_end
();
auto
e
=
cache
.
second_end
();
...
...
libcaf_core/caf/response_handle.hpp
View file @
bddecb9c
...
@@ -68,9 +68,9 @@ class response_handle<Self, message, nonblocking_response_handle_tag> {
...
@@ -68,9 +68,9 @@ class response_handle<Self, message, nonblocking_response_handle_tag> {
// nop
// nop
}
}
template
<
class
...
V
s
>
template
<
class
...
T
s
>
continue_helper
then
(
Vs
&&
...
v
s
)
const
{
continue_helper
then
(
Ts
&&
...
x
s
)
const
{
behavior
bhvr
{
std
::
forward
<
Vs
>
(
v
s
)...};
behavior
bhvr
{
std
::
forward
<
Ts
>
(
x
s
)...};
m_self
->
bhvr_stack
().
push_back
(
std
::
move
(
bhvr
),
m_mid
);
m_self
->
bhvr_stack
().
push_back
(
std
::
move
(
bhvr
),
m_mid
);
return
{
m_mid
};
return
{
m_mid
};
}
}
...
@@ -138,9 +138,9 @@ class response_handle<Self, message, blocking_response_handle_tag> {
...
@@ -138,9 +138,9 @@ class response_handle<Self, message, blocking_response_handle_tag> {
m_self
->
dequeue_response
(
bhvr
,
m_mid
);
m_self
->
dequeue_response
(
bhvr
,
m_mid
);
}
}
template
<
class
...
V
s
>
template
<
class
...
T
s
>
void
await
(
Vs
&&
...
v
s
)
const
{
void
await
(
Ts
&&
...
x
s
)
const
{
behavior
bhvr
{
std
::
forward
<
Vs
>
(
v
s
)...};
behavior
bhvr
{
std
::
forward
<
Ts
>
(
x
s
)...};
m_self
->
dequeue_response
(
bhvr
,
m_mid
);
m_self
->
dequeue_response
(
bhvr
,
m_mid
);
}
}
...
...
libcaf_core/caf/send.hpp
View file @
bddecb9c
...
@@ -36,104 +36,104 @@ namespace caf {
...
@@ -36,104 +36,104 @@ namespace caf {
/**
/**
* Sends `to` a message under the identity of `from` with priority `prio`.
* Sends `to` a message under the identity of `from` with priority `prio`.
*/
*/
template
<
class
...
V
s
>
template
<
class
...
T
s
>
void
send_as
(
const
actor
&
from
,
message_priority
prio
,
void
send_as
(
const
actor
&
from
,
message_priority
prio
,
const
channel
&
to
,
Vs
&&
...
v
s
)
{
const
channel
&
to
,
Ts
&&
...
x
s
)
{
if
(
!
to
)
{
if
(
!
to
)
{
return
;
return
;
}
}
message_id
mid
;
message_id
mid
;
to
->
enqueue
(
from
.
address
(),
to
->
enqueue
(
from
.
address
(),
prio
==
message_priority
::
high
?
mid
.
with_high_priority
()
:
mid
,
prio
==
message_priority
::
high
?
mid
.
with_high_priority
()
:
mid
,
make_message
(
std
::
forward
<
Vs
>
(
v
s
)...),
nullptr
);
make_message
(
std
::
forward
<
Ts
>
(
x
s
)...),
nullptr
);
}
}
/**
/**
* Sends `to` a message under the identity of `from`.
* Sends `to` a message under the identity of `from`.
*/
*/
template
<
class
...
V
s
>
template
<
class
...
T
s
>
void
send_as
(
const
actor
&
from
,
const
channel
&
to
,
Vs
&&
...
v
s
)
{
void
send_as
(
const
actor
&
from
,
const
channel
&
to
,
Ts
&&
...
x
s
)
{
send_as
(
from
,
message_priority
::
normal
,
to
,
std
::
forward
<
Vs
>
(
v
s
)...);
send_as
(
from
,
message_priority
::
normal
,
to
,
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
/**
/**
* Sends `to` a message under the identity of `from` with priority `prio`.
* Sends `to` a message under the identity of `from` with priority `prio`.
*/
*/
template
<
class
...
Rs
,
class
...
V
s
>
template
<
class
...
Sigs
,
class
...
T
s
>
void
send_as
(
const
actor
&
from
,
message_priority
prio
,
void
send_as
(
const
actor
&
from
,
message_priority
prio
,
const
typed_actor
<
Rs
...
>&
to
,
Vs
&&
...
v
s
)
{
const
typed_actor
<
Sigs
...
>&
to
,
Ts
&&
...
x
s
)
{
using
token
=
using
token
=
detail
::
type_list
<
detail
::
type_list
<
typename
detail
::
implicit_conversions
<
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
V
s
>::
type
typename
std
::
decay
<
T
s
>::
type
>::
type
...
>
;
>::
type
...
>
;
token
tk
;
token
tk
;
check_typed_input
(
to
,
tk
);
check_typed_input
(
to
,
tk
);
send_as
(
from
,
prio
,
actor_cast
<
channel
>
(
to
),
std
::
forward
<
Vs
>
(
v
s
)...);
send_as
(
from
,
prio
,
actor_cast
<
channel
>
(
to
),
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
/**
/**
* Sends `to` a message under the identity of `from`.
* Sends `to` a message under the identity of `from`.
*/
*/
template
<
class
...
Rs
,
class
...
V
s
>
template
<
class
...
Sigs
,
class
...
T
s
>
void
send_as
(
const
actor
&
from
,
const
typed_actor
<
Rs
...
>&
to
,
Vs
&&
...
v
s
)
{
void
send_as
(
const
actor
&
from
,
const
typed_actor
<
Sigs
...
>&
to
,
Ts
&&
...
x
s
)
{
using
token
=
using
token
=
detail
::
type_list
<
detail
::
type_list
<
typename
detail
::
implicit_conversions
<
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
V
s
>::
type
typename
std
::
decay
<
T
s
>::
type
>::
type
...
>
;
>::
type
...
>
;
token
tk
;
token
tk
;
check_typed_input
(
to
,
tk
);
check_typed_input
(
to
,
tk
);
send_as
(
from
,
message_priority
::
normal
,
send_as
(
from
,
message_priority
::
normal
,
actor_cast
<
channel
>
(
to
),
std
::
forward
<
Vs
>
(
v
s
)...);
actor_cast
<
channel
>
(
to
),
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
/**
/**
* Anonymously sends `to` a message with priority `prio`.
* Anonymously sends `to` a message with priority `prio`.
*/
*/
template
<
class
...
V
s
>
template
<
class
...
T
s
>
void
anon_send
(
message_priority
prio
,
const
channel
&
to
,
Vs
&&
...
v
s
)
{
void
anon_send
(
message_priority
prio
,
const
channel
&
to
,
Ts
&&
...
x
s
)
{
send_as
(
invalid_actor
,
prio
,
to
,
std
::
forward
<
Vs
>
(
v
s
)...);
send_as
(
invalid_actor
,
prio
,
to
,
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
/**
/**
* Anonymously sends `to` a message.
* Anonymously sends `to` a message.
*/
*/
template
<
class
...
V
s
>
template
<
class
...
T
s
>
void
anon_send
(
const
channel
&
to
,
Vs
&&
...
v
s
)
{
void
anon_send
(
const
channel
&
to
,
Ts
&&
...
x
s
)
{
send_as
(
invalid_actor
,
message_priority
::
normal
,
to
,
std
::
forward
<
Vs
>
(
v
s
)...);
send_as
(
invalid_actor
,
message_priority
::
normal
,
to
,
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
/**
/**
* Anonymously sends `to` a message with priority `prio`.
* Anonymously sends `to` a message with priority `prio`.
*/
*/
template
<
class
...
Rs
,
class
...
V
s
>
template
<
class
...
Sigs
,
class
...
T
s
>
void
anon_send
(
message_priority
prio
,
const
typed_actor
<
R
s
...
>&
to
,
void
anon_send
(
message_priority
prio
,
const
typed_actor
<
Sig
s
...
>&
to
,
Vs
&&
...
v
s
)
{
Ts
&&
...
x
s
)
{
using
token
=
using
token
=
detail
::
type_list
<
detail
::
type_list
<
typename
detail
::
implicit_conversions
<
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
V
s
>::
type
typename
std
::
decay
<
T
s
>::
type
>::
type
...
>
;
>::
type
...
>
;
token
tk
;
token
tk
;
check_typed_input
(
to
,
tk
);
check_typed_input
(
to
,
tk
);
anon_send
(
prio
,
actor_cast
<
channel
>
(
to
),
std
::
forward
<
Vs
>
(
v
s
)...);
anon_send
(
prio
,
actor_cast
<
channel
>
(
to
),
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
/**
/**
* Anonymously sends `to` a message.
* Anonymously sends `to` a message.
*/
*/
template
<
class
...
Rs
,
class
...
V
s
>
template
<
class
...
Sigs
,
class
...
T
s
>
void
anon_send
(
const
typed_actor
<
Rs
...
>&
to
,
Vs
&&
...
v
s
)
{
void
anon_send
(
const
typed_actor
<
Sigs
...
>&
to
,
Ts
&&
...
x
s
)
{
using
token
=
using
token
=
detail
::
type_list
<
detail
::
type_list
<
typename
detail
::
implicit_conversions
<
typename
detail
::
implicit_conversions
<
typename
std
::
decay
<
V
s
>::
type
typename
std
::
decay
<
T
s
>::
type
>::
type
...
>
;
>::
type
...
>
;
token
tk
;
token
tk
;
check_typed_input
(
to
,
tk
);
check_typed_input
(
to
,
tk
);
anon_send
(
message_priority
::
normal
,
actor_cast
<
channel
>
(
to
),
anon_send
(
message_priority
::
normal
,
actor_cast
<
channel
>
(
to
),
std
::
forward
<
Vs
>
(
v
s
)...);
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
/**
/**
...
...
libcaf_core/caf/spawn.hpp
View file @
bddecb9c
...
@@ -234,13 +234,13 @@ actor spawn_in_group(const group& grp, Ts&&... args) {
...
@@ -234,13 +234,13 @@ actor spawn_in_group(const group& grp, Ts&&... args) {
/**
/**
* Base class for strongly typed actors using a functor-based implementation.
* Base class for strongly typed actors using a functor-based implementation.
*/
*/
template
<
class
...
R
s
>
template
<
class
...
Sig
s
>
class
functor_based_typed_actor
:
public
typed_event_based_actor
<
R
s
...
>
{
class
functor_based_typed_actor
:
public
typed_event_based_actor
<
Sig
s
...
>
{
public:
public:
/**
/**
* Base class for actors using given interface.
* Base class for actors using given interface.
*/
*/
using
base
=
typed_event_based_actor
<
R
s
...
>
;
using
base
=
typed_event_based_actor
<
Sig
s
...
>
;
/**
/**
* Pointer to the base class.
* Pointer to the base class.
...
@@ -339,14 +339,14 @@ class functor_based_typed_actor : public typed_event_based_actor<Rs...> {
...
@@ -339,14 +339,14 @@ class functor_based_typed_actor : public typed_event_based_actor<Rs...> {
template
<
class
Result
,
class
FirstArg
>
template
<
class
Result
,
class
FirstArg
>
struct
infer_typed_actor_base
;
struct
infer_typed_actor_base
;
template
<
class
...
R
s
,
class
FirstArg
>
template
<
class
...
Sig
s
,
class
FirstArg
>
struct
infer_typed_actor_base
<
typed_behavior
<
R
s
...
>
,
FirstArg
>
{
struct
infer_typed_actor_base
<
typed_behavior
<
Sig
s
...
>
,
FirstArg
>
{
using
type
=
functor_based_typed_actor
<
R
s
...
>
;
using
type
=
functor_based_typed_actor
<
Sig
s
...
>
;
};
};
template
<
class
...
R
s
>
template
<
class
...
Sig
s
>
struct
infer_typed_actor_base
<
void
,
typed_event_based_actor
<
R
s
...
>*>
{
struct
infer_typed_actor_base
<
void
,
typed_event_based_actor
<
Sig
s
...
>*>
{
using
type
=
functor_based_typed_actor
<
R
s
...
>
;
using
type
=
functor_based_typed_actor
<
Sig
s
...
>
;
};
};
/**
/**
...
...
libcaf_core/caf/spawn_fwd.hpp
View file @
bddecb9c
...
@@ -76,23 +76,23 @@ template <class TypedBehavior, class FirstArg>
...
@@ -76,23 +76,23 @@ template <class TypedBehavior, class FirstArg>
struct
infer_typed_actor_handle
;
struct
infer_typed_actor_handle
;
// infer actor type from result type if possible
// infer actor type from result type if possible
template
<
class
...
R
s
,
class
FirstArg
>
template
<
class
...
Sig
s
,
class
FirstArg
>
struct
infer_typed_actor_handle
<
typed_behavior
<
R
s
...
>
,
FirstArg
>
{
struct
infer_typed_actor_handle
<
typed_behavior
<
Sig
s
...
>
,
FirstArg
>
{
using
type
=
typed_actor
<
R
s
...
>
;
using
type
=
typed_actor
<
Sig
s
...
>
;
};
};
// infer actor type from first argument if result type is void
// infer actor type from first argument if result type is void
template
<
class
...
R
s
>
template
<
class
...
Sig
s
>
struct
infer_typed_actor_handle
<
void
,
typed_event_based_actor
<
R
s
...
>*>
{
struct
infer_typed_actor_handle
<
void
,
typed_event_based_actor
<
Sig
s
...
>*>
{
using
type
=
typed_actor
<
R
s
...
>
;
using
type
=
typed_actor
<
Sig
s
...
>
;
};
};
template
<
class
SignatureList
>
template
<
class
SignatureList
>
struct
actor_handle_from_signature_list
;
struct
actor_handle_from_signature_list
;
template
<
class
...
R
s
>
template
<
class
...
Sig
s
>
struct
actor_handle_from_signature_list
<
detail
::
type_list
<
R
s
...
>>
{
struct
actor_handle_from_signature_list
<
detail
::
type_list
<
Sig
s
...
>>
{
using
type
=
typed_actor
<
R
s
...
>
;
using
type
=
typed_actor
<
Sig
s
...
>
;
};
};
template
<
spawn_options
Os
,
typename
BeforeLaunch
,
typename
F
,
class
...
Ts
>
template
<
spawn_options
Os
,
typename
BeforeLaunch
,
typename
F
,
class
...
Ts
>
...
...
libcaf_core/caf/typed_actor.hpp
View file @
bddecb9c
...
@@ -36,18 +36,19 @@ class local_actor;
...
@@ -36,18 +36,19 @@ class local_actor;
struct
invalid_actor_addr_t
;
struct
invalid_actor_addr_t
;
template
<
class
...
R
s
>
template
<
class
...
Sig
s
>
class
typed_event_based_actor
;
class
typed_event_based_actor
;
/**
/**
* Identifies a strongly typed actor.
* Identifies a strongly typed actor.
* @tparam Rs Interface as `replies_to<...>::with<...>` parameter pack.
* @tparam Sigs Signature of this actor as `replies_to<...>::with<...>`
* parameter pack.
*/
*/
template
<
class
...
R
s
>
template
<
class
...
Sig
s
>
class
typed_actor
class
typed_actor
:
detail
::
comparable
<
typed_actor
<
R
s
...
>>
,
:
detail
::
comparable
<
typed_actor
<
Sig
s
...
>>
,
detail
::
comparable
<
typed_actor
<
R
s
...
>
,
actor_addr
>
,
detail
::
comparable
<
typed_actor
<
Sig
s
...
>
,
actor_addr
>
,
detail
::
comparable
<
typed_actor
<
R
s
...
>
,
invalid_actor_addr_t
>
{
detail
::
comparable
<
typed_actor
<
Sig
s
...
>
,
invalid_actor_addr_t
>
{
friend
class
local_actor
;
friend
class
local_actor
;
...
@@ -63,24 +64,24 @@ class typed_actor
...
@@ -63,24 +64,24 @@ class typed_actor
template
<
class
...
Es
>
template
<
class
...
Es
>
struct
extend
{
struct
extend
{
using
type
=
typed_actor
<
R
s
...,
Es
...
>
;
using
type
=
typed_actor
<
Sig
s
...,
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.
*/
*/
using
behavior_type
=
typed_behavior
<
R
s
...
>
;
using
behavior_type
=
typed_behavior
<
Sig
s
...
>
;
/**
/**
* Identifies pointers to instances of this kind of actor.
* Identifies pointers to instances of this kind of actor.
*/
*/
using
pointer
=
typed_event_based_actor
<
R
s
...
>*
;
using
pointer
=
typed_event_based_actor
<
Sig
s
...
>*
;
/**
/**
* Identifies the base class for this kind of actor.
* Identifies the base class for this kind of actor.
*/
*/
using
base
=
typed_event_based_actor
<
R
s
...
>
;
using
base
=
typed_event_based_actor
<
Sig
s
...
>
;
typed_actor
()
=
default
;
typed_actor
()
=
default
;
typed_actor
(
typed_actor
&&
)
=
default
;
typed_actor
(
typed_actor
&&
)
=
default
;
...
@@ -88,13 +89,13 @@ class typed_actor
...
@@ -88,13 +89,13 @@ class typed_actor
typed_actor
&
operator
=
(
typed_actor
&&
)
=
default
;
typed_actor
&
operator
=
(
typed_actor
&&
)
=
default
;
typed_actor
&
operator
=
(
const
typed_actor
&
)
=
default
;
typed_actor
&
operator
=
(
const
typed_actor
&
)
=
default
;
template
<
class
...
Other
R
s
>
template
<
class
...
Other
Sig
s
>
typed_actor
(
const
typed_actor
<
Other
R
s
...
>&
other
)
{
typed_actor
(
const
typed_actor
<
Other
Sig
s
...
>&
other
)
{
set
(
std
::
move
(
other
));
set
(
std
::
move
(
other
));
}
}
template
<
class
...
Other
R
s
>
template
<
class
...
Other
Sig
s
>
typed_actor
&
operator
=
(
const
typed_actor
<
Other
R
s
...
>&
other
)
{
typed_actor
&
operator
=
(
const
typed_actor
<
Other
Sig
s
...
>&
other
)
{
set
(
std
::
move
(
other
));
set
(
std
::
move
(
other
));
return
*
this
;
return
*
this
;
}
}
...
@@ -132,7 +133,7 @@ class typed_actor
...
@@ -132,7 +133,7 @@ class typed_actor
}
}
static
std
::
set
<
std
::
string
>
message_types
()
{
static
std
::
set
<
std
::
string
>
message_types
()
{
return
{
R
s
::
static_type_name
()...};
return
{
Sig
s
::
static_type_name
()...};
}
}
explicit
operator
bool
()
const
{
return
static_cast
<
bool
>
(
m_ptr
);
}
explicit
operator
bool
()
const
{
return
static_cast
<
bool
>
(
m_ptr
);
}
...
@@ -151,15 +152,15 @@ class typed_actor
...
@@ -151,15 +152,15 @@ class typed_actor
"'this' must be a strict subset of 'other'"
);
"'this' must be a strict subset of 'other'"
);
}
}
template
<
class
...
Other
R
s
>
template
<
class
...
Other
Sig
s
>
inline
void
set
(
const
typed_actor
<
Other
R
s
...
>&
other
)
{
inline
void
set
(
const
typed_actor
<
Other
Sig
s
...
>&
other
)
{
check_signatures
<
detail
::
type_list
<
Rs
...
>
,
detail
::
type_list
<
OtherR
s
...
>>
();
check_signatures
<
detail
::
type_list
<
Sigs
...
>
,
detail
::
type_list
<
OtherSig
s
...
>>
();
m_ptr
=
other
.
m_ptr
;
m_ptr
=
other
.
m_ptr
;
}
}
template
<
class
Impl
>
template
<
class
Impl
>
inline
void
set
(
intrusive_ptr
<
Impl
>&
other
)
{
inline
void
set
(
intrusive_ptr
<
Impl
>&
other
)
{
check_signatures
<
detail
::
type_list
<
R
s
...
>
,
typename
Impl
::
signatures
>
();
check_signatures
<
detail
::
type_list
<
Sig
s
...
>
,
typename
Impl
::
signatures
>
();
m_ptr
=
std
::
move
(
other
);
m_ptr
=
std
::
move
(
other
);
}
}
...
...
libcaf_core/caf/typed_behavior.hpp
View file @
bddecb9c
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
namespace
caf
{
namespace
caf
{
template
<
class
...
R
s
>
template
<
class
...
Sig
s
>
class
functor_based_typed_actor
;
class
functor_based_typed_actor
;
namespace
detail
{
namespace
detail
{
...
@@ -57,18 +57,6 @@ struct collapse_replies_to_statement<List, none_t> {
...
@@ -57,18 +57,6 @@ struct collapse_replies_to_statement<List, none_t> {
using
type
=
List
;
using
type
=
List
;
};
};
/*
template <class List>
struct unbox_typed_continue_helper {
using type = List;
};
template <class List>
struct unbox_typed_continue_helper<typed_continue_helper<List>> {
using type = List;
};
*/
template
<
class
Input
,
class
RepliesToWith
>
template
<
class
Input
,
class
RepliesToWith
>
struct
same_input
:
std
::
is_same
<
Input
,
typename
RepliesToWith
::
input_types
>
{};
struct
same_input
:
std
::
is_same
<
Input
,
typename
RepliesToWith
::
input_types
>
{};
...
@@ -168,7 +156,7 @@ void static_check_typed_behavior_input() {
...
@@ -168,7 +156,7 @@ void static_check_typed_behavior_input() {
}
// namespace detail
}
// namespace detail
template
<
class
...
R
s
>
template
<
class
...
Sig
s
>
class
typed_actor
;
class
typed_actor
;
namespace
mixin
{
namespace
mixin
{
...
@@ -176,10 +164,10 @@ template <class, class, class>
...
@@ -176,10 +164,10 @@ template <class, class, class>
class
behavior_stack_based_impl
;
class
behavior_stack_based_impl
;
}
}
template
<
class
...
R
s
>
template
<
class
...
Sig
s
>
class
typed_behavior
{
class
typed_behavior
{
public:
public:
template
<
class
...
Other
R
s
>
template
<
class
...
Other
Sig
s
>
friend
class
typed_actor
;
friend
class
typed_actor
;
template
<
class
,
class
,
class
>
template
<
class
,
class
,
class
>
...
@@ -193,11 +181,11 @@ class typed_behavior {
...
@@ -193,11 +181,11 @@ class typed_behavior {
typed_behavior
&
operator
=
(
typed_behavior
&&
)
=
default
;
typed_behavior
&
operator
=
(
typed_behavior
&&
)
=
default
;
typed_behavior
&
operator
=
(
const
typed_behavior
&
)
=
default
;
typed_behavior
&
operator
=
(
const
typed_behavior
&
)
=
default
;
using
signatures
=
detail
::
type_list
<
R
s
...
>
;
using
signatures
=
detail
::
type_list
<
Sig
s
...
>
;
template
<
class
...
V
s
>
template
<
class
...
T
s
>
typed_behavior
(
Vs
...
v
s
)
{
typed_behavior
(
Ts
...
x
s
)
{
set
(
detail
::
make_behavior
(
v
s
...));
set
(
detail
::
make_behavior
(
x
s
...));
}
}
explicit
operator
bool
()
const
{
explicit
operator
bool
()
const
{
...
...
libcaf_core/caf/typed_event_based_actor.hpp
View file @
bddecb9c
...
@@ -37,18 +37,18 @@ namespace caf {
...
@@ -37,18 +37,18 @@ namespace caf {
* `blocking_api` flag.
* `blocking_api` flag.
* @extends mailbox_based_actor
* @extends mailbox_based_actor
*/
*/
template
<
class
...
R
s
>
template
<
class
...
Sig
s
>
class
typed_event_based_actor
:
public
class
typed_event_based_actor
:
public
extend
<
mailbox_based_actor
,
typed_event_based_actor
<
R
s
...
>>::
template
extend
<
mailbox_based_actor
,
typed_event_based_actor
<
Sig
s
...
>>::
template
with
<
mixin
::
behavior_stack_based
<
typed_behavior
<
R
s
...>
>::
template
impl
,
with
<
mixin
::
behavior_stack_based
<
typed_behavior
<
Sig
s
...>
>::
template
impl
,
mixin
::
sync_sender
<
nonblocking_response_handle_tag
>
::
template
impl
>
{
mixin
::
sync_sender
<
nonblocking_response_handle_tag
>
::
template
impl
>
{
public:
public:
using
signatures
=
detail
::
type_list
<
R
s
...
>
;
using
signatures
=
detail
::
type_list
<
Sig
s
...
>
;
using
behavior_type
=
typed_behavior
<
R
s
...
>
;
using
behavior_type
=
typed_behavior
<
Sig
s
...
>
;
std
::
set
<
std
::
string
>
message_types
()
const
override
{
std
::
set
<
std
::
string
>
message_types
()
const
override
{
return
{
R
s
::
static_type_name
()...};
return
{
Sig
s
::
static_type_name
()...};
}
}
protected:
protected:
...
...
libcaf_core/src/abstract_coordinator.cpp
View file @
bddecb9c
...
@@ -68,10 +68,10 @@ inline void deliver(delayed_msg& dm) {
...
@@ -68,10 +68,10 @@ inline void deliver(delayed_msg& dm) {
}
}
template
<
class
Map
,
class
...
Ts
>
template
<
class
Map
,
class
...
Ts
>
inline
void
insert_dmsg
(
Map
&
storage
,
const
duration
&
d
,
Ts
&&
...
v
s
)
{
inline
void
insert_dmsg
(
Map
&
storage
,
const
duration
&
d
,
Ts
&&
...
x
s
)
{
auto
tout
=
hrc
::
now
();
auto
tout
=
hrc
::
now
();
tout
+=
d
;
tout
+=
d
;
delayed_msg
dmsg
{
std
::
forward
<
Ts
>
(
v
s
)...};
delayed_msg
dmsg
{
std
::
forward
<
Ts
>
(
x
s
)...};
storage
.
insert
(
std
::
make_pair
(
std
::
move
(
tout
),
std
::
move
(
dmsg
)));
storage
.
insert
(
std
::
make_pair
(
std
::
move
(
tout
),
std
::
move
(
dmsg
)));
}
}
...
...
libcaf_io/caf/io/broker.hpp
View file @
bddecb9c
...
@@ -226,9 +226,9 @@ class broker : public extend<local_actor>::
...
@@ -226,9 +226,9 @@ class broker : public extend<local_actor>::
/** @cond PRIVATE */
/** @cond PRIVATE */
template
<
class
F
,
class
...
Ts
>
template
<
class
F
,
class
...
Ts
>
actor
fork
(
F
fun
,
connection_handle
hdl
,
Ts
&&
...
v
s
)
{
actor
fork
(
F
fun
,
connection_handle
hdl
,
Ts
&&
...
x
s
)
{
// provoke compile-time errors early
// provoke compile-time errors early
using
fun_res
=
decltype
(
fun
(
this
,
hdl
,
std
::
forward
<
Ts
>
(
v
s
)...));
using
fun_res
=
decltype
(
fun
(
this
,
hdl
,
std
::
forward
<
Ts
>
(
x
s
)...));
// prevent warning about unused local type
// prevent warning about unused local type
static_assert
(
std
::
is_same
<
fun_res
,
fun_res
>::
value
,
static_assert
(
std
::
is_same
<
fun_res
,
fun_res
>::
value
,
"your compiler is lying to you"
);
"your compiler is lying to you"
);
...
@@ -245,7 +245,7 @@ class broker : public extend<local_actor>::
...
@@ -245,7 +245,7 @@ class broker : public extend<local_actor>::
forked
->
m_scribes
.
insert
(
forked
->
m_scribes
.
insert
(
std
::
make_pair
(
sptr
->
hdl
(),
sptr
));
std
::
make_pair
(
sptr
->
hdl
(),
sptr
));
},
},
fun
,
hdl
,
std
::
forward
<
Ts
>
(
v
s
)...);
fun
,
hdl
,
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
inline
void
add_scribe
(
const
scribe_pointer
&
ptr
)
{
inline
void
add_scribe
(
const
scribe_pointer
&
ptr
)
{
...
@@ -393,7 +393,7 @@ class broker::functor_based : public extend<broker>::
...
@@ -393,7 +393,7 @@ class broker::functor_based : public extend<broker>::
using
super
=
combined_type
;
using
super
=
combined_type
;
template
<
class
...
Ts
>
template
<
class
...
Ts
>
functor_based
(
Ts
&&
...
vs
)
:
super
(
std
::
forward
<
Ts
>
(
v
s
)...)
{
functor_based
(
Ts
&&
...
xs
)
:
super
(
std
::
forward
<
Ts
>
(
x
s
)...)
{
// nop
// nop
}
}
...
...
libcaf_io/caf/io/network/default_multiplexer.hpp
View file @
bddecb9c
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
# include <sys/socket.h>
# include <sys/socket.h>
#endif
#endif
// poll
v
s epoll backend
// poll
x
s epoll backend
#if !defined(CAF_LINUX) || defined(CAF_POLL_IMPL) // poll() multiplexer
#if !defined(CAF_LINUX) || defined(CAF_POLL_IMPL) // poll() multiplexer
# define CAF_POLL_MULTIPLEXER
# define CAF_POLL_MULTIPLEXER
# ifndef CAF_WINDOWS
# ifndef CAF_WINDOWS
...
@@ -105,7 +105,7 @@ namespace network {
...
@@ -105,7 +105,7 @@ namespace network {
constexpr
int
ec_interrupted_syscall
=
EINTR
;
constexpr
int
ec_interrupted_syscall
=
EINTR
;
#endif
#endif
// poll
v
s epoll backend
// poll
x
s epoll backend
#if !defined(CAF_LINUX) || defined(CAF_POLL_IMPL) // poll() multiplexer
#if !defined(CAF_LINUX) || defined(CAF_POLL_IMPL) // poll() multiplexer
# ifdef CAF_WINDOWS
# ifdef CAF_WINDOWS
// From the MSDN: If the POLLPRI flag is set on a socket for the Microsoft
// From the MSDN: If the POLLPRI flag is set on a socket for the Microsoft
...
...
libcaf_io/caf/io/publish.hpp
View file @
bddecb9c
...
@@ -53,8 +53,8 @@ inline uint16_t publish(caf::actor whom, uint16_t port,
...
@@ -53,8 +53,8 @@ inline uint16_t publish(caf::actor whom, uint16_t port,
/**
/**
* @copydoc publish(actor,uint16_t,const char*)
* @copydoc publish(actor,uint16_t,const char*)
*/
*/
template
<
class
...
R
s
>
template
<
class
...
Sig
s
>
uint16_t
typed_publish
(
typed_actor
<
R
s
...
>
whom
,
uint16_t
port
,
uint16_t
typed_publish
(
typed_actor
<
Sig
s
...
>
whom
,
uint16_t
port
,
const
char
*
in
=
nullptr
,
bool
reuse_addr
=
false
)
{
const
char
*
in
=
nullptr
,
bool
reuse_addr
=
false
)
{
if
(
!
whom
)
{
if
(
!
whom
)
{
return
0
;
return
0
;
...
...
libcaf_io/caf/io/remote_actor.hpp
View file @
bddecb9c
...
@@ -34,20 +34,6 @@ namespace io {
...
@@ -34,20 +34,6 @@ namespace io {
abstract_actor_ptr
remote_actor_impl
(
std
::
set
<
std
::
string
>
ifs
,
abstract_actor_ptr
remote_actor_impl
(
std
::
set
<
std
::
string
>
ifs
,
const
std
::
string
&
host
,
uint16_t
port
);
const
std
::
string
&
host
,
uint16_t
port
);
template
<
class
List
>
struct
typed_remote_actor_helper
;
template
<
template
<
class
...
>
class
List
,
class
...
Ts
>
struct
typed_remote_actor_helper
<
List
<
Ts
...
>>
{
using
return_type
=
typed_actor
<
Ts
...
>
;
template
<
class
...
Vs
>
return_type
operator
()(
Vs
&&
...
vs
)
{
auto
iface
=
return_type
::
message_types
();
auto
tmp
=
remote_actor_impl
(
std
::
move
(
iface
),
std
::
forward
<
Vs
>
(
vs
)...);
return
actor_cast
<
return_type
>
(
tmp
);
}
};
/**
/**
* Establish a new connection to the actor at `host` on given `port`.
* Establish a new connection to the actor at `host` on given `port`.
* @param host Valid hostname or IP address.
* @param host Valid hostname or IP address.
...
@@ -71,11 +57,11 @@ inline actor remote_actor(const std::string& host, uint16_t port) {
...
@@ -71,11 +57,11 @@ inline actor remote_actor(const std::string& host, uint16_t port) {
* @throws network_error Thrown on connection error or when connecting
* @throws network_error Thrown on connection error or when connecting
* to an untyped otherwise unexpected actor.
* to an untyped otherwise unexpected actor.
*/
*/
template
<
class
List
>
template
<
class
ActorHandle
>
typename
typed_remote_actor_helper
<
List
>::
return_type
ActorHandle
typed_remote_actor
(
const
std
::
string
&
host
,
uint16_t
port
)
{
typed_remote_actor
(
const
std
::
string
&
host
,
uint16_t
port
)
{
auto
iface
=
ActorHandle
::
message_types
();
typed_remote_actor_helper
<
List
>
f
;
return
actor_cast
<
ActorHandle
>
(
remote_actor_impl
(
std
::
move
(
iface
),
return
f
(
host
,
port
);
host
,
port
)
);
}
}
}
// namespace io
}
// namespace io
...
...
libcaf_io/caf/io/spawn_io.hpp
View file @
bddecb9c
...
@@ -38,8 +38,8 @@ namespace io {
...
@@ -38,8 +38,8 @@ namespace io {
*/
*/
template
<
spawn_options
Os
=
no_spawn_options
,
template
<
spawn_options
Os
=
no_spawn_options
,
typename
F
=
std
::
function
<
void
(
broker
*
)>,
class
...
Ts
>
typename
F
=
std
::
function
<
void
(
broker
*
)>,
class
...
Ts
>
actor
spawn_io
(
F
fun
,
Ts
&&
...
v
s
)
{
actor
spawn_io
(
F
fun
,
Ts
&&
...
x
s
)
{
return
spawn
<
broker
::
functor_based
>
(
std
::
move
(
fun
),
std
::
forward
<
Ts
>
(
v
s
)...);
return
spawn
<
broker
::
functor_based
>
(
std
::
move
(
fun
),
std
::
forward
<
Ts
>
(
x
s
)...);
}
}
/**
/**
...
...
libcaf_io/src/default_multiplexer.cpp
View file @
bddecb9c
...
@@ -247,7 +247,7 @@ namespace network {
...
@@ -247,7 +247,7 @@ namespace network {
#endif
#endif
/******************************************************************************
/******************************************************************************
* epoll()
v
s. poll() *
* epoll()
x
s. poll() *
******************************************************************************/
******************************************************************************/
#ifdef CAF_EPOLL_MULTIPLEXER
#ifdef CAF_EPOLL_MULTIPLEXER
...
...
libcaf_io/src/middleman.cpp
View file @
bddecb9c
...
@@ -276,15 +276,15 @@ class middleman_actor_impl : public middleman_actor_base::base {
...
@@ -276,15 +276,15 @@ class middleman_actor_impl : public middleman_actor_base::base {
return
result
;
return
result
;
}
}
template
<
class
T
,
class
...
V
s
>
template
<
class
T
,
class
...
T
s
>
void
handle_ok
(
map_type
&
storage
,
int64_t
request_id
,
Vs
&&
...
v
s
)
{
void
handle_ok
(
map_type
&
storage
,
int64_t
request_id
,
Ts
&&
...
x
s
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
request_id
));
CAF_LOG_TRACE
(
CAF_ARG
(
request_id
));
auto
i
=
storage
.
find
(
request_id
);
auto
i
=
storage
.
find
(
request_id
);
if
(
i
==
storage
.
end
())
{
if
(
i
==
storage
.
end
())
{
CAF_LOG_ERROR
(
"request id not found: "
<<
request_id
);
CAF_LOG_ERROR
(
"request id not found: "
<<
request_id
);
return
;
return
;
}
}
i
->
second
.
deliver
(
T
{
ok_atom
::
value
,
std
::
forward
<
Vs
>
(
v
s
)...}.
value
);
i
->
second
.
deliver
(
T
{
ok_atom
::
value
,
std
::
forward
<
Ts
>
(
x
s
)...}.
value
);
storage
.
erase
(
i
);
storage
.
erase
(
i
);
}
}
...
...
unit_testing/test_match.cpp
View file @
bddecb9c
...
@@ -45,8 +45,8 @@ void fill_mb(message_builder&) {
...
@@ -45,8 +45,8 @@ void fill_mb(message_builder&) {
}
}
template
<
class
T
,
class
...
Ts
>
template
<
class
T
,
class
...
Ts
>
void
fill_mb
(
message_builder
&
mb
,
const
T
&
v
,
const
Ts
&
...
v
s
)
{
void
fill_mb
(
message_builder
&
mb
,
const
T
&
x
,
const
Ts
&
...
x
s
)
{
fill_mb
(
mb
.
append
(
v
),
v
s
...);
fill_mb
(
mb
.
append
(
x
),
x
s
...);
}
}
template
<
class
...
Ts
>
template
<
class
...
Ts
>
...
...
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