Split an N-ary source into N unary ones. More...
#include <divider.h>
Classes | |
class | DividerSource |
Public Types | |
using | Connections = std::array< Connection, NUM_INPUTS > |
Array of connection objects. More... | |
template<std::size_t N> | |
using | SourceType = helpers::select_nth< N, Source< Inputs >... > |
Base class of the Nth source. More... | |
Public Member Functions | |
Connections | connect_to_sinks (Sink< Inputs > &... sinks) noexcept |
Convenience function to connect all sources at once. More... | |
void | disconnect () noexcept override |
Disconnect from all connected sources and sinks. More... | |
void | disconnect_from_all_sinks () noexcept |
Disconnect all sources from their sinks. More... | |
template<std::size_t N> | |
const Divider< Inputs... >::template SourceType< N > & | source () const noexcept |
template<std::size_t N> | |
const SourceType< N > & | source () const noexcept |
Access the source for the Nth data element. More... | |
template<std::size_t N> | |
Divider< Inputs... >::template SourceType< N > & | source () noexcept |
template<std::size_t N> | |
SourceType< N > & | source () noexcept |
Access the source for the Nth data element. More... | |
Protected Member Functions | |
void | receive (const Inputs &... in) override |
Process incoming data. More... | |
Private Member Functions | |
template<std::size_t N> | |
void | connect_to_sinks_impl (Connections &conn) noexcept |
template<std::size_t N, typename ThisSink , typename... OtherSinks> | |
void | connect_to_sinks_impl (Connections &conn, ThisSink &sink, OtherSinks &... sinks) noexcept |
template<std::size_t N> | |
void | forward_to_sources () |
template<std::size_t N, typename ThisInput , typename... OtherInputs> | |
void | forward_to_sources (const ThisInput &in, const OtherInputs &... ins) |
Private Attributes | |
std::tuple< DividerSource< Inputs >... > | sources_ |
Additional Inherited Members |
Split an N-ary source into N unary ones.
The divider splits an N-ary source into its constituent elements, so they can be processed independently. It is mostly used as the penultimate pipeline filter to forward message tuples to independent Publisher instances.
Technically, the divider acts as one sink and N sources, one for each data type that is passed in. You can connect the sources independently using the source() function.
The divider will always completely separate the input arguments. If you want a partial split only, you should use one or more Selector filters instead.
using fkie_message_filters::Divider< Inputs >::Connections = std::array<Connection, NUM_INPUTS> |
using fkie_message_filters::Divider< Inputs >::SourceType = helpers::select_nth<N, Source<Inputs>...> |
|
noexcept |
Convenience function to connect all sources at once.
\nothrow
Definition at line 62 of file divider_impl.h.
|
privatenoexcept |
Definition at line 116 of file divider_impl.h.
|
privatenoexcept |
Definition at line 122 of file divider_impl.h.
|
overridevirtualnoexcept |
Disconnect from all connected sources and sinks.
\nothrow
Reimplemented from fkie_message_filters::Sink< Inputs... >.
Definition at line 81 of file divider_impl.h.
|
noexcept |
|
private |
Definition at line 102 of file divider_impl.h.
|
private |
Definition at line 108 of file divider_impl.h.
|
overrideprotectedvirtual |
Process incoming data.
Derived classes need to override this method to handle all data that is to be consumed by the sink.
\abstractthrow
Implements fkie_message_filters::Sink< Inputs... >.
Definition at line 95 of file divider_impl.h.
|
noexcept |
Definition at line 56 of file divider_impl.h.
|
noexcept |
Access the source for the Nth data element.
|
noexcept |
Definition at line 49 of file divider_impl.h.
|
noexcept |
Access the source for the Nth data element.
|
private |