Go to the documentation of this file.
20 #ifndef INCLUDE_FKIE_MESSAGE_FILTERS_DIVIDER_H_
21 #define INCLUDE_FKIE_MESSAGE_FILTERS_DIVIDER_H_
58 template<
class... Inputs>
59 class Divider :
public Sink<Inputs...>
64 using Connections = std::array<Connection, NUM_INPUTS>;
66 template<std::
size_t N>
using SourceType = helpers::select_nth<N, Source<Inputs>...>;
68 template<std::
size_t N>
69 SourceType<N>&
source() noexcept;
71 template<
std::
size_t N>
89 void receive (const Inputs&... in) override;
95 void forward(
const Input& in);
97 std::tuple<DividerSource<Inputs>...>
sources_;
98 template<std::size_t N,
typename ThisInput,
typename... OtherInputs>
100 template<std::
size_t N>
102 template<std::size_t N,
typename ThisSink,
typename... OtherSinks>
104 template<std::
size_t N>
108 template<
class... Inputs>
void forward_to_sources()
Group multiple data types as filter input or output.
void receive(const Inputs &... in) override
Process incoming data.
void connect_to_sinks_impl(Connections &conn, ThisSink &sink, OtherSinks &... sinks) noexcept
static constexpr std::size_t NUM_INPUTS
Number of input arguments.
std::tuple< DividerSource< Inputs >... > sources_
Split an N-ary source into N unary ones.
void disconnect_from_all_sinks() noexcept
Disconnect all sources from their sinks.
std::array< Connection, NUM_INPUTS > Connections
Array of connection objects.
Connections connect_to_sinks(Sink< Inputs > &... sinks) noexcept
Convenience function to connect all sources at once.
helpers::select_nth< N, Source< Inputs >... > SourceType
Base class of the Nth source.
Base class for data consumers.
Base class for data providers.
SourceType< N > & source() noexcept
Access the source for the Nth data element.
void disconnect() noexcept override
Disconnect from all connected sources and sinks.