home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 6.ddi / MWHC.006 / P0 < prev    next >
Encoding:
Text File  |  1992-06-07  |  2.3 KB  |  71 lines

  1. #ifndef __RWCOLLASS_H__
  2. #define __RWCOLLASS_H__
  3. pragma push_align_members(64);
  4.  
  5. /*
  6.  * Declarations for RWCollectable Associations, used in dictionaries.
  7.  *
  8.  * $Header:   E:/vcs/rw/collass.h_v   1.2   18 Feb 1992 09:54:12   KEFFER  $
  9.  *
  10.  ****************************************************************************
  11.  *
  12.  * Rogue Wave 
  13.  * P.O. Box 2328
  14.  * Corvallis, OR 97339
  15.  * Voice: (503) 754-3010    FAX: (503) 757-6650
  16.  *
  17.  * Copyright (C) 1989, 1990, 1991. This software is subject to copyright 
  18.  * protection under the laws of the United States and other countries.
  19.  *
  20.  ***************************************************************************
  21.  *
  22.  * $Log:   E:/vcs/rw/collass.h_v  $
  23.  * 
  24.  *    Rev 1.2   18 Feb 1992 09:54:12   KEFFER
  25.  * 
  26.  *    Rev 1.1   28 Oct 1991 09:08:10   keffer
  27.  * Changed inclusions to <rw/xxx.h>
  28.  * 
  29.  *    Rev 1.0   28 Jul 1991 08:13:26   keffer
  30.  * Tools.h++ V4.0.5 PVCS baseline version
  31.  *
  32.  */
  33.  
  34. /*
  35.  * Binds a "key" and a "value" together.  The key and value must be RWCollectable.
  36.  */
  37.  
  38. #include "rw/collect.h"
  39.  
  40. class RWExport RWCollectableAssociation : public RWCollectable {
  41. protected:
  42.   RWCollectable*        ky;
  43.   RWCollectable*        val;
  44. public:
  45.   RWCollectableAssociation();
  46.   RWCollectableAssociation(RWCollectable* k, RWCollectable* v){ky=k; val=v;}
  47.   RWCollectableAssociation(const RWCollectableAssociation& ca){ky=ca.ky; val=ca.val;}
  48.  
  49.   RWCollectable*        key()   const {return ky;}
  50.   RWCollectable*        value() const {return val;}
  51.   RWCollectable*        value(RWCollectable*);
  52.  
  53.   /* Inherited from class RWCollectable: */
  54.   virtual unsigned        binaryStoreSize() const;
  55.   virtual int            compareTo(const RWCollectable*) const;
  56.   virtual unsigned        hash() const;
  57.   virtual ClassID        isA() const {return __RWCOLLECTABLEASSOCIATION;}
  58.   virtual RWBoolean        isEqual(const RWCollectable*) const;
  59.   virtual RWCollectable*    newSpecies() const;
  60.   virtual void            restoreGuts(RWvistream&);
  61.   virtual void            restoreGuts(RWFile&);
  62.   virtual void            saveGuts(RWvostream&) const;
  63.   virtual void            saveGuts(RWFile&) const;
  64. };
  65.  
  66. // NB: this function has *not* been exported; it is not intended to be used outside of the DLL:
  67. extern void rwDestroyAssociation(RWCollectable* key, RWCollectable* value, void*);
  68.  
  69. pragma pop_align_members();
  70. #endif /* __RWCOLLASS_H__ */
  71.