Tizen Native API
5.0
|
Vector class with minimum space allocation when it's empty. More...
Public Types | |
enum | |
Enumeration for BaseType. More... | |
typedef VectorBase::SizeType | SizeType |
Type definitions. | |
typedef T * | Iterator |
Most simple Iterator is a pointer. | |
typedef const T * | ConstIterator |
Const iterator. | |
typedef T | ItemType |
Item type. | |
Public Member Functions | |
Vector () | |
Default constructor. Does not allocate any space. | |
~Vector () | |
Destructor. Releases the allocated space. | |
Vector (const Vector &vector) | |
Copy constructor. | |
Vector & | operator= (const Vector &vector) |
Assignment operator. | |
Iterator | Begin () const |
Iterator to the beginning of the data. | |
Iterator | End () const |
Iterator to the end of the data (one past last element). | |
Iterator | begin () const |
Iterator | end () const |
ItemType & | operator[] (SizeType index) |
Subscript operator. | |
const ItemType & | operator[] (SizeType index) const |
Subscript operator. | |
void | PushBack (const ItemType &element) |
Pushes back an element to the vector. | |
void | Insert (Iterator at, const ItemType &element) |
Inserts an element to the vector. | |
void | Insert (Iterator at, Iterator from, Iterator to) |
Inserts the given elements into the vector. | |
void | Reserve (SizeType count) |
Reserves space in the vector. | |
void | Resize (SizeType count) |
Resizes the vector. Does not change capacity. | |
void | Resize (SizeType count, const ItemType &item) |
Resizes the vector. Does not change capacity. | |
Iterator | Erase (Iterator iterator) |
Erases an element. | |
Iterator | Erase (Iterator first, Iterator last) |
Erases a range of elements. | |
void | Remove (Iterator iterator) |
Removes an element. | |
void | Swap (Vector &vector) |
Swaps the contents of two vectors. | |
void | Clear () |
Clears the contents of the vector. Keeps its capacity. | |
void | Release () |
Releases the memory that the vector holds. |
Vector class with minimum space allocation when it's empty.
type | The type of the data that the vector holds |
typedef const T* Dali::Vector< T, IsTrivialType >::ConstIterator |
Const iterator.
typedef T Dali::Vector< T, IsTrivialType >::ItemType |
Item type.
typedef T* Dali::Vector< T, IsTrivialType >::Iterator |
Most simple Iterator is a pointer.
typedef VectorBase::SizeType Dali::Vector< T, IsTrivialType >::SizeType |
Type definitions.
Reimplemented from Dali::VectorAlgorithms< IsTrivialType >.
anonymous enum |
Dali::Vector< T, IsTrivialType >::Vector | ( | ) |
Default constructor. Does not allocate any space.
Dali::Vector< T, IsTrivialType >::~Vector | ( | ) |
Destructor. Releases the allocated space.
Dali::Vector< T, IsTrivialType >::Vector | ( | const Vector< T, IsTrivialType > & | vector | ) |
Iterator Dali::Vector< T, IsTrivialType >::Begin | ( | ) | const |
Iterator to the beginning of the data.
Iterator Dali::Vector< T, IsTrivialType >::begin | ( | ) | const |
Support for C++11 Range-based for loop: for( item : container ).
void Dali::Vector< T, IsTrivialType >::Clear | ( | ) |
Clears the contents of the vector. Keeps its capacity.
Reimplemented from Dali::VectorAlgorithms< IsTrivialType >.
Iterator Dali::Vector< T, IsTrivialType >::End | ( | ) | const |
Iterator to the end of the data (one past last element).
Iterator Dali::Vector< T, IsTrivialType >::end | ( | ) | const |
Support for C++11 Range-based for loop: for( item : container ).
Iterator Dali::Vector< T, IsTrivialType >::Erase | ( | Iterator | iterator | ) |
Erases an element.
Does not change capacity. Other elements get moved.
[in] | iterator | Iterator pointing to the item to remove |
Iterator Dali::Vector< T, IsTrivialType >::Erase | ( | Iterator | first, |
Iterator | last | ||
) |
Erases a range of elements.
Does not change capacity. Other elements get moved.
[in] | first | Iterator to the first element to be erased |
[in] | last | Iterator to the last element to be erased |
void Dali::Vector< T, IsTrivialType >::Insert | ( | Iterator | at, |
const ItemType & | element | ||
) |
Inserts an element to the vector.
Elements after at are moved one position to the right.
The underlying storage may be reallocated to provide space. If this occurs, all pre-existing pointers into the vector will become invalid.
[in] | at | Iterator where to insert the elements into the vector |
[in] | element | An element to be added |
void Dali::Vector< T, IsTrivialType >::Insert | ( | Iterator | at, |
Iterator | from, | ||
Iterator | to | ||
) |
Inserts the given elements into the vector.
Elements after at are moved the number of given elements positions to the right.
The underlying storage may be reallocated to provide space. If this occurs, all pre-existing pointers into the vector will become invalid.
[in] | at | Iterator where to insert the elements into the vector |
[in] | from | Iterator to the first element to be inserted |
[in] | to | Iterator to the last element to be inserted |
Vector& Dali::Vector< T, IsTrivialType >::operator= | ( | const Vector< T, IsTrivialType > & | vector | ) |
Assignment operator.
[in] | vector | Vector to assign from |
ItemType& Dali::Vector< T, IsTrivialType >::operator[] | ( | SizeType | index | ) |
Subscript operator.
[in] | index | Index of the element |
const ItemType& Dali::Vector< T, IsTrivialType >::operator[] | ( | SizeType | index | ) | const |
Subscript operator.
[in] | index | Index of the element |
void Dali::Vector< T, IsTrivialType >::PushBack | ( | const ItemType & | element | ) |
Pushes back an element to the vector.
The underlying storage may be reallocated to provide space. If this occurs, all pre-existing pointers into the vector will become invalid.
[in] | element | Element to be added |
void Dali::Vector< T, IsTrivialType >::Release | ( | ) |
Releases the memory that the vector holds.
Reimplemented from Dali::VectorAlgorithms< IsTrivialType >.
void Dali::Vector< T, IsTrivialType >::Remove | ( | Iterator | iterator | ) |
Removes an element.
Does not maintain order. Swaps the element with end and decreases size by one. This is much faster than Erase so use this in case order does not matter. Does not change capacity.
[in] | iterator | Iterator pointing to the item to remove |
void Dali::Vector< T, IsTrivialType >::Reserve | ( | SizeType | count | ) |
Reserves space in the vector.
Reserving less than current Capacity is a no-op.
[in] | count | Count of elements to reserve |
void Dali::Vector< T, IsTrivialType >::Resize | ( | SizeType | count | ) |
Resizes the vector. Does not change capacity.
[in] | count | Count to resize to |
void Dali::Vector< T, IsTrivialType >::Resize | ( | SizeType | count, |
const ItemType & | item | ||
) |
Resizes the vector. Does not change capacity.
[in] | count | Count to resize to |
[in] | item | An item to insert to the new indices |
void Dali::Vector< T, IsTrivialType >::Swap | ( | Vector< T, IsTrivialType > & | vector | ) |
Swaps the contents of two vectors.
[in] | vector | Vector to swap with |