Download Source Code

TLList< T > Class Template Reference

Implements a linked list. More...

#include <TLList.h>

Inheritance diagram for TLList< T >:

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef LPSTLListInfo iterator
 Hash list element iterator.

Public Member Functions

virtual ~TLList ()
 Destructor.
iterator begin ()
 Returns the iterator for the first element in the list.
iterator last ()
 Returns the iterator for the last element in the list.
iterator end ()
 Returns a NULL iterator.
iterator next (iterator it)
 Returns the next element in the list.
iterator prev (iterator it)
 Returns the previous element in the list.
T * push_back (T *node=NULL)
 Adds an element to the end of the list.
T * push_back_memcpy (T *node)
 Adds an element to the end of the list.
T * push_back_copy (T *node)
 Adds an element to the end of the list.
iterator erase (iterator it)
 Removes the specified element from the list.
BOOL verify (T *node)
 Verifies that the specified object pointer is actually in the list.
BOOL verify (iterator it)
 Verifies that the specified iterator is actually in the list.
void clear ()
 Removes all elements from the list.
virtual DWORD GetObjSize ()
 Returns the size of a hash list structure in bytes.
virtual void Destroy ()
 Removes all elements from the list.
virtual BOOL InitObject (void *node)
 Provides custom initialization of new hash list structures.
virtual void DeleteObject (void *node)
 Provides custom destruction of hash list structures.
bool allocate (DWORD dwSize)
 Creates a list with the specified number of elements.
bool resize (DWORD dwSize)
 Resizes a list to the specified number of elements.
T * operator[] (unsigned long i)
 Returns a pointer to the specified element.
iterator find_obj (T *pObj)
 Searchs the list to find the iterator for the specified object pointer.

Detailed Description

template<class T>
class TLList< T >

Implements a linked list.

Implements a linked list Obsolete, new code should use ATL7 classes or other standard implementation.


Member Function Documentation

template<class T>
bool TLList< T >::allocate DWORD  dwSize  )  [inline]
 

Creates a list with the specified number of elements.

Parameters:
[in] dwSize - Desired number of elements in list
Returns:
Non-zero if success
See also:

template<class T>
virtual void TLList< T >::DeleteObject void *  node  )  [inline, virtual]
 

Provides custom destruction of hash list structures.

Parameters:
[in] node - Hash list structure pointer

Reimplemented from CHList.

template<class T>
iterator TLList< T >::erase iterator  it  )  [inline]
 

Removes the specified element from the list.

Parameters:
[in] it - Element iterator to remove
Returns:
Pointer to the previous element. Useful when iterating elements.
See also:

template<class T>
iterator TLList< T >::find_obj T *  pObj  )  [inline]
 

Searchs the list to find the iterator for the specified object pointer.

Parameters:
[in] pObj - Element object pointer
Returns:
Iterator if found, otherwise NULL
See also:

template<class T>
virtual BOOL TLList< T >::InitObject void *  node  )  [inline, virtual]
 

Provides custom initialization of new hash list structures.

Parameters:
[in] node - Hash list structure pointer
Returns:
Non-zero if success
See also:

Reimplemented from CHList.

template<class T>
iterator TLList< T >::next iterator  it  )  [inline]
 

Returns the next element in the list.

Parameters:
[in] it - Reference element
If it is NULL, the head element is returned.

Returns:
Pointer to the next element or NULL if none.
See also:

template<class T>
T* TLList< T >::operator[] unsigned long  i  )  [inline]
 

Returns a pointer to the specified element.

Parameters:
[in] i - Element index
This function can be slow since it has to iterate through the entire list until the specified element is reached

Returns:
Pointer to specified element.
See also:

template<class T>
iterator TLList< T >::prev iterator  it  )  [inline]
 

Returns the previous element in the list.

Parameters:
[in] it - Reference element
If it is NULL, the last element is returned.

Returns:
Pointer to the previous element or NULL if none.
See also:

template<class T>
T* TLList< T >::push_back T *  node = NULL  )  [inline]
 

Adds an element to the end of the list.

Parameters:
[in] node - Optional element pointer to add. If node is NULL, a new element is created.
Returns:
Pointer to newly added element
See also:

template<class T>
T* TLList< T >::push_back_copy T *  node  )  [inline]
 

Adds an element to the end of the list.

Parameters:
[in] node - Optional element pointer that is copied to the new element.
Returns:
Pointer to newly added element
See also:

template<class T>
T* TLList< T >::push_back_memcpy T *  node  )  [inline]
 

Adds an element to the end of the list.

Parameters:
[in] node - Optional element pointer that is copied byte-wise into the new element. Must be a POD pointer.
Warning:
POD only!
Returns:
Pointer to newly added element
See also:

template<class T>
bool TLList< T >::resize DWORD  dwSize  )  [inline]
 

Resizes a list to the specified number of elements.

Parameters:
[in] dwSize - Desired number of elements in list
Returns:
Non-zero if success
See also:

template<class T>
BOOL TLList< T >::verify iterator  it  )  [inline]
 

Verifies that the specified iterator is actually in the list.

Parameters:
[in] it - Iterator pointer to verify
Returns:
Non-zero if valid list iterator
See also:

template<class T>
BOOL TLList< T >::verify T *  node  )  [inline]
 

Verifies that the specified object pointer is actually in the list.

Parameters:
[in] node - Object pointer to verify
Returns:
Non-zero if valid list object
See also:


The documentation for this class was generated from the following file:
  • inc/TLList.h
Copyright Robert Umbehant
This documentation is covered by the LGPL