JSON output thread owner. Non-copyable, non-movable.
More...
#include <signal_consumer.hpp>
|
| static constexpr std::size_t | RING_SIZE = 65536 |
| |
| static constexpr std::size_t | FLUSH_INTERVAL = 100 |
| | Flush every N signals.
|
| |
JSON output thread owner. Non-copyable, non-movable.
consumer.start();
consumer.stop();
Lock-free single-producer / single-consumer ring buffer.
JSON output thread owner. Non-copyable, non-movable.
Definition at line 66 of file signal_consumer.hpp.
◆ Ring
◆ SignalConsumer() [1/3]
| srfm::stream::SignalConsumer::SignalConsumer |
( |
Ring & |
ring, |
|
|
FILE * |
sink = stdout |
|
) |
| |
|
inlineexplicitnoexcept |
Construct bound to the output ring and an I/O sink.
- Parameters
-
| ring | Ring populated by SignalProcessor (non-owning ref). |
| sink | Output stream (default: stdout). Must remain valid for the lifetime of this SignalConsumer. |
Definition at line 80 of file signal_consumer.hpp.
◆ ~SignalConsumer()
| srfm::stream::SignalConsumer::~SignalConsumer |
( |
| ) |
|
|
inlinenoexcept |
◆ SignalConsumer() [2/3]
| srfm::stream::SignalConsumer::SignalConsumer |
( |
const SignalConsumer & |
| ) |
|
|
delete |
◆ SignalConsumer() [3/3]
◆ counters()
◆ flush()
| void srfm::stream::SignalConsumer::flush |
( |
| ) |
|
|
inlinenoexcept |
Flush the output sink.
Calls std::fflush(sink_). noexcept.
Definition at line 120 of file signal_consumer.hpp.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ running()
| bool srfm::stream::SignalConsumer::running |
( |
| ) |
const |
|
inlinenoexcept |
◆ sink()
| FILE * srfm::stream::SignalConsumer::sink |
( |
| ) |
const |
|
inlinenoexcept |
◆ start()
| void srfm::stream::SignalConsumer::start |
( |
| ) |
|
|
noexcept |
◆ stop()
| void srfm::stream::SignalConsumer::stop |
( |
| ) |
|
|
noexcept |
Stop the consumer thread and perform a final flush. Idempotent.
Definition at line 48 of file signal_consumer.cpp.
◆ write_one()
Serialise one signal to the sink immediately.
Does not flush. Useful in unit tests.
- Parameters
-
Definition at line 58 of file signal_consumer.cpp.
◆ FLUSH_INTERVAL
| constexpr std::size_t srfm::stream::SignalConsumer::FLUSH_INTERVAL = 100 |
|
staticconstexpr |
◆ RING_SIZE
| constexpr std::size_t srfm::stream::SignalConsumer::RING_SIZE = 65536 |
|
staticconstexpr |
The documentation for this class was generated from the following files: