UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TIndexedContainerIterator< ContainerType, ElementType, SizeType > Class Template Reference

#include <Array.h>

Public Member Functions

UE_NODEBUG TIndexedContainerIterator (ContainerType &InContainer, SizeType StartIndex=0)
 
UE_NODEBUG TIndexedContainerIteratoroperator++ ()
 
UE_NODEBUG TIndexedContainerIterator operator++ (int)
 
UE_NODEBUG TIndexedContainerIteratoroperator-- ()
 
UE_NODEBUG TIndexedContainerIterator operator-- (int)
 
UE_NODEBUG TIndexedContainerIteratoroperator+= (SizeType Offset)
 
UE_NODEBUG TIndexedContainerIterator operator+ (SizeType Offset) const
 
UE_NODEBUG TIndexedContainerIteratoroperator-= (SizeType Offset)
 
UE_NODEBUG TIndexedContainerIterator operator- (SizeType Offset) const
 
UE_NODEBUG UE_FORCEINLINE_HINT ElementType & operator* () const
 
UE_NODEBUG UE_FORCEINLINE_HINT ElementType * operator-> () const
 
UE_NODEBUG UE_FORCEINLINE_HINT operator bool () const
 
UE_NODEBUG SizeType GetIndex () const
 
UE_NODEBUG void Reset ()
 
UE_NODEBUG void SetToEnd ()
 
UE_NODEBUG void RemoveCurrent ()
 
UE_NODEBUG void RemoveCurrentSwap ()
 
UE_NODEBUG UE_FORCEINLINE_HINT bool operator== (const TIndexedContainerIterator &Rhs) const
 
UE_NODEBUG UE_FORCEINLINE_HINT bool operator!= (const TIndexedContainerIterator &Rhs) const
 

Detailed Description

template<typename ContainerType, typename ElementType, typename SizeType>
class TIndexedContainerIterator< ContainerType, ElementType, SizeType >

Generic iterator which can operate on types that expose the following:

  • A type called ElementType representing the contained type.
  • A method SizeType Num() const that returns the number of items in the container.
  • A method bool IsValidIndex(SizeType index) which returns whether a given index is valid in the container.
  • A method T& operator[](SizeType index) which returns a reference to a contained object by index.
  • A method void RemoveAt(SizeType index) which removes the element at index

Constructor & Destructor Documentation

◆ TIndexedContainerIterator()

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG TIndexedContainerIterator< ContainerType, ElementType, SizeType >::TIndexedContainerIterator ( ContainerType &  InContainer,
SizeType  StartIndex = 0 
)
inline

Member Function Documentation

◆ GetIndex()

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG SizeType TIndexedContainerIterator< ContainerType, ElementType, SizeType >::GetIndex ( ) const
inline

Returns an index to the current element.

◆ operator bool()

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG UE_FORCEINLINE_HINT TIndexedContainerIterator< ContainerType, ElementType, SizeType >::operator bool ( ) const
inlineexplicit

conversion to "bool" returning true if the iterator has not reached the last element.

◆ operator!=()

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG UE_FORCEINLINE_HINT bool TIndexedContainerIterator< ContainerType, ElementType, SizeType >::operator!= ( const TIndexedContainerIterator< ContainerType, ElementType, SizeType > &  Rhs) const
inline

◆ operator*()

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG UE_FORCEINLINE_HINT ElementType & TIndexedContainerIterator< ContainerType, ElementType, SizeType >::operator* ( ) const
inline

◆ operator+()

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG TIndexedContainerIterator TIndexedContainerIterator< ContainerType, ElementType, SizeType >::operator+ ( SizeType  Offset) const
inline

◆ operator++() [1/2]

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG TIndexedContainerIterator & TIndexedContainerIterator< ContainerType, ElementType, SizeType >::operator++ ( )
inline

Advances iterator to the next element in the container.

◆ operator++() [2/2]

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG TIndexedContainerIterator TIndexedContainerIterator< ContainerType, ElementType, SizeType >::operator++ ( int  )
inline

◆ operator+=()

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG TIndexedContainerIterator & TIndexedContainerIterator< ContainerType, ElementType, SizeType >::operator+= ( SizeType  Offset)
inline

iterator arithmetic support

◆ operator-()

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG TIndexedContainerIterator TIndexedContainerIterator< ContainerType, ElementType, SizeType >::operator- ( SizeType  Offset) const
inline

◆ operator--() [1/2]

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG TIndexedContainerIterator & TIndexedContainerIterator< ContainerType, ElementType, SizeType >::operator-- ( )
inline

Moves iterator to the previous element in the container.

◆ operator--() [2/2]

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG TIndexedContainerIterator TIndexedContainerIterator< ContainerType, ElementType, SizeType >::operator-- ( int  )
inline

◆ operator-=()

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG TIndexedContainerIterator & TIndexedContainerIterator< ContainerType, ElementType, SizeType >::operator-= ( SizeType  Offset)
inline

◆ operator->()

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG UE_FORCEINLINE_HINT ElementType * TIndexedContainerIterator< ContainerType, ElementType, SizeType >::operator-> ( ) const
inline

◆ operator==()

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG UE_FORCEINLINE_HINT bool TIndexedContainerIterator< ContainerType, ElementType, SizeType >::operator== ( const TIndexedContainerIterator< ContainerType, ElementType, SizeType > &  Rhs) const
inline

◆ RemoveCurrent()

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG void TIndexedContainerIterator< ContainerType, ElementType, SizeType >::RemoveCurrent ( )
inline

Removes current element in array. This invalidates the current iterator value and it must be incremented

◆ RemoveCurrentSwap()

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG void TIndexedContainerIterator< ContainerType, ElementType, SizeType >::RemoveCurrentSwap ( )
inline

Removes current element in array by swapping it with the end element and popping it from the end. This invalidates the current iterator value and it must be incremented. Note this modifies the order of the remaining elements in the array.

◆ Reset()

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG void TIndexedContainerIterator< ContainerType, ElementType, SizeType >::Reset ( )
inline

Resets the iterator to the first element.

◆ SetToEnd()

template<typename ContainerType , typename ElementType , typename SizeType >
UE_NODEBUG void TIndexedContainerIterator< ContainerType, ElementType, SizeType >::SetToEnd ( )
inline

Sets the iterator to one past the last element.


The documentation for this class was generated from the following file: