|
Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
|
#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 | |
| JniListSource & | operator= (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. | |
| using aria::adapters::jni::JniListSource< T >::NotifySink = std::function<void(const RecyclerNotification&)> |
|
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.
|
inline |
|
delete |
|
delete |
|
inlinenodiscard |
|
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.
|
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.