Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
LList Class Reference

#include <List.h>

Public Types

enum  SortMode { ASCENDING , DESCENDING }
 Enumeration of list sorting methods. More...
 

Public Member Functions

 LList ()
 
void addToHead (LListNode *new_node)
 Adds new node to the front of the list.
 
void addToTail (LListNode *new_node)
 Adds new node to the end of the list.
 
void add (LListNode *new_node)
 Adds new node to list sorted by priority.
 
void addItemToHead (void *item)
 Adds new item to the front of the list.
 
void addItemToTail (void *item)
 Adds new item to the end of the list.
 
void addItem (Int pri, void *item)
 Adds new item to list sorted by priority.
 
Int nodeCount (void)
 Returns number of nodes currently in list.
 
LListNodefirstNode (void)
 Returns first node in list.
 
LListNodelastNode (void)
 Returns last node in list.
 
LListNodegetNode (Int index)
 Returns node in list addressed by the zero-based index passed.
 
void setSortMode (SortMode new_mode)
 Sets the sorting mode for the Add() operation.
 
void addToEndOfGroup (Bool yes=TRUE)
 Add node to end or start of group with same priority.
 
Bool isEmpty (void)
 Returns whether or not the the list is empty.
 
void clear (void)
 Deletes all items in the list. Use with care!!
 
void merge (LList *list)
 Move the contents of the specified list in to this list.
 
Bool hasItem (void *item)
 Tests if list has the specified item.
 
LListNodefindItem (void *item)
 Returns the LListNode that references item.
 
void destroy (void)
 Free up the list items.
 

Protected Attributes

LListNode m_head
 List head node.
 
SortMode m_sortMode
 What sorting method to use for this list's Add() operation.
 
Bool m_addToEndOfGroup
 Add nodes to end of group of nodes with same priority.
 

Detailed Description

Linked list abstraction.

Definition at line 116 of file List.h.

Member Enumeration Documentation

◆ SortMode

Enumeration of list sorting methods.

Enumerator
ASCENDING 

Lower priority numbers to front of list.

DESCENDING 

Higher priority numbers to front of list.

Definition at line 121 of file List.h.

Constructor & Destructor Documentation

◆ LList()

LList::LList ( )

Definition at line 105 of file List.cpp.

Member Function Documentation

◆ add()

void LList::add ( LListNode * new_node)

Adds new node to list sorted by priority.

Definition at line 115 of file List.cpp.

◆ addItem()

void LList::addItem ( Int pri,
void * item )

Adds new item to list sorted by priority.

Definition at line 156 of file List.cpp.

◆ addItemToHead()

void LList::addItemToHead ( void * item)

Adds new item to the front of the list.

Definition at line 173 of file List.cpp.

◆ addItemToTail()

void LList::addItemToTail ( void * item)

Adds new item to the end of the list.

Definition at line 189 of file List.cpp.

◆ addToEndOfGroup()

void LList::addToEndOfGroup ( Bool yes = TRUE)

Add node to end or start of group with same priority.

Definition at line 448 of file List.cpp.

◆ addToHead()

void LList::addToHead ( LListNode * new_node)
inline

Adds new node to the front of the list.

Definition at line 173 of file List.h.

◆ addToTail()

void LList::addToTail ( LListNode * new_node)
inline

Adds new node to the end of the list.

Definition at line 174 of file List.h.

◆ clear()

void LList::clear ( void )

Deletes all items in the list. Use with care!!

Definition at line 205 of file List.cpp.

◆ destroy()

void LList::destroy ( void )
inline

Free up the list items.

Definition at line 179 of file List.h.

◆ findItem()

LListNode * LList::findItem ( void * item)

Returns the LListNode that references item.

Definition at line 292 of file List.cpp.

◆ firstNode()

LListNode * LList::firstNode ( void )
inline

Returns first node in list.

Definition at line 175 of file List.h.

◆ getNode()

LListNode * LList::getNode ( Int index)

Returns node in list addressed by the zero-based index passed.

Definition at line 240 of file List.cpp.

◆ hasItem()

Bool LList::hasItem ( void * item)

Tests if list has the specified item.

Definition at line 283 of file List.cpp.

◆ isEmpty()

Bool LList::isEmpty ( void )
inline

Returns whether or not the the list is empty.

Definition at line 178 of file List.h.

◆ lastNode()

LListNode * LList::lastNode ( void )
inline

Returns last node in list.

Definition at line 176 of file List.h.

◆ merge()

void LList::merge ( LList * list)

Move the contents of the specified list in to this list.

Definition at line 262 of file List.cpp.

◆ nodeCount()

Int LList::nodeCount ( void )

Returns number of nodes currently in list.

Definition at line 220 of file List.cpp.

◆ setSortMode()

void LList::setSortMode ( SortMode new_mode)
inline

Sets the sorting mode for the Add() operation.

Definition at line 177 of file List.h.

Member Data Documentation

◆ m_addToEndOfGroup

Bool LList::m_addToEndOfGroup
protected

Add nodes to end of group of nodes with same priority.

Definition at line 131 of file List.h.

◆ m_head

LListNode LList::m_head
protected

List head node.

Definition at line 129 of file List.h.

◆ m_sortMode

SortMode LList::m_sortMode
protected

What sorting method to use for this list's Add() operation.

Definition at line 130 of file List.h.


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