![]() |
ICF 3.0.5.47
Technical documentation of ICF Libraries
|
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 51 of file TPointerVector.h.
AccessAdapter::ElementType istd::TPointerVector< Pointer, AccessAdapter >::ElementType |
Definition at line 54 of file TPointerVector.h.
anonymous enum |
Enumerator | |
---|---|
InvalidIndex | Invalid index in the vector. |
Definition at line 56 of file TPointerVector.h.
|
inline |
Definition at line 158 of file TPointerVector.h.
|
inline |
Definition at line 164 of file TPointerVector.h.
istd::TPointerVector< Pointer, AccessAdapter >::~TPointerVector | ( | ) |
Definition at line 187 of file TPointerVector.h.
Pointer * istd::TPointerVector< Pointer, AccessAdapter >::GetAt | ( | int | index | ) | const |
Get pointer at specified index.
Definition at line 236 of file TPointerVector.h.
Referenced by i2dgui::TViewExtenderCompBase< Base >::AddItemsToScene(), i2dgui::TViewExtenderCompBase< Base >::RemoveItemsFromScene(), and i2dgui::TViewExtenderCompBase< Base >::SetAllShapesVisible().
|
inline |
Get number of stored elements.
Definition at line 178 of file TPointerVector.h.
Referenced by i2dgui::TViewExtenderCompBase< Base >::AddItemsToScene(), i2dgui::TViewExtenderCompBase< Base >::RemoveItemsFromScene(), and i2dgui::TViewExtenderCompBase< Base >::SetAllShapesVisible().
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 246 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 220 of file TPointerVector.h.
void istd::TPointerVector< Pointer, AccessAdapter >::InsertElementAt | ( | int | index, |
const ElementType & | element ) |
Insert element at specified position.
Definition at line 320 of file TPointerVector.h.
|
inline |
Check if there is element stored in this set.
Definition at line 171 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 299 of file TPointerVector.h.
void istd::TPointerVector< Pointer, AccessAdapter >::PushBack | ( | const ElementType & | element | ) |
Add new element at the end of collection.
Definition at line 313 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 281 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 267 of file TPointerVector.h.
void istd::TPointerVector< Pointer, AccessAdapter >::Reset | ( | ) |
Remove all elements.
Definition at line 207 of file TPointerVector.h.
void istd::TPointerVector< Pointer, AccessAdapter >::SetCount | ( | int | count | ) |
Set number of elements.
Definition at line 194 of file TPointerVector.h.
void istd::TPointerVector< Pointer, AccessAdapter >::SetElementAt | ( | int | index, |
const ElementType & | element ) |
Set element at specified index.
Definition at line 256 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 331 of file TPointerVector.h.
© Witold Gantzke and Kirill Lepskiy