|
ACF $AcfVersion:0$
|
Implementation of a pointer container, which controls the live cycle of the pointer object. More...
#include <TPointerVector.h>
Public Types | |
| enum | { InvalidIndex = -1 } |
| typedef AccessAdapter::ElementType | ElementType |
Public Member Functions | |
| TPointerVector () | |
| TPointerVector (const TPointerVector &) | |
| ~TPointerVector () | |
| bool | IsEmpty () const |
| Check if there is element stored in this set. | |
| int | GetCount () const |
| Get number of stored elements. | |
| void | SetCount (int count) |
| Set number of elements. | |
| void | Reset () |
| Remove all elements. | |
| int | HasElement (const Pointer *elementPtr) const |
Check if some element is stored in this vector and return the index of the element, if anyone exists, otherwise return InvalidIndex. | |
| Pointer * | GetAt (int index) const |
| Get pointer at specified index. | |
| const ElementType & | GetElementAt (int index) const |
| Get element at specified index. | |
| void | SetElementAt (int index, const ElementType &element) |
| Set element at specified index. | |
| void | RemoveAt (int index) |
| Remove element at specified index. | |
| bool | Remove (Pointer *elementPtr) |
Remove element elementPtr. | |
| Pointer * | PopAt (int index) |
| Pop element at specified index. | |
| void | PushBack (const ElementType &element) |
| Add new element at the end of collection. | |
| void | InsertElementAt (int index, const ElementType &element) |
| Insert element at specified position. | |
| void | SwapElements (int index1, int index2) |
| Switch two elements. | |
Implementation of a pointer container, which controls the live cycle of the pointer object.
Definition at line 47 of file TPointerVector.h.
| typedef AccessAdapter::ElementType istd::TPointerVector< Pointer, AccessAdapter >::ElementType |
Definition at line 50 of file TPointerVector.h.
| anonymous enum |
| Enumerator | |
|---|---|
| InvalidIndex | Invalid index in the vector. |
Definition at line 52 of file TPointerVector.h.
|
inline |
Definition at line 154 of file TPointerVector.h.
| istd::TPointerVector< Pointer, AccessAdapter >::TPointerVector | ( | const TPointerVector< Pointer, AccessAdapter > & | ) |
| istd::TPointerVector< Pointer, AccessAdapter >::~TPointerVector | ( | ) |
Definition at line 183 of file TPointerVector.h.
| Pointer * istd::TPointerVector< Pointer, AccessAdapter >::GetAt | ( | int | index | ) | const |
Get pointer at specified index.
Definition at line 232 of file TPointerVector.h.
Referenced by iqt2d::TViewExtenderCompBase< Base >::AddItemsToScene(), and iqt2d::TViewExtenderCompBase< Base >::RemoveItemsFromScene().
|
inline |
Get number of stored elements.
Definition at line 174 of file TPointerVector.h.
Referenced by iqt2d::TViewExtenderCompBase< Base >::AddItemsToScene(), and iqt2d::TViewExtenderCompBase< Base >::RemoveItemsFromScene().
| const TPointerVector< Pointer, AccessAdapter >::ElementType & istd::TPointerVector< Pointer, AccessAdapter >::GetElementAt | ( | int | index | ) | const |
Get element at specified index.
Dependent on implementation of AccessAdapter it can differ from GetAt().
Definition at line 242 of file TPointerVector.h.
| int istd::TPointerVector< Pointer, AccessAdapter >::HasElement | ( | const Pointer * | elementPtr | ) | const |
Check if some element is stored in this vector and return the index of the element, if anyone exists, otherwise return InvalidIndex.
Definition at line 216 of file TPointerVector.h.
| void istd::TPointerVector< Pointer, AccessAdapter >::InsertElementAt | ( | int | index, |
| const ElementType & | element | ||
| ) |
Insert element at specified position.
Definition at line 316 of file TPointerVector.h.
|
inline |
Check if there is element stored in this set.
Definition at line 167 of file TPointerVector.h.
| Pointer * istd::TPointerVector< Pointer, AccessAdapter >::PopAt | ( | int | index | ) |
Pop element at specified index.
It does't delete pointed object, it removes it only from the vector.
Definition at line 295 of file TPointerVector.h.
| void istd::TPointerVector< Pointer, AccessAdapter >::PushBack | ( | const ElementType & | element | ) |
Add new element at the end of collection.
Definition at line 309 of file TPointerVector.h.
| bool istd::TPointerVector< Pointer, AccessAdapter >::Remove | ( | Pointer * | elementPtr | ) |
Remove element elementPtr.
The element will be deleted and removed from this vector. It means after call of this method number of elements will be decreased if pointer is found.
Definition at line 277 of file TPointerVector.h.
| void istd::TPointerVector< Pointer, AccessAdapter >::RemoveAt | ( | int | index | ) |
Remove element at specified index.
The element will be deleted and removed from this vector. It means after call of this method number of elements will be decreased.
Definition at line 263 of file TPointerVector.h.
| void istd::TPointerVector< Pointer, AccessAdapter >::Reset | ( | ) |
Remove all elements.
Definition at line 203 of file TPointerVector.h.
| void istd::TPointerVector< Pointer, AccessAdapter >::SetCount | ( | int | count | ) |
Set number of elements.
Definition at line 190 of file TPointerVector.h.
| void istd::TPointerVector< Pointer, AccessAdapter >::SetElementAt | ( | int | index, |
| const ElementType & | element | ||
| ) |
Set element at specified index.
Definition at line 252 of file TPointerVector.h.
| void istd::TPointerVector< Pointer, AccessAdapter >::SwapElements | ( | int | index1, |
| int | index2 | ||
| ) |
Switch two elements.
This operation is done very performant without any allocation.
Definition at line 327 of file TPointerVector.h.