neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
item_model.hpp
Go to the documentation of this file.
1// item_model.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2015, 2020 Leigh Johnston. All Rights Reserved.
5
6 This program is free software: you can redistribute it and / or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
23#include <vector>
24#include <deque>
25#include <boost/algorithm/string.hpp>
28#include <neolib/core/tree.hpp>
33
34namespace neogfx
35{
36 template <typename T, typename CellType, uint32_t Columns, bool CellsCached>
38
39 template <typename T, typename CellType, uint32_t Columns>
40 class item_row_traits<T, CellType, Columns, false>
41 {
42 public:
43 typedef T value_type;
44 typedef std::allocator<value_type> allocator_type;
45 typedef CellType cell_type;
46 typedef neolib::vecarray<cell_type, Columns, Columns, neolib::check<neolib::vecarray_overflow>, typename std::allocator_traits<allocator_type>::template rebind_alloc<cell_type>> row_cell_array;
52 };
53
54 template <typename T, typename CellType, uint32_t Columns>
55 class item_row_traits<T, CellType, Columns, true>
56 {
57 public:
58 typedef T value_type;
59 typedef std::allocator<value_type> allocator_type;
60 typedef CellType cell_type;
61 typedef neolib::vecarray<cell_type, Columns, Columns, neolib::check<neolib::vecarray_overflow>, typename std::allocator_traits<allocator_type>::template rebind_alloc<cell_type>> row_cell_array;
62 struct row
63 {
66 };
67 };
68
69 template <typename T, typename CellType>
70 class item_row_traits<T, CellType, 0, false>
71 {
72 public:
73 typedef T value_type;
74 typedef std::allocator<value_type> allocator_type;
75 typedef CellType cell_type;
76 typedef std::vector<cell_type, typename std::allocator_traits<allocator_type>::template rebind_alloc<cell_type>> row_cell_array;
82 };
83
84 template <typename T, typename CellType>
85 class item_row_traits<T, CellType, 0, true>
86 {
87 public:
88 typedef T value_type;
89 typedef std::allocator<value_type> allocator_type;
90 typedef CellType cell_type;
91 typedef std::vector<cell_type, typename std::allocator_traits<allocator_type>::template rebind_alloc<cell_type>> row_cell_array;
92 struct row
93 {
96 };
97 };
98
99 template <typename T, typename CellType, uint32_t Columns, bool CellsCached = false>
101 {
102 public:
103 static constexpr bool is_flat = true;
104 static constexpr bool is_tree = false;
105 public:
106 typedef T value_type;
107 typedef std::allocator<value_type> allocator_type;
108 typedef CellType cell_type;
111 typedef std::vector<row, typename std::allocator_traits<allocator_type>::template rebind_alloc<row>> container_type;
112 typedef typename container_type::iterator iterator;
113 typedef typename container_type::const_iterator const_iterator;
114 typedef typename iterator sibling_iterator;
116 typedef typename iterator skip_iterator;
118 public:
119 template <typename T2, typename CellType2, bool CellsCached2 = CellsCached>
124 };
125
126 template <typename T, typename CellType, uint32_t Columns, bool CellsCached = false>
128 {
129 public:
130 static constexpr bool is_flat = false;
131 static constexpr bool is_tree = true;
132 public:
133 typedef T value_type;
134 typedef std::allocator<value_type> allocator_type;
135 typedef CellType cell_type;
145 public:
146 template <typename T2, typename CellType2, bool CellsCached2 = CellsCached>
151 };
152
153 template <typename T, typename CellType, bool CellsCached>
154 class item_flat_container_traits<T, CellType, 0, CellsCached>
155 {
156 public:
157 static constexpr bool is_flat = true;
158 static constexpr bool is_tree = false;
159 public:
160 typedef T value_type;
161 typedef std::allocator<value_type> allocator_type;
162 typedef CellType cell_type;
165 typedef std::vector<row, typename std::allocator_traits<allocator_type>::template rebind_alloc<row>> container_type;
166 typedef typename container_type::iterator iterator;
167 typedef typename container_type::const_iterator const_iterator;
168 typedef typename iterator sibling_iterator;
170 typedef typename iterator skip_iterator;
172 public:
173 template <typename T2, typename CellType2, bool CellsCached2 = CellsCached>
178 };
179
180 template <typename T, typename CellType, bool CellsCached>
181 class item_tree_container_traits<T, CellType, 0, CellsCached>
182 {
183 public:
184 static constexpr bool is_flat = false;
185 static constexpr bool is_tree = true;
186 public:
187 typedef T value_type;
188 typedef std::allocator<value_type> allocator_type;
189 typedef CellType cell_type;
199 public:
200 template <typename T2, typename CellType2, bool CellsCached2 = CellsCached>
205 };
206
207 template <typename T, uint32_t Columns = 0, typename CellType = item_cell_data, typename ContainerTraits = item_flat_container_traits<T, CellType, Columns>>
208 class basic_item_model : public object<reference_counted<i_basic_item_model<T>>>
209 {
211 public:
212 define_declared_event(ColumnInfoChanged, column_info_changed, item_model_index::column_type)
214 define_declared_event(ItemChanged, item_changed, const item_model_index&)
216 define_declared_event(ItemRemoved, item_removed, const item_model_index&)
217 define_declared_event(Cleared, cleared)
218 public:
219 typedef ContainerTraits container_traits;
228 typedef neolib::specialized_generic_iterator<iterator> base_iterator;
229 typedef neolib::specialized_generic_iterator<const_iterator> const_base_iterator;
234 private:
235 struct column_info
236 {
237 std::string name;
238 mutable optional_item_cell_info defaultDataInfo;
239 };
240 typedef typename container_traits::template rebind<item_model_index::row_type, column_info>::other::row_cell_array column_info_array;
241 public:
250 public:
251 bool is_tree() const override
252 {
253 return container_traits::is_tree;
254 }
255 uint32_t rows() const override
256 {
257 return static_cast<uint32_t>(iItems.size());
258 }
259 uint32_t columns() const override
260 {
261 return static_cast<uint32_t>(iColumns.size());
262 }
263 uint32_t columns(item_model_index const& aIndex) const override
264 {
265 return static_cast<uint32_t>(row(aIndex).cells.size());
266 }
267 std::string const& column_name(item_model_index::value_type aColumnIndex) const override
268 {
269 if (iColumns.size() < aColumnIndex + 1u)
270 throw base_type::bad_column_index();
271 return iColumns[aColumnIndex].name;
272 }
273 void set_column_name(item_model_index::value_type aColumnIndex, std::string const& aName) override
274 {
275 if (iColumns.size() < aColumnIndex + 1u)
276 iColumns.resize(aColumnIndex + 1u);
277 iColumns[aColumnIndex].name = aName;
278 ColumnInfoChanged.trigger(aColumnIndex);
279 }
281 {
282 return default_cell_info(aColumnIndex).dataType;
283 }
285 {
286 default_cell_info(aColumnIndex).dataType = aType;
287 ColumnInfoChanged.trigger(aColumnIndex);
288 }
289 item_cell_data const& column_min_value(item_model_index::column_type aColumnIndex) const override
290 {
291 return default_cell_info(aColumnIndex).dataMin;
292 }
293 void set_column_min_value(item_model_index::column_type aColumnIndex, item_cell_data const& aValue) override
294 {
295 default_cell_info(aColumnIndex).dataMin = aValue;
296 ColumnInfoChanged.trigger(aColumnIndex);
297 }
298 item_cell_data const& column_max_value(item_model_index::column_type aColumnIndex) const override
299 {
300 return default_cell_info(aColumnIndex).dataMax;
301 }
302 void set_column_max_value(item_model_index::column_type aColumnIndex, item_cell_data const& aValue) override
303 {
304 default_cell_info(aColumnIndex).dataMax = aValue;
305 ColumnInfoChanged.trigger(aColumnIndex);
306 }
307 item_cell_data const& column_step_value(item_model_index::column_type aColumnIndex) const override
308 {
309 return default_cell_info(aColumnIndex).dataStep;
310 }
311 void set_column_step_value(item_model_index::column_type aColumnIndex, item_cell_data const& aValue) override
312 {
313 default_cell_info(aColumnIndex).dataStep = aValue;
314 ColumnInfoChanged.trigger(aColumnIndex);
315 }
316 public:
317 i_item_model::iterator index_to_iterator(item_model_index const& aIndex) override
318 {
319 return base_iterator{ std::next(iItems.begin(), aIndex.row()) };
320 }
321 i_item_model::const_iterator index_to_iterator(item_model_index const& aIndex) const override
322 {
323 return const_base_iterator{ std::next(iItems.begin(), aIndex.row()) };
324 }
325 item_model_index iterator_to_index(i_item_model::const_iterator aPosition) const override
326 {
327 return item_model_index{ static_cast<uint32_t>(std::distance(iItems.begin(), const_base_iterator{ aPosition }.get<const_iterator, const_iterator, iterator, const_sibling_iterator, sibling_iterator>())), 0 };
328 }
329 i_item_model::iterator begin() override
330 {
331 return base_iterator{ iItems.begin() };
332 }
333 i_item_model::const_iterator begin() const override
334 {
335 return const_base_iterator{ iItems.begin() };
336 }
337 i_item_model::iterator end() override
338 {
339 return base_iterator{ iItems.end() };
340 }
341 i_item_model::const_iterator end() const override
342 {
343 return const_base_iterator{ iItems.end() };
344 }
345 i_item_model::iterator sbegin() override
346 {
347 if constexpr (container_traits::is_tree)
348 return base_iterator{ iItems.sbegin() };
349 else
350 throw base_type::wrong_model_type();
351 }
352 i_item_model::const_iterator sbegin() const override
353 {
354 if constexpr (container_traits::is_tree)
355 return const_base_iterator{ iItems.sbegin() };
356 else
357 throw base_type::wrong_model_type();
358 }
359 i_item_model::iterator send() override
360 {
361 if constexpr (container_traits::is_tree)
362 return base_iterator{ iItems.send() };
363 else
364 throw base_type::wrong_model_type();
365 }
366 i_item_model::const_iterator send() const override
367 {
368 if constexpr (container_traits::is_tree)
369 return const_base_iterator{ iItems.send() };
370 else
371 throw base_type::wrong_model_type();
372 }
373 bool has_children(i_item_model::const_iterator aParent) const override
374 {
375 if constexpr (container_traits::is_tree)
376 return aParent.get<const_iterator, const_iterator, iterator, const_sibling_iterator, sibling_iterator>().descendent_count() != 0;
377 else
378 throw base_type::wrong_model_type();
379 }
380 bool has_children(const item_model_index& aParentIndex) const override
381 {
382 if constexpr (container_traits::is_tree)
383 return has_children(index_to_iterator(aParentIndex));
384 else
385 throw base_type::wrong_model_type();
386 }
387 bool has_parent(i_item_model::const_iterator aChild) const override
388 {
389 if constexpr (container_traits::is_tree)
390 return !aChild.get<const_iterator, const_iterator, iterator, const_sibling_iterator, sibling_iterator>().parent_is_root();
391 else
392 throw base_type::wrong_model_type();
393 }
394 bool has_parent(const item_model_index& aChildIndex) const override
395 {
396 if constexpr (container_traits::is_tree)
397 return has_parent(index_to_iterator(aChildIndex));
398 else
399 throw base_type::wrong_model_type();
400 }
401 i_item_model::iterator parent(i_item_model::iterator aChild) override
402 {
403 if constexpr (container_traits::is_tree)
405 else
406 throw base_type::wrong_model_type();
407 }
408 i_item_model::const_iterator parent(i_item_model::const_iterator aChild) const override
409 {
410 if constexpr (container_traits::is_tree)
412 else
413 throw base_type::wrong_model_type();
414 }
415 item_model_index parent(const item_model_index& aChildIndex) const override
416 {
417 if constexpr (container_traits::is_tree)
418 return iterator_to_index(parent(index_to_iterator(aChildIndex)));
419 else
420 throw base_type::wrong_model_type();
421 }
422 i_item_model::iterator sbegin(i_item_model::iterator aParent) override
423 {
424 if constexpr (container_traits::is_tree)
425 return base_iterator{ aParent.get<iterator, iterator, sibling_iterator>().begin() };
426 else
427 throw base_type::wrong_model_type();
428 }
429 i_item_model::const_iterator sbegin(i_item_model::const_iterator aParent) const override
430 {
431 if constexpr (container_traits::is_tree)
433 else
434 throw base_type::wrong_model_type();
435 }
436 i_item_model::iterator send(i_item_model::iterator aParent) override
437 {
438 if constexpr (container_traits::is_tree)
439 return base_iterator{ aParent.get<iterator, iterator, sibling_iterator>().end() };
440 else
441 throw base_type::wrong_model_type();
442 }
443 i_item_model::const_iterator send(i_item_model::const_iterator aParent) const override
444 {
445 if constexpr (container_traits::is_tree)
447 else
448 throw base_type::wrong_model_type();
449 }
450 public:
451 item_cell_data const& cell_data(item_model_index const& aIndex) const override
452 {
453 if (aIndex.column() < row(aIndex).cells.size())
454 return row(aIndex).cells[aIndex.column()];
455 static const item_cell_data sEmpty;
456 return sEmpty;
457 }
458 const item_cell_info& cell_info(item_model_index const& aIndex) const override
459 {
460 return default_cell_info(aIndex.column());
461 }
462 public:
463 bool empty() const override
464 {
465 return iItems.empty();
466 }
467 void reserve(uint32_t aItemCount) override
468 {
469 if constexpr (container_traits::is_flat)
470 iItems.reserve(aItemCount);
471 else
472 throw base_type::wrong_model_type();
473 }
474 uint32_t capacity() const override
475 {
476 if constexpr (container_traits::is_flat)
477 return static_cast<uint32_t>(iItems.capacity());
478 else
479 throw base_type::wrong_model_type();
480 }
481 i_item_model::iterator insert_item(i_item_model::const_iterator aPosition, value_type const& aValue) override
482 {
483 auto result = base_iterator{ iItems.insert(aPosition.get<const_sibling_iterator, const_iterator, iterator, const_sibling_iterator, sibling_iterator>(), row_type{ aValue, row_cell_array{} }) };
484 ItemAdded.trigger(iterator_to_index(result));
485 return result;
486 }
487 i_item_model::iterator insert_item(i_item_model::const_iterator aPosition, value_type const& aValue, item_cell_data const& aCellData) override
488 {
489 auto result = base_iterator{ iItems.insert(aPosition.get<const_sibling_iterator, const_iterator, iterator, const_sibling_iterator, sibling_iterator>(), row_type{ aValue, row_cell_array{} }) };
490 do_insert_cell_data(result, 0, aCellData);
491 ItemAdded.trigger(iterator_to_index(result));
492 ItemChanged.trigger(iterator_to_index(result));
493 return result;
494 }
495 i_item_model::iterator insert_item(i_item_model::const_iterator aPosition, item_cell_data const& aCellData) override
496 {
497 return insert_item(aPosition, value_type{}, aCellData);
498 }
499 i_item_model::iterator insert_item(item_model_index const& aIndex, value_type const& aValue) override
500 {
501 return insert_item(index_to_iterator(aIndex), aValue);
502 }
503 i_item_model::iterator insert_item(item_model_index const& aIndex, value_type const& aValue, item_cell_data const& aCellData) override
504 {
505 return insert_item(index_to_iterator(aIndex), aValue, aCellData);
506 }
507 i_item_model::iterator insert_item(item_model_index const& aIndex, item_cell_data const& aCellData) override
508 {
509 return insert_item(index_to_iterator(aIndex), aCellData);
510 }
511 i_item_model::iterator append_item(value_type const& aValue) override
512 {
513 return insert_item(item_model_index{ rows(), 0 }, aValue);
514 }
515 i_item_model::iterator append_item(value_type const& aValue, item_cell_data const& aCellData) override
516 {
517 return insert_item(item_model_index{ rows(), 0 }, aValue, aCellData);
518 }
519 i_item_model::iterator append_item(i_item_model::const_iterator aParent, value_type const& aValue) override
520 {
521 if constexpr (container_traits::is_tree)
522 {
523 auto result = base_iterator{ iItems.insert(aParent.get<const_sibling_iterator, const_iterator, iterator, const_sibling_iterator, sibling_iterator>().end(), row_type{ aValue, row_cell_array{} }) };
524 ItemAdded.trigger(iterator_to_index(result));
525 return result;
526 }
527 else
528 throw base_type::wrong_model_type();
529 }
530 i_item_model::iterator append_item(i_item_model::const_iterator aParent, value_type const& aValue, item_cell_data const& aCellData) override
531 {
532 auto result = base_iterator{ append_item(aParent, aValue) };
533 insert_cell_data(result, 0, aCellData);
534 return result;
535 }
536 i_item_model::iterator append_item(i_item_model::const_iterator aParent, item_cell_data const& aCellData) override
537 {
538 return append_item(aParent, value_type(), aCellData);
539 }
540 i_item_model::iterator append_item(item_model_index const& aIndex, value_type const& aValue) override
541 {
542 return append_item(index_to_iterator(aIndex), aValue);
543 }
544 i_item_model::iterator append_item(item_model_index const& aIndex, value_type const& aValue, item_cell_data const& aCellData) override
545 {
546 return append_item(index_to_iterator(aIndex), aValue, aCellData);
547 }
548 i_item_model::iterator append_item(item_model_index const& aIndex, item_cell_data const& aCellData) override
549 {
550 return append_item(index_to_iterator(aIndex), aCellData);
551 }
552 void clear() override
553 {
554 iItems.clear();
555 Cleared.trigger();
556 }
557 i_item_model::iterator erase(i_item_model::const_iterator aPosition) override
558 {
559 auto containerIterator = aPosition.get<const_iterator, const_iterator, iterator, const_sibling_iterator, sibling_iterator>();
560 if constexpr (container_traits::is_tree)
561 while (containerIterator.rbegin() != containerIterator.rend())
562 erase(const_base_iterator{ --containerIterator.rbegin().base() });
563 auto const index = iterator_to_index(aPosition);
564 ItemRemoving.trigger(index);
565 auto result = base_iterator{ iItems.erase(containerIterator) };
566 ItemRemoved.trigger(index);
567 return result;
568 }
569 i_item_model::iterator erase(item_model_index const& aIndex) override
570 {
571 return erase(index_to_iterator(aIndex));
572 }
573 void insert_cell_data(i_item_model::iterator aItem, item_model_index::value_type aColumnIndex, item_cell_data const& aCellData) override
574 {
575 if (do_insert_cell_data(aItem, aColumnIndex, aCellData))
576 {
577 item_model_index index = iterator_to_index(aItem);
578 index.set_column(aColumnIndex);
579 ItemChanged.trigger(index);
580 }
581 }
582 void insert_cell_data(item_model_index const& aIndex, item_cell_data const& aCellData) override
583 {
584 insert_cell_data(index_to_iterator(aIndex), aIndex.column(), aCellData);
585 }
586 void update_cell_data(i_item_model::const_iterator aPosition, item_model_index::value_type aColumnIndex, item_cell_data const& aCellData) override
587 {
588 update_cell_data(iterator_to_index(aPosition).with_column(aColumnIndex), aCellData);
589 }
590 void update_cell_data(item_model_index const& aIndex, item_cell_data const& aCellData) override
591 {
592 if (std::holds_alternative<string>(aCellData) && std::get<string>(aCellData).empty())
593 {
594 update_cell_data(aIndex, {});
595 return;
596 }
597 if (row(aIndex).cells.size() <= aIndex.column())
598 row(aIndex).cells.resize(aIndex.column() + 1u);
599 if (row(aIndex).cells[aIndex.column()] == aCellData)
600 return;
601 row(aIndex).cells[aIndex.column()] = aCellData;
602 if (default_cell_info(aIndex.column()).dataType == item_data_type::Unknown)
603 default_cell_info(aIndex.column()).dataType = static_cast<item_data_type>(aCellData.index());
604 ItemChanged.trigger(aIndex);
605 }
606 public:
607 using base_type::item;
608 value_type& item(item_model_index const& aIndex) override
609 {
610 return row(aIndex).value;
611 }
612 value_type const& item(item_model_index const& aIndex) const override
613 {
614 return row(aIndex).value;
615 }
616 public:
617 container_type const& items() const
618 {
619 return iItems;
620 }
621 private:
622 row_type& row(item_model_index const& aIndex)
623 {
624 return *std::next(iItems.begin(), aIndex.row());
625 }
626 row_type const& row(item_model_index const& aIndex) const
627 {
628 return *std::next(iItems.begin(), aIndex.row());
629 }
630 item_cell_info const& default_cell_info(item_model_index::column_type aColumnIndex) const
631 {
632 if (iColumns.size() < aColumnIndex + 1)
633 throw base_type::bad_column_index();
634 if (iColumns[aColumnIndex].defaultDataInfo != std::nullopt)
635 return *iColumns[aColumnIndex].defaultDataInfo;
636 else
637 {
638 static const item_cell_info sZero = {};
639 return sZero;
640 }
641 }
642 item_cell_info& default_cell_info(item_model_index::column_type aColumnIndex)
643 {
644 if (iColumns.size() < aColumnIndex + 1)
645 {
646 iColumns.resize(aColumnIndex + 1);
647 ColumnInfoChanged.trigger(aColumnIndex);
648 }
649 if (iColumns[aColumnIndex].defaultDataInfo == std::nullopt)
650 iColumns[aColumnIndex].defaultDataInfo = item_cell_info{};
651 return *iColumns[aColumnIndex].defaultDataInfo;
652 }
653 bool do_insert_cell_data(i_item_model::iterator aItem, item_model_index::value_type aColumnIndex, item_cell_data const& aCellData)
654 {
655 if (std::holds_alternative<string>(aCellData) && std::get<string>(aCellData).empty())
656 return do_insert_cell_data(aItem, aColumnIndex, {});
657 bool changed = false;
658 auto ri = aItem.get<iterator, iterator, sibling_iterator>();
659 if (ri->cells.size() < aColumnIndex + 1)
660 {
661 ri->cells.resize(aColumnIndex + 1);
662 changed = true;
663 }
664 if (iColumns.size() < aColumnIndex + 1)
665 {
666 iColumns.resize(aColumnIndex + 1);
667 ColumnInfoChanged.trigger(aColumnIndex);
668 changed = true;
669 }
670 if (default_cell_info(aColumnIndex).dataType == item_data_type::Unknown)
671 {
672 default_cell_info(aColumnIndex).dataType = static_cast<item_data_type>(aCellData.index());
673 changed = true;
674 }
675 if (ri->cells[aColumnIndex] != aCellData)
676 {
677 ri->cells[aColumnIndex] = aCellData;
678 changed = true;
679 }
680 return changed;
681 }
682 private:
683 container_type iItems;
684 column_info_array iColumns;
685 };
686
689
690 template <typename T, uint32_t Columns = 0>
692}
i_item_model::iterator append_item(value_type const &aValue, item_cell_data const &aCellData) override
ContainerTraits container_traits
container_traits::sibling_iterator sibling_iterator
bool has_children(i_item_model::const_iterator aParent) const override
container_type::const_iterator const_iterator
row_cell_array::iterator column_iterator
i_item_model::const_iterator send(i_item_model::const_iterator aParent) const override
void reserve(uint32_t aItemCount) override
container_type::iterator iterator
i_item_model::iterator send() override
i_item_model::iterator sbegin(i_item_model::iterator aParent) override
i_item_model::iterator send(i_item_model::iterator aParent) override
i_item_model::iterator index_to_iterator(item_model_index const &aIndex) override
void insert_cell_data(item_model_index const &aIndex, item_cell_data const &aCellData) override
i_item_model::iterator append_item(item_model_index const &aIndex, value_type const &aValue) override
uint32_t columns() const override
define_declared_event(ColumnInfoChanged, column_info_changed, item_model_index::column_type) define_declared_event(ItemAdded
i_item_model::iterator append_item(item_model_index const &aIndex, value_type const &aValue, item_cell_data const &aCellData) override
item_cell_data const & column_step_value(item_model_index::column_type aColumnIndex) const override
bool has_parent(i_item_model::const_iterator aChild) const override
i_item_model::iterator end() override
value_type & item(item_model_index const &aIndex) override
i_item_model::const_iterator sbegin() const override
bool has_parent(const item_model_index &aChildIndex) const override
uint32_t rows() const override
const item_model_index item_removing
void update_cell_data(item_model_index const &aIndex, item_cell_data const &aCellData) override
i_item_model::iterator append_item(i_item_model::const_iterator aParent, value_type const &aValue, item_cell_data const &aCellData) override
void set_column_max_value(item_model_index::column_type aColumnIndex, item_cell_data const &aValue) override
item_data_type column_data_type(item_model_index::column_type aColumnIndex) const override
item_model_index iterator_to_index(i_item_model::const_iterator aPosition) const override
i_item_model::iterator insert_item(item_model_index const &aIndex, item_cell_data const &aCellData) override
row_cell_array::const_iterator const_column_iterator
i_item_model::iterator append_item(i_item_model::const_iterator aParent, value_type const &aValue) override
container_type::value_type row_type
void set_column_data_type(item_model_index::column_type aColumnIndex, item_data_type aType) override
i_item_model::iterator parent(i_item_model::iterator aChild) override
item_model_index parent(const item_model_index &aChildIndex) const override
uint32_t columns(item_model_index const &aIndex) const override
i_item_model::iterator insert_item(item_model_index const &aIndex, value_type const &aValue) override
uint32_t capacity() const override
const item_cell_info & cell_info(item_model_index const &aIndex) const override
i_item_model::iterator append_item(value_type const &aValue) override
item_cell_data const & cell_data(item_model_index const &aIndex) const override
i_item_model::iterator begin() override
i_item_model::const_iterator send() const override
i_item_model::iterator insert_item(i_item_model::const_iterator aPosition, value_type const &aValue, item_cell_data const &aCellData) override
i_item_model::iterator insert_item(item_model_index const &aIndex, value_type const &aValue, item_cell_data const &aCellData) override
i_item_model::iterator erase(item_model_index const &aIndex) override
bool is_tree() const override
i_item_model::const_iterator index_to_iterator(item_model_index const &aIndex) const override
container_traits::const_sibling_iterator const_sibling_iterator
value_type const & item(item_model_index const &aIndex) const override
container_type const & items() const
i_item_model::iterator append_item(item_model_index const &aIndex, item_cell_data const &aCellData) override
i_item_model::iterator append_item(i_item_model::const_iterator aParent, item_cell_data const &aCellData) override
container_traits::cell_type cell_type
void update_cell_data(i_item_model::const_iterator aPosition, item_model_index::value_type aColumnIndex, item_cell_data const &aCellData) override
void set_column_name(item_model_index::value_type aColumnIndex, std::string const &aName) override
i_item_model::iterator sbegin() override
i_item_model::const_iterator begin() const override
i_item_model::const_iterator sbegin(i_item_model::const_iterator aParent) const override
container_traits::value_type value_type
container_traits::allocator_type allocator_type
container_traits::container_type container_type
std::string const & column_name(item_model_index::value_type aColumnIndex) const override
container_traits::row_cell_array row_cell_array
i_item_model::const_iterator parent(i_item_model::const_iterator aChild) const override
void set_column_min_value(item_model_index::column_type aColumnIndex, item_cell_data const &aValue) override
i_item_model::iterator insert_item(i_item_model::const_iterator aPosition, value_type const &aValue) override
bool has_children(const item_model_index &aParentIndex) const override
void set_column_step_value(item_model_index::column_type aColumnIndex, item_cell_data const &aValue) override
i_item_model::iterator insert_item(i_item_model::const_iterator aPosition, item_cell_data const &aCellData) override
i_item_model::const_iterator end() const override
void insert_cell_data(i_item_model::iterator aItem, item_model_index::value_type aColumnIndex, item_cell_data const &aCellData) override
i_item_model::iterator erase(i_item_model::const_iterator aPosition) override
bool empty() const override
item_cell_data const & column_max_value(item_model_index::column_type aColumnIndex) const override
item_cell_data const & column_min_value(item_model_index::column_type aColumnIndex) const override
std::string name(uint32_t aIndex) const
item_row_traits< T, CellType, 0, CellsCached >::row row
item_row_traits< T, CellType, 0, CellsCached >::row_cell_array row_cell_array
std::vector< row, typename std::allocator_traits< allocator_type >::template rebind_alloc< row > > container_type
item_row_traits< T, CellType, Columns, CellsCached >::row_cell_array row_cell_array
container_type::iterator iterator
container_type::const_iterator const_iterator
item_row_traits< T, CellType, Columns, CellsCached >::row row
std::allocator< value_type > allocator_type
std::vector< row, typename std::allocator_traits< allocator_type >::template rebind_alloc< row > > container_type
void set_column(column_type aColumn)
row_type row() const
column_type column() const
std::allocator< value_type > allocator_type
std::vector< cell_type, typename std::allocator_traits< allocator_type >::template rebind_alloc< cell_type > > row_cell_array
std::allocator< value_type > allocator_type
std::vector< cell_type, typename std::allocator_traits< allocator_type >::template rebind_alloc< cell_type > > row_cell_array
neolib::vecarray< cell_type, Columns, Columns, neolib::check< neolib::vecarray_overflow >, typename std::allocator_traits< allocator_type >::template rebind_alloc< cell_type > > row_cell_array
neolib::vecarray< cell_type, Columns, Columns, neolib::check< neolib::vecarray_overflow >, typename std::allocator_traits< allocator_type >::template rebind_alloc< cell_type > > row_cell_array
item_row_traits< T, CellType, 0, CellsCached >::row_cell_array row_cell_array
item_row_traits< T, CellType, 0, CellsCached >::row row
container_type::const_sibling_iterator const_sibling_iterator
neolib::tree< row, 64, typename std::allocator_traits< allocator_type >::template rebind_alloc< row > > container_type
container_type::const_iterator const_iterator
container_type::sibling_iterator sibling_iterator
std::allocator< value_type > allocator_type
container_type::iterator iterator
container_type::const_sibling_iterator const_sibling_iterator
item_row_traits< T, CellType, Columns, CellsCached >::row_cell_array row_cell_array
container_type::skip_iterator skip_iterator
item_row_traits< T, CellType, Columns, CellsCached >::row row
container_type::const_skip_iterator const_skip_iterator
neolib::tree< row, 64, typename std::allocator_traits< allocator_type >::template rebind_alloc< row > > container_type
virtual void set_alive()=0
void set_destroying() override
Definition object.hpp:66
basic_iterator< iterator_type::Normal > iterator
basic_iterator< iterator_type::Sibling > sibling_iterator
basic_const_iterator< iterator_type::Skip > const_skip_iterator
basic_const_iterator< iterator_type::Normal > const_iterator
basic_const_iterator< iterator_type::Sibling > const_sibling_iterator
basic_iterator< iterator_type::Skip > skip_iterator
basic_item_model< void * > item_model
basic_item_model< T, Columns, item_cell_data, item_tree_container_traits< T, item_cell_data, Columns > > basic_item_tree_model
it_type next(it_type it, const typename iterator_traits< it_type >::difference_type distance=1)
Definition plf_hive.h:89
iterator_traits< it_type >::difference_type distance(const it_type first, const it_type last)
Definition plf_hive.h:107
#define define_declared_event(name, declName,...)
Definition event.hpp:195
item_flat_container_traits< T2, CellType2, Columns, CellsCached2 > other
item_flat_container_traits< T2, CellType2, 0, CellsCached2 > other
item_tree_container_traits< T2, CellType2, Columns, CellsCached2 > other
item_tree_container_traits< T2, CellType2, 0, CellsCached2 > other