OpenBarnyard
 
Loading...
Searching...
No Matches
T2Vector< T, MaxSize >::Iterator Class Reference

#include <T2Vector.h>

Public Member Functions

constexpr Iterator (T2Vector *a_pVector)
 
constexpr Iterator (TINT a_iIndex, T2Vector *a_pVector)
 
constexpr Iterator (const Iterator &a_rOther)
 
constexpr TINT Index () const noexcept
 
T * Get () noexcept
 
const T * Get () const noexcept
 
T & Value () noexcept
 
const T & Value () const noexcept
 
Iterator Next () const
 
Iterator Prev () const
 
 operator T* ()
 
 operator const T * () const
 
T & operator* () noexcept
 
const T & operator* () const noexcept
 
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 Iterator operator++ (TINT) noexcept
 
constexpr Iterator operator-- (TINT) noexcept
 
constexpr Iteratoroperator++ () noexcept
 
constexpr Iteratoroperator-- () noexcept
 
constexpr Iteratoroperator= (const Iterator &a_rOther) noexcept
 
Iterator operator+ (TINT a_uiValue) const noexcept
 
Iterator operator- (TINT a_uiValue) const noexcept
 
Iteratoroperator+= (TINT a_uiValue) const noexcept
 
Iteratoroperator-= (TINT a_uiValue) const noexcept
 

Friends

class T2Vector
 

Detailed Description

template<typename T, TINT MaxSize>
class T2Vector< T, MaxSize >::Iterator

Definition at line 9 of file T2Vector.h.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

template<typename T, TINT MaxSize>
T2Vector< T, MaxSize >::Iterator::Iterator ( T2Vector * a_pVector)
inlineconstexpr

Definition at line 15 of file T2Vector.h.

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

◆ Iterator() [2/3]

template<typename T, TINT MaxSize>
T2Vector< T, MaxSize >::Iterator::Iterator ( TINT a_iIndex,
T2Vector * a_pVector )
inlineconstexpr

Definition at line 17 of file T2Vector.h.

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

◆ Iterator() [3/3]

template<typename T, TINT MaxSize>
T2Vector< T, MaxSize >::Iterator::Iterator ( const Iterator & a_rOther)
inlineconstexpr

Definition at line 19 of file T2Vector.h.

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

Member Function Documentation

◆ Get() [1/2]

template<typename T, TINT MaxSize>
const T * T2Vector< T, MaxSize >::Iterator::Get ( ) const
inlinenoexcept

Definition at line 32 of file T2Vector.h.

33 {
34 return &m_pVector->At( m_iIndex );
35 }

◆ Get() [2/2]

template<typename T, TINT MaxSize>
T * T2Vector< T, MaxSize >::Iterator::Get ( )
inlinenoexcept

Definition at line 27 of file T2Vector.h.

28 {
29 return &m_pVector->At( m_iIndex );
30 }

◆ Index()

template<typename T, TINT MaxSize>
TINT T2Vector< T, MaxSize >::Iterator::Index ( ) const
inlineconstexprnoexcept

Definition at line 22 of file T2Vector.h.

23 {
24 return m_iIndex;
25 }

◆ Next()

template<typename T, TINT MaxSize>
Iterator T2Vector< T, MaxSize >::Iterator::Next ( ) const
inline

Definition at line 47 of file T2Vector.h.

48 {
49 Iterator temp = *this;
50 temp.m_iIndex += 1;
51 return temp;
52 }
constexpr Iterator(T2Vector *a_pVector)
Definition T2Vector.h:15

◆ operator const T *()

template<typename T, TINT MaxSize>
T2Vector< T, MaxSize >::Iterator::operator const T * ( ) const
inline

Definition at line 66 of file T2Vector.h.

67 {
68 return &Value();
69 }
T & Value() noexcept
Definition T2Vector.h:37

◆ operator T*()

template<typename T, TINT MaxSize>
T2Vector< T, MaxSize >::Iterator::operator T* ( )
inline

Definition at line 61 of file T2Vector.h.

62 {
63 return &Value();
64 }

◆ operator*() [1/2]

template<typename T, TINT MaxSize>
const T & T2Vector< T, MaxSize >::Iterator::operator* ( ) const
inlinenoexcept

Definition at line 76 of file T2Vector.h.

77 {
78 return Value();
79 }

◆ operator*() [2/2]

template<typename T, TINT MaxSize>
T & T2Vector< T, MaxSize >::Iterator::operator* ( )
inlinenoexcept

Definition at line 71 of file T2Vector.h.

72 {
73 return Value();
74 }

◆ operator+()

template<typename T, TINT MaxSize>
Iterator T2Vector< T, MaxSize >::Iterator::operator+ ( TINT a_uiValue) const
inlinenoexcept

Definition at line 149 of file T2Vector.h.

150 {
151 TASSERT( m_iIndex + a_uiValue < m_pVector->Size() );
152 return Iterator( m_iIndex + a_uiValue, m_pVector );
153 }
#define TASSERT(X,...)
Definition Defines.h:138
TINT Size() const
Definition T2Vector.h:325

◆ operator++() [1/2]

template<typename T, TINT MaxSize>
Iterator & T2Vector< T, MaxSize >::Iterator::operator++ ( )
inlineconstexprnoexcept

Definition at line 130 of file T2Vector.h.

131 {
132 m_iIndex++;
133 return *this;
134 }

◆ operator++() [2/2]

template<typename T, TINT MaxSize>
Iterator T2Vector< T, MaxSize >::Iterator::operator++ ( TINT )
inlineconstexprnoexcept

Definition at line 116 of file T2Vector.h.

117 {
118 Iterator temp = *this;
119 m_iIndex++;
120 return temp;
121 }

◆ operator+=()

template<typename T, TINT MaxSize>
Iterator & T2Vector< T, MaxSize >::Iterator::operator+= ( TINT a_uiValue) const
inlinenoexcept

Definition at line 161 of file T2Vector.h.

162 {
163 TASSERT( m_iIndex + a_uiValue < m_pVector->Size() );
164 m_iIndex += a_uiValue;
165 return *this;
166 }

◆ operator-()

template<typename T, TINT MaxSize>
Iterator T2Vector< T, MaxSize >::Iterator::operator- ( TINT a_uiValue) const
inlinenoexcept

Definition at line 155 of file T2Vector.h.

156 {
157 TASSERT( m_iIndex - a_uiValue < m_pVector->Size() );
158 return Iterator( m_iIndex - a_uiValue, m_pVector );
159 }

◆ operator--() [1/2]

template<typename T, TINT MaxSize>
Iterator & T2Vector< T, MaxSize >::Iterator::operator-- ( )
inlineconstexprnoexcept

Definition at line 136 of file T2Vector.h.

137 {
138 m_iIndex--;
139 return *this;
140 }

◆ operator--() [2/2]

template<typename T, TINT MaxSize>
Iterator T2Vector< T, MaxSize >::Iterator::operator-- ( TINT )
inlineconstexprnoexcept

Definition at line 123 of file T2Vector.h.

124 {
125 Iterator temp = *this;
126 m_iIndex--;
127 return temp;
128 }

◆ operator-=()

template<typename T, TINT MaxSize>
Iterator & T2Vector< T, MaxSize >::Iterator::operator-= ( TINT a_uiValue) const
inlinenoexcept

Definition at line 168 of file T2Vector.h.

169 {
170 TASSERT( m_iIndex - a_uiValue < m_pVector->Size() );
171 m_iIndex -= a_uiValue;
172 return *this;
173 }

◆ operator->() [1/2]

template<typename T, TINT MaxSize>
const T * T2Vector< T, MaxSize >::Iterator::operator-> ( ) const
inlinenoexcept

Definition at line 86 of file T2Vector.h.

87 {
88 return &Value();
89 }

◆ operator->() [2/2]

template<typename T, TINT MaxSize>
T * T2Vector< T, MaxSize >::Iterator::operator-> ( )
inlinenoexcept

Definition at line 81 of file T2Vector.h.

82 {
83 return &Value();
84 }

◆ operator<()

template<typename T, TINT MaxSize>
TBOOL T2Vector< T, MaxSize >::Iterator::operator< ( const Iterator & a_rOther) const
inlinenoexcept

Definition at line 106 of file T2Vector.h.

107 {
108 return a_rOther.m_pVector == m_pVector && a_rOther.m_iIndex < m_iIndex;
109 }

◆ operator<=()

template<typename T, TINT MaxSize>
TBOOL T2Vector< T, MaxSize >::Iterator::operator<= ( const Iterator & a_rOther) const
inlinenoexcept

Definition at line 111 of file T2Vector.h.

112 {
113 return a_rOther.m_pVector == m_pVector && a_rOther.m_iIndex <= m_iIndex;
114 }

◆ operator=()

template<typename T, TINT MaxSize>
Iterator & T2Vector< T, MaxSize >::Iterator::operator= ( const Iterator & a_rOther)
inlineconstexprnoexcept

Definition at line 142 of file T2Vector.h.

143 {
144 m_iIndex = a_rOther.m_iIndex;
145 m_pVector = a_rOther.m_pVector;
146 return *this;
147 }

◆ operator==()

template<typename T, TINT MaxSize>
TBOOL T2Vector< T, MaxSize >::Iterator::operator== ( const Iterator & a_rOther) const
inlinenoexcept

Definition at line 91 of file T2Vector.h.

92 {
93 return a_rOther.m_pVector == m_pVector && a_rOther.m_iIndex == m_iIndex;
94 }

◆ operator>()

template<typename T, TINT MaxSize>
TBOOL T2Vector< T, MaxSize >::Iterator::operator> ( const Iterator & a_rOther) const
inlinenoexcept

Definition at line 96 of file T2Vector.h.

97 {
98 return a_rOther.m_pVector == m_pVector && a_rOther.m_iIndex > m_iIndex;
99 }

◆ operator>=()

template<typename T, TINT MaxSize>
TBOOL T2Vector< T, MaxSize >::Iterator::operator>= ( const Iterator & a_rOther) const
inlinenoexcept

Definition at line 101 of file T2Vector.h.

102 {
103 return a_rOther.m_pVector == m_pVector && a_rOther.m_iIndex >= m_iIndex;
104 }

◆ Prev()

template<typename T, TINT MaxSize>
Iterator T2Vector< T, MaxSize >::Iterator::Prev ( ) const
inline

Definition at line 54 of file T2Vector.h.

55 {
56 Iterator temp = *this;
57 temp.m_iIndex -= 1;
58 return temp;
59 }

◆ Value() [1/2]

template<typename T, TINT MaxSize>
const T & T2Vector< T, MaxSize >::Iterator::Value ( ) const
inlinenoexcept

Definition at line 42 of file T2Vector.h.

43 {
44 return m_pVector->At( m_iIndex );
45 }

◆ Value() [2/2]

template<typename T, TINT MaxSize>
T & T2Vector< T, MaxSize >::Iterator::Value ( )
inlinenoexcept

Definition at line 37 of file T2Vector.h.

38 {
39 return m_pVector->At( m_iIndex );
40 }

Friends And Related Symbol Documentation

◆ T2Vector

template<typename T, TINT MaxSize>
friend class T2Vector
friend

Definition at line 12 of file T2Vector.h.


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