14#include <AUI/Common/AVector.h>
15#include <AUI/Common/ASignal.h>
16#include <AUI/Model/AListModelSelection.h>
18#include "AListModelRange.h"
19#include "AUI/Common/AObject.h"
28 virtual size_t listSize() = 0;
38 return AListModelRange<T>(item, {item.getRow() + 1}, std::dynamic_pointer_cast<IListModel<T>>(this->shared_from_this()));
44 size_t size = listSize();
46 for (
size_t i = 0; i < size; ++i) {
47 result << listItemAt(i);
52 template<
typename Filter>
55 size_t currentBeginning = 0;
56 size_t s = listSize();
57 bool prevValue =
false;
60 auto endSliceIfNecessary = [&](
size_t i) {
62 result << range(currentBeginning, i);
65 for (
size_t i = 0; i < s; ++i, prevValue = currentValue) {
66 currentValue = filter(i);
72 endSliceIfNecessary(i);
75 endSliceIfNecessary(listSize());
Definition: AListModelIndex.h:20
Definition: AListModelRange.h:23
A base object class.
Definition: AObject.h:49
A std::vector with AUI extensions.
Definition: AVector.h:38
Definition: IListModel.h:23
emits< AListModelRange< T > > dataInserted
Model data was added.
Definition: IListModel.h:88
emits< AListModelRange< T > > dataChanged
Model data was changed.
Definition: IListModel.h:83
emits< AListModelRange< T > > dataRemoved
Model data about to remove.
Definition: IListModel.h:93