home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IACLLCT.H < prev    next >
Text File  |  1993-09-22  |  4KB  |  97 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 _IACLLCT_H
  13. #define _IACLLCT_H
  14.  
  15. #include <iglobals.h>
  16. #include <icursor.h>
  17.  
  18. template < class Element >
  19. class IACollection {
  20. public:
  21.  
  22.   virtual                ~IACollection             ();
  23.  
  24.   virtual IBoolean       add                         (Element const&) = 0;
  25.  
  26.   virtual IBoolean       add                         (Element const&,
  27.                                                ICursor&) = 0;
  28.  
  29.   virtual void           addAllFrom                  (IACollection <Element> const&);
  30.  
  31.   virtual void           copy                        (IACollection
  32.                                                   <Element> const&);
  33.  
  34.   virtual Element const& elementAt                   (ICursor const&) const = 0;
  35.  
  36.   virtual Element&       elementAt                   (ICursor const&) = 0;
  37.  
  38.   virtual Element const& anyElement                  () const = 0;
  39.  
  40.   virtual void           removeAt                    (ICursor const&) = 0;
  41.  
  42.   virtual INumber        removeAll                   (IBoolean (*property)
  43.                                                (Element const&, void*),
  44.                                                void* additionalArgument = 0) = 0;
  45.  
  46.   virtual void           replaceAt                   (ICursor const&,
  47.                                                Element const&) = 0;
  48.  
  49.   virtual void           removeAll                   () = 0;
  50.  
  51.   virtual IBoolean       isBounded                   () const = 0;
  52.  
  53.   virtual INumber        maxNumberOfElements         () const = 0;
  54.  
  55.   virtual INumber        numberOfElements            () const = 0;
  56.  
  57.   virtual IBoolean       isEmpty                     () const = 0;
  58.  
  59.   virtual IBoolean       isFull                      () const = 0;
  60.  
  61.   virtual ICursor*       newCursor                   () const = 0;
  62.  
  63.   virtual IBoolean       setToFirst                  (ICursor&) const = 0;
  64.  
  65.   virtual IBoolean       setToNext                   (ICursor&) const = 0;
  66.  
  67.   virtual IBoolean       allElementsDo               (IBoolean (*function)
  68.                                                   (Element&, void*),
  69.                                                void* additionalArgument = 0) = 0;
  70.  
  71.   virtual IBoolean       allElementsDo               (IIterator <Element>&) = 0;
  72.  
  73.   virtual IBoolean       allElementsDo               (IBoolean (*function)
  74.                                                (Element const&, void*),
  75.                                                void* additionalArgument = 0)
  76.                                                const = 0;
  77.  
  78.   virtual IBoolean       allElementsDo               (IConstantIterator
  79.                                                   <Element>&) const = 0;
  80.  
  81.   virtual IBoolean       isConsistent                () const = 0;
  82.  
  83. protected:
  84.   virtual void*   identity () const;
  85.           Boolean isIdentical (IACollection < Element > const& collection) const
  86.           { return identity () == collection.identity ();
  87.           }
  88. };
  89.  
  90. #ifdef __IBMCPP__
  91. #ifndef __TEMPINC__
  92. #include <iacllct.c>
  93. #endif
  94. #endif
  95.  
  96. #endif
  97.