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

#include <mapped_list.hpp>

Inheritance diagram for aria::MappedList< Source, Target, SourceList >:
[legend]

Public Types

using value_type = Target
 Element type of the derived list — i.e.
using Mapper = aria::inplace_function<std::shared_ptr<Target>(const Source&), 32>
 Owning, heap-free mapper handle (capacity 32 bytes).
using Signal = detail::ListSignal<Target>

Public Member Functions

 MappedList (std::shared_ptr< SourceList > source, Mapper mapper, bool remap_on_change=false)
 Construct a MappedList.
 ~MappedList ()=default
 MappedList (const MappedList &)=delete
MappedListoperator= (const MappedList &)=delete
std::size_t size () const
bool empty () const
std::shared_ptr< Target > at (std::size_t idx) const
std::vector< std::shared_ptr< Target > > snapshot () const

Member Typedef Documentation

◆ value_type

template<typename Source, typename Target, typename SourceList = ObservableList<Source>>
using aria::MappedList< Source, Target, SourceList >::value_type = Target

Element type of the derived list — i.e.

Target. This is what adapter / ListSource consumers care about.

◆ Mapper

template<typename Source, typename Target, typename SourceList = ObservableList<Source>>
using aria::MappedList< Source, Target, SourceList >::Mapper = aria::inplace_function<std::shared_ptr<Target>(const Source&), 32>

Owning, heap-free mapper handle (capacity 32 bytes).

◆ Signal

template<typename Source, typename Target, typename SourceList = ObservableList<Source>>
using aria::MappedList< Source, Target, SourceList >::Signal = detail::ListSignal<Target>

Constructor & Destructor Documentation

◆ MappedList() [1/2]

template<typename Source, typename Target, typename SourceList = ObservableList<Source>>
aria::MappedList< Source, Target, SourceList >::MappedList ( std::shared_ptr< SourceList > source,
Mapper mapper,
bool remap_on_change = false )
inline

Construct a MappedList.

Parameters
sourcethe upstream list to project from
mapperTarget(const Source&) — called once per source item on Insert / Replace / Reset (and also on ItemChanged when remap_on_change is true)
remap_on_changeif true, ItemChanged invalidates the slot and re-invokes the mapper; if false (default), ItemChanged propagates as ItemChanged on the existing Target and the Target identity is preserved

◆ ~MappedList()

template<typename Source, typename Target, typename SourceList = ObservableList<Source>>
aria::MappedList< Source, Target, SourceList >::~MappedList ( )
default

◆ MappedList() [2/2]

template<typename Source, typename Target, typename SourceList = ObservableList<Source>>
aria::MappedList< Source, Target, SourceList >::MappedList ( const MappedList< Source, Target, SourceList > & )
delete

Member Function Documentation

◆ operator=()

template<typename Source, typename Target, typename SourceList = ObservableList<Source>>
MappedList & aria::MappedList< Source, Target, SourceList >::operator= ( const MappedList< Source, Target, SourceList > & )
delete

◆ size()

template<typename Source, typename Target, typename SourceList = ObservableList<Source>>
std::size_t aria::MappedList< Source, Target, SourceList >::size ( ) const
inlinenodiscard

◆ empty()

template<typename Source, typename Target, typename SourceList = ObservableList<Source>>
bool aria::MappedList< Source, Target, SourceList >::empty ( ) const
inlinenodiscard

◆ at()

template<typename Source, typename Target, typename SourceList = ObservableList<Source>>
std::shared_ptr< Target > aria::MappedList< Source, Target, SourceList >::at ( std::size_t idx) const
inlinenodiscard

◆ snapshot()

template<typename Source, typename Target, typename SourceList = ObservableList<Source>>
std::vector< std::shared_ptr< Target > > aria::MappedList< Source, Target, SourceList >::snapshot ( ) const
inlinenodiscard

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