|
EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
|
Maintains a type-safe multi-observer single-consumer message bus for WorkerResult objects. More...
#include <ResultChannel.hpp>
Public Member Functions | |
| template<class SlotT> | |
| sigc::connection | observe (SlotT &&slot) |
| Provide a new slot as an observer on the channel. | |
| template<class SlotT> requires (!std::is_const_v<ResultT>) | |
| sigc::connection | nominate_consumer (SlotT &&slot) |
| Nominate the consumer slot for the channel. | |
Private Types | |
| using | ObserverSignalT = sigc::signal<void(const ResultT&)> |
| using | ConsumerSignalT = sigc::signal<void(ResultT&&)> |
Private Member Functions | |
| void | publish (ResultT &&result) |
| Publish a consumable result onto the channel for all observers, followed by the single consumer. | |
| void | publish (const ResultT &result) |
| Publish a non-consumable result onto the channel for all observers. | |
Private Attributes | |
| ObserverSignalT | observers |
| ConsumerSignalT | consumer |
Friends | |
| class | WorkerResultDespatcher |
Maintains a type-safe multi-observer single-consumer message bus for WorkerResult objects.
| ResultT | The type of result to broadcast on the channel. In practice, this is the first parameter of the subscribed slots. |
Definition at line 29 of file ResultChannel.hpp.
|
private |
Definition at line 72 of file ResultChannel.hpp.
|
private |
Definition at line 71 of file ResultChannel.hpp.
|
inlinenodiscard |
Nominate the consumer slot for the channel.
| SlotT | The slot type signature, accepting ResultT&&. |
| slot | The slot to consume the result following broadcast to observers. |
| std::runtime_error | The channel already had a nominated consumer. |
Definition at line 58 of file ResultChannel.hpp.
|
inlinenodiscard |
Provide a new slot as an observer on the channel.
| SlotT | The slot type signature, accepting const ResultT&. |
| slot | The slot to add to the subscribers of the channel. |
Definition at line 40 of file ResultChannel.hpp.
|
inlineprivate |
Publish a non-consumable result onto the channel for all observers.
| result | A constant l-value reference to the result to publish on the channel. |
Definition at line 105 of file ResultChannel.hpp.
|
inlineprivate |
Publish a consumable result onto the channel for all observers, followed by the single consumer.
| result | An r-value reference to the result to publish on the channel. |
Definition at line 79 of file ResultChannel.hpp.
|
friend |
Definition at line 69 of file ResultChannel.hpp.
|
private |
Definition at line 113 of file ResultChannel.hpp.
|
private |
Definition at line 112 of file ResultChannel.hpp.