home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IEVTDATA.INL < prev    next >
Text File  |  1993-10-22  |  4KB  |  118 lines

  1. #ifndef _IEVTDATA_INL_
  2. #define _IEVTDATA_INL_ 0
  3. /*******************************************************************************
  4. * FILE NAME: ievtdata.inl                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the definition of the inline functions for the          *
  8. *   class(es) declared in ievtdata.hpp                                         *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   Licensed Materials - Property of IBM                                       *
  12. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  13. *   All Rights Reserved                                                        *
  14. *   US Government Users Restricted Rights - Use, duplication, or               *
  15. *   disclosure                                                                 *
  16. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  17. *                                                                              *
  18. *******************************************************************************/
  19. #ifndef _IEVTDATA_
  20.   #undef  _IEVTDATA_INL_
  21.   #define _IEVTDATA_INL_ 1
  22.   #include <ievtdata.hpp>
  23. #endif
  24.  
  25. #if _IEVTDATA_INL_
  26.   #define inline
  27. #endif
  28.  
  29. /*-------------------------------- IEventData --------------------------------*/
  30. inline IEventData :: IEventData ( )
  31.   : pvClMsg ( 0 )
  32.   { }
  33. inline IEventData :: IEventData ( void* value )
  34.   {
  35.   pvClMsg = value;
  36.   }
  37. inline IEventData :: IEventData ( unsigned long value )
  38.   {
  39.   pvClMsg = (void*)value;
  40.   }
  41. inline IEventData :: IEventData ( int value )
  42.   {
  43.   pvClMsg = (void*)((unsigned long)value);
  44.   }
  45. inline IEventData :: IEventData ( unsigned short lowValue,
  46.                                   unsigned short hiValue )
  47.   {
  48.   pvClMsg = (void*)(lowValue | (unsigned long)hiValue << 16);
  49.   }
  50. inline IEventData :: IEventData ( unsigned short lowValue,
  51.                                   char lowByte, char hiByte )
  52.   {
  53.   unsigned short hiValue = (unsigned short)(lowByte | (unsigned short)hiByte <<
  54.   8); pvClMsg = (void*)(lowValue | (unsigned long)hiValue << 16);
  55.   }
  56. inline char  IEventData :: lowLowByte ( ) const
  57.   {
  58.   return (char)(unsigned long)pvClMsg;
  59.   }
  60. inline char  IEventData :: lowHighByte ( ) const
  61.   {
  62.   return (char)((unsigned long)pvClMsg >> 8);
  63.   }
  64. inline char  IEventData :: highLowByte ( ) const
  65.   {
  66.   return (char)((unsigned long)pvClMsg >> 16);
  67.   }
  68. inline char  IEventData :: highHighByte ( ) const
  69.   {
  70.   return (char)((unsigned long)pvClMsg >> 24);
  71.   }
  72. inline char  IEventData :: char1 ( ) const
  73.   {
  74.   return lowLowByte();
  75.   }
  76. inline char  IEventData :: char2 ( ) const
  77.   {
  78.   return lowHighByte();
  79.   }
  80. inline char  IEventData :: char3 ( ) const
  81.   {
  82.   return highLowByte();
  83.   }
  84. inline char  IEventData :: char4 ( ) const
  85.   {
  86.   return highHighByte();
  87.   }
  88. inline unsigned short  IEventData :: lowNumber ( ) const
  89.   {
  90.   return (unsigned short)(unsigned long)pvClMsg;
  91.   }
  92. inline unsigned short  IEventData :: highNumber ( ) const
  93.   {
  94.   return (unsigned short)((unsigned long)pvClMsg >> 16);
  95.   }
  96. inline unsigned short  IEventData :: number1 ( ) const
  97.   {
  98.   return lowNumber();
  99.   }
  100. inline unsigned short  IEventData :: number2 ( ) const
  101.   {
  102.   return highNumber();
  103.   }
  104. inline unsigned long  IEventData :: asUnsignedLong ( ) const
  105.   {
  106.   return (unsigned long)pvClMsg;
  107.   }
  108. inline IEventData :: operator char* ( ) const
  109.   {
  110.   return (char*)pvClMsg;
  111.   }
  112. inline IEventData :: operator unsigned long ( ) const
  113.   {
  114.   return (unsigned long)pvClMsg;
  115.   }
  116.  
  117. #endif // _IEVTDATA_INL_
  118.