CommRaT 2.0.0
C++20 Real-Time Messaging Framework
Loading...
Searching...
No Matches
commrat::Output< T > Struct Template Reference

Single output specification. More...

#include <commrat/module/io_spec.hpp>

Public Types

using PayloadType = T
 

Static Public Attributes

static constexpr size_t count = 1
 

Detailed Description

template<typename T>
struct commrat::Output< T >

Single output specification.

Specifies that a module produces exactly one output type. Used with PeriodicInput, LoopInput, or Input<T> to define module behavior.

Template Parameters
TThe payload type to be published

Process Signature:

  • With PeriodicInput: void process(T& output)
  • With Input: void process(const U& input, T& output)
  • With Inputs<U, V>: void process(const U& in1, const V& in2, T& output)

// Periodic sensor reading
class SensorModule : public Module<Registry, Output<TempData>, PeriodicInput> {
protected:
void process(TempData& output) override {
output.temperature = read_sensor();
}
};
// Event-driven filtering
class FilterModule : public Module<Registry, Output<Filtered>, Input<Raw>> {
protected:
void process(const Raw& input, Filtered& output) override {
output.value = apply_filter(input.value);
}
};
Timestamp Management Architecture.

See also
Outputs for multiple output types
PeriodicInput, Input, Inputs for input specifications

Definition at line 68 of file io_spec.hpp.

Member Typedef Documentation

◆ PayloadType

template<typename T >
using commrat::Output< T >::PayloadType = T

Definition at line 69 of file io_spec.hpp.

Member Data Documentation

◆ count

template<typename T >
constexpr size_t commrat::Output< T >::count = 1
staticconstexpr

Definition at line 70 of file io_spec.hpp.


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