home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / IOC / TRANSTAB / TRANSELM.H < prev    next >
Text File  |  1995-03-15  |  2KB  |  55 lines

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