Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
TIndexedContainerIterator< ContainerType, ElementType, SizeType > Class Template Reference

#include <Array.h>

Public Member Functions

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

Private Attributes

ContainerTypeContainer
 
SizeType Index
 

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

Definition at line 59 of file Array.h.

Constructor & Destructor Documentation

◆ TIndexedContainerIterator()

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

Definition at line 62 of file Array.h.

Member Function Documentation

◆ GetIndex()

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

Returns an index to the current element.

Definition at line 135 of file Array.h.

◆ operator bool()

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

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

Definition at line 129 of file Array.h.

◆ operator!=()

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

Definition at line 171 of file Array.h.

◆ operator*()

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

Definition at line 118 of file Array.h.

◆ operator+()

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

Definition at line 101 of file Array.h.

◆ operator++() [1/2]

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

Advances iterator to the next element in the container.

Definition at line 69 of file Array.h.

◆ operator++() [2/2]

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

Definition at line 74 of file Array.h.

◆ operator+=()

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

iterator arithmetic support

Definition at line 95 of file Array.h.

◆ operator-()

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

Definition at line 112 of file Array.h.

◆ operator--() [1/2]

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

Moves iterator to the previous element in the container.

Definition at line 82 of file Array.h.

◆ operator--() [2/2]

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

Definition at line 87 of file Array.h.

◆ operator-=()

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

Definition at line 107 of file Array.h.

◆ operator->()

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

Definition at line 123 of file Array.h.

◆ operator==()

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

Definition at line 170 of file Array.h.

◆ RemoveCurrent()

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

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

Definition at line 153 of file Array.h.

◆ RemoveCurrentSwap()

template<typename ContainerType , typename ElementType , typename SizeType >
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.

Definition at line 164 of file Array.h.

◆ Reset()

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

Resets the iterator to the first element.

Definition at line 141 of file Array.h.

◆ SetToEnd()

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

Sets the iterator to one past the last element.

Definition at line 147 of file Array.h.

Member Data Documentation

◆ Container

template<typename ContainerType , typename ElementType , typename SizeType >
ContainerType& TIndexedContainerIterator< ContainerType, ElementType, SizeType >::Container
private

Definition at line 175 of file Array.h.

◆ Index

template<typename ContainerType , typename ElementType , typename SizeType >
SizeType TIndexedContainerIterator< ContainerType, ElementType, SizeType >::Index
private

Definition at line 176 of file Array.h.


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