home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / immexcpt.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  2.9 KB  |  79 lines

  1. #ifndef _IMMEXCPT_
  2. #define _IMMEXCPT_
  3. /*******************************************************************************
  4. * FILE NAME: immexcpt.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IMMErrorInfo                                                             *
  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. #include <iexcept.hpp>
  19.  
  20. #pragma pack(4)
  21.  
  22.  
  23. class IMMErrorInfo : public IBaseErrorInfo {
  24. typedef IBaseErrorInfo
  25.   Inherited;
  26.  
  27. public:
  28. /*------------------------ Constructor ---------------------------------------*/
  29.   IMMErrorInfo  ( unsigned long errorId = 0,
  30.                   const char* functionName = 0 );
  31. virtual
  32.   ~IMMErrorInfo ( );
  33.  
  34. /*-------------------------------- Accessors ---------------------------------*/
  35. virtual operator const char* () const;
  36.  
  37. virtual const char
  38.  *text        ( ) const;
  39. virtual unsigned long
  40.   errorId     ( ) const;
  41. virtual Boolean
  42.   isAvailable ( ) const;
  43.  
  44. /*------------------------------ Throw Support -------------------------------*/
  45. static void
  46.   throwMMError  ( unsigned long             errorId,
  47.                   const char*               functionName,
  48.                   const IExceptionLocation& location,
  49.                   IBaseErrorInfo::ExceptionType name = accessError,
  50.                   IException::Severity      severity = recoverable );
  51.  
  52. private:
  53. /*--------------------------------- Private ----------------------------------*/
  54. unsigned long
  55.     ulClErrorId;
  56. Boolean
  57.     foundText;
  58. char
  59.  *pClFuncNameText;
  60.  
  61. /*--------------------------------- Hidden Functions -------------------------*/
  62.   IMMErrorInfo ( const IMMErrorInfo& errorInformation );
  63. IMMErrorInfo
  64.   &operator=   ( const IMMErrorInfo& errorInformation );
  65.  
  66. }; // IMMErrorInfo
  67.  
  68.  
  69. #define ITHROWMMERROR(errorId,func)\
  70.     IMMErrorInfo::throwMMError(errorId, func, IEXCEPTION_LOCATION())
  71.  
  72. #define ITHROWMMERROR2(errorId, func, exType, sev)\
  73.     IMMErrorInfo::throwMMError(errorId, func, IEXCEPTION_LOCATION(), exType, sev)
  74.  
  75.  
  76. #pragma pack()
  77.  
  78. #endif /* _IMMEXCPT_ */
  79.