ucc::LinkedList Class Reference

A double linked list object. More...

#include <linked.h>

Inheritance diagram for ucc::LinkedList:

Inheritance graph
[legend]
Collaboration diagram for ucc::LinkedList:

Collaboration graph
[legend]

Public Member Functions

void delist (void)
 Remove our object from the list it is currently part of.
void enlist (OrderedIndex *index)
 Attach our object to a linked list.
void enlistHead (OrderedIndex *index)
 Attach our object to the start of a linked list though an ordered index.
void enlistTail (OrderedIndex *index)
 Attach our object to the end of a linked list though an ordered index.
LinkedListgetNext (void) const
 Get next node in the list when iterating.
LinkedListgetPrev (void) const
 Get previous node in the list for reverse iteration.
virtual void insert (LinkedList *object)
 Insert object, method in derived object.
void insertHead (LinkedList *object)
 Insert object in front of our object.
void insertTail (LinkedList *object)
 Insert object behind our object.
bool isHead (void) const
 Test if we are at the head of a list.
bool isTail (void) const
 Test if we are at the end of a list.
void operator*= (LinkedList *object)
 Insert object in list with our object.
void operator+= (LinkedList *object)
 Insert object behind our object.
void operator-= (LinkedList *object)
 Insert object in front of our object.

Protected Member Functions

 LinkedList ()
 Construct an unlinked object.
 LinkedList (OrderedIndex *index)
 Construct and add our object to an existing double linked list at end.
virtual ~LinkedList ()
 Delete linked list object.

Protected Attributes

LinkedListprev
OrderedIndexroot

Friends

class ObjectQueue

Detailed Description

A double linked list object.

This is used as a base class for objects that will be organized through ordered double linked lists which allow convenient insertion and deletion of list members anywhere in the list.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 757 of file linked.h.


Constructor & Destructor Documentation

ucc::LinkedList::LinkedList ( OrderedIndex index  )  [protected]

Construct and add our object to an existing double linked list at end.

Parameters:
index of linked list we are listed in.

virtual ucc::LinkedList::~LinkedList (  )  [protected, virtual]

Delete linked list object.

If it is a member of a list of objects, then the list is reformed around us.


Member Function Documentation

void ucc::LinkedList::enlist ( OrderedIndex index  )  [virtual]

Attach our object to a linked list.

The default strategy is to add to tail.

Parameters:
index of linked list we are joining.

Reimplemented from ucc::OrderedObject.

void ucc::LinkedList::enlistHead ( OrderedIndex index  ) 

Attach our object to the start of a linked list though an ordered index.

If we are already attached to a list we are delisted first.

Parameters:
index of linked list we are joining.

Reimplemented from ucc::OrderedObject.

void ucc::LinkedList::enlistTail ( OrderedIndex index  ) 

Attach our object to the end of a linked list though an ordered index.

If we are already attached to a list we are delisted first.

Parameters:
index of linked list we are joining.

Reimplemented from ucc::OrderedObject.

LinkedList* ucc::LinkedList::getNext ( void   )  const [inline]

Get next node in the list when iterating.

Returns:
next node in list.

Reimplemented from ucc::OrderedObject.

Definition at line 834 of file linked.h.

LinkedList* ucc::LinkedList::getPrev ( void   )  const [inline]

Get previous node in the list for reverse iteration.

Returns:
previous node in list.

Definition at line 827 of file linked.h.

virtual void ucc::LinkedList::insert ( LinkedList object  )  [virtual]

Insert object, method in derived object.

Parameters:
object to add to list.

void ucc::LinkedList::insertHead ( LinkedList object  ) 

Insert object in front of our object.

Parameters:
object to add to list.

void ucc::LinkedList::insertTail ( LinkedList object  ) 

Insert object behind our object.

Parameters:
object to add to list.

bool ucc::LinkedList::isHead ( void   )  const [inline]

Test if we are at the head of a list.

Returns:
true if we are the first node in a list.

Definition at line 813 of file linked.h.

bool ucc::LinkedList::isTail ( void   )  const [inline]

Test if we are at the end of a list.

Returns:
true if we are the last node in a list.

Definition at line 820 of file linked.h.

void ucc::LinkedList::operator*= ( LinkedList object  )  [inline]

Insert object in list with our object.

Parameters:
object to add to list.

Definition at line 873 of file linked.h.

void ucc::LinkedList::operator+= ( LinkedList object  )  [inline]

Insert object behind our object.

Parameters:
object to add to list.

Definition at line 859 of file linked.h.

void ucc::LinkedList::operator-= ( LinkedList object  )  [inline]

Insert object in front of our object.

Parameters:
object to add to list.

Definition at line 866 of file linked.h.


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

Generated on Tue May 17 12:15:31 2011 for UCommon by  doxygen 1.5.6