Commit 9ecec36b authored by Dominik Charousset's avatar Dominik Charousset

Merge pull request #341 from ufownl/topic/typed_stateful_broker

Typed stateful broker
parents e140966f 62ffbbbe
......@@ -126,6 +126,24 @@ struct infer_handle_from_fun_impl<Result,
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,
experimental::stateful_actor<
State,
io::experimental::typed_broker<Sigs...>
>*,
true> {
using type = typed_actor<Sigs...>;
using impl =
experimental::stateful_actor<
State,
io::experimental::typed_broker<Sigs...>
>;
using behavior_type = typed_behavior<Sigs...>;
static constexpr spawn_mode mode = spawn_mode::function_with_selfptr;
};
template <class F, class Trait = typename detail::get_callable_trait<F>::type>
struct infer_handle_from_fun {
using result_type = typename Trait::result_type;
......
......@@ -104,6 +104,16 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
template <class State>
using stateful_pointer = experimental::stateful_actor<State, base>*;
/// Identifies the broker_base class for this kind of actor with actor.
template <class State>
using stateful_broker_base =
experimental::stateful_actor<State, broker_base>;
/// Identifies the broker_base class for this kind of actor with actor.
template <class State>
using stateful_broker_pointer =
experimental::stateful_actor<State, broker_base>*;
typed_actor() = default;
typed_actor(typed_actor&&) = default;
typed_actor(const typed_actor&) = default;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment