Base class for data providers. More...
#include <sink.h>
Public Types | |
using | Output = IO< Outputs... > |
Grouped output types. More... | |
Public Member Functions | |
Connection | connect_to_sink (Sink< Outputs... > &dst) noexcept |
Connect this source to a sink. More... | |
virtual void | disconnect () noexcept override |
Disconnect from all connected sinks. More... | |
void | disconnect_from_all_sinks () noexcept |
Disconnect from all connected sinks. More... | |
virtual | ~Source () |
Static Public Attributes | |
static constexpr std::size_t | NUM_OUTPUTS = sizeof...(Outputs) |
Number of output arguments. More... | |
Protected Member Functions | |
void | send (const Outputs &... out) |
Pass data to all connected sinks. More... | |
Private Attributes | |
boost::signals2::signal< void(const Outputs &...)> | signal_ |
Friends | |
template<typename... > | |
class | Sink |
Base class for data providers.
In the message filter library, all data flows from sources to sinks. The sources are providers of data, which may either be generated synthetically or gathered from other sources, such as ROS topics.
Derived classes need to call the send() method to pass actual data to the connected sinks. This class does nothing but track which sinks have been connected. The send() method takes the same number and types of arguments as specified in the template instantiation.
using fkie_message_filters::Source< Outputs >::Output = IO<Outputs...> |
|
inlinevirtual |
|
noexcept |
Connect this source to a sink.
Can be called multiple times to connect multiple sinks; in that case, the sinks receive data in the same order as they have been connected. This function does basically the same thing as Sink::connect_to_source(), only from the opposite point of view.
dst
the sink that is to be connected\nothrow
Definition at line 48 of file source_impl.h.
|
overridevirtualnoexcept |
Disconnect from all connected sinks.
The source implementation calls disconnect_from_all_sinks().
\nothrow
Reimplemented in fkie_message_filters::Filter< In, Out >, fkie_message_filters::Filter< IO< Inputs... >, IO< Outputs... > >, fkie_message_filters::Filter< IO< Inputs... >, IO< Inputs... >::template Select< Is... > >, and fkie_message_filters::Filter< IO< Inputs... >, IO< Inputs... > >.
Definition at line 63 of file source_impl.h.
|
noexcept |
Disconnect from all connected sinks.
Severs the connection to all sinks, turning the send() method into a no-op.
\nothrow
Definition at line 57 of file source_impl.h.
|
protected |
Pass data to all connected sinks.
out
data\filterthrow
Definition at line 69 of file source_impl.h.
|
staticconstexpr |
|
private |