home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / runnable / ibmc / ibmclass / irksset.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-26  |  4.2 KB  |  127 lines

  1. /* Copyright (c) IBM Corp. 1992 */
  2.  
  3. #ifndef _IRKSSET_H
  4. #define _IRKSSET_H
  5.  
  6. #include <iaksset.h>
  7.  
  8. template < class Element, class Key, class Base >
  9. class IRKeySortedSet : public virtual IAKeySortedSet < Element, Key > {
  10.   Base &ivBase;
  11. public:
  12.  
  13.        IRKeySortedSet (Base& base) : ivBase (base) {};
  14.  
  15.                  ~IRKeySortedSet             ();
  16.  
  17.    Boolean        add                         (Element const&);
  18.  
  19.    Boolean        add                         (Element const&,
  20.                                                ICursor&);
  21.  
  22.    Element const& elementAt                   (ICursor const&) const;
  23.  
  24.    Element&       elementAt                   (ICursor const&);
  25.  
  26.    Element const& anyElement                  () const;
  27.  
  28.    void           removeAt                    (ICursor const&);
  29.  
  30.    INumber        removeAll                   (Boolean (*property)
  31.                                                (Element const&, void*),
  32.                                                void* additionalArgument = 0);
  33.  
  34.    void           replaceAt                   (ICursor const&,
  35.                                                Element const&);
  36.  
  37.    void           removeAll                   ();
  38.  
  39.    Boolean        isBounded                   () const;
  40.  
  41.    INumber        maxNumberOfElements         () const;
  42.  
  43.    INumber        numberOfElements            () const;
  44.  
  45.    Boolean        isEmpty                     () const;
  46.  
  47.    Boolean        isFull                      () const;
  48.  
  49.    ICursor*       newCursor                   () const;
  50.  
  51.    Boolean        setToFirst                  (ICursor&) const;
  52.  
  53.    Boolean        setToNext                   (ICursor&) const;
  54.  
  55.    Boolean        allElementsDo               (Boolean (*function)
  56.                                                   (Element&, void*),
  57.                                                void* additionalArgument = 0);
  58.  
  59.    Boolean        allElementsDo               (IIterator <Element>&);
  60.  
  61.    Boolean        allElementsDo               (Boolean (*function)
  62.                                                (Element const&, void*),
  63.                                                void* additionalArgument = 0)
  64.                                                const;
  65.  
  66.    Boolean        allElementsDo               (IConstantIterator
  67.                                                   <Element>&) const;
  68.  
  69.    Key const&     key                         (Element const&) const;
  70.  
  71.    Boolean        containsElementWithKey      (Key const&) const;
  72.  
  73.    Boolean        locateElementWithKey        (Key const&, ICursor&)
  74.                                                const;
  75.  
  76.    Boolean        replaceElementWithKey       (Element const&);
  77.  
  78.    Boolean        replaceElementWithKey       (Element const&,
  79.                                                ICursor&);
  80.  
  81.    Boolean        locateOrAddElementWithKey   (Element const&);
  82.  
  83.    Boolean        locateOrAddElementWithKey   (Element const&,
  84.                                                ICursor&);
  85.  
  86.    Boolean        addOrReplaceElementWithKey  (Element const&);
  87.  
  88.    Boolean        addOrReplaceElementWithKey  (Element const&,
  89.                                                ICursor&);
  90.  
  91.    Boolean        removeElementWithKey        (Key const&);
  92.  
  93.    Element const& elementWithKey              (Key const&) const;
  94.  
  95.    Element&       elementWithKey              (Key const&);
  96.  
  97.    void           removeFirst                 ();
  98.  
  99.    void           removeLast                  ();
  100.  
  101.    void           removeAtPosition            (IPosition);
  102.  
  103.    Element const& firstElement                () const;
  104.  
  105.    Element const& lastElement                 () const;
  106.  
  107.    Element const& elementAtPosition           (IPosition) const;
  108.  
  109.    Boolean        setToLast                   (ICursor&) const;
  110.  
  111.    Boolean        setToPrevious               (ICursor&) const;
  112.  
  113.    void           setToPosition               (IPosition,
  114.                                                ICursor&) const;
  115.  
  116.    Boolean        isFirst                     (ICursor const&) const;
  117.  
  118.    Boolean        isLast                      (ICursor const&) const;
  119.  
  120. };
  121.  
  122. #ifdef __IBMCPP__
  123. #include <irksset.c>
  124. #endif
  125.  
  126. #endif
  127.