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

#include <JniListSource.hpp>

Public Types

using NotifySink = std::function<void(const RecyclerNotification&)>

Public Member Functions

template<class L>
requires ::aria::ListSourceOf< L, T > JniListSource (L &source, NotifySink sink, std::shared_ptr< runtime::IDispatcher > dispatcher={})
 Construct on the source's graph thread.
 ~JniListSource ()
 JniListSource (const JniListSource &)=delete
JniListSourceoperator= (const JniListSource &)=delete
std::size_t item_count () const
std::shared_ptr< T > at (std::size_t position) const
 Out-of-range reads return nullptr.
void reload ()
 Ask a reattached RecyclerView to redisplay the current event mirror.

Member Typedef Documentation

◆ NotifySink

template<typename T>
using aria::adapters::jni::JniListSource< T >::NotifySink = std::function<void(const RecyclerNotification&)>

Constructor & Destructor Documentation

◆ JniListSource() [1/2]

template<typename T>
template<class L>
requires ::aria::ListSourceOf< L, T > aria::adapters::jni::JniListSource< T >::JniListSource ( L & source,
NotifySink sink,
std::shared_ptr< runtime::IDispatcher > dispatcher = {} )
inline

Construct on the source's graph thread.

The initial snapshot is ready before any notification. With no dispatcher, source events must already arrive on the RecyclerView owner thread. With a dispatcher, mirror edits and sink calls are posted together when that thread differs.

The source can be destroyed first: its owning events and the initial snapshot are sufficient for all subsequent mirror operations. A queued callback cannot reach a destroyed bridge. Sink exceptions are reported through the callback failure sink and do not escape the native boundary.

◆ ~JniListSource()

template<typename T>
aria::adapters::jni::JniListSource< T >::~JniListSource ( )
inline

◆ JniListSource() [2/2]

template<typename T>
aria::adapters::jni::JniListSource< T >::JniListSource ( const JniListSource< T > & )
delete

Member Function Documentation

◆ operator=()

template<typename T>
JniListSource & aria::adapters::jni::JniListSource< T >::operator= ( const JniListSource< T > & )
delete

◆ item_count()

template<typename T>
std::size_t aria::adapters::jni::JniListSource< T >::item_count ( ) const
inlinenodiscard

◆ at()

template<typename T>
std::shared_ptr< T > aria::adapters::jni::JniListSource< T >::at ( std::size_t position) const
inlinenodiscard

Out-of-range reads return nullptr.

Rows are owning shared pointers; callers must still obey T's own rules when reading mutable item fields.

◆ reload()

template<typename T>
void aria::adapters::jni::JniListSource< T >::reload ( )
inline

Ask a reattached RecyclerView to redisplay the current event mirror.

Queued changes are applied before this notification; no source reread can accidentally apply future changes before their own notifications.


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