home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / SAMPLES / ICLCC / TRANSELM.H < prev    next >
C/C++ Source or Header  |  1993-05-07  |  3KB  |  52 lines

  1. /******************************************************************************/
  2. /*                                                                            */
  3. /* COPYRIGHT:                                                                 */
  4. /* ----------                                                                 */
  5. /* Copyright (C) International Business Machines Corp., 1991,1992.            */
  6. /*                                                                            */
  7. /* DISCLAIMER OF WARRANTIES:                                                  */
  8. /* -------------------------                                                  */
  9. /* The following [enclosed] code is sample code created by IBM                */
  10. /* Corporation.  This sample code is not part of any standard IBM product     */
  11. /* and is provided to you solely for the purpose of assisting you in the      */
  12. /* development of your applications.  The code is provided "AS IS",           */
  13. /* without warranty of any kind.  IBM shall not be liable for any damages     */
  14. /* arising out of your use of the sample code, even if they have been         */
  15. /* advised of the possibility of such damages.                                */
  16. /*                                                                            */
  17. /******************************************************************************/
  18. /*-------------------------------------------------------------*\
  19. |  transelm.h  -  Class TranslationElement  for use with the    |
  20. |                 Translation Table example.                    |
  21. \*-------------------------------------------------------------*/
  22.  
  23. #include <iglobals.h>
  24.  
  25.  
  26. class TranslationElement  {
  27.  
  28.    public:
  29.      char asc_code;
  30.      char ebc_code;
  31.  
  32.      /* Let the compiler generate Default and Copy Constructor,*/
  33.      /* Destructor and Assignment for us.                      */
  34.  
  35.      TranslationElement(char asc, char ebc)
  36.           : asc_code(asc), ebc_code(ebc) {};
  37.  
  38.      /* We need to define the equality.                        */
  39.      Boolean operator == (TranslationElement const& te) const  {
  40.         return asc_code == te.asc_code
  41.            &&  ebc_code == te.ebc_code;
  42.       };
  43.  
  44.      /* An ordering relation must not be defined for           */
  45.      /* elements in a map.                                     */
  46.  
  47.      /* We need to define the key access for the elements.     */
  48.      /* We decided to define all key operations in a           */
  49.      /* separate operations class in file trmapops.h.          */
  50.  
  51. };
  52.