|
|
/*============================================================================= Copyright (C) 2001 Silicon Tao Technology Systems E-mail: SupportWeb: www.silicontao.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =============================================================================*/ /*============================================================================= File Name: STList.h Object Name: STList Programmer Name: Roy Souther By Command of: Silicon Tao Technology Systems License: GNU general public license. See GNU. Day Zero: 02152000, Feburary 15, 2000 Target Platform: Linux Registors Used: Compiler Used: GNU g++ Compiled Settings: Resources Used: Libraries Used: alloc.h, stdio.h, string.h Ports Used: None Title of program: Object library Discription: Basic linked list =============================================================================*/ #ifndef STList_included #define STList_included // Do not use STMalloc here, would cause recursive loop. #include #include #include #define ByName 1 #define BySize 0 // For NodePointer see CommanSTCore /** * A list for pointers. * * @short A simple list. */ class STList { private: struct NodePointer { void *Item; NodePointer *PointerToNextCell; NodePointer *PointerToPreviousCell; }; NodePointer *FirstCell, *PreviousCell, *CurrentCell, *NextCell, *LastCell; void MoveToCell(int CellToGoto); unsigned int NodeCount; public: /** * Tells the number of nodes in the list. */ unsigned int Count(); /** * Appends a new node to the end of the list. */ void Add(void *NewItemToAdd); /** * Deletes a node from the list. */ void Delete(int CellToKill); /** * Deletes all nodes from the list. */ void Clear(); /** * Returns a pointer contained in a node of the list. */ void *Item(int ItemIndex); /** * Moves a node in the list from Source to Dest * * Has not been implemented yet. */ void MoveTo(int SourceIndex, int DestIndex); /** * Constructor */ STList(); /** * Destructor */ ~STList(); }; #endif // STList_included
Generated by: root on UtopiaPlanitia.Ept on Mon Dec 10 22:55:12 2001, using kdoc 2.0a53. |