20 #ifndef INCLUDE_FKIE_MESSAGE_FILTERS_SINK_IMPL_H_
21 #define INCLUDE_FKIE_MESSAGE_FILTERS_SINK_IMPL_H_
29 template<
typename... Inputs>
30 class Sink<Inputs...>::ReentryProtector
33 ReentryProtector(Sink<Inputs...>& parent)
36 if (!
running_.insert(this_id_).second)
38 throw std::logic_error(
"recursive invocation detected");
49 const std::thread::id this_id_;
53 template<
typename... Inputs>
56 std::lock_guard<std::mutex> lock(mutex_);
57 Connection c = src.signal_.connect_extended([
this](
const Connection& conn,
const Inputs&... in) { this->receive_cb(conn, in...); });
62 template<
typename... Inputs>
65 std::lock_guard<std::mutex> lock(mutex_);
69 template<
typename... Inputs>
72 disconnect_from_all_sources();
75 template<
typename... Inputs>
78 std::unique_lock<std::mutex> lock(mutex_);
79 conn_.erase(std::remove_if(conn_.begin(), conn_.end(), [](
const Connection& c) ->
bool { return !c.connected(); }), conn_.end());