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