"L. Spiro Engine"
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

lstl::CSingleLinkedList< _tType > Class Template Reference

A template providing linked-list functionality. More...

#include <LSTLSingleLinkedList.h>

Inheritance diagram for lstl::CSingleLinkedList< _tType >:
lstl::CLinkedListBase

List of all members.

Classes

struct  LSTL_LINKED_LIST_NODE

Public Types

typedef struct
lstl::CSingleLinkedList::LSTL_LINKED_LIST_NODE
LPLSTL_LINKED_LIST_NODE
typedef struct
lstl::CSingleLinkedList::LSTL_LINKED_LIST_NODE 
LPCLSTL_LINKED_LIST_NODE

Public Member Functions

LSVOID LSE_CALL SetAllocator (CAllocator *_paAllocator)
CAllocator *LSE_CALL GetAllocator ()
LSVOID LSE_CALL Reset ()
LPLSTL_LINKED_LIST_NODE LSE_CALL InsertAfter (const _tType &_tNew, LPLSTL_LINKED_LIST_NODE _lpllnNode)
LSVOID LSE_CALL RemoveItem (LPLSTL_LINKED_LIST_NODE _lpllnNode)
LPLSTL_LINKED_LIST_NODE LSE_CALL Head ()
const LPLSTL_LINKED_LIST_NODE
LSE_CALL 
Head () const
LPLSTL_LINKED_LIST_NODE LSE_CALL PushFront (const _tType &_tNew)
LSUINT32 LSE_CALL Length ()
LPLSTL_LINKED_LIST_NODE LSE_CALL Find (const _tType &_tValue)

Protected Member Functions

LSVOID LSE_CALL Construct (LSTL_LINKED_LIST_NODE &_llnNode)
LSVOID LSE_CALL Destroy (const LSTL_LINKED_LIST_NODE &_llnNode)
LPLSTL_LINKED_LIST_NODE LSE_CALL NewNode ()

Protected Attributes

LPLSTL_LINKED_LIST_NODE m_lpllnHead
CAllocatorm_paOurAllocator

Detailed Description

template<typename _tType>
class lstl::CSingleLinkedList< _tType >

A template providing linked-list functionality.

Class CSingleLinkedList Description: A template providing linked-list functionality. The list is one-way.


Member Typedef Documentation

Each item in the linked list is of this type.


Member Function Documentation

template<typename _tType >
LSVOID LSE_CALL lstl::CSingleLinkedList< _tType >::Construct ( LSTL_LINKED_LIST_NODE _llnNode) [inline, protected]

Secret way of constructing items.

Parameters:
_llnNodeThe item to be constructed.
template<typename _tType >
LSVOID LSE_CALL lstl::CSingleLinkedList< _tType >::Destroy ( const LSTL_LINKED_LIST_NODE _llnNode) [inline, protected]

Secret way of destroying items. No error checking.

Parameters:
_llnNodeThe item to be destroyed.
template<typename _tType >
LPLSTL_LINKED_LIST_NODE LSE_CALL lstl::CSingleLinkedList< _tType >::Find ( const _tType &  _tValue) [inline]

Finds the linked-list entry containing the given value.

Parameters:
_tValueThe value to find.
Returns:
Returns a pointer to the linked-list entry with the given value or NULL.
template<typename _tType >
CAllocator* LSE_CALL lstl::CSingleLinkedList< _tType >::GetAllocator ( ) [inline]

Gets our allocator.

Returns:
Returns our allocator.
template<typename _tType >
LPLSTL_LINKED_LIST_NODE LSE_CALL lstl::CSingleLinkedList< _tType >::Head ( ) [inline]

Gets the head of this list.

Returns:
Returns the head of the linked list, which may be NULL.
template<typename _tType >
const LPLSTL_LINKED_LIST_NODE LSE_CALL lstl::CSingleLinkedList< _tType >::Head ( ) const [inline]

Gets the head of this list.

Returns:
Returns the head of the linked list, which may be NULL.
template<typename _tType >
LPLSTL_LINKED_LIST_NODE LSE_CALL lstl::CSingleLinkedList< _tType >::InsertAfter ( const _tType &  _tNew,
LPLSTL_LINKED_LIST_NODE  _lpllnNode 
) [inline]

Insert an item after another item. If the previous item is NULL, the new item is inserted at the beginning of the list.

Parameters:
_tNewThe item to insert.
_lpllnNodeThe node after which the item is to be inserted or NULL.
Returns:
Returns the created node if insertion was successful. Returns NULL if allocation fails.
template<typename _tType >
LSUINT32 LSE_CALL lstl::CSingleLinkedList< _tType >::Length ( ) [inline]

Gets the total number of items in the list.

Returns:
Returns the number of items in the linked list.
template<typename _tType >
LPLSTL_LINKED_LIST_NODE LSE_CALL lstl::CSingleLinkedList< _tType >::NewNode ( ) [inline, protected]

Create a new node.

Returns:
Returns a new node.
template<typename _tType >
LPLSTL_LINKED_LIST_NODE LSE_CALL lstl::CSingleLinkedList< _tType >::PushFront ( const _tType &  _tNew) [inline]

Insert at the front of the list.

Parameters:
_tNewThe item to add to the list.
Returns:
Returns the created node if insertion was successful. Returns NULL if allocation fails.
template<typename _tType >
LSVOID LSE_CALL lstl::CSingleLinkedList< _tType >::RemoveItem ( LPLSTL_LINKED_LIST_NODE  _lpllnNode) [inline]

Remove an item from the linked list. The item is deleted upon being removed and the item pointer may no longer be used.

Parameters:
_lpllnNodeThe node to remove from this linked list.
template<typename _tType >
LSVOID LSE_CALL lstl::CSingleLinkedList< _tType >::Reset ( ) [inline]

Reset everything. Clears all resources created by this instance.

template<typename _tType >
LSVOID LSE_CALL lstl::CSingleLinkedList< _tType >::SetAllocator ( CAllocator _paAllocator) [inline]

Set the allocator to be used by this instance. Causes the object to be fully reset. Cannot be used on lists that have contents already.

Parameters:
_paAllocatorPointer to the allocator to use.

Member Data Documentation

template<typename _tType >
LPLSTL_LINKED_LIST_NODE lstl::CSingleLinkedList< _tType >::m_lpllnHead [protected]

The head of the list.

template<typename _tType >
CAllocator* lstl::CSingleLinkedList< _tType >::m_paOurAllocator [protected]

The allocator we should use.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator