home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IASRTBAG.H < prev    next >
Text File  |  1993-09-22  |  3KB  |  70 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 _IASRTBAG_H
  13. #define _IASRTBAG_H
  14.  
  15. #include <iglobals.h>
  16. #include <icursor.h>
  17. #include <iaeqsrt.h>
  18.  
  19. template < class Element >
  20. class IASortedBag :
  21.   public virtual IAEqualitySortedCollection < Element > {
  22. public:
  23.  
  24.   virtual INumber        numberOfOccurrences         (Element const&) const = 0;
  25.  
  26.   virtual IBoolean       locateNext                  (Element const&, ICursor&)
  27.                                                const = 0;
  28.  
  29.   virtual INumber        removeAllOccurrences        (Element const&) = 0;
  30.  
  31.   virtual INumber        numberOfDifferentElements   () const = 0;
  32.  
  33.   virtual IBoolean       setToNextDifferentElement   (ICursor&) const = 0;
  34.  
  35.   virtual IBoolean       operator ==                 (IASortedBag < Element > const&) const;
  36.  
  37.   virtual IBoolean       operator !=                 (IASortedBag < Element > const&) const;
  38.  
  39.   virtual void           unionWith                   (IASortedBag < Element > const&) = 0;
  40.  
  41.   virtual void           intersectionWith            (IASortedBag < Element > const&) = 0;
  42.  
  43.   virtual void           differenceWith              (IASortedBag < Element > const&) = 0;
  44.  
  45.   virtual void           addUnion                    (IASortedBag < Element > const&,
  46.                                                IASortedBag < Element > const&) = 0;
  47.  
  48.   virtual void           addIntersection             (IASortedBag < Element > const&,
  49.                                                IASortedBag < Element > const&) = 0;
  50.  
  51.   virtual void           addDifference               (IASortedBag < Element > const&,
  52.                                                IASortedBag < Element > const&) = 0;
  53.  
  54.   virtual long           compare                     (IASortedBag < Element > const&,
  55.                                                long (*comparisonFunction)
  56.                                                   (Element const&,
  57.                                                   Element const&)) const;
  58.  
  59. protected:
  60.  
  61. };
  62.  
  63. #ifdef __IBMCPP__
  64. #ifndef __TEMPINC__
  65. #include <iasrtbag.c>
  66. #endif
  67. #endif
  68.  
  69. #endif
  70.