20 #ifndef INCLUDE_FKIE_MESSAGE_FILTERS_COMBINER_H_ 21 #define INCLUDE_FKIE_MESSAGE_FILTERS_COMBINER_H_ 33 namespace combiner_policies
71 template<
template<
typename...>
class PolicyTmpl,
class... IOs>
74 template<template<typename...> class PolicyTmpl, class... IOs>
80 static constexpr std::size_t NUM_SINKS =
sizeof...(IOs);
84 template<std::
size_t N>
95 template<
std::
size_t N>
98 template<
std::
size_t N>
99 const
SinkType<N>& sink() const noexcept;
101 const
Policy& policy() const noexcept;
108 void set_policy(const
Policy& policy) noexcept;
118 void disconnect_from_all_sources() noexcept;
125 void reset() noexcept override;
130 void disconnect() noexcept override;
134 template<typename... Inputs>
138 using Tuple = std::tuple<Inputs...>;
140 void set_parent(
Combiner* parent) noexcept;
143 void receive(
const Inputs&... in)
override;
150 std::tuple<typename IOs::template Rewrap<CombinerSink>...>
sinks_;
151 void connect_policy() noexcept;
152 template<
std::
size_t N, typename ThisSource, typename... OtherSources>
153 void connect_to_sources_impl(
Connections& conn, ThisSource& src, OtherSources&... sources) noexcept;
154 template<
std::
size_t N>
155 void connect_to_sources_impl(
Connections& conn) noexcept;
160 #include "combiner_impl.h" std::tuple_element_t< N, std::tuple< Ts... > > select_nth
Base class for data consumers.
helpers::io_tuple_t< helpers::io_concat_t< IOs... > > OutgoingTuple
std::tuple< typename IOs::template Rewrap< CombinerSink >... > sinks_
Base class for data providers.
std::function< void(std::unique_lock< std::mutex > &, const Tuple &)> PolicyInFunc
std::array< Connection, NUM_SINKS > Connections
Array of connection objects.
typename io_rewrap< IO, Wrap >::type io_rewrap_t
helpers::io_rewrap_t< helpers::select_nth< N, IOs... >, Sink > SinkType
Base class for the Nth sink.
std::tuple< Inputs... > Tuple
typename io_tuple< IO >::type io_tuple_t
std::mutex combiner_mutex_
Combine multiple sources into a single one.
std::tuple< typename helpers::io_tuple_t< IOs >... > IncomingTuples
typename io_concat< Ts... >::type io_concat_t
PolicyTmpl< IOs... > Policy
Class type of the policy that applies to the combiner.