THList< H, T > Class Template ReferenceImplements a hashed linked list.
More...
#include <THList.h>
Inheritance diagram for THList< H, T >:
[legend]Collaboration diagram for THList< H, T >:
[legend]List of all members.
|
Public Types |
| typedef THList::tagSTHListInfo | STHListInfo |
| | Hash list element iterator structure.
|
| typedef THList::tagSTHListInfo * | LPSTHListInfo |
| | Hash list element iterator structure.
|
|
typedef LPSTHListInfo | iterator |
| | Hash list element iterator.
|
Public Member Functions |
|
virtual | ~THList () |
| | 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 (const H &key, T *node=NULL) |
| | Adds an element to the end of the list.
|
| T * | push_back_memcpy (const H &key, T *node) |
| | Adds an element to the end of the list.
|
| T * | push_back_copy (const H &key, T *node) |
| | Adds an element to the end of the list.
|
| T * | operator[] (const H &key) |
| | Returns a pointer to the specified element.
|
| T * | get (const H &key, T *node=NULL) |
| | Returns a pointer to the specified element, adding if needed.
|
| iterator | erase (const H &key) |
| | Removes the specified element from the list.
|
| iterator | erase (const 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.
|
| iterator | find_obj (T *pObj) |
| | Searchs the list to find the iterator for the specified object pointer.
|
Classes |
| struct | tagSTHListInfo |
| | Hash list element iterator structure. More...
|
Detailed Description
template<class H, class T>
class THList< H, T >
Implements a hashed linked list.
Implements a hashed linked list Obsolete, new code should use ATL7 classes or other standard implementation.
Member Typedef Documentation
Member Function Documentation
|
template<class H, class T> |
| virtual void THList< H, T >::DeleteObject |
( |
void * |
node |
) |
[inline, virtual] |
|
|
|
Provides custom destruction of hash list structures.
- Parameters:
-
| [in] | node | - Hash list structure pointer |
Reimplemented from CHList. |
|
|
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 H, class T> |
| iterator THList< H, T >::erase |
( |
const H & |
key |
) |
[inline] |
|
|
|
Removes the specified element from the list.
- Parameters:
-
- Returns:
- Pointer to the previous element. Useful when iterating elements.
- See also:
|
|
template<class H, class T> |
| iterator THList< H, 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 H, class T> |
| T* THList< H, T >::get |
( |
const H & |
key, |
|
|
T * |
node = NULL |
|
) |
[inline] |
|
|
|
Returns a pointer to the specified element, adding if needed.
- Parameters:
-
| [in] | key | - Element key |
| [in] | node | - Element to add if not found |
- Returns:
- Pointer to specified element.
- See also:
|
|
template<class H, class T> |
| virtual BOOL THList< H, 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. |
|
|
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 H, class T> |
| T* THList< H, T >::operator[] |
( |
const H & |
key |
) |
[inline] |
|
|
|
Returns a pointer to the specified element.
- Parameters:
-
- Returns:
- Pointer to specified element.
- See also:
|
|
|
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 H, class T> |
| T* THList< H, T >::push_back |
( |
const H & |
key, |
|
|
T * |
node = NULL |
|
) |
[inline] |
|
|
|
Adds an element to the end of the list.
- Parameters:
-
| [in] | key | - Element key |
| [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 H, class T> |
| T* THList< H, T >::push_back_copy |
( |
const H & |
key, |
|
|
T * |
node |
|
) |
[inline] |
|
|
|
Adds an element to the end of the list.
- Parameters:
-
| [in] | key | - Element key |
| [in] | node | - Optional element pointer that is copied to the new element. |
- Returns:
- Pointer to newly added element
- See also:
|
|
template<class H, class T> |
| T* THList< H, T >::push_back_memcpy |
( |
const H & |
key, |
|
|
T * |
node |
|
) |
[inline] |
|
|
|
Adds an element to the end of the list.
- Parameters:
-
| [in] | key | - Element key |
| [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 H, class T> |
| BOOL THList< H, 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 H, class T> |
| BOOL THList< H, 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:
|