ScummVM API documentation
Bagel::CBofList< T > Class Template Reference

Public Member Functions

virtual ~CBofList ()
 
int getCount () const
 
int getActualCount () const
 
bool isEmpty () const
 
getNodeItem (int nNodeIndex)
 
void setNodeItem (int nNodeIndex, T tNewItem)
 
operator[] (int nIndex)
 
CBofListNode< T > * getNode (int nNodeIndex)
 
void insertBefore (int nNodeIndex, T cNewItem)
 
void insertBefore (CBofListNode< T > *pNode, T cNewItem)
 
void insertAfter (int nNodeIndex, T cNewItem)
 
void insertAfter (CBofListNode< T > *pNode, T cNewItem)
 
remove (CBofListNode< T > *pNode)
 
remove (int nNodeIndex)
 
void removeAll ()
 
removeHead ()
 
removeTail ()
 
void addToHead (CBofListNode< T > *pNewNode)
 
void addToHead (T cItem)
 
void addToTail (CBofListNode< T > *pNewNode)
 
void addToTail (T cItem)
 
CBofListNode< T > * getHead () const
 
CBofListNode< T > * getTail () const
 

Protected Attributes

uint32 _nNumItems
 
uint32 _nItemsAllocated
 
CBofListNode< T > * _pHead
 
CBofListNode< T > * _pTail
 
void ** _pItemList
 

Constructor & Destructor Documentation

◆ ~CBofList()

template<class T>
virtual Bagel::CBofList< T >::~CBofList ( )
inlinevirtual

Destructor

Member Function Documentation

◆ getActualCount()

template<class T>
int Bagel::CBofList< T >::getActualCount ( ) const
inline

Retrieves the number of items in this list

Returns
Returns the number of linked items in this linked list.

◆ isEmpty()

template<class T>
bool Bagel::CBofList< T >::isEmpty ( ) const
inline

Returns true if the list is empty

Returns

◆ getNodeItem()

template<class T>
T Bagel::CBofList< T >::getNodeItem ( int  nNodeIndex)
inline

Retrieves the item at the specified location

Returns
Returns the item located at the node with given index.
Parameters
nNodeIndexIndex of node to retrieve

◆ getNode()

template<class T>
CBofListNode<T>* Bagel::CBofList< T >::getNode ( int  nNodeIndex)
inline

Retrieves the node at the specified location

Returns
Returns the node located at the given index.
Parameters
nNodeIndexIndex of node to retrieve

◆ insertBefore() [1/2]

template<class T>
void Bagel::CBofList< T >::insertBefore ( int  nNodeIndex,
cNewItem 
)
inline

Inserts a new node as the previous node to the one specified

Parameters
nNodeIndexIndex of node to insert before
cNewItemData to store at new node

◆ insertBefore() [2/2]

template<class T>
void Bagel::CBofList< T >::insertBefore ( CBofListNode< T > *  pNode,
cNewItem 
)
inline

Inserts a new node as the previous node to the one specified

Parameters
pNodeNode to insert before
cNewItemData to store at new node

◆ insertAfter() [1/2]

template<class T>
void Bagel::CBofList< T >::insertAfter ( int  nNodeIndex,
cNewItem 
)
inline

Inserts a new node as the next node to the one specified

Parameters
nNodeIndexIndex of node to insert after
cNewItemData to store at new node

◆ insertAfter() [2/2]

template<class T>
void Bagel::CBofList< T >::insertAfter ( CBofListNode< T > *  pNode,
cNewItem 
)
inline

Inserts a new node as the next node to the one specified

Parameters
pNodeNode to insert after
cNewItemData to store at new node

◆ remove() [1/2]

template<class T>
T Bagel::CBofList< T >::remove ( CBofListNode< T > *  pNode)
inline

Removes specified node from the list

Parameters
pNodeNode to remove
Returns
Item stored at specified location

◆ remove() [2/2]

template<class T>
T Bagel::CBofList< T >::remove ( int  nNodeIndex)
inline

Removes specified node (by index) from the list

Parameters
nNodeIndexIndex of node to remove
Returns
Item stored at specified location

◆ removeAll()

template<class T>
void Bagel::CBofList< T >::removeAll ( )
inline

Removes all nodes from this list

Remarks
Deletes all memory used by the nodes in this list

◆ removeHead()

template<class T>
T Bagel::CBofList< T >::removeHead ( )
inline

Removes specified node (by index) from the list

Returns
Item stored at specified location

◆ removeTail()

template<class T>
T Bagel::CBofList< T >::removeTail ( )
inline

Removes specified node (by index) from the list

Returns
Item stored at specified location

◆ addToHead() [1/2]

template<class T>
void Bagel::CBofList< T >::addToHead ( CBofListNode< T > *  pNewNode)
inline

Adds specified node as the new head of this list

Parameters
pNewNodePointer to node to add to the list

◆ addToHead() [2/2]

template<class T>
void Bagel::CBofList< T >::addToHead ( cItem)
inline

Adds specified item as the new head of this list

Parameters
cItemItem to add to the list

◆ addToTail() [1/2]

template<class T>
void Bagel::CBofList< T >::addToTail ( CBofListNode< T > *  pNewNode)
inline

Adds specified node as the new tail of this list

Parameters
pNewNodePointer to node to add to the list

◆ addToTail() [2/2]

template<class T>
void Bagel::CBofList< T >::addToTail ( cItem)
inline

Adds specified item as the new tail of this list

Parameters
cItemItem to add to the list

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