FKIE Message Filters
Improved filters for processing ROS messages
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
fkie_message_filters::Sink< Inputs > Class Template Referenceabstract

Base class for data consumers. More...

#include <fkie_message_filters/sink.h>

Inheritance diagram for fkie_message_filters::Sink< Inputs >:
Inheritance graph
[legend]
Collaboration diagram for fkie_message_filters::Sink< Inputs >:
Collaboration graph
[legend]

Public Types

using Input = IO< Inputs... >
 Grouped input types. More...
 

Public Member Functions

Connection connect_to_source (Source< Inputs... > &src) noexcept
 Connect this sink to a source. More...
 
virtual void disconnect () noexcept override
 Disconnect from all connected sources. More...
 
void disconnect_from_all_sources () noexcept
 Disconnect from all connected sources. More...
 
virtual void reset () noexcept
 Reset filter state. More...
 

Static Public Attributes

static constexpr std::size_t NUM_INPUTS = sizeof...(Inputs)
 Number of input arguments.
 

Protected Member Functions

virtual void receive (const Inputs &... in)=0
 Process incoming data. More...
 

Detailed Description

template<typename... Inputs>
class fkie_message_filters::Sink< Inputs >

Base class for data consumers.

In the message filter library, all data flows from sources to sinks. The sinks are data consumers, which process all data they receive from a source.

Derived classes must override the receive() method to actually process data. The receive() method takes the same number and types of arguments as specified in the template instantiation.

See also
Source

Member Typedef Documentation

◆ Input

template<typename... Inputs>
using fkie_message_filters::Sink< Inputs >::Input = IO<Inputs...>

Grouped input types.

This type can be used to define sources with matching types.

Member Function Documentation

◆ connect_to_source()

template<typename... Inputs>
Connection fkie_message_filters::Sink< Inputs >::connect_to_source ( Source< Inputs... > &  src)
noexcept

Connect this sink to a source.

Can be called multiple times to connect multiple sources; in that case, the sink receives data from all connected sources. This function does basically the same thing as Source::connect_to_sink(), only from the opposite point of view.

  • src the source that is to be connected
Returns
a connection object that can be used to monitor or sever the created connection
Exceptions
Does not throw any exceptions.

◆ disconnect()

template<typename... Inputs>
virtual void fkie_message_filters::Sink< Inputs >::disconnect ( )
overridevirtualnoexcept

Disconnect from all connected sources.

The sink implementation calls disconnect_from_all_sources().

Exceptions
Does not throw any exceptions.

Implements fkie_message_filters::FilterBase.

Reimplemented in fkie_message_filters::Divider< Inputs >, and fkie_message_filters::Divider< Inputs... >.

◆ disconnect_from_all_sources()

template<typename... Inputs>
void fkie_message_filters::Sink< Inputs >::disconnect_from_all_sources ( )
noexcept

Disconnect from all connected sources.

Severs the connection to all sources. The receive() method will not be called any more.

Exceptions
Does not throw any exceptions.

◆ receive()

template<typename... Inputs>
virtual void fkie_message_filters::Sink< Inputs >::receive ( const Inputs &...  in)
protectedpure virtual

◆ reset()

virtual void fkie_message_filters::FilterBase::reset ( )
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.

Exceptions
Does not throw any exceptions.

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... >.


The documentation for this class was generated from the following file: