home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iaorder.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  3.3 KB  |  127 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 _IAORDER_H
  19. #define _IAORDER_H
  20.  
  21. #include <iacllct.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 IOrderedCursor : public IElementCursor <Element> {
  30.  
  31.   typedef  ICursorImpl Implementation;
  32.  
  33. public:
  34.  
  35.   IBoolean setToLast        ();
  36.  
  37.   IBoolean setToPrevious    ();
  38.  
  39. protected:
  40.  
  41.            IOrderedCursor   (Implementation*);
  42.  
  43.  
  44. };
  45.  
  46. template <class Element>
  47. class IAOrderedCollection : public virtual IACollection <Element> {
  48.  
  49.   typedef  IACollectionImpl Implementation;
  50.  
  51. public:
  52.  
  53.            IAOrderedCollection
  54.                             (INotifier&);
  55.  
  56.           ~IAOrderedCollection
  57.                             ();
  58.  
  59.   Element const&
  60.            elementAtPosition
  61.                             (IPosition) const;
  62.  
  63.   Element const&
  64.            first            () const;
  65.  
  66.   IBoolean isFirstAt        (ICursor const&) const;
  67.  
  68.   IBoolean isLastAt         (ICursor const&) const;
  69.  
  70.   Element const&
  71.            last             () const;
  72.  
  73.   IPosition
  74.            positionAt       (ICursor const&) const;
  75.  
  76.   void     removeAtPosition (IPosition);
  77.  
  78.   void     removeFirst      ();
  79.  
  80.   void     removeLast       ();
  81.  
  82.   IBoolean setToLast        (ICursor&) const;
  83.  
  84.   void     setToPosition    (IPosition, ICursor&) const;
  85.  
  86.   IBoolean setToPrevious    (ICursor&) const;
  87.  
  88.   // for backward compatibility
  89.   Element const&
  90.            firstElement     () const;
  91.  
  92.   IBoolean isFirst          (ICursor const&) const;
  93.  
  94.   IBoolean isLast           (ICursor const&) const;
  95.  
  96.   Element const&
  97.            lastElement      () const;
  98.  
  99.   IPosition
  100.            position         (ICursor const&) const;
  101.  
  102. protected:
  103.  
  104.            IAOrderedCollection
  105.                             ();
  106.  
  107.            IAOrderedCollection
  108.                             (IAOrderedCollection <Element> const&);
  109.  
  110. private:
  111.  
  112.   static
  113.   Implementation&
  114.            ImplOf           (IAOrderedCollection <Element> const&);
  115.  
  116.  
  117. };
  118.  
  119. #pragma SOMAsDefault (pop)
  120.  
  121. #include <iaorder.inl>
  122.  
  123. #pragma info (restore)
  124. #pragma pack ()
  125.  
  126. #endif
  127.