#include <karrayul.h>
Inherits KBaseArray.
Inheritance diagram for KArrayTemplate:
Definition at line 224 of file karrayul.h.
Public Member Functions | |
KArrayTemplate (int pItemPerBlock=16) | |
Constructor. | |
KArrayTemplate (const KArrayTemplate< Type > &pArrayTemplate) | |
Copy constructor. | |
~KArrayTemplate () | |
int | InsertAt (int pIndex, Type pItem) |
Insert a pointer. | |
Type | RemoveAt (int pIndex) |
Remove a pointer in the array without deleting the associated object. | |
Type | RemoveLast () |
Remove last pointer in the array without deleting the associated object. | |
bool | RemoveIt (Type pItem) |
Remove first matching pointer in the array without deleting the associated object. | |
Type & | operator[] (int pIndex) const |
Access pointer at given index. | |
void | SetAt (int pIndex, Type pItem) |
Set pointer at given index, must within valid range. | |
void | SetLast (Type pItem) |
Set last pointer, the array must contain at least one pointer. | |
Type | GetAt (int pIndex) const |
Get pointer at given index, must be within valid range. | |
Type | GetFirst () const |
Get first pointer, the array must contain at least one pointer. | |
Type | GetLast () const |
Get last pointer, the array must contain at least one pointer. | |
int | Find (Type pItem) const |
Find first matching pointer. | |
int | FindAfter (int pAfterIndex, Type pItem) const |
Find first matching pointer after given index. | |
int | FindBefore (int pBeforeIndex, Type pItem) const |
Find first matching pointer before given index. | |
int | Add (Type pItem) |
Append a pointer at the end of the array. | |
int | AddUnique (Type pItem) |
Add Element at the end of array if not present. | |
void | AddMultiple (kUInt pItemCount) |
Add multiple (init to zero) elements in the array, use SetAt or GetArray to set the value of the new elements. | |
void | AddArray (KArrayTemplate< Type > &pArray) |
void | AddArrayNoDuplicate (KArrayTemplate< Type > &pArray) |
void | RemoveArray (KArrayTemplate< Type > &pArray) |
Type * | GetArray () |
Get pointer to internal array of pointers. | |
KArrayTemplate< Type > & | operator= (const KArrayTemplate< Type > &pArrayTemplate) |
Copy array of pointers without copying the associated objects. | |
Public Attributes | |
Type *& | mArray |
KArrayTemplate | ( | int | pItemPerBlock = 16 |
) | [inline] |
Constructor.
pItemPerBlock | Number of pointers per allocated block. |
Definition at line 233 of file karrayul.h.
KArrayTemplate | ( | const KArrayTemplate< Type > & | pArrayTemplate | ) | [inline] |
int InsertAt | ( | int | pIndex, | |
Type | pItem | |||
) | [inline] |
Insert a pointer.
pIndex | Position where to insert the pointer. | |
pItem | Item to insert. |
Definition at line 253 of file karrayul.h.
Referenced by KArrayTemplate< KString * >::Add(), KStringListTemplate< KStringListItem >::InsertAt(), and KStringListTemplate< KStringListItem >::InsertItemAt().
Type RemoveAt | ( | int | pIndex | ) | [inline] |
Remove a pointer in the array without deleting the associated object.
pIndex | Position of the item to remove. |
Reimplemented from KBaseArray.
Definition at line 262 of file karrayul.h.
Referenced by KStringListTemplate< KStringListItem >::RemoveAt(), KArrayTemplate< KString * >::RemoveIt(), and KArrayTemplate< KString * >::RemoveLast().
Type RemoveLast | ( | ) | [inline] |
Remove last pointer in the array without deleting the associated object.
Definition at line 272 of file karrayul.h.
bool RemoveIt | ( | Type | pItem | ) | [inline] |
Remove first matching pointer in the array without deleting the associated object.
pItem | Item to remove. |
true
if a matching pointer is found and removed, false
otherwise. Definition at line 281 of file karrayul.h.
Referenced by KArrayTemplate< KString * >::RemoveArray().
Type& operator[] | ( | int | pIndex | ) | const [inline] |
void SetAt | ( | int | pIndex, | |
Type | pItem | |||
) | [inline] |
Set pointer at given index, must within valid range.
Definition at line 305 of file karrayul.h.
Referenced by KArrayTemplate< KString * >::AddArray(), and KArrayTemplate< KString * >::SetLast().
void SetLast | ( | Type | pItem | ) | [inline] |
Set last pointer, the array must contain at least one pointer.
Definition at line 317 of file karrayul.h.
Type GetAt | ( | int | pIndex | ) | const [inline] |
Get pointer at given index, must be within valid range.
Definition at line 323 of file karrayul.h.
Referenced by KArrayTemplate< KString * >::FindAfter(), KArrayTemplate< KString * >::FindBefore(), KArrayTemplate< KString * >::GetFirst(), KArrayTemplate< KString * >::GetLast(), and KArrayTemplate< KString * >::RemoveAt().
Type GetFirst | ( | ) | const [inline] |
Get first pointer, the array must contain at least one pointer.
Definition at line 337 of file karrayul.h.
Type GetLast | ( | ) | const [inline] |
Get last pointer, the array must contain at least one pointer.
Definition at line 348 of file karrayul.h.
int Find | ( | Type | pItem | ) | const [inline] |
Find first matching pointer.
Definition at line 360 of file karrayul.h.
Referenced by KArrayTemplate< KString * >::AddArrayNoDuplicate(), KArrayTemplate< KString * >::AddUnique(), KStringListTemplate< KStringListItem >::FindItem(), and KArrayTemplate< KString * >::RemoveIt().
int FindAfter | ( | int | pAfterIndex, | |
Type | pItem | |||
) | const [inline] |
Find first matching pointer after given index.
Definition at line 370 of file karrayul.h.
Referenced by KArrayTemplate< KString * >::Find().
int FindBefore | ( | int | pBeforeIndex, | |
Type | pItem | |||
) | const [inline] |
Find first matching pointer before given index.
Definition at line 397 of file karrayul.h.
int Add | ( | Type | pItem | ) | [inline] |
Append a pointer at the end of the array.
Definition at line 422 of file karrayul.h.
Referenced by KArrayTemplate< KString * >::AddArrayNoDuplicate(), KStringListTemplate< KStringListItem >::AddItem(), KArrayTemplate< KString * >::AddUnique(), and KArrayTemplate< KString * >::operator=().
int AddUnique | ( | Type | pItem | ) | [inline] |
Add Element at the end of array if not present.
Definition at line 430 of file karrayul.h.
void AddMultiple | ( | kUInt | pItemCount | ) | [inline] |
Add multiple (init to zero) elements in the array, use SetAt or GetArray to set the value of the new elements.
pItemCount. | How many new Array elements you want. |
Definition at line 443 of file karrayul.h.
Referenced by KArrayTemplate< KString * >::AddArray().
Type* GetArray | ( | ) | [inline] |
Get pointer to internal array of pointers.
Definition at line 482 of file karrayul.h.
Referenced by KStringListTemplate< KStringListItem >::FindCaseSensitive(), KStringListTemplate< KStringListItem >::FindEqual(), KArrayTemplate< KString * >::SetAt(), and KStringListTemplate< KStringListItem >::Sort().
KArrayTemplate<Type>& operator= | ( | const KArrayTemplate< Type > & | pArrayTemplate | ) | [inline] |
Copy array of pointers without copying the associated objects.
Definition at line 488 of file karrayul.h.