Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
Loading...
Searching...
No Matches
aria::Selection< T > Class Template Reference

#include <selection.hpp>

Public Types

using value_type = T
using handle = std::shared_ptr<T>

Public Member Functions

 Selection ()=default
 ~Selection ()
 Selection (const Selection &)=delete
Selectionoperator= (const Selection &)=delete
 Selection (Selection &&)=delete
Selectionoperator= (Selection &&)=delete
reactive::Property< handle > & selected () noexcept
 Reactive selected handle (null when nothing is selected).
const reactive::Property< handle > & selected () const noexcept
handle value () const
 Current selected element (may be null).
bool has_value () const
void select (handle item)
 Select item (null clears).
void clear ()
 Clear the selection.
bool is_selected (const handle &item) const
 True iff item is the current selection (by shared_ptr identity).
void bind_to (ObservableList< T > &source)
 Follow source membership by replaying its owning events.
void unbind () noexcept
 Detach from the bound source list (idempotent).

Member Typedef Documentation

◆ value_type

template<typename T>
using aria::Selection< T >::value_type = T

◆ handle

template<typename T>
using aria::Selection< T >::handle = std::shared_ptr<T>

Constructor & Destructor Documentation

◆ Selection() [1/3]

template<typename T>
aria::Selection< T >::Selection ( )
default

◆ ~Selection()

template<typename T>
aria::Selection< T >::~Selection ( )
inline

◆ Selection() [2/3]

template<typename T>
aria::Selection< T >::Selection ( const Selection< T > & )
delete

◆ Selection() [3/3]

template<typename T>
aria::Selection< T >::Selection ( Selection< T > && )
delete

Member Function Documentation

◆ operator=() [1/2]

template<typename T>
Selection & aria::Selection< T >::operator= ( const Selection< T > & )
delete

◆ operator=() [2/2]

template<typename T>
Selection & aria::Selection< T >::operator= ( Selection< T > && )
delete

◆ selected() [1/2]

template<typename T>
reactive::Property< handle > & aria::Selection< T >::selected ( )
inlinenodiscardnoexcept

Reactive selected handle (null when nothing is selected).

◆ selected() [2/2]

template<typename T>
const reactive::Property< handle > & aria::Selection< T >::selected ( ) const
inlinenodiscardnoexcept

◆ value()

template<typename T>
handle aria::Selection< T >::value ( ) const
inlinenodiscard

Current selected element (may be null).

◆ has_value()

template<typename T>
bool aria::Selection< T >::has_value ( ) const
inlinenodiscard

◆ select()

template<typename T>
void aria::Selection< T >::select ( handle item)
inline

Select item (null clears).

No-op if already selected (equality gate on the shared_ptr identity).

◆ clear()

template<typename T>
void aria::Selection< T >::clear ( )
inline

Clear the selection.

◆ is_selected()

template<typename T>
bool aria::Selection< T >::is_selected ( const handle & item) const
inlinenodiscard

True iff item is the current selection (by shared_ptr identity).

◆ bind_to()

template<typename T>
void aria::Selection< T >::bind_to ( ObservableList< T > & source)
inline

Follow source membership by replaying its owning events.

A removed or replaced selection clears only when no occurrence remains. Reset preserves handles present in its snapshot. The binding may outlive the source; cached handles remain valid until explicitly cleared/unbound. Bind on the source writer thread or while its writer is quiescent.

◆ unbind()

template<typename T>
void aria::Selection< T >::unbind ( )
inlinenoexcept

Detach from the bound source list (idempotent).


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