home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IRPRIOQU.H < prev    next >
Text File  |  1993-09-22  |  5KB  |  125 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 _IRPRIOQU_H
  13. #define _IRPRIOQU_H
  14.  
  15. #include <iaprioqu.h>
  16.  
  17. template < class Element, class Key, class Base >
  18. class IRPriorityQueue : public virtual IAPriorityQueue < Element, Key > {
  19.   Base &ivBase;
  20. public:
  21.  
  22.        IRPriorityQueue (Base& base) : ivBase (base) {};
  23.  
  24.                  ~IRPriorityQueue             ();
  25.  
  26.    IBoolean       add                         (Element const&);
  27.  
  28.    IBoolean       add                         (Element const&,
  29.                                                ICursor&);
  30.  
  31.    Element const& elementAt                   (ICursor const&) const;
  32.  
  33.    Element const& anyElement                  () const;
  34.  
  35.    void           removeAll                   ();
  36.  
  37.    IBoolean       isBounded                   () const;
  38.  
  39.    INumber        maxNumberOfElements         () const;
  40.  
  41.    INumber        numberOfElements            () const;
  42.  
  43.    IBoolean       isEmpty                     () const;
  44.  
  45.    IBoolean       isFull                      () const;
  46.  
  47.    ICursor*       newCursor                   () const;
  48.  
  49.    IBoolean       setToFirst                  (ICursor&) const;
  50.  
  51.    IBoolean       setToNext                   (ICursor&) const;
  52.  
  53.    IBoolean       allElementsDo               (IBoolean (*function)
  54.                                                (Element const&, void*),
  55.                                                void* additionalArgument = 0)
  56.                                                const;
  57.  
  58.    IBoolean       allElementsDo               (IConstantIterator
  59.                                                   <Element>&) const;
  60.  
  61.    IBoolean       isConsistent                () const;
  62.  
  63.    Key const&     key                         (Element const&) const;
  64.  
  65.    IBoolean       containsElementWithKey      (Key const&) const;
  66.  
  67.    IBoolean       locateElementWithKey        (Key const&, ICursor&)
  68.                                                const;
  69.  
  70.    IBoolean       locateOrAddElementWithKey   (Element const&);
  71.  
  72.    IBoolean       locateOrAddElementWithKey   (Element const&,
  73.                                                ICursor&);
  74.  
  75.    Element const& elementWithKey              (Key const&) const;
  76.  
  77.    INumber        numberOfElementsWithKey     (Key const&) const;
  78.  
  79.    IBoolean       locateNextElementWithKey    (Key const&,
  80.                                                ICursor&) const;
  81.  
  82.    INumber        numberOfDifferentKeys       () const;
  83.  
  84.    IBoolean       setToNextWithDifferentKey   (ICursor&) const;
  85.  
  86.    void           removeFirst                 ();
  87.  
  88.    Element const& firstElement                () const;
  89.  
  90.    Element const& lastElement                 () const;
  91.  
  92.    Element const& elementAtPosition           (IPosition) const;
  93.  
  94.    IBoolean       setToLast                   (ICursor&) const;
  95.  
  96.    IBoolean       setToPrevious               (ICursor&) const;
  97.  
  98.    void           setToPosition               (IPosition,
  99.                                                ICursor&) const;
  100.  
  101.    IBoolean       isFirst                     (ICursor const&) const;
  102.  
  103.    IBoolean       isLast                      (ICursor const&) const;
  104.  
  105.    void           enqueue                     (Element const&);
  106.  
  107.    void           enqueue                     (Element const&,
  108.                                                ICursor&);
  109.  
  110.    void           dequeue                     ();
  111.  
  112.    void           dequeue                     (Element&);
  113.  
  114. protected:
  115.   void* identity () const;
  116. };
  117.  
  118. #ifdef __IBMCPP__
  119. #ifndef __TEMPINC__
  120. #include <irprioqu.c>
  121. #endif
  122. #endif
  123.  
  124. #endif
  125.