Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

skAlist.h

00001 /*
00002   Copyright 1996-2003
00003   Simon Whiteside
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 * $Id: skAlist_8h-source.html,v 1.7 2004/12/17 21:31:15 sdw Exp $
00020 */
00021 
00022 #ifndef skALIST_H
00023 #define skALIST_H
00024 
00025 
00026 #include "skGeneral.h"
00027   
00028 class  CLASSEXPORT skAList;  
00029 
00033 class  CLASSEXPORT skAListIterator 
00034 #ifdef __SYMBIAN32__
00035 : public CBase
00036 #endif
00037 {       
00038  public:
00042   void  reset();
00046   virtual ~skAListIterator();
00047  protected:
00051   skAListIterator(const skAList&);
00055   skAListIterator& operator=(const skAListIterator&);
00059   void * operator()();
00060  private:
00064   USize m_Current;
00068   const skAList& m_AList;
00069 };    
00074 class  CLASSEXPORT skAList 
00075 #ifdef __SYMBIAN32__
00076 : public CBase
00077 #endif
00078 {   
00079  public:
00083   inline virtual ~skAList();       
00087   IMPORT_C void clearAndDestroy();
00091   IMPORT_C void clear();
00095   inline USize entries() const;
00099   IMPORT_C void deleteElt(USize  n);
00103   IMPORT_C void test() const;
00108   IMPORT_C void growTo(USize size);
00112   inline USize getArraySize() const;
00113  protected:
00117   inline skAList();
00122   void insert(void *,USize index);
00127   void prepend(void *);
00132   inline void append(void *);
00136   void remove(void *);
00140   void removeAndDestroy(void *); 
00144   inline void * operator[](USize  n) const;
00148   inline int index(const void *) const;
00152   inline bool contains(const void *) const;
00156   virtual void deleteItem(void *)=0;
00157   friend class skAListIterator;
00161   inline int findElt(const void * i) const;
00166   IMPORT_C void grow();
00171   IMPORT_C void createArray();
00175   void ** m_Array;
00179   USize m_ArraySize;
00183   USize m_Entries;
00184  private:
00188   skAList(const skAList&);
00192   skAList& operator=(const skAList&);
00193 };    
00197 template <class T> class CLASSEXPORT skTAList : public skAList
00198 {
00199  public:
00203   skTAList();
00207   virtual ~skTAList();
00212   void insert(T *,USize index);
00217   void prepend(T *);
00222   void append(T *);
00226   void remove(T *);
00230   void removeAndDestroy(T *);
00234   T * operator[](USize  n) const;
00238   int index(const T *) const;
00242   bool contains(const T *) const;
00243  protected:
00247   void deleteItem(void *);
00248  private:
00252   skTAList<T>& operator=(const skTAList<T>& l);
00256   skTAList(const skTAList<T>&);
00257 };
00261 template <class T> class CLASSEXPORT skTAListIterator : public skAListIterator
00262 {       
00263  public:
00267   skTAListIterator(const skTAList<T>&);
00271   T * operator()();
00272 };    
00273 
00274 #include "skAlist.inl"
00275 
00276 #endif
00277 
00278 
00279 
00280 

Generated on Fri Dec 17 20:28:26 2004 for Simkin C++ for Symbian by doxygen1.3