Cleanup ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE, all platforms support it so far as I can...
[ACE_TAO.git] / ACE / ACEXML / common / Exception.h
blob6942e4c4eb531d7cbf045f1e7bc55cd912856cd0
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Exception.h
7 * @author Nanbor Wang <nanbor@cs.wustl.edu>
8 */
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)
18 #pragma once
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "ACEXML/common/XML_Types.h"
23 /**
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.
32 * @sa ACEXML_Env
34 class ACEXML_Export ACEXML_Exception
36 public:
37 /// Destructor.
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;
58 protected:
59 /// Default constructor.
60 ACEXML_Exception ();
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_ */