ZenitUI
Retained-mode C++20 UI framework
Loading...
Searching...
No Matches
ZenitUI::Bindable< T >::Subscription Class Reference

RAII handle to an onChanged registration. More...

#include <Bindable.hpp>

Public Member Functions

 Subscription (Subscription &&o) noexcept
Subscription & operator= (Subscription &&o) noexcept
 Subscription (const Subscription &)=delete
Subscription & operator= (const Subscription &)=delete
void unsubscribe ()
 Remove the callback from the owning Bindable.
bool active () const
 true while the underlying callback is still registered.

Friends

class Bindable

Detailed Description

template<typename T>
class ZenitUI::Bindable< T >::Subscription

RAII handle to an onChanged registration.

Move-only. Destruction (or explicit unsubscribe) removes the callback from the owning Bindable. Safe to destroy after the Bindable has already been destroyed: the shared ControlBlock outlives both.

Member Function Documentation

◆ unsubscribe()

template<typename T>
void ZenitUI::Bindable< T >::Subscription::unsubscribe ( )
inline

Remove the callback from the owning Bindable.

Idempotent.


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