Commit 7ad680ec authored by Dominik Charousset's avatar Dominik Charousset

Enable anon_send in composable behaviors

parent 70f560bc
......@@ -65,9 +65,10 @@ struct is_weak_ptr {
};
template <class T>
struct is_weak_ptr<T*> {
static constexpr bool value = false;
};
struct is_weak_ptr<T*> : std::false_type {};
template <class... Ts>
struct is_weak_ptr<typed_actor_pointer<Ts...>> : std::false_type {};
template <class T>
struct is_non_null_handle {
......
......@@ -44,6 +44,7 @@ template <class, class, int> class actor_cast_access;
template <class...> class result;
template <class...> class delegated;
template <class...> class typed_actor;
template <class...> class typed_actor_pointer;
template <class...> class typed_response_promise;
template <class...> class typed_event_based_actor;
......
......@@ -142,7 +142,7 @@ public:
>::type
>::value,
"this actor does not accept the response message");
this->system().scheduler().delayed_send(
dptr()->system().scheduler().delayed_send(
rtime, this->ctrl(), actor_cast<strong_actor_ptr>(dest),
message_id::make(P), make_message(std::forward<Ts>(xs)...));
}
......@@ -161,10 +161,15 @@ public:
token
>::value,
"receiver does not accept given message");
this->system().scheduler().delayed_send(
dptr()->system().scheduler().delayed_send(
rtime, nullptr, actor_cast<strong_actor_ptr>(dest),
message_id::make(P), make_message(std::forward<Ts>(xs)...));
}
private:
Subtype* dptr() {
return static_cast<Subtype*>(this);
}
};
} // namespace mixin
......
......@@ -29,6 +29,9 @@ namespace caf {
template <class... Sigs>
class typed_actor_pointer {
public:
/// Stores the template parameter pack.
using signatures = detail::type_list<Sigs...>;
template <class Supertype>
typed_actor_pointer(Supertype* selfptr) : view_(selfptr) {
using namespace caf::detail;
......@@ -47,6 +50,11 @@ public:
return &view_;
}
/// @private
actor_control_block* get() const {
return actor_control_block::from(view_.selfptr());
}
private:
typed_actor_view<Sigs...> view_;
};
......
......@@ -95,6 +95,11 @@ public:
return self_->response(std::forward<Ts>(xs)...);
}
/// @private
scheduled_actor* selfptr() const {
return self_;
}
private:
scheduled_actor* self_;
};
......
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