Base class for combiner policies. More...
#include <policy_base.h>
Public Types | |
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... | |
Public Member Functions | |
virtual | ~PolicyBase () |
Protected Types | |
using | MaybeOutgoingTuples = std::tuple< boost::optional< helpers::io_tuple_t< IOs > >... > |
Tuple of outgoing tuple candidates. More... | |
Protected Member Functions | |
void | emit (const OutgoingTuple &out) |
Emit data. More... | |
virtual void | reset () noexcept=0 |
Reset internal state. More... | |
void | set_emitter_callback (const EmitterCB &) noexcept |
Set output function. More... | |
Private Attributes | |
EmitterCB | emit_ |
Friends | |
template<template< typename... > class, class... > | |
class | fkie_message_filters::Combiner |
Base class for combiner policies.
Definition at line 37 of file policy_base.h.
using fkie_message_filters::combiner_policies::PolicyBase< IOs >::EmitterCB = std::function<void(const OutgoingTuple&)> |
Callback for assembled outputs.
Definition at line 46 of file policy_base.h.
using fkie_message_filters::combiner_policies::PolicyBase< IOs >::IncomingTuples = std::tuple<helpers::io_tuple_t<IOs>...> |
Tuple type of incoming data tuples.
Definition at line 42 of file policy_base.h.
|
protected |
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.
Definition at line 64 of file policy_base.h.
using fkie_message_filters::combiner_policies::PolicyBase< IOs >::OutgoingTuple = helpers::io_tuple_t<helpers::io_concat_t<IOs...> > |
Combined tuple type for data output.
Definition at line 44 of file policy_base.h.
|
inlinevirtual |
Definition at line 47 of file policy_base.h.
|
protected |
Emit data.
This returns combined data back to the Combiner class.
Definition at line 38 of file policy_base_impl.h.
|
protectedpure virtualnoexcept |
Reset internal state.
This function is called by the Combiner if the filter is reset.
Implemented in fkie_message_filters::combiner_policies::ApproximateTime< IOs >, fkie_message_filters::combiner_policies::ExactTime< IOs >, and fkie_message_filters::combiner_policies::Fifo< IOs >.
|
protectednoexcept |
Set output function.
This function is called by the policy whenever it has output ready to be passed on.
Definition at line 32 of file policy_base_impl.h.
|
friend |
Definition at line 40 of file policy_base.h.
|
private |
Definition at line 71 of file policy_base.h.