home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / TCPP30-1.ZIP / CLASSINC.ZIP / ASSOC.H < prev    next >
C/C++ Source or Header  |  1992-02-18  |  2KB  |  88 lines

  1. /*------------------------------------------------------------------------*/
  2. /*                                                                        */
  3. /*  ASSOC.H                                                               */
  4. /*                                                                        */
  5. /*  Copyright Borland International 1991                                  */
  6. /*  All Rights Reserved                                                   */
  7. /*                                                                        */
  8. /*------------------------------------------------------------------------*/
  9.  
  10. #if !defined( __ASSOC_H )
  11. #define __ASSOC_H
  12.  
  13. #if !defined( __CLSTYPES_H )
  14. #include <ClsTypes.h>
  15. #endif  // __CLSTYPES_H
  16.  
  17. #if !defined( __OBJECT_H )
  18. #include <Object.h>
  19. #endif  // __OBJECT_H
  20.  
  21. #if !defined( __SHDDEL_H )
  22. #include <ShdDel.h>
  23. #endif  // __SHDDEL_H
  24.  
  25. _CLASSDEF(ostream)
  26. _CLASSDEF(Association)
  27.  
  28. class _CLASSTYPE Association : public Object, public virtual TShouldDelete
  29. {
  30.  
  31. public:
  32.  
  33.     Association( Object _FAR & k, Object _FAR & v ) :
  34.         aKey( k ),
  35.         aValue( v )
  36.         {
  37.         }
  38.  
  39.     Association( const Association _FAR & a ) :
  40.         aKey(a.aKey),
  41.         aValue(a.aValue)
  42.         {
  43.         }
  44.  
  45.     virtual ~Association();
  46.  
  47.     Object _FAR & key() const
  48.         {
  49.         return aKey;
  50.         }
  51.  
  52.     Object _FAR & value() const
  53.         {
  54.         return aValue;
  55.         }
  56.  
  57.     virtual classType isA() const
  58.         {
  59.         return associationClass;
  60.         }
  61.  
  62.     virtual char _FAR *nameOf() const
  63.         {
  64.         return "Association";
  65.         }
  66.  
  67.     virtual hashValueType hashValue() const
  68.         {
  69.         return aKey.hashValue();
  70.         }
  71.  
  72.     virtual int isEqual( const Object _FAR & ) const;
  73.     virtual int isAssociation() const
  74.         {
  75.         return 1;
  76.         }
  77.  
  78.     virtual void printOn( ostream _FAR & ) const;
  79.  
  80. private:
  81.  
  82.     Object _FAR & aKey;
  83.     Object _FAR & aValue;
  84.  
  85. };
  86.  
  87. #endif
  88.