Aria
2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
Toggle main menu visibility
Loading...
Searching...
No Matches
list_change.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstddef>
4
#include <memory>
5
#include <utility>
6
#include <vector>
7
8
namespace
aria
{
9
10
enum class
ListChangeKind
{
Insert
,
Remove
,
Replace
, ItemChanged,
Reset
,
Move
};
11
15
template
<
typename
T>
16
struct
ListChange
{
17
using
Snapshot
= std::vector<std::shared_ptr<T>>;
18
ListChangeKind
kind
;
19
std::size_t
index
= 0;
20
std::shared_ptr<T>
item
;
21
std::size_t
from_index
= 0;
22
std::shared_ptr<const Snapshot>
snapshot
=
nullptr
;
23
24
static
ListChange
reset
(
Snapshot
items) {
25
return
{
ListChangeKind::Reset
, 0, {}, 0,
26
std::make_shared<const Snapshot>(std::move(items))};
27
}
28
29
static
ListChange
cleared
() {
30
static
const
auto
empty = std::make_shared<const Snapshot>();
31
return
{
ListChangeKind::Reset
, 0, {}, 0, empty};
32
}
33
};
34
35
}
// namespace aria
aria
Definition
signal.hpp:12
aria::ListChangeKind
ListChangeKind
Definition
list_change.hpp:10
aria::ListChangeKind::Replace
@ Replace
Definition
list_change.hpp:10
aria::ListChangeKind::Remove
@ Remove
Definition
list_change.hpp:10
aria::ListChangeKind::Reset
@ Reset
Definition
list_change.hpp:10
aria::ListChangeKind::Move
@ Move
Definition
list_change.hpp:10
aria::ListChangeKind::Insert
@ Insert
Definition
list_change.hpp:10
aria::ListChange
An owning event in a sequential list edit stream.
Definition
list_change.hpp:16
aria::ListChange::index
std::size_t index
Definition
list_change.hpp:19
aria::ListChange::reset
static ListChange reset(Snapshot items)
Definition
list_change.hpp:24
aria::ListChange::cleared
static ListChange cleared()
Definition
list_change.hpp:29
aria::ListChange::item
std::shared_ptr< T > item
Definition
list_change.hpp:20
aria::ListChange::snapshot
std::shared_ptr< const Snapshot > snapshot
Definition
list_change.hpp:22
aria::ListChange::from_index
std::size_t from_index
Definition
list_change.hpp:21
aria::ListChange::kind
ListChangeKind kind
Definition
list_change.hpp:18
aria::ListChange::Snapshot
std::vector< std::shared_ptr< T > > Snapshot
Definition
list_change.hpp:17
modules
core
include
aria
list_change.hpp
Generated by
1.18.0