home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iamap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  3.4 KB  |  114 lines

  1. /**********************************************************************
  2. *                                                                     *
  3. *  IBM(R) VisualAge(TM) for C++ for Windows(R), Version 3.5           *
  4. *                                                                     *
  5. *  PID: 5622-880                                                      *
  6. *  - Licensed Material - Program-Property of IBM                      *
  7. *  (C) Copyright IBM Corp. 1991, 1995 - All Right Reserved.           *
  8. *                                                                     *
  9. *  US Government Users Restricted Rights - Use, duplication or        *
  10. *  disclosure restricted by GSA ADP Schedule Contract with IBM Corp.  *
  11. *                                                                     *
  12. *  VisualAge, and IBM are trademarks or registered trademarks of      *
  13. *  International Business Machines Corporation.                       *
  14. *  Windows is a registered trademark of Microsoft Corporation.        *
  15. *                                                                     *
  16. **********************************************************************/
  17.  
  18. #ifndef _IAMAP_H
  19. #define _IAMAP_H
  20.  
  21. #include <iaeqkey.h>
  22. #include <iiamap.h>
  23.  
  24. #pragma info (nocls, nocnd, nocns, nocnv, noext, nognr, novft)
  25. #pragma pack (4)
  26.  
  27. #pragma SOMAsDefault (off)
  28.  
  29. template <class Element, class Key>
  30. class IAMap :
  31.   public IAEqualityKeyCollection <Element, Key> {
  32.  
  33.   typedef  IAEqualityKeyCollection <Element, Key> Inherited;
  34.  
  35.   typedef  IAMapImpl Implementation;
  36.  
  37. public:
  38.  
  39.            IAMap
  40.                             (INotifier&);
  41.  
  42.           ~IAMap
  43.                             ();
  44.  
  45.   void     addDifference    (IAMap <Element, Key> const&,
  46.                              IAMap <Element, Key> const&); 
  47.  
  48.   void     addIntersection  (IAMap <Element, Key> const&,
  49.                              IAMap <Element, Key> const&);
  50.  
  51.   void     addUnion         (IAMap <Element, Key> const&,
  52.                              IAMap <Element, Key> const&);
  53.  
  54.   void     differenceWith   (IAMap <Element, Key> const&);
  55.  
  56.   void     intersectionWith (IAMap <Element, Key> const&);
  57.  
  58.   void     unionWith        (IAMap <Element, Key> const&);
  59.  
  60.   IBoolean operator==       (IAMap
  61.                               <Element, Key> const&) const;
  62.  
  63.   IBoolean operator!=       (IAMap
  64.                               <Element, Key> const&) const;
  65.  
  66. protected:
  67.  
  68.            IAMap
  69.                             ();
  70.  
  71.            IAMap
  72.                             (IAMap <Element, Key> const&);
  73.  
  74.   IBoolean locateNext       (Element const&, ICursor&) const;
  75.  
  76.   IBoolean locateNextElementWithKey
  77.                             (Key const&, ICursor&) const;
  78.  
  79.   INumber  numberOfDifferentKeys
  80.                             () const;
  81.  
  82.   INumber  numberOfElementsWithKey
  83.                             (Key const&) const;
  84.  
  85.   INumber  numberOfOccurrences
  86.                             (Element const&) const;
  87.  
  88.   INumber  removeAllOccurrences
  89.                             (Element const&);
  90.  
  91.   INumber  removeAllElementsWithKey
  92.                             (Key const&);
  93.  
  94.   IBoolean setToNextWithDifferentKey
  95.                             (ICursor&) const;
  96.  
  97. private:
  98.  
  99.   static
  100.   Implementation&
  101.            ImplOf           (IAMap <Element, Key> const&);
  102.  
  103.  
  104. };
  105.  
  106. #include <iamap.inl>
  107.  
  108. #pragma SOMAsDefault (pop)
  109.  
  110. #pragma info (restore)
  111. #pragma pack ()
  112.  
  113. #endif
  114.