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 it = this->Iterator;
130 return lhs.Iterator == rhs.Iterator;
135 return lhs.Iterator != rhs.Iterator;
141 swap(lhs.Iterator, rhs.Iterator);
148 void Increment() noexcept
153 ItemType* GetItem() const noexcept {
return static_cast<ItemType*
>(*this->Iterator); }
155 std::vector<vtkObject*>::iterator Iterator;
162 template <
typename CollectionType>
163 struct CollectionRange
181 assert(this->Collection);
186 size_type size() const noexcept {
return this->Collection->GetNumberOfItems(); }
202 VTK_ABI_NAMESPACE_END
206 #endif // vtkCollectionRange_h
typename std::remove_pointer< PointerType >::type Type
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
CollectionIterator(std::vector< vtkObject * >::iterator iterator) noexcept
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
typename GetCollectionItemType< CollectionType >::Type ItemType
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