FKIE Message Filters
Improved filters for processing ROS messages
|
Base class for data providers. More...
#include <fkie_message_filters/source.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 void | reset () noexcept |
Reset filter state. More... | |
Static Public Attributes | |
static constexpr std::size_t | NUM_OUTPUTS = sizeof...(Outputs) |
Number of output arguments. | |
Protected Member Functions | |
void | send (const Outputs &... out) |
Pass data to all connected sinks. More... | |
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...> |
Grouped output types.
This type can be used to define sinks with matching types.
|
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
|
overridevirtualnoexcept |
Disconnect from all connected sinks.
The source implementation calls disconnect_from_all_sinks().
Implements fkie_message_filters::FilterBase.
Reimplemented in fkie_message_filters::Combiner< PolicyTmpl, IOs >.
|
noexcept |
Disconnect from all connected sinks.
Severs the connection to all sinks, turning the send() method into a no-op.
|
inlinevirtualnoexceptinherited |
Reset filter state.
For stateful filters, this method resets the internal state as if the filter had just been created. Existing connections to sources and sinks are unaffected.
The default implementation does nothing.
Reimplemented in fkie_message_filters::Buffer< Inputs >, fkie_message_filters::Buffer< Inputs... >, fkie_message_filters::TfFilter< Inputs >, fkie_message_filters::TfFilter< Inputs... >, fkie_message_filters::Combiner< PolicyTmpl, IOs >, fkie_message_filters::Sequencer< Inputs >, and fkie_message_filters::Sequencer< Inputs... >.
|
protected |
Pass data to all connected sinks.
out
data