00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file ORB_Constants.h 00006 * 00007 * $Id: ORB_Constants.h 76562 2007-01-24 18:37:07Z johnnyw $ 00008 * 00009 * Constants needed by various files. 00010 * 00011 * @author Jeff Parsons 00012 * @author Ossama Othman 00013 */ 00014 //============================================================================= 00015 00016 #ifndef TAO_ORB_CONSTANTS_H 00017 #define TAO_ORB_CONSTANTS_H 00018 00019 #include /**/ "ace/pre.h" 00020 00021 #include "tao/Basic_Types.h" 00022 00023 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00024 # pragma once 00025 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00026 00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00028 00029 // A hash define for the regular two way operation. 00030 #define TAO_TWOWAY_RESPONSE_FLAG 255 00031 00032 namespace CORBA 00033 { 00034 /// The OMG Vendor Minor Codeset ID (VMCID). 00035 /** 00036 * This number is reserved by the OMG as a prefix to all the 00037 * standard system exception minor codes. Check the CORBA/IIOP 00038 * specification for details. 00039 * 00040 * OMG defined system exception minor codes should be logically 00041 * OR-ed with this constant when passing such minor codes to a 00042 * @c CORBA::SystemException constructor. For example, throwing a 00043 * @c CORBA::BAD_PARAM exception with an OMG defined minor code of 00044 * @c 2 is done as follows: 00045 * 00046 * @verbatim 00047 * throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO); 00048 * @endverbatim 00049 * 00050 * *NOT* as: 00051 * 00052 * @verbatim 00053 * throw ::CORBA::BAD_PARAM (2, CORBA::COMPLETED_NO); 00054 * @endverbatim 00055 */ 00056 const ULong OMGVMCID = 0x4f4d0000U; 00057 } 00058 00059 namespace TAO 00060 { 00061 /// TAO Vendor Minor Codeset ID (VMCID). 00062 /** 00063 * TAO Vendor Minor Codeset ID (VMCID) assigned by the OMG. Do 00064 * *NOT* change at random. The TAO VMCID is an ASCII representation 00065 * of @c TA0xxxx (close enough since a VMCID only consists of the 00066 * higher order 20 bits of a 32 bit unsigned long integer). The 00067 * first 16 bits are @c TA, and the remaining 4 are @c 0. 00068 * 00069 * @note Remember that we can only play with the lower order 12 00070 * bits. @c MAX_MINOR_CODE is there to remind us of that. 00071 * 00072 * @see @c MAX_MINOR_CODE 00073 */ 00074 const CORBA::ULong VMCID = 0x54410000U; 00075 00076 /// Maximum allowed TAO system exception minor code. 00077 /** 00078 * Vendors are only allowed to use the lower order 12 bits of their 00079 * when defining vendor-specific exception minor codes. 00080 * @c MAX_MINOR_CODE is the maximum minor code value available to 00081 * TAO. Do not exceed it when defining TAO system exception minor 00082 * codes. 00083 * 00084 * @see @c VMCID 00085 */ 00086 const CORBA::ULong MAX_MINOR_CODE = VMCID | 0xfffU; 00087 00088 /// TAO Vendor @c PolicyType Valueset ID (VPVID) 00089 /** 00090 * TAO Vendor @c PolicyType Valueset ID (VPVID) assigned by the 00091 * OMG. This value was automatically assigned when TAO's VMCID was 00092 * assigned. Its value is always the same as the VMCID. 00093 * 00094 * As with TAO-specific system exception minor codes, the 00095 * TAO-specific @c PolicyType space occupies the lower order 12 bits 00096 * of the TAO VPVID, i.e. 00097 * 00098 * @verbatim 00099 * TAO::VPVID <= TAO PolicyType <= TAO::VPVID | 0xfffU. 00100 * @endverbatim 00101 * 00102 * For example, TAO-specific @c PolicyTypes should be defined by 00103 * logically "OR-ing" a 12 bit or less (i.e. 0x0U <= value <= 00104 * 0xfffU) value with @c TAO::VPVID. 00105 * 00106 * @see VMCID 00107 */ 00108 const CORBA::ULong VPVID = VMCID; 00109 } 00110 00111 /** 00112 * @name TAO-Specific System Exception Minor Code Values 00113 * 00114 * These system exception minor code values are specific to TAO. 00115 */ 00116 //@{ 00117 /// TAO VMCID assigned by the OMG. 00118 #if !defined (ACE_LACKS_DEPRECATED_MACROS) 00119 /** 00120 * @note This constant has historically been used in the wrong way. 00121 * It was often used as the @a location argument to the @c 00122 * CORBA::SystemException::_tao_minor_code() static method. A 00123 * more appropriate default @a location argument/value would 00124 * have been zero since the location code resides in portion of 00125 * the lower order 12 bits, not the higher order 20 bits which 00126 * is where the VMCID resides, and what this value happens to 00127 * be. 00128 * 00129 * @deprecated Please use @c TAO::VMCID instead, or zero if being used 00130 * as default TAO exception location code argument. 00131 * 00132 * @see @c TAO::VMCID 00133 */ 00134 const CORBA::ULong TAO_DEFAULT_MINOR_CODE = TAO::VMCID; 00135 #endif /* !ACE_LACKS_DEPRECATED_MACROS */ 00136 00137 #if !defined (ACE_LACKS_DEPRECATED_MACROS) 00138 /// Maximum allowed system exception minor code. 00139 /** 00140 * @deprecated Please use @c TAO::MAX_MINOR_CODE instead. 00141 * 00142 * @see @c TAO::MAX_MINOR_CODE 00143 */ 00144 const CORBA::ULong TAO_MAX_MINOR_CODE = TAO::MAX_MINOR_CODE; 00145 #endif /* !ACE_LACKS_DEPRECATED_MACROS */ 00146 //@} 00147 00148 /// A dummy service context that is inserted in the service context 00149 /// list to preserve the alignment in DSI based gateways, so no 00150 /// marshaling/demarshaling is required. 00151 /** 00152 * @note This is *extremely* brittle but works. 00153 */ 00154 const CORBA::ULong TAO_SVC_CONTEXT_ALIGN = 0x54414f00U; 00155 00156 /** 00157 * @name TAO-Specific Profile IDs 00158 * 00159 * The TAO @c IOP::ProfileId range @c 0x54414f00 - @c 0x54414f0f has 00160 * been reserved with the OMG. 00161 * 00162 * @note It is *NOT* necessary to list your own protocols here. 00163 * 00164 * @note The values below are subject to change at any point. 00165 */ 00166 //@{ 00167 /// Local IPC (Unix Domain) 00168 const CORBA::ULong TAO_TAG_UIOP_PROFILE = 0x54414f00U; 00169 00170 /// ATM/AAL5 00171 // const CORBA::ULong TAO_TAG_AIOP_PROFILE = 0x54414f01U; 00172 00173 /// Shared memory 00174 const CORBA::ULong TAO_TAG_SHMEM_PROFILE = 0x54414f02U; 00175 00176 /// Message Queue 00177 // const CORBA::ULong TAO_TAG_MSGQ_PROFILE = 0x54414f03U; 00178 00179 /// UDP 00180 const CORBA::ULong TAO_TAG_DIOP_PROFILE = 0x54414f04U; 00181 00182 /// COIOP 00183 const CORBA::ULong TAO_TAG_COIOP_PROFILE = 0x54414f05U; 00184 00185 /// SCIOP 00186 const CORBA::ULong TAO_TAG_SCIOP_PROFILE = 0x54414f0EU; 00187 00188 /// Tandem (HP) File System Protocol 00189 const CORBA::ULong TAO_TAG_NSKFS_PROFILE = 0x00003039U; 00190 00191 /// Tandem (HP) Pathsend Protocol 00192 const CORBA::ULong TAO_TAG_NSKPW_PROFILE = 0x0000303AU; 00193 00194 // Default DiffServ CodePoint. 00195 const int IPDSFIELD_DSCP_DEFAULT = 0x00; 00196 00197 /** 00198 * @name Minor Code Encoding 00199 * 00200 * Encode the location in 5 bits, and the errno in 7 bits: 00201 * 00202 * @verbatim 00203 * 0x 0101 0100 0100 0001 0000 ____ _ ___ ____ 00204 * T A 0 location errno 00205 * @endverbatim 00206 **/ 00207 //@{ 00208 /** 00209 * @name Location Encoding 00210 * 00211 * The location encoding is the 5 bits, after the @ errno encoding. 00212 */ 00213 //@{ 00214 const CORBA::ULong TAO_INVOCATION_LOCATION_FORWARD_MINOR_CODE = (0x01U << 7); 00215 const CORBA::ULong TAO_INVOCATION_SEND_REQUEST_MINOR_CODE = (0x02U << 7); 00216 const CORBA::ULong TAO_POA_DISCARDING = (0x03U << 7); 00217 const CORBA::ULong TAO_POA_HOLDING = (0x04U << 7); 00218 const CORBA::ULong TAO_UNHANDLED_SERVER_CXX_EXCEPTION = (0x05U << 7); 00219 const CORBA::ULong TAO_INVOCATION_RECV_REQUEST_MINOR_CODE = (0x06U << 7); 00220 const CORBA::ULong TAO_CONNECTOR_REGISTRY_NO_USABLE_PROTOCOL = (0x07U << 7); 00221 const CORBA::ULong TAO_MPROFILE_CREATION_ERROR = (0x08U << 7); 00222 const CORBA::ULong TAO_TIMEOUT_CONNECT_MINOR_CODE = (0x09U << 7); 00223 const CORBA::ULong TAO_TIMEOUT_SEND_MINOR_CODE = (0x0AU << 7); 00224 const CORBA::ULong TAO_TIMEOUT_RECV_MINOR_CODE = (0x0BU << 7); 00225 const CORBA::ULong TAO_IMPLREPO_MINOR_CODE = (0x0CU << 7); 00226 const CORBA::ULong TAO_ACCEPTOR_REGISTRY_OPEN_LOCATION_CODE = (0x0DU << 7); 00227 const CORBA::ULong TAO_ORB_CORE_INIT_LOCATION_CODE = (0x0EU << 7); 00228 const CORBA::ULong TAO_POLICY_NARROW_CODE = (0x0FU << 7); 00229 const CORBA::ULong TAO_GUARD_FAILURE = (0x10U << 7); 00230 const CORBA::ULong TAO_POA_BEING_DESTROYED = (0x11U << 7); 00231 const CORBA::ULong TAO_POA_INACTIVE = (0x12U << 7); 00232 const CORBA::ULong TAO_CONNECTOR_REGISTRY_INIT_LOCATION_CODE = (0x13U << 7); 00233 const CORBA::ULong TAO_AMH_REPLY_LOCATION_CODE = (0x14U << 7); 00234 const CORBA::ULong TAO_RTCORBA_THREAD_CREATION_LOCATION_CODE = (0x15U << 7); 00235 // *Don't* use TAO_<location>_MINOR_CODE greater than 0x1FU! 00236 //@} 00237 //@} 00238 00239 TAO_END_VERSIONED_NAMESPACE_DECL 00240 00241 #include /**/ "ace/post.h" 00242 00243 #endif /* TAO_ORB_CONSTANTS_H */