home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iimapks.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  5.4 KB  |  228 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 _IIMAPKS_H
  19. #define _IIMAPKS_H
  20.  
  21. #include <iiamap.h>
  22.  
  23.  
  24. #pragma info (nocls, nocnd, nocns, nocnv, noext, nognr, novft)
  25. #pragma pack (4)
  26.  
  27. #pragma SOMAsDefault (off)
  28.  
  29. template <class Base>
  30. class IMapOnKeySetMngCursorImpl;
  31.  
  32. template <class Base>
  33. class IMapOnKeySetImpl;
  34.  
  35. template <class Base>
  36. class IMapOnKeySetMngCursorImpl : public Base::MngCursor {
  37.  
  38.   typedef  Base::MngCursor Inherited;
  39.  
  40. public:
  41.  
  42.            IMapOnKeySetMngCursorImpl
  43.                             (IMapOnKeySetImpl <Base> const&);
  44.  
  45.           ~IMapOnKeySetMngCursorImpl
  46.                             ();
  47.  
  48. protected:
  49.  
  50. private:
  51.  
  52.  
  53. };
  54.  
  55. template <class Base>
  56. class IAMapOnKeySetOps;
  57.  
  58. template <class Base>
  59. class IMapOnKeySetImpl : public IAMapImpl {
  60.  
  61.   typedef  IAMapImpl Inherited;
  62.  
  63.   typedef  IMapOnKeySetImpl <Base> Self;
  64.  
  65. public:
  66.  
  67.   typedef  IAMapOnKeySetOps <Base> Ops;
  68.  
  69.   typedef  Base::Cursor Cursor;
  70.  
  71.   typedef  IMapOnKeySetMngCursorImpl <Base> MngCursor;
  72.  
  73.            IMapOnKeySetImpl (Ops&, INumber);
  74.  
  75.            IMapOnKeySetImpl (Ops&, IMapOnKeySetImpl <Base> const&);
  76.  
  77.           ~IMapOnKeySetImpl ();
  78.  
  79.   IBoolean Add              (void const*, ICursorImpl&);
  80.  
  81.   IBoolean AddOrReplaceElementWithKey
  82.                             (void const*, ICursorImpl&);
  83.  
  84.   IBoolean AllElementsDo    (IApplFunc, void*);
  85.  
  86.   void*    Any              () const;
  87.  
  88.   IBoolean CheckCursor      (ICursorImpl const&) const;
  89.  
  90.   IBoolean CheckReplacement (ICursorImpl const&, void const*) const;
  91.  
  92.   char const*
  93.            ClassName        () const;
  94.  
  95.   IACollectionImpl*
  96.            Clone            () const;
  97.  
  98.   IBoolean Contains         (void const*) const;
  99.  
  100.   IBoolean ContainsAllKeysFrom
  101.                             (IACollectionImpl const&) const;
  102.  
  103.   IBoolean ContainsElementWithKey
  104.                             (void const*) const;
  105.  
  106.   void     Copy             (IACollectionImpl const&);
  107.  
  108.   Cursor*  CreateCursor     () const;
  109.  
  110.   MngCursor*
  111.            CreateMngCursor  () const;
  112.  
  113.   void*    ElementAt        (ICursorImpl const&) const;
  114.  
  115.   void*    ElementWithKey   (void const*) const;
  116.  
  117.   IBoolean IsBounded        () const;
  118.  
  119.   IBoolean IsConsistent     () const;
  120.  
  121.   IBoolean IsEmpty          () const;
  122.  
  123.   IBoolean IsFull           () const;
  124.  
  125.   void*    Key              (void const*) const;
  126.  
  127.   IBoolean Locate           (void const*, ICursorImpl&) const;
  128.  
  129.   IBoolean LocateElementWithKey
  130.                             (void const*, ICursorImpl&) const;
  131.  
  132.   IBoolean LocateOrAdd      (void const*, ICursorImpl&);
  133.  
  134.   IBoolean LocateOrAddElementWithKey
  135.                             (void const*, ICursorImpl&);
  136.  
  137.   INumber  NumberOfElements () const;
  138.  
  139.   IBoolean Remove           (void const*);
  140.  
  141.   INumber  RemoveAll        ();
  142.  
  143.   INumber  RemoveAll        (IPredFunc, void*);
  144.  
  145.   void     RemoveAt         (ICursorImpl&);
  146.  
  147.   IBoolean RemoveElementWithKey
  148.                             (void const*);
  149.  
  150.   void     ReplaceAt        (ICursorImpl const&, void const*);
  151.  
  152.   IBoolean ReplaceElementWithKey
  153.                             (void const*, ICursorImpl&);
  154.  
  155.   IBoolean SetToFirst       (ICursorImpl&) const;
  156.  
  157.   IBoolean SetToNext        (ICursorImpl&) const;
  158.  
  159.   void     operator=        (IMapOnKeySetImpl <Base> const&);
  160.  
  161.   IBoolean operator==       (IAMapImpl const&) const;
  162.  
  163.   TStream& operator<<=      (TStream&);
  164.  
  165.   TStream& operator>>=      (TStream&) const;
  166.  
  167. protected:
  168.  
  169.   IBoolean EqualElements    (void const*, void const*) const;
  170.  
  171. private:
  172.  
  173.   static
  174.   char const*
  175.            cvClassName;
  176.  
  177.   Base&    ivBase;
  178.  
  179.   static
  180.   Base&    BaseOf           (IMapOnKeySetImpl <Base> const&);
  181.  
  182.   static
  183.   Ops&     OpsOf            (IMapOnKeySetImpl <Base> const&);
  184.  
  185.   friend
  186.   class    IMapOnKeySetMngCursorImpl <Base>;
  187.  
  188.  
  189. };
  190.  
  191. template <class Base>
  192. class IAMapOnKeySetOps {
  193. public:
  194.  
  195.   virtual ~IAMapOnKeySetOps ();
  196.  
  197.   virtual
  198.   IACollectionImpl*
  199.            Clone            () const = 0;
  200.  
  201.   virtual
  202.   IBoolean EqualElements    (void const*, void const*) const = 0;
  203.  
  204.   virtual
  205.   TStream& operator<<=      (TStream&) = 0;
  206.  
  207.   virtual
  208.   TStream& operator>>=      (TStream&) const = 0;
  209.  
  210.   virtual  operator Base&   () = 0;
  211.  
  212. protected:
  213.  
  214. private:
  215.  
  216.  
  217. };
  218.  
  219. #pragma SOMAsDefault (pop)
  220.  
  221. #include <iimapks.inl>
  222.  
  223.  
  224. #pragma info (restore)
  225. #pragma pack ()
  226.  
  227. #endif
  228.