#include <List.h>
Public Types | |
typedef ConstListIterator< T > | ConstIterator |
typedef ListIterator< T > | Iterator |
Public Member Functions | |
virtual void | Add (const T &rValue) |
virtual void | Add (const List &rValue) |
virtual const T & | Back () const |
kt_int32s | BinarySearch (const T &rValue, kt_int32s(*f)(const T &a, const T &b)) |
virtual void | Clear () |
virtual kt_bool | Contains (const T &rValue) const |
void | EnsureCapacity (kt_size_t newCapacity) |
T * | Find (const T &rValue) |
virtual const T & | Front () const |
virtual T & | Get (kt_size_t index) |
virtual const T & | Get (kt_size_t index) const |
virtual ConstListIterator< T > | GetConstIterator () const |
virtual ListIterator< T > | GetIterator () |
virtual kt_bool | IsEmpty () const |
List () | |
List (kt_size_t size) | |
List (const List &rOther) | |
List & | operator= (const List &rOther) |
kt_bool | operator== (const List &rOther) const |
T & | operator[] (kt_size_t index) |
const T & | operator[] (kt_size_t index) const |
virtual kt_bool | Remove (const T &rValue) |
virtual void | RemoveAt (kt_size_t index) |
virtual void | Resize (kt_size_t newSize) |
void | Set (kt_size_t index, const T &rValue) |
virtual kt_size_t | Size () const |
virtual | ~List () |
Private Member Functions | |
void | Reset () |
Private Attributes | |
kt_size_t | m_Capacity |
T * | m_pElements |
kt_size_t | m_Size |
List class with boundary check. Any class that is used with List MUST implement operator==. Implementation notes: Do NOT use memcpy/memset (does not work with smart pointers)
typedef ConstListIterator<T> karto::List< T >::ConstIterator |
typedef ListIterator<T> karto::List< T >::Iterator |
karto::List< T >::List | ( | ) | [inline] |
karto::List< T >::List | ( | kt_size_t | size | ) | [inline] |
karto::List< T >::List | ( | const List< T > & | rOther | ) | [inline] |
virtual karto::List< T >::~List | ( | ) | [inline, virtual] |
virtual void karto::List< T >::Add | ( | const T & | rValue | ) | [inline, virtual] |
virtual void karto::List< T >::Add | ( | const List< T > & | rValue | ) | [inline, virtual] |
virtual const T& karto::List< T >::Back | ( | ) | const [inline, virtual] |
kt_int32s karto::List< T >::BinarySearch | ( | const T & | rValue, |
kt_int32s(*)(const T &a, const T &b) | f | ||
) | [inline] |
Searches for value in list using given comparator f. Elements must be in sorted order for this function to work properly.
rValue | value to search for |
f | comparator takes two elements; returns 0 if the elements are equal, a value less than 0 if the first value is less than the second value, and a value greater than 0 if the first value is greater than the second value |
virtual void karto::List< T >::Clear | ( | ) | [inline, virtual] |
virtual kt_bool karto::List< T >::Contains | ( | const T & | rValue | ) | const [inline, virtual] |
void karto::List< T >::EnsureCapacity | ( | kt_size_t | newCapacity | ) | [inline] |
T* karto::List< T >::Find | ( | const T & | rValue | ) | [inline] |
virtual const T& karto::List< T >::Front | ( | ) | const [inline, virtual] |
virtual T& karto::List< T >::Get | ( | kt_size_t | index | ) | [inline, virtual] |
virtual const T& karto::List< T >::Get | ( | kt_size_t | index | ) | const [inline, virtual] |
virtual ConstListIterator<T> karto::List< T >::GetConstIterator | ( | ) | const [inline, virtual] |
virtual ListIterator<T> karto::List< T >::GetIterator | ( | ) | [inline, virtual] |
virtual kt_bool karto::List< T >::IsEmpty | ( | ) | const [inline, virtual] |
List& karto::List< T >::operator= | ( | const List< T > & | rOther | ) | [inline] |
kt_bool karto::List< T >::operator== | ( | const List< T > & | rOther | ) | const [inline] |
T& karto::List< T >::operator[] | ( | kt_size_t | index | ) | [inline] |
const T& karto::List< T >::operator[] | ( | kt_size_t | index | ) | const [inline] |
virtual kt_bool karto::List< T >::Remove | ( | const T & | rValue | ) | [inline, virtual] |
virtual void karto::List< T >::RemoveAt | ( | kt_size_t | index | ) | [inline, virtual] |
void karto::List< T >::Reset | ( | ) | [inline, private] |
virtual void karto::List< T >::Resize | ( | kt_size_t | newSize | ) | [inline, virtual] |
void karto::List< T >::Set | ( | kt_size_t | index, |
const T & | rValue | ||
) | [inline] |
virtual kt_size_t karto::List< T >::Size | ( | ) | const [inline, virtual] |
kt_size_t karto::List< T >::m_Capacity [private] |
T* karto::List< T >::m_pElements [private] |
kt_size_t karto::List< T >::m_Size [private] |