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

  1. /* Copyright (c) IBM Corp. 1992 */
  2.  
  3. #ifndef _IRREL_H
  4. #define _IRREL_H
  5.  
  6. #include <iarel.h>
  7.  
  8. template < class Element, class Key, class Base >
  9. class IRRelation : public virtual IARelation < Element, Key > {
  10.   Base &ivBase;
  11. public:
  12.  
  13.        IRRelation (Base& base) : ivBase (base) {};
  14.  
  15.                  ~IRRelation             ();
  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.    INumber        numberOfElementsWithKey     (Key const&) const;
  110.  
  111.    Boolean        locateNextElementWithKey    (Key const&,
  112.                                                ICursor&) const;
  113.  
  114.    INumber        removeAllElementsWithKey    (Key const&);
  115.  
  116.    INumber        numberOfDifferentKeys       () const;
  117.  
  118.    Boolean        setToNextWithDifferentKey   (ICursor&) const;
  119.  
  120. };
  121.  
  122. #ifdef __IBMCPP__
  123. #include <irrel.c>
  124. #endif
  125.  
  126. #endif
  127.