FKIE Message Filters
Improved filters for processing ROS messages
Public Types | Public Member Functions | Protected Types | Protected Member Functions | List of all members
fkie_message_filters::combiner_policies::Fifo< IOs > Class Template Reference

First-In-First-Out policy. More...

#include <fkie_message_filters/combiner_policies/fifo.h>

Inheritance diagram for fkie_message_filters::combiner_policies::Fifo< IOs >:
Inheritance graph
[legend]
Collaboration diagram for fkie_message_filters::combiner_policies::Fifo< IOs >:
Collaboration graph
[legend]

Public Types

using EmitterCB = std::function< void(const OutgoingTuple &)>
 Callback for assembled outputs.
 
using IncomingTuples = std::tuple< helpers::io_tuple_t< IOs >... >
 Tuple type of incoming data tuples.
 
using OutgoingTuple = helpers::io_tuple_t< helpers::io_concat_t< IOs... > >
 Combined tuple type for data output.
 

Public Member Functions

 Fifo (std::size_t max_queue_size=1)
 Constructor. More...
 

Protected Types

using MaybeOutgoingTuples = std::tuple< boost::optional< helpers::io_tuple_t< IOs > >... >
 Tuple of outgoing tuple candidates. More...
 

Protected Member Functions

template<std::size_t N>
void add (std::unique_lock< std::mutex > &, const std::tuple_element_t< N, IncomingTuples > &)
 Input function. More...
 
void emit (const OutgoingTuple &out)
 Emit data. More...
 
void reset () noexcept override
 Reset internal state. More...
 
void set_emitter_callback (const EmitterCB &) noexcept
 Set output function. More...
 

Detailed Description

template<typename... IOs>
class fkie_message_filters::combiner_policies::Fifo< IOs >

First-In-First-Out policy.

This is a policy for the Combiner class. It will assemble data from the connected sources in a FIFO manner. As soon as at least one input from each source has been received, a combined output is created and passed to the sink. There is no attempt to reorder inputs in any way.

The FIFO policy is sufficient if all corresponding inputs arrive always in order and with the same frequency. The policy has no requirements with regard to the data types it processes.

Member Typedef Documentation

◆ MaybeOutgoingTuples

using fkie_message_filters::combiner_policies::PolicyBase< IOs >::MaybeOutgoingTuples = std::tuple<boost::optional<helpers::io_tuple_t<IOs> >...>
protectedinherited

Tuple of outgoing tuple candidates.

This is basically a tuple of optionals, so elements can remain empty until a suitable data element has been found by the policy.

Constructor & Destructor Documentation

◆ Fifo()

template<typename... IOs>
fkie_message_filters::combiner_policies::Fifo< IOs >::Fifo ( std::size_t  max_queue_size = 1)
explicit

Constructor.

  • max_queue_size maximum queue length for the FIFO queue, per input source
Exceptions
std::invalid_argumentif max_queue_size is zero

Member Function Documentation

◆ add()

template<typename... IOs>
template<std::size_t N>
void fkie_message_filters::combiner_policies::Fifo< IOs >::add ( std::unique_lock< std::mutex > &  ,
const std::tuple_element_t< N, IncomingTuples > &   
)
protected

Input function.

This function will be called by the Combiner class for incoming data.

◆ emit()

void fkie_message_filters::combiner_policies::PolicyBase< IOs >::emit ( const OutgoingTuple out)
protectedinherited

Emit data.

This returns combined data back to the Combiner class.

◆ reset()

template<typename... IOs>
void fkie_message_filters::combiner_policies::Fifo< IOs >::reset ( )
overrideprotectedvirtualnoexcept

Reset internal state.

This function is called by the Combiner if the filter is reset.

Implements fkie_message_filters::combiner_policies::PolicyBase< IOs... >.

◆ set_emitter_callback()

void fkie_message_filters::combiner_policies::PolicyBase< IOs >::set_emitter_callback ( const EmitterCB )
protectednoexceptinherited

Set output function.

This function is called by the policy whenever it has output ready to be passed on.


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