home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / bbxxk / irsrtmap.h__ / IRSRTMAP.H
Encoding:
C/C++ Source or Header  |  1992-10-26  |  4.6 KB  |  139 lines

  1. /* Copyright (c) IBM Corp. 1992 */
  2.  
  3. #ifndef _IRSRTMAP_H
  4. #define _IRSRTMAP_H
  5.  
  6. #include <iasrtmap.h>
  7.  
  8. template < class Element, class Key, class Base >
  9. class IRSortedMap : public virtual IASortedMap < Element, Key > {
  10.   Base &ivBase;
  11. public:
  12.  
  13.        IRSortedMap (Base& base) : ivBase (base) {};
  14.  
  15.                  ~IRSortedMap             ();
  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.    Boolean        contains                    (Element const&) const;
  70.  
  71.    Boolean        locate                      (Element const&, ICursor&)
  72.                                                const;
  73.  
  74.    Boolean        locateOrAdd                 (Element const&);
  75.  
  76.    Boolean        locateOrAdd                 (Element const&,
  77.                                                ICursor&);
  78.  
  79.    Boolean        remove                      (Element const&);
  80.  
  81.    Key const&     key                         (Element const&) const;
  82.  
  83.    Boolean        containsElementWithKey      (Key const&) const;
  84.  
  85.    Boolean        locateElementWithKey        (Key const&, ICursor&)
  86.                                                const;
  87.  
  88.    Boolean        replaceElementWithKey       (Element const&);
  89.  
  90.    Boolean        replaceElementWithKey       (Element const&,
  91.                                                ICursor&);
  92.  
  93.    Boolean        locateOrAddElementWithKey   (Element const&);
  94.  
  95.    Boolean        locateOrAddElementWithKey   (Element const&,
  96.                                                ICursor&);
  97.  
  98.    Boolean        addOrReplaceElementWithKey  (Element const&);
  99.  
  100.    Boolean        addOrReplaceElementWithKey  (Element const&,
  101.                                                ICursor&);
  102.  
  103.    Boolean        removeElementWithKey        (Key const&);
  104.  
  105.    Element const& elementWithKey              (Key const&) const;
  106.  
  107.    Element&       elementWithKey              (Key const&);
  108.  
  109.    void           removeFirst                 ();
  110.  
  111.    void           removeLast                  ();
  112.  
  113.    void           removeAtPosition            (IPosition);
  114.  
  115.    Element const& firstElement                () const;
  116.  
  117.    Element const& lastElement                 () const;
  118.  
  119.    Element const& elementAtPosition           (IPosition) const;
  120.  
  121.    Boolean        setToLast                   (ICursor&) const;
  122.  
  123.    Boolean        setToPrevious               (ICursor&) const;
  124.  
  125.    void           setToPosition               (IPosition,
  126.                                                ICursor&) const;
  127.  
  128.    Boolean        isFirst                     (ICursor const&) const;
  129.  
  130.    Boolean        isLast                      (ICursor const&) const;
  131.  
  132. };
  133.  
  134. #ifdef __IBMCPP__
  135. #include <irsrtmap.c>
  136. #endif
  137.  
  138. #endif
  139.