Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

phLinkedList.h

Go to the documentation of this file.
00001 /* ---------------------------------------------------------------------------
00002     Phission : 
00003         Realtime Vision Processing System
00004     
00005     Copyright (C) 2003-2006 Philip D.S. Thoren (pthoren@cs.uml.edu)
00006     University of Massachusetts at Lowell,
00007     Laboratory for Artificial Intelligence and Robotics
00008     
00009     This file is part of Phission.
00010 
00011     Phission is free software; you can redistribute it and/or modify
00012     it under the terms of the GNU Lesser General Public License as published by
00013     the Free Software Foundation; either version 2 of the License, or
00014     (at your option) any later version.
00015 
00016     Phission is distributed in the hope that it will be useful,
00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019     GNU Lesser General Public License for more details.
00020 
00021     You should have received a copy of the GNU Lesser General Public License
00022     along with Phission; if not, write to the Free Software
00023     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024 
00025  ---------------------------------------------------------------------------*/
00026 #ifndef _PHLINKEDLIST_H
00027 #define _PHLINKEDLIST_H
00028 
00029 #include <phStdint.h>
00030 #include <phObject.h>
00031 
00032 /* ------------------------------------------------------------------------ */
00046 PHAPI(class) phLinkedListNode : public phObject
00047 {
00048 protected:
00049     phLinkedListNode *m_next;
00050     phLinkedListNode *m_previous;
00051 
00052 public:
00056     phLinkedListNode();
00062     ~phLinkedListNode();
00063     
00075     int         setNext     ( phLinkedListNode *node );
00087     int         setPrevious ( phLinkedListNode *node );
00088 
00094     phLinkedListNode *getNext     ( );
00101     phLinkedListNode *getPrevious ( );
00102 };
00103 
00104 /* ------------------------------------------------------------------------ */
00113 PHAPI(class) phLinkedList : public phObject
00114 {
00115 protected:
00117     uint32_t m_totalNodes;
00118     
00120     phLinkedListNode *m_head;
00122     phLinkedListNode *m_tail;
00123 
00124 public:
00129     phLinkedList();
00134     ~phLinkedList();
00135     
00142     uint32_t length();
00149     uint32_t getTotal();
00159     int isEmpty();
00160     
00166     int empty();
00167     
00183     int insert( phLinkedListNode *pobj, uint32_t index = 0 );
00184 
00199     int remove( phLinkedListNode *pobj );
00200     
00210     int         push   ( phLinkedListNode *pobj );
00217     phLinkedListNode *pop    ( );
00218     
00231     int         enqueue( phLinkedListNode *node );
00243     phLinkedListNode *dequeue( );
00244     
00252     int         unshift( phLinkedListNode *node );
00259     phLinkedListNode *shift  ( );
00260 
00265     phLinkedListNode *removeTail();
00273     phLinkedListNode *removeHead();
00274 
00282     const phLinkedListNode *getHead();
00291     const phLinkedListNode *getTail();
00292 };
00293 
00294 #endif /* _PHLINKEDLIST_H */




Copyright (C) 2002 - 2007 Philip D.S. Thoren ( pthoren@users.sourceforge.net )
University Of Massachusetts at Lowell
Robotics Lab
SourceForge.net Logo

Generated on Sat Jun 16 02:44:02 2007 for phission by  doxygen 1.4.4