MeVisLab Toolbox Reference
|
This template implements a proxy for container that contain a collection of items that are normally accessed with a get by index method. More...
#include <mlContainerHelpers.h>
Classes | |
class | iterator |
Public Types | |
using | value_type = R * |
using | const_iterator = const iterator |
Public Member Functions | |
ContainerProxy (const T &object) | |
ContainerProxy (const ContainerProxy &)=default | |
ContainerProxy & | operator= (const ContainerProxy &)=default |
ContainerProxy (ContainerProxy &&)=default | |
ContainerProxy & | operator= (ContainerProxy &&)=default |
iterator | begin () const |
iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
This template implements a proxy for container that contain a collection of items that are normally accessed with a get by index method.
Because of this structure it is not possible to use them in any STL compatible algorithm or range based for loop. So the proxy provides a begin()/end() pair that follow the standard STL conventions. So calling *end() is no good idea.
By defining a proxy like eg: using TreeWidgetProxy = ContainerHelpers::ContainerProxy<QTreeWidget, QTreeWidgetItem, int, &QTreeWidget::topLevelItemCount, &QTreeWidget::topLevelItem>; auto element = SCR::in(TreeWidgetProxy(<em>myListView)).find([&value](QTreeWidgetItem item) { return item->text(0) == value; }).or_return_nullptr();
NOTE: It is not wise to add or remove items within any loop!
Definition at line 64 of file mlContainerHelpers.h.
Definition at line 157 of file mlContainerHelpers.h.
Definition at line 69 of file mlContainerHelpers.h.
Definition at line 71 of file mlContainerHelpers.h.
|
default |
|
default |
Definition at line 159 of file mlContainerHelpers.h.
|
inline |
Definition at line 169 of file mlContainerHelpers.h.
|
inline |
Definition at line 174 of file mlContainerHelpers.h.
Definition at line 164 of file mlContainerHelpers.h.
References mlrange_cast().
|
default |
|
default |