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

  1. /*------------------------------------------------------------------------*/
  2. /*                                                                        */
  3. /*  BDICT.CPP                                                             */
  4. /*                                                                        */
  5. /*  Copyright Borland International 1991                                  */
  6. /*  All Rights Reserved                                                   */
  7. /*                                                                        */
  8. /*------------------------------------------------------------------------*/
  9.  
  10. #if !defined( TEMPLATES )
  11. #define TEMPLATES
  12. #endif
  13.  
  14. #if !defined( __ASSOC_H )
  15. #include <Assoc.h>
  16. #endif  // __ASSOC_H
  17.  
  18. #if !defined( __DICT_H )
  19. #include <Dict.h>
  20. #endif  // __DICT_H
  21.  
  22. #if !defined( __IOSTREAM_H )
  23. #include <iostream.h>
  24. #endif  // __IOSTREAM_H
  25.  
  26. #if !defined( __CLSTYPES_H )
  27. #include <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.