3 //=============================================================================
7 * @author Nanbor Wang <nanbor@cs.wustl.edu>
9 //=============================================================================
11 #ifndef _ACEXML_EXCEPTION_H_
12 #define _ACEXML_EXCEPTION_H_
14 #include /**/ "ace/pre.h"
15 #include "ACEXML/common/ACEXML_Export.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "ACEXML/common/XML_Types.h"
24 * @class ACEXML_Exception
26 * @brief ACEXML_Exception
28 * ACEXML_Exception is the base class for all ACEXML related exceptions.
29 * Since ACEXML currently does not support native exceptions, all
30 * exceptions should be thrown thru ACEXML_Env.
34 class ACEXML_Export ACEXML_Exception
38 virtual ~ACEXML_Exception ();
40 /// Throw the exception.
41 virtual void _raise () = 0;
43 /// Static narrow operation.
44 static ACEXML_Exception
* _downcast (ACEXML_Exception
* ex
);
46 /// Return the exception type. (for safe downcast.)
47 virtual const ACEXML_Char
*id () const ;
49 /// Dynamically create a copy of this exception.
50 virtual ACEXML_Exception
*duplicate () const = 0;
52 /// Check whether this is an exception of type specified by <name>.
53 virtual int is_a (const ACEXML_Char
*name
);
55 /// Print out exception using ACE_DEBUG.
56 virtual void print () const = 0;
59 /// Default constructor.
62 /// All exceptions have names. This name is used to identify the
63 /// type of an exception.
64 static const ACEXML_Char
*exception_name_
;
66 /// A null string that we return when there is no exception.
67 static const ACEXML_Char
*null_
;
70 #if defined (__ACEXML_INLINE__)
71 # include "ACEXML/common/Exception.inl"
72 #endif /* __ACEXML_INLINE__ */
74 #include /**/ "ace/post.h"
76 #endif /* _ACEXML_EXCEPTION_H_ */