ALBA
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
albaVector< T > Class Template Reference

#include <albaVector.h>

Inheritance diagram for albaVector< T >:
Inheritance graph
[legend]
Collaboration diagram for albaVector< T >:
Collaboration graph
[legend]

Public Member Functions

 albaVector ()
 
virtual ~albaVector ()
 
albaID GetNumberOfItems ()
 
void SetItem (const albaID idx, const T &object)
 
albaID AppendItem (const T &object)
 
bool ReplaceItem (const albaID idx, const T &newitem)
 
bool RemoveItem (const albaID idx)
 
bool FindAndRemoveItem (const T &object)
 
void RemoveAllItems ()
 
bool IsItemPresent (const T &object)
 
bool GetItem (const albaID idx, T &obj)
 
T & GetItem (const albaID idx)
 
bool FindItem (const T &object, albaID &idx)
 
albaID Push (const T &obj)
 
bool Pop (T &obj)
 
T & operator[] (const albaID idx)
 
const T & operator[] (const albaID idx) const
 

Static Public Attributes

static T m_NullItem
 

Protected Attributes

mmuVectorItems< T > * m_Items
 

Detailed Description

template<class T>
class albaVector< T >

albaVector - vector container wrapping STL vectors.

This class simply wraps the STL vector container. It can be used in conjunction with albaSmartPointers to store albaReferenceCounted pointers.

Definition at line 32 of file albaVector.h.

Constructor & Destructor Documentation

◆ albaVector()

template<class T >
albaVector< T >::albaVector

Definition at line 132 of file albaVector.h.

◆ ~albaVector()

template<class T >
albaVector< T >::~albaVector
virtual

Definition at line 140 of file albaVector.h.

Member Function Documentation

◆ GetNumberOfItems()

template<class T >
albaID albaVector< T >::GetNumberOfItems

return number of items in the array

Definition at line 317 of file albaVector.h.

◆ SetItem()

template<class T >
void albaVector< T >::SetItem ( const albaID  idx,
const T &  object 
)

Set an item with the specified Key.

Definition at line 149 of file albaVector.h.

◆ AppendItem()

template<class T >
albaID albaVector< T >::AppendItem ( const T &  object)

Set an item with the specified Key.

Definition at line 162 of file albaVector.h.

◆ ReplaceItem()

template<class T >
bool albaVector< T >::ReplaceItem ( const albaID  idx,
const T &  newitem 
)

Replace the item with the given Key in the container with a new one.

Return false if no item with the given Key exists.

Definition at line 218 of file albaVector.h.

◆ RemoveItem()

template<class T >
bool albaVector< T >::RemoveItem ( const albaID  idx)

Remove the item with given Key in the container.

If no object with such Key is found the container is uneffected and the function return false.

Attention
Be careful if using this function during traversal of the list using GetNextItem.

Definition at line 233 of file albaVector.h.

◆ FindAndRemoveItem()

template<class T >
bool albaVector< T >::FindAndRemoveItem ( const T &  object)

Remove an object from the list.

If object is not found, the list is unaffected and return false. See warning in description of RemoveItem(int).

Definition at line 248 of file albaVector.h.

◆ RemoveAllItems()

template<class T >
void albaVector< T >::RemoveAllItems

Remove all objects from the list.

Definition at line 262 of file albaVector.h.

◆ IsItemPresent()

template<class T >
bool albaVector< T >::IsItemPresent ( const T &  object)

Search for an object and return its ID.

If ID == 0, object was not found.

Definition at line 286 of file albaVector.h.

◆ GetItem() [1/2]

template<class T >
bool albaVector< T >::GetItem ( const albaID  idx,
T &  obj 
)

Get the item with given Key in the container.

false is returned if no item with such index is present

Definition at line 171 of file albaVector.h.

◆ GetItem() [2/2]

template<class T >
T & albaVector< T >::GetItem ( const albaID  idx)

Get the item with given Key in the container.

NullItem is returned if no item with such index is present

Definition at line 187 of file albaVector.h.

◆ FindItem()

template<class T >
bool albaVector< T >::FindItem ( const T &  object,
albaID idx 
)

Return the item index.

Definition at line 270 of file albaVector.h.

◆ Push()

template<class T >
albaID albaVector< T >::Push ( const T &  obj)

Return the number of objects in the list.

append an item

Definition at line 295 of file albaVector.h.

◆ Pop()

template<class T >
bool albaVector< T >::Pop ( T &  obj)

Retrieve an item.

Definition at line 303 of file albaVector.h.

◆ operator[]() [1/2]

template<class T >
T & albaVector< T >::operator[] ( const albaID  idx)

provide access to vector items.

If idx is outside the result is invalid

Definition at line 202 of file albaVector.h.

◆ operator[]() [2/2]

template<class T >
const T & albaVector< T >::operator[] ( const albaID  idx) const

provide access to vector items.

If idx is outside the result is invalid

Definition at line 210 of file albaVector.h.

Member Data Documentation

◆ m_NullItem

template<class T >
T albaVector< T >::m_NullItem
static

Definition at line 103 of file albaVector.h.

◆ m_Items

template<class T >
mmuVectorItems<T>* albaVector< T >::m_Items
protected

Definition at line 107 of file albaVector.h.


The documentation for this class was generated from the following file: