Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.3 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. Abstract:
  5. History:
  6. --*/
  7. #ifndef __CIMVALUE_H__
  8. #define __CIMVALUE_H__
  9. const ULONG CIM_INTERVAL = 99;
  10. class CCimValue
  11. {
  12. union {
  13. __int32 m_iVal;
  14. __int64 m_lVal;
  15. unsigned __int32 m_uiVal;
  16. unsigned __int64 m_ulVal;
  17. float m_fVal;
  18. double m_dbVal;
  19. long double m_ldbVal;
  20. };
  21. public:
  22. enum {
  23. e_Int,
  24. e_UnsignedInt,
  25. e_Float,
  26. e_Double,
  27. e_Long,
  28. e_UnsignedLong,
  29. e_LongDouble
  30. } m_eType;
  31. CCimValue();
  32. HRESULT GetValue( VARIANT& rvValue, ULONG lCimType );
  33. HRESULT SetValue( VARIANT& rvValue, ULONG lCimType );
  34. void CoerceToLongDouble();
  35. void CoerceToDouble();
  36. void CoerceToFloat();
  37. void CoerceToUnsignedLong();
  38. void CoerceToLong();
  39. void CoerceToUnsignedInt();
  40. void CoerceToInt();
  41. friend CCimValue operator+ ( CCimValue ValA, CCimValue ValB );
  42. friend CCimValue operator- ( CCimValue ValA, CCimValue ValB );
  43. friend CCimValue operator% ( CCimValue ValA, CCimValue ValB );
  44. friend CCimValue operator/ ( CCimValue ValA, CCimValue ValB );
  45. friend CCimValue operator* ( CCimValue ValA, CCimValue ValB );
  46. };
  47. class CX_DivideByZeroException
  48. {
  49. };
  50. class CX_InvalidFloatingPointOperationException
  51. {
  52. };
  53. #endif __CIMVALUE_H__