Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
fkie_message_filters::combiner_policies::Fifo< IOs > Class Template Reference

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

#include <fifo.h>

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

Public Member Functions

 Fifo (std::size_t max_queue_size=1)
 Constructor. More...
 
- Public Member Functions inherited from fkie_message_filters::combiner_policies::PolicyBase< IOs... >
virtual ~PolicyBase ()
 

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 reset () noexcept override
 Reset internal state. More...
 
- Protected Member Functions inherited from fkie_message_filters::combiner_policies::PolicyBase< IOs... >
void emit (const OutgoingTuple &out)
 Emit data. More...
 
void set_emitter_callback (const EmitterCB &) noexcept
 Set output function. More...
 

Private Types

using IncomingQueues = std::tuple< boost::circular_buffer< helpers::io_tuple_t< IOs > >... >
 

Private Member Functions

MaybeOutgoingTuples assemble_output () noexcept
 
bool has_complete_tuple () noexcept
 

Private Attributes

IncomingQueues in_
 

Friends

template<template< typename... > class, class... >
class fkie_message_filters::Combiner
 

Additional Inherited Members

- Public Types inherited from fkie_message_filters::combiner_policies::PolicyBase< IOs... >
using EmitterCB = std::function< void(const OutgoingTuple &)>
 Callback for assembled outputs. More...
 
using IncomingTuples = std::tuple< helpers::io_tuple_t< IOs >... >
 Tuple type of incoming data tuples. More...
 
using OutgoingTuple = helpers::io_tuple_t< helpers::io_concat_t< IOs... > >
 Combined tuple type for data output. More...
 
- Protected Types inherited from fkie_message_filters::combiner_policies::PolicyBase< IOs... >
using MaybeOutgoingTuples = std::tuple< boost::optional< helpers::io_tuple_t< IOs > >... >
 Tuple of outgoing tuple candidates. 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.

Definition at line 43 of file fifo.h.

Member Typedef Documentation

◆ IncomingQueues

template<typename... IOs>
using fkie_message_filters::combiner_policies::Fifo< IOs >::IncomingQueues = std::tuple<boost::circular_buffer<helpers::io_tuple_t<IOs> >...>
private

Definition at line 67 of file fifo.h.

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

Definition at line 34 of file fifo_impl.h.

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 > &  lock,
const std::tuple_element_t< N, IncomingTuples > &  item 
)
protected

Input function.

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

Definition at line 47 of file fifo_impl.h.

◆ assemble_output()

template<typename... IOs>
Fifo< IOs... >::MaybeOutgoingTuples fkie_message_filters::combiner_policies::Fifo< IOs >::assemble_output ( )
privatenoexcept

Definition at line 78 of file fifo_impl.h.

◆ has_complete_tuple()

template<typename... IOs>
bool fkie_message_filters::combiner_policies::Fifo< IOs >::has_complete_tuple ( )
privatenoexcept

Definition at line 64 of file fifo_impl.h.

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

Definition at line 92 of file fifo_impl.h.

Friends And Related Function Documentation

◆ fkie_message_filters::Combiner

template<typename... IOs>
template<template< typename... > class, class... >
friend class fkie_message_filters::Combiner
friend

Definition at line 46 of file fifo.h.

Member Data Documentation

◆ in_

template<typename... IOs>
IncomingQueues fkie_message_filters::combiner_policies::Fifo< IOs >::in_
private

Definition at line 70 of file fifo.h.


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


fkie_message_filters
Author(s): Timo Röhling
autogenerated on Mon Feb 28 2022 22:21:44