OpenBarnyard
 
Loading...
Searching...
No Matches
T2SortedVector< T, Container, SortResults > Class Template Reference

#include <T2SortedVector.h>

Inheritance diagram for T2SortedVector< T, Container, SortResults >:

Public Types

using Iterator = Container::Iterator
 

Public Member Functions

template<class... Args>
 T2SortedVector (Args &&... args)
 
 ~T2SortedVector ()=default
 
Iterator FindInsertionPoint (const T &a_rcValue, TBOOL &a_rbNotUnique)
 
Iterator Push (const T &a_rValue)
 
Iterator Push (const T *a_pValue)
 
Iterator ReInsert (const T &a_rcItem)
 
Iterator ReInsert (const T *a_pValue)
 
void PopBack ()
 
void PopFront ()
 
void Clear ()
 
Iterator Find (const T &a_rValue)
 
void Erase (const Iterator &a_rIterator)
 
void FindAndErase (const T &a_rcItem)
 
void EraseFast (const Iterator &a_rIterator)
 
void FindAndEraseFast (const T &a_rcItem)
 
TINT Size () const
 
TINT Capacity () const
 
TBOOL IsEmpty () const
 
Iterator Front ()
 
Iterator Back ()
 
Iterator Begin ()
 
Iterator End ()
 
T & At (TINT a_iIndex)
 
const T & At (TINT a_iIndex) const
 
T & operator[] (TINT a_iIndex)
 
const T & operator[] (TINT a_iIndex) const
 
Container * AccessContainer ()
 

Detailed Description

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
class T2SortedVector< T, Container, SortResults >

Definition at line 23 of file T2SortedVector.h.

Member Typedef Documentation

◆ Iterator

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
using T2SortedVector< T, Container, SortResults >::Iterator = Container::Iterator

Definition at line 26 of file T2SortedVector.h.

Constructor & Destructor Documentation

◆ T2SortedVector()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
template<class... Args>
T2SortedVector< T, Container, SortResults >::T2SortedVector ( Args &&... args)
inline

Definition at line 30 of file T2SortedVector.h.

◆ ~T2SortedVector()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
T2SortedVector< T, Container, SortResults >::~T2SortedVector ( )
default

Member Function Documentation

◆ AccessContainer()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
Container * T2SortedVector< T, Container, SortResults >::AccessContainer ( )
inline

Definition at line 124 of file T2SortedVector.h.

124{ return TSTATICCAST( Container, this ); }
#define TSTATICCAST(POINTERTYPE, VALUE)
Definition Defines.h:69

◆ At() [1/2]

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
T & T2SortedVector< T, Container, SortResults >::At ( TINT a_iIndex)
inline

Definition at line 118 of file T2SortedVector.h.

118{ return Container::At( a_iIndex ); }

◆ At() [2/2]

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
const T & T2SortedVector< T, Container, SortResults >::At ( TINT a_iIndex) const
inline

Definition at line 119 of file T2SortedVector.h.

119{ return Container::At( a_iIndex ); }

◆ Back()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
Iterator T2SortedVector< T, Container, SortResults >::Back ( )
inline

Definition at line 114 of file T2SortedVector.h.

114{ return Container::Back(); }

◆ Begin()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
Iterator T2SortedVector< T, Container, SortResults >::Begin ( )
inline

Definition at line 115 of file T2SortedVector.h.

115{ return Container::Begin(); }

◆ Capacity()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
TINT T2SortedVector< T, Container, SortResults >::Capacity ( ) const
inline

Definition at line 110 of file T2SortedVector.h.

110{ return Container::Capacity(); }

◆ Clear()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
void T2SortedVector< T, Container, SortResults >::Clear ( )
inline

Definition at line 101 of file T2SortedVector.h.

101{ Container::Clear(); }

◆ End()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
Iterator T2SortedVector< T, Container, SortResults >::End ( )
inline

Definition at line 116 of file T2SortedVector.h.

116{ return Container::End(); }

◆ Erase()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
void T2SortedVector< T, Container, SortResults >::Erase ( const Iterator & a_rIterator)
inline

Definition at line 104 of file T2SortedVector.h.

◆ EraseFast()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
void T2SortedVector< T, Container, SortResults >::EraseFast ( const Iterator & a_rIterator)
inline

Definition at line 106 of file T2SortedVector.h.

◆ Find()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
Iterator T2SortedVector< T, Container, SortResults >::Find ( const T & a_rValue)
inline

Definition at line 103 of file T2SortedVector.h.

103{ return Container::Find( a_rValue ); }

◆ FindAndErase()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
void T2SortedVector< T, Container, SortResults >::FindAndErase ( const T & a_rcItem)
inline

Definition at line 105 of file T2SortedVector.h.

◆ FindAndEraseFast()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
void T2SortedVector< T, Container, SortResults >::FindAndEraseFast ( const T & a_rcItem)
inline

Definition at line 107 of file T2SortedVector.h.

◆ FindInsertionPoint()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
Iterator T2SortedVector< T, Container, SortResults >::FindInsertionPoint ( const T & a_rcValue,
TBOOL & a_rbNotUnique )
inline

Definition at line 37 of file T2SortedVector.h.

38 {
42
43 while ( iSearchStart <= iSearchEnd )
44 {
47
48 if ( iSortResult < 0 )
49 {
50 // Should look for the insertion place at the left side
51 iSearchEnd = iMiddle - 1;
52 }
53 else if ( iSortResult > 0 )
54 {
55 // Should look for the insertion place at the right side
57 }
58 else
59 {
60 // We found an item that is equal to this
61 // Now, skip all equal items to prevent order changes
62 iSearchStart += 1;
63
64 while ( iSearchStart <= iSearchEnd &&
66 {
67 iSearchStart += 1;
68 }
69
71 break;
72 }
73 }
74
75 return Iterator( iSearchStart, this );
76 }
Container::Iterator Iterator

◆ Front()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
Iterator T2SortedVector< T, Container, SortResults >::Front ( )
inline

Definition at line 113 of file T2SortedVector.h.

113{ return Container::Front(); }

◆ IsEmpty()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
TBOOL T2SortedVector< T, Container, SortResults >::IsEmpty ( ) const
inline

Definition at line 111 of file T2SortedVector.h.

111{ return Container::IsEmpty(); }

◆ operator[]() [1/2]

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
T & T2SortedVector< T, Container, SortResults >::operator[] ( TINT a_iIndex)
inline

Definition at line 121 of file T2SortedVector.h.

121{ return Container::At( a_iIndex ); }

◆ operator[]() [2/2]

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
const T & T2SortedVector< T, Container, SortResults >::operator[] ( TINT a_iIndex) const
inline

Definition at line 122 of file T2SortedVector.h.

122{ return Container::At( a_iIndex ); }

◆ PopBack()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
void T2SortedVector< T, Container, SortResults >::PopBack ( )
inline

Definition at line 98 of file T2SortedVector.h.

◆ PopFront()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
void T2SortedVector< T, Container, SortResults >::PopFront ( )
inline

Definition at line 99 of file T2SortedVector.h.

◆ Push() [1/2]

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
Iterator T2SortedVector< T, Container, SortResults >::Push ( const T & a_rValue)
inline

Definition at line 78 of file T2SortedVector.h.

79 {
82 }
Iterator FindInsertionPoint(const T &a_rcValue, TBOOL &a_rbNotUnique)

◆ Push() [2/2]

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
Iterator T2SortedVector< T, Container, SortResults >::Push ( const T * a_pValue)
inline

Definition at line 84 of file T2SortedVector.h.

84{ return Push( *a_pValue ); }
Iterator Push(const T &a_rValue)

◆ ReInsert() [1/2]

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
Iterator T2SortedVector< T, Container, SortResults >::ReInsert ( const T & a_rcItem)
inline

Definition at line 86 of file T2SortedVector.h.

87 {
89
90 return Push( a_rcItem );
91 }
void FindAndErase(const T &a_rcItem)

◆ ReInsert() [2/2]

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
Iterator T2SortedVector< T, Container, SortResults >::ReInsert ( const T * a_pValue)
inline

Definition at line 93 of file T2SortedVector.h.

94 {
95 return ReInsert( *a_pValue );
96 }
Iterator ReInsert(const T &a_rcItem)

◆ Size()

template<typename T, typename Container, typename SortResults = T2SortedVectorDefaultSortResults<T>>
TINT T2SortedVector< T, Container, SortResults >::Size ( ) const
inline

Definition at line 109 of file T2SortedVector.h.

109{ return Container::Size(); }

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