home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iapqu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  3.5 KB  |  119 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 _IAPQU_H
  19. #define _IAPQU_H
  20.  
  21. #include <iarstrct.h>
  22. #include <iaorder.h>
  23. #include <iiaksb.h>
  24.  
  25. #pragma info (nocls, nocnd, nocns, nocnv, noext, nognr, novft)
  26. #pragma pack (4)
  27.  
  28. #pragma SOMAsDefault (off)
  29.  
  30. template <class Element, class Key>
  31. class IAPriorityQueue :
  32.   public IARestrictedAccessCollection <Element> {
  33.  
  34.   typedef  IARestrictedAccessCollection <Element> Inherited;
  35.  
  36.   typedef  IAKeySortedBagImpl Implementation;
  37.  
  38. public:
  39.  
  40.            IAPriorityQueue
  41.                             (INotifier&);
  42.  
  43.           ~IAPriorityQueue
  44.                             ();
  45.  
  46.   long     compare          (IAPriorityQueue <Element, Key> const&,
  47.                              long (*comparisonFunction)
  48.                               (Element const&, Element const&)) const;
  49.  
  50.   IBoolean containsAllKeysFrom
  51.                             (IARestrictedAccessCollection
  52.                               <Element> const&) const;
  53.  
  54.   IBoolean containsElementWithKey
  55.                             (Key const&) const;
  56.  
  57.   void     dequeue          ();
  58.  
  59.   void     dequeue          (Element&);
  60.  
  61.   Element const&
  62.            elementWithKey   (Key const&) const;
  63.  
  64.   void     enqueue          (Element const&);
  65.  
  66.   void     enqueue          (Element const&, ICursor&);
  67.  
  68.   Key const&
  69.            key              (Element const&) const;
  70.  
  71.   IBoolean locateElementWithKey
  72.                             (Key const&, ICursor&) const;
  73.  
  74.   IBoolean locateNextElementWithKey
  75.                             (Key const&, ICursor&) const;
  76.  
  77.   IBoolean locateOrAddElementWithKey
  78.                             (Element const&);
  79.  
  80.   IBoolean locateOrAddElementWithKey
  81.                             (Element const&, ICursor&);
  82.  
  83.   INumber  numberOfDifferentKeys
  84.                             () const;
  85.  
  86.   INumber  numberOfElementsWithKey
  87.                             (Key const&) const;
  88.  
  89.   void     removeFirst      ();
  90.  
  91.   IBoolean setToNextWithDifferentKey
  92.                             (ICursor&) const;
  93.  
  94. protected:
  95.  
  96.            IAPriorityQueue
  97.                             ();
  98.  
  99.            IAPriorityQueue
  100.                             (IAPriorityQueue <Element, Key> const&);
  101.  
  102. private:
  103.  
  104.   static
  105.   Implementation&
  106.            ImplOf           (IAPriorityQueue <Element, Key> const&);
  107.  
  108.  
  109. };
  110.  
  111. #include <iapqu.inl>
  112.  
  113. #pragma SOMAsDefault (pop)
  114.  
  115. #pragma info (restore)
  116. #pragma pack ()
  117.  
  118. #endif
  119.