From 6c09087360c2ccd9de522cf6783563433d4b534d Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Fri, 19 Aug 2005 08:28:35 +0000 Subject: ChangeLogTag Fri Aug 19 07:56:12 UTC 2005 Johnny Willemsen --- .../Kokyu_dsrt_schedulers/EDF_Scheduling.idl | 2 +- TAO/tao/AnyTypeCode/Alias_TypeCode.cpp | 201 +++ TAO/tao/AnyTypeCode/Alias_TypeCode.h | 141 +++ TAO/tao/AnyTypeCode/Alias_TypeCode.inl | 28 + TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp | 175 +++ TAO/tao/AnyTypeCode/Alias_TypeCode_Static.h | 131 ++ TAO/tao/AnyTypeCode/Alias_TypeCode_Static.inl | 18 + TAO/tao/AnyTypeCode/Any.cpp | 770 ++++++++++++ TAO/tao/AnyTypeCode/Any.h | 397 ++++++ TAO/tao/AnyTypeCode/Any.inl | 368 ++++++ TAO/tao/AnyTypeCode/AnySeq.pidl | 31 + TAO/tao/AnyTypeCode/AnySeqA.cpp | 142 +++ TAO/tao/AnyTypeCode/AnySeqA.h | 106 ++ TAO/tao/AnyTypeCode/AnySeqC.cpp | 171 +++ TAO/tao/AnyTypeCode/AnySeqC.h | 179 +++ TAO/tao/AnyTypeCode/AnySeqS.h | 28 + TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.cpp | 153 +++ TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h | 119 ++ TAO/tao/AnyTypeCode/AnyTypeCode_methods.h | 54 + TAO/tao/AnyTypeCode/Any_Arg_Traits.h | 52 + TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp | 162 +++ TAO/tao/AnyTypeCode/Any_Array_Impl_T.h | 85 ++ TAO/tao/AnyTypeCode/Any_Array_Impl_T.inl | 28 + TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp | 382 ++++++ TAO/tao/AnyTypeCode/Any_Basic_Impl.h | 97 ++ TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp | 144 +++ TAO/tao/AnyTypeCode/Any_Basic_Impl_T.h | 82 ++ TAO/tao/AnyTypeCode/Any_Basic_Impl_T.inl | 26 + TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp | 202 +++ TAO/tao/AnyTypeCode/Any_Dual_Impl_T.h | 97 ++ TAO/tao/AnyTypeCode/Any_Dual_Impl_T.inl | 26 + TAO/tao/AnyTypeCode/Any_Impl.cpp | 137 ++ TAO/tao/AnyTypeCode/Any_Impl.h | 111 ++ TAO/tao/AnyTypeCode/Any_Impl_T.cpp | 157 +++ TAO/tao/AnyTypeCode/Any_Impl_T.h | 92 ++ TAO/tao/AnyTypeCode/Any_Impl_T.inl | 53 + TAO/tao/AnyTypeCode/Any_Special_Impl_T.cpp | 208 +++ TAO/tao/AnyTypeCode/Any_Special_Impl_T.h | 87 ++ TAO/tao/AnyTypeCode/Any_Special_Impl_T.inl | 30 + TAO/tao/AnyTypeCode/Any_SystemException.cpp | 206 +++ TAO/tao/AnyTypeCode/Any_SystemException.h | 83 ++ TAO/tao/AnyTypeCode/Any_Unknown_IDL_Type.cpp | 288 +++++ TAO/tao/AnyTypeCode/Any_Unknown_IDL_Type.h | 67 + TAO/tao/AnyTypeCode/BooleanSeqA.cpp | 142 +++ TAO/tao/AnyTypeCode/BooleanSeqA.h | 66 + TAO/tao/AnyTypeCode/Bounds.pidl | 43 + TAO/tao/AnyTypeCode/BoundsA.cpp | 147 +++ TAO/tao/AnyTypeCode/BoundsA.h | 159 +++ TAO/tao/AnyTypeCode/BoundsC.cpp | 173 +++ TAO/tao/AnyTypeCode/BoundsC.h | 146 +++ TAO/tao/AnyTypeCode/CONV_FRAMEA.cpp | 427 +++++++ TAO/tao/AnyTypeCode/CONV_FRAMEA.h | 110 ++ TAO/tao/AnyTypeCode/CharSeqA.cpp | 142 +++ TAO/tao/AnyTypeCode/CharSeqA.h | 107 ++ TAO/tao/AnyTypeCode/CurrentA.cpp | 53 + TAO/tao/AnyTypeCode/CurrentA.h | 58 + TAO/tao/AnyTypeCode/DomainA.cpp | 296 +++++ TAO/tao/AnyTypeCode/DomainA.h | 135 ++ TAO/tao/AnyTypeCode/DoubleSeqA.cpp | 143 +++ TAO/tao/AnyTypeCode/DoubleSeqA.h | 107 ++ TAO/tao/AnyTypeCode/Dynamic.pidl | 50 + TAO/tao/AnyTypeCode/DynamicA.cpp | 287 +++++ TAO/tao/AnyTypeCode/DynamicA.h | 142 +++ TAO/tao/AnyTypeCode/DynamicC.cpp | 303 +++++ TAO/tao/AnyTypeCode/DynamicC.h | 266 ++++ TAO/tao/AnyTypeCode/DynamicS.h | 28 + TAO/tao/AnyTypeCode/Dynamic_Parameter.pidl | 41 + TAO/tao/AnyTypeCode/Dynamic_ParameterA.cpp | 124 ++ TAO/tao/AnyTypeCode/Dynamic_ParameterA.h | 104 ++ TAO/tao/AnyTypeCode/Dynamic_ParameterC.cpp | 82 ++ TAO/tao/AnyTypeCode/Dynamic_ParameterC.h | 136 ++ TAO/tao/AnyTypeCode/Empty_Param_TypeCode.cpp | 83 ++ TAO/tao/AnyTypeCode/Empty_Param_TypeCode.h | 98 ++ TAO/tao/AnyTypeCode/Empty_Param_TypeCode.inl | 10 + TAO/tao/AnyTypeCode/Enum_TypeCode.cpp | 221 ++++ TAO/tao/AnyTypeCode/Enum_TypeCode.h | 141 +++ TAO/tao/AnyTypeCode/Enum_TypeCode.inl | 21 + TAO/tao/AnyTypeCode/Enum_TypeCode_Static.cpp | 214 ++++ TAO/tao/AnyTypeCode/Enum_TypeCode_Static.h | 137 ++ TAO/tao/AnyTypeCode/Enum_TypeCode_Static.inl | 20 + TAO/tao/AnyTypeCode/ExceptionA.cpp | 118 ++ TAO/tao/AnyTypeCode/ExceptionA.h | 49 + TAO/tao/AnyTypeCode/Fixed_TypeCode.cpp | 111 ++ TAO/tao/AnyTypeCode/Fixed_TypeCode.h | 114 ++ TAO/tao/AnyTypeCode/Fixed_TypeCode.inl | 14 + TAO/tao/AnyTypeCode/FloatSeqA.cpp | 142 +++ TAO/tao/AnyTypeCode/FloatSeqA.h | 66 + TAO/tao/AnyTypeCode/GIOPA.cpp | 328 +++++ TAO/tao/AnyTypeCode/GIOPA.h | 99 ++ TAO/tao/AnyTypeCode/IIOPA.cpp | 321 +++++ TAO/tao/AnyTypeCode/IIOPA.h | 92 ++ TAO/tao/AnyTypeCode/IIOP_EndpointsA.cpp | 233 ++++ TAO/tao/AnyTypeCode/IIOP_EndpointsA.h | 120 ++ TAO/tao/AnyTypeCode/IOPA.cpp | 34 + TAO/tao/AnyTypeCode/IOPA.h | 43 + TAO/tao/AnyTypeCode/IOP_IORA.cpp | 997 +++++++++++++++ TAO/tao/AnyTypeCode/IOP_IORA.h | 186 +++ TAO/tao/AnyTypeCode/LongDoubleSeqA.cpp | 142 +++ TAO/tao/AnyTypeCode/LongDoubleSeqA.h | 106 ++ TAO/tao/AnyTypeCode/LongLongSeqA.cpp | 142 +++ TAO/tao/AnyTypeCode/LongLongSeqA.h | 106 ++ TAO/tao/AnyTypeCode/LongSeqA.cpp | 142 +++ TAO/tao/AnyTypeCode/LongSeqA.h | 107 ++ TAO/tao/AnyTypeCode/Marshal.cpp | 257 ++++ TAO/tao/AnyTypeCode/Marshal.h | 455 +++++++ TAO/tao/AnyTypeCode/Marshal.inl | 77 ++ TAO/tao/AnyTypeCode/Messaging_PolicyValueA.cpp | 240 ++++ TAO/tao/AnyTypeCode/Messaging_PolicyValueA.h | 122 ++ TAO/tao/AnyTypeCode/Messaging_SyncScopeA.h | 40 + TAO/tao/AnyTypeCode/NVList.cpp | 498 ++++++++ TAO/tao/AnyTypeCode/NVList.h | 307 +++++ TAO/tao/AnyTypeCode/NVList.inl | 126 ++ TAO/tao/AnyTypeCode/NVList_Adapter_Impl.cpp | 79 ++ TAO/tao/AnyTypeCode/NVList_Adapter_Impl.h | 56 + TAO/tao/AnyTypeCode/Null_RefCount_Policy.h | 78 ++ TAO/tao/AnyTypeCode/ObjectIdListA.cpp | 100 ++ TAO/tao/AnyTypeCode/ObjectIdListA.h | 101 ++ TAO/tao/AnyTypeCode/Objref_TypeCode.cpp | 153 +++ TAO/tao/AnyTypeCode/Objref_TypeCode.h | 122 ++ TAO/tao/AnyTypeCode/Objref_TypeCode.inl | 16 + TAO/tao/AnyTypeCode/Objref_TypeCode_Static.cpp | 149 +++ TAO/tao/AnyTypeCode/Objref_TypeCode_Static.h | 118 ++ TAO/tao/AnyTypeCode/Objref_TypeCode_Static.inl | 15 + TAO/tao/AnyTypeCode/OctetSeqA.cpp | 142 +++ TAO/tao/AnyTypeCode/OctetSeqA.h | 66 + TAO/tao/AnyTypeCode/PI_ForwardA.cpp | 197 +++ TAO/tao/AnyTypeCode/PI_ForwardA.h | 190 +++ TAO/tao/AnyTypeCode/ParameterModeA.cpp | 91 ++ TAO/tao/AnyTypeCode/ParameterModeA.h | 104 ++ TAO/tao/AnyTypeCode/PolicyA.cpp | 557 ++++++++ TAO/tao/AnyTypeCode/PolicyA.h | 158 +++ TAO/tao/AnyTypeCode/Policy_ForwardA.cpp | 331 +++++ TAO/tao/AnyTypeCode/Policy_ForwardA.h | 102 ++ TAO/tao/AnyTypeCode/PortableInterceptorA.cpp | 34 + TAO/tao/AnyTypeCode/PortableInterceptorA.h | 55 + TAO/tao/AnyTypeCode/Recursive_Type_TypeCode.cpp | 138 ++ TAO/tao/AnyTypeCode/Recursive_Type_TypeCode.h | 216 ++++ TAO/tao/AnyTypeCode/Recursive_Type_TypeCode.inl | 149 +++ TAO/tao/AnyTypeCode/RefCount_Policy_Traits.h | 107 ++ TAO/tao/AnyTypeCode/Sequence_TypeCode.cpp | 148 +++ TAO/tao/AnyTypeCode/Sequence_TypeCode.h | 134 ++ TAO/tao/AnyTypeCode/Sequence_TypeCode.inl | 23 + TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.cpp | 147 +++ TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.h | 125 ++ TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.inl | 16 + TAO/tao/AnyTypeCode/ServicesA.cpp | 518 ++++++++ TAO/tao/AnyTypeCode/ServicesA.h | 126 ++ TAO/tao/AnyTypeCode/ShortSeqA.cpp | 142 +++ TAO/tao/AnyTypeCode/ShortSeqA.h | 66 + TAO/tao/AnyTypeCode/StringSeqA.cpp | 143 +++ TAO/tao/AnyTypeCode/StringSeqA.h | 66 + TAO/tao/AnyTypeCode/String_TypeCode.cpp | 91 ++ TAO/tao/AnyTypeCode/String_TypeCode.h | 111 ++ TAO/tao/AnyTypeCode/String_TypeCode.inl | 14 + TAO/tao/AnyTypeCode/String_TypeCode_Static.cpp | 84 ++ TAO/tao/AnyTypeCode/String_TypeCode_Static.h | 107 ++ TAO/tao/AnyTypeCode/String_TypeCode_Static.inl | 14 + TAO/tao/AnyTypeCode/String_TypeCode_Traits.h | 77 ++ TAO/tao/AnyTypeCode/Struct_TypeCode.cpp | 346 +++++ TAO/tao/AnyTypeCode/Struct_TypeCode.h | 156 +++ TAO/tao/AnyTypeCode/Struct_TypeCode.inl | 47 + TAO/tao/AnyTypeCode/Struct_TypeCode_Static.cpp | 316 +++++ TAO/tao/AnyTypeCode/Struct_TypeCode_Static.h | 152 +++ TAO/tao/AnyTypeCode/Struct_TypeCode_Static.inl | 23 + TAO/tao/AnyTypeCode/SystemExceptionA.cpp | 180 +++ TAO/tao/AnyTypeCode/SystemExceptionA.h | 88 ++ TAO/tao/AnyTypeCode/TAOA.cpp | 164 +++ TAO/tao/AnyTypeCode/TAOA.h | 79 ++ TAO/tao/AnyTypeCode/TAO_AnyTypeCode_Export.h | 40 + TAO/tao/AnyTypeCode/TC_Constants_Forward.h | 110 ++ TAO/tao/AnyTypeCode/TimeBaseA.cpp | 271 ++++ TAO/tao/AnyTypeCode/TimeBaseA.h | 135 ++ TAO/tao/AnyTypeCode/True_RefCount_Policy.cpp | 17 + TAO/tao/AnyTypeCode/True_RefCount_Policy.h | 116 ++ TAO/tao/AnyTypeCode/True_RefCount_Policy.inl | 25 + TAO/tao/AnyTypeCode/TypeCode.cpp | 463 +++++++ TAO/tao/AnyTypeCode/TypeCode.h | 587 +++++++++ TAO/tao/AnyTypeCode/TypeCode.inl | 183 +++ TAO/tao/AnyTypeCode/TypeCodeA.cpp | 59 + TAO/tao/AnyTypeCode/TypeCode_Base_Attributes.cpp | 12 + TAO/tao/AnyTypeCode/TypeCode_Base_Attributes.h | 96 ++ TAO/tao/AnyTypeCode/TypeCode_Base_Attributes.inl | 51 + TAO/tao/AnyTypeCode/TypeCode_CDR_Extraction.cpp | 1325 ++++++++++++++++++++ TAO/tao/AnyTypeCode/TypeCode_CDR_Extraction.h | 196 +++ TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.cpp | 86 ++ TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.h | 204 +++ TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.inl | 76 ++ TAO/tao/AnyTypeCode/TypeCode_Case_T.cpp | 162 +++ TAO/tao/AnyTypeCode/TypeCode_Case_T.h | 145 +++ TAO/tao/AnyTypeCode/TypeCode_Case_T.inl | 29 + TAO/tao/AnyTypeCode/TypeCode_Constants.cpp | 111 ++ TAO/tao/AnyTypeCode/TypeCode_Constants.h | 65 + TAO/tao/AnyTypeCode/TypeCode_Struct_Field.h | 89 ++ TAO/tao/AnyTypeCode/TypeCode_Traits.h | 123 ++ TAO/tao/AnyTypeCode/TypeCode_Value_Field.h | 91 ++ TAO/tao/AnyTypeCode/Typecode_typesA.h | 47 + TAO/tao/AnyTypeCode/ULongLongSeqA.cpp | 142 +++ TAO/tao/AnyTypeCode/ULongLongSeqA.h | 66 + TAO/tao/AnyTypeCode/ULongSeqA.cpp | 142 +++ TAO/tao/AnyTypeCode/ULongSeqA.h | 66 + TAO/tao/AnyTypeCode/UShortSeqA.cpp | 142 +++ TAO/tao/AnyTypeCode/UShortSeqA.h | 107 ++ TAO/tao/AnyTypeCode/Union_TypeCode.cpp | 439 +++++++ TAO/tao/AnyTypeCode/Union_TypeCode.h | 179 +++ TAO/tao/AnyTypeCode/Union_TypeCode.inl | 55 + TAO/tao/AnyTypeCode/Union_TypeCode_Static.cpp | 400 ++++++ TAO/tao/AnyTypeCode/Union_TypeCode_Static.h | 169 +++ TAO/tao/AnyTypeCode/Union_TypeCode_Static.inl | 25 + TAO/tao/AnyTypeCode/ValueModifier.pidl | 36 + TAO/tao/AnyTypeCode/ValueModifierA.cpp | 54 + TAO/tao/AnyTypeCode/ValueModifierA.h | 94 ++ TAO/tao/AnyTypeCode/ValueModifierC.cpp | 46 + TAO/tao/AnyTypeCode/ValueModifierC.h | 121 ++ TAO/tao/AnyTypeCode/ValueModifierS.h | 28 + TAO/tao/AnyTypeCode/Value_TypeCode.cpp | 463 +++++++ TAO/tao/AnyTypeCode/Value_TypeCode.h | 179 +++ TAO/tao/AnyTypeCode/Value_TypeCode.inl | 57 + TAO/tao/AnyTypeCode/Value_TypeCode_Static.cpp | 422 +++++++ TAO/tao/AnyTypeCode/Value_TypeCode_Static.h | 168 +++ TAO/tao/AnyTypeCode/Value_TypeCode_Static.inl | 26 + TAO/tao/AnyTypeCode/Visibility.pidl | 34 + TAO/tao/AnyTypeCode/VisibilityA.cpp | 53 + TAO/tao/AnyTypeCode/VisibilityA.h | 96 ++ TAO/tao/AnyTypeCode/VisibilityC.cpp | 46 + TAO/tao/AnyTypeCode/VisibilityC.h | 111 ++ TAO/tao/AnyTypeCode/VisibilityS.h | 28 + TAO/tao/AnyTypeCode/WCharSeqA.cpp | 142 +++ TAO/tao/AnyTypeCode/WCharSeqA.h | 66 + TAO/tao/AnyTypeCode/WStringSeqA.cpp | 143 +++ TAO/tao/AnyTypeCode/WStringSeqA.h | 66 + TAO/tao/AnyTypeCode/WrongTransactionA.cpp | 147 +++ TAO/tao/AnyTypeCode/WrongTransactionA.h | 107 ++ TAO/tao/AnyTypeCode/append.cpp | 1320 +++++++++++++++++++ TAO/tao/AnyTypeCode/orb_typesA.cpp | 114 ++ TAO/tao/AnyTypeCode/orb_typesA.h | 73 ++ TAO/tao/AnyTypeCode/skip.cpp | 1042 +++++++++++++++ 236 files changed, 36466 insertions(+), 1 deletion(-) create mode 100644 TAO/tao/AnyTypeCode/Alias_TypeCode.cpp create mode 100644 TAO/tao/AnyTypeCode/Alias_TypeCode.h create mode 100644 TAO/tao/AnyTypeCode/Alias_TypeCode.inl create mode 100644 TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp create mode 100644 TAO/tao/AnyTypeCode/Alias_TypeCode_Static.h create mode 100644 TAO/tao/AnyTypeCode/Alias_TypeCode_Static.inl create mode 100644 TAO/tao/AnyTypeCode/Any.cpp create mode 100644 TAO/tao/AnyTypeCode/Any.h create mode 100644 TAO/tao/AnyTypeCode/Any.inl create mode 100644 TAO/tao/AnyTypeCode/AnySeq.pidl create mode 100644 TAO/tao/AnyTypeCode/AnySeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/AnySeqA.h create mode 100644 TAO/tao/AnyTypeCode/AnySeqC.cpp create mode 100644 TAO/tao/AnyTypeCode/AnySeqC.h create mode 100644 TAO/tao/AnyTypeCode/AnySeqS.h create mode 100644 TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.cpp create mode 100644 TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h create mode 100644 TAO/tao/AnyTypeCode/AnyTypeCode_methods.h create mode 100644 TAO/tao/AnyTypeCode/Any_Arg_Traits.h create mode 100644 TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp create mode 100644 TAO/tao/AnyTypeCode/Any_Array_Impl_T.h create mode 100644 TAO/tao/AnyTypeCode/Any_Array_Impl_T.inl create mode 100644 TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp create mode 100644 TAO/tao/AnyTypeCode/Any_Basic_Impl.h create mode 100644 TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp create mode 100644 TAO/tao/AnyTypeCode/Any_Basic_Impl_T.h create mode 100644 TAO/tao/AnyTypeCode/Any_Basic_Impl_T.inl create mode 100644 TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp create mode 100644 TAO/tao/AnyTypeCode/Any_Dual_Impl_T.h create mode 100644 TAO/tao/AnyTypeCode/Any_Dual_Impl_T.inl create mode 100644 TAO/tao/AnyTypeCode/Any_Impl.cpp create mode 100644 TAO/tao/AnyTypeCode/Any_Impl.h create mode 100644 TAO/tao/AnyTypeCode/Any_Impl_T.cpp create mode 100644 TAO/tao/AnyTypeCode/Any_Impl_T.h create mode 100644 TAO/tao/AnyTypeCode/Any_Impl_T.inl create mode 100644 TAO/tao/AnyTypeCode/Any_Special_Impl_T.cpp create mode 100644 TAO/tao/AnyTypeCode/Any_Special_Impl_T.h create mode 100644 TAO/tao/AnyTypeCode/Any_Special_Impl_T.inl create mode 100644 TAO/tao/AnyTypeCode/Any_SystemException.cpp create mode 100644 TAO/tao/AnyTypeCode/Any_SystemException.h create mode 100644 TAO/tao/AnyTypeCode/Any_Unknown_IDL_Type.cpp create mode 100644 TAO/tao/AnyTypeCode/Any_Unknown_IDL_Type.h create mode 100644 TAO/tao/AnyTypeCode/BooleanSeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/BooleanSeqA.h create mode 100644 TAO/tao/AnyTypeCode/Bounds.pidl create mode 100644 TAO/tao/AnyTypeCode/BoundsA.cpp create mode 100644 TAO/tao/AnyTypeCode/BoundsA.h create mode 100644 TAO/tao/AnyTypeCode/BoundsC.cpp create mode 100644 TAO/tao/AnyTypeCode/BoundsC.h create mode 100644 TAO/tao/AnyTypeCode/CONV_FRAMEA.cpp create mode 100644 TAO/tao/AnyTypeCode/CONV_FRAMEA.h create mode 100644 TAO/tao/AnyTypeCode/CharSeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/CharSeqA.h create mode 100644 TAO/tao/AnyTypeCode/CurrentA.cpp create mode 100644 TAO/tao/AnyTypeCode/CurrentA.h create mode 100644 TAO/tao/AnyTypeCode/DomainA.cpp create mode 100644 TAO/tao/AnyTypeCode/DomainA.h create mode 100644 TAO/tao/AnyTypeCode/DoubleSeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/DoubleSeqA.h create mode 100644 TAO/tao/AnyTypeCode/Dynamic.pidl create mode 100644 TAO/tao/AnyTypeCode/DynamicA.cpp create mode 100644 TAO/tao/AnyTypeCode/DynamicA.h create mode 100644 TAO/tao/AnyTypeCode/DynamicC.cpp create mode 100644 TAO/tao/AnyTypeCode/DynamicC.h create mode 100644 TAO/tao/AnyTypeCode/DynamicS.h create mode 100644 TAO/tao/AnyTypeCode/Dynamic_Parameter.pidl create mode 100644 TAO/tao/AnyTypeCode/Dynamic_ParameterA.cpp create mode 100644 TAO/tao/AnyTypeCode/Dynamic_ParameterA.h create mode 100644 TAO/tao/AnyTypeCode/Dynamic_ParameterC.cpp create mode 100644 TAO/tao/AnyTypeCode/Dynamic_ParameterC.h create mode 100644 TAO/tao/AnyTypeCode/Empty_Param_TypeCode.cpp create mode 100644 TAO/tao/AnyTypeCode/Empty_Param_TypeCode.h create mode 100644 TAO/tao/AnyTypeCode/Empty_Param_TypeCode.inl create mode 100644 TAO/tao/AnyTypeCode/Enum_TypeCode.cpp create mode 100644 TAO/tao/AnyTypeCode/Enum_TypeCode.h create mode 100644 TAO/tao/AnyTypeCode/Enum_TypeCode.inl create mode 100644 TAO/tao/AnyTypeCode/Enum_TypeCode_Static.cpp create mode 100644 TAO/tao/AnyTypeCode/Enum_TypeCode_Static.h create mode 100644 TAO/tao/AnyTypeCode/Enum_TypeCode_Static.inl create mode 100644 TAO/tao/AnyTypeCode/ExceptionA.cpp create mode 100644 TAO/tao/AnyTypeCode/ExceptionA.h create mode 100644 TAO/tao/AnyTypeCode/Fixed_TypeCode.cpp create mode 100644 TAO/tao/AnyTypeCode/Fixed_TypeCode.h create mode 100644 TAO/tao/AnyTypeCode/Fixed_TypeCode.inl create mode 100644 TAO/tao/AnyTypeCode/FloatSeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/FloatSeqA.h create mode 100644 TAO/tao/AnyTypeCode/GIOPA.cpp create mode 100644 TAO/tao/AnyTypeCode/GIOPA.h create mode 100644 TAO/tao/AnyTypeCode/IIOPA.cpp create mode 100644 TAO/tao/AnyTypeCode/IIOPA.h create mode 100644 TAO/tao/AnyTypeCode/IIOP_EndpointsA.cpp create mode 100644 TAO/tao/AnyTypeCode/IIOP_EndpointsA.h create mode 100644 TAO/tao/AnyTypeCode/IOPA.cpp create mode 100644 TAO/tao/AnyTypeCode/IOPA.h create mode 100644 TAO/tao/AnyTypeCode/IOP_IORA.cpp create mode 100644 TAO/tao/AnyTypeCode/IOP_IORA.h create mode 100644 TAO/tao/AnyTypeCode/LongDoubleSeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/LongDoubleSeqA.h create mode 100644 TAO/tao/AnyTypeCode/LongLongSeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/LongLongSeqA.h create mode 100644 TAO/tao/AnyTypeCode/LongSeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/LongSeqA.h create mode 100644 TAO/tao/AnyTypeCode/Marshal.cpp create mode 100644 TAO/tao/AnyTypeCode/Marshal.h create mode 100644 TAO/tao/AnyTypeCode/Marshal.inl create mode 100644 TAO/tao/AnyTypeCode/Messaging_PolicyValueA.cpp create mode 100644 TAO/tao/AnyTypeCode/Messaging_PolicyValueA.h create mode 100644 TAO/tao/AnyTypeCode/Messaging_SyncScopeA.h create mode 100644 TAO/tao/AnyTypeCode/NVList.cpp create mode 100644 TAO/tao/AnyTypeCode/NVList.h create mode 100644 TAO/tao/AnyTypeCode/NVList.inl create mode 100644 TAO/tao/AnyTypeCode/NVList_Adapter_Impl.cpp create mode 100644 TAO/tao/AnyTypeCode/NVList_Adapter_Impl.h create mode 100644 TAO/tao/AnyTypeCode/Null_RefCount_Policy.h create mode 100644 TAO/tao/AnyTypeCode/ObjectIdListA.cpp create mode 100644 TAO/tao/AnyTypeCode/ObjectIdListA.h create mode 100644 TAO/tao/AnyTypeCode/Objref_TypeCode.cpp create mode 100644 TAO/tao/AnyTypeCode/Objref_TypeCode.h create mode 100644 TAO/tao/AnyTypeCode/Objref_TypeCode.inl create mode 100644 TAO/tao/AnyTypeCode/Objref_TypeCode_Static.cpp create mode 100644 TAO/tao/AnyTypeCode/Objref_TypeCode_Static.h create mode 100644 TAO/tao/AnyTypeCode/Objref_TypeCode_Static.inl create mode 100644 TAO/tao/AnyTypeCode/OctetSeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/OctetSeqA.h create mode 100644 TAO/tao/AnyTypeCode/PI_ForwardA.cpp create mode 100644 TAO/tao/AnyTypeCode/PI_ForwardA.h create mode 100644 TAO/tao/AnyTypeCode/ParameterModeA.cpp create mode 100644 TAO/tao/AnyTypeCode/ParameterModeA.h create mode 100644 TAO/tao/AnyTypeCode/PolicyA.cpp create mode 100644 TAO/tao/AnyTypeCode/PolicyA.h create mode 100644 TAO/tao/AnyTypeCode/Policy_ForwardA.cpp create mode 100644 TAO/tao/AnyTypeCode/Policy_ForwardA.h create mode 100644 TAO/tao/AnyTypeCode/PortableInterceptorA.cpp create mode 100644 TAO/tao/AnyTypeCode/PortableInterceptorA.h create mode 100644 TAO/tao/AnyTypeCode/Recursive_Type_TypeCode.cpp create mode 100644 TAO/tao/AnyTypeCode/Recursive_Type_TypeCode.h create mode 100644 TAO/tao/AnyTypeCode/Recursive_Type_TypeCode.inl create mode 100644 TAO/tao/AnyTypeCode/RefCount_Policy_Traits.h create mode 100644 TAO/tao/AnyTypeCode/Sequence_TypeCode.cpp create mode 100644 TAO/tao/AnyTypeCode/Sequence_TypeCode.h create mode 100644 TAO/tao/AnyTypeCode/Sequence_TypeCode.inl create mode 100644 TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.cpp create mode 100644 TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.h create mode 100644 TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.inl create mode 100644 TAO/tao/AnyTypeCode/ServicesA.cpp create mode 100644 TAO/tao/AnyTypeCode/ServicesA.h create mode 100644 TAO/tao/AnyTypeCode/ShortSeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/ShortSeqA.h create mode 100644 TAO/tao/AnyTypeCode/StringSeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/StringSeqA.h create mode 100644 TAO/tao/AnyTypeCode/String_TypeCode.cpp create mode 100644 TAO/tao/AnyTypeCode/String_TypeCode.h create mode 100644 TAO/tao/AnyTypeCode/String_TypeCode.inl create mode 100644 TAO/tao/AnyTypeCode/String_TypeCode_Static.cpp create mode 100644 TAO/tao/AnyTypeCode/String_TypeCode_Static.h create mode 100644 TAO/tao/AnyTypeCode/String_TypeCode_Static.inl create mode 100644 TAO/tao/AnyTypeCode/String_TypeCode_Traits.h create mode 100644 TAO/tao/AnyTypeCode/Struct_TypeCode.cpp create mode 100644 TAO/tao/AnyTypeCode/Struct_TypeCode.h create mode 100644 TAO/tao/AnyTypeCode/Struct_TypeCode.inl create mode 100644 TAO/tao/AnyTypeCode/Struct_TypeCode_Static.cpp create mode 100644 TAO/tao/AnyTypeCode/Struct_TypeCode_Static.h create mode 100644 TAO/tao/AnyTypeCode/Struct_TypeCode_Static.inl create mode 100644 TAO/tao/AnyTypeCode/SystemExceptionA.cpp create mode 100644 TAO/tao/AnyTypeCode/SystemExceptionA.h create mode 100644 TAO/tao/AnyTypeCode/TAOA.cpp create mode 100644 TAO/tao/AnyTypeCode/TAOA.h create mode 100644 TAO/tao/AnyTypeCode/TAO_AnyTypeCode_Export.h create mode 100644 TAO/tao/AnyTypeCode/TC_Constants_Forward.h create mode 100644 TAO/tao/AnyTypeCode/TimeBaseA.cpp create mode 100644 TAO/tao/AnyTypeCode/TimeBaseA.h create mode 100644 TAO/tao/AnyTypeCode/True_RefCount_Policy.cpp create mode 100644 TAO/tao/AnyTypeCode/True_RefCount_Policy.h create mode 100644 TAO/tao/AnyTypeCode/True_RefCount_Policy.inl create mode 100644 TAO/tao/AnyTypeCode/TypeCode.cpp create mode 100644 TAO/tao/AnyTypeCode/TypeCode.h create mode 100644 TAO/tao/AnyTypeCode/TypeCode.inl create mode 100644 TAO/tao/AnyTypeCode/TypeCodeA.cpp create mode 100644 TAO/tao/AnyTypeCode/TypeCode_Base_Attributes.cpp create mode 100644 TAO/tao/AnyTypeCode/TypeCode_Base_Attributes.h create mode 100644 TAO/tao/AnyTypeCode/TypeCode_Base_Attributes.inl create mode 100644 TAO/tao/AnyTypeCode/TypeCode_CDR_Extraction.cpp create mode 100644 TAO/tao/AnyTypeCode/TypeCode_CDR_Extraction.h create mode 100644 TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.cpp create mode 100644 TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.h create mode 100644 TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.inl create mode 100644 TAO/tao/AnyTypeCode/TypeCode_Case_T.cpp create mode 100644 TAO/tao/AnyTypeCode/TypeCode_Case_T.h create mode 100644 TAO/tao/AnyTypeCode/TypeCode_Case_T.inl create mode 100644 TAO/tao/AnyTypeCode/TypeCode_Constants.cpp create mode 100644 TAO/tao/AnyTypeCode/TypeCode_Constants.h create mode 100644 TAO/tao/AnyTypeCode/TypeCode_Struct_Field.h create mode 100644 TAO/tao/AnyTypeCode/TypeCode_Traits.h create mode 100644 TAO/tao/AnyTypeCode/TypeCode_Value_Field.h create mode 100644 TAO/tao/AnyTypeCode/Typecode_typesA.h create mode 100644 TAO/tao/AnyTypeCode/ULongLongSeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/ULongLongSeqA.h create mode 100644 TAO/tao/AnyTypeCode/ULongSeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/ULongSeqA.h create mode 100644 TAO/tao/AnyTypeCode/UShortSeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/UShortSeqA.h create mode 100644 TAO/tao/AnyTypeCode/Union_TypeCode.cpp create mode 100644 TAO/tao/AnyTypeCode/Union_TypeCode.h create mode 100644 TAO/tao/AnyTypeCode/Union_TypeCode.inl create mode 100644 TAO/tao/AnyTypeCode/Union_TypeCode_Static.cpp create mode 100644 TAO/tao/AnyTypeCode/Union_TypeCode_Static.h create mode 100644 TAO/tao/AnyTypeCode/Union_TypeCode_Static.inl create mode 100644 TAO/tao/AnyTypeCode/ValueModifier.pidl create mode 100644 TAO/tao/AnyTypeCode/ValueModifierA.cpp create mode 100644 TAO/tao/AnyTypeCode/ValueModifierA.h create mode 100644 TAO/tao/AnyTypeCode/ValueModifierC.cpp create mode 100644 TAO/tao/AnyTypeCode/ValueModifierC.h create mode 100644 TAO/tao/AnyTypeCode/ValueModifierS.h create mode 100644 TAO/tao/AnyTypeCode/Value_TypeCode.cpp create mode 100644 TAO/tao/AnyTypeCode/Value_TypeCode.h create mode 100644 TAO/tao/AnyTypeCode/Value_TypeCode.inl create mode 100644 TAO/tao/AnyTypeCode/Value_TypeCode_Static.cpp create mode 100644 TAO/tao/AnyTypeCode/Value_TypeCode_Static.h create mode 100644 TAO/tao/AnyTypeCode/Value_TypeCode_Static.inl create mode 100644 TAO/tao/AnyTypeCode/Visibility.pidl create mode 100644 TAO/tao/AnyTypeCode/VisibilityA.cpp create mode 100644 TAO/tao/AnyTypeCode/VisibilityA.h create mode 100644 TAO/tao/AnyTypeCode/VisibilityC.cpp create mode 100644 TAO/tao/AnyTypeCode/VisibilityC.h create mode 100644 TAO/tao/AnyTypeCode/VisibilityS.h create mode 100644 TAO/tao/AnyTypeCode/WCharSeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/WCharSeqA.h create mode 100644 TAO/tao/AnyTypeCode/WStringSeqA.cpp create mode 100644 TAO/tao/AnyTypeCode/WStringSeqA.h create mode 100644 TAO/tao/AnyTypeCode/WrongTransactionA.cpp create mode 100644 TAO/tao/AnyTypeCode/WrongTransactionA.h create mode 100644 TAO/tao/AnyTypeCode/append.cpp create mode 100644 TAO/tao/AnyTypeCode/orb_typesA.cpp create mode 100644 TAO/tao/AnyTypeCode/orb_typesA.h create mode 100644 TAO/tao/AnyTypeCode/skip.cpp diff --git a/TAO/examples/Kokyu_dsrt_schedulers/EDF_Scheduling.idl b/TAO/examples/Kokyu_dsrt_schedulers/EDF_Scheduling.idl index a4f15a0da55..8d0a05b1ad4 100644 --- a/TAO/examples/Kokyu_dsrt_schedulers/EDF_Scheduling.idl +++ b/TAO/examples/Kokyu_dsrt_schedulers/EDF_Scheduling.idl @@ -1,7 +1,7 @@ // $Id$ /** - * @file EDF_Scheduling.pidl + * @file EDF_Scheduling.idl * * EDF_Scheduling.pidl,v 1.2 2003/10/08 13:26:32 venkita Exp * diff --git a/TAO/tao/AnyTypeCode/Alias_TypeCode.cpp b/TAO/tao/AnyTypeCode/Alias_TypeCode.cpp new file mode 100644 index 00000000000..7a27a68e747 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Alias_TypeCode.cpp @@ -0,0 +1,201 @@ +// $Id$ + +#ifndef TAO_ALIAS_TYPECODE_CPP +#define TAO_ALIAS_TYPECODE_CPP + +#include "tao/AnyTypeCode/Alias_TypeCode.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/Alias_TypeCode.inl" +#endif /* !__ACE_INLINE__ */ + +#include "tao/ORB_Core.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/TypeCode_Traits.h" + +#include "ace/Dynamic_Service.h" + + +template +bool +TAO::TypeCode::Alias::tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const +{ + // A tk_alias TypeCode has a "complex" parameter list type (see + // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of + // the CORBA specification), meaning that it must be marshaled into + // a CDR encapsulation. + + // Create a CDR encapsulation. + + TAO_OutputCDR enc; + + // Account for the encoded CDR encapsulation length and byte order. + // + // Aligning on an octet since the next value after the CDR + // encapsulation length will always be the byte order octet/boolean + // in this case. + offset = ACE_align_binary (offset + 4, + ACE_CDR::OCTET_ALIGN); + + return + enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER) + && enc << TAO_OutputCDR::from_string (this->attributes_.id (), 0) + && enc << TAO_OutputCDR::from_string (this->attributes_.name (), 0) + && marshal (enc, + Traits::get_typecode (this->content_type_), + offset + enc.total_length ()) + && cdr << static_cast (enc.total_length ()) + && cdr.write_octet_array_mb (enc.begin ()); +} + +template +void +TAO::TypeCode::Alias::tao_duplicate (void) +{ + this->RefCountPolicy::add_ref (); +} + +template +void +TAO::TypeCode::Alias::tao_release (void) +{ + this->RefCountPolicy::remove_ref (); +} + +template +CORBA::Boolean +TAO::TypeCode::Alias::equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // The CORBA::TypeCode base class already verified equality of the + // base attributes (id and name). Perform an equality comparison of + // the content. + + CORBA::TypeCode_var rhs_content_type = + tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return + Traits::get_typecode (this->content_type_)->equal ( + rhs_content_type.in () + ACE_ENV_ARG_PARAMETER); +} + +template +CORBA::Boolean +TAO::TypeCode::Alias::equivalent_i ( + CORBA::TypeCode_ptr + ACE_ENV_ARG_DECL_NOT_USED) const +{ + // Equivalence already verified in the base class + // CORBA::TypeCode::equivalent() method. + + return true; +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::Alias::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const +{ + TAO_TypeCodeFactory_Adapter * const adapter = + ACE_Dynamic_Service::instance ( + TAO_ORB_Core::typecodefactory_adapter_name () + ); + + if (adapter == 0) + { + ACE_THROW_RETURN (CORBA::INITIALIZE (), + CORBA::TypeCode::_nil ()); + } + + CORBA::TypeCode_var compact_content_type = + Traits::get_typecode ( + this->content_type_)->get_compact_typecode ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); + + if (this->kind_ == CORBA::tk_alias) + { + return adapter->create_alias_tc (this->attributes_.id (), + "", /* empty name */ + compact_content_type.in () + ACE_ENV_ARG_PARAMETER); + } + else + { + return adapter->create_value_box_tc (this->attributes_.id (), + "", /* empty name */ + compact_content_type.in () + ACE_ENV_ARG_PARAMETER); + } +} + +template +char const * +TAO::TypeCode::Alias::id_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->attributes_.id (); +} + +template +char const * +TAO::TypeCode::Alias::name_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->attributes_.name (); +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::Alias::content_type_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return + CORBA::TypeCode::_duplicate ( + Traits::get_typecode (this->content_type_)); +} + +#endif /* TAO_ALIAS_TYPECODE_CPP */ diff --git a/TAO/tao/AnyTypeCode/Alias_TypeCode.h b/TAO/tao/AnyTypeCode/Alias_TypeCode.h new file mode 100644 index 00000000000..e0d5dd2d06a --- /dev/null +++ b/TAO/tao/AnyTypeCode/Alias_TypeCode.h @@ -0,0 +1,141 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Alias_TypeCode.h + * + * $Id$ + * + * Header file for a @c tk_alias and @c tk_value_box + * @c CORBA::TypeCode. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_ALIAS_TYPECODE_H +#define TAO_ALIAS_TYPECODE_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/TypeCodeFactory_Adapter.h" +#include "tao/AnyTypeCode/TypeCode_Base_Attributes.h" + + +namespace TAO +{ + namespace TypeCode + { + /** + * @class Alias + * + * @brief @c CORBA::TypeCode implementation for an OMG IDL + * @c typedef. + * + * This class implements a @c CORBA::TypeCode for an OMG IDL + * @c typedef. + */ + template + class Alias + : public CORBA::TypeCode, + private RefCountPolicy + { + public: + + /// Constructor. + Alias (CORBA::TCKind kind, + char const * id, + char const * name, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + // Borland C++ currently can't handle a reference to + // const pointer to const CORBA::TypeCode_ptr + TypeCodeType tc); +#else + TypeCodeType const & tc); +#endif + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c tk_alias and @c tk_value_box @c CORBA::TypeCode -specific + * template methods. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * name_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::TypeCode_ptr content_type_i (ACE_ENV_SINGLE_ARG_DECL) const; + + private: + + /// Base attributes for this @c TypeCode containing the + /// repository ID and name of the @c typedef. + Base_Attributes attributes_; + + /// The @c TypeCode corresponding to the original type upon + /// which the IDL @c typedef was made. + /** + * A pointer to the @c CORBA::TypeCode_ptr rather than the + * @c CORBA::TypeCode_ptr itself is stored since that address is + * well-defined. We may not know the value of the @c + * CORBA::TypeCode_ptr when creating this @c Field statically at + * compile-time, hence the indirection. + * + * @note This @c TypeCode is released upon destruction of this + * @c TypeCode::Alias. + */ + TypeCodeType const content_type_; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/Alias_TypeCode.inl" +#endif /* __ACE_INLINE__ */ + +#ifdef ACE_TEMPLATES_REQUIRE_SOURCE +# include "tao/AnyTypeCode/Alias_TypeCode.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA +# pragma implementation ("Alias_TypeCode.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* TAO_ALIAS_TYPECODE_H */ diff --git a/TAO/tao/AnyTypeCode/Alias_TypeCode.inl b/TAO/tao/AnyTypeCode/Alias_TypeCode.inl new file mode 100644 index 00000000000..fb692130538 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Alias_TypeCode.inl @@ -0,0 +1,28 @@ +// -*- C++ -*- +// +// $Id$ + + +template +ACE_INLINE +TAO::TypeCode::Alias::Alias ( + CORBA::TCKind kind, + char const * id, + char const * name, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + // Borland C++ currently can't handle a reference to + // const pointer to const CORBA::TypeCode_ptr + TypeCodeType tc) +#else + TypeCodeType const & tc) +#endif + : CORBA::TypeCode (kind) + , RefCountPolicy () + , attributes_ (id, name) + , content_type_ (tc) +{ +} diff --git a/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp b/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp new file mode 100644 index 00000000000..bad91cccc89 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.cpp @@ -0,0 +1,175 @@ +// $Id$ + +#include "Alias_TypeCode_Static.h" + +#ifndef __ACE_INLINE__ +# include "Alias_TypeCode_Static.inl" +#endif /* !__ACE_INLINE__ */ + +#include "TypeCode_Traits.h" + +#include "tao/ORB_Core.h" +#include "tao/CDR.h" +#include "tao/TypeCodeFactory_Adapter.h" + +#include "ace/Dynamic_Service.h" + + +ACE_RCSID (tao, + Alias_TypeCode_Static, + "$Id$") + + +bool +TAO::TypeCode::Alias::tao_marshal ( + TAO_OutputCDR & cdr, + CORBA::ULong offset) const +{ + // A tk_alias TypeCode has a "complex" parameter list type (see + // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of + // the CORBA specification), meaning that it must be marshaled into + // a CDR encapsulation. + + // Create a CDR encapsulation. + + TAO_OutputCDR enc; + + // Account for the encoded CDR encapsulation length and byte order. + // + // Aligning on an octet since the next value after the CDR + // encapsulation length will always be the byte order octet/boolean + // in this case. + offset = ACE_align_binary (offset + 4, + ACE_CDR::OCTET_ALIGN); + + return + enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER) + && enc << TAO_OutputCDR::from_string (this->attributes_.id (), 0) + && enc << TAO_OutputCDR::from_string (this->attributes_.name (), 0) + && marshal (enc, + Traits::get_typecode (this->content_type_), + offset + enc.total_length ()) + && cdr << static_cast (enc.total_length ()) + && cdr.write_octet_array_mb (enc.begin ()); +} + +void +TAO::TypeCode::Alias::tao_duplicate (void) +{ +} + +void +TAO::TypeCode::Alias::tao_release (void) +{ +} + +CORBA::Boolean +TAO::TypeCode::Alias::equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // The CORBA::TypeCode base class already verified equality of the + // base attributes (id and name). Perform an equality comparison of + // the content. + + CORBA::TypeCode_var rhs_content_type = + tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return + Traits::get_typecode (this->content_type_)->equal ( + rhs_content_type.in () + ACE_ENV_ARG_PARAMETER); +} + +CORBA::Boolean +TAO::TypeCode::Alias::equivalent_i ( + CORBA::TypeCode_ptr + ACE_ENV_ARG_DECL_NOT_USED) const +{ + // Equivalence already verified in the base class + // CORBA::TypeCode::equivalent() method. + + return true; +} + +CORBA::TypeCode_ptr +TAO::TypeCode::Alias::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const +{ + TAO_TypeCodeFactory_Adapter * const adapter = + ACE_Dynamic_Service::instance ( + TAO_ORB_Core::typecodefactory_adapter_name () + ); + + if (adapter == 0) + { + ACE_THROW_RETURN (CORBA::INITIALIZE (), + CORBA::TypeCode::_nil ()); + } + + CORBA::TypeCode_var compact_content_type = + Traits::get_typecode ( + this->content_type_)->get_compact_typecode ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); + + if (this->kind_ == CORBA::tk_alias) + { + return adapter->create_alias_tc (this->attributes_.id (), + "", /* empty name */ + compact_content_type.in () + ACE_ENV_ARG_PARAMETER); + } + else + { + return adapter->create_value_box_tc (this->attributes_.id (), + "", /* empty name */ + compact_content_type.in () + ACE_ENV_ARG_PARAMETER); + } +} + +char const * +TAO::TypeCode::Alias::id_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->attributes_.id (); +} + +char const * +TAO::TypeCode::Alias::name_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->attributes_.name (); +} + +CORBA::TypeCode_ptr +TAO::TypeCode::Alias::content_type_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return + CORBA::TypeCode::_duplicate ( + Traits::get_typecode (this->content_type_)); +} diff --git a/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.h b/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.h new file mode 100644 index 00000000000..9b94432b9ff --- /dev/null +++ b/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.h @@ -0,0 +1,131 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Alias_TypeCode_Static.h + * + * $Id$ + * + * Header file for a static @c tk_alias and @c tk_value_box + * @c CORBA::TypeCode. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_ALIAS_TYPECODE_STATIC_H +#define TAO_ALIAS_TYPECODE_STATIC_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TypeCode_Base_Attributes.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" + + +namespace TAO +{ + namespace TypeCode + { + template class Alias; + + /** + * @class Alias + * + * @brief @c CORBA::TypeCode implementation for an OMG IDL + * @c typedef. + * + * This class implements a @c CORBA::TypeCode for an OMG IDL + * @c typedef. + */ + template<> + class TAO_AnyTypeCode_Export Alias + : public CORBA::TypeCode, + private TAO::Null_RefCount_Policy + { + public: + + /// Constructor. + Alias (CORBA::TCKind kind, + char const * id, + char const * name, + CORBA::TypeCode_ptr const * tc); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c tk_alias and @c tk_value_box @c CORBA::TypeCode -specific + * template methods. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * name_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::TypeCode_ptr content_type_i (ACE_ENV_SINGLE_ARG_DECL) const; + + private: + + /// Base attributes for this @c TypeCode containing the + /// repository ID and name of the @c typedef. + Base_Attributes attributes_; + + /// The @c TypeCode corresponding to the original type upon + /// which the IDL @c typedef was made. + /** + * A pointer to the @c CORBA::TypeCode_ptr rather than the + * @c CORBA::TypeCode_ptr itself is stored since that address is + * well-defined. We may not know the value of the @c + * CORBA::TypeCode_ptr when creating this @c Field statically at + * compile-time, hence the indirection. + * + * @note This @c TypeCode is released upon destruction of this + * @c TypeCode::Alias. + */ + CORBA::TypeCode_ptr const * content_type_; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/Alias_TypeCode_Static.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* TAO_ALIAS_TYPECODE_STATIC_H */ diff --git a/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.inl b/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.inl new file mode 100644 index 00000000000..a2665f5e461 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Alias_TypeCode_Static.inl @@ -0,0 +1,18 @@ +// -*- C++ -*- +// +// $Id$ + +ACE_INLINE +TAO::TypeCode::Alias::Alias ( + CORBA::TCKind kind, + char const * id, + char const * name, + CORBA::TypeCode_ptr const * tc) + : CORBA::TypeCode (kind) + , ACE_NESTED_CLASS (TAO, Null_RefCount_Policy) () + , attributes_ (id, name) + , content_type_ (tc) +{ +} diff --git a/TAO/tao/AnyTypeCode/Any.cpp b/TAO/tao/AnyTypeCode/Any.cpp new file mode 100644 index 00000000000..ed5f9a7715e --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any.cpp @@ -0,0 +1,770 @@ +// $Id$ + +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Basic_Impl.h" +#include "tao/AnyTypeCode/Any_Impl_T.h" +#include "tao/AnyTypeCode/Any_Special_Impl_T.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" +#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" +#include "tao/Object.h" +#include "tao/AnyTypeCode/TypeCode.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/SystemException.h" +#include "tao/CDR.h" + +#include "ace/Log_Msg.h" +#include "ace/OS_NS_string.h" +#include "ace/OS_NS_wchar.h" +#include "ace/OS_Memory.h" + +#if !defined (__ACE_INLINE__) +# include "tao/AnyTypeCode/Any.inl" +#endif /* ! __ACE_INLINE__ */ + +ACE_RCSID (tao, + Any, + "$Id$") + +using namespace TAO; + +CORBA::Any::Any (void) + : impl_ (0) +{ +} + +CORBA::Any::Any (const CORBA::Any &rhs) + : impl_ (rhs.impl_) +{ + if (this->impl_ != 0) + { + this->impl_->_add_ref (); + } +} + +CORBA::Any::~Any (void) +{ + if (this->impl_ != 0) + { + this->impl_->_remove_ref (); + } +} + +CORBA::Any & +CORBA::Any::operator= (const CORBA::Any &rhs) +{ + if (this->impl_ != rhs.impl_) + { + if (this->impl_ != 0) + { + this->impl_->_remove_ref (); + } + + this->impl_ = rhs.impl_; + + if (this->impl_ != 0) + { + this->impl_->_add_ref (); + } + } + + return *this; +} + +void +CORBA::Any::replace (TAO::Any_Impl *new_impl) +{ + ACE_ASSERT (new_impl != 0); + + if (this->impl_ != 0) + { + this->impl_->_remove_ref (); + } + + this->impl_ = new_impl; +} + +CORBA::TypeCode_ptr +CORBA::Any::type (void) const +{ + if (this->impl_ != 0) + { + return this->impl_->type (); + } + + return CORBA::TypeCode::_duplicate (CORBA::_tc_null); +} + +CORBA::TypeCode_ptr +CORBA::Any::_tao_get_typecode (void) const +{ + if (this->impl_ != 0) + { + return this->impl_->_tao_get_typecode (); + } + + return CORBA::_tc_null; +} + +void +CORBA::Any::_tao_set_typecode (const CORBA::TypeCode_ptr tc) +{ + if (this->impl_ == 0) + { + ACE_NEW (this->impl_, + TAO::Unknown_IDL_Type (tc)); + } + else + { + this->impl_->type (tc); + } +} + +int +CORBA::Any::_tao_byte_order (void) const +{ + if (this->impl_ != 0) + { + return this->impl_->_tao_byte_order (); + } + + return TAO_ENCAP_BYTE_ORDER; +} + +void +CORBA::Any::type (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) +{ + CORBA::Boolean equiv = 0; + + if (this->impl_ != 0) + { + equiv = + this->impl_->_tao_get_typecode ()->equivalent (tc + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + + if (equiv) + { + this->impl_->type (tc); + } + else + { + ACE_THROW (CORBA::BAD_TYPECODE ()); + } +} + +void +CORBA::Any::_tao_any_destructor (void *x) +{ + CORBA::Any *tmp = static_cast (x); + delete tmp; +} + +CORBA::Any::to_object::to_object (CORBA::Object_out obj) + : ref_ (obj.ptr ()) +{ +} + +CORBA::Any::to_abstract_base::to_abstract_base (CORBA::AbstractBase_ptr &obj) + : ref_ (obj) +{ +} + +CORBA::Any::to_value::to_value (CORBA::ValueBase *& obj) + : ref_ (obj) +{ +} + +CORBA::Boolean +CORBA::Any::checked_to_object (CORBA::Object_ptr &_tao_elem) const +{ + if (this->impl_ == 0) + { + return 0; + } + + return this->impl_->to_object (_tao_elem); +} + +CORBA::Boolean +CORBA::Any::checked_to_value (CORBA::ValueBase *&_tao_elem) const +{ + if (this->impl_ == 0) + { + return 0; + } + + return this->impl_->to_value (_tao_elem); +} + +CORBA::Boolean +CORBA::Any::checked_to_abstract_base ( + CORBA::AbstractBase_ptr &_tao_elem + ) const +{ + if (this->impl_ == 0) + { + return 0; + } + + return this->impl_->to_abstract_base (_tao_elem); +} + +// **************************************************************** + +CORBA::Any_var::Any_var (const CORBA::Any_var &r) + : ptr_ (0) +{ + if (r.ptr_ != 0) + { + ACE_NEW (this->ptr_, + CORBA::Any (*r.ptr_)); + } +} + +CORBA::Any_var & +CORBA::Any_var::operator= (CORBA::Any *p) +{ + if (this->ptr_ != p) + { + delete this->ptr_; + this->ptr_ = p; + } + + return *this; +} + +CORBA::Any_var & +CORBA::Any_var::operator= (const CORBA::Any_var &r) +{ + delete this->ptr_; + this->ptr_ = 0; + + if (r.ptr_ != 0) + { + ACE_NEW_RETURN (this->ptr_, + CORBA::Any (*r.ptr_), + *this); + } + + return *this; +} + +// *********************************************************************** + +CORBA::Boolean +operator<< (TAO_OutputCDR &cdr, const CORBA::Any &any) +{ + TAO::Any_Impl *impl = any.impl (); + + if (impl != 0) + { + return impl->marshal (cdr); + } + + return (cdr << CORBA::_tc_null); +} + +CORBA::Boolean +operator>> (TAO_InputCDR &cdr, CORBA::Any &any) +{ + CORBA::TypeCode_var tc; + + if ((cdr >> tc.out ()) == 0) + { + return 0; + } + + ACE_TRY_NEW_ENV + { + TAO::Unknown_IDL_Type *impl = 0; + ACE_NEW_RETURN (impl, + TAO::Unknown_IDL_Type (tc.in ()), + 0); + + any.replace (impl); + impl->_tao_decode (cdr + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCH (CORBA::Exception, ex) + { + return 0; + } + ACE_ENDTRY; + + return 1; +} + +// ======================================================================= + +// Insertion of the special basic types. + +void +CORBA::Any::operator<<= (CORBA::Any::from_boolean b) +{ + TAO::Any_Basic_Impl::insert (*this, + CORBA::_tc_boolean, + &b.val_); +} + +void +CORBA::Any::operator<<= (CORBA::Any::from_octet o) +{ + TAO::Any_Basic_Impl::insert (*this, + CORBA::_tc_octet, + &o.val_); +} + +void +CORBA::Any::operator<<= (CORBA::Any::from_char c) +{ + TAO::Any_Basic_Impl::insert (*this, + CORBA::_tc_char, + &c.val_); +} + +void +CORBA::Any::operator<<= (CORBA::Any::from_wchar wc) +{ + TAO::Any_Basic_Impl::insert (*this, + CORBA::_tc_wchar, + &wc.val_); +} + +void +CORBA::Any::operator<<= (CORBA::Any::from_string s) +{ + if (s.bound_ > 0 && s.val_ != 0 && ACE_OS::strlen (s.val_) > s.bound_) + { + return; + } + + TAO::Any_Special_Impl_T< + char, + CORBA::Any::from_string, + CORBA::Any::to_string + >::insert (*this, + TAO::Any_Impl::_tao_any_string_destructor, + CORBA::_tc_string, + s.nocopy_ ? s.val_ : CORBA::string_dup (s.val_), + s.bound_); +} + +void +CORBA::Any::operator<<= (CORBA::Any::from_wstring ws) +{ + if (ws.bound_ > 0 && ws.val_ != 0 && ACE_OS::wslen (ws.val_) > ws.bound_) + { + return; + } + + TAO::Any_Special_Impl_T< + CORBA::WChar, + CORBA::Any::from_wstring, + CORBA::Any::to_wstring + >::insert (*this, + TAO::Any_Impl::_tao_any_wstring_destructor, + CORBA::_tc_wstring, + ws.nocopy_ ? ws.val_ : CORBA::wstring_dup (ws.val_), + ws.bound_); +} + +// Insertion of the other basic types. + +void +operator<<= (CORBA::Any &any, CORBA::Short s) +{ + TAO::Any_Basic_Impl::insert (any, + CORBA::_tc_short, + &s); +} + +void +operator<<= (CORBA::Any &any, CORBA::UShort us) +{ + TAO::Any_Basic_Impl::insert (any, + CORBA::_tc_ushort, + &us); +} + +void +operator<<= (CORBA::Any &any, CORBA::Long l) +{ + TAO::Any_Basic_Impl::insert (any, + CORBA::_tc_long, + &l); +} + +void +operator<<= (CORBA::Any &any, CORBA::ULong ul) +{ + TAO::Any_Basic_Impl::insert (any, + CORBA::_tc_ulong, + &ul); +} + +void +operator<<= (CORBA::Any &any, CORBA::LongLong ll) +{ + TAO::Any_Basic_Impl::insert (any, + CORBA::_tc_longlong, + &ll); +} + +void +operator<<= (CORBA::Any &any, CORBA::ULongLong ull) +{ + TAO::Any_Basic_Impl::insert (any, + CORBA::_tc_ulonglong, + &ull); +} + +void +operator<<= (CORBA::Any &any, CORBA::Float f) +{ + TAO::Any_Basic_Impl::insert (any, + CORBA::_tc_float, + &f); +} + +void +operator<<= (CORBA::Any &any, CORBA::Double d) +{ + TAO::Any_Basic_Impl::insert (any, + CORBA::_tc_double, + &d); +} + +void +operator<<= (CORBA::Any &any, CORBA::LongDouble ld) +{ + TAO::Any_Basic_Impl::insert (any, + CORBA::_tc_longdouble, + &ld); +} + +// Insertion of Any - copying. +void +operator<<= (CORBA::Any &any, const CORBA::Any &a) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + any, + CORBA::Any::_tao_any_destructor, + CORBA::_tc_any, + a + ); +} + +// Insertion of Any - non-copying. +void +operator<<= (CORBA::Any &any, CORBA::Any *a) +{ + TAO::Any_Dual_Impl_T::insert (any, + CORBA::Any::_tao_any_destructor, + CORBA::_tc_any, + a); +} + +// Insertion of TypeCode - copying. +void +operator<<= (CORBA::Any &any, CORBA::TypeCode_ptr tc) +{ + CORBA::TypeCode_ptr dup = CORBA::TypeCode::_duplicate (tc); + any <<= &dup; +} + +// Insertion of TypeCode - non-copying. +void +operator<<= (CORBA::Any &any, CORBA::TypeCode_ptr * tc) +{ + TAO::Any_Impl_T::insert ( + any, + CORBA::TypeCode::_tao_any_destructor, + CORBA::_tc_TypeCode, + *tc + ); +} + +// Insertion of CORBA object - copying. +void +operator<<= (CORBA::Any &any, const CORBA::Object_ptr obj) +{ + CORBA::Object_ptr dup = CORBA::Object::_duplicate (obj); + any <<= &dup; +} + +// Insertion of CORBA object - non-copying. +void +operator<<= (CORBA::Any &any, CORBA::Object_ptr *objptr) +{ + TAO::Any_Impl_T::insert (any, + CORBA::Object::_tao_any_destructor, + CORBA::_tc_Object, + *objptr); +} + +// These are copying versions for unbounded (w)strings. They are not inlined, +// to avoid use in Any.i before definition in ORB.i. + +void +operator<<= (CORBA::Any &any, const char *s) +{ + TAO::Any_Special_Impl_T< + char, + CORBA::Any::from_string, + CORBA::Any::to_string + >::insert (any, + TAO::Any_Impl::_tao_any_string_destructor, + CORBA::_tc_string, + CORBA::string_dup (s), + 0); +} + +void +operator<<= (CORBA::Any &any, const CORBA::WChar *ws) +{ + TAO::Any_Special_Impl_T< + CORBA::WChar, + CORBA::Any::from_wstring, + CORBA::Any::to_wstring + >::insert (any, + TAO::Any_Impl::_tao_any_wstring_destructor, + CORBA::_tc_wstring, + CORBA::wstring_dup (ws), + 0); +} + +// Extraction: these are safe and hence we have to check that the +// typecode of the Any is equal to the one we are trying to extract +// into. + +// Extraction into the special basic types. + +CORBA::Boolean +CORBA::Any::operator>>= (CORBA::Any::to_boolean b) const +{ + return TAO::Any_Basic_Impl::extract (*this, + CORBA::_tc_boolean, + &b.ref_); +} + +CORBA::Boolean +CORBA::Any::operator>>= (CORBA::Any::to_octet o) const +{ + return TAO::Any_Basic_Impl::extract (*this, + CORBA::_tc_octet, + &o.ref_); +} + +CORBA::Boolean +CORBA::Any::operator>>= (CORBA::Any::to_char c) const +{ + return TAO::Any_Basic_Impl::extract (*this, + CORBA::_tc_char, + &c.ref_); +} + +CORBA::Boolean +CORBA::Any::operator>>= (CORBA::Any::to_wchar wc) const +{ + return TAO::Any_Basic_Impl::extract (*this, + CORBA::_tc_wchar, + &wc.ref_); +} + +CORBA::Boolean +CORBA::Any::operator>>= (CORBA::Any::to_string s) const +{ + return + TAO::Any_Special_Impl_T< + char, + CORBA::Any::from_string, + CORBA::Any::to_string + >::extract (*this, + TAO::Any_Impl::_tao_any_string_destructor, + CORBA::_tc_string, + s.val_, + s.bound_); +} + +CORBA::Boolean +CORBA::Any::operator>>= (CORBA::Any::to_wstring ws) const +{ + return + TAO::Any_Special_Impl_T< + CORBA::WChar, + CORBA::Any::from_wstring, + CORBA::Any::to_wstring + >::extract (*this, + TAO::Any_Impl::_tao_any_wstring_destructor, + CORBA::_tc_wstring, + ws.val_, + ws.bound_); +} + +CORBA::Boolean +CORBA::Any::operator>>= (CORBA::Any::to_object obj) const +{ + return this->checked_to_object (obj.ref_); +} + +CORBA::Boolean +CORBA::Any::operator>>= (CORBA::Any::to_abstract_base obj) const +{ + return this->checked_to_abstract_base (obj.ref_); +} + +CORBA::Boolean +CORBA::Any::operator>>= (CORBA::Any::to_value obj) const +{ + return this->checked_to_value (obj.ref_); +} + +// Extraction into the other basic types. + +CORBA::Boolean +operator>>= (const CORBA::Any &any, CORBA::Short &s) +{ + return TAO::Any_Basic_Impl::extract (any, + CORBA::_tc_short, + &s); +} + +CORBA::Boolean +operator>>= (const CORBA::Any &any, CORBA::UShort &us) +{ + return TAO::Any_Basic_Impl::extract (any, + CORBA::_tc_ushort, + &us); +} + +CORBA::Boolean +operator>>= (const CORBA::Any &any, CORBA::Long &l) +{ + return TAO::Any_Basic_Impl::extract (any, + CORBA::_tc_long, + &l); +} + +CORBA::Boolean +operator>>= (const CORBA::Any &any, CORBA::ULong &ul) +{ + return TAO::Any_Basic_Impl::extract (any, + CORBA::_tc_ulong, + &ul); +} + +CORBA::Boolean +operator>>= (const CORBA::Any &any, CORBA::LongLong &ll) +{ + return + TAO::Any_Basic_Impl::extract (any, + CORBA::_tc_longlong, + &ll); +} + +CORBA::Boolean +operator>>= (const CORBA::Any &any, CORBA::ULongLong &ull) +{ + return + TAO::Any_Basic_Impl::extract (any, + CORBA::_tc_ulonglong, + &ull); +} + +CORBA::Boolean +operator>>= (const CORBA::Any &any, CORBA::Float &f) +{ + return TAO::Any_Basic_Impl::extract (any, + CORBA::_tc_float, + &f); +} + +CORBA::Boolean +operator>>= (const CORBA::Any &any, CORBA::Double &d) +{ + return TAO::Any_Basic_Impl::extract (any, + CORBA::_tc_double, + &d); +} + +CORBA::Boolean +operator>>= (const CORBA::Any &any, CORBA::LongDouble &ld) +{ + return + TAO::Any_Basic_Impl::extract (any, + CORBA::_tc_longdouble, + &ld); +} + +CORBA::Boolean +operator>>= (const CORBA::Any &any, const CORBA::Any *&a) +{ + return TAO::Any_Dual_Impl_T::extract ( + any, + CORBA::Any::_tao_any_destructor, + CORBA::_tc_any, + a + ); +} + +CORBA::Boolean +operator>>= (const CORBA::Any &any, const CORBA::Char *&s) +{ + return + TAO::Any_Special_Impl_T< + char, + CORBA::Any::from_string, + CORBA::Any::to_string + >::extract (any, + TAO::Any_Impl::_tao_any_string_destructor, + CORBA::_tc_string, + s, + 0); +} + +CORBA::Boolean +operator>>= (const CORBA::Any &any, const CORBA::WChar *&ws) +{ + return + TAO::Any_Special_Impl_T< + CORBA::WChar, + CORBA::Any::from_wstring, + CORBA::Any::to_wstring + >::extract (any, + TAO::Any_Impl::_tao_any_wstring_destructor, + CORBA::_tc_wstring, + ws, + 0); +} + +CORBA::Boolean +operator>>= (const CORBA::Any &any, CORBA::TypeCode_ptr &tc) +{ + return TAO::Any_Impl_T::extract ( + any, + CORBA::TypeCode::_tao_any_destructor, + CORBA::_tc_TypeCode, + tc + ); +} + +// ================================================================ +// Any_Impl_T template specializations. + +namespace TAO +{ + template<> + CORBA::Boolean + Any_Impl_T::to_object ( + CORBA::Object_ptr &_tao_elem + ) const + { + _tao_elem = CORBA::Object::_duplicate (this->value_); + return 1; + } +} + + diff --git a/TAO/tao/AnyTypeCode/Any.h b/TAO/tao/AnyTypeCode/Any.h new file mode 100644 index 00000000000..2ddfaf2dac1 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any.h @@ -0,0 +1,397 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Any.h + * + * $Id$ + * + * @author Carlos O'Ryan + * @author Jeff Parsons + */ +//============================================================================= + +#ifndef TAO_ANY_H +#define TAO_ANY_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/CORBA_methods.h" +#include "tao/Pseudo_VarOut_T.h" +#include "tao/Arg_Traits_T.h" + +#include "ace/CDR_Stream.h" +#include "ace/CORBA_macros.h" + +namespace TAO +{ + class Any_Impl; +} + +namespace CORBA +{ + class Any; + typedef Any *Any_ptr; + class Any_var; + + class TypeCode; + typedef TypeCode *TypeCode_ptr; + + class Object; + typedef Object *Object_ptr; + typedef TAO_Pseudo_Var_T Object_var; + typedef TAO_Pseudo_Out_T Object_out; + + class AbstractBase; + typedef AbstractBase *AbstractBase_ptr; + + class ValueBase; + class Exception; + + /** + * @class Any + * + * @brief Generic container for IDL types. + * + * This is the top-level class of the Any implementation. It exposes the + * spec-required functionality, but is mostly a wrapper for one of the + * template classes below. + */ + class TAO_AnyTypeCode_Export Any + { + public: + typedef Any_ptr _ptr_type; + typedef Any_var _var_type; + + Any (void); + Any (const Any &); + + ~Any (void); + + Any &operator= (const Any &); + TAO::Any_Impl *impl (void) const; + + /// Used in our destruction if we ourselves are stored in an Any. + static void _tao_any_destructor (void *); + + /// These are needed for insertion and extraction of booleans, + /// octets, chars, and bounded strings. CORBA spec requires + /// that they be here, we just typedef to the already-defined + /// ACE_OutputCDR types. + + typedef ACE_OutputCDR::from_boolean from_boolean; + typedef ACE_OutputCDR::from_octet from_octet; + typedef ACE_OutputCDR::from_char from_char; + typedef ACE_OutputCDR::from_wchar from_wchar; + typedef ACE_OutputCDR::from_string from_string; + typedef ACE_OutputCDR::from_wstring from_wstring; + + /// Insertion of the special types. + + void operator<<= (from_boolean); + void operator<<= (from_char); + void operator<<= (from_wchar); + void operator<<= (from_octet); + void operator<<= (from_string); + void operator<<= (from_wstring); + + /// These extract octets, chars, booleans, bounded strings, and + /// object references. All these are defined in ACE_InputCDR. + + typedef ACE_InputCDR::to_boolean to_boolean; + typedef ACE_InputCDR::to_char to_char; + typedef ACE_InputCDR::to_wchar to_wchar; + typedef ACE_InputCDR::to_octet to_octet; + typedef ACE_InputCDR::to_string to_string; + typedef ACE_InputCDR::to_wstring to_wstring; + + /// These are not in ACE. + + struct TAO_AnyTypeCode_Export to_object + { + // This signature reflects the change set out in + // issue 154 of the 1.3 RTF. + explicit to_object (Object_out obj); + Object_ptr &ref_; + }; + + struct TAO_AnyTypeCode_Export to_abstract_base + { + explicit to_abstract_base (AbstractBase_ptr &obj); + AbstractBase_ptr &ref_; + }; + + struct TAO_AnyTypeCode_Export to_value + { + explicit to_value (ValueBase *&base); + ValueBase *&ref_; + }; + + /// Extraction of the special types. + + Boolean operator>>= (to_boolean) const; + Boolean operator>>= (to_octet) const; + Boolean operator>>= (to_char) const; + Boolean operator>>= (to_wchar) const; + Boolean operator>>= (to_string) const; + Boolean operator>>= (to_wstring) const; + Boolean operator>>= (to_object) const; + Boolean operator>>= (to_abstract_base) const; + Boolean operator>>= (to_value) const; + + /// TAO-specific signature. + void replace (TAO::Any_Impl *); + + /// Return TypeCode of the element stored in the Any. + TypeCode_ptr type (void) const; + + /// For use along with <<= of a value of aliased type when the alias must + /// be preserved. + void type (TypeCode_ptr + ACE_ENV_ARG_DECL); + + /// TAO extension, does not return a duplicate. + CORBA::TypeCode_ptr _tao_get_typecode (void) const; + + /// TAO extension. + void _tao_set_typecode (const CORBA::TypeCode_ptr); + + int _tao_byte_order (void) const; + + private: + CORBA::Boolean checked_to_object (CORBA::Object_ptr &) const; + CORBA::Boolean checked_to_value (CORBA::ValueBase *&) const; + CORBA::Boolean checked_to_abstract_base (CORBA::AbstractBase_ptr &) const; + + // Unimplemented - hides unsigned char insert/extract. + void operator<<= (unsigned char); + CORBA::Boolean operator>>= (unsigned char&) const; + + private: + TAO::Any_Impl *impl_; + + friend class TAO_Marshal_Any; + }; + + /** + * @class CORBA::Any_var + * + * @brief Provide for automatic storage deallocation on going out of + * scope. + */ + class TAO_AnyTypeCode_Export Any_var + { + public: + Any_var (void); + Any_var (Any *a); + Any_var (const Any_var &); + ~Any_var (void); + + Any_var &operator= (Any *); + + /** + * Assignment from an Any_var + * This operation requires memory allocation. + * If the allocation fails, *this is returned + * unmodified. + */ + Any_var &operator= (const Any_var &); + + /// Arrow operator (smart pointer). + Any *operator-> (void); + + /// Cast. + operator const Any *() const; + + /// Cast. + operator Any *&(); + + /// For in Any parameter. + const Any &in (void) const; + + /// For inout Any parameter. + Any &inout (void); + + /// For out Any parameter. + Any *&out (void); + + /// For Any return type. + Any *_retn (void); + + /// TAO specific extension + Any *ptr (void) const; + private: + /// Holds the Any. + Any *ptr_; + }; + + /** + * @class CORBA::Any_out + * + * @brief CORBA::Any_out + * + * The _out class for CORBA::Any. This is used to help in + * managing the out parameters. + */ + class TAO_AnyTypeCode_Export Any_out + { + public: + Any_out (Any *&); + Any_out (Any_var &); + Any_out (const Any_out &); + + /// Assignment from a Any_out. + Any_out &operator= (const Any_out &s); + + /// Assignment from a Any. + Any_out &operator= (Any *); + + /// Cast. + operator Any *&(); + + /// Return underlying instance. + Any *& ptr (void); + + Any *operator-> (void); + + private: + /// Assignment from _var disallowed. + void operator= (const Any_var &); + + private: + /// Instance. + Any *&ptr_; + }; +} + +TAO_AnyTypeCode_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const CORBA::Any &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>> (TAO_InputCDR &, CORBA::Any &); + +/// Typesafe insertion. + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::Short); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::UShort); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::Long); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::ULong); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::LongLong); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::ULongLong); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::Float); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::Double); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::LongDouble); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::Any &); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::Any *); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const char *); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::WChar *); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::TypeCode_ptr); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::TypeCode_ptr *); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::Object_ptr); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::Object_ptr *); + +/// Typesafe extraction. + +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, + CORBA::Short &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, + CORBA::UShort &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, + CORBA::Long &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, + CORBA::ULong &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, + CORBA::LongLong &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, + CORBA::ULongLong &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, + CORBA::Float &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, + CORBA::Double &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, + CORBA::LongDouble &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, + const CORBA::Any *&); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, + CORBA::TypeCode_ptr &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, + const CORBA::Char *&); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, + const CORBA::WChar *&); + +#if defined (__ACE_INLINE__) +# include "tao/Any.i" +#else + +/// Copying versions of insertion operators for basic types +/// must also be defined for CORBA::Any_var. + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, CORBA::Short); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, CORBA::UShort); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, CORBA::Long); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, CORBA::ULong); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, CORBA::LongLong); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, CORBA::ULongLong); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, CORBA::Float); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, CORBA::Double); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, const CORBA::Any *&); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, const char *); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, CORBA::TypeCode_ptr); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, const CORBA::Object_ptr); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, ACE_OutputCDR::from_boolean); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, CORBA::Any::from_char); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, CORBA::Any::from_wchar); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, CORBA::Any::from_octet); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, CORBA::Any::from_string); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any_var &, CORBA::Any::from_wstring); + +/// These are not required by the spec, but will make users +/// of other ORBs that are used to them more comfortable. + +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::Short &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::UShort &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::Long &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::ULong &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::LongLong &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::ULongLong &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::Float &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::Double &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::Any &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::TypeCode_ptr &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + const char *&); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + const CORBA::WChar *&); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::Any::to_boolean); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::Any::to_octet); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::Any::to_char); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::Any::to_wchar); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::Any::to_string); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::Any::to_wstring); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any_var &, + CORBA::Any::to_object); + +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* TAO_ANY_H */ diff --git a/TAO/tao/AnyTypeCode/Any.inl b/TAO/tao/AnyTypeCode/Any.inl new file mode 100644 index 00000000000..281074ede88 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any.inl @@ -0,0 +1,368 @@ +// -*- C++ -*- +// +// $Id$ + +ACE_INLINE TAO::Any_Impl * +CORBA::Any::impl (void) const +{ + return this->impl_; +} + +// ************************************************************* +// Inline operations for class CORBA::Any_var +// ************************************************************* + +ACE_INLINE +CORBA::Any_var::Any_var (void) + : ptr_ (0) +{ +} + +ACE_INLINE +CORBA::Any_var::Any_var (CORBA::Any *p) + : ptr_ (p) +{ +} + +ACE_INLINE +CORBA::Any_var::~Any_var (void) +{ + delete this->ptr_; +} + +ACE_INLINE +CORBA::Any_var::operator CORBA::Any *&() +{ + return this->ptr_; +} + +ACE_INLINE +CORBA::Any_var::operator const CORBA::Any *() const +{ + return this->ptr_; +} + +ACE_INLINE CORBA::Any * +CORBA::Any_var::operator-> (void) +{ + return this->ptr_; +} + +ACE_INLINE const CORBA::Any & +CORBA::Any_var::in (void) const +{ + return *this->ptr_; +} + +ACE_INLINE CORBA::Any & +CORBA::Any_var::inout (void) +{ + return *this->ptr_; +} + +ACE_INLINE CORBA::Any *& +CORBA::Any_var::out (void) +{ + delete this->ptr_; + this->ptr_ = 0; + return this->ptr_; +} + +ACE_INLINE CORBA::Any * +CORBA::Any_var::_retn (void) +{ + CORBA::Any *temp = this->ptr_; + this->ptr_ = 0; + return temp; +} + +ACE_INLINE CORBA::Any * +CORBA::Any_var::ptr (void) const +{ + return this->ptr_; +} + +// ************************************************************* +// CORBA::Any_var insertion operators +// ************************************************************* + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, CORBA::Short rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, CORBA::UShort rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, CORBA::Long rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, CORBA::ULong rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, CORBA::LongLong rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, CORBA::ULongLong rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, CORBA::Float rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, CORBA::Double rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, const CORBA::Any& rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, const char* rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, CORBA::TypeCode_ptr rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, const CORBA::Object_ptr rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, ACE_OutputCDR::from_boolean rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, CORBA::Any::from_char rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, CORBA::Any::from_wchar rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, CORBA::Any::from_octet rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, CORBA::Any::from_string rhs) +{ + lhs.inout () <<= rhs; +} + +ACE_INLINE void +operator <<= (CORBA::Any_var &lhs, CORBA::Any::from_wstring rhs) +{ + lhs.inout () <<= rhs; +} + +// ************************************************************* +// CORBA::Any_var extraction operators +// ************************************************************* + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::Short &rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::UShort &rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::Long &rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::ULong &rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::LongLong &rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::ULongLong &rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::Float &rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::Double &rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, const CORBA::Any *&rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::TypeCode_ptr &rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, const char *&rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, const CORBA::WChar *&rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::Any::to_boolean rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::Any::to_octet rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::Any::to_char rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::Any::to_wchar rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::Any::to_string rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::Any::to_wstring rhs) +{ + return lhs.in () >>= rhs; +} + +ACE_INLINE CORBA::Boolean +operator >>= (const CORBA::Any_var &lhs, CORBA::Any::to_object rhs) +{ + return lhs.in () >>= rhs; +} + +// ************************************************************* +// Inline operations for class CORBA::Any_out +// ************************************************************* + +ACE_INLINE +CORBA::Any_out::Any_out (CORBA::Any *&s) + : ptr_ (s) +{ + this->ptr_ = 0; +} + +ACE_INLINE +CORBA::Any_out::Any_out (CORBA::Any_var &s) + : ptr_ (s.out ()) +{ +} + +ACE_INLINE +CORBA::Any_out::Any_out (const CORBA::Any_out &s) + : ptr_ (s.ptr_) +{ +} + +ACE_INLINE CORBA::Any_out & +CORBA::Any_out::operator= (const CORBA::Any_out &s) +{ + this->ptr_ = s.ptr_; + return *this; +} + +ACE_INLINE CORBA::Any_out & +CORBA::Any_out::operator= (CORBA::Any *s) +{ + this->ptr_ = s; + return *this; +} + +ACE_INLINE +CORBA::Any_out::operator CORBA::Any *&() +{ + return this->ptr_; +} + +ACE_INLINE CORBA::Any *& +CORBA::Any_out::ptr (void) +{ + return this->ptr_; +} + +ACE_INLINE CORBA::Any * +CORBA::Any_out::operator-> (void) +{ + return this->ptr_; +} diff --git a/TAO/tao/AnyTypeCode/AnySeq.pidl b/TAO/tao/AnyTypeCode/AnySeq.pidl new file mode 100644 index 00000000000..fb3a570b657 --- /dev/null +++ b/TAO/tao/AnyTypeCode/AnySeq.pidl @@ -0,0 +1,31 @@ +// -*- IDL -*- +// +// $Id$ + +// ================================================================ +/** + * This file was used to generate the code in AnySeq*.* + * The command used to generate code is: + * + * tao_idl + * -o orig -Ge 1 -Sc -GA -SS -Sci + * -Wb,export_macro=TAO_Export + * -Wb,export_include="tao/TAO_Export.h" + * -Wb,pre_include="ace/pre.h" + * -Wb,post_include="ace/post.h" + * AnySeq.pidl + * + */ +// ================================================================ + +#ifndef TAO_CORBA_ANY_SEQ_IDL +#define TAO_CORBA_ANY_SEQ_IDL + +#pragma prefix "omg.org" + +module CORBA +{ + typedef sequence AnySeq; +}; + +#endif /* TAO_CORBA_ANY_SEQ_IDL */ diff --git a/TAO/tao/AnyTypeCode/AnySeqA.cpp b/TAO/tao/AnyTypeCode/AnySeqA.cpp new file mode 100644 index 00000000000..4b87880c61f --- /dev/null +++ b/TAO/tao/AnyTypeCode/AnySeqA.cpp @@ -0,0 +1,142 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "AnySeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_AnySeq_GUARD +#define _TAO_TYPECODE_CORBA_AnySeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_AnySeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_any, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_AnySeq_0 = + &CORBA_AnySeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_AnySeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_AnySeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/AnySeq:1.0", + "AnySeq", + &TAO::TypeCode::tc_CORBA_AnySeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_AnySeq = + &_tao_tc_CORBA_AnySeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::AnySeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::AnySeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_AnySeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::AnySeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::AnySeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_AnySeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::AnySeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::AnySeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::AnySeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::AnySeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_AnySeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/AnySeqA.h b/TAO/tao/AnyTypeCode/AnySeqA.h new file mode 100644 index 00000000000..16f1b2288f1 --- /dev/null +++ b/TAO/tao/AnyTypeCode/AnySeqA.h @@ -0,0 +1,106 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_ANYSEQA_H_ +#define _TAO_IDL_ORIG_ANYSEQA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/AnyTypeCode/AnySeqC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_AnySeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::AnySeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::AnySeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::AnySeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::AnySeq *&); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/AnySeqC.cpp b/TAO/tao/AnyTypeCode/AnySeqC.cpp new file mode 100644 index 00000000000..f04c69e6e47 --- /dev/null +++ b/TAO/tao/AnyTypeCode/AnySeqC.cpp @@ -0,0 +1,171 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:291 + + +#include "AnySeqC.h" +#include "tao/CDR.h" + +#if defined (__BORLANDC__) +#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_arg_traits.cpp:70 + +// Arg traits specializations. +namespace TAO +{ +} + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/sequence_cs.cpp:65 + +#if !defined (_CORBA_ANYSEQ_CS_) +#define _CORBA_ANYSEQ_CS_ + +CORBA::AnySeq::AnySeq (void) +{} + +CORBA::AnySeq::AnySeq ( + CORBA::ULong max + ) + : TAO_Unbounded_Sequence< + CORBA::Any + > + (max) +{} + +CORBA::AnySeq::AnySeq ( + CORBA::ULong max, + CORBA::ULong length, + CORBA::Any * buffer, + CORBA::Boolean release + ) + : TAO_Unbounded_Sequence< + CORBA::Any + > + (max, length, buffer, release) +{} + +CORBA::AnySeq::AnySeq ( + const AnySeq &seq + ) + : TAO_Unbounded_Sequence< + CORBA::Any + > + (seq) +{} + +CORBA::AnySeq::~AnySeq (void) +{} + +void CORBA::AnySeq::_tao_any_destructor ( + void * _tao_void_pointer + ) +{ + AnySeq * _tao_tmp_pointer = + static_cast (_tao_void_pointer); + delete _tao_tmp_pointer; +} + +#endif /* end #if !defined */ + +// TAO_IDL - Generated from +// be\be_visitor_sequence/cdr_op_cs.cpp:96 + +#if !defined _TAO_CDR_OP_CORBA_AnySeq_CPP_ +#define _TAO_CDR_OP_CORBA_AnySeq_CPP_ + +CORBA::Boolean operator<< ( + TAO_OutputCDR &strm, + const CORBA::AnySeq &_tao_sequence + ) +{ + const CORBA::ULong _tao_seq_len = _tao_sequence.length (); + + if (strm << _tao_seq_len) + { + // Encode all elements. + CORBA::Boolean _tao_marshal_flag = true; + + for (CORBA::ULong i = 0; i < _tao_seq_len && _tao_marshal_flag; ++i) + { + _tao_marshal_flag = (strm << _tao_sequence[i]); + } + + return _tao_marshal_flag; + } + + return false; +} + +CORBA::Boolean operator>> ( + TAO_InputCDR &strm, + CORBA::AnySeq &_tao_sequence + ) +{ + CORBA::ULong _tao_seq_len; + + if (strm >> _tao_seq_len) + { + // Add a check to the length of the sequence + // to make sure it does not exceed the length + // of the stream. (See bug 58.) + if (_tao_seq_len > strm.length ()) + { + return false; + } + + // Set the length of the sequence. + _tao_sequence.length (_tao_seq_len); + + // If length is 0 we return true. + if (0 >= _tao_seq_len) + { + return true; + } + + // Retrieve all the elements. + CORBA::Boolean _tao_marshal_flag = true; + + for (CORBA::ULong i = 0; i < _tao_seq_len && _tao_marshal_flag; ++i) + { + _tao_marshal_flag = (strm >> _tao_sequence[i]); + } + + return _tao_marshal_flag; + + } + + return false; +} + +#endif /* _TAO_CDR_OP_CORBA_AnySeq_CPP_ */ diff --git a/TAO/tao/AnyTypeCode/AnySeqC.h b/TAO/tao/AnyTypeCode/AnySeqC.h new file mode 100644 index 00000000000..4d51e2253b6 --- /dev/null +++ b/TAO/tao/AnyTypeCode/AnySeqC.h @@ -0,0 +1,179 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_ANYSEQC_H_ +#define _TAO_IDL_ORIG_ANYSEQC_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/ORB.h" +#include "tao/Environment.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/TypeCode.h" +#include "tao/Sequence_T.h" +#include "tao/Seq_Var_T.h" +#include "tao/Seq_Out_T.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_sequence/sequence_ch.cpp:101 + +#if !defined (_CORBA_ANYSEQ_CH_) +#define _CORBA_ANYSEQ_CH_ + + class AnySeq; + + typedef + TAO_VarSeq_Var_T< + AnySeq, + CORBA::Any + > + AnySeq_var; + + typedef + TAO_Seq_Out_T< + AnySeq, + AnySeq_var, + CORBA::Any + > + AnySeq_out; + + class TAO_AnyTypeCode_Export AnySeq + : public + TAO_Unbounded_Sequence< + CORBA::Any + > + { + public: + AnySeq (void); + AnySeq (CORBA::ULong max); + AnySeq ( + CORBA::ULong max, + CORBA::ULong length, + CORBA::Any* buffer, + CORBA::Boolean release = 0 + ); + AnySeq (const AnySeq &); + ~AnySeq (void); + + static void _tao_any_destructor (void *); + + typedef AnySeq_var _var_type; + }; + +#endif /* end #if !defined */ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_AnySeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::AnySeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::AnySeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::AnySeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::AnySeq *&); + +// TAO_IDL - Generated from +// be\be_visitor_sequence/cdr_op_ch.cpp:71 + +#if !defined _TAO_CDR_OP_CORBA_AnySeq_H_ +#define _TAO_CDR_OP_CORBA_AnySeq_H_ + +TAO_AnyTypeCode_Export CORBA::Boolean operator<< ( + TAO_OutputCDR &, + const CORBA::AnySeq & + ); +TAO_AnyTypeCode_Export CORBA::Boolean operator>> ( + TAO_InputCDR &, + CORBA::AnySeq & + ); + +#endif /* _TAO_CDR_OP_CORBA_AnySeq_H_ */ + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/AnySeqS.h b/TAO/tao/AnyTypeCode/AnySeqS.h new file mode 100644 index 00000000000..17b1360599e --- /dev/null +++ b/TAO/tao/AnyTypeCode/AnySeqS.h @@ -0,0 +1,28 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// Skeleton file generation suppressed with command line option -SS diff --git a/TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.cpp b/TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.cpp new file mode 100644 index 00000000000..0e35d292055 --- /dev/null +++ b/TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.cpp @@ -0,0 +1,153 @@ +// @(#) $Id$ + +#include "tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h" +#include "tao/AnyTypeCode/SystemExceptionA.h" +#include "tao/AnyTypeCode/WrongTransactionA.h" +#include "tao/AnyTypeCode/PolicyA.h" +#include "tao/AnyTypeCode/Any.h" + +ACE_RCSID (tao, + TAO_AnyTypeCode_Adapter, + "$Id$") + +#define STANDARD_EXCEPTION_LIST \ + TAO_SYSTEM_EXCEPTION (UNKNOWN) \ + TAO_SYSTEM_EXCEPTION (BAD_PARAM) \ + TAO_SYSTEM_EXCEPTION (NO_MEMORY) \ + TAO_SYSTEM_EXCEPTION (IMP_LIMIT) \ + TAO_SYSTEM_EXCEPTION (COMM_FAILURE) \ + TAO_SYSTEM_EXCEPTION (INV_OBJREF) \ + TAO_SYSTEM_EXCEPTION (OBJECT_NOT_EXIST) \ + TAO_SYSTEM_EXCEPTION (NO_PERMISSION) \ + TAO_SYSTEM_EXCEPTION (INTERNAL) \ + TAO_SYSTEM_EXCEPTION (MARSHAL) \ + TAO_SYSTEM_EXCEPTION (INITIALIZE) \ + TAO_SYSTEM_EXCEPTION (NO_IMPLEMENT) \ + TAO_SYSTEM_EXCEPTION (BAD_TYPECODE) \ + TAO_SYSTEM_EXCEPTION (BAD_OPERATION) \ + TAO_SYSTEM_EXCEPTION (NO_RESOURCES) \ + TAO_SYSTEM_EXCEPTION (NO_RESPONSE) \ + TAO_SYSTEM_EXCEPTION (PERSIST_STORE) \ + TAO_SYSTEM_EXCEPTION (BAD_INV_ORDER) \ + TAO_SYSTEM_EXCEPTION (TRANSIENT) \ + TAO_SYSTEM_EXCEPTION (FREE_MEM) \ + TAO_SYSTEM_EXCEPTION (INV_IDENT) \ + TAO_SYSTEM_EXCEPTION (INV_FLAG) \ + TAO_SYSTEM_EXCEPTION (INTF_REPOS) \ + TAO_SYSTEM_EXCEPTION (BAD_CONTEXT) \ + TAO_SYSTEM_EXCEPTION (OBJ_ADAPTER) \ + TAO_SYSTEM_EXCEPTION (DATA_CONVERSION) \ + TAO_SYSTEM_EXCEPTION (INV_POLICY) \ + TAO_SYSTEM_EXCEPTION (REBIND) \ + TAO_SYSTEM_EXCEPTION (TIMEOUT) \ + TAO_SYSTEM_EXCEPTION (TRANSACTION_UNAVAILABLE) \ + TAO_SYSTEM_EXCEPTION (TRANSACTION_MODE) \ + TAO_SYSTEM_EXCEPTION (TRANSACTION_REQUIRED) \ + TAO_SYSTEM_EXCEPTION (TRANSACTION_ROLLEDBACK) \ + TAO_SYSTEM_EXCEPTION (INVALID_TRANSACTION) \ + TAO_SYSTEM_EXCEPTION (CODESET_INCOMPATIBLE) \ + TAO_SYSTEM_EXCEPTION (BAD_QOS) \ + TAO_SYSTEM_EXCEPTION (INVALID_ACTIVITY) \ + TAO_SYSTEM_EXCEPTION (ACTIVITY_COMPLETED) \ + TAO_SYSTEM_EXCEPTION (ACTIVITY_REQUIRED) \ + TAO_SYSTEM_EXCEPTION (THREAD_CANCELLED) \ + TAO_SYSTEM_EXCEPTION (WrongTransaction) \ + TAO_SYSTEM_EXCEPTION (PolicyError) \ + TAO_SYSTEM_EXCEPTION (InvalidPolicies) + +#define TAO_SYSTEM_EXCEPTION(name) \ +CORBA::TypeCode_ptr \ +TAO_AnyTypeCode_Adapter_Impl::_tao_type_ ## name (void) const \ +{ \ + return CORBA::_tc_ ## name; \ +} + +STANDARD_EXCEPTION_LIST +#undef TAO_SYSTEM_EXCEPTION + +void +TAO_AnyTypeCode_Adapter_Impl::insert_into_any (CORBA::Any * any, CORBA::Char const * mychar) +{ + (*any) <<= mychar; +} + +void +TAO_AnyTypeCode_Adapter_Impl::insert_into_any (CORBA::Any * any, CORBA::WChar const * mywchar) +{ + (*any) <<= mywchar; +} + +void +TAO_AnyTypeCode_Adapter_Impl::insert_into_any (CORBA::Any * any, CORBA::Long value) +{ + (*any) <<= value; +} + +void +TAO_AnyTypeCode_Adapter_Impl::insert_into_any (CORBA::Any * any, CORBA::Short value) +{ + (*any) <<= value; +} + +void +TAO_AnyTypeCode_Adapter_Impl::insert_into_any (CORBA::Any * any, CORBA::Policy_ptr policy) +{ + (*any) <<= policy; +} + +void +TAO_AnyTypeCode_Adapter_Impl::insert_into_any (CORBA::Any * any, CORBA::Policy_ptr * policy) +{ + (*any) <<= policy; +} + +void +TAO_AnyTypeCode_Adapter_Impl::insert_into_any (CORBA::Any * any, CORBA::ULong value) +{ + (*any) <<= value; +} + +void +TAO_AnyTypeCode_Adapter_Impl::insert_into_any (CORBA::Any * any, ACE_OutputCDR::from_wchar value) +{ + (*any) <<= value; +} + +void +TAO_AnyTypeCode_Adapter_Impl::insert_into_any (CORBA::Any * any, ACE_OutputCDR::from_char value) +{ + (*any) <<= value; +} + +void +TAO_AnyTypeCode_Adapter_Impl::insert_into_any (CORBA::Any * any, ACE_OutputCDR::from_octet value) +{ + (*any) <<= value; +} + +void +TAO_AnyTypeCode_Adapter_Impl::insert_into_any (CORBA::Any * any, ACE_OutputCDR::from_boolean value) +{ + (*any) <<= value; +} + +int +TAO_AnyTypeCode_Adapter_Impl::Initializer (void) +{ + return ACE_Service_Config::process_directive ( + ace_svc_desc_TAO_AnyTypeCode_Adapter_Impl + ); +} + + +ACE_STATIC_SVC_DEFINE ( + TAO_AnyTypeCode_Adapter_Impl, + ACE_TEXT ("AnyTypeCode_Adapter"), + ACE_SVC_OBJ_T, + &ACE_SVC_NAME (TAO_AnyTypeCode_Adapter_Impl), + ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, + 0) + +ACE_FACTORY_DEFINE (TAO_AnyTypeCode, TAO_AnyTypeCode_Adapter_Impl) + + diff --git a/TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h b/TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h new file mode 100644 index 00000000000..ccee6c0a090 --- /dev/null +++ b/TAO/tao/AnyTypeCode/AnyTypeCode_Adapter_Impl.h @@ -0,0 +1,119 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file AnyTypeCode_Adapter_Impl.h + * + * $Id$ + * + * @author Johnny Willemsen + */ +//============================================================================= + + +#ifndef TAO_ANYTYPECODE_ADAPTER_IMPL_H +#define TAO_ANYTYPECODE_ADAPTER_IMPL_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode_Adapter.h" +#include "ace/Service_Config.h" + +/** + * @class TAO_AnyTypeCode_Adapter + */ +class TAO_AnyTypeCode_Export TAO_AnyTypeCode_Adapter_Impl + : public TAO_AnyTypeCode_Adapter +{ +public: + // Used to force the initialization of the code. + static int Initializer (void); + +#define ANYTYPECODE__EXCEPTION_LIST \ + TAO_SYSTEM_EXCEPTION (UNKNOWN) \ + TAO_SYSTEM_EXCEPTION (BAD_PARAM) \ + TAO_SYSTEM_EXCEPTION (NO_MEMORY) \ + TAO_SYSTEM_EXCEPTION (IMP_LIMIT) \ + TAO_SYSTEM_EXCEPTION (COMM_FAILURE) \ + TAO_SYSTEM_EXCEPTION (INV_OBJREF) \ + TAO_SYSTEM_EXCEPTION (OBJECT_NOT_EXIST) \ + TAO_SYSTEM_EXCEPTION (NO_PERMISSION) \ + TAO_SYSTEM_EXCEPTION (INTERNAL) \ + TAO_SYSTEM_EXCEPTION (MARSHAL) \ + TAO_SYSTEM_EXCEPTION (INITIALIZE) \ + TAO_SYSTEM_EXCEPTION (NO_IMPLEMENT) \ + TAO_SYSTEM_EXCEPTION (BAD_TYPECODE) \ + TAO_SYSTEM_EXCEPTION (BAD_OPERATION) \ + TAO_SYSTEM_EXCEPTION (NO_RESOURCES) \ + TAO_SYSTEM_EXCEPTION (NO_RESPONSE) \ + TAO_SYSTEM_EXCEPTION (PERSIST_STORE) \ + TAO_SYSTEM_EXCEPTION (BAD_INV_ORDER) \ + TAO_SYSTEM_EXCEPTION (TRANSIENT) \ + TAO_SYSTEM_EXCEPTION (FREE_MEM) \ + TAO_SYSTEM_EXCEPTION (INV_IDENT) \ + TAO_SYSTEM_EXCEPTION (INV_FLAG) \ + TAO_SYSTEM_EXCEPTION (INTF_REPOS) \ + TAO_SYSTEM_EXCEPTION (BAD_CONTEXT) \ + TAO_SYSTEM_EXCEPTION (OBJ_ADAPTER) \ + TAO_SYSTEM_EXCEPTION (DATA_CONVERSION) \ + TAO_SYSTEM_EXCEPTION (INV_POLICY) \ + TAO_SYSTEM_EXCEPTION (REBIND) \ + TAO_SYSTEM_EXCEPTION (TIMEOUT) \ + TAO_SYSTEM_EXCEPTION (TRANSACTION_UNAVAILABLE) \ + TAO_SYSTEM_EXCEPTION (TRANSACTION_MODE) \ + TAO_SYSTEM_EXCEPTION (TRANSACTION_REQUIRED) \ + TAO_SYSTEM_EXCEPTION (TRANSACTION_ROLLEDBACK) \ + TAO_SYSTEM_EXCEPTION (INVALID_TRANSACTION) \ + TAO_SYSTEM_EXCEPTION (CODESET_INCOMPATIBLE) \ + TAO_SYSTEM_EXCEPTION (BAD_QOS) \ + TAO_SYSTEM_EXCEPTION (INVALID_ACTIVITY) \ + TAO_SYSTEM_EXCEPTION (ACTIVITY_COMPLETED) \ + TAO_SYSTEM_EXCEPTION (ACTIVITY_REQUIRED) \ + TAO_SYSTEM_EXCEPTION (THREAD_CANCELLED) \ + TAO_SYSTEM_EXCEPTION (WrongTransaction) \ + TAO_SYSTEM_EXCEPTION (PolicyError) \ + TAO_SYSTEM_EXCEPTION (InvalidPolicies) + +#define TAO_SYSTEM_EXCEPTION(name) \ + virtual CORBA::TypeCode_ptr _tao_type_ ## name (void) const; + +ANYTYPECODE__EXCEPTION_LIST +#undef TAO_SYSTEM_EXCEPTION + + virtual void insert_into_any (CORBA::Any * any, CORBA::Char const * mychar); + + virtual void insert_into_any (CORBA::Any * any, CORBA::WChar const * mywchar); + + virtual void insert_into_any (CORBA::Any * any, CORBA::Long value); + + virtual void insert_into_any (CORBA::Any * any, CORBA::Short value); + + virtual void insert_into_any (CORBA::Any * any, CORBA::Policy_ptr policy); + + virtual void insert_into_any (CORBA::Any * any, CORBA::Policy_ptr * policy); + + virtual void insert_into_any (CORBA::Any * any, CORBA::ULong value); + + virtual void insert_into_any (CORBA::Any * any, ACE_OutputCDR::from_wchar value); + + virtual void insert_into_any (CORBA::Any * any, ACE_OutputCDR::from_char value); + + virtual void insert_into_any (CORBA::Any * any, ACE_OutputCDR::from_octet value); + + virtual void insert_into_any (CORBA::Any * any, ACE_OutputCDR::from_boolean value); +}; + +ACE_STATIC_SVC_DECLARE (TAO_AnyTypeCode_Adapter_Impl) +ACE_FACTORY_DECLARE (TAO_AnyTypeCode, TAO_AnyTypeCode_Adapter_Impl) + +static int TAO_Requires_TAO_AnyTypeCode_Adapter_Impl = + TAO_AnyTypeCode_Adapter_Impl::Initializer (); + +#include /**/ "ace/post.h" +#endif /* TAO_ANYTYPECODE_ADAPTER_IMPL_H */ diff --git a/TAO/tao/AnyTypeCode/AnyTypeCode_methods.h b/TAO/tao/AnyTypeCode/AnyTypeCode_methods.h new file mode 100644 index 00000000000..e106a85b137 --- /dev/null +++ b/TAO/tao/AnyTypeCode/AnyTypeCode_methods.h @@ -0,0 +1,54 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file AnyTypeCode_methods.h + * + * $Id$ + * + * Declarations of NamedValue and NVlist methods in the CORBA namespace. + * + * @author Jeff Parsons + */ +//============================================================================= + +#ifndef TAO_ANYTYPECODE_METHODS_H +#define TAO_ANYTYPECODE_METHODS_H + +#include /**/ "ace/pre.h" +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif + +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +namespace CORBA +{ + class NamedValue; + typedef NamedValue *NamedValue_ptr; + + class NVList; + typedef NVList *NVList_ptr; + + class TypeCode; + typedef TypeCode *TypeCode_ptr; + + TAO_NAMESPACE_INLINE_FUNCTION void release (NamedValue_ptr); + TAO_NAMESPACE_INLINE_FUNCTION Boolean is_nil (NamedValue_ptr); + + TAO_NAMESPACE_INLINE_FUNCTION void release (NVList_ptr); + TAO_NAMESPACE_INLINE_FUNCTION Boolean is_nil (NVList_ptr ); + + TAO_NAMESPACE_INLINE_FUNCTION Boolean is_nil (TypeCode_ptr); + TAO_NAMESPACE_INLINE_FUNCTION void release (TypeCode_ptr); +} + +#include /**/ "ace/post.h" + +#endif /* TAO_ANYTYPECODE_METHODS_H */ diff --git a/TAO/tao/AnyTypeCode/Any_Arg_Traits.h b/TAO/tao/AnyTypeCode/Any_Arg_Traits.h new file mode 100644 index 00000000000..26e4b66a844 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Arg_Traits.h @@ -0,0 +1,52 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file Any_Arg_Traits.h + * + * $Id$ + * + * @author Jeff Parsons + */ +//============================================================================= + + +#ifndef TAO_ANY_ARG_TRAITS_H +#define TAO_ANY_ARG_TRAITS_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/Var_Size_Argument_T.h" +#include "tao/Arg_Traits_T.h" + +namespace CORBA +{ + class Any; + class Any_var; + class Any_out; +} + +namespace TAO +{ + template<> + class TAO_AnyTypeCode_Export Arg_Traits + : public + Var_Size_Arg_Traits_T< + CORBA::Any, + CORBA::Any_var, + CORBA::Any_out, + TAO::Any_Insert_Policy_Stream + > + { + }; +} + +#include /**/ "ace/post.h" + +#endif /* TAO_ANY_ARG_TRAITS_H */ diff --git a/TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp new file mode 100644 index 00000000000..31998ed36e3 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp @@ -0,0 +1,162 @@ +// $Id$ + +#ifndef TAO_ANY_ARRAY_IMPL_T_C +#define TAO_ANY_ARRAY_IMPL_T_C + +#include "tao/AnyTypeCode/Any_Array_Impl_T.h" +#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" +#include "tao/AnyTypeCode/Marshal.h" +#include "tao/debug.h" +#include "tao/CDR.h" +#include "tao/SystemException.h" + +#include "ace/CORBA_macros.h" +#include "ace/Auto_Ptr.h" + +#if !defined (__ACE_INLINE__) +# include "tao/AnyTypeCode/Any_Array_Impl_T.inl" +#endif /* ! __ACE_INLINE__ */ + +ACE_RCSID (tao, + Any_Array_Impl_T, + "$Id$") + +template +TAO::Any_Array_Impl_T::Any_Array_Impl_T ( + _tao_destructor destructor, + CORBA::TypeCode_ptr tc, + T_slice * const val + ) + : Any_Impl (destructor, + tc), + value_ (val) +{ +} + +template +TAO::Any_Array_Impl_T::~Any_Array_Impl_T (void) +{ +} + +template +void +TAO::Any_Array_Impl_T::insert (CORBA::Any & any, + _tao_destructor destructor, + CORBA::TypeCode_ptr tc, + T_slice * const value) +{ + TAO::Any_Array_Impl_T *new_impl = 0; + typedef TAO::Any_Array_Impl_T ARRAY_ANY_IMPL; + ACE_NEW (new_impl, + ARRAY_ANY_IMPL (destructor, + tc, + value)); + any.replace (new_impl); +} + +template +CORBA::Boolean +TAO::Any_Array_Impl_T::extract (const CORBA::Any & any, + _tao_destructor destructor, + CORBA::TypeCode_ptr tc, + T_slice *& _tao_elem) +{ + _tao_elem = 0; + + ACE_TRY_NEW_ENV + { + CORBA::TypeCode_ptr any_tc = any._tao_get_typecode (); + const CORBA::Boolean _tao_equiv = + any_tc->equivalent (tc + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (_tao_equiv == 0) + { + return 0; + } + + TAO::Any_Impl *impl = any.impl (); + + if (!impl->encoded ()) + { + TAO::Any_Array_Impl_T *narrow_impl = + dynamic_cast *> (impl); + + if (narrow_impl == 0) + { + return 0; + } + + _tao_elem = reinterpret_cast (narrow_impl->value_); + return 1; + } + + TAO::Any_Array_Impl_T *replacement = 0; + typedef TAO::Any_Array_Impl_T ARRAY_ANY_IMPL; + ACE_NEW_RETURN (replacement, + ARRAY_ANY_IMPL (destructor, + any_tc, + T_forany::tao_alloc ()), + 0); + + auto_ptr > replacement_safety ( + replacement + ); + + // We know this will work since the unencoded case is covered above. + TAO::Unknown_IDL_Type *unk = + dynamic_cast (impl); + + // We don't want the rd_ptr of unk to move, in case it is + // shared by another Any. This copies the state, not the buffer. + TAO_InputCDR for_reading (unk->_tao_get_cdr ()); + + CORBA::Boolean good_decode = + replacement->demarshal_value (for_reading); + + if (good_decode) + { + _tao_elem = reinterpret_cast (replacement->value_); + const_cast (any).replace (replacement); + replacement_safety.release (); + return 1; + } + + // Duplicated by Any_Impl base class constructor. + CORBA::release (any_tc); + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + return 0; +} + +template +void +TAO::Any_Array_Impl_T::free_value (void) +{ + if (this->value_destructor_ != 0) + { + (*this->value_destructor_) (this->value_); + this->value_destructor_ = 0; + } + + this->value_ = 0; + CORBA::release (this->type_); +} + +template +void +TAO::Any_Array_Impl_T::_tao_decode (TAO_InputCDR &cdr + ACE_ENV_ARG_DECL) +{ + if (! this->demarshal_value (cdr)) + { + ACE_THROW (CORBA::MARSHAL ()); + } +} + +#endif /* TAO_ANY_ARRAY_IMPL_T_C */ diff --git a/TAO/tao/AnyTypeCode/Any_Array_Impl_T.h b/TAO/tao/AnyTypeCode/Any_Array_Impl_T.h new file mode 100644 index 00000000000..4f0d7ce0dee --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Array_Impl_T.h @@ -0,0 +1,85 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file Any_Array_Impl_T.h + * + * $Id$ + * + * @authors Carlos O'Ryan and Jeff Parsons + */ +//============================================================================= + + +#ifndef TAO_ANY_ARRAY_IMPL_T_H +#define TAO_ANY_ARRAY_IMPL_T_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/Any_Impl.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace TAO +{ + /** + * @class Any_Array_Impl_T + * + * @brief Template Any class for array types. + * + * Used for arrays + */ + template + class Any_Array_Impl_T : public Any_Impl + { + public: + Any_Array_Impl_T (_tao_destructor destructor, + CORBA::TypeCode_ptr, + T_slice * const); + virtual ~Any_Array_Impl_T (void); + + static void insert (CORBA::Any &, + _tao_destructor destructor, + CORBA::TypeCode_ptr, + T_slice * const); + static CORBA::Boolean extract (const CORBA::Any &, + _tao_destructor, + CORBA::TypeCode_ptr, + T_slice *&); + + virtual CORBA::Boolean marshal_value (TAO_OutputCDR &); + CORBA::Boolean demarshal_value (TAO_InputCDR &); + virtual void _tao_decode (TAO_InputCDR & + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + virtual const void *value (void) const; + virtual void free_value (void); + + private: + T_slice * value_; + }; +} + +#if defined (__ACE_INLINE__) +# include "tao/AnyTypeCode/Any_Array_Impl_T.inl" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "tao/AnyTypeCode/Any_Array_Impl_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Any_Array_Impl_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* TAO_ANY_ARRAY_IMPL_T_H */ + diff --git a/TAO/tao/AnyTypeCode/Any_Array_Impl_T.inl b/TAO/tao/AnyTypeCode/Any_Array_Impl_T.inl new file mode 100644 index 00000000000..876b658d0ae --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Array_Impl_T.inl @@ -0,0 +1,28 @@ +// -*- C++ -*- +// +// $Id$ + +template +ACE_INLINE +CORBA::Boolean +TAO::Any_Array_Impl_T::marshal_value (TAO_OutputCDR &cdr) +{ + return (cdr << T_forany (this->value_)); +} + +template +ACE_INLINE +CORBA::Boolean +TAO::Any_Array_Impl_T::demarshal_value (TAO_InputCDR &cdr) +{ + T_forany tmp (this->value_); + return (cdr >> tmp); +} + +template +ACE_INLINE +const void * +TAO::Any_Array_Impl_T::value (void) const +{ + return this->value_; +} diff --git a/TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp b/TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp new file mode 100644 index 00000000000..4f390f5be3e --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp @@ -0,0 +1,382 @@ +// $Id$ + +#include "tao/AnyTypeCode/Any_Basic_Impl.h" +#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/TypeCode.h" +#include "tao/CDR.h" +#include "tao/SystemException.h" + +#include "ace/Auto_Ptr.h" +#include "ace/OS_NS_string.h" + +ACE_RCSID (tao, + Any_Basic_Impl, + "$Id$") + +namespace TAO +{ + Any_Basic_Impl::Any_Basic_Impl (CORBA::TypeCode_ptr tc, + void *value) + : Any_Impl (0, tc), + kind_ (CORBA::tk_null) + { + ACE_DECLARE_NEW_CORBA_ENV; + this->kind_ = TAO::unaliased_kind (tc + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + switch (this->kind_) + { + case CORBA::tk_short: + this->u_.s = *static_cast (value); + break; + case CORBA::tk_ushort: + this->u_.us = *static_cast (value); + break; + case CORBA::tk_long: + this->u_.l = *static_cast (value); + break; + case CORBA::tk_ulong: + this->u_.ul = *static_cast (value); + break; + case CORBA::tk_float: + this->u_.f = *static_cast (value); + break; + case CORBA::tk_double: + this->u_.d = *static_cast (value); + break; + case CORBA::tk_boolean: + this->u_.b = *static_cast (value); + break; + case CORBA::tk_char: + this->u_.c = *static_cast (value); + break; + case CORBA::tk_octet: + this->u_.o = *static_cast (value); + break; + case CORBA::tk_longlong: + this->u_.ll = *static_cast (value); + break; +#if !defined (ACE_LACKS_LONGLONG_T) + case CORBA::tk_ulonglong: + #if !defined (ACE_LACKS_UNSIGNEDLONGLONG_T) + this->u_.ull = *static_cast (value); + #else + this->u_.ull = *static_cast (value); + #endif + break; +#endif + case CORBA::tk_longdouble: + this->u_.ld = *static_cast (value); + break; + case CORBA::tk_wchar: + this->u_.wc = *static_cast (value); + break; + default: + break; + } + } + + Any_Basic_Impl::~Any_Basic_Impl (void) + { + } + + void + Any_Basic_Impl::insert (CORBA::Any &any, + CORBA::TypeCode_ptr tc, + const void *value) + { + Any_Basic_Impl *new_impl = 0; + ACE_NEW (new_impl, + Any_Basic_Impl (tc, + const_cast (value))); + any.replace (new_impl); + } + + CORBA::Boolean + Any_Basic_Impl::extract (const CORBA::Any &any, + CORBA::TypeCode_ptr tc, + void *_tao_elem) + { + ACE_TRY_NEW_ENV + { + CORBA::TypeCode_ptr any_tc = any._tao_get_typecode (); + CORBA::Boolean _tao_equiv = + any_tc->equivalent (tc + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (_tao_equiv == 0) + { + return 0; + } + + TAO::Any_Impl *impl = any.impl (); + + if (!impl->encoded ()) + { + TAO::Any_Basic_Impl *narrow_impl = + dynamic_cast (impl); + + if (narrow_impl == 0) + { + return 0; + } + + Any_Basic_Impl::assign_value (_tao_elem, + narrow_impl); + return 1; + } + + TAO::Any_Basic_Impl *replacement = + TAO::Any_Basic_Impl::create_empty (any_tc); + + auto_ptr replacement_safety (replacement); + + // We know this will work since the unencoded case is covered above. + TAO::Unknown_IDL_Type *unk = + dynamic_cast (impl); + + // Get the kind of the type where we are extracting in ie. the + // aliased type if there are any. Passing the aliased kind + // will not help. + CORBA::TCKind const tck = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + // We don't want the rd_ptr of unk to move, in case it is + // shared by another Any. This copies the state, not the buffer. + TAO_InputCDR for_reading (unk->_tao_get_cdr ()); + + CORBA::Boolean good_decode = + replacement->demarshal_value (for_reading, + static_cast (tck)); + + if (good_decode) + { + Any_Basic_Impl::assign_value (_tao_elem, + replacement, + tck); + const_cast (any).replace (replacement); + replacement_safety.release (); + return 1; + } + + // Duplicated by Any_Impl base class constructor. + CORBA::release (any_tc); + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + return 0; + } + + CORBA::Boolean + Any_Basic_Impl::marshal_value (TAO_OutputCDR &cdr) + { + CORBA::TCKind tckind = static_cast (this->kind_); + + switch (tckind) + { + case CORBA::tk_short: + return cdr << this->u_.s; + case CORBA::tk_ushort: + return cdr << this->u_.us; + case CORBA::tk_long: + return cdr << this->u_.l; + case CORBA::tk_ulong: + return cdr << this->u_.ul; + case CORBA::tk_float: + return cdr << this->u_.f; + case CORBA::tk_double: + return cdr << this->u_.d; + case CORBA::tk_boolean: + return cdr << CORBA::Any::from_boolean (this->u_.b); + case CORBA::tk_char: + return cdr << CORBA::Any::from_char (this->u_.c); + case CORBA::tk_octet: + return cdr << CORBA::Any::from_octet (this->u_.o); + case CORBA::tk_longlong: + return cdr << this->u_.ll; +#if !defined (ACE_LACKS_LONGLONG_T) + case CORBA::tk_ulonglong: + return cdr << this->u_.ull; +#endif + case CORBA::tk_longdouble: + return cdr << this->u_.ld; + case CORBA::tk_wchar: + return cdr << CORBA::Any::from_wchar (this->u_.wc); + default: + return 0; + } + } + + CORBA::Boolean + Any_Basic_Impl::demarshal_value (TAO_InputCDR &cdr) + { + return this->demarshal_value (cdr, + this->kind_); + } + + CORBA::Boolean + Any_Basic_Impl::demarshal_value (TAO_InputCDR &cdr, + CORBA::Long tck) + { + CORBA::TCKind const tckind = static_cast (tck); + switch (tckind) + { + case CORBA::tk_short: + return cdr >> this->u_.s; + case CORBA::tk_ushort: + return cdr >> this->u_.us; + case CORBA::tk_long: + return cdr >> this->u_.l; + case CORBA::tk_ulong: + return cdr >> this->u_.ul; + case CORBA::tk_float: + return cdr >> this->u_.f; + case CORBA::tk_double: + return cdr >> this->u_.d; + case CORBA::tk_boolean: + return cdr >> CORBA::Any::to_boolean (this->u_.b); + case CORBA::tk_char: + return cdr >> CORBA::Any::to_char (this->u_.c); + case CORBA::tk_octet: + return cdr >> CORBA::Any::to_octet (this->u_.o); + case CORBA::tk_longlong: + return cdr >> this->u_.ll; +#if !defined (ACE_LACKS_LONGLONG_T) + case CORBA::tk_ulonglong: + return cdr >> this->u_.ull; +#endif + case CORBA::tk_longdouble: + return cdr >> this->u_.ld; + case CORBA::tk_wchar: + return cdr >> CORBA::Any::to_wchar (this->u_.wc); + default: + return 0; + } + } + + void + Any_Basic_Impl::_tao_decode (TAO_InputCDR &cdr + ACE_ENV_ARG_DECL) + { + if (! this->demarshal_value (cdr)) + { + ACE_THROW (CORBA::MARSHAL ()); + } + } + + Any_Basic_Impl * + Any_Basic_Impl::create_empty (CORBA::TypeCode_ptr tc) + { + ACE_DECLARE_NEW_CORBA_ENV; + CORBA::TCKind const kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + TAO::Any_Basic_Impl * retval = 0; + + switch (kind) + { + case CORBA::tk_longlong: + { + CORBA::LongLong tmp = ACE_CDR_LONGLONG_INITIALIZER; + ACE_NEW_RETURN (retval, + TAO::Any_Basic_Impl (tc, &tmp), + 0); + } + + break; + case CORBA::tk_longdouble: + { + CORBA::LongDouble tmp = ACE_CDR_LONG_DOUBLE_INITIALIZER; + ACE_NEW_RETURN (retval, + TAO::Any_Basic_Impl (tc, &tmp), + 0); + } + + break; + default: + { + CORBA::ULongLong tmp = 0; + ACE_NEW_RETURN (retval, + TAO::Any_Basic_Impl (tc, &tmp), + 0); + } + + break; + } + + return retval; + } + + void + Any_Basic_Impl::assign_value (void *dest, Any_Basic_Impl *src) + { + Any_Basic_Impl::assign_value (dest, + src, + src->kind_); + } + + void + Any_Basic_Impl::assign_value (void *dest, + Any_Basic_Impl *src, + CORBA::Long tck) + { + CORBA::TCKind const kind = static_cast (tck); + + switch (kind) + { + case CORBA::tk_short: + *static_cast (dest) = src->u_.s; + break; + case CORBA::tk_ushort: + *static_cast (dest) = src->u_.us; + break; + case CORBA::tk_long: + *static_cast (dest) = src->u_.l; + break; + case CORBA::tk_ulong: + *static_cast (dest) = src->u_.ul; + break; + case CORBA::tk_float: + *static_cast (dest) = src->u_.f; + break; + case CORBA::tk_double: + *static_cast (dest) = src->u_.d; + break; + case CORBA::tk_boolean: + *static_cast (dest) = src->u_.b; + break; + case CORBA::tk_char: + *static_cast (dest) = src->u_.c; + break; + case CORBA::tk_octet: + *static_cast (dest) = src->u_.o; + break; + case CORBA::tk_longlong: + *static_cast (dest) = src->u_.ll; + break; +#if !defined (ACE_LACKS_LONGLONG_T) + case CORBA::tk_ulonglong: + #if !defined (ACE_LACKS_UNSIGNEDLONGLONG_T) + *static_cast (dest) = src->u_.ull; + break; + #else + *static_cast (dest) = src->u_.ull; + #endif +#endif + case CORBA::tk_longdouble: + *static_cast (dest) = src->u_.ld; + break; + case CORBA::tk_wchar: + *static_cast (dest) = src->u_.wc; + break; + default: + break; + } + } +} diff --git a/TAO/tao/AnyTypeCode/Any_Basic_Impl.h b/TAO/tao/AnyTypeCode/Any_Basic_Impl.h new file mode 100644 index 00000000000..34f75baad1d --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Basic_Impl.h @@ -0,0 +1,97 @@ +// -*- C++ -*- +//============================================================================= +/** + * @file Any_Basic_Impl.h + * + * $Id$ + * + * @authors Carlos O'Ryan and Jeff Parsons + */ +//============================================================================= + +#ifndef TAO_ANY_BASIC_IMPL_H +#define TAO_ANY_BASIC_IMPL_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/Any_Impl.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CORBA +{ + class Any; +} + +namespace TAO +{ + /** + * @class Any_Basic_Impl + * + * @brief Non-template class for all the basic types. + * + */ + class TAO_AnyTypeCode_Export Any_Basic_Impl : public Any_Impl + { + public: + Any_Basic_Impl (CORBA::TypeCode_ptr, + void *value); + + virtual ~Any_Basic_Impl (void); + + static void insert (CORBA::Any &, + CORBA::TypeCode_ptr, + const void *); + static CORBA::Boolean extract (const CORBA::Any &, + CORBA::TypeCode_ptr, + void *); + + virtual CORBA::Boolean marshal_value (TAO_OutputCDR &); + + CORBA::Boolean demarshal_value (TAO_InputCDR &); + CORBA::Boolean demarshal_value (TAO_InputCDR &, + CORBA::Long); + + virtual void _tao_decode (TAO_InputCDR & + ACE_ENV_ARG_DECL); + + static Any_Basic_Impl *create_empty (CORBA::TypeCode_ptr); + + private: + static void assign_value (void *, Any_Basic_Impl *); + + static void assign_value (void *, + Any_Basic_Impl *, + CORBA::Long tck); + private: + CORBA::Long kind_; + union + { + CORBA::Short s; + CORBA::UShort us; + CORBA::Long l; + CORBA::ULong ul; + CORBA::Float f; + CORBA::Double d; + CORBA::Boolean b; + CORBA::Char c; + CORBA::Octet o; + CORBA::LongLong ll; +#if !defined (ACE_LACKS_LONGLONG_T) && !defined (ACE_LACKS_UNSIGNEDLONGLONG_T) + CORBA::ULongLong ull; +#elif defined (ACE_LACKS_UNSIGNEDLONGLONG_T) + // Platform has signed long long but not unsigned long long. + // Use signed long long as the container. + CORBA::LongLong ull; +#endif + CORBA::LongDouble ld; + CORBA::WChar wc; + }u_; + }; +} + +#include /**/ "ace/post.h" + +#endif /* TAO_ANY_BASIC_IMPL_H */ diff --git a/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp new file mode 100644 index 00000000000..c9efb2ca50c --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp @@ -0,0 +1,144 @@ +// $Id$ + +#ifndef TAO_ANY_BASIC_IMPL_T_C +#define TAO_ANY_BASIC_IMPL_T_C + +#include "tao/AnyTypeCode/Any_Basic_Impl_T.h" +#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" +#include "tao/AnyTypeCode/Marshal.h" +#include "tao/Environment.h" +#include "tao/SystemException.h" +#include "tao/CDR.h" + +#include "ace/CORBA_macros.h" +#include "ace/Auto_Ptr.h" + +#if !defined (__ACE_INLINE__) +# include "tao/AnyTypeCode/Any_Basic_Impl_T.inl" +#endif /* ! __ACE_INLINE__ */ + +ACE_RCSID (tao, + Any_Basic_Impl_T, + "$Id$") + + +template +TAO::Any_Basic_Impl_T::Any_Basic_Impl_T (CORBA::TypeCode_ptr tc, + const T & val) + : Any_Impl (0, + tc), + value_ (val) +{ +} + +template +TAO::Any_Basic_Impl_T::~Any_Basic_Impl_T (void) +{ +} + +template +void +TAO::Any_Basic_Impl_T::insert (CORBA::Any & any, + CORBA::TypeCode_ptr tc, + const T & value) +{ + Any_Basic_Impl_T *new_impl = 0; + ACE_NEW (new_impl, + Any_Basic_Impl_T (tc, + value)); + any.replace (new_impl); +} + +template +CORBA::Boolean +TAO::Any_Basic_Impl_T::extract (const CORBA::Any & any, + CORBA::TypeCode_ptr tc, + T & _tao_elem) +{ + ACE_TRY_NEW_ENV + { + CORBA::TypeCode_ptr any_tc = any._tao_get_typecode (); + CORBA::Boolean _tao_equiv = any_tc->equivalent (tc + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (_tao_equiv == 0) + { + return 0; + } + + TAO::Any_Impl *impl = any.impl (); + + if (!impl->encoded ()) + { + TAO::Any_Basic_Impl_T *narrow_impl = + dynamic_cast *> (impl); + + if (narrow_impl == 0) + { + return 0; + } + + _tao_elem = narrow_impl->value_; + return 1; + } + + TAO::Any_Basic_Impl_T *replacement = + TAO::Any_Basic_Impl_T::create_empty (any_tc); + + auto_ptr > replacement_safety (replacement); + + // We know this will work since the unencoded case is covered above. + TAO::Unknown_IDL_Type *unk = + dynamic_cast (impl); + + // We don't want the rd_ptr of unk to move, in case it is + // shared by another Any. This copies the state, not the buffer. + TAO_InputCDR for_reading (unk->_tao_get_cdr ()); + + CORBA::Boolean good_decode = + replacement->demarshal_value (for_reading); + + if (good_decode) + { + _tao_elem = replacement->value_; + const_cast (any).replace (replacement); + replacement_safety.release (); + return 1; + } + + // Duplicated by Any_Impl base class constructor. + CORBA::release (any_tc); + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + return 0; +} + +template +TAO::Any_Basic_Impl_T * +TAO::Any_Basic_Impl_T::create_empty (CORBA::TypeCode_ptr tc) +{ + TAO::Any_Basic_Impl_T * retval = 0; + ACE_NEW_RETURN (retval, + TAO::Any_Basic_Impl_T (tc, + static_cast (0)), + 0); + return retval; +} + +template +void +TAO::Any_Basic_Impl_T::_tao_decode (TAO_InputCDR &cdr + ACE_ENV_ARG_DECL) +{ + if (! this->demarshal_value (cdr)) + { + ACE_THROW (CORBA::MARSHAL ()); + } +} + +#endif /* TAO_ANY_BASIC_IMPL_T_C */ diff --git a/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.h b/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.h new file mode 100644 index 00000000000..d704f87b546 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.h @@ -0,0 +1,82 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file Any_Basic_Impl_T.h + * + * $Id$ + * + * @authors Carlos O'Ryan and Jeff Parsons + */ +//============================================================================= + + +#ifndef TAO_ANY_BASIC_IMPL_T_H +#define TAO_ANY_BASIC_IMPL_T_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/Any_Impl.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace TAO +{ + /** + * @class Any_Basic_Impl_T + * + * @brief Template Any class for basic types. + * + * Used for all basic IDL types except bounded (w)strings. + */ + template + class Any_Basic_Impl_T : public Any_Impl + { + public: + Any_Basic_Impl_T (CORBA::TypeCode_ptr, + const T & val); + virtual ~Any_Basic_Impl_T (void); + + static void insert (CORBA::Any &, + CORBA::TypeCode_ptr, + const T &); + static CORBA::Boolean extract (const CORBA::Any &, + CORBA::TypeCode_ptr, + T &); + + virtual CORBA::Boolean marshal_value (TAO_OutputCDR &); + CORBA::Boolean demarshal_value (TAO_InputCDR &); + virtual void _tao_decode (TAO_InputCDR & + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + virtual const void *value (void) const; + static Any_Basic_Impl_T *create_empty (CORBA::TypeCode_ptr); + + private: + T value_; + }; +} + +#if defined (__ACE_INLINE__) +# include "tao/AnyTypeCode/Any_Basic_Impl_T.inl" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "tao/AnyTypeCode/Any_Basic_Impl_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Any_Basic_Impl_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* TAO_ANY_BASIC_IMPL_T_H */ + diff --git a/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.inl b/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.inl new file mode 100644 index 00000000000..4250b5f4f88 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.inl @@ -0,0 +1,26 @@ +// $Id$ + +template +ACE_INLINE +CORBA::Boolean +TAO::Any_Basic_Impl_T::marshal_value (TAO_OutputCDR &cdr) +{ + return (cdr << this->value_); +} + +template +ACE_INLINE +CORBA::Boolean +TAO::Any_Basic_Impl_T::demarshal_value (TAO_InputCDR &cdr) +{ + return (cdr >> this->value_); +} + +template +ACE_INLINE +const void * +TAO::Any_Basic_Impl_T::value (void) const +{ + return &this->value_; +} + diff --git a/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp new file mode 100644 index 00000000000..0bba1c76c46 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp @@ -0,0 +1,202 @@ +// $Id$ + +#ifndef TAO_ANY_DUAL_IMPL_T_CPP +#define TAO_ANY_DUAL_IMPL_T_CPP + +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" +#include "tao/AnyTypeCode/Marshal.h" +#include "tao/CORBA_String.h" +#include "tao/Environment.h" +#include "tao/SystemException.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/TypeCode.h" + +#include "ace/CORBA_macros.h" +#include "ace/Auto_Ptr.h" +#include "ace/OS_Memory.h" + +#if !defined (__ACE_INLINE__) +# include "tao/AnyTypeCode/Any_Dual_Impl_T.inl" +#endif /* ! __ACE_INLINE__ */ + +ACE_RCSID (tao, + Any_Dual_Impl_T, + "$Id$") + +template +TAO::Any_Dual_Impl_T::Any_Dual_Impl_T (_tao_destructor destructor, + CORBA::TypeCode_ptr tc, + T * const val) + : Any_Impl (destructor, + tc), + value_ (val) +{ +} + +template void +TAO::Any_Dual_Impl_T::value (const T & val) +{ + ACE_NEW (this->value_, + T (val)); +} + +template +TAO::Any_Dual_Impl_T::Any_Dual_Impl_T (_tao_destructor destructor, + CORBA::TypeCode_ptr tc, + const T & val) + : Any_Impl (destructor, + tc) +{ + this->value (val); +} + +template +TAO::Any_Dual_Impl_T::Any_Dual_Impl_T (CORBA::TypeCode_ptr tc) + : Any_Impl (0, + tc) +{ +} + +template +TAO::Any_Dual_Impl_T::~Any_Dual_Impl_T (void) +{ +} + +template +void +TAO::Any_Dual_Impl_T::insert (CORBA::Any & any, + _tao_destructor destructor, + CORBA::TypeCode_ptr tc, + T * const value) +{ + Any_Dual_Impl_T *new_impl = 0; + ACE_NEW (new_impl, + Any_Dual_Impl_T (destructor, + tc, + value)); + any.replace (new_impl); +} + +template +void +TAO::Any_Dual_Impl_T::insert_copy (CORBA::Any & any, + _tao_destructor destructor, + CORBA::TypeCode_ptr tc, + const T & value) +{ + Any_Dual_Impl_T *new_impl = 0; + ACE_NEW (new_impl, + Any_Dual_Impl_T (destructor, + tc, + value)); + any.replace (new_impl); +} + +template +CORBA::Boolean +TAO::Any_Dual_Impl_T::extract (const CORBA::Any & any, + _tao_destructor destructor, + CORBA::TypeCode_ptr tc, + const T *& _tao_elem) +{ + _tao_elem = 0; + + ACE_TRY_NEW_ENV + { + CORBA::TypeCode_ptr any_tc = any._tao_get_typecode (); + CORBA::Boolean _tao_equiv = any_tc->equivalent (tc + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (_tao_equiv == 0) + { + return 0; + } + + TAO::Any_Impl *impl = any.impl (); + + if (!impl->encoded ()) + { + TAO::Any_Dual_Impl_T *narrow_impl = + dynamic_cast *> (impl); + + if (narrow_impl == 0) + { + return 0; + } + + _tao_elem = narrow_impl->value_; + return 1; + } + + T *empty_value = 0; + ACE_NEW_RETURN (empty_value, + T, + 0); + TAO::Any_Dual_Impl_T *replacement = 0; + ACE_NEW_RETURN (replacement, + TAO::Any_Dual_Impl_T (destructor, + any_tc, + empty_value), + 0); + + auto_ptr > replacement_safety (replacement); + + // We know this will work since the unencoded case is covered above. + TAO::Unknown_IDL_Type *unk = + dynamic_cast (impl); + + // We don't want the rd_ptr of unk to move, in case it is + // shared by another Any. This copies the state, not the buffer. + TAO_InputCDR for_reading (unk->_tao_get_cdr ()); + + CORBA::Boolean good_decode = + replacement->demarshal_value (for_reading); + + if (good_decode) + { + _tao_elem = replacement->value_; + const_cast (any).replace (replacement); + replacement_safety.release (); + return 1; + } + + // Duplicated by Any_Impl base class constructor. + CORBA::release (any_tc); + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + return 0; +} + +template +void +TAO::Any_Dual_Impl_T::free_value (void) +{ + if (this->value_destructor_ != 0) + { + (*this->value_destructor_) (this->value_); + this->value_destructor_ = 0; + } + + CORBA::release (this->type_); + this->value_ = 0; +} + +template +void +TAO::Any_Dual_Impl_T::_tao_decode (TAO_InputCDR &cdr + ACE_ENV_ARG_DECL) +{ + if (! this->demarshal_value (cdr)) + { + ACE_THROW (CORBA::MARSHAL ()); + } +} + +#endif /* TAO_ANY_DUAL_IMPL_T_CPP */ diff --git a/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.h b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.h new file mode 100644 index 00000000000..8c06f69d64c --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.h @@ -0,0 +1,97 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file Any_Dual_Impl_T.h + * + * $Id$ + * + * @authors Carlos O'Ryan and Jeff Parsons + */ +//============================================================================= + + +#ifndef TAO_ANY_DUAL_IMPL_T_H +#define TAO_ANY_DUAL_IMPL_T_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/Any_Impl.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace TAO +{ + /** + * @class Any_Dual_Impl_T + * + * @brief Template Any class for IDL types with 2 modes of insertion + * + * Used for the IDL types that have copying and non-copying insertion, + * but which are not (de)marshaled as pointers - struct, union, sequence, + * and exception. + */ + template + class Any_Dual_Impl_T : public Any_Impl + { + public: + Any_Dual_Impl_T (_tao_destructor destructor, + CORBA::TypeCode_ptr, + T * const); + Any_Dual_Impl_T (_tao_destructor destructor, + CORBA::TypeCode_ptr, + const T &); + Any_Dual_Impl_T (CORBA::TypeCode_ptr); + virtual ~Any_Dual_Impl_T (void); + + static void insert (CORBA::Any &, + _tao_destructor, + CORBA::TypeCode_ptr, + T * const); + static void insert_copy (CORBA::Any &, + _tao_destructor destructor, + CORBA::TypeCode_ptr, + const T &); + static CORBA::Boolean extract (const CORBA::Any &, + _tao_destructor, + CORBA::TypeCode_ptr, + const T *&); + + virtual CORBA::Boolean marshal_value (TAO_OutputCDR &); + CORBA::Boolean demarshal_value (TAO_InputCDR &); + virtual void _tao_decode (TAO_InputCDR & + ACE_ENV_ARG_DECL); + + virtual const void *value (void) const; + virtual void free_value (void); + + protected: + void value (const T &); + + T * value_; + }; +} + +#if defined (__ACE_INLINE__) +# include "tao/AnyTypeCode/Any_Dual_Impl_T.inl" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "tao/AnyTypeCode/Any_Dual_Impl_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Any_Dual_Impl_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* TAO_ANY_DUAL_IMPL_T_H */ + diff --git a/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.inl b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.inl new file mode 100644 index 00000000000..bf3ecd90e33 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.inl @@ -0,0 +1,26 @@ +// $Id$ + +template +ACE_INLINE +CORBA::Boolean +TAO::Any_Dual_Impl_T::marshal_value (TAO_OutputCDR &cdr) +{ + return (cdr << *this->value_); +} + +template +ACE_INLINE +CORBA::Boolean +TAO::Any_Dual_Impl_T::demarshal_value (TAO_InputCDR &cdr) +{ + return (cdr >> *this->value_); +} + +template +ACE_INLINE +const void * +TAO::Any_Dual_Impl_T::value (void) const +{ + return this->value_; +} + diff --git a/TAO/tao/AnyTypeCode/Any_Impl.cpp b/TAO/tao/AnyTypeCode/Any_Impl.cpp new file mode 100644 index 00000000000..a0192816d53 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Impl.cpp @@ -0,0 +1,137 @@ +// $Id$ + +#include "Any_Impl.h" +#include "TypeCode.h" +#include "Marshal.h" + +#include "tao/CORBA_String.h" +#include "tao/SystemException.h" + +#include "ace/Guard_T.h" + +ACE_RCSID (tao, + Any_Impl, + "$Id$") + + +TAO::Any_Impl::Any_Impl (_tao_destructor destructor, + CORBA::TypeCode_ptr tc, + bool encoded) + : value_destructor_ (destructor) + , type_ (CORBA::TypeCode::_duplicate (tc)) + , encoded_ (encoded) + , refcount_ (1) +{ +} + +TAO::Any_Impl::~Any_Impl (void) +{ +} + +CORBA::Boolean +TAO::Any_Impl::marshal (TAO_OutputCDR &cdr) +{ + if ((cdr << this->type_) == 0) + { + return 0; + } + + return this->marshal_value (cdr); +} + +void +TAO::Any_Impl::free_value (void) +{ + // We always have to do this. + CORBA::release (this->type_); +} + +CORBA::TypeCode_ptr +TAO::Any_Impl::type (void) const +{ + return CORBA::TypeCode::_duplicate (this->type_); +} + +CORBA::TypeCode_ptr +TAO::Any_Impl::_tao_get_typecode (void) const +{ + return this->type_; +} + +void +TAO::Any_Impl::type (CORBA::TypeCode_ptr tc) +{ + CORBA::release (this->type_); + this->type_ = CORBA::TypeCode::_duplicate (tc); +} + +int +TAO::Any_Impl::_tao_byte_order (void) const +{ + return TAO_ENCAP_BYTE_ORDER; +} + +void +TAO::Any_Impl::_tao_any_string_destructor (void *x) +{ + char *tmp = static_cast (x); + CORBA::string_free (tmp); +} + +void +TAO::Any_Impl::_tao_any_wstring_destructor (void *x) +{ + CORBA::WChar *tmp = static_cast (x); + CORBA::wstring_free (tmp); +} + +void +TAO::Any_Impl::_add_ref (void) +{ + ++this->refcount_; +} + +void +TAO::Any_Impl::_remove_ref (void) +{ + const CORBA::ULong new_count = --this->refcount_; + + if (new_count != 0) + return; + + this->free_value (); + + delete this; +} + +void +TAO::Any_Impl::_tao_decode (TAO_InputCDR & + ACE_ENV_ARG_DECL) +{ + ACE_THROW (CORBA::NO_IMPLEMENT ()); +} + +CORBA::Boolean +TAO::Any_Impl::to_object (CORBA::Object_ptr &) const +{ + return 0; +} + +CORBA::Boolean +TAO::Any_Impl::to_value (CORBA::ValueBase *&) const +{ + return 0; +} + +CORBA::Boolean +TAO::Any_Impl::to_abstract_base (CORBA::AbstractBase_ptr &) const +{ + return 0; +} + +bool +TAO::Any_Impl::encoded (void) const +{ + return this->encoded_; +} + diff --git a/TAO/tao/AnyTypeCode/Any_Impl.h b/TAO/tao/AnyTypeCode/Any_Impl.h new file mode 100644 index 00000000000..c9ea19b900e --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Impl.h @@ -0,0 +1,111 @@ +// -*- C++ -*- +//============================================================================= +/** + * @file Any_Impl.h + * + * $Id$ + * + * @authors Carlos O'Ryan and Jeff Parsons + */ +//============================================================================= + +#ifndef TAO_ANY_IMPL_H +#define TAO_ANY_IMPL_H + +#include /**/ "ace/pre.h" +#include "ace/CORBA_macros.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/Basic_Types.h" +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/orbconf.h" +#include "ace/Synch_Traits.h" +#include "ace/Null_Mutex.h" +#include "ace/Thread_Mutex.h" +#include "ace/Atomic_Op.h" + +class TAO_OutputCDR; +class TAO_InputCDR; +class ACE_Message_Block; + +namespace CORBA +{ + class TypeCode; + typedef TypeCode *TypeCode_ptr; + + class Object; + typedef Object *Object_ptr; + + class ValueBase; + class AbstractBase; + typedef AbstractBase *AbstractBase_ptr; + + class Environment; +} + +namespace TAO +{ + /** + * @class Any_Impl + * + * @brief Base class for the Any template subclasses. + * + * Contains common functionality and some pure virtual methods. + */ + class TAO_AnyTypeCode_Export Any_Impl + { + public: + /// Generated data types define a 'destructor' function that + /// correctly destroys an object stored in an Any. + typedef void (*_tao_destructor)(void *); + + CORBA::Boolean marshal (TAO_OutputCDR &); + virtual CORBA::Boolean marshal_value (TAO_OutputCDR &) = 0; + + virtual void free_value (void); + + CORBA::TypeCode_ptr type (void) const; + CORBA::TypeCode_ptr _tao_get_typecode (void) const; + void type (CORBA::TypeCode_ptr); + + virtual int _tao_byte_order (void) const; + + virtual void _add_ref (void); + virtual void _remove_ref (void); + + /// Used to release these CORBA basic types. + static void _tao_any_string_destructor (void *); + static void _tao_any_wstring_destructor (void *); + + virtual void _tao_decode (TAO_InputCDR & + ACE_ENV_ARG_DECL); + + virtual CORBA::Boolean to_object (CORBA::Object_ptr &) const; + virtual CORBA::Boolean to_value (CORBA::ValueBase *&) const; + virtual CORBA::Boolean to_abstract_base (CORBA::AbstractBase_ptr &) const; + + bool encoded (void) const; + + protected: + Any_Impl (_tao_destructor, + CORBA::TypeCode_ptr, + bool encoded = false); + virtual ~Any_Impl (void); + + TAO::Any_Impl::_tao_destructor value_destructor_; + CORBA::TypeCode_ptr type_; + bool encoded_; + + private: + /// Reference counter. + ACE_Atomic_Op refcount_; + }; +} + +#include /**/ "ace/post.h" + +#endif /* TAO_ANY_IMPL_H */ diff --git a/TAO/tao/AnyTypeCode/Any_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Impl_T.cpp new file mode 100644 index 00000000000..f4a04cb568e --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Impl_T.cpp @@ -0,0 +1,157 @@ +// $Id$ + +#ifndef TAO_ANY_IMPL_T_C +#define TAO_ANY_IMPL_T_C + +#include "tao/AnyTypeCode/Any_Impl_T.h" +#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" +#include "tao/AnyTypeCode/Marshal.h" +#include "tao/CDR.h" +#include "tao/Environment.h" +#include "tao/SystemException.h" +#include "tao/AnyTypeCode/TypeCode.h" + +#include "ace/CORBA_macros.h" +#include "ace/Auto_Ptr.h" +#include "ace/OS_Memory.h" + +#if !defined (__ACE_INLINE__) +# include "tao/AnyTypeCode/Any_Impl_T.inl" +#endif /* ! __ACE_INLINE__ */ + +ACE_RCSID (tao, + Any_Impl_T, + "$Id$") + +template +TAO::Any_Impl_T::Any_Impl_T (_tao_destructor destructor, + CORBA::TypeCode_ptr tc, + T * const val) + : Any_Impl (destructor, + tc), + value_ (val) +{ +} + +template +TAO::Any_Impl_T::~Any_Impl_T (void) +{ +} + +template +void +TAO::Any_Impl_T::insert (CORBA::Any & any, + _tao_destructor destructor, + CORBA::TypeCode_ptr tc, + T * const value) +{ + TAO::Any_Impl_T *new_impl = 0; + ACE_NEW (new_impl, + TAO::Any_Impl_T (destructor, + tc, + value)); + any.replace (new_impl); +} + +template +CORBA::Boolean +TAO::Any_Impl_T::extract (const CORBA::Any & any, + _tao_destructor destructor, + CORBA::TypeCode_ptr tc, + T *& _tao_elem) +{ + _tao_elem = 0; + + ACE_TRY_NEW_ENV + { + CORBA::TypeCode_ptr any_tc = any._tao_get_typecode (); + CORBA::Boolean _tao_equiv = any_tc->equivalent (tc + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (_tao_equiv == 0) + { + return 0; + } + + TAO::Any_Impl *impl = any.impl (); + + if (!impl->encoded ()) + { + TAO::Any_Impl_T *narrow_impl = + dynamic_cast *> (impl); + + if (narrow_impl == 0) + { + return 0; + } + + _tao_elem = (T *) narrow_impl->value_; + return 1; + } + + TAO::Any_Impl_T *replacement = 0; + ACE_NEW_RETURN (replacement, + TAO::Any_Impl_T (destructor, + any_tc, + 0), + 0); + + auto_ptr > replacement_safety (replacement); + + // We know this will work since the unencoded case is covered above. + TAO::Unknown_IDL_Type *unk = + dynamic_cast (impl); + + // We don't want the rd_ptr of unk to move, in case it is + // shared by another Any. This copies the state, not the buffer. + TAO_InputCDR for_reading (unk->_tao_get_cdr ()); + + CORBA::Boolean good_decode = + replacement->demarshal_value (for_reading); + + if (good_decode) + { + _tao_elem = const_cast (replacement->value_); + const_cast (any).replace (replacement); + replacement_safety.release (); + return 1; + } + + // Duplicated by Any_Impl base class constructor. + CORBA::release (any_tc); + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + return 0; +} + +template +void +TAO::Any_Impl_T::free_value (void) +{ + if (this->value_destructor_ != 0) + { + (*this->value_destructor_) (this->value_); + this->value_destructor_ = 0; + } + + CORBA::release (this->type_); + this->value_ = 0; +} + +template +void +TAO::Any_Impl_T::_tao_decode (TAO_InputCDR &cdr + ACE_ENV_ARG_DECL) +{ + if (! this->demarshal_value (cdr)) + { + ACE_THROW (CORBA::MARSHAL ()); + } +} + +#endif /* TAO_ANY_IMPL_T_C */ diff --git a/TAO/tao/AnyTypeCode/Any_Impl_T.h b/TAO/tao/AnyTypeCode/Any_Impl_T.h new file mode 100644 index 00000000000..d79c5ce2135 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Impl_T.h @@ -0,0 +1,92 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file Any_Impl_T.h + * + * $Id$ + * + * @authors Carlos O'Ryan and Jeff Parsons + */ +//============================================================================= + + +#ifndef TAO_ANY_IMPL_T_H +#define TAO_ANY_IMPL_T_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/Any_Impl.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CORBA +{ + class Any; + class Environment; +} + +namespace TAO +{ + /** + * @class Any_Impl_T + * + * @brief Template Any class for pointer types. + * + * Used for interfaces and typecodes + */ + template + class Any_Impl_T : public Any_Impl + { + public: + Any_Impl_T (_tao_destructor destructor, + CORBA::TypeCode_ptr, + T * const); + virtual ~Any_Impl_T (void); + + static void insert (CORBA::Any &, + _tao_destructor destructor, + CORBA::TypeCode_ptr, + T * const); + static CORBA::Boolean extract (const CORBA::Any &, + _tao_destructor, + CORBA::TypeCode_ptr, + T *&); + + virtual CORBA::Boolean to_object (CORBA::Object_ptr &) const; + virtual CORBA::Boolean to_value (CORBA::ValueBase *&) const; + virtual CORBA::Boolean to_abstract_base (CORBA::AbstractBase_ptr &) const; + + virtual CORBA::Boolean marshal_value (TAO_OutputCDR &); + CORBA::Boolean demarshal_value (TAO_InputCDR &); + virtual void _tao_decode (TAO_InputCDR & ACE_ENV_ARG_DECL); + virtual const void *value (void) const; + virtual void free_value (void); + + private: + T * value_; + }; +} + +#if defined (__ACE_INLINE__) +# include "tao/AnyTypeCode/Any_Impl_T.inl" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "tao/AnyTypeCode/Any_Impl_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Any_Impl_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* TAO_ANY_IMPL_T_H */ diff --git a/TAO/tao/AnyTypeCode/Any_Impl_T.inl b/TAO/tao/AnyTypeCode/Any_Impl_T.inl new file mode 100644 index 00000000000..1bbeebeea78 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Impl_T.inl @@ -0,0 +1,53 @@ +// This may look like C, but it's really -*- C++ -*- +// $Id$ + +// These three are overridden in generated code where appropriate. + +template +ACE_INLINE +CORBA::Boolean +TAO::Any_Impl_T::to_object (CORBA::Object_ptr &) const +{ + return 0; +} + +template +ACE_INLINE +CORBA::Boolean +TAO::Any_Impl_T::to_value (CORBA::ValueBase *&) const +{ + return 0; +} + +template +ACE_INLINE +CORBA::Boolean +TAO::Any_Impl_T::to_abstract_base (CORBA::AbstractBase_ptr &) const +{ + return 0; +} + +template +ACE_INLINE +CORBA::Boolean +TAO::Any_Impl_T::marshal_value (TAO_OutputCDR &cdr) +{ + return (cdr << this->value_); +} + +template +ACE_INLINE +CORBA::Boolean +TAO::Any_Impl_T::demarshal_value (TAO_InputCDR &cdr) +{ + return (cdr >> this->value_); +} + +template +ACE_INLINE +const void * +TAO::Any_Impl_T::value (void) const +{ + return this->value_; +} + diff --git a/TAO/tao/AnyTypeCode/Any_Special_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Special_Impl_T.cpp new file mode 100644 index 00000000000..b584831329c --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Special_Impl_T.cpp @@ -0,0 +1,208 @@ +// $Id$ + +#ifndef TAO_ANY_SPECIAL_IMPL_T_C +#define TAO_ANY_SPECIAL_IMPL_T_C + +#include "tao/AnyTypeCode/Any_Special_Impl_T.h" +#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" +#include "tao/AnyTypeCode/Marshal.h" +#include "tao/Environment.h" +#include "tao/AnyTypeCode/String_TypeCode_Traits.h" + +#include "ace/CORBA_macros.h" + +#if !defined (__ACE_INLINE__) +# include "tao/AnyTypeCode/Any_Special_Impl_T.inl" +#endif /* ! __ACE_INLINE__ */ + +ACE_RCSID (tao, + Any_Special_Impl_T, + "$Id$") + +template +TAO::Any_Special_Impl_T::Any_Special_Impl_T ( + _tao_destructor destructor, + CORBA::TypeCode_ptr tc, + T * const val, + CORBA::ULong bound + ) + : Any_Impl (destructor, + tc), + value_ (val), + bound_ (bound) +{ +} + +template +TAO::Any_Special_Impl_T::~Any_Special_Impl_T (void) +{ +} + +template +void +TAO::Any_Special_Impl_T::insert (CORBA::Any & any, + _tao_destructor destructor, + CORBA::TypeCode_ptr tc, + T * const value, + CORBA::ULong bound + ) +{ + CORBA::TypeCode_var bounded_tc; + + if (bound > 0) + { + ACE_DECLARE_NEW_CORBA_ENV; + CORBA::TCKind const kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + bounded_tc = + TAO::TypeCodeFactory::String_Traits::create_typecode (kind, + bound); + } + else + { + bounded_tc = CORBA::TypeCode::_duplicate (tc); + } + + if (CORBA::is_nil (bounded_tc.in ())) + return; + + Any_Special_Impl_T * new_impl; + ACE_NEW (new_impl, + Any_Special_Impl_T (destructor, + bounded_tc.in (), + value, + bound)); + + any.replace (new_impl); +} + +template +CORBA::Boolean +TAO::Any_Special_Impl_T::extract (const CORBA::Any & any, + _tao_destructor destructor, + CORBA::TypeCode_ptr tc, + const T *& _tao_elem, + CORBA::ULong bound + ) +{ + _tao_elem = 0; + + ACE_TRY_NEW_ENV + { + CORBA::TypeCode_ptr any_type = any._tao_get_typecode (); + CORBA::TypeCode_var unaliased_any_type = + TAO::unaliased_typecode (any_type + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + CORBA::TCKind any_kind = + unaliased_any_type->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + CORBA::TCKind try_kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (any_kind != try_kind) + { + return 0; + } + + CORBA::ULong length = + unaliased_any_type->length (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (length != bound) + { + return 0; + } + + TAO::Any_Impl *impl = any.impl (); + + typedef TAO::Any_Special_Impl_T + BOUNDED_TSTRING_ANY_IMPL; + + if (!impl->encoded ()) + { + TAO::Any_Special_Impl_T *narrow_impl = + dynamic_cast (impl); + + if (narrow_impl == 0) + { + return 0; + } + + _tao_elem = (T *) narrow_impl->value_; + return 1; + } + + TAO::Any_Special_Impl_T *replacement = 0; + ACE_NEW_RETURN (replacement, + BOUNDED_TSTRING_ANY_IMPL (destructor, + tc, + 0, + bound), + 0); + + auto_ptr > replacement_safety ( + replacement + ); + + // We know this will work since the unencoded case is covered above. + TAO::Unknown_IDL_Type *unk = + dynamic_cast (impl); + + // We don't want the rd_ptr of unk to move, in case it is + // shared by another Any. This copies the state, not the buffer. + TAO_InputCDR for_reading (unk->_tao_get_cdr ()); + + CORBA::Boolean good_decode = + replacement->demarshal_value (for_reading); + + if (good_decode) + { + _tao_elem = replacement->value_; + const_cast (any).replace (replacement); + replacement_safety.release (); + return 1; + } + + // Duplicated by Any_Impl base class constructor. + CORBA::release (tc); + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + return 0; +} + +template +void +TAO::Any_Special_Impl_T::free_value (void) +{ + if (this->value_destructor_ != 0) + { + (*this->value_destructor_) (this->value_); + this->value_destructor_ = 0; + } + + CORBA::release (this->type_); + this->value_ = 0; +} + +template +void +TAO::Any_Special_Impl_T::_tao_decode ( + TAO_InputCDR &cdr + ACE_ENV_ARG_DECL + ) +{ + if (! this->demarshal_value (cdr)) + { + ACE_THROW (CORBA::MARSHAL ()); + } +} + +#endif /* TAO_ANY_T_C */ diff --git a/TAO/tao/AnyTypeCode/Any_Special_Impl_T.h b/TAO/tao/AnyTypeCode/Any_Special_Impl_T.h new file mode 100644 index 00000000000..c5fe808c64e --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Special_Impl_T.h @@ -0,0 +1,87 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file Any_Special_Impl_T.h + * + * $Id$ + * + * @author Carlos O'Ryan and Jeff Parsons + */ +//============================================================================= + + +#ifndef TAO_ANY_SPECIAL_IMPL_T_H +#define TAO_ANY_SPECIAL_IMPL_T_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/Any_Impl.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace TAO +{ + /** + * @class Any_Special_Impl_T + * + * @brief Template Any class for bounded IDL (w)strings. + */ + template + class Any_Special_Impl_T : public Any_Impl + { + public: + Any_Special_Impl_T (_tao_destructor destructor, + CORBA::TypeCode_ptr, + T * const, + CORBA::ULong bound); + virtual ~Any_Special_Impl_T (void); + + static void insert (CORBA::Any &, + _tao_destructor destructor, + CORBA::TypeCode_ptr, + T * const, + CORBA::ULong bound); + static CORBA::Boolean extract (const CORBA::Any &, + _tao_destructor, + CORBA::TypeCode_ptr, + const T *&, + CORBA::ULong bound); + + virtual CORBA::Boolean marshal_value (TAO_OutputCDR &); + CORBA::Boolean demarshal_value (TAO_InputCDR &); + virtual void _tao_decode (TAO_InputCDR & + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + virtual const void *value (void) const; + virtual void free_value (void); + + private: + T * value_; + CORBA::ULong bound_; + }; +} + +#if defined (__ACE_INLINE__) +# include "tao/AnyTypeCode/Any_Special_Impl_T.inl" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "tao/AnyTypeCode/Any_Special_Impl_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Any_Special_Impl_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* TAO_ANY_SPECIAL_IMPL_T_H */ + diff --git a/TAO/tao/AnyTypeCode/Any_Special_Impl_T.inl b/TAO/tao/AnyTypeCode/Any_Special_Impl_T.inl new file mode 100644 index 00000000000..bc8715b083f --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Special_Impl_T.inl @@ -0,0 +1,30 @@ +// $Id$ + +template +ACE_INLINE +CORBA::Boolean +TAO::Any_Special_Impl_T::marshal_value ( + TAO_OutputCDR &cdr + ) +{ + return (cdr << from_T (this->value_, this->bound_)); +} + +template +ACE_INLINE +CORBA::Boolean +TAO::Any_Special_Impl_T::demarshal_value ( + TAO_InputCDR &cdr + ) +{ + return (cdr >> to_T (this->value_, this->bound_)); +} + +template +ACE_INLINE +const void * +TAO::Any_Special_Impl_T::value (void) const +{ + return this->value_; +} + diff --git a/TAO/tao/AnyTypeCode/Any_SystemException.cpp b/TAO/tao/AnyTypeCode/Any_SystemException.cpp new file mode 100644 index 00000000000..d3a4b55193c --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_SystemException.cpp @@ -0,0 +1,206 @@ +// $Id$ + +#include "Any_SystemException.h" +#include "Any.h" +#include "Any_Unknown_IDL_Type.h" +#include "Marshal.h" +#include "TypeCode.h" + +#include "tao/CDR.h" +#include "tao/Exception.h" +#include "tao/Environment.h" +#include "tao/CORBA_String.h" +#include "tao/SystemException.h" + +#include "ace/Auto_Ptr.h" +#include "ace/CORBA_macros.h" +#include "ace/Auto_Ptr.h" + +ACE_RCSID (tao, + Any_SystemException, + "$Id$") + + +TAO::Any_SystemException::Any_SystemException (_tao_destructor destructor, + CORBA::TypeCode_ptr tc, + CORBA::SystemException * const val) + : Any_Impl (destructor, + tc), + value_ (val) +{ +} + +TAO::Any_SystemException::Any_SystemException (_tao_destructor destructor, + CORBA::TypeCode_ptr tc, + const CORBA::SystemException & val) + : Any_Impl (destructor, + tc) +{ + this->value_ = + dynamic_cast (val._tao_duplicate ()); +} + +TAO::Any_SystemException::Any_SystemException (CORBA::TypeCode_ptr tc) + : Any_Impl (0, + tc) +{ +} + +TAO::Any_SystemException::~Any_SystemException (void) +{ +} + +void +TAO::Any_SystemException::insert (CORBA::Any & any, + _tao_destructor destructor, + CORBA::TypeCode_ptr tc, + CORBA::SystemException * const value) +{ + Any_SystemException *new_impl = 0; + ACE_NEW (new_impl, + Any_SystemException (destructor, + tc, + value)); + any.replace (new_impl); +} + +void +TAO::Any_SystemException::insert_copy (CORBA::Any & any, + _tao_destructor destructor, + CORBA::TypeCode_ptr tc, + const CORBA::SystemException & value) +{ + Any_SystemException *new_impl = 0; + ACE_NEW (new_impl, + Any_SystemException (destructor, + tc, + value)); + any.replace (new_impl); +} + +CORBA::Boolean +TAO::Any_SystemException::extract (const CORBA::Any & any, + _tao_destructor destructor, + CORBA::TypeCode_ptr tc, + const CORBA::SystemException *& _tao_elem, + TAO::excp_factory f) +{ + _tao_elem = 0; + + ACE_TRY_NEW_ENV + { + CORBA::TypeCode_ptr any_tc = any._tao_get_typecode (); + CORBA::Boolean _tao_equiv = any_tc->equivalent (tc + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (_tao_equiv == 0) + { + return 0; + } + + TAO::Any_Impl *impl = any.impl (); + + if (!impl->encoded ()) + { + TAO::Any_SystemException *narrow_impl = + dynamic_cast (impl); + + if (narrow_impl == 0) + { + return 0; + } + + _tao_elem = narrow_impl->value_; + return 1; + } + + CORBA::SystemException *empty_value = (*f) (); + + TAO::Any_SystemException *replacement = 0; + ACE_NEW_RETURN (replacement, + TAO::Any_SystemException (destructor, + any_tc, + empty_value), + 0); + + auto_ptr replacement_safety (replacement); + + // We know this will work since the unencoded case is covered above. + TAO::Unknown_IDL_Type *unk = + dynamic_cast (impl); + + // We don't want the rd_ptr of unk to move, in case it is + // shared by another Any. This copies the state, not the buffer. + TAO_InputCDR for_reading (unk->_tao_get_cdr ()); + + CORBA::Boolean good_decode = + replacement->demarshal_value (for_reading); + + if (good_decode) + { + _tao_elem = replacement->value_; + const_cast (any).replace (replacement); + replacement_safety.release (); + return 1; + } + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + return 0; +} + +void +TAO::Any_SystemException::free_value (void) +{ + if (this->value_destructor_ != 0) + { + (*this->value_destructor_) (this->value_); + this->value_destructor_ = 0; + } + + this->value_ = 0; +} + +const void * +TAO::Any_SystemException::value (void) const +{ + return this->value_; +} + +CORBA::Boolean +TAO::Any_SystemException::marshal_value (TAO_OutputCDR &cdr) +{ + ACE_TRY_NEW_ENV + { + this->value_->_tao_encode (cdr + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + return 1; + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + return 0; +} + +CORBA::Boolean +TAO::Any_SystemException::demarshal_value (TAO_InputCDR &cdr) +{ + ACE_TRY_NEW_ENV + { + this->value_->_tao_decode (cdr + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + return 1; + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + return 0; +} diff --git a/TAO/tao/AnyTypeCode/Any_SystemException.h b/TAO/tao/AnyTypeCode/Any_SystemException.h new file mode 100644 index 00000000000..2856c6cf3f1 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_SystemException.h @@ -0,0 +1,83 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file Any_SystemException.h + * + * $Id$ + * + * @authors Carlos O'Ryan and Jeff Parsons + */ +//============================================================================= +#ifndef TAO_ANY_SYSTEMEXCEPTION_H +#define TAO_ANY_SYSTEMEXCEPTION_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/Any_Impl.h" +#include "tao/SystemException.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace CORBA +{ + class Any; +} + +namespace TAO +{ + /** + * @class Any_SystemException + * + * @brief Template Any class for IDL types with 2 modes of insertion + * + * Used for the IDL types that have copying and non-copying insertion, + * but which are not (de)marshaled as pointers - struct, union, sequence, + * and exception. + */ + class Any_SystemException : public Any_Impl + { + public: + Any_SystemException (_tao_destructor destructor, + CORBA::TypeCode_ptr, + CORBA::SystemException* const); + + Any_SystemException (_tao_destructor destructor, + CORBA::TypeCode_ptr, + const CORBA::SystemException &); + + Any_SystemException (CORBA::TypeCode_ptr); + + virtual ~Any_SystemException (void); + + static void insert (CORBA::Any &, + _tao_destructor, + CORBA::TypeCode_ptr, + CORBA::SystemException * const); + + static void insert_copy (CORBA::Any &, + _tao_destructor destructor, + CORBA::TypeCode_ptr, + const CORBA::SystemException &); + + static CORBA::Boolean extract (const CORBA::Any &, + _tao_destructor, + CORBA::TypeCode_ptr, + const CORBA::SystemException *&, + excp_factory f); + + virtual CORBA::Boolean marshal_value (TAO_OutputCDR &); + CORBA::Boolean demarshal_value (TAO_InputCDR &); + + virtual const void *value (void) const; + virtual void free_value (void); + + protected: + CORBA::SystemException *value_; + }; +} + +#include /**/ "ace/post.h" +#endif /*TAO_ANY_SYSTEMEXCEPTION_H*/ diff --git a/TAO/tao/AnyTypeCode/Any_Unknown_IDL_Type.cpp b/TAO/tao/AnyTypeCode/Any_Unknown_IDL_Type.cpp new file mode 100644 index 00000000000..eca5544a197 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Unknown_IDL_Type.cpp @@ -0,0 +1,288 @@ +// $Id$ + +#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" +#include "tao/Valuetype_Adapter.h" +#include "tao/ORB_Core.h" +#include "tao/SystemException.h" +#include "tao/AnyTypeCode/Marshal.h" +#include "tao/AnyTypeCode/TypeCode.h" +#include "tao/CDR.h" + +#include "ace/Dynamic_Service.h" +#include "ace/OS_NS_string.h" + + +ACE_RCSID (tao, + Any_Unknown_IDL_Type, + "$Id$") + + +TAO::Unknown_IDL_Type::Unknown_IDL_Type ( + CORBA::TypeCode_ptr tc, + TAO_InputCDR &cdr + ) + : TAO::Any_Impl (0, tc, true), + cdr_ (static_cast (0)) +{ + ACE_TRY_NEW_ENV + { + this->_tao_decode (cdr ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCH (CORBA::Exception, ex) + { + } + ACE_ENDTRY; +} + +TAO::Unknown_IDL_Type::Unknown_IDL_Type ( + CORBA::TypeCode_ptr tc + ) + : TAO::Any_Impl (0, tc, true), + cdr_ (static_cast (0)) +{ +} + +TAO::Unknown_IDL_Type::~Unknown_IDL_Type (void) +{ +} + +CORBA::Boolean +TAO::Unknown_IDL_Type::marshal_value (TAO_OutputCDR &cdr) +{ + ACE_TRY_NEW_ENV + { + // We don't want the rd_ptr to move, in case we are shared by + // another Any, so we use this to copy the state, not the buffer. + TAO_InputCDR for_reading (this->cdr_); + + TAO::traverse_status status = + TAO_Marshal_Object::perform_append (this->type_, + &for_reading, + &cdr + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (status != TAO::TRAVERSE_CONTINUE) + { + return 0; + } + } + ACE_CATCH (CORBA::Exception, ex) + { + return 0; + } + ACE_ENDTRY; + + return 1; +} + +const void * +TAO::Unknown_IDL_Type::value (void) const +{ + return this->cdr_.start (); +} + +void +TAO::Unknown_IDL_Type::free_value (void) +{ + CORBA::release (this->type_); +} + +TAO_InputCDR & +TAO::Unknown_IDL_Type::_tao_get_cdr (void) +{ + return this->cdr_; +} + +int +TAO::Unknown_IDL_Type::_tao_byte_order (void) const +{ + return this->cdr_.byte_order (); +} +void +TAO::Unknown_IDL_Type::_tao_decode (TAO_InputCDR &cdr + ACE_ENV_ARG_DECL) +{ + // @@ (JP) The following code depends on the fact that + // TAO_InputCDR does not contain chained message blocks, + // otherwise and could be part of + // different buffers! + + // This will be the start of a new message block. + char *begin = cdr.rd_ptr (); + + // Skip over the next argument. + TAO::traverse_status status = + TAO_Marshal_Object::perform_skip (this->type_, + &cdr + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + if (status != TAO::TRAVERSE_CONTINUE) + { + ACE_THROW (CORBA::MARSHAL ()); + } + + // This will be the end of the new message block. + char *end = cdr.rd_ptr (); + + // The ACE_CDR::mb_align() call can shift the rd_ptr by up to + // ACE_CDR::MAX_ALIGNMENT - 1 bytes. Similarly, the offset adjustment + // can move the rd_ptr by up to the same amount. We accommodate + // this by including 2 * ACE_CDR::MAX_ALIGNMENT bytes of additional + // space in the message block. + size_t size = end - begin; + + ACE_Message_Block new_mb (size + 2 * ACE_CDR::MAX_ALIGNMENT); + + ACE_CDR::mb_align (&new_mb); + ptrdiff_t offset = ptrdiff_t (begin) % ACE_CDR::MAX_ALIGNMENT; + + if (offset < 0) + { + offset += ACE_CDR::MAX_ALIGNMENT; + } + + new_mb.rd_ptr (offset); + new_mb.wr_ptr (offset + size); + + ACE_OS::memcpy (new_mb.rd_ptr (), + begin, + size); + + this->cdr_.reset (&new_mb, cdr.byte_order ()); + this->cdr_.char_translator (cdr.char_translator ()); + this->cdr_.wchar_translator (cdr.wchar_translator ()); +} + +CORBA::Boolean +TAO::Unknown_IDL_Type::to_object (CORBA::Object_ptr &obj) const +{ + ACE_TRY_NEW_ENV + { + CORBA::ULong kind = + this->type_->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + CORBA::TypeCode_var tcvar = + CORBA::TypeCode::_duplicate (this->type_); + + while (kind == CORBA::tk_alias) + { + tcvar = tcvar->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + kind = tcvar->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + + if (kind != CORBA::tk_objref) + { + return 0; + } + + return this->cdr_ >> obj; + } + ACE_CATCH (CORBA::Exception, ex) + { + } + ACE_ENDTRY; + + return 0; +} + +CORBA::Boolean +TAO::Unknown_IDL_Type::to_value (CORBA::ValueBase *&val) const +{ + ACE_TRY_NEW_ENV + { + CORBA::ULong kind = + this->type_->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + CORBA::TypeCode_var tcvar = + CORBA::TypeCode::_duplicate (this->type_); + + while (kind == CORBA::tk_alias) + { + tcvar = tcvar->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + kind = tcvar->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + + if (kind != CORBA::tk_value) + { + return 0; + } + + TAO_Valuetype_Adapter *adapter = + ACE_Dynamic_Service::instance ( + TAO_ORB_Core::valuetype_adapter_name () + ); + + if (adapter == 0) + { + ACE_THROW_RETURN (CORBA::INTERNAL (), + 0); + } + + return adapter->stream_to_value (this->cdr_, val); + } + ACE_CATCH (CORBA::Exception, ex) + { + } + ACE_ENDTRY; + + return 0; +} + +CORBA::Boolean +TAO::Unknown_IDL_Type::to_abstract_base (CORBA::AbstractBase_ptr &obj) const +{ + ACE_TRY_NEW_ENV + { + CORBA::ULong kind = + this->type_->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + CORBA::TypeCode_var tcvar = + CORBA::TypeCode::_duplicate (this->type_); + + while (kind == CORBA::tk_alias) + { + tcvar = tcvar->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + kind = tcvar->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + + if (kind != CORBA::tk_value) + { + return 0; + } + + TAO_Valuetype_Adapter *adapter = + ACE_Dynamic_Service::instance ( + TAO_ORB_Core::valuetype_adapter_name () + ); + + if (adapter == 0) + { + ACE_THROW_RETURN (CORBA::INTERNAL (), + 0); + } + + return adapter->stream_to_abstract_base (this->cdr_, + obj); + } + ACE_CATCH (CORBA::Exception, ex) + { + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/tao/AnyTypeCode/Any_Unknown_IDL_Type.h b/TAO/tao/AnyTypeCode/Any_Unknown_IDL_Type.h new file mode 100644 index 00000000000..45b05acde1d --- /dev/null +++ b/TAO/tao/AnyTypeCode/Any_Unknown_IDL_Type.h @@ -0,0 +1,67 @@ +// -*- C++ -*- +//============================================================================= +/** + * @file Any_Unknown_IDL_Type.h + * + * $Id$ + * + * @authors Carlos O'Ryan and Jeff Parsons + */ +//============================================================================= + +#ifndef TAO_ANY_UNKNOWN_IDL_TYPE_H +#define TAO_ANY_UNKNOWN_IDL_TYPE_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/Any_Impl.h" +#include "tao/CDR.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class ACE_Char_Codeset_Translator; +class ACE_WChar_Codeset_Translator; + +namespace TAO +{ + /** + * @class Unknown_IDL_Type + * + * @brief CDR-based Any impl class. + * + * Used when demarshaling an Any, and with DII/DSI, and Dynamic Anys. + */ + class TAO_AnyTypeCode_Export Unknown_IDL_Type : public Any_Impl + { + public: + Unknown_IDL_Type (CORBA::TypeCode_ptr, + TAO_InputCDR &cdr); + + Unknown_IDL_Type (CORBA::TypeCode_ptr); + + virtual ~Unknown_IDL_Type (void); + + virtual CORBA::Boolean marshal_value (TAO_OutputCDR &); + virtual const void *value (void) const; + virtual void free_value (void); + + virtual TAO_InputCDR &_tao_get_cdr (void); + virtual int _tao_byte_order (void) const; + + virtual void _tao_decode (TAO_InputCDR & + ACE_ENV_ARG_DECL); + + virtual CORBA::Boolean to_object (CORBA::Object_ptr &) const; + virtual CORBA::Boolean to_value (CORBA::ValueBase *&) const; + virtual CORBA::Boolean to_abstract_base (CORBA::AbstractBase_ptr &) const; + + private: + mutable TAO_InputCDR cdr_; + }; +} + +#include /**/ "ace/post.h" + +#endif /* TAO_ANY_UNKNOWN_IDL_TYPE_H */ diff --git a/TAO/tao/AnyTypeCode/BooleanSeqA.cpp b/TAO/tao/AnyTypeCode/BooleanSeqA.cpp new file mode 100644 index 00000000000..ca2f826567c --- /dev/null +++ b/TAO/tao/AnyTypeCode/BooleanSeqA.cpp @@ -0,0 +1,142 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "BooleanSeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_BooleanSeq_GUARD +#define _TAO_TYPECODE_CORBA_BooleanSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_BooleanSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_boolean, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_BooleanSeq_0 = + &CORBA_BooleanSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_BooleanSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_BooleanSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/BooleanSeq:1.0", + "BooleanSeq", + &TAO::TypeCode::tc_CORBA_BooleanSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_BooleanSeq = + &_tao_tc_CORBA_BooleanSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::BooleanSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::BooleanSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_BooleanSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::BooleanSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::BooleanSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_BooleanSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::BooleanSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::BooleanSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::BooleanSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::BooleanSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_BooleanSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/BooleanSeqA.h b/TAO/tao/AnyTypeCode/BooleanSeqA.h new file mode 100644 index 00000000000..3f62afae6af --- /dev/null +++ b/TAO/tao/AnyTypeCode/BooleanSeqA.h @@ -0,0 +1,66 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:788 + +#ifndef _TAO_IDL_ANYTYPECODE_BOOLEANSEQA_H_ +#define _TAO_IDL_ANYTYPECODE_BOOLEANSEQA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/BooleanSeqC.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_BooleanSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::BooleanSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::BooleanSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::BooleanSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::BooleanSeq *&); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/Bounds.pidl b/TAO/tao/AnyTypeCode/Bounds.pidl new file mode 100644 index 00000000000..c639e285fe5 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Bounds.pidl @@ -0,0 +1,43 @@ +/** + * @file Bounds.pidl + * + * $Id$ + * + * @brief Pre-compiled IDL source for the CORBA::Bounds + * exception. + * + * This file is used to generate BoundsC.{h,inl,cpp}, using the + * following command: + * + * tao_idl + * -o orig -Ge 1 -GA -Sc -Sci + * -Wb,export_macro=TAO_Export + * -Wb,export_include=TAO_Export.h + * -Wb,pre_include="ace/pre.h" + * -Wb,post_include="ace/post.h" + * Bounds.pidl + * + * and then: + * + * cp orig/BoundsC.{h,cpp} . + * + */ +#ifndef TAO_CORBA_BOUNDS_PIDL +#define TAO_CORBA_BOUNDS_PIDL + +#pragma prefix "omg.org" + +module CORBA +{ + /** + * @exception Bounds + * + * @brief UserException for NVList::item() + * + * This exception is thrown on attempts to access 'out of bounds' + * items in an NVList. + */ + exception Bounds {}; +}; + +#endif /* TAO_CORBA_BOUNDS_PIDL */ diff --git a/TAO/tao/AnyTypeCode/BoundsA.cpp b/TAO/tao/AnyTypeCode/BoundsA.cpp new file mode 100644 index 00000000000..097395f4667 --- /dev/null +++ b/TAO/tao/AnyTypeCode/BoundsA.cpp @@ -0,0 +1,147 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "BoundsA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Struct_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + +static TAO::TypeCode::Struct_Field const * const _tao_fields_CORBA_Bounds = 0; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_CORBA_Bounds ( + CORBA::tk_except, + "IDL:omg.org/CORBA/Bounds:1.0", + "Bounds", + _tao_fields_CORBA_Bounds, + 0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_Bounds = + &_tao_tc_CORBA_Bounds; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_exception/any_op_cs.cpp:50 + +namespace TAO +{ + template<> + CORBA::Boolean + Any_Dual_Impl_T::demarshal_value ( + TAO_InputCDR & cdr + ) + { + CORBA::String_var id; + + if (!(cdr >> id.out ())) + { + return false; + } + + ACE_TRY_NEW_ENV + { + this->value_->_tao_decode (cdr ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + return false; + } + ACE_ENDTRY; + + return true; + } +} + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::Bounds &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::Bounds::_tao_any_destructor, + CORBA::_tc_Bounds, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::Bounds *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::Bounds::_tao_any_destructor, + CORBA::_tc_Bounds, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::Bounds *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::Bounds *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::Bounds *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::Bounds::_tao_any_destructor, + CORBA::_tc_Bounds, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/BoundsA.h b/TAO/tao/AnyTypeCode/BoundsA.h new file mode 100644 index 00000000000..c5af5d83cd1 --- /dev/null +++ b/TAO/tao/AnyTypeCode/BoundsA.h @@ -0,0 +1,159 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_BOUNDSA_H_ +#define _TAO_IDL_ORIG_BOUNDSA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/ORB.h" +#include "tao/Environment.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_exception/exception_ch.cpp:53 + +#if !defined (_CORBA_BOUNDS_CH_) +#define _CORBA_BOUNDS_CH_ + + class TAO_AnyTypeCode_Export Bounds : public CORBA::UserException + { + public: + + Bounds (void); + Bounds (const Bounds &); + ~Bounds (void); + + Bounds &operator= (const Bounds &); + + static void _tao_any_destructor (void *); + + static Bounds *_downcast (CORBA::Exception *); + static const Bounds *_downcast (CORBA::Exception const *); + + static CORBA::Exception *_alloc (void); + + virtual CORBA::Exception *_tao_duplicate (void) const; + + virtual void _raise (void) const; + + virtual void _tao_encode ( + TAO_OutputCDR & + ACE_ENV_ARG_DECL + ) const; + + virtual void _tao_decode ( + TAO_InputCDR & + ACE_ENV_ARG_DECL + ); + + // TAO_IDL - Generated from + // be\be_visitor_exception/exception_ch.cpp:129 + + virtual CORBA::TypeCode_ptr _tao_type (void) const; + }; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_Bounds; + +#endif /* end #if !defined */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_exception/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::Bounds &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::Bounds*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::Bounds *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::Bounds *&); + +// TAO_IDL - Generated from +// be\be_visitor_exception/cdr_op_ch.cpp:52 + +TAO_AnyTypeCode_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const CORBA::Bounds &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>> (TAO_InputCDR &, CORBA::Bounds &); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/BoundsC.cpp b/TAO/tao/AnyTypeCode/BoundsC.cpp new file mode 100644 index 00000000000..fec4453680a --- /dev/null +++ b/TAO/tao/AnyTypeCode/BoundsC.cpp @@ -0,0 +1,173 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:291 + + +#include "BoundsA.h" +#include "tao/CDR.h" +#include "tao/SystemException.h" +#include "ace/OS_NS_string.h" + +#if defined (__BORLANDC__) +#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_arg_traits.cpp:70 + +// Arg traits specializations. +namespace TAO +{ +} + + +// TAO_IDL - Generated from +// be\be_visitor_exception/exception_cs.cpp:63 + +CORBA::Bounds::Bounds (void) + : CORBA::UserException ( + "IDL:omg.org/CORBA/Bounds:1.0", + "Bounds" + ) +{ +} + +CORBA::Bounds::~Bounds (void) +{ +} + +CORBA::Bounds::Bounds (const ::CORBA::Bounds &_tao_excp) + : CORBA::UserException ( + _tao_excp._rep_id (), + _tao_excp._name () + ) +{ +} + +CORBA::Bounds& +CORBA::Bounds::operator= (const ::CORBA::Bounds &_tao_excp) +{ + this->ACE_NESTED_CLASS (CORBA, UserException)::operator= (_tao_excp); + return *this; +} + +void CORBA::Bounds::_tao_any_destructor (void *_tao_void_pointer) +{ + Bounds *_tao_tmp_pointer = + static_cast (_tao_void_pointer); + delete _tao_tmp_pointer; +} + +CORBA::Bounds * +CORBA::Bounds::_downcast (CORBA::Exception *_tao_excp) +{ + return dynamic_cast (_tao_excp); +} + +const CORBA::Bounds * +CORBA::Bounds::_downcast (CORBA::Exception const *_tao_excp) +{ + return dynamic_cast (_tao_excp); +} + +CORBA::Exception *CORBA::Bounds::_alloc (void) +{ + CORBA::Exception *retval = 0; + ACE_NEW_RETURN (retval, ::CORBA::Bounds, 0); + return retval; +} + +CORBA::Exception * +CORBA::Bounds::_tao_duplicate (void) const +{ + CORBA::Exception *result = 0; + ACE_NEW_RETURN ( + result, + ::CORBA::Bounds (*this), + 0 + ); + return result; +} + +void CORBA::Bounds::_raise (void) const +{ + TAO_RAISE (*this); +} + +void CORBA::Bounds::_tao_encode ( + TAO_OutputCDR &cdr + ACE_ENV_ARG_DECL + ) const +{ + if (cdr << *this) + { + return; + } + + ACE_THROW (CORBA::MARSHAL ()); +} + +void CORBA::Bounds::_tao_decode ( + TAO_InputCDR &cdr + ACE_ENV_ARG_DECL + ) +{ + if (cdr >> *this) + { + return; + } + + ACE_THROW (CORBA::MARSHAL ()); +} + +// TAO extension - the virtual _type method. +CORBA::TypeCode_ptr CORBA::Bounds::_tao_type (void) const +{ + return ::CORBA::_tc_Bounds; +} + +// TAO_IDL - Generated from +// be\be_visitor_exception/cdr_op_cs.cpp:60 + +CORBA::Boolean operator<< ( + TAO_OutputCDR &strm, + const CORBA::Bounds &_tao_aggregate + ) +{ + // Marshal the repository ID. + return (strm << _tao_aggregate._rep_id ()); +} + +CORBA::Boolean operator>> ( + TAO_InputCDR &, + CORBA::Bounds& + ) +{ + return true; +} diff --git a/TAO/tao/AnyTypeCode/BoundsC.h b/TAO/tao/AnyTypeCode/BoundsC.h new file mode 100644 index 00000000000..b228461b7b0 --- /dev/null +++ b/TAO/tao/AnyTypeCode/BoundsC.h @@ -0,0 +1,146 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_BOUNDSC_H_ +#define _TAO_IDL_ORIG_BOUNDSC_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/ORB.h" +#include "tao/Environment.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_exception/exception_ch.cpp:53 + +#if !defined (_CORBA_BOUNDS_CH_) +#define _CORBA_BOUNDS_CH_ + + class TAO_AnyTypeCode_Export Bounds : public CORBA::UserException + { + public: + + Bounds (void); + Bounds (const Bounds &); + ~Bounds (void); + + Bounds &operator= (const Bounds &); + + static void _tao_any_destructor (void *); + + static Bounds *_downcast (CORBA::Exception *); + static const Bounds *_downcast (CORBA::Exception const *); + + static CORBA::Exception *_alloc (void); + + virtual CORBA::Exception *_tao_duplicate (void) const; + + virtual void _raise (void) const; + + virtual void _tao_encode ( + TAO_OutputCDR & + ACE_ENV_ARG_DECL + ) const; + + virtual void _tao_decode ( + TAO_InputCDR & + ACE_ENV_ARG_DECL + ); + + // TAO_IDL - Generated from + // be\be_visitor_exception/exception_ch.cpp:129 + + virtual CORBA::TypeCode_ptr _tao_type (void) const; + }; + +#endif /* end #if !defined */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_exception/cdr_op_ch.cpp:52 + +TAO_AnyTypeCode_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const CORBA::Bounds &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>> (TAO_InputCDR &, CORBA::Bounds &); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/CONV_FRAMEA.cpp b/TAO/tao/AnyTypeCode/CONV_FRAMEA.cpp new file mode 100644 index 00000000000..e93d7b8e7f7 --- /dev/null +++ b/TAO/tao/AnyTypeCode/CONV_FRAMEA.cpp @@ -0,0 +1,427 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "CONV_FRAMEA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/AnyTypeCode/Struct_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_CONV_FRAME_CodeSetId ( + CORBA::tk_alias, + "IDL:omg.org/CONV_FRAME/CodeSetId:1.0", + "CodeSetId", + &CORBA::_tc_ulong); + +namespace CONV_FRAME +{ + ::CORBA::TypeCode_ptr const _tc_CodeSetId = + &_tao_tc_CONV_FRAME_CodeSetId; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CONV_FRAME_CodeSetIdSeq_GUARD +#define _TAO_TYPECODE_CONV_FRAME_CodeSetIdSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CONV_FRAME_CodeSetIdSeq_0 ( + CORBA::tk_sequence, + &CONV_FRAME::_tc_CodeSetId, + 0U); + + ::CORBA::TypeCode_ptr const tc_CONV_FRAME_CodeSetIdSeq_0 = + &CONV_FRAME_CodeSetIdSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CONV_FRAME_CodeSetIdSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CONV_FRAME_CodeSetIdSeq ( + CORBA::tk_alias, + "IDL:omg.org/CONV_FRAME/CodeSetIdSeq:1.0", + "CodeSetIdSeq", + &TAO::TypeCode::tc_CONV_FRAME_CodeSetIdSeq_0); + +namespace CONV_FRAME +{ + ::CORBA::TypeCode_ptr const _tc_CodeSetIdSeq = + &_tao_tc_CONV_FRAME_CodeSetIdSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + +static TAO::TypeCode::Struct_Field const _tao_fields_CONV_FRAME_CodeSetComponent[] = + { + { "native_code_set", &CONV_FRAME::_tc_CodeSetId }, + { "conversion_code_sets", &CONV_FRAME::_tc_CodeSetIdSeq } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_CONV_FRAME_CodeSetComponent ( + CORBA::tk_struct, + "IDL:omg.org/CONV_FRAME/CodeSetComponent:1.0", + "CodeSetComponent", + _tao_fields_CONV_FRAME_CodeSetComponent, + 2); + +namespace CONV_FRAME +{ + ::CORBA::TypeCode_ptr const _tc_CodeSetComponent = + &_tao_tc_CONV_FRAME_CodeSetComponent; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + +static TAO::TypeCode::Struct_Field const _tao_fields_CONV_FRAME_CodeSetComponentInfo[] = + { + { "ForCharData", &CONV_FRAME::_tc_CodeSetComponent }, + { "ForWcharData", &CONV_FRAME::_tc_CodeSetComponent } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_CONV_FRAME_CodeSetComponentInfo ( + CORBA::tk_struct, + "IDL:omg.org/CONV_FRAME/CodeSetComponentInfo:1.0", + "CodeSetComponentInfo", + _tao_fields_CONV_FRAME_CodeSetComponentInfo, + 2); + +namespace CONV_FRAME +{ + ::CORBA::TypeCode_ptr const _tc_CodeSetComponentInfo = + &_tao_tc_CONV_FRAME_CodeSetComponentInfo; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + +static TAO::TypeCode::Struct_Field const _tao_fields_CONV_FRAME_CodeSetContext[] = + { + { "char_data", &CONV_FRAME::_tc_CodeSetId }, + { "wchar_data", &CONV_FRAME::_tc_CodeSetId } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_CONV_FRAME_CodeSetContext ( + CORBA::tk_struct, + "IDL:omg.org/CONV_FRAME/CodeSetContext:1.0", + "CodeSetContext", + _tao_fields_CONV_FRAME_CodeSetContext, + 2); + +namespace CONV_FRAME +{ + ::CORBA::TypeCode_ptr const _tc_CodeSetContext = + &_tao_tc_CONV_FRAME_CodeSetContext; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CONV_FRAME::CodeSetIdSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CONV_FRAME::CodeSetIdSeq::_tao_any_destructor, + TAO::TypeCode::tc_CONV_FRAME_CodeSetIdSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CONV_FRAME::CodeSetIdSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CONV_FRAME::CodeSetIdSeq::_tao_any_destructor, + TAO::TypeCode::tc_CONV_FRAME_CodeSetIdSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CONV_FRAME::CodeSetIdSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CONV_FRAME::CodeSetIdSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CONV_FRAME::CodeSetIdSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CONV_FRAME::CodeSetIdSeq::_tao_any_destructor, + TAO::TypeCode::tc_CONV_FRAME_CodeSetIdSeq_0, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CONV_FRAME::CodeSetComponent &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CONV_FRAME::CodeSetComponent::_tao_any_destructor, + CONV_FRAME::_tc_CodeSetComponent, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CONV_FRAME::CodeSetComponent *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CONV_FRAME::CodeSetComponent::_tao_any_destructor, + CONV_FRAME::_tc_CodeSetComponent, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CONV_FRAME::CodeSetComponent *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CONV_FRAME::CodeSetComponent *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CONV_FRAME::CodeSetComponent *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CONV_FRAME::CodeSetComponent::_tao_any_destructor, + CONV_FRAME::_tc_CodeSetComponent, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CONV_FRAME::CodeSetComponentInfo &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CONV_FRAME::CodeSetComponentInfo::_tao_any_destructor, + CONV_FRAME::_tc_CodeSetComponentInfo, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CONV_FRAME::CodeSetComponentInfo *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CONV_FRAME::CodeSetComponentInfo::_tao_any_destructor, + CONV_FRAME::_tc_CodeSetComponentInfo, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CONV_FRAME::CodeSetComponentInfo *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CONV_FRAME::CodeSetComponentInfo *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CONV_FRAME::CodeSetComponentInfo *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CONV_FRAME::CodeSetComponentInfo::_tao_any_destructor, + CONV_FRAME::_tc_CodeSetComponentInfo, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CONV_FRAME::CodeSetContext &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CONV_FRAME::CodeSetContext::_tao_any_destructor, + CONV_FRAME::_tc_CodeSetContext, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CONV_FRAME::CodeSetContext *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CONV_FRAME::CodeSetContext::_tao_any_destructor, + CONV_FRAME::_tc_CodeSetContext, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CONV_FRAME::CodeSetContext *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CONV_FRAME::CodeSetContext *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CONV_FRAME::CodeSetContext *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CONV_FRAME::CodeSetContext::_tao_any_destructor, + CONV_FRAME::_tc_CodeSetContext, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/CONV_FRAMEA.h b/TAO/tao/AnyTypeCode/CONV_FRAMEA.h new file mode 100644 index 00000000000..bb7e487b8aa --- /dev/null +++ b/TAO/tao/AnyTypeCode/CONV_FRAMEA.h @@ -0,0 +1,110 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:788 + +#ifndef _TAO_IDL_ANYTYPECODE_CONV_FRAMEA_H_ +#define _TAO_IDL_ANYTYPECODE_CONV_FRAMEA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/CONV_FRAMEC.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace CONV_FRAME +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_CodeSetId; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_CodeSetIdSeq; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_CodeSetComponent; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_CodeSetComponentInfo; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_CodeSetContext; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module CONV_FRAME + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CONV_FRAME::CodeSetIdSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CONV_FRAME::CodeSetIdSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CONV_FRAME::CodeSetIdSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CONV_FRAME::CodeSetIdSeq *&); + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CONV_FRAME::CodeSetComponent &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CONV_FRAME::CodeSetComponent*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CONV_FRAME::CodeSetComponent *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CONV_FRAME::CodeSetComponent *&); + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CONV_FRAME::CodeSetComponentInfo &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CONV_FRAME::CodeSetComponentInfo*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CONV_FRAME::CodeSetComponentInfo *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CONV_FRAME::CodeSetComponentInfo *&); + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CONV_FRAME::CodeSetContext &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CONV_FRAME::CodeSetContext*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CONV_FRAME::CodeSetContext *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CONV_FRAME::CodeSetContext *&); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/CharSeqA.cpp b/TAO/tao/AnyTypeCode/CharSeqA.cpp new file mode 100644 index 00000000000..644df59e780 --- /dev/null +++ b/TAO/tao/AnyTypeCode/CharSeqA.cpp @@ -0,0 +1,142 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "CharSeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_CharSeq_GUARD +#define _TAO_TYPECODE_CORBA_CharSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_CharSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_char, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_CharSeq_0 = + &CORBA_CharSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_CharSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_CharSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/CharSeq:1.0", + "CharSeq", + &TAO::TypeCode::tc_CORBA_CharSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_CharSeq = + &_tao_tc_CORBA_CharSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::CharSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::CharSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_CharSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::CharSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::CharSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_CharSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::CharSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::CharSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::CharSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::CharSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_CharSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/CharSeqA.h b/TAO/tao/AnyTypeCode/CharSeqA.h new file mode 100644 index 00000000000..d1c16850515 --- /dev/null +++ b/TAO/tao/AnyTypeCode/CharSeqA.h @@ -0,0 +1,107 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_CHARSEQA_H_ +#define _TAO_IDL_ORIG_CHARSEQA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/CharSeqC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_CharSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::CharSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::CharSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::CharSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::CharSeq *&); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/CurrentA.cpp b/TAO/tao/AnyTypeCode/CurrentA.cpp new file mode 100644 index 00000000000..d7946836b98 --- /dev/null +++ b/TAO/tao/AnyTypeCode/CurrentA.cpp @@ -0,0 +1,53 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "CurrentA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Objref_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/objref_typecode.cpp:76 + +static TAO::TypeCode::Objref + _tao_tc_CORBA_Current ( + CORBA::tk_local_interface, + "IDL:omg.org/CORBA/Current:1.0", + "Current"); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_Current = + &_tao_tc_CORBA_Current; +} + + diff --git a/TAO/tao/AnyTypeCode/CurrentA.h b/TAO/tao/AnyTypeCode/CurrentA.h new file mode 100644 index 00000000000..a0181c446fc --- /dev/null +++ b/TAO/tao/AnyTypeCode/CurrentA.h @@ -0,0 +1,58 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:788 + +#ifndef _TAO_IDL_ANYTYPECODE_CURRENTA_H_ +#define _TAO_IDL_ANYTYPECODE_CURRENTA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/CurrentC.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_Current; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module CORBA + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/DomainA.cpp b/TAO/tao/AnyTypeCode/DomainA.cpp new file mode 100644 index 00000000000..4bf71aa1cae --- /dev/null +++ b/TAO/tao/AnyTypeCode/DomainA.cpp @@ -0,0 +1,296 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "DomainA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Objref_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Impl_T.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/objref_typecode.cpp:76 + +static TAO::TypeCode::Objref + _tao_tc_CORBA_DomainManager ( + CORBA::tk_objref, + "IDL:omg.org/CORBA/DomainManager:1.0", + "DomainManager"); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_DomainManager = + &_tao_tc_CORBA_DomainManager; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/objref_typecode.cpp:76 + +static TAO::TypeCode::Objref + _tao_tc_CORBA_ConstructionPolicy ( + CORBA::tk_objref, + "IDL:omg.org/CORBA/ConstructionPolicy:1.0", + "ConstructionPolicy"); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ConstructionPolicy = + &_tao_tc_CORBA_ConstructionPolicy; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_DomainManagerList_GUARD +#define _TAO_TYPECODE_CORBA_DomainManagerList_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_DomainManagerList_0 ( + CORBA::tk_sequence, + &CORBA::_tc_DomainManager, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_DomainManagerList_0 = + &CORBA_DomainManagerList_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_DomainManagerList_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_DomainManagerList ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/DomainManagerList:1.0", + "DomainManagerList", + &TAO::TypeCode::tc_CORBA_DomainManagerList_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_DomainManagerList = + &_tao_tc_CORBA_DomainManagerList; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_interface/any_op_cs.cpp:50 + +namespace TAO +{ + template<> + CORBA::Boolean + Any_Impl_T::to_object ( + CORBA::Object_ptr &_tao_elem + ) const + { + _tao_elem = CORBA::Object::_duplicate (this->value_); + return true; + } +} + +// Copying insertion. +void +operator<<= ( + CORBA::Any &_tao_any, + CORBA::DomainManager_ptr _tao_elem + ) +{ + CORBA::DomainManager_ptr _tao_objptr = + CORBA::DomainManager::_duplicate (_tao_elem); + _tao_any <<= &_tao_objptr; +} + +// Non-copying insertion. +void +operator<<= ( + CORBA::Any &_tao_any, + CORBA::DomainManager_ptr *_tao_elem + ) +{ + TAO::Any_Impl_T::insert ( + _tao_any, + CORBA::DomainManager::_tao_any_destructor, + CORBA::_tc_DomainManager, + *_tao_elem + ); +} + +CORBA::Boolean +operator>>= ( + const CORBA::Any &_tao_any, + CORBA::DomainManager_ptr &_tao_elem + ) +{ + return + TAO::Any_Impl_T::extract ( + _tao_any, + CORBA::DomainManager::_tao_any_destructor, + CORBA::_tc_DomainManager, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_interface/any_op_cs.cpp:50 + +namespace TAO +{ + template<> + CORBA::Boolean + Any_Impl_T::to_object ( + CORBA::Object_ptr &_tao_elem + ) const + { + _tao_elem = CORBA::Object::_duplicate (this->value_); + return true; + } +} + +// Copying insertion. +void +operator<<= ( + CORBA::Any &_tao_any, + CORBA::ConstructionPolicy_ptr _tao_elem + ) +{ + CORBA::ConstructionPolicy_ptr _tao_objptr = + CORBA::ConstructionPolicy::_duplicate (_tao_elem); + _tao_any <<= &_tao_objptr; +} + +// Non-copying insertion. +void +operator<<= ( + CORBA::Any &_tao_any, + CORBA::ConstructionPolicy_ptr *_tao_elem + ) +{ + TAO::Any_Impl_T::insert ( + _tao_any, + CORBA::ConstructionPolicy::_tao_any_destructor, + CORBA::_tc_ConstructionPolicy, + *_tao_elem + ); +} + +CORBA::Boolean +operator>>= ( + const CORBA::Any &_tao_any, + CORBA::ConstructionPolicy_ptr &_tao_elem + ) +{ + return + TAO::Any_Impl_T::extract ( + _tao_any, + CORBA::ConstructionPolicy::_tao_any_destructor, + CORBA::_tc_ConstructionPolicy, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::DomainManagerList &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::DomainManagerList::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_DomainManagerList_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::DomainManagerList *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::DomainManagerList::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_DomainManagerList_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::DomainManagerList *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::DomainManagerList *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::DomainManagerList *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::DomainManagerList::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_DomainManagerList_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/DomainA.h b/TAO/tao/AnyTypeCode/DomainA.h new file mode 100644 index 00000000000..3bd4343b422 --- /dev/null +++ b/TAO/tao/AnyTypeCode/DomainA.h @@ -0,0 +1,135 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_DOMAINA_H_ +#define _TAO_IDL_ORIG_DOMAINA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/DomainC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_root/root_ch.cpp:62 + +namespace TAO +{ + class Collocation_Proxy_Broker; + template class Narrow_Utils; +} + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_DomainManager; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ConstructionPolicy; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_DomainManagerList; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_interface/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::DomainManager_ptr); // copying +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::DomainManager_ptr *); // non-copying +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::DomainManager_ptr &); + +// TAO_IDL - Generated from +// be\be_visitor_interface/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::ConstructionPolicy_ptr); // copying +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::ConstructionPolicy_ptr *); // non-copying +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::ConstructionPolicy_ptr &); + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::DomainManagerList &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::DomainManagerList*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::DomainManagerList *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::DomainManagerList *&); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined (__ACE_INLINE__) +#include "DomainC.inl" +#endif /* defined INLINE */ + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/DoubleSeqA.cpp b/TAO/tao/AnyTypeCode/DoubleSeqA.cpp new file mode 100644 index 00000000000..7de306f3f02 --- /dev/null +++ b/TAO/tao/AnyTypeCode/DoubleSeqA.cpp @@ -0,0 +1,143 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "DoubleSeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" +#include "tao/AnyTypeCode/StringSeqA.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_DoubleSeq_GUARD +#define _TAO_TYPECODE_CORBA_DoubleSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_DoubleSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_double, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_DoubleSeq_0 = + &CORBA_DoubleSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_DoubleSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_DoubleSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/DoubleSeq:1.0", + "DoubleSeq", + &TAO::TypeCode::tc_CORBA_DoubleSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_DoubleSeq = + &_tao_tc_CORBA_DoubleSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::DoubleSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::DoubleSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_DoubleSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::DoubleSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::DoubleSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_DoubleSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::DoubleSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::DoubleSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::DoubleSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::DoubleSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_DoubleSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/DoubleSeqA.h b/TAO/tao/AnyTypeCode/DoubleSeqA.h new file mode 100644 index 00000000000..d1b05d95dc3 --- /dev/null +++ b/TAO/tao/AnyTypeCode/DoubleSeqA.h @@ -0,0 +1,107 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_DOUBLESEQA_H_ +#define _TAO_IDL_ORIG_DOUBLESEQA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/DoubleSeqC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_DoubleSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::DoubleSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::DoubleSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::DoubleSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::DoubleSeq *&); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/Dynamic.pidl b/TAO/tao/AnyTypeCode/Dynamic.pidl new file mode 100644 index 00000000000..9cc2be7c43d --- /dev/null +++ b/TAO/tao/AnyTypeCode/Dynamic.pidl @@ -0,0 +1,50 @@ +// -*- IDL -*- + +// ================================================================ +/** + * @file Dynamic.pidl + * + * $Id$ + * + * This file was used to generate the code in DynamicC.* The command + * used to generate code is: + * + * tao_idl + * -o orig -Ge 1 -GA -Sc -SS -Sci + * -Wb,export_macro=TAO_Export + * -Wb,export_include="tao/TAO_Export.h" + * -Wb,pre_include="ace/pre.h" + * -Wb,post_include="ace/post.h" + * Dynamic.pidl + * + */ +// ================================================================ + +// File: Dynamic.idl +// Used primarily for Interceptors + +#include "Dynamic_Parameter.pidl" +#include "StringSeq.pidl" + +#ifndef _DYNAMIC_IDL_ +#define _DYNAMIC_IDL_ + +module CORBA +{ + interface TypeCode; +}; + +module Dynamic +{ + typeprefix Dynamic "omg.org"; + + typedef sequence ParameterList; + + typedef CORBA::StringSeq ContextList; + + typedef sequence ExceptionList; + + typedef CORBA::StringSeq RequestContext; +}; + +#endif // _DYNAMIC_IDL_ diff --git a/TAO/tao/AnyTypeCode/DynamicA.cpp b/TAO/tao/AnyTypeCode/DynamicA.cpp new file mode 100644 index 00000000000..589213436f5 --- /dev/null +++ b/TAO/tao/AnyTypeCode/DynamicA.cpp @@ -0,0 +1,287 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "DynamicA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/AnyTypeCode/String_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +#include "tao/AnyTypeCode/StringSeqA.h" +#include "tao/AnyTypeCode/Dynamic_ParameterA.h" + +#ifndef _TAO_TYPECODE_Dynamic_ParameterList_GUARD +#define _TAO_TYPECODE_Dynamic_ParameterList_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + Dynamic_ParameterList_0 ( + CORBA::tk_sequence, + &Dynamic::_tc_Parameter, + 0U); + + ::CORBA::TypeCode_ptr const tc_Dynamic_ParameterList_0 = + &Dynamic_ParameterList_0; + + } +} + + +#endif /* _TAO_TYPECODE_Dynamic_ParameterList_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_Dynamic_ParameterList ( + CORBA::tk_alias, + "IDL:omg.org/Dynamic/ParameterList:1.0", + "ParameterList", + &TAO::TypeCode::tc_Dynamic_ParameterList_0); + +namespace Dynamic +{ + ::CORBA::TypeCode_ptr const _tc_ParameterList = + &_tao_tc_Dynamic_ParameterList; +} + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_Dynamic_ContextList ( + CORBA::tk_alias, + "IDL:omg.org/Dynamic/ContextList:1.0", + "ContextList", + &CORBA::_tc_StringSeq); + +namespace Dynamic +{ + ::CORBA::TypeCode_ptr const _tc_ContextList = + &_tao_tc_Dynamic_ContextList; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + +namespace CORBA +{ + extern ::CORBA::TypeCode_ptr const _tc_TypeCode; +} + + +#ifndef _TAO_TYPECODE_Dynamic_ExceptionList_GUARD +#define _TAO_TYPECODE_Dynamic_ExceptionList_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + Dynamic_ExceptionList_0 ( + CORBA::tk_sequence, + &CORBA::_tc_TypeCode, + 0U); + + ::CORBA::TypeCode_ptr const tc_Dynamic_ExceptionList_0 = + &Dynamic_ExceptionList_0; + + } +} + + +#endif /* _TAO_TYPECODE_Dynamic_ExceptionList_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_Dynamic_ExceptionList ( + CORBA::tk_alias, + "IDL:omg.org/Dynamic/ExceptionList:1.0", + "ExceptionList", + &TAO::TypeCode::tc_Dynamic_ExceptionList_0); + +namespace Dynamic +{ + ::CORBA::TypeCode_ptr const _tc_ExceptionList = + &_tao_tc_Dynamic_ExceptionList; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_Dynamic_RequestContext ( + CORBA::tk_alias, + "IDL:omg.org/Dynamic/RequestContext:1.0", + "RequestContext", + &CORBA::_tc_StringSeq); + +namespace Dynamic +{ + ::CORBA::TypeCode_ptr const _tc_RequestContext = + &_tao_tc_Dynamic_RequestContext; +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const Dynamic::ParameterList &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + Dynamic::ParameterList::_tao_any_destructor, + TAO::TypeCode::tc_Dynamic_ParameterList_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + Dynamic::ParameterList *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + Dynamic::ParameterList::_tao_any_destructor, + TAO::TypeCode::tc_Dynamic_ParameterList_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + Dynamic::ParameterList *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const Dynamic::ParameterList *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const Dynamic::ParameterList *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + Dynamic::ParameterList::_tao_any_destructor, + TAO::TypeCode::tc_Dynamic_ParameterList_0, + _tao_elem + ); +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const Dynamic::ExceptionList &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + Dynamic::ExceptionList::_tao_any_destructor, + TAO::TypeCode::tc_Dynamic_ExceptionList_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + Dynamic::ExceptionList *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + Dynamic::ExceptionList::_tao_any_destructor, + TAO::TypeCode::tc_Dynamic_ExceptionList_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + Dynamic::ExceptionList *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const Dynamic::ExceptionList *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const Dynamic::ExceptionList *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + Dynamic::ExceptionList::_tao_any_destructor, + TAO::TypeCode::tc_Dynamic_ExceptionList_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/DynamicA.h b/TAO/tao/AnyTypeCode/DynamicA.h new file mode 100644 index 00000000000..944d9d28d76 --- /dev/null +++ b/TAO/tao/AnyTypeCode/DynamicA.h @@ -0,0 +1,142 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_DYNAMICA_H_ +#define _TAO_IDL_ORIG_DYNAMICA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/AnyTypeCode/DynamicC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace Dynamic +{ + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ParameterList; + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ContextList; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ExceptionList; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_RequestContext; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module Dynamic + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const Dynamic::ParameterList &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, Dynamic::ParameterList*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, Dynamic::ParameterList *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const Dynamic::ParameterList *&); + +// TAO_IDL - Generated from +// be\be_visitor_interface_fwd/any_op_ch.cpp:63 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::TypeCode_ptr); // copying +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::TypeCode_ptr *); // non-copying +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::TypeCode *&); + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const Dynamic::ExceptionList &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, Dynamic::ExceptionList*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, Dynamic::ExceptionList *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const Dynamic::ExceptionList *&); + +// TAO_IDL - Generated from +// be\be_visitor_interface_fwd/cdr_op_ch.cpp:66 + +TAO_AnyTypeCode_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const CORBA::TypeCode_ptr ); +TAO_AnyTypeCode_Export CORBA::Boolean operator>> (TAO_InputCDR &, CORBA::TypeCode_ptr &); + + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/DynamicC.cpp b/TAO/tao/AnyTypeCode/DynamicC.cpp new file mode 100644 index 00000000000..3b045863a7a --- /dev/null +++ b/TAO/tao/AnyTypeCode/DynamicC.cpp @@ -0,0 +1,303 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:291 + + +#include "DynamicC.h" +#include "tao/CDR.h" + +#if defined (__BORLANDC__) +#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_arg_traits.cpp:70 + +// Arg traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/sequence_cs.cpp:65 + +#if !defined (_DYNAMIC_PARAMETERLIST_CS_) +#define _DYNAMIC_PARAMETERLIST_CS_ + +Dynamic::ParameterList::ParameterList (void) +{} + +Dynamic::ParameterList::ParameterList ( + CORBA::ULong max + ) + : TAO_Unbounded_Sequence< + Dynamic::Parameter + > + (max) +{} + +Dynamic::ParameterList::ParameterList ( + CORBA::ULong max, + CORBA::ULong length, + Dynamic::Parameter * buffer, + CORBA::Boolean release + ) + : TAO_Unbounded_Sequence< + Dynamic::Parameter + > + (max, length, buffer, release) +{} + +Dynamic::ParameterList::ParameterList ( + const ParameterList &seq + ) + : TAO_Unbounded_Sequence< + Dynamic::Parameter + > + (seq) +{} + +Dynamic::ParameterList::~ParameterList (void) +{} + +void Dynamic::ParameterList::_tao_any_destructor ( + void * _tao_void_pointer + ) +{ + ParameterList * _tao_tmp_pointer = + static_cast (_tao_void_pointer); + delete _tao_tmp_pointer; +} + +#endif /* end #if !defined */ + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/sequence_cs.cpp:65 + +#if !defined (_DYNAMIC_EXCEPTIONLIST_CS_) +#define _DYNAMIC_EXCEPTIONLIST_CS_ + +Dynamic::ExceptionList::ExceptionList (void) +{} + +Dynamic::ExceptionList::ExceptionList ( + CORBA::ULong max + ) + : TAO_Unbounded_Object_Sequence< + CORBA::TypeCode, + CORBA::TypeCode_var + > + (max) +{} + +Dynamic::ExceptionList::ExceptionList ( + CORBA::ULong max, + CORBA::ULong length, + CORBA::TypeCode_ptr * buffer, + CORBA::Boolean release + ) + : TAO_Unbounded_Object_Sequence< + CORBA::TypeCode, + CORBA::TypeCode_var + > + (max, length, buffer, release) +{} + +Dynamic::ExceptionList::ExceptionList ( + const ExceptionList &seq + ) + : TAO_Unbounded_Object_Sequence< + CORBA::TypeCode, + CORBA::TypeCode_var + > + (seq) +{} + +Dynamic::ExceptionList::~ExceptionList (void) +{} + +void Dynamic::ExceptionList::_tao_any_destructor ( + void * _tao_void_pointer + ) +{ + ExceptionList * _tao_tmp_pointer = + static_cast (_tao_void_pointer); + delete _tao_tmp_pointer; +} + +#endif /* end #if !defined */ + +// TAO_IDL - Generated from +// be\be_visitor_sequence/cdr_op_cs.cpp:96 + +#if !defined _TAO_CDR_OP_Dynamic_ParameterList_CPP_ +#define _TAO_CDR_OP_Dynamic_ParameterList_CPP_ + +CORBA::Boolean operator<< ( + TAO_OutputCDR &strm, + const Dynamic::ParameterList &_tao_sequence + ) +{ + const CORBA::ULong _tao_seq_len = _tao_sequence.length (); + + if (strm << _tao_seq_len) + { + // Encode all elements. + CORBA::Boolean _tao_marshal_flag = true; + + for (CORBA::ULong i = 0; i < _tao_seq_len && _tao_marshal_flag; ++i) + { + _tao_marshal_flag = (strm << _tao_sequence[i]); + } + + return _tao_marshal_flag; + } + + return false; +} + +CORBA::Boolean operator>> ( + TAO_InputCDR &strm, + Dynamic::ParameterList &_tao_sequence + ) +{ + CORBA::ULong _tao_seq_len; + + if (strm >> _tao_seq_len) + { + // Add a check to the length of the sequence + // to make sure it does not exceed the length + // of the stream. (See bug 58.) + if (_tao_seq_len > strm.length ()) + { + return false; + } + + // Set the length of the sequence. + _tao_sequence.length (_tao_seq_len); + + // If length is 0 we return true. + if (0 >= _tao_seq_len) + { + return true; + } + + // Retrieve all the elements. + CORBA::Boolean _tao_marshal_flag = true; + + for (CORBA::ULong i = 0; i < _tao_seq_len && _tao_marshal_flag; ++i) + { + _tao_marshal_flag = (strm >> _tao_sequence[i]); + } + + return _tao_marshal_flag; + + } + + return false; +} + +#endif /* _TAO_CDR_OP_Dynamic_ParameterList_CPP_ */ + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/cdr_op_cs.cpp:96 + +#if !defined _TAO_CDR_OP_Dynamic_ExceptionList_CPP_ +#define _TAO_CDR_OP_Dynamic_ExceptionList_CPP_ + +CORBA::Boolean operator<< ( + TAO_OutputCDR &strm, + const Dynamic::ExceptionList &_tao_sequence + ) +{ + const CORBA::ULong _tao_seq_len = _tao_sequence.length (); + + if (strm << _tao_seq_len) + { + // Encode all elements. + CORBA::Boolean _tao_marshal_flag = true; + + for (CORBA::ULong i = 0; i < _tao_seq_len && _tao_marshal_flag; ++i) + { + _tao_marshal_flag = + TAO::Objref_Traits::marshal ( + _tao_sequence[i].in (), strm + ); + } + + return _tao_marshal_flag; + } + + return false; +} + +CORBA::Boolean operator>> ( + TAO_InputCDR &strm, + Dynamic::ExceptionList &_tao_sequence + ) +{ + CORBA::ULong _tao_seq_len; + + if (strm >> _tao_seq_len) + { + // Add a check to the length of the sequence + // to make sure it does not exceed the length + // of the stream. (See bug 58.) + if (_tao_seq_len > strm.length ()) + { + return false; + } + + // Set the length of the sequence. + _tao_sequence.length (_tao_seq_len); + + // If length is 0 we return true. + if (0 >= _tao_seq_len) + { + return true; + } + + // Retrieve all the elements. + CORBA::Boolean _tao_marshal_flag = true; + + for (CORBA::ULong i = 0; i < _tao_seq_len && _tao_marshal_flag; ++i) + { + _tao_marshal_flag = (strm >> _tao_sequence[i].out ()); + } + + return _tao_marshal_flag; + + } + + return false; +} + +#endif /* _TAO_CDR_OP_Dynamic_ExceptionList_CPP_ */ diff --git a/TAO/tao/AnyTypeCode/DynamicC.h b/TAO/tao/AnyTypeCode/DynamicC.h new file mode 100644 index 00000000000..17f4b599d19 --- /dev/null +++ b/TAO/tao/AnyTypeCode/DynamicC.h @@ -0,0 +1,266 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_DYNAMICC_H_ +#define _TAO_IDL_ORIG_DYNAMICC_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/ORB.h" +#include "tao/Environment.h" +#include "tao/AnyTypeCode/TypeCode.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/Sequence_T.h" +#include "tao/Objref_VarOut_T.h" +#include "tao/Seq_Var_T.h" +#include "tao/Seq_Out_T.h" + +#include "tao/StringSeqC.h" +#include "tao/AnyTypeCode/Dynamic_ParameterC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_interface.cpp:598 + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace Dynamic +{ + // TAO_IDL - Generated from + // be\be_visitor_sequence/sequence_ch.cpp:101 + +#if !defined (_DYNAMIC_PARAMETERLIST_CH_) +#define _DYNAMIC_PARAMETERLIST_CH_ + + class ParameterList; + + typedef + TAO_VarSeq_Var_T< + ParameterList, + Parameter + > + ParameterList_var; + + typedef + TAO_Seq_Out_T< + ParameterList, + ParameterList_var, + Parameter + > + ParameterList_out; + + class TAO_AnyTypeCode_Export ParameterList + : public + TAO_Unbounded_Sequence< + Parameter + > + { + public: + ParameterList (void); + ParameterList (CORBA::ULong max); + ParameterList ( + CORBA::ULong max, + CORBA::ULong length, + Parameter* buffer, + CORBA::Boolean release = 0 + ); + ParameterList (const ParameterList &); + ~ParameterList (void); + + static void _tao_any_destructor (void *); + + typedef ParameterList_var _var_type; + }; + +#endif /* end #if !defined */ + + + // TAO_IDL - Generated from + // be\be_visitor_typedef/typedef_ch.cpp:472 + + typedef CORBA::StringSeq ContextList; + typedef CORBA::StringSeq_var ContextList_var; + typedef CORBA::StringSeq_out ContextList_out; + + // TAO_IDL - Generated from + // be\be_visitor_sequence/sequence_ch.cpp:101 + +#if !defined (_DYNAMIC_EXCEPTIONLIST_CH_) +#define _DYNAMIC_EXCEPTIONLIST_CH_ + + class ExceptionList; + + typedef + TAO_MngSeq_Var_T< + ExceptionList, + TAO_Object_Manager< + CORBA::TypeCode, + CORBA::TypeCode_var + > + > + ExceptionList_var; + + typedef + TAO_MngSeq_Out_T< + ExceptionList, + ExceptionList_var, + TAO_Object_Manager< + CORBA::TypeCode, + CORBA::TypeCode_var + > + > + ExceptionList_out; + + class TAO_AnyTypeCode_Export ExceptionList + : public + TAO_Unbounded_Object_Sequence< + CORBA::TypeCode, + CORBA::TypeCode_var + > + { + public: + ExceptionList (void); + ExceptionList (CORBA::ULong max); + ExceptionList ( + CORBA::ULong max, + CORBA::ULong length, + CORBA::TypeCode_ptr* buffer, + CORBA::Boolean release = 0 + ); + ExceptionList (const ExceptionList &); + ~ExceptionList (void); + + static void _tao_any_destructor (void *); + + typedef ExceptionList_var _var_type; + }; + +#endif /* end #if !defined */ + + // TAO_IDL - Generated from + // be\be_visitor_typedef/typedef_ch.cpp:472 + + typedef CORBA::StringSeq RequestContext; + typedef CORBA::StringSeq_var RequestContext_var; + typedef CORBA::StringSeq_out RequestContext_out; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module Dynamic + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// TAO_IDL - Generated from +// be\be_visitor_sequence/cdr_op_ch.cpp:71 + +#if !defined _TAO_CDR_OP_Dynamic_ParameterList_H_ +#define _TAO_CDR_OP_Dynamic_ParameterList_H_ + +TAO_AnyTypeCode_Export CORBA::Boolean operator<< ( + TAO_OutputCDR &, + const Dynamic::ParameterList & + ); +TAO_AnyTypeCode_Export CORBA::Boolean operator>> ( + TAO_InputCDR &, + Dynamic::ParameterList & + ); + +#endif /* _TAO_CDR_OP_Dynamic_ParameterList_H_ */ + + +// Traits specializations. +// TAO_IDL - Generated from +// be\be_visitor_sequence/cdr_op_ch.cpp:71 + +#if !defined _TAO_CDR_OP_Dynamic_ExceptionList_H_ +#define _TAO_CDR_OP_Dynamic_ExceptionList_H_ + +TAO_AnyTypeCode_Export CORBA::Boolean operator<< ( + TAO_OutputCDR &, + const Dynamic::ExceptionList & + ); +TAO_AnyTypeCode_Export CORBA::Boolean operator>> ( + TAO_InputCDR &, + Dynamic::ExceptionList & + ); + +#endif /* _TAO_CDR_OP_Dynamic_ExceptionList_H_ */ + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/DynamicS.h b/TAO/tao/AnyTypeCode/DynamicS.h new file mode 100644 index 00000000000..17b1360599e --- /dev/null +++ b/TAO/tao/AnyTypeCode/DynamicS.h @@ -0,0 +1,28 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// Skeleton file generation suppressed with command line option -SS diff --git a/TAO/tao/AnyTypeCode/Dynamic_Parameter.pidl b/TAO/tao/AnyTypeCode/Dynamic_Parameter.pidl new file mode 100644 index 00000000000..f82dd8ba366 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Dynamic_Parameter.pidl @@ -0,0 +1,41 @@ +// -*- IDL -*- + +// ================================================================ +/** + * @file Dynamic_Parameter.pidl + * + * $Id$ + * + * This file was used to generate the code in Dynamic_ParameterC.* The command + * used to generate code is: + * + * tao_idl + * -o orig -Ge 1 -GA -Sc -Sci + * -Wb,export_macro=TAO_Export + * -Wb,export_include="tao/TAO_Export.h" + * -Wb,pre_include="ace/pre.h" + * -Wb,post_include="ace/post.h" + * Dynamic_Parameter.pidl + * + */ +// ================================================================ + +// File: Dynamic_Parameter.idl +// Piece of module Dynamic generated separately for use by +// template argument helper classes. + +#ifndef _DYNAMIC_PARAMETER_IDL_ +#define _DYNAMIC_PARAMETER_IDL_ + +#include + +module Dynamic +{ + struct Parameter + { + any argument; + CORBA::ParameterMode mode; + }; +}; + +#endif // _DYNAMIC_PARAMETER_IDL_ diff --git a/TAO/tao/AnyTypeCode/Dynamic_ParameterA.cpp b/TAO/tao/AnyTypeCode/Dynamic_ParameterA.cpp new file mode 100644 index 00000000000..df1f94abd24 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Dynamic_ParameterA.cpp @@ -0,0 +1,124 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "Dynamic_ParameterA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Struct_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/AnyTypeCode/Recursive_Type_TypeCode.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" +#include "tao/AnyTypeCode/ParameterModeA.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + +static TAO::TypeCode::Struct_Field const _tao_fields_Dynamic_Parameter[] = + { + { "argument", &CORBA::_tc_any }, + { "mode", &CORBA::_tc_ParameterMode } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_Dynamic_Parameter ( + CORBA::tk_struct, + "IDL:Dynamic/Parameter:1.0", + "Parameter", + _tao_fields_Dynamic_Parameter, + 2); + +namespace Dynamic +{ + ::CORBA::TypeCode_ptr const _tc_Parameter = + &_tao_tc_Dynamic_Parameter; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const Dynamic::Parameter &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + Dynamic::Parameter::_tao_any_destructor, + Dynamic::_tc_Parameter, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + Dynamic::Parameter *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + Dynamic::Parameter::_tao_any_destructor, + Dynamic::_tc_Parameter, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + Dynamic::Parameter *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const Dynamic::Parameter *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const Dynamic::Parameter *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + Dynamic::Parameter::_tao_any_destructor, + Dynamic::_tc_Parameter, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/Dynamic_ParameterA.h b/TAO/tao/AnyTypeCode/Dynamic_ParameterA.h new file mode 100644 index 00000000000..25b861466fd --- /dev/null +++ b/TAO/tao/AnyTypeCode/Dynamic_ParameterA.h @@ -0,0 +1,104 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_DYNAMIC_PARAMETERA_H_ +#define _TAO_IDL_ORIG_DYNAMIC_PARAMETERA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/AnyTypeCode/Dynamic_ParameterC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace Dynamic +{ + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_Parameter; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module Dynamic + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const Dynamic::Parameter &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, Dynamic::Parameter*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, Dynamic::Parameter *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const Dynamic::Parameter *&); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/Dynamic_ParameterC.cpp b/TAO/tao/AnyTypeCode/Dynamic_ParameterC.cpp new file mode 100644 index 00000000000..b681433ed5e --- /dev/null +++ b/TAO/tao/AnyTypeCode/Dynamic_ParameterC.cpp @@ -0,0 +1,82 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:291 + + +#include "Dynamic_ParameterC.h" +#include "tao/CDR.h" + +#if defined (__BORLANDC__) +#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_arg_traits.cpp:70 + +// Arg traits specializations. +namespace TAO +{ +} + + +// TAO_IDL - Generated from +// be\be_visitor_structure/structure_cs.cpp:66 + +void +Dynamic::Parameter::_tao_any_destructor ( + void *_tao_void_pointer + ) +{ + Parameter *_tao_tmp_pointer = + static_cast (_tao_void_pointer); + delete _tao_tmp_pointer; +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/cdr_op_cs.cpp:61 + +CORBA::Boolean operator<< ( + TAO_OutputCDR &strm, + const Dynamic::Parameter &_tao_aggregate + ) +{ + return + (strm << _tao_aggregate.argument) && + (strm << _tao_aggregate.mode); +} + +CORBA::Boolean operator>> ( + TAO_InputCDR &strm, + Dynamic::Parameter &_tao_aggregate + ) +{ + return + (strm >> _tao_aggregate.argument) && + (strm >> _tao_aggregate.mode); +} diff --git a/TAO/tao/AnyTypeCode/Dynamic_ParameterC.h b/TAO/tao/AnyTypeCode/Dynamic_ParameterC.h new file mode 100644 index 00000000000..7c817d56670 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Dynamic_ParameterC.h @@ -0,0 +1,136 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_DYNAMIC_PARAMETERC_H_ +#define _TAO_IDL_ORIG_DYNAMIC_PARAMETERC_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/ORB.h" +#include "tao/Environment.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/VarOut_T.h" + +#include "tao/ParameterModeC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace Dynamic +{ + + // TAO_IDL - Generated from + // be\be_type.cpp:258 + + struct Parameter; + + typedef + TAO_Var_Var_T< + Parameter + > + Parameter_var; + + typedef + TAO_Out_T< + Parameter, + Parameter_var + > + Parameter_out; + + // TAO_IDL - Generated from + // be\be_visitor_structure/structure_ch.cpp:52 + + struct TAO_AnyTypeCode_Export Parameter + { + typedef Parameter_var _var_type; + + static void _tao_any_destructor (void *); + CORBA::Any argument; + CORBA::ParameterMode mode; + }; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module Dynamic + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/cdr_op_ch.cpp:54 + +TAO_AnyTypeCode_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const Dynamic::Parameter &); +TAO_AnyTypeCode_Export CORBA::Boolean operator>> (TAO_InputCDR &, Dynamic::Parameter &); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/Empty_Param_TypeCode.cpp b/TAO/tao/AnyTypeCode/Empty_Param_TypeCode.cpp new file mode 100644 index 00000000000..6f9f5589c15 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Empty_Param_TypeCode.cpp @@ -0,0 +1,83 @@ +// $Id$ + +#include "Empty_Param_TypeCode.h" + +#ifndef __ACE_INLINE__ +# include "Empty_Param_TypeCode.inl" +#endif /* !__ACE_INLINE__ */ + + +ACE_RCSID (tao, + Empty_Param_TypeCode, + "$Id$") + + +bool +TAO::TypeCode::Empty_Param::tao_marshal (TAO_OutputCDR &, + CORBA::ULong) const +{ + // Empty parameter list. Nothing to marshal. + + return true; +} + +void +TAO::TypeCode::Empty_Param::tao_duplicate (void) +{ + // No-op since empty parameter TypeCodes are never created + // dynamically, meaning there is no need to implement reference + // counting. +} + +void +TAO::TypeCode::Empty_Param::tao_release (void) +{ + // No-op since empty parameter TypeCodes are never created + // dynamically, meaning there is no need to implement reference + // counting. +} + +CORBA::Boolean +TAO::TypeCode::Empty_Param::equal_i (CORBA::TypeCode_ptr + ACE_ENV_ARG_DECL_NOT_USED) const +{ + // Equality has already been established in the + // CORBA::TypeCode base class. + + return 1; +} + +CORBA::Boolean +TAO::TypeCode::Empty_Param::equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // We could refactor this code to the CORBA::TypeCode::equivalent() + // method but doing so would force us to determine the unaliased + // kind of this TypeCode. Since we already know the unaliased kind + // of this TypeCode, choose to optimize away the additional kind + // unaliasing operation rather than save space. + + CORBA::TCKind const tc_kind = + TAO::unaliased_kind (tc + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_kind != this->kind_) + return 0; + + return 1; +} + +CORBA::TypeCode_ptr +TAO::TypeCode::Empty_Param::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Already compact since parameter list is empty. + + // Since empty parameter TypeCodes are never created + // dynamically, there is no need to manipulate a reference count. + + static TAO::TypeCode::Empty_Param compact_typecode (this->kind_); + + return &compact_typecode; +} diff --git a/TAO/tao/AnyTypeCode/Empty_Param_TypeCode.h b/TAO/tao/AnyTypeCode/Empty_Param_TypeCode.h new file mode 100644 index 00000000000..0f1c251091b --- /dev/null +++ b/TAO/tao/AnyTypeCode/Empty_Param_TypeCode.h @@ -0,0 +1,98 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Empty_Param_TypeCode.h + * + * $Id$ + * + * Header file for @c CORBA::TypeCodes with empty parameter lists. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_EMPTY_PARAM_TYPECODE_H +#define TAO_EMPTY_PARAM_TYPECODE_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace TAO +{ + namespace TypeCode + { + + /** + * @class Empty_Param + * + * @brief @c CORBA::TypeCode implementation for OMG IDL types with + * empty parameter lists. + * + * This class implements a @c CORBA::TypeCode for OMG IDL types + * with empty parameter lists. + * + * @note @c Empty_Param @c TypeCodes are not reference counted in + * TAO since they are static, exist as constants for the + * length of a given OS process, and cannot be created + * through the @c CORBA::ORB or @c CORBA::TypeCodeFactory + * interfaces. + */ + class Empty_Param : public CORBA::TypeCode + { + public: + + /// Constructor. + Empty_Param (CORBA::TCKind k); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c CORBA::TypeCode template methods specific to @c TypeCodes + * with empty parameter lists. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/Empty_Param_TypeCode.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* TAO_EMPTY_PARAM_TYPECODE_H */ diff --git a/TAO/tao/AnyTypeCode/Empty_Param_TypeCode.inl b/TAO/tao/AnyTypeCode/Empty_Param_TypeCode.inl new file mode 100644 index 00000000000..85ec45fd029 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Empty_Param_TypeCode.inl @@ -0,0 +1,10 @@ +// -*- C++ -*- +// +// $Id$ + + +ACE_INLINE +TAO::TypeCode::Empty_Param::Empty_Param (CORBA::TCKind k) + : CORBA::TypeCode (k) +{ +} diff --git a/TAO/tao/AnyTypeCode/Enum_TypeCode.cpp b/TAO/tao/AnyTypeCode/Enum_TypeCode.cpp new file mode 100644 index 00000000000..112f3cc463e --- /dev/null +++ b/TAO/tao/AnyTypeCode/Enum_TypeCode.cpp @@ -0,0 +1,221 @@ +// $Id$ + +#ifndef TAO_ENUM_TYPECODE_CPP +#define TAO_ENUM_TYPECODE_CPP + +#include "tao/AnyTypeCode/Enum_TypeCode.h" +#include "tao/AnyTypeCode/TypeCode_Traits.h" +#include "tao/TypeCodeFactory_Adapter.h" +#include "tao/ORB_Core.h" +#include "tao/CDR.h" + +#include "ace/Dynamic_Service.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/Enum_TypeCode.inl" +#endif /* !__ACE_INLINE__ */ + + +template +bool +TAO::TypeCode::Enum::tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong) const +{ + // A tk_enum TypeCode has a "complex" parameter list type (see + // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of + // the CORBA specification), meaning that it must be marshaled into + // a CDR encapsulation. + + // Create a CDR encapsulation. + TAO_OutputCDR enc; + + bool const success = + (enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.id (), 0)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.name (), 0)) + && (enc << this->nenumerators_); + + if (!success) + return false; + + StringType const * const begin = &this->enumerators_[0]; + StringType const * const end = begin + this->nenumerators_; + + for (StringType const * i = begin; i != end; ++i) + { + StringType const & enumerator = *i; + + if (!(enc << TAO_OutputCDR::from_string ( + Traits::get_string (enumerator), 0))) + return false; + } + + return + cdr << static_cast (enc.total_length ()) + && cdr.write_octet_array_mb (enc.begin ()); +} + +template +void +TAO::TypeCode::Enum::tao_duplicate (void) +{ + this->RefCountPolicy::add_ref (); +} + +template +void +TAO::TypeCode::Enum::tao_release (void) +{ + this->RefCountPolicy::remove_ref (); +} + +template +CORBA::Boolean +TAO::TypeCode::Enum::equal_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // This call shouldn't throw since CORBA::TypeCode::equal() verified + // that the TCKind is the same as our's prior to invoking this + // method, meaning that member_count() is supported. + + CORBA::ULong const tc_nenumerators = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_nenumerators != this->nenumerators_) + return 0; + + for (CORBA::ULong i = 0; i < this->nenumerators_; ++i) + { + StringType const & lhs_enumerator = this->enumerators_[i]; + + char const * const lhs_name = + Traits::get_string (lhs_enumerator); + char const * const rhs_name = tc->member_name (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (ACE_OS::strcmp (lhs_name, rhs_name) != 0) + return 0; + } + + return 1; +} + +template +CORBA::Boolean +TAO::TypeCode::Enum::equivalent_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // Perform a structural comparison, excluding the name() and + // member_name() operations. + + CORBA::ULong const tc_nenumerators = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_nenumerators != this->nenumerators_) + return 0; + + return 1; +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::Enum::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_Array_Base tc_enumerators (this->nenumerators_); + + // Dynamically construct a new array of enumerators stripped of + // member names. + + static char const empty_name[] = ""; + + for (CORBA::ULong i = 0; i < this->nenumerators_; ++i) + { + // Member names will be stripped, i.e. not embedded within + // the compact TypeCode. + + tc_enumerators[i] = empty_name; + } + + TAO_TypeCodeFactory_Adapter * adapter = + ACE_Dynamic_Service::instance ( + TAO_ORB_Core::typecodefactory_adapter_name ()); + + if (adapter == 0) + { + ACE_THROW_RETURN (CORBA::INTERNAL (), + CORBA::TypeCode::_nil ()); + } + + return + adapter->create_enum_tc (this->base_attributes_.id (), + "" /* empty name */, + tc_enumerators, + this->nenumerators_ + ACE_ENV_ARG_PARAMETER); +} + +template +char const * +TAO::TypeCode::Enum::id_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.id (); +} + +template +char const * +TAO::TypeCode::Enum::name_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.name (); +} + +template +CORBA::ULong +TAO::TypeCode::Enum::member_count_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->nenumerators_; +} + +template +char const * +TAO::TypeCode::Enum::member_name_i ( + CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + if (index >= this->nenumerators_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), 0); + + return Traits::get_string (this->enumerators_[index]); +} + +#endif /* TAO_ENUM_TYPECODE_CPP */ diff --git a/TAO/tao/AnyTypeCode/Enum_TypeCode.h b/TAO/tao/AnyTypeCode/Enum_TypeCode.h new file mode 100644 index 00000000000..e85387209d6 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Enum_TypeCode.h @@ -0,0 +1,141 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Enum_TypeCode.h + * + * $Id$ + * + * Header file for a @c tk_enum CORBA::TypeCode. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_ENUM_TYPECODE_H +#define TAO_ENUM_TYPECODE_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TypeCode_Base_Attributes.h" + + +namespace TAO +{ + namespace TypeCode + { + /** + * @class Enum + * + * @brief @c CORBA::TypeCode implementation for an OMG IDL + * @c enum. + * + * This class implements a @c CORBA::TypeCode for an OMG IDL + * @c enum. + */ + template + class Enum + : public CORBA::TypeCode, + private RefCountPolicy + { + public: + + /// Constructor. + Enum (char const * id, + char const * name, + EnumeratorArrayType const & enumerators, + CORBA::ULong nenumerators); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c tk_enum @c CORBA::TypeCode -specific template methods. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * name_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::ULong member_count_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * member_name_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + //@} + + private: + + /** + * @c Enum Attributes + * + * Attributes representing the structure of an OMG IDL + * @c enum. + * + * @note These attributes are declared in the order in which + * they are marshaled into a CDR stream in order to + * increase cache hits by improving spatial locality. + */ + //@{ + + /// Base attributes containing repository ID and name of + /// structure type. + Base_Attributes base_attributes_; + + /// The number of enumerators in the OMG IDL enumeration. + CORBA::ULong const nenumerators_; + + /// Array of @c TAO::TypeCode enumerators representing + /// enumerators in the OMG IDL defined @c enum. + EnumeratorArrayType const enumerators_; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/Enum_TypeCode.inl" +#endif /* __ACE_INLINE__ */ + +#ifdef ACE_TEMPLATES_REQUIRE_SOURCE +# include "tao/AnyTypeCode/Enum_TypeCode.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA +# pragma implementation ("Enum_TypeCode.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + + +#include /**/ "ace/post.h" + +#endif /* TAO_ENUM_TYPECODE_H */ diff --git a/TAO/tao/AnyTypeCode/Enum_TypeCode.inl b/TAO/tao/AnyTypeCode/Enum_TypeCode.inl new file mode 100644 index 00000000000..8b8e04f8632 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Enum_TypeCode.inl @@ -0,0 +1,21 @@ +// -*- C++ -*- +// +// $Id$ + + +template +ACE_INLINE +TAO::TypeCode::Enum::Enum ( + char const * id, + char const * name, + EnumeratorArrayType const & enumerators, + CORBA::ULong nenumerators) + : CORBA::TypeCode (CORBA::tk_enum) + , RefCountPolicy () + , base_attributes_ (id, name) + , nenumerators_ (nenumerators) + , enumerators_ (enumerators) +{ +} diff --git a/TAO/tao/AnyTypeCode/Enum_TypeCode_Static.cpp b/TAO/tao/AnyTypeCode/Enum_TypeCode_Static.cpp new file mode 100644 index 00000000000..930fb10eaf2 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Enum_TypeCode_Static.cpp @@ -0,0 +1,214 @@ +// $Id$ + +#include "tao/AnyTypeCode/Enum_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Traits.h" +#include "tao/ORB_Core.h" +#include "tao/CDR.h" +#include "tao/TypeCodeFactory_Adapter.h" + +#include "ace/Dynamic_Service.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/Enum_TypeCode_Static.inl" +#endif /* !__ACE_INLINE__ */ + + +ACE_RCSID (tao, + Enum_TypeCode_Static, + "$Id$") + + +bool +TAO::TypeCode::Enum::tao_marshal ( + TAO_OutputCDR & cdr, + CORBA::ULong) const +{ + // A tk_enum TypeCode has a "complex" parameter list type (see + // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of + // the CORBA specification), meaning that it must be marshaled into + // a CDR encapsulation. + + // Create a CDR encapsulation. + TAO_OutputCDR enc; + + bool const success = + (enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.id (), 0)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.name (), 0)) + && (enc << this->nenumerators_); + + if (!success) + return false; + + char const * const * const begin = &this->enumerators_[0]; + char const * const * const end = begin + this->nenumerators_; + + for (char const * const * i = begin; i != end; ++i) + { + char const * const & enumerator = *i; + + if (!(enc << TAO_OutputCDR::from_string ( + Traits::get_string (enumerator), 0))) + return false; + } + + return + cdr << static_cast (enc.total_length ()) + && cdr.write_octet_array_mb (enc.begin ()); +} + +void +TAO::TypeCode::Enum::tao_duplicate (void) +{ +} + +void +TAO::TypeCode::Enum::tao_release (void) +{ +} + +CORBA::Boolean +TAO::TypeCode::Enum::equal_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // This call shouldn't throw since CORBA::TypeCode::equal() verified + // that the TCKind is the same as our's prior to invoking this + // method, meaning that member_count() is supported. + + CORBA::ULong const tc_nenumerators = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_nenumerators != this->nenumerators_) + return 0; + + for (CORBA::ULong i = 0; i < this->nenumerators_; ++i) + { + char const * const & lhs_enumerator = this->enumerators_[i]; + + char const * const lhs_name = + Traits::get_string (lhs_enumerator); + char const * const rhs_name = tc->member_name (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (ACE_OS::strcmp (lhs_name, rhs_name) != 0) + return 0; + } + + return 1; +} + +CORBA::Boolean +TAO::TypeCode::Enum::equivalent_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // Perform a structural comparison, excluding the name() and + // member_name() operations. + + CORBA::ULong const tc_nenumerators = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_nenumerators != this->nenumerators_) + return 0; + + return 1; +} + +CORBA::TypeCode_ptr +TAO::TypeCode::Enum::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_Array_Base tc_enumerators (this->nenumerators_); + + // Dynamically construct a new array of enumerators stripped of + // member names. + + static char const empty_name[] = ""; + + for (CORBA::ULong i = 0; i < this->nenumerators_; ++i) + { + // Member names will be stripped, i.e. not embedded within + // the compact TypeCode. + + tc_enumerators[i] = empty_name; + } + + TAO_TypeCodeFactory_Adapter * adapter = + ACE_Dynamic_Service::instance ( + TAO_ORB_Core::typecodefactory_adapter_name ()); + + if (adapter == 0) + { + ACE_THROW_RETURN (CORBA::INTERNAL (), + CORBA::TypeCode::_nil ()); + } + + return + adapter->create_enum_tc (this->base_attributes_.id (), + "" /* empty name */, + tc_enumerators, + this->nenumerators_ + ACE_ENV_ARG_PARAMETER); +} + +char const * +TAO::TypeCode::Enum::id_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.id (); +} + +char const * +TAO::TypeCode::Enum::name_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.name (); +} + +CORBA::ULong +TAO::TypeCode::Enum::member_count_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->nenumerators_; +} + +char const * +TAO::TypeCode::Enum::member_name_i ( + CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + if (index >= this->nenumerators_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), 0); + + return Traits::get_string (this->enumerators_[index]); +} diff --git a/TAO/tao/AnyTypeCode/Enum_TypeCode_Static.h b/TAO/tao/AnyTypeCode/Enum_TypeCode_Static.h new file mode 100644 index 00000000000..e8b78607c85 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Enum_TypeCode_Static.h @@ -0,0 +1,137 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Enum_TypeCode_Static.h + * + * $Id$ + * + * Header file for a static @c tk_enum CORBA::TypeCode. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_ENUM_TYPECODE_STATIC_H +#define TAO_ENUM_TYPECODE_STATIC_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TypeCode_Base_Attributes.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" + + +namespace TAO +{ + namespace TypeCode + { + template class Enum; + + /** + * @class Enum + * + * @brief @c CORBA::TypeCode implementation for an OMG IDL + * @c enum. + * + * This class implements a @c CORBA::TypeCode for an OMG IDL + * @c enum. + */ + template<> + class TAO_AnyTypeCode_Export Enum + : public CORBA::TypeCode, + private TAO::Null_RefCount_Policy + { + public: + + /// Constructor. + Enum (char const * id, + char const * name, + char const * const * enumerators, + CORBA::ULong nenumerators); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c tk_enum @c CORBA::TypeCode -specific template methods. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * name_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::ULong member_count_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * member_name_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + //@} + + private: + + /** + * @c Enum Attributes + * + * Attributes representing the structure of an OMG IDL + * @c enum. + * + * @note These attributes are declared in the order in which + * they are marshaled into a CDR stream in order to + * increase cache hits by improving spatial locality. + */ + //@{ + + /// Base attributes containing repository ID and name of + /// structure type. + Base_Attributes base_attributes_; + + /// The number of enumerators in the OMG IDL enumeration. + CORBA::ULong const nenumerators_; + + /// Array of @c TAO::TypeCode enumerators representing + /// enumerators in the OMG IDL defined @c enum. + char const * const * const enumerators_; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/Enum_TypeCode_Static.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* TAO_ENUM_TYPECODE_STATIC_H */ diff --git a/TAO/tao/AnyTypeCode/Enum_TypeCode_Static.inl b/TAO/tao/AnyTypeCode/Enum_TypeCode_Static.inl new file mode 100644 index 00000000000..1d2ab5ca8cb --- /dev/null +++ b/TAO/tao/AnyTypeCode/Enum_TypeCode_Static.inl @@ -0,0 +1,20 @@ +// -*- C++ -*- +// +// $Id$ + + +ACE_INLINE +TAO::TypeCode::Enum::Enum ( + char const * id, + char const * name, + char const * const * enumerators, + CORBA::ULong nenumerators) + : CORBA::TypeCode (CORBA::tk_enum) + , ACE_NESTED_CLASS (TAO, Null_RefCount_Policy) () + , base_attributes_ (id, name) + , nenumerators_ (nenumerators) + , enumerators_ (enumerators) +{ +} diff --git a/TAO/tao/AnyTypeCode/ExceptionA.cpp b/TAO/tao/AnyTypeCode/ExceptionA.cpp new file mode 100644 index 00000000000..ba97c942cdb --- /dev/null +++ b/TAO/tao/AnyTypeCode/ExceptionA.cpp @@ -0,0 +1,118 @@ +// $Id$ + +#include "ExceptionA.h" +#include "Any_Dual_Impl_T.h" +#include "tao/SystemException.h" +#include "tao/Environment.h" +#include "tao/ORB_Constants.h" +#include "tao/CORBA_String.h" +#include "tao/CDR.h" +#include "tao/debug.h" + +#include "ace/Malloc.h" +#include "ace/SString.h" +#include "ace/OS_NS_string.h" + +#include "ace/OS_NS_stdio.h" + +ACE_RCSID (tao, + Exception, + "$Id$") + + +// Specializations for CORBA::Exception Any operators. +namespace TAO +{ + template<> + void + Any_Dual_Impl_T::value ( + const CORBA::Exception & val + ) + { + this->value_ = val._tao_duplicate (); + } + + template<> + CORBA::Boolean + Any_Dual_Impl_T::marshal_value (TAO_OutputCDR &cdr) + { + ACE_TRY_NEW_ENV + { + this->value_->_tao_encode (cdr + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + return 1; + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + return 0; + } + + template<> + CORBA::Boolean + Any_Dual_Impl_T::demarshal_value (TAO_InputCDR &cdr) + { + ACE_TRY_NEW_ENV + { + this->value_->_tao_decode (cdr + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + return 1; + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + return 0; + } + + // This should never get called since we don't have extraction operators + // for CORBA::Exception, but it is here to sidestep the constructor call + // in the unspecialized version that causes a problem with compilers that + // require explicit instantiation + template<> + CORBA::Boolean + Any_Dual_Impl_T::extract ( + const CORBA::Any &, + _tao_destructor, + CORBA::TypeCode_ptr, + const CORBA::Exception *& + ) + { + return 0; + } +} + +// ======================================================================= + + +// Insertion of CORBA::Exception - copying. +void +operator<<= (CORBA::Any &any, const CORBA::Exception &exception) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + any, + CORBA::Exception::_tao_any_destructor, + exception._tao_type (), + exception + ); +} + +// Insertion of CORBA::Exception - non-copying. +void +operator<<= (CORBA::Any &any, CORBA::Exception *exception) +{ + TAO::Any_Dual_Impl_T::insert ( + any, + CORBA::Exception::_tao_any_destructor, + exception->_tao_type (), + exception + ); +} + diff --git a/TAO/tao/AnyTypeCode/ExceptionA.h b/TAO/tao/AnyTypeCode/ExceptionA.h new file mode 100644 index 00000000000..05d608f4403 --- /dev/null +++ b/TAO/tao/AnyTypeCode/ExceptionA.h @@ -0,0 +1,49 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file ExceptionA.h + * + * $Id$ + * + * This file defines way in which CORBA exceptions are reported. + * + * @author DOC Group at Vanderbilt U., Wash U, and UCI + */ +//============================================================================= + +#ifndef TAO_EXCEPTIONA_H +#define TAO_EXCEPTIONA_H + +#include /**/ "ace/pre.h" + +// Do not try removing this. If you remove this for subsetting lots of +// things go wrong in TAO. +#include "tao/orbconf.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +// This is used in the implementation of the _raise methods +#if defined (TAO_HAS_EXCEPTIONS) +#define TAO_RAISE(EXCEPTION) throw EXCEPTION +#else +#define TAO_RAISE(EXCEPTION) +#endif /* ACE_HAS_EXCEPTIONS */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/Exception.h" + +namespace CORBA +{ + class Any; + typedef Any *Any_ptr; +} + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::Exception &); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::Exception *); + +#include /**/"ace/post.h" + +#endif /* TAO_EXCEPTIONA_H */ diff --git a/TAO/tao/AnyTypeCode/Fixed_TypeCode.cpp b/TAO/tao/AnyTypeCode/Fixed_TypeCode.cpp new file mode 100644 index 00000000000..d0adfdcb7b0 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Fixed_TypeCode.cpp @@ -0,0 +1,111 @@ +// $Id$ + +#ifndef TAO_FIXED_TYPECODE_CPP +#define TAO_FIXED_TYPECODE_CPP + +#include "tao/AnyTypeCode/Fixed_TypeCode.h" +#include "tao/CDR.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/Fixed_TypeCode.inl" +#endif /* !__ACE_INLINE__ */ + + +template +bool +TAO::TypeCode::Fixed::tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong) const +{ + // A tk_fixed TypeCode has a "simple" parameter list type (see + // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of + // the CORBA specification), meaning that its parameter(s) must be + // marshaled immediately following the TCKind. No CDR encapsulation + // is to be created. + + return (cdr << this->digits_) && (cdr << this->scale_); +} + +template +void +TAO::TypeCode::Fixed::tao_duplicate (void) +{ + this->RefCountPolicy::add_ref (); +} + +template +void +TAO::TypeCode::Fixed::tao_release (void) +{ + this->RefCountPolicy::remove_ref (); +} + +template +CORBA::Boolean +TAO::TypeCode::Fixed::equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // The following call won't throw since CORBA::TypeCode::equal() has + // already established the kind of tc is the same as our kind. + CORBA::UShort const tc_digits = + tc->fixed_digits (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::UShort const tc_scale = + tc->fixed_scale (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return (this->digits_ == tc_digits + && this->scale_ == tc_scale); +} + +template +CORBA::Boolean +TAO::TypeCode::Fixed::equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // Since TCKind comparisons must be performed before equal_i() is + // called, we can also call it to determine equivalence of + // tk_fixed TypeCodes. + return this->equal_i (tc + ACE_ENV_ARG_PARAMETER); +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::Fixed::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Already compact since tk_fixed TypeCodes have no name or member + // names, meaning that we can simply call _duplicate() on this + // TypeCode. + + + // @@ There is a potential problem here if this TypeCode is a static + // and const since it may have been placed in read-only memory by + // the compiler. A const_cast<> can return undefined results in + // that case. + + CORBA::TypeCode_ptr mutable_tc = + const_cast *> (this); + + return CORBA::TypeCode::_duplicate (mutable_tc); +} + +template +CORBA::UShort +TAO::TypeCode::Fixed::fixed_digits_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->digits_; +} + +template +CORBA::UShort +TAO::TypeCode::Fixed::fixed_scale_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->scale_; +} + + +#endif /* TAO_FIXED_TYPECODE_CPP */ diff --git a/TAO/tao/AnyTypeCode/Fixed_TypeCode.h b/TAO/tao/AnyTypeCode/Fixed_TypeCode.h new file mode 100644 index 00000000000..740ae58de8e --- /dev/null +++ b/TAO/tao/AnyTypeCode/Fixed_TypeCode.h @@ -0,0 +1,114 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Fixed_TypeCode.h + * + * $Id$ + * + * Header file for @c CORBA::tk_fixed @c CORBA::TypeCodes. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_FIXED_TYPECODE_H +#define TAO_FIXED_TYPECODE_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace TAO +{ + namespace TypeCode + { + + /** + * @class Fixed + * + * @brief @c CORBA::TypeCode implementation for the OMG IDL @fixed + * types. + * + * This class implements a @c CORBA::TypeCode for the OMG IDL @c + * fixed types. + */ + template + class Fixed + : public CORBA::TypeCode + , private RefCountPolicy + { + public: + + /// Constructor. + Fixed (CORBA::UShort digits, CORBA::UShort scale); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c CORBA::TypeCode template methods specific to @c tk_fixed + * @c TypeCodes. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::UShort fixed_digits_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::UShort fixed_scale_i (ACE_ENV_SINGLE_ARG_DECL) const; + + private: + + /// The number of significant digits. + CORBA::UShort const digits_; + + /// The scale factor. + CORBA::UShort const scale_; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/Fixed_TypeCode.inl" +#endif /* __ACE_INLINE__ */ + +#ifdef ACE_TEMPLATES_REQUIRE_SOURCE +# include "tao/AnyTypeCode/Fixed_TypeCode.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA +# pragma implementation ("Fixed_TypeCode.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + + +#include /**/ "ace/post.h" + +#endif /* TAO_FIXED_TYPECODE_H */ diff --git a/TAO/tao/AnyTypeCode/Fixed_TypeCode.inl b/TAO/tao/AnyTypeCode/Fixed_TypeCode.inl new file mode 100644 index 00000000000..9db9ca2b26d --- /dev/null +++ b/TAO/tao/AnyTypeCode/Fixed_TypeCode.inl @@ -0,0 +1,14 @@ +// -*- C++ -*- +// +// $Id$ + +template +ACE_INLINE +TAO::TypeCode::Fixed::Fixed (CORBA::UShort digits, + CORBA::UShort scale) + : CORBA::TypeCode (CORBA::tk_fixed) + , RefCountPolicy () + , digits_ (digits) + , scale_ (scale) +{ +} diff --git a/TAO/tao/AnyTypeCode/FloatSeqA.cpp b/TAO/tao/AnyTypeCode/FloatSeqA.cpp new file mode 100644 index 00000000000..8e3ea6c5f24 --- /dev/null +++ b/TAO/tao/AnyTypeCode/FloatSeqA.cpp @@ -0,0 +1,142 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "FloatSeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_FloatSeq_GUARD +#define _TAO_TYPECODE_CORBA_FloatSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_FloatSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_float, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_FloatSeq_0 = + &CORBA_FloatSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_FloatSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_FloatSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/FloatSeq:1.0", + "FloatSeq", + &TAO::TypeCode::tc_CORBA_FloatSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_FloatSeq = + &_tao_tc_CORBA_FloatSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::FloatSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::FloatSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_FloatSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::FloatSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::FloatSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_FloatSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::FloatSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::FloatSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::FloatSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::FloatSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_FloatSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/FloatSeqA.h b/TAO/tao/AnyTypeCode/FloatSeqA.h new file mode 100644 index 00000000000..170afcdd2ca --- /dev/null +++ b/TAO/tao/AnyTypeCode/FloatSeqA.h @@ -0,0 +1,66 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:788 + +#ifndef _TAO_IDL_ANYTYPECODE_FLOATSEQA_H_ +#define _TAO_IDL_ANYTYPECODE_FLOATSEQA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/FloatSeqC.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_FloatSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::FloatSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::FloatSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::FloatSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::FloatSeq *&); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/GIOPA.cpp b/TAO/tao/AnyTypeCode/GIOPA.cpp new file mode 100644 index 00000000000..2e6898c7486 --- /dev/null +++ b/TAO/tao/AnyTypeCode/GIOPA.cpp @@ -0,0 +1,328 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "GIOPA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/String_TypeCode_Static.h" +#include "tao/AnyTypeCode/Struct_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/AnyTypeCode/TypeCode_Case_T.h" +#include "tao/AnyTypeCode/Union_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_GIOP_AddressingDisposition ( + CORBA::tk_alias, + "IDL:omg.org/GIOP/AddressingDisposition:1.0", + "AddressingDisposition", + &CORBA::_tc_short); + +namespace GIOP +{ + ::CORBA::TypeCode_ptr const _tc_AddressingDisposition = + &_tao_tc_GIOP_AddressingDisposition; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + +static TAO::TypeCode::Struct_Field const _tao_fields_GIOP_Version[] = + { + { "major", &CORBA::_tc_octet }, + { "minor", &CORBA::_tc_octet } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_GIOP_Version ( + CORBA::tk_struct, + "IDL:omg.org/GIOP/Version:1.0", + "Version", + _tao_fields_GIOP_Version, + 2); + +namespace GIOP +{ + ::CORBA::TypeCode_ptr const _tc_Version = + &_tao_tc_GIOP_Version; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + +static TAO::TypeCode::Struct_Field const _tao_fields_GIOP_IORAddressingInfo[] = + { + { "selected_profile_index", &CORBA::_tc_ulong }, + { "ior", &IOP::_tc_IOR } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_GIOP_IORAddressingInfo ( + CORBA::tk_struct, + "IDL:omg.org/GIOP/IORAddressingInfo:1.0", + "IORAddressingInfo", + _tao_fields_GIOP_IORAddressingInfo, + 2); + +namespace GIOP +{ + ::CORBA::TypeCode_ptr const _tc_IORAddressingInfo = + &_tao_tc_GIOP_IORAddressingInfo; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/union_typecode.cpp:58 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + +static TAO::TypeCode::Case_T const _tao_cases_GIOP_TargetAddress_0 (0, "object_key", &CORBA::_tc_OctetSeq); +static TAO::TypeCode::Case_T const _tao_cases_GIOP_TargetAddress_1 (1, "profile", &IOP::_tc_TaggedProfile); +static TAO::TypeCode::Case_T const _tao_cases_GIOP_TargetAddress_2 (2, "ior", &GIOP::_tc_IORAddressingInfo); + +static TAO::TypeCode::Case const * const _tao_cases_GIOP_TargetAddress[] = + { + &_tao_cases_GIOP_TargetAddress_0, + &_tao_cases_GIOP_TargetAddress_1, + &_tao_cases_GIOP_TargetAddress_2 + + }; + +static TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy> + _tao_tc_GIOP_TargetAddress ( + "IDL:omg.org/GIOP/TargetAddress:1.0", + "TargetAddress", + &CORBA::_tc_short, + _tao_cases_GIOP_TargetAddress, + 3, -1); + +namespace GIOP +{ + ::CORBA::TypeCode_ptr const _tc_TargetAddress = + &_tao_tc_GIOP_TargetAddress; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const GIOP::Version &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + GIOP::Version::_tao_any_destructor, + GIOP::_tc_Version, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + GIOP::Version *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + GIOP::Version::_tao_any_destructor, + GIOP::_tc_Version, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + GIOP::Version *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const GIOP::Version *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const GIOP::Version *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + GIOP::Version::_tao_any_destructor, + GIOP::_tc_Version, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const GIOP::IORAddressingInfo &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + GIOP::IORAddressingInfo::_tao_any_destructor, + GIOP::_tc_IORAddressingInfo, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + GIOP::IORAddressingInfo *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + GIOP::IORAddressingInfo::_tao_any_destructor, + GIOP::_tc_IORAddressingInfo, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + GIOP::IORAddressingInfo *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const GIOP::IORAddressingInfo *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const GIOP::IORAddressingInfo *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + GIOP::IORAddressingInfo::_tao_any_destructor, + GIOP::_tc_IORAddressingInfo, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_union/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const GIOP::TargetAddress &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + GIOP::TargetAddress::_tao_any_destructor, + GIOP::_tc_TargetAddress, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + GIOP::TargetAddress *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + GIOP::TargetAddress::_tao_any_destructor, + GIOP::_tc_TargetAddress, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + GIOP::TargetAddress *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const GIOP::TargetAddress *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const GIOP::TargetAddress *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + GIOP::TargetAddress::_tao_any_destructor, + GIOP::_tc_TargetAddress, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/GIOPA.h b/TAO/tao/AnyTypeCode/GIOPA.h new file mode 100644 index 00000000000..e314e72e9e2 --- /dev/null +++ b/TAO/tao/AnyTypeCode/GIOPA.h @@ -0,0 +1,99 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:788 + +#ifndef _TAO_IDL_ANYTYPECODE_GIOPA_H_ +#define _TAO_IDL_ANYTYPECODE_GIOPA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/GIOPC.h" +#include "tao/AnyTypeCode/IOP_IORA.h" +#include "tao/AnyTypeCode/OctetSeqA.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace GIOP +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_AddressingDisposition; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_Version; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_IORAddressingInfo; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_TargetAddress; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module GIOP + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const GIOP::Version &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, GIOP::Version*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, GIOP::Version *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const GIOP::Version *&); + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const GIOP::IORAddressingInfo &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, GIOP::IORAddressingInfo*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, GIOP::IORAddressingInfo *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const GIOP::IORAddressingInfo *&); + +// TAO_IDL - Generated from +// be\be_visitor_union/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const GIOP::TargetAddress &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, GIOP::TargetAddress*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, GIOP::TargetAddress *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const GIOP::TargetAddress *&); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/IIOPA.cpp b/TAO/tao/AnyTypeCode/IIOPA.cpp new file mode 100644 index 00000000000..89720b384a9 --- /dev/null +++ b/TAO/tao/AnyTypeCode/IIOPA.cpp @@ -0,0 +1,321 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "IIOPA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/AnyTypeCode/String_TypeCode_Static.h" +#include "tao/AnyTypeCode/Struct_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + +static TAO::TypeCode::Struct_Field const _tao_fields_IIOP_ListenPoint[] = + { + { "host", &CORBA::_tc_string }, + { "port", &CORBA::_tc_ushort } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_IIOP_ListenPoint ( + CORBA::tk_struct, + "IDL:omg.org/IIOP/ListenPoint:1.0", + "ListenPoint", + _tao_fields_IIOP_ListenPoint, + 2); + +namespace IIOP +{ + ::CORBA::TypeCode_ptr const _tc_ListenPoint = + &_tao_tc_IIOP_ListenPoint; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_IIOP_ListenPointList_GUARD +#define _TAO_TYPECODE_IIOP_ListenPointList_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + IIOP_ListenPointList_0 ( + CORBA::tk_sequence, + &IIOP::_tc_ListenPoint, + 0U); + + ::CORBA::TypeCode_ptr const tc_IIOP_ListenPointList_0 = + &IIOP_ListenPointList_0; + + } +} + + +#endif /* _TAO_TYPECODE_IIOP_ListenPointList_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_IIOP_ListenPointList ( + CORBA::tk_alias, + "IDL:omg.org/IIOP/ListenPointList:1.0", + "ListenPointList", + &TAO::TypeCode::tc_IIOP_ListenPointList_0); + +namespace IIOP +{ + ::CORBA::TypeCode_ptr const _tc_ListenPointList = + &_tao_tc_IIOP_ListenPointList; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + +static TAO::TypeCode::Struct_Field const _tao_fields_IIOP_BiDirIIOPServiceContext[] = + { + { "listen_points", &IIOP::_tc_ListenPointList } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_IIOP_BiDirIIOPServiceContext ( + CORBA::tk_struct, + "IDL:omg.org/IIOP/BiDirIIOPServiceContext:1.0", + "BiDirIIOPServiceContext", + _tao_fields_IIOP_BiDirIIOPServiceContext, + 1); + +namespace IIOP +{ + ::CORBA::TypeCode_ptr const _tc_BiDirIIOPServiceContext = + &_tao_tc_IIOP_BiDirIIOPServiceContext; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const IIOP::ListenPoint &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + IIOP::ListenPoint::_tao_any_destructor, + IIOP::_tc_ListenPoint, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + IIOP::ListenPoint *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + IIOP::ListenPoint::_tao_any_destructor, + IIOP::_tc_ListenPoint, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + IIOP::ListenPoint *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const IIOP::ListenPoint *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const IIOP::ListenPoint *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + IIOP::ListenPoint::_tao_any_destructor, + IIOP::_tc_ListenPoint, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const IIOP::ListenPointList &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + IIOP::ListenPointList::_tao_any_destructor, + TAO::TypeCode::tc_IIOP_ListenPointList_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + IIOP::ListenPointList *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + IIOP::ListenPointList::_tao_any_destructor, + TAO::TypeCode::tc_IIOP_ListenPointList_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + IIOP::ListenPointList *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const IIOP::ListenPointList *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const IIOP::ListenPointList *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + IIOP::ListenPointList::_tao_any_destructor, + TAO::TypeCode::tc_IIOP_ListenPointList_0, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const IIOP::BiDirIIOPServiceContext &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + IIOP::BiDirIIOPServiceContext::_tao_any_destructor, + IIOP::_tc_BiDirIIOPServiceContext, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + IIOP::BiDirIIOPServiceContext *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + IIOP::BiDirIIOPServiceContext::_tao_any_destructor, + IIOP::_tc_BiDirIIOPServiceContext, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + IIOP::BiDirIIOPServiceContext *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const IIOP::BiDirIIOPServiceContext *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const IIOP::BiDirIIOPServiceContext *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + IIOP::BiDirIIOPServiceContext::_tao_any_destructor, + IIOP::_tc_BiDirIIOPServiceContext, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/IIOPA.h b/TAO/tao/AnyTypeCode/IIOPA.h new file mode 100644 index 00000000000..011f510ff52 --- /dev/null +++ b/TAO/tao/AnyTypeCode/IIOPA.h @@ -0,0 +1,92 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:788 + +#ifndef _TAO_IDL_ANYTYPECODE_IIOPA_H_ +#define _TAO_IDL_ANYTYPECODE_IIOPA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/IIOPC.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace IIOP +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ListenPoint; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ListenPointList; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_BiDirIIOPServiceContext; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module IIOP + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const IIOP::ListenPoint &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, IIOP::ListenPoint*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, IIOP::ListenPoint *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const IIOP::ListenPoint *&); + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const IIOP::ListenPointList &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, IIOP::ListenPointList*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, IIOP::ListenPointList *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const IIOP::ListenPointList *&); + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const IIOP::BiDirIIOPServiceContext &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, IIOP::BiDirIIOPServiceContext*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, IIOP::BiDirIIOPServiceContext *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const IIOP::BiDirIIOPServiceContext *&); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/IIOP_EndpointsA.cpp b/TAO/tao/AnyTypeCode/IIOP_EndpointsA.cpp new file mode 100644 index 00000000000..d528ac270c4 --- /dev/null +++ b/TAO/tao/AnyTypeCode/IIOP_EndpointsA.cpp @@ -0,0 +1,233 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "IIOP_EndpointsA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/AnyTypeCode/String_TypeCode_Static.h" +#include "tao/AnyTypeCode/Struct_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/AnyTypeCode/Recursive_Type_TypeCode.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + +static TAO::TypeCode::Struct_Field const _tao_fields_TAO_IIOP_Endpoint_Info[] = + { + { "host", &CORBA::_tc_string }, + { "port", &CORBA::_tc_short }, + { "priority", &CORBA::_tc_short } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_TAO_IIOP_Endpoint_Info ( + CORBA::tk_struct, + "IDL:TAO/IIOP_Endpoint_Info:1.0", + "IIOP_Endpoint_Info", + _tao_fields_TAO_IIOP_Endpoint_Info, + 3); + +namespace TAO +{ + ::CORBA::TypeCode_ptr const _tc_IIOP_Endpoint_Info = + &_tao_tc_TAO_IIOP_Endpoint_Info; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_TAO_IIOPEndpointSequence_GUARD +#define _TAO_TYPECODE_TAO_IIOPEndpointSequence_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + TAO_IIOPEndpointSequence_0 ( + CORBA::tk_sequence, + &TAO::_tc_IIOP_Endpoint_Info, + 0U); + + ::CORBA::TypeCode_ptr const tc_TAO_IIOPEndpointSequence_0 = + &TAO_IIOPEndpointSequence_0; + + } +} + + +#endif /* _TAO_TYPECODE_TAO_IIOPEndpointSequence_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_TAO_IIOPEndpointSequence ( + CORBA::tk_alias, + "IDL:TAO/IIOPEndpointSequence:1.0", + "IIOPEndpointSequence", + &TAO::TypeCode::tc_TAO_IIOPEndpointSequence_0); + +namespace TAO +{ + ::CORBA::TypeCode_ptr const _tc_IIOPEndpointSequence = + &_tao_tc_TAO_IIOPEndpointSequence; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const TAO::IIOP_Endpoint_Info &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + TAO::IIOP_Endpoint_Info::_tao_any_destructor, + TAO::_tc_IIOP_Endpoint_Info, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + TAO::IIOP_Endpoint_Info *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + TAO::IIOP_Endpoint_Info::_tao_any_destructor, + TAO::_tc_IIOP_Endpoint_Info, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + TAO::IIOP_Endpoint_Info *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const TAO::IIOP_Endpoint_Info *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const TAO::IIOP_Endpoint_Info *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + TAO::IIOP_Endpoint_Info::_tao_any_destructor, + TAO::_tc_IIOP_Endpoint_Info, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const TAO::IIOPEndpointSequence &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + TAO::IIOPEndpointSequence::_tao_any_destructor, + TAO::TypeCode::tc_TAO_IIOPEndpointSequence_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + TAO::IIOPEndpointSequence *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + TAO::IIOPEndpointSequence::_tao_any_destructor, + TAO::TypeCode::tc_TAO_IIOPEndpointSequence_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + TAO::IIOPEndpointSequence *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const TAO::IIOPEndpointSequence *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const TAO::IIOPEndpointSequence *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + TAO::IIOPEndpointSequence::_tao_any_destructor, + TAO::TypeCode::tc_TAO_IIOPEndpointSequence_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/IIOP_EndpointsA.h b/TAO/tao/AnyTypeCode/IIOP_EndpointsA.h new file mode 100644 index 00000000000..2700971cce7 --- /dev/null +++ b/TAO/tao/AnyTypeCode/IIOP_EndpointsA.h @@ -0,0 +1,120 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_IIOP_ENDPOINTSA_H_ +#define _TAO_IDL_ORIG_IIOP_ENDPOINTSA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/IIOP_EndpointsC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace TAO +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_IIOP_Endpoint_Info; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_IIOPEndpointSequence; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module TAO + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const TAO::IIOP_Endpoint_Info &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, TAO::IIOP_Endpoint_Info*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, TAO::IIOP_Endpoint_Info *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const TAO::IIOP_Endpoint_Info *&); + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const TAO::IIOPEndpointSequence &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, TAO::IIOPEndpointSequence*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, TAO::IIOPEndpointSequence *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const TAO::IIOPEndpointSequence *&); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/IOPA.cpp b/TAO/tao/AnyTypeCode/IOPA.cpp new file mode 100644 index 00000000000..77398cd1a3b --- /dev/null +++ b/TAO/tao/AnyTypeCode/IOPA.cpp @@ -0,0 +1,34 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "IOPA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/String_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" diff --git a/TAO/tao/AnyTypeCode/IOPA.h b/TAO/tao/AnyTypeCode/IOPA.h new file mode 100644 index 00000000000..713cf4e330a --- /dev/null +++ b/TAO/tao/AnyTypeCode/IOPA.h @@ -0,0 +1,43 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:788 + +#ifndef _TAO_IDL_ANYTYPECODE_IOPA_H_ +#define _TAO_IDL_ANYTYPECODE_IOPA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/IOPC.h" +#include "tao/AnyTypeCode/IOP_IORA.h" + + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/IOP_IORA.cpp b/TAO/tao/AnyTypeCode/IOP_IORA.cpp new file mode 100644 index 00000000000..0c9e8f27150 --- /dev/null +++ b/TAO/tao/AnyTypeCode/IOP_IORA.cpp @@ -0,0 +1,997 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "IOP_IORA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/AnyTypeCode/String_TypeCode_Static.h" +#include "tao/AnyTypeCode/Struct_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_IOP_ProfileId ( + CORBA::tk_alias, + "IDL:omg.org/IOP/ProfileId:1.0", + "ProfileId", + &CORBA::_tc_ulong); + +namespace IOP +{ + ::CORBA::TypeCode_ptr const _tc_ProfileId = + &_tao_tc_IOP_ProfileId; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + +static TAO::TypeCode::Struct_Field const _tao_fields_IOP_TaggedProfile[] = + { + { "tag", &IOP::_tc_ProfileId }, + { "profile_data", &CORBA::_tc_OctetSeq } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_IOP_TaggedProfile ( + CORBA::tk_struct, + "IDL:omg.org/IOP/TaggedProfile:1.0", + "TaggedProfile", + _tao_fields_IOP_TaggedProfile, + 2); + +namespace IOP +{ + ::CORBA::TypeCode_ptr const _tc_TaggedProfile = + &_tao_tc_IOP_TaggedProfile; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_IOP_TaggedProfileSeq_GUARD +#define _TAO_TYPECODE_IOP_TaggedProfileSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + IOP_TaggedProfileSeq_0 ( + CORBA::tk_sequence, + &IOP::_tc_TaggedProfile, + 0U); + + ::CORBA::TypeCode_ptr const tc_IOP_TaggedProfileSeq_0 = + &IOP_TaggedProfileSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_IOP_TaggedProfileSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_IOP_TaggedProfileSeq ( + CORBA::tk_alias, + "IDL:omg.org/IOP/TaggedProfileSeq:1.0", + "TaggedProfileSeq", + &TAO::TypeCode::tc_IOP_TaggedProfileSeq_0); + +namespace IOP +{ + ::CORBA::TypeCode_ptr const _tc_TaggedProfileSeq = + &_tao_tc_IOP_TaggedProfileSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + +static TAO::TypeCode::Struct_Field const _tao_fields_IOP_IOR[] = + { + { "type_id", &CORBA::_tc_string }, + { "profiles", &IOP::_tc_TaggedProfileSeq } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_IOP_IOR ( + CORBA::tk_struct, + "IDL:omg.org/IOP/IOR:1.0", + "IOR", + _tao_fields_IOP_IOR, + 2); + +namespace IOP +{ + ::CORBA::TypeCode_ptr const _tc_IOR = + &_tao_tc_IOP_IOR; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_IOP_ComponentId ( + CORBA::tk_alias, + "IDL:omg.org/IOP/ComponentId:1.0", + "ComponentId", + &CORBA::_tc_ulong); + +namespace IOP +{ + ::CORBA::TypeCode_ptr const _tc_ComponentId = + &_tao_tc_IOP_ComponentId; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + +static TAO::TypeCode::Struct_Field const _tao_fields_IOP_TaggedComponent[] = + { + { "tag", &IOP::_tc_ComponentId }, + { "component_data", &CORBA::_tc_OctetSeq } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_IOP_TaggedComponent ( + CORBA::tk_struct, + "IDL:omg.org/IOP/TaggedComponent:1.0", + "TaggedComponent", + _tao_fields_IOP_TaggedComponent, + 2); + +namespace IOP +{ + ::CORBA::TypeCode_ptr const _tc_TaggedComponent = + &_tao_tc_IOP_TaggedComponent; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_IOP_MultipleComponentProfile_GUARD +#define _TAO_TYPECODE_IOP_MultipleComponentProfile_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + IOP_MultipleComponentProfile_0 ( + CORBA::tk_sequence, + &IOP::_tc_TaggedComponent, + 0U); + + ::CORBA::TypeCode_ptr const tc_IOP_MultipleComponentProfile_0 = + &IOP_MultipleComponentProfile_0; + + } +} + + +#endif /* _TAO_TYPECODE_IOP_MultipleComponentProfile_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_IOP_MultipleComponentProfile ( + CORBA::tk_alias, + "IDL:omg.org/IOP/MultipleComponentProfile:1.0", + "MultipleComponentProfile", + &TAO::TypeCode::tc_IOP_MultipleComponentProfile_0); + +namespace IOP +{ + ::CORBA::TypeCode_ptr const _tc_MultipleComponentProfile = + &_tao_tc_IOP_MultipleComponentProfile; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_IOP_TaggedComponentList_GUARD +#define _TAO_TYPECODE_IOP_TaggedComponentList_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + IOP_TaggedComponentList_0 ( + CORBA::tk_sequence, + &IOP::_tc_TaggedComponent, + 0U); + + ::CORBA::TypeCode_ptr const tc_IOP_TaggedComponentList_0 = + &IOP_TaggedComponentList_0; + + } +} + + +#endif /* _TAO_TYPECODE_IOP_TaggedComponentList_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_IOP_TaggedComponentList ( + CORBA::tk_alias, + "IDL:omg.org/IOP/TaggedComponentList:1.0", + "TaggedComponentList", + &TAO::TypeCode::tc_IOP_TaggedComponentList_0); + +namespace IOP +{ + ::CORBA::TypeCode_ptr const _tc_TaggedComponentList = + &_tao_tc_IOP_TaggedComponentList; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_IOP_TaggedComponentSeq_GUARD +#define _TAO_TYPECODE_IOP_TaggedComponentSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + IOP_TaggedComponentSeq_0 ( + CORBA::tk_sequence, + &IOP::_tc_TaggedComponent, + 0U); + + ::CORBA::TypeCode_ptr const tc_IOP_TaggedComponentSeq_0 = + &IOP_TaggedComponentSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_IOP_TaggedComponentSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_IOP_TaggedComponentSeq ( + CORBA::tk_alias, + "IDL:omg.org/IOP/TaggedComponentSeq:1.0", + "TaggedComponentSeq", + &TAO::TypeCode::tc_IOP_TaggedComponentSeq_0); + +namespace IOP +{ + ::CORBA::TypeCode_ptr const _tc_TaggedComponentSeq = + &_tao_tc_IOP_TaggedComponentSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_IOP_ServiceId ( + CORBA::tk_alias, + "IDL:omg.org/IOP/ServiceId:1.0", + "ServiceId", + &CORBA::_tc_ulong); + +namespace IOP +{ + ::CORBA::TypeCode_ptr const _tc_ServiceId = + &_tao_tc_IOP_ServiceId; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + +static TAO::TypeCode::Struct_Field const _tao_fields_IOP_ServiceContext[] = + { + { "context_id", &IOP::_tc_ServiceId }, + { "context_data", &CORBA::_tc_OctetSeq } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_IOP_ServiceContext ( + CORBA::tk_struct, + "IDL:omg.org/IOP/ServiceContext:1.0", + "ServiceContext", + _tao_fields_IOP_ServiceContext, + 2); + +namespace IOP +{ + ::CORBA::TypeCode_ptr const _tc_ServiceContext = + &_tao_tc_IOP_ServiceContext; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_IOP_ServiceContextList_GUARD +#define _TAO_TYPECODE_IOP_ServiceContextList_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + IOP_ServiceContextList_0 ( + CORBA::tk_sequence, + &IOP::_tc_ServiceContext, + 0U); + + ::CORBA::TypeCode_ptr const tc_IOP_ServiceContextList_0 = + &IOP_ServiceContextList_0; + + } +} + + +#endif /* _TAO_TYPECODE_IOP_ServiceContextList_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_IOP_ServiceContextList ( + CORBA::tk_alias, + "IDL:omg.org/IOP/ServiceContextList:1.0", + "ServiceContextList", + &TAO::TypeCode::tc_IOP_ServiceContextList_0); + +namespace IOP +{ + ::CORBA::TypeCode_ptr const _tc_ServiceContextList = + &_tao_tc_IOP_ServiceContextList; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const IOP::TaggedProfile &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + IOP::TaggedProfile::_tao_any_destructor, + IOP::_tc_TaggedProfile, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + IOP::TaggedProfile *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + IOP::TaggedProfile::_tao_any_destructor, + IOP::_tc_TaggedProfile, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + IOP::TaggedProfile *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const IOP::TaggedProfile *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const IOP::TaggedProfile *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + IOP::TaggedProfile::_tao_any_destructor, + IOP::_tc_TaggedProfile, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const IOP::TaggedProfileSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + IOP::TaggedProfileSeq::_tao_any_destructor, + TAO::TypeCode::tc_IOP_TaggedProfileSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + IOP::TaggedProfileSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + IOP::TaggedProfileSeq::_tao_any_destructor, + TAO::TypeCode::tc_IOP_TaggedProfileSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + IOP::TaggedProfileSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const IOP::TaggedProfileSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const IOP::TaggedProfileSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + IOP::TaggedProfileSeq::_tao_any_destructor, + TAO::TypeCode::tc_IOP_TaggedProfileSeq_0, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const IOP::IOR &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + IOP::IOR::_tao_any_destructor, + IOP::_tc_IOR, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + IOP::IOR *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + IOP::IOR::_tao_any_destructor, + IOP::_tc_IOR, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + IOP::IOR *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const IOP::IOR *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const IOP::IOR *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + IOP::IOR::_tao_any_destructor, + IOP::_tc_IOR, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const IOP::TaggedComponent &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + IOP::TaggedComponent::_tao_any_destructor, + IOP::_tc_TaggedComponent, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + IOP::TaggedComponent *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + IOP::TaggedComponent::_tao_any_destructor, + IOP::_tc_TaggedComponent, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + IOP::TaggedComponent *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const IOP::TaggedComponent *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const IOP::TaggedComponent *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + IOP::TaggedComponent::_tao_any_destructor, + IOP::_tc_TaggedComponent, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const IOP::MultipleComponentProfile &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + IOP::MultipleComponentProfile::_tao_any_destructor, + TAO::TypeCode::tc_IOP_MultipleComponentProfile_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + IOP::MultipleComponentProfile *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + IOP::MultipleComponentProfile::_tao_any_destructor, + TAO::TypeCode::tc_IOP_MultipleComponentProfile_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + IOP::MultipleComponentProfile *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const IOP::MultipleComponentProfile *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const IOP::MultipleComponentProfile *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + IOP::MultipleComponentProfile::_tao_any_destructor, + TAO::TypeCode::tc_IOP_MultipleComponentProfile_0, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const IOP::TaggedComponentList &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + IOP::TaggedComponentList::_tao_any_destructor, + TAO::TypeCode::tc_IOP_TaggedComponentList_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + IOP::TaggedComponentList *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + IOP::TaggedComponentList::_tao_any_destructor, + TAO::TypeCode::tc_IOP_TaggedComponentList_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + IOP::TaggedComponentList *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const IOP::TaggedComponentList *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const IOP::TaggedComponentList *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + IOP::TaggedComponentList::_tao_any_destructor, + TAO::TypeCode::tc_IOP_TaggedComponentList_0, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const IOP::TaggedComponentSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + IOP::TaggedComponentSeq::_tao_any_destructor, + TAO::TypeCode::tc_IOP_TaggedComponentSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + IOP::TaggedComponentSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + IOP::TaggedComponentSeq::_tao_any_destructor, + TAO::TypeCode::tc_IOP_TaggedComponentSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + IOP::TaggedComponentSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const IOP::TaggedComponentSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const IOP::TaggedComponentSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + IOP::TaggedComponentSeq::_tao_any_destructor, + TAO::TypeCode::tc_IOP_TaggedComponentSeq_0, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const IOP::ServiceContext &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + IOP::ServiceContext::_tao_any_destructor, + IOP::_tc_ServiceContext, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + IOP::ServiceContext *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + IOP::ServiceContext::_tao_any_destructor, + IOP::_tc_ServiceContext, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + IOP::ServiceContext *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const IOP::ServiceContext *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const IOP::ServiceContext *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + IOP::ServiceContext::_tao_any_destructor, + IOP::_tc_ServiceContext, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const IOP::ServiceContextList &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + IOP::ServiceContextList::_tao_any_destructor, + TAO::TypeCode::tc_IOP_ServiceContextList_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + IOP::ServiceContextList *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + IOP::ServiceContextList::_tao_any_destructor, + TAO::TypeCode::tc_IOP_ServiceContextList_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + IOP::ServiceContextList *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const IOP::ServiceContextList *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const IOP::ServiceContextList *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + IOP::ServiceContextList::_tao_any_destructor, + TAO::TypeCode::tc_IOP_ServiceContextList_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/IOP_IORA.h b/TAO/tao/AnyTypeCode/IOP_IORA.h new file mode 100644 index 00000000000..65300fca9e5 --- /dev/null +++ b/TAO/tao/AnyTypeCode/IOP_IORA.h @@ -0,0 +1,186 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:788 + +#ifndef _TAO_IDL_ANYTYPECODE_IOP_IORA_H_ +#define _TAO_IDL_ANYTYPECODE_IOP_IORA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/IOP_IORC.h" +#include "tao/AnyTypeCode/OctetSeqA.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace IOP +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ProfileId; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_TaggedProfile; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_TaggedProfileSeq; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_IOR; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ComponentId; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_TaggedComponent; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_MultipleComponentProfile; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_TaggedComponentList; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_TaggedComponentSeq; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ServiceId; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ServiceContext; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ServiceContextList; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module IOP + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const IOP::TaggedProfile &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, IOP::TaggedProfile*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, IOP::TaggedProfile *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const IOP::TaggedProfile *&); + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const IOP::TaggedProfileSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, IOP::TaggedProfileSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, IOP::TaggedProfileSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const IOP::TaggedProfileSeq *&); + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const IOP::IOR &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, IOP::IOR*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, IOP::IOR *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const IOP::IOR *&); + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const IOP::TaggedComponent &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, IOP::TaggedComponent*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, IOP::TaggedComponent *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const IOP::TaggedComponent *&); + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const IOP::MultipleComponentProfile &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, IOP::MultipleComponentProfile*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, IOP::MultipleComponentProfile *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const IOP::MultipleComponentProfile *&); + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const IOP::TaggedComponentList &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, IOP::TaggedComponentList*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, IOP::TaggedComponentList *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const IOP::TaggedComponentList *&); + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const IOP::TaggedComponentSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, IOP::TaggedComponentSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, IOP::TaggedComponentSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const IOP::TaggedComponentSeq *&); + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const IOP::ServiceContext &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, IOP::ServiceContext*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, IOP::ServiceContext *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const IOP::ServiceContext *&); + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const IOP::ServiceContextList &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, IOP::ServiceContextList*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, IOP::ServiceContextList *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const IOP::ServiceContextList *&); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/LongDoubleSeqA.cpp b/TAO/tao/AnyTypeCode/LongDoubleSeqA.cpp new file mode 100644 index 00000000000..98e266b808a --- /dev/null +++ b/TAO/tao/AnyTypeCode/LongDoubleSeqA.cpp @@ -0,0 +1,142 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "LongDoubleSeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_LongDoubleSeq_GUARD +#define _TAO_TYPECODE_CORBA_LongDoubleSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_LongDoubleSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_longdouble, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_LongDoubleSeq_0 = + &CORBA_LongDoubleSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_LongDoubleSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_LongDoubleSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/LongDoubleSeq:1.0", + "LongDoubleSeq", + &TAO::TypeCode::tc_CORBA_LongDoubleSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_LongDoubleSeq = + &_tao_tc_CORBA_LongDoubleSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::LongDoubleSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::LongDoubleSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_LongDoubleSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::LongDoubleSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::LongDoubleSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_LongDoubleSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::LongDoubleSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::LongDoubleSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::LongDoubleSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::LongDoubleSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_LongDoubleSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/LongDoubleSeqA.h b/TAO/tao/AnyTypeCode/LongDoubleSeqA.h new file mode 100644 index 00000000000..6003f619bed --- /dev/null +++ b/TAO/tao/AnyTypeCode/LongDoubleSeqA.h @@ -0,0 +1,106 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_LONGDOUBLESEQA_H_ +#define _TAO_IDL_ORIG_LONGDOUBLESEQA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/LongDoubleSeqC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_LongDoubleSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::LongDoubleSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::LongDoubleSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::LongDoubleSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::LongDoubleSeq *&); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/LongLongSeqA.cpp b/TAO/tao/AnyTypeCode/LongLongSeqA.cpp new file mode 100644 index 00000000000..237cc42e778 --- /dev/null +++ b/TAO/tao/AnyTypeCode/LongLongSeqA.cpp @@ -0,0 +1,142 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "LongLongSeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_LongLongSeq_GUARD +#define _TAO_TYPECODE_CORBA_LongLongSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_LongLongSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_longlong, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_LongLongSeq_0 = + &CORBA_LongLongSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_LongLongSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_LongLongSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/LongLongSeq:1.0", + "LongLongSeq", + &TAO::TypeCode::tc_CORBA_LongLongSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_LongLongSeq = + &_tao_tc_CORBA_LongLongSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::LongLongSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::LongLongSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_LongLongSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::LongLongSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::LongLongSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_LongLongSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::LongLongSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::LongLongSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::LongLongSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::LongLongSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_LongLongSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/LongLongSeqA.h b/TAO/tao/AnyTypeCode/LongLongSeqA.h new file mode 100644 index 00000000000..cb47442c065 --- /dev/null +++ b/TAO/tao/AnyTypeCode/LongLongSeqA.h @@ -0,0 +1,106 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_LONGLONGSEQA_H_ +#define _TAO_IDL_ORIG_LONGLONGSEQA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/LongLongSeqC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_LongLongSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::LongLongSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::LongLongSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::LongLongSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::LongLongSeq *&); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/LongSeqA.cpp b/TAO/tao/AnyTypeCode/LongSeqA.cpp new file mode 100644 index 00000000000..ac83fdac8db --- /dev/null +++ b/TAO/tao/AnyTypeCode/LongSeqA.cpp @@ -0,0 +1,142 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "LongSeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_LongSeq_GUARD +#define _TAO_TYPECODE_CORBA_LongSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_LongSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_long, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_LongSeq_0 = + &CORBA_LongSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_LongSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_LongSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/LongSeq:1.0", + "LongSeq", + &TAO::TypeCode::tc_CORBA_LongSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_LongSeq = + &_tao_tc_CORBA_LongSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::LongSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::LongSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_LongSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::LongSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::LongSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_LongSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::LongSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::LongSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::LongSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::LongSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_LongSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/LongSeqA.h b/TAO/tao/AnyTypeCode/LongSeqA.h new file mode 100644 index 00000000000..8112599206e --- /dev/null +++ b/TAO/tao/AnyTypeCode/LongSeqA.h @@ -0,0 +1,107 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_LONGSEQA_H_ +#define _TAO_IDL_ORIG_LONGSEQA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/LongSeqC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_LongSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::LongSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::LongSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::LongSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::LongSeq *&); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/Marshal.cpp b/TAO/tao/AnyTypeCode/Marshal.cpp new file mode 100644 index 00000000000..f3cab27779d --- /dev/null +++ b/TAO/tao/AnyTypeCode/Marshal.cpp @@ -0,0 +1,257 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO +// +// = FILENAME +// marshal.cpp +// +// = DESCRIPTION +// Implements the Marshal_Object class and the factory +// +// The original encoder and decoder code now appears in files encode.cpp and +// decode.cpp +// +// = AUTHOR +// Copyright 1994-1995 by Sun Microsystems Inc. +// and +// Aniruddha Gokhale +// +// ============================================================================ + +#include "tao/AnyTypeCode/Marshal.h" +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (__ACE_INLINE__) +# include "tao/AnyTypeCode/Marshal.inl" +#endif /* ! __ACE_INLINE__ */ + +ACE_RCSID (tao, + Marshal, + "$Id$") + +TAO_Marshal_Object::~TAO_Marshal_Object (void) +{ +} + +TAO::traverse_status +TAO_Marshal_Object::perform_skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *stream + ACE_ENV_ARG_DECL) +{ + CORBA::ULong kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + switch (kind) + { + default: + case CORBA::tk_fixed: + case CORBA::tk_value_box: + case CORBA::tk_native: + case CORBA::tk_abstract_interface: + case CORBA::tk_component: + case CORBA::tk_home: + // @@ We don't know how to handle any of them yet. + return TAO::TRAVERSE_STOP; + + case CORBA::tk_null: + case CORBA::tk_void: + case CORBA::tk_short: + case CORBA::tk_long: + case CORBA::tk_ushort: + case CORBA::tk_ulong: + case CORBA::tk_float: + case CORBA::tk_double: + case CORBA::tk_boolean: + case CORBA::tk_char: + case CORBA::tk_octet: + case CORBA::tk_longlong: + case CORBA::tk_ulonglong: + case CORBA::tk_longdouble: + case CORBA::tk_wchar: + case CORBA::tk_enum: + { + TAO_Marshal_Primitive marshal; + return marshal.skip (tc, stream ACE_ENV_ARG_PARAMETER); + } + + case CORBA::tk_any: + { + TAO_Marshal_Any marshal; + return marshal.skip (tc, stream ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_TypeCode: + { + TAO_Marshal_TypeCode marshal; + return marshal.skip (tc, stream ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_Principal: + { + TAO_Marshal_Principal marshal; + return marshal.skip (tc, stream ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_objref: + { + TAO_Marshal_ObjRef marshal; + return marshal.skip (tc, stream ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_struct: + { + TAO_Marshal_Struct marshal; + return marshal.skip (tc, stream ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_union: + { + TAO_Marshal_Union marshal; + return marshal.skip (tc, stream ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_string: + { + TAO_Marshal_String marshal; + return marshal.skip (tc, stream ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_sequence: + { + TAO_Marshal_Sequence marshal; + return marshal.skip (tc, stream ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_array: + { + TAO_Marshal_Array marshal; + return marshal.skip (tc, stream ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_alias: + { + TAO_Marshal_Alias marshal; + return marshal.skip (tc, stream ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_except: + { + TAO_Marshal_Except marshal; + return marshal.skip (tc, stream ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_wstring: + { + TAO_Marshal_WString marshal; + return marshal.skip (tc, stream ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_value: + { + TAO_Marshal_Value marshal; + return marshal.skip (tc, stream ACE_ENV_ARG_PARAMETER); + } + } +} + +TAO::traverse_status +TAO_Marshal_Object::perform_append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) +{ + CORBA::ULong kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + switch (kind) + { + default: + case CORBA::tk_fixed: + case CORBA::tk_value_box: + case CORBA::tk_native: + case CORBA::tk_abstract_interface: + case CORBA::tk_component: + case CORBA::tk_home: + // @@ We don't know how to handle any of them yet. + return TAO::TRAVERSE_STOP; + + case CORBA::tk_null: + case CORBA::tk_void: + case CORBA::tk_short: + case CORBA::tk_long: + case CORBA::tk_ushort: + case CORBA::tk_ulong: + case CORBA::tk_float: + case CORBA::tk_double: + case CORBA::tk_boolean: + case CORBA::tk_char: + case CORBA::tk_octet: + case CORBA::tk_longlong: + case CORBA::tk_ulonglong: + case CORBA::tk_longdouble: + case CORBA::tk_wchar: + case CORBA::tk_enum: + { + TAO_Marshal_Primitive marshal; + return marshal.append (tc, src, dest ACE_ENV_ARG_PARAMETER); + } + + case CORBA::tk_any: + { + TAO_Marshal_Any marshal; + return marshal.append (tc, src, dest ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_TypeCode: + { + TAO_Marshal_TypeCode marshal; + return marshal.append (tc, src, dest ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_Principal: + { + TAO_Marshal_Principal marshal; + return marshal.append (tc, src, dest ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_objref: + { + TAO_Marshal_ObjRef marshal; + return marshal.append (tc, src, dest ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_struct: + { + TAO_Marshal_Struct marshal; + return marshal.append (tc, src, dest ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_union: + { + TAO_Marshal_Union marshal; + return marshal.append (tc, src, dest ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_string: + { + TAO_Marshal_String marshal; + return marshal.append (tc, src, dest ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_sequence: + { + TAO_Marshal_Sequence marshal; + return marshal.append (tc, src, dest ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_array: + { + TAO_Marshal_Array marshal; + return marshal.append (tc, src, dest ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_alias: + { + TAO_Marshal_Alias marshal; + return marshal.append (tc, src, dest ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_except: + { + TAO_Marshal_Except marshal; + return marshal.append (tc, src, dest ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_wstring: + { + TAO_Marshal_WString marshal; + return marshal.append (tc, src, dest ACE_ENV_ARG_PARAMETER); + } + case CORBA::tk_value: + { + TAO_Marshal_Value marshal; + return marshal.append (tc, src, dest ACE_ENV_ARG_PARAMETER); + } + } +} + diff --git a/TAO/tao/AnyTypeCode/Marshal.h b/TAO/tao/AnyTypeCode/Marshal.h new file mode 100644 index 00000000000..94e98d86f81 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Marshal.h @@ -0,0 +1,455 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file Marshal.h + * + * $Id$ + * + * Classes that marshal various IDL data types. + * + * + * @author Aniruddha S. Gokhale + */ +//============================================================================= + + +#ifndef TAO_MARSHAL_H +#define TAO_MARSHAL_H + +#include /**/ "ace/pre.h" +#include "ace/CORBA_macros.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/Basic_Types.h" + +namespace CORBA +{ + class TypeCode; + typedef TypeCode *TypeCode_ptr; + + class Environment; +} + +class TAO_OutputCDR; +class TAO_InputCDR; + +// = Forward declarations. +class TAO_Marshal_Object; +class TAO_Marshal_Primitive; +class TAO_Marshal_Any; +class TAO_Marshal_TypeCode; +class TAO_Marshal_Principal; +class TAO_Marshal_ObjRef; +class TAO_Marshal_Struct; +class TAO_Marshal_Union; +class TAO_Marshal_String; +class TAO_Marshal_Sequence; +class TAO_Marshal_Array; +class TAO_Marshal_Alias; +class TAO_Marshal_Except; +class TAO_Marshal_WString; +class TAO_Marshal_Value; + +namespace TAO +{ + enum traverse_status + { + TRAVERSE_STOP, + TRAVERSE_CONTINUE + }; +} + +/** + * @class TAO_Marshal_Object + * + * @brief TAO_Marshal_Object + * + * The Marshaling object that provides a common interface to the + * CDR object for marshaling different IDL data types + * Provides a set of virtual methods for appending and skipping + * data over a CDR stream. + */ +class TAO_AnyTypeCode_Export TAO_Marshal_Object +{ +public: + /// constructor + TAO_Marshal_Object (void); + + /// destructor + virtual ~TAO_Marshal_Object (void); + + /// skip entry point, it allocates the right kind of Marshal_Object + /// and invokes skip on it. + static TAO::traverse_status perform_skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL); + + /// skip operation + virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL) = 0; + + /// append entry point, it allocates the right kind of Marshal_Object + /// and invokes skip on it. + static TAO::traverse_status perform_append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL); + + /// append operation + virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) = 0; +}; + +/** + * @class TAO_Marshal_Primitive: + * + * @brief TAO_Marshal_Primitive + * + * marshaling primitives + */ +class TAO_AnyTypeCode_Export TAO_Marshal_Primitive: public TAO_Marshal_Object +{ +public: + TAO_Marshal_Primitive (void); + + /// skip operation + virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL); + + /// append operation + virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL); +}; + +/** + * @class TAO_Marshal_Any: + * + * @brief TAO_Marshal_Any + * + * Marshal an Any + */ +class TAO_AnyTypeCode_Export TAO_Marshal_Any: public TAO_Marshal_Object +{ +public: + TAO_Marshal_Any (void); + + /// skip operation + virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL); + + /// append operation + virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL); +}; + +/** + * @class TAO_Marshal_TypeCode: + * + * @brief TAO_Marshal_TypeCode + * + * marshal a typecode + */ +class TAO_AnyTypeCode_Export TAO_Marshal_TypeCode: public TAO_Marshal_Object +{ +public: + TAO_Marshal_TypeCode (void); + + /// skip operation + virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL); + + /// append operation + virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL); +}; + +/** + * @class TAO_Marshal_Principal: + * + * @brief TAO_Marshal_Principal + * + * marshal a principal + */ +class TAO_AnyTypeCode_Export TAO_Marshal_Principal: public TAO_Marshal_Object +{ +public: + TAO_Marshal_Principal (void); + + /// skip operation + virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL); + + /// append operation + virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL); +}; + +/** + * @class TAO_Marshal_ObjRef: + * + * @brief TAO_Marshal_ObjRef + * + * marshal an object reference + */ +class TAO_AnyTypeCode_Export TAO_Marshal_ObjRef: public TAO_Marshal_Object +{ +public: + TAO_Marshal_ObjRef (void); + + /// skip operation + virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL); + + /// append operation + virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL); +}; + +/** + * @class TAO_Marshal_Struct: + * + * @brief TAO_Marshal_Struct + * + * marshal a struct + */ +class TAO_AnyTypeCode_Export TAO_Marshal_Struct: public TAO_Marshal_Object +{ +public: + TAO_Marshal_Struct (void); + + /// skip operation + virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL); + + /// append operation + virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL); +}; + +/** + * @class TAO_Marshal_Union: + * + * @brief TAO_Marshal_Union + * + * marshal a union + */ +class TAO_AnyTypeCode_Export TAO_Marshal_Union: public TAO_Marshal_Object +{ +public: + TAO_Marshal_Union (void); + + /// skip operation + virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL); + + /// append operation + virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL); +}; + +/** + * @class TAO_Marshal_String: + * + * @brief TAO_Marshal_String + * + * marshal a string + */ +class TAO_AnyTypeCode_Export TAO_Marshal_String: public TAO_Marshal_Object +{ +public: + TAO_Marshal_String (void); + + /// skip operation + virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL); + + /// append operation + virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL); +}; + +/** + * @class TAO_Marshal_Sequence: + * + * @brief TAO_Marshal_Sequence + * + * marshal a sequence + */ +class TAO_AnyTypeCode_Export TAO_Marshal_Sequence: public TAO_Marshal_Object +{ +public: + TAO_Marshal_Sequence (void); + + /// skip operation + virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL); + + /// append operation + virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL); +}; + +/** + * @class TAO_Marshal_Array: + * + * @brief TAO_Marshal_Array + * + * marshal an array + */ +class TAO_AnyTypeCode_Export TAO_Marshal_Array: public TAO_Marshal_Object +{ +public: + TAO_Marshal_Array (void); + + /// skip operation + virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL); + + /// append operation + virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL); +}; + +/** + * @class TAO_Marshal_Alias: + * + * @brief TAO_Marshal_Alias + * + * marshal an alias + */ +class TAO_AnyTypeCode_Export TAO_Marshal_Alias: public TAO_Marshal_Object +{ +public: + TAO_Marshal_Alias (void); + + /// skip operation + virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL); + + /// append operation + virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL); +}; + +/** + * @class TAO_Marshal_Except: + * + * @brief TAO_Marshal_Except + * + * marshal an exception + */ +class TAO_AnyTypeCode_Export TAO_Marshal_Except: public TAO_Marshal_Object +{ +public: + TAO_Marshal_Except (void); + + /// skip operation + virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL); + + /// append operation + virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL); +}; + +/** + * @class TAO_Marshal_WString + * + * @brief TAO_Marshal_WString + * + * marshal a wide string + */ +class TAO_AnyTypeCode_Export TAO_Marshal_WString : public TAO_Marshal_Object +{ +public: + TAO_Marshal_WString (void); + + /// skip operation + virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL); + + /// append operation + virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL); +}; + +/** + * @class TAO_Marshal_Value: + * + * @brief TAO_Marshal_Value + * + * marshal a valuetype + */ +class TAO_AnyTypeCode_Export TAO_Marshal_Value: public TAO_Marshal_Object +{ +public: + TAO_Marshal_Value (void); + + /// skip operation + virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *context + ACE_ENV_ARG_DECL); + + /// append operation + virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL); + +private: + CORBA::Boolean nested_processing_; +}; + +#if defined (__ACE_INLINE__) +# include "tao/AnyTypeCode/Marshal.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" +#endif /* TAO_MARSHAL_H */ diff --git a/TAO/tao/AnyTypeCode/Marshal.inl b/TAO/tao/AnyTypeCode/Marshal.inl new file mode 100644 index 00000000000..8b78849a003 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Marshal.inl @@ -0,0 +1,77 @@ +//$Id$ + +ACE_INLINE +TAO_Marshal_Object::TAO_Marshal_Object (void) +{ +} + +ACE_INLINE +TAO_Marshal_Primitive::TAO_Marshal_Primitive (void) +{ +} + +ACE_INLINE +TAO_Marshal_Any::TAO_Marshal_Any (void) +{ +} + +ACE_INLINE +TAO_Marshal_Principal::TAO_Marshal_Principal (void) +{ +} + +ACE_INLINE +TAO_Marshal_TypeCode::TAO_Marshal_TypeCode (void) +{ +} + +ACE_INLINE +TAO_Marshal_ObjRef::TAO_Marshal_ObjRef (void) +{ +} + +ACE_INLINE +TAO_Marshal_Struct::TAO_Marshal_Struct (void) +{ +} + +ACE_INLINE +TAO_Marshal_Union::TAO_Marshal_Union (void) +{ +} + +ACE_INLINE +TAO_Marshal_String::TAO_Marshal_String (void) +{ +} + +ACE_INLINE +TAO_Marshal_Sequence::TAO_Marshal_Sequence (void) +{ +} + +ACE_INLINE +TAO_Marshal_Array::TAO_Marshal_Array (void) +{ +} + +ACE_INLINE +TAO_Marshal_Alias::TAO_Marshal_Alias (void) +{ +} + +ACE_INLINE +TAO_Marshal_Except::TAO_Marshal_Except (void) +{ +} + +ACE_INLINE +TAO_Marshal_WString::TAO_Marshal_WString (void) +{ +} + +ACE_INLINE +TAO_Marshal_Value::TAO_Marshal_Value (void) + : nested_processing_ (0) +{ +} diff --git a/TAO/tao/AnyTypeCode/Messaging_PolicyValueA.cpp b/TAO/tao/AnyTypeCode/Messaging_PolicyValueA.cpp new file mode 100644 index 00000000000..6d77541a020 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Messaging_PolicyValueA.cpp @@ -0,0 +1,240 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "Messaging_PolicyValueA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/AnyTypeCode/String_TypeCode_Static.h" +#include "tao/AnyTypeCode/Struct_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/AnyTypeCode/Recursive_Type_TypeCode.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +#include "tao/AnyTypeCode/Policy_ForwardA.h" +#include "tao/AnyTypeCode/OctetSeqA.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + +static TAO::TypeCode::Struct_Field const _tao_fields_Messaging_PolicyValue[] = + { + { "ptype", &CORBA::_tc_PolicyType }, + { "pvalue", &CORBA::_tc_OctetSeq } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_Messaging_PolicyValue ( + CORBA::tk_struct, + "IDL:omg.org/Messaging/PolicyValue:1.0", + "PolicyValue", + _tao_fields_Messaging_PolicyValue, + 2); + +namespace Messaging +{ + ::CORBA::TypeCode_ptr const _tc_PolicyValue = + &_tao_tc_Messaging_PolicyValue; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_Messaging_PolicyValueSeq_GUARD +#define _TAO_TYPECODE_Messaging_PolicyValueSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + Messaging_PolicyValueSeq_0 ( + CORBA::tk_sequence, + &Messaging::_tc_PolicyValue, + 0U); + + ::CORBA::TypeCode_ptr const tc_Messaging_PolicyValueSeq_0 = + &Messaging_PolicyValueSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_Messaging_PolicyValueSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_Messaging_PolicyValueSeq ( + CORBA::tk_alias, + "IDL:omg.org/Messaging/PolicyValueSeq:1.0", + "PolicyValueSeq", + &TAO::TypeCode::tc_Messaging_PolicyValueSeq_0); + +namespace Messaging +{ + ::CORBA::TypeCode_ptr const _tc_PolicyValueSeq = + &_tao_tc_Messaging_PolicyValueSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const Messaging::PolicyValue &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + Messaging::PolicyValue::_tao_any_destructor, + Messaging::_tc_PolicyValue, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + Messaging::PolicyValue *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + Messaging::PolicyValue::_tao_any_destructor, + Messaging::_tc_PolicyValue, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + Messaging::PolicyValue *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const Messaging::PolicyValue *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const Messaging::PolicyValue *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + Messaging::PolicyValue::_tao_any_destructor, + Messaging::_tc_PolicyValue, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const Messaging::PolicyValueSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + Messaging::PolicyValueSeq::_tao_any_destructor, + TAO::TypeCode::tc_Messaging_PolicyValueSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + Messaging::PolicyValueSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + Messaging::PolicyValueSeq::_tao_any_destructor, + TAO::TypeCode::tc_Messaging_PolicyValueSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + Messaging::PolicyValueSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const Messaging::PolicyValueSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const Messaging::PolicyValueSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + Messaging::PolicyValueSeq::_tao_any_destructor, + TAO::TypeCode::tc_Messaging_PolicyValueSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/Messaging_PolicyValueA.h b/TAO/tao/AnyTypeCode/Messaging_PolicyValueA.h new file mode 100644 index 00000000000..839a7072eb8 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Messaging_PolicyValueA.h @@ -0,0 +1,122 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_MESSAGING_POLICYVALUEA_H_ +#define _TAO_IDL_ORIG_MESSAGING_POLICYVALUEA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/Messaging_PolicyValueC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace Messaging +{ + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_PolicyValue; + + // TAO_IDL - Generated from + // be\be_visitor_sequence/sequence_ch.cpp:101 + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_PolicyValueSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module Messaging + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const Messaging::PolicyValue &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, Messaging::PolicyValue*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, Messaging::PolicyValue *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const Messaging::PolicyValue *&); + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const Messaging::PolicyValueSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, Messaging::PolicyValueSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, Messaging::PolicyValueSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const Messaging::PolicyValueSeq *&); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/Messaging_SyncScopeA.h b/TAO/tao/AnyTypeCode/Messaging_SyncScopeA.h new file mode 100644 index 00000000000..227354c3b60 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Messaging_SyncScopeA.h @@ -0,0 +1,40 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_MESSAGING_SYNCSCOPEA_H_ +#define _TAO_IDL_ORIG_MESSAGING_SYNCSCOPEA_H_ + +#include /**/ "ace/pre.h" + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/NVList.cpp b/TAO/tao/AnyTypeCode/NVList.cpp new file mode 100644 index 00000000000..963b3c9d2b2 --- /dev/null +++ b/TAO/tao/AnyTypeCode/NVList.cpp @@ -0,0 +1,498 @@ +// $Id$ + + +// Implementation of Named Value List and NamedValue classes + +#include "NVList.h" +#include "BoundsC.h" +#include "TypeCode.h" +#include "Marshal.h" +#include "Any_Impl.h" + +#include "tao/SystemException.h" +#include "tao/CORBA_String.h" +#include "tao/CDR.h" +#include "tao/debug.h" + +#include "ace/Auto_Ptr.h" +#include "ace/Log_Msg.h" + +#if !defined (__ACE_INLINE__) +# include "NVList.inl" +#endif /* ! __ACE_INLINE__ */ + +ACE_RCSID (tao, + NVList, + "$Id$") + +// Reference counting for DII Request object + +CORBA::ULong +CORBA::NamedValue::_incr_refcnt (void) +{ + return ++this->refcount_; +} + +CORBA::ULong +CORBA::NamedValue::_decr_refcnt (void) +{ + const CORBA::ULong new_count = --this->refcount_; + + if (new_count == 0) + delete this; + + return new_count; +} + +CORBA::NamedValue::~NamedValue (void) +{ + if (this->name_) + { + CORBA::string_free (this->name_); + this->name_ = 0; + } + // the any will be destroyed by itself +} + +// **************************************************************** + +CORBA::ULong +CORBA::NVList::_incr_refcnt (void) +{ + return ++this->refcount_; +} + +CORBA::ULong +CORBA::NVList::_decr_refcnt (void) +{ + const CORBA::ULong new_count = --this->refcount_; + + if (new_count == 0) + delete this; + + return new_count; +} + +CORBA::NVList::~NVList (void) +{ + // initialize an iterator and delete each NamedValue + ACE_Unbounded_Queue_Iterator iter (this->values_); + + for (iter.first (); !iter.done (); iter.advance ()) + { + CORBA::NamedValue_ptr *nv; + (void) iter.next (nv); + delete *nv; + } + + this->max_ = 0; + + // Remove the CDR stream if it is present. + delete this->incoming_; +} + +// add an element and just initialize its flags +CORBA::NamedValue_ptr +CORBA::NVList::add (CORBA::Flags flags + ACE_ENV_ARG_DECL) +{ + // call the helper to allocate a NamedValue element (if necessary) + return this->add_element (flags + ACE_ENV_ARG_PARAMETER); +} + +// add an element and just initialize its flags and name +CORBA::NamedValue_ptr +CORBA::NVList::add_item (const char *name, + CORBA::Flags flags + ACE_ENV_ARG_DECL) +{ + // call the helper to allocate a NamedValue element + CORBA::NamedValue_ptr nv = this->add_element (flags + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (nv) + { + // now initialize the fields + nv->name_ = CORBA::string_dup (name); + return nv; + } + else + { + return 0; + } +} + +// add a value. If necessary, increment the list +CORBA::NamedValue_ptr +CORBA::NVList::add_value (const char *name, + const CORBA::Any &value, + CORBA::Flags flags + ACE_ENV_ARG_DECL) +{ + // Call the helper to allocate a NamedValue element. + CORBA::NamedValue_ptr nv = this->add_element (flags + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (nv) + { + nv->name_ = CORBA::string_dup (name); + + // With the original Any implementation, we had alternate + // paths for the assignment based on the IN_COPY_VALUE flag. + // Now that the Any's contained Any_Impl is refcounted, the + // distinction between the ORB "copying" or "borrowing" the + // memory is irrelevant. The IN_COPY_VALUE flag was not + // checked anywhere else in the ORB anyway. + nv->any_ = value; + return nv; + } + else + { + return 0; + } +} + +// add an element and just initialize its flags and name +CORBA::NamedValue_ptr +CORBA::NVList::add_item_consume (char *name, + CORBA::Flags flags + ACE_ENV_ARG_DECL) +{ + + // call the helper to allocate a NamedValue element + CORBA::NamedValue_ptr nv = this->add_element (flags + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (nv) + { + // now initialize the fields + + // consume the name + nv->name_ = name; + return nv; + } + else + { + return 0; + } +} + +// add a value. If necessary, increment the list +CORBA::NamedValue_ptr +CORBA::NVList::add_value_consume (char * name, + CORBA::Any * value, + CORBA::Flags flags + ACE_ENV_ARG_DECL) +{ + // call the helper to allocate a NamedValue element + CORBA::NamedValue_ptr nv = this->add_element (flags + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (nv) + { + // now initialize the fields + + // consume name + nv->name_ = name; + + // consume the value @@ (ASG) have we? we may need to destroy + // the in parameter + nv->any_ = *value; + return nv; + } + else + { + return 0; + } +} + +//CORBA::Status +void +CORBA::NVList::remove (CORBA::ULong /* n */ + ACE_ENV_ARG_DECL_NOT_USED) +{ + // not implemented + // @@ (ASG) - TODO +} + +// Helper method +CORBA::NamedValue_ptr +CORBA::NVList::add_element (CORBA::Flags flags + ACE_ENV_ARG_DECL) +{ + this->evaluate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::NamedValue::_nil ()); + + if (ACE_BIT_DISABLED (flags, + CORBA::ARG_IN | CORBA::ARG_OUT | CORBA::ARG_INOUT)) + { + ACE_THROW_RETURN (CORBA::BAD_PARAM (), + CORBA::NamedValue::_nil ()); + } + + CORBA::NamedValue_ptr nv; + + // allocate a new NamedValue + ACE_NEW_THROW_EX (nv, + CORBA::NamedValue, + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (CORBA::NamedValue::_nil ()); + + // set the flags and enqueue in the queue + nv->flags_ = flags; + + if (this->values_.enqueue_tail (nv) == -1) + { + delete nv; + return 0; + } + + this->max_++; + return nv; // success +} + +// return the item at location n +CORBA::NamedValue_ptr +CORBA::NVList::item (CORBA::ULong n + ACE_ENV_ARG_DECL) +{ + this->evaluate (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::NamedValue::_nil ()); + + if (n >= this->max_) + { + ACE_THROW_RETURN (CORBA::Bounds (), + CORBA::NamedValue::_nil ()); + } + + CORBA::NamedValue_ptr *nv = 0; + + this->values_.get (nv, n); + return *nv; +} + +void +CORBA::NVList::_tao_incoming_cdr (TAO_InputCDR &cdr, + int flag, + bool &lazy_evaluation + ACE_ENV_ARG_DECL) +{ + // If the list is empty then using lazy evaluation is the only + // choice. + // @@ There are other cases where we can use lazy evaluation, for + // example if the list is not empty but the anys own all their + // objects. + if (lazy_evaluation == false && this->max_ == 0) + { + lazy_evaluation = true; + } + + if (lazy_evaluation == false) + { + this->_tao_decode (cdr, + flag + ACE_ENV_ARG_PARAMETER); + return; + } + + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_); + + if (this->incoming_ != 0) + { + delete this->incoming_; + this->incoming_ = 0; + } + + ACE_NEW (this->incoming_, TAO_InputCDR (cdr)); + this->incoming_flag_ = flag; +} + +void +CORBA::NVList::_tao_encode (TAO_OutputCDR &cdr, + int flag + ACE_ENV_ARG_DECL) +{ + ACE_GUARD (TAO_SYNCH_MUTEX, + ace_mon, + this->lock_); + + if (this->incoming_ != 0) + { + if (this->max_ == 0) + { + // The list is empty aggresively reduce copies and just send + // the CDR stream, we assume that + // TAO_Server_Request::init_reply + // has inserted appropiated padding already to make this + // operation correct + cdr.write_octet_array_mb (this->incoming_->start ()); + return; + } + + // Then unmarshal each "in" and "inout" parameter. + ACE_Unbounded_Queue_Iterator i (this->values_); + + for (i.first (); !i.done (); i.advance ()) + { + CORBA::NamedValue_ptr *item = 0; + (void) i.next (item); + + CORBA::NamedValue_ptr nv = *item; + + if (ACE_BIT_DISABLED (nv->flags (), flag)) + { + continue; + } + + if (TAO_debug_level > 3) + { + const char* arg = nv->name (); + + if (arg == 0) + { + arg = "(nil)"; + } + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("NVList::_tao_encode - parameter <%s>\n"), + ACE_TEXT_CHAR_TO_TCHAR (arg))); + } + CORBA::TypeCode_ptr tc = nv->value ()->_tao_get_typecode (); + (void) TAO_Marshal_Object::perform_append (tc, + this->incoming_, + &cdr + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + + delete this->incoming_; + this->incoming_ = 0; + return; + } + + // The list is already evaluated, we cannot optimize the copies, go + // ahead with the slow way to do things. + + // Then marshal each "in" and "inout" parameter. + ACE_Unbounded_Queue_Iterator i (this->values_); + + for (i.first (); !i.done (); i.advance ()) + { + CORBA::NamedValue_ptr *item = 0; + (void) i.next (item); + + CORBA::NamedValue_ptr nv = *item; + + if (ACE_BIT_DISABLED (nv->flags (), flag)) + { + continue; + } + + nv->value ()->impl ()->marshal_value (cdr); + } +} + +void +CORBA::NVList::_tao_decode (TAO_InputCDR &incoming, + int flag + ACE_ENV_ARG_DECL) +{ + if (TAO_debug_level > 3) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) : NVList::_tao_decode\n"))); + } + + // Then unmarshal each "in" and "inout" parameter. + ACE_Unbounded_Queue_Iterator i (this->values_); + + for (i.first (); !i.done (); i.advance ()) + { + CORBA::NamedValue_ptr *item; + (void) i.next (item); + + CORBA::NamedValue_ptr nv = *item; + + // check if it is an in or inout parameter + // @@ this is where we assume that the NVList is coming from + // a Server-side request, we could probably handle both + // cases with a flag, but there is no clear need for that. + if (ACE_BIT_DISABLED (nv->flags (), flag)) + { + continue; + } + + if (TAO_debug_level > 3) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) : NVList::_tao_decode - %s\n"), + ACE_TEXT_CHAR_TO_TCHAR (nv->name ()? nv->name () : "(no name given)" ))); + } + + CORBA::Any_ptr any = nv->value (); + any->impl ()->_tao_decode (incoming + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } +} + +ptrdiff_t +CORBA::NVList::_tao_target_alignment (void) +{ + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, + ace_mon, + this->lock_, + ACE_CDR::MAX_ALIGNMENT); + + if (this->incoming_ == 0) + { + return ACE_CDR::MAX_ALIGNMENT; + } + + const char* rd = this->incoming_->start ()->rd_ptr (); + ptrdiff_t t = ptrdiff_t (rd) % ACE_CDR::MAX_ALIGNMENT; + + if (t < 0) + { + t += ACE_CDR::MAX_ALIGNMENT; + } + + return t; +} + +void +CORBA::NVList::evaluate (ACE_ENV_SINGLE_ARG_DECL) +{ + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_); + + if (this->incoming_ == 0) + { + return; + } + + auto_ptr incoming (this->incoming_); + this->incoming_ = 0; + + this->_tao_decode (*(incoming.get ()), + this->incoming_flag_ + ACE_ENV_ARG_PARAMETER); +} + +CORBA::Boolean +CORBA::NVList::_lazy_has_arguments (void) const +{ + if (this->incoming_ != 0) + { + return this->incoming_->length () == 0 ? 0 : 1; + } + else + { + return this->count () == 0 ? 0 : 1; + } +} + diff --git a/TAO/tao/AnyTypeCode/NVList.h b/TAO/tao/AnyTypeCode/NVList.h new file mode 100644 index 00000000000..961796fafc7 --- /dev/null +++ b/TAO/tao/AnyTypeCode/NVList.h @@ -0,0 +1,307 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file NVList.h + * + * $Id$ + * + * @author Copyright 1994-1995 by Sun Microsystems Inc. + * @author Aniruddha Gokhale + */ +//============================================================================= + + +#ifndef TAO_NVLIST_H +#define TAO_NVLIST_H + +#include /**/ "ace/pre.h" +#include "ace/CORBA_macros.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Unbounded_Queue.h" +#include "ace/Thread_Mutex.h" +#include "ace/Atomic_Op.h" + +#include "tao/Environment.h" +#include "tao/AnyTypeCode/AnyTypeCode_methods.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/NVList_Adapter_Impl.h" + +class TAO_ORB_Core; +class TAO_InputCDR; + +namespace CORBA +{ + enum + { + // = Flags for NVList add methods + ARG_IN = 0x01, + ARG_OUT = 0x02, + ARG_INOUT = 0x04, + IN_COPY_VALUE = 0x08, + OUT_LIST_MEMORY = 0x10, + DEPENDENT_LIST = 0x20, + + // = (Unused) flags for Context methods + CTX_RESTRICT_SCOPE = 0x40, + CTX_DELETE_DESCENDENTS = 0x80, + + // = Flags for deferred synchronous methods + INV_NO_RESPONSE = 0x100, + INV_TERM_ON_ERR = 0x200, + RESP_NO_WAIT = 0x400 + }; + + typedef TAO_Pseudo_Var_T NamedValue_var; + typedef TAO_Pseudo_Out_T NamedValue_out; + + typedef ULong Flags; + + /** + * @class NamedValue + * + * @brief CORBA Name/value pair implementation. + * + * These occur only in "NVList" (named value list) data structures. + * The binary form of the data structure is frozen and visible to + * programs using it (e.g. from C). The C++ class supports some + * programming discipline, e.g. to avoid memory leaks. They just + * represent parameters to calls. The name is optional, and the + * value is packaged as an Any. The flags indicate parameter mode, + * and some ownership rules for "top level" memory. + */ + class TAO_AnyTypeCode_Export NamedValue + { + friend class TAO_NVList_Adapter_Impl; + friend class NVList; + friend class Request; + + public: + /// optional name + const char * name (void) const; + + /// return the value + Any_ptr value (void) const; + + /// return the parameter mode flag + Flags flags (void) const; + + // The pseudo object static methods.. + static NamedValue * _duplicate (NamedValue *); + static NamedValue * _nil (void); + + // = Reference counting. + ULong _incr_refcnt (void); + ULong _decr_refcnt (void); + + // Useful for template programming. + typedef NamedValue_ptr _ptr_type; + typedef NamedValue_var _var_type; + + protected: + + /// Destructor + /** + * Protected destructor to enforce proper memory management + * through the reference counting mechanism. + */ + ~NamedValue (void); + + private: + + /// private constructor. Cannot be directly instantiated other than + /// by its friends. + NamedValue (void); + + private: + + /// Reference counter. + ACE_Atomic_Op refcount_; + + /// holds the value + Any any_; + + /// parameter mode flags + Flags flags_; + + /// optional IDL name of the parameter + char * name_; + }; + + // **************************************************************** + + typedef TAO_Pseudo_Var_T NVList_var; + typedef TAO_Pseudo_Out_T NVList_out; + + /** + * @class NVList + * + * @brief CORBA::NVList implementation. + + * This is used in the (client side) DII (Dynamic Invocation + * Interface) to hold parameters, except for the return + * parameter. It's used in the same role in the (server side) DSI + * (Dynamic Skeleton Interface). + * + * Each user (client, server) provides the typecode and memory for + * each parameter using an NVList, then talks to the ORB using a + * Request or ServerRequest pseudo-object. The ORB copies data + * to/from the IPC messages (e.g. IIOP::Request, IIOP::Response) + * as appropriate. + */ + class TAO_AnyTypeCode_Export NVList + { + friend class TAO_NVList_Adapter_Impl; + friend class Request; + + public: + + /// return the current number of elements in the list + ULong count (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) const; + + /// add an element and just initialize the flags + NamedValue_ptr add (Flags + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + /// add an element and initialize its name and flags + NamedValue_ptr add_item (const char *, + Flags + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + /// initializes a value, name, and flags + NamedValue_ptr add_value (const char *, + const Any &, + Flags + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + /// just like add_item. In addition, memory management of char * + /// name is taken over by the NVList + NamedValue_ptr add_item_consume (char *, + Flags + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + /// just like add_value. In addition, the NVList controls the + /// memory management of the char *name and Any *value parameter + NamedValue_ptr add_value_consume (char *, + Any_ptr, + Flags + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + /// retrieve the item at the nth location. Raises Bounds + NamedValue_ptr item (ULong n + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + // CORBA::Status + /// remove element at index n. Raises Bounds + void remove (ULong n + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + // The pseudo object static methods.. + static NVList * _duplicate (NVList *); + static NVList * _nil (void); + + // = Reference counting. + ULong _incr_refcnt (void); + ULong _decr_refcnt (void); + + // = TAO Extensions: + + /** + * Set the incoming CDR stream, this is used by TAO to perform lazy + * evaluation of the NVList in an incoming ServerRequest. + * The is used to check which parameters (IN, OUT and/or + * INOUT) are to be extracted + */ + void _tao_incoming_cdr (TAO_InputCDR & cdr, + int flag, + bool &lazy_evaluation + ACE_ENV_ARG_DECL); + + /// Encode the NVList into the CDR stream. masks the type of + /// arguments (IN, OUT or INOUT) that are to be marshaled. + void _tao_encode (TAO_OutputCDR & cdr, + int flag + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + /// Decode the NVList arguments from the stream. + void _tao_decode (TAO_InputCDR & cdr, + int flag + ACE_ENV_ARG_DECL); + + /** + * Return the required alignment to marshal the NVList without any + * re-alignment. + * It returns ACE_CDR::MAX_ALIGNMENT to indicate errors. + */ + ptrdiff_t _tao_target_alignment (void); + + /** + * If this list is used by a DII request, this will tell us if + * our CDR stream contains any marshaled arguments (needed for + * GIOP 1.2). + */ + Boolean _lazy_has_arguments (void) const; + + // Useful for template programming. + typedef NVList_ptr _ptr_type; + typedef NVList_var _var_type; + + protected: + + /// Destructor + /** + * Protected destructor to enforce proper memory management + * through the reference counting mechanism. + */ + ~NVList (void); + + private: + /// constructor - cannot be instantiated directly other than + /// through the CORBA::ORB::create_list method + NVList (void); + + /// helper to increase the list size. This is used by all the add_ + /// methods of the NVList class + NamedValue_ptr add_element (Flags + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + /// Lazy evaluation routine to fill up the Anys in the NVList from + /// the CDR stream. + void evaluate (ACE_ENV_SINGLE_ARG_DECL); + + private: + /// internal list of parameters stored as NamedValues + ACE_Unbounded_Queue values_; + + /// maximum length of list + ULong max_; + + /// Reference counter. + ACE_Atomic_Op refcount_; + + /// Protects the incoming pointer. + TAO_SYNCH_MUTEX lock_; + + /** + * When the NVList is used as part of a Server Request we can simply + * store the CDR buffer and perform lazy evaluation to compute the + * Anys. + */ + TAO_InputCDR * incoming_; + + /// The flags used to check which parameters are actually extracted + /// from the buffer + int incoming_flag_; + }; +} + +#if defined (__ACE_INLINE__) +# include "tao/NVList.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" +#endif /* TAO_NVLIST_H */ diff --git a/TAO/tao/AnyTypeCode/NVList.inl b/TAO/tao/AnyTypeCode/NVList.inl new file mode 100644 index 00000000000..035279feaf6 --- /dev/null +++ b/TAO/tao/AnyTypeCode/NVList.inl @@ -0,0 +1,126 @@ +// -*- C++ -*- +// +// $Id$ + +ACE_INLINE CORBA::Boolean +CORBA::is_nil (CORBA::NamedValue_ptr nv) +{ + return nv == 0; +} + +ACE_INLINE void +CORBA::release (CORBA::NamedValue_ptr nv) +{ + if (nv) + nv->_decr_refcnt (); +} + +// ************************************************************* + +ACE_INLINE +CORBA::NamedValue::NamedValue (void) + : refcount_ (1), + flags_ (0), + name_ (0) +{ +} + +ACE_INLINE +const char * +CORBA::NamedValue::name (void) const +{ + return this->name_; +} + +ACE_INLINE +CORBA::Any_ptr +CORBA::NamedValue::value (void) const +{ + return const_cast (&this->any_); +} + +ACE_INLINE +CORBA::Flags +CORBA::NamedValue::flags (void) const +{ + return this->flags_; +} + +ACE_INLINE +CORBA::NamedValue * +CORBA::NamedValue::_duplicate (CORBA::NamedValue * x) +{ + if (x != 0) + { + x->_incr_refcnt (); + } + + return x; +} + +ACE_INLINE +CORBA::NamedValue* +CORBA::NamedValue::_nil (void) +{ + return 0; +} + +// ************************************************************* + +ACE_INLINE +CORBA::Boolean +CORBA::is_nil (CORBA::NVList_ptr nvl) +{ + return (CORBA::Boolean) (nvl == 0); +} + +ACE_INLINE +void +CORBA::release (CORBA::NVList_ptr nvl) +{ + if (nvl) + { + nvl->_decr_refcnt (); + } +} + +// **************************************************************** + +ACE_INLINE +CORBA::NVList::NVList (void) + : max_ (0), + refcount_ (1), + incoming_ (0), + incoming_flag_ (0) +{ +} + +ACE_INLINE +CORBA::ULong +CORBA::NVList::count (ACE_ENV_SINGLE_ARG_DECL) const +{ + (const_cast (this))->evaluate ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return this->max_; +} + +ACE_INLINE +CORBA::NVList * +CORBA::NVList::_duplicate (CORBA::NVList * x) +{ + if (x != 0) + { + x->_incr_refcnt (); + } + + return x; +} + +ACE_INLINE +CORBA::NVList * +CORBA::NVList::_nil (void) +{ + return 0; +} diff --git a/TAO/tao/AnyTypeCode/NVList_Adapter_Impl.cpp b/TAO/tao/AnyTypeCode/NVList_Adapter_Impl.cpp new file mode 100644 index 00000000000..212a10a3dbf --- /dev/null +++ b/TAO/tao/AnyTypeCode/NVList_Adapter_Impl.cpp @@ -0,0 +1,79 @@ +// @(#) $Id$ + +#include "tao/AnyTypeCode/NVList_Adapter_Impl.h" + +ACE_RCSID (AnyTypeCode, + NVList_Adapter_Impl, + "$Id$") + +#include "tao/AnyTypeCode/NVList.h" +#include "tao/SystemException.h" + +void +TAO_NVList_Adapter_Impl::create_list ( + CORBA::Long count, + CORBA::NVList_ptr &new_list + ACE_ENV_ARG_DECL) +{ + ACE_ASSERT (CORBA::ULong (count) <= UINT_MAX); + // Create an empty list + ACE_NEW_THROW_EX (new_list, + CORBA::NVList, + CORBA::NO_MEMORY ( + CORBA::SystemException::_tao_minor_code ( + 0, + ENOMEM), + CORBA::COMPLETED_NO)); + ACE_CHECK; + + // If count is greater than 0, create a list of NamedValues. + if (count != 0) + { + new_list->max_ = (CORBA::ULong) count; + + for (CORBA::Long i = 0; i < count; ++i) + { + CORBA::NamedValue_ptr nv = 0; + ACE_NEW_THROW_EX (nv, + CORBA::NamedValue, + CORBA::NO_MEMORY ( + CORBA::SystemException::_tao_minor_code ( + 0, + ENOMEM), + CORBA::COMPLETED_NO)); + ACE_CHECK; + + new_list->values_.enqueue_tail (nv); + } + } +} + +void +TAO_NVList_Adapter_Impl::create_named_value ( + CORBA::NamedValue_ptr &nv + ACE_ENV_ARG_DECL) +{ + ACE_NEW_THROW_EX (nv, + CORBA::NamedValue, + CORBA::NO_MEMORY ( + CORBA::SystemException::_tao_minor_code ( + 0, + ENOMEM), + CORBA::COMPLETED_NO)); +} + +int +TAO_NVList_Adapter_Impl::Initializer (void) +{ + return ACE_Service_Config::process_directive (ace_svc_desc_TAO_NVList_Adapter_Impl); +} + +ACE_STATIC_SVC_DEFINE (TAO_NVList_Adapter_Impl, + ACE_TEXT ("TAO_NVList_Adapter"), + ACE_SVC_OBJ_T, + &ACE_SVC_NAME (TAO_NVList_Adapter_Impl), + ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, + 0) +ACE_FACTORY_DEFINE (TAO_AnyTypeCode, TAO_NVList_Adapter_Impl) + + diff --git a/TAO/tao/AnyTypeCode/NVList_Adapter_Impl.h b/TAO/tao/AnyTypeCode/NVList_Adapter_Impl.h new file mode 100644 index 00000000000..60593941e08 --- /dev/null +++ b/TAO/tao/AnyTypeCode/NVList_Adapter_Impl.h @@ -0,0 +1,56 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file NVList_Adapter_Impl.h + * + * $Id$ + * + * @author Johnny Willemsen + */ +//============================================================================= + +#ifndef TAO_NVLIST_ADAPTER_IMPL_H +#define TAO_NVLIST_ADAPTER_IMPL_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/NVList_Adapter.h" +#include "ace/Service_Config.h" + +/** + * @class TAO_NVList_Adapter + */ +class TAO_AnyTypeCode_Export TAO_NVList_Adapter_Impl + : public TAO_NVList_Adapter +{ +public: + virtual void create_list ( + CORBA::Long count, + CORBA::NVList_ptr &new_list + ACE_ENV_ARG_DECL); + + virtual void create_named_value ( + CORBA::NamedValue_ptr &nv + ACE_ENV_ARG_DECL); + + /// Used to force the initialization of the NVList adapter + static int Initializer (void); +}; + +ACE_STATIC_SVC_DECLARE (TAO_NVList_Adapter_Impl) +ACE_FACTORY_DECLARE (TAO_AnyTypeCode, TAO_NVList_Adapter_Impl) + +static int +TAO_Requires_NVList_Adapter_Impl_Initializer = + TAO_NVList_Adapter_Impl::Initializer (); + + +#include /**/ "ace/post.h" +#endif /* TAO_NVLIST_ADAPTER_IMPL_H */ diff --git a/TAO/tao/AnyTypeCode/Null_RefCount_Policy.h b/TAO/tao/AnyTypeCode/Null_RefCount_Policy.h new file mode 100644 index 00000000000..9206227ec0d --- /dev/null +++ b/TAO/tao/AnyTypeCode/Null_RefCount_Policy.h @@ -0,0 +1,78 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Null_RefCount_Policy.h + * + * $Id$ + * + * Header file for TAO's reference count policy (unrelated to CORBA + * policies). + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_NULL_REFCOUNT_POLICY_H +#define TAO_NULL_REFCOUNT_POLICY_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace TAO +{ + + /** + * @class Null_RefCount_Policy + * + * @brief No-op reference counting policy. + * + * This class is intended to be used as a "policy" argument to a + * host class template that implements no-op reference counting. + * That class would then inherit privately from it like so: + * + * @code + * template + * class MyHostClass : private RefCountPolicy + * { + * public: + * void my_add_ref (void) { this->RefCountPolicy::add_ref (); } + * void my_remove_ref (void) { this->RefCountPolicy::remove_ref (); } + * }; + * @endcode + * + * and use it like so: + * + * @code + * typedef MyHostClass MyNonRefCountedClass; + * MyNonRefCountedClass m; + * ... + * @endcode + * + * @note In order to incur no size overhead on the host class due to + * virtual tables, no base class defining an interface is + * defined. This allows C++ compilers to apply the Empty Base + * Class Optimization. + */ + class TAO_AnyTypeCode_Export Null_RefCount_Policy + { + public: + + /// No-op reference increment. + void add_ref (void) { } + + /// No-op reference decrement. + void remove_ref (void) { } + + }; + +} // End namespace TAO + +#include /**/ "ace/post.h" + +#endif /* TAO_NULL_REFCOUNT_POLICY_H */ diff --git a/TAO/tao/AnyTypeCode/ObjectIdListA.cpp b/TAO/tao/AnyTypeCode/ObjectIdListA.cpp new file mode 100644 index 00000000000..409a8b0e341 --- /dev/null +++ b/TAO/tao/AnyTypeCode/ObjectIdListA.cpp @@ -0,0 +1,100 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "ObjectIdListA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/AnyTypeCode/String_TypeCode_Static.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_CORBA_ORB_ObjectId ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/ORB_ObjectId:1.0", + "ORB_ObjectId", + &CORBA::_tc_string); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ORB_ObjectId = + &_tao_tc_CORBA_ORB_ObjectId; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_ORB_ObjectIdList_GUARD +#define _TAO_TYPECODE_CORBA_ORB_ObjectIdList_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_ORB_ObjectIdList_0 ( + CORBA::tk_sequence, + &CORBA::_tc_ORB_ObjectId, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_ORB_ObjectIdList_0 = + &CORBA_ORB_ObjectIdList_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_ORB_ObjectIdList_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_ORB_ObjectIdList ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/ORB_ObjectIdList:1.0", + "ORB_ObjectIdList", + &TAO::TypeCode::tc_CORBA_ORB_ObjectIdList_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ORB_ObjectIdList = + &_tao_tc_CORBA_ORB_ObjectIdList; +} + diff --git a/TAO/tao/AnyTypeCode/ObjectIdListA.h b/TAO/tao/AnyTypeCode/ObjectIdListA.h new file mode 100644 index 00000000000..9d3786b9f0b --- /dev/null +++ b/TAO/tao/AnyTypeCode/ObjectIdListA.h @@ -0,0 +1,101 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_OBJECTIDLISTA_H_ +#define _TAO_IDL_ORIG_OBJECTIDLISTA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/ObjectIdListC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ORB_ObjectId; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ORB_ObjectIdList; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/Objref_TypeCode.cpp b/TAO/tao/AnyTypeCode/Objref_TypeCode.cpp new file mode 100644 index 00000000000..bf53f06da69 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Objref_TypeCode.cpp @@ -0,0 +1,153 @@ +// $Id$ + +#ifndef TAO_OBJREF_TYPECODE_CPP +#define TAO_OBJREF_TYPECODE_CPP + +#include "tao/AnyTypeCode/Objref_TypeCode.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/Objref_TypeCode.inl" +#endif /* !__ACE_INLINE__ */ + +#include "tao/CDR.h" + +#include "ace/OS_NS_string.h" + + +template +bool +TAO::TypeCode::Objref::tao_marshal ( + TAO_OutputCDR & cdr, + CORBA::ULong) const +{ + // A tk_objref TypeCode has a "complex" parameter list type (see + // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of + // the CORBA specification), meaning that it must be marshaled into + // a CDR encapsulation. + + // Create a CDR encapsulation. + TAO_OutputCDR enc; + + return + enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER) + && enc << TAO_OutputCDR::from_string (this->attributes_.id (), 0) + && enc << TAO_OutputCDR::from_string (this->attributes_.name (), 0) + && cdr << static_cast (enc.total_length ()) + && cdr.write_octet_array_mb (enc.begin ()); +} + +template +void +TAO::TypeCode::Objref::tao_duplicate (void) +{ + this->RefCountPolicy::add_ref (); +} + +template +void +TAO::TypeCode::Objref::tao_release (void) +{ + this->RefCountPolicy::remove_ref (); +} + +template +CORBA::Boolean +TAO::TypeCode::Objref::equal_i ( + CORBA::TypeCode_ptr /* tc */ + ACE_ENV_ARG_DECL_NOT_USED) const +{ + // Equality has already been established in the + // CORBA::TypeCode base class. + + return true; +} + +template +CORBA::Boolean +TAO::TypeCode::Objref::equivalent_i ( + CORBA::TypeCode_ptr + ACE_ENV_ARG_DECL_NOT_USED) const +{ + // Equivalence already verified in the base class + // CORBA::TypeCode::equivalent() method. + + return true; +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::Objref::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const +{ + TAO_TypeCodeFactory_Adapter * const adapter = + ACE_Dynamic_Service::instance ( + TAO_ORB_Core::typecodefactory_adapter_name () + ); + + if (adapter == 0) + { + ACE_THROW_RETURN (CORBA::INTERNAL (), + CORBA::TypeCode::_nil ()); + } + + if (this->kind_ == CORBA::tk_abstract_interface) + { + return adapter->create_abstract_interface_tc (this->attributes_.id (), + "" /* empty name */ + ACE_ENV_ARG_PARAMETER); + } + else if (this->kind_ == CORBA::tk_component) + { + return adapter->create_component_tc (this->attributes_.id (), + "" /* empty name */ + ACE_ENV_ARG_PARAMETER); + } + else if (this->kind_ == CORBA::tk_home) + { + return adapter->create_home_tc (this->attributes_.id (), + "" /* empty name */ + ACE_ENV_ARG_PARAMETER); + } + else if (this->kind_ == CORBA::tk_local_interface) + { + return adapter->create_local_interface_tc (this->attributes_.id (), + "" /* empty name */ + ACE_ENV_ARG_PARAMETER); + + } + else if (this->kind_ == CORBA::tk_native) + { + return adapter->create_native_tc (this->attributes_.id (), + "" /* empty name */ + ACE_ENV_ARG_PARAMETER); + } + else // CORBA::tk_objref + { + return adapter->create_interface_tc (this->attributes_.id (), + "" /* empty name */ + ACE_ENV_ARG_PARAMETER); + } +} + +template +char const * +TAO::TypeCode::Objref::id_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->attributes_.id (); +} + +template +char const * +TAO::TypeCode::Objref::name_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->attributes_.name (); +} + +#endif /* TAO_OBJREF_TYPECODE_CPP */ diff --git a/TAO/tao/AnyTypeCode/Objref_TypeCode.h b/TAO/tao/AnyTypeCode/Objref_TypeCode.h new file mode 100644 index 00000000000..0e2a0e03f3a --- /dev/null +++ b/TAO/tao/AnyTypeCode/Objref_TypeCode.h @@ -0,0 +1,122 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Objref_TypeCode.h + * + * $Id$ + * + * Header file for + * @c tk_abstract_interface, + * @c tk_component, + * @c tk_home, + * @c tk_local_interface, + * @c tk_native and + * @c tk_objref + * @c CORBA::TypeCodes. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_OBJREF_TYPECODE_H +#define TAO_OBJREF_TYPECODE_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TypeCode_Base_Attributes.h" + +namespace TAO +{ + namespace TypeCode + { + /** + * @class Objref_Base + * + * @brief @c CORBA::TypeCode implementation for an OMG IDL + * @c object and object-like types. + * + * This class implements a @c CORBA::TypeCode for an OMG IDL + * @c object (interface) and object-like types (abstract + * interface, component, home, local interface and native). + */ + template + class Objref + : public CORBA::TypeCode, + private RefCountPolicy + { + public: + + /// Constructor. + Objref (CORBA::TCKind kind, + char const * id, + char const * name); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c tk_abstract_interface, @c tk_component, @c + * tk_local_interface, @c tk_native and @c tk_objref + * @c CORBA::TypeCode -specific template methods. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * name_i (ACE_ENV_SINGLE_ARG_DECL) const; + + protected: + + /// Base attributes (@c id and @c name). + Base_Attributes attributes_; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/Objref_TypeCode.inl" +#endif /* __ACE_INLINE__ */ + +#ifdef ACE_TEMPLATES_REQUIRE_SOURCE +# include "tao/AnyTypeCode/Objref_TypeCode.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA +# pragma implementation ("Objref_TypeCode.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* TAO_OBJREF_TYPECODE_H */ diff --git a/TAO/tao/AnyTypeCode/Objref_TypeCode.inl b/TAO/tao/AnyTypeCode/Objref_TypeCode.inl new file mode 100644 index 00000000000..e40aa1e10d9 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Objref_TypeCode.inl @@ -0,0 +1,16 @@ +// -*- C++ -*- +// +// $Id$ + + +template +ACE_INLINE +TAO::TypeCode::Objref::Objref ( + CORBA::TCKind kind, + char const * id, + char const * name) + : CORBA::TypeCode (kind) + , RefCountPolicy () + , attributes_ (id, name) +{ +} diff --git a/TAO/tao/AnyTypeCode/Objref_TypeCode_Static.cpp b/TAO/tao/AnyTypeCode/Objref_TypeCode_Static.cpp new file mode 100644 index 00000000000..69a540da1f0 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Objref_TypeCode_Static.cpp @@ -0,0 +1,149 @@ +// $Id$ + +#include "tao/AnyTypeCode/Objref_TypeCode_Static.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/Objref_TypeCode_Static.inl" +#endif /* !__ACE_INLINE__ */ + +#include "tao/CDR.h" +#include "tao/TypeCodeFactory_Adapter.h" +#include "tao/ORB_Core.h" + +#include "ace/Dynamic_Service.h" +#include "ace/OS_NS_string.h" + + +ACE_RCSID (tao, + Objref_TypeCode_Static, + "$Id$") + + +bool +TAO::TypeCode::Objref::tao_marshal ( + TAO_OutputCDR & cdr, + CORBA::ULong) const +{ + // A tk_objref TypeCode has a "complex" parameter list type (see + // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of + // the CORBA specification), meaning that it must be marshaled into + // a CDR encapsulation. + + // Create a CDR encapsulation. + TAO_OutputCDR enc; + + return + enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER) + && enc << TAO_OutputCDR::from_string (this->attributes_.id (), 0) + && enc << TAO_OutputCDR::from_string (this->attributes_.name (), 0) + && cdr << static_cast (enc.total_length ()) + && cdr.write_octet_array_mb (enc.begin ()); +} + +void +TAO::TypeCode::Objref::tao_duplicate (void) +{ +} + +void +TAO::TypeCode::Objref::tao_release (void) +{ +} + +CORBA::Boolean +TAO::TypeCode::Objref::equal_i ( + CORBA::TypeCode_ptr /* tc */ + ACE_ENV_ARG_DECL_NOT_USED) const +{ + // Equality has already been established in the + // CORBA::TypeCode base class. + + return true; +} + +CORBA::Boolean +TAO::TypeCode::Objref::equivalent_i ( + CORBA::TypeCode_ptr + ACE_ENV_ARG_DECL_NOT_USED) const +{ + // Equivalence already verified in the base class + // CORBA::TypeCode::equivalent() method. + + return true; +} + +CORBA::TypeCode_ptr +TAO::TypeCode::Objref::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const +{ + TAO_TypeCodeFactory_Adapter * const adapter = + ACE_Dynamic_Service::instance ( + TAO_ORB_Core::typecodefactory_adapter_name () + ); + + if (adapter == 0) + { + ACE_THROW_RETURN (CORBA::INTERNAL (), + CORBA::TypeCode::_nil ()); + } + + if (this->kind_ == CORBA::tk_abstract_interface) + { + return adapter->create_abstract_interface_tc (this->attributes_.id (), + "" /* empty name */ + ACE_ENV_ARG_PARAMETER); + } + else if (this->kind_ == CORBA::tk_component) + { + return adapter->create_component_tc (this->attributes_.id (), + "" /* empty name */ + ACE_ENV_ARG_PARAMETER); + } + else if (this->kind_ == CORBA::tk_home) + { + return adapter->create_home_tc (this->attributes_.id (), + "" /* empty name */ + ACE_ENV_ARG_PARAMETER); + } + else if (this->kind_ == CORBA::tk_local_interface) + { + return adapter->create_local_interface_tc (this->attributes_.id (), + "" /* empty name */ + ACE_ENV_ARG_PARAMETER); + + } + else if (this->kind_ == CORBA::tk_native) + { + return adapter->create_native_tc (this->attributes_.id (), + "" /* empty name */ + ACE_ENV_ARG_PARAMETER); + } + else // CORBA::tk_objref + { + return adapter->create_interface_tc (this->attributes_.id (), + "" /* empty name */ + ACE_ENV_ARG_PARAMETER); + } +} + +char const * +TAO::TypeCode::Objref::id_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->attributes_.id (); +} + +char const * +TAO::TypeCode::Objref::name_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->attributes_.name (); +} + diff --git a/TAO/tao/AnyTypeCode/Objref_TypeCode_Static.h b/TAO/tao/AnyTypeCode/Objref_TypeCode_Static.h new file mode 100644 index 00000000000..9d0837811df --- /dev/null +++ b/TAO/tao/AnyTypeCode/Objref_TypeCode_Static.h @@ -0,0 +1,118 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Objref_TypeCode_Static.h + * + * $Id$ + * + * Header file for static + * @c tk_abstract_interface, + * @c tk_component, + * @c tk_home, + * @c tk_local_interface, + * @c tk_native and + * @c tk_objref + * @c CORBA::TypeCodes. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_OBJREF_TYPECODE_STATIC_H +#define TAO_OBJREF_TYPECODE_STATIC_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TypeCode_Base_Attributes.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" + + +namespace TAO +{ + namespace TypeCode + { + template class Objref; + + /** + * @class Objref + * + * @brief @c CORBA::TypeCode implementation for an OMG IDL + * @c object and object-like types. + * + * This class implements a @c CORBA::TypeCode for an OMG IDL + * @c object (interface) and object-like types (abstract + * interface, component, home, local interface and native). + */ + template<> + class TAO_AnyTypeCode_Export Objref + : public CORBA::TypeCode, + private TAO::Null_RefCount_Policy + { + public: + + /// Constructor. + Objref (CORBA::TCKind kind, + char const * id, + char const * name); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c tk_abstract_interface, @c tk_component, @c + * tk_local_interface, @c tk_native and @c tk_objref + * @c CORBA::TypeCode -specific template methods. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * name_i (ACE_ENV_SINGLE_ARG_DECL) const; + + protected: + + /// Base attributes (@c id and @c name). + Base_Attributes attributes_; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/Objref_TypeCode_Static.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* TAO_OBJREF_TYPECODE_STATIC_H */ diff --git a/TAO/tao/AnyTypeCode/Objref_TypeCode_Static.inl b/TAO/tao/AnyTypeCode/Objref_TypeCode_Static.inl new file mode 100644 index 00000000000..07c5d36ece2 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Objref_TypeCode_Static.inl @@ -0,0 +1,15 @@ +// -*- C++ -*- +// +// $Id$ + + +ACE_INLINE +TAO::TypeCode::Objref::Objref ( + CORBA::TCKind kind, + char const * id, + char const * name) + : CORBA::TypeCode (kind) + , ACE_NESTED_CLASS (TAO, Null_RefCount_Policy) () + , attributes_ (id, name) +{ +} diff --git a/TAO/tao/AnyTypeCode/OctetSeqA.cpp b/TAO/tao/AnyTypeCode/OctetSeqA.cpp new file mode 100644 index 00000000000..66b18534bb1 --- /dev/null +++ b/TAO/tao/AnyTypeCode/OctetSeqA.cpp @@ -0,0 +1,142 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "OctetSeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_OctetSeq_GUARD +#define _TAO_TYPECODE_CORBA_OctetSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_OctetSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_octet, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_OctetSeq_0 = + &CORBA_OctetSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_OctetSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_OctetSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/OctetSeq:1.0", + "OctetSeq", + &TAO::TypeCode::tc_CORBA_OctetSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_OctetSeq = + &_tao_tc_CORBA_OctetSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::OctetSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::OctetSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_OctetSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::OctetSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::OctetSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_OctetSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::OctetSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::OctetSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::OctetSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::OctetSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_OctetSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/OctetSeqA.h b/TAO/tao/AnyTypeCode/OctetSeqA.h new file mode 100644 index 00000000000..a38ca95d79b --- /dev/null +++ b/TAO/tao/AnyTypeCode/OctetSeqA.h @@ -0,0 +1,66 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:788 + +#ifndef _TAO_IDL_ANYTYPECODE_OCTETSEQA_H_ +#define _TAO_IDL_ANYTYPECODE_OCTETSEQA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/OctetSeqC.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_OctetSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::OctetSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::OctetSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::OctetSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::OctetSeq *&); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/PI_ForwardA.cpp b/TAO/tao/AnyTypeCode/PI_ForwardA.cpp new file mode 100644 index 00000000000..6d4394780cf --- /dev/null +++ b/TAO/tao/AnyTypeCode/PI_ForwardA.cpp @@ -0,0 +1,197 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "PI_ForwardA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/String_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" + +#include "tao/AnyTypeCode/StringSeqA.h" +#include "tao/AnyTypeCode/OctetSeqA.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_PortableInterceptor_ServerId ( + CORBA::tk_alias, + "IDL:omg.org/PortableInterceptor/ServerId:1.0", + "ServerId", + &CORBA::_tc_string); + +namespace PortableInterceptor +{ + ::CORBA::TypeCode_ptr const _tc_ServerId = + &_tao_tc_PortableInterceptor_ServerId; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_PortableInterceptor_ORBId ( + CORBA::tk_alias, + "IDL:omg.org/PortableInterceptor/ORBId:1.0", + "ORBId", + &CORBA::_tc_string); + +namespace PortableInterceptor +{ + ::CORBA::TypeCode_ptr const _tc_ORBId = + &_tao_tc_PortableInterceptor_ORBId; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_PortableInterceptor_AdapterName ( + CORBA::tk_alias, + "IDL:omg.org/PortableInterceptor/AdapterName:1.0", + "AdapterName", + &CORBA::_tc_StringSeq); + +namespace PortableInterceptor +{ + ::CORBA::TypeCode_ptr const _tc_AdapterName = + &_tao_tc_PortableInterceptor_AdapterName; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_PortableInterceptor_ObjectId ( + CORBA::tk_alias, + "IDL:omg.org/PortableInterceptor/ObjectId:1.0", + "ObjectId", + &CORBA::_tc_OctetSeq); + +namespace PortableInterceptor +{ + ::CORBA::TypeCode_ptr const _tc_ObjectId = + &_tao_tc_PortableInterceptor_ObjectId; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_PortableInterceptor_AdapterManagerId ( + CORBA::tk_alias, + "IDL:omg.org/PortableInterceptor/AdapterManagerId:1.0", + "AdapterManagerId", + &CORBA::_tc_long); + +namespace PortableInterceptor +{ + ::CORBA::TypeCode_ptr const _tc_AdapterManagerId = + &_tao_tc_PortableInterceptor_AdapterManagerId; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_PortableInterceptor_AdapterState ( + CORBA::tk_alias, + "IDL:omg.org/PortableInterceptor/AdapterState:1.0", + "AdapterState", + &CORBA::_tc_short); + +namespace PortableInterceptor +{ + ::CORBA::TypeCode_ptr const _tc_AdapterState = + &_tao_tc_PortableInterceptor_AdapterState; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_PortableInterceptor_SlotId ( + CORBA::tk_alias, + "IDL:omg.org/PortableInterceptor/SlotId:1.0", + "SlotId", + &CORBA::_tc_ulong); + +namespace PortableInterceptor +{ + ::CORBA::TypeCode_ptr const _tc_SlotId = + &_tao_tc_PortableInterceptor_SlotId; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_PortableInterceptor_ReplyStatus ( + CORBA::tk_alias, + "IDL:omg.org/PortableInterceptor/ReplyStatus:1.0", + "ReplyStatus", + &CORBA::_tc_short); + +namespace PortableInterceptor +{ + ::CORBA::TypeCode_ptr const _tc_ReplyStatus = + &_tao_tc_PortableInterceptor_ReplyStatus; +} + + diff --git a/TAO/tao/AnyTypeCode/PI_ForwardA.h b/TAO/tao/AnyTypeCode/PI_ForwardA.h new file mode 100644 index 00000000000..7d24a7c85b2 --- /dev/null +++ b/TAO/tao/AnyTypeCode/PI_ForwardA.h @@ -0,0 +1,190 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_PI_FORWARDA_H_ +#define _TAO_IDL_ORIG_PI_FORWARDA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/ORB.h" +#include "tao/Environment.h" + +#include "tao/OctetSeqC.h" +#include "tao/StringSeqC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace PortableInterceptor +{ + + // TAO_IDL - Generated from + // be\be_visitor_typedef/typedef_ch.cpp:413 + + typedef char * ServerId; + typedef CORBA::String_var ServerId_var; + typedef CORBA::String_out ServerId_out; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ServerId; + + // TAO_IDL - Generated from + // be\be_visitor_typedef/typedef_ch.cpp:413 + + typedef char * ORBId; + typedef CORBA::String_var ORBId_var; + typedef CORBA::String_out ORBId_out; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ORBId; + + // TAO_IDL - Generated from + // be\be_visitor_typedef/typedef_ch.cpp:472 + + typedef CORBA::StringSeq AdapterName; + typedef CORBA::StringSeq_var AdapterName_var; + typedef CORBA::StringSeq_out AdapterName_out; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_AdapterName; + + // TAO_IDL - Generated from + // be\be_visitor_typedef/typedef_ch.cpp:472 + + typedef CORBA::OctetSeq ObjectId; + typedef CORBA::OctetSeq_var ObjectId_var; + typedef CORBA::OctetSeq_out ObjectId_out; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ObjectId; + + // TAO_IDL - Generated from + // be\be_visitor_typedef/typedef_ch.cpp:379 + + typedef CORBA::Long AdapterManagerId; + typedef CORBA::Long_out AdapterManagerId_out; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_AdapterManagerId; + + // TAO_IDL - Generated from + // be\be_visitor_typedef/typedef_ch.cpp:379 + + typedef CORBA::Short AdapterState; + typedef CORBA::Short_out AdapterState_out; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_AdapterState; + + // TAO_IDL - Generated from + // be\be_visitor_typedef/typedef_ch.cpp:379 + + typedef CORBA::ULong SlotId; + typedef CORBA::ULong_out SlotId_out; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_SlotId; + + // TAO_IDL - Generated from + // be\be_visitor_typedef/typedef_ch.cpp:379 + + typedef CORBA::Short ReplyStatus; + typedef CORBA::Short_out ReplyStatus_out; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ReplyStatus; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module PortableInterceptor + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/ParameterModeA.cpp b/TAO/tao/AnyTypeCode/ParameterModeA.cpp new file mode 100644 index 00000000000..7eeaa86618c --- /dev/null +++ b/TAO/tao/AnyTypeCode/ParameterModeA.cpp @@ -0,0 +1,91 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "ParameterModeA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Enum_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Basic_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/enum_typecode.cpp:34 + +static char const * const _tao_enumerators_CORBA_ParameterMode[] = + { + "PARAM_IN", + "PARAM_OUT", + "PARAM_INOUT" + + }; + +static TAO::TypeCode::Enum + _tao_tc_CORBA_ParameterMode ( + "IDL:omg.org/CORBA/ParameterMode:1.0", + "ParameterMode", + _tao_enumerators_CORBA_ParameterMode, + 3); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ParameterMode = + &_tao_tc_CORBA_ParameterMode; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_enum/any_op_cs.cpp:52 + +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::ParameterMode _tao_elem + ) +{ + TAO::Any_Basic_Impl_T::insert ( + _tao_any, + CORBA::_tc_ParameterMode, + _tao_elem + ); +} + +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::ParameterMode &_tao_elem + ) +{ + return + TAO::Any_Basic_Impl_T::extract ( + _tao_any, + CORBA::_tc_ParameterMode, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/ParameterModeA.h b/TAO/tao/AnyTypeCode/ParameterModeA.h new file mode 100644 index 00000000000..e4743d93fe9 --- /dev/null +++ b/TAO/tao/AnyTypeCode/ParameterModeA.h @@ -0,0 +1,104 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_PARAMETERMODEA_H_ +#define _TAO_IDL_ORIG_PARAMETERMODEA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/ParameterModeC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ParameterMode; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_enum/any_op_ch.cpp:51 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::ParameterMode); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::ParameterMode &); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/PolicyA.cpp b/TAO/tao/AnyTypeCode/PolicyA.cpp new file mode 100644 index 00000000000..0594672bf8f --- /dev/null +++ b/TAO/tao/AnyTypeCode/PolicyA.cpp @@ -0,0 +1,557 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "PolicyA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Objref_TypeCode_Static.h" +#include "tao/AnyTypeCode/Struct_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Impl_T.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +#include "tao/AnyTypeCode/UShortSeqA.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_CORBA_PolicyErrorCode ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/PolicyErrorCode:1.0", + "PolicyErrorCode", + &CORBA::_tc_short); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_PolicyErrorCode = + &_tao_tc_CORBA_PolicyErrorCode; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + +static TAO::TypeCode::Struct_Field const _tao_fields_CORBA_PolicyError[] = + { + { "reason", &CORBA::_tc_PolicyErrorCode } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_CORBA_PolicyError ( + CORBA::tk_except, + "IDL:omg.org/CORBA/PolicyError:1.0", + "PolicyError", + _tao_fields_CORBA_PolicyError, + 1); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_PolicyError = + &_tao_tc_CORBA_PolicyError; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + +static TAO::TypeCode::Struct_Field const _tao_fields_CORBA_InvalidPolicies[] = + { + { "indices", &CORBA::_tc_UShortSeq } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_CORBA_InvalidPolicies ( + CORBA::tk_except, + "IDL:omg.org/CORBA/InvalidPolicies:1.0", + "InvalidPolicies", + _tao_fields_CORBA_InvalidPolicies, + 1); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_InvalidPolicies = + &_tao_tc_CORBA_InvalidPolicies; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/objref_typecode.cpp:76 + +static TAO::TypeCode::Objref + _tao_tc_CORBA_Policy ( + CORBA::tk_objref, + "IDL:omg.org/CORBA/Policy:1.0", + "Policy"); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_Policy = + &_tao_tc_CORBA_Policy; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/objref_typecode.cpp:76 + +static TAO::TypeCode::Objref + _tao_tc_CORBA_PolicyManager ( + CORBA::tk_local_interface, + "IDL:omg.org/CORBA/PolicyManager:1.0", + "PolicyManager"); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_PolicyManager = + &_tao_tc_CORBA_PolicyManager; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/objref_typecode.cpp:76 + +static TAO::TypeCode::Objref + _tao_tc_CORBA_PolicyCurrent ( + CORBA::tk_local_interface, + "IDL:omg.org/CORBA/PolicyCurrent:1.0", + "PolicyCurrent"); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_PolicyCurrent = + &_tao_tc_CORBA_PolicyCurrent; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_exception/any_op_cs.cpp:50 + +namespace TAO +{ + template<> + CORBA::Boolean + Any_Dual_Impl_T::demarshal_value ( + TAO_InputCDR & cdr + ) + { + CORBA::String_var id; + + if (!(cdr >> id.out ())) + { + return false; + } + + ACE_TRY_NEW_ENV + { + this->value_->_tao_decode (cdr ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + return false; + } + ACE_ENDTRY; + + return true; + } +} + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::PolicyError &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::PolicyError::_tao_any_destructor, + CORBA::_tc_PolicyError, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::PolicyError *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::PolicyError::_tao_any_destructor, + CORBA::_tc_PolicyError, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::PolicyError *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::PolicyError *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::PolicyError *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::PolicyError::_tao_any_destructor, + CORBA::_tc_PolicyError, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_exception/any_op_cs.cpp:50 + +namespace TAO +{ + template<> + CORBA::Boolean + Any_Dual_Impl_T::demarshal_value ( + TAO_InputCDR & cdr + ) + { + CORBA::String_var id; + + if (!(cdr >> id.out ())) + { + return false; + } + + ACE_TRY_NEW_ENV + { + this->value_->_tao_decode (cdr ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + return false; + } + ACE_ENDTRY; + + return true; + } +} + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::InvalidPolicies &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::InvalidPolicies::_tao_any_destructor, + CORBA::_tc_InvalidPolicies, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::InvalidPolicies *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::InvalidPolicies::_tao_any_destructor, + CORBA::_tc_InvalidPolicies, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::InvalidPolicies *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::InvalidPolicies *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::InvalidPolicies *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::InvalidPolicies::_tao_any_destructor, + CORBA::_tc_InvalidPolicies, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_interface/any_op_cs.cpp:50 + +namespace TAO +{ + template<> + CORBA::Boolean + Any_Impl_T::to_object ( + CORBA::Object_ptr &_tao_elem + ) const + { + _tao_elem = CORBA::Object::_duplicate (this->value_); + return true; + } +} + +// Copying insertion. +void +operator<<= ( + CORBA::Any &_tao_any, + CORBA::Policy_ptr _tao_elem + ) +{ + CORBA::Policy_ptr _tao_objptr = + CORBA::Policy::_duplicate (_tao_elem); + _tao_any <<= &_tao_objptr; +} + +// Non-copying insertion. +void +operator<<= ( + CORBA::Any &_tao_any, + CORBA::Policy_ptr *_tao_elem + ) +{ + TAO::Any_Impl_T::insert ( + _tao_any, + CORBA::Policy::_tao_any_destructor, + CORBA::_tc_Policy, + *_tao_elem + ); +} + +CORBA::Boolean +operator>>= ( + const CORBA::Any &_tao_any, + CORBA::Policy_ptr &_tao_elem + ) +{ + return + TAO::Any_Impl_T::extract ( + _tao_any, + CORBA::Policy::_tao_any_destructor, + CORBA::_tc_Policy, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_interface/any_op_cs.cpp:50 + +namespace TAO +{ + template<> + CORBA::Boolean + Any_Impl_T::to_object ( + CORBA::Object_ptr &_tao_elem + ) const + { + _tao_elem = CORBA::Object::_duplicate (this->value_); + return true; + } +} + +namespace TAO +{ + template<> + CORBA::Boolean + Any_Impl_T::marshal_value (TAO_OutputCDR &) + { + return false; + } + + template<> + CORBA::Boolean + Any_Impl_T::demarshal_value (TAO_InputCDR &) + { + return false; + } +} + +// Copying insertion. +void +operator<<= ( + CORBA::Any &_tao_any, + CORBA::PolicyManager_ptr _tao_elem + ) +{ + CORBA::PolicyManager_ptr _tao_objptr = + CORBA::PolicyManager::_duplicate (_tao_elem); + _tao_any <<= &_tao_objptr; +} + +// Non-copying insertion. +void +operator<<= ( + CORBA::Any &_tao_any, + CORBA::PolicyManager_ptr *_tao_elem + ) +{ + TAO::Any_Impl_T::insert ( + _tao_any, + CORBA::PolicyManager::_tao_any_destructor, + CORBA::_tc_PolicyManager, + *_tao_elem + ); +} + +CORBA::Boolean +operator>>= ( + const CORBA::Any &_tao_any, + CORBA::PolicyManager_ptr &_tao_elem + ) +{ + return + TAO::Any_Impl_T::extract ( + _tao_any, + CORBA::PolicyManager::_tao_any_destructor, + CORBA::_tc_PolicyManager, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_interface/any_op_cs.cpp:50 + +namespace TAO +{ + template<> + CORBA::Boolean + Any_Impl_T::to_object ( + CORBA::Object_ptr &_tao_elem + ) const + { + _tao_elem = CORBA::Object::_duplicate (this->value_); + return true; + } +} + +namespace TAO +{ + template<> + CORBA::Boolean + Any_Impl_T::marshal_value (TAO_OutputCDR &) + { + return false; + } + + template<> + CORBA::Boolean + Any_Impl_T::demarshal_value (TAO_InputCDR &) + { + return false; + } +} + +// Copying insertion. +void +operator<<= ( + CORBA::Any &_tao_any, + CORBA::PolicyCurrent_ptr _tao_elem + ) +{ + CORBA::PolicyCurrent_ptr _tao_objptr = + CORBA::PolicyCurrent::_duplicate (_tao_elem); + _tao_any <<= &_tao_objptr; +} + +// Non-copying insertion. +void +operator<<= ( + CORBA::Any &_tao_any, + CORBA::PolicyCurrent_ptr *_tao_elem + ) +{ + TAO::Any_Impl_T::insert ( + _tao_any, + CORBA::PolicyCurrent::_tao_any_destructor, + CORBA::_tc_PolicyCurrent, + *_tao_elem + ); +} + +CORBA::Boolean +operator>>= ( + const CORBA::Any &_tao_any, + CORBA::PolicyCurrent_ptr &_tao_elem + ) +{ + return + TAO::Any_Impl_T::extract ( + _tao_any, + CORBA::PolicyCurrent::_tao_any_destructor, + CORBA::_tc_PolicyCurrent, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/PolicyA.h b/TAO/tao/AnyTypeCode/PolicyA.h new file mode 100644 index 00000000000..7ea67324c1d --- /dev/null +++ b/TAO/tao/AnyTypeCode/PolicyA.h @@ -0,0 +1,158 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_POLICYA_H_ +#define _TAO_IDL_ORIG_POLICYA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/PolicyC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_PolicyErrorCode; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_PolicyError; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_InvalidPolicies; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_Policy; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_PolicyManager; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_PolicyCurrent; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + + +// TAO_IDL - Generated from +// be\be_visitor_exception/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::PolicyError &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::PolicyError*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::PolicyError *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::PolicyError *&); + +// TAO_IDL - Generated from +// be\be_visitor_exception/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::InvalidPolicies &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::InvalidPolicies*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::InvalidPolicies *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::InvalidPolicies *&); + +// TAO_IDL - Generated from +// be\be_visitor_interface/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::Policy_ptr); // copying +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::Policy_ptr *); // non-copying +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::Policy_ptr &); + +// TAO_IDL - Generated from +// be\be_visitor_interface/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::PolicyManager_ptr); // copying +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::PolicyManager_ptr *); // non-copying +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::PolicyManager_ptr &); + +// TAO_IDL - Generated from +// be\be_visitor_interface/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::PolicyCurrent_ptr); // copying +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::PolicyCurrent_ptr *); // non-copying +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::PolicyCurrent_ptr &); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined (__ACE_INLINE__) +#include "PolicyC.inl" +#endif /* defined INLINE */ + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/Policy_ForwardA.cpp b/TAO/tao/AnyTypeCode/Policy_ForwardA.cpp new file mode 100644 index 00000000000..aae38186b03 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Policy_ForwardA.cpp @@ -0,0 +1,331 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "Policy_ForwardA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Enum_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" +#include "tao/AnyTypeCode/Any_Basic_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_CORBA_PolicyType ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/PolicyType:1.0", + "PolicyType", + &CORBA::_tc_ulong); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_PolicyType = + &_tao_tc_CORBA_PolicyType; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + +namespace CORBA +{ + extern ::CORBA::TypeCode_ptr const _tc_Policy; +} + + +#ifndef _TAO_TYPECODE_CORBA_PolicyList_GUARD +#define _TAO_TYPECODE_CORBA_PolicyList_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_PolicyList_0 ( + CORBA::tk_sequence, + &CORBA::_tc_Policy, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_PolicyList_0 = + &CORBA_PolicyList_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_PolicyList_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_PolicyList ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/PolicyList:1.0", + "PolicyList", + &TAO::TypeCode::tc_CORBA_PolicyList_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_PolicyList = + &_tao_tc_CORBA_PolicyList; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_PolicyTypeSeq_GUARD +#define _TAO_TYPECODE_CORBA_PolicyTypeSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_PolicyTypeSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_PolicyType, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_PolicyTypeSeq_0 = + &CORBA_PolicyTypeSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_PolicyTypeSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_PolicyTypeSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/PolicyTypeSeq:1.0", + "PolicyTypeSeq", + &TAO::TypeCode::tc_CORBA_PolicyTypeSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_PolicyTypeSeq = + &_tao_tc_CORBA_PolicyTypeSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/enum_typecode.cpp:34 + +static char const * const _tao_enumerators_CORBA_SetOverrideType[] = + { + "SET_OVERRIDE", + "ADD_OVERRIDE" + + }; + +static TAO::TypeCode::Enum + _tao_tc_CORBA_SetOverrideType ( + "IDL:omg.org/CORBA/SetOverrideType:1.0", + "SetOverrideType", + _tao_enumerators_CORBA_SetOverrideType, + 2); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_SetOverrideType = + &_tao_tc_CORBA_SetOverrideType; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::PolicyList &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::PolicyList::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_PolicyList_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::PolicyList *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::PolicyList::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_PolicyList_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::PolicyList *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::PolicyList *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::PolicyList *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::PolicyList::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_PolicyList_0, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::PolicyTypeSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::PolicyTypeSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_PolicyTypeSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::PolicyTypeSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::PolicyTypeSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_PolicyTypeSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::PolicyTypeSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::PolicyTypeSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::PolicyTypeSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::PolicyTypeSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_PolicyTypeSeq_0, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_enum/any_op_cs.cpp:52 + +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::SetOverrideType _tao_elem + ) +{ + TAO::Any_Basic_Impl_T::insert ( + _tao_any, + CORBA::_tc_SetOverrideType, + _tao_elem + ); +} + +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::SetOverrideType &_tao_elem + ) +{ + return + TAO::Any_Basic_Impl_T::extract ( + _tao_any, + CORBA::_tc_SetOverrideType, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/Policy_ForwardA.h b/TAO/tao/AnyTypeCode/Policy_ForwardA.h new file mode 100644 index 00000000000..4aa867f9662 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Policy_ForwardA.h @@ -0,0 +1,102 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:754 + +#ifndef _TAO_IDL_ANYTYPECODE_POLICY_FORWARDA_H_ +#define _TAO_IDL_ANYTYPECODE_POLICY_FORWARDA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/Policy_ForwardC.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_PolicyType; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_PolicyList; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_PolicyTypeSeq; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_SetOverrideType; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_interface_fwd/any_op_ch.cpp:64 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::Policy_ptr); // copying +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::Policy_ptr *); // non-copying +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::Policy *&); + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::PolicyList &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::PolicyList*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::PolicyList *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::PolicyList *&); + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::PolicyTypeSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::PolicyTypeSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::PolicyTypeSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::PolicyTypeSeq *&); + +// TAO_IDL - Generated from +// be\be_visitor_enum/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::SetOverrideType); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::SetOverrideType &); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/PortableInterceptorA.cpp b/TAO/tao/AnyTypeCode/PortableInterceptorA.cpp new file mode 100644 index 00000000000..0ffe043ddbe --- /dev/null +++ b/TAO/tao/AnyTypeCode/PortableInterceptorA.cpp @@ -0,0 +1,34 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "PortableInterceptorA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/String_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" diff --git a/TAO/tao/AnyTypeCode/PortableInterceptorA.h b/TAO/tao/AnyTypeCode/PortableInterceptorA.h new file mode 100644 index 00000000000..b342d9102e2 --- /dev/null +++ b/TAO/tao/AnyTypeCode/PortableInterceptorA.h @@ -0,0 +1,55 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:754 + +#ifndef _TAO_IDL_ANYTYPECODE_PORTABLEINTERCEPTORA_H_ +#define _TAO_IDL_ANYTYPECODE_PORTABLEINTERCEPTORA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/PortableInterceptorC.h" +#include "tao/AnyTypeCode/PI_ForwardA.h" +#include "tao/AnyTypeCode/Messaging_SyncScopeA.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace PortableInterceptor +{ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module PortableInterceptor + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/Recursive_Type_TypeCode.cpp b/TAO/tao/AnyTypeCode/Recursive_Type_TypeCode.cpp new file mode 100644 index 00000000000..a96abe13a0b --- /dev/null +++ b/TAO/tao/AnyTypeCode/Recursive_Type_TypeCode.cpp @@ -0,0 +1,138 @@ +// $Id$ + + +#include "tao/CDR.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/Recursive_Type_TypeCode.inl" +#endif /* __ACE_INLINE__ */ + +template +bool +TAO::TypeCode::Recursive_Type::tao_marshal ( + TAO_OutputCDR & cdr, + CORBA::ULong offset) const +{ + ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX, + guard, + this->lock_, + false); + + // Top-level TypeCode case. + if (!(this->in_recursion_)) + { + this->in_recursion_ = true; + + // Starting offset should point to the CORBA::TCKind value. + + // Note that this doesn't need to take into account alignment + // padding since CORBA::TCKind (encoded as a CORBA::ULong) is + // already aligned on the appropriate boundary, and since the + // CORBA::TCKind was the last thing marshaled into the CDR + // stream before getting here. + offset = sizeof (CORBA::ULong); + + // Reset recursion flag to false in an exception-safe manner once + // marshaling is done. + // + // Only reset the recursion flag at the top-level. + Reset flag (this->in_recursion_); + + return this->TypeCodeBase::tao_marshal (cdr, offset); + } + + // Recursive/indirected TypeCode case. + +// ACE_ASSERT (offset > 4 +// && offset < static_cast (ACE_INT32_MAX)); + + return (cdr << -static_cast (offset)); +} + +template +CORBA::Boolean +TAO::TypeCode::Recursive_Type::equal_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX, + guard, + this->lock_, + false); + + // Top-level TypeCode case. + if (!(this->in_recursion_)) + { + this->in_recursion_ = true; + + // Reset recursion flag to false in an exception-safe manner once + // equality determination is done. + // + // Only reset the recursion flag at the top-level. + Reset flag (this->in_recursion_); + + return this->TypeCodeBase::equal_i (tc + ACE_ENV_ARG_PARAMETER); + } + + // Nothing else to do. + return true; +} + +template +CORBA::Boolean +TAO::TypeCode::Recursive_Type::equivalent_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX, + guard, + this->lock_, + false); + + // Top-level TypeCode case. + if (!(this->in_recursion_)) + { + this->in_recursion_ = true; + + // Reset recursion flag to false in an exception-safe manner once + // equivalence determination is done. + // + // Only reset the recursion flag at the top-level. + Reset flag (this->in_recursion_); + + return this->TypeCodeBase::equivalent_i (tc + ACE_ENV_ARG_PARAMETER); + } + + // Nothing else to do. + return true; +} + +template +bool +TAO::TypeCode::Recursive_Type::tao_marshal_kind ( + TAO_OutputCDR & cdr) const +{ + ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX, + guard, + this->lock_, + false); + + // Top-level TypeCode case. + if (!(this->in_recursion_)) + return this->ACE_NESTED_CLASS (CORBA, TypeCode)::tao_marshal_kind (cdr); + + // Recursive/indirected TypeCode case. + CORBA::ULong const indirection_kind = 0xffffffff; + + return (cdr << indirection_kind); +} diff --git a/TAO/tao/AnyTypeCode/Recursive_Type_TypeCode.h b/TAO/tao/AnyTypeCode/Recursive_Type_TypeCode.h new file mode 100644 index 00000000000..08b0025560c --- /dev/null +++ b/TAO/tao/AnyTypeCode/Recursive_Type_TypeCode.h @@ -0,0 +1,216 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Recursive_Type_TypeCode.h + * + * $Id$ + * + * Header file for a recursive type (@c struct, @c union or + * @c valuetype) CORBA::TypeCode. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_RECURSIVE_TYPE_TYPECODE_H +#define TAO_RECURSIVE_TYPE_TYPECODE_H + +#include /**/ "ace/pre.h" + +#include "ace/Recursive_Thread_Mutex.h" +#include "tao/Basic_Types.h" +#include "tao/Typecode_typesC.h" + +namespace TAO +{ + namespace TypeCode + { + + /** + * @class Recursive_Type + * + * @brief Recursive type @c TypeCode decorator template. + * + * This class template decorates the underlying @c TypeCode + * implementation @a TypeCodeBase to provide support for IDL + * defined recursive types. Only IDL an @c struct, @c union or + * @c valuetype may be recursive, which is why this decorator only + * supports constructors for the corresponding @c TypeCode + * implementations. + */ + template + class Recursive_Type + : public TypeCodeBase + { + public: + + /// Recursive @c struct constructor. + Recursive_Type (CORBA::TCKind kind, + char const * id, + char const * name, + MemberArrayType const & fields, + CORBA::ULong nfields); + + /// Recursive @c union constructor. + Recursive_Type (char const * id, + char const * name, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + // Borland C++ currently can't handle a + // reference to const pointer to const + // CORBA::TypeCode_ptr. + TypeCodeType discriminant_type, +#else + TypeCodeType const & discriminant_type, +#endif + MemberArrayType const & cases, + CORBA::ULong ncases, + CORBA::Long default_index); + + /// Recursive @c valuetype constructor. + Recursive_Type (CORBA::TCKind kind, + char const * id, + char const * name, + CORBA::ValueModifier modifier, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + // Borland C++ currently can't handle a + // reference to const pointer to const + // CORBA::TypeCode_ptr. + TypeCodeType concrete_base, +#else + TypeCodeType const & concrete_base, +#endif + MemberArrayType const & fields, + CORBA::ULong nfields); + + /// Dynamic @c Recursive_Type TypeCode constructor. + Recursive_Type (CORBA::TCKind kind, + char const * id); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @par + * + * These are recursive type @c TypeCode marshaling operation + * overrides. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal_kind (TAO_OutputCDR & cdr) const; + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + //@} + + protected: + + /** + * @name TAO @c CORBA::TypeCode Template Methods + * + * Recursive type @c CORBA::TypeCode -specific + * template methods. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + //@} + + + public: + + /// Set @c struct @c TypeCode parameters. + void struct_parameters (char const * name, + MemberArrayType const & fields, + CORBA::ULong nfields); + + /// Set @c union @c TypeCode parameters. + void union_parameters ( + char const * name, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + // Borland C++ currently can't handle a + // reference to const pointer to const + // CORBA::TypeCode_ptr. + TypeCodeType discriminant_type, +#else + TypeCodeType const & discriminant_type, +#endif + MemberArrayType const & cases, + CORBA::ULong ncases, + CORBA::Long default_index); + + /// Set @c valuetype or @c eventtype @c TypeCode parameters. + void valuetype_parameters (char const * name, + CORBA::ValueModifier modifier, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + // Borland C++ currently can't handle a + // reference to const pointer to const + // CORBA::TypeCode_ptr. + TypeCodeType concrete_base, +#else + TypeCodeType const & concrete_base, +#endif + MemberArrayType const & fields, + CORBA::ULong nfields); + + private: + + /** + * @class Reset + * + * @brief Reset flag to false in an exception-safe manner. + * + * Reset flag to false in an exception-safe manner. + */ + class Reset + { + public: + Reset (bool & flag) : flag_ (flag) { } + ~Reset (void) { this->flag_ = false; } + private: + bool & flag_; + }; + + private: + + /// Internal state thread synchronization mutex. + mutable TAO_SYNCH_RECURSIVE_MUTEX lock_; + + /// @c true if equality or equivalence is being determined + /// recursively. + /** + * This flag is used to prevent @c TypeCode equality and + * equivalence operations from recursing indefinitely. + */ + mutable bool in_recursion_; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/Recursive_Type_TypeCode.inl" +#endif /* __ACE_INLINE__ */ + +#ifdef ACE_TEMPLATES_REQUIRE_SOURCE +# include "tao/AnyTypeCode/Recursive_Type_TypeCode.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA +# pragma implementation ("Recursive_Type_TypeCode.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* TAO_RECURSIVE_TYPE_TYPECODE_H */ diff --git a/TAO/tao/AnyTypeCode/Recursive_Type_TypeCode.inl b/TAO/tao/AnyTypeCode/Recursive_Type_TypeCode.inl new file mode 100644 index 00000000000..7f7a5ea6fe8 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Recursive_Type_TypeCode.inl @@ -0,0 +1,149 @@ +// -*- C++ -*- +// +// $Id$ + +template +ACE_INLINE +TAO::TypeCode::Recursive_Type::Recursive_Type ( + CORBA::TCKind kind, + char const * id, + char const * name, + MemberArrayType const & fields, + CORBA::ULong nfields) + : TypeCodeBase (kind, id, name, fields, nfields) + , lock_ () + , in_recursion_ (false) +{ + // ACE_ASSERT (kind != CORBA::tk_except); +} + +template +ACE_INLINE +TAO::TypeCode::Recursive_Type::Recursive_Type ( + char const * id, + char const * name, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + TypeCodeType discriminant_type, +#else + TypeCodeType const & discriminant_type, +#endif + MemberArrayType const & cases, + CORBA::ULong ncases, + CORBA::Long default_index) + : TypeCodeBase (id, + name, + discriminant_type, + cases, + ncases, + default_index) + , lock_ () + , in_recursion_ (false) +{ +} + +template +ACE_INLINE +TAO::TypeCode::Recursive_Type::Recursive_Type ( + CORBA::TCKind kind, + char const * id, + char const * name, + CORBA::ValueModifier modifier, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + TypeCodeType concrete_base, +#else + TypeCodeType const & concrete_base, +#endif + MemberArrayType const & fields, + CORBA::ULong nfields) + : TypeCodeBase (kind, + id, + name, + modifier, + concrete_base, + fields, + nfields) + , lock_ () + , in_recursion_ (false) +{ +} + +template +ACE_INLINE +TAO::TypeCode::Recursive_Type::Recursive_Type ( + CORBA::TCKind kind, + char const * id) + : TypeCodeBase (kind, id) + , lock_ () + , in_recursion_ (false) +{ +// ACE_ASSERT (kind == CORBA::tk_struct +// || kind == CORBA::tk_union +// || kind == CORBA::tk_value +// || kind == CORBA::tk_event); +} + +template +ACE_INLINE void +TAO::TypeCode::Recursive_Type::struct_parameters ( + char const * name, + MemberArrayType const & fields, + CORBA::ULong nfields) +{ + this->base_attributes_.name (name); + this->fields_ = fields; + this->nfields_ = nfields; +} + +template +ACE_INLINE void +TAO::TypeCode::Recursive_Type::union_parameters ( + char const * name, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + TypeCodeType discriminant_type, +#else + TypeCodeType const & discriminant_type, +#endif + MemberArrayType const & cases, + CORBA::ULong ncases, + CORBA::Long default_index) +{ + this->base_attributes_.name (name); + this->discriminant_type_ = discriminant_type; + this->cases_ = cases; + this->ncases_ = ncases; + this->default_index_ = default_index; +} + +template +ACE_INLINE void +TAO::TypeCode::Recursive_Type::valuetype_parameters ( + char const * name, + CORBA::ValueModifier modifier, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + TypeCodeType concrete_base, +#else + TypeCodeType const & concrete_base, +#endif + MemberArrayType const & fields, + CORBA::ULong nfields) +{ + this->base_attributes_.name (name); + this->type_modifier_ = modifier; + this->concrete_base_ = concrete_base; + this->fields_ = fields; + this->nfields_ = nfields; +} diff --git a/TAO/tao/AnyTypeCode/RefCount_Policy_Traits.h b/TAO/tao/AnyTypeCode/RefCount_Policy_Traits.h new file mode 100644 index 00000000000..6f4ea6a2e00 --- /dev/null +++ b/TAO/tao/AnyTypeCode/RefCount_Policy_Traits.h @@ -0,0 +1,107 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file RefCount_Policy_Traits.h + * + * $Id$ + * + * Header file for TAO's reference count policy (unrelated to CORBA + * policies) traits. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_REFCOUNT_POLICY_TRAITS_H +#define TAO_REFCOUNT_POLICY_TRAITS_H + +#include /**/ "ace/pre.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/CORBA_methods.h" + + +namespace TAO +{ + class Null_RefCount_Policy; + class True_RefCount_Policy; + +#if !defined (_MSC_VER) || (_MSC_VER >= 1310) + /** + * @struct RefCount_Policy_Traits + * + * @brief Compile-time selection of RefCount_Policy operations, + * etc. + * + * This primary template is used to select RefCount_Policy + * operations, etc at compile-time based on the reference counting + * policy and type being operated on. + * + * @note This merely a forward declaration since we really only care + * about the partial specializations below. + */ + template + struct RefCount_Policy_Traits; + + /** + * @struct RefCount_Policy_Traits + * + * @brief No-op reference count policy traits. + * + * This partial specialization performs no-op reference counting + * operations on values of type @a TypePtr if the @a RefCountPolicy + * first argument is @c Null_RefCount_Policy. + */ + template + struct RefCount_Policy_Traits + { + /// No-op "release" operation. + static void release (TypePtr) { } + }; + + template + struct RefCount_Policy_Traits + { + /// Call actual "release" operation on @a ptr value. + static void release (TypePtr ptr) + { + CORBA::release (ptr); + } + }; + +#else + + // MSVC++ 6 can't handle partial template specializations so fall + // back on an alternate implementation. + + template struct RefCount_Policy_Traits; + + template<> + struct RefCount_Policy_Traits + { + static bool is_refcounted (void) + { + return false; + } + }; + + template<> + struct RefCount_Policy_Traits + { + static bool is_refcounted (void) + { + return true; + } + }; + +#endif /* !_MSC_VER || _MSC_VER >= 1310 */ + +} // End namespace TAO + +#include /**/ "ace/post.h" + +#endif /* TAO_REFCOUNT_POLICY_TRAITS_H */ diff --git a/TAO/tao/AnyTypeCode/Sequence_TypeCode.cpp b/TAO/tao/AnyTypeCode/Sequence_TypeCode.cpp new file mode 100644 index 00000000000..a3b7c2e458c --- /dev/null +++ b/TAO/tao/AnyTypeCode/Sequence_TypeCode.cpp @@ -0,0 +1,148 @@ +// $Id$ + +#ifndef TAO_SEQUENCE_TYPECODE_CPP +#define TAO_SEQUENCE_TYPECODE_CPP + +#include "tao/AnyTypeCode/Sequence_TypeCode.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/TypeCode_Traits.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/Sequence_TypeCode.inl" +#endif /* !__ACE_INLINE__ */ + + +template +bool +TAO::TypeCode::Sequence::tao_marshal ( + TAO_OutputCDR & cdr, + CORBA::ULong offset) const +{ + // A tk_array or tk_sequence TypeCode has a "complex" parameter list + // type (see Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR + // section of the CORBA specification), meaning that it must be + // marshaled into a CDR encapsulation. + + // Create a CDR encapsulation. + TAO_OutputCDR enc; + + // Account for the encoded CDR encapsulation length and byte order. + // + // Aligning on an octet since the next value after the CDR + // encapsulation length will always be the byte order octet/boolean + // in this case. + offset = ACE_align_binary (offset + 4, + ACE_CDR::OCTET_ALIGN); + + return + enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER) + && marshal (enc, + Traits::get_typecode (this->content_type_), + offset + enc.total_length ()) + && enc << this->length_ + && cdr << static_cast (enc.total_length ()) + && cdr.write_octet_array_mb (enc.begin ()); +} + +template +void +TAO::TypeCode::Sequence::tao_duplicate (void) +{ + this->RefCountPolicy::add_ref (); +} + +template +void +TAO::TypeCode::Sequence::tao_release (void) +{ + this->RefCountPolicy::remove_ref (); +} + +template +CORBA::Boolean +TAO::TypeCode::Sequence::equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // The following calls won't throw since CORBA::TypeCode::equal() + // has already established the kind of tc is the same as our kind. + CORBA::ULong const tc_length = tc->length (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (this->length_ != tc_length) + return 0; + + CORBA::TypeCode_var rhs_content_type = + tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return + Traits::get_typecode (this->content_type_)->equal ( + rhs_content_type.in () + ACE_ENV_ARG_PARAMETER); +} + +template +CORBA::Boolean +TAO::TypeCode::Sequence::equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // The following calls won't throw since CORBA::TypeCode::equal() + // has already established the kind of tc is the same as our kind. + CORBA::ULong const tc_length = tc->length (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (this->length_ != tc_length) + return 0; + + CORBA::TypeCode_var rhs_content_type = + tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return + Traits::get_typecode (this->content_type_)->equivalent ( + rhs_content_type.in () + ACE_ENV_ARG_PARAMETER); +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::Sequence::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Already compact since tk_sequence and tk_array TypeCodes have no + // name or member names, meaning that we can simply call + // _duplicate() on this TypeCode. + + // @@ There is a potential problem here if this TypeCode is a static + // and const since it may have been placed in read-only memory by + // the compiler. A const_cast<> can return undefined results in + // that case. + + CORBA::TypeCode_ptr mutable_tc = + const_cast *> (this); + + return CORBA::TypeCode::_duplicate (mutable_tc); +} + +template +CORBA::ULong +TAO::TypeCode::Sequence::length_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->length_; +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::Sequence::content_type_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return + CORBA::TypeCode::_duplicate ( + Traits::get_typecode (this->content_type_)); +} + + +#endif /* TAO_SEQUENCE_TYPECODE_CPP */ diff --git a/TAO/tao/AnyTypeCode/Sequence_TypeCode.h b/TAO/tao/AnyTypeCode/Sequence_TypeCode.h new file mode 100644 index 00000000000..555511402c0 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Sequence_TypeCode.h @@ -0,0 +1,134 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Sequence_TypeCode.h + * + * $Id$ + * + * Header file for @c tk_sequence and @c tk_array @c CORBA::TypeCodes. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_SEQUENCE_TYPECODE_H +#define TAO_SEQUENCE_TYPECODE_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace TAO +{ + namespace TypeCode + { + + /** + * @class Sequence + * + * @brief @c CORBA::TypeCode implementation for OMG IDL + * @c sequence and @c array types. + * + * This class implements a @c CORBA::TypeCode for OMG IDL + * @c sequence and array types. + */ + template + class Sequence + : public CORBA::TypeCode + , private RefCountPolicy + { + public: + + /// Constructor. + Sequence (CORBA::TCKind kind, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + // Borland C++ currently can't handle a reference to + // const pointer to const CORBA::TypeCode_ptr + TypeCodeType content_type, +#else + TypeCodeType const & content_type, +#endif + CORBA::ULong length); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c CORBA::TypeCode template methods specific to @c tk_sequence + * @c TypeCodes. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::ULong length_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::TypeCode_ptr content_type_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + + private: + + /// Element type of the sequence. + /** + * A pointer to the @c CORBA::TypeCode_ptr rather than the + * @c CORBA::TypeCode_ptr itself is stored since that address is + * well-defined. We may not know the value of the @c + * CORBA::TypeCode_ptr when creating this @c Field statically at + * compile-time, hence the indirection. + * + * @note This @c TypeCode is released upon destruction of this + * @c TypeCode::Sequence. + */ + TypeCodeType const content_type_; + + /// Length of the @c sequence or array. A length of zero + /// indicates an unbounded @c sequence. + CORBA::ULong const length_; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/Sequence_TypeCode.inl" +#endif /* __ACE_INLINE__ */ + +#ifdef ACE_TEMPLATES_REQUIRE_SOURCE +# include "tao/AnyTypeCode/Sequence_TypeCode.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA +# pragma implementation ("Sequence_TypeCode.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + + +#include /**/ "ace/post.h" + +#endif /* TAO_SEQUENCE_TYPECODE_H */ diff --git a/TAO/tao/AnyTypeCode/Sequence_TypeCode.inl b/TAO/tao/AnyTypeCode/Sequence_TypeCode.inl new file mode 100644 index 00000000000..81e7add5646 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Sequence_TypeCode.inl @@ -0,0 +1,23 @@ +// -*- C++ -*- +// +// $Id$ + +template +ACE_INLINE +TAO::TypeCode::Sequence::Sequence ( + CORBA::TCKind kind, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + // Borland C++ currently can't handle a reference to + // const pointer to const CORBA::TypeCode_ptr + TypeCodeType content_type, +#else + TypeCodeType const & content_type, +#endif + CORBA::ULong length) + : CORBA::TypeCode (kind) + , RefCountPolicy () + , content_type_ (content_type) + , length_ (length) +{ + // ACE_ASSERT (kind == CORBA::tk_array || kind == CORBA::tk_sequence); +} diff --git a/TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.cpp b/TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.cpp new file mode 100644 index 00000000000..d0ab50e8dde --- /dev/null +++ b/TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.cpp @@ -0,0 +1,147 @@ +// $Id$ + +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/TypeCode_Traits.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/Sequence_TypeCode_Static.inl" +#endif /* !__ACE_INLINE__ */ + + +ACE_RCSID (tao, + Sequence_TypeCode_Static, + "$Id$") + + +bool +TAO::TypeCode::Sequence::tao_marshal ( + TAO_OutputCDR & cdr, + CORBA::ULong offset) const +{ + // A tk_array or tk_sequence TypeCode has a "complex" parameter list + // type (see Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR + // section of the CORBA specification), meaning that it must be + // marshaled into a CDR encapsulation. + + // Create a CDR encapsulation. + TAO_OutputCDR enc; + + // Account for the encoded CDR encapsulation length and byte order. + // + // Aligning on an octet since the next value after the CDR + // encapsulation length will always be the byte order octet/boolean + // in this case. + offset = ACE_align_binary (offset + 4, + ACE_CDR::OCTET_ALIGN); + + return + enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER) + && marshal (enc, + Traits::get_typecode ( + this->content_type_), + offset + enc.total_length ()) + && enc << this->length_ + && cdr << static_cast (enc.total_length ()) + && cdr.write_octet_array_mb (enc.begin ()); +} + +void +TAO::TypeCode::Sequence::tao_duplicate (void) +{ +} + +void +TAO::TypeCode::Sequence::tao_release (void) +{ +} + +CORBA::Boolean +TAO::TypeCode::Sequence::equal_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // The following calls won't throw since CORBA::TypeCode::equal() + // has already established the kind of tc is the same as our kind. + CORBA::ULong const tc_length = tc->length (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (this->length_ != tc_length) + return 0; + + CORBA::TypeCode_var rhs_content_type = + tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return + Traits::get_typecode (this->content_type_)->equal ( + rhs_content_type.in () + ACE_ENV_ARG_PARAMETER); +} + +CORBA::Boolean +TAO::TypeCode::Sequence::equivalent_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // The following calls won't throw since CORBA::TypeCode::equal() + // has already established the kind of tc is the same as our kind. + CORBA::ULong const tc_length = tc->length (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (this->length_ != tc_length) + return 0; + + CORBA::TypeCode_var rhs_content_type = + tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return + Traits::get_typecode (this->content_type_)->equivalent ( + rhs_content_type.in () + ACE_ENV_ARG_PARAMETER); +} + +CORBA::TypeCode_ptr +TAO::TypeCode::Sequence::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Already compact since tk_sequence and tk_array TypeCodes have no + // name or member names, meaning that we can simply call + // _duplicate() on this TypeCode. + + // @@ There is a potential problem here if this TypeCode is a static + // and const since it may have been placed in read-only memory by + // the compiler. A const_cast<> can return undefined results in + // that case. + + CORBA::TypeCode_ptr mutable_tc = + const_cast *> (this); + + return CORBA::TypeCode::_duplicate (mutable_tc); +} + +CORBA::ULong +TAO::TypeCode::Sequence::length_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->length_; +} + +CORBA::TypeCode_ptr +TAO::TypeCode::Sequence::content_type_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return + CORBA::TypeCode::_duplicate ( + Traits::get_typecode (this->content_type_)); +} diff --git a/TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.h b/TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.h new file mode 100644 index 00000000000..7975d403192 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.h @@ -0,0 +1,125 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Sequence_TypeCode_Static.h + * + * $Id$ + * + * Header file for static @c tk_sequence and @c tk_array + * @c CORBA::TypeCodes. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_SEQUENCE_TYPECODE_STATIC_H +#define TAO_SEQUENCE_TYPECODE_STATIC_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" + + +namespace TAO +{ + namespace TypeCode + { + template class Sequence; + + /** + * @class Sequence + * + * @brief @c CORBA::TypeCode implementation for OMG IDL + * @c sequence and @c array types. + * + * This class implements a @c CORBA::TypeCode for OMG IDL + * @c sequence and array types. + */ + template<> + class TAO_AnyTypeCode_Export Sequence + : public CORBA::TypeCode + , private TAO::Null_RefCount_Policy + { + public: + + /// Constructor. + Sequence (CORBA::TCKind kind, + CORBA::TypeCode_ptr const * content_type, + CORBA::ULong length); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c CORBA::TypeCode template methods specific to @c tk_sequence + * @c TypeCodes. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::ULong length_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::TypeCode_ptr content_type_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + + private: + + /// Element type of the sequence. + /** + * A pointer to the @c CORBA::TypeCode_ptr rather than the + * @c CORBA::TypeCode_ptr itself is stored since that address is + * well-defined. We may not know the value of the @c + * CORBA::TypeCode_ptr when creating this @c Field statically at + * compile-time, hence the indirection. + * + * @note This @c TypeCode is released upon destruction of this + * @c TypeCode::Sequence. + */ + CORBA::TypeCode_ptr const * const content_type_; + + /// Length of the @c sequence or array. A length of zero + /// indicates an unbounded @c sequence. + CORBA::ULong const length_; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/Sequence_TypeCode_Static.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* TAO_SEQUENCE_TYPECODE_STATIC_H */ diff --git a/TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.inl b/TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.inl new file mode 100644 index 00000000000..27e98729656 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Sequence_TypeCode_Static.inl @@ -0,0 +1,16 @@ +// -*- C++ -*- +// +// $Id$ + +ACE_INLINE +TAO::TypeCode::Sequence::Sequence ( + CORBA::TCKind kind, + CORBA::TypeCode_ptr const * content_type, + CORBA::ULong length) + : CORBA::TypeCode (kind) + , ACE_NESTED_CLASS (TAO, Null_RefCount_Policy) () + , content_type_ (content_type) + , length_ (length) +{ +} diff --git a/TAO/tao/AnyTypeCode/ServicesA.cpp b/TAO/tao/AnyTypeCode/ServicesA.cpp new file mode 100644 index 00000000000..2fa2316ff53 --- /dev/null +++ b/TAO/tao/AnyTypeCode/ServicesA.cpp @@ -0,0 +1,518 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "ServicesA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/AnyTypeCode/Struct_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_CORBA_ServiceType ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/ServiceType:1.0", + "ServiceType", + &CORBA::_tc_ushort); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ServiceType = + &_tao_tc_CORBA_ServiceType; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_CORBA_ServiceOption ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/ServiceOption:1.0", + "ServiceOption", + &CORBA::_tc_ulong); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ServiceOption = + &_tao_tc_CORBA_ServiceOption; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_CORBA_ServiceDetailType ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/ServiceDetailType:1.0", + "ServiceDetailType", + &CORBA::_tc_ulong); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ServiceDetailType = + &_tao_tc_CORBA_ServiceDetailType; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_CORBA_ServiceDetailData ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/ServiceDetailData:1.0", + "ServiceDetailData", + &CORBA::_tc_OctetSeq); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ServiceDetailData = + &_tao_tc_CORBA_ServiceDetailData; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_ServiceOptionSeq_GUARD +#define _TAO_TYPECODE_CORBA_ServiceOptionSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_ServiceOptionSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_ServiceOption, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_ServiceOptionSeq_0 = + &CORBA_ServiceOptionSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_ServiceOptionSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_ServiceOptionSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/ServiceOptionSeq:1.0", + "ServiceOptionSeq", + &TAO::TypeCode::tc_CORBA_ServiceOptionSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ServiceOptionSeq = + &_tao_tc_CORBA_ServiceOptionSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + +static TAO::TypeCode::Struct_Field const _tao_fields_CORBA_ServiceDetail[] = + { + { "service_detail_type", &CORBA::_tc_ServiceDetailType }, + { "service_detail", &CORBA::_tc_ServiceDetailData } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_CORBA_ServiceDetail ( + CORBA::tk_struct, + "IDL:omg.org/CORBA/ServiceDetail:1.0", + "ServiceDetail", + _tao_fields_CORBA_ServiceDetail, + 2); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ServiceDetail = + &_tao_tc_CORBA_ServiceDetail; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_ServiceDetailSeq_GUARD +#define _TAO_TYPECODE_CORBA_ServiceDetailSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_ServiceDetailSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_ServiceDetail, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_ServiceDetailSeq_0 = + &CORBA_ServiceDetailSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_ServiceDetailSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_ServiceDetailSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/ServiceDetailSeq:1.0", + "ServiceDetailSeq", + &TAO::TypeCode::tc_CORBA_ServiceDetailSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ServiceDetailSeq = + &_tao_tc_CORBA_ServiceDetailSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + +static TAO::TypeCode::Struct_Field const _tao_fields_CORBA_ServiceInformation[] = + { + { "service_options", &CORBA::_tc_ServiceOptionSeq }, + { "service_details", &CORBA::_tc_ServiceDetailSeq } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_CORBA_ServiceInformation ( + CORBA::tk_struct, + "IDL:omg.org/CORBA/ServiceInformation:1.0", + "ServiceInformation", + _tao_fields_CORBA_ServiceInformation, + 2); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ServiceInformation = + &_tao_tc_CORBA_ServiceInformation; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::ServiceOptionSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::ServiceOptionSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_ServiceOptionSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::ServiceOptionSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::ServiceOptionSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_ServiceOptionSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::ServiceOptionSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::ServiceOptionSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::ServiceOptionSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::ServiceOptionSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_ServiceOptionSeq_0, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::ServiceDetail &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::ServiceDetail::_tao_any_destructor, + CORBA::_tc_ServiceDetail, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::ServiceDetail *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::ServiceDetail::_tao_any_destructor, + CORBA::_tc_ServiceDetail, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::ServiceDetail *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::ServiceDetail *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::ServiceDetail *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::ServiceDetail::_tao_any_destructor, + CORBA::_tc_ServiceDetail, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::ServiceDetailSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::ServiceDetailSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_ServiceDetailSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::ServiceDetailSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::ServiceDetailSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_ServiceDetailSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::ServiceDetailSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::ServiceDetailSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::ServiceDetailSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::ServiceDetailSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_ServiceDetailSeq_0, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::ServiceInformation &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::ServiceInformation::_tao_any_destructor, + CORBA::_tc_ServiceInformation, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::ServiceInformation *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::ServiceInformation::_tao_any_destructor, + CORBA::_tc_ServiceInformation, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::ServiceInformation *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::ServiceInformation *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::ServiceInformation *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::ServiceInformation::_tao_any_destructor, + CORBA::_tc_ServiceInformation, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/ServicesA.h b/TAO/tao/AnyTypeCode/ServicesA.h new file mode 100644 index 00000000000..799f824e86c --- /dev/null +++ b/TAO/tao/AnyTypeCode/ServicesA.h @@ -0,0 +1,126 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:788 + +#ifndef _TAO_IDL_ANYTYPECODE_SERVICESA_H_ +#define _TAO_IDL_ANYTYPECODE_SERVICESA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/ServicesC.h" +#include "tao/AnyTypeCode/OctetSeqA.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ServiceType; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ServiceOption; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ServiceDetailType; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ServiceDetailData; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ServiceOptionSeq; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ServiceDetail; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ServiceDetailSeq; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ServiceInformation; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::ServiceOptionSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::ServiceOptionSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::ServiceOptionSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::ServiceOptionSeq *&); + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::ServiceDetail &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::ServiceDetail*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::ServiceDetail *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::ServiceDetail *&); + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::ServiceDetailSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::ServiceDetailSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::ServiceDetailSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::ServiceDetailSeq *&); + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::ServiceInformation &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::ServiceInformation*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::ServiceInformation *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::ServiceInformation *&); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/ShortSeqA.cpp b/TAO/tao/AnyTypeCode/ShortSeqA.cpp new file mode 100644 index 00000000000..ed70a459f81 --- /dev/null +++ b/TAO/tao/AnyTypeCode/ShortSeqA.cpp @@ -0,0 +1,142 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "ShortSeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_ShortSeq_GUARD +#define _TAO_TYPECODE_CORBA_ShortSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_ShortSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_short, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_ShortSeq_0 = + &CORBA_ShortSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_ShortSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_ShortSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/ShortSeq:1.0", + "ShortSeq", + &TAO::TypeCode::tc_CORBA_ShortSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ShortSeq = + &_tao_tc_CORBA_ShortSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::ShortSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::ShortSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_ShortSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::ShortSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::ShortSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_ShortSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::ShortSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::ShortSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::ShortSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::ShortSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_ShortSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/ShortSeqA.h b/TAO/tao/AnyTypeCode/ShortSeqA.h new file mode 100644 index 00000000000..11878875053 --- /dev/null +++ b/TAO/tao/AnyTypeCode/ShortSeqA.h @@ -0,0 +1,66 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:754 + +#ifndef _TAO_IDL_ANYTYPECODE_SHORTSEQA_H_ +#define _TAO_IDL_ANYTYPECODE_SHORTSEQA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/ShortSeqC.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ShortSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::ShortSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::ShortSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::ShortSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::ShortSeq *&); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/StringSeqA.cpp b/TAO/tao/AnyTypeCode/StringSeqA.cpp new file mode 100644 index 00000000000..df52b396d70 --- /dev/null +++ b/TAO/tao/AnyTypeCode/StringSeqA.cpp @@ -0,0 +1,143 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "StringSeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/AnyTypeCode/String_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_StringSeq_GUARD +#define _TAO_TYPECODE_CORBA_StringSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_StringSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_string, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_StringSeq_0 = + &CORBA_StringSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_StringSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_StringSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/StringSeq:1.0", + "StringSeq", + &TAO::TypeCode::tc_CORBA_StringSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_StringSeq = + &_tao_tc_CORBA_StringSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::StringSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::StringSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_StringSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::StringSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::StringSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_StringSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::StringSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::StringSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::StringSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::StringSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_StringSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/StringSeqA.h b/TAO/tao/AnyTypeCode/StringSeqA.h new file mode 100644 index 00000000000..91054f86fea --- /dev/null +++ b/TAO/tao/AnyTypeCode/StringSeqA.h @@ -0,0 +1,66 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:754 + +#ifndef _TAO_IDL_ANYTYPECODE_STRINGSEQA_H_ +#define _TAO_IDL_ANYTYPECODE_STRINGSEQA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/StringSeqC.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_StringSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::StringSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::StringSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::StringSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::StringSeq *&); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/String_TypeCode.cpp b/TAO/tao/AnyTypeCode/String_TypeCode.cpp new file mode 100644 index 00000000000..8542fc7ce99 --- /dev/null +++ b/TAO/tao/AnyTypeCode/String_TypeCode.cpp @@ -0,0 +1,91 @@ +// $Id$ + +#ifndef TAO_STRING_TYPECODE_CPP +#define TAO_STRING_TYPECODE_CPP + +#include "tao/AnyTypeCode/String_TypeCode.h" +#include "tao/CDR.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/String_TypeCode.inl" +#endif /* !__ACE_INLINE__ */ + + +template +bool +TAO::TypeCode::String::tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong) const +{ + // A tk_string TypeCode has a "simple" parameter list type (see + // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of + // the CORBA specification), meaning that its parameter(s) must be + // marshaled immediately following the TCKind. No CDR encapsulation + // is to be created. + + return (cdr << this->length_); +} + +template +void +TAO::TypeCode::String::tao_duplicate (void) +{ + this->RefCountPolicy::add_ref (); +} + +template +void +TAO::TypeCode::String::tao_release (void) +{ + this->RefCountPolicy::remove_ref (); +} + +template +CORBA::Boolean +TAO::TypeCode::String::equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // The following call won't throw since CORBA::TypeCode::equal() has + // already established the kind of tc is the same as our kind. + CORBA::ULong const tc_length = tc->length (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return (this->length_ == tc_length); +} + +template +CORBA::Boolean +TAO::TypeCode::String::equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // Since TCKind comparisons must be performed before equal_i() is + // called, we can also call it to determine equivalence of + // tk_string-based TypeCodes. + return this->equal_i (tc + ACE_ENV_ARG_PARAMETER); +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::String::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Already compact since tk_string and tk_wstring TypeCodes have no + // name or member names, meaning that we can simply call + // _duplicate() on this TypeCode. + + CORBA::TypeCode_ptr mutable_tc = + const_cast *> (this); + + return CORBA::TypeCode::_duplicate (mutable_tc); +} + +template +CORBA::ULong +TAO::TypeCode::String::length_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->length_; +} + + +#endif /* TAO_STRING_TYPECODE_CPP */ diff --git a/TAO/tao/AnyTypeCode/String_TypeCode.h b/TAO/tao/AnyTypeCode/String_TypeCode.h new file mode 100644 index 00000000000..628e251c491 --- /dev/null +++ b/TAO/tao/AnyTypeCode/String_TypeCode.h @@ -0,0 +1,111 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file String_TypeCode.h + * + * $Id$ + * + * Header file for @c CORBA::tk_string or @c CORBA::tk_wstring + * @c CORBA::TypeCodes. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_STRING_TYPECODE_H +#define TAO_STRING_TYPECODE_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace TAO +{ + namespace TypeCode + { + + /** + * @class String + * + * @brief @c CORBA::TypeCode implementation for OMG IDL string + * types. + * + * This class implements a @c CORBA::TypeCode for OMG IDL string + * types, including @c wstring. + */ + template + class String + : public CORBA::TypeCode, + private RefCountPolicy + { + public: + + /// Constructor. + String (CORBA::TCKind kind, CORBA::ULong length); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c CORBA::TypeCode template methods specific to @c tk_string + * @c TypeCodes. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::ULong length_i (ACE_ENV_SINGLE_ARG_DECL) const; + + private: + + /// Length of the @c string. A length of zero indicates an + /// unbounded @c string. + CORBA::ULong const length_; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/String_TypeCode.inl" +#endif /* __ACE_INLINE__ */ + +#ifdef ACE_TEMPLATES_REQUIRE_SOURCE +# include "tao/AnyTypeCode/String_TypeCode.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA +# pragma implementation ("String_TypeCode.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* TAO_STRING_TYPECODE_H */ diff --git a/TAO/tao/AnyTypeCode/String_TypeCode.inl b/TAO/tao/AnyTypeCode/String_TypeCode.inl new file mode 100644 index 00000000000..90e8e887c3b --- /dev/null +++ b/TAO/tao/AnyTypeCode/String_TypeCode.inl @@ -0,0 +1,14 @@ +// -*- C++ -*- +// +// $Id$ + +template +ACE_INLINE +TAO::TypeCode::String::String (CORBA::TCKind kind, + CORBA::ULong length) + : CORBA::TypeCode (kind) + , RefCountPolicy () + , length_ (length) +{ + // ACE_ASSERT (kind == CORBA::tk_string || kind == CORBA::tk_wstring); +} diff --git a/TAO/tao/AnyTypeCode/String_TypeCode_Static.cpp b/TAO/tao/AnyTypeCode/String_TypeCode_Static.cpp new file mode 100644 index 00000000000..a0817ca8c31 --- /dev/null +++ b/TAO/tao/AnyTypeCode/String_TypeCode_Static.cpp @@ -0,0 +1,84 @@ +// $Id$ + +#include "tao/AnyTypeCode/String_TypeCode_Static.h" +#include "tao/CDR.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/String_TypeCode_Static.inl" +#endif /* !__ACE_INLINE__ */ + + +ACE_RCSID (tao, + String_TypeCode_Static, + "$Id$") + + +bool +TAO::TypeCode::String::tao_marshal ( + TAO_OutputCDR & cdr, + CORBA::ULong) const +{ + // A tk_string TypeCode has a "simple" parameter list type (see + // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of + // the CORBA specification), meaning that its parameter(s) must be + // marshaled immediately following the TCKind. No CDR encapsulation + // is to be created. + + return (cdr << this->length_); +} + +void +TAO::TypeCode::String::tao_duplicate (void) +{ +} + +void +TAO::TypeCode::String::tao_release (void) +{ +} + +CORBA::Boolean +TAO::TypeCode::String::equal_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // The following call won't throw since CORBA::TypeCode::equal() has + // already established the kind of tc is the same as our kind. + CORBA::ULong const tc_length = tc->length (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return (this->length_ == tc_length); +} + +CORBA::Boolean +TAO::TypeCode::String::equivalent_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // Since TCKind comparisons must be performed before equal_i() is + // called, we can also call it to determine equivalence of + // tk_string-based TypeCodes. + return this->equal_i (tc + ACE_ENV_ARG_PARAMETER); +} + +CORBA::TypeCode_ptr +TAO::TypeCode::String::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Already compact since tk_string and tk_wstring TypeCodes have no + // name or member names, meaning that we can simply call + // _duplicate() on this TypeCode. + + CORBA::TypeCode_ptr mutable_tc = + const_cast *> (this); + + return CORBA::TypeCode::_duplicate (mutable_tc); +} + +CORBA::ULong +TAO::TypeCode::String::length_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->length_; +} diff --git a/TAO/tao/AnyTypeCode/String_TypeCode_Static.h b/TAO/tao/AnyTypeCode/String_TypeCode_Static.h new file mode 100644 index 00000000000..9bd90692793 --- /dev/null +++ b/TAO/tao/AnyTypeCode/String_TypeCode_Static.h @@ -0,0 +1,107 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file String_TypeCode_Static.h + * + * $Id$ + * + * Header file for static @c CORBA::tk_string or @c CORBA::tk_wstring + * @c CORBA::TypeCodes. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_STRING_TYPECODE_STATIC_H +#define TAO_STRING_TYPECODE_STATIC_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" + + +namespace TAO +{ + namespace TypeCode + { + template class String; + + /** + * @class String + * + * @brief @c CORBA::TypeCode implementation for OMG IDL string + * types. + * + * This class implements a @c CORBA::TypeCode for OMG IDL string + * types, including @c wstring. + */ + template<> + class TAO_AnyTypeCode_Export String + : public CORBA::TypeCode, + private TAO::Null_RefCount_Policy + { + public: + + /// Constructor. + String (CORBA::TCKind kind, CORBA::ULong length); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c CORBA::TypeCode template methods specific to @c tk_string + * @c TypeCodes. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::ULong length_i (ACE_ENV_SINGLE_ARG_DECL) const; + + private: + + /// Length of the @c string. A length of zero indicates an + /// unbounded @c string. + CORBA::ULong const length_; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/String_TypeCode_Static.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* TAO_STRING_TYPECODE_STATIC_H */ diff --git a/TAO/tao/AnyTypeCode/String_TypeCode_Static.inl b/TAO/tao/AnyTypeCode/String_TypeCode_Static.inl new file mode 100644 index 00000000000..4d42413daa1 --- /dev/null +++ b/TAO/tao/AnyTypeCode/String_TypeCode_Static.inl @@ -0,0 +1,14 @@ +// -*- C++ -*- +// +// $Id$ + +ACE_INLINE +TAO::TypeCode::String::String ( + CORBA::TCKind kind, + CORBA::ULong length) + : CORBA::TypeCode (kind) + , ACE_NESTED_CLASS (TAO, Null_RefCount_Policy) () + , length_ (length) +{ + // ACE_ASSERT (kind == CORBA::tk_string || kind == CORBA::tk_wstring); +} diff --git a/TAO/tao/AnyTypeCode/String_TypeCode_Traits.h b/TAO/tao/AnyTypeCode/String_TypeCode_Traits.h new file mode 100644 index 00000000000..14287963745 --- /dev/null +++ b/TAO/tao/AnyTypeCode/String_TypeCode_Traits.h @@ -0,0 +1,77 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file String_TypeCode_Traits.h + * + * $Id$ + * + * Header file for bound + * @c tk_string, + * @c tk_wstring, + * @c CORBA::TypeCode factories. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_STRING_TYPECODE_TRAITS_H +#define TAO_STRING_TYPECODE_TRAITS_H + +#include /**/ "ace/pre.h" + + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/String_TypeCode.h" +#include "tao/AnyTypeCode/True_RefCount_Policy.h" + +namespace TAO +{ + namespace TypeCodeFactory + { + template struct String_Traits; + + template<> + struct String_Traits + { + static CORBA::TypeCode_ptr create_typecode (CORBA::TCKind kind, + CORBA::ULong bound) + { + typedef TAO::TypeCode::String typecode_type; + + CORBA::TypeCode_ptr tc = CORBA::TypeCode::_nil (); + ACE_NEW_RETURN (tc, + typecode_type (kind, bound), + tc); + + return tc; + } + }; + + template <> + struct String_Traits + { + static CORBA::TypeCode_ptr create_typecode (CORBA::TCKind kind, + CORBA::ULong bound) + { + typedef TAO::TypeCode::String typecode_type; + + CORBA::TypeCode_ptr tc = CORBA::TypeCode::_nil (); + ACE_NEW_RETURN (tc, + typecode_type (kind, bound), + tc); + + return tc; + } + }; + + } // End namespace TypeCodeFactory +} // End namespace TAO + + +#include /**/ "ace/post.h" + +#endif /* TAO_STRING_TYPECODE_TRAITS_H */ diff --git a/TAO/tao/AnyTypeCode/Struct_TypeCode.cpp b/TAO/tao/AnyTypeCode/Struct_TypeCode.cpp new file mode 100644 index 00000000000..65ad7720597 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Struct_TypeCode.cpp @@ -0,0 +1,346 @@ +// $Id$ + +#ifndef TAO_STRUCT_TYPECODE_CPP +#define TAO_STRUCT_TYPECODE_CPP + +#include "tao/AnyTypeCode/Struct_TypeCode.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/AnyTypeCode/TypeCode_Traits.h" +#include "tao/ORB_Core.h" +#include "tao/TypeCodeFactory_Adapter.h" +#include "tao/CDR.h" + + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/Struct_TypeCode.inl" +#endif /* !__ACE_INLINE__ */ + +#include "ace/Dynamic_Service.h" + + +template +bool +TAO::TypeCode::Struct::tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const +{ + // A tk_struct TypeCode has a "complex" parameter list type (see + // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of + // the CORBA specification), meaning that it must be marshaled into + // a CDR encapsulation. + + // Create a CDR encapsulation. + TAO_OutputCDR enc; + + // Account for the encoded CDR encapsulation length and byte order. + // + // Aligning on an octet since the next value after the CDR + // encapsulation length will always be the byte order octet/boolean + // in this case. + offset = ACE_align_binary (offset + 4, + ACE_CDR::OCTET_ALIGN); + + bool const success = + (enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.id (), 0)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.name (), 0)) + && (enc << this->nfields_); + + if (!success) + return false; + + Struct_Field const * const begin = + &this->fields_[0]; + Struct_Field const * const end = + begin + this->nfields_; + + for (Struct_Field const * i = begin; i != end; ++i) + { + Struct_Field const & field = *i; + + if (!(enc << TAO_OutputCDR::from_string ( + Traits::get_string (field.name), 0)) + || !marshal (enc, + Traits::get_typecode (field.type), + offset + enc.total_length ())) + return false; + } + + return + cdr << static_cast (enc.total_length ()) + && cdr.write_octet_array_mb (enc.begin ()); +} + +template +void +TAO::TypeCode::Struct::tao_duplicate (void) +{ + this->RefCountPolicy::add_ref (); +} + +template +void +TAO::TypeCode::Struct::tao_release (void) +{ + this->RefCountPolicy::remove_ref (); +} + +template +CORBA::Boolean +TAO::TypeCode::Struct::equal_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // This call shouldn't throw since CORBA::TypeCode::equal() verified + // that the TCKind is the same as our's prior to invoking this + // method, meaning that member_count() is supported. + + CORBA::ULong const tc_nfields = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + if (tc_nfields != this->nfields_) + return false; + + for (CORBA::ULong i = 0; i < this->nfields_; ++i) + { + Struct_Field const & lhs_field = + this->fields_[i]; + + char const * const lhs_name = + Traits::get_string (lhs_field.name); + char const * const rhs_name = tc->member_name (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + if (ACE_OS::strcmp (lhs_name, rhs_name) != 0) + return false; + + CORBA::TypeCode_ptr const lhs_tc = + Traits::get_typecode (lhs_field.type); + CORBA::TypeCode_var const rhs_tc = + tc->member_type (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + CORBA::Boolean const equal_members = + lhs_tc->equal (rhs_tc.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + if (!equal_members) + return false; + } + + return true; +} + +template +CORBA::Boolean +TAO::TypeCode::Struct::equivalent_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // Perform a structural comparison, excluding the name() and + // member_name() operations. + + CORBA::ULong const tc_nfields = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + if (tc_nfields != this->nfields_) + return false; + + for (CORBA::ULong i = 0; i < this->nfields_; ++i) + { + CORBA::TypeCode_ptr const lhs = + Traits::get_typecode (this->fields_[i].type); + CORBA::TypeCode_var const rhs = + tc->member_type (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + CORBA::Boolean const equiv_members = + lhs->equivalent (rhs.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + if (!equiv_members) + return false; + } + + return true; +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::Struct::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_Array_Base > + tc_fields (this->nfields_); + + if (this->nfields_ > 0) + { + // Dynamically construct a new array of fields stripped of + // member names. + + static char const empty_name[] = ""; + + for (CORBA::ULong i = 0; i < this->nfields_; ++i) + { + // Member names will be stripped, i.e. not embedded within + // the compact TypeCode. + + tc_fields[i].name = empty_name; + tc_fields[i].type = + Traits::get_typecode ( + this->fields_[i].type)->get_compact_typecode ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); + } + } + + TAO_TypeCodeFactory_Adapter * const adapter = + ACE_Dynamic_Service::instance ( + TAO_ORB_Core::typecodefactory_adapter_name ()); + + if (adapter == 0) + { + ACE_THROW_RETURN (CORBA::INTERNAL (), + CORBA::TypeCode::_nil ()); + } + + return + adapter->create_struct_except_tc (this->kind_, + this->base_attributes_.id (), + "" /* empty name */, + tc_fields, + this->nfields_ + ACE_ENV_ARG_PARAMETER); +} + +template +char const * +TAO::TypeCode::Struct::id_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.id (); +} + +template +char const * +TAO::TypeCode::Struct::name_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.name (); +} + +template +CORBA::ULong +TAO::TypeCode::Struct::member_count_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->nfields_; +} + +template +char const * +TAO::TypeCode::Struct::member_name_i ( + CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + if (index >= this->nfields_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), 0); + + return Traits::get_string (this->fields_[index].name); +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::Struct::member_type_i ( + CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + if (index >= this->nfields_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), + CORBA::TypeCode::_nil ()); + + return + CORBA::TypeCode::_duplicate ( + Traits::get_typecode (this->fields_[index].type)); +} + +#endif /* TAO_STRUCT_TYPECODE_CPP */ diff --git a/TAO/tao/AnyTypeCode/Struct_TypeCode.h b/TAO/tao/AnyTypeCode/Struct_TypeCode.h new file mode 100644 index 00000000000..dc356f07447 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Struct_TypeCode.h @@ -0,0 +1,156 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Struct_TypeCode.h + * + * $Id$ + * + * Header file for a @c tk_struct and @c tk_except + * @c CORBA::TypeCodes. + * + * @author Ossama Othman + * @author Carlos O'Ryan + */ +//============================================================================= + +#ifndef TAO_STRUCT_TYPECODE_H +#define TAO_STRUCT_TYPECODE_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TypeCode_Base_Attributes.h" + + +namespace TAO +{ + namespace TypeCode + { + template struct Struct_Field; + + /** + * @class Struct + * + * @brief @c CORBA::TypeCode implementation for an OMG IDL + * @c struct or @c exception. + * + * This class implements a @c CORBA::TypeCode for an OMG IDL + * @c struct or @c exception. + */ + template + class Struct + : public CORBA::TypeCode, + private RefCountPolicy + { + public: + + /// Constructor. + Struct (CORBA::TCKind kind, + char const * id, + char const * name, + FieldArrayType const & fields, + CORBA::ULong nfields); + + /// Constructor used for recursive TypeCodes. + Struct (CORBA::TCKind kind, + char const * id); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c tk_struct or @c tk_except @c CORBA::TypeCode -specific + * template methods. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * name_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::ULong member_count_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * member_name_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr member_type_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + //@} + + protected: + + /** + * @c Struct Attributes + * + * Attributes representing the structure of an OMG IDL + * @c struct or @c exception. + * + * @note These attributes are declared in the order in which + * they are marshaled into a CDR stream in order to + * increase cache hits by improving spatial locality. + */ + //@{ + + /// Base attributes containing repository ID and name of + /// structure type. + Base_Attributes base_attributes_; + + /// The number of fields in the OMG IDL structure. + CORBA::ULong nfields_; + + /// Array of @c TAO::TypeCode fields representing structure of the + /// OMG IDL defined @c struct. + FieldArrayType fields_; + + //@} + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/Struct_TypeCode.inl" +#endif /* __ACE_INLINE__ */ + +#ifdef ACE_TEMPLATES_REQUIRE_SOURCE +# include "tao/AnyTypeCode/Struct_TypeCode.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA +# pragma implementation ("Struct_TypeCode.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + + +#include /**/ "ace/post.h" + +#endif /* TAO_STRUCT_TYPECODE_H */ diff --git a/TAO/tao/AnyTypeCode/Struct_TypeCode.inl b/TAO/tao/AnyTypeCode/Struct_TypeCode.inl new file mode 100644 index 00000000000..eb3da52ae7e --- /dev/null +++ b/TAO/tao/AnyTypeCode/Struct_TypeCode.inl @@ -0,0 +1,47 @@ +// -*- C++ -*- +// +// $Id$ + + +template +ACE_INLINE +TAO::TypeCode::Struct::Struct ( + CORBA::TCKind kind, + char const * id, + char const * name, + FieldArrayType const & fields, + CORBA::ULong nfields) + : CORBA::TypeCode (kind) + , RefCountPolicy () + , base_attributes_ (id, name) + , nfields_ (nfields) + , fields_ (fields) +{ +} + +template +ACE_INLINE +TAO::TypeCode::Struct::Struct ( + CORBA::TCKind kind, + char const * id) + : CORBA::TypeCode (kind) + , RefCountPolicy () + , base_attributes_ (id) + , nfields_ (0) + , fields_ () +{ + // CORBA::tk_except is not allowed in the recursive TypeCode case. + // ACE_ASSERT (kind == CORBA::tk_struct); +} diff --git a/TAO/tao/AnyTypeCode/Struct_TypeCode_Static.cpp b/TAO/tao/AnyTypeCode/Struct_TypeCode_Static.cpp new file mode 100644 index 00000000000..41211b42d25 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Struct_TypeCode_Static.cpp @@ -0,0 +1,316 @@ +// $Id$ + +#include "tao/AnyTypeCode/Struct_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/AnyTypeCode/TypeCode_Traits.h" +#include "tao/ORB_Core.h" +#include "tao/TypeCodeFactory_Adapter.h" +#include "tao/CDR.h" + + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/Struct_TypeCode_Static.inl" +#endif /* !__ACE_INLINE__ */ + +#include "ace/Dynamic_Service.h" + + +ACE_RCSID (tao, + Struct_TypeCode_Static, + "$Id$") + + +bool +TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy>::tao_marshal ( + TAO_OutputCDR & cdr, + CORBA::ULong offset) const +{ + // A tk_struct TypeCode has a "complex" parameter list type (see + // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of + // the CORBA specification), meaning that it must be marshaled into + // a CDR encapsulation. + + // Create a CDR encapsulation. + TAO_OutputCDR enc; + + // Account for the encoded CDR encapsulation length and byte order. + // + // Aligning on an octet since the next value after the CDR + // encapsulation length will always be the byte order octet/boolean + // in this case. + offset = ACE_align_binary (offset + 4, + ACE_CDR::OCTET_ALIGN); + + bool const success = + (enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.id (), 0)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.name (), 0)) + && (enc << this->nfields_); + + if (!success) + return false; + + Struct_Field const * const begin = + &this->fields_[0]; + Struct_Field const * const end = + begin + this->nfields_; + + for (Struct_Field const * i = + begin; + i != end; + ++i) + { + Struct_Field const & field = + *i; + + if (!(enc << TAO_OutputCDR::from_string ( + Traits::get_string (field.name), 0)) + || !marshal (enc, + Traits::get_typecode (field.type), + offset + enc.total_length ())) + return false; + } + + return + cdr << static_cast (enc.total_length ()) + && cdr.write_octet_array_mb (enc.begin ()); +} + +void +TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy>::tao_duplicate (void) +{ +} + +void +TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy>::tao_release (void) +{ +} + +CORBA::Boolean +TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy>::equal_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // This call shouldn't throw since CORBA::TypeCode::equal() verified + // that the TCKind is the same as our's prior to invoking this + // method, meaning that member_count() is supported. + + CORBA::ULong const tc_nfields = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + if (tc_nfields != this->nfields_) + return false; + + for (CORBA::ULong i = 0; i < this->nfields_; ++i) + { + Struct_Field const & + lhs_field = this->fields_[i]; + + char const * const lhs_name = + Traits::get_string (lhs_field.name); + char const * const rhs_name = tc->member_name (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + if (ACE_OS::strcmp (lhs_name, rhs_name) != 0) + return false; + + CORBA::TypeCode_ptr const lhs_tc = + Traits::get_typecode (lhs_field.type); + CORBA::TypeCode_var const rhs_tc = + tc->member_type (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + CORBA::Boolean const equal_members = + lhs_tc->equal (rhs_tc.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + if (!equal_members) + return false; + } + + return true; +} + +CORBA::Boolean +TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy>::equivalent_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // Perform a structural comparison, excluding the name() and + // member_name() operations. + + CORBA::ULong const tc_nfields = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + if (tc_nfields != this->nfields_) + return false; + + for (CORBA::ULong i = 0; i < this->nfields_; ++i) + { + CORBA::TypeCode_ptr const lhs = + Traits::get_typecode (this->fields_[i].type); + CORBA::TypeCode_var const rhs = + tc->member_type (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + CORBA::Boolean const equiv_members = + lhs->equivalent (rhs.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + if (!equiv_members) + return false; + } + + return true; +} + +CORBA::TypeCode_ptr +TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy>::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_Array_Base > + tc_fields (this->nfields_); + + if (this->nfields_ > 0) + { + // Dynamically construct a new array of fields stripped of + // member names. + + static char const empty_name[] = ""; + + for (CORBA::ULong i = 0; i < this->nfields_; ++i) + { + // Member names will be stripped, i.e. not embedded within + // the compact TypeCode. + + tc_fields[i].name = empty_name; + tc_fields[i].type = + Traits::get_typecode ( + this->fields_[i].type)->get_compact_typecode ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); + } + } + + TAO_TypeCodeFactory_Adapter * const adapter = + ACE_Dynamic_Service::instance ( + TAO_ORB_Core::typecodefactory_adapter_name ()); + + if (adapter == 0) + { + ACE_THROW_RETURN (CORBA::INTERNAL (), + CORBA::TypeCode::_nil ()); + } + + return + adapter->create_struct_except_tc (this->kind_, + this->base_attributes_.id (), + "" /* empty name */, + tc_fields, + this->nfields_ + ACE_ENV_ARG_PARAMETER); +} + +char const * +TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy>::id_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.id (); +} + +char const * +TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy>::name_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.name (); +} + +CORBA::ULong +TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy>::member_count_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->nfields_; +} + +char const * +TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy>::member_name_i ( + CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + if (index >= this->nfields_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), 0); + + return Traits::get_string (this->fields_[index].name); +} + +CORBA::TypeCode_ptr +TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy>::member_type_i ( + CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + if (index >= this->nfields_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), + CORBA::TypeCode::_nil ()); + + return + CORBA::TypeCode::_duplicate ( + Traits::get_typecode (this->fields_[index].type)); +} diff --git a/TAO/tao/AnyTypeCode/Struct_TypeCode_Static.h b/TAO/tao/AnyTypeCode/Struct_TypeCode_Static.h new file mode 100644 index 00000000000..b923b4c9917 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Struct_TypeCode_Static.h @@ -0,0 +1,152 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Struct_TypeCode_Static.h + * + * $Id$ + * + * Header file for static @c tk_struct and @c tk_except + * @c CORBA::TypeCodes. + * + * @author Ossama Othman + * @author Carlos O'Ryan + */ +//============================================================================= + +#ifndef TAO_STRUCT_TYPECODE_STATIC_H +#define TAO_STRUCT_TYPECODE_STATIC_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TypeCode_Base_Attributes.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" + + +namespace TAO +{ + namespace TypeCode + { + template struct Struct_Field; + template class Struct; + + + /** + * @class Struct + * + * @brief @c CORBA::TypeCode implementation for an OMG IDL + * @c struct or @c exception. + * + * This class implements a @c CORBA::TypeCode for an OMG IDL + * @c struct or @c exception. + */ + template<> + class TAO_AnyTypeCode_Export Struct const *, + TAO::Null_RefCount_Policy> + : public CORBA::TypeCode, + private TAO::Null_RefCount_Policy + { + public: + + /// Constructor. + Struct (CORBA::TCKind kind, + char const * id, + char const * name, + Struct_Field const * fields, + CORBA::ULong nfields); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c tk_struct or @c tk_except @c CORBA::TypeCode -specific + * template methods. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * name_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::ULong member_count_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * member_name_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr member_type_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + //@} + + private: + + /** + * @c Struct Attributes + * + * Attributes representing the structure of an OMG IDL + * @c struct or @c exception. + * + * @note These attributes are declared in the order in which + * they are marshaled into a CDR stream in order to + * increase cache hits by improving spatial locality. + */ + //@{ + + /// Base attributes containing repository ID and name of + /// structure type. + Base_Attributes const base_attributes_; + + /// The number of fields in the OMG IDL structure. + CORBA::ULong const nfields_; + + /// Array of @c TAO::TypeCode fields representing structure of the + /// OMG IDL defined @c struct. + Struct_Field const * const fields_; + + //@} + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/Struct_TypeCode_Static.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* TAO_STRUCT_TYPECODE_H */ diff --git a/TAO/tao/AnyTypeCode/Struct_TypeCode_Static.inl b/TAO/tao/AnyTypeCode/Struct_TypeCode_Static.inl new file mode 100644 index 00000000000..f32a858b845 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Struct_TypeCode_Static.inl @@ -0,0 +1,23 @@ +// -*- C++ -*- +// +// $Id$ + + +ACE_INLINE +TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy>::Struct ( + CORBA::TCKind kind, + char const * id, + char const * name, + Struct_Field const * fields, + CORBA::ULong nfields) + : CORBA::TypeCode (kind) + , ACE_NESTED_CLASS (TAO, Null_RefCount_Policy) () + , base_attributes_ (id, name) + , nfields_ (nfields) + , fields_ (fields) +{ +} diff --git a/TAO/tao/AnyTypeCode/SystemExceptionA.cpp b/TAO/tao/AnyTypeCode/SystemExceptionA.cpp new file mode 100644 index 00000000000..44271253ab5 --- /dev/null +++ b/TAO/tao/AnyTypeCode/SystemExceptionA.cpp @@ -0,0 +1,180 @@ +// $Id$ + +#include "SystemExceptionA.h" +#include "Any_SystemException.h" +#include "Any_Dual_Impl_T.h" +#include "TypeCode.h" +#include "TypeCode_Constants.h" +#include "Enum_TypeCode_Static.h" +#include "TypeCode_Struct_Field.h" +#include "Struct_TypeCode_Static.h" +#include "Null_RefCount_Policy.h" + +#include "tao/CORBA_String.h" + +ACE_RCSID (tao, + SystemExceptionA, + "$Id$") + +#if defined (ACE_HAS_PREDEFINED_THREAD_CANCELLED_MACRO) +#undef THREAD_CANCELLED +#endif /* ACE_HAS_PREDEFINED_THREAD_CANCELLED_MACRO */ + +// List of standard/system exceptions ... used to create static +// storage for their typecodes. + +#define STANDARD_EXCEPTION_LIST \ + TAO_SYSTEM_EXCEPTION (UNKNOWN) \ + TAO_SYSTEM_EXCEPTION (BAD_PARAM) \ + TAO_SYSTEM_EXCEPTION (NO_MEMORY) \ + TAO_SYSTEM_EXCEPTION (IMP_LIMIT) \ + TAO_SYSTEM_EXCEPTION (COMM_FAILURE) \ + TAO_SYSTEM_EXCEPTION (INV_OBJREF) \ + TAO_SYSTEM_EXCEPTION (OBJECT_NOT_EXIST) \ + TAO_SYSTEM_EXCEPTION (NO_PERMISSION) \ + TAO_SYSTEM_EXCEPTION (INTERNAL) \ + TAO_SYSTEM_EXCEPTION (MARSHAL) \ + TAO_SYSTEM_EXCEPTION (INITIALIZE) \ + TAO_SYSTEM_EXCEPTION (NO_IMPLEMENT) \ + TAO_SYSTEM_EXCEPTION (BAD_TYPECODE) \ + TAO_SYSTEM_EXCEPTION (BAD_OPERATION) \ + TAO_SYSTEM_EXCEPTION (NO_RESOURCES) \ + TAO_SYSTEM_EXCEPTION (NO_RESPONSE) \ + TAO_SYSTEM_EXCEPTION (PERSIST_STORE) \ + TAO_SYSTEM_EXCEPTION (BAD_INV_ORDER) \ + TAO_SYSTEM_EXCEPTION (TRANSIENT) \ + TAO_SYSTEM_EXCEPTION (FREE_MEM) \ + TAO_SYSTEM_EXCEPTION (INV_IDENT) \ + TAO_SYSTEM_EXCEPTION (INV_FLAG) \ + TAO_SYSTEM_EXCEPTION (INTF_REPOS) \ + TAO_SYSTEM_EXCEPTION (BAD_CONTEXT) \ + TAO_SYSTEM_EXCEPTION (OBJ_ADAPTER) \ + TAO_SYSTEM_EXCEPTION (DATA_CONVERSION) \ + TAO_SYSTEM_EXCEPTION (INV_POLICY) \ + TAO_SYSTEM_EXCEPTION (REBIND) \ + TAO_SYSTEM_EXCEPTION (TIMEOUT) \ + TAO_SYSTEM_EXCEPTION (TRANSACTION_UNAVAILABLE) \ + TAO_SYSTEM_EXCEPTION (TRANSACTION_MODE) \ + TAO_SYSTEM_EXCEPTION (TRANSACTION_REQUIRED) \ + TAO_SYSTEM_EXCEPTION (TRANSACTION_ROLLEDBACK) \ + TAO_SYSTEM_EXCEPTION (INVALID_TRANSACTION) \ + TAO_SYSTEM_EXCEPTION (CODESET_INCOMPATIBLE) \ + TAO_SYSTEM_EXCEPTION (BAD_QOS) \ + TAO_SYSTEM_EXCEPTION (INVALID_ACTIVITY) \ + TAO_SYSTEM_EXCEPTION (ACTIVITY_COMPLETED) \ + TAO_SYSTEM_EXCEPTION (ACTIVITY_REQUIRED) \ + TAO_SYSTEM_EXCEPTION (THREAD_CANCELLED) + +namespace TAO +{ + namespace TypeCode + { + char const * const enumerators_CORBA_CompletionStatus[] = + { + "COMPLETED_YES", + "COMPLETED_NO", + "COMPLETED_MAYBE" + }; + + Enum + tc_CompletionStatus ("IDL:omg.org/CORBA/CompletionStatus:1.0", + "CompletionStatus", + enumerators_CORBA_CompletionStatus, + 3 /* # of enumerators */); + } +} + +namespace CORBA +{ + // An internal TypeCode. + TypeCode_ptr const _tc_CompletionStatus = + &TAO::TypeCode::tc_CompletionStatus; +} + +namespace TAO +{ + namespace TypeCode + { + Struct_Field const + fields_CORBA_SystemException[] = + { + { "minor", &CORBA::_tc_ulong }, + { "completed", &CORBA::_tc_CompletionStatus } + }; + + typedef TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> tc_SystemException; + } +} + +#define TAO_SYSTEM_EXCEPTION(name) \ +namespace TAO \ +{ \ + namespace TypeCode \ + { \ + tc_SystemException tc_CORBA_ ## name ( \ + CORBA::tk_except, \ + "IDL:omg.org/CORBA/" #name ":1.0", \ + #name, \ + TAO::TypeCode::fields_CORBA_SystemException, \ + 2 /* # of fields */); \ + } \ +} \ +CORBA::TypeCode_ptr const CORBA::_tc_ ## name = \ + &TAO::TypeCode::tc_CORBA_ ## name; + +STANDARD_EXCEPTION_LIST +#undef TAO_SYSTEM_EXCEPTION + + +#define TAO_SYSTEM_EXCEPTION(name) \ +void \ +CORBA::operator<<= (CORBA::Any &any, const CORBA::name &ex) \ +{ \ + TAO::Any_SystemException::insert_copy ( \ + any, \ + CORBA::name ::_tao_any_destructor, \ + CORBA::_tc_ ## name, \ + ex \ + ); \ +} + +STANDARD_EXCEPTION_LIST +#undef TAO_SYSTEM_EXCEPTION + +#define TAO_SYSTEM_EXCEPTION(name) \ +void \ +CORBA::operator<<= (CORBA::Any &any, CORBA::name *ex) \ +{ \ + TAO::Any_SystemException::insert ( \ + any, \ + CORBA::name ::_tao_any_destructor, \ + CORBA::_tc_ ## name, \ + ex \ + ); \ +} + +STANDARD_EXCEPTION_LIST +#undef TAO_SYSTEM_EXCEPTION + +#define TAO_SYSTEM_EXCEPTION(name) \ +CORBA::Boolean operator>>= (const CORBA::Any &any, \ + const CORBA::name *&ex) \ +{ \ + return \ + TAO::Any_SystemException::extract ( \ + any, \ + CORBA::name ::_tao_any_destructor, \ + CORBA::_tc_ ## name, \ + (const CORBA::SystemException *&) ex, \ + &CORBA::name ::_tao_create); \ +} + +STANDARD_EXCEPTION_LIST +#undef TAO_SYSTEM_EXCEPTION diff --git a/TAO/tao/AnyTypeCode/SystemExceptionA.h b/TAO/tao/AnyTypeCode/SystemExceptionA.h new file mode 100644 index 00000000000..3cdb34ebf76 --- /dev/null +++ b/TAO/tao/AnyTypeCode/SystemExceptionA.h @@ -0,0 +1,88 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file SystemExceptionA.h + * + * $Id$ + * + * SystemException Any operator and typecode decls. + * + * @author Jeff Parsons + */ +//============================================================================= + +#ifndef TAO_SYSTEMEXCEPTIONA_H +#define TAO_SYSTEMEXCEPTIONA_H + +#include /**/ "ace/pre.h" +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/SystemException.h" + +namespace CORBA +{ + class TypeCode; + typedef TypeCode *TypeCode_ptr; + + class Any; + typedef Any *Any_ptr; + +#define TAO_SYSTEM_EXCEPTION(name) \ + TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, \ + const CORBA::name &); \ + TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, \ + CORBA::name *); \ + TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, \ + const CORBA::name *&); \ + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_ ## name + + TAO_SYSTEM_EXCEPTION(UNKNOWN); // the unknown exception + TAO_SYSTEM_EXCEPTION(BAD_PARAM); // an invalid parameter was passed + TAO_SYSTEM_EXCEPTION(NO_MEMORY); // memory allocation failure + TAO_SYSTEM_EXCEPTION(IMP_LIMIT); // violated implementation limit + TAO_SYSTEM_EXCEPTION(COMM_FAILURE); // communication failure + TAO_SYSTEM_EXCEPTION(INV_OBJREF); // invalid object reference + TAO_SYSTEM_EXCEPTION(OBJECT_NOT_EXIST); // no such object + TAO_SYSTEM_EXCEPTION(NO_PERMISSION); // no permission for operation + TAO_SYSTEM_EXCEPTION(INTERNAL); // ORB internal error + TAO_SYSTEM_EXCEPTION(MARSHAL); // error marshaling param/result + TAO_SYSTEM_EXCEPTION(INITIALIZE); // ORB initialization failure + TAO_SYSTEM_EXCEPTION(NO_IMPLEMENT); // implementation unavailable + TAO_SYSTEM_EXCEPTION(BAD_TYPECODE); // bad typecode + TAO_SYSTEM_EXCEPTION(BAD_OPERATION); // invalid operation + TAO_SYSTEM_EXCEPTION(NO_RESOURCES); // out of resources for request + TAO_SYSTEM_EXCEPTION(NO_RESPONSE); // response not yet available + TAO_SYSTEM_EXCEPTION(PERSIST_STORE); // persistent storage failure + TAO_SYSTEM_EXCEPTION(BAD_INV_ORDER); // routine invocations out of order + TAO_SYSTEM_EXCEPTION(TRANSIENT); // transient error, try again later + TAO_SYSTEM_EXCEPTION(FREE_MEM); // cannot free memory + TAO_SYSTEM_EXCEPTION(INV_IDENT); // invalid identifier syntax + TAO_SYSTEM_EXCEPTION(INV_FLAG); // invalid flag was specified + TAO_SYSTEM_EXCEPTION(INTF_REPOS); // interface repository unavailable + TAO_SYSTEM_EXCEPTION(BAD_CONTEXT); // error processing context object + TAO_SYSTEM_EXCEPTION(OBJ_ADAPTER); // object adapter failure + TAO_SYSTEM_EXCEPTION(DATA_CONVERSION); // data conversion error + TAO_SYSTEM_EXCEPTION(INV_POLICY); // invalid policies present + TAO_SYSTEM_EXCEPTION(REBIND); // rebind needed + TAO_SYSTEM_EXCEPTION(TIMEOUT); // operation timed out + TAO_SYSTEM_EXCEPTION(TRANSACTION_UNAVAILABLE); // no transaction + TAO_SYSTEM_EXCEPTION(TRANSACTION_MODE); // invalid transaction mode + TAO_SYSTEM_EXCEPTION(TRANSACTION_REQUIRED); // operation needs transaction + TAO_SYSTEM_EXCEPTION(TRANSACTION_ROLLEDBACK); // operation was a no-op + TAO_SYSTEM_EXCEPTION(INVALID_TRANSACTION); // invalid TP context passed + TAO_SYSTEM_EXCEPTION(CODESET_INCOMPATIBLE); // incompatible code set + TAO_SYSTEM_EXCEPTION(BAD_QOS); // bad quality of service + TAO_SYSTEM_EXCEPTION(INVALID_ACTIVITY); + TAO_SYSTEM_EXCEPTION(ACTIVITY_COMPLETED); + TAO_SYSTEM_EXCEPTION(ACTIVITY_REQUIRED); + TAO_SYSTEM_EXCEPTION(THREAD_CANCELLED); + +#undef TAO_SYSTEM_EXCEPTION + +} // End CORBA namespace + +#include /**/ "ace/post.h" + +#endif /* TAO_SYSTEMEXCEPTIONA_H */ + + diff --git a/TAO/tao/AnyTypeCode/TAOA.cpp b/TAO/tao/AnyTypeCode/TAOA.cpp new file mode 100644 index 00000000000..4230f001fc7 --- /dev/null +++ b/TAO/tao/AnyTypeCode/TAOA.cpp @@ -0,0 +1,164 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "TAOA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Objref_TypeCode_Static.h" +#include "tao/AnyTypeCode/Struct_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Impl_T.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_TAO_BufferingConstraintMode ( + CORBA::tk_alias, + "IDL:tao/TAO/BufferingConstraintMode:1.0", + "BufferingConstraintMode", + &CORBA::_tc_ushort); + +namespace TAO +{ + ::CORBA::TypeCode_ptr const _tc_BufferingConstraintMode = + &_tao_tc_TAO_BufferingConstraintMode; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + +static TAO::TypeCode::Struct_Field const _tao_fields_TAO_BufferingConstraint[] = + { + { "mode", &TAO::_tc_BufferingConstraintMode }, + { "timeout", &TimeBase::_tc_TimeT }, + { "message_count", &CORBA::_tc_ulong }, + { "message_bytes", &CORBA::_tc_ulong } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_TAO_BufferingConstraint ( + CORBA::tk_struct, + "IDL:tao/TAO/BufferingConstraint:1.0", + "BufferingConstraint", + _tao_fields_TAO_BufferingConstraint, + 4); + +namespace TAO +{ + ::CORBA::TypeCode_ptr const _tc_BufferingConstraint = + &_tao_tc_TAO_BufferingConstraint; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/objref_typecode.cpp:76 + +static TAO::TypeCode::Objref + _tao_tc_TAO_BufferingConstraintPolicy ( + CORBA::tk_local_interface, + "IDL:tao/TAO/BufferingConstraintPolicy:1.0", + "BufferingConstraintPolicy"); + +namespace TAO +{ + ::CORBA::TypeCode_ptr const _tc_BufferingConstraintPolicy = + &_tao_tc_TAO_BufferingConstraintPolicy; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const TAO::BufferingConstraint &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + TAO::BufferingConstraint::_tao_any_destructor, + TAO::_tc_BufferingConstraint, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + TAO::BufferingConstraint *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + TAO::BufferingConstraint::_tao_any_destructor, + TAO::_tc_BufferingConstraint, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + TAO::BufferingConstraint *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const TAO::BufferingConstraint *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const TAO::BufferingConstraint *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + TAO::BufferingConstraint::_tao_any_destructor, + TAO::_tc_BufferingConstraint, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/TAOA.h b/TAO/tao/AnyTypeCode/TAOA.h new file mode 100644 index 00000000000..635bc26d982 --- /dev/null +++ b/TAO/tao/AnyTypeCode/TAOA.h @@ -0,0 +1,79 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:754 + +#ifndef _TAO_IDL_ANYTYPECODE_TAOA_H_ +#define _TAO_IDL_ANYTYPECODE_TAOA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/TAOC.h" +#include "tao/AnyTypeCode/PolicyA.h" +#include "tao/AnyTypeCode/TimeBaseA.h" +#include "tao/AnyTypeCode/Messaging_SyncScopeA.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace TAO +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_BufferingConstraintMode; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_BufferingConstraint; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_BufferingConstraintPolicy; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module TAO + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const TAO::BufferingConstraint &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, TAO::BufferingConstraint*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, TAO::BufferingConstraint *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const TAO::BufferingConstraint *&); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/TAO_AnyTypeCode_Export.h b/TAO/tao/AnyTypeCode/TAO_AnyTypeCode_Export.h new file mode 100644 index 00000000000..b44ed4b4b47 --- /dev/null +++ b/TAO/tao/AnyTypeCode/TAO_AnyTypeCode_Export.h @@ -0,0 +1,40 @@ + +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl +// ------------------------------ +#ifndef TAO_ANYTYPECODE_EXPORT_H +#define TAO_ANYTYPECODE_EXPORT_H + +#include "ace/config-all.h" + +#if defined (TAO_ANYTYPECODE_AS_STATIC_LIBS) +# if !defined (TAO_ANYTYPECODE_HAS_DLL) +# define TAO_ANYTYPECODE_HAS_DLL 0 +# endif /* ! TAO_ANYTYPECODE_HAS_DLL */ +#else +# if !defined (TAO_ANYTYPECODE_HAS_DLL) +# define TAO_ANYTYPECODE_HAS_DLL 1 +# endif /* ! TAO_ANYTYPECODE_HAS_DLL */ +#endif + +#if defined (TAO_ANYTYPECODE_HAS_DLL) && (TAO_ANYTYPECODE_HAS_DLL == 1) +# if defined (TAO_ANYTYPECODE_BUILD_DLL) +# define TAO_AnyTypeCode_Export ACE_Proper_Export_Flag +# define TAO_ANYTYPECODE_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define TAO_ANYTYPECODE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* TAO_ANYTYPECODE_BUILD_DLL */ +# define TAO_AnyTypeCode_Export ACE_Proper_Import_Flag +# define TAO_ANYTYPECODE_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define TAO_ANYTYPECODE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* TAO_ANYTYPECODE_BUILD_DLL */ +#else /* TAO_ANYTYPECODE_HAS_DLL == 1 */ +# define TAO_AnyTypeCode_Export +# define TAO_ANYTYPECODE_SINGLETON_DECLARATION(T) +# define TAO_ANYTYPECODE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* TAO_ANYTYPECODE_HAS_DLL == 1 */ + +#endif /* TAO_ANYTYPECODE_EXPORT_H */ + +// End of auto generated file. diff --git a/TAO/tao/AnyTypeCode/TC_Constants_Forward.h b/TAO/tao/AnyTypeCode/TC_Constants_Forward.h new file mode 100644 index 00000000000..4595e91e048 --- /dev/null +++ b/TAO/tao/AnyTypeCode/TC_Constants_Forward.h @@ -0,0 +1,110 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file TC_Constants_Forward.h + * + * $Id$ + * + * Forward declare the type code constants used in the ORB. + * + * @author Jeff Parsons + */ +//============================================================================= + +#ifndef TAO_TC_CONSTANTS_FORWARD_H +#define TAO_TC_CONSTANTS_FORWARD_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" + +namespace CORBA +{ + /** + * @name TypeCode Constants + * + * All the TypeCode constants + */ + //@{ + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_null; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_void; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_short; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_long; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_ushort; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_ulong; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_float; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_double; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_boolean; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_char; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_octet; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_any; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_TypeCode; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_Principal; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_Object; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_string; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_longlong; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_ulonglong; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_longdouble; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_wchar; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_wstring; + +#define TAO_SYSTEM_EXCEPTION_LIST \ + TAO_SYSTEM_EXCEPTION(UNKNOWN); \ + TAO_SYSTEM_EXCEPTION(BAD_PARAM); \ + TAO_SYSTEM_EXCEPTION(NO_MEMORY); \ + TAO_SYSTEM_EXCEPTION(IMP_LIMIT); \ + TAO_SYSTEM_EXCEPTION(COMM_FAILURE); \ + TAO_SYSTEM_EXCEPTION(INV_OBJREF); \ + TAO_SYSTEM_EXCEPTION(OBJECT_NOT_EXIST); \ + TAO_SYSTEM_EXCEPTION(NO_PERMISSION); \ + TAO_SYSTEM_EXCEPTION(INTERNAL); \ + TAO_SYSTEM_EXCEPTION(MARSHAL); \ + TAO_SYSTEM_EXCEPTION(INITIALIZE); \ + TAO_SYSTEM_EXCEPTION(NO_IMPLEMENT); \ + TAO_SYSTEM_EXCEPTION(BAD_TYPECODE); \ + TAO_SYSTEM_EXCEPTION(BAD_OPERATION); \ + TAO_SYSTEM_EXCEPTION(NO_RESOURCES); \ + TAO_SYSTEM_EXCEPTION(NO_RESPONSE); \ + TAO_SYSTEM_EXCEPTION(PERSIST_STORE); \ + TAO_SYSTEM_EXCEPTION(BAD_INV_ORDER); \ + TAO_SYSTEM_EXCEPTION(TRANSIENT); \ + TAO_SYSTEM_EXCEPTION(FREE_MEM); \ + TAO_SYSTEM_EXCEPTION(INV_IDENT); \ + TAO_SYSTEM_EXCEPTION(INV_FLAG); \ + TAO_SYSTEM_EXCEPTION(INTF_REPOS); \ + TAO_SYSTEM_EXCEPTION(BAD_CONTEXT); \ + TAO_SYSTEM_EXCEPTION(OBJ_ADAPTER); \ + TAO_SYSTEM_EXCEPTION(DATA_CONVERSION); \ + TAO_SYSTEM_EXCEPTION(INV_POLICY); \ + TAO_SYSTEM_EXCEPTION(REBIND); \ + TAO_SYSTEM_EXCEPTION(TIMEOUT); \ + TAO_SYSTEM_EXCEPTION(TRANSACTION_UNAVAILABLE); \ + TAO_SYSTEM_EXCEPTION(TRANSACTION_MODE); \ + TAO_SYSTEM_EXCEPTION(TRANSACTION_REQUIRED); \ + TAO_SYSTEM_EXCEPTION(TRANSACTION_ROLLEDBACK); \ + TAO_SYSTEM_EXCEPTION(INVALID_TRANSACTION); \ + TAO_SYSTEM_EXCEPTION(CODESET_INCOMPATIBLE); \ + TAO_SYSTEM_EXCEPTION(BAD_QOS); \ + TAO_SYSTEM_EXCEPTION(INVALID_ACTIVITY); \ + TAO_SYSTEM_EXCEPTION(ACTIVITY_COMPLETED); \ + TAO_SYSTEM_EXCEPTION(ACTIVITY_REQUIRED); \ + TAO_SYSTEM_EXCEPTION(THREAD_CANCELLED); + + // = Typecode constants for system exceptions. +#define TAO_SYSTEM_EXCEPTION(name) \ + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_ ## name + TAO_SYSTEM_EXCEPTION_LIST +#undef TAO_SYSTEM_EXCEPTION + //@} + + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_UnknownUserException; + + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_Current; + + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_NamedValue; +} + +#include /**/ "ace/post.h" + +#endif /* TAO_TC_CONSTANTS_FORWARD_H */ diff --git a/TAO/tao/AnyTypeCode/TimeBaseA.cpp b/TAO/tao/AnyTypeCode/TimeBaseA.cpp new file mode 100644 index 00000000000..444c8d69f0a --- /dev/null +++ b/TAO/tao/AnyTypeCode/TimeBaseA.cpp @@ -0,0 +1,271 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "TimeBaseA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Struct_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/AnyTypeCode/Recursive_Type_TypeCode.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_TimeBase_TimeT ( + CORBA::tk_alias, + "IDL:omg.org/TimeBase/TimeT:1.0", + "TimeT", + &CORBA::_tc_ulonglong); + +namespace TimeBase +{ + ::CORBA::TypeCode_ptr const _tc_TimeT = + &_tao_tc_TimeBase_TimeT; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_TimeBase_InaccuracyT ( + CORBA::tk_alias, + "IDL:omg.org/TimeBase/InaccuracyT:1.0", + "InaccuracyT", + &TimeBase::_tc_TimeT); + +namespace TimeBase +{ + ::CORBA::TypeCode_ptr const _tc_InaccuracyT = + &_tao_tc_TimeBase_InaccuracyT; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_TimeBase_TdfT ( + CORBA::tk_alias, + "IDL:omg.org/TimeBase/TdfT:1.0", + "TdfT", + &CORBA::_tc_short); + +namespace TimeBase +{ + ::CORBA::TypeCode_ptr const _tc_TdfT = + &_tao_tc_TimeBase_TdfT; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + +static TAO::TypeCode::Struct_Field const _tao_fields_TimeBase_UtcT[] = + { + { "time", &TimeBase::_tc_TimeT }, + { "inacclo", &CORBA::_tc_ulong }, + { "inacchi", &CORBA::_tc_ushort }, + { "tdf", &TimeBase::_tc_TdfT } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_TimeBase_UtcT ( + CORBA::tk_struct, + "IDL:omg.org/TimeBase/UtcT:1.0", + "UtcT", + _tao_fields_TimeBase_UtcT, + 4); + +namespace TimeBase +{ + ::CORBA::TypeCode_ptr const _tc_UtcT = + &_tao_tc_TimeBase_UtcT; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + +static TAO::TypeCode::Struct_Field const _tao_fields_TimeBase_IntervalT[] = + { + { "lower_bound", &TimeBase::_tc_TimeT }, + { "upper_bound", &TimeBase::_tc_TimeT } + + }; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_TimeBase_IntervalT ( + CORBA::tk_struct, + "IDL:omg.org/TimeBase/IntervalT:1.0", + "IntervalT", + _tao_fields_TimeBase_IntervalT, + 2); + +namespace TimeBase +{ + ::CORBA::TypeCode_ptr const _tc_IntervalT = + &_tao_tc_TimeBase_IntervalT; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const TimeBase::UtcT &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + TimeBase::UtcT::_tao_any_destructor, + TimeBase::_tc_UtcT, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + TimeBase::UtcT *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + TimeBase::UtcT::_tao_any_destructor, + TimeBase::_tc_UtcT, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + TimeBase::UtcT *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const TimeBase::UtcT *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const TimeBase::UtcT *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + TimeBase::UtcT::_tao_any_destructor, + TimeBase::_tc_UtcT, + _tao_elem + ); +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_cs.cpp:54 + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const TimeBase::IntervalT &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + TimeBase::IntervalT::_tao_any_destructor, + TimeBase::_tc_IntervalT, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + TimeBase::IntervalT *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + TimeBase::IntervalT::_tao_any_destructor, + TimeBase::_tc_IntervalT, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + TimeBase::IntervalT *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const TimeBase::IntervalT *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const TimeBase::IntervalT *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + TimeBase::IntervalT::_tao_any_destructor, + TimeBase::_tc_IntervalT, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/TimeBaseA.h b/TAO/tao/AnyTypeCode/TimeBaseA.h new file mode 100644 index 00000000000..3ae7d0e15aa --- /dev/null +++ b/TAO/tao/AnyTypeCode/TimeBaseA.h @@ -0,0 +1,135 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_TIMEBASEA_H_ +#define _TAO_IDL_ORIG_TIMEBASEA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/TimeBaseC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace TimeBase +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_TimeT; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_InaccuracyT; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_TdfT; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_UtcT; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_IntervalT; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module TimeBase + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const TimeBase::UtcT &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, TimeBase::UtcT*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, TimeBase::UtcT *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const TimeBase::UtcT *&); + +// TAO_IDL - Generated from +// be\be_visitor_structure/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const TimeBase::IntervalT &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, TimeBase::IntervalT*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, TimeBase::IntervalT *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const TimeBase::IntervalT *&); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/True_RefCount_Policy.cpp b/TAO/tao/AnyTypeCode/True_RefCount_Policy.cpp new file mode 100644 index 00000000000..3b5b3fab354 --- /dev/null +++ b/TAO/tao/AnyTypeCode/True_RefCount_Policy.cpp @@ -0,0 +1,17 @@ +// $Id$ + +#include "True_RefCount_Policy.h" + +#ifndef __ACE_INLINE__ +# include "True_RefCount_Policy.inl" +#endif /* !__ACE_INLINE__ */ + + +ACE_RCSID (tao, + True_RefCount_Policy, + "$Id$") + + +TAO::True_RefCount_Policy::~True_RefCount_Policy (void) +{ +} diff --git a/TAO/tao/AnyTypeCode/True_RefCount_Policy.h b/TAO/tao/AnyTypeCode/True_RefCount_Policy.h new file mode 100644 index 00000000000..89035c00f47 --- /dev/null +++ b/TAO/tao/AnyTypeCode/True_RefCount_Policy.h @@ -0,0 +1,116 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file True_RefCount_Policy.h + * + * $Id$ + * + * Header file for TAO's true reference count policy (unrelated to + * CORBA policies). + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_TRUE_REFCOUNT_POLICY_H +#define TAO_TRUE_REFCOUNT_POLICY_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/orbconf.h" + +#include "ace/Thread_Mutex.h" +#include "ace/Atomic_Op.h" + +namespace TAO +{ + /** + * @class True_RefCount_Policy + * + * @brief True reference counting policy. + * + * This class is intended to be used as a "policy" argument to a + * host class template that requires true/functional reference + * counting. That class would then inherit privately from it like + * so: + * + * @code + * template + * class MyHostClass : private RefCountPolicy + * { + * public: + * void my_add_ref (void) { this->RefCountPolicy::add_ref (); } + * void my_remove_ref (void) { this->RefCountPolicy::remove_ref (); } + * }; + * @endcode + * + * and use it like so: + * + * @code + * typedef MyHostClass MyRefCountedClass; + * MyRefCountedClass * p = new MyRefCountedClass; + * ... + * p->my_remove_ref (); + * @endcode + * + * @note Ideally, the host class should declare a protected + * destructor to enforce proper memory management through the + * reference counting mechanism, i.e. to prevent clients from + * calling @c operator @c delete() directly on the host class + * object. + */ + class TAO_AnyTypeCode_Export True_RefCount_Policy + { + public: + + /// Increase the reference count on this object. + void add_ref (void); + + /// Decrease the reference count on this object. + /** + * Decrease the reference count on this object. Once the + * reference count drops to zero, call @c operator @c delete() + * on this object. + */ + void remove_ref (void); + + protected: + + /// Constructor. + /** + * @note This constructor is protected since it not meant to be + * instantiated/used as a standalone object. + */ + True_RefCount_Policy (void); + + /// Destructor. + /** + * @note The destructor must be virtual to ensure that subclass + * destructors are called when the reference count drops to + * zero, i.e. when @c remove_ref() calls @c operator + * @c delete @c this. + */ + virtual ~True_RefCount_Policy (void); + + private: + /// Reference counter. + ACE_Atomic_Op refcount_; + }; + +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/True_RefCount_Policy.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* TAO_TRUE_REFCOUNT_POLICY_H */ diff --git a/TAO/tao/AnyTypeCode/True_RefCount_Policy.inl b/TAO/tao/AnyTypeCode/True_RefCount_Policy.inl new file mode 100644 index 00000000000..87b1b1b9159 --- /dev/null +++ b/TAO/tao/AnyTypeCode/True_RefCount_Policy.inl @@ -0,0 +1,25 @@ +// -*- C++ -*- +// +// $Id$ + + +ACE_INLINE +TAO::True_RefCount_Policy::True_RefCount_Policy (void) + : refcount_ (1) +{ +} + +ACE_INLINE void +TAO::True_RefCount_Policy::add_ref (void) +{ + ++this->refcount_; +} + +ACE_INLINE void +TAO::True_RefCount_Policy::remove_ref (void) +{ + const unsigned long new_count = --this->refcount_; + + if (new_count == 0) + delete this; +} diff --git a/TAO/tao/AnyTypeCode/TypeCode.cpp b/TAO/tao/AnyTypeCode/TypeCode.cpp new file mode 100644 index 00000000000..e462b444238 --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode.cpp @@ -0,0 +1,463 @@ +// $Id$ + +#include "TypeCode.h" + +ACE_RCSID (tao, + TypeCode, + "$Id$") + + +#if !defined (__ACE_INLINE__) +# include "TypeCode.inl" +#endif /* ! __ACE_INLINE__ */ + +#include "tao/SystemException.h" +#include "tao/CDR.h" +#include "tao/ORB_Constants.h" +#include "tao/debug.h" + +#include "ace/OS_NS_string.h" + + +CORBA::TypeCode::~TypeCode (void) +{ +} + +bool +CORBA::TypeCode::tao_marshal_kind (TAO_OutputCDR & cdr) const +{ + return cdr << this->kind_; +} + +CORBA::Boolean +CORBA::TypeCode::equal (TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + if (this == tc) + { + return true; + } + else if (CORBA::is_nil (tc)) + { + ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 13, + CORBA::COMPLETED_NO), + false); + } + + CORBA::TCKind const tc_kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_kind != this->kind_) + return 0; + + ACE_TRY + { + char const * const tc_id = tc->id (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + char const * const this_id = this->id (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (ACE_OS::strcmp (this_id, tc_id) != 0) + return 0; + + char const * const tc_name = tc->name (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + char const * const this_name = this->name (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (ACE_OS::strcmp (this_name, tc_name) != 0) + return 0; + } + ACE_CATCH (CORBA::TypeCode::BadKind, ex) + { + // Some TypeCodes do not support the id() and name() + // operations. Ignore the failure, and continue equality + // verification using TypeCode subclass-specific techniques + // below. + } + ACE_ENDTRY; + ACE_CHECK_RETURN (0); + + return this->equal_i (tc + ACE_ENV_ARG_PARAMETER); +} + +CORBA::Boolean +CORBA::TypeCode::equivalent (TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + if (this == tc) + { + return true; + } + else if (CORBA::is_nil (tc)) + { + ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 13, + CORBA::COMPLETED_NO), + false); + } + + CORBA::TypeCode_ptr const mutable_this = + const_cast (this); + + CORBA::TypeCode_var unaliased_this = + TAO::unaliased_typecode (mutable_this + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + CORBA::TypeCode_var unaliased_tc = + TAO::unaliased_typecode (tc + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + + CORBA::TCKind const this_kind = + unaliased_this->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + CORBA::TCKind const tc_kind = + unaliased_tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + if (tc_kind != this_kind) + return false; + + ACE_TRY + { + char const * const this_id = + unaliased_this->id (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + char const * const tc_id = + unaliased_tc->id (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (ACE_OS::strlen (this_id) == 0 + || ACE_OS::strlen (tc_id) == 0) + { + return unaliased_this->equivalent_i (unaliased_tc.in () + ACE_ENV_ARG_PARAMETER); + } + else if (ACE_OS::strcmp (this_id, tc_id) != 0) + { + return false; + } + } + ACE_CATCH (CORBA::TypeCode::BadKind, ex) + { + // Some TypeCodes do not support the id() operation. Ignore the + // failure, and continue equivalence verification using TypeCode + // subclass-specific techniques. + return unaliased_this->equivalent_i (unaliased_tc.in () + ACE_ENV_ARG_PARAMETER); + } + ACE_ENDTRY; + ACE_CHECK_RETURN (false); + + return true; +} + +char const * +CORBA::TypeCode::id_i (ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), 0); +} + +char const * +CORBA::TypeCode::name_i (ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), 0); +} + +CORBA::ULong +CORBA::TypeCode::member_count_i (ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), 0); +} + +char const * +CORBA::TypeCode::member_name_i (CORBA::ULong /* index */ + ACE_ENV_ARG_DECL) const +{ + ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), 0); +} + +CORBA::TypeCode_ptr +CORBA::TypeCode::member_type_i (CORBA::ULong /* index */ + ACE_ENV_ARG_DECL) const +{ + ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), + CORBA::TypeCode::_nil ()); +} + +CORBA::Any * +CORBA::TypeCode::member_label_i (CORBA::ULong /* index */ + ACE_ENV_ARG_DECL) const +{ + ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), 0); +} + +CORBA::TypeCode_ptr +CORBA::TypeCode::discriminator_type_i (ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), + CORBA::TypeCode::_nil ()); +} + +CORBA::Long +CORBA::TypeCode::default_index_i (ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), 0); +} + +CORBA::ULong +CORBA::TypeCode::length_i (ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), 0); +} + +CORBA::TypeCode_ptr +CORBA::TypeCode::content_type_i (ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), + CORBA::TypeCode::_nil ()); +} + +CORBA::UShort +CORBA::TypeCode::fixed_digits_i (ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), 0); +} + +CORBA::UShort +CORBA::TypeCode::fixed_scale_i (ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), 0); +} + +CORBA::Visibility +CORBA::TypeCode::member_visibility_i (CORBA::ULong /* index */ + ACE_ENV_ARG_DECL) const +{ + ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), + CORBA::PRIVATE_MEMBER); +} + +CORBA::ValueModifier +CORBA::TypeCode::type_modifier_i (ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), + CORBA::VM_NONE); +} + +CORBA::TypeCode_ptr +CORBA::TypeCode::concrete_base_type_i (ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), + CORBA::TypeCode::_nil ()); +} + +// --------------------------------------------------------------- + +CORBA::TypeCode::Bounds::Bounds (void) + : CORBA::UserException ("IDL:omg.org/CORBA/TypeCode/Bounds:1.0", + "Bounds") +{ +} + +CORBA::TypeCode::Bounds* +CORBA::TypeCode::Bounds::_downcast (CORBA::Exception *ex) +{ + return dynamic_cast (ex); +} + +CORBA::Exception * +CORBA::TypeCode::Bounds::_alloc (void) +{ + CORBA::Exception *retval = 0; + ACE_NEW_RETURN (retval, ::CORBA::TypeCode::Bounds, 0); + return retval; +} + +CORBA::Exception * +CORBA::TypeCode::Bounds::_tao_duplicate (void) const +{ + CORBA::Exception *result; + ACE_NEW_RETURN (result, + CORBA::TypeCode::Bounds (*this), + 0); + return result; +} + +void +CORBA::TypeCode::Bounds::_raise (void) const +{ + TAO_RAISE(*this); +} + +void +CORBA::TypeCode::Bounds::_tao_encode (TAO_OutputCDR &cdr + ACE_ENV_ARG_DECL) const +{ + if (cdr << this->_rep_id ()) + { + return; + } + + ACE_THROW (CORBA::MARSHAL ()); +} + +void +CORBA::TypeCode::Bounds::_tao_decode (TAO_InputCDR & + ACE_ENV_ARG_DECL_NOT_USED) +{ +} + +// **************************************************************** + +CORBA::TypeCode::BadKind::BadKind (void) + : CORBA::UserException ("IDL:omg.org/CORBA/TypeCode/BadKind:1.0", + "BadKind") +{ +} + +CORBA::TypeCode::BadKind* +CORBA::TypeCode::BadKind::_downcast (CORBA::Exception *ex) +{ + return dynamic_cast (ex); +} + +CORBA::Exception * +CORBA::TypeCode::BadKind::_tao_duplicate (void) const +{ + CORBA::Exception *result; + ACE_NEW_RETURN (result, + CORBA::TypeCode::BadKind (*this), + 0); + return result; +} + +void +CORBA::TypeCode::BadKind::_raise (void) const +{ + TAO_RAISE(*this); +} + +void +CORBA::TypeCode::BadKind::_tao_encode (TAO_OutputCDR &cdr + ACE_ENV_ARG_DECL) const +{ + if (cdr << this->_rep_id ()) + { + return; + } + + ACE_THROW (CORBA::MARSHAL ()); +} + +void +CORBA::TypeCode::BadKind::_tao_decode (TAO_InputCDR & + ACE_ENV_ARG_DECL_NOT_USED) +{ +} + +// --------------------------------------------------------------- + +bool +TAO::TypeCode::marshal (TAO_OutputCDR & cdr, + CORBA::TypeCode_ptr tc, + CORBA::ULong offset) +{ + // Marshal the TypeCode TCKind and TypeCode body. + // + // Update the offset value in case a recursive TypeCode is being + // marshaled. + + return + tc != 0 + && tc->tao_marshal_kind (cdr) + && tc->tao_marshal (cdr, aligned_offset (offset) + sizeof (CORBA::ULong)); +} + +CORBA::ULong +TAO::TypeCode::aligned_offset (CORBA::ULong offset) +{ + ptrdiff_t const unaligned_offset = + static_cast (offset); + + return + static_cast (ACE_align_binary (unaligned_offset, + ACE_CDR::LONG_ALIGN)); +} + +// --------------------------------------------------------------- + +CORBA::TypeCode_ptr +TAO::unaliased_typecode (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) +{ + if (CORBA::is_nil (tc)) + { + ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 13, + CORBA::COMPLETED_NO), + tc); + } + + CORBA::TCKind tc_kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (tc); + + if (tc_kind == CORBA::tk_alias) + { + CORBA::TypeCode_var tc_content = + CORBA::TypeCode::_duplicate (tc); + + // Iterate until we get to the actual unaliased type. + do + { + tc_content = + tc_content->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (tc); + + tc_kind = tc_content->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (tc); + } + while (tc_kind == CORBA::tk_alias); + + return tc_content._retn (); + } + + return CORBA::TypeCode::_duplicate (tc); +} + +// ========================================================= + +// Traits specializations for CORBA::TypeCode. +namespace TAO +{ + CORBA::TypeCode_ptr + Objref_Traits::duplicate (CORBA::TypeCode_ptr p) + { + return CORBA::TypeCode::_duplicate (p); + } + + void + Objref_Traits::release (CORBA::TypeCode_ptr p) + { + CORBA::release (p); + } + + CORBA::TypeCode_ptr + Objref_Traits::nil (void) + { + return CORBA::TypeCode::_nil (); + } + + CORBA::Boolean + Objref_Traits::marshal (CORBA::TypeCode_ptr p, + TAO_OutputCDR & cdr) + { + return cdr << p; + } +} diff --git a/TAO/tao/AnyTypeCode/TypeCode.h b/TAO/tao/AnyTypeCode/TypeCode.h new file mode 100644 index 00000000000..bb1136bdefe --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode.h @@ -0,0 +1,587 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file TypeCode.h + * + * $Id$ + * + * Header file the @c CORBA::TypeCode class. + * + * @author Ossama Othman + * @author DOC group at Vanderbilt University, Washington University + * and the University of California at Irvine. + */ +//============================================================================= + +#ifndef TAO_TYPECODE_H +#define TAO_TYPECODE_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/UserException.h" +#include "tao/Basic_Types.h" +#include "tao/AnyTypeCode/ValueModifierC.h" +#include "tao/AnyTypeCode/VisibilityC.h" +#include "tao/Typecode_typesC.h" +#include "tao/Any_Insert_Policy_T.h" +#include "tao/CORBA_methods.h" +#include "tao/Pseudo_VarOut_T.h" +#include "tao/Object_Argument_T.h" +#include "tao/Arg_Traits_T.h" +#include "tao/AnyTypeCode/AnyTypeCode_methods.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +namespace CORBA +{ + typedef TAO_Pseudo_Var_T TypeCode_var; + typedef TAO_Pseudo_Out_T TypeCode_out; + + /** + * @class TypeCode + * + * @brief A representation of the structure of a given OMG + * IDL-declared type. + * + * @c TypeCodes are primarily used by @c CORBA::Anys, the CORBA + * Interface Repository and the CORBA Dynamic Invocation Interface. + */ + class TAO_AnyTypeCode_Export TypeCode + { + public: + + /** + * @class Bounds + * + * @brief Out-of-bounds member index exception. + * + * Exception thrown when attempting to pass an out-of-bounds index + * value to a @c TypeCode operation that accepts a member index + * argument. + */ + class TAO_AnyTypeCode_Export Bounds : public UserException + { + public: + + /// Constructor. + Bounds (void); + + static Bounds * _downcast (CORBA::Exception * ex); + static CORBA::Exception * _alloc (void); + + virtual CORBA::Exception * _tao_duplicate (void) const; + + virtual void _raise (void) const; + + virtual void _tao_encode (TAO_OutputCDR & cdr + ACE_ENV_ARG_DECL) const; + virtual void _tao_decode (TAO_InputCDR & cdr + ACE_ENV_ARG_DECL); + + }; + + /** + * @class BadKind + * + * @brief Invalid @c TypeCode operation exception. + * + * Exception thrown when attempting to invoke a @c TypeCode + * operation that is not valid for the type represented by the + * @c TypeCode. + */ + class TAO_AnyTypeCode_Export BadKind : public CORBA::UserException + { + public: + + BadKind (void); + + static BadKind * _downcast (CORBA::Exception * ex); + static CORBA::Exception * _alloc (void); + + virtual CORBA::Exception * _tao_duplicate (void) const; + + virtual void _raise (void) const; + + virtual void _tao_encode (TAO_OutputCDR & cdr + ACE_ENV_ARG_DECL) const; + virtual void _tao_decode (TAO_InputCDR & cdr + ACE_ENV_ARG_DECL); + + }; + + static CORBA::TypeCode_ptr const _tc_Bounds; + static CORBA::TypeCode_ptr const _tc_BadKind; + + /// Duplicate this @c TypeCode. + /** + * Statically instantiated @c TypeCodes incur no reference count + * manipulation, i.e. reference counting is a no-op. + * + * Dynamically instantiated @c TypeCodes will have their reference + * count incremented by one each time this function is called. + */ + static CORBA::TypeCode_ptr _duplicate (CORBA::TypeCode_ptr tc); + + /// Returns a NULL typecode. + static CORBA::TypeCode_ptr _nil (void); + + /** + * @name @c CORBA::TypeCode Methods + * + * These methods are part of the public interface of @c + * CORBA::TypeCode class, as defined by the OMG CORBA + * specification and C++ mapping. + * + * The C++ mapping does not declare the methods in the public + * @c CORBA::TypeCode API as @c virtual, so work around that by + * making these methods inlined to forward all calls to the + * corresponding protected template method (i.e. the design + * pattern, not the C++ feature) listed below in the @c protected + * block. + */ + //@{ + /// Equality of two @c TypeCodes. + /** + * @return @c true if and only if the set of legal operations is + * the same and invoking any operation on the this + * @c TypeCode and @a tc returns identical results. + */ + Boolean equal (TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + + /// Equivalence of two @c TypeCodes. + /** + * Equivalence of two @c TypeCodes satisfies a subset of the + * requirements necessary for equality. + * + * @see equal + */ + Boolean equivalent (TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + + /// The kind of @c TypeCode. + TCKind kind (ACE_ENV_SINGLE_ARG_DECL) const; + + /// Return @c TypeCode stripped of optional @c name and + /// @c member_name fields. + /** + * @note Calling this method will incur additional run-time memory + * consumption since TAO's implementation relies on the + * TypeCodeFactory to dynamically create a compact @c + * TypeCode; the exception being @c TypeCodes with empty + * parameter lists. Those @c TypeCodes are already compact, + * meaning that call this method on such @c TypeCodes incurs + * no additional run-time memory requirements. + * + * Unless you need to send compact @c TypeCodes + * "over-the-wire" or your @c TypeCode corresponds to a + * type with a large number of members, try to stick with + * the existing potentially non-compact @c TypeCode. + * + * @note Compact @c TypeCodes may also be generated statically by + * the TAO_IDL compiler by invoking it with its "-Gt" + * (i.e. enable optimized TypeCodes) command line option. + */ + TypeCode_ptr get_compact_typecode (ACE_ENV_SINGLE_ARG_DECL) const; + + /// The @c RepositoryId globally identifying the type. + /** + * This method is valid for the following kinds of @c TypeCodes: + * + * @li @c tk_objref + * @li @c tk_struct + * @li @c tk_union + * @li @c tk_enum + * @li @c tk_alias + * @li @c tk_value + * @li @c tk_value_box + * @li @c tk_native + * @li @c tk_abstract_interface + * @li @c tk_local_interface + * @li @c tk_except + * @li @c tk_component + * @li @c tk_home + * @li @c tk_event + * + * @note CORBA::TypeCode::id() does not follow the usual parameter + * passing rules defined by the C++ mapping. This behavior + * is required by the C++ mapping. In particular, ownership + * is maintained by the @c TypeCode. + */ + char const * id (ACE_ENV_SINGLE_ARG_DECL) const; + + /// The simple name identifying the type within its enclosing + /// scope. + /** + * This method is valid for the following kinds of @c TypeCodes: + * + * @li @c tk_objref + * @li @c tk_struct + * @li @c tk_union + * @li @c tk_enum + * @li @c tk_alias + * @li @c tk_value + * @li @c tk_value_box + * @li @c tk_native + * @li @c tk_abstract_interface + * @li @c tk_local_interface + * @li @c tk_except + * @li @c tk_component + * @li @c tk_home + * @li @c tk_event + * + * @note CORBA::TypeCode::name() does not follow the usual + * parameter passing rules defined by the C++ mapping. This + * behavior is required by the C++ mapping. In particular, + * ownership is maintained by the @c TypeCode. + */ + char const * name (ACE_ENV_SINGLE_ARG_DECL) const; + + /// The type member count. + /** + * This method is valid for the following kinds of @c TypeCodes: + * + * @li @c tk_struct + * @li @c tk_union + * @li @c tk_enum + * @li @c tk_value + * @li @c tk_except + * @li @c tk_event + */ + ULong member_count (ACE_ENV_SINGLE_ARG_DECL) const; + + /// The type member name. + /** + * This method is valid for the following kinds of @c TypeCodes: + * + * @li @c tk_struct + * @li @c tk_union + * @li @c tk_enum + * @li @c tk_value + * @li @c tk_except + * @li @c tk_event + * + * @note CORBA::TypeCode::member_name() does not follow the usual + * parameter passing rules defined by the C++ mapping. This + * behavior is required by the C++ mapping. In particular, + * ownership is maintained by the @c TypeCode. + */ + char const * member_name (ULong index + ACE_ENV_ARG_DECL) const; + + /// The type member @c TypeCode. + /** + * This method is valid for the following kinds of @c TypeCodes: + * + * @li @c tk_struct + * @li @c tk_union + * @li @c tk_value + * @li @c tk_except + * @li @c tk_event + */ + TypeCode_ptr member_type (ULong index + ACE_ENV_ARG_DECL) const; + + /// The union member label. + /** + * This method is valid for the following kinds of @c TypeCodes: + * + * @li @c tk_union + */ + Any * member_label (ULong index + ACE_ENV_ARG_DECL) const; + + /// The type of all non-default union member labels. + /** + * This method is valid for the following kinds of @c TypeCodes: + * + * @li @c tk_union + */ + TypeCode_ptr discriminator_type (ACE_ENV_SINGLE_ARG_DECL) const; + + /// The index of the default union member. + /** + * This method is valid for the following kinds of @c TypeCodes: + * + * @li @c tk_union + */ + Long default_index (ACE_ENV_SINGLE_ARG_DECL) const; + + /// The length of the type. + /** + * This method is valid for the following kinds of @c TypeCodes: + * + * @li @c tk_string + * @li @c tk_wstring + * @li @c tk_sequence + * @li @c tk_array + */ + ULong length (ACE_ENV_SINGLE_ARG_DECL) const; + + /// The underlying content type. + /** + * This method is valid for the following kinds of @c TypeCodes: + * + * @li @c tk_sequence + * @li @c tk_array + * @li @c tk_value_box + * @li @c tk_alias + */ + TypeCode_ptr content_type (ACE_ENV_SINGLE_ARG_DECL) const; + + /// The number of significant digits. + /** + * This method is valid for the following kinds of @c TypeCodes: + * + * @li @c tk_fixed + */ + UShort fixed_digits (ACE_ENV_SINGLE_ARG_DECL) const; + + /// The scale factor. + /** + * This method is valid for the following kinds of @c TypeCodes: + * + * @li @c tk_fixed + */ + UShort fixed_scale (ACE_ENV_SINGLE_ARG_DECL) const; + + /// The @c Visibility of the @c valuetype or @c eventtype member + /// corresponding to index @a index. + /** + * This method is valid for the following kinds of @c TypeCodes: + * + * @li @c tk_value + * @li @c tk_event + */ + Visibility member_visibility (ULong index + ACE_ENV_ARG_DECL) const; + + /// The @c ValueModifier of the @c valuetype of @c eventtype + /// represented by this @c TypeCode. + /** + * This method is valid for the following kinds of @c TypeCodes: + * + * @li @c tk_value + * @li @c tk_event + */ + ValueModifier type_modifier (ACE_ENV_SINGLE_ARG_DECL) const; + + /// The @c TypeCode corresponding to the concrete base + /// @c valuetype or @c eventtype. + /** + * This method is valid for the following kinds of @c TypeCodes: + * + * @li @c tk_value + * @li @c tk_event + * + * @return @c TypeCode corresponding to the concrete base + * @c valuetype or @c eventtype. + * @c CORBA::TypeCode::_nil() if no concrete base exists. + */ + TypeCode_ptr concrete_base_type (ACE_ENV_SINGLE_ARG_DECL) const; + //@} + + /// Marshal the @c TypeCode @c TCKind. + /** + * + */ + virtual bool tao_marshal_kind (TAO_OutputCDR & cdr) const; + + /// Marshal this @c TypeCode into a CDR output stream. + /** + * Marshal this @c TypeCode into the @a cdr output CDR stream, + * excluding the @c TypeCode kind. Existing @a cdr contents will + * not be altered. The marshaled @c TypeCode will be appended to + * the given @a cdr CDR output stream. + * + * @param cdr Output CDR stream into which the @c TypeCode will be + * marshaled. + * + * @param offset Number of bytes currently in the output CDR + * stream, including the top-level TypeCode @c + * TCKind. This argument is useful for recursive + * @c TypeCodes. @c TypeCodes that contain other + * @c TypeCodes should pass an updated @a offset + * value to the marshaling operation for those + * contained @c TypeCodes. + * + * @return @c true if marshaling was successful. + * + * @note This is a TAO-specific method that is not part of the + * standard @c CORBA::TypeCode interface. + * + * @note If this method returns @false, the contents of the @a cdr + * output CDR stream are undefined. + */ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const = 0; + + /// Increase the reference count on this @c TypeCode. + virtual void tao_duplicate (void) = 0; + + /// Decrease the reference count on this object. + virtual void tao_release (void) = 0; + + /// Destruction callback for Anys. + static void _tao_any_destructor (void * x); + + typedef CORBA::TypeCode_var _var_type; + + protected: + + /// Constructor. + TypeCode (CORBA::TCKind kind); + + /// Destructor. + /** + * Protected destructor to enforce proper memory management + * through the reference counting mechanism. + */ + virtual ~TypeCode (void); + + /** + * @name @c TypeCode Template Methods + * + * Methods that must be implemented by @c CORBA::TypeCode + * subclasses if valid for those subclasses. + * + * The default implementations of the non-pure virtual methods + * throw the @c CORBA::TypeCode::BadKind exception since many of + * these methods are @c TypeCode type-specific. This reduces code + * duplication and bloat. + * + * The @c TypeCode @c equal(), @c equivalent(), @c kind() and + * @c get_compact_typecode() methods are valid for all + * @c TypeCodes which is why their template method "@c _i" + * counterparts are pure virtual. + */ + //@{ + virtual Boolean equal_i (TypeCode_ptr tc + ACE_ENV_ARG_DECL) const = 0; + virtual Boolean equivalent_i (TypeCode_ptr tc + ACE_ENV_ARG_DECL) const = 0; + virtual TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const = 0; + + virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * name_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual ULong member_count_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * member_name_i (ULong index + ACE_ENV_ARG_DECL) const; + virtual TypeCode_ptr member_type_i (ULong index + ACE_ENV_ARG_DECL) const; + virtual Any * member_label_i (ULong index + ACE_ENV_ARG_DECL) const; + virtual TypeCode_ptr discriminator_type_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual Long default_index_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual ULong length_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual TypeCode_ptr content_type_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual UShort fixed_digits_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual UShort fixed_scale_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual Visibility member_visibility_i (ULong index + ACE_ENV_ARG_DECL) const; + virtual ValueModifier type_modifier_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual TypeCode_ptr concrete_base_type_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + //@} + + private: + + // Prevent copying and assignment. + TypeCode (TypeCode const &); + void operator= (TypeCode const &); + + protected: + + /// The kind of TypeCode. + TCKind const kind_; + + }; +} // End namespace CORBA + + +TAO_NAMESPACE_INLINE_FUNCTION +bool operator<< (TAO_OutputCDR & cdr, + CORBA::TypeCode_ptr tc); + +TAO_AnyTypeCode_Export bool operator>> (TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc); + +namespace TAO +{ + namespace TypeCode + { + /// Marshal the @c TypeCode @a tc in to the output CDR stream @a + /// cdr. + /** + * @see @CORBA::TypeCode::tao_marshal() description for details. + */ + + TAO_AnyTypeCode_Export bool marshal (TAO_OutputCDR & cdr, + CORBA::TypeCode_ptr tc, + CORBA::ULong offset); + + /// Return @a offset aligned on the appropriate CDR boundary. + TAO_AnyTypeCode_Export CORBA::ULong aligned_offset (CORBA::ULong offset); + } + + /// Return the unaliased content @c TypeCode of the given + /// @c TypeCode. + TAO_AnyTypeCode_Export CORBA::TypeCode_ptr unaliased_typecode (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL); + + /// Return the unaliased @c TCKind of the given @c TypeCode. + /** + * @note This is a convenience function that simply calls @c kind() + * on the unaliased @c TypeCode returned from + * @c unaliased_typecode(). + */ + TAO_NAMESPACE_INLINE_FUNCTION + CORBA::TCKind unaliased_kind (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL); + + // --------------------------------------------------------------- + + // Used in generated code if CORBA::TypeCode is an argument or + // return type. + template<> + class TAO_AnyTypeCode_Export Arg_Traits + : public Object_Arg_Traits_T, + TAO::Any_Insert_Policy_Stream + > + { + }; + + template<> + struct TAO_AnyTypeCode_Export Objref_Traits< ::CORBA::TypeCode> + { + static ::CORBA::TypeCode_ptr duplicate (::CORBA::TypeCode_ptr); + static void release (::CORBA::TypeCode_ptr); + static ::CORBA::TypeCode_ptr nil (void); + static CORBA::Boolean marshal (::CORBA::TypeCode_ptr p, + TAO_OutputCDR & cdr); + }; +} + + +#if defined (__ACE_INLINE__) +# include "tao/TypeCode.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* TAO_TYPECODE_H */ diff --git a/TAO/tao/AnyTypeCode/TypeCode.inl b/TAO/tao/AnyTypeCode/TypeCode.inl new file mode 100644 index 00000000000..4126fdb565c --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode.inl @@ -0,0 +1,183 @@ +// -*- C++ -*- +// +// $Id$ + + +#include "tao/CORBA_methods.h" +#include "tao/Environment.h" + + +ACE_INLINE CORBA::Boolean +CORBA::is_nil (CORBA::TypeCode_ptr obj) +{ + return obj == 0; +} + +ACE_INLINE void +CORBA::release (CORBA::TypeCode_ptr obj) +{ + if (obj) + obj->tao_release (); +} + +// -------------------------------------------------------------- + +ACE_INLINE +CORBA::TypeCode::TypeCode (CORBA::TCKind k) + : kind_ (k) +{ +} + +ACE_INLINE CORBA::TypeCode_ptr +CORBA::TypeCode::_duplicate (CORBA::TypeCode_ptr tc) +{ + if (!CORBA::is_nil (tc)) + tc->tao_duplicate (); + + return tc; +} + +ACE_INLINE CORBA::TypeCode_ptr +CORBA::TypeCode::_nil (void) +{ + return static_cast (0); +} + +ACE_INLINE CORBA::TCKind +CORBA::TypeCode::kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->kind_; +} + +ACE_INLINE CORBA::TypeCode_ptr +CORBA::TypeCode::get_compact_typecode (ACE_ENV_SINGLE_ARG_DECL) const +{ + return this->get_compact_typecode_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +ACE_INLINE char const * +CORBA::TypeCode::id (ACE_ENV_SINGLE_ARG_DECL) const +{ + return this->id_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +ACE_INLINE char const * +CORBA::TypeCode::name (ACE_ENV_SINGLE_ARG_DECL) const +{ + return this->name_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +ACE_INLINE CORBA::ULong +CORBA::TypeCode::member_count (ACE_ENV_SINGLE_ARG_DECL) const +{ + return this->member_count_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +ACE_INLINE char const * +CORBA::TypeCode::member_name (ULong index + ACE_ENV_ARG_DECL) const +{ + return this->member_name_i (index + ACE_ENV_ARG_PARAMETER); +} + +ACE_INLINE CORBA::TypeCode_ptr +CORBA::TypeCode::member_type (ULong index + ACE_ENV_ARG_DECL) const +{ + return this->member_type_i (index + ACE_ENV_ARG_PARAMETER); +} + +ACE_INLINE CORBA::Any * +CORBA::TypeCode::member_label (ULong index + ACE_ENV_ARG_DECL) const +{ + return this->member_label_i (index + ACE_ENV_ARG_PARAMETER); +} + +ACE_INLINE CORBA::TypeCode_ptr +CORBA::TypeCode::discriminator_type (ACE_ENV_SINGLE_ARG_DECL) const +{ + return this->discriminator_type_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +ACE_INLINE CORBA::Long +CORBA::TypeCode::default_index (ACE_ENV_SINGLE_ARG_DECL) const +{ + return this->default_index_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +ACE_INLINE CORBA::ULong +CORBA::TypeCode::length (ACE_ENV_SINGLE_ARG_DECL) const +{ + return this->length_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +ACE_INLINE CORBA::TypeCode_ptr +CORBA::TypeCode::content_type (ACE_ENV_SINGLE_ARG_DECL) const +{ + return this->content_type_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +ACE_INLINE CORBA::UShort +CORBA::TypeCode::fixed_digits (ACE_ENV_SINGLE_ARG_DECL) const +{ + return this->fixed_digits_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +ACE_INLINE CORBA::UShort +CORBA::TypeCode::fixed_scale (ACE_ENV_SINGLE_ARG_DECL) const +{ + return this->fixed_scale_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +ACE_INLINE CORBA::Visibility +CORBA::TypeCode::member_visibility (ULong index + ACE_ENV_ARG_DECL) const +{ + return this->member_visibility_i (index + ACE_ENV_ARG_PARAMETER); +} + +ACE_INLINE CORBA::ValueModifier +CORBA::TypeCode::type_modifier (ACE_ENV_SINGLE_ARG_DECL) const +{ + return this->type_modifier_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +ACE_INLINE CORBA::TypeCode_ptr +CORBA::TypeCode::concrete_base_type (ACE_ENV_SINGLE_ARG_DECL) const +{ + return this->concrete_base_type_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +ACE_INLINE void +CORBA::TypeCode::_tao_any_destructor (void * x) +{ + CORBA::release (static_cast (x)); +} + +// -------------------------------------------------------------- + +ACE_INLINE bool +operator<< (TAO_OutputCDR & cdr, + CORBA::TypeCode_ptr tc) +{ + return TAO::TypeCode::marshal (cdr, tc, 0); +} + +// --------------------------------------------------------------- + +ACE_INLINE CORBA::TCKind +TAO::unaliased_kind (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) +{ + CORBA::TypeCode_var unaliased_tc = + TAO::unaliased_typecode (tc + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::TAO_TC_KIND_COUNT); + + return unaliased_tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER); +} diff --git a/TAO/tao/AnyTypeCode/TypeCodeA.cpp b/TAO/tao/AnyTypeCode/TypeCodeA.cpp new file mode 100644 index 00000000000..6ff09fdf2cc --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCodeA.cpp @@ -0,0 +1,59 @@ +// $Id$ + +#include "Struct_TypeCode_Static.h" +#include "Null_RefCount_Policy.h" + + +ACE_RCSID (tao, + TypeCode, + "$Id$") + + +namespace TAO +{ + namespace TypeCode + { + // Notice that these are all statically instantiated and not + // exported. + + char const tc_bounds_id[] = "IDL:omg.org/CORBA/TypeCode/Bounds:1.0"; + char const tc_bounds_name[] = "Bounds"; + Struct const *, + TAO::Null_RefCount_Policy> tc_Bounds (CORBA::tk_except, + tc_bounds_id, + tc_bounds_name, + 0, + 0); + + char const tc_bad_kind_id[] = "IDL:omg.org/CORBA/TypeCode/BadKind:1.0"; + char const tc_bad_kind_name[] = "BadKind"; + Struct const *, + TAO::Null_RefCount_Policy> tc_BadKind (CORBA::tk_except, + tc_bad_kind_id, + tc_bad_kind_name, + 0, + 0); + } +} + + +// ------------------------------------------------------------------ +// OMG defined TypeCode constants +// ------------------------------------------------------------------ + +// Notice that these are constant TypeCode references/pointers, not +// constant TypeCodes. TypeCodes are effectively read-only since +// all non-static TypeCode operations are const. + + +CORBA::TypeCode_ptr const CORBA::TypeCode::_tc_BadKind = + &TAO::TypeCode::tc_BadKind; +CORBA::TypeCode_ptr const CORBA::TypeCode::_tc_Bounds = + &TAO::TypeCode::tc_Bounds; + diff --git a/TAO/tao/AnyTypeCode/TypeCode_Base_Attributes.cpp b/TAO/tao/AnyTypeCode/TypeCode_Base_Attributes.cpp new file mode 100644 index 00000000000..da416b4314f --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_Base_Attributes.cpp @@ -0,0 +1,12 @@ +// $Id$ + +#ifndef TAO_TYPECODE_BASE_ATTRIBUTES_CPP +#define TAO_TYPECODE_BASE_ATTRIBUTES_CPP + +#include "tao/AnyTypeCode/TypeCode_Base_Attributes.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/TypeCode_Base_Attributes.inl" +#endif /* !__ACE_INLINE__ */ + +#endif /* TAO_TYPECODE_BASE_ATTRIBUTES_CPP */ diff --git a/TAO/tao/AnyTypeCode/TypeCode_Base_Attributes.h b/TAO/tao/AnyTypeCode/TypeCode_Base_Attributes.h new file mode 100644 index 00000000000..4771d75d95b --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_Base_Attributes.h @@ -0,0 +1,96 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file TypeCode_Base_Attributes.h + * + * $Id$ + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_TYPECODE_BASE_ATTRIBUTES_H +#define TAO_TYPECODE_BASE_ATTRIBUTES_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace TAO +{ + namespace TypeCode + { + + /** + * @class Base_Attributes + * + * @brief Attributes contained by most @c TypeCodes with complex + * parameter lists. + * + * Most @c TypeCodes with complex parameter lists (see Section + * 15.3.5.1 "TypeCode" in the CORBA specification) contain these + * attributes, namely a repository ID and a name. + */ + template + class Base_Attributes + { + public: + + /// Constructor. + Base_Attributes (char const * id, + char const * name); + + /// Constructor used by recursive @c TypeCodes. + Base_Attributes (char const * id); + + /// Get the @c RepositoryId globally identifying the type. + char const * id (void) const; + + /// Get the simple name identifying the type within its + /// enclosing scope. + char const * name (void) const; + + /// Set the simple name identifying the type within its + /// enclosing scope. + /** + * @note This method only used when creating a recursive + * TypeCode. + */ + void name (char const * the_name); + + private: + + /// The @c RepositoryId globally identifying the type. + STRING_TYPE const id_; + + /// The simple name identifying the type within its enclosing + /// scope. + STRING_TYPE name_; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/TypeCode_Base_Attributes.inl" +#endif /* __ACE_INLINE__ */ + +#ifdef ACE_TEMPLATES_REQUIRE_SOURCE +# include "tao/AnyTypeCode/TypeCode_Base_Attributes.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA +# pragma implementation ("TypeCode_Base_Attributes.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + + +#include /**/ "ace/post.h" + +#endif /* TAO_TYPECODE_BASE_ATTRIBUTES_H */ diff --git a/TAO/tao/AnyTypeCode/TypeCode_Base_Attributes.inl b/TAO/tao/AnyTypeCode/TypeCode_Base_Attributes.inl new file mode 100644 index 00000000000..d94e65040a6 --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_Base_Attributes.inl @@ -0,0 +1,51 @@ +// -*- C++ -*- +// +// $Id$ + +#include "tao/AnyTypeCode/TypeCode_Traits.h" + + +template +ACE_INLINE +TAO::TypeCode::Base_Attributes::Base_Attributes ( + char const * id, + char const * name) + : id_ (id), + name_ (name) +{ +} + +template +ACE_INLINE +TAO::TypeCode::Base_Attributes::Base_Attributes ( + char const * id) + : id_ (id), + name_ () +{ + // Only used in the dynamic (when STRING_TYPE == CORBA::String_var) + // recursive TypeCode case. +} + +template +ACE_INLINE char const * +TAO::TypeCode::Base_Attributes::id (void) const +{ + return Traits::get_string (this->id_); +} + +template +ACE_INLINE char const * +TAO::TypeCode::Base_Attributes::name (void) const +{ + return Traits::get_string (this->name_); +} + +template +ACE_INLINE void +TAO::TypeCode::Base_Attributes::name (char const * the_name) +{ + // This method will only be instantiated in the dynamic TypeCode + // case, i.e. when STRING_TYPE is CORBA::String_var. + + this->name_ = the_name; +} diff --git a/TAO/tao/AnyTypeCode/TypeCode_CDR_Extraction.cpp b/TAO/tao/AnyTypeCode/TypeCode_CDR_Extraction.cpp new file mode 100644 index 00000000000..65e56318cd8 --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_CDR_Extraction.cpp @@ -0,0 +1,1325 @@ +// $Id$ + +#include "TypeCode_CDR_Extraction.h" + +#include "tao/CDR.h" + +#include "TypeCode_Constants.h" +#include "True_RefCount_Policy.h" + +#include "Alias_TypeCode.h" +#include "Enum_TypeCode.h" +#include "Fixed_TypeCode.h" +#include "Objref_TypeCode.h" +#include "Sequence_TypeCode.h" +#include "String_TypeCode.h" +#include "Struct_TypeCode.h" +#include "Union_TypeCode.h" +#include "Value_TypeCode.h" + +#include "Recursive_Type_TypeCode.h" + +#include "TypeCode_Case_T.h" +#include "TypeCode_Struct_Field.h" +#include "TypeCode_Value_Field.h" + +#include "ace/Array_Base.h" + + +ACE_RCSID (tao, + TypeCode_CDR_Extraction, + "$Id$") + + +namespace TAO +{ + namespace TypeCodeFactory + { + // An array of TC_Info objects is used instead of a map of + // repository IDs to TypeCodes since it is presumed that the + // number of directly or indirectly embedded types in a TypeCode + // capable of holding another TypeCode will be small enough to + // make traversing a list faster than performing a map lookup. + // Use a simple array also reduces static and run-time footprint. + + struct TC_Info + { + /// Constructor. + TC_Info (void) : id (0), type () {} + + /// Repository ID. + char const * id; + + /// TypeCode + CORBA::TypeCode_ptr type; + }; + + typedef ACE_Array_Base TC_Info_List; + } +} + +namespace +{ + bool start_cdr_encap_extraction (TAO_InputCDR & cdr) + { + CORBA::Boolean byte_order; + + // Don't bother demarshaling the encapsulation length. Prefer + // speed over early error checking. Any CDR length related + // failures will be detected when demarshaling the remainder of + // the complex parameter list TypeCode. + + if (!(cdr.skip_ulong () // Skip encapsulation length. + && cdr >> TAO_InputCDR::to_boolean (byte_order))) + return false; + + cdr.reset_byte_order (byte_order); + + return true; + } + + // --------------------------------------------------------- + + CORBA::ULong const TYPECODE_INDIRECTION = 0xffffffff; + + // --------------------------------------------------------- + + // Use an ACE::Value_Ptr to provide exception safety and proper + // copying semantics. + typedef ACE::Value_Ptr > union_elem_type; + typedef ACE_Array_Base union_case_array_type; + + // ------------------------------------------------------------ + + /// Demarshal a TypeCode. + bool tc_demarshal (TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TAO::TypeCodeFactory::TC_Info_List & infos); + + /// Demarshal an indirected TypeCode. + bool tc_demarshal_indirection (TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TAO::TypeCodeFactory::TC_Info_List & infos); + + bool find_recursive_tc (char const * id, + CORBA::TypeCode_ptr & tc, + TAO::TypeCodeFactory::TC_Info_List & infos) + { + // See comments above for rationale behind using an array instead + // of a map. + + size_t const len = infos.size (); + + for (size_t i = 0; i < len; ++i) + { + TAO::TypeCodeFactory::TC_Info & info = infos[i]; + + if (ACE_OS::strcmp (info.id, id) == 0) + { + tc = info.type; + return true; + } + } + + return false; + } +} + +bool +TAO::TypeCodeFactory::tc_null_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_null); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_void_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_void); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_short_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_short); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_long_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_long); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_ushort_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_ushort); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_ulong_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_ulong); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_float_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_float); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_double_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_double); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_boolean_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_boolean); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_char_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_char); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_octet_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_octet); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_any_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_any); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_TypeCode_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_TypeCode); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_Principal_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_Principal); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_objref_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + // The remainder of a tk_objref TypeCode is encoded in a CDR + // encapsulation. + if (!start_cdr_encap_extraction (cdr)) + return false; + + // Extract the repository ID and name. + CORBA::String_var id; + if (!(cdr >> TAO_InputCDR::to_string (id.out (), 0))) + return false; + + static char const Object_id[] = "IDL:omg.org/CORBA/Object:1.0"; + static char const CCMObject_id[] = "IDL:omg.org/CORBA/CCMObject:1.0"; + static char const CCMHome_id[] = "IDL:omg.org/CORBA/CCMHome:1.0"; + + char const * tc_constant_id = ""; + + switch (kind) + { + case CORBA::tk_component: + tc_constant_id = CCMObject_id; + break; + case CORBA::tk_home: + tc_constant_id = CCMHome_id; + break; + case CORBA::tk_objref: + tc_constant_id = Object_id; + break; + default: + break; + } + + if (ACE_OS::strcmp (id.in (), // len >= 0!!! + tc_constant_id) == 0) + { + if (!cdr.skip_string ()) // No need to demarshal the name. + return false; + + CORBA::TypeCode_ptr tc_constant = CORBA::TypeCode::_nil (); + switch (kind) + { + case CORBA::tk_component: + tc_constant = CORBA::_tc_Component; + break; + case CORBA::tk_home: + tc_constant = CORBA::_tc_Home; + break; + case CORBA::tk_objref: + tc_constant = CORBA::_tc_Object; + break; + default: + break; + } + + // No need to create a TypeCode. Just use the TypeCode + // constant. + tc = + CORBA::TypeCode::_duplicate (tc_constant); + } + else + { + CORBA::String_var name; + + if (!(cdr >> TAO_InputCDR::to_string (name.out (), 0))) + return false; + + typedef TAO::TypeCode::Objref typecode_type; + + ACE_NEW_RETURN (tc, + typecode_type (kind, + id.in (), + name.in ()), + false); + } + + return true; +} + +bool +TAO::TypeCodeFactory::tc_struct_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos) +{ + ACE_ASSERT (kind == CORBA::tk_struct || kind == CORBA::tk_except); + + // The remainder of a tk_struct/tk_except TypeCode is encoded in + // a CDR encapsulation. + if (!start_cdr_encap_extraction (cdr)) + return false; + + // Extract the repository ID, name and number of fields. + CORBA::String_var id, name; + CORBA::ULong nfields; + + if (!(cdr >> TAO_InputCDR::to_string (id.out (), 0) + && cdr >> TAO_InputCDR::to_string (name.out (), 0) + && cdr >> nfields)) + return false; + + typedef ACE_Array_Base > + member_array_type; + + member_array_type fields (nfields); + + for (CORBA::ULong i = 0; i < nfields; ++i) + { + if (!(cdr >> TAO_InputCDR::to_string (fields[i].name.out (), 0) + && tc_demarshal (cdr, fields[i].type.out (), infos))) + return false; + } + + typedef TAO::TypeCode::Struct< + CORBA::String_var, + CORBA::TypeCode_var, + member_array_type, + TAO::True_RefCount_Policy> typecode_type; + + + // Check if struct TypeCode is recursive. + if (kind == CORBA::tk_struct && find_recursive_tc (id.in (), tc, infos)) + { + // Set remaining parameters. + + typedef TAO::TypeCode::Recursive_Type + recursive_typecode_type; + + recursive_typecode_type * const rtc = + dynamic_cast (tc); + + ACE_ASSERT (rtc); + + rtc->struct_parameters (name.in (), + fields, + nfields); + } + else + { + ACE_NEW_RETURN (tc, + typecode_type (kind, + id.in (), + name.in (), + fields, // Will be copied. + nfields), + false); + } + + return true; +} + +bool +TAO::TypeCodeFactory::tc_union_factory (CORBA::TCKind /* kind */, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos) +{ + // The remainder of a tk_enum TypeCode is encoded in a CDR + // encapsulation. + + if (!start_cdr_encap_extraction (cdr)) + return false; + + // Extract the repository ID, name, discriminant type, default index + // and case count. + CORBA::String_var id, name; + CORBA::TypeCode_var discriminant_type; + CORBA::Long default_index = -1; + CORBA::ULong ncases = 0; // Just 'n case :-) + + if (!(cdr >> TAO_InputCDR::to_string (id.out (), 0) + && cdr >> TAO_InputCDR::to_string (name.out (), 0) + && cdr >> discriminant_type.out ())) // No need to use tc_demarshal() + return false; + + ACE_DECLARE_NEW_CORBA_ENV; + CORBA::TCKind const discriminant_kind = + discriminant_type->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + // Check for valid discriminant type. + if (!(discriminant_kind == CORBA::tk_enum + || discriminant_kind == CORBA::tk_ulong + || discriminant_kind == CORBA::tk_long + || discriminant_kind == CORBA::tk_ushort + || discriminant_kind == CORBA::tk_short + || discriminant_kind == CORBA::tk_char + || discriminant_kind == CORBA::tk_boolean + || discriminant_kind == CORBA::tk_longlong + || discriminant_kind == CORBA::tk_ulonglong)) + return false; + + if (!(cdr >> default_index + && default_index >= -1 + && cdr >> ncases)) + return false; + + typedef union_elem_type elem_type; + typedef union_case_array_type case_array_type; + + case_array_type cases (ncases); + + for (CORBA::ULong i = 0; i < ncases; ++i) + { + elem_type & member = cases[i]; + + TAO::TypeCode::Case * the_case; + + // Ugly. *sigh* + switch (discriminant_kind) + { + case CORBA::tk_enum: // Enumerators are encoded as unsigned longs. + case CORBA::tk_ulong: + { + CORBA::ULong label; + if (!(cdr >> label)) + return false; + + typedef TypeCode::Case_T case_type; + + ACE_NEW_RETURN (the_case, + case_type (label), + false); + } + break; + case CORBA::tk_long: + { + CORBA::Long label; + if (!(cdr >> label)) + return false; + + typedef TypeCode::Case_T case_type; + + ACE_NEW_RETURN (the_case, + case_type (label), + false); + } + break; + case CORBA::tk_ushort: + { + CORBA::UShort label; + if (!(cdr >> label)) + return false; + + typedef TypeCode::Case_T case_type; + + ACE_NEW_RETURN (the_case, + case_type (label), + false); + } + break; + case CORBA::tk_short: + { + CORBA::Short label; + if (!(cdr >> label)) + return false; + + typedef TypeCode::Case_T case_type; + + ACE_NEW_RETURN (the_case, + case_type (label), + false); + } + break; + case CORBA::tk_char: + { + CORBA::Char label; + if (!(cdr >> CORBA::Any::to_char (label))) + return false; + + typedef TypeCode::Case_T case_type; + + ACE_NEW_RETURN (the_case, + case_type (label), + false); + } + break; + case CORBA::tk_boolean: + { + CORBA::Boolean label; + if (!(cdr >> CORBA::Any::to_boolean (label))) + return false; + + typedef TypeCode::Case_T case_type; + + ACE_NEW_RETURN (the_case, + case_type (label), + false); + } + break; + case CORBA::tk_longlong: + { + CORBA::LongLong label; + if (!(cdr >> label)) + return false; + + typedef TypeCode::Case_T case_type; + + ACE_NEW_RETURN (the_case, + case_type (label), + false); + } + break; +#if !defined (ACE_LACKS_LONGLONG_T) + case CORBA::tk_ulonglong: + { + CORBA::ULongLong label; + if (!(cdr >> label)) + return false; + + typedef TypeCode::Case_T case_type; + + ACE_NEW_RETURN (the_case, + case_type (label), + false); + } + break; +#endif /* !ACE_LACKS_LONGLONG_T */ + default: + return false; + } + + elem_type case_value (the_case); + member.swap (case_value); // Exception-safe + + CORBA::String_var the_name; + CORBA::TypeCode_var the_type; + + if (!(cdr >> TAO_InputCDR::to_string (the_name.out (), 0) + && tc_demarshal (cdr, the_type.out (), infos))) + return false; + + member->name (the_name.in ()); + member->type (the_type.in ()); + } + + typedef TAO::TypeCode::Union typecode_type; + + // Check if union TypeCode is recursive. + if (find_recursive_tc (id.in (), tc, infos)) + { + // Set remaining parameters. + + typedef TAO::TypeCode::Recursive_Type + recursive_typecode_type; + + recursive_typecode_type * const rtc = + dynamic_cast (tc); + + ACE_ASSERT (rtc); + + rtc->union_parameters (name.in (), + discriminant_type, + cases, // Will be copied. + ncases, + default_index); + } + else + { + ACE_NEW_RETURN (tc, + typecode_type (id.in (), + name.in (), + discriminant_type, + cases, // Will be copied. + ncases, + default_index), + false); + } + + return true; +} + +bool +TAO::TypeCodeFactory::tc_enum_factory (CORBA::TCKind /* kind */, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + // The remainder of a tk_enum TypeCode is encoded in a CDR + // encapsulation. + + if (!start_cdr_encap_extraction (cdr)) + return false; + + // Extract the repository ID, name and number of fields. + CORBA::String_var id, name; + CORBA::ULong nenumerators; + + if (!(cdr >> TAO_InputCDR::to_string (id.out (), 0) + && cdr >> TAO_InputCDR::to_string (name.out (), 0) + && cdr >> nenumerators)) + return false; + + ACE_Array_Base enumerators (nenumerators); + + for (CORBA::ULong i = 0; i < nenumerators; ++i) + { + if (!(cdr >> TAO_InputCDR::to_string (enumerators[i].out (), 0))) + return false; + } + + typedef TAO::TypeCode::Enum< + CORBA::String_var, + ACE_Array_Base, + TAO::True_RefCount_Policy> typecode_type; + + ACE_NEW_RETURN (tc, + typecode_type (id.in (), + name.in (), + enumerators, // Will be copied. + nenumerators), + false); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_string_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + // A tk_string/tk_wstring TypeCode has a simple parameter list, + // i.e. it is not encoded in a CDR encapsulation. + + CORBA::ULong bound; + if (!(cdr >> bound)) + return false; + + if (bound == 0) + { + // Just use the TypeCode constant. + if (kind == CORBA::tk_string) + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_string); + else if (kind == CORBA::tk_wstring) + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_wstring); + else + return false; + + return true; + } + + typedef TAO::TypeCode::String typecode_type; + + ACE_NEW_RETURN (tc, + typecode_type (kind, bound), + false); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_sequence_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos) +{ + ACE_ASSERT (kind == CORBA::tk_sequence || kind == CORBA::tk_array); + + // The remainder of a tk_sequence TypeCode is encoded in a CDR + // encapsulation. + + if (!start_cdr_encap_extraction (cdr)) + return false; + + // Extract the repository ID, name and content type. + CORBA::TypeCode_var content_type; + CORBA::ULong length; + + if (!(tc_demarshal (cdr, content_type.out (), infos) + && cdr >> length)) + return false; + + typedef TAO::TypeCode::Sequence< + CORBA::TypeCode_var, + TAO::True_RefCount_Policy> typecode_type; + + ACE_NEW_RETURN (tc, + typecode_type (kind, content_type, length), + false); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_array_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos) +{ + return tc_sequence_factory (kind, cdr, tc, infos); +} + +bool +TAO::TypeCodeFactory::tc_alias_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos) +{ + // The remainder of a tk_alias or tk_value_box TypeCode is encoded + // in a CDR encapsulation. + + if (!start_cdr_encap_extraction (cdr)) + return false; + + // Extract the repository ID, name and content type. + CORBA::String_var id, name; + CORBA::TypeCode_var content_type; + if (!(cdr >> TAO_InputCDR::to_string (id.out (), 0) + && cdr >> TAO_InputCDR::to_string (name.out (), 0) + && tc_demarshal (cdr, content_type.out (), infos))) + return false; + + typedef TAO::TypeCode::Alias< + CORBA::String_var, + CORBA::TypeCode_var, + TAO::True_RefCount_Policy> typecode_type; + + ACE_NEW_RETURN (tc, + typecode_type (kind, + id.in (), + name.in (), + content_type), + false); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_except_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos) +{ + return tc_struct_factory (kind, cdr, tc, infos); +} + +bool +TAO::TypeCodeFactory::tc_longlong_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_longlong); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_ulonglong_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_ulonglong); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_longdouble_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_longdouble); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_wchar_factory (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + tc = CORBA::TypeCode::_duplicate (CORBA::_tc_wchar); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_wstring_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos) +{ + return tc_string_factory (kind, cdr, tc, infos); +} + +bool +TAO::TypeCodeFactory::tc_fixed_factory (CORBA::TCKind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List &) +{ + // A tk_fixed TypeCode has a simple parameter list, i.e. it is not + // encoded in a CDR encapsulation. + + CORBA::UShort digits, scale; + if (!(cdr >> digits && cdr >> scale)) + return false; + + typedef TAO::TypeCode::Fixed typecode_type; + + ACE_NEW_RETURN (tc, + typecode_type (digits, scale), + false); + + return true; +} + +bool +TAO::TypeCodeFactory::tc_value_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos) +{ + // The remainder of a tk_value/tk_event TypeCode is encoded in a + // CDR encapsulation + + if (!start_cdr_encap_extraction (cdr)) + return false; + + // Extract the repository ID, name and number of fields. + CORBA::String_var id; + if (!(cdr >> TAO_InputCDR::to_string (id.out (), 0))) + return false; + +// if (ACE_OS::strcmp (id.in (), "IDL:omg.org/CORBA/ValueBase:1.0") == 0) +// { +// // No need to create a TypeCode. Just use the TypeCode +// // constant. +// tc = CORBA::TypeCode::_duplicate (CORBA::_tc_ValueBase); + +// return true; +// } +// else if (ACE_OS::strcmp (id.in (), +// "IDL:omg.org/CORBA/EventBase:1.0") == 0) +// { +// // No need to create a TypeCode. Just use the TypeCode +// // constant. +// tc = CORBA::TypeCode::_duplicate (CORBA::_tc_EventBase); + +// return true; +// } + + CORBA::String_var name; + CORBA::ValueModifier type_modifier; + CORBA::TypeCode_var concrete_base; + CORBA::ULong nfields; + + if (!(cdr >> TAO_InputCDR::to_string (name.out (), 0) + && cdr >> type_modifier + && cdr >> concrete_base.out () + && cdr >> nfields)) + return false; + + typedef ACE_Array_Base > + member_array_type; + + member_array_type fields (nfields); + + for (CORBA::ULong i = 0; i < nfields; ++i) + { + TAO::TypeCode::Value_Field & field = fields[i]; + + if (!(cdr >> TAO_InputCDR::to_string (field.name.out (), 0) + && tc_demarshal (cdr, field.type.out (), infos) + && cdr >> field.visibility)) + return false; + } + + typedef TAO::TypeCode::Value< + CORBA::String_var, + CORBA::TypeCode_var, + member_array_type, + TAO::True_RefCount_Policy> typecode_type; + + // Check if valuetype/eventtype TypeCode is recursive. + if (find_recursive_tc (id.in (), tc, infos)) + { + // Set remaining parameters. + + typedef TAO::TypeCode::Recursive_Type + recursive_typecode_type; + + recursive_typecode_type * const rtc = + dynamic_cast (tc); + + ACE_ASSERT (rtc); + + rtc->valuetype_parameters (name.in (), + type_modifier, + concrete_base, + fields, // Will be copied. + nfields); + } + else + { + ACE_NEW_RETURN (tc, + typecode_type (kind, + id.in (), + name.in (), + type_modifier, + concrete_base, + fields, // Will be copied. + nfields), + false); + } + + return true; +} + +bool +TAO::TypeCodeFactory::tc_value_box_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos) +{ + return tc_alias_factory (kind, cdr, tc, infos); +} + +bool +TAO::TypeCodeFactory::tc_native_factory (CORBA::TCKind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos) +{ + return tc_objref_factory (CORBA::tk_native, cdr, tc, infos); +} + +bool +TAO::TypeCodeFactory::tc_abstract_interface_factory (CORBA::TCKind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos) +{ + return tc_objref_factory (CORBA::tk_abstract_interface, cdr, tc, infos); +} + +bool +TAO::TypeCodeFactory::tc_local_interface_factory (CORBA::TCKind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos) +{ + return tc_objref_factory (CORBA::tk_local_interface, cdr, tc, infos); +} + +bool +TAO::TypeCodeFactory::tc_component_factory (CORBA::TCKind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos) +{ + return tc_objref_factory (CORBA::tk_component, cdr, tc, infos); +} + +bool +TAO::TypeCodeFactory::tc_home_factory (CORBA::TCKind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos) +{ + return tc_objref_factory (CORBA::tk_home, cdr, tc, infos); +} + +bool +TAO::TypeCodeFactory::tc_event_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos) +{ + return tc_value_factory (kind, cdr, tc, infos); +} + +// --------------------------------------------------------------- + +namespace +{ + bool + tc_demarshal (TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TAO::TypeCodeFactory::TC_Info_List & infos) + { + // ULong since we need to detect indirected TypeCodes, too. + + CORBA::ULong kind; + if (!(cdr >> kind) + || (kind >= static_cast (CORBA::TAO_TC_KIND_COUNT) + && kind != TYPECODE_INDIRECTION)) + return false; + + if (kind == TYPECODE_INDIRECTION) + return tc_demarshal_indirection (cdr, tc, infos); + + using namespace TAO::TypeCodeFactory; + + static factory const factory_map[] = + { + tc_null_factory, + tc_void_factory, + tc_short_factory, + tc_long_factory, + tc_ushort_factory, + tc_ulong_factory, + tc_float_factory, + tc_double_factory, + tc_boolean_factory, + tc_char_factory, + tc_octet_factory, + tc_any_factory, + tc_TypeCode_factory, + tc_Principal_factory, + tc_objref_factory, + tc_struct_factory, + tc_union_factory, + tc_enum_factory, + tc_string_factory, + tc_sequence_factory, + tc_array_factory, + tc_alias_factory, + tc_except_factory, + tc_longlong_factory, + tc_ulonglong_factory, + tc_longdouble_factory, + tc_wchar_factory, + tc_wstring_factory, + tc_fixed_factory, + tc_value_factory, + tc_value_box_factory, + tc_native_factory, + tc_abstract_interface_factory, + tc_local_interface_factory, + tc_component_factory, + tc_home_factory, + tc_event_factory + }; + + return factory_map[kind] (static_cast (kind), + cdr, + tc, + infos); + } + + bool + tc_demarshal_indirection (TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TAO::TypeCodeFactory::TC_Info_List & infos) + { + CORBA::Long offset; + + if (!(cdr >> offset) || offset >= -4) + { + // Offsets must be negative since they point back to a + // TypeCode found earlier in the CDR stream. They must be + // less than -4 since an offset of -4 points back to the + // indirection TypeCode itself, meaning that it would be + // self-indirecting. + return false; + } + +// ACE_Message_Block * const mb = +// const_cast (cdr.start ()); + +// TAO_InputCDR indir_stream (mb->rd_ptr () + offset - 4, + TAO_InputCDR indir_stream (cdr.rd_ptr () + offset - sizeof (CORBA::Long), + (-offset) + sizeof (CORBA::Long), + cdr.byte_order ()); + + if (!indir_stream.good_bit ()) + { + return false; + } + + CORBA::TCKind kind; + if (!(indir_stream >> kind) + + // Indirected TypeCode must point to top-level TypeCode. + || static_cast (kind) == TYPECODE_INDIRECTION + + // Only struct, union and valuetype TypeCodes may be recursive. + || !(kind == CORBA::tk_struct + || kind == CORBA::tk_union + || kind == CORBA::tk_value + || kind == CORBA::tk_event) + + // Currently all recursive TypeCodes have complex parameter + // lists, meaning they are encoded as CDR encapsulations. + || !start_cdr_encap_extraction (indir_stream)) + { + return false; + } + + /** + * @todo Recursive TypeCode demarshaling is currently suboptimal + * due to redundant demarshaling of TypeCode parameters, + * such as repository ID, and excessive + * allocations/copying. + */ + + CORBA::String_var id; + if (!(indir_stream >> TAO_InputCDR::to_string (id.out (), 0))) + return false; + + // Don't bother demarshaling the rest of the parameters. They will + // be handled by the top-level TypeCode demarshaling call. + + switch (kind) + { + case CORBA::tk_struct: + { + typedef ACE_Array_Base< + TAO::TypeCode::Struct_Field< + CORBA::String_var, + CORBA::TypeCode_var> > member_array_type; + + typedef TAO::TypeCode::Struct< + CORBA::String_var, + CORBA::TypeCode_var, + member_array_type, + TAO::True_RefCount_Policy> typecode_type; + + typedef TAO::TypeCode::Recursive_Type + recursive_typecode_type; + + ACE_NEW_RETURN (tc, + recursive_typecode_type (kind, + id.in ()), + false); + } + break; + case CORBA::tk_union: + { + typedef union_case_array_type member_array_type; + + typedef TAO::TypeCode::Union< + CORBA::String_var, + CORBA::TypeCode_var, + member_array_type, + TAO::True_RefCount_Policy> typecode_type; + + typedef TAO::TypeCode::Recursive_Type + recursive_typecode_type; + + ACE_NEW_RETURN (tc, + recursive_typecode_type (kind, + id.in ()), + false); + } + break; + case CORBA::tk_value: + case CORBA::tk_event: + { + typedef ACE_Array_Base< + TAO::TypeCode::Value_Field< + CORBA::String_var, + CORBA::TypeCode_var> > member_array_type; + + typedef TAO::TypeCode::Value< + CORBA::String_var, + CORBA::TypeCode_var, + member_array_type, + TAO::True_RefCount_Policy> typecode_type; + + typedef TAO::TypeCode::Recursive_Type + recursive_typecode_type; + + ACE_NEW_RETURN (tc, + recursive_typecode_type (kind, + id.in ()), + false); + } + break; + default: + return false; // We should never get here. + }; + + size_t const old_size = infos.size (); + if (infos.size (old_size + 1) == -1) // Incremental growth -- *sigh* + return false; + + TAO::TypeCodeFactory::TC_Info & info = infos[old_size]; + + ACE_DECLARE_NEW_CORBA_ENV; + info.id = tc->id (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (false); // Should never throw! + + info.type = tc; + + return true; + } +} + +// ---------------------------------------------------------------- + +bool +operator>> (TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc) +{ + TAO::TypeCodeFactory::TC_Info_List infos; + + return tc_demarshal (cdr, tc, infos); +} diff --git a/TAO/tao/AnyTypeCode/TypeCode_CDR_Extraction.h b/TAO/tao/AnyTypeCode/TypeCode_CDR_Extraction.h new file mode 100644 index 00000000000..b7571fbfbf4 --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_CDR_Extraction.h @@ -0,0 +1,196 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file TypeCode_CDR_Extraction.h + * + * $Id$ + * + * Header file for TAO TypeCode CDR extraction operations. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_TYPECODE_CDR_EXTRACTION_H +#define TAO_TYPECODE_CDR_EXTRACTION_H + +#include /**/ "ace/pre.h" + +#include "tao/Typecode_typesC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +template class ACE_Array_Base; + +namespace TAO +{ + namespace TypeCodeFactory + { + struct TC_Info; + typedef ACE_Array_Base TC_Info_List; + + typedef bool (*factory) (CORBA::TCKind, + TAO_InputCDR &, + CORBA::TypeCode_ptr &, + TC_Info_List &); + + bool tc_null_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_void_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_short_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_long_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_ushort_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_ulong_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_float_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_double_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_boolean_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_char_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_octet_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_any_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_TypeCode_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_Principal_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_objref_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_struct_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_union_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_enum_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_string_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_sequence_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_array_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_alias_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_except_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_longlong_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_ulonglong_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_longdouble_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_wchar_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_wstring_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_fixed_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_value_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_value_box_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_native_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_abstract_interface_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_local_interface_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_component_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_home_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + bool tc_event_factory (CORBA::TCKind kind, + TAO_InputCDR & cdr, + CORBA::TypeCode_ptr & tc, + TC_Info_List & infos); + + } // End namespace TypeCodeFactory +} // End namespace TAO + + +#include /**/ "ace/post.h" + +#endif /* TAO_TYPECODE_CDR_EXTRACTION_H */ diff --git a/TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.cpp b/TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.cpp new file mode 100644 index 00000000000..9ed73f48bc8 --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.cpp @@ -0,0 +1,86 @@ +// $Id$ + +#ifndef TAO_TYPECODE_CASE_CPP +#define TAO_TYPECODE_CASE_CPP + +#include "TypeCode_Case_Base_T.h" +#include "ace/OS_NS_string.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/TypeCode_Case_Base_T.inl" +#endif /* __ACE_INLINE__ */ + + +template +TAO::TypeCode::Case::~Case (void) +{ +} + +template +bool +TAO::TypeCode::Case::equal (CORBA::ULong index, + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // Check case names. + char const * const lhs_name = this->name (); + char const * const rhs_name = tc->member_name (index + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (ACE_OS::strcmp (lhs_name, rhs_name) != 0) + return 0; + + // Check case TypeCodes. + CORBA::TypeCode_ptr const lhs_tc = this->type (); + CORBA::TypeCode_var const rhs_tc = + tc->member_type (index + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Boolean const equal_members = + lhs_tc->equal (rhs_tc.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equal_members) + return 0; + + // Check case label. + return this->equal_label (index, + tc + ACE_ENV_ARG_PARAMETER); +} + +template +bool +TAO::TypeCode::Case::equivalent ( + CORBA::ULong index, + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // Member names are ignore when determining equivalence. + + // Check case TypeCodes. + CORBA::TypeCode_ptr const lhs_tc = this->type (); + CORBA::TypeCode_var const rhs_tc = + tc->member_type (index + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Boolean const equivalent_members = + lhs_tc->equivalent (rhs_tc.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equivalent_members) + return 0; + + // Check case label. + // The label must be equal when determining equivalence, too. + return this->equal_label (index, + tc + ACE_ENV_ARG_PARAMETER); +} + +#endif /* TAO_TYPECODE_CASE_CPP */ diff --git a/TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.h b/TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.h new file mode 100644 index 00000000000..2a646e7724a --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.h @@ -0,0 +1,204 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file TypeCode_Case_Base_T.h + * + * $Id$ + * + * Header file for @c TAO::TypeCode::Case type. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_TYPECODE_CASE_H +#define TAO_TYPECODE_CASE_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +namespace CORBA +{ + class TypeCode; + typedef TypeCode* TypeCode_ptr; + + class Any; +} + +namespace TAO +{ + namespace TypeCode + { + + /** + * @class Case + * + * @brief Abstract base class for that represents an IDL @c union + * case/member. + * + * This class hides the actual IDL @c union member label value + * from the @c TAO::TypeCode::Union class by relying on a + * CORBA::Any return value that corresponds to the @c + * CORBA::TypeCode::member_label() return type. It also allows + * the @c TAO::TypeCode::Union class to marshal the member label + * values into a CDR stream without knowledge of the underlying + * member label values. + */ + template + class Case + { + public: + + /// Constructor. + /** + * Constructor used when creating static @c union @c TypeCodes. + */ + Case (char const * name, + TypeCodeType tc); + + /// Constructor. + /** + * Constructor used when creating dynamic @c union @c TypeCodes. + */ + Case (void); + + /// Destructor. + virtual ~Case (void); + + /// Cloning/copying operation. + virtual Case * clone (void) const = 0; + + /// Return the IDL @c union case label value embedded within a + /// @c CORBA::Any. + virtual CORBA::Any * label (ACE_ENV_SINGLE_ARG_DECL) const = 0; + + /// Get the name of the @c union case/member. + char const * name (void) const; + + /// Set the name of the @c union case/member. + void name (char const * the_name); + + /// Get the @c CORBA::TypeCode of the @c union case/member. + /** + * @note The reference count is not manipulated by this method, + * i.e., ownership is retained by this class. + */ + CORBA::TypeCode_ptr type (void) const; + + /// Set the @c CORBA::TypeCode of the @c union case/member. + /** + * @note @c CORBA::TypeCode::_duplicate() is called on the + * @c TypeCode @a tc. + */ + void type (CORBA::TypeCode_ptr tc); + + /// Marshal this IDL @c union member into the given output CDR + /// stream. + bool marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + + /// Check for equality of the @c case attributes contained by this + /// class and the corresponding member attributes at index "@a + /// index" in the given @c TypeCode @a tc. + bool equal (CORBA::ULong index, + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + + /// Check for equivalence of the @c case attributes contained by + /// this class and the corresponding member attributes at index + /// "@a index" in the given @c TypeCode @a tc. + bool equivalent (CORBA::ULong index, + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + + protected: + + /// Marshal the IDL @c union @c case label value into the given + /// output CDR stream. + virtual bool marshal_label (TAO_OutputCDR & cdr) const = 0; + + /// Verify equality of member labels. + /** + * Performing member label equality comparisons in the @c Case + * subclass allows us to avoid performing interpretive + * extraction of the value from the @c Any returned from the + * "right hand side" operand @c TypeCode since the @c Case + * subclass already knows what type and value should be + * extracted from the @c Any. + * + * @param index Member index of given @c TypeCode @a tc being + * tested. + * @param tc The @c TypeCode whose member "@a index" label is + * being tested. + */ + virtual bool equal_label (CORBA::ULong index, + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const = 0; + + private: + + /// The name of the case. + StringType name_; + + /// Pointer to the @c CORBA::TypeCode of the case. + /** + * A pointer to the @c CORBA::TypeCode_ptr rather than the + * @c CORBA::TypeCode_ptr itself is stored since that address is + * well-defined. We may not know the value of the @c + * CORBA::TypeCode_ptr when creating this @c Case statically at + * compile-time, hence the indirection. + * + * @note This @c TypeCode is released upon destruction of this + * @c Case. + */ + TypeCodeType type_; + + }; + + typedef Case Case_Dynamic; + + } // End namespace TypeCode +} // End namespace TAO + + +namespace ACE +{ + /// @see ace/Value_Ptr.h. + template struct VP_traits; + + template <> + struct TAO_AnyTypeCode_Export VP_traits + { + /// Copy the given object. + static TAO::TypeCode::Case_Dynamic * clone ( + TAO::TypeCode::Case_Dynamic const * p) + { + return p->clone (); + } + }; + +} // End namespace ACE namespace. + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/TypeCode_Case_Base_T.inl" +#endif /* __ACE_INLINE__ */ + +#ifdef ACE_TEMPLATES_REQUIRE_SOURCE +# include "tao/AnyTypeCode/TypeCode_Case_Base_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA +# pragma implementation ("TypeCode_Case_Base_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* TAO_TYPECODE_CASE_H */ diff --git a/TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.inl b/TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.inl new file mode 100644 index 00000000000..bf992fde3f3 --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_Case_Base_T.inl @@ -0,0 +1,76 @@ +// -*- C++ -*- +// +// $Id$ + +#include "tao/CDR.h" +#include "tao/AnyTypeCode/TypeCode_Traits.h" + + +template +ACE_INLINE +TAO::TypeCode::Case::Case ( + char const * member_name, + TypeCodeType member_type) + : name_ (member_name) + , type_ (member_type) +{ +} + +template +ACE_INLINE +TAO::TypeCode::Case::Case (void) + : name_ () + , type_ () +{ + // Only used when StringType and TypeCodeType are CORBA::String_var + // and CORBA::TypeCode_var, respectively. +} + +template +ACE_INLINE bool +TAO::TypeCode::Case::marshal ( + TAO_OutputCDR & cdr, + CORBA::ULong offset) const +{ + return + this->marshal_label (cdr) + && (cdr << TAO_OutputCDR::from_string ( + Traits::get_string (this->name_), 0)) + && TAO::TypeCode::marshal (cdr, + Traits::get_typecode (this->type_), + offset + cdr.total_length ()); +} + +template +ACE_INLINE char const * +TAO::TypeCode::Case::name (void) const +{ + return + Traits::get_string (this->name_); +} + +template +ACE_INLINE void +TAO::TypeCode::Case::name ( + char const * the_name) +{ + this->name_ = the_name; +} + +template +ACE_INLINE CORBA::TypeCode_ptr +TAO::TypeCode::Case::type (void) const +{ + return + Traits::get_typecode (this->type_); +} + +template +ACE_INLINE void +TAO::TypeCode::Case::type (CORBA::TypeCode_ptr tc) +{ + // This assignment works since it is only used when TypeCodeType is + // "CORBA::TypeCode_var", not in the "CORBA::TypeCode_ptr const *" + // case. + this->type_ = CORBA::TypeCode::_duplicate (tc); +} diff --git a/TAO/tao/AnyTypeCode/TypeCode_Case_T.cpp b/TAO/tao/AnyTypeCode/TypeCode_Case_T.cpp new file mode 100644 index 00000000000..579f968fd12 --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_Case_T.cpp @@ -0,0 +1,162 @@ +// $Id$ + +#ifndef TAO_TYPECODE_CASE_T_CPP +#define TAO_TYPECODE_CASE_T_CPP + +#include "TypeCode_Case_T.h" + +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/SystemException.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/TypeCode_Case_T.inl" +#endif /* __ACE_INLINE__ */ + + +namespace TAO +{ + namespace TypeCode + { + template + struct Case_Traits + { + inline static T any_from (T v) + { + return v; + } + + inline static T & any_to (T & v) + { + return v; + } + }; + + // Specializations for types that require wrapper for Any + // insertion. Note that we only define specializations for types + // that can be used in an IDL union discriminator. + + template <> + struct Case_Traits + { + inline static CORBA::Any::from_boolean any_from (CORBA::Boolean v) + { + return CORBA::Any::from_boolean (v); + } + + inline static CORBA::Any::to_boolean any_to (CORBA::Boolean & v) + { + return CORBA::Any::to_boolean (v); + } + }; + + template <> + struct Case_Traits + { + inline static CORBA::Any::from_char any_from (CORBA::Char v) + { + return CORBA::Any::from_char (v); + } + + inline static CORBA::Any::to_char any_to (CORBA::Char & v) + { + return CORBA::Any::to_char (v); + } + }; + + } // End TypeCode namespace +} // End TAO namespace + +// ---------------------------------------------------------------- + + +template +TAO::TypeCode::Case * +TAO::TypeCode::Case_T::clone (void) const +{ + Case * p = 0; + + typedef Case_T case_type; + + // The compiler generated memberwise copy constructor is sufficient. + ACE_NEW_RETURN (p, + case_type (*this), + p); + + return p; +} + +template +bool +TAO::TypeCode::Case_T::marshal_label (TAO_OutputCDR & cdr) const +{ + return + (cdr << + TAO::TypeCode::Case_Traits::any_from (this->label_)); +} + +template +bool +TAO::TypeCode::Case_T::equal_label (CORBA::ULong index, + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + CORBA::Any_var const any = tc->member_label (index + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (false); + + // The equality operator == below is guaranteed to be defined for + // the discriminator type since an IDL union discriminator type must + // be any of the following: (1) an integer, (2) a character, (3) a + // boolean, or (4) an enumeration. + + DiscriminatorType tc_label; + if ((any.in () + >>= TAO::TypeCode::Case_Traits::any_to (tc_label)) + && this->label_ == tc_label) + { + return true; + } + + return false; +} + +template +CORBA::Any * +TAO::TypeCode::Case_T::label (ACE_ENV_SINGLE_ARG_DECL) const +{ + CORBA::Any * value; + + ACE_NEW_THROW_EX (value, + CORBA::Any, + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (0); + + CORBA::Any_var safe_value (value); + + *value <<= + TAO::TypeCode::Case_Traits::any_from (this->label_); + + return safe_value._retn (); +} + + +#endif /* TAO_TYPECODE_CASE_T_CPP */ diff --git a/TAO/tao/AnyTypeCode/TypeCode_Case_T.h b/TAO/tao/AnyTypeCode/TypeCode_Case_T.h new file mode 100644 index 00000000000..516127d0054 --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_Case_T.h @@ -0,0 +1,145 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file TypeCode_Case_T.h + * + * $Id$ + * + * Header file for @c TAO::TypeCode::Case_T template. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_TYPECODE_CASE_T_H +#define TAO_TYPECODE_CASE_T_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TypeCode_Case_Base_T.h" + + +namespace TAO +{ + namespace TypeCode + { + /** + * @class Case_T + * + * @brief Representation of an OMG IDL defined @c union @c case. + * + * A @c Case_T contains the corresponding case label value, name and + * pointer to the @c CORBA::TypeCode for a given OMG IDL @c union + * @c case. For + * example, the cases in following OMG IDL @c union: + * + * \code + * union Foo switch (short) + * { + * case 0: + * case 1: short a; + * case 2: long b; + * default: octet c; + * }; + * \endcode + * + * would be represented using the following statically instantiated + * @c TAO::TypeCode::Case_T array: + * + * \code + * typedef TAO::TypeCode::Case_T Foo_Case; + * Foo_Case _tao_cases_Foo[] = + * { + * Foo_Case (0, "a", &CORBA::_tc_short), + * Foo_Case (1, "a", &CORBA::_tc_short), + * Foo_Case (2, "b", &CORBA::_tc_long), + * Foo_Case (0, "c", &CORBA::_tc_octet) + * }; + * \endcode + * + * The @c default index is passed directly to the + * @c TAO::TypeCode::Union constructor. + * + * The template parameter @a DISCRIMINATOR_TYPE is the + * corresponding C++ type for the IDL defined @c union + * discriminator type. For example, a @c union with an IDL @c + * short discriminator will have a corresponding @c CORBA::Short + * C++ type. This template parameter is necessary to allow the + * actual @c case label value to be stored as its actual type, + * which is particularly important when marshaling that value into + * a CDR stream. + * + * The template parameter @a StringType is either @c char @c + * const @c * or @c CORBA::String_var. The latter is only used + * when creating @c CORBA::tk_union @c TypeCode dynamically, such + * as through the TypeCodeFactory. + */ + template + class Case_T : public Case + { + public: + + /// Constructor. + Case_T (DiscriminatorType member_label, + char const * member_name, + TypeCodeType member_type); + + /// Constructor. + /** + * Constructor only used in the dynamically constructed @c union + * @c TypeCode case. + */ + Case_T (DiscriminatorType member_label); + + /** + * @name @c TAO::TypeCode::Case Methods + * + * Methods required by the @c TAO::TypeCode::Case abstract base + * class. + * + * @see @c TAO::TypeCode::Case + */ + //@{ + Case * clone (void) const; + virtual CORBA::Any * label (ACE_ENV_SINGLE_ARG_DECL) const; + virtual bool marshal_label (TAO_OutputCDR & cdr) const; + virtual bool equal_label (CORBA::ULong index, + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + //@} + + private: + + /// IDL @c union case/member label value. + DiscriminatorType const label_; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/TypeCode_Case_T.inl" +#endif /* __ACE_INLINE__ */ + +#ifdef ACE_TEMPLATES_REQUIRE_SOURCE +# include "tao/AnyTypeCode/TypeCode_Case_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA +# pragma implementation ("TypeCode_Case_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include /**/ "ace/post.h" + +#endif /* TAO_TYPECODE_CASE_T_H */ diff --git a/TAO/tao/AnyTypeCode/TypeCode_Case_T.inl b/TAO/tao/AnyTypeCode/TypeCode_Case_T.inl new file mode 100644 index 00000000000..b6ac33bd18e --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_Case_T.inl @@ -0,0 +1,29 @@ +// -*- C++ -*- +// +// $Id$ + +template +ACE_INLINE +TAO::TypeCode::Case_T::Case_T (DiscriminatorType member_label, + char const * member_name, + TypeCodeType member_type) + : Case (member_name, member_type) + , label_ (member_label) +{ +} + +template +ACE_INLINE +TAO::TypeCode::Case_T::Case_T (DiscriminatorType member_label) + : Case () + , label_ (member_label) +{ +} diff --git a/TAO/tao/AnyTypeCode/TypeCode_Constants.cpp b/TAO/tao/AnyTypeCode/TypeCode_Constants.cpp new file mode 100644 index 00000000000..fe6b46d2c1f --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_Constants.cpp @@ -0,0 +1,111 @@ +// $Id$ + + +#include "TypeCode_Constants.h" + + +ACE_RCSID (tao, + TypeCode_Constants, + "$Id$") + + +#include "Null_RefCount_Policy.h" +#include "Empty_Param_TypeCode.h" +#include "Objref_TypeCode_Static.h" +#include "String_TypeCode_Static.h" + + +namespace TAO +{ + namespace TypeCode + { + // Notice that these are all statically instantiated and not + // exported. There CORBA::TypeCode_ptr counterparts are, however, + // exported. + + Empty_Param tc_null (CORBA::tk_null); + Empty_Param tc_void (CORBA::tk_void); + Empty_Param tc_boolean (CORBA::tk_boolean); + Empty_Param tc_char (CORBA::tk_char); + Empty_Param tc_wchar (CORBA::tk_wchar); + Empty_Param tc_short (CORBA::tk_short); + Empty_Param tc_ushort (CORBA::tk_ushort); + Empty_Param tc_long (CORBA::tk_long); + Empty_Param tc_ulong (CORBA::tk_ulong); + Empty_Param tc_longlong (CORBA::tk_longlong); + Empty_Param tc_ulonglong (CORBA::tk_ulonglong); + Empty_Param tc_float (CORBA::tk_float); + Empty_Param tc_double (CORBA::tk_double); + Empty_Param tc_longdouble (CORBA::tk_longdouble); + Empty_Param tc_octet (CORBA::tk_octet); + Empty_Param tc_any (CORBA::tk_any); + Empty_Param tc_TypeCode (CORBA::tk_TypeCode); + Empty_Param tc_Principal (CORBA::tk_Principal); + + // -------------- + + String tc_string (CORBA::tk_string, 0); + String tc_wstring (CORBA::tk_wstring, 0); + + // -------------- + + char const tc_object_id[] = "IDL:omg.org/CORBA/Object:1.0"; + char const tc_object_name[] = "Object"; + Objref tc_Object (CORBA::tk_objref, + tc_object_id, + tc_object_name); + + char const tc_component_id[] = "IDL:omg.org/CORBA/CCMObject:1.0"; + char const tc_component_name[] = "CCMObject"; + Objref tc_Component (CORBA::tk_component, + tc_component_id, + tc_component_name); + + char const tc_home_id[] = "IDL:omg.org/CORBA/CCMHome:1.0"; + char const tc_home_name[] = "CCMHome"; + Objref tc_Home (CORBA::tk_home, + tc_home_id, + tc_home_name); + } // End TypeCode namespace +} // End TAO namespace + +// ------------------------------------------------------------------ +// OMG defined TypeCode constants +// ------------------------------------------------------------------ + +namespace CORBA +{ + // Notice that these are constant TypeCode references/pointers, not + // constant TypeCodes. TypeCodes are effectively read-only since + // all non-static TypeCode operations are const. + + TypeCode_ptr const _tc_null = &TAO::TypeCode::tc_null; + TypeCode_ptr const _tc_void = &TAO::TypeCode::tc_void; + TypeCode_ptr const _tc_boolean = &TAO::TypeCode::tc_boolean; + TypeCode_ptr const _tc_char = &TAO::TypeCode::tc_char; + TypeCode_ptr const _tc_wchar = &TAO::TypeCode::tc_wchar; + TypeCode_ptr const _tc_short = &TAO::TypeCode::tc_short; + TypeCode_ptr const _tc_ushort = &TAO::TypeCode::tc_ushort; + TypeCode_ptr const _tc_long = &TAO::TypeCode::tc_long; + TypeCode_ptr const _tc_ulong = &TAO::TypeCode::tc_ulong; + TypeCode_ptr const _tc_longlong = &TAO::TypeCode::tc_longlong; + TypeCode_ptr const _tc_ulonglong = &TAO::TypeCode::tc_ulonglong; + TypeCode_ptr const _tc_float = &TAO::TypeCode::tc_float; + TypeCode_ptr const _tc_double = &TAO::TypeCode::tc_double; + TypeCode_ptr const _tc_longdouble = &TAO::TypeCode::tc_longdouble; + TypeCode_ptr const _tc_octet = &TAO::TypeCode::tc_octet; + TypeCode_ptr const _tc_any = &TAO::TypeCode::tc_any; + TypeCode_ptr const _tc_TypeCode = &TAO::TypeCode::tc_TypeCode; + TypeCode_ptr const _tc_Principal = &TAO::TypeCode::tc_Principal; + + TypeCode_ptr const _tc_string = &TAO::TypeCode::tc_string; + TypeCode_ptr const _tc_wstring = &TAO::TypeCode::tc_wstring; + + TypeCode_ptr const _tc_Object = &TAO::TypeCode::tc_Object; + TypeCode_ptr const _tc_Component = &TAO::TypeCode::tc_Component; + TypeCode_ptr const _tc_Home = &TAO::TypeCode::tc_Home; + +} diff --git a/TAO/tao/AnyTypeCode/TypeCode_Constants.h b/TAO/tao/AnyTypeCode/TypeCode_Constants.h new file mode 100644 index 00000000000..8b057ace36d --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_Constants.h @@ -0,0 +1,65 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file TypeCode_Constants.h + * + * $Id$ + * + * Declare the @c TypeCode constants available to the ORB and user + * applications. + * + * @author Jeff Parsons + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_TYPECODE_CONSTANTS_H +#define TAO_TYPECODE_CONSTANTS_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" + +namespace CORBA +{ + class TypeCode; + typedef TypeCode * TypeCode_ptr; + + /** + * @name TypeCode Constants + * + * All the TypeCode constants + */ + //@{ + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_null; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_void; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_boolean; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_char; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_wchar; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_short; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_ushort; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_long; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_ulong; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_longlong; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_ulonglong; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_float; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_double; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_longdouble; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_octet; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_any; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_TypeCode; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_Principal; + + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_string; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_wstring; + + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_Object; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_Component; + extern TAO_AnyTypeCode_Export TypeCode_ptr const _tc_Home; + //@} +} + +#include /**/ "ace/post.h" + +#endif /* TAO_TYPECODE_CONSTANTS_H */ diff --git a/TAO/tao/AnyTypeCode/TypeCode_Struct_Field.h b/TAO/tao/AnyTypeCode/TypeCode_Struct_Field.h new file mode 100644 index 00000000000..ad1fb0b35c2 --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_Struct_Field.h @@ -0,0 +1,89 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file TypeCode_Struct_Field.h + * + * $Id$ + * + * Header file for @c TAO::TypeCode::Struct_Field type. + * + * @author Ossama Othman + * @author Carlos O'Ryan + */ +//============================================================================= + +#ifndef TAO_TYPECODE_STRUCT_FIELD_H +#define TAO_TYPECODE_STRUCT_FIELD_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +namespace CORBA +{ + class TypeCode; + typedef TypeCode* TypeCode_ptr; +} + +namespace TAO +{ + namespace TypeCode + { + /** + * @struct Struct_Field + * + * @brief Name/type pair for fields of an OMG IDL defined + * structure or exception. + * + * A @c Struct_Field contains the corresponding name and pointer + * to the @c CORBA::TypeCode for a given OMG IDL defined type. + * For example, the fields in following OMG IDL structure: + * + * \code + * struct Foo + * { + * long the_number; + * string the_string; + * }; + * \endcode + * + * would be represented using the following statically instantiated + * @c TAO::TypeCode::Struct_Field array: + * + * \code + * TAO::TypeCode::Struct_Field _tao_fields_Foo[] = + * { + * { "the_number", &CORBA::_tc_long }, + * { "the_string", &CORBA::_tc_string }, + * }; + * \endcode + * + * The template parameter @a STRING_TYPE is either @c char + * @c const @c * or @c CORBA::String_var. The latter is only used + * when creating @c CORBA::tk_struct or @c CORBA::tk_except + * @c TypeCodes dynamically, such as through the TypeCodeFactory. + */ + template + struct Struct_Field + { + /// The name of the field. + StringType name; + + /// The @c CORBA::TypeCode of the field. + TypeCodeType type; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#include /**/ "ace/post.h" + +#endif /* TAO_TYPECODE_STRUCT_FIELD_H */ diff --git a/TAO/tao/AnyTypeCode/TypeCode_Traits.h b/TAO/tao/AnyTypeCode/TypeCode_Traits.h new file mode 100644 index 00000000000..921f00717e8 --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_Traits.h @@ -0,0 +1,123 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file TypeCode_Traits.h + * + * $Id$ + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_TYPECODE_TRAITS_H +#define TAO_TYPECODE_TRAITS_H + +#include /**/ "ace/pre.h" + +#include "tao/CORBA_String.h" +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +namespace TAO +{ + class Null_RefCount_Policy; + class True_RefCount_Policy; + + namespace TypeCode + { + +// enum Storage { STATIC_TYPECODE, DYNAMIC_TYPECODE }; + +// template struct Traits; + + // ---- + // @@ Work around limitations in MSVC++ 6. + typedef char const * STATIC_TYPECODE; + typedef CORBA::String_var DYNAMIC_TYPECODE; + + template struct Traits; + // ---- + + template<> + struct Traits + { + typedef char const * string_type; + + /** + * A pointer to the @c CORBA::TypeCode_ptr rather than the + * @c CORBA::TypeCode_ptr itself is stored since that address is + * well-defined. We may not know the value of the + * @c CORBA::TypeCode_ptr when creating a static object that + * refers to it, hence the indirection. + */ + typedef CORBA::TypeCode_ptr const * typecode_type; + + typedef TAO::Null_RefCount_Policy refcount_policy_type; + + static char const * get_string (string_type const & str) + { + return str; + } + + static CORBA::TypeCode_ptr get_typecode (typecode_type const & tc) + { + return (tc == 0 ? CORBA::TypeCode::_nil () : *tc); + } + }; + + template<> + struct Traits + { + typedef CORBA::String_var string_type; + typedef CORBA::TypeCode_var typecode_type; + typedef TAO::True_RefCount_Policy refcount_policy_type; + + static char const * get_string (string_type const & str) + { + return str.in (); + } + + static CORBA::TypeCode_ptr get_typecode (typecode_type const & tc) + { + return tc.in (); + } + }; + + // --------------- + + // Traits based on TypeCode type template parameters. + + template<> + struct Traits::typecode_type> + { + typedef Traits::typecode_type typecode_type; + + static CORBA::TypeCode_ptr get_typecode (typecode_type const & tc) + { + return (tc == 0 ? CORBA::TypeCode::_nil () : *tc); + } + }; + + template<> + struct Traits::typecode_type> + { + typedef Traits::typecode_type typecode_type; + + static CORBA::TypeCode_ptr get_typecode (typecode_type const & tc) + { + return tc.in (); + } + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#include /**/ "ace/post.h" + +#endif /* TAO_TYPECODE_TRAITS_H */ diff --git a/TAO/tao/AnyTypeCode/TypeCode_Value_Field.h b/TAO/tao/AnyTypeCode/TypeCode_Value_Field.h new file mode 100644 index 00000000000..7fbfcb20501 --- /dev/null +++ b/TAO/tao/AnyTypeCode/TypeCode_Value_Field.h @@ -0,0 +1,91 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file TypeCode_Value_Field.h + * + * $Id$ + * + * Header file for @c TAO::TypeCode::Value_Field type. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_TYPECODE_VALUE_FIELD_H +#define TAO_TYPECODE_VALUE_FIELD_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +namespace CORBA +{ + class TypeCode; + typedef TypeCode* TypeCode_ptr; +} + +namespace TAO +{ + namespace TypeCode + { + /** + * @struct Value_Field + * + * @brief Name/type/visibility tuple fields of an OMG IDL defined + * @c valuetype or @c eventtype. + * + * A @c Value_Field contains the corresponding name and pointer to the + * @c CORBA::TypeCode for a given OMG IDL defined type. For + * example, the fields in following OMG IDL structure: + * + * \code + * struct Foo + * { + * long the_number; + * string the_string; + * }; + * \endcode + * + * would be represented using the following statically instantiated + * @c TAO::TypeCode::Value_Field array: + * + * \code + * TAO::TypeCode::Value_Field _tao_fields_Foo[] = + * { + * { "the_number", &CORBA::_tc_long }, + * { "the_string", &CORBA::_tc_string }, + * }; + * \endcode + * + * The template parameter @a STRING_TYPE is either @c char + * @c const @c * or @c CORBA::String_var. The latter is only used + * when creating @c CORBA::tk_value or @c CORBA::tk_event + * @c TypeCodes dynamically, such as through the TypeCodeFactory. + */ + template + struct Value_Field + { + /// The name of the field. + StringType name; + + /// The @c CORBA::TypeCode of the field. + TypeCodeType type; + + /// The visibility of the field. + CORBA::Visibility visibility; + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#include /**/ "ace/post.h" + +#endif /* TAO_TYPECODE_VALUE_FIELD_H */ diff --git a/TAO/tao/AnyTypeCode/Typecode_typesA.h b/TAO/tao/AnyTypeCode/Typecode_typesA.h new file mode 100644 index 00000000000..ccc5218c384 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Typecode_typesA.h @@ -0,0 +1,47 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_TYPECODE_TYPESA_H_ +#define _TAO_IDL_ORIG_TYPECODE_TYPESA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/ULongLongSeqA.cpp b/TAO/tao/AnyTypeCode/ULongLongSeqA.cpp new file mode 100644 index 00000000000..fc09ac7bd1b --- /dev/null +++ b/TAO/tao/AnyTypeCode/ULongLongSeqA.cpp @@ -0,0 +1,142 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "ULongLongSeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_ULongLongSeq_GUARD +#define _TAO_TYPECODE_CORBA_ULongLongSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_ULongLongSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_ulonglong, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_ULongLongSeq_0 = + &CORBA_ULongLongSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_ULongLongSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_ULongLongSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/ULongLongSeq:1.0", + "ULongLongSeq", + &TAO::TypeCode::tc_CORBA_ULongLongSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ULongLongSeq = + &_tao_tc_CORBA_ULongLongSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::ULongLongSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::ULongLongSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_ULongLongSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::ULongLongSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::ULongLongSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_ULongLongSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::ULongLongSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::ULongLongSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::ULongLongSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::ULongLongSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_ULongLongSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/ULongLongSeqA.h b/TAO/tao/AnyTypeCode/ULongLongSeqA.h new file mode 100644 index 00000000000..0c764c543e3 --- /dev/null +++ b/TAO/tao/AnyTypeCode/ULongLongSeqA.h @@ -0,0 +1,66 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:754 + +#ifndef _TAO_IDL_ANYTYPECODE_ULONGLONGSEQA_H_ +#define _TAO_IDL_ANYTYPECODE_ULONGLONGSEQA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/ULongLongSeqC.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ULongLongSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::ULongLongSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::ULongLongSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::ULongLongSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::ULongLongSeq *&); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/ULongSeqA.cpp b/TAO/tao/AnyTypeCode/ULongSeqA.cpp new file mode 100644 index 00000000000..f48c8306497 --- /dev/null +++ b/TAO/tao/AnyTypeCode/ULongSeqA.cpp @@ -0,0 +1,142 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "ULongSeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_ULongSeq_GUARD +#define _TAO_TYPECODE_CORBA_ULongSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_ULongSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_ulong, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_ULongSeq_0 = + &CORBA_ULongSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_ULongSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_ULongSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/ULongSeq:1.0", + "ULongSeq", + &TAO::TypeCode::tc_CORBA_ULongSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ULongSeq = + &_tao_tc_CORBA_ULongSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::ULongSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::ULongSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_ULongSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::ULongSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::ULongSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_ULongSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::ULongSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::ULongSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::ULongSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::ULongSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_ULongSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/ULongSeqA.h b/TAO/tao/AnyTypeCode/ULongSeqA.h new file mode 100644 index 00000000000..6d4f4ab8494 --- /dev/null +++ b/TAO/tao/AnyTypeCode/ULongSeqA.h @@ -0,0 +1,66 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:788 + +#ifndef _TAO_IDL_ANYTYPECODE_ULONGSEQA_H_ +#define _TAO_IDL_ANYTYPECODE_ULONGSEQA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/ULongSeqC.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ULongSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::ULongSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::ULongSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::ULongSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::ULongSeq *&); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/UShortSeqA.cpp b/TAO/tao/AnyTypeCode/UShortSeqA.cpp new file mode 100644 index 00000000000..8150d15bef7 --- /dev/null +++ b/TAO/tao/AnyTypeCode/UShortSeqA.cpp @@ -0,0 +1,142 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "UShortSeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_UShortSeq_GUARD +#define _TAO_TYPECODE_CORBA_UShortSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_UShortSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_ushort, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_UShortSeq_0 = + &CORBA_UShortSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_UShortSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_UShortSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/UShortSeq:1.0", + "UShortSeq", + &TAO::TypeCode::tc_CORBA_UShortSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_UShortSeq = + &_tao_tc_CORBA_UShortSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::UShortSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::UShortSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_UShortSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::UShortSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::UShortSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_UShortSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::UShortSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::UShortSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::UShortSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::UShortSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_UShortSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/UShortSeqA.h b/TAO/tao/AnyTypeCode/UShortSeqA.h new file mode 100644 index 00000000000..820b8080424 --- /dev/null +++ b/TAO/tao/AnyTypeCode/UShortSeqA.h @@ -0,0 +1,107 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_USHORTSEQA_H_ +#define _TAO_IDL_ORIG_USHORTSEQA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/UShortSeqC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_UShortSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::UShortSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::UShortSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::UShortSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::UShortSeq *&); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/Union_TypeCode.cpp b/TAO/tao/AnyTypeCode/Union_TypeCode.cpp new file mode 100644 index 00000000000..20c609c44ac --- /dev/null +++ b/TAO/tao/AnyTypeCode/Union_TypeCode.cpp @@ -0,0 +1,439 @@ +// $Id$ + +#ifndef TAO_UNION_TYPECODE_CPP +#define TAO_UNION_TYPECODE_CPP + +#include "Union_TypeCode.h" +#include "TypeCode_Case_Base_T.h" + +#ifndef __ACE_INLINE__ +# include "Union_TypeCode.inl" +#endif /* !__ACE_INLINE__ */ + +#include "tao/SystemException.h" +#include "Any.h" + +#include "ace/Value_Ptr.h" + + +template +bool +TAO::TypeCode::Union::tao_marshal ( + TAO_OutputCDR & cdr, + CORBA::ULong offset) const +{ + // A tk_union TypeCode has a "complex" parameter list type (see + // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of + // the CORBA specification), meaning that it must be marshaled into + // a CDR encapsulation. + + // Create a CDR encapsulation. + TAO_OutputCDR enc; + + bool const success = + (enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.id (), 0)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.name (), 0)) + && marshal (enc, + Traits::get_typecode (this->discriminant_type_), + offset + enc.total_length ()) + && (enc << this->default_index_) + && (enc << this->ncases_); + + if (!success) + return false; + + for (CORBA::ULong i = 0; i < this->ncases_; ++i) + { + case_type const & c = *this->cases_[i]; + + if (!c.marshal (enc, offset + enc.total_length ())) + return false; + } + + return + cdr << static_cast (enc.total_length ()) + && cdr.write_octet_array_mb (enc.begin ()); +} + +template +void +TAO::TypeCode::Union::tao_duplicate (void) +{ + this->RefCountPolicy::add_ref (); +} + +template +void +TAO::TypeCode::Union::tao_release (void) +{ + this->RefCountPolicy::remove_ref (); +} + +template +CORBA::Boolean +TAO::TypeCode::Union::equal_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // These calls shouldn't throw since CORBA::TypeCode::equal() + // verified that the TCKind is the same as our's prior to invoking + // this method, meaning that the CORBA::tk_union TypeCode methods + // are supported. + + CORBA::ULong const tc_count = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Long tc_def = tc->default_index (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_count != this->ncases_ + || tc_def != this->default_index_) + return 0; + + // Check the discriminator type. + CORBA::TypeCode_var tc_discriminator = + tc->discriminator_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Boolean const equal_discriminators = + Traits::get_typecode (this->discriminant_type_)->equal ( + tc_discriminator.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equal_discriminators) + return 0; + + for (CORBA::ULong i = 0; i < this->ncases_; ++i) + { + if (this->default_index_ > -1 + && static_cast (this->default_index_) == i) + { + // Don't bother checking equality of default case label. It + // will always be the zero octet (the CDR encoded value is + // ignored). + continue; + } + + case_type const & lhs_case = *this->cases_[i]; + + bool const equal_case = + lhs_case.equal (i, + tc + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equal_case) + return 0; + } + + return 1; +} + +template +CORBA::Boolean +TAO::TypeCode::Union::equivalent_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // Perform a structural comparison, excluding the name() and + // member_name() operations. + + CORBA::ULong const tc_count = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Long tc_def = tc->default_index (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_count != this->ncases_ + || tc_def != this->default_index_) + return 0; + + CORBA::TypeCode_var tc_discriminator = + tc->discriminator_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Boolean const equiv_discriminators = + Traits::get_typecode (this->discriminant_type_)->equivalent ( + tc_discriminator.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equiv_discriminators) + return 0; + + for (CORBA::ULong i = 0; i < this->ncases_; ++i) + { + if (this->default_index_ > -1 + && static_cast (this->default_index_) == i) + { + // Don't bother checking equality/equivalence of default + // case label. It will always be the zero octet (the CDR + // encoded value is ignored). + continue; + } + + case_type const & lhs_case = *this->cases_[i]; + + bool const equivalent_case = + lhs_case.equivalent (i, + tc + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equivalent_case) + return 0; + } + + return 1; +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::Union::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const +{ +// typedef ACE::Value_Ptr > elem_type; + +// ACE_Array_Base tc_cases (this->ncases_); + +// if (this->ncases_ > 0) +// { +// // Dynamically construct a new array of cases stripped of +// // member names. + +// static char const empty_name[] = ""; + +// for (CORBA::ULong i = 0; i < this->ncases_; ++i) +// { +// // Member names will be stripped, i.e. not embedded within +// // the compact TypeCode. +// tc_cases[i].name = empty_name; +// tc_cases[i].type = +// this->cases_[i]->type ()->get_compact_typecode ( +// ACE_ENV_ARG_PARAMETER); +// ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); +// } +// } + +// // Create the compact union TypeCode. +// TAO_TypeCodeFactory_Adapter * adapter = +// ACE_Dynamic_Service::instance ( +// TAO_ORB_Core::typecodefactory_adapter_name ()); + +// if (adapter == 0) +// { +// ACE_THROW_RETURN (CORBA::INTERNAL (), +// CORBA::TypeCode::_nil ()); +// } + +// return +// adapter->create_union_tc ( +// this->base_attributes_.id (), +// "", /* empty name */ +// Traits::get_typecode (this->discriminant_type_), +// tc_cases, +// this->ncases_, +// this->default_index_, +// "", +// Traits::get_typecode (this->default_case_.type) +// ACE_ENV_ARG_PARAMETER); +// ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); + + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CORBA::TypeCode::_nil ()); +} + +template +char const * +TAO::TypeCode::Union::id_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.id (); +} + +template +char const * +TAO::TypeCode::Union::name_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.name (); +} + +template +CORBA::ULong +TAO::TypeCode::Union::member_count_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->ncases_; +} + +template +char const * +TAO::TypeCode::Union::member_name_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + if (index >= this->ncases_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), 0); + + return this->cases_[index]->name (); +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::Union::member_type_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + if (index >= this->ncases_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), + CORBA::TypeCode::_nil ()); + + return CORBA::TypeCode::_duplicate (this->cases_[index]->type ()); +} + +template +CORBA::Any * +TAO::TypeCode::Union::member_label_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + if (index >= this->ncases_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), + 0); + + // Default case. + if (this->default_index_ > -1 + && static_cast (this->default_index_) == index) + { + CORBA::Any * any; + ACE_NEW_THROW_EX (any, + CORBA::Any, + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (0); + + CORBA::Any_var safe_any (any); + + // Default case's label is a zero octet. + CORBA::Any::from_octet const zero_octet (0); + + // Default case/member has a zero octet label value. + (*any) <<= zero_octet; + + return safe_any._retn (); + } + + // Non-default cases. + return this->cases_[index]->label (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::Union::discriminator_type_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return + CORBA::TypeCode::_duplicate ( + Traits::get_typecode (this->discriminant_type_)); +} + +template +CORBA::Long +TAO::TypeCode::Union::default_index_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->default_index_; +} + +#endif /* TAO_UNION_TYPECODE_CPP */ diff --git a/TAO/tao/AnyTypeCode/Union_TypeCode.h b/TAO/tao/AnyTypeCode/Union_TypeCode.h new file mode 100644 index 00000000000..92117ba92fd --- /dev/null +++ b/TAO/tao/AnyTypeCode/Union_TypeCode.h @@ -0,0 +1,179 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Union_TypeCode.h + * + * $Id$ + * + * Header file for a @c tk_union CORBA::TypeCode. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_UNION_TYPECODE_H +#define TAO_UNION_TYPECODE_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TypeCode_Base_Attributes.h" + + +namespace TAO +{ + namespace TypeCode + { + + /** + * @class Union + * + * @brief @c CORBA::TypeCode implementation for an OMG IDL + * @c union. + * + * This class implements a @c CORBA::TypeCode for an OMG IDL + * @c union. + */ + template + class Union + : public CORBA::TypeCode, + private RefCountPolicy + { + public: + + /// @typedef Type of individual case array element, not the + /// array itself. + typedef TAO::TypeCode::Case case_type; + + /// Constructor. + Union (char const * id, + char const * name, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + // Borland C++ currently can't handle a reference to + // const pointer to const CORBA::TypeCode_ptr + TypeCodeType discriminant_type, +#else + TypeCodeType const & discriminant_type, +#endif + CaseArrayType const & cases, + CORBA::ULong ncases, + CORBA::Long default_index); + + /// Constructor used for recursive TypeCodes. + Union (CORBA::TCKind kind, + char const * id); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c tk_union @c CORBA::TypeCode -specific template methods. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * name_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::ULong member_count_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * member_name_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr member_type_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + virtual CORBA::Any * member_label_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr discriminator_type_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::Long default_index_i (ACE_ENV_SINGLE_ARG_DECL) const; + //@} + + protected: + + /** + * @c Union Attributes + * + * Attributes representing the structure of an OMG IDL + * @c union. + * + * @note These attributes are declared in the order in which + * they are marshaled into a CDR stream in order to + * increase cache hits by improving spatial locality. + */ + //@{ + + /// Base attributes containing repository ID and name of + /// union type. + Base_Attributes base_attributes_; + + /// Type of IDL @c union discriminant. + TypeCodeType discriminant_type_; + + /// Index of the default union case. + /** + * This value will be -1 if no default case is found in the + * union. + */ + CORBA::Long default_index_; + + /// The number of cases in the OMG IDL union, excluding the + /// @c default case. + CORBA::ULong ncases_; + + /// Array of @c TAO::TypeCode::Case representing structure of + /// the OMG IDL defined @c union. + CaseArrayType cases_; + + //@} + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/Union_TypeCode.inl" +#endif /* __ACE_INLINE__ */ + +#ifdef ACE_TEMPLATES_REQUIRE_SOURCE +# include "tao/AnyTypeCode/Union_TypeCode.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA +# pragma implementation ("Union_TypeCode.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + + +#include /**/ "ace/post.h" + +#endif /* TAO_UNION_TYPECODE_H */ diff --git a/TAO/tao/AnyTypeCode/Union_TypeCode.inl b/TAO/tao/AnyTypeCode/Union_TypeCode.inl new file mode 100644 index 00000000000..84dfb32fa0b --- /dev/null +++ b/TAO/tao/AnyTypeCode/Union_TypeCode.inl @@ -0,0 +1,55 @@ +// -*- C++ -*- +// +// $Id$ + +template +ACE_INLINE +TAO::TypeCode::Union::Union ( + char const * id, + char const * name, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + // Borland C++ currently can't handle a reference to + // const pointer to const CORBA::TypeCode_ptr + TypeCodeType discriminant_type, +#else + TypeCodeType const & discriminant_type, +#endif + CaseArrayType const & cases, + CORBA::ULong ncases, + CORBA::Long default_index) + : CORBA::TypeCode (CORBA::tk_union) + , RefCountPolicy () + , base_attributes_ (id, name) + , discriminant_type_ (discriminant_type) + , default_index_ (default_index) + , ncases_ (ncases) + , cases_ (cases) +{ +} + +template +ACE_INLINE +TAO::TypeCode::Union::Union ( + CORBA::TCKind, + char const * id) + : CORBA::TypeCode (CORBA::tk_union) + , RefCountPolicy () + , base_attributes_ (id) + , discriminant_type_ (0) + , default_index_ (-1) + , ncases_ (0) + , cases_ () +{ +} diff --git a/TAO/tao/AnyTypeCode/Union_TypeCode_Static.cpp b/TAO/tao/AnyTypeCode/Union_TypeCode_Static.cpp new file mode 100644 index 00000000000..61b03381d19 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Union_TypeCode_Static.cpp @@ -0,0 +1,400 @@ +// $Id$ + +#include "tao/AnyTypeCode/Union_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Case_Base_T.h" +#include "tao/AnyTypeCode/Any.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/Union_TypeCode_Static.inl" +#endif /* !__ACE_INLINE__ */ + +#include "tao/SystemException.h" + +#include "ace/Value_Ptr.h" + + +ACE_RCSID (tao, + Union_TypeCode_Static, + "$Id$") + + +bool +TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy>::tao_marshal ( + TAO_OutputCDR & cdr, + CORBA::ULong offset) const +{ + // A tk_union TypeCode has a "complex" parameter list type (see + // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of + // the CORBA specification), meaning that it must be marshaled into + // a CDR encapsulation. + + // Create a CDR encapsulation. + TAO_OutputCDR enc; + + bool const success = + (enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.id (), 0)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.name (), 0)) + && marshal (enc, + Traits::get_typecode (this->discriminant_type_), + offset + enc.total_length ()) + && (enc << this->default_index_) + && (enc << this->ncases_); + + if (!success) + return false; + + // Note that we handle the default case below, too. + + for (unsigned int i = 0; i < this->ncases_; ++i) + { + case_type const & c = *this->cases_[i]; + + if (!c.marshal (enc, offset + enc.total_length ())) + return false; + } + + return + cdr << static_cast (enc.total_length ()) + && cdr.write_octet_array_mb (enc.begin ()); +} + +void +TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy>::tao_duplicate (void) +{ +} + +void +TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy>::tao_release (void) +{ +} + +CORBA::Boolean +TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy>::equal_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // These calls shouldn't throw since CORBA::TypeCode::equal() + // verified that the TCKind is the same as our's prior to invoking + // this method, meaning that the CORBA::tk_union TypeCode methods + // are supported. + + CORBA::ULong const tc_count = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Long tc_def = tc->default_index (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_count != this->ncases_ + || tc_def != this->default_index_) + return 0; + + // Check the discriminator type. + CORBA::TypeCode_var tc_discriminator = + tc->discriminator_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Boolean const equal_discriminators = + Traits::get_typecode (this->discriminant_type_)->equal ( + tc_discriminator.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equal_discriminators) + return 0; + + for (CORBA::ULong i = 0; i < this->ncases_; ++i) + { + if (this->default_index_ > -1 + && static_cast (this->default_index_) == i) + { + // Don't bother checking equality of default case label. It + // will always be the zero octet (the CDR encoded value is + // ignored). + continue; + } + + case_type const & lhs_case = *this->cases_[i]; + + bool const equal_case = + lhs_case.equal (i, + tc + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equal_case) + return 0; + } + + return 1; +} + +CORBA::Boolean +TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy>::equivalent_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // Perform a structural comparison, excluding the name() and + // member_name() operations. + + CORBA::ULong const tc_count = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Long tc_def = tc->default_index (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_count != this->ncases_ + || tc_def != this->default_index_) + return 0; + + CORBA::TypeCode_var tc_discriminator = + tc->discriminator_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Boolean const equiv_discriminators = + Traits::get_typecode (this->discriminant_type_)->equivalent ( + tc_discriminator.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equiv_discriminators) + return 0; + + for (CORBA::ULong i = 0; i < this->ncases_; ++i) + { + if (this->default_index_ > -1 + && static_cast (this->default_index_) == i) + { + // Don't bother checking equality/equivalence of default + // case label. It will always be the zero octet (the CDR + // encoded value is ignored). + continue; + } + + case_type const & lhs_case = *this->cases_[i]; + + bool const equivalent_case = + lhs_case.equivalent (i, + tc + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equivalent_case) + return 0; + } + + return 1; +} + +CORBA::TypeCode_ptr +TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy>::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const +{ +// typedef ACE::Value_Ptr > elem_type; + +// ACE_Array_Base tc_cases (this->ncases_); + +// if (this->ncases_ > 0) +// { +// // Dynamically construct a new array of cases stripped of +// // member names. + +// static char const empty_name[] = ""; + +// for (CORBA::ULong i = 0; i < this->ncases_; ++i) +// { +// // Member names will be stripped, i.e. not embedded within +// // the compact TypeCode. +// tc_cases[i].name = empty_name; +// tc_cases[i].type = +// this->cases_[i]->type ()->get_compact_typecode ( +// ACE_ENV_ARG_PARAMETER); +// ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); +// } +// } + +// // Create the compact union TypeCode. +// TAO_TypeCodeFactory_Adapter * adapter = +// ACE_Dynamic_Service::instance ( +// TAO_ORB_Core::typecodefactory_adapter_name ()); + +// if (adapter == 0) +// { +// ACE_THROW_RETURN (CORBA::INTERNAL (), +// CORBA::TypeCode::_nil ()); +// } + +// return +// adapter->create_union_tc ( +// this->base_attributes_.id (), +// "", /* empty name */ +// Traits::get_typecode (this->discriminant_type_), +// tc_cases, +// this->ncases_, +// this->default_index_, +// "", +// Traits::get_typecode (this->default_case_.type) +// ACE_ENV_ARG_PARAMETER); +// ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); + + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CORBA::TypeCode::_nil ()); +} + +char const * +TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy>::id_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.id (); +} + +char const * +TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy>::name_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.name (); +} + +CORBA::ULong +TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy>::member_count_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->ncases_; +} + +char const * +TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy>::member_name_i ( + CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + if (index >= this->ncases_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), 0); + + return this->cases_[index]->name (); +} + +CORBA::TypeCode_ptr +TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy>::member_type_i ( + CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + if (index >= this->ncases_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), + CORBA::TypeCode::_nil ()); + + return CORBA::TypeCode::_duplicate (this->cases_[index]->type ()); +} + +CORBA::Any * +TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy>::member_label_i ( + CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + if (index >= this->ncases_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), + 0); + + // Default case. + if (this->default_index_ > -1 + && static_cast (this->default_index_) == index) + { + CORBA::Any * any = 0; + ACE_NEW_THROW_EX (any, + CORBA::Any, + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (0); + + CORBA::Any_var safe_any (any); + + // Default case's label is a zero octet. + CORBA::Any::from_octet const zero_octet (0); + + // Default case/member has a zero octet label value. + (*any) <<= zero_octet; + + return safe_any._retn (); + } + + // Non-default cases. + return this->cases_[index]->label (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +CORBA::TypeCode_ptr +TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy>::discriminator_type_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return + CORBA::TypeCode::_duplicate ( + Traits::get_typecode (this->discriminant_type_)); +} + +CORBA::Long +TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy>::default_index_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->default_index_; +} diff --git a/TAO/tao/AnyTypeCode/Union_TypeCode_Static.h b/TAO/tao/AnyTypeCode/Union_TypeCode_Static.h new file mode 100644 index 00000000000..0d85b32eb3a --- /dev/null +++ b/TAO/tao/AnyTypeCode/Union_TypeCode_Static.h @@ -0,0 +1,169 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Union_TypeCode_Static.h + * + * $Id$ + * + * Header file for a static @c tk_union CORBA::TypeCode. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_UNION_TYPECODE_STATIC_H +#define TAO_UNION_TYPECODE_STATIC_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TypeCode_Base_Attributes.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" + + +namespace TAO +{ + namespace TypeCode + { + template class Union; + template class Case; + /** + * @class Union + * + * @brief @c CORBA::TypeCode implementation for an OMG IDL + * @c union. + * + * This class implements a @c CORBA::TypeCode for an OMG IDL + * @c union. + */ + template<> + class TAO_AnyTypeCode_Export Union const * const *, + TAO::Null_RefCount_Policy> + : public CORBA::TypeCode, + private TAO::Null_RefCount_Policy + { + public: + + /// @typedef Type of individual case array element, not the + /// array itself. + typedef TAO::TypeCode::Case case_type; + + /// Constructor. + Union (char const * id, + char const * name, + CORBA::TypeCode_ptr const * discriminant_type, + Case const * const * cases, + CORBA::ULong ncases, + CORBA::Long default_index); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c tk_union @c CORBA::TypeCode -specific template methods. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * name_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::ULong member_count_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * member_name_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr member_type_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + virtual CORBA::Any * member_label_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr discriminator_type_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::Long default_index_i (ACE_ENV_SINGLE_ARG_DECL) const; + //@} + + private: + + /** + * @c Union Attributes + * + * Attributes representing the structure of an OMG IDL + * @c union. + * + * @note These attributes are declared in the order in which + * they are marshaled into a CDR stream in order to + * increase cache hits by improving spatial locality. + */ + //@{ + + /// Base attributes containing repository ID and name of + /// union type. + Base_Attributes const base_attributes_; + + /// Type of IDL @c union discriminant. + CORBA::TypeCode_ptr const * const discriminant_type_; + + /// Index of the default union case. + /** + * This value will be -1 if no default case is found in the + * union. + */ + CORBA::Long const default_index_; + + /// The number of cases in the OMG IDL union, excluding the + /// @c default case. + CORBA::ULong const ncases_; + + /// Array of @c TAO::TypeCode::Case representing structure of + /// the OMG IDL defined @c union. + Case const * const * const cases_; + + //@} + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/Union_TypeCode_Static.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* TAO_UNION_TYPECODE_STATIC_H */ diff --git a/TAO/tao/AnyTypeCode/Union_TypeCode_Static.inl b/TAO/tao/AnyTypeCode/Union_TypeCode_Static.inl new file mode 100644 index 00000000000..019a8ba2a2f --- /dev/null +++ b/TAO/tao/AnyTypeCode/Union_TypeCode_Static.inl @@ -0,0 +1,25 @@ +// -*- C++ -*- +// +// $Id$ + +ACE_INLINE +TAO::TypeCode::Union const * const *, + TAO::Null_RefCount_Policy>::Union ( + char const * id, + char const * name, + CORBA::TypeCode_ptr const * discriminant_type, + Case const * const * cases, + CORBA::ULong ncases, + CORBA::Long default_index) + : CORBA::TypeCode (CORBA::tk_union) + , ACE_NESTED_CLASS (TAO, Null_RefCount_Policy) () + , base_attributes_ (id, name) + , discriminant_type_ (discriminant_type) + , default_index_ (default_index) + , ncases_ (ncases) + , cases_ (cases) +{ +} diff --git a/TAO/tao/AnyTypeCode/ValueModifier.pidl b/TAO/tao/AnyTypeCode/ValueModifier.pidl new file mode 100644 index 00000000000..4cd346c5049 --- /dev/null +++ b/TAO/tao/AnyTypeCode/ValueModifier.pidl @@ -0,0 +1,36 @@ +// -*- IDL -*- + +// ================================================================ +/** + * @file ValueModifier.pidl + * + * $Id$ + * + * This file was used to generate the code in ValueModifierC.* The command + * used to generate code is: + * + * tao_idl + * -o orig -Ge 1 -Sc -SS -Sci -St + * -Wb,export_macro=TAO_Export + * -Wb,export_include="tao/TAO_Export.h" + * -Wb,pre_include="ace/pre.h" + * -Wb,post_include="ace/post.h" + * ValueModifier.pidl + */ +// ================================================================ + +#ifndef TAO_VALUEMODIFIER_PIDL +#define TAO_VALUEMODIFIER_PIDL + +#pragma prefix "omg.org" + +module CORBA +{ + typedef short ValueModifier; + const ValueModifier VM_NONE = 0; + const ValueModifier VM_CUSTOM = 1; + const ValueModifier VM_ABSTRACT = 2; + const ValueModifier VM_TRUNCATABLE = 3; +}; + +#endif /* TAO_VALUEMODIFIER_PIDL */ diff --git a/TAO/tao/AnyTypeCode/ValueModifierA.cpp b/TAO/tao/AnyTypeCode/ValueModifierA.cpp new file mode 100644 index 00000000000..0a93f94dc26 --- /dev/null +++ b/TAO/tao/AnyTypeCode/ValueModifierA.cpp @@ -0,0 +1,54 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "ValueModifierA.h" + +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_CORBA_ValueModifier ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/ValueModifier:1.0", + "ValueModifier", + &CORBA::_tc_short); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ValueModifier = + &_tao_tc_CORBA_ValueModifier; +} + + diff --git a/TAO/tao/AnyTypeCode/ValueModifierA.h b/TAO/tao/AnyTypeCode/ValueModifierA.h new file mode 100644 index 00000000000..056c927ee4c --- /dev/null +++ b/TAO/tao/AnyTypeCode/ValueModifierA.h @@ -0,0 +1,94 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_VALUEMODIFIERA_H_ +#define _TAO_IDL_ORIG_VALUEMODIFIERA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/AnyTypeCode/ValueModifierC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/ValueModifierC.cpp b/TAO/tao/AnyTypeCode/ValueModifierC.cpp new file mode 100644 index 00000000000..76644c8b3c0 --- /dev/null +++ b/TAO/tao/AnyTypeCode/ValueModifierC.cpp @@ -0,0 +1,46 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:291 + + +#include "ValueModifierC.h" +#include "tao/CDR.h" + +#if defined (__BORLANDC__) +#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_arg_traits.cpp:70 + +// Arg traits specializations. +namespace TAO +{ +} + diff --git a/TAO/tao/AnyTypeCode/ValueModifierC.h b/TAO/tao/AnyTypeCode/ValueModifierC.h new file mode 100644 index 00000000000..2bfe5a25b4e --- /dev/null +++ b/TAO/tao/AnyTypeCode/ValueModifierC.h @@ -0,0 +1,121 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_VALUEMODIFIERC_H_ +#define _TAO_IDL_ORIG_VALUEMODIFIERC_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/TAO_Export.h" +#include "tao/ORB.h" +#include "tao/Environment.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typedef/typedef_ch.cpp:379 + + typedef CORBA::Short ValueModifier; + typedef CORBA::Short_out ValueModifier_out; + + // TAO_IDL - Generated from + // be\be_visitor_constant/constant_ch.cpp:52 + + const CORBA::ValueModifier VM_NONE = 0; + + // TAO_IDL - Generated from + // be\be_visitor_constant/constant_ch.cpp:52 + + const CORBA::ValueModifier VM_CUSTOM = 1; + + // TAO_IDL - Generated from + // be\be_visitor_constant/constant_ch.cpp:52 + + const CORBA::ValueModifier VM_ABSTRACT = 2; + + // TAO_IDL - Generated from + // be\be_visitor_constant/constant_ch.cpp:52 + + const CORBA::ValueModifier VM_TRUNCATABLE = 3; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/ValueModifierS.h b/TAO/tao/AnyTypeCode/ValueModifierS.h new file mode 100644 index 00000000000..17b1360599e --- /dev/null +++ b/TAO/tao/AnyTypeCode/ValueModifierS.h @@ -0,0 +1,28 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// Skeleton file generation suppressed with command line option -SS diff --git a/TAO/tao/AnyTypeCode/Value_TypeCode.cpp b/TAO/tao/AnyTypeCode/Value_TypeCode.cpp new file mode 100644 index 00000000000..4be37413b75 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Value_TypeCode.cpp @@ -0,0 +1,463 @@ +// $Id$ + +#ifndef TAO_VALUE_TYPECODE_CPP +#define TAO_VALUE_TYPECODE_CPP + +#include "tao/AnyTypeCode/Value_TypeCode.h" +#include "tao/AnyTypeCode/TypeCode_Value_Field.h" +#include "tao/CDR.h" + +#include "tao/ORB_Core.h" +#include "tao/TypeCodeFactory_Adapter.h" + +#include "ace/Dynamic_Service.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/Value_TypeCode.inl" +#endif /* !__ACE_INLINE__ */ + + +template +bool +TAO::TypeCode::Value::tao_marshal ( + TAO_OutputCDR & cdr, + CORBA::ULong offset) const +{ + // A tk_value TypeCode has a "complex" parameter list type (see + // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of + // the CORBA specification), meaning that it must be marshaled into + // a CDR encapsulation. + + // Create a CDR encapsulation. + TAO_OutputCDR enc; + + // Account for the encoded CDR encapsulation length and byte order. + // + // Aligning on an octet since the next value after the CDR + // encapsulation length will always be the byte order octet/boolean + // in this case. + offset = ACE_align_binary (offset + 4, + ACE_CDR::OCTET_ALIGN); + + bool const success = + (enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.id (), 0)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.name (), 0)) + && (enc << this->type_modifier_) + && marshal (enc, + Traits::get_typecode (this->concrete_base_), + offset + enc.total_length ()) + && (enc << this->nfields_); + + if (!success) + return false; + + Value_Field const * const begin = + &this->fields_[0]; + Value_Field const * const end = + begin + this->nfields_; + + for (Value_Field const * i = begin; i != end; ++i) + { + Value_Field const & field = *i; + + if (!(enc << Traits::get_string (field.name)) + || !marshal (enc, + Traits::get_typecode (field.type), + offset + enc.total_length ()) + || !(enc << field.visibility)) + return false; + } + + return + cdr << static_cast (enc.total_length ()) + && cdr.write_octet_array_mb (enc.begin ()); +} + +template +void +TAO::TypeCode::Value::tao_duplicate (void) +{ + this->RefCountPolicy::add_ref (); +} + +template +void +TAO::TypeCode::Value::tao_release (void) +{ + this->RefCountPolicy::remove_ref (); +} + +template +CORBA::Boolean +TAO::TypeCode::Value::equal_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // None of these calls should throw since CORBA::TypeCode::equal() + // verified that the TCKind is the same as our's prior to invoking + // this method. + + CORBA::ValueModifier const tc_type_modifier = + tc->type_modifier (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_type_modifier != this->type_modifier_) + return 0; + + CORBA::TypeCode_var rhs_concrete_base_type = + tc->concrete_base_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Boolean const equal_concrete_base_types = + this->equal (rhs_concrete_base_type.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equal_concrete_base_types) + return 0; + + CORBA::ULong const tc_nfields = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_nfields != this->nfields_) + return 0; + + for (CORBA::ULong i = 0; i < this->nfields_; ++i) + { + Value_Field const & lhs_field = + this->fields_[i]; + + CORBA::Visibility const lhs_visibility = lhs_field.visibility; + CORBA::Visibility const rhs_visibility = + tc->member_visibility (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (lhs_visibility != rhs_visibility) + return 0; + + char const * const lhs_name = + Traits::get_string (lhs_field.name);; + char const * const rhs_name = tc->member_name (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (ACE_OS::strcmp (lhs_name, rhs_name) != 0) + return 0; + + CORBA::TypeCode_ptr const lhs_tc = + Traits::get_typecode (lhs_field.type); + CORBA::TypeCode_var const rhs_tc = + tc->member_type (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Boolean const equal_members = + lhs_tc->equal (rhs_tc.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equal_members) + return 0; + } + + return 1; +} + +template +CORBA::Boolean +TAO::TypeCode::Value::equivalent_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + CORBA::ValueModifier const tc_type_modifier = + tc->type_modifier (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_type_modifier != this->type_modifier_) + return 0; + + CORBA::TypeCode_var rhs_concrete_base_type = + tc->concrete_base_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Boolean const equivalent_concrete_base_types = + this->equivalent (rhs_concrete_base_type.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equivalent_concrete_base_types) + return 0; + + // Perform a structural comparison, excluding the name() and + // member_name() operations. + + CORBA::ULong const tc_nfields = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_nfields != this->nfields_) + return 0; + + for (CORBA::ULong i = 0; i < this->nfields_; ++i) + { + Value_Field const & lhs_field = + this->fields_[i]; + + CORBA::Visibility const lhs_visibility = + lhs_field.visibility; + CORBA::Visibility const rhs_visibility = + tc->member_visibility (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (lhs_visibility != rhs_visibility) + return 0; + + CORBA::TypeCode_ptr const lhs_tc = + Traits::get_typecode (lhs_field.type); + CORBA::TypeCode_var const rhs_tc = + tc->member_type (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Boolean const equiv_types = + lhs_tc->equivalent (rhs_tc.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equiv_types) + return 0; + } + + return 1; +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::Value::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_Array_Base > + tc_fields (this->nfields_); + + if (this->nfields_ > 0) + { + // Dynamically construct a new array of fields stripped of + // member names. + + static char const empty_name[] = ""; + + for (CORBA::ULong i = 0; i < this->nfields_; ++i) + { + // Member names will be stripped, i.e. not embedded within + // the compact TypeCode. + + tc_fields[i].name = empty_name; + tc_fields[i].type = + Traits::get_typecode ( + this->fields_[i].type)->get_compact_typecode ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); + tc_fields[i].visibility = this->fields_[i].visibility; + } + } + + TAO_TypeCodeFactory_Adapter * const adapter = + ACE_Dynamic_Service::instance ( + TAO_ORB_Core::typecodefactory_adapter_name ()); + + if (adapter == 0) + { + ACE_THROW_RETURN (CORBA::INTERNAL (), + CORBA::TypeCode::_nil ()); + } + + return + adapter->create_value_event_tc ( + this->kind_, + this->base_attributes_.id (), + "", // empty name + this->type_modifier_, + Traits::get_typecode (this->concrete_base_), + tc_fields, + this->nfields_ + ACE_ENV_ARG_PARAMETER); +} + +template +char const * +TAO::TypeCode::Value::id_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.id (); +} + +template +char const * +TAO::TypeCode::Value::name_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.name (); +} + +template +CORBA::ULong +TAO::TypeCode::Value::member_count_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->nfields_; +} + +template +char const * +TAO::TypeCode::Value::member_name_i ( + CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + if (index >= this->nfields_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), 0); + + return Traits::get_string (this->fields_[index].name); +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::Value::member_type_i ( + CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + if (index >= this->nfields_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), + CORBA::TypeCode::_nil ()); + + return + CORBA::TypeCode::_duplicate ( + Traits::get_typecode (this->fields_[index].type)); +} + +template +CORBA::Visibility +TAO::TypeCode::Value::member_visibility_i ( + CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + if (index >= this->nfields_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), + CORBA::PRIVATE_MEMBER); + + return this->fields_[index].visibility; +} + +template +CORBA::ValueModifier +TAO::TypeCode::Value::type_modifier_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->type_modifier_; +} + +template +CORBA::TypeCode_ptr +TAO::TypeCode::Value::concrete_base_type_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return + CORBA::TypeCode::_duplicate ( + Traits::get_typecode (this->concrete_base_)); +} + + +#endif /* TAO_VALUE_TYPECODE_CPP */ diff --git a/TAO/tao/AnyTypeCode/Value_TypeCode.h b/TAO/tao/AnyTypeCode/Value_TypeCode.h new file mode 100644 index 00000000000..2578a304b53 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Value_TypeCode.h @@ -0,0 +1,179 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Value_TypeCode.h + * + * $Id$ + * + * Header file for a @c tk_value and @c tk_event + * @c CORBA::TypeCodes. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_VALUE_TYPECODE_H +#define TAO_VALUE_TYPECODE_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TypeCode_Base_Attributes.h" +#include "tao/AnyTypeCode/ValueModifierC.h" +#include "tao/AnyTypeCode/VisibilityC.h" + + +namespace TAO +{ + namespace TypeCode + { + template struct Value_Field; + + /** + * @class Value + * + * @brief @c CORBA::TypeCode implementation for an OMG IDL + * @c valuetype or @c event. + * + * This class implements a @c CORBA::TypeCode for an OMG IDL + * @c valuetype or @c event. + */ + template + class Value + : public CORBA::TypeCode, + private RefCountPolicy + { + public: + + /// Constructor. + Value (CORBA::TCKind kind, + char const * id, + char const * name, + CORBA::ValueModifier modifier, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + // Borland C++ currently can't handle a reference to + // const pointer to const CORBA::TypeCode_ptr + TypeCodeType concrete_base, +#else + TypeCodeType const & concrete_base, +#endif + FieldArrayType const & fields, + CORBA::ULong nfields); + + /// Constructor used for recursive TypeCodes. + Value (CORBA::TCKind kind, + char const * id); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c tk_value or @c tk_event @c CORBA::TypeCode -specific + * template methods. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * name_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::ULong member_count_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * member_name_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr member_type_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + virtual CORBA::Visibility member_visibility_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + virtual CORBA::ValueModifier type_modifier_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::TypeCode_ptr concrete_base_type_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + //@} + + protected: + + /** + * @c Valuetype Attributes + * + * Attributes representing the structure of an OMG IDL + * @c valuetype or @c event. + * + * @note These attributes are declared in the order in which + * they are marshaled into a CDR stream in order to + * increase cache hits by improving spatial locality. + */ + //@{ + + /// Base attributes containing repository ID and name of + /// @c valuetype. + Base_Attributes base_attributes_; + + /// The @c ValueModifier of the @c valuetype of @c eventtype + /// represented by this @c TypeCode. + CORBA::ValueModifier type_modifier_; + + /// The @c TypeCode corresponding to the concrete base + /// @c valuetype or @c eventtype. + TypeCodeType concrete_base_; + + /// The number of fields in the OMG IDL value. + CORBA::ULong nfields_; + + /// Array of @c TAO::TypeCode fields representing structure of the + /// OMG IDL defined @c value. + FieldArrayType fields_; + + //@} + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/AnyTypeCode/Value_TypeCode.inl" +#endif /* __ACE_INLINE__ */ + +#ifdef ACE_TEMPLATES_REQUIRE_SOURCE +# include "tao/AnyTypeCode/Value_TypeCode.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA +# pragma implementation ("Value_TypeCode.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + + +#include /**/ "ace/post.h" + +#endif /* TAO_VALUE_TYPECODE_H */ diff --git a/TAO/tao/AnyTypeCode/Value_TypeCode.inl b/TAO/tao/AnyTypeCode/Value_TypeCode.inl new file mode 100644 index 00000000000..9a8b31f0ddb --- /dev/null +++ b/TAO/tao/AnyTypeCode/Value_TypeCode.inl @@ -0,0 +1,57 @@ +// -*- C++ -*- +// +// $Id$ + + +template +ACE_INLINE +TAO::TypeCode::Value::Value ( + CORBA::TCKind kind, + char const * id, + char const * name, + CORBA::ValueModifier modifier, +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x572) + // Borland C++ currently can't handle a reference to + // const pointer to const CORBA::TypeCode_ptr + TypeCodeType concrete_base, +#else + TypeCodeType const & concrete_base, +#endif + FieldArrayType const & fields, + CORBA::ULong nfields) + : CORBA::TypeCode (kind) + , RefCountPolicy () + , base_attributes_ (id, name) + , type_modifier_ (modifier) + , concrete_base_ (concrete_base) + , nfields_ (nfields) + , fields_ (fields) +{ +} + +template +ACE_INLINE +TAO::TypeCode::Value::Value ( + CORBA::TCKind kind, + char const * id) + : CORBA::TypeCode (kind) + , RefCountPolicy () + , base_attributes_ (id) + , type_modifier_ (CORBA::VM_NONE) + , concrete_base_ () + , nfields_ (0) + , fields_ () +{ +} diff --git a/TAO/tao/AnyTypeCode/Value_TypeCode_Static.cpp b/TAO/tao/AnyTypeCode/Value_TypeCode_Static.cpp new file mode 100644 index 00000000000..369aeae045c --- /dev/null +++ b/TAO/tao/AnyTypeCode/Value_TypeCode_Static.cpp @@ -0,0 +1,422 @@ +// $Id$ + +#include "tao/AnyTypeCode/Value_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Value_Field.h" +#include "tao/CDR.h" + +#include "tao/ORB_Core.h" +#include "tao/TypeCodeFactory_Adapter.h" + +#include "ace/Dynamic_Service.h" + +#ifndef __ACE_INLINE__ +# include "tao/AnyTypeCode/Value_TypeCode_Static.inl" +#endif /* !__ACE_INLINE__ */ + + +ACE_RCSID (tao, + Value_TypeCode_Static, + "$Id$") + + +bool +TAO::TypeCode::Value const *, + TAO::Null_RefCount_Policy>::tao_marshal ( + TAO_OutputCDR & cdr, + CORBA::ULong offset) const +{ + // A tk_value TypeCode has a "complex" parameter list type (see + // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of + // the CORBA specification), meaning that it must be marshaled into + // a CDR encapsulation. + + // Create a CDR encapsulation. + TAO_OutputCDR enc; + + // Account for the encoded CDR encapsulation length and byte order. + // + // Aligning on an octet since the next value after the CDR + // encapsulation length will always be the byte order octet/boolean + // in this case. + offset = ACE_align_binary (offset + 4, + ACE_CDR::OCTET_ALIGN); + + bool const success = + (enc << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.id (), 0)) + && (enc << TAO_OutputCDR::from_string (this->base_attributes_.name (), 0)) + && (enc << this->type_modifier_) + && marshal (enc, + Traits::get_typecode (this->concrete_base_), + offset + enc.total_length ()) + && (enc << this->nfields_); + + if (!success) + return false; + + Value_Field const * const begin = + &this->fields_[0]; + Value_Field const * const end = + begin + this->nfields_; + + for (Value_Field const * i = + begin; + i != end; + ++i) + { + Value_Field const & field = *i; + + if (!(enc << Traits::get_string (field.name)) + || !marshal (enc, + Traits::get_typecode (field.type), + offset + enc.total_length ()) + || !(enc << field.visibility)) + return false; + } + + return + cdr << static_cast (enc.total_length ()) + && cdr.write_octet_array_mb (enc.begin ()); +} + +void +TAO::TypeCode::Value const *, + TAO::Null_RefCount_Policy>::tao_duplicate (void) +{ +} + +void +TAO::TypeCode::Value const *, + TAO::Null_RefCount_Policy>::tao_release (void) +{ +} + +CORBA::Boolean +TAO::TypeCode::Value const *, + TAO::Null_RefCount_Policy>::equal_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + // None of these calls should throw since CORBA::TypeCode::equal() + // verified that the TCKind is the same as our's prior to invoking + // this method. + + CORBA::ValueModifier const tc_type_modifier = + tc->type_modifier (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_type_modifier != this->type_modifier_) + return 0; + + CORBA::TypeCode_var rhs_concrete_base_type = + tc->concrete_base_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Boolean const equal_concrete_base_types = + this->equal (rhs_concrete_base_type.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equal_concrete_base_types) + return 0; + + CORBA::ULong const tc_nfields = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_nfields != this->nfields_) + return 0; + + for (CORBA::ULong i = 0; i < this->nfields_; ++i) + { + Value_Field const & lhs_field = + this->fields_[i]; + + CORBA::Visibility const lhs_visibility = lhs_field.visibility; + CORBA::Visibility const rhs_visibility = + tc->member_visibility (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (lhs_visibility != rhs_visibility) + return 0; + + char const * const lhs_name = + Traits::get_string (lhs_field.name);; + char const * const rhs_name = tc->member_name (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (ACE_OS::strcmp (lhs_name, rhs_name) != 0) + return 0; + + CORBA::TypeCode_ptr const lhs_tc = + Traits::get_typecode (lhs_field.type); + CORBA::TypeCode_var const rhs_tc = + tc->member_type (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Boolean const equal_members = + lhs_tc->equal (rhs_tc.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equal_members) + return 0; + } + + return 1; +} + +CORBA::Boolean +TAO::TypeCode::Value const *, + TAO::Null_RefCount_Policy>::equivalent_i ( + CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const +{ + CORBA::ValueModifier const tc_type_modifier = + tc->type_modifier (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_type_modifier != this->type_modifier_) + return 0; + + CORBA::TypeCode_var rhs_concrete_base_type = + tc->concrete_base_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Boolean const equivalent_concrete_base_types = + this->equivalent (rhs_concrete_base_type.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equivalent_concrete_base_types) + return 0; + + // Perform a structural comparison, excluding the name() and + // member_name() operations. + + CORBA::ULong const tc_nfields = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (tc_nfields != this->nfields_) + return 0; + + for (CORBA::ULong i = 0; i < this->nfields_; ++i) + { + Value_Field const & lhs_field = + this->fields_[i]; + + CORBA::Visibility const lhs_visibility = + lhs_field.visibility; + CORBA::Visibility const rhs_visibility = + tc->member_visibility (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (lhs_visibility != rhs_visibility) + return 0; + + CORBA::TypeCode_ptr const lhs_tc = + Traits::get_typecode (lhs_field.type); + CORBA::TypeCode_var const rhs_tc = + tc->member_type (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Boolean const equiv_types = + lhs_tc->equivalent (rhs_tc.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (!equiv_types) + return 0; + } + + return 1; +} + +CORBA::TypeCode_ptr +TAO::TypeCode::Value const *, + TAO::Null_RefCount_Policy>::get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const +{ + ACE_Array_Base > + tc_fields (this->nfields_); + + if (this->nfields_ > 0) + { + // Dynamically construct a new array of fields stripped of + // member names. + + static char const empty_name[] = ""; + + for (CORBA::ULong i = 0; i < this->nfields_; ++i) + { + // Member names will be stripped, i.e. not embedded within + // the compact TypeCode. + + tc_fields[i].name = empty_name; + tc_fields[i].type = + Traits::get_typecode ( + this->fields_[i].type)->get_compact_typecode ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::TypeCode::_nil ()); + tc_fields[i].visibility = this->fields_[i].visibility; + } + } + + TAO_TypeCodeFactory_Adapter * const adapter = + ACE_Dynamic_Service::instance ( + TAO_ORB_Core::typecodefactory_adapter_name ()); + + if (adapter == 0) + { + ACE_THROW_RETURN (CORBA::INTERNAL (), + CORBA::TypeCode::_nil ()); + } + + return + adapter->create_value_event_tc ( + this->kind_, + this->base_attributes_.id (), + "", // empty name + this->type_modifier_, + Traits::get_typecode (this->concrete_base_), + tc_fields, + this->nfields_ + ACE_ENV_ARG_PARAMETER); +} + +char const * +TAO::TypeCode::Value const *, + TAO::Null_RefCount_Policy>::id_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.id (); +} + +char const * +TAO::TypeCode::Value const *, + TAO::Null_RefCount_Policy>::name_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + return this->base_attributes_.name (); +} + +CORBA::ULong +TAO::TypeCode::Value const *, + TAO::Null_RefCount_Policy>::member_count_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->nfields_; +} + +char const * +TAO::TypeCode::Value const *, + TAO::Null_RefCount_Policy>::member_name_i ( + CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + // Ownership is retained by the TypeCode, as required by the C++ + // mapping. + if (index >= this->nfields_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), 0); + + return Traits::get_string (this->fields_[index].name); +} + +CORBA::TypeCode_ptr +TAO::TypeCode::Value const *, + TAO::Null_RefCount_Policy>::member_type_i ( + CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + if (index >= this->nfields_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), + CORBA::TypeCode::_nil ()); + + return + CORBA::TypeCode::_duplicate ( + Traits::get_typecode (this->fields_[index].type)); +} + +CORBA::Visibility +TAO::TypeCode::Value const *, + TAO::Null_RefCount_Policy>::member_visibility_i ( + CORBA::ULong index + ACE_ENV_ARG_DECL) const +{ + if (index >= this->nfields_) + ACE_THROW_RETURN (CORBA::TypeCode::Bounds (), + CORBA::PRIVATE_MEMBER); + + return this->fields_[index].visibility; +} + +CORBA::ValueModifier +TAO::TypeCode::Value const *, + TAO::Null_RefCount_Policy>::type_modifier_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return this->type_modifier_; +} + +CORBA::TypeCode_ptr +TAO::TypeCode::Value const *, + TAO::Null_RefCount_Policy>::concrete_base_type_i ( + ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const +{ + return + CORBA::TypeCode::_duplicate ( + Traits::get_typecode (this->concrete_base_)); +} diff --git a/TAO/tao/AnyTypeCode/Value_TypeCode_Static.h b/TAO/tao/AnyTypeCode/Value_TypeCode_Static.h new file mode 100644 index 00000000000..7a8c87c584b --- /dev/null +++ b/TAO/tao/AnyTypeCode/Value_TypeCode_Static.h @@ -0,0 +1,168 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Value_TypeCode_Static.h + * + * $Id$ + * + * Header file for static @c tk_value and @c tk_event + * @c CORBA::TypeCodes. + * + * @author Ossama Othman + */ +//============================================================================= + +#ifndef TAO_VALUE_TYPECODE_STATIC_H +#define TAO_VALUE_TYPECODE_STATIC_H + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TypeCode.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TypeCode_Base_Attributes.h" +#include "tao/AnyTypeCode/ValueModifierC.h" +#include "tao/AnyTypeCode/VisibilityC.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" + + +namespace TAO +{ + namespace TypeCode + { + template struct Value_Field; + template class Value; + + /** + * @class Value + * + * @brief @c CORBA::TypeCode implementation for an OMG IDL + * @c valuetype or @c event. + * + * This class implements a @c CORBA::TypeCode for an OMG IDL + * @c valuetype or @c event. + */ + template<> + class TAO_AnyTypeCode_Export Value const *, + TAO::Null_RefCount_Policy> + : public CORBA::TypeCode, + private TAO::Null_RefCount_Policy + { + public: + + /// Constructor. + Value (CORBA::TCKind kind, + char const * id, + char const * name, + CORBA::ValueModifier modifier, + CORBA::TypeCode_ptr const * concrete_base, + Value_Field const * fields, + CORBA::ULong nfields); + + /** + * @name TAO-specific @c CORBA::TypeCode Methods + * + * Methods required by TAO's implementation of the + * @c CORBA::TypeCode class. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual bool tao_marshal (TAO_OutputCDR & cdr, + CORBA::ULong offset) const; + virtual void tao_duplicate (void); + virtual void tao_release (void); + //@} + + protected: + + /** + * @name @c TAO CORBA::TypeCode Template Methods + * + * @c tk_value or @c tk_event @c CORBA::TypeCode -specific + * template methods. + * + * @see @c CORBA::TypeCode + */ + //@{ + virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr get_compact_typecode_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * name_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::ULong member_count_i (ACE_ENV_SINGLE_ARG_DECL) const; + virtual char const * member_name_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + virtual CORBA::TypeCode_ptr member_type_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + virtual CORBA::Visibility member_visibility_i (CORBA::ULong index + ACE_ENV_ARG_DECL) const; + virtual CORBA::ValueModifier type_modifier_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + virtual CORBA::TypeCode_ptr concrete_base_type_i ( + ACE_ENV_SINGLE_ARG_DECL) const; + //@} + + private: + + /** + * @c Valuetype Attributes + * + * Attributes representing the structure of an OMG IDL + * @c valuetype or @c event. + * + * @note These attributes are declared in the order in which + * they are marshaled into a CDR stream in order to + * increase cache hits by improving spatial locality. + */ + //@{ + + /// Base attributes containing repository ID and name of + /// @c valuetype. + Base_Attributes const base_attributes_; + + /// The @c ValueModifier of the @c valuetype of @c eventtype + /// represented by this @c TypeCode. + CORBA::ValueModifier const type_modifier_; + + /// The @c TypeCode corresponding to the concrete base + /// @c valuetype or @c eventtype. + CORBA::TypeCode_ptr const * const concrete_base_; + + /// The number of fields in the OMG IDL value. + CORBA::ULong const nfields_; + + /// Array of @c TAO::TypeCode fields representing structure of the + /// OMG IDL defined @c value. + Value_Field const * const fields_; + + //@} + + }; + + } // End namespace TypeCode +} // End namespace TAO + + +#ifdef __ACE_INLINE__ +# include "tao/Value_TypeCode_Static.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* TAO_VALUE_TYPECODE_STATIC_H */ diff --git a/TAO/tao/AnyTypeCode/Value_TypeCode_Static.inl b/TAO/tao/AnyTypeCode/Value_TypeCode_Static.inl new file mode 100644 index 00000000000..70c7d6cf1b1 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Value_TypeCode_Static.inl @@ -0,0 +1,26 @@ +// -*- C++ -*- +// +// $Id$ + +ACE_INLINE +TAO::TypeCode::Value const *, + TAO::Null_RefCount_Policy>::Value ( + CORBA::TCKind kind, + char const * id, + char const * name, + CORBA::ValueModifier modifier, + CORBA::TypeCode_ptr const * concrete_base, + Value_Field const * fields, + CORBA::ULong nfields) + : CORBA::TypeCode (kind) + , ACE_NESTED_CLASS (TAO, Null_RefCount_Policy) () + , base_attributes_ (id, name) + , type_modifier_ (modifier) + , concrete_base_ (concrete_base) + , nfields_ (nfields) + , fields_ (fields) +{ +} diff --git a/TAO/tao/AnyTypeCode/Visibility.pidl b/TAO/tao/AnyTypeCode/Visibility.pidl new file mode 100644 index 00000000000..44cece777a3 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Visibility.pidl @@ -0,0 +1,34 @@ +// -*- IDL -*- + +// ================================================================ +/** + * @file Visibility.pidl + * + * $Id$ + * + * This file was used to generate the code in VisibiltyC.* The command + * used to generate code is: + * + * tao_idl + * -o orig -SS -Ge 1 -Sc -Sci + * -Wb,export_macro=TAO_Export + * -Wb,export_include="tao/TAO_Export.h" + * -Wb,pre_include="ace/pre.h" + * -Wb,post_include="ace/post.h" + * Visibilty.pidl + */ +// ================================================================ + +#ifndef TAO_VISIBILITY_PIDL +#define TAO_VISIBILITY_PIDL + +#pragma prefix "omg.org" + +module CORBA +{ + typedef short Visibility; + const Visibility PRIVATE_MEMBER = 0; + const Visibility PUBLIC_MEMBER = 1; +}; + +#endif /* TAO_VISIBILITY_PIDL */ diff --git a/TAO/tao/AnyTypeCode/VisibilityA.cpp b/TAO/tao/AnyTypeCode/VisibilityA.cpp new file mode 100644 index 00000000000..95ae55adc13 --- /dev/null +++ b/TAO/tao/AnyTypeCode/VisibilityA.cpp @@ -0,0 +1,53 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "VisibilityA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_CORBA_Visibility ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/Visibility:1.0", + "Visibility", + &CORBA::_tc_short); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_Visibility = + &_tao_tc_CORBA_Visibility; +} + + diff --git a/TAO/tao/AnyTypeCode/VisibilityA.h b/TAO/tao/AnyTypeCode/VisibilityA.h new file mode 100644 index 00000000000..c017677e438 --- /dev/null +++ b/TAO/tao/AnyTypeCode/VisibilityA.h @@ -0,0 +1,96 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_VISIBILITYA_H_ +#define _TAO_IDL_ORIG_VISIBILITYA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/AnyTypeCode/VisibilityC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_Visibility; + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/VisibilityC.cpp b/TAO/tao/AnyTypeCode/VisibilityC.cpp new file mode 100644 index 00000000000..76f74d94f2f --- /dev/null +++ b/TAO/tao/AnyTypeCode/VisibilityC.cpp @@ -0,0 +1,46 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:291 + + +#include "VisibilityC.h" +#include "tao/CDR.h" + +#if defined (__BORLANDC__) +#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_arg_traits.cpp:70 + +// Arg traits specializations. +namespace TAO +{ +} + diff --git a/TAO/tao/AnyTypeCode/VisibilityC.h b/TAO/tao/AnyTypeCode/VisibilityC.h new file mode 100644 index 00000000000..124188ba2f7 --- /dev/null +++ b/TAO/tao/AnyTypeCode/VisibilityC.h @@ -0,0 +1,111 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_VISIBILITYC_H_ +#define _TAO_IDL_ORIG_VISIBILITYC_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/ORB.h" +#include "tao/Environment.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typedef/typedef_ch.cpp:379 + + typedef CORBA::Short Visibility; + typedef CORBA::Short_out Visibility_out; + + // TAO_IDL - Generated from + // be\be_visitor_constant/constant_ch.cpp:52 + + const CORBA::Visibility PRIVATE_MEMBER = 0; + + // TAO_IDL - Generated from + // be\be_visitor_constant/constant_ch.cpp:52 + + const CORBA::Visibility PUBLIC_MEMBER = 1; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/VisibilityS.h b/TAO/tao/AnyTypeCode/VisibilityS.h new file mode 100644 index 00000000000..17b1360599e --- /dev/null +++ b/TAO/tao/AnyTypeCode/VisibilityS.h @@ -0,0 +1,28 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// Skeleton file generation suppressed with command line option -SS diff --git a/TAO/tao/AnyTypeCode/WCharSeqA.cpp b/TAO/tao/AnyTypeCode/WCharSeqA.cpp new file mode 100644 index 00000000000..d7024fce2a6 --- /dev/null +++ b/TAO/tao/AnyTypeCode/WCharSeqA.cpp @@ -0,0 +1,142 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "WCharSeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_WCharSeq_GUARD +#define _TAO_TYPECODE_CORBA_WCharSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_WCharSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_wchar, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_WCharSeq_0 = + &CORBA_WCharSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_WCharSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_WCharSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/WCharSeq:1.0", + "WCharSeq", + &TAO::TypeCode::tc_CORBA_WCharSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_WCharSeq = + &_tao_tc_CORBA_WCharSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::WCharSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::WCharSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_WCharSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::WCharSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::WCharSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_WCharSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::WCharSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::WCharSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::WCharSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::WCharSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_WCharSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/WCharSeqA.h b/TAO/tao/AnyTypeCode/WCharSeqA.h new file mode 100644 index 00000000000..105a283a9ea --- /dev/null +++ b/TAO/tao/AnyTypeCode/WCharSeqA.h @@ -0,0 +1,66 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:788 + +#ifndef _TAO_IDL_ANYTYPECODE_WCHARSEQA_H_ +#define _TAO_IDL_ANYTYPECODE_WCHARSEQA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/WCharSeqC.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_WCharSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::WCharSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::WCharSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::WCharSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::WCharSeq *&); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/WStringSeqA.cpp b/TAO/tao/AnyTypeCode/WStringSeqA.cpp new file mode 100644 index 00000000000..0a36da30b26 --- /dev/null +++ b/TAO/tao/AnyTypeCode/WStringSeqA.cpp @@ -0,0 +1,143 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "WStringSeqA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Sequence_TypeCode_Static.h" +#include "tao/AnyTypeCode/String_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/typecode_defn.cpp:937 + + +#ifndef _TAO_TYPECODE_CORBA_WStringSeq_GUARD +#define _TAO_TYPECODE_CORBA_WStringSeq_GUARD +namespace TAO +{ + namespace TypeCode + { + TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *, + TAO::Null_RefCount_Policy> + CORBA_WStringSeq_0 ( + CORBA::tk_sequence, + &CORBA::_tc_wstring, + 0U); + + ::CORBA::TypeCode_ptr const tc_CORBA_WStringSeq_0 = + &CORBA_WStringSeq_0; + + } +} + + +#endif /* _TAO_TYPECODE_CORBA_WStringSeq_GUARD */ + +static TAO::TypeCode::Alias + _tao_tc_CORBA_WStringSeq ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/WStringSeq:1.0", + "WStringSeq", + &TAO::TypeCode::tc_CORBA_WStringSeq_0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_WStringSeq = + &_tao_tc_CORBA_WStringSeq; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_cs.cpp:54 + + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::WStringSeq &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::WStringSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_WStringSeq_0, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::WStringSeq *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::WStringSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_WStringSeq_0, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::WStringSeq *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::WStringSeq *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::WStringSeq *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::WStringSeq::_tao_any_destructor, + TAO::TypeCode::tc_CORBA_WStringSeq_0, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/WStringSeqA.h b/TAO/tao/AnyTypeCode/WStringSeqA.h new file mode 100644 index 00000000000..a78c90dfdec --- /dev/null +++ b/TAO/tao/AnyTypeCode/WStringSeqA.h @@ -0,0 +1,66 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:754 + +#ifndef _TAO_IDL_ANYTYPECODE_WSTRINGSEQA_H_ +#define _TAO_IDL_ANYTYPECODE_WSTRINGSEQA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/WStringSeqC.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_WStringSeq; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_sequence/any_op_ch.cpp:53 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::WStringSeq &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::WStringSeq*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::WStringSeq *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::WStringSeq *&); + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/WrongTransactionA.cpp b/TAO/tao/AnyTypeCode/WrongTransactionA.cpp new file mode 100644 index 00000000000..7b37a76f712 --- /dev/null +++ b/TAO/tao/AnyTypeCode/WrongTransactionA.cpp @@ -0,0 +1,147 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "WrongTransactionA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/Struct_TypeCode_Static.h" +#include "tao/AnyTypeCode/TypeCode_Struct_Field.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" +#include "tao/AnyTypeCode/Any_Dual_Impl_T.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/struct_typecode.cpp:87 + +static TAO::TypeCode::Struct_Field const * const _tao_fields_CORBA_WrongTransaction = 0; +static TAO::TypeCode::Struct const *, + TAO::Null_RefCount_Policy> + _tao_tc_CORBA_WrongTransaction ( + CORBA::tk_except, + "IDL:omg.org/CORBA/WrongTransaction:1.0", + "WrongTransaction", + _tao_fields_CORBA_WrongTransaction, + 0); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_WrongTransaction = + &_tao_tc_CORBA_WrongTransaction; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_exception/any_op_cs.cpp:50 + +namespace TAO +{ + template<> + CORBA::Boolean + Any_Dual_Impl_T::demarshal_value ( + TAO_InputCDR & cdr + ) + { + CORBA::String_var id; + + if (!(cdr >> id.out ())) + { + return false; + } + + ACE_TRY_NEW_ENV + { + this->value_->_tao_decode (cdr ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + return false; + } + ACE_ENDTRY; + + return true; + } +} + +// Copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + const CORBA::WrongTransaction &_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert_copy ( + _tao_any, + CORBA::WrongTransaction::_tao_any_destructor, + CORBA::_tc_WrongTransaction, + _tao_elem + ); +} + +// Non-copying insertion. +void operator<<= ( + CORBA::Any &_tao_any, + CORBA::WrongTransaction *_tao_elem + ) +{ + TAO::Any_Dual_Impl_T::insert ( + _tao_any, + CORBA::WrongTransaction::_tao_any_destructor, + CORBA::_tc_WrongTransaction, + _tao_elem + ); +} + +// Extraction to non-const pointer (deprecated). +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + CORBA::WrongTransaction *&_tao_elem + ) +{ + return _tao_any >>= const_cast< + const CORBA::WrongTransaction *&> ( + _tao_elem + ); +} + +// Extraction to const pointer. +CORBA::Boolean operator>>= ( + const CORBA::Any &_tao_any, + const CORBA::WrongTransaction *&_tao_elem + ) +{ + return + TAO::Any_Dual_Impl_T::extract ( + _tao_any, + CORBA::WrongTransaction::_tao_any_destructor, + CORBA::_tc_WrongTransaction, + _tao_elem + ); +} diff --git a/TAO/tao/AnyTypeCode/WrongTransactionA.h b/TAO/tao/AnyTypeCode/WrongTransactionA.h new file mode 100644 index 00000000000..ad9a3e7cedb --- /dev/null +++ b/TAO/tao/AnyTypeCode/WrongTransactionA.h @@ -0,0 +1,107 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_WRONGTRANSACTIONA_H_ +#define _TAO_IDL_ORIG_WRONGTRANSACTIONA_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/WrongTransactionC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_AnyTypeCode_Export + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:48 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:44 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_WrongTransaction; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:66 + +} // module CORBA + +// TAO_IDL - Generated from +// be\be_visitor_traits.cpp:61 + +// Traits specializations. +namespace TAO +{ +} + +// TAO_IDL - Generated from +// be\be_visitor_exception/any_op_ch.cpp:52 + +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::WrongTransaction &); // copying version +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::WrongTransaction*); // noncopying version +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::WrongTransaction *&); // deprecated +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::WrongTransaction *&); + +// TAO_IDL - Generated from +// be\be_codegen.cpp:955 + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + + diff --git a/TAO/tao/AnyTypeCode/append.cpp b/TAO/tao/AnyTypeCode/append.cpp new file mode 100644 index 00000000000..3e1a0020dde --- /dev/null +++ b/TAO/tao/AnyTypeCode/append.cpp @@ -0,0 +1,1320 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO +// +// = FILENAME +// append.cpp +// +// = DESCRIPTION +// Appends a CDR stream to another CDR stream. Due to the +// stringent alignment requirements, it is not possible to simply +// append or memcpy. Instead we go thru the same CDR encoding rules +// +// = AUTHOR +// Copyright 1994-1995 by Sun Microsystems Inc. +// and Aniruddha Gokhale +// +// ============================================================================ + +#include "tao/Environment.h" +#include "tao/debug.h" +#include "tao/Valuetype_Adapter.h" +#include "tao/ORB_Core.h" +#include "tao/AnyTypeCode/TypeCode.h" +#include "tao/AnyTypeCode/Marshal.h" +#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" +#include "tao/CDR.h" +#include "tao/SystemException.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/OctetSeqA.h" +#include "tao/AnyTypeCode/Any.h" + +#include "ace/Dynamic_Service.h" + +ACE_RCSID (tao, + append, + "$Id$") + +// Encode instances of arbitrary data types based only on typecode. +// "data" points to the data type; if it's not a primitve data type, +// the TypeCode interpreter is used to recursively encode its +// components. "context" is the marshaling stream on which to encode +// the data value. + +TAO::traverse_status +TAO_Marshal_Primitive::append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) +{ + CORBA::Boolean continue_append = 1; + TAO::traverse_status retval = + TAO::TRAVERSE_CONTINUE; // status of encode operation + + CORBA::TCKind const k = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + switch (k) + { + case CORBA::tk_null: + case CORBA::tk_void: + break; + case CORBA::tk_short: + case CORBA::tk_ushort: + continue_append = dest->append_short (*src); + break; + case CORBA::tk_long: + case CORBA::tk_ulong: + case CORBA::tk_float: + case CORBA::tk_enum: + continue_append = dest->append_long (*src); + break; + case CORBA::tk_double: + case CORBA::tk_longlong: + case CORBA::tk_ulonglong: + continue_append = dest->append_double (*src); + break; + case CORBA::tk_boolean: + continue_append = dest->append_boolean (*src); + break; + case CORBA::tk_char: + case CORBA::tk_octet: + continue_append = dest->append_octet (*src); + break; + case CORBA::tk_longdouble: + continue_append = dest->append_longdouble (*src); + break; + case CORBA::tk_wchar: + continue_append = dest->append_wchar (*src); + break; + default: + retval = TAO::TRAVERSE_STOP; + // we are not a primitive type + } + + if (retval == TAO::TRAVERSE_CONTINUE + && continue_append == 1) + return TAO::TRAVERSE_CONTINUE; + + if (TAO_debug_level > 0) + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Primitive::append detected error\n") + )); + + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); +} + +TAO::traverse_status +TAO_Marshal_Any::append (CORBA::TypeCode_ptr, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) +{ + // Typecode of the element that makes the Any. + CORBA::TypeCode_var elem_tc; + + if (!(*src >> elem_tc.inout ())) + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); + + if (!(*dest << elem_tc.in ())) + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); + + // append the data + TAO::traverse_status retval = + TAO_Marshal_Object::perform_append (elem_tc.in (), + src, + dest + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + if (retval != TAO::TRAVERSE_CONTINUE) + { + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Any::append detected error\n"))); + + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); + } + + return retval; +} + +TAO::traverse_status +TAO_Marshal_TypeCode::append (CORBA::TypeCode_ptr, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) +{ + CORBA::Boolean continue_append = 1; + TAO::traverse_status retval = + TAO::TRAVERSE_CONTINUE; + CORBA::ULong kind; + + // Decode the "kind" field of the typecode from the src for further + // use. However, also write it back into the destination + continue_append = (CORBA::Boolean) (src->read_ulong (kind) + ? dest->write_ulong (kind) + : 0); + + if (continue_append == 1) + { + // Typecodes with empty parameter lists all have preallocated + // constants. We use those to reduce memory consumption and + // heap access ... also, to speed things up! + if ((kind < CORBA::TAO_TC_KIND_COUNT) + || (kind == ~0u)) + { + // Either a non-constant typecode or an indirected typecode. + switch (kind) + { + // Need special handling for all kinds of typecodes that + // have nonempty parameter lists ... + default: + // nothing to de done + break; + case CORBA::tk_string: + case CORBA::tk_wstring: + { + // read and write the bounds + retval = + TAO_Marshal_Object::perform_append (CORBA::_tc_long, + src, + dest + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + } + break; + + // Indirected typecodes, illegal at "top level" + case ~0u: + { + // read and write the negative offset + retval = + TAO_Marshal_Object::perform_append (CORBA::_tc_long, + src, + dest + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + } + break; + + // The rest have "complex" parameter lists that are + // encoded as bulk octets ... + case CORBA::tk_objref: + case CORBA::tk_struct: + case CORBA::tk_union: + case CORBA::tk_enum: + case CORBA::tk_sequence: + case CORBA::tk_array: + case CORBA::tk_alias: + case CORBA::tk_except: + case CORBA::tk_value: + case CORBA::tk_value_box: + case CORBA::tk_native: + case CORBA::tk_abstract_interface: + case CORBA::tk_local_interface: + case CORBA::tk_component: + case CORBA::tk_home: + case CORBA::tk_event: + { + // write the encapsulation i.e., octet sequence + retval = + TAO_Marshal_Object::perform_append (CORBA::_tc_OctetSeq, + src, + dest + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + } + } // end of switch + } + else // bad kind_ value to be decoded + { + if (TAO_debug_level > 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_TypeCode: ") + ACE_TEXT ("Bad kind_ value in CDR stream\n"))); + } + + ACE_THROW_RETURN (CORBA::BAD_TYPECODE (), + TAO::TRAVERSE_STOP); + } + } + + if (continue_append == 1 && retval == TAO::TRAVERSE_CONTINUE) + { + return TAO::TRAVERSE_CONTINUE; + } + + if (TAO_debug_level > 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_TypeCode::append detected error\n"))); + } + + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); +} + +TAO::traverse_status +TAO_Marshal_Principal::append (CORBA::TypeCode_ptr, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) +{ + // write the octet sequence representing the Principal + return TAO_Marshal_Object::perform_append (CORBA::_tc_OctetSeq, + src, + dest + ACE_ENV_ARG_PARAMETER); +} + +TAO::traverse_status +TAO_Marshal_ObjRef::append (CORBA::TypeCode_ptr, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) +{ + CORBA::Boolean continue_append = 1; + + // First, append the type hint. This will be the type_id encoded in an + // object reference. + dest->append_string (*src); + + // Read the profiles, discarding all until an IIOP profile comes by. + // Once we see an IIOP profile, ignore any further ones. + // + // XXX this will need to change someday to let different protocol + // code be accessed, not just IIOP. Protocol modules will be + // dynamically loaded from shared libraries via ORB_init (), and we + // just need to be able to access such preloaded libraries here as + // we unmarshal objrefs. + + CORBA::ULong profiles = 0; + + // get the count of profiles that follow. This will tell us the + // length of the sequence + continue_append = (CORBA::Boolean) (src->read_ulong (profiles) + ? dest->write_ulong (profiles) + : 0); + + // No profiles means a NIL objref. + while (profiles-- != 0 && continue_append) + { + CORBA::ULong tag = 0; + + // get the profile ID tag + if ((continue_append = (CORBA::Boolean) (src->read_ulong (tag) + ? dest->write_ulong (tag) + : 0)) == 0) + continue; + + CORBA::ULong length = 0; + if ((continue_append = (CORBA::Boolean) (src->read_ulong (length) + ? dest->write_ulong (length) + : 0)) == 0) + continue; + + // @@ This can be optimized! Pre-allocating on the destination + // and then copying directly into that. + CORBA::Octet* body = 0; + ACE_NEW_RETURN (body, + CORBA::Octet[length], + TAO::TRAVERSE_STOP); + continue_append = + (CORBA::Boolean) (src->read_octet_array (body, length) + ? dest->write_octet_array (body, length) + : 0); + delete [] body; + } + + if (continue_append == 1) + return TAO::TRAVERSE_CONTINUE; + + if (TAO_debug_level > 0) + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("TAO_Marshal_ObjRef::append detected error\n") + )); + + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); +} + +TAO::traverse_status +TAO_Marshal_Struct::append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) +{ + TAO::traverse_status retval = + TAO::TRAVERSE_CONTINUE; + CORBA::TypeCode_var param; + + // Number of fields in the struct. + const CORBA::ULong member_count = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + for (CORBA::ULong i = 0; + i < member_count && retval == TAO::TRAVERSE_CONTINUE; + ++i) + { + // get member type + param = tc->member_type (i ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + retval = + TAO_Marshal_Object::perform_append (param.in (), + src, + dest + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + } + + if (retval == TAO::TRAVERSE_CONTINUE) + return TAO::TRAVERSE_CONTINUE; + + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Struct::append detected error\n"))); + + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); +} + +TAO::traverse_status +TAO_Marshal_Union::append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) +{ + CORBA::TypeCode_var discrim_tc = + tc->discriminator_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + CORBA::ULong kind = + discrim_tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + // Save the discriminator value in a temporary variable... + CORBA::Short short_v; + CORBA::UShort ushort_v; + CORBA::Long long_v; + CORBA::ULong ulong_v; + CORBA::ULong enum_v; + CORBA::Char char_v; + CORBA::WChar wchar_v; + CORBA::Boolean boolean_v = false; + + switch (kind) + { + case CORBA::tk_short: + { + if (!src->read_short (short_v) + || !dest->write_short (short_v)) + return TAO::TRAVERSE_STOP; + } + break; + + case CORBA::tk_ushort: + { + if (!src->read_ushort (ushort_v) + || !dest->write_ushort (ushort_v)) + return TAO::TRAVERSE_STOP; + } + break; + + case CORBA::tk_long: + { + if (!src->read_long (long_v) + || !dest->write_long (long_v)) + return TAO::TRAVERSE_STOP; + } + break; + + case CORBA::tk_ulong: + { + if (!src->read_ulong (ulong_v) + || !dest->write_ulong (ulong_v)) + return TAO::TRAVERSE_STOP; + } + break; + + case CORBA::tk_enum: + { + if (!src->read_ulong (enum_v) + || !dest->write_ulong (enum_v)) + return TAO::TRAVERSE_STOP; + } + break; + + case CORBA::tk_char: + { + if (!src->read_char (char_v) + || !dest->write_char (char_v)) + return TAO::TRAVERSE_STOP; + } + break; + + case CORBA::tk_wchar: + { + if (!src->read_wchar (wchar_v) + || !dest->write_wchar (wchar_v)) + return TAO::TRAVERSE_STOP; + } + break; + + case CORBA::tk_boolean: + { + if (!src->read_boolean (boolean_v) + || !dest->write_boolean (boolean_v)) + return TAO::TRAVERSE_STOP; + } + break; + + default: + return TAO::TRAVERSE_STOP; + } + + const CORBA::ULong member_count = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + const CORBA::ULong null_member = ~static_cast (0U); + + CORBA::ULong current_member = null_member; + CORBA::ULong default_member = null_member; + + for (CORBA::ULong i = 0; + i < member_count && current_member == null_member; + ++i) + { + CORBA::Any_var any = tc->member_label (i + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + CORBA::Octet o; + + if ((any >>= CORBA::Any::to_octet (o)) && o == 0) + { + CORBA::ULong default_index = + tc->default_index (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + if (i != default_index) + ACE_THROW_RETURN (CORBA::BAD_TYPECODE (), + TAO::TRAVERSE_STOP); + // Found the default branch, save its position and continue + // trying to find the current value... + default_member = i; + continue; + } + + switch (kind) + { + case CORBA::tk_short: + { + CORBA::Short d; + if ((any >>= d) && d == short_v) + current_member = i; + } + break; + + case CORBA::tk_ushort: + { + CORBA::UShort d; + if ((any >>= d) && d == ushort_v) + current_member = i; + } + break; + + case CORBA::tk_long: + { + CORBA::Long d; + if ((any >>= d) && d == long_v) + current_member = i; + } + break; + + case CORBA::tk_ulong: + { + CORBA::ULong d; + if ((any >>= d) && d == ulong_v) + current_member = i; + } + break; + + case CORBA::tk_enum: + { + CORBA::ULong d; + TAO::Any_Impl *impl = any->impl (); + + if (impl->encoded ()) + { + TAO::Unknown_IDL_Type *unk = + dynamic_cast (impl); + + // We don't want unk's rd_ptr to move, in case + // we are shared by another Any, so we use this + // to copy the state, not the buffer. + TAO_InputCDR for_reading (unk->_tao_get_cdr ()); + + for_reading.read_ulong (d); + } + else + { + TAO_OutputCDR out; + impl->marshal_value (out); + TAO_InputCDR cdr (out); + cdr.read_ulong (d); + } + + if (d == enum_v) + { + current_member = i; + } + } + break; + + case CORBA::tk_char: + { + CORBA::Char d; + if ((any >>= CORBA::Any::to_char (d)) && d == char_v) + current_member = i; + } + break; + + case CORBA::tk_wchar: + { + CORBA::WChar d; + if ((any >>= CORBA::Any::to_wchar (d)) && d == wchar_v) + current_member = i; + } + break; + + case CORBA::tk_boolean: + { + CORBA::Boolean d; + if ((any >>= CORBA::Any::to_boolean (d)) && d == boolean_v) + current_member = i; + } + break; + + default: + return TAO::TRAVERSE_STOP; + } + } + + if (current_member == null_member) + { + // Cannot find the current member, check if there is a + // default... + if (default_member != null_member) + { + // Good, use the default to append... + CORBA::TypeCode_var member_tc = + tc->member_type (default_member ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + return TAO_Marshal_Object::perform_append (member_tc.in (), + src, + dest + ACE_ENV_ARG_PARAMETER); + } + + // If we're here, we have an implicit default case, and we + // should just return without appending anything, since no + // union member was marshaled in the first place. + return TAO::TRAVERSE_CONTINUE; + } + + // If we found the member successfully then just use that one... + CORBA::TypeCode_var member_tc = + tc->member_type (current_member ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + return TAO_Marshal_Object::perform_append (member_tc.in (), + src, + dest + ACE_ENV_ARG_PARAMETER); +} + +TAO::traverse_status +TAO_Marshal_String::append (CORBA::TypeCode_ptr, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) +{ + CORBA::Boolean continue_append = 1; + + // On decode, omit the check against specified string bounds, and + // cope with illegal "zero length" strings (all lengths on the wire + // must include a NUL). + // + // This is on the principle of being gracious in what we accept; we + // don't generate messages that fail to comply with protocol specs, + // but we will accept them when it's clear how to do so. + + continue_append = dest->append_string (*src); + if (continue_append == 1) + return TAO::TRAVERSE_CONTINUE; + + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_TypeCode::append detected error\n"))); + + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); +} + +TAO::traverse_status +TAO_Marshal_Sequence::append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) +{ + // Size of element. + CORBA::ULong bounds; + + // First unmarshal the sequence length ... we trust it to be right + // here, on the "be gracious in what you accept" principle. We + // don't generate illegal sequences (i.e. length > bounds). + + CORBA::Boolean continue_append = + (CORBA::Boolean) (src->read_ulong (bounds) + ? dest->write_ulong (bounds) + : 0); + + if (!continue_append) + { + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Sequence::append detected error\n") + )); + ACE_THROW_RETURN (CORBA::MARSHAL (), + TAO::TRAVERSE_STOP); + } + + if (bounds == 0) + { + return TAO::TRAVERSE_CONTINUE; + } + + if (continue_append) + { + // Get element typecode. + CORBA::TypeCode_var tc2 = + tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + TAO::traverse_status retval = + TAO::TRAVERSE_CONTINUE; + + CORBA::TCKind kind = tc2->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + switch (kind) + { + case CORBA::tk_octet: + { + char* buf; + if (dest->adjust (ACE_CDR::OCTET_SIZE * bounds, + ACE_CDR::OCTET_ALIGN, buf) == 0) + { + if (src->read_octet_array ((ACE_CDR::Octet*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_boolean: + { + char* buf; + if (dest->adjust (ACE_CDR::OCTET_SIZE * bounds, + ACE_CDR::OCTET_ALIGN, buf) == 0) + { + if (src->read_boolean_array ((ACE_CDR::Boolean*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_char: + { + char* buf; + if (dest->adjust (ACE_CDR::OCTET_SIZE * bounds, + ACE_CDR::OCTET_ALIGN, buf) == 0) + { + if (src->read_char_array ((ACE_CDR::Char*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_short: + { + char* buf; + if (dest->adjust (ACE_CDR::SHORT_SIZE * bounds, + ACE_CDR::SHORT_ALIGN, buf) == 0) + { + if (src->read_short_array ((ACE_CDR::Short*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_ushort: + { + char* buf; + if (dest->adjust (ACE_CDR::SHORT_SIZE * bounds, + ACE_CDR::SHORT_ALIGN, buf) == 0) + { + if (src->read_ushort_array ((ACE_CDR::UShort*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_wchar: + { + char* buf; + if (dest->adjust (ACE_CDR::SHORT_SIZE * bounds, + ACE_CDR::SHORT_ALIGN, buf) == 0) + { + if (src->read_wchar_array ((ACE_CDR::WChar*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_long: + { + char* buf; + if (dest->adjust (ACE_CDR::LONG_SIZE * bounds, + ACE_CDR::LONG_ALIGN, buf) == 0) + { + if (src->read_long_array ((ACE_CDR::Long*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_ulong: + { + char* buf; + if (dest->adjust (ACE_CDR::LONG_SIZE * bounds, + ACE_CDR::LONG_ALIGN, buf) == 0) + { + if (src->read_ulong_array ((ACE_CDR::ULong*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_float: + { + char* buf; + if (dest->adjust (ACE_CDR::LONG_SIZE * bounds, + ACE_CDR::LONG_ALIGN, buf) == 0) + { + if (src->read_float_array ((ACE_CDR::Float*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_double: + { + char* buf; + if (dest->adjust (ACE_CDR::LONGLONG_SIZE * bounds, + ACE_CDR::LONGLONG_ALIGN, buf) == 0) + { + if (src->read_double_array ((ACE_CDR::Double*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_longlong: + { + char* buf; + if (dest->adjust (ACE_CDR::LONGLONG_SIZE * bounds, + ACE_CDR::LONGLONG_ALIGN, buf) == 0) + { + if (src->read_longlong_array ((ACE_CDR::LongLong*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_ulonglong: + { + char* buf; + if (dest->adjust (ACE_CDR::LONGLONG_SIZE * bounds, + ACE_CDR::LONGLONG_ALIGN, buf) == 0) + { + if (src->read_ulonglong_array ((ACE_CDR::ULongLong*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_longdouble: + { + char* buf; + if (dest->adjust (ACE_CDR::LONGDOUBLE_SIZE * bounds, + ACE_CDR::LONGDOUBLE_ALIGN, buf) == 0) + { + if (src->read_longdouble_array ((ACE_CDR::LongDouble*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + + default: + while (bounds-- && retval == TAO::TRAVERSE_CONTINUE) + { + retval = TAO_Marshal_Object::perform_append (tc2.in (), + src, + dest + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + } + break; + }// end of switch + + if (retval == TAO::TRAVERSE_CONTINUE) + return TAO::TRAVERSE_CONTINUE; + } + // error exit + if (TAO_debug_level > 0) + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("marshaling TAO_Marshal_Sequence::append detected error\n") + )); + + ACE_THROW_RETURN (CORBA::MARSHAL (), + TAO::TRAVERSE_STOP); +} + +TAO::traverse_status +TAO_Marshal_Array::append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) +{ + // retrieve the bounds of the array + CORBA::ULong bounds = tc->length (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + // get element typecode + CORBA::TypeCode_var tc2 = tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + // For CORBA basic types, the copy can be optimized + CORBA::TCKind kind = tc2->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + // Return status. + TAO::traverse_status retval = + TAO::TRAVERSE_CONTINUE; + + switch (kind) + { + case CORBA::tk_octet: + { + char* buf; + if (dest->adjust (ACE_CDR::OCTET_SIZE * bounds, + ACE_CDR::OCTET_ALIGN, buf) == 0) + { + if (src->read_octet_array ((ACE_CDR::Octet*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_boolean: + { + char* buf; + if (dest->adjust (ACE_CDR::OCTET_SIZE * bounds, + ACE_CDR::OCTET_ALIGN, buf) == 0) + { + if (src->read_boolean_array ((ACE_CDR::Boolean*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_char: + { + char* buf; + if (dest->adjust (ACE_CDR::OCTET_SIZE * bounds, + ACE_CDR::OCTET_ALIGN, buf) == 0) + { + if (src->read_char_array ((ACE_CDR::Char*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_short: + { + char* buf; + if (dest->adjust (ACE_CDR::SHORT_SIZE * bounds, + ACE_CDR::SHORT_ALIGN, buf) == 0) + { + if (src->read_short_array ((ACE_CDR::Short*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_ushort: + { + char* buf; + if (dest->adjust (ACE_CDR::SHORT_SIZE * bounds, + ACE_CDR::SHORT_ALIGN, buf) == 0) + { + if (src->read_ushort_array ((ACE_CDR::UShort*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_wchar: + { + char* buf; + if (dest->adjust (ACE_CDR::SHORT_SIZE * bounds, + ACE_CDR::SHORT_ALIGN, buf) == 0) + { + if (src->read_wchar_array ((ACE_CDR::WChar*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_long: + { + char* buf; + if (dest->adjust (ACE_CDR::LONG_SIZE * bounds, + ACE_CDR::LONG_ALIGN, buf) == 0) + { + if (src->read_long_array ((ACE_CDR::Long*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_ulong: + { + char* buf; + if (dest->adjust (ACE_CDR::LONG_SIZE * bounds, + ACE_CDR::LONG_ALIGN, buf) == 0) + { + if (src->read_ulong_array ((ACE_CDR::ULong*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_float: + { + char* buf; + if (dest->adjust (ACE_CDR::LONG_SIZE * bounds, + ACE_CDR::LONG_ALIGN, buf) == 0) + { + if (src->read_float_array ((ACE_CDR::Float*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_double: + { + char* buf; + if (dest->adjust (ACE_CDR::LONGLONG_SIZE * bounds, + ACE_CDR::LONGLONG_ALIGN, buf) == 0) + { + if (src->read_double_array ((ACE_CDR::Double*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_longlong: + { + char* buf; + if (dest->adjust (ACE_CDR::LONGLONG_SIZE * bounds, + ACE_CDR::LONGLONG_ALIGN, buf) == 0) + { + if (src->read_longlong_array ((ACE_CDR::LongLong*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_ulonglong: + { + char* buf; + if (dest->adjust (ACE_CDR::LONGLONG_SIZE * bounds, + ACE_CDR::LONGLONG_ALIGN, buf) == 0) + { + if (src->read_ulonglong_array ((ACE_CDR::ULongLong*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + case CORBA::tk_longdouble: + { + char* buf; + if (dest->adjust (ACE_CDR::LONGDOUBLE_SIZE * bounds, + ACE_CDR::LONGDOUBLE_ALIGN, buf) == 0) + { + if (src->read_longdouble_array ((ACE_CDR::LongDouble*)buf, bounds) == 0) + retval = TAO::TRAVERSE_STOP; + } + } + break; + default: + while (bounds-- && retval == TAO::TRAVERSE_CONTINUE) + { + retval = TAO_Marshal_Object::perform_append (tc2.in (), + src, + dest + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + } + break; + }// end of switch + + if (retval == TAO::TRAVERSE_CONTINUE) + return retval; + + // error exit + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Sequence::append detected error\n"))); + + ACE_THROW_RETURN (CORBA::MARSHAL (), + TAO::TRAVERSE_STOP); +} + +TAO::traverse_status +TAO_Marshal_Alias::append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) +{ + // Typecode of the aliased type. + CORBA::TypeCode_var tc2; + CORBA::Boolean continue_append = 1; + + // Status of decode operation. + TAO::traverse_status retval = + TAO::TRAVERSE_CONTINUE; + + tc2 = tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + retval = TAO_Marshal_Object::perform_append (tc2.in (), + src, + dest + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + if (retval == TAO::TRAVERSE_CONTINUE + && continue_append == 1) + return TAO::TRAVERSE_CONTINUE; + + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Alias::append detected error\n"))); + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); +} + +// Decode exception For exceptions, the "hidden" type ID near the +// front of the on-wire representation was previously unmarshaled and +// mapped to the "tc" typcode we're using to traverse the memory ... +// at the same time its vtable, refcount, and other state was +// established. +// +// NOTE: This is asymmetric with respect to encoding exceptions. +TAO::traverse_status +TAO_Marshal_Except::append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) +{ + TAO::traverse_status retval = + TAO::TRAVERSE_CONTINUE; + CORBA::Boolean continue_append = 1; + CORBA::TypeCode_var param; + + // first append the RepositoryID + continue_append = dest->append_string (*src); + + // Number of fields in the struct. + const CORBA::ULong member_count = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + for (CORBA::ULong i = 0; + i < member_count + && retval == TAO::TRAVERSE_CONTINUE + && continue_append == 1; + ++i) + { + param = tc->member_type (i ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + retval = TAO_Marshal_Object::perform_append (param.in (), + src, + dest + ACE_ENV_ARG_PARAMETER); + } + + if (retval == TAO::TRAVERSE_CONTINUE + && continue_append == 1) + return TAO::TRAVERSE_CONTINUE; + + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Except::append detected error\n"))); + + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); +} + +TAO::traverse_status +TAO_Marshal_WString::append (CORBA::TypeCode_ptr, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) +{ + CORBA::Boolean continue_append = 1; + + // On decode, omit the check against specified wstring bounds, and + // cope with illegal "zero length" strings (all lengths on the wire + // must include a NUL). + // + // This is on the principle of being gracious in what we accept; we + // don't generate messages that fail to comply with protocol specs, + // but we will accept them when it's clear how to do so. + + continue_append = dest->append_wstring (*src); + + if (continue_append == 1) + return TAO::TRAVERSE_CONTINUE; + + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_WString::append detected error\n"))); + + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); +} + +TAO::traverse_status +TAO_Marshal_Value::append (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src, + TAO_OutputCDR *dest + ACE_ENV_ARG_DECL) +{ + TAO::traverse_status retval = + TAO::TRAVERSE_CONTINUE; + + // Use the same method to append our base valuetype. + // To achive this we'll need to distinguish between + // first-time/nested appends so that we won't attempt to + // append rep_id several times. + // + if (this->nested_processing_ == 0) + { + this->nested_processing_ = 1; + + CORBA::ULong value_tag; + + if (!src->read_ulong (value_tag) || + !dest->write_ulong (value_tag)) + { + return TAO::TRAVERSE_STOP; + } + + TAO_Valuetype_Adapter *adapter = + ACE_Dynamic_Service::instance ( + TAO_ORB_Core::valuetype_adapter_name () + ); + + if (adapter == 0) + { + ACE_THROW_RETURN (CORBA::INTERNAL (), + TAO::TRAVERSE_STOP); + } + + if (value_tag == 0) // Null value type pointer. + { + //We are done. + return retval; + } + else if (value_tag & adapter->type_info_single ()) + { + // Append repository id which is of type string. + dest->append_string (*src); + } + else + { + //@@ boris: VT CDR + return TAO::TRAVERSE_STOP; + } + } + + // Handle our base valuetype if any. + CORBA::TypeCode_var param = + tc->concrete_base_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + CORBA::TCKind const param_kind = param->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + if (param_kind != CORBA::tk_null) + { + retval = this->append (param.in (), + src, + dest + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + if (retval != TAO::TRAVERSE_CONTINUE) + { + return retval; + } + } + + // Number of fields in the struct. + const CORBA::ULong member_count = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + for (CORBA::ULong i = 0; + i < member_count && retval == TAO::TRAVERSE_CONTINUE; + ++i) + { + // get member type + param = tc->member_type (i ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + retval = + TAO_Marshal_Object::perform_append (param.in (), + src, + dest + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + } + + if (retval == TAO::TRAVERSE_CONTINUE) + return TAO::TRAVERSE_CONTINUE; + + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Value::append detected error\n"))); + + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); +} diff --git a/TAO/tao/AnyTypeCode/orb_typesA.cpp b/TAO/tao/AnyTypeCode/orb_typesA.cpp new file mode 100644 index 00000000000..92c9bc9bc46 --- /dev/null +++ b/TAO/tao/AnyTypeCode/orb_typesA.cpp @@ -0,0 +1,114 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "orb_typesA.h" +#include "tao/AnyTypeCode/Null_RefCount_Policy.h" +#include "tao/AnyTypeCode/TypeCode_Constants.h" +#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" +#include "tao/AnyTypeCode/String_TypeCode_Static.h" +#include "tao/CDR.h" +#include "tao/AnyTypeCode/Any.h" + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_CORBA_ORBid ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/ORBid:1.0", + "ORBid", + &CORBA::_tc_string); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_ORBid = + &_tao_tc_CORBA_ORBid; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_CORBA_Flags ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/Flags:1.0", + "Flags", + &CORBA::_tc_ulong); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_Flags = + &_tao_tc_CORBA_Flags; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_CORBA_Identifier ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/Identifier:1.0", + "Identifier", + &CORBA::_tc_string); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_Identifier = + &_tao_tc_CORBA_Identifier; +} + + + +// TAO_IDL - Generated from +// be\be_visitor_typecode/alias_typecode.cpp:50 + +static TAO::TypeCode::Alias + _tao_tc_CORBA_RepositoryId ( + CORBA::tk_alias, + "IDL:omg.org/CORBA/RepositoryId:1.0", + "RepositoryId", + &CORBA::_tc_string); + +namespace CORBA +{ + ::CORBA::TypeCode_ptr const _tc_RepositoryId = + &_tao_tc_CORBA_RepositoryId; +} + + diff --git a/TAO/tao/AnyTypeCode/orb_typesA.h b/TAO/tao/AnyTypeCode/orb_typesA.h new file mode 100644 index 00000000000..ca3709243f9 --- /dev/null +++ b/TAO/tao/AnyTypeCode/orb_typesA.h @@ -0,0 +1,73 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// be\be_codegen.cpp:788 + +#ifndef _TAO_IDL_ANYTYPECODE_ORB_TYPESA_H_ +#define _TAO_IDL_ANYTYPECODE_ORB_TYPESA_H_ + +#include /**/ "ace/pre.h" + +#include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" +#include "tao/orb_typesC.h" + + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:59 + +namespace CORBA +{ + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_ORBid; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_Flags; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_Identifier; + + // TAO_IDL - Generated from + // be\be_visitor_typecode/typecode_decl.cpp:49 + + extern TAO_AnyTypeCode_Export ::CORBA::TypeCode_ptr const _tc_RepositoryId; + +// TAO_IDL - Generated from +// be\be_visitor_module/module_ch.cpp:86 + +} // module CORBA + +#include /**/ "ace/post.h" + +#endif /* ifndef */ diff --git a/TAO/tao/AnyTypeCode/skip.cpp b/TAO/tao/AnyTypeCode/skip.cpp new file mode 100644 index 00000000000..31fd7a14552 --- /dev/null +++ b/TAO/tao/AnyTypeCode/skip.cpp @@ -0,0 +1,1042 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO +// +// = FILENAME +// skip.cpp +// +// = DESCRIPTION +// Code for skipping different data types +// +// Data types encoded as CDR streams need to be skipped when they +// are part of an Any. +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +#include "Marshal.h" +#include "TypeCode.h" +#include "Any_Unknown_IDL_Type.h" +#include "Any.h" + +#include "tao/debug.h" +#include "tao/Valuetype_Adapter.h" +#include "tao/ORB_Core.h" +#include "tao/CDR.h" +#include "tao/SystemException.h" + +#include "ace/Dynamic_Service.h" + +ACE_RCSID (tao, + skip, + "$Id$") + +TAO::traverse_status +TAO_Marshal_Primitive::skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *stream + ACE_ENV_ARG_DECL) +{ + CORBA::Boolean continue_skipping = 1; + + // Status of skip operation. + TAO::traverse_status retval = TAO::TRAVERSE_CONTINUE; + + CORBA::TCKind const k = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + switch (k) + { + case CORBA::tk_null: + case CORBA::tk_void: + break; + case CORBA::tk_short: + case CORBA::tk_ushort: + continue_skipping = stream->skip_short (); + break; + case CORBA::tk_long: + case CORBA::tk_ulong: + case CORBA::tk_float: + case CORBA::tk_enum: + continue_skipping = stream->skip_long (); + break; + case CORBA::tk_double: + case CORBA::tk_longlong: + case CORBA::tk_ulonglong: + continue_skipping = stream->skip_longlong (); + break; + case CORBA::tk_boolean: + continue_skipping = stream->skip_boolean (); + break; + case CORBA::tk_char: + case CORBA::tk_octet: + continue_skipping = stream->skip_char (); + break; + case CORBA::tk_longdouble: + continue_skipping = stream->skip_longdouble (); + break; + case CORBA::tk_wchar: + continue_skipping = stream->skip_wchar (); + break; + default: + retval = TAO::TRAVERSE_STOP; + // we are not a primitive type + } + if (retval == TAO::TRAVERSE_CONTINUE + && continue_skipping == 1) + return TAO::TRAVERSE_CONTINUE; + else + { + if (TAO_debug_level > 0) + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Primitive::skip detected error\n") + )); + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); + } +} + +TAO::traverse_status +TAO_Marshal_Any::skip (CORBA::TypeCode_ptr, + TAO_InputCDR *stream + ACE_ENV_ARG_DECL) +{ + // Typecode of the element that makes the Any. + CORBA::TypeCode_var elem_tc; + + // Status of encode operation. + if (!(*stream >> elem_tc.inout ())) + return TAO::TRAVERSE_STOP; + + return TAO_Marshal_Object::perform_skip (elem_tc.in (), + stream + ACE_ENV_ARG_PARAMETER); +} + +TAO::traverse_status +TAO_Marshal_TypeCode::skip (CORBA::TypeCode_ptr, + TAO_InputCDR *stream + ACE_ENV_ARG_DECL) +{ + CORBA::Boolean continue_skipping = 1; + + // Typecode kind. + CORBA::ULong kind; + + // Decode the "kind" field of the typecode from the stream. + continue_skipping = stream->read_ulong (kind); + + if (continue_skipping == 1) + { + // Typecodes with empty parameter lists all have preallocated + // constants. We use those to reduce memory consumption and + // heap access ... also, to speed things up! + if ((kind < CORBA::TAO_TC_KIND_COUNT) || + (kind == ~0u)) + { + // Either a non-constant typecode or an indirected typecode. + switch (kind) + { + // Need special handling for all kinds of typecodes that + // have nonempty parameter lists ... + default: + // simple typecodes, nothing to do + break; + case CORBA::tk_string: + case CORBA::tk_wstring: + { + // skip the bounds + continue_skipping = stream->skip_ulong (); + } + break; + + // Indirected typecodes, illegal at "top level". + case ~0u: + { + // skip the long indicating the encapsulation offset, + continue_skipping = stream->skip_long (); + } + break; + + // The rest have "complex" parameter lists that are + // encoded as bulk octets ... + case CORBA::tk_objref: + case CORBA::tk_struct: + case CORBA::tk_union: + case CORBA::tk_enum: + case CORBA::tk_sequence: + case CORBA::tk_array: + case CORBA::tk_alias: + case CORBA::tk_except: + case CORBA::tk_value: + case CORBA::tk_value_box: + case CORBA::tk_native: + case CORBA::tk_abstract_interface: + case CORBA::tk_local_interface: + case CORBA::tk_component: + case CORBA::tk_home: + case CORBA::tk_event: + { + CORBA::ULong length; + + // get the encapsulation length + continue_skipping = stream->read_ulong (length); + if (!continue_skipping) + break; + // skip the encapsulation + continue_skipping = stream->skip_bytes (length); + } + } // end of switch + } + else // bad kind_ value to be decoded + { + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_TypeCode::skip: ") + ACE_TEXT ("Bad kind_ value in CDR stream\n"))); + ACE_THROW_RETURN (CORBA::BAD_TYPECODE (), + TAO::TRAVERSE_STOP); + } + } + + if (continue_skipping == 1) + return TAO::TRAVERSE_CONTINUE; + else + { + if (TAO_debug_level > 0) + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("TAO_Marshal_TypeCode::skip detected error\n") + )); + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); + } +} + +TAO::traverse_status +TAO_Marshal_Principal::skip (CORBA::TypeCode_ptr, + TAO_InputCDR *stream + ACE_ENV_ARG_DECL) +{ + CORBA::Boolean continue_skipping = 1; + + // specifies the number of bytes in the Principal + CORBA::ULong len; + + continue_skipping = stream->read_ulong (len); + if (len > 0 && continue_skipping) + { + continue_skipping = stream->skip_bytes (len); + } + + if (continue_skipping == 1) + return TAO::TRAVERSE_CONTINUE; + else + { + if (TAO_debug_level > 0) + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Principal::skip detected error\n") + )); + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); + } +} + +TAO::traverse_status +TAO_Marshal_ObjRef::skip (CORBA::TypeCode_ptr, + TAO_InputCDR *stream + ACE_ENV_ARG_DECL) +{ + CORBA::Boolean continue_skipping = 1; + + // return status + TAO::traverse_status retval = + TAO::TRAVERSE_CONTINUE; + + // First, skip the type hint. This will be the type_id encoded in an + // object reference. + stream->skip_string (); + + // Read the profiles, discarding all until an IIOP profile comes by. + // Once we see an IIOP profile, ignore any further ones. + // + // XXX this will need to change someday to let different protocol + // code be accessed, not just IIOP. Protocol modules will be + // dynamically loaded from shared libraries via ORB_init (), and we + // just need to be able to access such preloaded libraries here as + // we unmarshal objrefs. + CORBA::ULong profiles = 0; + + // get the count of profiles that follow + continue_skipping = stream->read_ulong (profiles); + + while (profiles-- != 0 && continue_skipping) + { + CORBA::ULong tag; + + // get the profile ID tag + if ( (continue_skipping = stream->read_ulong (tag)) == 0) + continue; + + CORBA::ULong encap_len; + // ProfileData is encoded as a sequence of octet. So first get + // the length of the sequence. + // Create the decoding stream from the encapsulation in the + // buffer, and skip the encapsulation. + if ( (continue_skipping = stream->read_ulong (encap_len)) == 0) + continue; + + continue_skipping = stream->skip_bytes (encap_len); + } + + if (retval == TAO::TRAVERSE_CONTINUE + && continue_skipping == 1) + return TAO::TRAVERSE_CONTINUE; + else + { + if (TAO_debug_level > 0) + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT ("TAO_Marshal_ObjRef::skip detected error\n") + )); + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); + } +} + +TAO::traverse_status +TAO_Marshal_Struct::skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *stream + ACE_ENV_ARG_DECL) +{ + TAO::traverse_status retval = TAO::TRAVERSE_CONTINUE; + CORBA::TypeCode_var param; + + // Number of fields in the struct. + const CORBA::ULong member_count = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + for (CORBA::ULong i = 0; + i < member_count && retval == TAO::TRAVERSE_CONTINUE; + ++i) + { + param = tc->member_type (i ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + retval = TAO_Marshal_Object::perform_skip (param.in (), + stream + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + } + + if (retval == TAO::TRAVERSE_CONTINUE) + return TAO::TRAVERSE_CONTINUE; + + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Struct::skip detected error\n"))); + + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); +} + +TAO::traverse_status +TAO_Marshal_Union::skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *src + ACE_ENV_ARG_DECL) +{ + CORBA::TypeCode_var discrim_tc = + tc->discriminator_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + CORBA::ULong kind = + discrim_tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + // Save the discriminator value in a temporary variable... + CORBA::Short short_v; + CORBA::UShort ushort_v; + CORBA::Long long_v; + CORBA::ULong ulong_v; + CORBA::ULong enum_v; + CORBA::Char char_v; + CORBA::WChar wchar_v; + CORBA::Boolean boolean_v = false;; + + switch (kind) + { + case CORBA::tk_short: + { + if (!src->read_short (short_v)) + return TAO::TRAVERSE_STOP; + } + break; + + case CORBA::tk_ushort: + { + if (!src->read_ushort (ushort_v)) + return TAO::TRAVERSE_STOP; + } + break; + + case CORBA::tk_long: + { + if (!src->read_long (long_v)) + return TAO::TRAVERSE_STOP; + } + break; + + case CORBA::tk_ulong: + { + if (!src->read_ulong (ulong_v)) + return TAO::TRAVERSE_STOP; + } + break; + + case CORBA::tk_enum: + { + if (!src->read_ulong (enum_v)) + return TAO::TRAVERSE_STOP; + } + break; + + case CORBA::tk_char: + { + if (!src->read_char (char_v)) + return TAO::TRAVERSE_STOP; + } + break; + + case CORBA::tk_wchar: + { + if (!src->read_wchar (wchar_v)) + return TAO::TRAVERSE_STOP; + } + break; + + case CORBA::tk_boolean: + { + if (!src->read_boolean (boolean_v)) + return TAO::TRAVERSE_STOP; + } + break; + + default: + return TAO::TRAVERSE_STOP; + } + + const CORBA::ULong member_count = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + const CORBA::ULong null_member = ~static_cast (0U); + + CORBA::ULong current_member = null_member; + CORBA::ULong default_member = null_member; + + for (CORBA::ULong i = 0; + i < member_count && current_member == null_member; + ++i) + { + CORBA::Any_var any = tc->member_label (i ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + CORBA::Octet o; + if ((any >>= CORBA::Any::to_octet (o)) && o == 0) + { + CORBA::ULong default_index = + tc->default_index (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + if (i != default_index) + ACE_THROW_RETURN (CORBA::BAD_TYPECODE (), + TAO::TRAVERSE_STOP); + // Found the default branch, save its position and continue + // trying to find the current value... + default_member = i; + continue; + } + + switch (kind) + { + case CORBA::tk_short: + { + CORBA::Short d; + if ((any >>= d) && d == short_v) + current_member = i; + } + break; + + case CORBA::tk_ushort: + { + CORBA::UShort d; + if ((any >>= d) && d == ushort_v) + current_member = i; + } + break; + + case CORBA::tk_long: + { + CORBA::Long d; + if ((any >>= d) && d == long_v) + current_member = i; + } + break; + + case CORBA::tk_ulong: + { + CORBA::ULong d; + if ((any >>= d) && d == ulong_v) + current_member = i; + } + break; + + case CORBA::tk_enum: + { + CORBA::ULong d; + TAO::Any_Impl *impl = any->impl (); + + if (impl->encoded ()) + { + TAO::Unknown_IDL_Type *unk = + dynamic_cast (impl); + + // We don't want unk's rd_ptr to move, in case + // we are shared by another Any, so we use this + // to copy the state, not the buffer. + TAO_InputCDR for_reading (unk->_tao_get_cdr ()); + + for_reading.read_ulong (d); + } + else + { + TAO_OutputCDR out; + impl->marshal_value (out); + TAO_InputCDR cdr (out); + cdr.read_ulong (d); + } + + if (d == enum_v) + { + current_member = i; + } + } + break; + + case CORBA::tk_char: + { + CORBA::Char d; + if ((any >>= CORBA::Any::to_char (d)) && d == char_v) + current_member = i; + } + break; + + case CORBA::tk_wchar: + { + CORBA::WChar d; + if ((any >>= CORBA::Any::to_wchar (d)) && d == wchar_v) + current_member = i; + } + break; + + case CORBA::tk_boolean: + { + CORBA::Boolean d; + if ((any >>= CORBA::Any::to_boolean (d)) && d == boolean_v) + current_member = i; + } + break; + + default: + return TAO::TRAVERSE_STOP; + } + } + + if (current_member == null_member) + { + // Cannot find the current member, check if there is a + // default... + if (default_member != null_member) + { + // Good, use the default to append... + CORBA::TypeCode_var member_tc = + tc->member_type (default_member ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + return TAO_Marshal_Object::perform_skip (member_tc.in (), + src + ACE_ENV_ARG_PARAMETER); + } + + // If we're here, we have an implicit default case, and we + // should just return without skipping anything, since no + // union member was marshaled in the first place. + return TAO::TRAVERSE_CONTINUE; + } + + // If we found the member successfully then just use that one... + CORBA::TypeCode_var member_tc = + tc->member_type (current_member ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + return TAO_Marshal_Object::perform_skip (member_tc.in (), + src + ACE_ENV_ARG_PARAMETER); +} + +TAO::traverse_status +TAO_Marshal_String::skip (CORBA::TypeCode_ptr, + TAO_InputCDR *stream + ACE_ENV_ARG_DECL) +{ + CORBA::Boolean continue_skipping = 1; + + // On decode, omit the check against specified string bounds, and + // cope with illegal "zero length" strings (all lengths on the wire + // must include a NUL). + // + // This is on the principle of being gracious in what we accept; we + // don't generate messages that fail to comply with protocol specs, + // but we will accept them when it's clear how to do so. + + continue_skipping = stream->skip_string (); + if (continue_skipping == 1) + return TAO::TRAVERSE_CONTINUE; + else + { + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_String::skip detected error\n"))); + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); + } +} + +TAO::traverse_status +TAO_Marshal_Sequence::skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *stream + ACE_ENV_ARG_DECL) +{ + // Size of element. + CORBA::ULong bounds; + + // First unmarshal the sequence length ... we trust it to be right + // here, on the "be gracious in what you accept" principle. We + // don't generate illegal sequences (i.e. length > bounds). + + CORBA::Boolean continue_skipping = + stream->read_ulong (bounds); + + if (!continue_skipping) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Sequence::skip detected error\n"))); + ACE_THROW_RETURN (CORBA::MARSHAL (), + TAO::TRAVERSE_STOP); + } + + // No point decoding an empty sequence. + if (bounds == 0) + return TAO::TRAVERSE_CONTINUE; + + // Get element typecode. + CORBA::TypeCode_var tc2 = + tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + // For CORBA basic types, the skip can be optimized + CORBA::TCKind kind = tc2->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + char *dummy; + switch (kind) + { + case CORBA::tk_octet: + case CORBA::tk_boolean: + case CORBA::tk_char: + { + stream->adjust (0, ACE_CDR::OCTET_ALIGN, dummy); + continue_skipping = + stream->skip_bytes (ACE_CDR::OCTET_SIZE * bounds); + } + break; + case CORBA::tk_short: + case CORBA::tk_ushort: + case CORBA::tk_wchar: + { + stream->adjust (0, ACE_CDR::SHORT_ALIGN, dummy); + continue_skipping = + stream->skip_bytes (ACE_CDR::SHORT_SIZE * bounds); + } + break; + case CORBA::tk_long: + case CORBA::tk_ulong: + case CORBA::tk_float: + { + stream->adjust (0, ACE_CDR::LONG_ALIGN, dummy); + continue_skipping = + stream->skip_bytes (ACE_CDR::LONG_SIZE * bounds); + } + break; + case CORBA::tk_double: + case CORBA::tk_longlong: + case CORBA::tk_ulonglong: + { + stream->adjust (0, ACE_CDR::LONGLONG_ALIGN, dummy); + continue_skipping = + stream->skip_bytes (ACE_CDR::LONGLONG_SIZE * bounds); + } + break; + case CORBA::tk_longdouble: + { + stream->adjust (0, ACE_CDR::LONGDOUBLE_ALIGN, dummy); + continue_skipping = + stream->skip_bytes (ACE_CDR::LONGDOUBLE_SIZE * bounds); + } + break; + + default: + while (bounds-- && continue_skipping == 1) + { + continue_skipping = + TAO_Marshal_Object::perform_skip (tc2.in (), + stream + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + } + break; + }// end of switch + + if (continue_skipping) + return TAO::TRAVERSE_CONTINUE; + + // error exit + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Sequence::skip detected error\n"))); + + ACE_THROW_RETURN (CORBA::MARSHAL (), + TAO::TRAVERSE_STOP); +} + +TAO::traverse_status +TAO_Marshal_Array::skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *stream + ACE_ENV_ARG_DECL) +{ + CORBA::Boolean continue_skipping = 1; + + + // retrieve the bounds of the array + CORBA::ULong bounds = tc->length (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + // get element typecode + // Typecode of the element. + CORBA::TypeCode_var tc2 = tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + // For CORBA basic types, the skip can be optimized + CORBA::TCKind kind = tc2->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + char *dummy; + switch (kind) + { + case CORBA::tk_octet: + case CORBA::tk_boolean: + case CORBA::tk_char: + { + stream->adjust (0, ACE_CDR::OCTET_ALIGN, dummy); + continue_skipping = + stream->skip_bytes (ACE_CDR::OCTET_SIZE * bounds); + } + break; + case CORBA::tk_short: + case CORBA::tk_ushort: + case CORBA::tk_wchar: + { + stream->adjust (0, ACE_CDR::SHORT_ALIGN, dummy); + continue_skipping = + stream->skip_bytes (ACE_CDR::SHORT_SIZE * bounds); + } + break; + case CORBA::tk_long: + case CORBA::tk_ulong: + case CORBA::tk_float: + { + stream->adjust (0, ACE_CDR::LONG_ALIGN, dummy); + continue_skipping = + stream->skip_bytes (ACE_CDR::LONG_SIZE * bounds); + } + break; + case CORBA::tk_double: + case CORBA::tk_longlong: + case CORBA::tk_ulonglong: + { + stream->adjust (0, ACE_CDR::LONGLONG_ALIGN, dummy); + continue_skipping = + stream->skip_bytes (ACE_CDR::LONGLONG_SIZE * bounds); + } + break; + case CORBA::tk_longdouble: + { + stream->adjust (0, ACE_CDR::LONGDOUBLE_ALIGN, dummy); + continue_skipping = + stream->skip_bytes (ACE_CDR::LONGDOUBLE_SIZE * bounds); + } + break; + + default: + while (bounds-- && continue_skipping == 1) + { + int stop = + TAO_Marshal_Object::perform_skip (tc2.in (), + stream + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + if (stop == TAO::TRAVERSE_STOP) + continue_skipping = 0; + } + break; + }// end of switch + + if (continue_skipping) + return TAO::TRAVERSE_CONTINUE; + + // error exit + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Sequence::skip detected error\n"))); + + ACE_THROW_RETURN (CORBA::MARSHAL (), + TAO::TRAVERSE_STOP); +} + +TAO::traverse_status +TAO_Marshal_Alias::skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *stream + ACE_ENV_ARG_DECL) +{ + // Typecode of the aliased type. + CORBA::TypeCode_var tc2; + CORBA::Boolean continue_skipping = 1; + + // Status of decode operation. + TAO::traverse_status retval = + TAO::TRAVERSE_CONTINUE; + + tc2 = tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + retval = TAO_Marshal_Object::perform_skip (tc2.in (), + stream + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + // tc2->_decr_refcnt (); + if (retval == TAO::TRAVERSE_CONTINUE + && continue_skipping == 1) + return TAO::TRAVERSE_CONTINUE; + + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Alias::skip detected error\n"))); + + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); +} + +// Decode exception For exceptions, the "hidden" type ID near the +// front of the on-wire representation was previously unmarshaled and +// mapped to the "tc" typcode we're using to traverse the memory ... +// at the same time its vtable, refcount, and other state was +// established. +// +// NOTE: This is asymmetric with respect to encoding exceptions. +TAO::traverse_status +TAO_Marshal_Except::skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *stream + ACE_ENV_ARG_DECL) +{ + TAO::traverse_status retval = + TAO::TRAVERSE_CONTINUE; + CORBA::TypeCode_var param; + + // skip the Repository ID + if (!stream->skip_string ()) + return TAO::TRAVERSE_STOP; + + // Number of fields in the exception + const CORBA::ULong member_count = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + for (CORBA::ULong i = 0; + i < member_count && retval == TAO::TRAVERSE_CONTINUE; + ++i) + { + param = tc->member_type (i ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + retval = TAO_Marshal_Object::perform_skip (param.in (), + stream + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + } + + if (retval == TAO::TRAVERSE_CONTINUE) + return TAO::TRAVERSE_CONTINUE; + + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Except::skip detected error\n"))); + + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); +} + +// decode wstring +TAO::traverse_status +TAO_Marshal_WString::skip (CORBA::TypeCode_ptr, + TAO_InputCDR *stream + ACE_ENV_ARG_DECL) +{ + ACE_CDR::Boolean continue_skipping = 1; + + // On decode, omit the check against specified wstring bounds, and + // cope with illegal "zero length" strings (all lengths on the wire + // must include a NUL). + // + // This is on the principle of being gracious in what we accept; we + // don't generate messages that fail to comply with protocol specs, + // but we will accept them when it's clear how to do so. + + // "zero length" wstrings are legal in GIOP 1.2. + + continue_skipping = stream->skip_wstring (); + + if (continue_skipping == 1) + return TAO::TRAVERSE_CONTINUE; + + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_WString::skip detected error\n"))); + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); +} + +TAO::traverse_status +TAO_Marshal_Value::skip (CORBA::TypeCode_ptr tc, + TAO_InputCDR *stream + ACE_ENV_ARG_DECL) +{ + TAO::traverse_status retval = TAO::TRAVERSE_CONTINUE; + CORBA::TypeCode_var param; + + // Use the same method to skip over our base valuetype. + // To achive this we'll need to distinguish between + // first-time/nested skips so that we won't attempt to + // skip rep_id several times. + // + if (this->nested_processing_ == 0) + { + this->nested_processing_ = 1; + + CORBA::ULong value_tag; + + if (!stream->read_ulong (value_tag)) + { + return TAO::TRAVERSE_STOP; + } + + TAO_Valuetype_Adapter *adapter = + ACE_Dynamic_Service::instance ( + TAO_ORB_Core::valuetype_adapter_name () + ); + + if (adapter == 0) + { + ACE_THROW_RETURN (CORBA::INTERNAL (), + TAO::TRAVERSE_STOP); + } + + if (value_tag == 0) // Null value type pointer. + { + //We are done. + return retval; + } + else if (value_tag & adapter->type_info_single ()) + { + // Skip a single repository id which is of type string. + stream->skip_string (); + } + else + { + //@@ boris: VT CDR + return TAO::TRAVERSE_STOP; + } + } + + // Handle our base valuetype if any. + param = tc->concrete_base_type (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + CORBA::TCKind const k = param->kind (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + if (k != CORBA::tk_null) + { + retval = this->skip (param.in (), stream ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + if (retval != TAO::TRAVERSE_CONTINUE) + { + return retval; + } + } + + // Number of fields in the valuetype. + const CORBA::ULong member_count = + tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + for (CORBA::ULong i = 0; + i < member_count && retval == TAO::TRAVERSE_CONTINUE; + ++i) + { + param = tc->member_type (i ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + + retval = TAO_Marshal_Object::perform_skip (param.in (), + stream + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO::TRAVERSE_STOP); + } + + if (retval == TAO::TRAVERSE_CONTINUE) + return TAO::TRAVERSE_CONTINUE; + + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO_Marshal_Value::skip detected error\n"))); + + ACE_THROW_RETURN (CORBA::MARSHAL (0, + CORBA::COMPLETED_MAYBE), + TAO::TRAVERSE_STOP); +} -- cgit v1.2.1