Commit 673c0fd3 authored by Dominik Charousset's avatar Dominik Charousset

Add getter for inbound paths

parent 0250f6bb
...@@ -143,6 +143,9 @@ public: ...@@ -143,6 +143,9 @@ public:
return inbound_paths_; return inbound_paths_;
} }
/// Returns the inbound paths at slot `x`.
inbound_path* get_inbound_path(stream_slot x) const;
/// Returns the parent actor. /// Returns the parent actor.
inline scheduled_actor* self() { inline scheduled_actor* self() {
return self_; return self_;
...@@ -207,8 +210,8 @@ public: ...@@ -207,8 +210,8 @@ public:
/// @pre `out().terminal() == false` /// @pre `out().terminal() == false`
/// @private /// @private
template <class In> template <class In>
stream_result<> add_unchecked_inbound_path(const stream<In>&) { stream_slot add_unchecked_inbound_path(const stream<In>&) {
return {add_unchecked_inbound_path_impl(), this}; return add_unchecked_inbound_path_impl();
} }
/// Adds a new outbound path to `rp.next()`. /// Adds a new outbound path to `rp.next()`.
......
...@@ -176,6 +176,15 @@ void stream_manager::remove_input_path(stream_slot slot, error reason, ...@@ -176,6 +176,15 @@ void stream_manager::remove_input_path(stream_slot slot, error reason,
self_->erase_inbound_path_later(slot, std::move(reason)); self_->erase_inbound_path_later(slot, std::move(reason));
} }
inbound_path* stream_manager::get_inbound_path(stream_slot x) const {
auto pred = [=](inbound_path* ptr) {
return ptr->slots.receiver == x;
};
auto e = inbound_paths_.end();
auto i = std::find_if(inbound_paths_.begin(), e, pred);
return i != e ? *i : nullptr;
}
stream_slot stream_manager::add_unchecked_outbound_path_impl(response_promise& rp, stream_slot stream_manager::add_unchecked_outbound_path_impl(response_promise& rp,
message handshake) { message handshake) {
CAF_LOG_TRACE(CAF_ARG(rp) << CAF_ARG(handshake)); CAF_LOG_TRACE(CAF_ARG(rp) << CAF_ARG(handshake));
......
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