Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / AnyTypeCode / SystemExceptionA.cpp
blob05fbcb8fc509acf8a448a3c2925591791318a122
1 // -*- C++ -*-
2 #include "tao/AnyTypeCode/SystemExceptionA.h"
3 #include "tao/AnyTypeCode/Any_SystemException.h"
4 #include "tao/AnyTypeCode/Any_Dual_Impl_T.h"
5 #include "tao/AnyTypeCode/TypeCode.h"
6 #include "tao/AnyTypeCode/TypeCode_Constants.h"
7 #include "tao/AnyTypeCode/Enum_TypeCode_Static.h"
8 #include "tao/AnyTypeCode/TypeCode_Struct_Field.h"
9 #include "tao/AnyTypeCode/Struct_TypeCode_Static.h"
10 #include "tao/AnyTypeCode/Null_RefCount_Policy.h"
12 #include "tao/CORBA_String.h"
14 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
16 #if defined (THREAD_CANCELLED)
17 #undef THREAD_CANCELLED
18 #endif /* THREAD_CANCELLED */
20 // List of standard/system exceptions ... used to create static
21 // storage for their typecodes.
23 #define STANDARD_EXCEPTION_LIST \
24 TAO_SYSTEM_EXCEPTION (UNKNOWN) \
25 TAO_SYSTEM_EXCEPTION (BAD_PARAM) \
26 TAO_SYSTEM_EXCEPTION (NO_MEMORY) \
27 TAO_SYSTEM_EXCEPTION (IMP_LIMIT) \
28 TAO_SYSTEM_EXCEPTION (COMM_FAILURE) \
29 TAO_SYSTEM_EXCEPTION (INV_OBJREF) \
30 TAO_SYSTEM_EXCEPTION (OBJECT_NOT_EXIST) \
31 TAO_SYSTEM_EXCEPTION (NO_PERMISSION) \
32 TAO_SYSTEM_EXCEPTION (INTERNAL) \
33 TAO_SYSTEM_EXCEPTION (MARSHAL) \
34 TAO_SYSTEM_EXCEPTION (INITIALIZE) \
35 TAO_SYSTEM_EXCEPTION (NO_IMPLEMENT) \
36 TAO_SYSTEM_EXCEPTION (BAD_TYPECODE) \
37 TAO_SYSTEM_EXCEPTION (BAD_OPERATION) \
38 TAO_SYSTEM_EXCEPTION (NO_RESOURCES) \
39 TAO_SYSTEM_EXCEPTION (NO_RESPONSE) \
40 TAO_SYSTEM_EXCEPTION (PERSIST_STORE) \
41 TAO_SYSTEM_EXCEPTION (BAD_INV_ORDER) \
42 TAO_SYSTEM_EXCEPTION (TRANSIENT) \
43 TAO_SYSTEM_EXCEPTION (FREE_MEM) \
44 TAO_SYSTEM_EXCEPTION (INV_IDENT) \
45 TAO_SYSTEM_EXCEPTION (INV_FLAG) \
46 TAO_SYSTEM_EXCEPTION (INTF_REPOS) \
47 TAO_SYSTEM_EXCEPTION (BAD_CONTEXT) \
48 TAO_SYSTEM_EXCEPTION (OBJ_ADAPTER) \
49 TAO_SYSTEM_EXCEPTION (DATA_CONVERSION) \
50 TAO_SYSTEM_EXCEPTION (INV_POLICY) \
51 TAO_SYSTEM_EXCEPTION (REBIND) \
52 TAO_SYSTEM_EXCEPTION (TIMEOUT) \
53 TAO_SYSTEM_EXCEPTION (TRANSACTION_UNAVAILABLE) \
54 TAO_SYSTEM_EXCEPTION (TRANSACTION_MODE) \
55 TAO_SYSTEM_EXCEPTION (TRANSACTION_REQUIRED) \
56 TAO_SYSTEM_EXCEPTION (TRANSACTION_ROLLEDBACK) \
57 TAO_SYSTEM_EXCEPTION (INVALID_TRANSACTION) \
58 TAO_SYSTEM_EXCEPTION (CODESET_INCOMPATIBLE) \
59 TAO_SYSTEM_EXCEPTION (BAD_QOS) \
60 TAO_SYSTEM_EXCEPTION (INVALID_ACTIVITY) \
61 TAO_SYSTEM_EXCEPTION (ACTIVITY_COMPLETED) \
62 TAO_SYSTEM_EXCEPTION (ACTIVITY_REQUIRED) \
63 TAO_SYSTEM_EXCEPTION (THREAD_CANCELLED)
65 namespace TAO
67 namespace TypeCode
69 char const * const enumerators_CORBA_CompletionStatus[] =
71 "COMPLETED_YES",
72 "COMPLETED_NO",
73 "COMPLETED_MAYBE"
76 Enum<char const *,
77 char const * const *,
78 TAO::Null_RefCount_Policy>
79 tc_CompletionStatus ("IDL:omg.org/CORBA/CompletionStatus:1.0",
80 "CompletionStatus",
81 enumerators_CORBA_CompletionStatus,
82 3 /* # of enumerators */);
86 namespace CORBA
88 // An internal TypeCode.
89 TypeCode_ptr const _tc_CompletionStatus =
90 &TAO::TypeCode::tc_CompletionStatus;
93 namespace TAO
95 namespace TypeCode
97 Struct_Field<char const *,
98 CORBA::TypeCode_ptr const *> const
99 fields_CORBA_SystemException[] =
101 { "minor", &CORBA::_tc_ulong },
102 { "completed", &CORBA::_tc_CompletionStatus }
105 typedef TAO::TypeCode::Struct<char const *,
106 CORBA::TypeCode_ptr const *,
107 TAO::TypeCode::Struct_Field<char const *,
108 CORBA::TypeCode_ptr const *> const *,
109 TAO::Null_RefCount_Policy> tc_SystemException;
113 #define TAO_SYSTEM_EXCEPTION(name) \
114 namespace TAO \
116 namespace TypeCode \
118 tc_SystemException tc_CORBA_ ## name ( \
119 CORBA::tk_except, \
120 "IDL:omg.org/CORBA/" #name ":1.0", \
121 #name, \
122 TAO::TypeCode::fields_CORBA_SystemException, \
123 2 /* # of fields */); \
126 CORBA::TypeCode_ptr const CORBA::_tc_ ## name = \
127 &TAO::TypeCode::tc_CORBA_ ## name;
129 STANDARD_EXCEPTION_LIST
130 #undef TAO_SYSTEM_EXCEPTION
132 #define TAO_SYSTEM_EXCEPTION(name) \
133 void \
134 CORBA::operator<<= (CORBA::Any &any, const CORBA::name &ex) \
136 TAO::Any_SystemException::insert_copy ( \
137 any, \
138 CORBA::name ::_tao_any_destructor, \
139 CORBA::_tc_ ## name, \
140 ex); \
143 STANDARD_EXCEPTION_LIST
144 #undef TAO_SYSTEM_EXCEPTION
146 #define TAO_SYSTEM_EXCEPTION(name) \
147 void \
148 CORBA::operator<<= (CORBA::Any &any, CORBA::name *ex) \
150 TAO::Any_SystemException::insert ( \
151 any, \
152 CORBA::name ::_tao_any_destructor, \
153 CORBA::_tc_ ## name, \
154 ex); \
157 STANDARD_EXCEPTION_LIST
158 #undef TAO_SYSTEM_EXCEPTION
160 #define TAO_SYSTEM_EXCEPTION(name) \
161 CORBA::Boolean \
162 CORBA::operator>>= (const CORBA::Any &any, \
163 const CORBA::name *&ex) \
165 return \
166 TAO::Any_SystemException::extract ( \
167 any, \
168 CORBA::name ::_tao_any_destructor, \
169 CORBA::_tc_ ## name, \
170 (const CORBA::SystemException *&) ex, \
171 &CORBA::name ::_tao_create); \
174 STANDARD_EXCEPTION_LIST
175 #undef TAO_SYSTEM_EXCEPTION
177 TAO_END_VERSIONED_NAMESPACE_DECL