#include <base_types_array.hh>
Public Types | |
| typedef T | Type |
Public Member Functions | |
| SortedArray (const uint size_=0) | |
| SortedArray (const SortedArray< T > &src) | |
| ~SortedArray () | |
| const T & | operator[] (uint i) const |
| SortedArray< T > & | operator= (const SortedArray< T > &src) |
| bool | operator== (const SortedArray< T > &src) const |
| bool | operator!= (const SortedArray< T > &src) const |
| bool | operator< (const SortedArray< T > &src) const |
| uint | size (void) const |
| void | resize (const uint size_) |
| void | clear (void) |
| bool | empty (void) const |
| pair< bool, uint > | find (const T item) const |
| pair< bool, uint > | find_first (const T item) const |
| |
| pair< bool, uint > | find_last (const T item) const |
| |
| uint | insert_last (const T item) |
| void | remove_idx (const uint idx) |
| Directly remove one item by its index. | |
| pair< bool, uint > | remove_first (const T item) |
Private Attributes | |
| CONTAINER | mArray |
This is implemented by a STL vector that stays sorted. Elements can be inserted and removed. Intentionally, only the const operator[] is provided, to encourage using insert() instead of writing by operator[].
insert() inserts a item in sorted order. The order of equal items is the chronological order they were inserted (the newest equal item will follow older equal items).
Graph depends on this order of insertion for younger sibling nodes to follow older siblings.
| typedef T base::SortedArray< T, CONTAINER >::Type |
| base::SortedArray< T, CONTAINER >::SortedArray | ( | const uint | size_ = 0 |
) | [inline] |
| base::SortedArray< T, CONTAINER >::SortedArray | ( | const SortedArray< T > & | src | ) | [inline] |
| base::SortedArray< T, CONTAINER >::~SortedArray | ( | ) | [inline] |
| const T& base::SortedArray< T, CONTAINER >::operator[] | ( | uint | i | ) | const [inline] |
| SortedArray<T>& base::SortedArray< T, CONTAINER >::operator= | ( | const SortedArray< T > & | src | ) | [inline] |
| bool base::SortedArray< T, CONTAINER >::operator== | ( | const SortedArray< T > & | src | ) | const [inline] |
| bool base::SortedArray< T, CONTAINER >::operator!= | ( | const SortedArray< T > & | src | ) | const [inline] |
| bool base::SortedArray< T, CONTAINER >::operator< | ( | const SortedArray< T > & | src | ) | const [inline] |
| uint base::SortedArray< T, CONTAINER >::size | ( | void | ) | const [inline] |
| void base::SortedArray< T, CONTAINER >::resize | ( | const uint | size_ | ) | [inline] |
| void base::SortedArray< T, CONTAINER >::clear | ( | void | ) | [inline] |
| bool base::SortedArray< T, CONTAINER >::empty | ( | void | ) | const [inline] |
| pair<bool,uint> base::SortedArray< T, CONTAINER >::find | ( | const T | item | ) | const [inline] |
| pair<bool,uint> base::SortedArray< T, CONTAINER >::find_first | ( | const T | item | ) | const [inline] |
| pair<bool,uint> base::SortedArray< T, CONTAINER >::find_last | ( | const T | item | ) | const [inline] |
| uint base::SortedArray< T, CONTAINER >::insert_last | ( | const T | item | ) | [inline] |
Insert item according to order.
| void base::SortedArray< T, CONTAINER >::remove_idx | ( | const uint | idx | ) | [inline] |
Directly remove one item by its index.
| pair<bool,uint> base::SortedArray< T, CONTAINER >::remove_first | ( | const T | item | ) | [inline] |
Removes the first item having an equal value.
CONTAINER base::SortedArray< T, CONTAINER >::mArray [private] |
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:20 2007