home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IRSRTMAP.H < prev    next >
Text File  |  1993-09-22  |  7KB  |  169 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 _IRSRTMAP_H
  13. #define _IRSRTMAP_H
  14.  
  15. #include <iasrtmap.h>
  16.  
  17. template < class Element, class Key, class Base >
  18. class IRSortedMap : public virtual IASortedMap < Element, Key > {
  19.   Base &ivBase;
  20. public:
  21.  
  22.        IRSortedMap (Base& base) : ivBase (base) {};
  23.  
  24.                  ~IRSortedMap             ();
  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&       elementAt                   (ICursor const&);
  34.  
  35.    Element const& anyElement                  () const;
  36.  
  37.    void           removeAt                    (ICursor const&);
  38.  
  39.    INumber        removeAll                   (IBoolean (*property)
  40.                                                (Element const&, void*),
  41.                                                void* additionalArgument = 0);
  42.  
  43.    void           replaceAt                   (ICursor const&,
  44.                                                Element const&);
  45.  
  46.    void           removeAll                   ();
  47.  
  48.    IBoolean       isBounded                   () const;
  49.  
  50.    INumber        maxNumberOfElements         () const;
  51.  
  52.    INumber        numberOfElements            () const;
  53.  
  54.    IBoolean       isEmpty                     () const;
  55.  
  56.    IBoolean       isFull                      () const;
  57.  
  58.    ICursor*       newCursor                   () const;
  59.  
  60.    IBoolean       setToFirst                  (ICursor&) const;
  61.  
  62.    IBoolean       setToNext                   (ICursor&) const;
  63.  
  64.    IBoolean       allElementsDo               (IBoolean (*function)
  65.                                                   (Element&, void*),
  66.                                                void* additionalArgument = 0);
  67.  
  68.    IBoolean       allElementsDo               (IIterator <Element>&);
  69.  
  70.    IBoolean       allElementsDo               (IBoolean (*function)
  71.                                                (Element const&, void*),
  72.                                                void* additionalArgument = 0)
  73.                                                const;
  74.  
  75.    IBoolean       allElementsDo               (IConstantIterator
  76.                                                   <Element>&) const;
  77.  
  78.    IBoolean       isConsistent                () const;
  79.  
  80.    IBoolean       contains                    (Element const&) const;
  81.  
  82.    IBoolean       locate                      (Element const&, ICursor&)
  83.                                                const;
  84.  
  85.    IBoolean       locateOrAdd                 (Element const&);
  86.  
  87.    IBoolean       locateOrAdd                 (Element const&,
  88.                                                ICursor&);
  89.  
  90.    IBoolean       remove                      (Element const&);
  91.  
  92.    void           unionWith                   (IASortedMap < Element, Key > const&);
  93.  
  94.    void           intersectionWith            (IASortedMap < Element, Key > const&);
  95.  
  96.    void           differenceWith              (IASortedMap < Element, Key > const&);
  97.  
  98.    void           addUnion                    (IASortedMap < Element, Key > const&,
  99.                                                IASortedMap < Element, Key > const&);
  100.  
  101.    void           addIntersection             (IASortedMap < Element, Key > const&,
  102.                                                IASortedMap < Element, Key > const&);
  103.  
  104.    void           addDifference               (IASortedMap < Element, Key > const&,
  105.                                                IASortedMap < Element, Key > const&);
  106.  
  107.    Key const&     key                         (Element const&) const;
  108.  
  109.    IBoolean       containsElementWithKey      (Key const&) const;
  110.  
  111.    IBoolean       locateElementWithKey        (Key const&, ICursor&)
  112.                                                const;
  113.  
  114.    IBoolean       replaceElementWithKey       (Element const&);
  115.  
  116.    IBoolean       replaceElementWithKey       (Element const&,
  117.                                                ICursor&);
  118.  
  119.    IBoolean       locateOrAddElementWithKey   (Element const&);
  120.  
  121.    IBoolean       locateOrAddElementWithKey   (Element const&,
  122.                                                ICursor&);
  123.  
  124.    IBoolean       addOrReplaceElementWithKey  (Element const&);
  125.  
  126.    IBoolean       addOrReplaceElementWithKey  (Element const&,
  127.                                                ICursor&);
  128.  
  129.    IBoolean       removeElementWithKey        (Key const&);
  130.  
  131.    Element const& elementWithKey              (Key const&) const;
  132.  
  133.    Element&       elementWithKey              (Key const&);
  134.  
  135.    void           removeFirst                 ();
  136.  
  137.    void           removeLast                  ();
  138.  
  139.    void           removeAtPosition            (IPosition);
  140.  
  141.    Element const& firstElement                () const;
  142.  
  143.    Element const& lastElement                 () const;
  144.  
  145.    Element const& elementAtPosition           (IPosition) const;
  146.  
  147.    IBoolean       setToLast                   (ICursor&) const;
  148.  
  149.    IBoolean       setToPrevious               (ICursor&) const;
  150.  
  151.    void           setToPosition               (IPosition,
  152.                                                ICursor&) const;
  153.  
  154.    IBoolean       isFirst                     (ICursor const&) const;
  155.  
  156.    IBoolean       isLast                      (ICursor const&) const;
  157.  
  158. protected:
  159.   void* identity () const;
  160. };
  161.  
  162. #ifdef __IBMCPP__
  163. #ifndef __TEMPINC__
  164. #include <irsrtmap.c>
  165. #endif
  166. #endif
  167.  
  168. #endif
  169.