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

  1. /* Copyright (c) IBM Corp. 1992 */
  2.  
  3. #ifndef _IRKEYSET_H
  4. #define _IRKEYSET_H
  5.  
  6. #include <iakeyset.h>
  7.  
  8. template < class Element, class Key, class Base >
  9. class IRKeySet : public virtual IAKeySet < Element, Key > {
  10.   Base &ivBase;
  11. public:
  12.  
  13.        IRKeySet (Base& base) : ivBase (base) {};
  14.  
  15.                  ~IRKeySet             ();
  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. };
  98.  
  99. #ifdef __IBMCPP__
  100. #include <irkeyset.c>
  101. #endif
  102.  
  103. #endif
  104.