4 #ifndef vtkCollectionRange_h
5 #define vtkCollectionRange_h
18 VTK_ABI_NAMESPACE_BEGIN
20 template <
typename CollectionType>
22 template <
typename CollectionType>
32 template <
typename CollectionType,
typename T = CollectionType>
38 template <
typename CollectionType>
62 static auto GetType(...) -> decltype(std::declval<T>().GetNextItemAsObject());
66 static auto GetType(
int) -> decltype(std::declval<T>().GetNextItem());
68 using PointerType = decltype(GetType<CollectionType>(0));
88 template <
typename CollectionType>
119 auto elem = this->Element;
130 return lhs.Element == rhs.Element;
135 return lhs.Element != rhs.Element;
141 swap(lhs.Element, rhs.Element);
153 void Increment() noexcept
155 this->Element = this->Element->
Next;
158 ItemType* GetItem() const noexcept {
return static_cast<ItemType*
>(this->Element->
Item); }
167 template <
typename CollectionType>
168 struct CollectionRange
186 assert(this->Collection);
191 size_type size() const noexcept {
return this->Collection->GetNumberOfItems(); }
196 this->Collection->InitTraversal(cookie);
207 this->Collection->InitTraversal(cookie);
219 VTK_ABI_NAMESPACE_END
223 #endif // vtkCollectionRange_h
typename std::remove_pointer< PointerType >::type Type
void * vtkCollectionSimpleIterator
ItemType * const_reference
typename std::enable_if< IsCollection< CollectionType >::value, T >::type EnableIfIsCollection
size_type size() const noexcept
typename GetCollectionItemType< CollectionType >::Type * reference
friend void swap(CollectionIterator &lhs, CollectionIterator &rhs) noexcept
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
CollectionIterator & operator++() noexcept
pointer operator->() const noexcept
typename GetCollectionItemType< CollectionType >::Type * pointer
friend bool operator!=(const CollectionIterator &lhs, const CollectionIterator &rhs) noexcept
const_iterator cend() const
CollectionIterator operator++(int) noexcept
CollectionIterator & operator=(const CollectionIterator &o) noexcept=default
CollectionIterator(vtkCollectionElement *element) noexcept
typename GetCollectionItemType< CollectionType >::Type ItemType
vtkCollectionElement * Next
std::forward_iterator_tag iterator_category
const_iterator cbegin() const
CollectionRange(CollectionType *coll) noexcept
typename GetCollectionItemType< CollectionType >::Type * value_type
friend bool operator==(const CollectionIterator &lhs, const CollectionIterator &rhs) noexcept
reference operator*() const noexcept
CollectionType * GetCollection() const noexcept
CollectionIterator() noexcept