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

  1. /* Copyright (c) IBM Corp. 1992 */
  2.  
  3. #ifndef _IRBAG_H
  4. #define _IRBAG_H
  5.  
  6. #include <iabag.h>
  7.  
  8. template < class Element, class Base >
  9. class IRBag : public virtual IABag < Element > {
  10.   Base &ivBase;
  11. public:
  12.  
  13.        IRBag (Base& base) : ivBase (base) {};
  14.  
  15.                  ~IRBag             ();
  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.    INumber        numberOfOccurrences         (Element const&) const;
  82.  
  83.    Boolean        locateNext                  (Element const&, ICursor&)
  84.                                                const;
  85.  
  86.    INumber        removeAllOccurrences        (Element const&);
  87.  
  88.    INumber        numberOfDifferentElements   () const;
  89.  
  90.    Boolean        setToNextDifferentElement   (ICursor&) const;
  91.  
  92. };
  93.  
  94. #ifdef __IBMCPP__
  95. #include <irbag.c>
  96. #endif
  97.  
  98. #endif
  99.