00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef TAO_EXCEPTION_H
00016 #define TAO_EXCEPTION_H
00017
00018 #include "ace/pre.h"
00019
00020
00021
00022 #include "tao/orbconf.h"
00023
00024 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 # pragma once
00026 #endif
00027
00028 #include "tao/TAO_Export.h"
00029 #include "tao/Basic_Types.h"
00030 #include "tao/CORBA_String.h"
00031 #include "ace/SStringfwd.h"
00032 #include "ace/iosfwd.h"
00033 #include "ace/CORBA_macros.h"
00034
00035
00036 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00037 class ACE_Allocator;
00038 ACE_END_VERSIONED_NAMESPACE_DECL
00039
00040 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00041
00042 class TAO_OutputCDR;
00043 class TAO_InputCDR;
00044
00045
00046
00047
00048 #if defined (minor)
00049 #undef minor
00050 #endif
00051
00052 namespace CORBA
00053 {
00054 class TypeCode;
00055 typedef TypeCode * TypeCode_ptr;
00056
00057 class Environment;
00058
00059 class Any;
00060 typedef Any * Any_ptr;
00061
00062 class SystemException;
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 enum exception_type
00074 {
00075 NO_EXCEPTION,
00076 USER_EXCEPTION,
00077 SYSTEM_EXCEPTION
00078 };
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 class TAO_Export Exception
00100 {
00101 public:
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 Exception (const Exception &src);
00113
00114
00115 virtual ~Exception (void);
00116
00117
00118 virtual void _raise (void) const = 0;
00119
00120
00121 static Exception * _downcast (Exception * x);
00122 static Exception const * _downcast (Exception const * x);
00123
00124
00125 virtual const char * _rep_id (void) const;
00126
00127
00128 virtual const char * _name (void) const;
00129
00130
00131
00132
00133 virtual CORBA::TypeCode_ptr _tao_type (void) const = 0;
00134
00135
00136
00137
00138
00139 void _tao_print_exception (const char *info, FILE *f = stdout) const;
00140
00141 #if defined (ACE_USES_WCHAR)
00142
00143
00144
00145
00146 void _tao_print_exception (const ACE_WCHAR_T *info, FILE *f = stdout) const;
00147 #endif // ACE_USES_WCHAR
00148
00149
00150
00151 virtual ACE_CString _info (void) const = 0;
00152
00153 virtual void _tao_encode (TAO_OutputCDR &cdr) const = 0;
00154
00155 virtual void _tao_decode (TAO_InputCDR &cdr) = 0;
00156
00157
00158 static void _tao_any_destructor (void *);
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183 virtual CORBA::Exception *_tao_duplicate (void) const = 0;
00184
00185 protected:
00186
00187
00188 Exception (void);
00189
00190
00191 Exception & operator = (const Exception & src);
00192
00193
00194 Exception (const char *repository_id, const char *local_name);
00195
00196 private:
00197
00198
00199 CORBA::String_var id_;
00200
00201
00202 CORBA::String_var name_;
00203
00204 };
00205
00206 #if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
00207
00208
00209 TAO_Export ACE_OSTREAM_TYPE& operator<< (ACE_OSTREAM_TYPE &os,
00210 const CORBA::Exception &e);
00211
00212 TAO_Export ACE_OSTREAM_TYPE& operator<< (ACE_OSTREAM_TYPE &os,
00213 const CORBA::Exception *e);
00214
00215 #endif
00216 }
00217
00218 namespace TAO
00219 {
00220
00221 TAO_Export CORBA::SystemException *create_system_exception (const char *id);
00222 }
00223
00224 TAO_END_VERSIONED_NAMESPACE_DECL
00225
00226 #if defined (__ACE_INLINE__)
00227 # include "tao/Exception.inl"
00228 #endif
00229
00230 #include "ace/post.h"
00231
00232 #endif