19#include <AUI/Common/ASignal.h>
20#include "AUI/Common/AObject.h"
21#include "AUI/Common/AOptional.h"
22#include <AUI/Model/ATreeModelIndex.h>
58 const ATreeModelIndexOrRoot& vertex) = 0;
67 template<aui::predicate<ATreeModelIndex> Predicate>
72 template<aui::invocable<ATreeModelIndex> Callback>
73 void forEachDirectChildOf(
const ATreeModelIndexOrRoot& vertex, Callback callback) {
75 for (
decltype(s) i = 0; i < s; ++i) {
97 template<aui::predicate<ATreeModelIndex> Predicate>
99 if (
auto index = std::get_if<ATreeModelIndex>(&vertex)) {
105 for (std::size_t i = 0; i < count; ++i) {
107 if (
auto v = visit(p, child)) {
Utility wrapper implementing the stack-allocated (fast) optional idiom.
Definition AOptional.h:32
Valid index of ITreeModel.
Definition ATreeModelIndex.h:10
static constexpr struct ATreeModelIndex::@102253001377275224255007337255000205374254314015 ROOT
Tag type to define root vertex.
Tree model.
Definition ITreeModel.h:35
emits< ATreeModelIndex > dataChanged
Model data was changed.
Definition ITreeModel.h:84
emits< ATreeModelIndex > dataRemoved
Model data about to remove.
Definition ITreeModel.h:94
emits< ATreeModelIndex > dataInserted
Model data was added.
Definition ITreeModel.h:89
virtual ATreeModelIndex indexOfChild(size_t row, size_t column, const ATreeModelIndexOrRoot &vertex)=0
Creates valid ATreeModelIndex of the child.
virtual ATreeModelIndexOrRoot parent(const ATreeModelIndex &vertex)=0
Creates index of parent vertex of the specified vertex.
virtual size_t childrenCount(const ATreeModelIndexOrRoot &vertex)=0
Count of children of the vertex.
virtual T itemAt(const ATreeModelIndex &index)=0
value representation, used by ATreeView.
ASignal< Args... > emits
A signal declaration.
Definition ASignal.h:348