Aria 3.2.6
C++23 MVVM framework — reactive, coroutine-first, ABI-layered
Loading...
Searching...
No Matches
aria::SortedList< T, Source > Class Template Reference

#include <sorted_list.hpp>

Inheritance diagram for aria::SortedList< T, Source >:
[legend]

Public Types

using value_type = T
using Comparator = aria::inplace_function<bool(const T&, const T&), 32>
 Strict weak ordering on items.
using Signal = detail::ListSignal<T>

Public Member Functions

 SortedList (std::shared_ptr< Source > source, Comparator comparator)
template<typename Fn>
requires (!std::is_same_v<std::decay_t<Fn>, Comparator> && !std::is_pointer_v<std::decay_t<Fn>> && std::is_copy_constructible_v
<std::decay_t<Fn>> && std::is_invocable_r_v<bool, std::decay_t<Fn>&, const T&, const T&>)
 SortedList (std::shared_ptr< Source > source, Fn &&comparator)
 ~SortedList ()=default
 SortedList (const SortedList &)=delete
SortedList & operator= (const SortedList &)=delete
std::size_t size () const
bool empty () const
std::shared_ptr< T > at (std::size_t derived_index) const
std::vector< std::shared_ptr< T > > snapshot () const
std::optional< std::size_t > source_index_of (std::size_t derived_index) const
void set_comparator (Comparator new_comparator)
template<typename Fn>
requires (!std::is_same_v<std::decay_t<Fn>, Comparator> && !std::is_pointer_v<std::decay_t<Fn>> && std::is_copy_constructible_v
<std::decay_t<Fn>> && std::is_invocable_r_v<bool, std::decay_t<Fn>&, const T&, const T&>)
void set_comparator (Fn &&comparator)

Member Typedef Documentation

◆ value_type

template<typename T, typename Source = ObservableList<T>>
using aria::SortedList< T, Source >::value_type = T

◆ Comparator

template<typename T, typename Source = ObservableList<T>>
using aria::SortedList< T, Source >::Comparator = aria::inplace_function<bool(const T&, const T&), 32>

Strict weak ordering on items.

Must be stable across calls for the lifetime of the SortedList (or until set_comparator). Owning, heap-free comparator handle (capacity 32 bytes). Concrete callable overloads retain its target type for whole-scan inlining; the view still owns one comparator instance in one shared allocation.

◆ Signal

template<typename T, typename Source = ObservableList<T>>
using aria::SortedList< T, Source >::Signal = detail::ListSignal<T>

Constructor & Destructor Documentation

◆ SortedList() [1/3]

template<typename T, typename Source = ObservableList<T>>
aria::SortedList< T, Source >::SortedList ( std::shared_ptr< Source > source,
Comparator comparator )
inline

◆ SortedList() [2/3]

template<typename T, typename Source = ObservableList<T>>
template<typename Fn>
requires (!std::is_same_v<std::decay_t<Fn>, Comparator> && !std::is_pointer_v<std::decay_t<Fn>> && std::is_copy_constructible_v
<std::decay_t<Fn>> && std::is_invocable_r_v<bool, std::decay_t<Fn>&, const T&, const T&>)
aria::SortedList< T, Source >::SortedList ( std::shared_ptr< Source > source,
Fn && comparator )
inline

◆ ~SortedList()

template<typename T, typename Source = ObservableList<T>>
aria::SortedList< T, Source >::~SortedList ( )
default

◆ SortedList() [3/3]

template<typename T, typename Source = ObservableList<T>>
aria::SortedList< T, Source >::SortedList ( const SortedList< T, Source > & )
delete

Member Function Documentation

◆ operator=()

template<typename T, typename Source = ObservableList<T>>
SortedList & aria::SortedList< T, Source >::operator= ( const SortedList< T, Source > & )
delete

◆ size()

template<typename T, typename Source = ObservableList<T>>
std::size_t aria::SortedList< T, Source >::size ( ) const
inlinenodiscard

◆ empty()

template<typename T, typename Source = ObservableList<T>>
bool aria::SortedList< T, Source >::empty ( ) const
inlinenodiscard

◆ at()

template<typename T, typename Source = ObservableList<T>>
std::shared_ptr< T > aria::SortedList< T, Source >::at ( std::size_t derived_index) const
inlinenodiscard

◆ snapshot()

template<typename T, typename Source = ObservableList<T>>
std::vector< std::shared_ptr< T > > aria::SortedList< T, Source >::snapshot ( ) const
inlinenodiscard

◆ source_index_of()

template<typename T, typename Source = ObservableList<T>>
std::optional< std::size_t > aria::SortedList< T, Source >::source_index_of ( std::size_t derived_index) const
inlinenodiscard

◆ set_comparator() [1/2]

template<typename T, typename Source = ObservableList<T>>
void aria::SortedList< T, Source >::set_comparator ( Comparator new_comparator)
inline

◆ set_comparator() [2/2]

template<typename T, typename Source = ObservableList<T>>
template<typename Fn>
requires (!std::is_same_v<std::decay_t<Fn>, Comparator> && !std::is_pointer_v<std::decay_t<Fn>> && std::is_copy_constructible_v
<std::decay_t<Fn>> && std::is_invocable_r_v<bool, std::decay_t<Fn>&, const T&, const T&>)
void aria::SortedList< T, Source >::set_comparator ( Fn && comparator)
inline

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