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

  1. /*------------------------------------------------------------------------*/
  2. /*                                                                        */
  3. /*  ASSOC.CPP                                                             */
  4. /*                                                                        */
  5. /*  Copyright Borland International 1991                                  */
  6. /*  All Rights Reserved                                                   */
  7. /*                                                                        */
  8. /*------------------------------------------------------------------------*/
  9.  
  10. #if !defined( CHECKS_H )
  11. #include <Checks.h>
  12. #endif  // CHECKS_H
  13.  
  14. #if !defined( __ASSOC_H )
  15. #include <Assoc.h>
  16. #endif  // __ASSOC_H
  17.  
  18. #ifndef __IOSTREAM_H
  19. #include <iostream.h>
  20. #endif
  21.  
  22. Association::~Association()
  23. {
  24.     if( !ownsElements() )
  25.         return;
  26.     if( &aKey != ZERO )
  27.         delete &aKey;
  28.     if( &aValue != ZERO )
  29.         delete &aValue;
  30. }
  31.  
  32. void Association::printOn( ostream& outputStream ) const
  33. {
  34.     outputStream << " " << nameOf() << " { ";
  35.     aKey.printOn( outputStream );
  36.     outputStream << ", ";
  37.     aValue.printOn( outputStream );
  38.     outputStream << " }\n";
  39. }
  40.  
  41. int Association::isEqual( const Object& toObject ) const
  42. {
  43.     return aKey == ( (Association&)toObject ).key();
  44. }
  45.  
  46.