home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / runnable / ibmc / ibmclass / irseq.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-26  |  4.3 KB  |  126 lines

  1. /* Copyright (c) IBM Corp. 1992 */
  2.  
  3. #ifndef _IRSEQ_H
  4. #define _IRSEQ_H
  5.  
  6. #include <iaseq.h>
  7.  
  8. template < class Element, class Base >
  9. class IRSequence : public virtual IASequence < Element > {
  10.   Base &ivBase;
  11. public:
  12.  
  13.        IRSequence (Base& base) : ivBase (base) {};
  14.  
  15.                  ~IRSequence             ();
  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.    void           removeFirst                 ();
  70.  
  71.    void           removeLast                  ();
  72.  
  73.    void           removeAtPosition            (IPosition);
  74.  
  75.    Element const& firstElement                () const;
  76.  
  77.    Element const& lastElement                 () const;
  78.  
  79.    Element const& elementAtPosition           (IPosition) const;
  80.  
  81.    Boolean        setToLast                   (ICursor&) const;
  82.  
  83.    Boolean        setToPrevious               (ICursor&) const;
  84.  
  85.    void           setToPosition               (IPosition,
  86.                                                ICursor&) const;
  87.  
  88.    Boolean        isFirst                     (ICursor const&) const;
  89.  
  90.    Boolean        isLast                      (ICursor const&) const;
  91.  
  92.    void           addAsFirst                  (Element const&);
  93.  
  94.    void           addAsFirst                  (Element const&,
  95.                                                ICursor&);
  96.  
  97.    void           addAsLast                   (Element const&);
  98.  
  99.    void           addAsLast                   (Element const&,
  100.                                                ICursor&);
  101.  
  102.    void           addAsNext                   (Element const&,
  103.                                                ICursor&);
  104.  
  105.    void           addAsPrevious               (Element const&,
  106.                                                ICursor&);
  107.  
  108.    void           addAtPosition               (IPosition,
  109.                                                Element const&);
  110.  
  111.    void           addAtPosition               (IPosition,
  112.                                                Element const&,
  113.                                                ICursor&);
  114.  
  115.    void           sort                        (long (*comparisonFunction)
  116.                                                (Element const&,
  117.                                                Element const&));
  118.  
  119. };
  120.  
  121. #ifdef __IBMCPP__
  122. #include <irseq.c>
  123. #endif
  124.  
  125. #endif
  126.