OpenBarnyard
 
Loading...
Searching...
No Matches
T2DynamicVector< T >::Iterator Class Reference

#include <T2DynamicVector.h>

Public Member Functions

constexpr Iterator ()
 
constexpr Iterator (T2DynamicVector *a_pVector)
 
constexpr Iterator (T2DynamicVector &a_rVector)
 
constexpr Iterator (TINT a_iIndex, T2DynamicVector *a_pVector)
 
constexpr Iterator (const Iterator &a_rOther)
 
constexpr TINT Index () const
 
TBOOL IsValid () const
 
T * Get () noexcept
 
const T * Get () const noexcept
 
T & Value ()
 
const T & Value () const
 
Iterator Next () const
 
Iterator Prev () const
 
 operator T* ()
 
 operator const T * () const
 
T * operator-> ()
 
const T * operator-> () const
 
T & operator* () noexcept
 
const T & operator* () const noexcept
 
TBOOL operator== (const Iterator &a_rOther) const noexcept
 
TBOOL operator> (const Iterator &a_rOther) const noexcept
 
TBOOL operator>= (const Iterator &a_rOther) const noexcept
 
TBOOL operator< (const Iterator &a_rOther) const noexcept
 
TBOOL operator<= (const Iterator &a_rOther) const noexcept
 
constexpr Iteratoroperator= (const Iterator &a_rOther) noexcept
 
Iteratoroperator++ ()
 
Iterator operator++ (TINT)
 
Iteratoroperator-- ()
 
Iterator operator-- (TINT)
 
Iterator operator+ (TINT a_iValue) const
 
Iterator operator- (TINT a_iValue) const
 

Public Attributes

friend T2DynamicVector
 

Detailed Description

template<class T>
class T2DynamicVector< T >::Iterator

Definition at line 53 of file T2DynamicVector.h.

Constructor & Destructor Documentation

◆ Iterator() [1/5]

template<class T>
T2DynamicVector< T >::Iterator::Iterator ( )
inlineconstexpr

Definition at line 59 of file T2DynamicVector.h.

60 : m_iIndex( 0 ), m_pVector( TNULL ) {}

◆ Iterator() [2/5]

template<class T>
T2DynamicVector< T >::Iterator::Iterator ( T2DynamicVector * a_pVector)
inlineconstexpr

Definition at line 61 of file T2DynamicVector.h.

62 : m_iIndex( 0 ), m_pVector( a_pVector ) {}

◆ Iterator() [3/5]

template<class T>
T2DynamicVector< T >::Iterator::Iterator ( T2DynamicVector & a_rVector)
inlineconstexpr

Definition at line 63 of file T2DynamicVector.h.

64 : m_iIndex( 0 ), m_pVector( &a_rVector ) {}

◆ Iterator() [4/5]

template<class T>
T2DynamicVector< T >::Iterator::Iterator ( TINT a_iIndex,
T2DynamicVector * a_pVector )
inlineconstexpr

Definition at line 65 of file T2DynamicVector.h.

66 : m_iIndex( a_iIndex ), m_pVector( a_pVector ) {}

◆ Iterator() [5/5]

template<class T>
T2DynamicVector< T >::Iterator::Iterator ( const Iterator & a_rOther)
inlineconstexpr

Definition at line 67 of file T2DynamicVector.h.

68 : m_iIndex( a_rOther.m_iIndex ), m_pVector( a_rOther.m_pVector ) {}

Member Function Documentation

◆ Get() [1/2]

template<class T>
const T * T2DynamicVector< T >::Iterator::Get ( ) const
inlinenoexcept

Definition at line 87 of file T2DynamicVector.h.

88 {
89 TASSERT( m_iIndex >= 0 );
90 TASSERT( m_pVector );
91 return &m_pVector->At( m_iIndex );
92 }
#define TASSERT(X,...)
Definition Defines.h:138

◆ Get() [2/2]

template<class T>
T * T2DynamicVector< T >::Iterator::Get ( )
inlinenoexcept

Definition at line 80 of file T2DynamicVector.h.

81 {
82 TASSERT( m_iIndex >= 0 );
83 TASSERT( m_pVector );
84 return &m_pVector->At( m_iIndex );
85 }

◆ Index()

template<class T>
TINT T2DynamicVector< T >::Iterator::Index ( ) const
inlineconstexpr

Definition at line 70 of file T2DynamicVector.h.

71 {
72 return m_iIndex;
73 }

◆ IsValid()

template<class T>
TBOOL T2DynamicVector< T >::Iterator::IsValid ( ) const
inline

Definition at line 75 of file T2DynamicVector.h.

76 {
77 return m_pVector && *this != m_pVector->End();
78 }

◆ Next()

template<class T>
Iterator T2DynamicVector< T >::Iterator::Next ( ) const
inline

Definition at line 108 of file T2DynamicVector.h.

109 {
110 Iterator temp = *this;
111 temp.m_iIndex += 1;
112 return temp;
113 }

◆ operator const T *()

template<class T>
T2DynamicVector< T >::Iterator::operator const T * ( ) const
inline

Definition at line 127 of file T2DynamicVector.h.

128 {
129 return &Value();
130 }

◆ operator T*()

template<class T>
T2DynamicVector< T >::Iterator::operator T* ( )
inline

Definition at line 122 of file T2DynamicVector.h.

123 {
124 return &Value();
125 }

◆ operator*() [1/2]

template<class T>
const T & T2DynamicVector< T >::Iterator::operator* ( ) const
inlinenoexcept

Definition at line 147 of file T2DynamicVector.h.

148 {
149 return Value();
150 }

◆ operator*() [2/2]

template<class T>
T & T2DynamicVector< T >::Iterator::operator* ( )
inlinenoexcept

Definition at line 142 of file T2DynamicVector.h.

143 {
144 return Value();
145 }

◆ operator+()

template<class T>
Iterator T2DynamicVector< T >::Iterator::operator+ ( TINT a_iValue) const
inline

Definition at line 210 of file T2DynamicVector.h.

211 {
212 return Iterator( m_iIndex + a_iValue, m_pVector );
213 }

◆ operator++() [1/2]

template<class T>
Iterator & T2DynamicVector< T >::Iterator::operator++ ( )
inline

Definition at line 184 of file T2DynamicVector.h.

185 {
186 m_iIndex++;
187 return *this;
188 }

◆ operator++() [2/2]

template<class T>
Iterator T2DynamicVector< T >::Iterator::operator++ ( TINT )
inline

Definition at line 190 of file T2DynamicVector.h.

191 {
192 Iterator temp = *this;
193 m_iIndex++;
194 return temp;
195 }

◆ operator-()

template<class T>
Iterator T2DynamicVector< T >::Iterator::operator- ( TINT a_iValue) const
inline

Definition at line 215 of file T2DynamicVector.h.

216 {
217 return Iterator( m_iIndex - a_iValue, m_pVector );
218 }

◆ operator--() [1/2]

template<class T>
Iterator & T2DynamicVector< T >::Iterator::operator-- ( )
inline

Definition at line 197 of file T2DynamicVector.h.

198 {
199 m_iIndex--;
200 return *this;
201 }

◆ operator--() [2/2]

template<class T>
Iterator T2DynamicVector< T >::Iterator::operator-- ( TINT )
inline

Definition at line 203 of file T2DynamicVector.h.

204 {
205 Iterator temp = *this;
206 m_iIndex--;
207 return temp;
208 }

◆ operator->() [1/2]

template<class T>
T * T2DynamicVector< T >::Iterator::operator-> ( )
inline

Definition at line 132 of file T2DynamicVector.h.

133 {
134 return &Value();
135 }

◆ operator->() [2/2]

template<class T>
const T * T2DynamicVector< T >::Iterator::operator-> ( ) const
inline

Definition at line 137 of file T2DynamicVector.h.

138 {
139 return &Value();
140 }

◆ operator<()

template<class T>
TBOOL T2DynamicVector< T >::Iterator::operator< ( const Iterator & a_rOther) const
inlinenoexcept

Definition at line 167 of file T2DynamicVector.h.

168 {
169 return a_rOther.m_pVector == m_pVector && a_rOther.m_iIndex < m_iIndex;
170 }

◆ operator<=()

template<class T>
TBOOL T2DynamicVector< T >::Iterator::operator<= ( const Iterator & a_rOther) const
inlinenoexcept

Definition at line 172 of file T2DynamicVector.h.

173 {
174 return a_rOther.m_pVector == m_pVector && a_rOther.m_iIndex <= m_iIndex;
175 }

◆ operator=()

template<class T>
Iterator & T2DynamicVector< T >::Iterator::operator= ( const Iterator & a_rOther)
inlineconstexprnoexcept

Definition at line 177 of file T2DynamicVector.h.

178 {
179 m_iIndex = a_rOther.m_iIndex;
180 m_pVector = a_rOther.m_pVector;
181 return *this;
182 }

◆ operator==()

template<class T>
TBOOL T2DynamicVector< T >::Iterator::operator== ( const Iterator & a_rOther) const
inlinenoexcept

Definition at line 152 of file T2DynamicVector.h.

153 {
154 return a_rOther.m_pVector == m_pVector && a_rOther.m_iIndex == m_iIndex;
155 }

◆ operator>()

template<class T>
TBOOL T2DynamicVector< T >::Iterator::operator> ( const Iterator & a_rOther) const
inlinenoexcept

Definition at line 157 of file T2DynamicVector.h.

158 {
159 return a_rOther.m_pVector == m_pVector && a_rOther.m_iIndex > m_iIndex;
160 }

◆ operator>=()

template<class T>
TBOOL T2DynamicVector< T >::Iterator::operator>= ( const Iterator & a_rOther) const
inlinenoexcept

Definition at line 162 of file T2DynamicVector.h.

163 {
164 return a_rOther.m_pVector == m_pVector && a_rOther.m_iIndex >= m_iIndex;
165 }

◆ Prev()

template<class T>
Iterator T2DynamicVector< T >::Iterator::Prev ( ) const
inline

Definition at line 115 of file T2DynamicVector.h.

116 {
117 Iterator temp = *this;
118 temp.m_iIndex -= 1;
119 return temp;
120 }

◆ Value() [1/2]

template<class T>
T & T2DynamicVector< T >::Iterator::Value ( )
inline

Definition at line 94 of file T2DynamicVector.h.

95 {
96 TASSERT( m_iIndex >= 0 );
97 TASSERT( m_pVector );
98 return m_pVector->At( m_iIndex );
99 }

◆ Value() [2/2]

template<class T>
const T & T2DynamicVector< T >::Iterator::Value ( ) const
inline

Definition at line 101 of file T2DynamicVector.h.

102 {
103 TASSERT( m_iIndex >= 0 );
104 TASSERT( m_pVector );
105 return m_pVector->At( m_iIndex );
106 }

Member Data Documentation

◆ T2DynamicVector

template<class T>
friend T2DynamicVector< T >::Iterator::T2DynamicVector

Definition at line 56 of file T2DynamicVector.h.


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