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