home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / ibitflag.inl < prev    next >
Encoding:
Text File  |  1996-02-22  |  2.5 KB  |  65 lines

  1. #ifndef _IBITFLAG_INL_
  2. #define _IBITFLAG_INL_ 0
  3. /*******************************************************************************
  4. * FILE NAME: ibitflag.inl                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the definition of the inline functions for the          *
  8. *   classes declared in ibitflag.hpp.                                          *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *******************************************************************************/
  18. #ifndef _IBITFLAG_
  19.   #undef  _IBITFLAG_INL_
  20.   #define _IBITFLAG_INL_ 1
  21.   #include <ibitflag.hpp>
  22. #endif
  23.  
  24. #if _IBITFLAG_INL_
  25.   #define inline
  26. #endif
  27.  
  28. inline IBitFlag :: IBitFlag ( unsigned long value,
  29.                               unsigned long extValue )
  30.        : ulClValue( value ),
  31.          ulClExtValue( extValue )
  32. {}
  33.  
  34. inline unsigned long  IBitFlag :: asUnsignedLong ( ) const
  35. {
  36.   return( this->ulClValue );
  37. }
  38.  
  39. inline unsigned long  IBitFlag :: asExtendedUnsignedLong ( ) const
  40. {
  41.   return( this->ulClExtValue );
  42. }
  43.  
  44. inline IBitFlag  &IBitFlag :: setValue ( unsigned long value,
  45.                                          unsigned long extValue )
  46. {
  47.   this->ulClValue = value;
  48.   this->ulClExtValue = extValue;
  49.   return( *this );
  50. }
  51.  
  52. inline IBase::Boolean  IBitFlag :: operator == ( const IBitFlag &rhs ) const
  53. {
  54.   return( (this->asUnsignedLong() == rhs.asUnsignedLong())  &
  55.           (this->asExtendedUnsignedLong() == rhs.asExtendedUnsignedLong()) );
  56. }
  57.  
  58. inline IBase::Boolean  IBitFlag :: operator != ( const IBitFlag &rhs ) const
  59. {
  60.   return( (this->asUnsignedLong() != rhs.asUnsignedLong())  |
  61.           (this->asExtendedUnsignedLong() != rhs.asExtendedUnsignedLong()) );
  62. }
  63.  
  64. #endif /* _IBITFLAG_INL_ */
  65.