home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dho.zip / DHO / SRC / SORTLIST.H < prev    next >
C/C++ Source or Header  |  1995-08-27  |  957b  |  43 lines

  1. /****************************************/
  2. /*    Developer Helper Object Set       */
  3. /*  (C) 1994-95 Thomas E. Bednarz, Jr.  */
  4. /*     All rights reserved              */
  5. /***************************************/
  6.  
  7. /* $Id: sortlist.h 1.4 1995/08/13 03:21:12 teb Exp $ */
  8.  
  9.  
  10. #ifndef __SORTLIST_H__
  11. #define __SORTLIST_H__
  12.  
  13. #include<list.h>
  14.  
  15. class TSortedList: public TList
  16. {
  17.  
  18.       virtual int compare( void *key1, void *key2 ) = 0;
  19.   
  20.    protected:
  21.  
  22.       TSortedList(void);
  23.       virtual void *keyOf( TObject *item );
  24.       Boolean duplicates;
  25.    public:
  26.  
  27.       TSortedList( ListIndex aLimit, ListIndex aDelta);
  28.  
  29.       virtual Boolean search( void *key, ListIndex & index );
  30.  
  31.       virtual ListIndex indexOf( TObject *item );
  32.       virtual ListIndex insert( TObject *item );
  33.  
  34.       void KeepDuplicates(Boolean dups);
  35.       Boolean getDuplicateState(void);
  36.  
  37.       virtual const char *getClassName(void);
  38. };
  39.  
  40.  
  41. #endif
  42.  
  43.