24#include "AUI/Model/ATreeModelIndex.h"
25#include "ITreeModel.h"
48 auto result = _new<Node>(Node {
49 .value = std::move(item.value),
51 result->children = item.children.map([&](Item& item) {
52 auto child = itemToNode(item);
53 child->parent = result;
70 return container.size();
83 auto parent = node->parent.lock();
89 if (
auto p = vertex.
as<
_<Node>>()->parent.lock()) {
90 return makeIndex(std::move(p));
Valid index of ITreeModel.
Definition: ATreeModelIndex.h:10
static constexpr struct ATreeModelIndex::@2 ROOT
Tag type to define root vertex.
T as() const
any_cast the external user data stored in this vertex.
Definition: ATreeModelIndex.h:33
Basic implementation of ITreeModel.
Definition: ATreeModel.h:32
ATreeModelIndexOrRoot parent(const ATreeModelIndex &vertex) override
Creates index of parent vertex of the specified vertex.
Definition: ATreeModel.h:88
T itemAt(const ATreeModelIndex &index) override
value representation, used by ATreeView.
Definition: ATreeModel.h:73
ATreeModelIndex indexOfChild(size_t row, size_t column, const ATreeModelIndexOrRoot &vertex) override
Creates valid ATreeModelIndex of the child.
Definition: ATreeModel.h:77
size_t childrenCount(const ATreeModelIndexOrRoot &vertex) override
Count of children of the vertex.
Definition: ATreeModel.h:68
A std::vector with AUI extensions.
Definition: AVector.h:38
Tree model.
Definition: ITreeModel.h:35
An std::weak_ptr with AUI extensions.
Definition: SharedPtrTypes.h:177
Definition: ATreeModel.h:41
An std::weak_ptr with AUI extensions.
Definition: SharedPtrTypes.h:51