home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / ioc / transtab / transelm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  2.4 KB  |  64 lines

  1. /**********************************************************************
  2. *                                                                     *
  3. *  IBM(R) VisualAge(TM) for C++ for Windows(R), Version 3.5           *
  4. *                                                                     *
  5. *  PID: 5622-880                                                      *
  6. *  - Licensed Material - Program-Property of IBM                      *
  7. *  (C) Copyright IBM Corp. 1991, 1995 - All Right Reserved.           *
  8. *                                                                     *
  9. *  US Government Users Restricted Rights - Use, duplication or        *
  10. *  disclosure restricted by GSA ADP Schedule Contract with IBM Corp.  *
  11. *                                                                     *
  12. *  VisualAge, and IBM are trademarks or registered trademarks of      *
  13. *  International Business Machines Corporation.                       *
  14. *  Windows is a registered trademark of Microsoft Corporation.        *
  15. *                                                                     *
  16. **********************************************************************/
  17.  
  18. /*-------------------------------------------------------------*\
  19. |  transelm.h  -  Class TranslationElement  for use with the    |
  20. |                 Translation Table example.                    |
  21. \*-------------------------------------------------------------*/
  22. #ifndef _TRANSELM_H
  23. #define _TRANSELM_H
  24.  
  25. #include <iglobals.h>
  26.  
  27. class TranslationElement  {
  28.  
  29.   char ivAscCode;
  30.   char ivEbcCode;
  31.  
  32. public:
  33.  
  34.   /* Let the compiler generate Default and Copy Constructor,*/
  35.   /* Destructor and Assignment for us.                      */
  36.  
  37.   char const& ascCode () const
  38.        { return ivAscCode;
  39.        }
  40.  
  41.   char const& ebcCode () const
  42.        { return ivEbcCode;
  43.        }
  44.  
  45.   TranslationElement (char asc, char ebc)
  46.        : ivAscCode(asc), ivEbcCode(ebc) {};
  47.  
  48.   /* We need to define the equality.                        */
  49.   IBoolean operator == (TranslationElement const& te) const  {
  50.      return ivAscCode == te.ivAscCode
  51.         &&  ivEbcCode == te.ivEbcCode;
  52.    };
  53.  
  54.   /* An ordering relation must not be defined for           */
  55.   /* elements in a map.                                     */
  56.  
  57.   /* We need to define the key access for the elements.     */
  58.   /* We decided to define all key operations in a           */
  59.   /* separate operations class in file trmapops.h.          */
  60.  
  61. };
  62.  
  63. #endif
  64.