|
Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
|
Type-erased multi-cast signal. More...
#include <signal.hpp>
Public Member Functions | |
| SignalErased () | |
| ~SignalErased () | |
| SignalErased (const SignalErased &)=delete | |
| SignalErased & | operator= (const SignalErased &)=delete |
| SignalErased (SignalErased &&) noexcept | |
| SignalErased & | operator= (SignalErased &&) noexcept |
| SlotId | connect (SlotErased slot) |
| Add a slot. Returns its id (used for disconnection). | |
| void | disconnect (SlotId id) noexcept |
| Disconnect by id. | |
| void | emit (void *args) const |
| Emit to all slots. | |
| std::size_t | slot_count () const noexcept |
| Number of currently connected slots. | |
| void | clear () noexcept |
| Drop all slots, releasing captures outside the signal lock. | |
| std::weak_ptr< ControlBlock > | weak_handle () const noexcept |
Static Public Member Functions | |
| static void | disconnect_via_weak (const std::weak_ptr< ControlBlock > &weak, SlotId id) noexcept |
| Disconnect a slot via a weak handle to the signal's control block — used by Subscription's RAII deleter so unsubscribing after the signal itself has been destroyed is a safe no-op. | |
Type-erased multi-cast signal.
Thread-safe.
Stored as a control block reachable via shared_ptr — Subscriptions hold a weak_ptr to it, so unsubscribing after the signal is destroyed is a no-op rather than a crash.
| aria::abi::SignalErased::SignalErased | ( | ) |
| aria::abi::SignalErased::~SignalErased | ( | ) |
|
delete |
|
noexcept |
|
delete |
|
noexcept |
| SlotId aria::abi::SignalErased::connect | ( | SlotErased | slot | ) |
Add a slot. Returns its id (used for disconnection).
|
noexcept |
Disconnect by id.
Later callbacks in an active emission are skipped. A callback already executing on another thread may finish.
| void aria::abi::SignalErased::emit | ( | void * | args | ) | const |
Emit to all slots.
The args pointer is passed to each slot's invoker. Slots are snapshotted under lock; emission happens outside the lock.
|
nodiscardnoexcept |
Number of currently connected slots.
|
noexcept |
Drop all slots, releasing captures outside the signal lock.
|
nodiscardnoexcept |
|
staticnoexcept |
Disconnect a slot via a weak handle to the signal's control block — used by Subscription's RAII deleter so unsubscribing after the signal itself has been destroyed is a safe no-op.