00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
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