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 / DICT.CPP < prev    next >
C/C++ Source or Header  |  1992-02-18  |  1KB  |  43 lines

  1. /*------------------------------------------------------------------------*/
  2. /*                                                                        */
  3. /*  DICT.CPP                                                              */
  4. /*                                                                        */
  5. /*  Copyright Borland International 1991                                  */
  6. /*  All Rights Reserved                                                   */
  7. /*                                                                        */
  8. /*------------------------------------------------------------------------*/
  9.  
  10. #if !defined( __ASSOC_H )
  11. #include <Assoc.h>
  12. #endif  // __ASSOC_H
  13.  
  14. #if !defined( __DICT_H )
  15. #include <Dict.h>
  16. #endif  // __DICT_H
  17.  
  18. #if !defined( __IOSTREAM_H )
  19. #include <iostream.h>
  20. #endif  // __IOSTREAM_H
  21.  
  22. #if !defined( __CLSTYPES_H )
  23. #include <ClsTypes.h>
  24. #endif  // __CLSTYPES_H
  25.  
  26. void Dictionary::add( Object& objectToAdd )
  27. {
  28.     if( !objectToAdd.isAssociation() )
  29.         ClassLib_error( __ENOTASSOC );
  30.     else
  31.         Set::add( objectToAdd );
  32. }
  33.  
  34. Association& Dictionary::lookup( const Object& 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.