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

#include <paged_list.hpp>

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

Public Types

using value_type = T
using Signal = detail::ListSignal<T>

Public Member Functions

 PagedList (std::shared_ptr< Source > source, std::size_t initial_page_size, std::size_t initial_page_index=0)
 Construct a PagedList.
 ~PagedList ()
 PagedList (const PagedList &)=delete
PagedListoperator= (const PagedList &)=delete
std::size_t size () const
bool empty () const
std::shared_ptr< T > at (std::size_t derived_pos) const
std::vector< std::shared_ptr< T > > snapshot () const
std::size_t page_count () const
 Number of pages for the current source size + page_size.
bool is_last_page () const
Property< std::size_t > & page_size () noexcept
 Window size in items per page. Set to drive a re-window.
const Property< std::size_t > & page_size () const noexcept
Property< std::size_t > & page_index () noexcept
 0-based page index. Set to drive a re-window.
const Property< std::size_t > & page_index () const noexcept

Member Typedef Documentation

◆ value_type

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

◆ Signal

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

Constructor & Destructor Documentation

◆ PagedList() [1/2]

template<typename T, typename Source = ObservableList<T>>
aria::PagedList< T, Source >::PagedList ( std::shared_ptr< Source > source,
std::size_t initial_page_size,
std::size_t initial_page_index = 0 )
inline

Construct a PagedList.

Both page_index (0-based) and page_size are bound to public Properties; observers can drive the window from any UI element.

◆ ~PagedList()

template<typename T, typename Source = ObservableList<T>>
aria::PagedList< T, Source >::~PagedList ( )
inline

◆ PagedList() [2/2]

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

Member Function Documentation

◆ operator=()

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

◆ size()

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

◆ empty()

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

◆ at()

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

◆ snapshot()

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

◆ page_count()

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

Number of pages for the current source size + page_size.

0-source -> 0 pages.

◆ is_last_page()

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

◆ page_size() [1/2]

template<typename T, typename Source = ObservableList<T>>
Property< std::size_t > & aria::PagedList< T, Source >::page_size ( )
inlinenodiscardnoexcept

Window size in items per page. Set to drive a re-window.

◆ page_size() [2/2]

template<typename T, typename Source = ObservableList<T>>
const Property< std::size_t > & aria::PagedList< T, Source >::page_size ( ) const
inlinenodiscardnoexcept

◆ page_index() [1/2]

template<typename T, typename Source = ObservableList<T>>
Property< std::size_t > & aria::PagedList< T, Source >::page_index ( )
inlinenodiscardnoexcept

0-based page index. Set to drive a re-window.

◆ page_index() [2/2]

template<typename T, typename Source = ObservableList<T>>
const Property< std::size_t > & aria::PagedList< T, Source >::page_index ( ) const
inlinenodiscardnoexcept

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