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

  1. /*------------------------------------------------------------------------*/
  2. /*                                                                        */
  3. /*  BDICT.CPP                                                             */
  4. /*                                                                        */
  5. /*  Copyright Borland International 1991, 1993                            */
  6. /*  All Rights Reserved                                                   */
  7. /*                                                                        */
  8. /*------------------------------------------------------------------------*/
  9.  
  10. #if !defined( TEMPLATES )
  11. #define TEMPLATES
  12. #endif
  13.  
  14. #if !defined( __IOSTREAM_H )
  15. #include <iostream.h>
  16. #endif  // __IOSTREAM_H
  17.  
  18. #if !defined( __ASSOC_H )
  19. #include "classlib\obsolete\assoc.h"
  20. #endif  // __ASSOC_H
  21.  
  22. #if !defined( __DICT_H )
  23. #include "classlib\obsolete\dict.h"
  24. #endif  // __DICT_H
  25.  
  26. #if !defined( __CLSTYPES_H )
  27. #include "classlib\obsolete\clstypes.h"
  28. #endif  // __CLSTYPES_H
  29.  
  30. void Dictionary::add( Object& objectToAdd )
  31. {
  32.     if( !objectToAdd.isAssociation() )
  33.         ClassLib_error( __ENOTASSOC );
  34.     else
  35.         Set::add( objectToAdd );
  36. }
  37.  
  38. Association& Dictionary::lookup( const Object& toLookUp ) const
  39. {
  40.     Association toFind( (Object&)toLookUp, NOOBJECT );
  41.     toFind.ownsElements(0);
  42.  
  43.     Association& found = (Association&)findMember( toFind );
  44.     return found;
  45. }
  46.  
  47.