Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Exception.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Exception.h
00006  *
00007  *  $Id: Exception.h,v 1.1.1.1 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Nanbor Wang <nanbor@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef _ACEXML_EXCEPTION_H_
00014 #define _ACEXML_EXCEPTION_H_
00015 
00016 #include "ace/pre.h"
00017 #include "ACEXML/common/ACEXML_Export.h"
00018 
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 #pragma once
00021 #endif /* ACE_LACKS_PRAGMA_ONCE */
00022 
00023 #include "ACEXML/common/XML_Types.h"
00024 #include "ACEXML/common/XML_Macros.h"
00025 
00026 #if defined (ACE_USES_NATIVE_EXCEPTIONS)
00027 # define ACEXML_RAISE(EXCEPTION) throw EXCEPTION
00028 #else
00029 # define ACEXML_RAISE(EXCEPTION)
00030 #endif
00031 
00032 
00033 /**
00034  * @class ACEXML_Exception Exception.h "ACEXML/common/Exception.h"
00035  *
00036  * @brief ACEXML_Exception
00037  *
00038  * ACEXML_Exception is the base class for all ACEXML related exceptions.
00039  * Since ACEXML currently does not support native exceptions, all
00040  * exceptions should be thrown thru ACEXML_Env.
00041  *
00042  * @sa ACEXML_Env
00043  */
00044 class ACEXML_Export ACEXML_Exception
00045 {
00046 public:
00047 
00048   /// Copy constructor.
00049   ACEXML_Exception (const ACEXML_Exception &src);
00050 
00051   /// Assignment operator.
00052   ACEXML_Exception& operator= (const ACEXML_Exception& src);
00053 
00054   /// Destructor.
00055   virtual ~ACEXML_Exception (void);
00056 
00057   /// Throw the exception.
00058   virtual void _raise (void) = 0;
00059 
00060   /// Static narrow operation.
00061   static ACEXML_Exception* _downcast (ACEXML_Exception* ex);
00062 
00063   /// Return the exception type.  (for safe downcast.)
00064   virtual const ACEXML_Char *id (void) const ;
00065 
00066   /// Dynamically create a copy of this exception.
00067   virtual ACEXML_Exception *duplicate (void) const = 0;
00068 
00069   /// Check whether this is an exception of type specified by <name>.
00070   virtual int is_a (const ACEXML_Char *name) = 0;
00071 
00072   /// Print out exception using ACE_DEBUG.
00073   virtual void print (void) = 0;
00074 
00075 protected:
00076   /// Default contructor.
00077   ACEXML_Exception (void);
00078 
00079   /// All exceptions have names.  This name is used to identify the
00080   /// type of an exception.
00081   static const ACEXML_Char *exception_name_;
00082 
00083   /// A null string that we return when there is no exception.
00084   static const ACEXML_Char *null_;
00085 };
00086 
00087 #if defined (__ACEXML_INLINE__)
00088 # include "ACEXML/common/Exception.i"
00089 #endif /* __ACEXML_INLINE__ */
00090 
00091 #include "ace/post.h"
00092 
00093 #endif /* _ACEXML_EXCEPTION_H_ */

Generated on Mon Jun 16 13:23:21 2003 for ACEXML by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002