|
| | ObservableList ()=default |
| | ObservableList (const ObservableList &)=delete |
| ObservableList & | operator= (const ObservableList &)=delete |
| | ObservableList (ObservableList &&)=delete |
| ObservableList & | operator= (ObservableList &&)=delete |
| std::size_t | size () const |
| bool | empty () const |
| std::shared_ptr< T > | at (std::size_t index) const |
| std::vector< std::shared_ptr< T > > | snapshot () const |
| SnapshotRange | items () const |
| | Return a thread-safe, std::ranges-compatible snapshot range over the element handles.
|
| void | push_back (std::shared_ptr< T > item) |
| template<typename... Args> |
| std::shared_ptr< T > | emplace_back (Args &&... args) |
| void | insert (std::size_t index, std::shared_ptr< T > item) |
| template<typename InputIt> |
| void | insert_range (std::size_t index, InputIt first, InputIt last) |
| | One O(n + k) insertion and k owning Insert events, in forward order.
|
| void | remove_at (std::size_t index) |
| void | remove_range (std::size_t index, std::size_t count) |
| | Removes in forward event order, each at the same replay pivot.
|
| template<std::predicate< const T & > Pred> |
| bool | remove_first (Pred &&predicate) |
| template<std::predicate< const T & > Pred> |
| std::size_t | remove_all (Pred &&predicate) |
| void | replace_at (std::size_t index, std::shared_ptr< T > item) |
| void | move (std::size_t from, std::size_t to) |
| void | clear () |
| template<typename KeyFn = AddressIdentity> |
| std::size_t | reconcile (std::vector< std::shared_ptr< T > > next, KeyFn key_of={}) |
| | Reconcile by unique key.
|
| std::size_t | index_of (const T *item) const |
| bool | contains (const T *item) const |
template<typename T>
class aria::ObservableList< T >
Observable sequence of owning element handles.
Readers take a shared lock; writers serialize mutation and event publication with a separate recursive lock. Callbacks execute without the structural lock. Event payloads own the affected objects and are replayed in order even when the source has already committed the final state of a batch (see ListChange).
Reentrant writes commit immediately, then notify after the current complete event/batch fan-out. Shared backing state keeps an in-flight operation safe if an observer destroys the ObservableList itself.
Repeated handles are separate sequence occurrences. index_of returns the last occurrence; one item subscription emits ItemChanged for each current occurrence. Unique-item lookup and append are amortized O(1); middle edits shift a contiguous vector. Range edits shift/compact once, in O(n + k).