![]() |
CommRaT 2.0.0
C++20 Real-Time Messaging Framework
|
Multi-input processing mixin. More...
#include <commrat/module/io/multi_input_processor.hpp>
Protected Member Functions | |
| template<std::size_t PrimaryIdx> | |
| auto | receive_primary_input () -> MailboxResult< TimsMessage< std::tuple_element_t< PrimaryIdx, InputTypesTuple > > > |
| Receive from primary input mailbox. | |
| template<std::size_t PrimaryIdx, typename PrimaryMsgType > | |
| std::optional< InputTypesTuple > | gather_all_inputs (const PrimaryMsgType &primary_msg) |
| Gather all inputs synchronized to primary timestamp. | |
| template<typename O = OutputData, typename = std::enable_if_t<!std::is_void_v<O>>> | |
| void | call_multi_input_process (const InputTypesTuple &inputs, O &output) |
| Call multi-input process with single output. | |
| void | call_multi_input_multi_output_process (const InputTypesTuple &inputs, OutputTypesTuple &outputs) |
| Call multi-input process with multi-output. | |
Multi-input processing mixin.
Provides helpers for:
| ModuleType | The derived Module class (CRTP) |
| InputTypesTuple | Tuple of input payload types |
| OutputData | Single output type (or void) |
| OutputTypesTuple | Tuple of output types (for multi-output) |
| InputCount | Number of inputs |
Definition at line 34 of file multi_input_processor.hpp.
|
inlineprotected |
Call multi-input process with multi-output.
Unpacks both tuples and calls process(const T1&, ..., O1&, O2&, ...)
| inputs | Tuple of all input payloads |
| outputs | Tuple of output payloads (passed by reference) |
Definition at line 118 of file multi_input_processor.hpp.
|
inlineprotected |
Call multi-input process with single output.
Unpacks InputTypesTuple and calls process(const T1&, const T2&, ..., Output&) SFINAE: Only enabled when OutputData is not void (single output case)
| inputs | Tuple of all input payloads |
| output | Reference to output data to populate |
Definition at line 106 of file multi_input_processor.hpp.
|
inlineprotected |
Gather all inputs synchronized to primary timestamp.
Places primary input at its index, then uses getData to synchronize all secondary inputs to the primary's timestamp.
| PrimaryIdx | Index of primary input |
| PrimaryMsgType | Type of primary TimsMessage |
| primary_msg | Received primary message with timestamp |
Definition at line 71 of file multi_input_processor.hpp.
|
inlineprotected |
Receive from primary input mailbox.
Blocking receive that drives the execution rate of multi-input modules.
| PrimaryIdx | Index of primary input in InputTypesTuple |
Definition at line 45 of file multi_input_processor.hpp.
References commrat::NotInitialized.