home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IASRTMAP.H < prev    next >
Text File  |  1993-09-22  |  3KB  |  77 lines

  1. /*******************************************************************************
  2. *                                                                              *
  3. * COPYRIGHT:                                                                   *
  4. *   IBM C/C++ Tools Version 2.01 - Collection Class Library                    *
  5. *   Licensed Materials - Property of IBM                                       *
  6. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  7. *   All Rights Reserved                                                        *
  8. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  9. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  10. *                                                                              *
  11. *******************************************************************************/
  12. #ifndef _IASRTMAP_H
  13. #define _IASRTMAP_H
  14.  
  15. #include <iglobals.h>
  16. #include <icursor.h>
  17. #include <iaeqksrt.h>
  18.  
  19. template < class Element, class Key >
  20. class IASortedMap :
  21.   public virtual IAEqualityKeySortedCollection < Element, Key > {
  22. public:
  23.  
  24.   virtual IBoolean       operator ==                 (IASortedMap < Element, Key > const&) const;
  25.  
  26.   virtual IBoolean       operator !=                 (IASortedMap < Element, Key > const&) const;
  27.  
  28.   virtual void           unionWith                   (IASortedMap < Element, Key > const&) = 0;
  29.  
  30.   virtual void           intersectionWith            (IASortedMap < Element, Key > const&) = 0;
  31.  
  32.   virtual void           differenceWith              (IASortedMap < Element, Key > const&) = 0;
  33.  
  34.   virtual void           addUnion                    (IASortedMap < Element, Key > const&,
  35.                                                IASortedMap < Element, Key > const&) = 0;
  36.  
  37.   virtual void           addIntersection             (IASortedMap < Element, Key > const&,
  38.                                                IASortedMap < Element, Key > const&) = 0;
  39.  
  40.   virtual void           addDifference               (IASortedMap < Element, Key > const&,
  41.                                                IASortedMap < Element, Key > const&) = 0;
  42.  
  43.   virtual long           compare                     (IASortedMap < Element, Key > const&,
  44.                                                long (*comparisonFunction)
  45.                                                   (Element const&,
  46.                                                   Element const&)) const;
  47.  
  48. protected:
  49.  
  50.    INumber        numberOfOccurrences         (Element const&) const;
  51.  
  52.    IBoolean       locateNext                  (Element const&, ICursor&)
  53.                                                const;
  54.  
  55.    INumber        removeAllOccurrences        (Element const&);
  56.  
  57.    INumber        numberOfElementsWithKey     (Key const&) const;
  58.  
  59.    IBoolean       locateNextElementWithKey    (Key const&,
  60.                                                ICursor&) const;
  61.  
  62.    INumber        removeAllElementsWithKey    (Key const&);
  63.  
  64.    INumber        numberOfDifferentKeys       () const;
  65.  
  66.    IBoolean       setToNextWithDifferentKey   (ICursor&) const;
  67.  
  68. };
  69.  
  70. #ifdef __IBMCPP__
  71. #ifndef __TEMPINC__
  72. #include <iasrtmap.c>
  73. #endif
  74. #endif
  75.  
  76. #endif
  77.