#include <CList.h>
Public Member Functions | |
CList () | |
CList (const CList &cSource) | |
~CList () | |
CListContainer< ObjectType > * | getFirst () const |
CListContainer< ObjectType > * | getLast () const |
int | getNumObjects () const |
int | insertAsFirst (ObjectType *pObj) |
int | insertAsLast (ObjectType *pObj) |
int | insertAfter (CListContainer< ObjectType > *pThere, ObjectType *pObject) |
CListContainer< ObjectType > * | find (ObjectType *pObj) const |
int | remove (CListContainer< ObjectType > *pRemove) |
int | remove (ObjectType *pObj) |
CList< ObjectType > * | getFullDuplicate () const |
void | clear (int nFlag=0) |
ObjectType & | operator[] (int nIndex) const |
CListContainer< ObjectType > * | operator() (int nIndex) const |
const CList & | operator+ (const CList &cSource) |
CList & | operator= (const CList &cSource) |
Protected Member Functions | |
void | init () |
void | setFirst (CListContainer< ObjectType > *pTmp) |
void | setLast (CListContainer< ObjectType > *pTmp) |
void | setNumObjects (int nTmp) |
void | increaseNumObjects () |
void | decreaseNumObjects () |
Protected Attributes | |
int | m_nNumObjects |
CListContainer< ObjectType > * | m_pFirst |
CListContainer< ObjectType > * | m_pLast |
This class provides functionality of a double linked list. You can add and remove objects to the list and have sequential or random access to the objects in the list.
Copy constructor.
void CList< ObjectType >::clear | ( | int | nFlag = 0 |
) |
Removes all containers from the list if 'nFlag' = 0 (default). If 'nFlag' = 1 then also the objects are deleted from the heap.
void CList< ObjectType >::decreaseNumObjects | ( | ) | [inline, protected] |
CListContainer< ObjectType > * CList< ObjectType >::find | ( | ObjectType * | pObj | ) | const |
Searches for the element 'pObj' in the list and returns the pointer to the container which holds the element.
CListContainer<ObjectType>* CList< ObjectType >::getFirst | ( | ) | const [inline] |
Returns pointer to the first container of the list.
Returns a copy of the list. But this method NOT only copies the the pointer of the objects as the '=' operator does. No, this method makes a real memcpy of the list.
CListContainer<ObjectType>* CList< ObjectType >::getLast | ( | ) | const [inline] |
Returns pointer to the last container of the list.
int CList< ObjectType >::getNumObjects | ( | ) | const [inline] |
Returns the number of container in the list.
void CList< ObjectType >::increaseNumObjects | ( | ) | [inline, protected] |
void CList< ObjectType >::init | ( | ) | [inline, protected] |
int CList< ObjectType >::insertAfter | ( | CListContainer< ObjectType > * | pThere, | |
ObjectType * | pObject | |||
) |
Inserts the object 'pObject' after the container 'pThere' in the list.
int CList< ObjectType >::insertAsFirst | ( | ObjectType * | pObj | ) |
Inserts new object at the beginning of the list.
int CList< ObjectType >::insertAsLast | ( | ObjectType * | pObj | ) |
Appends the object 'pObj' to the end of the list.
CListContainer< ObjectType > * CList< ObjectType >::operator() | ( | int | nIndex | ) | const |
const CList< ObjectType > & CList< ObjectType >::operator+ | ( | const CList< ObjectType > & | cSource | ) |
concatenates one list with another by appending one to another.
CList< ObjectType > & CList< ObjectType >::operator= | ( | const CList< ObjectType > & | cSource | ) |
Copies one list to another.
ObjectType & CList< ObjectType >::operator[] | ( | int | nIndex | ) | const |
int CList< ObjectType >::remove | ( | ObjectType * | pObj | ) |
Same as before but with different type of parameter.
int CList< ObjectType >::remove | ( | CListContainer< ObjectType > * | pRemove | ) |
Removes the container 'pRemove' from the list.
void CList< ObjectType >::setFirst | ( | CListContainer< ObjectType > * | pTmp | ) | [inline, protected] |
void CList< ObjectType >::setLast | ( | CListContainer< ObjectType > * | pTmp | ) | [inline, protected] |
void CList< ObjectType >::setNumObjects | ( | int | nTmp | ) | [inline, protected] |
int CList< ObjectType >::m_nNumObjects [protected] |
CListContainer<ObjectType>* CList< ObjectType >::m_pFirst [protected] |
CListContainer<ObjectType>* CList< ObjectType >::m_pLast [protected] |