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

#include <T2SortedList.h>

Inheritance diagram for T2SortedList< T, Container, SortResults >:
T2DList< T >

Public Types

using Iterator = Container::Iterator
 
using Node = Container::Node
 

Public Member Functions

 T2SortedList ()=default
 
 ~T2SortedList ()=default
 
Iterator FindInsertionPoint (const T &a_rcValue)
 
Iterator Push (T &a_rValue)
 
Iterator Push (T *a_pValue)
 
T * PopBack ()
 
T * PopFront ()
 
Iterator ReInsert (T &a_rValue)
 
Iterator ReInsert (T *a_pValue)
 
void Delete (Iterator a_It)
 
void DeleteAll ()
 
Iterator Erase (Iterator a_It)
 
TBOOL IsEmpty () const
 
TUINT Size () const
 
Iterator Head () const
 
Iterator Tail () const
 
Iterator Begin () const
 
Iterator RBegin () const
 
Iterator End () const
 
Iterator REnd () const
 
Iterator Front () const
 
Iterator Back () const
 
Container * AccessContainer ()
 
Container * operator-> ()
 

Detailed Description

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
class T2SortedList< T, Container, SortResults >

Definition at line 23 of file T2SortedList.h.

Member Typedef Documentation

◆ Iterator

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
using T2SortedList< T, Container, SortResults >::Iterator = Container::Iterator

Definition at line 26 of file T2SortedList.h.

◆ Node

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
using T2SortedList< T, Container, SortResults >::Node = Container::Node

Definition at line 27 of file T2SortedList.h.

Constructor & Destructor Documentation

◆ T2SortedList()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
T2SortedList< T, Container, SortResults >::T2SortedList ( )
default

◆ ~T2SortedList()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
T2SortedList< T, Container, SortResults >::~T2SortedList ( )
default

Member Function Documentation

◆ AccessContainer()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Container * T2SortedList< T, Container, SortResults >::AccessContainer ( )
inline

Definition at line 87 of file T2SortedList.h.

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

◆ Back()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Iterator T2SortedList< T, Container, SortResults >::Back ( ) const
inline

Definition at line 85 of file T2SortedList.h.

85{ return Container::Back(); }

◆ Begin()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Iterator T2SortedList< T, Container, SortResults >::Begin ( ) const
inline

Definition at line 80 of file T2SortedList.h.

80{ return Container::Begin(); }

◆ Delete()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
void T2SortedList< T, Container, SortResults >::Delete ( Iterator a_It)
inline

Definition at line 70 of file T2SortedList.h.

◆ DeleteAll()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
void T2SortedList< T, Container, SortResults >::DeleteAll ( )
inline

Definition at line 71 of file T2SortedList.h.

◆ End()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Iterator T2SortedList< T, Container, SortResults >::End ( ) const
inline

Definition at line 82 of file T2SortedList.h.

82{ return Container::End(); }

◆ Erase()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Iterator T2SortedList< T, Container, SortResults >::Erase ( Iterator a_It)
inline

Definition at line 73 of file T2SortedList.h.

73{ return Container::Erase( a_It ); }

◆ FindInsertionPoint()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Iterator T2SortedList< T, Container, SortResults >::FindInsertionPoint ( const T & a_rcValue)
inline

Definition at line 33 of file T2SortedList.h.

34 {
35 T2_FOREACH( *this, it )
36 {
37 if ( SortResults()( a_rcValue, *it.Get() ) < 0 )
38 return it;
39 }
40
41 return End();
42 }
#define T2_FOREACH(vecName, iteratorName)
Definition T2Iterator.h:4
Iterator End() const

◆ Front()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Iterator T2SortedList< T, Container, SortResults >::Front ( ) const
inline

Definition at line 84 of file T2SortedList.h.

84{ return Container::Front(); }

◆ Head()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Iterator T2SortedList< T, Container, SortResults >::Head ( ) const
inline

Definition at line 78 of file T2SortedList.h.

78{ return Container::Head(); }

◆ IsEmpty()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
TBOOL T2SortedList< T, Container, SortResults >::IsEmpty ( ) const
inline

Definition at line 75 of file T2SortedList.h.

75{ return Container::IsEmpty(); }

◆ operator->()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Container * T2SortedList< T, Container, SortResults >::operator-> ( )
inline

Definition at line 88 of file T2SortedList.h.

88{ return TSTATICCAST( Container, this ); }

◆ PopBack()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
T * T2SortedList< T, Container, SortResults >::PopBack ( )
inline

Definition at line 52 of file T2SortedList.h.

52{ return Container::PopBack(); }

◆ PopFront()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
T * T2SortedList< T, Container, SortResults >::PopFront ( )
inline

Definition at line 53 of file T2SortedList.h.

53{ return Container::PopFront(); }

◆ Push() [1/2]

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Iterator T2SortedList< T, Container, SortResults >::Push ( T & a_rValue)
inline

Definition at line 44 of file T2SortedList.h.

45 {
46 a_rValue.InsertBefore( FindInsertionPoint( a_rValue ) );
47 return &a_rValue;
48 }
Iterator FindInsertionPoint(const T &a_rcValue)

◆ Push() [2/2]

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Iterator T2SortedList< T, Container, SortResults >::Push ( T * a_pValue)
inline

Definition at line 50 of file T2SortedList.h.

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

◆ RBegin()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Iterator T2SortedList< T, Container, SortResults >::RBegin ( ) const
inline

Definition at line 81 of file T2SortedList.h.

81{ return Container::RBegin(); }

◆ ReInsert() [1/2]

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Iterator T2SortedList< T, Container, SortResults >::ReInsert ( T & a_rValue)
inline

Definition at line 56 of file T2SortedList.h.

57 {
58 if ( a_rValue.IsLinked() )
59 Erase( &a_rValue );
60
61 return Push( a_rValue );
62 }
Iterator Erase(Iterator a_It)

◆ ReInsert() [2/2]

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Iterator T2SortedList< T, Container, SortResults >::ReInsert ( T * a_pValue)
inline

Definition at line 65 of file T2SortedList.h.

66 {
67 return ReInsert( *a_pValue );
68 }
Iterator ReInsert(T &a_rValue)

◆ REnd()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Iterator T2SortedList< T, Container, SortResults >::REnd ( ) const
inline

Definition at line 83 of file T2SortedList.h.

83{ return Container::REnd(); }

◆ Size()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
TUINT T2SortedList< T, Container, SortResults >::Size ( ) const
inline

Definition at line 76 of file T2SortedList.h.

76{ return Container::Size(); }

◆ Tail()

template<typename T, typename Container = T2DList<T>, typename SortResults = T2SortedListDefaultSortResults<T>>
Iterator T2SortedList< T, Container, SortResults >::Tail ( ) const
inline

Definition at line 79 of file T2SortedList.h.

79{ return Container::Tail(); }

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