home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IRKEYBAG.H < prev    next >
Text File  |  1993-09-22  |  5KB  |  130 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 _IRKEYBAG_H
  13. #define _IRKEYBAG_H
  14.  
  15. #include <iakeybag.h>
  16.  
  17. template < class Element, class Key, class Base >
  18. class IRKeyBag : public virtual IAKeyBag < Element, Key > {
  19.   Base &ivBase;
  20. public:
  21.  
  22.        IRKeyBag (Base& base) : ivBase (base) {};
  23.  
  24.                  ~IRKeyBag             ();
  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.    Key const&     key                         (Element const&) const;
  81.  
  82.    IBoolean       containsElementWithKey      (Key const&) const;
  83.  
  84.    IBoolean       locateElementWithKey        (Key const&, ICursor&)
  85.                                                const;
  86.  
  87.    IBoolean       replaceElementWithKey       (Element const&);
  88.  
  89.    IBoolean       replaceElementWithKey       (Element const&,
  90.                                                ICursor&);
  91.  
  92.    IBoolean       locateOrAddElementWithKey   (Element const&);
  93.  
  94.    IBoolean       locateOrAddElementWithKey   (Element const&,
  95.                                                ICursor&);
  96.  
  97.    IBoolean       addOrReplaceElementWithKey  (Element const&);
  98.  
  99.    IBoolean       addOrReplaceElementWithKey  (Element const&,
  100.                                                ICursor&);
  101.  
  102.    IBoolean       removeElementWithKey        (Key const&);
  103.  
  104.    Element const& elementWithKey              (Key const&) const;
  105.  
  106.    Element&       elementWithKey              (Key const&);
  107.  
  108.    INumber        numberOfElementsWithKey     (Key const&) const;
  109.  
  110.    IBoolean       locateNextElementWithKey    (Key const&,
  111.                                                ICursor&) const;
  112.  
  113.    INumber        removeAllElementsWithKey    (Key const&);
  114.  
  115.    INumber        numberOfDifferentKeys       () const;
  116.  
  117.    IBoolean       setToNextWithDifferentKey   (ICursor&) const;
  118.  
  119. protected:
  120.   void* identity () const;
  121. };
  122.  
  123. #ifdef __IBMCPP__
  124. #ifndef __TEMPINC__
  125. #include <irkeybag.c>
  126. #endif
  127. #endif
  128.  
  129. #endif
  130.