19#include "AListModelIndex.h"
20#include "AListModelRange.h"
21#include <AUI/Common/ASet.h>
22#include <AUI/Common/AVector.h>
36 mModel(std::move(model)) {}
40 ASet<AListModelIndex>::iterator mIterator;
46 mIterator(iterator), mModel(std::move(model)) {}
54 return mModel->listItemAt(*mIterator);
57 return mModel->listItemAt(*mIterator);
65 bool operator!=(
const Iterator& other)
const {
67 return mIterator != other.mIterator;
70 bool operator==(
const Iterator& other)
const {
72 return mIterator == other.mIterator;
82 return {mIndices.begin(), mModel};
85 return {mIndices.end(), mModel};
88 [[nodiscard]]
size_t size()
const {
89 return mIndices.size();
91 [[nodiscard]]
bool empty()
const {
92 return mIndices.empty();
104 AUI_ASSERTX(mIndices.begin() != mIndices.end(),
"selection model is empty");
105 return *mIndices.begin();
111#include "IListModel.h"
115 return mModel->rangesIncluding([&](
size_t i) {
116 return mIndices.contains(i);
Definition: AListModelIndex.h:20
Definition: AListModelSelection.h:38
Definition: AListModelSelection.h:28
A std::set with AUI extensions.
Definition: ASet.h:25
A std::vector with AUI extensions.
Definition: AVector.h:38
Definition: IListModel.h:23
An std::weak_ptr with AUI extensions.
Definition: SharedPtrTypes.h:177
#define AUI_ASSERT(condition)
Asserts that the passed condition evaluates to true.
Definition: Assert.h:55
#define AUI_ASSERTX(condition, what)
Asserts that the passed condition evaluates to true. Adds extra message string.
Definition: Assert.h:74