home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / clobss.pak / DICT.CPO < prev    next >
Text File  |  1997-07-23  |  1KB  |  43 lines

  1. /*------------------------------------------------------------------------*/
  2. /*                                                                        */
  3. /*  DICT.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( __ASSOC_H )
  15. #include "classlib\obsolete\assoc.h"
  16. #endif  // __ASSOC_H
  17.  
  18. #if !defined( __DICT_H )
  19. #include "classlib\obsolete\dict.h"
  20. #endif  // __DICT_H
  21.  
  22. #if !defined( __CLSTYPES_H )
  23. #include "classlib\obsolete\clstypes.h"
  24. #endif  // __CLSTYPES_H
  25.  
  26. void Dictionary::add( Object _FAR & objectToAdd )
  27. {
  28.     if( !objectToAdd.isAssociation() )
  29.         ClassLib_error( __ENOTASSOC );
  30.     else
  31.         Set::add( objectToAdd );
  32. }
  33.  
  34. Association _FAR & Dictionary::lookup( const Object _FAR & toLookUp ) const
  35. {
  36.     Association toFind( (Object&)toLookUp, NOOBJECT );
  37.     toFind.ownsElements(0);
  38.  
  39.     Association& found = (Association&)findMember( toFind );
  40.     return found;
  41. }
  42.  
  43.