slinkList Class Reference

#include <slink-list.hpp>

Inheritance diagram for slinkList:

Inheritance graph
[legend]
Collaboration diagram for slinkList:

Collaboration graph
[legend]
List of all members.

Detailed Description

Generic linked list implementation.

Definition at line 33 of file slink-list.hpp.

Public Member Functions

 slinkList ()
void append (slinkNode *p)
void prepend (slinkNode *p)
slinkNodegetRoot ()


Constructor & Destructor Documentation

slinkList::slinkList (  ) 

General constructor.

Definition at line 27 of file slink-list.cpp.

00027                     {
00028         root=new slinkNode(0);
00029 }


Member Function Documentation

void slinkList::append ( slinkNode p  ) 

Add a node to the end of the list

Parameters:
p pointer to the node to add.

Definition at line 32 of file slink-list.cpp.

References slinkNode::getNext(), and slinkNode::setNext().

Referenced by materialBenefitList::addBenefit().

00032                                   {
00033         slinkNode* n = root;
00034         
00035         while(n->getNext()!=0){
00036                 n = n->getNext();
00037         }
00038         n->setNext(p);
00039         p->setNext(0);
00040         
00041 }

Here is the call graph for this function:

Here is the caller graph for this function:

slinkNode * slinkList::getRoot (  ) 

Return the root pointer.

Returns:
pointer to the root slinkNode

Definition at line 48 of file slink-list.cpp.

Referenced by materialBenefitList::addBenefit(), and materialBenefitList::XMLout().

00048                              {
00049         return root;
00050 }

Here is the caller graph for this function:

void slinkList::prepend ( slinkNode p  ) 

Add a node to the head of the list.

Parameters:
p pointer to the node to add.

Definition at line 43 of file slink-list.cpp.

References slinkNode::getNext(), and slinkNode::setNext().

00043                                    {
00044         n->setNext(root->getNext());
00045         root->setNext(n);
00046 }

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Fri Mar 7 16:43:02 2008 for frpuniverse by  doxygen 1.4.7