home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / CLOBSS.PAK / ASSOC.CPO < prev    next >
Text File  |  1995-08-29  |  1KB  |  46 lines

  1. /*------------------------------------------------------------------------*/
  2. /*                                                                        */
  3. /*  ASSOC.CPP                                                             */
  4. /*                                                                        */
  5. /*  Copyright Borland International 1991, 1993                            */
  6. /*  All Rights Reserved                                                   */
  7. /*                                                                        */
  8. /*------------------------------------------------------------------------*/
  9.  
  10. #if !defined( __IOSTREAM_H )
  11. #include <iostream.h>
  12. #endif    // __IOSTREAM_H
  13.  
  14. #if !defined( CHECKS_H )
  15. #include <checks.h>
  16. #endif  // CHECKS_H
  17.  
  18. #if !defined( __ASSOC_H )
  19. #include "classlib\obsolete\assoc.h"
  20. #endif  // __ASSOC_H
  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.