home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iacllct.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  4.3 KB  |  163 lines

  1. /**********************************************************************
  2. *                                                                     *
  3. *  IBM(R) VisualAge(TM) for C++ for Windows(R), Version 3.5           *
  4. *                                                                     *
  5. *  PID: 5622-880                                                      *
  6. *  - Licensed Material - Program-Property of IBM                      *
  7. *  (C) Copyright IBM Corp. 1991, 1995 - All Right Reserved.           *
  8. *                                                                     *
  9. *  US Government Users Restricted Rights - Use, duplication or        *
  10. *  disclosure restricted by GSA ADP Schedule Contract with IBM Corp.  *
  11. *                                                                     *
  12. *  VisualAge, and IBM are trademarks or registered trademarks of      *
  13. *  International Business Machines Corporation.                       *
  14. *  Windows is a registered trademark of Microsoft Corporation.        *
  15. *                                                                     *
  16. **********************************************************************/
  17.  
  18. #ifndef _IACLLCT_H
  19. #define _IACLLCT_H
  20.  
  21. #include <ibcllct.h>
  22.  
  23. #pragma info (nocls, nocnd, nocns, nocnv, noext, nognr, novft)
  24. #pragma pack (4)
  25.  
  26. #pragma SOMAsDefault (off)
  27.  
  28. template <class Element>
  29. class IElementCursor : public ICursor {
  30.  
  31.   typedef  ICursorImpl Implementation;
  32.  
  33. public:
  34.  
  35.   Element const&
  36.            element          () const;
  37.  
  38. protected:
  39.  
  40.            IElementCursor   (Implementation*);
  41.  
  42.  
  43. };
  44.  
  45. template <class Element>
  46. class IACollection : protected IACollectionBase {
  47.  
  48.   typedef  IACollectionImpl Implementation;
  49.  
  50. public:
  51.  
  52.            IACollection     (INotifier&);
  53.  
  54.   virtual ~IACollection     ();
  55.  
  56.   IBoolean add              (Element const&);
  57.  
  58.   IBoolean add              (Element const&, ICursor&);
  59.  
  60.   void     addAllFrom       (IACollection <Element> const&);
  61.  
  62.   IBoolean allElementsDo    (IBoolean (*applicatorFunction)
  63.                               (Element&, void*),
  64.                              void* additionalArgument = 0);
  65.  
  66.   IBoolean allElementsDo    (IBoolean (*applicatorFunction)
  67.                               (Element const&, void*),
  68.                              void* additionalArgument = 0) const;
  69.  
  70.   IBoolean allElementsDo    (IApplicator <Element>&);
  71.  
  72.   IBoolean allElementsDo    (IConstantApplicator <Element>&) const;
  73.  
  74.   Element const&
  75.            any              () const;
  76.  
  77.   void     copy             (IACollection <Element> const&);
  78.  
  79.   INotifier&
  80.            disableNotification
  81.                             ();
  82.  
  83.   Element& elementAt        (ICursor const&);
  84.  
  85.   Element const&
  86.            elementAt        (ICursor const&) const;
  87.  
  88.   INotifier&
  89.            enableNotification
  90.                             (IBoolean = true);
  91.  
  92.   IBoolean isBounded        () const;
  93.  
  94.   IBoolean isConsistent     () const;
  95.  
  96.   IBoolean isEmpty          () const;
  97.  
  98.   IBoolean isEnabledForNotification
  99.                             () const;
  100.  
  101.   IBoolean isFull           () const;
  102.  
  103.   INumber  maxNumberOfElements
  104.                             () const;
  105.  
  106.   ICursor* newCursor        () const;
  107.  
  108.   INotifier&
  109.            notifier         ();
  110.  
  111.   INotifier const&
  112.            notifier         () const;
  113.  
  114.   INotifier&
  115.            notifyObservers  (INotificationEvent const&);
  116.  
  117.   INumber  numberOfElements () const;
  118.  
  119.   INumber  removeAll        ();
  120.  
  121.   INumber  removeAll        (IBoolean (*predicateFunction)
  122.                               (Element const&, void*),
  123.                              void* additionalArgument = 0);
  124.  
  125.   void     removeAt         (ICursor&);
  126.  
  127.   void     replaceAt        (ICursor const&, Element const&);
  128.  
  129.   IBoolean setToFirst       (ICursor&) const;
  130.  
  131.   IBoolean setToNext        (ICursor&) const;
  132.  
  133.            operator INotifier&
  134.                             () const;
  135.  
  136.   // for backward compatibility
  137.   Element const&
  138.            anyElement       () const;
  139.  
  140. protected:
  141.  
  142.            IACollection     ();
  143.  
  144.            IACollection     (IACollection <Element> const&);
  145.  
  146.   static
  147.   Implementation&
  148.            ImplOf           (IACollection <Element> const&);
  149.  
  150. private:
  151.  
  152.  
  153. };
  154.  
  155. #pragma SOMAsDefault (pop)
  156.  
  157. #include <iacllct.inl>
  158.  
  159. #pragma info (restore)
  160. #pragma pack ()
  161.  
  162. #endif
  163.