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::UserSource< Outputs > Class Template Reference

Manually operated data source. More...

#include <fkie_message_filters/user_source.h>

Inheritance diagram for fkie_message_filters::UserSource< Outputs >:
Inheritance graph
[legend]
Collaboration diagram for fkie_message_filters::UserSource< Outputs >:
Collaboration graph
[legend]

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...
 
void operator() (const Outputs &... out)
 Manually inject data and pass it to the connected sinks. More...
 
virtual void reset () noexcept
 Reset filter state. More...
 

Static Public Attributes

static constexpr std::size_t NUM_OUTPUTS
 Number of output arguments.
 

Protected Member Functions

void send (const Outputs &... out)
 Pass data to all connected sinks. More...
 

Detailed Description

template<class... Outputs>
class fkie_message_filters::UserSource< Outputs >

Manually operated data source.

This data source behaves like a function object and can be called to pass data to its sinks. It is mostly useful to connect a filter pipeline to foreign data sources. Even though its technically possible to use a UserSource object as callback for a ROS subscriber, the specialized Subscriber sources have additional functionality and are easier to set up.

Member Typedef Documentation

◆ Output

using fkie_message_filters::Source< Outputs >::Output = IO<Outputs...>
inherited

Grouped output types.

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

Member Function Documentation

◆ connect_to_sink()

Connection fkie_message_filters::Source< Outputs >::connect_to_sink ( Sink< Outputs... > &  dst)
noexceptinherited

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
Returns
a connection object that can be used to monitor or sever the created connection
Exceptions
Does not throw any exceptions.

◆ disconnect()

virtual void fkie_message_filters::Source< Outputs >::disconnect ( )
overridevirtualnoexceptinherited

Disconnect from all connected sinks.

The source implementation calls disconnect_from_all_sinks().

Exceptions
Does not throw any exceptions.

Implements fkie_message_filters::FilterBase.

◆ disconnect_from_all_sinks()

void fkie_message_filters::Source< Outputs >::disconnect_from_all_sinks ( )
noexceptinherited

Disconnect from all connected sinks.

Severs the connection to all sinks, turning the send() method into a no-op.

Exceptions
Does not throw any exceptions.

◆ operator()()

template<class... Outputs>
void fkie_message_filters::UserSource< Outputs >::operator() ( const Outputs &...  out)

Manually inject data and pass it to the connected sinks.

  • out data
Exceptions
Does not throw any exceptions, but will propagate uncaught exceptions from filter callbacks.

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

◆ send()

void fkie_message_filters::Source< Outputs >::send ( const Outputs &...  out)
protectedinherited

Pass data to all connected sinks.

  • out data
Exceptions
Does not throw any exceptions, but will propagate uncaught exceptions from filter callbacks.

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