home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / pascal / rehack / contain / sortlist.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-06-01  |  1.0 KB  |  31 lines

  1. #ifndef __SORTLIST_H
  2. #define __SORTLIST_H
  3.  
  4. // ╔════════════════════════════════════════════════╗
  5. // ║ sortlist.h, sortlist.cpp                       ║
  6. // ╟────────────────────────────────────────────────╢
  7. // ║ Sorted linked lists                            ║
  8. // ╟────────────────────────────────────────────────╢
  9. // ║ Written by Gus Smedstad                        ║
  10. // ╟────────────────────────────────────────────────╢
  11. // ║ Copyright 1990-91 NoGate Consulting            ║
  12. // ╚════════════════════════════════════════════════╝
  13.  
  14. #ifndef __DOUBLE_H
  15. #include "double.h"
  16. #endif
  17.  
  18. class sorted_list : public double_list { // ascending order
  19. public:
  20.   virtual void      put(containable *arg);
  21.           sortable *find(sortable &arg);  // find an object >= arg
  22.  };
  23.  
  24. class sorted_index : public double_index {
  25. public:
  26.   sorted_index(sorted_list &base) : double_index(base) {};
  27.   int       find(sortable &arg); // look for an item >= to arg
  28.   sortable *value() { return (sortable *) item(); };
  29.  };
  30.  
  31. #endif