RAII handle to a single subscription.
More...
#include <subscription.hpp>
RAII handle to a single subscription.
Dropping it (or calling release()) severs the underlying connection. Move-only.
◆ Subscription() [1/6]
| aria::Subscription::Subscription |
( |
| ) |
|
|
defaultnoexcept |
◆ Subscription() [2/6]
template<class T>
| aria::Subscription::Subscription |
( |
std::shared_ptr< T > | owner | ) |
|
|
inlineexplicitnoexcept |
Construct from any shared pointer.
The common case: pass a std::shared_ptr<ReactionNode> returned from the reactive layer; its destructor detaches from the graph.
◆ Subscription() [3/6]
template<class Fn>
requires std::invocable<std::decay_t<Fn>&>
| aria::Subscription::Subscription |
( |
Fn && | on_disconnect | ) |
|
|
inlineexplicit |
Invoke a disconnect callback exactly once when this handle is released.
Captures are stored directly in the shared allocation, including move-only captures; there is no intermediate std::function allocation.
◆ Subscription() [4/6]
| aria::Subscription::Subscription |
( |
std::function< void()> | on_disconnect | ) |
|
|
inlineexplicit |
◆ Subscription() [5/6]
| aria::Subscription::Subscription |
( |
const Subscription & | | ) |
|
|
delete |
◆ Subscription() [6/6]
| aria::Subscription::Subscription |
( |
Subscription && | | ) |
|
|
defaultnoexcept |
◆ ~Subscription()
| aria::Subscription::~Subscription |
( |
| ) |
|
|
defaultnoexcept |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ release()
| void aria::Subscription::release |
( |
| ) |
|
|
inlinenoexcept |
Explicitly disconnect now (instead of at destruction).
◆ active()
| bool aria::Subscription::active |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ operator bool()
| aria::Subscription::operator bool |
( |
| ) |
const |
|
inlineexplicitnoexcept |
The documentation for this class was generated from the following file: