home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / oclsrc15.zip / OCL / Include / OXcptBase.hpp < prev    next >
C/C++ Source or Header  |  1996-08-12  |  3KB  |  106 lines

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // OXcptBase.hpp
  5.  
  6. /*
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  * 1. Redistributions of source code must retain the above copyright
  11.  *    notice, this list of conditions and the following disclaimer.
  12.  * 2. Neither the name Cubus nor the name Team OCL may be used to
  13.  *    endorse or promote products derived from this software
  14.  *    without specific prior written permission.
  15.  * 3. See OCL.INF for a detailed copyright notice.
  16.  *
  17.  *              THIS SOFTWARE IS PROVIDED ``AS IS'' AND
  18.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  21.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27.  * SUCH DAMAGE.
  28.  */
  29.  
  30. // $Header: W:/Projects/OCL/Include/rcs/OXcptBase.hpp 1.50 1996/08/11 23:47:36 B.STEIN Release $
  31.  
  32. #ifndef OXCPTBASE_INCLUDED
  33.   #define OXCPTBASE_INCLUDED
  34.  
  35. #ifndef OSTRING_INCLUDED
  36.   #include <OString.hpp>
  37. #endif
  38.  
  39.  
  40. typedef class OXcptBase *pOXcptBase;
  41.  
  42. typedef EXCEPTIONREGISTRATIONRECORD OXCPTRECORD;
  43.  
  44.  
  45. class __CPP_EXPORT__ OXcptBase
  46.   : virtual public OCLObject
  47. {
  48.  protected:
  49.   OXCPTRECORD         *record;
  50.   BOOL                killMsg;
  51.  
  52.  public:
  53.   ULONG               times;
  54.  
  55.   OXcptBase           (BOOL killMessages); // provide detailed information about kill cases
  56.  
  57.   virtual
  58.      ~OXcptBase       ();
  59.  
  60.   virtual
  61.      PSZ isOfType     () const;
  62.  
  63.   virtual BOOL
  64.      trapTrace        () = 0,
  65.      killTrace        () = 0,
  66.      handler          (PEXCEPTIONREPORTRECORD report,
  67.                        OXCPTRECORD            *record,
  68.                        CONTEXTRECORD          *context,
  69.                        PVOID                  pargs);
  70.  
  71.   virtual void
  72.      exceptionMessage (PCSZ msg) = 0;
  73.  
  74.   BOOL
  75.      setHandler       (OXCPTRECORD& regRecord),
  76.      unsetHandler     ();
  77.  
  78.  
  79. // for internal use, do not change
  80.  
  81.   static ULONG
  82.      OXCPT_CATCH      (EXCEPTIONREPORTRECORD *report,
  83.                        OXCPTRECORD *record,
  84.                        CONTEXTRECORD *context,
  85.                        PVOID pargs);
  86.  
  87.   static
  88.      OXcptBase        *currentHandler;
  89. };
  90.  
  91.  
  92. extern "C"
  93. {
  94.  PSZ  __CPP_EXPORT__ 
  95.     except_printf        (const char *format, ...); 
  96.  void __CPP_EXPORT__
  97.     except_print_context (OString& msg, PCONTEXTRECORD cont); 
  98. }
  99.  
  100. #define XCPT_CPP_EXCEPTION 0x00020000
  101.  
  102.  
  103. #endif // OXCPTBASE_INCLUDED
  104.  
  105. // end of source
  106.