15#include "AListModelIndex.h"
16#include <AUI/Common/SharedPtr.h>
23class AListModelRange {
30 AListModelRange() =
default;
33 mModel(std::move(model)) {}
35 bool operator==(
const AListModelRange& rhs)
const {
36 return std::tie(mBegin, mEnd, mModel) == std::tie(rhs.mBegin, rhs.mEnd, rhs.mModel);
47 mIndex(index), mModel(std::move(model)) {}
49 Iterator& operator*() {
54 return mModel->listItemAt(mIndex);
57 return mModel->listItemAt(mIndex);
60 Iterator& operator++() {
61 mIndex = {mIndex.getRow() + 1, mIndex.getColumn()};
65 bool operator!=(
const Iterator& other)
const {
67 return mIndex.getRow() != other.mIndex.getRow();
70 bool operator==(
const Iterator& other)
const {
72 return mIndex.getRow() == other.mIndex.getRow();
81 return {mBegin, mModel};
83 AListModelRange<T>::Iterator end()
const {
84 return {mEnd, mModel};
87 [[nodiscard]]
const AListModelIndex& getBegin()
const {
91 [[nodiscard]]
const AListModelIndex& getEnd()
const {
95 const _<IListModel<T>>& getModel()
const {
103 o <<
"[ " << range.getBegin() <<
"; " << range.getEnd() <<
" )";
108#include "IListModel.h"
Definition AListModelIndex.h:20
Definition AListModelRange.h:39
Definition AListModelRange.h:23
Definition IListModel.h:23
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:178
#define AUI_ASSERT(condition)
Asserts that the passed condition evaluates to true.
Definition Assert.h:55