Main Page   Packages   Class Hierarchy   Alphabetical List   Data Structures   File List   Namespace Members   Data Fields   Globals  

clawsoft.List< T > Class Template Reference

#include <List.h>

Inheritance diagram for clawsoft.List< T >:

Inheritance graph
[legend]
Collaboration diagram for clawsoft.List< T >:

Collaboration graph
[legend]

Detailed Description

template<class T>
class clawsoft::List< T >

This class handles single linked lists using templates, don't use this class if you intend to share it's data between threads if you do please use the appropiate semaphore or mutex code to prevent data corruption between threads, you have been warned.

Definition at line 22 of file List.h.

Public Methods

 List ()
 This is the default constructor, it initilizes all data to zero.

 ~List ()
 By default we only destroy the list itself, without destroying its data.

void destroy ()
 Use this method to destroy the list without destroying its data.

void add (T data)
 Appends an element to the end of the list.

void remove (int idx)
 Removes an element from the end of the list.

T & get (unsigned int j)
 Return the elemt at the j position of the list starting by the head.

T & operator[] (unsigned int i)
 Same as List::get(i).

char * getClassName ()
 Returns the name of the current class.


Protected Methods

void setClassName (char *n)
 Call this method when you need to set the name of the class you're creating, typically int it's constructor, remeber that you must set the classname for every clas you create, that way you can have more information while being in a debuging process.


Protected Attributes

unsigned int num_data
 Keeps a count of the number of elements contained in the list.

unsigned int middle
 Keeps the index of the data in the middle of the list.

nodeTlist
 Points to the beginning of the list.

nodeTend
 Points to the beginning of the list.


Constructor & Destructor Documentation

template<class T>
clawsoft.List< T >.List   [inline]
 

This is the default constructor, it initilizes all data to zero.

Definition at line 80 of file List.h.

References clawsoft.List< T >.num_data.

template<class T>
clawsoft.List< T >.~List   [inline]
 

By default we only destroy the list itself, without destroying its data.

Definition at line 89 of file List.h.

References clawsoft.List< T >.destroy().


Member Function Documentation

template<class T>
void clawsoft.List< T >.add   data [inline]
 

Appends an element to the end of the list.

Definition at line 108 of file List.h.

References clawsoft.List< T >.nodeT.before, clawsoft.List< T >.middle, clawsoft.List< T >.nodeT.next, and clawsoft.List< T >.num_data.

template<class T>
void clawsoft.List< T >.destroy   [inline]
 

Use this method to destroy the list without destroying its data.

Definition at line 96 of file List.h.

References clawsoft.List< T >.nodeT.next.

Referenced by clawsoft.List< T >.~List().

template<class T>
T& clawsoft.List< T >.get unsigned int    j [inline]
 

Return the elemt at the j position of the list starting by the head.

Definition at line 153 of file List.h.

References clawsoft.List< T >.nodeT.before, clawsoft.List< T >.nodeT.data, clawsoft.List< T >.middle, clawsoft.List< T >.nodeT.next, and clawsoft.List< T >.num_data.

Referenced by clawsoft.List< T >.operator[]().

char * clawsoft.Object::getClassName   [inherited]
 

Returns the name of the current class.

Definition at line 18 of file Object.cpp.

References clawsoft.Object.__cls_name.

template<class T>
T& clawsoft.List< T >.operator[] unsigned int    i [inline]
 

Same as List::get(i).

Definition at line 179 of file List.h.

References clawsoft.List< T >.get().

template<class T>
void clawsoft.List< T >.remove int    idx [inline]
 

Removes an element from the end of the list.

Definition at line 126 of file List.h.

References clawsoft.List< T >.nodeT.before, and clawsoft.List< T >.nodeT.next.

void clawsoft.Object::setClassName char *    n [protected, inherited]
 

Call this method when you need to set the name of the class you're creating, typically int it's constructor, remeber that you must set the classname for every clas you create, that way you can have more information while being in a debuging process.

Definition at line 14 of file Object.cpp.

References clawsoft.Object.__cls_name.

Referenced by clawsoft.ArrayOutOfBoundsException.ArrayOutOfBoundsException(), clawsoft.BrokenPipeException.BrokenPipeException(), clawsoft.Dialog.CancelButton.CancelButton(), clawsoft.CantLoadDSOException.CantLoadDSOException(), clawsoft.CantUnloadDSOException.CantUnloadDSOException(), clawsoft.ConnectionRefusedException.ConnectionRefusedException(), clawsoft.ConnectionTimeoutException.ConnectionTimeoutException(), clawsoft.Dialog.Dialog(), clawsoft.DSOException.DSOException(), clawsoft.DSOSymbolException.DSOSymbolException(), clawsoft.ElementNotFoundException.ElementNotFoundException(), clawsoft.Font.Font(), clawsoft.GameSelector.GameSelector(), clawsoft.Dialog.HelpButton.HelpButton(), clawsoft.IOException.IOException(), clawsoft.KeyboardEvent.KeyboardEvent(), clawsoft.LoginDialog.LoginDialog(), clawsoft.Mutex.Mutex(), clawsoft.MutexException.MutexException(), clawsoft.NetworkException.NetworkException(), clawsoft.NetworkUnreachableException.NetworkUnreachableException(), clawsoft.NoMoreTokensException.NoMoreTokensException(), clawsoft.NullPointerException.NullPointerException(), clawsoft.NumberException.NumberException(), clawsoft.Object.Object(), clawsoft.Dialog.OKButton.OKButton(), clawsoft.Plugin.Plugin(), clawsoft.ProcOutOfFileDescriptorsException.ProcOutOfFileDescriptorsException(), Random.Random(), clawsoft.ServerSocket.ServerSocket(), clawsoft.Socket.Socket(), clawsoft.SocketAlreadyBoundedException.SocketAlreadyBoundedException(), clawsoft.SocketAlreadyUsedException.SocketAlreadyUsedException(), clawsoft.SocketUnableToReadException.SocketUnableToReadException(), clawsoft.SocketUnableToWriteException.SocketUnableToWriteException(), clawsoft.SysOutOfFileDescriptorsException.SysOutOfFileDescriptorsException(), clawsoft.TextBox.TextBox(), clawsoft.TextButton.TextButton(), clawsoft.TextField.TextField(), clawsoft.Thread.Thread(), clawsoft.UnableToLockMutexException.UnableToLockMutexException(), clawsoft.UnableToUnlockMutexException.UnableToUnlockMutexException(), and clawsoft.Window.Window().


Field Documentation

template<class T>
nodeT* clawsoft.List< T >.end [protected]
 

Points to the beginning of the list.

Definition at line 74 of file List.h.

template<class T>
nodeT* clawsoft.List< T >.list [protected]
 

Points to the beginning of the list.

Definition at line 70 of file List.h.

template<class T>
unsigned int clawsoft.List< T >.middle [protected]
 

Keeps the index of the data in the middle of the list.

Definition at line 66 of file List.h.

Referenced by clawsoft.List< T >.add(), and clawsoft.List< T >.get().

template<class T>
unsigned int clawsoft.List< T >.num_data [protected]
 

Keeps a count of the number of elements contained in the list.

Definition at line 62 of file List.h.

Referenced by clawsoft.List< T >.add(), clawsoft.List< T >.get(), and clawsoft.List< T >.List().


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

Powered by:

SourceForge Logo