summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/be')
-rw-r--r--TAO/TAO_IDL/be/be_argument.cpp91
-rw-r--r--TAO/TAO_IDL/be/be_array.cpp275
-rw-r--r--TAO/TAO_IDL/be/be_attribute.cpp164
-rw-r--r--TAO/TAO_IDL/be/be_codegen.cpp2436
-rw-r--r--TAO/TAO_IDL/be/be_component.cpp132
-rw-r--r--TAO/TAO_IDL/be/be_component_fwd.cpp84
-rw-r--r--TAO/TAO_IDL/be/be_constant.cpp68
-rw-r--r--TAO/TAO_IDL/be/be_decl.cpp967
-rw-r--r--TAO/TAO_IDL/be/be_enum.cpp92
-rw-r--r--TAO/TAO_IDL/be/be_enum_val.cpp69
-rw-r--r--TAO/TAO_IDL/be/be_eventtype.cpp143
-rw-r--r--TAO/TAO_IDL/be/be_eventtype_fwd.cpp87
-rw-r--r--TAO/TAO_IDL/be/be_exception.cpp96
-rw-r--r--TAO/TAO_IDL/be/be_expression.cpp95
-rw-r--r--TAO/TAO_IDL/be/be_factory.cpp75
-rw-r--r--TAO/TAO_IDL/be/be_field.cpp78
-rw-r--r--TAO/TAO_IDL/be/be_generator.cpp913
-rw-r--r--TAO/TAO_IDL/be/be_global.cpp2695
-rw-r--r--TAO/TAO_IDL/be/be_helper.cpp595
-rw-r--r--TAO/TAO_IDL/be/be_home.cpp143
-rw-r--r--TAO/TAO_IDL/be/be_init.cpp31
-rw-r--r--TAO/TAO_IDL/be/be_interface.cpp2657
-rw-r--r--TAO/TAO_IDL/be/be_interface_fwd.cpp99
-rw-r--r--TAO/TAO_IDL/be/be_interface_strategy.cpp1124
-rw-r--r--TAO/TAO_IDL/be/be_module.cpp68
-rw-r--r--TAO/TAO_IDL/be/be_native.cpp96
-rw-r--r--TAO/TAO_IDL/be/be_operation.cpp153
-rw-r--r--TAO/TAO_IDL/be/be_operation_strategy.cpp381
-rw-r--r--TAO/TAO_IDL/be/be_predefined_type.cpp240
-rw-r--r--TAO/TAO_IDL/be/be_produce.cpp220
-rw-r--r--TAO/TAO_IDL/be/be_root.cpp126
-rw-r--r--TAO/TAO_IDL/be/be_scope.cpp105
-rw-r--r--TAO/TAO_IDL/be/be_sequence.cpp760
-rw-r--r--TAO/TAO_IDL/be/be_stream_factory.cpp43
-rw-r--r--TAO/TAO_IDL/be/be_string.cpp150
-rw-r--r--TAO/TAO_IDL/be/be_structure.cpp109
-rw-r--r--TAO/TAO_IDL/be/be_structure_fwd.cpp72
-rw-r--r--TAO/TAO_IDL/be/be_sunsoft.cpp191
-rw-r--r--TAO/TAO_IDL/be/be_tmplinst.cpp15
-rw-r--r--TAO/TAO_IDL/be/be_type.cpp344
-rw-r--r--TAO/TAO_IDL/be/be_typedef.cpp131
-rw-r--r--TAO/TAO_IDL/be/be_union.cpp196
-rw-r--r--TAO/TAO_IDL/be/be_union_branch.cpp200
-rw-r--r--TAO/TAO_IDL/be/be_union_fwd.cpp78
-rw-r--r--TAO/TAO_IDL/be/be_union_label.cpp35
-rw-r--r--TAO/TAO_IDL/be/be_util.cpp58
-rw-r--r--TAO/TAO_IDL/be/be_valuebox.cpp96
-rw-r--r--TAO/TAO_IDL/be/be_valuetype.cpp942
-rw-r--r--TAO/TAO_IDL/be/be_valuetype_fwd.cpp84
-rw-r--r--TAO/TAO_IDL/be/be_visitor.cpp224
-rw-r--r--TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp858
-rw-r--r--TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp1258
-rw-r--r--TAO/TAO_IDL/be/be_visitor_arg_traits.cpp1165
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument.cpp61
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp455
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/argument.cpp98
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp681
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp695
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp237
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/post_upcall_ss.cpp133
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp424
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp457
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array.cpp60
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/any_op_ch.cpp66
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp134
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/array.cpp236
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp349
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp366
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp358
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp159
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp795
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/serializer_op_ch.cpp166
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/serializer_op_cs.cpp1227
-rw-r--r--TAO/TAO_IDL/be/be_visitor_attribute.cpp41
-rw-r--r--TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp431
-rw-r--r--TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp1922
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component.cpp60
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/any_op_ch.cpp46
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/any_op_cs.cpp46
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/cdr_op_ch.cpp47
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/cdr_op_cs.cpp42
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/component.cpp359
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp279
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp71
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp335
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/component_ih.cpp42
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/component_is.cpp43
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp306
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/component_si.cpp44
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/component_ss.cpp44
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component_fwd.cpp35
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component_fwd/any_op_ch.cpp49
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component_fwd/cdr_op_ch.cpp48
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component_fwd/component_fwd_ch.cpp48
-rw-r--r--TAO/TAO_IDL/be/be_visitor_constant.cpp37
-rw-r--r--TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp147
-rw-r--r--TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp139
-rw-r--r--TAO/TAO_IDL/be/be_visitor_context.cpp654
-rw-r--r--TAO/TAO_IDL/be/be_visitor_decl.cpp108
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum.cpp40
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp67
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp118
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ch.cpp64
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/cdr_op_cs.cpp80
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp121
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/enum_cs.cpp70
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/serializer_op_ch.cpp62
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/serializer_op_cs.cpp76
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception.cpp58
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/any_op_ch.cpp177
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp293
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp80
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp203
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp424
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception.cpp109
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp152
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception_ci.cpp59
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp361
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp462
-rw-r--r--TAO/TAO_IDL/be/be_visitor_factory.cpp144
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field.cpp59
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp248
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp981
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp607
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp162
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp205
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/serializer_op_ch.cpp249
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/serializer_op_cs.cpp1137
-rw-r--r--TAO/TAO_IDL/be/be_visitor_home.cpp37
-rw-r--r--TAO/TAO_IDL/be/be_visitor_home/home_ch.cpp80
-rw-r--r--TAO/TAO_IDL/be/be_visitor_home/home_cs.cpp64
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface.cpp96
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/amh_ch.cpp105
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/amh_rh_sh.cpp97
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/amh_rh_ss.cpp102
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp433
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/amh_si.cpp230
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp339
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/ami_interface_ch.cpp67
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp124
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp266
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/base_proxy_broker_ch.cpp81
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/base_proxy_impl_ch.cpp191
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp84
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp149
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp212
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_ss.cpp178
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface.cpp853
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp463
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp112
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp659
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp176
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp196
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp406
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp137
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp1079
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/proxy_brokers_ch.cpp72
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/proxy_impls_ch.cpp72
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp94
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_cs.cpp106
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_ch.cpp169
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp203
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp359
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp95
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp131
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp186
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp252
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp39
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp126
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp79
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp61
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module.cpp75
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/any_op.cpp52
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/cdr_op.cpp52
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/module.cpp1231
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/module_ch.cpp93
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/module_ih.cpp52
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp87
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/serializer_op.cpp52
-rw-r--r--TAO/TAO_IDL/be/be_visitor_native.cpp32
-rw-r--r--TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp65
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation.cpp99
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp106
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp253
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp225
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp423
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp111
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp319
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_exception_holder_operation_cs.cpp48
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp84
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp461
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp196
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/argument.cpp221
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp170
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp287
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/base_proxy_impl_ch.cpp71
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp192
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp94
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/exceptlist_ss.cpp85
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation.cpp711
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp95
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp161
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp99
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp111
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp121
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp345
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/proxy_impl_xh.cpp63
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/remote_proxy_impl_cs.cpp144
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp406
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/rettype_return_cs.cpp247
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_ch.cpp102
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp172
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp95
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp164
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp410
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root.cpp80
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/any_op.cpp69
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp52
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root.cpp1738
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp84
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_ci.cpp53
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp54
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_ih.cpp55
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_is.cpp54
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp59
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_si.cpp68
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp70
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp183
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/serializer_op.cpp52
-rw-r--r--TAO/TAO_IDL/be/be_visitor_scope.cpp244
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence.cpp65
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp83
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp158
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp283
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp106
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp256
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/sequence_base.cpp295
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp266
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp198
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/serializer_op_ch.cpp117
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/serializer_op_cs.cpp1337
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure.cpp45
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/any_op_ch.cpp155
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp241
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ch.cpp82
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp167
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/serializer_op_ch.cpp140
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/serializer_op_cs.cpp311
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/structure.cpp118
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/structure_ch.cpp105
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/structure_ci.cpp58
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp96
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure_fwd.cpp32
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure_fwd/structure_fwd_ch.cpp55
-rw-r--r--TAO/TAO_IDL/be/be_visitor_traits.cpp488
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode.cpp62
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp94
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/enum_typecode.cpp98
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/objref_typecode.cpp93
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp218
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp163
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp818
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/union_typecode.cpp224
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/value_typecode.cpp300
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef.cpp62
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/any_op_ch.cpp293
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/any_op_cs.cpp275
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp293
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp263
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/serializer_op_ch.cpp294
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/serializer_op_cs.cpp264
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp480
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp649
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp318
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp146
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union.cpp54
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/any_op_ch.cpp152
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp240
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp81
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp212
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp144
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp264
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/discriminant_cs.cpp78
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/serializer_op_ch.cpp92
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/serializer_op_cs.cpp468
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/union.cpp206
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp209
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp96
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp301
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch.cpp61
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp214
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp1005
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp608
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp861
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp763
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp1252
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/public_cs.cpp182
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp542
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/serializer_op_ch.cpp215
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/serializer_op_cs.cpp1319
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_fwd.cpp32
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_fwd/union_fwd_ch.cpp53
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuebox.cpp57
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuebox/any_op_ch.cpp117
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuebox/any_op_cs.cpp206
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuebox/cdr_op_ch.cpp66
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuebox/cdr_op_cs.cpp91
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuebox/field_ch.cpp536
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuebox/field_ci.cpp614
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuebox/union_member_ci.cpp568
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuebox/valuebox.cpp40
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ch.cpp863
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp879
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp653
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype.cpp104
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_ch.cpp72
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_cs.cpp67
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/any_op_ch.cpp125
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp214
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp303
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ch.cpp103
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp170
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ch.cpp216
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp974
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp821
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/field_ci.cpp233
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp1192
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp90
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp302
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp287
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp986
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp546
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp129
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp430
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init.cpp46
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_arglist_ch.cpp168
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ch.cpp194
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ci.cpp37
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_cs.cpp165
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp313
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ci.cpp103
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp257
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_sh.cpp131
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_si.cpp51
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp159
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype_fwd.cpp41
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype_fwd/any_op_ch.cpp135
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp103
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ci.cpp97
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp65
350 files changed, 0 insertions, 96199 deletions
diff --git a/TAO/TAO_IDL/be/be_argument.cpp b/TAO/TAO_IDL/be/be_argument.cpp
deleted file mode 100644
index c2c0774a91d..00000000000
--- a/TAO/TAO_IDL/be/be_argument.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_argument.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Argument that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_argument.h"
-#include "be_type.h"
-#include "be_visitor.h"
-#include "nr_extern.h"
-#include "global_extern.h"
-
-ACE_RCSID (be,
- be_argument,
- "$Id$")
-
-be_argument::be_argument (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Field (),
- AST_Argument (),
- be_decl ()
-{
-}
-
-be_argument::be_argument (AST_Argument::Direction d,
- AST_Type *ft,
- UTL_ScopedName *n)
- : COMMON_Base (),
- AST_Decl (AST_Decl::NT_argument,
- n),
- AST_Field (AST_Decl::NT_argument,
- ft,
- n),
- AST_Argument (d,
- ft,
- n),
- be_decl (AST_Decl::NT_argument,
- n)
-{
- AST_Decl *dcl = ScopeAsDecl (this->defined_in ());
-
- // If there have been previous errors, dcl may be 0,
- // and we don't want to crash, so we check for non-zero.
- // Also, we don't want to set the bit if the operation is
- // declared in an included file UNLESS the enclosing
- // interface is abstract, in which case we regenerate the
- // operation.
- if (dcl != 0
- && !dcl->is_local ()
- && (idl_global->in_main_file () || dcl->is_abstract ()))
- {
- be_type *bt = be_type::narrow_from_decl (ft);
- bt->seen_in_operation (true);
- this->set_arg_seen_bit (bt);
- idl_global->need_skeleton_includes_ = true;
- }
-}
-
-
-int
-be_argument::accept (be_visitor *visitor)
-{
- return visitor->visit_argument (this);
-}
-
-void
-be_argument::destroy (void)
-{
- this->be_decl::destroy ();
- this->AST_Argument::destroy ();
-}
-
-// Narrowing.
-IMPL_NARROW_METHODS2 (be_argument, AST_Argument, be_decl)
-IMPL_NARROW_FROM_DECL (be_argument)
diff --git a/TAO/TAO_IDL/be/be_array.cpp b/TAO/TAO_IDL/be/be_array.cpp
deleted file mode 100644
index 72042f19118..00000000000
--- a/TAO/TAO_IDL/be/be_array.cpp
+++ /dev/null
@@ -1,275 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_array.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Array that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_array.h"
-#include "be_codegen.h"
-#include "be_scope.h"
-#include "be_helper.h"
-#include "be_visitor.h"
-#include "utl_identifier.h"
-#include "idl_defines.h"
-#include "global_extern.h"
-
-#include "ace/Log_Msg.h"
-
-ACE_RCSID (be,
- be_array,
- "$Id$")
-
-be_array::be_array (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_ConcreteType (),
- AST_Array (),
- be_decl (),
- be_type ()
-{
-}
-
-be_array::be_array (UTL_ScopedName *n,
- unsigned long ndims,
- UTL_ExprList *dims,
- bool local,
- bool abstract)
- : COMMON_Base (local,
- abstract),
- AST_Decl (AST_Decl::NT_array,
- n,
- true),
- AST_Type (AST_Decl::NT_array,
- n),
- AST_ConcreteType (AST_Decl::NT_array,
- n),
- AST_Array (n,
- ndims,
- dims,
- local,
- abstract),
- be_decl (AST_Decl::NT_array,
- n),
- be_type (AST_Decl::NT_array,
- n)
-{
- if (!this->imported ())
- {
- idl_global->array_seen_ = true;
- }
-}
-
-be_array::~be_array (void)
-{
-}
-
-int
-be_array::create_name (void)
-{
- char namebuf [NAMEBUFSIZE];
- unsigned long i;
- UTL_ScopedName *n = 0;
- be_decl *scope;
-
- ACE_OS::memset (namebuf,
- '\0',
- NAMEBUFSIZE);
- // Retrieve the base type.
- // The name always starts this way.
- be_type *bt = be_type::narrow_from_decl (this->base_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_array::"
- "create_name - "
- "bad base type\n"),
- 0);
- }
-
- ACE_OS::sprintf (namebuf,
- "_tao_array_%s",
- bt->local_name ()->get_string ());
-
- // Now append dimensions.
- for (i = 0; i < this->n_dims (); ++i)
- {
- AST_Expression *expr = this->dims ()[i];
-
- // Dimension value.
- if ((expr == 0) || ((expr != 0) && (expr->ev () == 0)))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_array::"
- "create_name - "
- "bad array dimension\n"),
- -1);
- }
- if (expr->ev ()->et == AST_Expression::EV_ulong)
- {
- ACE_OS::sprintf (namebuf,
- "%s_%d",
- namebuf,
- ((int)expr->ev ()->u.ulval));
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_array::"
- "create_name - "
- "bad dimension value\n"),
- -1);
- }
- }
-
- // Now see if we have a fully scoped name and if so, generate one.
- scope = be_scope::narrow_from_scope (this->defined_in ())->decl ();
-
- if (scope)
- {
- // Make a copy of the enclosing scope's name.
- n = (UTL_ScopedName *)scope->name ()->copy ();
-
- Identifier *id = 0;
- ACE_NEW_RETURN (id,
- Identifier (ACE_OS::strdup (namebuf)),
- -1);
-
- UTL_ScopedName *sn = 0;
- ACE_NEW_RETURN (sn,
- UTL_ScopedName (id,
- 0),
- -1);
-
- // Add our local name as the last component.
- n->nconc (sn);
- // Set the fully scoped name.
- this->set_name (n);
- }
- else
- {
- // We better be not here because we must be inside some scope,
- // at least the ROOT scope.
- return -1;
- }
-
- return 0;
-}
-
-// Overriden method.
-void
-be_array::compute_tc_name (void)
-{
- // Array TypeCodes can only be accessed through an alias
- // TypeCode. Generate a TypeCode name that is meant for internal
- // use alone.
-
- Identifier * tao_id = 0;
- ACE_NEW (tao_id,
- Identifier ("TAO"));
-
- ACE_NEW (this->tc_name_,
- UTL_ScopedName (tao_id,
- 0));
-
- ACE_CString local_tc_name =
- ACE_CString ("tc_")
- + ACE_CString (this->flat_name ());
-
- Identifier * typecode_scope = 0;
- ACE_NEW (typecode_scope,
- Identifier ("TypeCode"));
-
- UTL_ScopedName * tc_scope_conc_name = 0;
- ACE_NEW (tc_scope_conc_name,
- UTL_ScopedName (typecode_scope,
- 0));
-
- this->tc_name_->nconc (tc_scope_conc_name);
-
- Identifier * id = 0;
- ACE_NEW (id,
- Identifier (local_tc_name.c_str ()));
-
- UTL_ScopedName * conc_name = 0;
- ACE_NEW (conc_name,
- UTL_ScopedName (id,
- 0));
-
- this->tc_name_->nconc (conc_name);
-}
-
-// Code generation.
-
-int
-be_array::gen_dimensions (TAO_OutStream *os,
- unsigned short slice)
-{
- // Loop index.
- unsigned long i;
-
- // Print our dimensions.
- for (i = (slice ? 1 : 0); i < this->n_dims (); ++i)
- {
- // Retrieve the ith.
- AST_Expression *expr = this->dims ()[i];
-
- // Dimension value.
- if ((expr == 0) || ((expr != 0) && (expr->ev () == 0)))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_array::"
- "gen_dimensions - "
- "bad array dimension\n"),
- -1);
- }
-
- if (expr->ev ()->et == AST_Expression::EV_ulong)
- {
- *os << "[" << ((int)expr->ev ()->u.ulval) << "]";
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_array::"
- "gen_dimensions - "
- "bad dimension value\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_array::accept (be_visitor *visitor)
-{
- return visitor->visit_array (this);
-}
-
-void
-be_array::destroy (void)
-{
- this->be_type::destroy ();
- this->AST_Array::destroy ();
-}
-
-// Narrowing
-IMPL_NARROW_METHODS2 (be_array, AST_Array, be_type)
-IMPL_NARROW_FROM_DECL (be_array)
diff --git a/TAO/TAO_IDL/be/be_attribute.cpp b/TAO/TAO_IDL/be/be_attribute.cpp
deleted file mode 100644
index ad32663ab16..00000000000
--- a/TAO/TAO_IDL/be/be_attribute.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_attribute.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Attribute that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_attribute.h"
-#include "be_type.h"
-#include "be_visitor.h"
-
-#include "global_extern.h"
-
-ACE_RCSID (be,
- be_attribute,
- "$Id$")
-
-be_attribute::be_attribute (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Field (),
- AST_Attribute (),
- be_decl ()
-{
- be_operation_default_strategy *bods = 0;
-
- ACE_NEW (bods,
- be_operation_default_strategy (0));
- this->get_strategy_ = bods;
-
- ACE_NEW (bods,
- be_operation_default_strategy (0));
- this->set_strategy_ = bods;
-}
-
-be_attribute::be_attribute (bool ro,
- AST_Type *ft,
- UTL_ScopedName *n,
- bool local,
- bool abstract)
- : COMMON_Base (local,
- abstract),
- AST_Decl (AST_Decl::NT_attr,
- n),
- AST_Field (AST_Decl::NT_attr,
- ft,
- n),
- AST_Attribute (ro,
- ft,
- n,
- local,
- abstract),
- be_decl (AST_Decl::NT_attr,
- n)
-{
- be_operation_default_strategy *bods = 0;
-
- ACE_NEW (bods,
- be_operation_default_strategy (0));
- this->get_strategy_ = bods;
-
- ACE_NEW (bods,
- be_operation_default_strategy (0));
- this->set_strategy_ = bods;
-
- // TAO_IDL generated attribute methods currently have an exception
- // specification containing CORBA::SystemException. Make sure we
- // generate a "tao/SystemException.h" include directive.
- idl_global->operation_seen_ = true;
-
- if (!this->imported () && !this->is_local ())
- {
- // For the return types of the two operations
- // generated from this attribute.
- this->set_arg_seen_bit (be_type::narrow_from_decl (ft));
- idl_global->basic_arg_seen_ = true;
- }
-}
-
-
-
-int
-be_attribute::accept (be_visitor *visitor)
-{
- return visitor->visit_attribute (this);
-}
-
-
-be_operation_strategy *
-be_attribute::set_set_strategy (be_operation_strategy *new_strategy)
-{
- be_operation_strategy *old = this->set_strategy_;
-
- if (new_strategy != 0)
- {
- this->set_strategy_ = new_strategy;
- }
-
- return old;
-}
-
-be_operation_strategy *
-be_attribute::set_get_strategy (be_operation_strategy *new_strategy)
-{
- be_operation_strategy *old = this->get_strategy_;
-
- if (new_strategy != 0)
- {
- this->get_strategy_ = new_strategy;
- }
-
- return old;
-}
-
-be_operation_strategy *
-be_attribute::get_set_strategy ()
-{
- return this->set_strategy_;
-}
-
-be_operation_strategy *
-be_attribute::get_get_strategy ()
-{
- return this->get_strategy_;
-}
-
-void
-be_attribute::destroy (void)
-{
- if (0 != this->get_strategy_)
- {
- this->get_strategy_->destroy ();
- delete this->get_strategy_;
- this->get_strategy_ = 0;
- }
-
- if (0 != this->set_strategy_)
- {
- this->set_strategy_->destroy ();
- delete this->set_strategy_;
- this->set_strategy_ = 0;
- }
-
- this->be_decl::destroy ();
- this->AST_Attribute::destroy ();
-}
-
-// Narrowing
-IMPL_NARROW_METHODS2 (be_attribute, AST_Attribute, be_decl)
-IMPL_NARROW_FROM_DECL (be_attribute)
diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp
deleted file mode 100644
index 2393171c558..00000000000
--- a/TAO/TAO_IDL/be/be_codegen.cpp
+++ /dev/null
@@ -1,2436 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_codegen.cpp
-//
-// = DESCRIPTION
-// Code generation
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_codegen.h"
-#include "be_helper.h"
-#include "be_visitor_factory.h"
-#include "be_stream_factory.h"
-#include "be_extern.h"
-#include "global_extern.h"
-#include "utl_string.h"
-#include "idl_defines.h"
- #include "ace/os_include/os_ctype.h"
-
-ACE_RCSID (be,
- be_codegen,
- "$Id$")
-
-TAO_CodeGen * tao_cg = 0;
-
-TAO_CodeGen::TAO_CodeGen (void)
- : client_header_ (0),
- client_stubs_ (0),
- client_inline_ (0),
- server_header_ (0),
- implementation_header_(0),
- implementation_skeleton_(0),
- server_template_header_ (0),
- server_skeletons_ (0),
- server_template_skeletons_ (0),
- server_inline_ (0),
- server_template_inline_ (0),
- anyop_header_ (0),
- anyop_source_ (0),
- gperf_input_stream_ (0),
- gperf_input_filename_ (0),
- curr_os_ (0),
- visitor_factory_ (0)
-{
-}
-
-// destructor
-TAO_CodeGen::~TAO_CodeGen (void)
-{
-}
-
-// visitor factory method
-be_visitor *
-TAO_CodeGen::make_visitor (be_visitor_context *ctx)
-{
-
- if (this->visitor_factory_ == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("TAO_CodeGen::make_visitor - ")
- ACE_TEXT ("No Visitor Factory\n\n")),
- 0);
- }
-
- return this->visitor_factory_->make_visitor (ctx);
-}
-
-// Change the string to all upper case.
-const char *
-TAO_CodeGen::upcase (const char *str)
-{
- static char upcase_str [NAMEBUFSIZE];
-
- ACE_OS::memset (upcase_str,
- '\0',
- NAMEBUFSIZE);
-
- // Convert letters in str to upper case.
- for (unsigned int i = 0; i < ACE_OS::strlen (str); ++i)
- {
- if (isalpha (str[i]))
- {
- upcase_str[i] = static_cast<char> (toupper (str[i]));
- }
- else
- {
- // Copy it as it is.
- upcase_str[i] = str[i];
- }
- }
-
- return upcase_str;
-}
-
-// Set the client header stream.
-int
-TAO_CodeGen::start_client_header (const char *fname)
-{
- if (0 == fname)
- {
- // Bad file name.
- return -1;
- }
-
- // @@ We are making use of "included_idl_files" that is in the
- // idl_global. We need to make sure the validity of those files.
- idl_global->validate_included_idl_files ();
-
- // Retrieve the singleton instance to the outstream factory.
- TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance ();
-
- // Clean up between multiple files.
- delete this->client_header_;
- this->client_header_ = factory->make_outstream ();
-
- if (!this->client_header_)
- {
- return -1;
- }
-
- if (this->client_header_->open (fname, TAO_OutStream::TAO_CLI_HDR) == -1)
- {
- return -1;
- }
-
- *this->client_header_ << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__
- << be_nl << be_nl;
-
- // Generate the #ident string, if any.
- this->gen_ident_string (this->client_header_);
-
- ACE_CString pidl_checker (idl_global->filename ()->get_string ());
- bool got_pidl =
- (pidl_checker.substr (pidl_checker.length () - 5) == ".pidl");
-
- if (!got_pidl)
- {
- // Generate the #ifndef clause.
- this->gen_ifndef_string (fname,
- this->client_header_,
- "_TAO_IDL_",
- "_H_");
- }
- else
- {
- // Generate the #ifndef clause.
- this->gen_ifndef_string (fname,
- this->client_header_,
- "_TAO_PIDL_",
- "_H_");
- }
-
- if (be_global->pre_include () != 0)
- {
- *this->client_header_ << "#include /**/ \""
- << be_global->pre_include ()
- << "\"\n\n";
- }
-
- if (be_global->include_guard () != 0)
- {
- *this->client_header_ << "#ifndef "
- << be_global->include_guard ()
- << "\n";
-
- *this->client_header_ << "#error "
- << "You should not include " << fname;
-
- if (be_global->safe_include () != 0)
- {
- *this->client_header_ << ", use " << be_global->safe_include ();
- }
-
- *this->client_header_ << "\n";
-
- *this->client_header_ << "#endif /* "
- << be_global->include_guard ()
- << " */\n";
- }
-
- // To get ACE_UNUSED_ARGS
- this->gen_standard_include (this->client_header_,
- "ace/config-all.h");
-
- // Some compilers don't optimize the #ifndef header include
- // protection, but do optimize based on #pragma once.
- *this->client_header_ << "\n\n#if !defined (ACE_LACKS_PRAGMA_ONCE)\n"
- << "# pragma once\n"
- << "#endif /* ACE_LACKS_PRAGMA_ONCE */";
-
- *this->client_header_ << be_nl;
-
- // Other include files.
-
- if (be_global->stub_export_include () != 0)
- {
- *this->client_header_ << "\n#include \""
- << be_global->stub_export_include ()
- << "\"";
- }
-
- this->gen_stub_hdr_includes ();
-
- size_t nfiles = idl_global->n_included_idl_files ();
-
- if (nfiles > 0)
- {
- *this->client_header_ << "\n";
- }
-
- // We must include all the client headers corresponding to
- // IDL files included by the current IDL file.
- // We will use the included IDL file names as they appeared
- // in the original main IDL file, not the one which went
- // thru CC preprocessor.
- for (size_t j = 0; j < nfiles; ++j)
- {
- char* idl_name = idl_global->included_idl_files ()[j];
-
- // Make a String out of it.
- UTL_String idl_name_str = idl_name;
-
- // Make sure this file was actually got included, not
- // ignored by some #if defined compiler directive.
-
-
- // Get the clnt header from the IDL file name.
- const char* client_hdr =
- BE_GlobalData::be_get_client_hdr (&idl_name_str,
- 1);
-
- idl_name_str.destroy ();
-
- // Sanity check and then print.
- if (client_hdr != 0)
- {
- this->client_header_->print ("\n#include \"%s\"",
- client_hdr);
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("\nERROR, invalid file '%s' included"),
- idl_name),
- -1);
- }
- }
-
- // Generate the TAO_EXPORT_MACRO macro.
- *this->client_header_ << "\n\n#if defined (TAO_EXPORT_MACRO)\n";
- *this->client_header_ << "#undef TAO_EXPORT_MACRO\n";
- *this->client_header_ << "#endif\n";
- *this->client_header_ << "#define TAO_EXPORT_MACRO "
- << be_global->stub_export_macro ();
-
- // Begin versioned namespace support after initial headers have been
- // included, but before the inline file and post include
- // directives.
- *this->client_header_ << be_global->versioning_begin ();
-
- return 0;
-}
-
-// Get the client header stream.
-TAO_OutStream *
-TAO_CodeGen::client_header (void)
-{
- return this->client_header_;
-}
-
-// Set the client stub stream.
-int
-TAO_CodeGen::start_client_stubs (const char *fname)
-{
- // Retrieve the singleton instance to the outstream factory.
- TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance ();
-
- // Clean up between multiple files.
- delete this->client_stubs_;
- this->client_stubs_ = factory->make_outstream ();
-
- if (!this->client_stubs_)
- {
- return -1;
- }
-
- if (this->client_stubs_->open (fname, TAO_OutStream::TAO_CLI_IMPL) == -1)
- {
- return -1;
- }
-
- *this->client_stubs_ << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__
- << be_nl << be_nl;
-
- this->gen_stub_src_includes ();
-
- // Generate the ident string, if any.
- this->gen_ident_string (this->client_stubs_);
-
- // Only when we generate a client inline file generate the include
- if (be_global->gen_client_inline ())
- {
- // Generate the code that includes the inline file if not included in the
- // header file.
- *this->client_stubs_ << "\n\n#if !defined (__ACE_INLINE__)";
- *this->client_stubs_ << "\n#include \""
- << be_global->be_get_client_inline_fname (1)
- << "\"";
- *this->client_stubs_ << "\n#endif /* !defined INLINE */";
- }
-
- // Begin versioned namespace support after all headers have been
- // included, but before any code is generated.
- *this->client_stubs_ << be_global->versioning_begin ();
-
- return 0;
-}
-
-// Get the client stubs stream.
-TAO_OutStream *
-TAO_CodeGen::client_stubs (void)
-{
- return this->client_stubs_;
-}
-
-// Set the client inline stream.
-int
-TAO_CodeGen::start_client_inline (const char *fname)
-{
- // Retrieve the singleton instance to the outstream factory.
- TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance ();
-
- // Clean up between multiple files.
- delete this->client_inline_;
- this->client_inline_ = factory->make_outstream ();
-
- if (!this->client_inline_)
- {
- return -1;
- }
-
- if (this->client_inline_->open (fname, TAO_OutStream::TAO_CLI_INL) == -1)
- {
- return -1;
- }
-
- // Generate the ident string, if any.
- this->gen_ident_string (this->client_inline_);
-
- // Begin versioned namespace support after initial headers, if any,
- // have been included.
- *this->client_inline_ << be_global->versioning_begin ();
-
- return 0;
-}
-
-// Get the client inline stream.
-TAO_OutStream *
-TAO_CodeGen::client_inline (void)
-{
- return this->client_inline_;
-}
-
-// Set the server header stream.
-int
-TAO_CodeGen::start_server_header (const char *fname)
-{
- // Retrieve the singleton instance to the outstream factory.
- TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance ();
-
- // Clean up between multiple files.
- delete this->server_header_;
- this->server_header_ = factory->make_outstream ();
-
- if (!this->server_header_)
- {
- return -1;
- }
-
- if (this->server_header_->open (fname, TAO_OutStream::TAO_SVR_HDR) == -1)
- {
- return -1;
- }
-
- // If we are suppressing skel file generation, bail after generating the
- // copyright text and an informative message.
- if (!be_global->gen_skel_files ())
- {
- *this->server_header_ << be_nl
- << "// Skeleton file generation suppressed with "
- << "command line option -SS" << be_nl;
-
- return 0;
- }
-
- *this->server_header_ << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__
- << be_nl << be_nl;
-
- // Generate the ident string, if any.
- this->gen_ident_string (this->server_header_);
-
- // Generate the #ifndef clause.
- this->gen_ifndef_string (fname,
- this->server_header_,
- "_TAO_IDL_",
- "_H_");
-
- if (be_global->pre_include () != 0)
- {
- *this->server_header_ << "#include /**/ \""
- << be_global->pre_include ()
- << "\"\n";
- }
-
- // The server header should include the client header.
- *this->server_header_ << "\n#include \""
- << be_global->be_get_client_hdr_fname (1)
- << "\"";
-
- // We must include all the skeleton headers corresponding to
- // IDL files included by the current IDL file.
- // We will use the included IDL file names as they appeared
- // in the original main IDL file, not the one which went
- // thru CC preprocessor.
- for (size_t j = 0;
- j < idl_global->n_included_idl_files ();
- ++j)
- {
- char* idl_name = idl_global->included_idl_files ()[j];
-
- // String'ifying the name.
- UTL_String idl_name_str (idl_name);
-
- const char* server_hdr =
- BE_GlobalData::be_get_server_hdr (&idl_name_str, 1);
-
- idl_name_str.destroy ();
-
- this->server_header_->print ("\n#include \"%s\"",
- server_hdr);
- }
-
- // Some compilers don't optimize the #ifndef header include
- // protection, but do optimize based on #pragma once.
- *this->server_header_ << "\n\n#if !defined (ACE_LACKS_PRAGMA_ONCE)\n"
- << "# pragma once\n"
- << "#endif /* ACE_LACKS_PRAGMA_ONCE */\n";
-
- // Include the definitions for the PortableServer namespace,
- // this forces the application to link the POA library, a good
- // thing, because we need the definitions there, it also
- // registers the POA factory with the Service_Configurator, so
- // the ORB can automatically find it.
- if (idl_global->non_local_iface_seen_)
- {
- // Include the Messaging files if AMI is enabled.
- if (be_global->ami_call_back () == true)
- {
- // Include Messaging skeleton file.
- this->gen_standard_include (this->server_header_,
- "tao/Messaging/MessagingS.h");
- }
-
- this->gen_standard_include (this->server_header_,
- "tao/Collocation_Proxy_Broker.h");
- this->gen_standard_include (this->server_header_,
- "tao/PortableServer/PortableServer.h");
- this->gen_standard_include (this->server_header_,
- "tao/PortableServer/Servant_Base.h");
-
- if (be_global->gen_amh_classes ())
- {
- this->gen_standard_include (this->server_header_,
- "tao/Messaging/AMH_Response_Handler.h");
- }
- }
-
- if (be_global->skel_export_include () != 0)
- {
- *this->server_header_ << "\n\n#include \""
- << be_global->skel_export_include ()
- << "\"";
-
- // Generate the TAO_EXPORT_MACRO macro.
- *this->server_header_ << "\n\n#if defined (TAO_EXPORT_MACRO)\n";
- *this->server_header_ << "#undef TAO_EXPORT_MACRO\n";
- *this->server_header_ << "#endif\n";
- *this->server_header_ << "#define TAO_EXPORT_MACRO "
- << be_global->skel_export_macro ();
- }
-
- // Begin versioned namespace support after initial headers have been
- // included, but before the inline file and post include
- // directives.
- *this->server_header_ << be_global->versioning_begin ();
-
- return 0;
-}
-
-// Get the server header stream.
-TAO_OutStream *
-TAO_CodeGen::server_header (void)
-{
- return this->server_header_;
-}
-
-// Set the server header stream.
-int
-TAO_CodeGen::start_server_template_header (const char *fname)
-{
- // Retrieve the singleton instance to the outstream factory.
- TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance ();
-
- // Clean up between multiple files.
- delete this->server_template_header_;
- this->server_template_header_ = factory->make_outstream ();
-
- if (!this->server_template_header_)
- {
- return -1;
- }
-
- if (this->server_template_header_->open (fname,
- TAO_OutStream::TAO_SVR_TMPL_HDR)
- == -1)
- {
- return -1;
- }
-
- *this->server_template_header_ << be_nl << "// TAO_IDL - Generated from"
- << be_nl
- << "// " << __FILE__ << ":" << __LINE__
- << be_nl << be_nl;
-
- // Generate the ident string, if any.
- this->gen_ident_string (this->server_template_header_);
-
- // Generate the #ifndef clause.
- this->gen_ifndef_string (fname,
- this->server_template_header_,
- "_TAO_IDL_",
- "_H_");
-
- if (be_global->pre_include () != 0)
- {
- *this->server_template_header_ << "#include /**/ \""
- << be_global->pre_include ()
- << "\"";
- }
-
- // Begin versioned namespace support after initial headers have been
- // included, but before the inline file and post include
- // directives.
- *this->server_template_header_ << be_global->versioning_begin ();
-
- return 0;
-}
-
-// Get the server header stream.
-TAO_OutStream *
-TAO_CodeGen::server_template_header (void)
-{
- return this->server_template_header_;
-}
-
-// Set the server skeletons stream.
-int
-TAO_CodeGen::start_server_skeletons (const char *fname)
-{
- // Retrieve the singleton instance to the outstream factory.
- TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance ();
-
- // Clean up between multiple files.
- delete this->server_skeletons_;
- this->server_skeletons_ = factory->make_outstream ();
-
- if (!this->server_skeletons_)
- {
- return -1;
- }
-
- if (this->server_skeletons_->open (fname,
- TAO_OutStream::TAO_SVR_IMPL)
- == -1)
- {
- return -1;
- }
-
- *this->server_skeletons_ << be_nl << be_nl << "// TAO_IDL - Generated from "
- << be_nl << "// " << __FILE__ << ":" << __LINE__
- << be_nl << be_nl;
-
- // Generate the ident string, if any.
- this->gen_ident_string (this->server_skeletons_);
-
- // Generate the include statement for the precompiled header file.
- if (be_global->pch_include ())
- {
- *this->server_skeletons_ << "#include \""
- << be_global->pch_include ()
- << "\"\n";
- }
-
- // Generate the #ifndef clause.
- this->gen_ifndef_string (fname,
- this->server_skeletons_,
- "_TAO_IDL_",
- "_CPP_");
-
- // Generate the include statement for the server header.
- *this->server_skeletons_
- << "\n#include \""
- << be_global->be_get_server_hdr_fname (1)
- << "\"";
-
- this->gen_skel_src_includes ();
-
- // Only when we generate a server inline file generate the include
- if (be_global->gen_server_inline ())
- {
- // Generate the code that includes the inline file if not included in the
- // header file.
- *this->server_skeletons_ << "\n\n#if !defined (__ACE_INLINE__)\n";
- *this->server_skeletons_ << "#include \""
- << be_global->be_get_server_inline_fname (1)
- << "\"\n";
- *this->server_skeletons_ << "#endif /* !defined INLINE */";
- }
-
- // Begin versioned namespace support after initial headers have been
- // included, but before the inline file and post include
- // directives.
- *this->server_skeletons_ << be_global->versioning_begin ();
-
- return 0;
-}
-
-// Get the server skeletons stream.
-TAO_OutStream *
-TAO_CodeGen::server_skeletons (void)
-{
- return this->server_skeletons_;
-}
-
-// Start the server template skeleton stream.
-int
-TAO_CodeGen::start_server_template_skeletons (const char *fname)
-{
- // Retrieve the singleton instance to the outstream factory.
- TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance ();
-
- // Clean up between multiple files.
- delete this->server_template_skeletons_;
- this->server_template_skeletons_ = factory->make_outstream ();
-
- if (!this->server_template_skeletons_)
- {
- return -1;
- }
-
- if (this->server_template_skeletons_->open (fname,
- TAO_OutStream::TAO_SVR_TMPL_IMPL)
- == -1)
- {
- return -1;
- }
-
- *this->server_template_skeletons_ << be_nl << "// TAO_IDL - Generated from "
- << be_nl << "// "
- << __FILE__ << ":" << __LINE__
- << be_nl << be_nl;
-
- // Generate the ident string, if any.
- this->gen_ident_string (this->server_template_skeletons_);
-
- // Generate the #ifndef clause.
- this->gen_ifndef_string (fname,
- this->server_template_skeletons_,
- "_TAO_IDL_",
- "_CPP_");
-
- // Generate the include statement for the server header.
- *this->server_template_skeletons_
- << "#include \""
- << be_global->be_get_server_template_hdr_fname (1)
- << "\"";
-
- // Generate the code that includes the inline file if not included in the
- // header file.
- *this->server_template_skeletons_ << "\n\n#if !defined (__ACE_INLINE__)";
- *this->server_template_skeletons_
- << "\n#include \""
- << be_global->be_get_server_template_inline_fname (1)
- << "\"";
- *this->server_template_skeletons_ << "\n#endif /* !defined INLINE */\n\n";
-
- // Begin versioned namespace support after initial headers have been
- // included, but before the inline file and post include
- // directives.
- *this->server_template_skeletons_ << be_global->versioning_begin ();
-
- return 0;
-}
-
-// Get the server template skeletons stream.
-TAO_OutStream *
-TAO_CodeGen::server_template_skeletons (void)
-{
- return this->server_template_skeletons_;
-}
-
-// Set the server inline stream.
-int
-TAO_CodeGen::start_server_inline (const char *fname)
-{
- // Retrieve the singleton instance to the outstream factory.
- TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance ();
-
- // Clean up between multiple files.
- delete this->server_inline_;
- this->server_inline_ = factory->make_outstream ();
-
- if (!this->server_inline_)
- {
- return -1;
- }
-
- if (this->server_inline_->open (fname, TAO_OutStream::TAO_SVR_INL) == -1)
- {
- return -1;
- }
-
- // Generate the ident string, if any.
- this->gen_ident_string (this->server_inline_);
-
- // Begin versioned namespace support after initial headers, if any, have been
- // included.
- *this->server_inline_ << be_global->versioning_begin ();
-
- return 0;
-}
-
-// Get the server inline stream.
-TAO_OutStream *
-TAO_CodeGen::server_inline (void)
-{
- return this->server_inline_;
-}
-
-// Set the server template inline stream.
-int
-TAO_CodeGen::start_server_template_inline (const char *fname)
-{
- // Retrieve the singleton instance to the outstream factory.
- TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance ();
-
- // Clean up between multiple files.
- delete this->server_template_inline_;
- this->server_template_inline_ = factory->make_outstream ();
-
- if (!this->server_template_inline_)
- {
- return -1;
- }
-
- if (this->server_template_inline_->open (fname,
- TAO_OutStream::TAO_SVR_INL)
- == -1)
- {
- return -1;
- }
-
- // Generate the ident string, if any.
- this->gen_ident_string (this->server_template_inline_);
-
- // Begin versioned namespace support after initial headers have been
- // included, but before the inline file and post include
- // directives.
- *this->server_template_inline_ << be_global->versioning_begin ();
-
- return 0;
-}
-
-// Get the server template inline stream.
-TAO_OutStream *
-TAO_CodeGen::server_template_inline (void)
-{
- return this->server_template_inline_;
-}
-
-int
-TAO_CodeGen::start_anyop_header (const char *fname)
-{
- if (!be_global->gen_anyop_files ())
- {
- return 0;
- }
-
- // Retrieve the singleton instance to the outstream factory.
- TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance ();
-
- // Clean up between multiple files.
- delete this->anyop_header_;
- this->anyop_header_ = factory->make_outstream ();
-
- if (0 == this->anyop_header_)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "TAO_CodeGen::start_anyop_header - "
- "Error creating file stream\n"),
- -1);
- }
-
- if (this->anyop_header_->open (fname,
- TAO_OutStream::TAO_CLI_HDR)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "TAO_CodeGen::start_anyop_header - "
- "Error opening file\n"),
- -1);
- }
-
- *this->anyop_header_ << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__
- << be_nl << be_nl;
-
- // Generate the #ident string, if any.
- this->gen_ident_string (this->anyop_header_);
-
- // Generate the #ifndef clause.
- this->gen_ifndef_string (fname,
- this->anyop_header_,
- "_TAO_IDL_",
- "_H_");
-
- if (be_global->pre_include () != 0)
- {
- *this->anyop_header_ << "#include /**/ \""
- << be_global->pre_include ()
- << "\"\n";
- }
-
- // If anyop macro hasn't been set, default to stub macro.
- if (be_global->anyop_export_include () != 0)
- {
- *this->anyop_header_ << "\n#include \""
- << be_global->anyop_export_include ()
- << "\"";
- }
- else if (be_global->stub_export_include () != 0)
- {
- *this->anyop_header_ << "\n#include \""
- << be_global->stub_export_include ()
- << "\"";
- }
-
- const char *tao_prefix = "";
- ACE_CString pidl_checker (idl_global->filename ()->get_string ());
- bool got_pidl =
- (pidl_checker.substr (pidl_checker.length () - 5) == ".pidl");
-
- // If we're here and we have a .pidl file, we need to generate
- // the *A.h include from the AnyTypeCode library.
- if (got_pidl)
- {
- tao_prefix = "tao/";
- }
-
- // Generate the include statement for the client header. We just
- // need to put only the base names. Path info is not required.
- *this->anyop_header_ << "\n#include \"" << tao_prefix
- << be_global->be_get_client_hdr_fname ()
- << "\"";
-
- // If we have not suppressed Any operator generation and also
- // are not generating the operators in a separate file, we
- // need to include the *A.h file from all .pidl files here.
- if (be_global->any_support ())
- {
- for (size_t j = 0; j < idl_global->n_included_idl_files (); ++j)
- {
- char* idl_name = idl_global->included_idl_files ()[j];
-
- // Make a String out of it.
- UTL_String idl_name_str = idl_name;
-
- const char *anyop_hdr =
- BE_GlobalData::be_get_anyop_header (&idl_name_str, 1);
-
- idl_name_str.destroy ();
-
- ACE_CString pidl_checker (idl_name);
- bool got_pidl =
- (pidl_checker.substr (pidl_checker.length () - 5) == ".pidl");
-
- // If we're here and we have a .pidl file, we need to generate
- // the *A.h include from the AnyTypeCode library.
- if (got_pidl)
- {
- // Stripped off any scope in the name and add the
- // AnyTypeCode prefix.
- ACE_CString work_hdr (anyop_hdr);
- ACE_CString final_hdr = "tao/AnyTypeCode/";
- ACE_CString::size_type pos = work_hdr.rfind ('/');
-
- if (pos != ACE_SString::npos)
- {
- ACE_CString scope (work_hdr.substr (0, pos - 1));
-
- // If we find a '/' in the containing scope name, it
- // means we are including a .pidl file from a
- // subdirectory of $TAO_ROOT/tao, and so we should
- // include the anyop_hdr string as is, and not strip
- // off the scope name and prepend "tao/AnyTypeCode/".
- // Only .pidl files in $TAO_ROOT/tao itself have
- // their generated *A.* files moved to the AnyTypeCode
- // library.
- if (scope.find ('/') == ACE_SString::npos)
- {
- work_hdr = work_hdr.substr (pos + 1);
- final_hdr += work_hdr;
- }
- else
- {
- final_hdr = work_hdr;
- }
- }
-
- this->anyop_header_->print ("\n#include \"%s\"",
- final_hdr.c_str ());
- }
- else
- {
- this->anyop_header_->print ("\n#include \"%s\"",
- anyop_hdr);
- }
- }
- }
- *this->anyop_header_ << "\n";
-
- // Begin versioned namespace support after initial headers have been
- // included, but before the inline file and post include
- // directives.
- *this->anyop_header_ << be_global->versioning_begin ();
-
- return 0;
-}
-
-int
-TAO_CodeGen::start_anyop_source (const char *fname)
-{
- if (!be_global->gen_anyop_files ())
- {
- return 0;
- }
-
- // Retrieve the singleton instance to the outstream factory.
- TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance ();
-
- // Clean up between multiple files.
- delete this->anyop_source_;
- this->anyop_source_ = factory->make_outstream ();
-
- if (0 == this->anyop_source_)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "TAO_CodeGen::start_anyop_source - "
- "Error creating file stream\n"),
- -1);
- }
-
- if (this->anyop_source_->open (fname,
- TAO_OutStream::TAO_CLI_IMPL)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "TAO_CodeGen::start_anyop_source - "
- "Error opening file\n"),
- -1);
- }
-
- // Generate the include statement for the precompiled header file.
- if (be_global->pch_include ())
- {
- *this->anyop_source_ << "#include \""
- << be_global->pch_include ()
- << "\"";
- }
-
- if (be_global->safe_include ())
- {
- // Generate the safe include if it is defined instead of the client header
- // need to put only the base names. Path info is not required.
- *this->anyop_source_ << "\n#include \""
- << be_global->safe_include ()
- << "\"";
- }
- else
- {
- // Generate the include statement for the client header. We just
- // need to put only the base names. Path info is not required.
- *this->anyop_source_ << "\n#include \""
- << be_global->be_get_anyop_header_fname (1)
- << "\"";
- }
-
- this->gen_typecode_includes (this->anyop_source_);
-
- this->gen_any_file_includes (this->anyop_source_);
-
- // Begin versioned namespace support after initial headers have been
- // included, but before the inline file and post include
- // directives.
- *this->anyop_source_ << be_global->versioning_begin ();
-
- return 0;
-}
-
-TAO_OutStream *
-TAO_CodeGen::anyop_header (void)
-{
- return this->anyop_header_;
-}
-
-TAO_OutStream *
-TAO_CodeGen::anyop_source (void)
-{
- return this->anyop_source_;
-}
-
-// Set the server header stream.
-int
-TAO_CodeGen::start_implementation_header (const char *fname)
-{
- // Retrieve the singleton instance to the outstream factory.
- TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance ();
-
- // Clean up between multiple files.
- delete this->implementation_header_;
- this->implementation_header_ = factory->make_outstream ();
-
- if (!this->implementation_header_)
- {
- return -1;
- }
-
- if (this->implementation_header_->open (fname,
- TAO_OutStream::TAO_IMPL_HDR)
- == -1)
- {
- return -1;
- }
-
- *this->implementation_header_ << be_nl << "// TAO_IDL - Generated from "
- << be_nl << "// "
- << __FILE__ << ":" << __LINE__
- << be_nl << be_nl;
-
- // Generate the ident string, if any.
- this->gen_ident_string (this->implementation_header_);
-
- // Generate the #ifndef clause.
- this->gen_ifndef_string (fname,
- this->implementation_header_,
- "",
- "_H_");
-
- const char* server_hdr = BE_GlobalData::be_get_server_hdr_fname (1);
-
- *this->implementation_header_<< "#include \"" << server_hdr <<"\"";
-
- *this->implementation_header_
- << "\n\n#if !defined (ACE_LACKS_PRAGMA_ONCE)\n"
- << "#pragma once\n"
- << "#endif /* ACE_LACKS_PRAGMA_ONCE */\n\n";
-
- if (idl_global->local_iface_seen_)
- {
- *this->implementation_header_ << "#include \"tao/LocalObject.h\"\n\n";
- }
-
- return 0;
-}
-
-
-// Get the implementation header stream.
-TAO_OutStream *
-TAO_CodeGen::implementation_header (void)
-{
- return this->implementation_header_;
-}
-
-
-// Set the implementation skeleton stream.
-int
-TAO_CodeGen::start_implementation_skeleton (const char *fname)
-{
- // Retrieve the singleton instance to the outstream factory.
- TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance ();
-
- // Clean up between multiple files.
- delete this->implementation_skeleton_;
- this->implementation_skeleton_ = factory->make_outstream ();
-
- if (!this->implementation_skeleton_)
- {
- return -1;
- }
-
- if (this->implementation_skeleton_->open (fname,
- TAO_OutStream::TAO_IMPL_SKEL)
- == -1)
- {
- return -1;
- }
-
- *this->implementation_skeleton_ << be_nl << "// TAO_IDL - Generated from "
- << be_nl << "// "
- << __FILE__ << ":" << __LINE__
- << be_nl << be_nl;
-
- // Generate the ident string, if any.
- this->gen_ident_string (this->implementation_skeleton_);
-
- const char* impl_hdr =
- BE_GlobalData::be_get_implementation_hdr_fname ();
-
- this->implementation_skeleton_->print ("#include \"%s\"\n\n",
- impl_hdr);
-
- return 0;
-}
-
-// Get the implementation header stream.
-TAO_OutStream *
-TAO_CodeGen::implementation_skeleton (void)
-{
- return this->implementation_skeleton_;
-}
-
-// Put the last #endif in the client and server headers.
-int
-TAO_CodeGen::end_client_header (void)
-{
- // Generate the <<= and >>= operators here.
-
- *this->client_header_ << be_nl << be_nl << "// TAO_IDL - Generated from"
- << be_nl << "// " << __FILE__ << ":" <<
- __LINE__ << be_nl;
-
- // End versioned namespace support before remaining include
- // directives at end of file.
- *this->client_header_ << be_global->versioning_end ();
-
- // Only when we generate a client inline file generate the include
- if (be_global->gen_client_inline ())
- {
- // Insert the code to include the inline file.
- *this->client_header_ << "#if defined (__ACE_INLINE__)\n";
- *this->client_header_ << "#include \""
- << be_global->be_get_client_inline_fname (1)
- << "\"\n";
- *this->client_header_ << "#endif /* defined INLINE */\n\n";
- }
-
- // Code to put the last #endif.
-
- if (be_global->post_include () != 0)
- {
- *this->client_header_ << "#include /**/ \""
- << be_global->post_include ()
- << "\"\n\n";
- }
-
- *this->client_header_ << "#endif /* ifndef */" << be_nl << be_nl;
-
- return 0;
-}
-
-void
-TAO_CodeGen::end_client_inline (void)
-{
- *this->client_inline_ << "\n";
-
- // End versioned namespace support. Do not place include directives
- // before this.
- *this->client_inline_ << be_global->versioning_end ();
-}
-
-void
-TAO_CodeGen::end_client_stubs (void)
-{
- *this->client_stubs_ << "\n";
-
- // End versioned namespace support. Do not place include directives
- // before this.
- *this->client_stubs_ << be_global->versioning_end ();
-}
-
-int
-TAO_CodeGen::end_server_header (void)
-{
- *this->server_header_ << be_nl << be_nl << "// TAO_IDL - Generated from "
- << be_nl << "// " << __FILE__ << ":" << __LINE__
- << be_nl << be_nl;
-
- // End versioned namespace support. Do not place include directives
- // before this.
- *this->server_header_ << be_global->versioning_end ();
-
- // Insert the template header.
- if (be_global->gen_tie_classes ())
- {
- *this->server_header_ << "#include \""
- << be_global->be_get_server_template_hdr_fname (1)
- << "\"\n";
- }
-
- // Only when we generate a server inline file generate the include
- if (be_global->gen_server_inline ())
- {
- // Insert the code to include the inline file.
- *this->server_header_ << "\n#if defined (__ACE_INLINE__)\n";
- *this->server_header_ << "#include \""
- << be_global->be_get_server_inline_fname (1)
- << "\"\n";
- *this->server_header_ << "#endif /* defined INLINE */";
- }
-
- // Code to put the last #endif.
- *this->server_header_ << "\n\n";
-
- if (be_global->post_include () != 0)
- {
- *this->server_header_ << "#include /**/ \""
- << be_global->post_include ()
- << "\"\n";
- }
-
- *this->server_header_ << "#endif /* ifndef */\n";
- return 0;
-}
-
-void
-TAO_CodeGen::end_server_inline (void)
-{
- *this->server_inline_ << "\n";
-
- // End versioned namespace support. Do not place include directives
- // before this.
- *this->server_inline_ << be_global->versioning_end ();
-}
-
-int
-TAO_CodeGen::end_implementation_header (const char *fname)
-{
- char macro_name [NAMEBUFSIZE] = { 0 };
-
- const char *suffix = ACE_OS::strrchr (fname, '.');
-
- if (suffix == 0)
- {
- // File seems to have no extension, so let us take the name
- // as it is.
- if (fname == 0)
- {
- // Bad file name.
- return -1;
- }
- else
- {
- suffix = fname;
- }
- }
-
- // Convert letters in fname to upper case.
- for (int i = 0; i < (suffix - fname); ++i)
- {
- if (isalpha (fname [i]))
- {
- macro_name[i] = static_cast<char> (toupper (fname [i]));
- }
- else if (isdigit (fname [i]))
- {
- macro_name[i] = fname[i];
- }
- else
- {
- macro_name[i] = '_';
- }
- }
-
- ACE_OS::strcat (macro_name,
- "_H_");
-
- // Code to put the last #endif.
- this->implementation_header_->print ("\n#endif /* %s */\n",
- macro_name);
- return 0;
-}
-
-int
-TAO_CodeGen::end_server_template_header (void)
-{
- *this->server_template_header_ << be_nl << be_nl << "// TAO_IDL - Generated from "
- << be_nl << "// "
- << __FILE__ << ":" << __LINE__ << "\n";
-
- // End versioned namespace support. Do not place include directives
- // before this.
- *this->server_template_header_ << be_global->versioning_end ();
-
- // Insert the code to include the inline file.
- *this->server_template_header_ << "#if defined (__ACE_INLINE__)";
- *this->server_template_header_
- << "\n#include \""
- << be_global->be_get_server_template_inline_fname (1)
- << "\"";
- *this->server_template_header_ << "\n#endif /* defined INLINE */";
-
- // Insert the code to include the template source file.
- *this->server_template_header_
- << "\n\n#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)";
- *this->server_template_header_
- << "\n#include \""
- << be_global->be_get_server_template_skeleton_fname (1)
- << "\"";
- *this->server_template_header_ << "\n#endif /* defined REQUIRED SOURCE */";
-
- // Insert the code to include the template pragma.
- *this->server_template_header_
- << "\n\n#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)";
- *this->server_template_header_
- << "\n#pragma implementation (\""
- << be_global->be_get_server_template_skeleton_fname (1)
- << "\")";
- *this->server_template_header_ << "\n#endif /* defined REQUIRED PRAGMA */";
-
- // Code to put the last #endif.
- *this->server_template_header_ << "\n\n";
-
- if (be_global->post_include () != 0)
- {
- *this->server_template_header_ << "#include /**/ \""
- << be_global->post_include ()
- << "\"\n";
- }
-
- *this->server_template_header_ << "#endif /* ifndef */\n";
- return 0;
-}
-
-int
-TAO_CodeGen::end_server_template_inline (void)
-{
- *this->server_template_inline_ << "\n";
-
- // End versioned namespace support. Do not place include directives
- // before this.
- *this->server_template_inline_ << be_global->versioning_end ();
-
- return 0;
-}
-
-int
-TAO_CodeGen::end_server_template_skeletons (void)
-{
- // End versioned namespace support. Do not place include directives
- // before this.
- *this->server_template_skeletons_ << be_global->versioning_end ();
-
- // Code to put the last #endif.
- *this->server_template_skeletons_ << "\n#endif /* ifndef */\n";
-
- return 0;
-}
-
-int
-TAO_CodeGen::end_server_skeletons (void)
-{
- // End versioned namespace support. Do not place include directives
- // before this.
- *this->server_skeletons_ << be_global->versioning_end ();
-
- // Code to put the last #endif.
- *this->server_skeletons_ << "\n\n#endif /* ifndef */\n";
-
- return 0;
-}
-
-int
-TAO_CodeGen::end_anyop_header (void)
-{
- // End versioned namespace support. Do not place include directives
- // before this.
- *this->anyop_header_ << be_global->versioning_end ();
-
-
- if (be_global->post_include () != 0)
- {
- *this->anyop_header_ << "\n\n#include /**/ \""
- << be_global->post_include ()
- << "\"";
- }
-
- // Code to put the last #endif.
- *this->anyop_header_ << "\n\n#endif /* ifndef */\n";
-
- return 0;
-}
-
-int
-TAO_CodeGen::end_anyop_source (void)
-{
- // End versioned namespace support. Do not place include directives
- // before this.
- *this->anyop_source_ << be_global->versioning_end ();
-
- *this->anyop_source_ << "\n";
-
- return 0;
-}
-
-// We use the following helper functions to pass information. This class is the
-// best place to pass such information rather than passing information through
-// global variables spread everywhere. This class is a singleton and is
-// effectively a global.
-
-void
-TAO_CodeGen::gperf_input_stream (TAO_OutStream *os)
-{
-#if !defined (linux) && !defined (__QNX__) && !defined (__GLIBC__)
- // This causes a seg fault on Linux RH 5.1. Let it leak . . .
- delete this->gperf_input_stream_;
-#endif /* ! linux */
- this->gperf_input_stream_ = os;
-}
-
-TAO_OutStream *
-TAO_CodeGen::gperf_input_stream (void)
-{
- return this->gperf_input_stream_;
-}
-
-void
-TAO_CodeGen::gperf_input_filename (char *filename)
-{
- delete [] this->gperf_input_filename_;
- this->gperf_input_filename_ = filename;
-}
-
-char *
-TAO_CodeGen::gperf_input_filename (void)
-{
- return this->gperf_input_filename_;
-}
-
-void
-TAO_CodeGen::outstream (TAO_OutStream *os)
-{
- this->curr_os_ = os;
-}
-
-TAO_OutStream *
-TAO_CodeGen::outstream (void)
-{
- return this->curr_os_;
-}
-
-void
-TAO_CodeGen::node (be_decl *n)
-{
- this->node_ = n;
-}
-
-be_decl *
-TAO_CodeGen::node (void)
-{
- return this->node_;
-}
-
-void
-TAO_CodeGen::config_visitor_factory (void)
-{
- this->visitor_factory_ = TAO_VISITOR_FACTORY::instance ();
-}
-
-void
-TAO_CodeGen::gen_ident_string (TAO_OutStream *stream) const
-{
- const char *str = idl_global->ident_string ();
-
- if (str != 0)
- {
- *stream << "#" << str << be_nl << be_nl;
- }
-}
-
-void
-TAO_CodeGen::gen_ifndef_string (const char *fname,
- TAO_OutStream *stream,
- const char *prefix,
- const char *suffix)
-{
- char macro_name [NAMEBUFSIZE] = { 0 };
-
- const char *extension = ACE_OS::strrchr (fname, '.');
-
- if (extension == 0)
- {
- // File seems to have no extension, so let us take the name
- // as it is.
- extension = fname;
- }
-
- ACE_OS::sprintf (macro_name, prefix);
-
- size_t offset = ACE_OS::strlen (prefix);
-
- // Convert letters in fname to upper case.
- for (int i = 0; i < (extension - fname); i++)
- {
- if (isalpha (fname [i]))
- {
- macro_name[i + offset] = static_cast<char> (toupper (fname [i]));
- }
- else if (isdigit (fname [i]))
- {
- macro_name[i + offset] = fname[i];
- }
- else
- {
- macro_name[i + offset] = '_';
- }
- }
-
- ACE_OS::strcat (macro_name, suffix);
-
- // Generate the #ifndef ... #define statements.
- stream->print ("#ifndef %s\n",
- macro_name);
- stream->print ("#define %s\n\n",
- macro_name);
-}
-
-void
-TAO_CodeGen::gen_standard_include (TAO_OutStream *stream,
- const char *included_file)
-{
- // Switch between changing or non-changing standard include files
- // include files, so that #include statements can be
- // generated with ""s or <>s respectively, for the standard include
- // files (e.g. tao/corba.h).
-
- const char *start_delimiter = "\"";
- const char *end_delimiter = "\"";
-
- if (be_global->changing_standard_include_files () == 0)
- {
- start_delimiter = "<";
- end_delimiter = ">";
- }
-
- *stream << "\n#include " << start_delimiter
- << included_file
- << end_delimiter;
-}
-
-void
-TAO_CodeGen::gen_stub_hdr_includes (void)
-{
- // Include valuetype and Any/TypeCode headers before ORB core
- // headers to make sure some things are parsed before some templates
- // (e.g. TAO_Pseudo_{Var,Out}_T). Addresses issues with compilers
- // that require all necessary non-dependent names be parsed prior to
- // parsing templates that may use them (e.g. GNU g++ 3.4.x).
-
- this->gen_cond_file_include (be_global->tc_support ()
- && !be_global->gen_anyop_files (),
- "tao/AnyTypeCode/AnyTypeCode_methods.h",
- this->client_header_);
-
- if (idl_global->abstract_iface_seen_)
- {
- // Include the AbstractBase file from the Valuetype library.
- this->gen_standard_include (this->client_header_,
- "tao/Valuetype/AbstractBase.h");
-
- // Turn on generation of the rest of the Valuetype library includes.
- idl_global->valuetype_seen_ = true;
- }
-
- if (idl_global->valuebase_seen_)
- {
- // Include files from the Valuetype library.
- this->gen_standard_include (this->client_header_,
- "tao/Valuetype/ValueBase.h");
-
- // Valuebox needs CDR for _tao_marshal_v code in .inl file
- this->gen_standard_include (this->client_header_,
- "tao/CDR.h");
- }
-
- if (idl_global->valuetype_seen_)
- {
- // Don't want to generate this twice.
- if (!idl_global->valuebase_seen_)
- {
- this->gen_standard_include (this->client_header_,
- "tao/Valuetype/ValueBase.h");
- }
-
- this->gen_standard_include (this->client_header_,
- "tao/Valuetype/Valuetype_Adapter_Factory_Impl.h");
-
- // Check for setting this bit performed in y.tab.cpp, actual checking
- // code is in be_valuetype.cpp.
- this->gen_cond_file_include (
- idl_global->valuefactory_seen_,
- "tao/Valuetype/ValueFactory.h",
- this->client_header_
- );
- }
-
- // @note This header should not go first. See the discussion above
- // regarding non-dependent template names.
- this->gen_cond_file_include (
- be_global->gen_orb_h_include (),
- "tao/ORB.h",
- this->client_header_
- );
-
- this->gen_cond_file_include (
- idl_global->operation_seen_ || idl_global->valuefactory_seen_
- || idl_global->valuebase_seen_,
- "tao/SystemException.h",
- this->client_header_
- );
-
- // For IDL exception, we need full knowledge of CORBA::UserException.
- this->gen_cond_file_include (
- idl_global->exception_seen_,
- "tao/UserException.h",
- this->client_header_
- );
-
- this->gen_standard_include (this->client_header_,
- "tao/Environment.h");
-
- // Conditionally included.
-
- // DDS/DCPS marshaling.
- this->gen_cond_file_include (
- be_global->gen_dcps_type_support (),
- "dds/DCPS/Serializer.h",
- this->client_header_
- );
-
- // Non-abstract interface or keyword 'Object'.
- this->gen_cond_file_include (
- idl_global->non_local_iface_seen_
- | idl_global->local_iface_seen_
- | idl_global->base_object_seen_,
- "tao/Object.h",
- this->client_header_
- );
-
- // This is true if we have a typecode or TCKind in the IDL file.
- // If not included here, it will appear in *C.cpp, if TCs not suppressed.
- this->gen_cond_file_include (
- idl_global->typecode_seen_
- | idl_global->any_seen_,
- "tao/AnyTypeCode/TypeCode.h",
- this->client_header_
- );
-
- this->gen_cond_file_include (
- idl_global->any_seen_
- | idl_global->typecode_seen_,
- "tao/AnyTypeCode/TypeCode_Constants.h",
- this->client_header_);
-
- // This is true if we have an 'any' in the IDL file.
- // If not included here, it will appear in *C.cpp, if Anys not suppressed.
- this->gen_cond_file_include (
- idl_global->any_seen_,
- "tao/AnyTypeCode/Any.h",
- this->client_header_
- );
-
- // Generated if (w)string member of struct/union/exception/array/valuetype
- // has been seen.
- this->gen_cond_file_include (idl_global->string_member_seen_,
- "tao/String_Manager_T.h",
- this->client_header_);
-
- // Include the Messaging library entry point, if AMI is enabled.
- if (be_global->ami_call_back () == true)
- {
- // Include Messaging skeleton file.
- this->gen_standard_include (this->client_header_,
- "tao/Messaging/Messaging.h");
- }
-
- // Include the smart proxy base class if smart proxies are enabled.
- if (be_global->gen_smart_proxies () == true)
- {
- this->gen_standard_include (this->client_header_,
- "tao/SmartProxies/Smart_Proxies.h");
- }
-
- // If we have not suppressed Any operator generation and also
- // are not generating the operators in a separate file, we
- // need to include the *A.h file from all .pidl files here.
- if (be_global->any_support () && !be_global->gen_anyop_files ())
- {
- for (size_t j = 0; j < idl_global->n_included_idl_files (); ++j)
- {
- char* idl_name = idl_global->included_idl_files ()[j];
-
- ACE_CString pidl_checker (idl_name);
- bool got_pidl =
- (pidl_checker.substr (pidl_checker.length () - 5) == ".pidl")
- && (pidl_checker.find ("IFR_Client") == ACE_CString::npos);
- // We can't use the -GA option on IFR_Client .pidl files,
- // because there are decls inside interfaces.
-
- // If we're here and we have a .pidl file, we need to generate
- // the *A.h include from the AnyTypeCode library.
- if (got_pidl)
- {
- // Make a String out of it.
- UTL_String idl_name_str = idl_name;
-
- const char *anyop_hdr =
- BE_GlobalData::be_get_anyop_header (&idl_name_str, 1);
-
- idl_name_str.destroy ();
-
- // Stripped off any scope in the name and add the
- // AnyTypeCode prefix.
- ACE_CString work_hdr (anyop_hdr);
- ACE_CString final_hdr = "tao/AnyTypeCode/";
- ACE_CString::size_type pos = work_hdr.rfind ('/');
-
- if (pos != ACE_SString::npos)
- {
- ACE_CString scope (work_hdr.substr (0, pos));
-
- // If we find a '/' in the containing scope name, it
- // means we are including a .pidl file from a
- // subdirectory of $TAO_ROOT/tao, and so we should
- // include the anyop_hdr string as is, and not strip
- // off the scope name and prepend "tao/AnyTypeCode/".
- // Only .pidl files in $TAO_ROOT/tao itself have
- // their generated *A.* files moved to the AnyTypeCode
- // library.
- if (scope.find ('/') == ACE_SString::npos)
- {
- work_hdr = work_hdr.substr (pos + 1);
- final_hdr += work_hdr;
- }
- else
- {
- final_hdr = work_hdr;
- }
- }
-
- this->client_header_->print ("\n#include \"%s\"",
- final_hdr.c_str ());
- }
- }
- }
-
-
- // Must have knowledge of the base class.
- this->gen_seq_file_includes ();
-
- // _vars and _outs are typedefs of template class instantiations.
- this->gen_var_file_includes ();
-
- // Versioned namespace support.
- this->gen_standard_include (this->client_header_,
- "tao/Versioned_Namespace.h");
-}
-
-void
-TAO_CodeGen::gen_stub_src_includes (void)
-{
- // Generate the include statement for the precompiled header file.
- if (be_global->pch_include ())
- {
- *this->client_stubs_ << "#include \""
- << be_global->pch_include ()
- << "\"";
- }
-
- if (be_global->safe_include ())
- {
- // Generate the safe include if it is defined instead of the client header
- // need to put only the base names. Path info is not required.
- *this->client_stubs_ << "\n#include \""
- << be_global->safe_include ()
- << "\"";
- }
- else
- {
- // Generate the include statement for the client header. We just
- // need to put only the base names. Path info is not required.
- *this->client_stubs_ << "\n#include \""
- << be_global->be_get_client_hdr_fname (1)
- << "\"";
- }
-
- if (be_global->tc_support ()
- && !be_global->gen_anyop_files ())
- {
- this->gen_typecode_includes (this->client_stubs_);
- }
-
- // Always generated.
- this->gen_standard_include (this->client_stubs_,
- "tao/CDR.h");
-
- // Conditional includes.
-
- if (idl_global->non_local_op_seen_)
- {
- this->gen_standard_include (this->client_stubs_,
- "tao/Exception_Data.h");
- }
-
- // Operations for local interfaces are pure virtual.
- if (idl_global->non_local_op_seen_)
- {
- this->gen_standard_include (this->client_stubs_,
- "tao/Invocation_Adapter.h");
- }
-
- // Any abstract interface present will probably have an operation.
- if (idl_global->abstract_iface_seen_)
- {
- this->gen_standard_include (
- this->client_stubs_,
- "tao/Valuetype/AbstractBase_Invocation_Adapter.h"
- );
-
- this->gen_standard_include (
- this->client_stubs_,
- "tao/Valuetype/AbstractBase_T.h"
- );
- }
-
- if (be_global->ami_call_back () == true)
- {
- this->gen_standard_include (this->client_stubs_,
- "tao/Messaging/Asynch_Invocation_Adapter.h");
-
- this->gen_standard_include (this->client_stubs_,
- "tao/Messaging/ExceptionHolder_i.h");
- }
-
- // If valuefactory_seen_ was set, this was generated in the stub header file,
- // otherwise it needs to go here - used in _tao_unmarshal().
- if (idl_global->valuetype_seen_
- && !idl_global->valuefactory_seen_)
- {
- this->gen_standard_include (this->client_stubs_,
- "tao/Valuetype/ValueFactory.h");
- }
-
- if (idl_global->non_local_iface_seen_)
- {
- // Needed for _narrow(), which is now template-based.
- this->gen_standard_include (this->client_stubs_,
- "tao/Object_T.h");
- }
-
- if (idl_global->octet_seq_seen_)
- {
- // Needed for the TAO_NO_COPY_OCTET_SEQUENCES optimization. Note that
- // it is preferable to just refer to CORBA::OctetSeq in the IDL file.
- this->gen_standard_include (this->client_stubs_,
- "tao/ORB_Core.h");
- }
-
- // The UserException::_tao_{en,de}code() methods can throw a
- // CORBA::MARSHAL exception so make sure that system exception is
- // fully declared/defined by including "tao/SystemException.h".
- // However, only include "tao/SystemException.h" if a user exception
- // was encountered and if we're not already including it in the stub
- // header.
- if (idl_global->exception_seen_
- && !idl_global->operation_seen_)
- {
- this->gen_standard_include (this->client_stubs_,
- "tao/SystemException.h");
- }
-
- // Includes whatever Any template classes that may be needed.
- if (!be_global->gen_anyop_files ())
- {
- this->gen_any_file_includes (this->client_stubs_);
- }
-
- // Includes whatever arg helper template classes that may be needed.
- this->gen_stub_arg_file_includes (this->client_stubs_);
-
- // strlen() for DCPS marshaling or
- // strcmp() is used with interfaces and exceptions.
- if ((be_global->gen_dcps_type_support ()
- && (idl_global->string_seen_
- || idl_global->string_seq_seen_
- || idl_global->wstring_seq_seen_) )
- || idl_global->interface_seen_
- || idl_global->exception_seen_
- || idl_global->union_seen_)
- {
- // Needed for _narrow(), which is now template-based.
- this->gen_standard_include (this->client_stubs_,
- "ace/OS_NS_string.h");
- }
-
- if (be_global->gen_amh_classes () == true)
- {
- // Necessary for the AIX compiler.
- this->gen_standard_include (this->client_stubs_,
- "ace/Auto_Ptr.h");
- }
-}
-
-void
-TAO_CodeGen::gen_skel_src_includes (void)
-{
- // Only non-local interfaces generate anything in the skeleton.
- if (!(idl_global->non_local_iface_seen_
- || idl_global->need_skeleton_includes_))
- {
- return;
- }
-
- switch (be_global->lookup_strategy ())
- {
- case BE_GlobalData::TAO_DYNAMIC_HASH:
- {
- this->gen_standard_include (this->server_skeletons_,
- "tao/PortableServer/Operation_Table_Dynamic_Hash.h");
- }
- break;
- case BE_GlobalData::TAO_LINEAR_SEARCH:
- {
- this->gen_standard_include (this->server_skeletons_,
- "tao/PortableServer/Operation_Table_Linear_Search.h");
- }
- break;
- case BE_GlobalData::TAO_BINARY_SEARCH:
- {
- this->gen_standard_include (this->server_skeletons_,
- "tao/PortableServer/Operation_Table_Binary_Search.h");
- }
- break;
- case BE_GlobalData::TAO_PERFECT_HASH:
- {
- this->gen_standard_include (this->server_skeletons_,
- "tao/PortableServer/Operation_Table_Perfect_Hash.h");
- }
- break;
- }
-
- if (be_global->gen_direct_collocation ())
- {
- this->gen_standard_include (
- this->server_skeletons_,
- "tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h"
- );
- }
-
- this->gen_standard_include (this->server_skeletons_,
- "tao/PortableServer/Upcall_Command.h");
- this->gen_standard_include (this->server_skeletons_,
- "tao/PortableServer/Upcall_Wrapper.h");
-
- this->gen_standard_include (this->server_skeletons_,
- "tao/TAO_Server_Request.h");
- this->gen_standard_include (this->server_skeletons_,
- "tao/ORB_Core.h");
- this->gen_standard_include (this->server_skeletons_,
- "tao/Profile.h");
- this->gen_standard_include (this->server_skeletons_,
- "tao/Stub.h");
- this->gen_standard_include (this->server_skeletons_,
- "tao/IFR_Client_Adapter.h");
- this->gen_standard_include (this->server_skeletons_,
- "tao/Object_T.h");
- this->gen_standard_include (this->server_skeletons_,
- "tao/AnyTypeCode/TypeCode.h");
- this->gen_standard_include (this->server_skeletons_,
- "tao/AnyTypeCode/DynamicC.h");
- this->gen_standard_include (this->server_skeletons_,
- "tao/CDR.h");
- this->gen_standard_include (this->server_skeletons_,
- "tao/operation_details.h");
- this->gen_standard_include (this->server_skeletons_,
- "tao/PortableInterceptor.h");
-
- this->gen_skel_arg_file_includes (this->server_skeletons_);
-
- if (be_global->gen_thru_poa_collocation ()
- || be_global->gen_direct_collocation ())
- {
- // Collocation skeleton code doesn't use "SArg" variants.
- this->gen_stub_arg_file_includes (this->server_skeletons_);
- }
-
- // The following header must always be included.
- if (be_global->gen_amh_classes ())
- {
- this->gen_standard_include (this->server_skeletons_,
- "tao/Thread_Lane_Resources.h");
- this->gen_standard_include (this->server_skeletons_,
- "tao/Buffer_Allocator_T.h");
- this->gen_standard_include (this->server_skeletons_,
- "ace/Auto_Functor.h");
- }
-
- this->gen_standard_include (this->server_skeletons_,
- "ace/Dynamic_Service.h");
-
- // For Static_Allocator_Base
- this->gen_standard_include (this->server_skeletons_,
- "ace/Malloc_Allocator.h");
-}
-
-void
-TAO_CodeGen::gen_seq_file_includes (void)
-{
- // @@@ (JP) These can get more specialized, after the TAO seq template
- // files have been split up.
-
- this->gen_cond_file_include (
- idl_global->vt_seq_seen_,
- "tao/Valuetype/Sequence_T.h",
- this->client_header_
- );
-
- this->gen_cond_file_include (
- idl_global->seq_seen_,
- "tao/Sequence_T.h",
- this->client_header_
- );
-}
-
-void
-TAO_CodeGen::gen_any_file_includes (TAO_OutStream * stream)
-{
- if (be_global->any_support ())
- {
- this->gen_standard_include (stream,
- "tao/CDR.h");
-
- // Any_Impl_T.cpp needs the full CORBA::Any type.
- this->gen_cond_file_include (
- idl_global->interface_seen_
- | idl_global->valuetype_seen_,
- "tao/AnyTypeCode/Any.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->interface_seen_
- | idl_global->valuetype_seen_,
- "tao/AnyTypeCode/Any_Impl_T.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->aggregate_seen_
- | idl_global->seq_seen_
- | idl_global->exception_seen_,
- "tao/AnyTypeCode/Any_Dual_Impl_T.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->array_seen_,
- "tao/AnyTypeCode/Any_Array_Impl_T.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->enum_seen_,
- "tao/AnyTypeCode/Any_Basic_Impl_T.h",
- stream
- );
- }
-}
-
-void
-TAO_CodeGen::gen_var_file_includes (void)
-{
- this->gen_cond_file_include (
- idl_global->valuetype_seen_
- | idl_global->fwd_valuetype_seen_,
- "tao/Valuetype/Value_VarOut_T.h",
- this->client_header_
- );
-
- this->gen_cond_file_include (
- idl_global->interface_seen_
- | idl_global->fwd_iface_seen_,
- "tao/Objref_VarOut_T.h",
- this->client_header_
- );
-
- this->gen_cond_file_include (
- idl_global->seq_seen_,
- "tao/Seq_Var_T.h",
- this->client_header_
- );
-
- this->gen_cond_file_include (
- idl_global->seq_seen_,
- "tao/Seq_Out_T.h",
- this->client_header_
- );
-
- this->gen_cond_file_include (
- idl_global->aggregate_seen_,
- "tao/VarOut_T.h",
- this->client_header_
- );
-
- this->gen_cond_file_include (
- idl_global->array_seen_,
- "tao/Array_VarOut_T.h",
- this->client_header_
- );
-}
-
-void
-TAO_CodeGen::gen_stub_arg_file_includes (TAO_OutStream * stream)
-{
- this->gen_cond_file_include (
- idl_global->basic_arg_seen_,
- "tao/Basic_Arguments.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->bd_string_arg_seen_,
- "tao/BD_String_Argument_T.h",
- stream
- );
-
- // If we have a bound string and we have any generation enabled we must
- // include Any.h to get the <<= operator for BD_String
- this->gen_cond_file_include (
- idl_global->bd_string_arg_seen_ && be_global->any_support (),
- "tao/AnyTypeCode/Any.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->fixed_array_arg_seen_,
- "tao/Fixed_Array_Argument_T.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->fixed_size_arg_seen_,
- "tao/Fixed_Size_Argument_T.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->object_arg_seen_,
- "tao/Object_Argument_T.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->special_basic_arg_seen_,
- "tao/Special_Basic_Arguments.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->ub_string_arg_seen_,
- "tao/UB_String_Arguments.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->var_array_arg_seen_,
- "tao/Var_Array_Argument_T.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->var_size_arg_seen_,
- "tao/Var_Size_Argument_T.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->any_arg_seen_,
- "tao/AnyTypeCode/Any_Arg_Traits.h",
- stream
- );
-}
-
-
-void
-TAO_CodeGen::gen_skel_arg_file_includes (TAO_OutStream * stream)
-{
- this->gen_cond_file_include (
- idl_global->basic_arg_seen_,
- "tao/PortableServer/Basic_SArguments.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->bd_string_arg_seen_,
- "tao/PortableServer/BD_String_SArgument_T.h",
- stream
- );
-
- // If we have a bound string and we have any generation enabled we must
- // include Any.h to get the <<= operator for BD_String
- this->gen_cond_file_include (
- idl_global->bd_string_arg_seen_ && be_global->any_support (),
- "tao/AnyTypeCode/Any.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->fixed_array_arg_seen_,
- "tao/PortableServer/Fixed_Array_SArgument_T.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->fixed_size_arg_seen_,
- "tao/PortableServer/Fixed_Size_SArgument_T.h",
- stream
- );
-
- // Always needed for CORBA::Object handling in _component() skeleton
- // code when an unconstrained (non-local) IDL interface is defined.
- this->gen_cond_file_include (
- idl_global->non_local_iface_seen_
- || idl_global->object_arg_seen_,
- "tao/PortableServer/Object_SArgument_T.h",
- stream
- );
-
- // Always needed for CORBA::Boolean handling in _is_a() skeleton
- // code when an unconstrained (non-local) IDL interface is defined.
- this->gen_cond_file_include (
- idl_global->non_local_iface_seen_
- || idl_global->special_basic_arg_seen_,
- "tao/PortableServer/Special_Basic_SArguments.h",
- stream
- );
-
- // Always needed for string argument handling in _is_a() skeleton
- // code when an unconstrained (non-local) IDL interface is defined.
- this->gen_cond_file_include (
- idl_global->non_local_iface_seen_
- || idl_global->ub_string_arg_seen_,
- "tao/PortableServer/UB_String_SArguments.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->var_array_arg_seen_,
- "tao/PortableServer/Var_Array_SArgument_T.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->var_size_arg_seen_,
- "tao/PortableServer/Var_Size_SArgument_T.h",
- stream
- );
-
- this->gen_cond_file_include (
- idl_global->any_arg_seen_,
- "tao/PortableServer/Any_SArg_Traits.h",
- stream
- );
-
- this->gen_standard_include (stream,
- "tao/PortableServer/TypeCode_SArg_Traits.h");
- this->gen_standard_include (stream,
- "tao/PortableServer/Object_SArg_Traits.h");
-
- if (be_global->gen_thru_poa_collocation ())
- {
- // Thru-POA/skeleton argument selection function templates.
- this->gen_cond_file_include (idl_global->non_local_iface_seen_,
- "tao/PortableServer/get_arg.h",
- stream);
-
- // We need the stub side argument templates when thru-POA
- // collocation is enabled for type resolution.
- // this->gen_stub_arg_file_includes (stream);
-
- // Always needed for CORBA::Boolean handling in _is_a() skeleton
- // code when an unconstrained (non-local) IDL interface is defined.
- this->gen_cond_file_include (idl_global->non_local_iface_seen_,
- "tao/Special_Basic_Arguments.h",
- stream);
-
- // Always needed for string argument handling in _is_a() skeleton
- // code when an unconstrained (non-local) IDL interface is defined.
- this->gen_cond_file_include (idl_global->non_local_iface_seen_,
- "tao/UB_String_Arguments.h",
- stream);
- }
-}
-
-void
-TAO_CodeGen::gen_cond_file_include (bool condition_green,
- const char *filepath,
- TAO_OutStream *stream)
-{
- if (condition_green)
- {
- this->gen_standard_include (stream,
- filepath);
- }
-}
-
-void
-TAO_CodeGen::gen_typecode_includes (TAO_OutStream * stream)
-{
- this->gen_standard_include (stream,
- "tao/AnyTypeCode/Null_RefCount_Policy.h");
-
- this->gen_standard_include (stream,
- "tao/AnyTypeCode/TypeCode_Constants.h");
-
- // Just assume we're going to need alias TypeCodes since there is
- // currently no alias_seen_ or typedef_seen_ flag in idl_global.
- this->gen_standard_include (stream,
- "tao/AnyTypeCode/Alias_TypeCode_Static.h");
-
- this->gen_cond_file_include (idl_global->enum_seen_,
- "tao/AnyTypeCode/Enum_TypeCode_Static.h",
- stream);
-
- this->gen_cond_file_include (idl_global->interface_seen_,
- "tao/AnyTypeCode/Objref_TypeCode_Static.h",
- stream);
-
- this->gen_cond_file_include (idl_global->seq_seen_
- | idl_global->array_seen_,
- "tao/AnyTypeCode/Sequence_TypeCode_Static.h",
- stream);
-
- this->gen_cond_file_include (idl_global->string_seen_,
- "tao/AnyTypeCode/String_TypeCode_Static.h",
- stream);
-
- this->gen_cond_file_include (
- idl_global->exception_seen_
- | idl_global->aggregate_seen_,
- "tao/AnyTypeCode/Struct_TypeCode_Static.h",
- stream);
-
- this->gen_cond_file_include (
- idl_global->exception_seen_
- | idl_global->aggregate_seen_,
- "tao/AnyTypeCode/TypeCode_Struct_Field.h",
- stream);
-
- this->gen_cond_file_include (idl_global->union_seen_,
- "tao/AnyTypeCode/TypeCode_Case_T.h",
- stream);
-
- this->gen_cond_file_include (idl_global->union_seen_,
- "tao/AnyTypeCode/Union_TypeCode_Static.h",
- stream);
-
- this->gen_cond_file_include (idl_global->valuetype_seen_,
- "tao/AnyTypeCode/Value_TypeCode_Static.h",
- stream);
-
- this->gen_cond_file_include (idl_global->valuetype_seen_,
- "tao/AnyTypeCode/TypeCode_Value_Field.h",
- stream);
-
- this->gen_cond_file_include (idl_global->recursive_type_seen_,
- "tao/AnyTypeCode/Recursive_Type_TypeCode.h",
- stream);
-}
-
-void
-TAO_CodeGen::destroy (void)
-{
- delete this->client_header_;
- delete this->server_header_;
- delete this->implementation_header_;
- delete this->implementation_skeleton_;
- delete this->server_template_header_;
- delete this->client_stubs_;
- delete this->server_skeletons_;
- delete this->server_template_skeletons_;
- delete this->client_inline_;
- delete this->server_inline_;
- delete this->server_template_inline_;
- delete this->anyop_source_;
- delete this->anyop_header_;
-#if !defined (linux) && !defined (__QNX__) && !defined (__GLIBC__)
- // This causes a seg fault on Linux RH 5.1. Let it leak . . .
- delete this->gperf_input_stream_;
-#endif /* ! linux */
- delete [] this->gperf_input_filename_;
- this->curr_os_ = 0;
-}
diff --git a/TAO/TAO_IDL/be/be_component.cpp b/TAO/TAO_IDL/be/be_component.cpp
deleted file mode 100644
index a19d6a27eb1..00000000000
--- a/TAO/TAO_IDL/be/be_component.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_component.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Component that provides additional means for C++
-// mapping of an interface.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-#include "be_component.h"
-#include "be_visitor.h"
-
-#include "global_extern.h"
-#include "utl_err.h"
-
-ACE_RCSID (be,
- be_component,
- "$Id$")
-
-be_component::be_component (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- UTL_Scope (),
- AST_Interface (),
- AST_Component (),
- be_scope (),
- be_type (),
- be_interface ()
-{
- this->size_type (AST_Type::VARIABLE);
- this->has_constructor (true);
-}
-
-be_component::be_component (UTL_ScopedName *n,
- AST_Component *base_component,
- AST_Interface **supports,
- long n_supports,
- AST_Interface **supports_flat,
- long n_supports_flat)
- : COMMON_Base (false,
- false),
- AST_Decl (AST_Decl::NT_component,
- n),
- AST_Type (AST_Decl::NT_component,
- n),
- UTL_Scope (AST_Decl::NT_component),
- AST_Interface (n,
- supports,
- n_supports,
- supports_flat,
- n_supports_flat,
- false,
- false),
- AST_Component (n,
- base_component,
- supports,
- n_supports,
- supports_flat,
- n_supports_flat),
- be_scope (AST_Decl::NT_component),
- be_type (AST_Decl::NT_component,
- n),
- be_interface (n,
- supports,
- n_supports,
- supports_flat,
- n_supports_flat,
- false,
- false)
-{
- this->size_type (AST_Type::VARIABLE);
- this->has_constructor (true);
-}
-
-be_component::~be_component (void)
-{
-}
-
-void
-be_component::redefine (AST_Interface *from)
-{
- be_component *bc = be_component::narrow_from_decl (from);
- this->var_out_seq_decls_gen_ = bc->var_out_seq_decls_gen_;
- AST_Component::redefine (from);
-}
-
-void
-be_component::destroy ()
-{
- this->be_interface::destroy ();
- this->AST_Component::destroy ();
-}
-
-int
-be_component::accept (be_visitor *visitor)
-{
- if (idl_global->ignore_idl3 ())
- {
- idl_global->err ()->ignore_idl3_error (this);
- return -1;
- }
-
- return visitor->visit_component (this);
-}
-
-AST_Structure *
-be_component::be_add_structure (AST_Structure *t)
-{
- return this->fe_add_structure (t);
-}
-
-AST_Typedef *
-be_component::be_add_typedef (AST_Typedef *t)
-{
- return this->fe_add_typedef (t);
-}
-
-// Narrowing.
-IMPL_NARROW_METHODS2 (be_component, be_interface, AST_Component)
-IMPL_NARROW_FROM_DECL (be_component)
-IMPL_NARROW_FROM_SCOPE (be_component)
diff --git a/TAO/TAO_IDL/be/be_component_fwd.cpp b/TAO/TAO_IDL/be/be_component_fwd.cpp
deleted file mode 100644
index 17996631869..00000000000
--- a/TAO/TAO_IDL/be/be_component_fwd.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_component_fwd.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_ComponentFwd that provides additional means for C++
-// mapping of a forward declared component.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-#include "be_component_fwd.h"
-#include "be_visitor.h"
-#include "global_extern.h"
-#include "utl_err.h"
-
-ACE_RCSID (be,
- be_component_fwd,
- "$Id$")
-
-be_component_fwd::be_component_fwd (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_InterfaceFwd (),
- AST_ComponentFwd (),
- be_type (),
- be_interface_fwd ()
-{
- this->size_type (AST_Type::VARIABLE);
-}
-
-be_component_fwd::be_component_fwd (AST_Interface *dummy,
- UTL_ScopedName *n)
- : COMMON_Base (),
- AST_Decl (AST_Decl::NT_component_fwd,
- n),
- AST_Type (AST_Decl::NT_component_fwd,
- n),
- AST_InterfaceFwd (dummy,
- n),
- AST_ComponentFwd (dummy,
- n),
- be_type (AST_Decl::NT_component_fwd,
- n),
- be_interface_fwd (dummy,
- n)
-{
- this->size_type (AST_Type::VARIABLE);
-}
-
-be_component_fwd::~be_component_fwd (void)
-{
-}
-
-void
-be_component_fwd::destroy (void)
-{
- this->AST_ComponentFwd::destroy ();
-}
-
-int
-be_component_fwd::accept (be_visitor *visitor)
-{
- if (idl_global->ignore_idl3 ())
- {
- idl_global->err ()->ignore_idl3_error (this);
- return -1;
- }
-
- return visitor->visit_component_fwd (this);
-}
-
-// Narrowing
-IMPL_NARROW_METHODS2 (be_component_fwd, AST_ComponentFwd, be_interface_fwd)
-IMPL_NARROW_FROM_DECL (be_component_fwd)
diff --git a/TAO/TAO_IDL/be/be_constant.cpp b/TAO/TAO_IDL/be/be_constant.cpp
deleted file mode 100644
index be495979757..00000000000
--- a/TAO/TAO_IDL/be/be_constant.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_constant.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Constant that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_constant.h"
-#include "be_visitor.h"
-#include "utl_scope.h"
-#include "nr_extern.h"
-
-ACE_RCSID (be,
- be_constant,
- "$Id$")
-
-be_constant::be_constant (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Constant (),
- be_decl ()
-{
-}
-
-be_constant::be_constant (AST_Expression::ExprType et,
- AST_Expression *v,
- UTL_ScopedName *n)
- : COMMON_Base (),
- AST_Decl (AST_Decl::NT_const,
- n),
- AST_Constant (et,
- v,
- n),
- be_decl (AST_Decl::NT_const,
- n)
-{
-}
-
-int
-be_constant::accept (be_visitor *visitor)
-{
- return visitor->visit_constant (this);
-}
-
-void
-be_constant::destroy (void)
-{
- this->be_decl::destroy ();
- this->AST_Constant::destroy ();
-}
-
-// Narrowing
-IMPL_NARROW_METHODS2 (be_constant, AST_Constant, be_decl)
-IMPL_NARROW_FROM_DECL (be_constant)
diff --git a/TAO/TAO_IDL/be/be_decl.cpp b/TAO/TAO_IDL/be/be_decl.cpp
deleted file mode 100644
index 81b23b7d59c..00000000000
--- a/TAO/TAO_IDL/be/be_decl.cpp
+++ /dev/null
@@ -1,967 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_decl.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Decl that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_decl.h"
-#include "be_scope.h"
-#include "be_interface.h"
-#include "be_interface_fwd.h"
-#include "be_valuetype.h"
-#include "be_component.h"
-#include "be_eventtype.h"
-#include "be_home.h"
-#include "be_module.h"
-#include "be_root.h"
-#include "be_exception.h"
-#include "be_structure.h"
-#include "be_union.h"
-#include "be_enum.h"
-#include "be_operation.h"
-#include "be_factory.h"
-#include "be_sequence.h"
-#include "be_visitor.h"
-#include "ast_structure_fwd.h"
-#include "ast_string.h"
-#include "utl_identifier.h"
-#include "global_extern.h"
-#include "ace/Log_Msg.h"
-#include "ace/String_Base.h"
-
-ACE_RCSID (be,
- be_decl,
- "$Id$")
-
-// Default Constructor
-be_decl::be_decl (void)
- : COMMON_Base (),
- AST_Decl (),
- cli_hdr_gen_ (false),
- cli_stub_gen_ (false),
- cli_inline_gen_ (false),
- srv_hdr_gen_ (false),
- impl_hdr_gen_ (false),
- srv_skel_gen_ (false),
- impl_skel_gen_ (false),
- srv_inline_gen_ (false),
- cli_hdr_any_op_gen_ (false),
- cli_stub_any_op_gen_ (false),
- cli_hdr_cdr_op_gen_ (false),
- cli_stub_cdr_op_gen_ (false),
- cli_inline_cdr_op_gen_ (false),
- cli_inline_cdr_decl_gen_ (false),
- cli_hdr_serializer_op_gen_ (false),
- cli_stub_serializer_op_gen_ (false),
- cli_inline_serializer_op_gen_ (false),
- cli_inline_serializer_decl_gen_ (false),
- cli_traits_gen_ (false),
- cli_arg_traits_gen_ (false),
- srv_arg_traits_gen_ (false),
- srv_sarg_traits_gen_ (false),
- cli_pragma_inst_gen_ (false),
- cli_inarg_tmpl_class_gen_ (false),
- cli_inarg_pragma_inst_gen_ (false),
- cli_inoutarg_tmpl_class_gen_ (false),
- cli_inoutarg_pragma_inst_gen_ (false),
- cli_outarg_tmpl_class_gen_ (false),
- cli_outarg_pragma_inst_gen_ (false),
- cli_retarg_tmpl_class_gen_ (false),
- cli_retarg_pragma_inst_gen_ (false),
- srv_tmpl_class_gen_ (false),
- srv_pragma_inst_gen_ (false),
- srv_inarg_tmpl_class_gen_ (false),
- srv_inarg_pragma_inst_gen_ (false),
- srv_inoutarg_tmpl_class_gen_ (false),
- srv_inoutarg_pragma_inst_gen_ (false),
- srv_outarg_tmpl_class_gen_ (false),
- srv_outarg_pragma_inst_gen_ (false),
- srv_retarg_tmpl_class_gen_ (false),
- srv_retarg_pragma_inst_gen_ (false),
- ccm_pre_proc_gen_ (false)
-{
-}
-
-// Constructor
-be_decl::be_decl (AST_Decl::NodeType type,
- UTL_ScopedName *n)
- : COMMON_Base (),
- AST_Decl (type,
- n),
- cli_hdr_gen_ (false),
- cli_stub_gen_ (false),
- cli_inline_gen_ (false),
- srv_hdr_gen_ (false),
- impl_hdr_gen_ (false),
- srv_skel_gen_ (false),
- impl_skel_gen_ (false),
- srv_inline_gen_ (false),
- cli_hdr_any_op_gen_ (false),
- cli_stub_any_op_gen_ (false),
- cli_hdr_cdr_op_gen_ (false),
- cli_stub_cdr_op_gen_ (false),
- cli_inline_cdr_op_gen_ (false),
- cli_inline_cdr_decl_gen_ (false),
- cli_hdr_serializer_op_gen_ (false),
- cli_stub_serializer_op_gen_ (false),
- cli_inline_serializer_op_gen_ (false),
- cli_inline_serializer_decl_gen_ (false),
- cli_traits_gen_ (false),
- cli_arg_traits_gen_ (false),
- srv_arg_traits_gen_ (false),
- srv_sarg_traits_gen_ (false),
- cli_pragma_inst_gen_ (false),
- cli_inarg_tmpl_class_gen_ (false),
- cli_inarg_pragma_inst_gen_ (false),
- cli_inoutarg_tmpl_class_gen_ (false),
- cli_inoutarg_pragma_inst_gen_ (false),
- cli_outarg_tmpl_class_gen_ (false),
- cli_outarg_pragma_inst_gen_ (false),
- cli_retarg_tmpl_class_gen_ (false),
- cli_retarg_pragma_inst_gen_ (false),
- srv_tmpl_class_gen_ (false),
- srv_pragma_inst_gen_ (false),
- srv_inarg_tmpl_class_gen_ (false),
- srv_inarg_pragma_inst_gen_ (false),
- srv_inoutarg_tmpl_class_gen_ (false),
- srv_inoutarg_pragma_inst_gen_ (false),
- srv_outarg_tmpl_class_gen_ (false),
- srv_outarg_pragma_inst_gen_ (false),
- srv_retarg_tmpl_class_gen_ (false),
- srv_retarg_pragma_inst_gen_ (false),
- ccm_pre_proc_gen_ (false)
-{
-}
-
-// Destructor
-be_decl::~be_decl (void)
-{
-}
-
-void
-be_decl::compute_full_name (const char *prefix,
- const char *suffix,
- char *&name)
-{
- if (prefix == 0 || suffix == 0)
- {
- return;
- }
-
- ACE_CString prefix_str (prefix);
- ACE_CString suffix_str (suffix);
- ACE_CString result_str;
-
- // Get parent.
- if (this->defined_in () == 0)
- {
- // Global scope.
-
- // Prefix.
- result_str = prefix_str;
-
- // Local name.
- result_str += ACE_CString (this->local_name ()->get_string ());
-
- // Suffix.
- result_str += suffix_str;
- }
- else
- {
- // Get scope name.
- be_decl *parent =
- be_scope::narrow_from_scope (this->defined_in ())->decl ();
-
- if (parent == 0)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_decl::"
- "compute_full_name - "
- "scope name is nil\n"));
- }
-
- // Parent name.
- result_str = ACE_CString (parent->full_name ());
-
- // _
- if (ACE_OS::strcmp (parent->full_name (), "") != 0)
- {
- result_str += ACE_CString ("::");
- }
-
- // Prefix.
- result_str += prefix_str;
-
- // Local name.
- result_str += ACE_CString (this->local_name ()->get_string ());
-
- // Suffix.
- result_str += suffix_str;
- }
-
- name = ACE_OS::strdup (result_str.fast_rep ());
-}
-
-void
-be_decl::compute_flat_name (const char *prefix,
- const char *suffix,
- char *&name)
-{
- if (prefix == 0 || suffix == 0)
- {
- return;
- }
-
- ACE_CString prefix_str (prefix);
- ACE_CString suffix_str (suffix);
-
- ACE_CString result_str;
-
- // Get parent.
- if (this->defined_in () == 0)
- {
- // Global scope.
-
- // Prefix.
- result_str = prefix_str;
-
- // Local name.
- result_str += ACE_CString (this->local_name ()->get_string ());
-
- // Suffix.
- result_str += suffix_str;
- }
- else
- {
- // Get scope name.
- be_decl *parent =
- be_scope::narrow_from_scope (this->defined_in ())->decl ();
- if (parent == 0)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_decl::"
- "compute_flat_name - "
- "scope name is nil\n"));
- }
-
- // Parent name.
- result_str = ACE_CString (parent->flat_name ());
-
- // _
- if (ACE_OS::strcmp (parent->flat_name (), "") != 0)
- result_str += "_";
-
- // Prefix.
- result_str += prefix_str;
-
- // Local name.
- result_str += ACE_CString (this->local_name ()->get_string ());
-
- // Suffix.
- result_str += suffix_str;
- }
-
- name = ACE_OS::strdup (result_str.c_str ());
-}
-
-void
-be_decl::destroy (void)
-{
-}
-
-void
-be_decl::set_local (bool val)
-{
- this->is_local_ = val;
-}
-
-// Return the scope created by this node (if one exists, else NULL).
-be_scope *
-be_decl::scope (void)
-{
- be_decl *d = this;
-
- switch (this->node_type ())
- {
- case AST_Decl::NT_interface_fwd:
- // Resolve forward declared interface by looking at full_definition()
- // field and iterating.
- d =
- be_interface::narrow_from_decl (
- (be_interface_fwd::narrow_from_decl (this))->full_definition ()
- );
- // Fall through
- case AST_Decl::NT_interface:
- return be_interface::narrow_from_decl (d);
- case AST_Decl::NT_module:
- return be_module::narrow_from_decl (d);
- case AST_Decl::NT_root:
- return be_root::narrow_from_decl (d);
- case AST_Decl::NT_except:
- return be_exception::narrow_from_decl (d);
- case AST_Decl::NT_union:
- return be_union::narrow_from_decl (d);
- case AST_Decl::NT_struct:
- return be_structure::narrow_from_decl (d);
- case AST_Decl::NT_enum:
- return be_enum::narrow_from_decl (d);
- case AST_Decl::NT_op:
- return be_operation::narrow_from_decl (d);
- case AST_Decl::NT_factory:
- return be_factory::narrow_from_decl (d);
- case AST_Decl::NT_sequence:
- return be_sequence::narrow_from_decl (d);
- case AST_Decl::NT_valuetype:
- return be_valuetype::narrow_from_decl (d);
- case AST_Decl::NT_component:
- return be_component::narrow_from_decl (d);
- case AST_Decl::NT_eventtype:
- return be_eventtype::narrow_from_decl (d);
- case AST_Decl::NT_home:
- return be_home::narrow_from_decl (d);
- default:
- return (be_scope *)0;
- }
-}
-
-// Boolean methods to test if code was already generated.
-bool
-be_decl::cli_hdr_gen (void)
-{
- return this->cli_hdr_gen_;
-}
-
-bool
-be_decl::cli_stub_gen (void)
-{
- return this->cli_stub_gen_;
-}
-
-bool
-be_decl::cli_hdr_any_op_gen (void)
-{
- return this->cli_hdr_any_op_gen_;
-}
-
-bool
-be_decl::cli_stub_any_op_gen (void)
-{
- return this->cli_stub_any_op_gen_;
-}
-
-bool
-be_decl::cli_hdr_cdr_op_gen (void)
-{
- return this->cli_hdr_cdr_op_gen_;
-}
-
-bool
-be_decl::cli_stub_cdr_op_gen (void)
-{
- return this->cli_stub_cdr_op_gen_;
-}
-
-bool
-be_decl::cli_inline_cdr_op_gen (void)
-{
- return this->cli_inline_cdr_op_gen_;
-}
-
-bool
-be_decl::cli_inline_cdr_decl_gen (void)
-{
- return this->cli_inline_cdr_decl_gen_;
-}
-
-bool
-be_decl::cli_hdr_serializer_op_gen (void)
-{
- return this->cli_hdr_serializer_op_gen_;
-}
-
-bool
-be_decl::cli_stub_serializer_op_gen (void)
-{
- return this->cli_stub_serializer_op_gen_;
-}
-
-bool
-be_decl::cli_inline_serializer_op_gen (void)
-{
- return this->cli_inline_serializer_op_gen_;
-}
-
-bool
-be_decl::cli_inline_serializer_decl_gen (void)
-{
- return this->cli_inline_cdr_decl_gen_;
-}
-
-bool
-be_decl::cli_traits_gen (void)
-{
- return this->cli_traits_gen_;
-}
-
-bool
-be_decl::cli_arg_traits_gen (void)
-{
- return this->cli_arg_traits_gen_;
-}
-
-bool
-be_decl::srv_arg_traits_gen (void)
-{
- return this->srv_arg_traits_gen_;
-}
-
-bool
-be_decl::srv_sarg_traits_gen (void)
-{
- return this->srv_sarg_traits_gen_;
-}
-
-bool
-be_decl::cli_pragma_inst_gen (void)
-{
- return this->cli_pragma_inst_gen_;
-}
-
-bool
-be_decl::cli_inarg_tmpl_class_gen (void)
-{
- return this->cli_inarg_tmpl_class_gen_;
-}
-
-bool
-be_decl::cli_inarg_pragma_inst_gen (void)
-{
- return this->cli_inarg_pragma_inst_gen_;
-}
-
-bool
-be_decl::cli_inoutarg_tmpl_class_gen (void)
-{
- return this->cli_inoutarg_tmpl_class_gen_;
-}
-
-bool
-be_decl::cli_inoutarg_pragma_inst_gen (void)
-{
- return this->cli_inoutarg_pragma_inst_gen_;
-}
-
-bool
-be_decl::cli_outarg_tmpl_class_gen (void)
-{
- return this->cli_outarg_tmpl_class_gen_;
-}
-
-bool
-be_decl::cli_outarg_pragma_inst_gen (void)
-{
- return this->cli_outarg_pragma_inst_gen_;
-}
-
-bool
-be_decl::cli_retarg_tmpl_class_gen (void)
-{
- return this->cli_retarg_tmpl_class_gen_;
-}
-
-bool
-be_decl::cli_retarg_pragma_inst_gen (void)
-{
- return this->cli_retarg_pragma_inst_gen_;
-}
-
-bool
-be_decl::srv_tmpl_class_gen (void)
-{
- return this->srv_tmpl_class_gen_;
-}
-
-bool
-be_decl::srv_pragma_inst_gen (void)
-{
- return this->srv_pragma_inst_gen_;
-}
-
-bool
-be_decl::srv_inarg_tmpl_class_gen (void)
-{
- return this->srv_inarg_tmpl_class_gen_;
-}
-
-bool
-be_decl::srv_inarg_pragma_inst_gen (void)
-{
- return this->srv_inarg_pragma_inst_gen_;
-}
-
-bool
-be_decl::srv_inoutarg_tmpl_class_gen (void)
-{
- return this->srv_inoutarg_tmpl_class_gen_;
-}
-
-bool
-be_decl::srv_inoutarg_pragma_inst_gen (void)
-{
- return this->srv_inoutarg_pragma_inst_gen_;
-}
-
-bool
-be_decl::srv_outarg_tmpl_class_gen (void)
-{
- return this->srv_outarg_tmpl_class_gen_;
-}
-
-bool
-be_decl::srv_outarg_pragma_inst_gen (void)
-{
- return this->srv_outarg_pragma_inst_gen_;
-}
-
-bool
-be_decl::srv_retarg_tmpl_class_gen (void)
-{
- return this->srv_retarg_tmpl_class_gen_;
-}
-
-bool
-be_decl::srv_retarg_pragma_inst_gen (void)
-{
- return this->cli_retarg_pragma_inst_gen_;
-}
-
-bool
-be_decl::cli_inline_gen (void)
-{
- return this->cli_inline_gen_;
-}
-
-bool
-be_decl::srv_hdr_gen (void)
-{
- return this->srv_hdr_gen_;
-}
-
-bool
-be_decl::impl_hdr_gen (void)
-{
- return this->impl_hdr_gen_;
-}
-
-bool
-be_decl::srv_skel_gen (void)
-{
- return this->srv_skel_gen_;
-}
-
-bool
-be_decl::impl_skel_gen (void)
-{
- return this->impl_skel_gen_;
-}
-
-bool
-be_decl::srv_inline_gen (void)
-{
- return this->srv_inline_gen_;
-}
-
-bool
-be_decl::ccm_pre_proc_gen (void)
-{
- return this->ccm_pre_proc_gen_;
-}
-
-// Set the flag indicating that code generation is done.
-void
-be_decl::cli_hdr_gen (bool val)
-{
- this->cli_hdr_gen_ = val;
-}
-
-void
-be_decl::cli_stub_gen (bool val)
-{
- this->cli_stub_gen_ = val;
-}
-
-void
-be_decl::cli_hdr_any_op_gen (bool val)
-{
- this->cli_hdr_any_op_gen_ = val;
-}
-
-void
-be_decl::cli_stub_any_op_gen (bool val)
-{
- this->cli_stub_any_op_gen_ = val;
-}
-
-void
-be_decl::cli_hdr_cdr_op_gen (bool val)
-{
- this->cli_hdr_cdr_op_gen_ = val;
-}
-
-void
-be_decl::cli_stub_cdr_op_gen (bool val)
-{
- this->cli_stub_cdr_op_gen_ = val;
-}
-
-void
-be_decl::cli_inline_cdr_op_gen (bool val)
-{
- this->cli_inline_cdr_op_gen_ = val;
-}
-
-void
-be_decl::cli_inline_cdr_decl_gen (bool val)
-{
- this->cli_inline_cdr_decl_gen_ = val;
-}
-
-void
-be_decl::cli_hdr_serializer_op_gen (bool val)
-{
- this->cli_hdr_serializer_op_gen_ = val;
-}
-
-void
-be_decl::cli_stub_serializer_op_gen (bool val)
-{
- this->cli_stub_serializer_op_gen_ = val;
-}
-
-void
-be_decl::cli_inline_serializer_op_gen (bool val)
-{
- this->cli_inline_serializer_op_gen_ = val;
-}
-
-void
-be_decl::cli_inline_serializer_decl_gen (bool val)
-{
- this->cli_inline_serializer_decl_gen_ = val;
-}
-
-void
-be_decl::cli_inline_gen (bool val)
-{
- this->cli_inline_gen_ = val;
-}
-
-void
-be_decl::cli_traits_gen (bool val)
-{
- this->cli_traits_gen_ = val;
-}
-
-void
-be_decl::cli_arg_traits_gen (bool val)
-{
- this->cli_arg_traits_gen_ = val;
-}
-
-void
-be_decl::srv_arg_traits_gen (bool val)
-{
- this->srv_arg_traits_gen_ = val;
-}
-
-void
-be_decl::srv_sarg_traits_gen (bool val)
-{
- this->srv_sarg_traits_gen_ = val;
-}
-
-void
-be_decl::cli_pragma_inst_gen (bool val)
-{
- this->cli_pragma_inst_gen_ = val;
-}
-
-void
-be_decl::cli_inarg_tmpl_class_gen (bool val)
-{
- this->cli_inarg_tmpl_class_gen_ = val;
-}
-
-void
-be_decl::cli_inarg_pragma_inst_gen (bool val)
-{
- this->cli_inarg_pragma_inst_gen_ = val;
-}
-
-void
-be_decl::cli_inoutarg_tmpl_class_gen (bool val)
-{
- this->cli_inoutarg_tmpl_class_gen_ = val;
-}
-
-void
-be_decl::cli_inoutarg_pragma_inst_gen (bool val)
-{
- this->cli_inoutarg_pragma_inst_gen_ = val;
-}
-
-void
-be_decl::cli_outarg_tmpl_class_gen (bool val)
-{
- this->cli_outarg_tmpl_class_gen_ = val;
-}
-
-void
-be_decl::cli_outarg_pragma_inst_gen (bool val)
-{
- this->cli_outarg_pragma_inst_gen_ = val;
-}
-
-void
-be_decl::cli_retarg_tmpl_class_gen (bool val)
-{
- this->cli_retarg_tmpl_class_gen_ = val;
-}
-
-void
-be_decl::cli_retarg_pragma_inst_gen (bool val)
-{
- this->cli_retarg_pragma_inst_gen_ = val;
-}
-
-void
-be_decl::srv_tmpl_class_gen (bool val)
-{
- this->srv_tmpl_class_gen_ = val;
-}
-
-void
-be_decl::srv_pragma_inst_gen (bool val)
-{
- this->srv_pragma_inst_gen_ = val;
-}
-
-void
-be_decl::srv_inarg_tmpl_class_gen (bool val)
-{
- this->srv_inarg_tmpl_class_gen_ = val;
-}
-
-void
-be_decl::srv_inarg_pragma_inst_gen (bool val)
-{
- this->srv_inarg_pragma_inst_gen_ = val;
-}
-
-void
-be_decl::srv_inoutarg_tmpl_class_gen (bool val)
-{
- this->srv_inoutarg_tmpl_class_gen_ = val;
-}
-
-void
-be_decl::srv_inoutarg_pragma_inst_gen (bool val)
-{
- this->srv_inoutarg_pragma_inst_gen_ = val;
-}
-
-void
-be_decl::srv_outarg_tmpl_class_gen (bool val)
-{
- this->srv_outarg_tmpl_class_gen_ = val;
-}
-
-void
-be_decl::srv_outarg_pragma_inst_gen (bool val)
-{
- this->srv_outarg_pragma_inst_gen_ = val;
-}
-
-void
-be_decl::srv_retarg_tmpl_class_gen (bool val)
-{
- this->srv_retarg_tmpl_class_gen_ = val;
-}
-
-void
-be_decl::srv_retarg_pragma_inst_gen (bool val)
-{
- this->srv_retarg_pragma_inst_gen_ = val;
-}
-
-void
-be_decl::srv_hdr_gen (bool val)
-{
- this->srv_hdr_gen_ = val;
-}
-
-void
-be_decl::impl_hdr_gen (bool val)
-{
- this->impl_hdr_gen_ = val;
-}
-
-
-void
-be_decl::srv_skel_gen (bool val)
-{
- this->srv_skel_gen_ = val;
-}
-
-void
-be_decl::srv_inline_gen (bool val)
-{
- this->srv_inline_gen_ = val;
-}
-
-void
-be_decl::ccm_pre_proc_gen (bool val)
-{
- this->ccm_pre_proc_gen_ = val;
-}
-
-//==========================================
-
-int
-be_decl::accept (be_visitor *visitor)
-{
- return visitor->visit_decl (this);
-}
-
-void
-be_decl::set_arg_seen_bit (be_type *bt)
-{
- if (bt == 0)
- {
- return;
- }
-
- switch (bt->node_type ())
- {
- case NT_typedef:
- {
- AST_Typedef *td = AST_Typedef::narrow_from_decl (bt);
- this->set_arg_seen_bit (
- be_type::narrow_from_decl (td->primitive_base_type ())
- );
- break;
- }
- case NT_interface:
- case NT_interface_fwd:
- case NT_valuetype:
- case NT_valuetype_fwd:
- case NT_component:
- case NT_component_fwd:
- case NT_home:
- case NT_eventtype:
- case NT_eventtype_fwd:
- idl_global->object_arg_seen_ = true;
- break;
- case NT_union:
- case NT_struct:
- if (bt->size_type () == AST_Type::FIXED)
- {
- idl_global->fixed_size_arg_seen_ = true;
- }
- else
- {
- idl_global->var_size_arg_seen_ = true;
- }
-
- break;
- case NT_struct_fwd:
- case NT_union_fwd:
- {
- AST_StructureFwd *fwd = AST_StructureFwd::narrow_from_decl (bt);
- be_type *fd = be_type::narrow_from_decl (fwd->full_definition ());
- this->set_arg_seen_bit (fd);
- break;
- }
- case NT_enum:
- case NT_enum_val:
- idl_global->basic_arg_seen_ = true;
- break;
- case NT_string:
- case NT_wstring:
- {
- AST_String *str = AST_String::narrow_from_decl (bt);
-
- if (str->max_size ()->ev ()->u.ulval == 0)
- {
- idl_global->ub_string_arg_seen_ = true;
- }
- else
- {
- idl_global->bd_string_arg_seen_ = true;
- }
-
- break;
- }
- case NT_array:
- if (bt->size_type () == AST_Type::FIXED)
- {
- idl_global->fixed_array_arg_seen_ = true;
- }
- else
- {
- idl_global->var_array_arg_seen_ = true;
- }
-
- break;
- case NT_sequence:
- idl_global->var_size_arg_seen_ = true;
- break;
- case NT_pre_defined:
- {
- AST_PredefinedType *pdt = AST_PredefinedType::narrow_from_decl (bt);
-
- switch (pdt->pt ())
- {
- case AST_PredefinedType::PT_object:
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_value:
- idl_global->object_arg_seen_ = true;
- break;
- case AST_PredefinedType::PT_any:
- idl_global->var_size_arg_seen_ = true;
- idl_global->any_arg_seen_ = true;
- break;
- case AST_PredefinedType::PT_char:
- case AST_PredefinedType::PT_wchar:
- case AST_PredefinedType::PT_octet:
- case AST_PredefinedType::PT_boolean:
- idl_global->special_basic_arg_seen_ = true;
- break;
- default:
- idl_global->basic_arg_seen_ = true;
- break;
- }
- }
- default:
- break;
- }
-}
-
-// Narrowing methods.
-IMPL_NARROW_METHODS1 (be_decl, AST_Decl)
-IMPL_NARROW_FROM_DECL (be_decl)
diff --git a/TAO/TAO_IDL/be/be_enum.cpp b/TAO/TAO_IDL/be/be_enum.cpp
deleted file mode 100644
index 4b5ccad4b10..00000000000
--- a/TAO/TAO_IDL/be/be_enum.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_enum.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Enum that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_enum.h"
-#include "be_visitor.h"
-
-#include "global_extern.h"
-
-ACE_RCSID (be,
- be_enum,
- "$Id$")
-
-be_enum::be_enum (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_ConcreteType (),
- UTL_Scope (),
- AST_Enum (),
- be_scope (),
- be_decl (),
- be_type ()
-{
-}
-
-be_enum::be_enum (UTL_ScopedName *n,
- bool local,
- bool abstract)
- : COMMON_Base (local,
- abstract),
- AST_Decl (AST_Decl::NT_enum,
- n),
- AST_Type (AST_Decl::NT_enum,
- n),
- AST_ConcreteType (AST_Decl::NT_enum,
- n),
- UTL_Scope (AST_Decl::NT_enum),
- AST_Enum (n,
- local,
- abstract),
- be_scope (AST_Decl::NT_enum),
- be_decl (AST_Decl::NT_enum,
- n),
- be_type (AST_Decl::NT_enum,
- n)
-{
- if (!this->imported ())
- {
- idl_global->enum_seen_ = true;
- }
-}
-
-void
-be_enum::destroy (void)
-{
- // Call the destroy methods of our base classes.
- // No need to call be_scope::destroy(). It has no
- // allocated members, and AST_Enum::destroy() will
- // call UTL_Scope::destroy().
- this->be_type::destroy ();
- this->be_scope::destroy ();
- this->AST_Enum::destroy ();
-}
-
-int
-be_enum::accept (be_visitor *visitor)
-{
- return visitor->visit_enum (this);
-}
-
-// Narrowing
-IMPL_NARROW_METHODS3 (be_enum, AST_Enum, be_scope, be_type)
-IMPL_NARROW_FROM_DECL (be_enum)
-IMPL_NARROW_FROM_SCOPE (be_enum)
diff --git a/TAO/TAO_IDL/be/be_enum_val.cpp b/TAO/TAO_IDL/be/be_enum_val.cpp
deleted file mode 100644
index 32623c25452..00000000000
--- a/TAO/TAO_IDL/be/be_enum_val.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_enum_val.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_EnumVal that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_enum_val.h"
-#include "be_visitor.h"
-
-ACE_RCSID (be,
- be_enum_val,
- "$Id$")
-
-be_enum_val::be_enum_val (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Constant (),
- AST_EnumVal (),
- be_decl ()
-{
-}
-
-be_enum_val::be_enum_val (unsigned long v,
- UTL_ScopedName *n)
- : COMMON_Base (),
- AST_Decl (AST_Decl::NT_enum_val,
- n),
- AST_Constant (AST_Expression::EV_ulong,
- AST_Decl::NT_enum_val,
- new AST_Expression (v),
- n),
- AST_EnumVal (v,
- n),
- be_decl (AST_Decl::NT_enum_val,
- n)
-{
-}
-
-int
-be_enum_val::accept (be_visitor *visitor)
-{
- return visitor->visit_enum_val (this);
-}
-
-void
-be_enum_val::destroy (void)
-{
- this->AST_EnumVal::destroy ();
- this->be_decl::destroy ();
-}
-
-// Narrowing
-IMPL_NARROW_METHODS2 (be_enum_val, AST_EnumVal, be_decl)
-IMPL_NARROW_FROM_DECL (be_enum_val)
diff --git a/TAO/TAO_IDL/be/be_eventtype.cpp b/TAO/TAO_IDL/be/be_eventtype.cpp
deleted file mode 100644
index 75c484d39c3..00000000000
--- a/TAO/TAO_IDL/be/be_eventtype.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_eventtype.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_EventType and be_valuetype that provides
-// additional means for C++ mapping of an eventtype.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-#include "be_eventtype.h"
-#include "be_visitor.h"
-
-ACE_RCSID (be,
- be_eventtype,
- "$Id$")
-
-// Default constructor.
-be_eventtype::be_eventtype (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- UTL_Scope (),
- AST_Interface (),
- be_scope (),
- be_decl (),
- be_type (),
- be_interface (),
- AST_ValueType (),
- be_valuetype (),
- AST_EventType ()
-{
-}
-
-// Constructor used to build the AST.
-be_eventtype::be_eventtype (UTL_ScopedName *n,
- AST_Interface **inherits,
- long n_inherits,
- AST_ValueType *inherits_concrete,
- AST_Interface **inherits_flat,
- long n_inherits_flat,
- AST_Interface **supports,
- long n_supports,
- AST_Interface *supports_concrete,
- bool abstract,
- bool truncatable,
- bool custom)
- : COMMON_Base (0,
- abstract),
- AST_Decl (AST_Decl::NT_eventtype,
- n),
- AST_Type (AST_Decl::NT_eventtype,
- n),
- UTL_Scope (AST_Decl::NT_eventtype),
- AST_Interface (n,
- inherits,
- n_inherits,
- inherits_flat,
- n_inherits_flat,
- 0,
- abstract),
- be_scope (AST_Decl::NT_eventtype),
- be_decl (AST_Decl::NT_eventtype,
- n),
- be_type (AST_Decl::NT_eventtype,
- n),
- be_interface (n,
- inherits,
- n_inherits,
- inherits_flat,
- n_inherits_flat,
- 0,
- abstract),
- AST_ValueType (n,
- inherits,
- n_inherits,
- inherits_concrete,
- inherits_flat,
- n_inherits_flat,
- supports,
- n_supports,
- supports_concrete,
- abstract,
- truncatable,
- custom),
- be_valuetype (n,
- inherits,
- n_inherits,
- inherits_concrete,
- inherits_flat,
- n_inherits_flat,
- supports,
- n_supports,
- supports_concrete,
- abstract,
- truncatable,
- custom),
- AST_EventType (n,
- inherits,
- n_inherits,
- inherits_concrete,
- inherits_flat,
- n_inherits_flat,
- supports,
- n_supports,
- supports_concrete,
- abstract,
- truncatable,
- custom)
-{
-}
-
-be_eventtype::~be_eventtype (void)
-{
-}
-
-// The differences between valuetype and eventtype are too small
-// to warrant a separate set of visitors.
-int
-be_eventtype::accept (be_visitor *visitor)
-{
- return visitor->visit_eventtype (this);
-}
-
-void
-be_eventtype::destroy (void)
-{
- this->be_valuetype::destroy ();
-}
-
-// Narrowing.
-IMPL_NARROW_METHODS2 (be_eventtype, be_valuetype, AST_EventType)
-IMPL_NARROW_FROM_DECL (be_eventtype)
-IMPL_NARROW_FROM_SCOPE (be_eventtype)
diff --git a/TAO/TAO_IDL/be/be_eventtype_fwd.cpp b/TAO/TAO_IDL/be/be_eventtype_fwd.cpp
deleted file mode 100644
index 327e514624a..00000000000
--- a/TAO/TAO_IDL/be/be_eventtype_fwd.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_eventtype_fwd.h
-//
-// = DESCRIPTION
-// Extension of class be_valuetype_fwd that provides additional
-// means for C++ mapping of an eventtype.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-
-#include "be_eventtype_fwd.h"
-#include "be_visitor.h"
-#include "ast_interface.h"
-
-ACE_RCSID (be,
- be_eventtype_fwd,
- "$Id$")
-
-be_eventtype_fwd::be_eventtype_fwd (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_InterfaceFwd (),
- be_decl (),
- be_type (),
- be_interface_fwd (),
- AST_ValueTypeFwd (),
- be_valuetype_fwd (),
- AST_EventTypeFwd ()
-{
-}
-
-be_eventtype_fwd::be_eventtype_fwd (AST_Interface *dummy,
- UTL_ScopedName *n)
- : COMMON_Base (dummy->is_local (),
- dummy->is_abstract ()),
- AST_Decl (AST_Decl::NT_eventtype_fwd,
- n),
- AST_Type (AST_Decl::NT_eventtype_fwd,
- n),
- AST_InterfaceFwd (dummy,
- n),
- be_decl (AST_Decl::NT_eventtype_fwd,
- n),
- be_type (AST_Decl::NT_eventtype_fwd,
- n),
- be_interface_fwd (dummy,
- n),
- AST_ValueTypeFwd (dummy,
- n),
- be_valuetype_fwd (dummy,
- n),
- AST_EventTypeFwd (dummy,
- n)
-{
-}
-
-be_eventtype_fwd::~be_eventtype_fwd (void)
-{
-}
-
-int
-be_eventtype_fwd::accept (be_visitor *visitor)
-{
- return visitor->visit_eventtype_fwd (this);
-}
-
-void
-be_eventtype_fwd::destroy (void)
-{
- this->be_valuetype_fwd::destroy ();
-}
-
-// Narrowing.
-IMPL_NARROW_METHODS2 (be_eventtype_fwd, be_valuetype_fwd, AST_EventTypeFwd)
-IMPL_NARROW_FROM_DECL (be_eventtype_fwd)
-
diff --git a/TAO/TAO_IDL/be/be_exception.cpp b/TAO/TAO_IDL/be/be_exception.cpp
deleted file mode 100644
index 3f8711549bc..00000000000
--- a/TAO/TAO_IDL/be/be_exception.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_exception.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Exception that provides additional means for C++
-// mapping of an interface.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-
-#include "be_exception.h"
-#include "be_visitor.h"
-
-#include "global_extern.h"
-
-ACE_RCSID (be,
- be_exception,
- "$Id$")
-
-be_exception::be_exception (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_ConcreteType (),
- UTL_Scope (),
- AST_Structure (),
- be_scope (),
- be_decl (),
- be_type ()
-{
- // Always the case.
- this->size_type (AST_Type::VARIABLE);
-}
-
-be_exception::be_exception (UTL_ScopedName *n,
- bool local,
- bool abstract)
- : COMMON_Base (local,
- abstract),
- AST_Decl (AST_Decl::NT_except,
- n),
- AST_Type (AST_Decl::NT_except,
- n),
- AST_ConcreteType (AST_Decl::NT_except,
- n),
- UTL_Scope (AST_Decl::NT_except),
- AST_Structure (AST_Decl::NT_except,
- n,
- local,
- abstract),
- be_scope (AST_Decl::NT_except),
- be_decl (AST_Decl::NT_except,
- n),
- be_type (AST_Decl::NT_except,
- n)
-{
- // Always the case.
- this->size_type (AST_Type::VARIABLE);
-
- if (!this->imported ())
- {
- idl_global->exception_seen_ = true;
- }
-}
-
-void
-be_exception::destroy (void)
-{
- // Call the destroy methods of our base classes.
- this->be_scope::destroy ();
- this->be_type::destroy ();
- this->AST_Exception::destroy ();
-}
-
-int
-be_exception::accept (be_visitor *visitor)
-{
- return visitor->visit_exception (this);
-}
-
-// Narrowing
-IMPL_NARROW_METHODS3 (be_exception, AST_Exception, be_scope, be_type)
-IMPL_NARROW_FROM_DECL (be_exception)
-IMPL_NARROW_FROM_SCOPE (be_exception)
diff --git a/TAO/TAO_IDL/be/be_expression.cpp b/TAO/TAO_IDL/be/be_expression.cpp
deleted file mode 100644
index 40da1b84eea..00000000000
--- a/TAO/TAO_IDL/be/be_expression.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_expression.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Expression that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_expression.h"
-#include "be_visitor.h"
-
-ACE_RCSID (be,
- be_expression,
- "$Id$")
-
-be_expression::be_expression (UTL_ScopedName *n)
- : AST_Expression (n)
-{
-}
-
-be_expression::be_expression (AST_Expression *b, AST_Expression::ExprType t)
- : AST_Expression (b,
- t)
-{
-}
-
-be_expression::be_expression (AST_Expression::ExprComb c,
- AST_Expression *v1,
- AST_Expression *v2)
- : AST_Expression (c,
- v1,
- v2)
-{
-}
-
-be_expression::be_expression (long l)
- : AST_Expression (l)
-{
-}
-
-be_expression::be_expression (bool b)
- : AST_Expression (b)
-{
-}
-
-be_expression::be_expression (idl_uns_long l,
- AST_Expression::ExprType t)
- : AST_Expression (l,
- t)
-{
-}
-
-be_expression::be_expression (UTL_String *s)
- : AST_Expression (s)
-{
-}
-
-be_expression::be_expression (char *s)
- : AST_Expression (s)
-{
-}
-
-be_expression::be_expression (char c)
- : AST_Expression (c)
-{
-}
-
-be_expression::be_expression (ACE_OutputCDR::from_wchar wc)
- : AST_Expression (wc)
-{
-}
-
-be_expression::be_expression (double d)
- : AST_Expression (d)
-{
-}
-
-int
-be_expression::accept (be_visitor *visitor)
-{
- return visitor->visit_expression (this);
-}
diff --git a/TAO/TAO_IDL/be/be_factory.cpp b/TAO/TAO_IDL/be/be_factory.cpp
deleted file mode 100644
index 271648d6f6b..00000000000
--- a/TAO/TAO_IDL/be/be_factory.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_factory.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Factory that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Boris Kolpackov <bosk@ipmce.ru>
-//
-// ============================================================================
-
-#include "be_factory.h"
-#include "be_visitor.h"
-
-ACE_RCSID (be,
- be_factory,
- "$Id$")
-
-be_factory::be_factory (void)
- : COMMON_Base (),
- AST_Decl (),
- UTL_Scope (),
- AST_Factory (),
- be_scope (),
- be_decl ()
-{
-}
-
-be_factory::be_factory (UTL_ScopedName *n)
- : COMMON_Base (1,
- 0), //@@ Always local, never abstract
- AST_Decl (AST_Decl::NT_factory,
- n),
- UTL_Scope (AST_Decl::NT_factory),
- AST_Factory (n),
- be_scope (AST_Decl::NT_factory),
- be_decl (AST_Decl::NT_factory,
- n)
-{
-}
-
-be_factory::~be_factory (void)
-{
-}
-
-void
-be_factory::destroy (void)
-{
- // Call the destroy methods of our base classes.
- this->be_scope::destroy ();
- this->be_decl::destroy ();
-
- this->AST_Factory::destroy ();
-}
-
-int
-be_factory::accept (be_visitor *visitor)
-{
- return visitor->visit_factory (this);
-}
-
-// Narrowing
-IMPL_NARROW_METHODS3 (be_factory, AST_Factory, be_scope, be_decl)
-IMPL_NARROW_FROM_DECL (be_factory)
-IMPL_NARROW_FROM_SCOPE (be_factory)
diff --git a/TAO/TAO_IDL/be/be_field.cpp b/TAO/TAO_IDL/be/be_field.cpp
deleted file mode 100644
index d33847bed01..00000000000
--- a/TAO/TAO_IDL/be/be_field.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_field.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Field that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_field.h"
-#include "be_visitor.h"
-#include "be_type.h"
-#include "global_extern.h"
-#include "ace/Log_Msg.h"
-
-ACE_RCSID (be,
- be_field,
- "$Id$")
-
-be_field::be_field (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Field (),
- be_decl ()
-{
-}
-
-be_field::be_field (AST_Type *ft,
- UTL_ScopedName *n,
- Visibility vis)
- : COMMON_Base (ft->is_local (),
- ft->is_abstract ()),
- AST_Decl (AST_Decl::NT_field,
- n),
- AST_Field (ft,
- n,
- vis),
- be_decl (AST_Decl::NT_field,
- n)
-{
- // This covers valuetype fields as well, which is what we want.
- AST_Decl::NodeType nt =
- ft->unaliased_type ()->node_type ();
-
- if (nt == AST_Decl::NT_string || nt == AST_Decl::NT_wstring)
- {
- idl_global->string_member_seen_ = true;
- }
-}
-
-int
-be_field::accept (be_visitor *visitor)
-{
- return visitor->visit_field (this);
-}
-
-void
-be_field::destroy (void)
-{
- this->be_decl::destroy ();
- this->AST_Field::destroy ();
-}
-
-// Narrowing
-IMPL_NARROW_METHODS2 (be_field, AST_Field, be_decl)
-IMPL_NARROW_FROM_DECL (be_field)
diff --git a/TAO/TAO_IDL/be/be_generator.cpp b/TAO/TAO_IDL/be/be_generator.cpp
deleted file mode 100644
index 49dfc20a7ce..00000000000
--- a/TAO/TAO_IDL/be/be_generator.cpp
+++ /dev/null
@@ -1,913 +0,0 @@
-// $Id$
-
-/*
-
-COPYRIGHT
-
-Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United
-States of America. All Rights Reserved.
-
-This product is protected by copyright and distributed under the following
-license restricting its use.
-
-The Interface Definition Language Compiler Front End (CFE) is made
-available for your use provided that you include this license and copyright
-notice on all media and documentation and the software program in which
-this product is incorporated in whole or part. You may copy and extend
-functionality (but may not remove functionality) of the Interface
-Definition Language CFE without charge, but you are not authorized to
-license or distribute it to anyone else except as part of a product or
-program developed by you or with the express written consent of Sun
-Microsystems, Inc. ("Sun").
-
-The names of Sun Microsystems, Inc. and any of its subsidiaries or
-affiliates may not be used in advertising or publicity pertaining to
-distribution of Interface Definition Language CFE as permitted herein.
-
-This license is effective until terminated by Sun for failure to comply
-with this license. Upon termination, you shall destroy or return all code
-and documentation for the Interface Definition Language CFE.
-
-INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF
-ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS
-FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF
-DEALING, USAGE OR TRADE PRACTICE.
-
-INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT
-ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES
-TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT.
-
-SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH
-RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY
-INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF.
-
-IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR
-ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL
-DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-Use, duplication, or disclosure by the government is subject to
-restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
-Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR
-52.227-19.
-
-Sun, Sun Microsystems and the Sun logo are trademarks or registered
-trademarks of Sun Microsystems, Inc.
-
-SunSoft, Inc.
-2550 Garcia Avenue
-Mountain View, California 94043
-
-NOTE:
-
-SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are
-trademarks or registered trademarks of Sun Microsystems, Inc.
-
-*/
-
-// Implementation of BE generator class.
-//
-// This implements the same protocol as AST_Generator but creates instances
-// of the BE-subclassed classes instead of of AST classes.
-
-#include "be_generator.h"
-#include "be_root.h"
-#include "be_predefined_type.h"
-#include "be_module.h"
-#include "be_valuebox.h"
-#include "be_valuetype.h"
-#include "be_valuetype_fwd.h"
-#include "be_eventtype.h"
-#include "be_eventtype_fwd.h"
-#include "be_component.h"
-#include "be_component_fwd.h"
-#include "be_home.h"
-#include "be_union.h"
-#include "be_union_fwd.h"
-#include "be_structure.h"
-#include "be_structure_fwd.h"
-#include "be_exception.h"
-#include "be_operation.h"
-#include "be_enum.h"
-#include "be_field.h"
-#include "be_argument.h"
-#include "be_attribute.h"
-#include "be_union_branch.h"
-#include "be_union_label.h"
-#include "be_constant.h"
-#include "be_expression.h"
-#include "be_enum_val.h"
-#include "be_array.h"
-#include "be_sequence.h"
-#include "be_string.h"
-#include "be_typedef.h"
-#include "be_native.h"
-#include "be_factory.h"
-#include "utl_identifier.h"
-#include "nr_extern.h"
-#include "ace/config-all.h"
-
-ACE_RCSID (be,
- be_generator,
- "$Id$")
-
-AST_Root *
-be_generator::create_root (UTL_ScopedName *n)
-{
- be_root *retval = 0;
- ACE_NEW_RETURN (retval,
- be_root (n),
- 0);
-
- return retval;
-}
-
-AST_PredefinedType *
-be_generator::create_predefined_type (AST_PredefinedType::PredefinedType t,
- UTL_ScopedName *n)
-{
- be_predefined_type *retval = 0;
- ACE_NEW_RETURN (retval,
- be_predefined_type (t,
- n),
- 0);
-
- return retval;
-}
-
-AST_Module *
-be_generator::create_module (UTL_Scope *s,
- UTL_ScopedName *n)
-{
- // We create this first so if we find a module with the
- // same name from an included file, we can add its
- // members to the new module's scope.
- AST_Module *retval = 0;
- ACE_NEW_RETURN (retval,
- be_module (n),
- 0);
-
-
- // Check for another module of the same name in this scope.
- for (UTL_ScopeActiveIterator iter (s, UTL_Scope::IK_decls);
- !iter.is_done ();
- iter.next ())
- {
- AST_Decl *d = iter.item ();
-
- if (d->node_type () == AST_Decl::NT_module)
- {
- // Does it have the same name as the one we're
- // supposed to create.
- if (d->local_name ()->compare (n->last_component ()))
- {
- AST_Module *m = AST_Module::narrow_from_decl (d);
-
- // Get m's previous_ member, plus all it's decls,
- // into the new modules's previous_ member.
- retval->add_to_previous (m);
- retval->prefix (const_cast<char *> (m->prefix ()));
- }
- }
- }
-
- // If this scope is itself a module, and has been previously
- // opened, the previous opening may contain a previous opening
- // of the module we're creating.
- AST_Decl *d = ScopeAsDecl (s);
- AST_Decl::NodeType nt = d->node_type ();
-
- if (nt == AST_Decl::NT_module || nt == AST_Decl::NT_root)
- {
- AST_Module *m = AST_Module::narrow_from_decl (d);
-
- // AST_Module::previous_ is a set, so it contains each
- // entry only once, but previous_ will contain the decls
- // from all previous openings. See comment in
- // AST_Module::add_to_previous() body.
- d = m->look_in_previous (n->last_component ());
-
- if (d != 0)
- {
- if (d->node_type () == AST_Decl::NT_module)
- {
- m = AST_Module::narrow_from_decl (d);
-
- retval->add_to_previous (m);
- }
- }
- }
-
- return retval;
-}
-
-AST_Interface *
-be_generator::create_interface (UTL_ScopedName *n,
- AST_Interface **ih,
- long nih,
- AST_Interface **ih_flat,
- long nih_flat,
- bool l,
- bool a)
-{
- be_interface *retval = 0;
- ACE_NEW_RETURN (retval,
- be_interface (n,
- ih,
- nih,
- ih_flat,
- nih_flat,
- l,
- a),
- 0);
-
- return retval;
-}
-
-AST_InterfaceFwd *
-be_generator::create_interface_fwd (UTL_ScopedName *n,
- bool is_local,
- bool is_abstract)
-{
- AST_Interface *full_defn = this->create_interface (n,
- 0,
- -1,
- 0,
- 0,
- is_local,
- is_abstract);
-
- be_interface_fwd *retval = 0;
- ACE_NEW_RETURN (retval,
- be_interface_fwd (full_defn,
- n),
- 0);
-
- full_defn->fwd_decl (retval);
- return retval;
-}
-
-AST_ValueBox *
-be_generator::create_valuebox (UTL_ScopedName *n,
- AST_Type *boxed_type)
-{
- be_valuebox *retval = 0;
- ACE_NEW_RETURN (retval,
- be_valuebox (boxed_type,
- n),
- 0);
-
- return retval;
-}
-
-AST_ValueType *
-be_generator::create_valuetype (UTL_ScopedName *n,
- AST_Interface **inherits,
- long n_inherits,
- AST_ValueType *inherits_concrete,
- AST_Interface **inherits_flat,
- long n_inherits_flat,
- AST_Interface **supports_list,
- long n_supports,
- AST_Interface *supports_concrete,
- bool is_abstract,
- bool is_truncatable,
- bool is_custom)
-{
- be_valuetype *retval = 0;
- ACE_NEW_RETURN (retval,
- be_valuetype (n,
- inherits,
- n_inherits,
- inherits_concrete,
- inherits_flat,
- n_inherits_flat,
- supports_list,
- n_supports,
- supports_concrete,
- is_abstract,
- is_truncatable,
- is_custom),
- 0);
-
- return retval;
-}
-
-AST_ValueTypeFwd *
-be_generator::create_valuetype_fwd (UTL_ScopedName *n,
- bool is_abstract)
-{
- AST_ValueType *full_defn = this->create_valuetype (n,
- 0,
- -1,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- is_abstract,
- false,
- false);
-
- be_valuetype_fwd *retval = 0;
- ACE_NEW_RETURN (retval,
- be_valuetype_fwd (full_defn,
- n),
- 0);
-
- full_defn->fwd_decl (retval);
- return retval;
-}
-
-AST_EventType *
-be_generator::create_eventtype (UTL_ScopedName *n,
- AST_Interface **inherits,
- long n_inherits,
- AST_ValueType *inherits_concrete,
- AST_Interface **inherits_flat,
- long n_inherits_flat,
- AST_Interface **supports_list,
- long n_supports,
- AST_Interface *supports_concrete,
- bool is_abstract,
- bool is_truncatable,
- bool is_custom)
-{
- be_eventtype *retval = 0;
- ACE_NEW_RETURN (retval,
- be_eventtype (n,
- inherits,
- n_inherits,
- inherits_concrete,
- inherits_flat,
- n_inherits_flat,
- supports_list,
- n_supports,
- supports_concrete,
- is_abstract,
- is_truncatable,
- is_custom),
- 0);
-
- return retval;
-}
-
-AST_EventTypeFwd *
-be_generator::create_eventtype_fwd (UTL_ScopedName *n,
- bool is_abstract)
-{
- AST_EventType *full_defn = this->create_eventtype (n,
- 0,
- -1,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- is_abstract,
- false,
- false);
-
- be_eventtype_fwd *retval = 0;
- ACE_NEW_RETURN (retval,
- be_eventtype_fwd (full_defn,
- n),
- 0);
-
- full_defn->fwd_decl (retval);
- return retval;
-}
-
-AST_Component *
-be_generator::create_component (UTL_ScopedName *n,
- AST_Component *base_component,
- AST_Interface **supports_list,
- long n_supports,
- AST_Interface **supports_flat,
- long n_supports_flat)
-{
- be_component *retval = 0;
- ACE_NEW_RETURN (retval,
- be_component (n,
- base_component,
- supports_list,
- n_supports,
- supports_flat,
- n_supports_flat),
- 0);
-
- return retval;
-}
-
-AST_ComponentFwd *
-be_generator::create_component_fwd (UTL_ScopedName *n)
-{
- AST_Component *full_defn = this->create_component (n,
- 0,
- 0,
- -1,
- 0,
- 0);
-
- be_component_fwd *retval = 0;
- ACE_NEW_RETURN (retval,
- be_component_fwd (full_defn,
- n),
- 0);
-
- full_defn->fwd_decl (retval);
- return retval;
-}
-
-AST_Home *
-be_generator::create_home (UTL_ScopedName *n,
- AST_Home *base_home,
- AST_Component *managed_component,
- AST_ValueType *primary_key,
- AST_Interface **supports_list,
- long n_supports,
- AST_Interface **supports_flat,
- long n_supports_flat)
-{
- be_home *retval = 0;
- ACE_NEW_RETURN (retval,
- be_home (n,
- base_home,
- managed_component,
- primary_key,
- supports_list,
- n_supports,
- supports_flat,
- n_supports_flat),
- 0);
-
- return retval;
-}
-
-AST_Exception *
-be_generator::create_exception (UTL_ScopedName *n,
- bool is_local,
- bool is_abstract)
-{
- be_exception *retval = 0;
- ACE_NEW_RETURN (retval,
- be_exception (n,
- is_local,
- is_abstract),
- 0);
-
- return retval;
-}
-
-AST_Structure *
-be_generator::create_structure (UTL_ScopedName *n,
- bool is_local,
- bool is_abstract)
-{
- be_structure *retval = 0;
- ACE_NEW_RETURN (retval,
- be_structure (n,
- is_local,
- is_abstract),
- 0);
-
- return retval;
-}
-
-AST_StructureFwd *
-be_generator::create_structure_fwd (UTL_ScopedName *n)
-{
-
- AST_Structure *full_defn = this->create_structure (n,
- false,
- false);
- be_structure_fwd *retval = 0;
- ACE_NEW_RETURN (retval,
- be_structure_fwd (full_defn,
- n),
- 0);
-
- full_defn->fwd_decl (retval);
- return retval;
-}
-
-AST_Enum *
-be_generator::create_enum (UTL_ScopedName *n,
- bool is_local,
- bool is_abstract)
-{
- be_enum *retval = 0;
- ACE_NEW_RETURN (retval,
- be_enum (n,
- is_local,
- is_abstract),
- 0);
-
- return retval;
-}
-
-AST_Operation *
-be_generator::create_operation (AST_Type *rt,
- AST_Operation::Flags fl,
- UTL_ScopedName *n,
- bool is_local,
- bool is_abstract)
-{
- be_operation *retval = 0;
- ACE_NEW_RETURN (retval,
- be_operation (rt,
- fl,
- n,
- is_local,
- is_abstract),
- 0);
-
- return retval;
-}
-
-AST_Field *
-be_generator::create_field (AST_Type *ft,
- UTL_ScopedName *n,
- AST_Field::Visibility vis)
-{
- be_field *retval = 0;
- ACE_NEW_RETURN (retval,
- be_field (ft,
- n,
- vis),
- 0);
-
- return retval;
-}
-
-AST_Argument *
-be_generator::create_argument (AST_Argument::Direction d,
- AST_Type *ft,
- UTL_ScopedName *n)
-{
- be_argument *retval = 0;
- ACE_NEW_RETURN (retval,
- be_argument (d,
- ft,
- n),
- 0);
-
- return retval;
-}
-
-AST_Attribute *
-be_generator::create_attribute (bool ro,
- AST_Type *ft,
- UTL_ScopedName *n,
- bool is_local,
- bool is_abstract)
-{
- be_attribute *retval = 0;
- ACE_NEW_RETURN (retval,
- be_attribute (ro,
- ft,
- n,
- is_local,
- is_abstract),
- 0);
-
- return retval;
-}
-
-AST_Union *
-be_generator::create_union (AST_ConcreteType *dt,
- UTL_ScopedName *n,
- bool is_local,
- bool is_abstract)
-{
- be_union *retval = 0;
- ACE_NEW_RETURN (retval,
- be_union (dt,
- n,
- is_local,
- is_abstract),
- 0);
-
- return retval;
-}
-
-AST_UnionFwd *
-be_generator::create_union_fwd (UTL_ScopedName *n)
-{
- AST_Union *full_defn = this->create_union (0,
- n,
- false,
- false);
- be_union_fwd *retval = 0;
- ACE_NEW_RETURN (retval,
- be_union_fwd (full_defn,
- n),
- 0);
-
- full_defn->fwd_decl (retval);
- return retval;
-}
-
-AST_UnionBranch *
-be_generator::create_union_branch (UTL_LabelList *ll,
- AST_Type *ft,
- UTL_ScopedName *n)
-{
- be_union_branch *retval = 0;
- ACE_NEW_RETURN (retval,
- be_union_branch (ll,
- ft,
- n),
- 0);
-
- return retval;
-}
-
-AST_UnionLabel *
-be_generator::create_union_label (AST_UnionLabel::UnionLabel ul,
- AST_Expression *lv)
-{
- be_union_label *retval = 0;
- ACE_NEW_RETURN (retval,
- be_union_label (ul,
- lv),
- 0);
-
- return retval;
-}
-
-AST_Constant *
-be_generator::create_constant (AST_Expression::ExprType et,
- AST_Expression *ev,
- UTL_ScopedName *n)
-{
- be_constant *retval = 0;
- ACE_NEW_RETURN (retval,
- be_constant (et,
- ev,
- n),
- 0);
-
- return retval;
-}
-
-AST_Expression *
-be_generator::create_expr (UTL_ScopedName *n)
-{
- be_expression *retval = 0;
- ACE_NEW_RETURN (retval,
- be_expression (n),
- 0);
-
- return retval;
-}
-
-AST_Expression *
-be_generator::create_expr (AST_Expression *b,
- AST_Expression::ExprType t)
-{
- be_expression *retval = 0;
- ACE_NEW_RETURN (retval,
- be_expression (b,
- t),
- 0);
-
- return retval;
-}
-
-AST_Expression *
-be_generator::create_expr (AST_Expression::ExprComb c,
- AST_Expression *v1,
- AST_Expression *v2)
-{
- be_expression *retval = 0;
- ACE_NEW_RETURN (retval,
- be_expression (c,
- v1,
- v2),
- 0);
-
- return retval;
-}
-
-AST_Expression *
-be_generator::create_expr (long l)
-{
- be_expression *retval = 0;
- ACE_NEW_RETURN (retval,
- be_expression (l),
- 0);
-
- return retval;
-}
-
-AST_Expression *
-be_generator::create_expr (bool b)
-{
- be_expression *retval = 0;
- ACE_NEW_RETURN (retval,
- be_expression (b),
- 0);
-
- return retval;
-}
-
-AST_Expression *
-be_generator::create_expr (idl_uns_long l,
- AST_Expression::ExprType t)
-{
- be_expression *retval = 0;
- ACE_NEW_RETURN (retval,
- be_expression (l,
- t),
- 0);
-
- return retval;
-}
-
-AST_Expression *
-be_generator::create_expr (UTL_String *s)
-{
- be_expression *retval = 0;
- ACE_NEW_RETURN (retval,
- be_expression (s),
- 0);
-
- return retval;
-}
-
-AST_Expression *
-be_generator::create_expr(char c)
-{
- be_expression *retval = 0;
- ACE_NEW_RETURN (retval,
- be_expression (c),
- 0);
-
- return retval;
-}
-
-AST_Expression *
-be_generator::create_expr (ACE_OutputCDR::from_wchar wc)
-{
- be_expression *retval = 0;
- ACE_NEW_RETURN (retval,
- be_expression (wc),
- 0);
-
- return retval;
-}
-
-AST_Expression *
-be_generator::create_expr (char *s)
-{
- be_expression *retval = 0;
- ACE_NEW_RETURN (retval,
- be_expression (s),
- 0);
-
- return retval;
-}
-
-AST_Expression *
-be_generator::create_expr (double d)
-{
- be_expression *retval = 0;
- ACE_NEW_RETURN (retval,
- be_expression (d),
- 0);
-
- return retval;
-}
-
-AST_EnumVal *
-be_generator::create_enum_val (unsigned long v,
- UTL_ScopedName *n)
-{
- be_enum_val *retval = 0;
- ACE_NEW_RETURN (retval,
- be_enum_val (v,
- n),
- 0);
-
- return retval;
-}
-
-AST_Array *
-be_generator::create_array (UTL_ScopedName *n,
- unsigned long ndims,
- UTL_ExprList *dims,
- bool is_local,
- bool is_abstract)
-{
- be_array *retval = 0;
- ACE_NEW_RETURN (retval,
- be_array (n,
- ndims,
- dims,
- is_local,
- is_abstract),
- 0);
-
- return retval;
-}
-
-AST_Sequence *
-be_generator::create_sequence (AST_Expression *v,
- AST_Type *bt,
- UTL_ScopedName *n,
- bool is_local,
- bool is_abstract)
-{
- be_sequence *retval = 0;
- ACE_NEW_RETURN (retval,
- be_sequence (v,
- bt,
- n,
- is_local,
- is_abstract),
- 0);
-
- return retval;
-}
-
-AST_String *
-be_generator::create_string (AST_Expression *v)
-{
- Identifier id ("string");
- UTL_ScopedName n (&id,
- 0);
-
- be_string *retval = 0;
- ACE_NEW_RETURN (retval,
- be_string (AST_Decl::NT_string,
- &n,
- v,
- 1),
- 0);
-
- return retval;
-}
-
-AST_String *
-be_generator::create_wstring (AST_Expression *v)
-{
- Identifier id (sizeof (ACE_CDR::WChar) == 1
- ? "string"
- : "wstring");
- UTL_ScopedName n (&id,
- 0);
- AST_Decl::NodeType nt = sizeof (ACE_CDR::WChar) == 1
- ? AST_Decl::NT_string
- : AST_Decl::NT_wstring;
-
- be_string *retval = 0;
- ACE_NEW_RETURN (retval,
- be_string (nt,
- &n,
- v,
- sizeof (ACE_CDR::WChar)),
- 0);
-
- return retval;
-}
-
-AST_Typedef *
-be_generator::create_typedef (AST_Type *bt,
- UTL_ScopedName *n,
- bool is_local,
- bool is_abstract)
-{
- be_typedef *retval = 0;
- ACE_NEW_RETURN (retval,
- be_typedef (bt,
- n,
- is_local,
- is_abstract),
- 0);
-
- return retval;
-}
-
-AST_Native *
-be_generator::create_native (UTL_ScopedName *n)
-{
- be_native *retval = 0;
- ACE_NEW_RETURN (retval,
- be_native (n),
- 0);
-
- return retval;
-}
-
-AST_Factory *
-be_generator::create_factory (UTL_ScopedName *n)
-{
- be_factory *retval = 0;
- ACE_NEW_RETURN (retval,
- be_factory (n),
- 0);
-
- return retval;
-}
diff --git a/TAO/TAO_IDL/be/be_global.cpp b/TAO/TAO_IDL/be/be_global.cpp
deleted file mode 100644
index 261ed9f3850..00000000000
--- a/TAO/TAO_IDL/be/be_global.cpp
+++ /dev/null
@@ -1,2695 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_global.cpp
-//
-// = DESCRIPTION
-// Stores global data specific to the compiler back end.
-//
-// = AUTHOR
-// Jeff Parsons <parsons@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "be_global.h"
-#include "be_codegen.h"
-#include "be_generator.h"
-#include "be_module.h"
-#include "be_valuetype.h"
-#include "be_interface.h"
-#include "ast_predefined_type.h"
-#include "utl_identifier.h"
-#include "utl_string.h"
-#include "global_extern.h"
-#include "idl_defines.h"
-#include "ace/ACE.h"
-#include "ace/OS_NS_stdio.h"
-#include "ace/OS_NS_sys_stat.h"
-#include "ace/os_include/os_ctype.h"
-
-ACE_RCSID (be,
- be_global,
- "$Id$")
-
-TAO_IDL_BE_Export BE_GlobalData *be_global = 0;
-
-BE_GlobalData::BE_GlobalData (void)
- : changing_standard_include_files_ (1),
- skel_export_macro_ (0),
- skel_export_include_ (0),
- stub_export_macro_ (0),
- stub_export_include_ (0),
- anyop_export_macro_ (0),
- anyop_export_include_ (0),
- pch_include_ (0),
- pre_include_ (0),
- post_include_ (0),
- include_guard_ (0),
- safe_include_ (0),
- core_versioning_begin_ ("\nTAO_BEGIN_VERSIONED_NAMESPACE_DECL\n"),
- core_versioning_end_ ("\nTAO_END_VERSIONED_NAMESPACE_DECL\n"),
- versioning_begin_ (),
- versioning_end_ (),
- client_hdr_ending_ (ACE::strnew ("C.h")),
- client_stub_ending_ (ACE::strnew ("C.cpp")),
- client_inline_ending_ (ACE::strnew ("C.inl")),
- server_hdr_ending_ (ACE::strnew ("S.h")),
- implementation_hdr_ending_ (ACE::strnew ("I.h")),
- implementation_skel_ending_ (ACE::strnew ("I.cpp")),
- impl_class_prefix_ (ACE::strnew ("")),
- impl_class_suffix_ (ACE::strnew ("_i")),
- server_template_hdr_ending_ (ACE::strnew ("S_T.h")),
- server_skeleton_ending_ (ACE::strnew ("S.cpp")),
- server_template_skeleton_ending_ (ACE::strnew ("S_T.cpp")),
- server_inline_ending_ (ACE::strnew ("S.inl")),
- server_template_inline_ending_ (ACE::strnew ("S_T.inl")),
- anyop_hdr_ending_ (ACE::strnew ("A.h")),
- anyop_src_ending_ (ACE::strnew ("A.cpp")),
- output_dir_ (0),
- skel_output_dir_ (0),
- anyop_output_dir_ (0),
- any_support_ (true),
- tc_support_ (true),
- obv_opt_accessor_ (0),
- gen_impl_files_ (false),
- gen_impl_debug_info_ (false),
- gen_copy_ctor_ (false),
- gen_assign_op_ (false),
- gen_thru_poa_collocation_ (true), // Default is thru_poa.
- gen_direct_collocation_ (false),
-#ifdef ACE_HAS_EXCEPTIONS
- exception_support_ (true),
-#else
- exception_support_ (false),
-#endif /* ACE_HAS_EXCEPTIONS */
- use_raw_throw_ (false),
- opt_tc_ (false),
- ami_call_back_ (false),
- gen_amh_classes_ (false),
- gen_tie_classes_ (false),
- gen_smart_proxies_ (false),
- gen_inline_constants_ (true),
- gen_dcps_type_support_ (false),
- gen_orb_h_include_ (true),
- lookup_strategy_ (TAO_PERFECT_HASH),
- void_type_ (0),
- ccmobject_ (0),
- messaging_ (0),
- messaging_exceptionholder_ (0),
- exceptionholder_ (0),
- messaging_replyhandler_ (0),
- gen_anyop_files_ (false),
- gen_skel_files_ (true),
- gen_client_inline_ (true),
- gen_server_inline_ (true),
- gen_local_iface_anyops_ (true)
-{
-}
-
-BE_GlobalData::~BE_GlobalData (void)
-{
-}
-
-// To switch between changing or non-changing standard include files
-// include files, so that #include statements can be
-// generated with ""s or <>s respectively, for the standard include
-// files (e.g. tao/corba.h)
-void
-BE_GlobalData::changing_standard_include_files (size_t changing)
-{
- this->changing_standard_include_files_ = changing;
-}
-
-size_t
-BE_GlobalData::changing_standard_include_files (void)
-{
- return this->changing_standard_include_files_;
-}
-
-/************ Helper functions **************/
-static const char*
-be_change_idl_file_extension (UTL_String* idl_file,
- const char *new_extension,
- bool base_name_only = false,
- bool for_anyop = false,
- bool for_skel = false)
-{
- // @@ This shouldn't happen anyway; but a better error handling
- // mechanism is needed.
- if (idl_file == 0 || new_extension == 0)
- {
- return 0;
- }
-
- static char fname[MAXPATHLEN];
- ACE_OS::memset (fname, 0, MAXPATHLEN);
-
- // Get the char* from the UTL_String.
- const char* string = idl_file->get_string ();
-
- // Get the base part of the filename, we try several extensions
- // before giving up.
- const char *base = 0;
-
- static const char* extensions[] = {
- ".idl",
- ".pidl",
- ".IDL",
- ".PIDL"
- };
-
- static int nextensions = sizeof(extensions)/sizeof(extensions[0]);
-
- for (int k = 0; k < nextensions; ++k)
- {
- base = ACE_OS::strstr (string, extensions[k]);
-
- if (base != 0)
- {
- break;
- }
- }
-
- if (base == 0)
- {
- return 0;
- }
-
- // Anyop * skel file output defaults to general output dir if not set.
- const char *output_path = 0;
-
- if (for_anyop && 0 != be_global->anyop_output_dir ())
- {
- output_path = be_global->anyop_output_dir ();
- }
- else if (for_skel && 0 != be_global->skel_output_dir ())
- {
- output_path = be_global->skel_output_dir ();
- }
- else
- {
- output_path = be_global->output_dir ();
- }
-
- if (!base_name_only && output_path != 0)
- {
- // Path info should also be added to fname.
-
- // Add path and "/".
- ACE_OS::sprintf (fname, "%s/", output_path);
-
- // Append the base part to fname.
- ACE_OS::strncpy (fname + strlen (fname), string, base - string);
- }
- else
- {
- // Base_name_only or no putput_dir specified by user. JUST put the
- // base part to fname.
- ACE_OS::strncpy (fname, string, base - string);
- }
-
- // Turn '\' and '\\' into '/'.
- char* i = fname;
-
- for (char* j = fname; *j != 0; ++i, ++j)
- {
- if (*j == '\\')
- {
- *i = '/';
-
- if (*(j+1) == '\\')
- {
- ++j;
- }
- }
- else
- {
- *i = *j;
- }
- }
-
- *i = 0;
-
- // Append the newextension.
- ACE_OS::strcat (fname, new_extension);
-
- return fname;
-}
-
-const char *
-BE_GlobalData::be_get_client_hdr (UTL_String *idl_file_name,
- bool base_name_only)
-{
- // User-defined file extensions don't apply to .pidl files.
- ACE_CString fn (idl_file_name->get_string ());
- ACE_CString fn_ext = fn.substr (fn.length () - 5);
- bool orb_file = (fn_ext == ".pidl" || fn_ext == ".PIDL");
-
- return be_change_idl_file_extension (idl_file_name,
- orb_file
- ? "C.h"
- : be_global->client_hdr_ending (),
- base_name_only);
-}
-
-const char *
-BE_GlobalData::be_get_client_stub (UTL_String *idl_file_name)
-{
- return be_change_idl_file_extension (idl_file_name,
- be_global->client_stub_ending ());
-}
-
-const char *
-BE_GlobalData::be_get_client_inline (UTL_String *idl_file_name,
- bool base_name_only)
-{
- return be_change_idl_file_extension (idl_file_name,
- be_global->client_inline_ending (),
- base_name_only);
-}
-
-const char *
-BE_GlobalData::be_get_server_hdr (UTL_String *idl_file_name,
- bool base_name_only)
-{
- // User-defined file extensions don't apply to .pidl files.
- ACE_CString fn (idl_file_name->get_string ());
- ACE_CString fn_ext = fn.substr (fn.length () - 5);
- bool orb_file = (fn_ext == ".pidl" || fn_ext == ".PIDL");
-
- return be_change_idl_file_extension (idl_file_name,
- orb_file
- ? "S.h"
- : be_global->server_hdr_ending (),
- base_name_only,
- false,
- true);
-}
-
-const char *
-BE_GlobalData::be_get_implementation_hdr (UTL_String *idl_file_name,
- bool base_name_only)
-{
- return be_change_idl_file_extension (idl_file_name,
- be_global->implementation_hdr_ending (),
- base_name_only);
-}
-
-const char *
-BE_GlobalData::be_get_implementation_skel (UTL_String *idl_file_name,
- bool base_name_only)
-{
- return be_change_idl_file_extension (idl_file_name,
- be_global->implementation_skel_ending (),
- base_name_only);
-}
-
-const char *
-BE_GlobalData::be_get_server_template_hdr (UTL_String *idl_file_name,
- bool base_name_only)
-{
- return be_change_idl_file_extension (idl_file_name,
- be_global->server_template_hdr_ending (),
- base_name_only,
- false,
- true);
-}
-
-const char *
-BE_GlobalData::be_get_server_skeleton (UTL_String *idl_file_name)
-{
- return be_change_idl_file_extension (idl_file_name,
- be_global->server_skeleton_ending (),
- false,
- false,
- true);
-}
-
-const char *
-BE_GlobalData::be_get_server_template_skeleton (UTL_String *idl_file_name,
- bool base_name_only)
-{
- return be_change_idl_file_extension (idl_file_name,
- be_global->server_template_skeleton_ending (),
- base_name_only,
- false,
- true);
-}
-
-const char *
-BE_GlobalData::be_get_server_inline (UTL_String *idl_file_name,
- bool base_name_only)
-{
- return be_change_idl_file_extension (idl_file_name,
- be_global->server_inline_ending (),
- base_name_only,
- false,
- true);
-}
-
-const char *
-BE_GlobalData::be_get_server_template_inline (UTL_String *idl_file_name,
- bool base_name_only)
-{
- return be_change_idl_file_extension (idl_file_name,
- be_global->server_template_inline_ending (),
- base_name_only,
- false,
- true);
-}
-
-const char *
-BE_GlobalData::be_get_anyop_header (UTL_String *idl_file_name,
- bool base_name_only)
-{
- return be_change_idl_file_extension (idl_file_name,
- be_global->anyop_header_ending (),
- base_name_only,
- true);
-}
-
-const char *
-BE_GlobalData::be_get_anyop_source (UTL_String *idl_file_name,
- bool base_name_only)
-{
- return be_change_idl_file_extension (idl_file_name,
- be_global->anyop_source_ending (),
- base_name_only,
- true);
-}
-
-const char *
-BE_GlobalData::be_get_client_hdr_fname (bool base_name_only)
-{
- return be_get_client_hdr (idl_global->stripped_filename (),
- base_name_only);
-}
-
-const char *
-BE_GlobalData::be_get_client_stub_fname (void)
-{
- return be_get_client_stub (idl_global->stripped_filename ());
-}
-
-const char *
-BE_GlobalData::be_get_client_inline_fname (bool base_name_only)
-{
- return be_get_client_inline (idl_global->stripped_filename (),
- base_name_only);
-}
-
-const char *
-BE_GlobalData::be_get_server_hdr_fname (bool base_name_only)
-{
- return be_get_server_hdr (idl_global->stripped_filename (),
- base_name_only);
-}
-
-const char *
-BE_GlobalData::be_get_implementation_hdr_fname (bool base_name_only)
-{
- return be_get_implementation_hdr (idl_global->stripped_filename (),
- base_name_only);
-}
-
-const char *
-BE_GlobalData::be_get_implementation_skel_fname (bool base_name_only)
-{
- return be_get_implementation_skel (idl_global->stripped_filename (),
- base_name_only);
-}
-
-const char *
-BE_GlobalData::be_get_server_template_hdr_fname (bool base_name_only)
-{
- return be_get_server_template_hdr (idl_global->stripped_filename (),
- base_name_only);
-}
-
-const char *
-BE_GlobalData::be_get_server_skeleton_fname (void)
-{
- return be_get_server_skeleton (idl_global->stripped_filename ());
-}
-
-const char *
-BE_GlobalData::be_get_implementation_skeleton_fname (void)
-{
- return be_get_implementation_skel (idl_global->stripped_filename ());
-}
-
-const char *
-BE_GlobalData::be_get_server_template_skeleton_fname (bool base_name_only)
-{
- return be_get_server_template_skeleton (idl_global->stripped_filename (),
- base_name_only);
-}
-
-const char *
-BE_GlobalData::be_get_server_inline_fname (bool base_name_only)
-{
- return be_get_server_inline (idl_global->stripped_filename (),
- base_name_only);
-}
-
-const char *
-BE_GlobalData::be_get_server_template_inline_fname (bool base_name_only)
-{
- return be_get_server_template_inline (idl_global->stripped_filename (),
- base_name_only);
-}
-
-const char *
-BE_GlobalData::be_get_anyop_source_fname (bool base_name_only)
-{
- return be_get_anyop_source (idl_global->stripped_filename (),
- base_name_only);
-}
-
-const char *
-BE_GlobalData::be_get_anyop_header_fname (bool base_name_only)
-{
- return be_get_anyop_header (idl_global->stripped_filename (),
- base_name_only);
-}
-
-const char*
-BE_GlobalData::skel_export_macro (void) const
-{
- if (this->skel_export_macro_ == 0)
- {
- return "";
- }
-
- return this->skel_export_macro_;
-}
-
-void
-BE_GlobalData::skel_export_macro (const char *s)
-{
- this->skel_export_macro_ = ACE_OS::strdup (s);
-}
-
-const char*
-BE_GlobalData::skel_export_include (void) const
-{
- return this->skel_export_include_;
-}
-
-void
-BE_GlobalData::skel_export_include (const char *s)
-{
- this->skel_export_include_ = ACE_OS::strdup (s);
-}
-
-const char*
-BE_GlobalData::stub_export_macro (void) const
-{
- if (this->stub_export_macro_ == 0)
- {
- return "";
- }
-
- return this->stub_export_macro_;
-}
-
-void
-BE_GlobalData::stub_export_macro (const char *s)
-{
- this->stub_export_macro_ = ACE_OS::strdup (s);
-}
-
-const char*
-BE_GlobalData::stub_export_include (void) const
-{
- return this->stub_export_include_;
-}
-
-void
-BE_GlobalData::stub_export_include (const char *s)
-{
- this->stub_export_include_ = ACE_OS::strdup (s);
-}
-
-const char*
-BE_GlobalData::anyop_export_macro (void) const
-{
- if (this->anyop_export_macro_ == 0)
- {
- return "";
- }
-
- return this->anyop_export_macro_;
-}
-
-void
-BE_GlobalData::anyop_export_macro (const char *s)
-{
- this->anyop_export_macro_ = ACE_OS::strdup (s);
-}
-
-const char*
-BE_GlobalData::anyop_export_include (void) const
-{
- return this->anyop_export_include_;
-}
-
-void
-BE_GlobalData::anyop_export_include (const char *s)
-{
- this->anyop_export_include_ = ACE_OS::strdup (s);
-}
-
-const char*
-BE_GlobalData::pch_include (void) const
-{
- return this->pch_include_;
-}
-
-void
-BE_GlobalData::pch_include (const char *s)
-{
- this->pch_include_ = ACE_OS::strdup (s);
-}
-
-const char*
-BE_GlobalData::pre_include (void) const
-{
- return this->pre_include_;
-}
-
-void
-BE_GlobalData::pre_include (const char *s)
-{
- this->pre_include_ = ACE_OS::strdup (s);
-}
-
-const char*
-BE_GlobalData::post_include (void) const
-{
- return this->post_include_;
-}
-
-void
-BE_GlobalData::post_include (const char *s)
-{
- this->post_include_ = ACE_OS::strdup (s);
-}
-
-const char*
-BE_GlobalData::include_guard (void) const
-{
- return this->include_guard_;
-}
-
-void
-BE_GlobalData::include_guard (const char *s)
-{
- this->include_guard_ = ACE_OS::strdup (s);
-}
-
-const char*
-BE_GlobalData::safe_include (void) const
-{
- return this->safe_include_;
-}
-
-void
-BE_GlobalData::safe_include (const char *s)
-{
- this->safe_include_ = ACE_OS::strdup (s);
-}
-
-void
-BE_GlobalData::versioning_begin (const char * s)
-{
- this->versioning_begin_ =
- ACE_CString ("\n\n")
- + ACE_CString (s)
- + ACE_CString ("\n\n");
-
- this->core_versioning_end_ += this->versioning_begin_; // Yes, "begin".
-}
-
-const char *
-BE_GlobalData::versioning_begin (void) const
-{
- return this->versioning_begin_.c_str ();
-}
-
-const char *
-BE_GlobalData::core_versioning_begin (void) const
-{
- return this->core_versioning_begin_.c_str ();
-}
-
-void
-BE_GlobalData::versioning_end (const char * s)
-{
- this->versioning_end_ =
- ACE_CString ("\n\n")
- + ACE_CString (s)
- + ACE_CString ("\n\n");
-
- this->core_versioning_begin_ =
- this->versioning_end_ // Yes, "end".
- + this->core_versioning_begin_; // Initialized in constructor.
-}
-
-const char *
-BE_GlobalData::versioning_end (void) const
-{
- return this->versioning_end_.c_str ();
-}
-
-const char *
-BE_GlobalData::core_versioning_end (void) const
-{
- return this->core_versioning_end_.c_str ();
-}
-
-// Set the client_hdr_ending.
-void
-BE_GlobalData::client_hdr_ending (const char* s)
-{
- delete [] this->client_hdr_ending_;
- this->client_hdr_ending_ = ACE::strnew (s);
-}
-
-// Get the client_hdr_ending.
-const char*
-BE_GlobalData::client_hdr_ending (void) const
-{
- return this->client_hdr_ending_;
-}
-
-void
-BE_GlobalData::client_inline_ending (const char* s)
-{
- delete [] this->client_inline_ending_;
- this->client_inline_ending_ = ACE::strnew (s);
-}
-
-const char*
-BE_GlobalData::client_inline_ending (void) const
-{
- return this->client_inline_ending_;
-}
-
-// Set the client_stub_ending.
-void
-BE_GlobalData::client_stub_ending (const char* s)
-{
- delete [] this->client_stub_ending_;
- this->client_stub_ending_ = ACE::strnew (s);
-}
-
-const char*
-BE_GlobalData::client_stub_ending (void) const
-{
- return this->client_stub_ending_;
-}
-
-void
-BE_GlobalData::server_hdr_ending (const char* s)
-{
- delete [] this->server_hdr_ending_;
- this->server_hdr_ending_ = ACE::strnew (s);
-}
-
-const char*
-BE_GlobalData::server_hdr_ending (void) const
-{
- return this->server_hdr_ending_;
-}
-
-void
-BE_GlobalData::implementation_hdr_ending (const char* s)
-{
- delete [] this->implementation_hdr_ending_;
- this->implementation_hdr_ending_ = ACE::strnew (s);
-}
-
-void
-BE_GlobalData::implementation_skel_ending (const char* s)
-{
- delete [] this->implementation_skel_ending_;
- this->implementation_skel_ending_ = ACE::strnew (s);
-}
-
-void
-BE_GlobalData::impl_class_prefix (const char* s)
-{
- delete [] this->impl_class_prefix_;
- this->impl_class_prefix_ = ACE::strnew (s);
-}
-
-void
-BE_GlobalData::impl_class_suffix (const char* s)
-{
- delete [] this->impl_class_suffix_;
- this->impl_class_suffix_ = ACE::strnew (s);
-}
-
-const char*
-BE_GlobalData::impl_class_prefix (void) const
-{
- return this->impl_class_prefix_;
-}
-
-const char*
-BE_GlobalData::implementation_hdr_ending (void) const
-{
- return this->implementation_hdr_ending_;
-}
-
-const char*
-BE_GlobalData::impl_class_suffix (void) const
-{
- return this->impl_class_suffix_;
-}
-
-const char*
-BE_GlobalData::implementation_skel_ending (void) const
-{
- return this->implementation_skel_ending_;
-}
-
-void
-BE_GlobalData::server_template_hdr_ending (const char* s)
-{
- delete [] this->server_template_hdr_ending_;
- this->server_template_hdr_ending_ = ACE::strnew (s);
-}
-
-const char*
-BE_GlobalData::server_template_hdr_ending (void) const
-{
- return this->server_template_hdr_ending_;
-}
-
-void
-BE_GlobalData::server_skeleton_ending (const char* s)
-{
- delete [] this->server_skeleton_ending_;
- this->server_skeleton_ending_ = ACE::strnew (s);
-}
-
-const char*
-BE_GlobalData::server_skeleton_ending (void) const
-{
- return this->server_skeleton_ending_;
-}
-
-void
-BE_GlobalData::server_template_skeleton_ending (const char* s)
-{
- delete [] this->server_template_skeleton_ending_;
- this->server_template_skeleton_ending_ = ACE::strnew (s);
-}
-
-const char*
-BE_GlobalData::server_template_skeleton_ending (void) const
-{
- return this->server_template_skeleton_ending_;
-}
-
-void
-BE_GlobalData::server_inline_ending (const char* s)
-{
- delete [] this->server_inline_ending_;
- this->server_inline_ending_ = ACE::strnew (s);
-}
-
-const char*
-BE_GlobalData::server_inline_ending (void) const
-{
- return this->server_inline_ending_;
-}
-
-void
-BE_GlobalData::server_template_inline_ending (const char* s)
-{
- delete [] this->server_template_inline_ending_;
- this->server_template_inline_ending_ = ACE::strnew (s);
-}
-
-const char*
-BE_GlobalData::server_template_inline_ending (void) const
-{
- return this->server_template_inline_ending_;
-}
-
-void
-BE_GlobalData::anyop_header_ending (const char* s)
-{
- delete [] this->anyop_hdr_ending_;
- this->anyop_hdr_ending_ = ACE::strnew (s);
-}
-
-const char*
-BE_GlobalData::anyop_header_ending (void) const
-{
- return this->anyop_hdr_ending_;
-}
-
-void
-BE_GlobalData::anyop_source_ending (const char* s)
-{
- delete [] this->anyop_src_ending_;
- this->anyop_src_ending_ = ACE::strnew (s);
-}
-
-const char*
-BE_GlobalData::anyop_source_ending (void) const
-{
- return this->anyop_src_ending_;
-}
-
-void
-BE_GlobalData::output_dir (const char* s)
-{
- delete [] this->output_dir_;
- this->output_dir_ = ACE::strnew (s);
-}
-
-const char*
-BE_GlobalData::output_dir (void) const
-{
- return this->output_dir_;
-}
-
-void
-BE_GlobalData::skel_output_dir (const char* s)
-{
- delete [] this->skel_output_dir_;
- this->skel_output_dir_ = ACE::strnew (s);
-}
-
-const char*
-BE_GlobalData::skel_output_dir (void) const
-{
- return this->skel_output_dir_;
-}
-
-void
-BE_GlobalData::anyop_output_dir (const char* s)
-{
- delete [] this->anyop_output_dir_;
- this->anyop_output_dir_ = ACE::strnew (s);
-}
-
-const char*
-BE_GlobalData::anyop_output_dir (void) const
-{
- return this->anyop_output_dir_;
-}
-
-void
-BE_GlobalData::any_support (bool val)
-{
- this->any_support_ = val;
-}
-
-bool
-BE_GlobalData::any_support (void) const
-{
- return this->any_support_;
-}
-
-void
-BE_GlobalData::tc_support (bool val)
-{
- this->tc_support_ = val;
-}
-
-bool
-BE_GlobalData::tc_support (void) const
-{
- return this->tc_support_;
-}
-
-void
-BE_GlobalData::obv_opt_accessor (bool val)
-{
- this->obv_opt_accessor_ = val;
-}
-
-bool
-BE_GlobalData::obv_opt_accessor (void) const
-{
- return this->obv_opt_accessor_;
-}
-
-void
-BE_GlobalData::gen_impl_files (bool val)
-{
- this->gen_impl_files_ = val;
-}
-
-bool
-BE_GlobalData::gen_impl_files (void) const
-{
- return this->gen_impl_files_;
-}
-
-void
-BE_GlobalData::gen_impl_debug_info (bool val)
-{
- this->gen_impl_debug_info_ = val;
-}
-
-bool
-BE_GlobalData::gen_impl_debug_info (void) const
-{
- return this->gen_impl_debug_info_;
-}
-
-void
-BE_GlobalData::gen_copy_ctor (bool val)
-{
- this->gen_copy_ctor_ = val;
-}
-
-bool
-BE_GlobalData::gen_copy_ctor (void) const
-{
- return this->gen_copy_ctor_;
-}
-
-void
-BE_GlobalData::gen_assign_op (bool val)
-{
- this->gen_assign_op_ = val;
-}
-
-bool
-BE_GlobalData::gen_assign_op (void) const
-{
- return this->gen_assign_op_;
-}
-
-void
-BE_GlobalData::gen_thru_poa_collocation (bool val)
-{
- this->gen_thru_poa_collocation_ = val;
-}
-
-bool
-BE_GlobalData::gen_thru_poa_collocation (void) const
-{
- return this->gen_thru_poa_collocation_;
-}
-
-void
-BE_GlobalData::gen_direct_collocation (bool val)
-{
- this->gen_direct_collocation_ = val;
-}
-
-bool
-BE_GlobalData::gen_direct_collocation (void) const
-{
- return this->gen_direct_collocation_;
-}
-
-void
-BE_GlobalData::exception_support (bool val)
-{
- this->exception_support_ = val;
-}
-
-bool
-BE_GlobalData::exception_support (void) const
-{
- return this->exception_support_;
-}
-
-void
-BE_GlobalData::use_raw_throw (bool val)
-{
- this->use_raw_throw_ = val;
-}
-
-bool
-BE_GlobalData::use_raw_throw (void) const
-{
- return this->use_raw_throw_;
-}
-
-void
-BE_GlobalData::opt_tc (bool val)
-{
- this->opt_tc_ = val;
-}
-
-bool
-BE_GlobalData::opt_tc (void) const
-{
- return this->opt_tc_;
-}
-
-void
-BE_GlobalData::ami_call_back (bool val)
-{
- this->ami_call_back_ = val;
-}
-
-bool
-BE_GlobalData::ami_call_back (void) const
-{
- return this->ami_call_back_;
-}
-
-void
-BE_GlobalData::gen_amh_classes (bool val)
-{
- this->gen_amh_classes_ = val;
-}
-
-bool
-BE_GlobalData::gen_amh_classes (void) const
-{
- return this->gen_amh_classes_;
-}
-
-void
-BE_GlobalData::gen_tie_classes (bool val)
-{
- this->gen_tie_classes_ = val;
-}
-
-bool
-BE_GlobalData::gen_tie_classes (void) const
-{
- return this->gen_tie_classes_;
-}
-
-void
-BE_GlobalData::gen_smart_proxies (bool val)
-{
- this->gen_smart_proxies_ = val;
-}
-
-bool
-BE_GlobalData::gen_smart_proxies (void) const
-{
- return this->gen_smart_proxies_;
-}
-
-void
-BE_GlobalData::gen_inline_constants (bool val)
-{
- this->gen_inline_constants_ = val;
-}
-
-bool
-BE_GlobalData::gen_inline_constants (void) const
-{
- return this->gen_inline_constants_;
-}
-
-void
-BE_GlobalData::gen_dcps_type_support (bool val)
-{
- this->gen_dcps_type_support_ = val;
-}
-
-bool
-BE_GlobalData::gen_dcps_type_support (void) const
-{
- return this->gen_dcps_type_support_;
-}
-
-void
-BE_GlobalData::gen_orb_h_include (bool val)
-{
- this->gen_orb_h_include_ = val;
-}
-
-bool
-BE_GlobalData::gen_orb_h_include (void) const
-{
- return this->gen_orb_h_include_;
-}
-
-void
-BE_GlobalData::lookup_strategy (LOOKUP_STRATEGY s)
-{
- this->lookup_strategy_ = s;
-}
-
-BE_GlobalData::LOOKUP_STRATEGY
-BE_GlobalData::lookup_strategy (void) const
-{
- return this->lookup_strategy_;
-}
-
-void
-BE_GlobalData::destroy (void)
-{
- ACE_OS::free (this->pch_include_);
- this->pch_include_ = 0;
-
- ACE_OS::free (this->pre_include_);
- this->pre_include_ = 0;
-
- ACE_OS::free (this->post_include_);
- this->post_include_ = 0;
-
- ACE_OS::free (this->include_guard_);
- this->include_guard_ = 0;
-
- ACE_OS::free (this->safe_include_);
- this->safe_include_ = 0;
-
- delete [] this->client_hdr_ending_;
- this->client_hdr_ending_ = 0;
-
- delete [] this->client_stub_ending_;
- this->client_stub_ending_ = 0;
-
- delete [] this->client_inline_ending_;
- this->client_inline_ending_ = 0;
-
- delete [] this->server_hdr_ending_;
- this->server_hdr_ending_ = 0;
-
- delete [] this->implementation_hdr_ending_;
- this->implementation_hdr_ending_ = 0;
-
- delete [] this->implementation_skel_ending_;
- this->implementation_skel_ending_ = 0;
-
- delete [] this->impl_class_prefix_;
- this->impl_class_prefix_ = 0;
-
- delete [] this->impl_class_suffix_;
- this->impl_class_suffix_ = 0;
-
- delete [] this->server_template_hdr_ending_;
- this->server_template_hdr_ending_ = 0;
-
- delete [] this->server_skeleton_ending_;
- this->server_skeleton_ending_ = 0;
-
- delete [] this->server_template_skeleton_ending_;
- this->server_template_skeleton_ending_ = 0;
-
- delete [] this->server_inline_ending_;
- this->server_inline_ending_ = 0;
-
- delete [] this->server_template_inline_ending_;
- this->server_template_inline_ending_ = 0;
-
- delete [] this->anyop_hdr_ending_;
- this->anyop_hdr_ending_ = 0;
-
- delete [] this->anyop_src_ending_;
- this->anyop_src_ending_ = 0;
-
- delete [] this->output_dir_;
- this->output_dir_ = 0;
-
- delete [] this->anyop_output_dir_;
- this->anyop_output_dir_ = 0;
-
- if (0 != this->messaging_)
- {
- this->messaging_->destroy ();
- delete this->messaging_;
- this->messaging_ = 0;
- }
-
- if (0 != this->messaging_exceptionholder_)
- {
- this->messaging_exceptionholder_->destroy ();
- delete this->messaging_exceptionholder_;
- this->messaging_exceptionholder_ = 0;
- }
-
- if (0 != this->messaging_replyhandler_)
- {
- this->messaging_replyhandler_->destroy ();
- delete this->messaging_replyhandler_;
- this->messaging_replyhandler_ = 0;
- }
-
- if (0 != tao_cg)
- {
- tao_cg->destroy ();
- }
-}
-
-AST_PredefinedType *
-BE_GlobalData:: void_type (void)
-{
- if (0 == this->void_type_)
- {
- AST_Decl *d =
- idl_global->scopes ().bottom ()->lookup_primitive_type (
- AST_Expression::EV_void
- );
- this->void_type_ = AST_PredefinedType::narrow_from_decl (d);
- }
-
- return this->void_type_;
-}
-
-be_interface *
-BE_GlobalData::ccmobject (void)
-{
- if (0 == this->ccmobject_)
- {
- Identifier *local_id = 0;
- ACE_NEW_RETURN (local_id,
- Identifier ("CCMObject"),
- 0);
- UTL_ScopedName *local_name = 0;
- ACE_NEW_RETURN (local_name,
- UTL_ScopedName (local_id, 0),
- 0);
-
- Identifier *module_id = 0;
- ACE_NEW_RETURN (module_id,
- Identifier ("Components"),
- 0);
- UTL_ScopedName sn (module_id,
- local_name);
-
- AST_Decl *d =
- idl_global->scopes ().top_non_null ()->lookup_by_name (&sn,
- true);
-
- sn.destroy ();
-
- if (0 == d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_global::ccmobject - "
- "lookup of CCMObject failed\n"),
- 0);
- }
-
- this->ccmobject_ = be_interface::narrow_from_decl (d);
- }
-
- return this->ccmobject_;
-}
-
-be_module *
-BE_GlobalData::messaging (void)
-{
- if (0 == this->messaging_)
- {
- Identifier *id = 0;
- UTL_ScopedName *sn = 0;
-
- ACE_NEW_RETURN (id,
- Identifier ("Messaging"),
- 0);
-
- ACE_NEW_RETURN (sn,
- UTL_ScopedName (id,
- 0),
- 0);
-
- ACE_NEW_RETURN (this->messaging_,
- be_module (sn),
- 0);
-
- this->messaging_->set_name (sn);
- }
-
- return this->messaging_;
-}
-
-be_valuetype *
-BE_GlobalData::messaging_exceptionholder (void)
-{
- if (0 == this->messaging_exceptionholder_)
- {
- Identifier *id = 0;
- be_module *msg = this->messaging ();
- idl_global->scopes ().push (msg);
-
- ACE_NEW_RETURN (id,
- Identifier ("Messaging"),
- 0);
-
- // Create a valuetype "ExceptionHolder"
- // from which we inherit.
- UTL_ScopedName *full_name = 0;
- ACE_NEW_RETURN (full_name,
- UTL_ScopedName (id,
- 0),
- 0);
-
- ACE_NEW_RETURN (id,
- Identifier ("ExceptionHolder"),
- 0);
-
- UTL_ScopedName *local_name = 0;
- ACE_NEW_RETURN (local_name,
- UTL_ScopedName (id,
- 0),
- 0);
-
- full_name->nconc (local_name);
-
- ACE_NEW_RETURN (this->messaging_exceptionholder_,
- be_valuetype (full_name,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0),
- 0);
-
- this->messaging_exceptionholder_->set_name (full_name);
-
- // Notice the valuetype "ExceptionHolder" that it is defined in the
- // "Messaging" module
- this->messaging_exceptionholder_->set_defined_in (msg);
- this->messaging_exceptionholder_->set_prefix_with_typeprefix (
- "omg.org"
- );
-
- idl_global->scopes ().pop ();
-
- // Notice the interface "ReplyHandler" that it is defined in the
- // "Messaging" module.
- this->messaging_exceptionholder_->set_defined_in (msg);
- }
-
- return this->messaging_exceptionholder_;
-}
-
-be_valuetype *
-BE_GlobalData::exceptionholder (void) const
-{
- return this->exceptionholder_;
-}
-
-void
-BE_GlobalData::exceptionholder (be_valuetype *val)
-{
- this->exceptionholder_ = val;
-}
-
-be_interface *
-BE_GlobalData::messaging_replyhandler (void)
-{
- if (0 == this->messaging_replyhandler_)
- {
- be_module *msg = this->messaging ();
- idl_global->scopes ().push (msg);
-
- Identifier *id = 0;
- UTL_ScopedName *local_name = 0;
-
- // Create a virtual module named "Messaging"
- // "and an interface "ReplyHandler"
- // from which we inherit.
- ACE_NEW_RETURN (id,
- Identifier ("Messaging"),
- 0);
-
- UTL_ScopedName *full_name = 0;
- ACE_NEW_RETURN (full_name,
- UTL_ScopedName (id,
- 0),
- 0);
-
- ACE_NEW_RETURN (id,
- Identifier ("ReplyHandler"),
- 0);
-
- ACE_NEW_RETURN (local_name,
- UTL_ScopedName (id,
- 0),
- 0);
-
- full_name->nconc (local_name);
-
- ACE_NEW_RETURN (this->messaging_replyhandler_,
- be_interface (full_name,
- 0, // inherited interfaces
- 0, // number of inherited interfaces
- 0, // ancestors
- 0, // number of ancestors
- 0, // not local
- 0), // not abstract
- 0);
-
- this->messaging_replyhandler_->set_name (full_name);
- this->messaging_replyhandler_->set_prefix_with_typeprefix ("omg.org");
-
- idl_global->scopes ().pop ();
-
- // Notice the interface "ReplyHandler" that it is defined in the
- // "Messaging" module.
- this->messaging_replyhandler_->set_defined_in (msg);
- }
-
- return this->messaging_replyhandler_;
-}
-
-bool
-BE_GlobalData::gen_anyop_files (void) const
-{
- return this->gen_anyop_files_;
-}
-
-void
-BE_GlobalData::gen_anyop_files (bool val)
-{
- this->gen_anyop_files_ = val;
-}
-
-bool
-BE_GlobalData::gen_skel_files (void) const
-{
- return this->gen_skel_files_;
-}
-
-void
-BE_GlobalData::gen_skel_files (bool val)
-{
- this->gen_skel_files_ = val;
-}
-
-bool
-BE_GlobalData::gen_client_inline (void) const
-{
- return this->gen_client_inline_;
-}
-
-void
-BE_GlobalData::gen_client_inline (bool val)
-{
- this->gen_client_inline_ = val;
-}
-
-bool
-BE_GlobalData::gen_server_inline (void) const
-{
- return this->gen_server_inline_;
-}
-
-void
-BE_GlobalData::gen_server_inline (bool val)
-{
- this->gen_server_inline_ = val;
-}
-
-bool
-BE_GlobalData::gen_local_iface_anyops (void) const
-{
- return this->gen_local_iface_anyops_;
-}
-
-void
-BE_GlobalData::gen_local_iface_anyops (bool val)
-{
- this->gen_local_iface_anyops_ = val;
-}
-
-ACE_CString
-BE_GlobalData::spawn_options (void)
-{
- return idl_global->idl_flags ();
-}
-
-void
-BE_GlobalData::parse_args (long &i, char **av)
-{
- switch (av[i][1])
- {
- // = Various 'h'eader_file_name_endings.
- case 'h':
-
- // <-hc Client's header file name ending>
- // Default is "C.h".
- // <-hs Server's header file name ending>
- // Default is "S.h".
- // <-hT Server's template hdr file name ending>
- // Default is "S_T.h".
- // <-hI Server's implementation header file name ending>
- // Default is "I.h".
-
- if (av[i][2] == 'c')
- {
- // Client stub's header file ending.
- // @@ No error handling done here.
- idl_global->append_idl_flag (av[i + 1]);
- be_global->client_hdr_ending (av[i + 1]);
- ++i;
- }
- else if (av[i][2] == 's')
- {
- // Server skeleton's header file.
- idl_global->append_idl_flag (av[i + 1]);
- be_global->server_hdr_ending (av[i + 1]);
- ++i;
- }
- else if (av[i][2] == 'T')
- {
- // Server template header ending.
- idl_global->append_idl_flag (av[i + 1]);
- be_global->server_template_hdr_ending (av[i + 1]);
- ++i;
- }
- else if (av[i][2] == 'I')
- {
- // Server implementation header ending.
- idl_global->append_idl_flag (av[i + 1]);
- be_global->implementation_hdr_ending (av[i + 1]);
- ++i;
- }
- else
- {
- // I expect 'c' or 's' or 'I' or 'T' after this.
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand the '%s' option\n"),
- av[i]
- ));
- }
-
- break;
- // = Various 'c'lient side stub file_name_endings.
- case 'c':
- // <-cs Client stub's file name ending>
- // Default is "C.cpp".
- // <-ci Client inline file name ending>
- // Default is "C.inl".
-
- if (av[i][2] == 's')
- {
- idl_global->append_idl_flag (av[i + 1]);
- be_global->client_stub_ending (av[i + 1]);
- i++;
- }
- else if (av[i][2] == 'i')
- {
- idl_global->append_idl_flag (av[i + 1]);
- be_global->client_inline_ending (av[i + 1]);
- i++;
- }
- else
- {
- // I expect 's' or 'i' after 'c'.
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand the '%s' option\n"),
- av[i]
- ));
- }
-
- break;
- // = Various 's'erver side skeleton file name endings.
- case 's':
- // <-ss Server's skeleton file name ending>
- // Default is "S.cpp".
- // <-sT Server's template skeleton file name ending>
- // Default is "S_T.cpp".
- // <-si Server's inline file name ending>
- // Default is "S.inl".
- // <-st Server's template inline file name ending>
- // Default is "S_T.inl".
- // <-sI Server's implementation skeleton file name ending>
- // Default is "I.cpp".
-
- if (av[i][2] == 's')
- {
- idl_global->append_idl_flag (av[i + 1]);
- be_global->server_skeleton_ending (av[i + 1]);
- ++i;
- }
- else if (av[i][2] == 'T')
- {
- idl_global->append_idl_flag (av[i + 1]);
- be_global->server_template_skeleton_ending (av[i + 1]);
- ++i;
- }
- else if (av[i][2] == 'i')
- {
- idl_global->append_idl_flag (av[i + 1]);
- be_global->server_inline_ending (av[i + 1]);
- ++i;
- }
- else if (av[i][2] == 't')
- {
- idl_global->append_idl_flag (av[i + 1]);
- be_global->server_template_inline_ending (av[i + 1]);
- ++i;
- }
- else if (av[i][2] == 'I')
- {
- idl_global->append_idl_flag (av[i + 1]);
- be_global->implementation_skel_ending (av[i + 1]);
- ++i;
- }
- else
- {
- // I expect 's' or 'T' or 'i' or 't' after 's'.
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand the '%s' option\n"),
- av[i]
- ));
- }
-
- break;
- // Operation lookup strategy.
- // <perfect_hash>, <dynamic_hash> or <binary_search>
- // Default is perfect.
- case 'H':
- idl_global->append_idl_flag (av[i + 1]);
-
- if (av[i + 1] == 0 || av[i + 1][0] == '-')
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("no selection for -H option\n")));
- }
- else if (ACE_OS::strcmp (av[i+1], "dynamic_hash") == 0)
- {
- be_global->lookup_strategy (
- BE_GlobalData::TAO_DYNAMIC_HASH
- );
- }
- else if (ACE_OS::strcmp (av[i + 1], "perfect_hash") == 0)
- {
- be_global->lookup_strategy (
- BE_GlobalData::TAO_PERFECT_HASH
- );
- }
- else if (ACE_OS::strcmp (av[i + 1], "binary_search") == 0)
- {
- be_global->lookup_strategy (
- BE_GlobalData::TAO_BINARY_SEARCH
- );
- }
- else if (ACE_OS::strcmp (av[i + 1], "linear_search") == 0)
- {
- be_global->lookup_strategy (
- BE_GlobalData::TAO_LINEAR_SEARCH
- );
- }
- else
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("%s: unknown operation lookup <%s>\n"),
- av[0],
- av[i + 1]));
- }
-
- ++i;
- break;
- // Switching between ""s and <>s when we generate
- // #include statements for the standard files (e.g. tao/corba.h)
- case 'i':
- if (av[i][2] == 'c')
- {
- be_global->changing_standard_include_files (1);
- }
- else if (av[i][2] == 'n')
- {
- be_global->changing_standard_include_files (0);
- }
- else
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand the '%s' option\n"),
- av[i]
- ));
- }
-
- break;
- // Path for the perfect hash generator(gperf) program. Default
- // is $ACE_ROOT/bin/gperf.
- case 'g':
- if (av[i][2] == '\0')
- {
- idl_global->append_idl_flag (av[i + 1]);
- ACE_CString tmp (av[i + 1], 0, 0);
-#if defined (ACE_WIN32)
- // WIN32's CreateProcess needs the full executable name
- // when the gperf path is modified, but not for the default
- // path given above. Other platforms don't need the
- // executable name at all.
- tmp += "\\gperf.exe";
-#endif
- idl_global->gperf_path (tmp.fast_rep ());
- ++i;
- }
- else
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand")
- ACE_TEXT (" the '%s' option\n"),
- av[i]
- ));
- }
-
- break;
- // Directory where all the IDL-Compiler-Generated files are to
- // be kept. Default is the current directory from which the
- // <tao_idl> is called.
- case 'o':
- if (av[i][2] == '\0')
- {
- idl_global->append_idl_flag (av[i + 1]);
- int result = ACE_OS::mkdir (av[i + 1]);
-
- #if !defined (__BORLANDC__)
- if (result != 0 && errno != EEXIST)
- #else
- // The Borland RTL doesn't give EEXIST back, only EACCES in case
- // the directory exists, reported to Borland as QC 9495
- if (result != 0 && errno != EEXIST && errno != EACCES)
- #endif
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: unable to create directory %s")
- ACE_TEXT (" specified by -o option\n"),
- av[i + 1]
- ));
-
- break;
- }
-
- be_global->output_dir (av[i + 1]);
- ++i;
- }
- else if (av[i][2] == 'A')
- {
- if (av[i][3] == '\0')
- {
- idl_global->append_idl_flag (av[i + 1]);
- int result = ACE_OS::mkdir (av[i + 1]);
-
- #if !defined (__BORLANDC__)
- if (result != 0 && errno != EEXIST)
- #else
- // The Borland RTL doesn't give EEXIST back, only EACCES in
- // case the directory exists, reported to Borland as QC 9495
- if (result != 0 && errno != EEXIST && errno != EACCES)
- #endif
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: unable to create directory %s")
- ACE_TEXT (" specified by -oA option\n"),
- av[i + 1]
- ));
-
- break;
- }
-
- be_global->anyop_output_dir (av[i + 1]);
- ++i;
- }
- else
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand")
- ACE_TEXT (" the '%s' option\n"),
- av[i]
- ));
- }
- }
- else if (av[i][2] == 'S')
- {
- if (av[i][3] == '\0')
- {
- idl_global->append_idl_flag (av[i + 1]);
- int result = ACE_OS::mkdir (av[i + 1]);
-
- #if !defined (__BORLANDC__)
- if (result != 0 && errno != EEXIST)
- #else
- // The Borland RTL doesn't give EEXIST back, only EACCES in
- // case the directory exists, reported to Borland as QC 9495
- if (result != 0 && errno != EEXIST && errno != EACCES)
- #endif
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: unable to create directory %s")
- ACE_TEXT (" specified by -oS option\n"),
- av[i + 1]
- ));
-
- break;
- }
-
- be_global->skel_output_dir (av[i + 1]);
- ++i;
- }
- else
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand")
- ACE_TEXT (" the '%s' option\n"),
- av[i]
- ));
- }
- }
- else
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand")
- ACE_TEXT (" the '%s' option\n"),
- av[i]
- ));
- }
-
- break;
- case 'G':
- // Enable generation of ...
- if (av[i][2] == 'C')
- {
- // AMI with Call back.
- be_global->ami_call_back (true);
- }
- else if (av[i][2] == 'T')
- {
- // Generate tie classes and files
- be_global->gen_tie_classes (true);
- }
- else if (av[i][2] == 'H')
- {
- // AMH classes.
- be_global->gen_amh_classes (true);
- }
- else if (av[i][2] == 'A')
- {
- // TAO-team-only, undocumented option to generate
- // Any operators into a separate set of files.
- be_global->gen_anyop_files (true);
- }
- else if (av[i][2] == 'e')
- {
- idl_global->append_idl_flag (av[i + 1]);
- int option = ACE_OS::atoi (av[i + 1]);
-
- // Exception support.
- be_global->exception_support (option == 0
- || option == 2);
-
- // Use of raw 'throw'.
- be_global->use_raw_throw (option == 2);
- ++i;
- }
- else if (av[i][2] == 's')
- {
- if (av[i][3] == 'p')
- {
- // Smart proxies.
- be_global->gen_smart_proxies (true);
- }
- else
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand ")
- ACE_TEXT ("the '%s' option\n"),
- av[i]
- ));
- }
-
- break;
- }
- else if (av[i][2] == 'u')
- {
- if (av[i][3] == 'c')
- {
- // Inline constants.
- be_global->gen_inline_constants (false);
- }
- else
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand ")
- ACE_TEXT ("the '%s' option\n"),
- av[i]
- ));
- }
-
- break;
- }
- else if (av[i][2] == 't')
- {
- // Optimized typecode generation.
- be_global->opt_tc (1);
- }
- else if (av[i][2] == 'p')
- {
- // Generating Thru_POA collocated stubs.
- be_global->gen_thru_poa_collocation (true);
- }
- else if (av[i][2] == 'd')
- {
- if (av[i][3] == 'c')
- {
- if (av[i][4] == 'p' && av[i][5] =='s' && '\0' == av[i][6])
- {
- // DDS DCSP type support.
- be_global->gen_dcps_type_support (true);
- }
- else
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand ")
- ACE_TEXT ("the '%s' option\n"),
- av[i]
- ));
- }
- }
- else if ('\0' == av[i][3])
- {
- // Generating Direct collocated stubs.
- be_global->gen_direct_collocation (true);
- }
- else
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand ")
- ACE_TEXT ("the '%s' option\n"),
- av[i]
- ));
- }
- }
- else if (av[i][2] == 'I')
- {
- size_t options = ACE_OS::strlen (av[i]) - 3;
- size_t j;
- size_t k = i;
- // Generate implementation files.
- be_global->gen_impl_files (1);
-
- for (j = 0; j < options; ++j)
- {
- if (av[k][j + 3] == 's')
- {
- idl_global->append_idl_flag (av[i + 1]);
- be_global->implementation_skel_ending (av[i + 1]);
- ++i;
- }
- else if (av[k][j + 3] == 'h')
- {
- idl_global->append_idl_flag (av[i + 1]);
- be_global->implementation_hdr_ending (av[i + 1]);
- ++i;
- }
- else if (av[k][j + 3] == 'b')
- {
- idl_global->append_idl_flag (av[i + 1]);
- be_global->impl_class_prefix (av[i + 1]);
- ++i;
- }
- else if (av[k][j + 3] == 'e')
- {
- idl_global->append_idl_flag (av[i + 1]);
- be_global->impl_class_suffix (av[i + 1]);
- ++i;
- }
- else if (av[k][j + 3] == 'c')
- {
- be_global->gen_copy_ctor (true);
- }
- else if (av[k][j + 3] == 'a')
- {
- be_global->gen_assign_op (true);
- }
- else if (av[k][j + 3] == 'd')
- {
- be_global->gen_impl_debug_info (true);
- }
- else if (isalpha (av[k][j + 3] ))
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand")
- ACE_TEXT (" the '%s' option\n"),
- av[i]
- ));
-
- idl_global->set_compile_flags (
- idl_global->compile_flags ()
- | IDL_CF_ONLY_USAGE
- );
- }
- }
- }
- else
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand the '%s' option\n"),
- av[i]
- ));
- }
-
- break;
- case 'S':
- // Suppress generation of...
- if (av[i][2] == 'a')
- {
- if (av[i][3] == 'l')
- {
- // Suppress Any support for local interfaces.
- be_global->gen_local_iface_anyops (false);
- }
- else
- {
- // Suppress all Any support.
- be_global->any_support (false);
- }
- }
- else if (av[i][2] == 'o' && av[i][3] == 'r' && av[i][4] =='b' && '\0' == av[i][5])
- {
- be_global->gen_orb_h_include (false);
- }
- else if (av[i][2] == 't')
- {
- // Suppress typecode generation
- // Anys must be suppressed as well.
- be_global->tc_support (false);
- be_global->any_support (false);
- }
- else if (av[i][2] == 'p')
- {
- // Suppress generating Thru_POA collocated stubs.
- be_global->gen_thru_poa_collocation (false);
- }
- else if (av[i][2] == 'd')
- {
- // sSppress generating Direct collocated stubs.
- be_global->gen_direct_collocation (false);
- }
- else if (av[i][2] == 'c')
- {
- if (av[i][3] == 'i')
- {
- // No stub inline.
- be_global->gen_client_inline (false);
- }
- }
- else if (av[i][2] == 'm')
- {
- // Turn off ccm preprocessing.
- idl_global->ignore_idl3 (true);
- }
- else if (av[i][2] == 'S')
- {
- // Disable skeleton file generation.
- be_global->gen_skel_files (false);
- }
- else if (av[i][2] == 's')
- {
- if (av[i][3] == 'i')
- {
- // No skeleton inline.
- be_global->gen_server_inline (false);
- }
- else
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand the '%s' option\n"),
- av[i]
- ));
- }
- }
- else
- {
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand the '%s' option\n"),
- av[i]
- ));
- }
-
- break;
- default:
- ACE_ERROR ((
- LM_ERROR,
- ACE_TEXT ("IDL: I don't understand the '%s' option\n"),
- av[i]
- ));
-
- idl_global->set_compile_flags (idl_global->compile_flags ()
- | IDL_CF_ONLY_USAGE);
- break;
- }
-}
-
-// Prepare an argument for a BE
-void
-BE_GlobalData::prep_be_arg (char *s)
-{
- static const char arg_macro[] = "export_macro=";
- static const char arg_include[] = "export_include=";
- static const char skel_arg_macro[] = "skel_export_macro=";
- static const char skel_arg_include[] = "skel_export_include=";
- static const char stub_arg_macro[] = "stub_export_macro=";
- static const char stub_arg_include[] = "stub_export_include=";
- static const char anyop_arg_macro[] = "anyop_export_macro=";
- static const char anyop_arg_include[] = "anyop_export_include=";
- static const char arg_pch_include[] = "pch_include=";
- static const char arg_pre_include[] = "pre_include=";
- static const char arg_post_include[] = "post_include=";
- static const char arg_versioning_begin[] = "versioning_begin=";
- static const char arg_versioning_end[] = "versioning_end=";
- static const char obv_opt_accessor[] = "obv_opt_accessor";
- static const char include_guard[] = "include_guard=";
- static const char safe_include[] = "safe_include=";
-
- char* last = 0;
-
- for (char* arg = ACE_OS::strtok_r (s, ",", &last);
- arg != 0;
- arg = ACE_OS::strtok_r (0, ",", &last))
- {
- if (ACE_OS::strstr (arg, arg_macro) == arg)
- {
- char* val = arg + sizeof (arg_macro) - 1;
- be_global->skel_export_macro (val);
- be_global->stub_export_macro (val);
- be_global->anyop_export_macro (val);
- }
- else if (ACE_OS::strstr (arg, arg_include) == arg)
- {
- char* val = arg + sizeof (arg_include) - 1;
- be_global->stub_export_include (val);
- }
- else if (ACE_OS::strstr (arg, skel_arg_macro) == arg)
- {
- char* val = arg + sizeof (skel_arg_macro) - 1;
- be_global->skel_export_macro (val);
- }
- else if (ACE_OS::strstr (arg, skel_arg_include) == arg)
- {
- char* val = arg + sizeof (skel_arg_include) - 1;
- be_global->skel_export_include (val);
- }
- else if (ACE_OS::strstr (arg, stub_arg_macro) == arg)
- {
- char* val = arg + sizeof (stub_arg_macro) - 1;
- be_global->stub_export_macro (val);
- }
- else if (ACE_OS::strstr (arg, stub_arg_include) == arg)
- {
- char* val = arg + sizeof (stub_arg_include) - 1;
- be_global->stub_export_include (val);
- }
- else if (ACE_OS::strstr (arg, anyop_arg_macro) == arg)
- {
- char* val = arg + sizeof (anyop_arg_macro) - 1;
- be_global->anyop_export_macro (val);
- }
- else if (ACE_OS::strstr (arg, anyop_arg_include) == arg)
- {
- char* val = arg + sizeof (anyop_arg_include) - 1;
- be_global->anyop_export_include (val);
- }
- else if (ACE_OS::strstr (arg, arg_pch_include) == arg)
- {
- char* val = arg + sizeof (arg_pch_include) - 1;
- be_global->pch_include (val);
- }
- else if (ACE_OS::strstr (arg, arg_pre_include) == arg)
- {
- char* val = arg + sizeof (arg_pre_include) - 1;
- be_global->pre_include (val);
- }
- else if (ACE_OS::strstr (arg, arg_post_include) == arg)
- {
- char* val = arg + sizeof (arg_post_include) - 1;
- be_global->post_include (val);
- }
- else if (ACE_OS::strstr (arg, include_guard) == arg)
- {
- char* val = arg + sizeof (include_guard) - 1;
- be_global->include_guard (val);
- }
- else if (ACE_OS::strstr (arg, safe_include) == arg)
- {
- char* val = arg + sizeof (safe_include) - 1;
- be_global->safe_include (val);
- }
- else if (ACE_OS::strstr (arg, obv_opt_accessor) == arg)
- {
- be_global->obv_opt_accessor (1);
- }
- else if (ACE_OS::strstr (arg, arg_versioning_begin) == arg)
- {
- char const * const val = arg + sizeof (arg_versioning_begin) - 1;
- be_global->versioning_begin (val);
- }
- else if (ACE_OS::strstr (arg, arg_versioning_end) == arg)
- {
- char const * const val = arg + sizeof (arg_versioning_end) - 1;
- be_global->versioning_end (val);
- }
- else
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("%s%s%s%s"),
- idl_global->prog_name (),
- ACE_TEXT (": invalid or unknown argument <"),
- arg,
- ACE_TEXT ("> to back end\n")));
- }
- }
-}
-
-void
-BE_GlobalData::arg_post_proc (void)
-{
- // Let us try to use Perfect Hashing Operation Lookup Strategy. Let
- // us check whether things are fine with GPERF.
-#if defined (ACE_HAS_GPERF)
- // If Perfect Hashing or Binary Search or Linear Search strategies
- // have been selected, let us make sure that it exists and will
- // work.
- if ((be_global->lookup_strategy () == BE_GlobalData::TAO_PERFECT_HASH) ||
- (be_global->lookup_strategy () == BE_GlobalData::TAO_BINARY_SEARCH) ||
- (be_global->lookup_strategy () == BE_GlobalData::TAO_LINEAR_SEARCH))
- {
- // Testing whether GPERF works or no.
- int return_value = idl_global->check_gperf ();
- if (return_value == -1)
- {
- // If gperf_path is an absolute path, try to call this
- // again with
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT ("TAO_IDL: warning, GPERF could not be executed\n")
- ACE_TEXT ("Perfect Hashing or Binary/Linear Search cannot be")
- ACE_TEXT (" done without GPERF\n")
- ACE_TEXT ("Now, using Dynamic Hashing..\n")
- ACE_TEXT ("To use Perfect Hashing or Binary/Linear")
- ACE_TEXT (" Search strategy\n")
- ACE_TEXT ("\t-Build gperf at $ACE_ROOT/apps/gperf/src\n")
- ACE_TEXT ("\t-Set the environment variable $ACE_ROOT")
- ACE_TEXT (" appropriately or add $ACE_ROOT/bin to the PATH\n")
- ACE_TEXT ("\t-Refer to Operation Lookup section in the TAO IDL")
- ACE_TEXT (" User Guide ($TAO_ROOT/docs/compiler.html)")
- ACE_TEXT (" for more details\n")
- ));
-
- // Switching over to Dynamic Hashing.
- be_global->lookup_strategy (BE_GlobalData::TAO_DYNAMIC_HASH);
- }
- }
-#else /* Not ACE_HAS_GPERF */
- // If GPERF is not there, we cannot use PERFECT_HASH strategy. Let
- // us go for DYNAMIC_HASH.
- if ((be_global->lookup_strategy () == BE_GlobalData::TAO_PERFECT_HASH) ||
- (be_global->lookup_strategy () == BE_GlobalData::TAO_BINARY_SEARCH) ||
- (be_global->lookup_strategy () == BE_GlobalData::TAO_LINEAR_SEARCH))
- {
- be_global->lookup_strategy (BE_GlobalData::TAO_DYNAMIC_HASH);
- }
-#endif /* ACE_HAS_GPERF */
-
- // Make sure that we are not suppressing TypeCode generation and asking for
- // optimized typecode support at the same time.
- if (!be_global->tc_support () && be_global->opt_tc ())
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("Bad Combination -St and -Gt \n")));
- }
-}
-
-void
-BE_GlobalData::usage (void) const
-{
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,export_macro=<macro name>\t\t\tsets export macro ")
- ACE_TEXT ("for all files\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,export_include=<include path>\t\tsets export include ")
- ACE_TEXT ("file for all files\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,stub_export_macro=<macro name>\t\tsets export ")
- ACE_TEXT ("macro for client files only\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,stub_export_include=<include path>\t\tsets export ")
- ACE_TEXT ("include file for client only\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,skel_export_macro=<macro name>\t\tsets export ")
- ACE_TEXT ("macro for server files only\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,skel_export_include=<include path>\t\tsets export ")
- ACE_TEXT ("include file for server only\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,anyop_export_macro=<macro name>\t\tsets export macro ")
- ACE_TEXT ("for typecode/Any operator files only, when -GA option ")
- ACE_TEXT ("is used\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,anyop_export_include=<include path>\tsets export ")
- ACE_TEXT ("include file typecode/Any operator files only, when -GA ")
- ACE_TEXT ("option is used\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,pch_include=<include path>\t\t\tsets include ")
- ACE_TEXT ("file for precompiled header mechanism\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,pre_include=<include path>\t\t\tsets include ")
- ACE_TEXT ("file generate before any other includes\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,post_include=<include path>\t\tsets include ")
- ACE_TEXT ("file generated at the end of the file\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,include_guard=<include path>\t\tguard to prevent ")
- ACE_TEXT ("the generated client header file\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,safe_include=<include path>\t\tinclude that should ")
- ACE_TEXT ("be used instead of the own generated client header file\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,obv_opt_accessor\t\t\t\toptimizes access to base class ")
- ACE_TEXT ("data in valuetypes\n")
- ));
-#if (defined (ACE_HAS_VERSIONED_NAMESPACE) \
- && ACE_HAS_VERSIONED_NAMESPACE == 1) \
- || (defined (TAO_HAS_VERSIONED_NAMESPACE) \
- && TAO_HAS_VERSIONED_NAMESPACE == 1)
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,versioning_begin\t\t\tSet text that opens a ")
- ACE_TEXT ("a \"versioned\" namespace\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Wb,versioning_end\t\t\tSet text that closes a ")
- ACE_TEXT ("a \"versioned\" namespace\n")
- ));
-#endif /* ACE_HAS_VERSIONED_NAMESPACE || TAO_HAS_VERSIONED_NAMESPACE */
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -ci\t\t\tClient inline file name ending. Default is C.inl\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -cs\t\t\tClient stub's file name ending.")
- ACE_TEXT (" Default is C.cpp\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -g <gperf_path>\tPath for the GPERF program.")
- ACE_TEXT (" Default is $ACE_ROOT/bin/gperf\n")));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -GC \t\t\tGenerate the AMI classes\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -GH \t\t\tGenerate the AMH classes\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Gd \t\t\tGenerate the code for direct collocation. Default ")
- ACE_TEXT ("is thru-POA collocation\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Ge [0|1]\t\tDisable/Enable generation of")
- ACE_TEXT (" CORBA::Environment arguments (disabled by default")
- ACE_TEXT (" if ACE_HAS_EXCEPTIONS)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Ge 2\t\t\tUse raw throw instead of ACE_THROW macro")
- ACE_TEXT (" (disabled by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -GI[h|s|b|e|c|a|d]\tGenerate Implementation Files \n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" \t\t\th - Implementation header file name ending.")
- ACE_TEXT (" Default is I.h \n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" \t\t\ts - Implementation skeleton file name ending.")
- ACE_TEXT (" Default is I.cpp\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" \t\t\tb - Prefix to the implementation class names.")
- ACE_TEXT (" Default is 'no prefix' \n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" \t\t\te - Suffix to the implementation class names.")
- ACE_TEXT (" Default is _i\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" \t\t\tc - Generate copy constructors in the servant")
- ACE_TEXT (" implementation template files (off by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" \t\t\ta - Generate assignment operators in the servant")
- ACE_TEXT (" implementation template files (off by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" \t\t\td - Generate debug (source file/line#) information.")
- ACE_TEXT (" (off by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Gp \t\t\tGenerate the code for thru-POA collocation")
- ACE_TEXT (" (default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Gsp\t\t\tGenerate the code for Smart Proxies\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Gt\t\t\tenable optimized TypeCode support")
- ACE_TEXT (" (unopt by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -GT\t\t\tgenerate tie class (and file)")
- ACE_TEXT (" generation (disabled by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" \t\t\tNo effect if TypeCode generation is suppressed\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -GA\t\t\tgenerate Any operator and type code bodies in *A.cpp")
- ACE_TEXT (" (generated in *C.cpp by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Guc\t\t\tgenerate uninlined constant if declared ")
- ACE_TEXT ("in a module")
- ACE_TEXT (" (inlined by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -hc\t\t\tClient's header file name ending.")
- ACE_TEXT (" Default is C.h\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -hs\t\t\tServer's header file name ending.")
- ACE_TEXT (" Default is S.h\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -hT\t\t\tServer's template hdr file name ending.")
- ACE_TEXT (" Default is S_T.h\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -H perfect_hash\tTo force perfect hashed operation")
- ACE_TEXT (" lookup strategy (default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -H dynamic_hash\tTo force dynamic hashed operation")
- ACE_TEXT (" lookup strategy. Default is perfect hashing\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -H linear_search\tTo force linear search operation")
- ACE_TEXT (" lookup strategy\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -H binary_search\tTo force binary search operation")
- ACE_TEXT (" lookup strategy\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -in \t\t\tTo generate <>s for standard #include'd")
- ACE_TEXT (" files (non-changing files)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -ic \t\t\tTo generate \"\"s for standard #include'd")
- ACE_TEXT (" files (changing files)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -o <output_dir>\tOutput directory for the generated files.")
- ACE_TEXT (" Default is current directory\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -oS <output_dir>\tOutput directory for the generated ")
- ACE_TEXT ("skeleton files. Default is -o value or current directory\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -oA <output_dir>\tOutput directory for the generated anyop")
- ACE_TEXT ("files. Default is -o value or current directory\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -si\t\t\tServer's inline file name ending.")
- ACE_TEXT (" Default is S.inl\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -ss\t\t\tServer's skeleton file name ending.")
- ACE_TEXT (" Default is S.cpp\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -st\t\t\tServer's template inline file name ending.")
- ACE_TEXT (" Default S_T.inl\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -sT\t\t\tServer's template skeleton file name ending.")
- ACE_TEXT (" Default is S_T.cpp\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Sa\t\t\tsuppress Any support")
- ACE_TEXT (" (support enabled by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Sal\t\t\tsuppress Any support")
- ACE_TEXT (" for local interfaces")
- ACE_TEXT (" (support enabled by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -St\t\t\tsuppress TypeCode support")
- ACE_TEXT (" (support enabled by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Sp\t\t\tsuppress generating Thru POA collocated")
- ACE_TEXT (" stubs (enabled by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Sd\t\t\tsuppress generating Direct collocated")
- ACE_TEXT (" stubs (disable by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Sm\t\t\tdisable IDL3 equivalent IDL preprocessing")
- ACE_TEXT (" (enabled by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -SS\t\t\tsuppress generating skeleton implementation")
- ACE_TEXT (" and inline file (disabled by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Sci\t\t\tsuppress generating client inline file")
- ACE_TEXT (" (disabled by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Ssi\t\t\tsuppress generating server inline file")
- ACE_TEXT (" (disabled by default)\n")
- ));
- ACE_DEBUG ((
- LM_DEBUG,
- ACE_TEXT (" -Sorb\t\t\tsuppress generating include of ORB.h")
- ACE_TEXT (" (disabled by default)\n")
- ));
-}
-
-AST_Generator *
-BE_GlobalData::generator_init (void)
-{
- tao_cg = TAO_CODEGEN::instance ();
- tao_cg->config_visitor_factory ();
-
- AST_Generator *gen = 0;
- ACE_NEW_RETURN (gen,
- be_generator,
- 0);
-
- return gen;
-}
diff --git a/TAO/TAO_IDL/be/be_helper.cpp b/TAO/TAO_IDL/be/be_helper.cpp
deleted file mode 100644
index 65a0a7cc4b4..00000000000
--- a/TAO/TAO_IDL/be/be_helper.cpp
+++ /dev/null
@@ -1,595 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_helper.cpp
-//
-// = DESCRIPTION
-// Provides helper classes to print generated code to the output
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// Improvements by Carlos O'Ryan
-//
-// ============================================================================
-
-#include "be_helper.h"
-#include "be_codegen.h"
-#include "be_extern.h"
-#include "idl_defines.h"
-#include "ace/OS_NS_string.h"
-
-ACE_RCSID (be,
- be_helper,
- "$Id$")
-
-static const char copyright[] =
-"// -*- C++ -*-\n"
-"//\n"
-"// $I" "d$\n\n"
-"// **** Code generated by the The ACE ORB (TAO) IDL Compiler ****\n"
-"// TAO and the TAO IDL Compiler have been developed by:\n"
-"// Center for Distributed Object Computing\n"
-"// Washington University\n"
-"// St. Louis, MO\n"
-"// USA\n"
-"// http://www.cs.wustl.edu/~schmidt/doc-center.html\n"
-"// and\n"
-"// Distributed Object Computing Laboratory\n"
-"// University of California at Irvine\n"
-"// Irvine, CA\n"
-"// USA\n"
-"// http://doc.ece.uci.edu/\n"
-"// and\n"
-"// Institute for Software Integrated Systems\n"
-"// Vanderbilt University\n"
-"// Nashville, TN\n"
-"// USA\n"
-"// http://www.isis.vanderbilt.edu/\n"
-"//\n"
-"// Information about TAO is available at:\n"
-"// http://www.cs.wustl.edu/~schmidt/TAO.html";
-
-TAO_NL::TAO_NL (void)
-{
- ACE_UNUSED_ARG (copyright);
-}
-
-TAO_INDENT::TAO_INDENT (int do_now)
- : do_now_ (do_now)
-{
-}
-
-TAO_UNINDENT::TAO_UNINDENT (int do_now)
- : do_now_ (do_now)
-{
-}
-
-const TAO_NL be_nl;
-const TAO_INDENT be_idt;
-const TAO_INDENT be_idt_nl (1);
-const TAO_UNINDENT be_uidt;
-const TAO_UNINDENT be_uidt_nl (1);
-
-TAO_ENV_ARG::TAO_ENV_ARG (bool with_defaults,
- bool single,
- bool arg,
- bool not_used)
- : with_defaults_ (with_defaults),
- single_ (single),
- arg_ (arg),
- not_used_ (not_used)
-{
-}
-
-const TAO_ENV_ARG env_decl;
-const TAO_ENV_ARG env_dflts (true);
-const TAO_ENV_ARG env_sngl (false, true);
-const TAO_ENV_ARG env_sngl_dflts (true, true);
-const TAO_ENV_ARG env_not (false, false, false, true);
-const TAO_ENV_ARG env_sngl_not (false, true, false, true);
-const TAO_ENV_ARG env_arg (false, false, true);
-const TAO_ENV_ARG env_sngl_arg (false, true, true);
-
-TAO_ACE_CHECK::TAO_ACE_CHECK (const char *retval,
- bool do_return)
- : retval_ (retval),
- do_return_ (retval != 0 || do_return)
-{
-}
-
-TAO_ACE_TRY_CHECK::TAO_ACE_TRY_CHECK (void)
-{
-}
-
-TAO_ACE_ENDTRY::TAO_ACE_ENDTRY (void)
-{
-}
-
-const TAO_ACE_TRY_CHECK ace_try_check;
-const TAO_ACE_ENDTRY ace_endtry;
-
-// Methods of the TAO_OutStream class.
-
-TAO_OutStream::TAO_OutStream (void)
- : fp_ (0),
- indent_level_ (0)
-{
-}
-
-TAO_OutStream::~TAO_OutStream (void)
-{
- // Close the underlying I/O handle only if it exists.
- if (this->fp_ != 0)
- {
- ACE_OS::fclose (this->fp_);
- this->fp_ = 0;
- }
-
- indent_level_ = 0;
-}
-
-int
-TAO_OutStream::open (const char *fname,
- TAO_OutStream::STREAM_TYPE st)
-{
- if (fname != 0)
- {
- // File name exists, open an I/O file handle.
- this->fp_ = ACE_OS::fopen (fname, "w");
-
- if (this->fp_ != 0)
- {
- this->st_ = st;
- // Put the copyright notice. Not for the gperf's temp input
- // file.
- if (st != TAO_OutStream::TAO_GPERF_INPUT)
- {
- ACE_OS::fprintf (this->fp_,
- "%s\n",
- copyright);
-
- ACE_OS::fflush (this->fp_);
- }
-
- return 0;
- }
- else
- {
- return -1;
- }
- }
- else
- {
- return -1;
- }
-}
-
-// Set and get the stream type.
-void
-TAO_OutStream::stream_type (TAO_OutStream::STREAM_TYPE st)
-{
- this->st_ = st;
-}
-
-TAO_OutStream::STREAM_TYPE
-TAO_OutStream::stream_type (void)
-{
- return this->st_;
-}
-
-// Return the underlying lowlevel file pointer.
-// indentation.
-FILE *
-TAO_OutStream::file (void)
-{
- return this->fp_;
-}
-
-int
-TAO_OutStream::incr_indent (unsigned short flag)
-{
- indent_level_++;
-
- if (flag != 0)
- {
- return this->indent ();
- }
- else
- {
- // Do not indent output.
- return 0;
- }
-}
-
-// Indentation
-int
-TAO_OutStream::decr_indent (unsigned short flag)
-{
- this->indent_level_--;
- // Just in case somebody gets "unindent happy".
- if (this->indent_level_ < 0)
- {
- // ACE_DEBUG ((LM_DEBUG, "negative indentation?\n"));
- this->indent_level_ = 0;
- }
- if (flag != 0)
- {
- return this->indent ();
- }
- else
- {
- // Do not indent output.
- return 0;
- }
-}
-
-int
-TAO_OutStream::reset (void)
-{
- this->indent_level_ = 0;
- return 0;
-}
-
-// Indented print.
-int
-TAO_OutStream::indent (void)
-{
- // Based on the current indentation level, leave appropriate number of blank
- // spaces in the output.
- if (this->indent_level_ > 0)
- {
- for (int i = 0; i < this->indent_level_; i++)
- {
- ACE_OS::fprintf (this->fp_, " ");
-#if !defined (ACE_OPENVMS)
- ACE_OS::fflush (this->fp_);
-#endif
- }
- }
-
- return 0;
-}
-
-int
-TAO_OutStream::nl (void)
-{
- ACE_OS::fprintf (this->fp_, "\n");
- this->indent ();
- return 0;
-}
-
-// Macro generation.
-int
-TAO_OutStream::gen_ifdef_macro (const char *flat_name,
- const char *suffix,
- bool add_stream_type_suffix)
-{
- static char macro [NAMEBUFSIZE];
-
- ACE_OS::memset (macro,
- '\0',
- NAMEBUFSIZE);
-
- ACE_OS::sprintf (macro,
- "_%s_",
- tao_cg->upcase (flat_name));
- if (suffix != 0)
- {
- //ACE_OS::sprintf (macro, "%s_%s_", macro, cg->upcase (suffix));
- // Can't have macro on both sides of sprintf
- // I'm not sure if the first strcat of "_" should be here or
- // not, but having it gives the same functionality as the old
- // sprintf call...
- ACE_OS::strcat (macro, "_");
- ACE_OS::strcat (macro, tao_cg->upcase (suffix));
- ACE_OS::strcat (macro, "_");
- }
-
- // Append a suffix representing the stream type.
- if (add_stream_type_suffix)
- switch (this->st_)
- {
- case TAO_OutStream::TAO_CLI_HDR:
- ACE_OS::strcat (macro, "CH_");
- break;
- case TAO_OutStream::TAO_CLI_INL:
- ACE_OS::strcat (macro, "CI_");
- break;
- case TAO_OutStream::TAO_CLI_IMPL:
- ACE_OS::strcat (macro, "CS_");
- break;
- case TAO_OutStream::TAO_SVR_HDR:
- ACE_OS::strcat (macro, "SH_");
- break;
- case TAO_OutStream::TAO_IMPL_HDR:
- ACE_OS::strcat (macro, "IH_");
- break;
- case TAO_OutStream::TAO_IMPL_SKEL:
- ACE_OS::strcat (macro, "IS_");
- break;
- case TAO_OutStream::TAO_SVR_INL:
- ACE_OS::strcat (macro, "SI_");
- break;
- case TAO_OutStream::TAO_SVR_IMPL:
- ACE_OS::strcat (macro, "SS_");
- break;
- default:
- return -1;
- }
-
- *this << "\n\n#if !defined (" << macro << ")\n";
- *this << "#define " << macro;
-
- return 0;
-}
-
-int
-TAO_OutStream::gen_endif (void)
-{
- *this << "\n\n#endif /* end #if !defined */";
-
- return 0;
-}
-
-// Printf style variable argument print.
-int
-TAO_OutStream::print (const char *format, ...)
-{
- int result = 0;
- va_list ap;
- va_start (ap, format);
- ACE_OSCALL (::vfprintf (this->fp_,
- format,
- ap),
- int,
- -1,
- result);
-#if !defined (ACE_OPENVMS)
- ACE_OS::fflush (this->fp_);
-#endif
- va_end (ap);
-
- return result;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const char *str)
-{
- ACE_OS::fprintf (this->fp_, "%s", str);
-#if !defined (ACE_OPENVMS)
- ACE_OS::fflush (this->fp_);
-#endif
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const ACE_CDR::UShort num)
-{
- ACE_OS::fprintf (this->fp_,
- "%hu",
- num);
-
-#if !defined (ACE_OPENVMS)
- ACE_OS::fflush (this->fp_);
-#endif
-
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const ACE_CDR::Short num)
-{
- ACE_OS::fprintf (this->fp_,
- "%hd",
- num);
-
-#if !defined (ACE_OPENVMS)
- ACE_OS::fflush (this->fp_);
-#endif
-
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const ACE_CDR::ULong num)
-{
- ACE_OS::fprintf (this->fp_,
- "%lu",
- (unsigned long) num);
-
-#if !defined (ACE_OPENVMS)
- ACE_OS::fflush (this->fp_);
-#endif
-
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const ACE_CDR::Long num)
-{
- ACE_OS::fprintf (this->fp_,
- "%ld",
- (long) num);
-
-#if !defined (ACE_OPENVMS)
- ACE_OS::fflush (this->fp_);
-#endif
-
- return *this;
-}
-
-#if defined (ACE_WIN64)
-TAO_OutStream &
-TAO_OutStream::operator<< (const ACE_CDR::ULongLong num)
-{
- ACE_OS::fprintf (this->fp_,
- ACE_UINT64_FORMAT_SPECIFIER,
- num);
-
-#if !defined (ACE_OPENVMS)
- ACE_OS::fflush (this->fp_);
-#endif
-
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const ACE_CDR::LongLong num)
-{
- ACE_OS::fprintf (this->fp_,
- ACE_INT64_FORMAT_SPECIFIER,
- num);
-
-#if !defined (ACE_OPENVMS)
- ACE_OS::fflush (this->fp_);
-#endif
-
- return *this;
-}
-#endif /* ACE_WIN64 */
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const unsigned long num)
-{
- ACE_OS::fprintf (this->fp_,
- "%lu",
- num);
-
-#if !defined (ACE_OPENVMS)
- ACE_OS::fflush (this->fp_);
-#endif
-
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const long num)
-{
- ACE_OS::fprintf (this->fp_,
- "%ld",
- num);
-
-#if !defined (ACE_OPENVMS)
- ACE_OS::fflush (this->fp_);
-#endif
-
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const TAO_NL&)
-{
- ACE_OS::fprintf (this->fp_ ,
- "\n");
- this->indent ();
-
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const TAO_INDENT& i)
-{
- this->incr_indent (0);
-
- if (i.do_now_)
- {
- this->nl ();
- }
-
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const TAO_UNINDENT& i)
-{
- this->decr_indent (0);
-
- if (i.do_now_)
- {
- this->nl ();
- }
-
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const TAO_ENV_ARG& i)
-{
- if (!be_global->use_raw_throw ())
- {
- (*this) << be_nl
- << "ACE_ENV_"
- << (i.single_ ? "SINGLE_" : "")
- << "ARG_"
- << (i.arg_ ? "PARAMETER" : "DECL")
- << (i.with_defaults_ ? "_WITH_DEFAULTS" : "")
- << (i.not_used_ ? "_NOT_USED" : "");
- }
-
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const TAO_ACE_CHECK& i)
-{
- if (!be_global->use_raw_throw ())
- {
- (*this) << be_nl
- << "ACE_CHECK"
- << (i.do_return_ ? "_RETURN (" : "")
- << (i.retval_ ? i.retval_ : "")
- << (i.do_return_ ? ")" : "")
- << ";";
- }
-
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const TAO_ACE_TRY_CHECK&)
-{
- if (!be_global->use_raw_throw ())
- {
- (*this) << be_nl
- << "ACE_TRY_CHECK;";
- }
-
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const TAO_ACE_ENDTRY&)
-{
- if (!be_global->use_raw_throw ())
- {
- (*this) << be_nl
- << "ACE_ENDTRY;";
- }
-
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (Identifier *id)
-{
- return this->print (id);
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (UTL_IdList *id)
-{
- return this->print (id);
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (AST_Expression *expr)
-{
- return this->print (expr);
-}
diff --git a/TAO/TAO_IDL/be/be_home.cpp b/TAO/TAO_IDL/be/be_home.cpp
deleted file mode 100644
index f7ddaac8f5e..00000000000
--- a/TAO/TAO_IDL/be/be_home.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_home.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Home that provides additional means for C++
-// mapping of a component home.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-#include "be_home.h"
-#include "be_component.h"
-#include "be_interface_strategy.h"
-#include "be_visitor.h"
-#include "global_extern.h"
-#include "utl_err.h"
-
-ACE_RCSID (be,
- be_home,
- "$Id$")
-
-be_home::be_home (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- UTL_Scope (),
- AST_Interface (),
- AST_Home (),
- be_scope (),
- be_type (),
- be_interface ()
-{
- this->size_type (AST_Type::VARIABLE);
-}
-
-be_home::be_home (UTL_ScopedName *n,
- AST_Home *base_home,
- AST_Component *managed_component,
- AST_ValueType *primary_key,
- AST_Interface **supports,
- long n_supports,
- AST_Interface **supports_flat,
- long n_supports_flat)
- : COMMON_Base (false,
- false),
- AST_Decl (AST_Decl::NT_home,
- n),
- AST_Type (AST_Decl::NT_home,
- n),
- UTL_Scope (AST_Decl::NT_home),
- AST_Interface (n,
- supports,
- n_supports,
- supports_flat,
- n_supports_flat,
- false,
- false),
- AST_Home (n,
- base_home,
- managed_component,
- primary_key,
- supports,
- n_supports,
- supports_flat,
- n_supports_flat),
- be_scope (AST_Decl::NT_home),
- be_type (AST_Decl::NT_home,
- n),
- be_interface (n,
- supports,
- n_supports,
- supports_flat,
- n_supports_flat,
- false,
- false)
-{
- this->size_type (AST_Type::VARIABLE);
-
- // Some previous error may have caused a lookup failure, in which
- // case we'll crash if we do the narrow below.
- if (managed_component == 0)
- {
- idl_global->set_err_count (idl_global->err_count () + 1);
- return;
- }
-
- be_component *bt =
- be_component::narrow_from_decl (managed_component);
-
- bt->seen_in_operation (true);
-
- idl_global->object_arg_seen_ = true;
-}
-
-be_home::~be_home (void)
-{
-}
-
-void
-be_home::destroy (void)
-{
- // Skip be_interface, since our decls were added to
- // the equivalent interface and will get destroyed
- // there.
- if (this->strategy_ != 0)
- {
- this->strategy_->destroy ();
- delete this->strategy_;
- this->strategy_ = 0;
- }
-
- this->be_scope::destroy ();
- this->be_type::destroy ();
-
- // This skips AST_Interface, for the reason above.
- this->AST_Home::destroy ();
-}
-
-int
-be_home::accept (be_visitor *visitor)
-{
- if (idl_global->ignore_idl3 ())
- {
- idl_global->err ()->ignore_idl3_error (this);
- return -1;
- }
-
- return visitor->visit_home (this);
-}
-
-// Narrowing
-IMPL_NARROW_METHODS2 (be_home, be_interface, AST_Home)
-IMPL_NARROW_FROM_DECL (be_home)
-IMPL_NARROW_FROM_SCOPE (be_home)
diff --git a/TAO/TAO_IDL/be/be_init.cpp b/TAO/TAO_IDL/be/be_init.cpp
deleted file mode 100644
index 65fee2a4821..00000000000
--- a/TAO/TAO_IDL/be/be_init.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-// $Id$
-
-#include "global_extern.h"
-#include "be_extern.h"
-#include "../../tao/Version.h"
-
-TAO_IDL_BE_Export void
-BE_version (void)
-{
- ACE_DEBUG ((LM_DEBUG,
- "%s %s\n",
- ACE_TEXT ("TAO_IDL_BE, version"),
- ACE_TEXT (TAO_VERSION)));
-}
-
-TAO_IDL_BE_Export int
-BE_init (int &, char *[])
-{
- // Initialize BE global data object.
- ACE_NEW_RETURN (be_global,
- BE_GlobalData,
- -1);
-
- return 0;
-}
-
-TAO_IDL_BE_Export void
-BE_post_init (char *[], long)
-{
-}
-
diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp
deleted file mode 100644
index 511abe72f82..00000000000
--- a/TAO/TAO_IDL/be/be_interface.cpp
+++ /dev/null
@@ -1,2657 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_interface.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Interface that provides additional means for C++
-// mapping of an interface.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale,
-// Michael Kircher
-//
-// ============================================================================
-
-#include "be_interface.h"
-#include "be_interface_strategy.h"
-#include "be_attribute.h"
-#include "be_operation.h"
-#include "be_exception.h"
-#include "be_visitor.h"
-#include "be_helper.h"
-#include "be_stream_factory.h"
-#include "be_extern.h"
-#include "utl_identifier.h"
-#include "utl_exceptlist.h"
-#include "ast_generator.h"
-#include "ast_component.h"
-#include "global_extern.h"
-#include "idl_defines.h"
-#include "nr_extern.h"
-
-#include "ace/Process.h"
-#include "ace/OS_NS_time.h"
-#include "ace/OS_NS_unistd.h"
-#include "ace/OS_NS_fcntl.h"
-
-ACE_RCSID (be,
- be_interface,
- "$Id$")
-
-// Default constructor.
-be_interface::be_interface (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- UTL_Scope (),
- AST_Interface (),
- be_scope (),
- be_type (),
- var_out_seq_decls_gen_ (0),
- skel_count_ (0),
- in_mult_inheritance_ (-1),
- strategy_ (0),
- original_interface_ (0),
- has_mixed_parentage_ (-1),
- session_component_child_ (-1)
-{
- ACE_NEW (this->strategy_,
- be_interface_default_strategy (this));
-}
-
-// Constructor used to build the AST.
-be_interface::be_interface (UTL_ScopedName *n,
- AST_Interface **ih,
- long nih,
- AST_Interface **ih_flat,
- long nih_flat,
- bool local,
- bool abstract)
- : COMMON_Base (local,
- abstract),
- AST_Decl (AST_Decl::NT_interface,
- n),
- AST_Type (AST_Decl::NT_interface,
- n),
- UTL_Scope (AST_Decl::NT_interface),
- AST_Interface (n,
- ih,
- nih,
- ih_flat,
- nih_flat,
- local,
- abstract),
- be_scope (AST_Decl::NT_interface),
- be_type (AST_Decl::NT_interface,
- n),
- var_out_seq_decls_gen_ (0),
- skel_count_ (0),
- in_mult_inheritance_ (-1),
- strategy_ (0),
- original_interface_ (0),
- has_mixed_parentage_ (-1),
- session_component_child_ (-1)
-{
- ACE_NEW (this->strategy_,
- be_interface_default_strategy (this));
-
- if (this->imported () || this->node_type () == AST_Decl::NT_valuetype)
- {
- return ;
- }
-
- if (this->is_defined ())
- {
- // Set the flag that says we have a interface in this IDL file.
- idl_global->interface_seen_ = true;
-
- if (abstract || this->has_mixed_parentage ())
- {
- // Set the flag for abstract interface seen in this IDL file.
- idl_global->abstract_iface_seen_ = true;
- }
-
- if (local)
- {
- // Set the flag for local interface seen in this IDL file.
- idl_global->local_iface_seen_ = true;
- }
- else
- {
- // Set the flag for non-local interface seen in this IDL file.
- idl_global->non_local_iface_seen_ = true;
- }
- }
- else
- {
- // Forward declared non-defined interface. Still gets a _var decl.
- idl_global->fwd_iface_seen_ = true;
- }
-}
-
-be_interface::~be_interface (void)
-{
-}
-
-be_interface_strategy *
-be_interface::set_strategy (be_interface_strategy *new_strategy)
-{
- be_interface_strategy *old = this->strategy_;
-
- if (new_strategy != 0)
- {
- this->strategy_ = new_strategy;
- }
-
- return old;
-}
-
-
-const char *
-be_interface::local_name (void) const
-{
- // Return the local name.
- return this->strategy_->local_name ();
-}
-
-const char *
-be_interface::full_name (void)
-{
- return this->strategy_->full_name ();
-}
-
-const char *
-be_interface::flat_name (void)
-{
- // Return the flattened full scoped name.
- return this->strategy_->flat_name ();
-}
-
-const char *
-be_interface::repoID (void) const
-{
- // Retrieve the repository ID.
- return this->strategy_->repoID ();
-}
-
-const char *
-be_interface::full_skel_name (void) const
-{
- // Retrieve the fully scoped skel class name.
- return this->strategy_->full_skel_name ();
-}
-
-const char *
-be_interface::full_coll_name (int type) const
-{
- // Retrieve the fully qualified collocated class name
- return this->strategy_->full_coll_name (type);
-}
-
-const char *
-be_interface::local_coll_name (int type) const
-{
- // Retrieve the fully qualified collocated class name.
- return this->strategy_->local_coll_name (type);
-}
-
-const char *
-be_interface::relative_skel_name (const char *skel_name)
-{
- // Relative skeleton name.
- return this->strategy_->relative_skel_name (skel_name);
-}
-
-
-void
-be_interface::compute_full_skel_name (const char *prefix,
- char *&skelname)
-{
- if (skelname != 0)
- {
- return;
- }
- else
- {
- size_t namelen = ACE_OS::strlen (prefix);
- long first = true;
- long second = false;
- char *item_name = 0;
-
- // In the first loop compute the total length.
- for (UTL_IdListActiveIterator i (this->name ());
- !i.is_done ();
- i.next ())
- {
- if (!first)
- {
- namelen += 2; // for "::"
- }
- else if (second)
- {
- first = second = false;
- }
-
- // Print the identifier.
- item_name = i.item ()->get_string ();
- namelen += ACE_OS::strlen (item_name);
-
- // Additional 4 for the POA_ characters.
- if (first)
- {
- if (ACE_OS::strcmp (item_name, "") != 0)
- {
- // Does not start with a "".
- first = false;
- }
- else
- {
- second = true;
- }
- }
- }
-
- ACE_NEW (skelname,
- char [namelen+1]);
- skelname[0] = '\0';
- first = true;
- second = false;
- ACE_OS::strcat (skelname, prefix);
-
- for (UTL_IdListActiveIterator j (this->name ());
- !j.is_done ();
- j.next ())
- {
- if (!first)
- {
- ACE_OS::strcat (skelname, "::");
- }
- else if (second)
- {
- first = second = false;
- }
-
- // Print the identifier.
- item_name = j.item ()->get_string ();
- ACE_OS::strcat (skelname, item_name);
-
- if (first)
- {
- if (ACE_OS::strcmp (item_name, "") != 0)
- {
- // Does not start with a "".
- first = false;
- }
- else
- {
- second = true;
- }
- }
- }
- }
-}
-
-const char*
-be_interface::relative_name (const char *localname,
- const char *othername)
-{
- // Some compilers do not like generating a fully scoped name for a
- // type that was defined in the same enclosing scope in which it was
- // defined. We have to emit just the partial name, relative to our
- // "localname".
-
- // The tricky part here is that it is not enough to check if the
- // typename we are using was defined in the current scope. But we
- // need to ensure that it was not defined in any of our ancestor
- // scopes as well. If that is the case, then we can generate a fully
- // scoped name for that type, else we use the ACE_NESTED_CLASS macro.
-
- // Thus we need some sort of relative name to be generated.
-
- static char macro [NAMEBUFSIZE];
-
- // Hold the fully scoped name.
- char def_name [NAMEBUFSIZE];
- char use_name [NAMEBUFSIZE];
-
- // These point to the curr and next component in the scope.
- char *def_curr = def_name;
- char *def_next;
- char *use_curr = use_name;
- char *use_next;
-
- ACE_OS::memset (macro,
- '\0',
- NAMEBUFSIZE);
- ACE_OS::memset (def_name,
- '\0',
- NAMEBUFSIZE);
- ACE_OS::memset (use_name,
- '\0',
- NAMEBUFSIZE);
-
- // Traverse every component of the def_scope and use_scope beginning at the
- // root and proceeding towards the leaf trying to see if the components
- // match. Continue until there is a match and keep accumulating the path
- // traversed. This forms the first argument to the ACE_NESTED_CLASS
- // macro. Whenever there is no match, the remaining components of the
- // def_scope form the second argument.
-
- ACE_OS::strcpy (def_name,
- localname);
- ACE_OS::strcpy (use_name,
- othername);
-
- while (def_curr && use_curr)
- {
- // Find the first occurrence of a ::
- // and advance the next pointers accordingly.
- def_next = ACE_OS::strstr (def_curr, "::");
- use_next = ACE_OS::strstr (use_curr, "::");
-
- if (def_next)
- {
- *def_next = 0;
- }
-
- if (use_next)
- {
- *use_next = 0;
- }
-
- if (!ACE_OS::strcmp (def_curr, use_curr))
- {
- // They have same prefix, append to arg1.
- def_curr = (def_next ? (def_next+2) : 0); // Skip the ::
- use_curr = (use_next ? (use_next+2) : 0); // Skip the ::
- }
- else
- {
- // We had overwritten a ':' by a '\0' for string comparison. We
- // revert back because we want the rest of the relative name to be
- // used.
- if (def_next)
- {
- *def_next = ':';
- }
-
- if (use_next)
- {
- *use_next = ':';
- }
-
- // No match. This is the end of the first argument. Get out
- // of the loop as no more comparisons are necessary.
- break;
- }
- }
-
- // Start the 2nd argument of the macro.
-
- // Copy the remaining def_name (if any left)
- if (def_curr)
- {
- ACE_OS::strcat (macro,
- def_curr);
- }
-
- return macro;
-}
-
-
-// Am I in some kind of a multiple inheritance?
-int
-be_interface::in_mult_inheritance (void)
-{
- if (this->in_mult_inheritance_ == -1)
- {
- // Compute once for all.
- // Determine if we are in some form of a multiple inheritance.
- if (this->traverse_inheritance_graph (
- be_interface::in_mult_inheritance_helper,
- 0
- ) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_interface::in_mult_inheritance "
- "error determining mult inheritance\n"),
- -1);
- }
- }
-
- return this->in_mult_inheritance_;
-}
-
-void
-be_interface::in_mult_inheritance (int mi)
-{
- if (this->in_mult_inheritance_ == -1)
- {
- this->in_mult_inheritance_ = mi;
- }
-}
-
-void
-be_interface::redefine (AST_Interface *from)
-{
- be_interface *bi = be_interface::narrow_from_decl (from);
- this->var_out_seq_decls_gen_ = bi->var_out_seq_decls_gen_;
- this->has_mixed_parentage_ = bi->has_mixed_parentage_;
-
- if (bi->has_mixed_parentage_)
- {
- ACE_Unbounded_Queue<be_interface *> &q =
- be_global->mixed_parentage_interfaces;
- size_t slot = 0;
- be_interface **t = 0;
-
- // The queue of interfaces with mixed parentage must
- // replace each interface that has been forward
- // declared, since the pointer existing in the queue
- // will be deleted after redefine() returns.
- for (slot = 0; slot < q.size (); ++slot)
- {
- (void) q.get (t, slot);
-
- if (*t == bi)
- {
- (void) q.set (this, slot);
- break;
- }
- }
- }
-
- AST_Interface::redefine (from);
-}
-
-// Generate default constructors.
-void
-be_interface::gen_def_ctors (TAO_OutStream *os)
-{
- this->traverse_inheritance_graph (
- be_interface::gen_def_ctors_helper,
- os
- );
-
- return;
-}
-
-
-int
-be_interface::gen_def_ctors_helper (be_interface* node,
- be_interface* base,
- TAO_OutStream *os)
-{
-
- static int first = 0;
-
- if (node != base)
- {
- if (first)
- {
- *os << be_global->impl_class_prefix () << base->flat_name ()
- << be_global->impl_class_suffix () << " ()";
-
- first = 0;
- }
- else
- {
- *os << ", " << be_global->impl_class_prefix () << base->flat_name ()
- << be_global->impl_class_suffix () << " ()";
- }
- }
- else
- {
- *os << ":";
- first = 1;
- }
-
- return 1;
-}
-
-
-void
-be_interface::gen_stub_ctor (TAO_OutStream *os)
-{
- // Generate the constructor from stub and servant.
- if (!this->is_local ())
- {
- *os << be_nl << be_nl
- << "ACE_INLINE" << be_nl;
- *os << this->name () << "::"
- << this->local_name () << " ("
- << be_idt << be_idt_nl
- << "TAO_Stub *objref," << be_nl
- << "::CORBA::Boolean _tao_collocated," << be_nl
- << "TAO_Abstract_ServantBase *servant," << be_nl
- << "TAO_ORB_Core *oc" << be_uidt_nl
- << ")" << be_nl
- << ": ";
-
- bool the_check =
- (this->has_mixed_parentage_
- && !this->is_abstract_
- && this->pd_n_inherits > 0
- && this->pd_inherits[0]->is_abstract ())
- || this->is_abstract_;
-
- if (this->has_mixed_parentage_)
- {
- *os << "::CORBA::"
- << (the_check ? "AbstractBase" : "Object")
- << " ("
- << be_idt << be_idt << be_idt_nl
- << "objref," << be_nl
- << "_tao_collocated," << be_nl
- << "servant"
- << (the_check ? "" : ", oc") << be_uidt_nl
- << ")" << be_uidt;
-
- if (!the_check)
- {
- *os << "," << be_nl
- << "::CORBA::AbstractBase ("
- << be_idt << be_idt_nl
- << "objref," << be_nl
- << "_tao_collocated," << be_nl
- << "servant"
- << (the_check ? ", oc" : "") << be_uidt_nl
- << ")" << be_uidt;
- }
-
- int status =
- this->traverse_inheritance_graph (
- be_interface::gen_abstract_init_helper,
- os,
- true
- );
-
- if (status == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "be_interface::gen_stub_ctor - "
- "inheritance graph traversal failed\n"));
- }
- }
- else
- {
- *os << be_idt;
- }
-
- if (the_check && !this->is_abstract_)
- {
- *os << "," << be_uidt_nl;
- }
-
- if (!this->is_abstract_
- && (!this->has_mixed_parentage_ || the_check))
- {
- *os << "::CORBA::Object (objref, _tao_collocated, servant, oc)";
- }
-
- *os << "," << be_nl
- << "the"<< this->base_proxy_broker_name () << "_ (0)"
- << be_uidt << be_uidt;
-
- *os << be_nl << "{" << be_idt_nl
- << "this->" << this->flat_name ()
- << "_setup_collocation ();";
-
- if (this->is_abstract ())
- {
- *os << be_nl
- << "ACE_UNUSED_ARG (oc);";
- }
-
- *os << be_uidt_nl
- << "}";
- }
-}
-
-// Generate the forward declarations and static methods used by the
-// interface _var and _out template classes, as well as by the
-// template sequence classes for object references.
-void
-be_interface:: gen_var_out_seq_decls (void)
-{
- if (this->var_out_seq_decls_gen_ == 1)
- {
- return;
- }
-
- const char *lname = this->local_name ();
- TAO_OutStream *os = tao_cg->client_header ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Generate the ifdefined macro for this interface.
- os->gen_ifdef_macro (this->flat_name (),
- "var_out");
-
- *os << be_nl << be_nl
- << "class " << lname << ";" << be_nl
- << "typedef " << lname << " *" << lname << "_ptr;";
-
- *os << be_nl << be_nl
- << "typedef" << be_idt_nl
- << "TAO_Objref_Var_T<" << be_idt << be_idt_nl
- << lname << be_uidt_nl
- << ">" << be_uidt_nl
- << lname << "_var;" << be_uidt_nl << be_nl
- << "typedef" << be_idt_nl
- << "TAO_Objref_Out_T<" << be_idt << be_idt_nl
- << lname << be_uidt_nl
- << ">" << be_uidt_nl
- << lname << "_out;" << be_uidt;
-
- os->gen_endif ();
-
- this->var_out_seq_decls_gen_ = 1;
-}
-
-// ****************************************************************
-
-TAO_IDL_Inheritance_Hierarchy_Worker::~TAO_IDL_Inheritance_Hierarchy_Worker (
- void
- )
-{
-}
-
-// =================================================================
-
-class TAO_IDL_Gen_OpTable_Worker
- : public TAO_IDL_Inheritance_Hierarchy_Worker
-{
-public:
- TAO_IDL_Gen_OpTable_Worker (const char *skeleton_name);
-
- virtual int emit (be_interface *derived_interface,
- TAO_OutStream *os,
- be_interface *base_interface);
-
-private:
- const char *skeleton_name_;
-};
-
-TAO_IDL_Gen_OpTable_Worker::TAO_IDL_Gen_OpTable_Worker (
- const char *skeleton_name
- )
- : skeleton_name_ (skeleton_name)
-{
-}
-
-int
-TAO_IDL_Gen_OpTable_Worker::emit (be_interface *derived_interface,
- TAO_OutStream *os,
- be_interface *base_interface)
-{
- // Generate entries for the derived class using the properties of its
- // ancestors.
- be_interface *bi = be_interface::narrow_from_decl (base_interface);
- return bi->gen_optable_entries (derived_interface,
- this->skeleton_name_,
- os);
-}
-
-// =================================================================
-
-class Pure_Virtual_Regenerator
- : public TAO_IDL_Inheritance_Hierarchy_Worker
-{
-public:
- Pure_Virtual_Regenerator (be_visitor *visitor);
-
- virtual int emit (be_interface *derived_interface,
- TAO_OutStream *os,
- be_interface *base_interface);
-
-private:
- be_visitor *visitor_;
-};
-
-Pure_Virtual_Regenerator::Pure_Virtual_Regenerator (
- be_visitor *visitor
- )
- : visitor_ (visitor)
-{
-}
-
-// We don't use the output stream in the signature but instead
-// pass the visitor member (which is always be_visitor_operation_ch)
-// to each iterator item, and (almost, see below) everything else
-// is automatic.
-int
-Pure_Virtual_Regenerator::emit (be_interface *derived_interface,
- TAO_OutStream *,
- be_interface *base_interface)
-{
- if (derived_interface == base_interface)
- {
- return 0;
- }
-
- // If the parent is local, it will already have its operations declared
- // as pure virtual, and if it's abstract, its operations will already
- // be generated as pure virtual for the derived local interface.
- if (base_interface->is_local () || base_interface->is_abstract ())
- {
- return 0;
- }
-
- be_decl *d = 0;
-
- for (UTL_ScopeActiveIterator si (base_interface, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- d = be_decl::narrow_from_decl (si.item ());
-
- if (d->node_type () == AST_Decl::NT_op)
- {
- // Hack to force the generation of the pure virtual ' = 0'
- // at the end of the operation declaration.
- d->set_local (true);
-
- if (d->accept (this->visitor_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) Pure_Virtual_Regenerator::emit - "
- "visit base interface operation failed\n"),
- -1);
- }
-
- d->set_local (false);
- }
- }
-
- return 0;
-}
-
-// =================================================================
-
-int
-be_interface::gen_operation_table (const char *flat_name,
- const char *skeleton_class_name)
-{
- // Check out the op_lookup_strategy.
- switch (be_global->lookup_strategy ())
- {
- case BE_GlobalData::TAO_DYNAMIC_HASH:
- {
- this->skel_count_ = 0;
- // Init the outstream appropriately.
- TAO_OutStream *os = this->strategy_->get_out_stream ();
-
- // Start from current indentation level.
- os->indent ();
-
- // Start the table generation.
- *os << be_nl << be_nl
- << "static const TAO_operation_db_entry " << flat_name
- << "_operations [] = {" << be_idt_nl;
-
- // Make sure the queues are empty.
- this->insert_queue.reset ();
- this->del_queue.reset ();
-
- // Insert ourselves in the queue.
- if (insert_queue.enqueue_tail (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::gen_operation_table - "
- "error generating entries\n"),
- -1);
- }
-
- // Traverse the graph.
- TAO_IDL_Gen_OpTable_Worker worker (skeleton_class_name);
-
- if (this->traverse_inheritance_graph (worker, os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::gen_operation_table - "
- "inheritance graph traversal failed\n"), -1);
- }
-
- // Generate the skeleton for the is_a method.
- *os << "{\"_is_a\", &" << skeleton_class_name
- << "::_is_a_skel, 0}," << be_nl;
-
- this->skel_count_++;
-
- *os << "{\"_non_existent\", &" << skeleton_class_name
- << "::_non_existent_skel, 0}," << be_nl;
-
- this->skel_count_++;
-
- *os << "{\"_component\", &" << skeleton_class_name
- << "::_component_skel, 0}," << be_nl;
-
- this->skel_count_++;
-
- *os << "{\"_interface\", &" << skeleton_class_name
- << "::_interface_skel, 0}," << be_nl;
-
- this->skel_count_++;
-
- *os << "{\"_repository_id\", &" << skeleton_class_name
- << "::_repository_id_skel, 0}" << be_uidt_nl;
-
- this->skel_count_++;
-
- *os << "};" << be_nl << be_nl;
- *os << "static const ::CORBA::Long _tao_" << flat_name
- << "_optable_size = sizeof (ACE_Hash_Map_Entry<const char *,"
- << " TAO::Operation_Skeletons>) * (" << (3 * this->skel_count_)
- << ");" << be_nl;
- *os << "static char _tao_" << flat_name << "_optable_pool "
- << "[_tao_" << flat_name << "_optable_size];" << be_nl;
- *os << "static ACE_Static_Allocator_Base _tao_" << flat_name
- << "_allocator (_tao_" << flat_name << "_optable_pool, "
- << "_tao_" << flat_name << "_optable_size);" << be_nl;
- *os << "static TAO_Dynamic_Hash_OpTable tao_"
- << flat_name << "_optable " << "(" << be_idt << be_idt_nl
- << flat_name << "_operations," << be_nl
- << this->skel_count_ << "," << be_nl
- << 2 * this->skel_count_ << "," << be_nl
- << "&_tao_" << flat_name << "_allocator" << be_uidt_nl
- << ");" << be_uidt_nl;
- }
- break;
-
- case BE_GlobalData::TAO_LINEAR_SEARCH:
- // For generating linear search also, we are calling GPERF
- // only.
- case BE_GlobalData::TAO_BINARY_SEARCH:
- // For generating binary search also, we are calling GPERF
- // only.
- case BE_GlobalData::TAO_PERFECT_HASH:
- // For each interface in the IDL, have a new temp file to
- // collect the input for the gperf program.
- {
- // Temp file name.
- // We must randomize this a bit in order to avoid problems with
- // processing more than one idl file (in separate processes) with
- // the same name (in different directories).
- char *temp_file = 0;
- ACE_NEW_RETURN (temp_file,
- char [ACE_OS::strlen (idl_global->temp_dir ())
- + 11 // The number of possible digits in
- // a 32-bit number plus a dot
- + ACE_OS::strlen (flat_name)
- + ACE_OS::strlen (".gperf")
- + 1],
- -1);
-
- // This degree of randomness is necessary because there was an
- // obscure chance of even this arriving at colliding filenames
- // on multiprocessor machines when the IDL compiler was run at
- // exactly the same time.
- ACE_RANDR_TYPE seed =
- (static_cast<ACE_RANDR_TYPE> (ACE_OS::time())
- + static_cast<ACE_RANDR_TYPE> (ACE_OS::getpid ()));
- ACE_OS::sprintf (temp_file,
- "%s%d.%s.gperf",
- idl_global->temp_dir (),
- ACE_OS::rand_r (seed),
- flat_name);
-
- // QNX can't handle individual file names (path components)
- // longer than 48 characters.
-#if defined(__QNX__)
- size_t temp_dir_len = ACE_OS::strlen (idl_global->temp_dir ());
-
- if (ACE_OS::strlen (temp_file) > temp_dir_len + 47)
- {
- temp_file[temp_dir_len + 47] = 0;
- }
-#endif /* defined(__QNX__) */
-
- // Save this file name with the codegen singleton.
- tao_cg->gperf_input_filename (temp_file);
-
- // Make a new outstream to hold the gperf_temp_file for this
- // interface.
-
- // Retrieve the singleton instance to the outstream factory.
- TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance ();
-
- // Get a new instance for the temp file.
- TAO_OutStream *os = factory->make_outstream ();
-
- if (os == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss"
- "::"
- "visit_interface-"
- "make_outstream failed\n"),
- -1);
- }
-
- // Store the outstream with the codegen singleton.
- tao_cg->gperf_input_stream (os);
-
- // Open the temp file.
- if (os->open (temp_file,
- TAO_OutStream::TAO_GPERF_INPUT) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss"
- "::"
- "visit_interface-"
- "gperf_input.tmp file open failed\n"),
- -1);
- }
-
- // Add the gperf input header.
- this->gen_gperf_input_header (os);
-
- // Make sure the queues are empty.
- this->insert_queue.reset ();
- this->del_queue.reset ();
-
- // Insert ourselves in the queue.
- if (insert_queue.enqueue_tail (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::gen_operation_table - "
- "error generating entries\n"),
- -1);
- }
-
- // Traverse the graph.
- TAO_IDL_Gen_OpTable_Worker worker (skeleton_class_name);
-
- if (this->traverse_inheritance_graph (worker, os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::gen_operation_table - "
- "inheritance graph traversal failed\n"),
- -1);
- }
-
- *os << "_is_a,&"
- << skeleton_class_name
- << "::_is_a_skel, 0" << be_nl;
-
- this->skel_count_++;
-
- *os << "_non_existent,&"
- << skeleton_class_name
- << "::_non_existent_skel, 0" << be_nl;
-
- this->skel_count_++;
-
- *os << "_component,&"
- << skeleton_class_name
- << "::_component_skel, 0" << be_nl;
- this->skel_count_++;
-
- *os << "_interface,&"
- << skeleton_class_name
- << "::_interface_skel, 0" << be_nl;
-
- this->skel_count_++;
-
- *os << "_repository_id,&"
- << skeleton_class_name
- << "::_repository_id_skel, 0" << be_nl;
- this->skel_count_++;
-
- // Input to the gperf is ready. Run gperf and get things
- // done. This method also unlinks the temp file that we used
- // for the gperf.
- this->gen_gperf_things (flat_name);
- }
- break;
-
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_interface"
- "::"
- "gen_operation_table"
- "unknown op_lookup_strategy\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_interface::convert_parent_ops (be_visitor *visitor)
-{
- // Make sure the queues are empty.
- this->insert_queue.reset ();
- this->del_queue.reset ();
-
- // Insert ourselves in the queue.
- if (insert_queue.enqueue_tail (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::convert_parent_ops - "
- "error generating entries\n"),
- -1);
- }
-
- // Traverse the graph.
- Pure_Virtual_Regenerator worker (visitor);
-
- if (this->traverse_inheritance_graph (worker, 0) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::"
- "convert_parent_ops - "
- "codegen for base class operations failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// Output the header (type declaration and %%) to the gperf's input
-// file.
-void
-be_interface::gen_gperf_input_header (TAO_OutStream *os)
-{
- *os << "TAO_operation_db_entry {\n"
- << "\tchar * opname;" << "\n"
- << "\tTAO_Skeleton skel_ptr;" << "\n"
- << "};" << "\n"
- << "%%"
- << "\n";
-}
-
-// we separate the generation of operation table entries from the
-// "gen_operation_table" method. This enables us to invoke generation of
-// entries for interfaces from which we inherit without any additional
-// code. The parameter "derived" is the one for which the entire operation
-// table is being built.
-int
-be_interface::gen_optable_entries (be_interface *derived_interface,
- const char *full_skeleton_name,
- TAO_OutStream *os)
-{
- int lookup_strategy =
- be_global->lookup_strategy ();
-
- if (lookup_strategy == BE_GlobalData::TAO_DYNAMIC_HASH)
- {
- for (UTL_ScopeActiveIterator si (this, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- // get the next AST decl node
- AST_Decl *d = si.item ();
-
- if (d->node_type () == AST_Decl::NT_op)
- {
- // We are an operation node.
- *os << "{\"" << d->original_local_name () << "\", &"
- << full_skeleton_name << "::"
- << d->local_name () << "_skel,";
-
- if (be_global->gen_direct_collocation ())
- {
- *os << " &"
- << derived_interface->full_direct_proxy_impl_name ()
- << "::" << d->local_name ();
- }
- else
- {
- *os << " 0";
- }
-
- *os << "}," << be_nl;
-
- derived_interface->skel_count_++;
- }
- else if (d->node_type () == AST_Decl::NT_attr)
- {
- AST_Attribute *attr =
- AST_Attribute::narrow_from_decl (d);
-
- if (attr == 0)
- return -1;
-
- // Generate only the "get" entry if we are
- // readonly.
- *os << "{\"_get_" << d->original_local_name ()
- << "\", &" << full_skeleton_name
- << "::_get_" << d->local_name () << "_skel,";
-
- if (be_global->gen_direct_collocation ())
- {
- *os << " &"
- << derived_interface->full_direct_proxy_impl_name ()
- << "::_get_" << d->local_name ();
- }
- else
- {
- *os << " 0";
- }
-
- *os << "}," << be_nl;
-
- derived_interface->skel_count_++;
-
- if (!attr->readonly ())
- {
- // The set method
- *os << "{\"_set_" << d->original_local_name ()
- << "\", &" << full_skeleton_name
- << "::_set_" << d->local_name () << "_skel,";
-
- if (be_global->gen_direct_collocation ())
- {
- *os << " &"
- << derived_interface->full_direct_proxy_impl_name ()
- << "::_set_" << d->local_name ();
- }
- else
- {
- *os << " 0";
- }
-
- *os << "}," << be_nl;
-
- derived_interface->skel_count_++;
- }
- }
- }
- }
- else if (lookup_strategy == BE_GlobalData::TAO_LINEAR_SEARCH
- || lookup_strategy == BE_GlobalData::TAO_BINARY_SEARCH
- || lookup_strategy == BE_GlobalData::TAO_PERFECT_HASH)
- {
- // We call GPERF for all these three strategies.
- // Init the outstream.
- // @@ We probably do no need to do this, the "right" <os>
- // argument is passed down!!
- os = tao_cg->gperf_input_stream ();
-
- for (UTL_ScopeActiveIterator si (this, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- // get the next AST decl node
- AST_Decl *d = si.item ();
-
- if (d->node_type () == AST_Decl::NT_op)
- {
- // Generate operation name.
-
- // We are an operation node. We use the original
- // operation name, not the one with _cxx_ in it.
- *os << d->original_local_name () << ",&"
- << full_skeleton_name << "::"
- << d->local_name () << "_skel,";
-
- if (be_global->gen_direct_collocation ())
- {
- *os << " &"
- << derived_interface->full_direct_proxy_impl_name ();
- *os << "::" << d->local_name ();
- }
- else
- {
- *os << " 0";
- }
-
- *os << "\n";
-
- this->skel_count_++;
- }
- else if (d->node_type () == AST_Decl::NT_attr)
- {
- AST_Attribute *attr =
- AST_Attribute::narrow_from_decl (d);
-
- if (attr == 0)
- {
- return -1;
- }
-
- // Generate only the "get" entry if we are readonly.
- *os << "_get_" << d->original_local_name () << ",&"
- << full_skeleton_name << "::_get_"
- << d->local_name () << "_skel,";
-
- if (be_global->gen_direct_collocation ())
- {
- *os << " &"
- << derived_interface->full_direct_proxy_impl_name ()
- << "::_get_" << d->local_name ();
- }
- else
- {
- *os << " 0";
- }
-
- *os << "\n";
-
- this->skel_count_++;
-
- if (!attr->readonly ())
- {
- // The set method
- *os << "_set_" << d->original_local_name () << ",&"
- << full_skeleton_name << "::_set_"
- << d->local_name () << "_skel,";
-
- if (be_global->gen_direct_collocation ())
- {
- *os << " &"
- << derived_interface->full_direct_proxy_impl_name ()
- << "::_set_" << d->local_name ();
- }
- else
- {
- *os << " 0";
- }
-
- *os << "\n";
-
- this->skel_count_++;
- }
- }
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_interface::gen_optable_entries - "
- "unknown op_lookup_strategy\n"),
- -1);
- }
-
- return 0;
-}
-
-void
-be_interface::gen_collocated_skel_body (be_interface *derived,
- be_interface *ancestor,
- AST_Decl *d,
- const char *prefix,
- bool /* direct */,
- UTL_ExceptList *list,
- TAO_OutStream *os)
-{
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Generate the static method corresponding to this method.
- *os << be_nl << be_nl
- << "ACE_INLINE void" << be_nl
- << derived->full_direct_proxy_impl_name ()
- << "::" << prefix << d->local_name () << " (" << be_idt << be_idt_nl
- << "TAO_Abstract_ServantBase *servant," << be_nl
- << "TAO::Argument ** args," << be_nl
- << "int num_args" << env_decl << be_uidt_nl
- << ")";
-
- be_interface::gen_throw_spec (list, os);
-
- *os << be_uidt_nl
- << "{" << be_idt_nl
- << ancestor->full_direct_proxy_impl_name ()
- << "::" << prefix << d->local_name () << " (" << be_idt << be_idt_nl
- << "servant," << be_nl
- << "args," << be_nl
- << "num_args" << env_arg << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}"<< be_nl;
-
-
-}
-
-void
-be_interface::analyze_parentage (void)
-{
- if (this->has_mixed_parentage_ != -1)
- {
- return;
- }
-
- this->has_mixed_parentage_ = 0;
-
- for (long i = 0; i < this->pd_n_inherits; ++i)
- {
- be_interface *parent =
- be_interface::narrow_from_decl (this->pd_inherits[i]);
-
- if (parent->is_abstract () || parent->has_mixed_parentage ())
- {
- this->has_mixed_parentage_ = 1;
- break;
- }
- }
-
- AST_Decl::NodeType nt = this->node_type ();
- bool can_be_mixed = nt == AST_Decl::NT_interface
- || nt == AST_Decl::NT_component
- || nt == AST_Decl::NT_home;
-
- if (this->has_mixed_parentage_ == 1 && can_be_mixed && this->is_defined ())
- {
- be_global->mixed_parentage_interfaces.enqueue_tail (this);
- }
-}
-
-// ****************************************************************
-
-be_code_emitter_wrapper::
-be_code_emitter_wrapper (be_interface::tao_code_emitter emitter)
- : emitter_ (emitter)
-{
-}
-
-int
-be_code_emitter_wrapper::emit (be_interface *derived_interface,
- TAO_OutStream *output_stream,
- be_interface *base_interface)
-{
- return this->emitter_ (derived_interface,
- base_interface,
- output_stream);
-}
-
-// Template method that traverses the inheritance graph in a breadth-first
-// style. The actual work on each element in the inheritance graph is carried
-// out by the function passed as argument.
-int
-be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen,
- TAO_OutStream *os,
- bool abstract_paths_only)
-{
- // Make sure the queues are empty.
- this->insert_queue.reset ();
- this->del_queue.reset ();
-
-
- // Insert ourselves in the queue.
- if (insert_queue.enqueue_tail (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::traverse_inheritance_graph - "
- "error generating entries\n"),
- -1);
- }
-
- be_code_emitter_wrapper wrapper (gen);
-
- return this->traverse_inheritance_graph (wrapper,
- os,
- abstract_paths_only);
-}
-
-int
-be_interface::traverse_inheritance_graph (
- TAO_IDL_Inheritance_Hierarchy_Worker &worker,
- TAO_OutStream *os,
- bool abstract_paths_only
- )
-{
- AST_Interface *intf = 0; // element inside the queue
-
- if (!this->insert_queue.is_empty ())
- {
- // Dequeue the element at the head of the queue.
- if (this->insert_queue.dequeue_head (intf))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::traverse_graph - "
- "dequeue_head failed\n"),
- -1);
- }
-
- // If we are doing a component, we check for a parent.
- if (intf->node_type () == AST_Decl::NT_component)
- {
- (void) this->insert_non_dup (be_global->ccmobject ());
-
- AST_Component *base =
- AST_Component::narrow_from_decl (intf)->base_component ();
-
- if (base != 0)
- {
- (void) this->insert_non_dup (base);
-
- long n_supports = base->n_supports ();
- AST_Interface **supports = base->supports ();
-
- for (long j = 0; j < n_supports; ++j)
- {
- (void) this->insert_non_dup (supports[j],
- abstract_paths_only);
- }
- }
- }
-
- (void) this->insert_non_dup (intf, abstract_paths_only);
- }
-
- // Do until queue is empty.
- while (!this->insert_queue.is_empty ())
- {
- // Use breadth-first strategy i.e., first generate entries for ourselves,
- // followed by nodes that we immediately inherit from, and so on. In the
- // process make sure that we do not generate code for the same node more
- // than once. Such a case may arise due to multiple inheritance forming
- // a diamond-like inheritance graph.
-
- // Dequeue the element at the head of the queue.
- if (this->insert_queue.dequeue_head (intf))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::traverse_graph - "
- "dequeue_head failed\n"),
- -1);
- }
-
- // Insert the dequeued element in the del_queue.
- if (this->del_queue.enqueue_tail (intf) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::traverse_graph - "
- "enqueue_head failed\n"),
- -1);
- }
-
- be_interface *bi = be_interface::narrow_from_decl (intf);
-
- // Use the helper method to generate code for ourself using the
- // properties of the element dequeued. For the first iteration, the
- // element dequeued and "this" will be the same i.e., ourselves.
- if (worker.emit (this, os, bi) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::traverse_graph - "
- "helper code gen failed\n"),
- -1);
- }
- } // end of while queue not empty
-
- return 0;
-}
-
-// Run GPERF and get the correct lookup and other operations
-// depending on which strategy we are using. Returns 0 on sucess, -1
-// on error.
-int
-be_interface::gen_gperf_things (const char *flat_name)
-{
- // GPERF can give Binary search, Linear search and Perfect Hash
- // methods. Generate the class defintion according to that.
-
- TAO_OutStream *os = this->strategy_->get_out_stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Generate the correct class definition for the operation lookup
- // strategy. Then, get the lookup method from GPERF. And then,
- // instantiate the correct class for the operation lookup strategy
- // we are following.
- switch (be_global->lookup_strategy ())
- {
- case BE_GlobalData::TAO_PERFECT_HASH:
- // Output a class definition deriving from
- // TAO_Perfect_Hash_OpTable.
- this->gen_perfect_hash_class_definition (flat_name);
-
- // Call GPERF and get the methods defined.
- if (this->gen_gperf_lookup_methods (flat_name) == -1)
- {
- return -1;
- }
-
- // Create an instance of the correct class corresponding the
- // operation lookup strategy we are following.
- this->gen_perfect_hash_instance (flat_name);
-
- break;
-
- case BE_GlobalData::TAO_BINARY_SEARCH:
- // Output a class definition deriving from
- // TAO_Binary_Search_OpTable.
- this->gen_binary_search_class_definition (flat_name);
-
- // Call GPERF and get the methods defined.
- if (gen_gperf_lookup_methods (flat_name) == -1)
- {
- return -1;
- }
-
- // Create an instance of the correct class corresponding the
- // operation lookup strategy we are following.
- this->gen_binary_search_instance (flat_name);
-
- break;
-
- case BE_GlobalData::TAO_LINEAR_SEARCH:
- // Output a class definition deriving from
- // TAO_Linear_Search_OpTable.
- this->gen_linear_search_class_definition (flat_name);
-
- // Call GPERF and get the methods defined.
- if (this->gen_gperf_lookup_methods (flat_name) == -1)
- {
- return -1;
- }
-
- // Create an instance of the correct class corresponding the
- // operation lookup strategy we are following.
- this->gen_linear_search_instance (flat_name);
-
- break;
-
- default:
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "tao_idl:ERROR:%N:%l:Unknown Operation Lookup Strategy\n"
- ),
- -1
- );
- }
-
- return 0;
-}
-
-
-// Outputs the class definition for the perfect hashing. This class
-// will inherit from the TAO_Perfect_Hash_OpTable.
-void
-be_interface::gen_perfect_hash_class_definition (const char *flat_name)
-{
- // Outstream.
- TAO_OutStream *os = this->strategy_->get_out_stream ();
-
- *os << "class " << "TAO_" << flat_name << "_Perfect_Hash_OpTable"
- << be_idt_nl
- << ": public TAO_Perfect_Hash_OpTable" << be_uidt_nl
- << "{" << be_nl
- << "private:" << be_idt_nl
- << "unsigned int hash (const char *str, unsigned int len);"
- << be_uidt_nl << be_nl
- << "public:" << be_idt_nl
- << "const TAO_operation_db_entry * lookup "
- << "(const char *str, unsigned int len);"
- << be_uidt_nl
- << "};\n\n";
-}
-
-// Outputs the class definition for the binary searching. This class
-// will inherit from the TAO_Binary_Seach_OpTable.
-void
-be_interface::gen_binary_search_class_definition (const char *flat_name)
-{
- // Outstream.
- TAO_OutStream *os = this->strategy_->get_out_stream ();
-
- *os << "class " << "TAO_" << flat_name << "_Binary_Search_OpTable"
- << be_idt_nl
- << ": public TAO_Binary_Search_OpTable" << be_uidt_nl
- << "{" << be_nl
- << "public:" << be_idt_nl
- << "const TAO_operation_db_entry * lookup (const char *str);"
- << be_uidt_nl
- << "};\n\n";
-}
-
-// Outputs the class definition for the linear search. This class
-// will inherit from the TAO_Linear_Search_OpTable.
-void
-be_interface::gen_linear_search_class_definition (const char *flat_name)
-{
- // Outstream.
- TAO_OutStream *ss = this->strategy_->get_out_stream ();
-
- *ss << "class " << "TAO_" << flat_name << "_Linear_Search_OpTable"
- << be_idt_nl
- << ": public TAO_Linear_Search_OpTable" << be_nl
- << "{" << be_nl
- << "public:" << be_idt_nl
- << "const TAO_operation_db_entry * lookup (const char *str);"
- << be_uidt_nl
- << "};\n\n";
-}
-
-// We have collected the input (Operations and the corresponding
-// skeleton pointers) for the gperf program. Now let us execute gperf
-// and get things done.
-// GPERF reads from our temp file and write to the Server Skeleton
-// file.
-int
-be_interface::gen_gperf_lookup_methods (const char *flat_name)
-{
- // Using ACE_Process.
- ACE_Process process;
- ACE_Process_Options process_options;
-
- // Adjust the offset of the underlying file pointer.
- ACE_OS::rewind (tao_cg->gperf_input_stream ()->file ());
-
- // Set the stdin and stdout appropriately for the gperf program.
-
- // Stdin is our temp file. Close the temp file and open. We will use
- // <open_temp_file> to open the file now, so that the file will get
- // deleted once when we close the file.
-
- // Close the file.
- if (ACE_OS::fclose (tao_cg->gperf_input_stream ()->file ()) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p:File close failed on temp gperf's input file\n",
- "fclose"),
- -1);
- }
-
- // Open the temp file.
-#if defined (ACE_OPENVMS)
- ACE_HANDLE input = ::open(tao_cg->gperf_input_filename(), O_RDONLY,
- "shr=get,put,upd", "ctx=rec", "fop=dfw");
-#else
- ACE_HANDLE input = ACE::open_temp_file (tao_cg->gperf_input_filename (),
- O_RDONLY);
-#endif
-
- if (input == ACE_INVALID_HANDLE)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p:File open failed on gperf's temp input file\n",
- "open_temp_file"),
- -1);
- }
-
- // Stdout is server skeleton. Do *not* close the file, just open
- // again with <ACE_OS::open> with WRITE + APPEND option.. After
- // this, remember to update the file offset to the correct location.
-
-#if defined (ACE_OPENVMS)
- char* gperfOutput = tempnam(NULL, "idl_");
- if (gperfOutput == NULL)
- {
- ACE_OS::close(input);
- ACE_ERROR_RETURN ((LM_ERROR, "failed to allocate memory\n"), -1);
- }
- ACE_HANDLE output = ::open(gperfOutput, O_WRONLY | O_CREAT | O_EXCL,
- ACE_DEFAULT_FILE_PERMS , "shr=get,put,upd", "ctx=rec", "fop=dfw");
-#else
- ACE_HANDLE output = ACE_OS::open (this->strategy_->get_out_stream_fname (),
- O_WRONLY | O_APPEND);
-#endif
-
- if (output == ACE_INVALID_HANDLE)
- {
- ACE_OS::close (input);
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p:File open failed on server skeleton file\n",
- "open"),
- -1);
- }
-
- // Seek to the end of the output file.
- ACE_OS::lseek (output, 0, SEEK_END);
-
- // Set the handles now in the process options.
- process_options.set_handles (input, output);
-
- int result = 0;
-
- // Set the command line for the gperf program. Give the right
- // arguments for the operation lookup strategy that we are using.
- switch (be_global->lookup_strategy ())
- {
- // Perfect Hashing.
- case BE_GlobalData::TAO_PERFECT_HASH:
- process_options.command_line ("%s"
- " "
- "-m -M -J -c -C"
- " "
- "-D -E -T -f 0"
- " "
- "-F 0,0"
- " "
- "-a -o -t -p -K"
- " "
- "opname -L C++"
- " "
- "-Z TAO_%s_Perfect_Hash_OpTable"
- " "
- "-N lookup",
- idl_global->gperf_path (),
- flat_name);
- break;
-
- // Binary search methods from GPERF. Everythis and the -B flag.
- case BE_GlobalData::TAO_BINARY_SEARCH:
- process_options.command_line ("%s"
- " "
- "-B"
- " "
- "-m -M -J -c -C"
- " "
- "-D -E -T -f 0"
- " "
- "-F 0,0,0"
- " "
- "-a -o -t -p -K"
- " "
- "opname -L C++"
- " "
- "-Z TAO_%s_Binary_Search_OpTable"
- " "
- "-N lookup",
- idl_global->gperf_path (),
- flat_name);
- break;
-
- // Linear search methods from GPERF. Everything and the -Z flag.
- case BE_GlobalData::TAO_LINEAR_SEARCH:
- process_options.command_line ("%s"
- " "
- "-b"
- " "
- "-m -M -J -c -C"
- " "
- "-D -E -T -f 0"
- " "
- "-F 0,0"
- " "
- "-a -o -t -p -K"
- " "
- "opname -L C++"
- " "
- "-Z TAO_%s_Linear_Search_OpTable"
- " "
- "-N lookup",
- idl_global->gperf_path (),
- flat_name);
- break;
-
- default:
- ACE_ERROR ((LM_ERROR,
- "tao_idl:ERROR:%N:%l:Unknown Operation Lookup Strategy\n"));
-
- result = -1;
- }
-
- if (result != -1)
- {
- // Spawn a process for gperf.
- if (process.spawn (process_options) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "Error:%p:Couldnt spawn a process for gperf program\n",
- "process.spawn"));
-
- result = -1;
- }
-
- // Wait for gperf to complete.
- else if (process.wait () == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "Error:%p:Error on waiting for completion of gperf program.\n",
- "process.wait"));
-
- result = -1;
- }
-
- // Adjust the file offset to the EOF for the server skeleton
- // file.
- ACE_OS::fseek (this->strategy_->get_out_stream()->file (),
- 0,
- SEEK_END);
- }
-
- ACE_OS::close (output);
- ACE_OS::close (input);
-
-#if defined(ACE_OPENVMS)
- ACE_OS::unlink(tao_cg->gperf_input_filename());
- process_options.release_handles();
- if (result != -1)
- {
- FILE* gperfOutputFile;
- gperfOutputFile = ::fopen(gperfOutput, "r");
- if (gperfOutputFile == 0)
- {
- ACE_ERROR ((LM_ERROR,
- "Error:%p:Couldn't open gperf output file\n",
- "fopen"));
- result = -1;
- }
- else
- {
- FILE* out = this->strategy_->get_out_stream()->file();
- int c;
- while ((c = fgetc(gperfOutputFile)) != EOF)
- {
- fputc(c, out);
- }
- if (ferror(gperfOutputFile) || ferror(out))
- {
- ACE_ERROR ((LM_ERROR,
- "Error:%p:Couldn't open gperf output file\n",
- "get/put"));
- result = -1;
- }
- fclose(gperfOutputFile);
- }
- }
- ACE_OS::unlink(gperfOutput);
- free(gperfOutput);
-#endif /* ACE_OPENVMS */
-
- return result;
-}
-
-// Create an instance of this perfect hash table.
-void
-be_interface::gen_perfect_hash_instance (const char *flat_name)
-{
- // Outstream.
- TAO_OutStream *os = this->strategy_->get_out_stream ();
-
- *os << be_nl
- << "static TAO_" << flat_name << "_Perfect_Hash_OpTable"
- << " "
- << "tao_" << flat_name << "_optable;";
-}
-
-// Create an instance of the binary search optable.
-void
-be_interface::gen_binary_search_instance (const char *flat_name)
-{
- // Outstream.
- TAO_OutStream *os = this->strategy_->get_out_stream ();
-
- *os << be_nl
- << "static TAO_" << flat_name << "_Binary_Search_OpTable"
- << " "
- << "tao_" << flat_name << "_optable;";
-}
-
-
-// Create an instance of this perfect hash table.
-void
-be_interface::gen_linear_search_instance (const char *flat_name)
-{
- // Outstream.
- TAO_OutStream *os = this->strategy_->get_out_stream ();
-
- *os << be_nl
- << "static TAO_" << flat_name << "_Linear_Search_OpTable"
- << " "
- << "tao_" << flat_name << "_optable;";
-}
-
-int
-be_interface::is_a_helper (be_interface * /*derived*/,
- be_interface *bi,
- TAO_OutStream *os)
-{
- // Emit the comparison code.
- *os << "!ACE_OS::strcmp (" << be_idt << be_idt_nl
- << "value," << be_nl
- << "\"" << bi->repoID () << "\"" << be_uidt_nl
- << ") ||" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_interface::gen_skel_helper (be_interface *derived,
- be_interface *ancestor,
- TAO_OutStream *os)
-{
- // If derived and ancestor are same, skip it.
- if (derived == ancestor)
- {
- return 0;
- }
-
- // If an operation or an attribute is abstract (declared in an
- // abstract interface), we will either generate the full
- // definition (if there are no concrete interfaces between the
- // abstract ancestor and us) or, if there is a concrete ancestor
- // in between, we will catch its definition elsewhere in this
- // traversal.
- if (ancestor->is_abstract ())
- {
- return 0;
- }
-
- // Else generate code that does the cast to the appropriate type.
-
- if (ancestor->nmembers () > 0)
- {
- // If there are elements in ancestor scope i.e., any operations and
- // attributes defined by "ancestor", become methods on the derived class
- // which call the corresponding method of the base class by doing the
- // proper casting.
-
- for (UTL_ScopeActiveIterator si (ancestor, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- // Get the next AST decl node
- AST_Decl *d = si.item ();
-
- if (d->node_type () == AST_Decl::NT_op)
- {
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl << be_nl;
-
- if (os->stream_type () == TAO_OutStream::TAO_SVR_HDR)
- {
- // Generate the static method corresponding to this method.
- *os << "static void" << be_nl
- << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & server_request, " << be_nl
- << "void * servant_upcall," << be_nl
- << "void * servant" << env_dflts << be_uidt_nl
- << ");" << be_uidt;
- }
- else
- { // Generate code in the inline file.
- // Generate the static method corresponding to this method.
- *os << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << derived->full_skel_name () << "::"
- << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & server_request," << be_nl
- << "void * servant_upcall," << be_nl
- << "void * servant" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- *os << ancestor->full_skel_name ()
- << " * const impl = static_cast<"
- << derived->full_skel_name ()
- << " *> (servant);" << be_nl;
-
- *os << ancestor->full_skel_name ()
- << "::" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "server_request," << be_nl
- << "servant_upcall," << be_nl
- << "impl" << env_arg << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}";
- }
- }
- else if (d->node_type () == AST_Decl::NT_attr)
- {
- AST_Attribute *attr = AST_Attribute::narrow_from_decl (d);
-
- if (attr == 0)
- {
- return -1;
- }
-
- *os << be_nl << be_nl;
-
- if (os->stream_type () == TAO_OutStream::TAO_SVR_HDR)
- {
- // Generate the static method corresponding to this method.
- *os << "static void" << be_nl
- << "_get_" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & server_request," << be_nl
- << "void * servant_upcall," << be_nl
- << "void * servant" << env_dflts << be_uidt_nl
- << ");" << be_uidt;
- }
- else
- { // Generate code in the inline file.
- // Generate the static method corresponding to this method.
- *os << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << derived->full_skel_name () << "::_get_"
- << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & server_request," << be_nl
- << "void * servant_upcall," << be_nl
- << "void * servant" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- *os << ancestor->full_skel_name ()
- << " * const impl = static_cast<"
- << derived->full_skel_name ()
- << " *> (servant);" << be_nl;
-
- *os << ancestor->full_skel_name ()
- << "::_get_" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "server_request," << be_nl
- << "servant_upcall," << be_nl
- << "impl" << env_arg << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}";
- }
-
- if (!attr->readonly ())
- {
- *os << be_nl << be_nl;
-
- if (os->stream_type () == TAO_OutStream::TAO_SVR_HDR)
- {
- // Generate the static method corresponding to
- // this method.
- *os << "static void" << be_nl
- << "_set_" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & server_request," << be_nl
- << "void * servant_upcall," << be_nl
- << "void * servant" << env_dflts << be_uidt_nl
- << ");" << be_uidt;
- }
- else
- { // Generate code in the inline file.
- // Generate the static method corresponding to
- // this method.
- *os << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << derived->full_skel_name ()
- << "::_set_" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & server_request," << be_nl
- << "void * servant_upcall," << be_nl
- << "void * servant" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- *os << ancestor->full_skel_name ()
- << " * const impl = static_cast<"
- << derived->full_skel_name ()
- << " *> (servant);" << be_nl;
-
- *os << ancestor->full_skel_name ()
- << "::_set_" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "server_request," << be_nl
- << "servant_upcall," << be_nl
- << "impl" << env_arg << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}";
- }
- }
- }
- } // End of FOR.
- }
-
- return 0;
-}
-
-int
-be_interface::gen_colloc_op_decl_helper (be_interface *derived,
- be_interface *ancestor,
- TAO_OutStream *os)
-{
- // If derived and ancestor are same, skip it.
- if (derived == ancestor)
- {
- return 0;
- }
-
- // If an operation or an attribute is abstract (declared in an
- // abstract interface), we will either generate the full
- // definition (if there are no concrete interfaces between the
- // abstract ancestor and us) or, if there is a concrete ancestor
- // in between, we will catch its definition elsewhere in this
- // traversal.
- if (ancestor->is_abstract () || ancestor->nmembers () == 0)
- {
- return 0;
- }
-
- UTL_ExceptList *list = 0;
-
- for (UTL_ScopeActiveIterator si (ancestor, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- // Get the next AST decl node
- AST_Decl *d = si.item ();
-
- if (d->node_type () == AST_Decl::NT_op)
- {
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Generate the static method corresponding to this method.
- *os << "static void" << be_nl
- << d->local_name () << " (" << be_idt << be_idt_nl
- << "TAO_Abstract_ServantBase *servant, " << be_nl
- << "TAO::Argument ** args," << be_nl
- << "int num_args" << env_dflts << be_uidt_nl
- << ")";
-
- list = be_operation::narrow_from_decl (d)->exceptions ();
- be_interface::gen_throw_spec (list, os);
-
- *os << ";";
- }
- else if (d->node_type () == AST_Decl::NT_attr)
- {
- AST_Attribute *attr = AST_Attribute::narrow_from_decl (d);
-
- if (attr == 0)
- {
- return -1;
- }
-
- // Generate the static method corresponding to this method.
- *os << "static void" << be_nl
- << "_get_" << d->local_name () << " (" << be_idt << be_idt_nl
- << "TAO_Abstract_ServantBase *servant, " << be_nl
- << "TAO::Argument ** args," << be_nl
- << "int num_args" << env_dflts << be_uidt_nl
- << ")";
-
- list = attr->get_get_exceptions ();
- be_interface::gen_throw_spec (list, os);
-
- *os << ";";
-
- if (!attr->readonly ())
- {
- *os << be_nl << be_nl;
-
- // Generate the static method corresponding to
- // this method.
- *os << "static void" << be_nl
- << "_set_" << d->local_name () << " (" << be_idt << be_idt_nl
- << "TAO_Abstract_ServantBase *servant, " << be_nl
- << "TAO::Argument ** args," << be_nl
- << "int num_args" << env_dflts << be_uidt_nl
- << ")";
-
- list = attr->get_set_exceptions ();
- be_interface::gen_throw_spec (list, os);
-
- *os << ";";
- }
- }
- }
-
- return 0;
-}
-
-int
-be_interface::gen_colloc_op_defn_helper (be_interface *derived,
- be_interface *ancestor,
- TAO_OutStream *os)
-{
- // If derived and ancestor are same, skip it.
- if (derived == ancestor)
- {
- return 0;
- }
-
- // If an operation or an attribute is abstract (declared in an
- // abstract interface), we will either generate the full
- // definition (if there are no concrete interfaces between the
- // abstract ancestor and us) or, if there is a concrete ancestor
- // in between, we will catch its definition elsewhere in this
- // traversal.
- if (ancestor->is_abstract () || ancestor->nmembers () == 0)
- {
- return 0;
- }
-
- AST_Decl *d = 0;
- be_operation *op = 0;
-
- for (UTL_ScopeActiveIterator si (ancestor, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- // Get the next AST decl node
- d = si.item ();
-
- if (d->node_type () == AST_Decl::NT_op)
- {
- op = be_operation::narrow_from_decl (d);
-
- if (be_global->gen_direct_collocation ())
- {
- be_interface::gen_collocated_skel_body (derived,
- ancestor,
- d,
- "",
- true,
- op->exceptions (),
- os);
- }
- }
- else if (d->node_type () == AST_Decl::NT_attr)
- {
- AST_Attribute *attr = AST_Attribute::narrow_from_decl (d);
-
- if (attr == 0)
- {
- return -1;
- }
-
- if (be_global->gen_direct_collocation ())
- {
- be_interface::gen_collocated_skel_body (
- derived,
- ancestor,
- d,
- "_get_",
- true,
- attr->get_get_exceptions (),
- os
- );
- }
-
- if (!attr->readonly ())
- {
- if (be_global->gen_direct_collocation ())
- {
- be_interface::gen_collocated_skel_body (
- derived,
- ancestor,
- d,
- "_set_",
- true,
- attr->get_set_exceptions (),
- os
- );
- }
- }
- }
- }
-
- return 0;
-}
-
-int
-be_interface::copy_ctor_helper (be_interface *derived,
- be_interface *base,
- TAO_OutStream *os)
-{
- // We can't call ourselves in a copy constructor, and
- // abstract interfaces don't exist on the skeleton side.
- if (derived == base || base->is_abstract ())
- {
- return 0;
- }
-
- *os << "," << be_idt_nl;
-
- bool is_rh_base =
- (ACE_OS::strcmp (base->flat_name (), "Messaging_ReplyHandler") == 0);
-
- if (is_rh_base)
- {
- *os << "::POA_Messaging::ReplyHandler (rhs)";
- }
- else if (base->is_nested ())
- {
- be_decl *scope;
- scope = be_scope::narrow_from_scope (base->defined_in ())->decl ();
-
- *os << "POA_" << scope->name () << "::"
- << base->local_name () << " (rhs)";
- }
- else
- {
- *os << base->full_skel_name () << " (rhs)";
- }
-
- *os << be_uidt;
-
- return 0;
-}
-
-int
-be_interface::in_mult_inheritance_helper (be_interface *derived,
- be_interface *base,
- TAO_OutStream *)
-{
- switch (derived->n_inherits ())
- {
- case 0:
- // No parent.
- derived->in_mult_inheritance (0);
- break;
- case 1:
- if (derived == base)
- {
- // Prevent indefinite recursion.
- derived->in_mult_inheritance (-1);
- }
- else
- {
- // One parent. We have the same characteristics as our base.
- derived->in_mult_inheritance (base->in_mult_inheritance ());
- }
-
- break;
- default:
- // Direct multiple inheritance.
- derived->in_mult_inheritance (1);
- }
-
- return 0;
-}
-
-int
-be_interface::gen_abstract_init_helper (be_interface *node,
- be_interface *base,
- TAO_OutStream *os)
-{
- if (node == base)
- {
- return 0;
- }
-
- *os << "," << be_nl;
-
- if (base->is_nested ())
- {
- UTL_Scope *parent_scope = base->defined_in ();
- AST_Decl *parent_decl = ScopeAsDecl (parent_scope);
-
- *os << ""
- << parent_decl->name () << "::"
- << base->local_name ()<< " (" << be_idt << be_idt_nl;
- }
- else
- {
- *os << base->name () << " (" << be_idt << be_idt_nl;
- }
-
- *os << "objref," << be_nl
- << "_tao_collocated," << be_nl
- << "servant" << be_uidt_nl
- << ")" << be_uidt;
-
-
- return 0;
-}
-
-void
-be_interface::gen_throw_spec (UTL_ExceptList *list,
- TAO_OutStream *os)
-{
- const char *throw_spec_open = "throw (";
- const char *throw_spec_close = ")";
-
- if (!be_global->use_raw_throw ())
- {
- throw_spec_open = "ACE_THROW_SPEC ((";
- throw_spec_close = "))";
- }
-
- *os << be_nl << throw_spec_open;
- *os << be_idt_nl << "::CORBA::SystemException";
-
- // Initialize an iterator to iterate thru the exception list.
- for (UTL_ExceptlistActiveIterator ei (list);
- !ei.is_done ();
- ei.next ())
- {
- *os << "," << be_nl
- << "::" << ei.item ()->name ();
- }
-
- *os << be_uidt_nl
- << throw_spec_close << be_uidt;
-}
-
-void
-be_interface::destroy (void)
-{
- // We know that it cannot be 0, but..
- if (this->strategy_ != 0)
- {
- this->strategy_->destroy ();
- delete this->strategy_;
- this->strategy_ = 0;
- }
-
- // Call the destroy methods of our base classes.
- this->AST_Interface::destroy ();
- this->be_scope::destroy ();
- this->be_type::destroy ();
-}
-
-int
-be_interface::accept (be_visitor *visitor)
-{
- return visitor->visit_interface (this);
-}
-
-
-TAO_CodeGen::CG_STATE
-be_interface::next_state (TAO_CodeGen::CG_STATE current_state,
- int is_extra_state)
-{
- return this->strategy_->next_state (current_state,
- is_extra_state);
-}
-
-int
-be_interface::has_extra_code_generation (TAO_CodeGen::CG_STATE current_state)
-{
- return this->strategy_->has_extra_code_generation (current_state);
-}
-
-void
-be_interface::original_interface (be_interface *original_interface)
-{
- this->original_interface_ = original_interface;
-}
-
-be_interface *
-be_interface::original_interface ()
-{
- return this->original_interface_;
-}
-
-be_interface *
-be_interface::replacement (void)
-{
- return this->strategy_->replacement ();
-}
-
-int
-be_interface::has_mixed_parentage (void)
-{
- if (this->is_abstract_)
- {
- return 0;
- }
-
- AST_Decl::NodeType nt = this->node_type ();
-
- if (AST_Decl::NT_component == nt || AST_Decl::NT_home == nt)
- {
- return 0;
- }
-
- if (this->has_mixed_parentage_ == -1)
- {
- this->analyze_parentage ();
- }
-
- return this->has_mixed_parentage_;
-}
-
-int
-be_interface::session_component_child (void)
-{
- if (this->session_component_child_ == -1)
- {
- // We are looking only for executor interfaces.
- if (!this->is_local_)
- {
- this->session_component_child_ = 0;
- return this->session_component_child_;
- }
-
- Identifier tail_id ("SessionComponent");
- UTL_ScopedName tail (&tail_id, 0);
- Identifier head_id ("Components");
- UTL_ScopedName sn (&head_id, &tail);
-
- AST_Decl *session_component =
- const_cast<be_interface*> (this)->scope ()->lookup_by_name (&sn,
- true);
-
- tail_id.destroy ();
- head_id.destroy ();
-
- // If Components::SessionComponent is not in the AST, we are
- // barking up the wrong tree.
- if (session_component == 0)
- {
- this->session_component_child_ = 0;
- return this->session_component_child_;
- }
-
- for (long i = 0; i < this->pd_n_inherits; ++i)
- {
- AST_Decl *tmp = this->pd_inherits[i];
-
- if (tmp == session_component)
- {
- this->session_component_child_ = 1;
- return this->session_component_child_;
- }
- }
-
- this->session_component_child_ = 0;
- }
-
- return this->session_component_child_;
-}
-
-bool
-be_interface::is_event_consumer (void)
-{
- return
- this->pd_n_inherits == 1
- && ACE_OS::strcmp (this->pd_inherits[0]->full_name (),
- "Components::EventConsumerBase") == 0;
-}
-
-const char *
-be_interface::base_proxy_impl_name (void)
-{
- return this->strategy_->base_proxy_impl_name ();
-}
-
-const char *
-be_interface::full_base_proxy_impl_name (void)
-{
- return this->strategy_->full_base_proxy_impl_name ();
-}
-
-const char *
-be_interface::remote_proxy_impl_name (void)
-{
- return this->strategy_->remote_proxy_impl_name ();
-}
-
-const char *
-be_interface::full_remote_proxy_impl_name (void)
-{
- return this->strategy_->full_remote_proxy_impl_name ();
-}
-
-const char *
-be_interface::direct_proxy_impl_name (void)
-{
- return this->strategy_->direct_proxy_impl_name ();
-}
-
-const char *
-be_interface::full_direct_proxy_impl_name (void)
-{
- return this->strategy_->full_direct_proxy_impl_name ();
-}
-
-
-const char *
-be_interface::base_proxy_broker_name (void)
-{
- return this->strategy_->base_proxy_broker_name ();
-}
-
-const char *
-be_interface::full_base_proxy_broker_name (void)
-{
- return this->strategy_->full_base_proxy_broker_name ();
-}
-
-
-const char *
-be_interface::remote_proxy_broker_name (void)
-{
- return this->strategy_->remote_proxy_broker_name ();
-}
-
-const char *
-be_interface::full_remote_proxy_broker_name (void)
-{
- return this->strategy_->full_remote_proxy_broker_name ();
-}
-
-
-const char *
-be_interface::strategized_proxy_broker_name (void)
-{
- return this->strategy_->strategized_proxy_broker_name ();
-}
-
-const char *
-be_interface::full_strategized_proxy_broker_name (void)
-{
- return this->strategy_->full_strategized_proxy_broker_name ();
-}
-
-const char *
-be_interface::client_enclosing_scope (void)
-{
- return this->strategy_->client_scope ();
-}
-
-const char *
-be_interface::flat_client_enclosing_scope (void)
-{
- return this->strategy_->flat_client_scope ();
-}
-
-const char *
-be_interface::server_enclosing_scope (void)
-{
- return this->strategy_->server_scope ();
-}
-
-
-// Narrowing
-IMPL_NARROW_METHODS3 (be_interface, AST_Interface, be_scope, be_type)
-IMPL_NARROW_FROM_DECL (be_interface)
-IMPL_NARROW_FROM_SCOPE (be_interface)
diff --git a/TAO/TAO_IDL/be/be_interface_fwd.cpp b/TAO/TAO_IDL/be/be_interface_fwd.cpp
deleted file mode 100644
index b5fe8edb8c8..00000000000
--- a/TAO/TAO_IDL/be/be_interface_fwd.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_interface_fwd.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_InterfaceFwd that provides additional means for C++
-// mapping of an interface.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_interface_fwd.h"
-#include "be_interface.h"
-#include "be_visitor.h"
-#include "ast_interface.h"
-
-ACE_RCSID (be,
- be_interface_fwd,
- "$Id$")
-
-be_interface_fwd::be_interface_fwd (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_InterfaceFwd (),
- be_decl (),
- be_type ()
-{
- // Always the case.
- this->size_type (AST_Type::VARIABLE);
-}
-
-be_interface_fwd::be_interface_fwd (AST_Interface *dummy,
- UTL_ScopedName *n)
- : COMMON_Base (dummy->is_local (),
- dummy->is_abstract ()),
- AST_Decl (AST_Decl::NT_interface_fwd,
- n),
- AST_Type (AST_Decl::NT_interface_fwd,
- n),
- AST_InterfaceFwd (dummy,
- n),
- be_decl (AST_Decl::NT_interface_fwd,
- n),
- be_type (AST_Decl::NT_interface_fwd,
- n)
-{
- // Always the case.
- this->size_type (AST_Type::VARIABLE);
-}
-
-be_interface_fwd::~be_interface_fwd (void)
-{
-}
-
-void
-be_interface_fwd::seen_in_sequence (bool val)
-{
- this->be_type::seen_in_sequence (val);
- be_interface *fd =
- be_interface::narrow_from_decl (this->full_definition ());
- fd->seen_in_sequence (val);
-}
-
-void
-be_interface_fwd::seen_in_operation (bool val)
-{
- this->be_type::seen_in_operation (val);
- be_interface *fd =
- be_interface::narrow_from_decl (this->full_definition ());
- fd->seen_in_operation (val);
-}
-
-void
-be_interface_fwd::destroy (void)
-{
- this->be_type::destroy ();
- this->AST_InterfaceFwd::destroy ();
-}
-
-int
-be_interface_fwd::accept (be_visitor *visitor)
-{
- return visitor->visit_interface_fwd (this);
-}
-
-// Narrowing
-IMPL_NARROW_METHODS2 (be_interface_fwd, AST_InterfaceFwd, be_type)
-IMPL_NARROW_FROM_DECL (be_interface_fwd)
diff --git a/TAO/TAO_IDL/be/be_interface_strategy.cpp b/TAO/TAO_IDL/be/be_interface_strategy.cpp
deleted file mode 100644
index 29894b7e2ae..00000000000
--- a/TAO/TAO_IDL/be/be_interface_strategy.cpp
+++ /dev/null
@@ -1,1124 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_interface_strategy.cpp
-//
-// = DESCRIPTION
-// A strategy to cover the differences between various variants
-// of an interface
-//
-// = AUTHOR
-// Michael Kircher
-//
-// ============================================================================
-
-#include "be_interface_strategy.h"
-#include "be_interface.h"
-#include "be_extern.h"
-#include "utl_identifier.h"
-
-ACE_RCSID (be,
- be_interface_strategy,
- "$Id$")
-
-
-be_interface_strategy::be_interface_strategy (be_interface *node,
- Strategy_Kind strategy_type)
- : local_name_(0),
- full_name_(0),
- flat_name_(0),
- repoID_(0),
- full_skel_name_(0),
- full_coll_name_(0),
- local_coll_name_(0),
- relative_skel_name_(0),
- node_ (node),
- cached_type_ (-1),
- strategy_type_ (strategy_type)
-{
-}
-
-be_interface_strategy::~be_interface_strategy (void)
-{
-}
-
-// Interface Type Strategy Base Class
-
-// Relative skeleton name.
-const char *
-be_interface_strategy::relative_skel_name (const char *skel_name)
-{
- return be_interface::relative_name (this->full_skel_name (),
- skel_name);
-}
-
-
-
-// Compute stringified fully qualified collocated class name.
-void
-be_interface_strategy::compute_coll_names (int type,
- const char *prefix,
- const char *suffix)
-{
- if (type == this->cached_type_ && this->full_coll_name_ != 0)
- {
- return;
- }
- else
- {
- this->cached_type_ = type;
- delete [] this->full_coll_name_;
- delete [] this->local_coll_name_;
- }
-
- static const char *collocated_names[] = {"_tao_thru_poa_collocated_",
- "_tao_direct_collocated_"};
- static const char *poa = "POA_";
-
- // Reserve enough room for the "POA_" prefix, the "_tao_collocated_"
- // prefix and the local name and the (optional) "::"
- const char *collocated = collocated_names[type];
-
- size_t name_len = ACE_OS::strlen (collocated)
- + ACE_OS::strlen (poa)
- + 1;
-
- if (prefix)
- {
- name_len += ACE_OS::strlen (prefix);
- }
-
- if (suffix)
- {
- name_len += ACE_OS::strlen (suffix);
- }
-
- for (UTL_IdListActiveIterator i (this->node_->name ());
- !i.is_done ();
- i.next ())
- {
- // Reserve 2 characters for "::".
- name_len += ACE_OS::strlen (i.item ()->get_string ()) + 2;
- }
-
- ACE_NEW (this->full_coll_name_,
- char[name_len + 1]);
-
- // Null terminate the string.
- this->full_coll_name_[0] = 0;
-
- // Only the first component get the "POA_" preffix.
- int poa_added = 0;
-
- // Iterate again.
- // Must advance the iterator explicitly inside the loop.
- for (UTL_IdListActiveIterator j (this->node_->name ());
- !j.is_done ();)
- {
- const char *item = j.item ()->get_string ();
-
- // Increase right away, so we can test for the final component
- // in the loop.
- j.next ();
-
- // We add the POA_ preffix only if the first component is not
- // the global scope...
- if (ACE_OS::strcmp (item, "") != 0)
- {
- if (!j.is_done ())
- {
- // We only add the POA_ preffix if there are more than
- // two components in the name, in other words, if the
- // class is inside some scope.
- if (!poa_added)
- {
- ACE_OS::strcat (this->full_coll_name_, poa);
- poa_added = 1;
- }
- ACE_OS::strcat (this->full_coll_name_, item);
- ACE_OS::strcat (this->full_coll_name_, "::");
- }
- else
- {
- ACE_OS::strcat (this->full_coll_name_, collocated);
-
- if (prefix)
- {
- ACE_OS::strcat (this->full_coll_name_, prefix);
- }
-
- ACE_OS::strcat (this->full_coll_name_, item);
-
- if (suffix)
- {
- ACE_OS::strcat (this->full_coll_name_, suffix);
- }
- }
- }
- }
-
- // Compute the local name for the collocated class.
- char *local_name = this->node_->AST_Interface::local_name ()->get_string ();
- size_t local_len = ACE_OS::strlen (collocated)
- + ACE_OS::strlen (local_name)
- + 1;
- if (prefix)
- {
- local_len += ACE_OS::strlen (prefix);
- }
-
- if (suffix)
- {
- local_len += ACE_OS::strlen (suffix);
- }
-
- ACE_NEW (this->local_coll_name_,
- char[local_len]);
-
- ACE_OS::strcpy (this->local_coll_name_,
- collocated);
-
- if (prefix)
- {
- ACE_OS::strcat (this->local_coll_name_,
- prefix);
- }
-
- ACE_OS::strcat (this->local_coll_name_,
- node_->AST_Interface::local_name ()->get_string ());
-
- if (suffix)
- {
- ACE_OS::strcat (this->local_coll_name_, suffix);
- }
-}
-
-
-void
-be_interface_strategy::compute_names (const char *name,
- const char *prefix,
- const char *suffix,
- char *&new_name)
-{
- if (!prefix || !suffix)
- {
- return;
- }
-
- size_t name_length = ACE_OS::strlen (name) +
- ACE_OS::strlen (prefix) +
- ACE_OS::strlen (suffix);
-
- ACE_NEW (new_name,
- char[name_length + 1]);
-
- // Copy it in.
- ACE_OS::strcpy (new_name, name);
-
- const char *interface_name = 0;
- size_t i = ACE_OS::strlen (name);
-
- for (;i >= 1; i--)
- {
- if (name[i-1] == ':' && name[i] == ':')
- {
- interface_name = &name[i+1];
- break;
- }
- else if (i >= 3)
- {
- if (name[i-3] == 'P' &&
- name[i-2] == 'O' &&
- name[i-1] == 'A' &&
- name[i] == '_')
- {
- interface_name = &name[i+1];
- break;
- }
- }
- }
-
- if (interface_name == 0)
- {
- interface_name = name;
- }
-
- ACE_OS::strcpy (&new_name[name_length
- - ACE_OS::strlen (prefix)
- - ACE_OS::strlen (interface_name)
- - ACE_OS::strlen (suffix)],
- prefix);
-
- ACE_OS::strcpy (&new_name[name_length
- - ACE_OS::strlen (interface_name)
- - ACE_OS::strlen (suffix)],
- interface_name);
-
- ACE_OS::strcpy (&new_name[name_length
- - ACE_OS::strlen(suffix)],
- suffix);
-}
-
-
-TAO_OutStream *
-be_interface_strategy::get_out_stream (void)
-{
- // Outstream.
- return tao_cg->server_skeletons ();
-}
-
-const char *
-be_interface_strategy::get_out_stream_fname (void)
-{
- return be_global->be_get_server_skeleton_fname ();
-}
-
-int
-be_interface_strategy::strategy_type (void)
-{
- return strategy_type_;
-}
-
-TAO_CodeGen::CG_STATE
-be_interface_strategy::next_state (TAO_CodeGen::CG_STATE current_state,
- int /* is_extra_state */)
-{
- return current_state;
-}
-
-int
-be_interface_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE /* current_state */
- )
-{
- return 0;
-}
-
-be_interface *
-be_interface_strategy::replacement (void)
-{
- return 0;
-}
-
-void
-be_interface_strategy::destroy (void)
-{
- if (this->local_name_ != 0)
- {
- delete [] this->local_name_;
- this->local_name_ = 0;
- }
-
- if (this->full_name_ != 0)
- {
- delete [] this->full_name_;
- this->full_name_ = 0;
- }
-
- if (this->flat_name_ != 0)
- {
- delete [] this->flat_name_;
- this->flat_name_ = 0;
- }
-
- if (this->repoID_ != 0)
- {
- delete [] this->repoID_;
- this->repoID_ = 0;
- }
-
- if (this->full_skel_name_ != 0)
- {
- delete [] this->full_skel_name_;
- this->full_skel_name_ = 0;
- }
-
- if (this->full_coll_name_ != 0)
- {
- delete [] this->full_coll_name_;
- this->full_coll_name_ = 0;
- }
-
- if (this->local_coll_name_ != 0)
- {
- delete [] this->local_coll_name_;
- this->local_coll_name_ = 0;
- }
-
- if (this->relative_skel_name_ != 0)
- {
- delete [] this->relative_skel_name_;
- this->relative_skel_name_ = 0;
- }
-}
-
-// ****************************************************************
-// Default Strategy
-
-const char *be_interface_default_strategy::suffix_table_[] =
-{
- "_Proxy_Impl",
- "_Proxy_Broker"
-};
-
-const char *be_interface_default_strategy::tag_table_[] =
-{
- "_Remote",
- "_ThruPOA",
- "_Direct",
- "_Strategized",
- "_TAO_"
-};
-
-
-be_interface_default_strategy::be_interface_default_strategy (
- be_interface *node,
- Strategy_Kind strategy_kind
- )
- : be_interface_strategy (node,
- strategy_kind),
- base_proxy_impl_name_ (0),
- remote_proxy_impl_name_ (0),
- direct_proxy_impl_name_ (0),
- full_base_proxy_impl_name_ (0),
- full_remote_proxy_impl_name_ (0),
- full_direct_proxy_impl_name_ (0),
- base_proxy_broker_ (0),
- remote_proxy_broker_ (0),
- strategized_proxy_broker_ (0),
- full_base_proxy_broker_name_ (0),
- full_remote_proxy_broker_name_ (0),
- full_strategized_proxy_broker_name_(0),
- client_scope_ (0),
- flat_client_scope_ (0),
- server_scope_ (0),
- flat_server_scope_ (0)
-{
-}
-
-be_interface_default_strategy::~be_interface_default_strategy (void)
-{
-}
-
-const char *
-be_interface_default_strategy::full_name (void)
-{
- if (this->full_name_ == 0)
- {
- size_t len = ACE_OS::strlen (node_->be_decl::full_name ());
-
- ACE_NEW_RETURN (this->full_name_,
- char[len + 1],
- 0);
-
- ACE_OS::strcpy (this->full_name_,
- node_->be_decl::full_name ());
- }
-
- return this->full_name_;
-}
-
-const char *
-be_interface_default_strategy::local_name (void)
-{
- if (!this->local_name_)
- {
- size_t len =
- ACE_OS::strlen (node_->AST_Interface::local_name ()->get_string ());
-
- ACE_NEW_RETURN (this->local_name_,
- char[len + 1],
- 0);
-
- ACE_OS::strcpy (this->local_name_,
- node_->AST_Interface::local_name ()->get_string ());
- }
-
- return this->local_name_;
-}
-
-const char *
-be_interface_default_strategy::flat_name (void)
-{
- if (!this->flat_name_)
- {
- size_t len = ACE_OS::strlen (node_->be_decl::flat_name ());
-
- ACE_NEW_RETURN (this->flat_name_,
- char[len + 1],
- 0);
-
- ACE_OS::strcpy (this->flat_name_,
- node_->be_decl::flat_name ());
- }
-
- return this->flat_name_;
-}
-
-const char *
-be_interface_default_strategy::repoID (void)
-{
- if (this->repoID_ == 0)
- {
- size_t len = ACE_OS::strlen (node_->be_decl::repoID ());
-
- ACE_NEW_RETURN (this->repoID_,
- char[len + 1],
- 0);
-
- ACE_OS::strcpy (this->repoID_,
- node_->be_decl::repoID ());
- }
-
- return this->repoID_;
-}
-
-const char *
-be_interface_default_strategy::full_skel_name (void)
-{
- if (this->full_skel_name_ == 0)
- {
- // the following method is inherited from the base class
- node_->compute_full_skel_name ("POA_",
- this->full_skel_name_);
- }
-
- return this->full_skel_name_;
-}
-
-
-const char *
-be_interface_default_strategy::full_coll_name (int type)
-{
- this->compute_coll_names (type,
- 0, // prefix
- 0); // suffix
-
- return this->full_coll_name_;
-}
-
-const char *
-be_interface_default_strategy::local_coll_name (int type)
-{
- this->compute_coll_names (type,
- 0, // prefix
- 0); // suffix
-
- return this->local_coll_name_;
-}
-
-char *
-be_interface_default_strategy::create_with_prefix_suffix (
- const char *prefix,
- const char *str,
- const char *suffix,
- const char *separator
- )
-{
- char *cat_string = 0;
- size_t length =
- ACE_OS::strlen (str) +
- ACE_OS::strlen (prefix) +
- ACE_OS::strlen (suffix) +
- ACE_OS::strlen (separator) +
- 1; // The '/0'
-
- ACE_NEW_RETURN (cat_string,
- char[length],
- 0);
-
- ACE_OS::strcpy (cat_string, prefix);
- ACE_OS::strcat (cat_string, str);
- ACE_OS::strcat (cat_string, separator);
- ACE_OS::strcat (cat_string, suffix);
-
- return cat_string;
-}
-
-const char *
-be_interface_default_strategy::base_proxy_impl_name (void)
-{
- if (this->base_proxy_impl_name_ != 0)
- {
- return this->base_proxy_impl_name_;
- }
-
- this->base_proxy_impl_name_ =
- this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
- this->node_->local_name (),
- this->suffix_table_[PROXY_IMPL]);
-
- return this->base_proxy_impl_name_;
-}
-
-
-const char *
-be_interface_default_strategy::client_scope (void)
-{
- if (this->client_scope_ != 0)
- {
- return this->client_scope_;
- }
-
- const char *full_name = this->full_name ();
- const char *name = this->local_name ();
-
- size_t offset = ACE_OS::strlen (name);
- size_t length = ACE_OS::strlen (full_name) - offset;
- ACE_NEW_RETURN (this->client_scope_,
- char[length + 1],
- 0);
-
- ACE_OS::strncpy (this->client_scope_, full_name, length);
- this->client_scope_[length] = '\0';
-
- return this->client_scope_;
-}
-const char *
-be_interface_default_strategy::flat_client_scope (void)
-{
- if (this->flat_client_scope_ != 0)
- {
- return this->flat_client_scope_;
- }
-
- const char *full_name = this->flat_name ();
- const char *name = this->local_name ();
-
- size_t offset = ACE_OS::strlen (name);
- size_t length = ACE_OS::strlen (full_name) - offset;
- ACE_NEW_RETURN (this->flat_client_scope_,
- char[length + 1],
- 0);
-
- ACE_OS::strncpy (this->flat_client_scope_, full_name, length);
- this->flat_client_scope_[length] = '\0';
-
- return this->flat_client_scope_;
-}
-
-
-const char *
-be_interface_default_strategy::server_scope (void)
-{
- if (this->server_scope_ != 0)
- {
- return this->server_scope_;
- }
-
- const char *full_name =
- this->node_->full_coll_name (be_interface::DIRECT);
-
- const char *name = this->node_->local_coll_name (be_interface::DIRECT);
-
- size_t offset = ACE_OS::strlen (name);
- size_t length = ACE_OS::strlen (full_name) - offset;
- ACE_NEW_RETURN (this->server_scope_,
- char[length + 1],
- 0);
-
- ACE_OS::strncpy (this->server_scope_, full_name, length);
- this->server_scope_[length] = '\0';
-
- return this->server_scope_;
-}
-
-const char *
-be_interface_default_strategy::flat_server_scope (void)
-{
- if (this->flat_server_scope_ != 0)
- {
- return this->flat_server_scope_;
- }
-
- const char *full_name = this->flat_name ();
- const char *name = this->local_name ();
-
- size_t offset = ACE_OS::strlen (name);
- size_t length = ACE_OS::strlen (full_name) - offset;
- ACE_NEW_RETURN (this->flat_client_scope_,
- char[length + 1],
- 0);
-
- ACE_OS::strncpy (this->flat_server_scope_, full_name, length);
- this->flat_server_scope_[length] = '\0';
-
- return this->flat_server_scope_;
-}
-
-
-
-const char *
-be_interface_default_strategy::full_base_proxy_impl_name (void)
-{
- if (this->full_base_proxy_impl_name_ != 0)
- {
- return this->full_base_proxy_impl_name_;
- }
-
- const char *scope = this->client_scope ();
- const char *base_name = this->base_proxy_impl_name ();
- size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
- ACE_NEW_RETURN (this->full_base_proxy_impl_name_,
- char[length + 1],
- 0);
-
- ACE_OS::strcpy (this->full_base_proxy_impl_name_, scope);
- ACE_OS::strcat (this->full_base_proxy_impl_name_, base_name);
-
- return this->full_base_proxy_impl_name_;
-}
-
-
-
-const char *
-be_interface_default_strategy::remote_proxy_impl_name (void)
-{
- if (this->remote_proxy_impl_name_ != 0)
- {
- return this->remote_proxy_impl_name_;
- }
-
-
- this->remote_proxy_impl_name_ =
- this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
- this->node_->local_name (),
- this->suffix_table_[PROXY_IMPL],
- this->tag_table_[REMOTE]);
-
- return this->remote_proxy_impl_name_;
-}
-
-const char *
-be_interface_default_strategy::full_remote_proxy_impl_name (void)
-{
- if (this->full_remote_proxy_impl_name_ != 0)
- {
- return this->full_remote_proxy_impl_name_;
- }
-
- const char *scope = this->client_scope ();
- const char *base_name = this->remote_proxy_impl_name ();
- size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
- ACE_NEW_RETURN (this->full_remote_proxy_impl_name_,
- char[length + 1],
- 0);
-
- ACE_OS::strcpy (this->full_remote_proxy_impl_name_, scope);
- ACE_OS::strcat (this->full_remote_proxy_impl_name_, base_name);
-
- return this->full_remote_proxy_impl_name_;
-}
-
-const char *
-be_interface_default_strategy::direct_proxy_impl_name (void)
-{
- if (this->direct_proxy_impl_name_ != 0)
- {
- return this->direct_proxy_impl_name_;
- }
-
- this->direct_proxy_impl_name_ =
- this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
- this->node_->local_name (),
- this->suffix_table_[PROXY_IMPL],
- this->tag_table_[DIRECT]);
-
- return this->direct_proxy_impl_name_;
-}
-
-
-const char *
-be_interface_default_strategy::full_direct_proxy_impl_name (void)
-{
- if (this->full_direct_proxy_impl_name_ != 0)
- {
- return this->full_direct_proxy_impl_name_;
- }
-
- const char *scope = this->server_scope ();
- const char *base_name = this->direct_proxy_impl_name ();
-
- size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
- ACE_NEW_RETURN (this->full_direct_proxy_impl_name_,
- char[length + 1],
- 0);
-
- ACE_OS::strcpy (this->full_direct_proxy_impl_name_, scope);
- ACE_OS::strcat (this->full_direct_proxy_impl_name_, base_name);
-
- return this->full_direct_proxy_impl_name_;
-}
-
-
-const char *
-be_interface_default_strategy::base_proxy_broker_name (void)
-{
- if (this->base_proxy_broker_ != 0)
- {
- return this->base_proxy_broker_;
- }
-
- this->base_proxy_broker_ =
- this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
- this->node_->local_name (),
- this->suffix_table_[PROXY_BROKER]);
-
- return this->base_proxy_broker_;
-}
-
-
-const char *
-be_interface_default_strategy::full_base_proxy_broker_name (void)
-{
- if (this->full_base_proxy_broker_name_ != 0)
- {
- return this->full_base_proxy_broker_name_;
- }
-
- const char *scope = this->client_scope ();
- const char *base_name = this->base_proxy_broker_name ();
- size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
- ACE_NEW_RETURN (this->full_base_proxy_broker_name_,
- char[length + 1],
- 0);
-
- ACE_OS::strcpy (this->full_base_proxy_broker_name_, scope);
- ACE_OS::strcat (this->full_base_proxy_broker_name_, base_name);
-
- return this->full_base_proxy_broker_name_;
-}
-
-const char *
-be_interface_default_strategy::remote_proxy_broker_name (void)
-{
- if (this->remote_proxy_broker_ != 0)
- {
- return this->remote_proxy_broker_;
- }
-
- this->remote_proxy_broker_ =
- this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
- this->node_->local_name (),
- this->suffix_table_[PROXY_BROKER],
- this->tag_table_[REMOTE]);
-
- return this->remote_proxy_broker_;
-}
-
-
-const char *
-be_interface_default_strategy::full_remote_proxy_broker_name (void)
-{
- if (this->full_remote_proxy_broker_name_ != 0)
- {
- return this->full_remote_proxy_broker_name_;
- }
-
- const char *scope = this->client_scope ();
- const char *base_name = this->remote_proxy_broker_name ();
- size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
- ACE_NEW_RETURN (this->full_remote_proxy_broker_name_,
- char[length + 1],
- 0);
-
- ACE_OS::strcpy (this->full_remote_proxy_broker_name_, scope);
- ACE_OS::strcat (this->full_remote_proxy_broker_name_, base_name);
-
- return this->full_remote_proxy_broker_name_;
-}
-
-
-const char *
-be_interface_default_strategy::strategized_proxy_broker_name (void)
-{
- if (this->strategized_proxy_broker_ != 0)
- {
- return this->strategized_proxy_broker_;
- }
-
- this->strategized_proxy_broker_ =
- this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
- this->node_->local_name (),
- this->suffix_table_[PROXY_BROKER],
- this->tag_table_[STRATEGIZED]);
-
- return this->strategized_proxy_broker_;
-}
-
-const char *
-be_interface_default_strategy::full_strategized_proxy_broker_name (void)
-{
- if (this->full_strategized_proxy_broker_name_ != 0)
- {
- return this->full_strategized_proxy_broker_name_;
- }
-
- const char *scope = this->server_scope ();
- const char *base_name = this->strategized_proxy_broker_name ();
- size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
- ACE_NEW_RETURN (this->full_strategized_proxy_broker_name_,
- char[length + 1],
- 0);
-
- ACE_OS::strcpy (this->full_strategized_proxy_broker_name_, scope);
- ACE_OS::strcat (this->full_strategized_proxy_broker_name_, base_name);
-
- return this->full_strategized_proxy_broker_name_;
-}
-
-void
-be_interface_default_strategy::destroy (void)
-{
- if (this->base_proxy_impl_name_ != 0)
- {
- delete [] this->base_proxy_impl_name_;
- this->base_proxy_impl_name_ = 0;
- }
-
- if (this->remote_proxy_impl_name_ != 0)
- {
- delete [] this->remote_proxy_impl_name_;
- this->remote_proxy_impl_name_ = 0;
- }
-
- if (this->direct_proxy_impl_name_ != 0)
- {
- delete [] this->direct_proxy_impl_name_;
- this->direct_proxy_impl_name_ = 0;
- }
-
- if (this->full_base_proxy_impl_name_ != 0)
- {
- delete [] this->full_base_proxy_impl_name_;
- this->full_base_proxy_impl_name_ = 0;
- }
-
- if (this->full_remote_proxy_impl_name_ != 0)
- {
- delete [] this->full_remote_proxy_impl_name_;
- this->full_remote_proxy_impl_name_ = 0;
- }
-
- if (this->full_direct_proxy_impl_name_ != 0)
- {
- delete [] this->full_direct_proxy_impl_name_;
- this->full_direct_proxy_impl_name_ = 0;
- }
-
- if (this->base_proxy_broker_ != 0)
- {
- delete [] this->base_proxy_broker_;
- this->base_proxy_broker_ = 0;
- }
-
- if (this->remote_proxy_broker_ != 0)
- {
- delete [] this->remote_proxy_broker_;
- this->remote_proxy_broker_ = 0;
- }
-
- if (this->strategized_proxy_broker_ != 0)
- {
- delete [] this->strategized_proxy_broker_;
- this->strategized_proxy_broker_ = 0;
- }
-
- if (this->full_base_proxy_broker_name_ != 0)
- {
- delete [] this->full_base_proxy_broker_name_;
- this->full_base_proxy_broker_name_ = 0;
- }
-
- if (this->full_remote_proxy_broker_name_ != 0)
- {
- delete [] this->full_remote_proxy_broker_name_;
- this->full_remote_proxy_broker_name_ = 0;
- }
-
- if (this->full_strategized_proxy_broker_name_ != 0)
- {
- delete [] this->full_strategized_proxy_broker_name_;
- this->full_strategized_proxy_broker_name_ = 0;
- }
-
- if (this->client_scope_ != 0)
- {
- delete [] this->client_scope_;
- this->client_scope_ = 0;
- }
-
- if (this->flat_client_scope_ != 0)
- {
- delete [] this->flat_client_scope_;
- this->flat_client_scope_ = 0;
- }
-
- if (this->server_scope_ != 0)
- {
- delete [] this->server_scope_;
- this->server_scope_ = 0;
- }
-
- if (this->flat_server_scope_ != 0)
- {
- delete [] this->flat_server_scope_;
- this->flat_server_scope_ = 0;
- }
-
- this->be_interface_strategy::destroy ();
-}
-
-// ****************************************************************
-// AMI Handler Strategy
-
-be_interface_ami_handler_strategy::be_interface_ami_handler_strategy (
- be_interface *node
- )
- : be_interface_default_strategy (node,
- AMI_HANDLER)
-{
-}
-
-be_interface_ami_handler_strategy::~be_interface_ami_handler_strategy (void)
-{
-}
-
-
-TAO_CodeGen::CG_STATE
-be_interface_ami_handler_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int /*is_extra_state */
- )
-{
- return current_state;
-}
-
-
-// ****************************************************************
-// AMI Exception Holder Strategy
-
-be_interface_ami_exception_holder_strategy::
-be_interface_ami_exception_holder_strategy (be_interface *node)
- : be_interface_default_strategy (node,
- AMI_EXCEPTION_HOLDER)
-{
-}
-
-be_interface_ami_exception_holder_strategy
-::~be_interface_ami_exception_holder_strategy (void)
-{
-}
-
-
-TAO_CodeGen::CG_STATE
-be_interface_ami_exception_holder_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int is_extra_state
- )
-{
- if (is_extra_state)
- {
- switch (current_state)
- {
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CH:
- return TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CH;
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CS:
- return TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CS;
- default:
- return current_state;
- }
- }
- else
- {
- return current_state;
- }
-}
-
-
-int
-be_interface_ami_exception_holder_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE current_state
- )
-{
- if (current_state == TAO_CodeGen::TAO_VALUETYPE_OBV_CH
- || current_state == TAO_CodeGen::TAO_VALUETYPE_OBV_CS)
- {
- return 1;
- }
- else
- {
- return 0;
- }
-}
-
-
-// ****************************************************************
-// AMI Strategy
-
-be_interface_ami_strategy::be_interface_ami_strategy (be_interface *node,
- be_interface *handler)
- : be_interface_default_strategy (node,
- AMI_INTERFACE),
- handler_ (handler)
-{
-}
-
-be_interface_ami_strategy::~be_interface_ami_strategy (void)
-{
-}
-
-
-TAO_CodeGen::CG_STATE
-be_interface_ami_strategy::next_state (TAO_CodeGen::CG_STATE current_state,
- int is_extra_state)
-{
- if (is_extra_state)
- {
- switch (current_state)
- {
- case TAO_CodeGen::TAO_AMI_INTERFACE_CH:
- return TAO_CodeGen::TAO_INTERFACE_CH;
- default:
- return current_state;
- }
- }
- else
- {
- switch (current_state)
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- return TAO_CodeGen::TAO_AMI_INTERFACE_CH;
- default:
- return current_state;
- }
- }
-}
-
-
-int
-be_interface_ami_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE current_state
- )
-{
- if (current_state == TAO_CodeGen::TAO_AMI_INTERFACE_CH)
- {
- return 1;
- }
- else
- {
- return 0;
- }
-}
-
-be_interface *
-be_interface_ami_strategy::replacement (void)
-{
- return handler_;
-}
-
diff --git a/TAO/TAO_IDL/be/be_module.cpp b/TAO/TAO_IDL/be/be_module.cpp
deleted file mode 100644
index 363585e7d47..00000000000
--- a/TAO/TAO_IDL/be/be_module.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_module.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Module that provides additional means for C++
-// mapping of a module
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_module.h"
-#include "be_visitor.h"
-
-ACE_RCSID (be,
- be_module,
- "$Id$")
-
-be_module::be_module (void)
- : COMMON_Base (),
- AST_Decl (),
- UTL_Scope (),
- be_scope (),
- be_decl ()
-{
-}
-
-be_module::be_module (UTL_ScopedName *n)
- : COMMON_Base (),
- AST_Decl (AST_Decl::NT_module,
- n),
- UTL_Scope (AST_Decl::NT_module),
- AST_Module (n),
- be_scope (AST_Decl::NT_module),
- be_decl (AST_Decl::NT_module,
- n)
-{
-}
-
-void
-be_module::destroy (void)
-{
- // Call the destroy methods of our base classes.
- this->be_scope::destroy ();
- this->be_decl::destroy ();
- this->AST_Module::destroy ();
-}
-
-int
-be_module::accept (be_visitor *visitor)
-{
- return visitor->visit_module (this);
-}
-
-// Narrowing
-IMPL_NARROW_METHODS3 (be_module, AST_Module, be_scope, be_decl)
-IMPL_NARROW_FROM_DECL (be_module)
-IMPL_NARROW_FROM_SCOPE (be_module)
diff --git a/TAO/TAO_IDL/be/be_native.cpp b/TAO/TAO_IDL/be/be_native.cpp
deleted file mode 100644
index 5174efd0f5d..00000000000
--- a/TAO/TAO_IDL/be/be_native.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_native.cpp
-//
-// = DESCRIPTION
-// The native IDL type
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_native.h"
-#include "be_visitor.h"
-
-ACE_RCSID (be,
- be_native,
- "$Id$")
-
-
-be_native::be_native (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_ConcreteType (),
- UTL_Scope (),
- AST_Structure (),
- AST_Native (),
- be_scope (),
- be_decl (),
- be_type (),
- be_exception ()
-{
-}
-
-be_native::be_native (UTL_ScopedName *n)
- : COMMON_Base (),
- AST_Decl (AST_Decl::NT_native,
- n),
- AST_Type (AST_Decl::NT_native,
- n),
- AST_ConcreteType (AST_Decl::NT_native,
- n),
- UTL_Scope (AST_Decl::NT_native),
- AST_Structure (AST_Decl::NT_native,
- n,
- true,
- false),
- AST_Exception (n,
- true,
- false),
- AST_Native (n),
- be_decl (AST_Decl::NT_native,
- n),
- be_type (AST_Decl::NT_native,
- n),
- be_exception (n,
- true,
- false)
-{
-}
-
-int
-be_native::gen_typecode (void)
-{
- return 0;
-}
-
-long
-be_native::tc_size (void)
-{
- return 0;
-}
-
-void
-be_native::destroy (void)
-{
- this->be_exception::destroy ();
- this->AST_Native::destroy ();
-}
-
-int
-be_native::accept (be_visitor *visitor)
-{
- return visitor->visit_native (this);
-}
-
-// Narrowing
-IMPL_NARROW_METHODS2(be_native, AST_Native, be_exception)
-IMPL_NARROW_FROM_DECL(be_native)
diff --git a/TAO/TAO_IDL/be/be_operation.cpp b/TAO/TAO_IDL/be/be_operation.cpp
deleted file mode 100644
index 40e2f7bd36b..00000000000
--- a/TAO/TAO_IDL/be/be_operation.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_operation.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Operation that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_operation.h"
-#include "be_operation_strategy.h"
-#include "be_predefined_type.h"
-#include "be_argument.h"
-#include "be_visitor.h"
-#include "global_extern.h"
-
-ACE_RCSID (be,
- be_operation,
- "$Id$")
-
-be_operation::be_operation (void)
- : COMMON_Base (),
- AST_Decl (),
- UTL_Scope (),
- AST_Operation (),
- be_scope (),
- be_decl ()
-{
- ACE_NEW (this->strategy_,
- be_operation_default_strategy (this));
-}
-
-be_operation::be_operation (AST_Type *rt,
- AST_Operation::Flags fl,
- UTL_ScopedName *n,
- bool local,
- bool abstract)
- : COMMON_Base (local,
- abstract),
- AST_Decl (AST_Decl::NT_op,
- n),
- UTL_Scope (AST_Decl::NT_op),
- AST_Operation (rt,
- fl,
- n,
- local,
- abstract),
- be_scope (AST_Decl::NT_op),
- be_decl (AST_Decl::NT_op,
- n)
-{
- ACE_NEW (this->strategy_,
- be_operation_default_strategy (this));
-
- if (this->imported ())
- {
- return;
- }
-
- idl_global->operation_seen_ = true;
-
- if (!this->is_local ())
- {
- be_type *bt = be_type::narrow_from_decl (rt);
- bt->seen_in_operation (true);
- this->set_arg_seen_bit (bt);
- idl_global->non_local_op_seen_ = true;
- }
-}
-
-
-be_operation::~be_operation (void)
-{
-}
-
-void
-be_operation::destroy (void)
-{
- if (0 != this->strategy_)
- {
- this->strategy_->destroy ();
- delete this->strategy_;
- this->strategy_ = 0;
- }
-
- // Call the destroy methods of our base classes.
- this->be_scope::destroy ();
- this->be_decl::destroy ();
- this->AST_Operation::destroy ();
-}
-
-int
-be_operation::accept (be_visitor *visitor)
-{
- return visitor->visit_operation (this);
-}
-
-be_operation_strategy *
-be_operation::set_strategy (be_operation_strategy *new_strategy)
-{
- be_operation_strategy *old = this->strategy_;
-
- if (new_strategy != 0)
- {
- this->strategy_ = new_strategy;
- }
-
- return old;
-}
-
-
-TAO_CodeGen::CG_STATE
-be_operation::next_state (TAO_CodeGen::CG_STATE current_state,
- int is_extra_state)
-{
- return this->strategy_->next_state (current_state, is_extra_state);
-}
-
-int
-be_operation::has_extra_code_generation (TAO_CodeGen::CG_STATE current_state)
-{
- return this->strategy_->has_extra_code_generation (current_state);
-}
-
-be_operation*
-be_operation::marshaling (void)
-{
- return this->strategy_->marshaling ();
-}
-
-be_operation*
-be_operation::arguments (void)
-{
- return this->strategy_->arguments ();
-}
-
-
-// Narrowing
-IMPL_NARROW_METHODS3 (be_operation, AST_Operation, be_scope, be_decl)
-IMPL_NARROW_FROM_DECL (be_operation)
-IMPL_NARROW_FROM_SCOPE (be_operation)
diff --git a/TAO/TAO_IDL/be/be_operation_strategy.cpp b/TAO/TAO_IDL/be/be_operation_strategy.cpp
deleted file mode 100644
index d4af00fa11b..00000000000
--- a/TAO/TAO_IDL/be/be_operation_strategy.cpp
+++ /dev/null
@@ -1,381 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_operation_strategy.cpp
-//
-// = DESCRIPTION
-// A strategy to cover the differences between various variants
-// of an operations, e.g. AMI sendc_, AMI raise_
-//
-// = AUTHOR
-// Michael Kircher
-//
-// ============================================================================
-
-#include "be_operation_strategy.h"
-#include "be_operation.h"
-
-ACE_RCSID (be,
- be_operation_strategy,
- "$Id$")
-
-
-be_operation_strategy::be_operation_strategy (be_operation *node,
- Strategy_Kind strategy_type)
- : node_ (node),
- strategy_type_ (strategy_type)
-{
-}
-
-be_operation_strategy::~be_operation_strategy (void)
-{
-}
-
-int
-be_operation_strategy::strategy_type (void)
-{
- return strategy_type_;
-}
-
-int
-be_operation_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE /* current_state */
- )
-{
- return 0;
-}
-
-be_operation *
-be_operation_strategy::marshaling (void)
-{
- return 0;
-}
-
-be_operation *
-be_operation_strategy::arguments (void)
-{
- return 0;
-}
-
-be_operation_strategy *
-be_operation_strategy::copy (void)
-{
- return 0;
-}
-
-void
-be_operation_strategy::destroy (void)
-{
-}
-
-// ****************************************************************
-// AMI sendc_ operation strategy
-
-be_operation_default_strategy::be_operation_default_strategy (
- be_operation *node
- )
- : be_operation_strategy (node,
- DEFAULT)
-{
-}
-
-be_operation_default_strategy::~be_operation_default_strategy (void)
-{
-}
-
-TAO_CodeGen::CG_STATE
-be_operation_default_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int /* is_extra_state */
- )
-{
- return current_state;
-}
-
-be_operation_strategy *
-be_operation_default_strategy::copy (void)
-{
- be_operation_default_strategy *retval = 0;
- ACE_NEW_RETURN (retval,
- be_operation_default_strategy (this->node_),
- 0);
- retval->strategy_type_ = this->strategy_type_;
- return retval;
-}
-
-// ****************************************************************
-// AMI sendc_ operation strategy
-
-be_operation_ami_sendc_strategy::be_operation_ami_sendc_strategy (
- be_operation *node,
- be_operation *marshaling,
- be_operation *arguments
- )
- : be_operation_strategy (node,
- AMI_SENDC),
- marshaling_ (marshaling),
- arguments_ (arguments),
- owns_operations_ (true)
-{
-}
-
-be_operation_ami_sendc_strategy::~be_operation_ami_sendc_strategy (void)
-{
-}
-
-TAO_CodeGen::CG_STATE
-be_operation_ami_sendc_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int is_extra_state
- )
-{
- if (is_extra_state)
- {
- switch (current_state)
- {
- case TAO_CodeGen::TAO_OPERATION_CH:
- return TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CH;
- case TAO_CodeGen::TAO_OPERATION_CS:
- return TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CS;
- default:
- return current_state;
- }
- }
- else
- {
- return current_state;
- }
-}
-
-int
-be_operation_ami_sendc_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE current_state
- )
-{
- if (current_state == TAO_CodeGen::TAO_OPERATION_CH
- || current_state == TAO_CodeGen::TAO_OPERATION_CS)
- {
- return 1;
- }
- else
- {
- return 0;
- }
-}
-
-be_operation*
-be_operation_ami_sendc_strategy::marshaling (void)
-{
- return marshaling_;
-}
-
-
-be_operation*
-be_operation_ami_sendc_strategy::arguments (void)
-{
- return arguments_;
-}
-
-be_operation_strategy *
-be_operation_ami_sendc_strategy::copy (void)
-{
- be_operation_ami_sendc_strategy *retval = 0;
- ACE_NEW_RETURN (retval,
- be_operation_ami_sendc_strategy (this->node_,
- this->marshaling_,
- this->arguments_),
- 0);
- retval->strategy_type_ = this->strategy_type_;
- retval->owns_operations_ = false;
- return retval;
-}
-
-void
-be_operation_ami_sendc_strategy::destroy (void)
-{
- if (this->owns_operations_)
- {
- this->marshaling_->destroy ();
- delete this->marshaling_;
- this->marshaling_ = 0;
-
- this->arguments_->destroy ();
- delete this->arguments_;
- this->arguments_ = 0;
- }
-
- this->be_operation_strategy::destroy ();
-}
-
-// ****************************************************************
-// AMI ExceptionHolder raise_ operation strategy
-
-be_operation_ami_exception_holder_raise_strategy
-::be_operation_ami_exception_holder_raise_strategy (be_operation *node)
- : be_operation_strategy (node,
- AMI_EXCEPTION_HOLDER_RAISE)
-{
-}
-
-be_operation_ami_exception_holder_raise_strategy
-::~be_operation_ami_exception_holder_raise_strategy (void)
-{
-}
-
-
-TAO_CodeGen::CG_STATE
-be_operation_ami_exception_holder_raise_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int is_extra_state
- )
-{
- if (!is_extra_state)
- {
- switch (current_state)
- {
- case TAO_CodeGen::TAO_OPERATION_CS:
- return TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_RAISE_OPERATION_CS;
- default:
- return current_state;
- }
- }
- else
- {
- return current_state;
- }
-}
-
-be_operation_strategy *
-be_operation_ami_exception_holder_raise_strategy::copy (void)
-{
- be_operation_ami_exception_holder_raise_strategy *retval = 0;
- ACE_NEW_RETURN (retval,
- be_operation_ami_exception_holder_raise_strategy (
- this->node_
- ),
- 0);
- retval->strategy_type_ = this->strategy_type_;
- return retval;
-}
-
-// ****************************************************************
-// AMI Reply Handler reply stub operation strategy
-
-be_operation_ami_handler_reply_stub_strategy
-::be_operation_ami_handler_reply_stub_strategy (be_operation *node)
- : be_operation_strategy (node,
- AMI_EXCEPTION_HOLDER_RAISE)
-{
-}
-
-be_operation_ami_handler_reply_stub_strategy
-::~be_operation_ami_handler_reply_stub_strategy (void)
-{
-}
-
-TAO_CodeGen::CG_STATE
-be_operation_ami_handler_reply_stub_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int is_extra_state
- )
-{
- if (is_extra_state)
- {
- switch (current_state)
- {
- case TAO_CodeGen::TAO_OPERATION_CH:
- return TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CH;
-
- case TAO_CodeGen::TAO_OPERATION_CS:
- return TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CS;
-
- default:
- return current_state;
- }
- }
- else
- {
- return current_state;
- }
-}
-
-int
-be_operation_ami_handler_reply_stub_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE current_state
- )
-{
- if (current_state == TAO_CodeGen::TAO_OPERATION_CH
- || current_state == TAO_CodeGen::TAO_OPERATION_CS)
- {
- return 1;
- }
- else
- {
- return 0;
- }
-}
-
-be_operation_strategy *
-be_operation_ami_handler_reply_stub_strategy::copy (void)
-{
- be_operation_ami_handler_reply_stub_strategy *retval = 0;
- ACE_NEW_RETURN (retval,
- be_operation_ami_handler_reply_stub_strategy (this->node_),
- 0);
- retval->strategy_type_ = this->strategy_type_;
- return retval;
-}
-
-// ****************************************************************
-// AMH Strategy
-
-be_operation_amh_strategy::be_operation_amh_strategy (be_operation *node)
- : be_operation_strategy (node, AMI_EXCEPTION_HOLDER_RAISE)
-{
-}
-
-be_operation_amh_strategy::~be_operation_amh_strategy (void)
-{
-}
-
-TAO_CodeGen::CG_STATE
-be_operation_amh_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int /* is_extra_state */
- )
-{
-// We don't know yet if we need extra state for AMH but
-// we''ll leave the placeholder code here anyway ...
- return current_state;
-}
-
-be_operation*
-be_operation_amh_strategy::arguments (void)
-{
- return arguments_;
-}
-
-int
-be_operation_amh_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE
- )
-{
- return 0;
-}
-
-be_operation_strategy *
-be_operation_amh_strategy::copy (void)
-{
- be_operation_amh_strategy *retval = 0;
- ACE_NEW_RETURN (retval,
- be_operation_amh_strategy (this->node_),
- 0);
- retval->arguments_ = this->arguments_;
- retval->strategy_type_ = this->strategy_type_;
- return retval;
-}
diff --git a/TAO/TAO_IDL/be/be_predefined_type.cpp b/TAO/TAO_IDL/be/be_predefined_type.cpp
deleted file mode 100644
index 0d1c7a6b69b..00000000000
--- a/TAO/TAO_IDL/be/be_predefined_type.cpp
+++ /dev/null
@@ -1,240 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_predefined_type.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_PredefinedType that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_predefined_type.h"
-#include "be_visitor.h"
-#include "utl_identifier.h"
-#include "global_extern.h"
-
-#include "ace/Log_Msg.h"
-#include "ace/ACE.h"
-#include "ace/OS_NS_stdio.h"
-
-ACE_RCSID (be,
- be_predefined_type,
- "$Id$")
-
-be_predefined_type::be_predefined_type (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_ConcreteType (),
- AST_PredefinedType (),
- be_decl (),
- be_type ()
-{
-}
-
-be_predefined_type::be_predefined_type (AST_PredefinedType::PredefinedType t,
- UTL_ScopedName *n)
- : COMMON_Base (),
- AST_Decl (AST_Decl::NT_pre_defined,
- n,
- true),
- AST_Type (AST_Decl::NT_pre_defined,
- n),
- AST_ConcreteType (AST_Decl::NT_pre_defined,
- n),
- AST_PredefinedType (t,
- n),
- be_decl (AST_Decl::NT_pre_defined,
- n),
- be_type (AST_Decl::NT_pre_defined,
- n)
-{
- // Computes the repoID.
- this->compute_repoID ();
-
- // Computes the fully scoped typecode name.
- this->compute_tc_name ();
-
- // Compute the flattened fully scoped name.
- this->AST_Decl::compute_flat_name ();
-
- if (t == AST_PredefinedType::PT_object)
- {
- this->fwd_helper_name_ = "::CORBA::tao_Object";
- }
- else if (t == AST_PredefinedType::PT_value)
- {
- this->fwd_helper_name_ = "::CORBA::tao_ValueBase";
- }
-
- switch (t)
- {
- case AST_PredefinedType::PT_char:
- case AST_PredefinedType::PT_wchar:
- case AST_PredefinedType::PT_boolean:
- case AST_PredefinedType::PT_octet:
- idl_global->ambiguous_type_seen_ = true;
- break;
- case AST_PredefinedType::PT_any:
- case AST_PredefinedType::PT_object:
- case AST_PredefinedType::PT_value:
- case AST_PredefinedType::PT_void:
- case AST_PredefinedType::PT_pseudo:
- break;
- default:
- idl_global->basic_type_seen_ = true;
- break;
- }
-}
-
-// Overriden method.
-void
-be_predefined_type::compute_tc_name (void)
-{
- // Start with the head as the CORBA namespace.
- Identifier *corba_id = 0;
- ACE_NEW (corba_id,
- Identifier ("CORBA"));
-
- ACE_NEW (this->tc_name_,
- UTL_ScopedName (corba_id,
- 0));
-
- Identifier *id = 0;
- UTL_ScopedName *conc_name = 0;
-
- switch (this->pt ())
- {
- case AST_PredefinedType::PT_void:
- ACE_NEW (id,
- Identifier ("_tc_void"));
- break;
- case AST_PredefinedType::PT_long:
- ACE_NEW (id,
- Identifier ("_tc_long"));
- break;
- case AST_PredefinedType::PT_longlong:
- ACE_NEW (id,
- Identifier ("_tc_longlong"));
- break;
- case AST_PredefinedType::PT_ulong:
- ACE_NEW (id,
- Identifier ("_tc_ulong"));
- break;
- case AST_PredefinedType::PT_ulonglong:
- ACE_NEW (id,
- Identifier ("_tc_ulonglong"));
- break;
- case AST_PredefinedType::PT_short:
- ACE_NEW (id,
- Identifier ("_tc_short"));
- break;
- case AST_PredefinedType::PT_ushort:
- ACE_NEW (id,
- Identifier ("_tc_ushort"));
- break;
- case AST_PredefinedType::PT_float:
- ACE_NEW (id,
- Identifier ("_tc_float"));
- break;
- case AST_PredefinedType::PT_double:
- ACE_NEW (id,
- Identifier ("_tc_double"));
- break;
- case AST_PredefinedType::PT_longdouble:
- ACE_NEW (id,
- Identifier ("_tc_longdouble"));
- break;
- case AST_PredefinedType::PT_char:
- ACE_NEW (id,
- Identifier ("_tc_char"));
- break;
- case AST_PredefinedType::PT_wchar:
- ACE_NEW (id,
- Identifier ("_tc_wchar"));
- break;
- case AST_PredefinedType::PT_octet:
- ACE_NEW (id,
- Identifier ("_tc_octet"));
- break;
- case AST_PredefinedType::PT_boolean:
- ACE_NEW (id,
- Identifier ("_tc_boolean"));
- break;
- case AST_PredefinedType::PT_any:
- ACE_NEW (id,
- Identifier ("_tc_any"));
- break;
- case AST_PredefinedType::PT_object:
- ACE_NEW (id,
- Identifier ("_tc_Object"));
- break;
- case AST_PredefinedType::PT_value:
- ACE_NEW (id,
- Identifier ("_tc_ValueBase"));
- break;
- case AST_PredefinedType::PT_pseudo:
- {
- char tcname [100];
- ACE_OS::sprintf (tcname,
- "_tc_%s",
- this->name ()->last_component ()->get_string ());
-
- ACE_NEW (id,
- Identifier (tcname));
- break;
- }
- default:
- ACE_ERROR ((LM_WARNING, "Unknown or invalid predefined type"));
- break;
- }
-
- ACE_NEW (conc_name,
- UTL_ScopedName (id,
- 0));
-
- this->tc_name_->nconc (conc_name);
-}
-
-void
-be_predefined_type::compute_repoID (void)
-{
- switch (this->pt ())
- {
- case AST_PredefinedType::PT_object:
- ACE::strdelete (this->repoID_);
- this->repoID_ = ACE::strnew ("IDL:omg.org/CORBA/Object:1.0");
- break;
- default:
- AST_Decl::compute_repoID ();
- break;
- }
-}
-
-int
-be_predefined_type::accept (be_visitor *visitor)
-{
- return visitor->visit_predefined_type (this);
-}
-
-void
-be_predefined_type::destroy (void)
-{
- this->AST_PredefinedType::destroy ();
- this->be_type::destroy ();
-}
-
-// Narrowing
-IMPL_NARROW_METHODS2 (be_predefined_type, AST_PredefinedType, be_type)
-IMPL_NARROW_FROM_DECL (be_predefined_type)
diff --git a/TAO/TAO_IDL/be/be_produce.cpp b/TAO/TAO_IDL/be/be_produce.cpp
deleted file mode 100644
index 3e749b5c50c..00000000000
--- a/TAO/TAO_IDL/be/be_produce.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-// $Id$
-
-/*
-
-COPYRIGHT
-
-Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United
-States of America. All Rights Reserved.
-
-This product is protected by copyright and distributed under the following
-license restricting its use.
-
-The Interface Definition Language Compiler Front End (CFE) is made
-available for your use provided that you include this license and copyright
-notice on all media and documentation and the software program in which
-this product is incorporated in whole or part. You may copy and extend
-functionality (but may not remove functionality) of the Interface
-Definition Language CFE without charge, but you are not authorized to
-license or distribute it to anyone else except as part of a product or
-program developed by you or with the express written consent of Sun
-Microsystems, Inc. ("Sun").
-
-The names of Sun Microsystems, Inc. and any of its subsidiaries or
-affiliates may not be used in advertising or publicity pertaining to
-distribution of Interface Definition Language CFE as permitted herein.
-
-This license is effective until terminated by Sun for failure to comply
-with this license. Upon termination, you shall destroy or return all code
-and documentation for the Interface Definition Language CFE.
-
-INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF
-ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS
-FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF
-DEALING, USAGE OR TRADE PRACTICE.
-
-INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT
-ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES
-TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT.
-
-SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH
-RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY
-INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF.
-
-IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR
-ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL
-DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-Use, duplication, or disclosure by the government is subject to
-restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
-Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR
-52.227-19.
-
-Sun, Sun Microsystems and the Sun logo are trademarks or registered
-trademarks of Sun Microsystems, Inc.
-
-SunSoft, Inc.
-2550 Garcia Avenue
-Mountain View, California 94043
-
-NOTE:
-
-SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are
-trademarks or registered trademarks of Sun Microsystems, Inc.
-
-*/
-
-#include "be_visitor_root.h"
-#include "be_visitor_ami_pre_proc.h"
-#include "be_visitor_amh_pre_proc.h"
-#include "be_visitor_ccm_pre_proc.h"
-#include "be_visitor_context.h"
-#include "be_root.h"
-#include "be_extern.h"
-#include "fe_extern.h"
-#include "global_extern.h"
-
-ACE_RCSID (be,
- be_produce,
- "$Id$")
-
-// Clean up before exit, whether successful or not.
-TAO_IDL_BE_Export void
-BE_cleanup (void)
-{
- idl_global->destroy ();
-}
-
-// Abort this run of the BE.
-TAO_IDL_BE_Export void
-BE_abort (void)
-{
- ACE_ERROR ((LM_ERROR,
- "Fatal Error - Aborting\n"));
-
- // BE_cleanup will be called after the exception is caught.
- throw FE_Bailout ();
-}
-
-void
-BE_visit_root (be_visitor_decl &root_visitor, const char *which_pass)
-{
- static be_root *root =
- be_root::narrow_from_decl (idl_global->root ());
-
- if (-1 == root->accept (&root_visitor))
- {
- ACE_ERROR ((LM_ERROR,
- "BE_visit_root - %s for Root failed\n",
- which_pass));
- BE_abort ();
- }
-
- root_visitor.ctx ()->reset ();
-}
-
-// Do the work of this BE. This is the starting point for code generation.
-TAO_IDL_BE_Export void
-BE_produce (void)
-{
- be_visitor_context ctx;
-
- if (!idl_global->ignore_idl3 ())
- {
- be_visitor_ccm_pre_proc ccm_preproc_visitor (&ctx);
- BE_visit_root (ccm_preproc_visitor, "CCM preprocessing");
- }
-
- if (be_global->ami_call_back ())
- {
- be_visitor_ami_pre_proc ami_preproc_visitor (&ctx);
- BE_visit_root (ami_preproc_visitor, "AMI preprocessing");
- }
-
- if (be_global->gen_amh_classes ())
- {
- be_visitor_amh_pre_proc amh_pre_proc_visitor (&ctx);
- BE_visit_root (amh_pre_proc_visitor, "AMH preprocessing");
- }
-
- const char *fname = be_global->be_get_anyop_header_fname ();
-
- // No-op if the -GA wasn't on the command line.
- if (-1 == tao_cg->start_anyop_header (fname))
- {
- BE_abort ();
- }
-
- ctx.state (TAO_CodeGen::TAO_ROOT_CH);
- be_visitor_root_ch root_ch_visitor (&ctx);
- BE_visit_root (root_ch_visitor, "client header");
-
- // Initialize the anyop source stream, if the option is set.
- // It has to be done after the stub header file generation,
- // where checks for recursive types are done,
- // and before stub source file generation, since
- // generation of Any-related #includes may be redirected.
- fname = be_global->be_get_anyop_source_fname ();
-
- if (-1 == tao_cg->start_anyop_source (fname))
- {
- BE_abort ();
- }
-
- if (be_global->gen_client_inline ())
- {
- ctx.state (TAO_CodeGen::TAO_ROOT_CI);
- be_visitor_root_ci root_ci_visitor (&ctx);
- BE_visit_root (root_ci_visitor, "client inline");
- }
-
- ctx.state (TAO_CodeGen::TAO_ROOT_CS);
- be_visitor_root_cs root_cs_visitor (&ctx);
- BE_visit_root (root_cs_visitor, "client stub");
-
- ctx.state (TAO_CodeGen::TAO_ROOT_SH);
- be_visitor_root_sh root_sh_visitor (&ctx);
- BE_visit_root (root_sh_visitor, "server header");
-
- // If skeleton file generation is suppressed, we're done.
- if (!be_global->gen_skel_files ())
- {
- BE_cleanup ();
- return;
- }
-
- if (be_global->gen_server_inline ())
- {
- ctx.state (TAO_CodeGen::TAO_ROOT_SI);
- be_visitor_root_si root_si_visitor (&ctx);
- BE_visit_root (root_si_visitor, "server inline");
- }
-
- ctx.state (TAO_CodeGen::TAO_ROOT_SS);
- be_visitor_root_ss root_ss_visitor (&ctx);
- BE_visit_root (root_ss_visitor, "server skeleton");
-
- // Inline and source files for tie classes are generated
- // by the corresponding skeleton visitors.
- if (be_global->gen_tie_classes ())
- {
- ctx.state (TAO_CodeGen::TAO_ROOT_TIE_SH);
- be_visitor_root_sth sth_visitor (&ctx);
- BE_visit_root (sth_visitor, "server template header");
- }
-
- if (be_global->gen_impl_files ())
- {
- ctx.state (TAO_CodeGen::TAO_ROOT_IH);
- be_visitor_root_ih root_ih_visitor (&ctx);
- BE_visit_root (root_ih_visitor, "implementation header");
-
- ctx.state (TAO_CodeGen::TAO_ROOT_IS);
- be_visitor_root_is root_is_visitor (&ctx);
- BE_visit_root (root_is_visitor, "implementation skeleton");
- }
-
- // Done with this IDL file.
- BE_cleanup ();
-}
-
diff --git a/TAO/TAO_IDL/be/be_root.cpp b/TAO/TAO_IDL/be/be_root.cpp
deleted file mode 100644
index 7ccffd91e03..00000000000
--- a/TAO/TAO_IDL/be/be_root.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_root.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Root that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_root.h"
-#include "be_visitor.h"
-#include "ast_sequence.h"
-#include "ast_string.h"
-#include "ast_array.h"
-
-ACE_RCSID (be,
- be_root,
- "$Id$")
-
-// Default Constructor.
-be_root::be_root (void)
- : COMMON_Base (),
- AST_Decl (),
- UTL_Scope (),
- AST_Root (),
- be_scope (),
- be_decl ()
-{
-}
-
-// Constructor used to build the root of the abstract syntax tree (AST).
-be_root::be_root (UTL_ScopedName *n)
- : COMMON_Base (),
- AST_Decl (AST_Decl::NT_root,
- n),
- UTL_Scope (AST_Decl::NT_root),
- AST_Module (n),
- AST_Root (n),
- be_scope (AST_Decl::NT_root),
- be_decl (AST_Decl::NT_root,
- n)
-{
-}
-
-be_root::~be_root (void)
-{
-}
-
-// We had to provide these since the AST_Root::fe_* method was setting the
-// names of these three to "local type".
-
-// Add this AST_Sequence to the locally defined types in this scope.
-AST_Sequence *
-be_root::fe_add_sequence (AST_Sequence *t)
-{
- if (t == 0)
- {
- return 0;
- }
-
- add_to_local_types (t);
- return t;
-}
-
-// Add this AST_String to the locally defined types in this scope
-AST_String *
-be_root::fe_add_string (AST_String *t)
-{
- if (t == 0)
- {
- return 0;
- }
-
- add_to_local_types (t);
- return t;
-}
-
-// Add this AST_Array to the locally defined types in this scope
-AST_Array *
-be_root::fe_add_array (AST_Array *t)
-{
- if (t == 0)
- {
- return 0;
- }
-
- add_to_local_types (t);
- return t;
-}
-
-void
-be_root::destroy (void)
-{
- // Call the destroy methods of our base classes.
-
-// The scope of the root is handled specially, since we may
-// be processing multiple IDL files and we want to keep
-// the predefined types around until we are all done.
-// be_scope::destroy ();
-// be_decl::destroy ();
-
- AST_Root::destroy ();
-}
-
-int
-be_root::accept (be_visitor *visitor)
-{
- return visitor->visit_root (this);
-}
-
-// Narrowing methods
-IMPL_NARROW_METHODS3 (be_root, AST_Root, be_scope, be_decl)
-IMPL_NARROW_FROM_DECL (be_root)
-IMPL_NARROW_FROM_SCOPE (be_root)
diff --git a/TAO/TAO_IDL/be/be_scope.cpp b/TAO/TAO_IDL/be/be_scope.cpp
deleted file mode 100644
index c335fee14c3..00000000000
--- a/TAO/TAO_IDL/be/be_scope.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// $Id$
-//
-#include "be_scope.h"
-#include "be_valuetype.h"
-#include "be_eventtype.h"
-#include "be_component.h"
-#include "be_home.h"
-#include "be_module.h"
-#include "be_exception.h"
-#include "be_union.h"
-#include "be_structure.h"
-#include "be_enum.h"
-#include "be_operation.h"
-#include "be_factory.h"
-#include "be_root.h"
-#include "be_visitor.h"
-
-ACE_RCSID (be,
- be_scope,
- "$Id$")
-
-// Default Constructor.
-be_scope::be_scope (void)
- : UTL_Scope (),
- comma_ (0)
-{
-}
-
-// Constructor.
-be_scope::be_scope (AST_Decl::NodeType type)
- : UTL_Scope (type),
- comma_ (0)
-{
-}
-
-be_scope::~be_scope (void)
-{
-}
-
-// Code generation methods.
-
-void
-be_scope::comma (unsigned short comma)
-{
- this->comma_ = comma;
-}
-
-int
-be_scope::comma (void) const
-{
- return this->comma_;
-}
-
-// Return the scope created by this node (if one exists, else NULL).
-be_decl *
-be_scope::decl (void)
-{
- switch (this->scope_node_type ())
- {
- case AST_Decl::NT_interface:
- return be_interface::narrow_from_scope (this);
- case AST_Decl::NT_valuetype:
- return be_valuetype::narrow_from_scope (this);
- case AST_Decl::NT_eventtype:
- return be_eventtype::narrow_from_scope (this);
- case AST_Decl::NT_component:
- return be_component::narrow_from_scope (this);
- case AST_Decl::NT_home:
- return be_home::narrow_from_scope (this);
- case AST_Decl::NT_module:
- return be_module::narrow_from_scope (this);
- case AST_Decl::NT_root:
- return be_root::narrow_from_scope (this);
- case AST_Decl::NT_except:
- return be_exception::narrow_from_scope (this);
- case AST_Decl::NT_union:
- return be_union::narrow_from_scope (this);
- case AST_Decl::NT_struct:
- return be_structure::narrow_from_scope (this);
- case AST_Decl::NT_enum:
- return be_enum::narrow_from_scope (this);
- case AST_Decl::NT_op:
- return be_operation::narrow_from_scope (this);
- case AST_Decl::NT_factory:
- return be_factory::narrow_from_scope (this);
- default:
- return (be_decl *)0;
- }
-}
-
-void
-be_scope::destroy (void)
-{
-}
-
-int
-be_scope::accept (be_visitor *visitor)
-{
- return visitor->visit_scope (this);
-}
-
-// Narrowing methods.
-IMPL_NARROW_METHODS1 (be_scope, UTL_Scope)
-IMPL_NARROW_FROM_SCOPE (be_scope)
diff --git a/TAO/TAO_IDL/be/be_sequence.cpp b/TAO/TAO_IDL/be/be_sequence.cpp
deleted file mode 100644
index a724cbb35f1..00000000000
--- a/TAO/TAO_IDL/be/be_sequence.cpp
+++ /dev/null
@@ -1,760 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_sequence.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Sequence that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_sequence.h"
-#include "be_typedef.h"
-#include "be_interface.h"
-#include "be_interface_fwd.h"
-#include "be_predefined_type.h"
-#include "be_field.h"
-#include "be_visitor.h"
-#include "be_helper.h"
-
-#include "utl_identifier.h"
-#include "idl_defines.h"
-#include "nr_extern.h"
-#include "global_extern.h"
-
-#include "ace/Log_Msg.h"
-
-ACE_RCSID (be,
- be_sequence,
- "$Id$")
-
-be_sequence::be_sequence (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_ConcreteType (),
- AST_Sequence (),
- UTL_Scope (),
- be_scope (),
- be_decl (),
- be_type (),
- mt_ (be_sequence::MNG_UNKNOWN),
- field_node_ (0)
-{
- // Always the case.
- this->has_constructor (true);
-}
-
-be_sequence::be_sequence (AST_Expression *v,
- AST_Type *t,
- UTL_ScopedName *n,
- bool local,
- bool abstract)
- : COMMON_Base (t->is_local () || local,
- abstract),
- AST_Decl (AST_Decl::NT_sequence,
- n,
- true),
- AST_Type (AST_Decl::NT_sequence,
- n),
- AST_ConcreteType (AST_Decl::NT_sequence,
- n),
- AST_Sequence (v,
- t,
- n,
- t->is_local () || local,
- abstract),
- UTL_Scope (AST_Decl::NT_sequence),
- be_scope (AST_Decl::NT_sequence),
- be_decl (AST_Decl::NT_sequence,
- n),
- be_type (AST_Decl::NT_sequence,
- n),
- mt_ (be_sequence::MNG_UNKNOWN),
- field_node_ (0)
-{
- // Always the case.
- this->has_constructor (true);
-
- // Don't want to set any bits below for imported nodes.
- if (this->imported ())
- {
- return;
- }
-
- // This one gets set for all sequences, in addition to any specialized
- // one that may get set below.
- idl_global->seq_seen_ = true;
-
- // Don't need the return value - just set the member.
- (void) this->managed_type ();
-
- switch (this->mt_)
- {
- case MNG_OBJREF:
- idl_global->iface_seq_seen_ = true;
- break;
- case MNG_PSEUDO:
- idl_global->pseudo_seq_seen_ = true;
- break;
- case MNG_VALUE:
- idl_global->vt_seq_seen_ = true;
- break;
- case MNG_STRING:
- idl_global->string_seq_seen_ = true;
- break;
- case MNG_WSTRING:
- idl_global->wstring_seq_seen_ = true;
- break;
- default:
- break;
- }
-
- AST_Decl::NodeType nt = t->node_type ();
- AST_Typedef *td = 0;
- AST_Type *pbt = 0;
-
- if (nt == AST_Decl::NT_typedef)
- {
- td = AST_Typedef::narrow_from_decl (t);
- pbt = td->primitive_base_type ();
- nt = pbt->node_type ();
- }
-
- if (nt == AST_Decl::NT_pre_defined)
- {
- AST_PredefinedType *pdt =
- AST_PredefinedType::narrow_from_decl (pbt ? pbt : t);
-
- switch (pdt->pt ())
- {
- case AST_PredefinedType::PT_octet:
- idl_global->octet_seq_seen_ = true;
- break;
- default:
- break;
- }
- }
-}
-
-// Helper to create_name.
-char *
-be_sequence::gen_name (void)
-{
- char namebuf [NAMEBUFSIZE];
- be_type *bt = 0;
-
- // Reset the buffer.
- ACE_OS::memset (namebuf,
- '\0',
- NAMEBUFSIZE);
-
- // Retrieve the base type.
- bt = be_type::narrow_from_decl (this->base_type ());
-
- if (bt == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_sequence::"
- "gen_name - "
- "bad base type\n"),
- 0);
- }
-
- // If this is non-zero, add its local name to the generated name,
- // for uniqueness.
- be_field *fn = this->field_node_;
-
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- // Our base type is an anonymous sequence.
- be_sequence *seq = be_sequence::narrow_from_decl (bt);
-
- if (seq == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_sequence::"
- "gen_name - "
- "error converting base type to sequence\n"),
- 0);
- }
-
- // If the nested sequence were defined in
- // the scope of the enclosing sequence, we would have to
- // not only define the nested class in two places, but also
- // deal with the fact that, for the template classes, the
- // enclosing sequence's template type is a class defined
- // inside it. So we define the nested sequence in the next
- // scope up, and the existing code generation works for both
- // template and non-template implementations of IDL sequences.
- UTL_Scope *parent = this->defined_in ();
- seq->set_defined_in (parent);
- parent->add_sequence (seq);
- char *seq_name = seq->gen_name ();
-
- ACE_OS::sprintf (namebuf,
- "_tao_seq_%s_%s",
- seq_name,
- fn ? fn->local_name ()->get_string () : "");
- ACE::strdelete (seq_name);
- }
- else
- {
- ACE_OS::sprintf (namebuf,
- "_tao_seq_%s_",
- bt->flat_name ());
- }
-
- // Append the size (if any).
- if (this->unbounded () == false)
- {
- char ulval_str [NAMEBUFSIZE];
- ACE_OS::sprintf (ulval_str,
- "_%lu",
- this->max_size ()->ev ()->u.ulval);
- ACE_OS::strcat (namebuf,
- ulval_str);
- }
-
- return ACE::strnew (namebuf);
-}
-
-// Create a name for ourselves.
-int
-be_sequence::create_name (be_typedef *node)
-{
- static char *namebuf = 0;
- UTL_ScopedName *n = 0;
-
- // Scope in which we are defined.
- be_decl *scope = 0;
-
- // If there is a typedef node, we use its name as our name.
- if (node)
- {
- this->set_name (
- dynamic_cast<UTL_ScopedName *> (node->name ()->copy ())
- );
- }
- else
- {
- // Generate a local name.
- namebuf = this->gen_name ();
-
- // Now see if we have a fully scoped name and if so, generate one.
- UTL_Scope *us = this->defined_in ();
-
- scope = be_scope::narrow_from_scope (us)->decl ();
-
- if (scope != 0)
- {
- // Make a copy of the enclosing scope's name.
- n = (UTL_ScopedName *) scope->name ()->copy ();
-
- Identifier *id = 0;
- ACE_NEW_RETURN (id,
- Identifier (namebuf),
- -1);
-
- UTL_ScopedName *conc_name = 0;
- ACE_NEW_RETURN (conc_name,
- UTL_ScopedName (id,
- 0),
- -1);
-
- // Add our local name as the last component.
- n->nconc (conc_name);
-
- // Set the fully scoped name.
- this->set_name (n);
- }
- else
- {
- // We better be not here because we must be inside some scope,
- // at least the ROOT scope.
- return -1;
- }
-
- ACE::strdelete (namebuf);
- }
-
- return 0;
-}
-
-// Does this sequence have a managed type sequence element?
-be_sequence::MANAGED_TYPE
-be_sequence::managed_type (void)
-{
- if (this->mt_ == be_sequence::MNG_UNKNOWN) // Not calculated yet.
- {
- // Base types.
- be_type *bt = 0;
- be_type *prim_type = 0;
-
- bt = be_type::narrow_from_decl (this->base_type ());
-
- if (bt->node_type () == AST_Decl::NT_typedef)
- {
- // Get the primitive base type of this typedef node.
- be_typedef *t = be_typedef::narrow_from_decl (bt);
- prim_type = t->primitive_base_type ();
- }
- else
- {
- prim_type = bt;
- }
-
- // Determine if we need a managed type and which one.
- switch (prim_type->node_type ())
- {
- case AST_Decl::NT_interface:
- case AST_Decl::NT_interface_fwd:
- case AST_Decl::NT_component:
- case AST_Decl::NT_component_fwd:
- this->mt_ = be_sequence::MNG_OBJREF;
- break;
- case AST_Decl::NT_valuebox:
- case AST_Decl::NT_valuetype:
- case AST_Decl::NT_valuetype_fwd:
- case AST_Decl::NT_eventtype:
- case AST_Decl::NT_eventtype_fwd:
- this->mt_ = be_sequence::MNG_VALUE;
- break;
- case AST_Decl::NT_string:
- this->mt_ = be_sequence::MNG_STRING;
- break;
- case AST_Decl::NT_wstring:
- this->mt_ = be_sequence::MNG_WSTRING;
- break;
- case AST_Decl::NT_pre_defined:
- {
- be_predefined_type *bpd =
- be_predefined_type::narrow_from_decl (prim_type);
- AST_PredefinedType::PredefinedType pt = bpd->pt ();
-
- switch (pt)
- {
- case AST_PredefinedType::PT_pseudo:
- this->mt_ = be_sequence::MNG_PSEUDO;
- break;
- case AST_PredefinedType::PT_object:
- this->mt_ = be_sequence::MNG_PSEUDO;
- break;
- case AST_PredefinedType::PT_value:
- this->mt_ = be_sequence::MNG_VALUE;
- break;
- default:
- this->mt_ = be_sequence::MNG_NONE;
- break;
- }
- }
- break;
- default:
- this->mt_ = be_sequence::MNG_NONE;
- }
- }
-
- return this->mt_;
-}
-
-// Add this be_sequence to the locally defined types in this scope
-AST_Sequence *
-be_sequence::fe_add_sequence (AST_Sequence *t)
-{
- if (t == 0)
- {
- return 0;
- }
-
- this->add_to_local_types (t);
- return t;
-}
-
-// Overridden method
-be_decl *
-be_sequence::decl (void)
-{
- return this;
-}
-
-int
-be_sequence::accept (be_visitor *visitor)
-{
- return visitor->visit_sequence (this);
-}
-
-
-const char *
-be_sequence::instance_name ()
-{
- static char namebuf[NAMEBUFSIZE];
- ACE_OS::memset (namebuf,
- '\0',
- NAMEBUFSIZE);
-
- be_type *bt = 0;
- bt = be_type::narrow_from_decl (this->base_type ());
-
- if (bt == 0)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "gen_instantiate_name - "
- "Bad element type\n"));
-
- return namebuf;
- }
-
- // Generate the class name.
-
- // The base type after removing all the aliases.
- be_type *prim_type = bt;
-
- if (bt->node_type () == AST_Decl::NT_typedef)
- {
- // Get the primitive base type of this typedef node.
- be_typedef *t = be_typedef::narrow_from_decl (bt);
- prim_type = t->primitive_base_type ();
- }
-
- // Generate the appropriate sequence type.
- switch (this->managed_type ())
- {
- case be_sequence::MNG_PSEUDO:
- case be_sequence::MNG_OBJREF:
- if (this->unbounded ())
- {
- ACE_OS::sprintf (namebuf,
- "_TAO_unbounded_object_reference_sequence_%s",
- prim_type->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (namebuf,
- "_TAO_bounded_object_reference_sequence_%s_%lu",
- prim_type->local_name ()->get_string (),
- this->max_size ()->ev ()->u.ulval);
- }
-
- break;
- case be_sequence::MNG_VALUE:
- if (this->unbounded ())
- {
- ACE_OS::sprintf (namebuf,
- "_TAO_unbounded_valuetype_sequence_%s",
- prim_type->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (namebuf,
- "_TAO_bounded_valuetype_sequence_%s_%lu",
- prim_type->local_name ()->get_string (),
- this->max_size ()->ev ()->u.ulval);
- }
-
- break;
- case be_sequence::MNG_STRING:
- if (this->unbounded ())
- {
- ACE_OS::sprintf (namebuf,
- "TAO::unbounded_string_sequence");
- }
- else
- {
- ACE_OS::sprintf (namebuf,
- "_TAO_unbounded_string_sequence_%s",
- prim_type->local_name ()->get_string ());
- }
-
- break;
- case be_sequence::MNG_WSTRING:
- if (this->unbounded ())
- {
- ACE_OS::sprintf (namebuf,
- "TAO::unbounded_wstring_sequence");
- }
- else
- {
- ACE_OS::sprintf (namebuf,
- "_TAO_bounded_wstring_sequence_%s",
- prim_type->local_name ()->get_string ());
- }
-
- break;
- default: // Not a managed type.
- if (this->unbounded ())
- {
- // TAO provides extensions for octet sequences, first find out
- // if the base type is an octet (or an alias for octet)
- be_predefined_type *predef =
- be_predefined_type::narrow_from_decl (prim_type);
-
- if (predef != 0
- && predef->pt() == AST_PredefinedType::PT_octet)
- {
- ACE_OS::sprintf (namebuf,
- "TAO::unbounded_value_sequence<CORBA::Octet>");
- }
- else
- {
- ACE_OS::sprintf (namebuf,
- "_TAO_unbounded_value_sequence_%s",
- prim_type->local_name ()->get_string ());
- }
- }
- else
- {
- ACE_OS::sprintf (namebuf,
- "_TAO_bounded_value_sequence_%s_%lu",
- prim_type->local_name ()->get_string (),
- this->max_size ()->ev ()->u.ulval);
- }
-
- break;
- }
-
- return namebuf;
-}
-
-int
-be_sequence::gen_base_class_name (TAO_OutStream *os,
- const char * linebreak,
- AST_Decl *ctx_scope)
-{
- be_type *elem = be_type::narrow_from_decl (this->base_type ());
-
- // Generate the appropriate base class type.
- switch (this->managed_type ())
- {
- case be_sequence::MNG_OBJREF:
- case be_sequence::MNG_PSEUDO:
- if (this->unbounded ())
- {
- *os << "TAO::unbounded_object_reference_sequence<" << linebreak
- << be_idt << be_idt_nl
- << elem->nested_type_name (ctx_scope) << "," << linebreak
- << be_nl;
- *os << elem->nested_type_name (ctx_scope, "_var") << linebreak
- << be_uidt_nl
- << ">" << be_uidt;
- }
- else
- {
- *os << "TAO::bounded_object_reference_sequence<" << linebreak
- << be_idt << be_idt_nl
- << elem->nested_type_name (ctx_scope) << "," << linebreak << be_nl;
- *os << elem->nested_type_name (ctx_scope, "_var") << ","
- << linebreak << be_nl;
- *os << this->max_size ()->ev ()->u.ulval << linebreak << be_uidt_nl
- << ">" << be_uidt;
- }
-
- break;
- case be_sequence::MNG_VALUE:
- if (this->unbounded ())
- {
- *os << "TAO::unbounded_valuetype_sequence<" << linebreak
- << be_idt << be_idt_nl
- << elem->nested_type_name (ctx_scope) << "," << linebreak
- << be_nl;
- *os << elem->nested_type_name (ctx_scope, "_var") << linebreak
- << be_uidt_nl
- << ">" << be_uidt;
- }
- else
- {
- *os << "TAO::bounded_valuetype_sequence<" << linebreak
- << be_idt << be_idt_nl
- << elem->nested_type_name (ctx_scope) << "," << linebreak
- << be_nl;
- *os << elem->nested_type_name (ctx_scope, "_var") << ","
- << linebreak << be_nl
- << this->max_size ()->ev ()->u.ulval << linebreak << be_uidt_nl
- << ">" << be_uidt;
- }
-
- break;
- case be_sequence::MNG_STRING:
- if (this->unbounded ())
- {
- *os << "TAO::unbounded_string_sequence";
- }
- else
- {
- *os << "TAO::bounded_string_sequence<"
- << this->max_size ()->ev ()->u.ulval << ">";
- }
-
- break;
- case be_sequence::MNG_WSTRING:
- if (this->unbounded ())
- {
- *os << "TAO::unbounded_wstring_sequence";
- }
- else
- {
- *os << "TAO::bounded_wstring_sequence<"
- << this->max_size ()->ev ()->u.ulval << ">";
- }
-
- break;
- default: // Not a managed type.
- switch (elem->base_node_type ())
- {
- case AST_Decl::NT_array:
- if (this->unbounded ())
- {
- *os << "TAO::unbounded_array_sequence<" << linebreak
- << be_idt << be_idt_nl
- << elem->nested_type_name (ctx_scope) << "," << linebreak
- << be_nl;
- *os << elem->nested_type_name (ctx_scope) << "_slice,"
- << linebreak << be_nl
- << elem->nested_type_name (ctx_scope) << "_tag"
- << linebreak << be_uidt_nl
- << ">" << be_uidt;
- }
- else
- {
- *os << "TAO::bounded_array_sequence<" << linebreak
- << be_idt << be_idt_nl
- << elem->nested_type_name (ctx_scope) << "," << linebreak
- << be_nl;
- *os << elem->nested_type_name (ctx_scope) << "_slice,"
- << linebreak << be_nl
- << elem->nested_type_name (ctx_scope) << "_tag,"
- << linebreak << be_nl
- << this->max_size ()->ev ()->u.ulval << linebreak
- << be_uidt_nl
- << ">" << be_uidt;
- }
-
- break;
- default:
- if (this->unbounded ())
- {
- *os << "TAO::unbounded_value_sequence<" << linebreak
- << be_idt << be_idt_nl
- << elem->nested_type_name (ctx_scope) << linebreak
- << be_uidt_nl
- << ">" << be_uidt;
- }
- else
- {
- *os << "TAO::bounded_value_sequence<" << linebreak
- << be_idt << be_idt_nl
- << elem->nested_type_name (ctx_scope) << "," << linebreak
- << be_nl
- << this->max_size ()->ev ()->u.ulval << linebreak
- << be_uidt_nl
- << ">" << be_uidt;
- }
-
- break;
- }
-
- break;
- }
-
- return 0;
-}
-
-be_field *
-be_sequence::field_node (void) const
-{
- return this->field_node_;
-}
-
-void
-be_sequence::field_node (be_field *node)
-{
- this->field_node_ = node;
-}
-
-// Overriden method.
-void
-be_sequence::compute_tc_name (void)
-{
- // Sequence TypeCodes can only be accessed through an alias
- // TypeCode. Generate a TypeCode name that is meant for internal
- // use alone.
-
- Identifier * tao_id = 0;
- ACE_NEW (tao_id,
- Identifier ("TAO"));
-
- ACE_NEW (this->tc_name_,
- UTL_ScopedName (tao_id,
- 0));
-
- char bound[30] = { 0 };
-
- ACE_OS::sprintf (bound,
- "_%lu",
- this->max_size ()->ev ()->u.ulval);
-
- ACE_CString local_tc_name =
- ACE_CString ("tc_")
- + ACE_CString (this->flat_name ())
- + ACE_CString (bound);
-
- Identifier * typecode_scope = 0;
- ACE_NEW (typecode_scope,
- Identifier ("TypeCode"));
-
- UTL_ScopedName * tc_scope_conc_name = 0;
- ACE_NEW (tc_scope_conc_name,
- UTL_ScopedName (typecode_scope,
- 0));
-
- this->tc_name_->nconc (tc_scope_conc_name);
-
- Identifier * id = 0;
- ACE_NEW (id,
- Identifier (local_tc_name.c_str ()));
-
- UTL_ScopedName * conc_name = 0;
- ACE_NEW (conc_name,
- UTL_ScopedName (id,
- 0));
-
- this->tc_name_->nconc (conc_name);
-}
-
-const char *
-be_sequence::smart_fwd_helper_name (AST_Decl *ctx_scope,
- be_type *elem)
-{
- if (ScopeAsDecl (elem->defined_in ()) == ctx_scope)
- {
- ACE_CString retval = "tao_";
- retval += elem->local_name ()->get_string ();
- return retval.rep ();
- }
-
- return elem->fwd_helper_name ();
-}
-
-void
-be_sequence::destroy (void)
-{
- // Call the destroy methods of our base classes.
- this->be_scope::destroy ();
- this->be_type::destroy ();
- this->AST_Sequence::destroy ();
-}
-
-// Narrowing
-IMPL_NARROW_METHODS3 (be_sequence, AST_Sequence, be_scope, be_type)
-IMPL_NARROW_FROM_DECL (be_sequence)
diff --git a/TAO/TAO_IDL/be/be_stream_factory.cpp b/TAO/TAO_IDL/be/be_stream_factory.cpp
deleted file mode 100644
index ef327ecd30e..00000000000
--- a/TAO/TAO_IDL/be/be_stream_factory.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-// $Id$
-
-#include "be_stream_factory.h"
-#include "be_sunsoft.h"
-
-ACE_RCSID (be,
- be_streamfactory,
- "$Id$")
-
-// Constructor.
-TAO_OutStream_Factory::TAO_OutStream_Factory (void)
- : strm_type_ (TAO_OutStream_Factory::TAO_SUNSOFT)
-{
-}
-
-// Destructor.
-TAO_OutStream_Factory::~TAO_OutStream_Factory (void)
-{
-}
-
-// Set the type of specialized output stream we want.
-int
-TAO_OutStream_Factory::set_stream_type
-(TAO_OutStream_Factory::TAO_OutStream_Type t)
-{
- this->strm_type_ = t;
- return 0;
-}
-
-// Factory method.
-TAO_OutStream *
-TAO_OutStream_Factory::make_outstream (void)
-{
- switch (this->strm_type_)
- {
- case TAO_OutStream_Factory::TAO_SUNSOFT:
- return new TAO_SunSoft_OutStream ();
- case TAO_OutStream_Factory::TAO_FLICK:
- return (TAO_OutStream *)0; // Not implemented as yet.
- default:
- return (TAO_OutStream *)0;
- }
-}
diff --git a/TAO/TAO_IDL/be/be_string.cpp b/TAO/TAO_IDL/be/be_string.cpp
deleted file mode 100644
index aaaf8427a7a..00000000000
--- a/TAO/TAO_IDL/be/be_string.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_string.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_String that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_string.h"
-#include "be_visitor.h"
-
-#include "utl_identifier.h"
-#include "global_extern.h"
-
-ACE_RCSID (be,
- be_string,
- "$Id$")
-
-be_string::be_string (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_String (),
- be_decl (),
- be_type ()
-{
- // Always the case.
- this->size_type (AST_Type::VARIABLE);
-}
-
-be_string::be_string (AST_Decl::NodeType nt,
- UTL_ScopedName * n,
- AST_Expression * v,
- long width)
- : COMMON_Base (),
- AST_Decl (nt,
- n,
- true),
- AST_Type (nt,
- n),
- AST_String (nt,
- n,
- v,
- width),
- be_decl (nt,
- n),
- be_type (nt,
- n)
-{
- idl_global->string_seen_ = true;
-}
-
-// Overriden method.
-void
-be_string::compute_tc_name (void)
-{
- Identifier * id = 0;
-
- AST_Expression zero (static_cast<unsigned long> (0));
-
- if (*this->max_size () == &zero)
- {
- // If the string is unbounded, use the string TypeCode
- // constants.
-
- // Start with the head as the CORBA namespace.
- Identifier * corba_id = 0;
- ACE_NEW (corba_id,
- Identifier ("CORBA"));
-
- ACE_NEW (this->tc_name_,
- UTL_ScopedName (corba_id,
- 0));
-
- ACE_NEW (id,
- Identifier (this->width () == 1
- ? "_tc_string"
- : "_tc_wstring"));
- }
- else
- {
- // We have a bounded string. Generate a TypeCode name that is
- // meant for internal use alone.
-
- Identifier * tao_id = 0;
- ACE_NEW (tao_id,
- Identifier ("TAO"));
-
- ACE_NEW (this->tc_name_,
- UTL_ScopedName (tao_id,
- 0));
-
- ACE_CString local_tc_name =
- ACE_CString ("tc_")
- + ACE_CString (this->flat_name ());
-
- Identifier * typecode_scope = 0;
- ACE_NEW (typecode_scope,
- Identifier ("TypeCode"));
-
- UTL_ScopedName * tc_scope_conc_name = 0;
- ACE_NEW (tc_scope_conc_name,
- UTL_ScopedName (typecode_scope,
- 0));
-
- this->tc_name_->nconc (tc_scope_conc_name);
-
- ACE_NEW (id,
- Identifier (local_tc_name.c_str ()));
- }
-
- zero.destroy ();
-
- UTL_ScopedName *conc_name = 0;
- ACE_NEW (conc_name,
- UTL_ScopedName (id,
- 0));
-
- this->tc_name_->nconc (conc_name);
-}
-
-int
-be_string::accept (be_visitor * visitor)
-{
- return visitor->visit_string (this);
-}
-
-void
-be_string::destroy (void)
-{
- this->be_type::destroy ();
- this->AST_String::destroy ();
-}
-
-// Narrowing.
-IMPL_NARROW_METHODS2 (be_string, AST_String, be_type)
-IMPL_NARROW_FROM_DECL (be_string)
diff --git a/TAO/TAO_IDL/be/be_structure.cpp b/TAO/TAO_IDL/be/be_structure.cpp
deleted file mode 100644
index d26a250cebf..00000000000
--- a/TAO/TAO_IDL/be/be_structure.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_structure.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Structure that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_structure.h"
-#include "be_codegen.h"
-#include "be_helper.h"
-#include "be_visitor.h"
-#include "be_extern.h"
-
-#include "ast_field.h"
-#include "utl_identifier.h"
-#include "idl_defines.h"
-#include "global_extern.h"
-
-ACE_RCSID (be,
- be_structure,
- "$Id$")
-
-be_structure::be_structure (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_ConcreteType (),
- UTL_Scope (),
- AST_Structure (),
- be_scope (),
- be_decl (),
- be_type ()
-{
-}
-
-be_structure::be_structure (UTL_ScopedName *n,
- bool local,
- bool abstract)
- : COMMON_Base (local,
- abstract),
- AST_Decl (AST_Decl::NT_struct,
- n),
- AST_Type (AST_Decl::NT_struct,
- n),
- AST_ConcreteType (AST_Decl::NT_struct,
- n),
- UTL_Scope (AST_Decl::NT_struct),
- AST_Structure (n,
- local,
- abstract),
- be_scope (AST_Decl::NT_struct),
- be_decl (AST_Decl::NT_struct,
- n),
- be_type (AST_Decl::NT_struct,
- n)
-{
- if (!this->imported ())
- {
- idl_global->aggregate_seen_ = true;
- }
-}
-
-void
-be_structure::redefine (AST_Structure *from)
-{
- be_structure *bs = be_structure::narrow_from_decl (from);
- this->common_varout_gen_ = bs->common_varout_gen_;
- AST_Structure::redefine (from);
-}
-
-void
-be_structure::destroy (void)
-{
- // Call the destroy methods of our base classes.
- this->be_scope::destroy ();
- this->be_type::destroy ();
- this->AST_Structure::destroy ();
-}
-
-int
-be_structure::accept (be_visitor *visitor)
-{
- return visitor->visit_structure (this);
-}
-
-AST_Field *
-be_structure::be_add_field (AST_Field *f)
-{
- return this->fe_add_field (f);
-}
-
-// Narrowing.
-IMPL_NARROW_METHODS3 (be_structure, AST_Structure, be_scope, be_type)
-IMPL_NARROW_FROM_DECL (be_structure)
-IMPL_NARROW_FROM_SCOPE (be_structure)
diff --git a/TAO/TAO_IDL/be/be_structure_fwd.cpp b/TAO/TAO_IDL/be/be_structure_fwd.cpp
deleted file mode 100644
index cfc33e9b28d..00000000000
--- a/TAO/TAO_IDL/be/be_structure_fwd.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_structure_fwd.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_StructureFwd that provides additional means for C++
-// mapping of a struct.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-#include "be_structure_fwd.h"
-#include "be_visitor.h"
-
-ACE_RCSID (be,
- be_structure_fwd,
- "$Id$")
-
-be_structure_fwd::be_structure_fwd (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_StructureFwd (),
- be_decl (),
- be_type ()
-{
-}
-
-be_structure_fwd::be_structure_fwd (AST_Structure *dummy,
- UTL_ScopedName *n)
- : COMMON_Base (),
- AST_Decl (AST_Decl::NT_struct_fwd,
- n),
- AST_Type (AST_Decl::NT_struct_fwd,
- n),
- AST_StructureFwd (dummy,
- n),
- be_decl (AST_Decl::NT_struct_fwd,
- n),
- be_type (AST_Decl::NT_struct_fwd,
- n)
-{
-}
-
-be_structure_fwd::~be_structure_fwd (void)
-{
-}
-
-void
-be_structure_fwd::destroy (void)
-{
- this->be_type::destroy ();
- this->AST_StructureFwd::destroy ();
-}
-
-int
-be_structure_fwd::accept (be_visitor *visitor)
-{
- return visitor->visit_structure_fwd (this);
-}
-
-// Narrowing
-IMPL_NARROW_METHODS2 (be_structure_fwd, AST_StructureFwd, be_type)
-IMPL_NARROW_FROM_DECL (be_structure_fwd)
diff --git a/TAO/TAO_IDL/be/be_sunsoft.cpp b/TAO/TAO_IDL/be/be_sunsoft.cpp
deleted file mode 100644
index 06be8962802..00000000000
--- a/TAO/TAO_IDL/be/be_sunsoft.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-// $Id$
-
-#include "be_sunsoft.h"
-#include "ast_expression.h"
-#include "utl_identifier.h"
-#include "utl_idlist.h"
-#include "utl_string.h"
-#include "ace/OS_NS_stdio.h"
-#include "ace/OS_NS_string.h"
-#include "ace/os_include/os_ctype.h"
-
-ACE_RCSID (be,
- be_sunsoft,
- "$Id$")
-
-TAO_SunSoft_OutStream::TAO_SunSoft_OutStream (void)
- : TAO_OutStream ()
-{
-}
-
-TAO_SunSoft_OutStream::~TAO_SunSoft_OutStream (void)
-{
-}
-
-TAO_OutStream &
-TAO_SunSoft_OutStream::print (Identifier *id)
-{
- ACE_OS::fprintf (this->fp_,
- id->get_string ());
-
- return *this;
-}
-
-TAO_OutStream &
-TAO_SunSoft_OutStream::print (UTL_IdList *idl)
-{
- long first = true;
- long second = false;
- Identifier *id = 0;
-
- for (UTL_IdListActiveIterator i (idl); !i.is_done (); i.next ())
- {
- if (!first)
- {
- *this << "::";
- }
- else if (second)
- {
- first = second = false;
- }
-
- // Print the identifier.
- id = i.item ();
- *this << id;
-
- if (first)
- {
- if (ACE_OS::strcmp (id->get_string (), "") != 0)
- {
- // Does not start with a "".
- first = false;
- }
- else
- {
- second = true;
- }
- }
- }
-
- return *this;
-}
-
-TAO_OutStream&
-TAO_SunSoft_OutStream::print (AST_Expression *expr)
-{
- AST_Expression::AST_ExprValue *ev = expr->ev ();
-
- if (ev)
- {
- switch (ev->et)
- {
- case AST_Expression::EV_short:
- this->TAO_OutStream::print ("%hd", ev->u.sval);
- break;
- case AST_Expression::EV_ushort:
- this->TAO_OutStream::print ("%hu%c", ev->u.usval, 'U');
- break;
- case AST_Expression::EV_long:
- this->TAO_OutStream::print ("%ld", ev->u.lval);
- break;
- case AST_Expression::EV_ulong:
- this->TAO_OutStream::print ("%u%c", ev->u.ulval, 'U');
- break;
- case AST_Expression::EV_longlong:
-#if ! defined (ACE_LACKS_LONGLONG_T)
- this->TAO_OutStream::print (ACE_INT64_FORMAT_SPECIFIER, ev->u.llval);
-#endif /* ! defined (ACE_LACKS_LONGLONG_T) */
- break;
- case AST_Expression::EV_ulonglong:
-#if ! defined (ACE_LACKS_LONGLONG_T)
- this->TAO_OutStream::print ("ACE_UINT64_LITERAL (");
- this->TAO_OutStream::print (ACE_UINT64_FORMAT_SPECIFIER,
- ev->u.ullval);
- this->TAO_OutStream::print (")");
-#endif /* ! defined (ACE_LACKS_LONGLONG_T) */
- break;
- case AST_Expression::EV_float:
- this->TAO_OutStream::print ("%f%c", ev->u.fval, 'F');
- break;
- case AST_Expression::EV_double:
- this->TAO_OutStream::print ("%24.16G", ev->u.dval);
- break;
- case AST_Expression::EV_longdouble:
- break;
- case AST_Expression::EV_char:
- // isprint() sees \ and ' as printable characters
- // so we have to test for them first.
- if (ev->u.cval == '\\')
- this->TAO_OutStream::print ("'\\\\'");
- else if (ev->u.cval == '\'')
- this->TAO_OutStream::print ("'\\''");
-
- // This handles hex and octal escape sequences
- // that would print out either as weird characters
- // or as an unsigned number too large for a char.
- else if ((unsigned char) ev->u.cval > ACE_CHAR_MAX)
- this->TAO_OutStream::print ("%hd", ev->u.cval);
- else if (isprint (ev->u.cval))
- this->TAO_OutStream::print ("'%c'", ev->u.cval);
- else if (iscntrl (ev->u.cval))
- switch (ev->u.cval)
- {
- case '\n':
- this->TAO_OutStream::print ("'\\n'");
- break;
- case '\t':
- this->TAO_OutStream::print ("'\\t'");
- break;
- case '\r':
- this->TAO_OutStream::print ("'\\r'");
- break;
- case '\v':
- this->TAO_OutStream::print ("'\\v'");
- break;
- case '\f':
- this->TAO_OutStream::print ("'\\f'");
- break;
- case '\b':
- this->TAO_OutStream::print ("'\\b'");
- break;
- case '\a':
- this->TAO_OutStream::print ("'\\a'");
- break;
- case '\?':
- this->TAO_OutStream::print ("'?'");
- break;
- default:
- this->TAO_OutStream::print ("'\\x%x'", ev->u.cval);
- }
- else
- this->TAO_OutStream::print ("'\\x%x'", ev->u.cval);
- break;
- case AST_Expression::EV_wchar:
- this->TAO_OutStream::print ("L'%lc'", ev->u.wcval);
- break;
- case AST_Expression::EV_octet:
- this->TAO_OutStream::print ("%d", ev->u.oval);
- break;
- case AST_Expression::EV_bool:
- this->TAO_OutStream::print ("%s", ev->u.bval ? "true" : "false");
- break;
- case AST_Expression::EV_string:
- this->TAO_OutStream::print ("\"%s\"", ev->u.strval->get_string ());
- break;
- case AST_Expression::EV_wstring:
- this->TAO_OutStream::print ("L\"%s\"", ev->u.wstrval);
- break;
- case AST_Expression::EV_enum:
- this->print (expr->n ());
- break;
- default:
- break;
- }
- }
- else
- {
- // XXXASG: need to add code here
- }
-
- return *this;
-}
diff --git a/TAO/TAO_IDL/be/be_tmplinst.cpp b/TAO/TAO_IDL/be/be_tmplinst.cpp
deleted file mode 100644
index 0cbf0481478..00000000000
--- a/TAO/TAO_IDL/be/be_tmplinst.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// $Id$
-
-#include "be_visitor_typecode/typecode_defn.h"
-#include "be_stream_factory.h"
-#include "be_visitor_factory.h"
-#include "ast_interface.h"
-#include "ace/Singleton.h"
-#include "ace/Synch.h"
-#include "ace/Unbounded_Queue.h"
-
-#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
-template class ACE_Singleton<TAO_CodeGen, ACE_SYNCH_RECURSIVE_MUTEX>;
-template class ACE_Singleton<TAO_OutStream_Factory,ACE_SYNCH_RECURSIVE_MUTEX>;
-template class ACE_Singleton<TAO_Visitor_Factory,ACE_SYNCH_RECURSIVE_MUTEX>;
-#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/TAO_IDL/be/be_type.cpp b/TAO/TAO_IDL/be/be_type.cpp
deleted file mode 100644
index 8e4ca8254b3..00000000000
--- a/TAO/TAO_IDL/be/be_type.cpp
+++ /dev/null
@@ -1,344 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_type.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Type that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_type.h"
-#include "be_scope.h"
-#include "be_visitor.h"
-#include "be_codegen.h"
-#include "be_helper.h"
-#include "utl_identifier.h"
-#include "idl_defines.h"
-#include "nr_extern.h"
-
-ACE_RCSID (be,
- be_type,
- "$Id$")
-
-be_type::be_type (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- be_decl (),
- tc_name_ (0),
- common_varout_gen_ (false),
- seen_in_sequence_ (false),
- seen_in_operation_ (false)
-{
-}
-
-be_type::be_type (AST_Decl::NodeType nt,
- UTL_ScopedName *n)
- : COMMON_Base (),
- AST_Decl (nt,
- n),
- AST_Type (nt,
- n),
- be_decl (nt,
- n),
- tc_name_ (0),
- common_varout_gen_ (false),
- seen_in_sequence_ (false),
- seen_in_operation_ (false)
-{
- if (n != 0)
- {
- this->gen_fwd_helper_name ();
- }
-}
-
-be_type::~be_type (void)
-{
-}
-
-// Compute the typecode name. The idea is to use the fully scoped name,
-// however, prepend a _tc_ to the last component. A slightly different approach
-// is required of the predefined types. Hence this method is overridden for
-// predefined types.
-
-void
-be_type::compute_tc_name (void)
-{
- static char namebuf [NAMEBUFSIZE];
- UTL_ScopedName *n = this->name ();
-
- this->tc_name_ = 0;
-
- ACE_OS::memset (namebuf,
- '\0',
- NAMEBUFSIZE);
-
- while (n->tail () != 0)
- {
- // Does not exist.
- if (this->tc_name_ == 0)
- {
- ACE_NEW (this->tc_name_,
- UTL_ScopedName (n->head ()->copy (),
- 0));
- }
- else
- {
- UTL_ScopedName *conc_name = 0;
- ACE_NEW (conc_name,
- UTL_ScopedName (n->head ()->copy (),
- 0));
-
- this->tc_name_->nconc (conc_name);
- }
-
- n = (UTL_ScopedName *)n->tail ();
- }
-
- ACE_OS::sprintf (namebuf,
- "_tc_%s",
- n->last_component ()->get_string ());
-
- Identifier *id = 0;
- ACE_NEW (id,
- Identifier (namebuf));
-
- // Does not exist.
- if (this->tc_name_ == 0)
- {
- ACE_NEW (this->tc_name_,
- UTL_ScopedName (id,
- 0));
- }
- else
- {
- UTL_ScopedName *conc_name = 0;
- ACE_NEW (conc_name,
- UTL_ScopedName (id,
- 0));
-
- this->tc_name_->nconc (conc_name);
- }
-}
-
-// Retrieve typecode name.
-UTL_ScopedName *
-be_type::tc_name (void)
-{
- // Compute and init the member.
- if (this->tc_name_ == 0)
- {
- this->compute_tc_name ();
- }
-
- return this->tc_name_;
-}
-
-// This works for the "special" names generated for smart proxy
-// classes. The form of these names is
-// scope'TAO_'+flat_name+'_Smart_Proxy_Base'.
-//
-// We can use the flat_name() method for the local_name parm but have
-// to construct the full name ourselves.
-const char *
-be_type::nested_sp_type_name (be_decl *use_scope,
- const char *suffix,
- const char *prefix)
-{
- // Our defining scope.
- be_decl *fu_scope = 0;
-
- char fu_name [NAMEBUFSIZE];
- char fl_name [NAMEBUFSIZE];
-
- ACE_OS::memset (fu_name,
- '\0',
- NAMEBUFSIZE);
-
- ACE_OS::memset (fl_name,
- '\0',
- NAMEBUFSIZE);
-
- fu_scope = this->defined_in ()
- ? be_scope::narrow_from_scope (this->defined_in ())->decl ()
- : 0;
-
- ACE_OS::strcat (fu_name,
- fu_scope->full_name ());
-
- ACE_OS::strcat (fu_name,
- "::TAO_");
-
- ACE_OS::strcat (fu_name,
- this->flat_name());
-
- ACE_OS::strcat (fl_name,
- "TAO_");
-
- ACE_OS::strcat (fl_name,
- this->flat_name());
-
- return this->nested_name (fl_name,
- fu_name,
- use_scope,
- suffix,
- prefix);
-}
-
-void
-be_type::gen_fwd_helper_name (void)
-{
- AST_Decl *parent = ScopeAsDecl (this->defined_in ());
- Identifier *segment = 0;
- char *tmp = 0;
- this->fwd_helper_name_.clear (1);
-
- if (parent != 0 && parent->node_type () != AST_Decl::NT_root)
- {
- for (UTL_IdListActiveIterator i (parent->name ());
- !i.is_done ();
- i.next ())
- {
- segment = i.item ();
- tmp = segment->get_string ();
-
- if (ACE_OS::strcmp (tmp, "") == 0)
- {
- continue;
- }
-
- this->fwd_helper_name_ += tmp;
- this->fwd_helper_name_ += "::";
- }
- }
- else
- {
- this->fwd_helper_name_= "";
- }
-
- this->fwd_helper_name_ += "tao_";
- this->fwd_helper_name_ += this->local_name ()->get_string ();
-}
-
-const char *
-be_type::fwd_helper_name (void) const
-{
- return this->fwd_helper_name_.fast_rep ();
-}
-
-void
-be_type::fwd_helper_name (const char *name)
-{
- this->fwd_helper_name_ = name;
-}
-
-void
-be_type::gen_common_varout (TAO_OutStream *os)
-{
- if (this->common_varout_gen_ == 1)
- {
- return;
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- AST_Type::SIZE_TYPE st = this->size_type ();
-
- *os << be_nl << be_nl
- << (this->node_type () == AST_Decl::NT_struct ? "struct "
- : "class ")
- << this->local_name () << ";";
-
- *os << be_nl << be_nl
- << "typedef" << be_idt_nl
- << (st == AST_Type::FIXED ? "TAO_Fixed_Var_T<"
- : "TAO_Var_Var_T<")
- << be_idt << be_idt_nl
- << this->local_name () << be_uidt_nl
- << ">" << be_uidt_nl
- << this->local_name () << "_var;" << be_uidt_nl << be_nl;
-
- if (st == AST_Type::FIXED)
- {
- *os << "typedef" << be_idt_nl
- << this->local_name () << " &" << be_nl
- << this->local_name () << "_out;" << be_uidt;
- }
- else
- {
- *os << "typedef" << be_idt_nl
- << "TAO_Out_T<" << be_idt << be_idt_nl
- << this->local_name () << be_uidt_nl
- << ">" << be_uidt_nl
- << this->local_name () << "_out;" << be_uidt;
- }
-
- this->common_varout_gen_ = 1;
-}
-
-bool
-be_type::seen_in_sequence (void) const
-{
- return this->seen_in_sequence_;
-}
-
-void
-be_type::seen_in_sequence (bool val)
-{
- this->seen_in_sequence_ = val;
-}
-
-bool
-be_type::seen_in_operation (void) const
-{
- return this->seen_in_operation_;
-}
-
-void
-be_type::seen_in_operation (bool val)
-{
- this->seen_in_operation_ = val;
-}
-
-AST_Decl::NodeType
-be_type::base_node_type (void) const
-{
- return const_cast<be_type*> (this)->node_type ();
-}
-
-// Cleanup method
-void
-be_type::destroy (void)
-{
- if (this->tc_name_ != 0)
- {
- this->tc_name_->destroy ();
- delete this->tc_name_;
- this->tc_name_ = 0;
- }
-
- this->be_decl::destroy ();
-}
-
-int
-be_type::accept (be_visitor *visitor)
-{
- return visitor->visit_type (this);
-}
-
-// Narrowing.
-IMPL_NARROW_METHODS2 (be_type, AST_Type, be_decl)
-IMPL_NARROW_FROM_DECL (be_type)
diff --git a/TAO/TAO_IDL/be/be_typedef.cpp b/TAO/TAO_IDL/be/be_typedef.cpp
deleted file mode 100644
index f33301349e5..00000000000
--- a/TAO/TAO_IDL/be/be_typedef.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_typedef.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Typedef that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_typedef.h"
-#include "be_visitor.h"
-#include "ace/Log_Msg.h"
-
-ACE_RCSID (be,
- be_typedef,
- "$Id$")
-
-be_typedef::be_typedef (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_Typedef (),
- be_decl (),
- be_type ()
-{
-}
-
-be_typedef::be_typedef (AST_Type *bt,
- UTL_ScopedName *n,
- bool local,
- bool abstract)
- : COMMON_Base (bt->is_local () || local,
- abstract),
- AST_Decl (AST_Decl::NT_typedef,
- n),
- AST_Type (AST_Decl::NT_typedef,
- n),
- AST_Typedef (bt,
- n,
- bt->is_local () || local,
- abstract),
- be_decl (AST_Decl::NT_typedef,
- n),
- be_type (AST_Decl::NT_typedef,
- n)
-{
- AST_Type *pbt = this->primitive_base_type ();
- AST_Decl::NodeType nt = pbt->node_type ();
-
- if (nt == AST_Decl::NT_sequence)
- {
- pbt->anonymous (false);
- }
-}
-
-void
-be_typedef::seen_in_sequence (bool val)
-{
- this->be_type::seen_in_sequence (val);
- this->primitive_base_type ()->seen_in_sequence (val);
-}
-
-// Some compilers seems to have a problem with a function
-// that's both virtual and overloaded.
-bool
-be_typedef::seen_in_operation (void) const
-{
- return this->be_type::seen_in_operation ();
-}
-
-void
-be_typedef::seen_in_operation (bool val)
-{
- this->be_type::seen_in_operation (val);
-}
-
-// Given a typedef node, traverse the chain of base types until they are no
-// more typedefs, and return that most primitive base type.
-be_type *
-be_typedef::primitive_base_type (void)
-{
- be_type *d = this;
- be_typedef *temp = 0;
-
- while (d && d->node_type () == AST_Decl::NT_typedef)
- {
- temp = be_typedef::narrow_from_decl (d);
- d = be_type::narrow_from_decl (temp->base_type ());
- }
-
- return d;
-}
-
-AST_Decl::NodeType
-be_typedef::base_node_type (void) const
-{
- be_typedef *td = const_cast<be_typedef *> (this);
-
- be_type *base = be_type::narrow_from_decl (td->base_type ());
-
- return base->base_node_type ();
-}
-
-void
-be_typedef::destroy (void)
-{
- this->AST_Typedef::destroy ();
- this->be_type::destroy ();
-}
-
-int
-be_typedef::accept (be_visitor *visitor)
-{
- return visitor->visit_typedef (this);
-}
-
-// Narrowing.
-IMPL_NARROW_METHODS2 (be_typedef, AST_Typedef, be_type)
-IMPL_NARROW_FROM_DECL (be_typedef)
diff --git a/TAO/TAO_IDL/be/be_union.cpp b/TAO/TAO_IDL/be/be_union.cpp
deleted file mode 100644
index 7d23e07703d..00000000000
--- a/TAO/TAO_IDL/be/be_union.cpp
+++ /dev/null
@@ -1,196 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_union.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Union that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_union.h"
-#include "be_visitor.h"
-#include "be_codegen.h"
-#include "be_helper.h"
-#include "be_extern.h"
-
-#include "ast_union_branch.h"
-#include "utl_identifier.h"
-#include "idl_defines.h"
-#include "global_extern.h"
-
-ACE_RCSID (be,
- be_union,
- "$Id$")
-
-
-be_union::be_union (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_ConcreteType (),
- UTL_Scope (),
- AST_Structure (),
- AST_Union (),
- be_scope (),
- be_decl (),
- be_type ()
-{
- // Always the case.
- this->has_constructor (true);
-}
-
-be_union::be_union (AST_ConcreteType *dt,
- UTL_ScopedName *n,
- bool local,
- bool abstract)
- : COMMON_Base (local,
- abstract),
- AST_Decl (AST_Decl::NT_union,
- n),
- AST_Type (AST_Decl::NT_union,
- n),
- AST_ConcreteType (AST_Decl::NT_union,
- n),
- UTL_Scope (AST_Decl::NT_union),
- AST_Structure (AST_Decl::NT_union,
- n,
- local,
- abstract),
- AST_Union (dt,
- n,
- local,
- abstract),
- be_scope (AST_Decl::NT_union),
- be_decl (AST_Decl::NT_union,
- n),
- be_type (AST_Decl::NT_union,
- n)
-{
- // Always the case.
- this->has_constructor (true);
-
- if (!this->imported ())
- {
- idl_global->aggregate_seen_ = true;
-
- idl_global->union_seen_ = true;
- }
-}
-
-void
-be_union::redefine (AST_Structure *from)
-{
- be_union *bu = be_union::narrow_from_decl (from);
- this->common_varout_gen_ = bu->common_varout_gen_;
- AST_Union::redefine (from);
-}
-
-bool
-be_union::has_duplicate_case_labels (void)
-{
- for (UTL_ScopeActiveIterator si (this, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- AST_Decl *d = si.item ();
- AST_UnionBranch *ub =
- AST_UnionBranch::narrow_from_decl (d);
-
- if (ub->label_list_length () > 1)
- {
- return true;
- }
- }
-
- return false;
-}
-
-void
-be_union::destroy (void)
-{
- // Call the destroy methods of our base classes.
- this->be_scope::destroy ();
- this->be_type::destroy ();
- this->AST_Union::destroy ();
-
-}
-
-// Visitor method.
-int
-be_union::accept (be_visitor *visitor)
-{
- return visitor->visit_union (this);
-}
-
-bool
-be_union::gen_empty_default_label (void)
-{
- // A non-empty explicit default label will be generated.
- if (this->default_index () != -1)
- {
- return false;
- }
-
- AST_ConcreteType *disc = this->disc_type ();
- AST_Decl::NodeType nt = disc->node_type ();
-
- if (nt == AST_Decl::NT_enum)
- {
- return true;
- }
-
- AST_PredefinedType *pdt = AST_PredefinedType::narrow_from_decl (disc);
-
- if (pdt == 0)
- {
- return true;
- }
-
- unsigned long n_labels = this->nlabels ();
-
- if (pdt->pt () == AST_PredefinedType::PT_boolean && n_labels == 2)
- {
- return false;
- }
-
- return true;
-}
-
-unsigned long
-be_union::nlabels (void)
-{
- unsigned long retval = 0;
-
- for (UTL_ScopeActiveIterator si (this, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- AST_Decl *d = si.item ();
- AST_UnionBranch *ub =
- AST_UnionBranch::narrow_from_decl (d);
-
- if (ub != 0)
- {
- retval += ub->label_list_length ();
- }
- }
-
- return retval;
-}
-
-// Narrowing.
-IMPL_NARROW_METHODS3 (be_union, AST_Union, be_scope, be_type)
-IMPL_NARROW_FROM_DECL (be_union)
-IMPL_NARROW_FROM_SCOPE (be_union)
diff --git a/TAO/TAO_IDL/be/be_union_branch.cpp b/TAO/TAO_IDL/be/be_union_branch.cpp
deleted file mode 100644
index 22cd43f8a86..00000000000
--- a/TAO/TAO_IDL/be/be_union_branch.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_union_branch.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_UnionBranch that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_union_branch.h"
-#include "be_union.h"
-#include "be_type.h"
-#include "be_enum.h"
-#include "be_visitor.h"
-#include "be_helper.h"
-#include "ast_union_label.h"
-#include "ace/Log_Msg.h"
-
-ACE_RCSID (be,
- be_union_branch,
- "$Id$")
-
-be_union_branch::be_union_branch (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Field (),
- AST_UnionBranch (),
- be_decl ()
-{
-}
-
-be_union_branch::be_union_branch (UTL_LabelList *ll,
- AST_Type *ft,
- UTL_ScopedName *n)
- : COMMON_Base (ft->is_local (),
- ft->is_abstract ()),
- AST_Decl (AST_Decl::NT_union_branch,
- n),
- AST_Field (AST_Decl::NT_union_branch,
- ft,
- n),
- AST_UnionBranch (ll,
- ft,
- n),
- be_decl (AST_Decl::NT_union_branch,
- n)
-{
-}
-
-int
-be_union_branch::gen_label_value (TAO_OutStream *os, unsigned long index)
-{
- AST_Expression *e = this->label (index)->label_val ();
-
- if (e->ec () != AST_Expression::EC_symbol)
- {
- // Easy, just a number...
- *os << e;
- return 0;
- }
-
- // If the enum is not in the global scope we have to prefix it.
- be_union *u =
- be_union::narrow_from_scope (this->defined_in ());
-
- if (u == 0)
- {
- return -1;
- }
-
- be_type* dt =
- be_type::narrow_from_decl (u->disc_type ());
-
- if (dt == 0)
- {
- return -1;
- }
-
- // Check if discriminator is a typedef of an integer. If so, and the
- // first IF block in this function didn't catch it, then we
- // are a constant of this type. We can't generate the constant's name,
- // we must generate the underlying integer value for the
- // label value.
- if (dt->node_type () == AST_Decl::NT_pre_defined)
- {
- *os << e;
- return 0;
- }
-
- // Find where was the enum defined, if it was defined in the globa
- // scope, then it is easy to generate the enum values....
- be_scope* scope =
- be_scope::narrow_from_scope (dt->defined_in ());
-
- if (scope == 0)
- {
- *os << e->n ();
- return 0;
- }
-
- // But if it was generated inside a module or something similar then
- // we must prefix the enum value with something...
- be_decl* decl = scope->decl ();
-
- *os << decl->full_name () << "::" << e->n ()->last_component ();
-
- return 0;
-}
-
-int
-be_union_branch::gen_default_label_value (TAO_OutStream *os,
- be_union *bu)
-{
- be_union::DefaultValue dv;
-
- if (bu->default_value (dv) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch::"
- "gen_default_label_value - "
- "computing default value failed\n"),
- -1);
- }
-
- switch (bu->udisc_type ())
- {
- case AST_Expression::EV_short:
- *os << dv.u.short_val;
- break;
- case AST_Expression::EV_ushort:
- *os << dv.u.ushort_val;
- break;
- case AST_Expression::EV_long:
- *os << dv.u.long_val;
- break;
- case AST_Expression::EV_ulong:
- *os << dv.u.ulong_val;
- break;
- case AST_Expression::EV_char:
- os->print ("%d", dv.u.char_val);
- break;
- case AST_Expression::EV_bool:
- *os << (dv.u.bool_val == 0 ? "false" : "true");
- break;
- case AST_Expression::EV_enum:
- // The discriminant is an enum. Some compilers will
- // not accept a numeric value assigned to this
- // discriminant, so we must generate the string name.
- {
- AST_ConcreteType *act = bu->disc_type ();
- be_enum *be = be_enum::narrow_from_decl (act);
-
- // The function value_to_name() takes care of adding
- // any necessary scoping to the output.
- *os << be->value_to_name (dv.u.enum_val);
- break;
- }
- case AST_Expression::EV_longlong:
- case AST_Expression::EV_ulonglong:
- // Unimplemented.
- default:
- // Error caught earlier.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch::"
- "gen_default_label_value - "
- "bad or unimplemented discriminant type\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_union_branch::accept (be_visitor *visitor)
-{
- return visitor->visit_union_branch (this);
-}
-
-void
-be_union_branch::destroy (void)
-{
- this->be_decl::destroy ();
- this->AST_UnionBranch::destroy ();
-}
-
-// Narrowing.
-IMPL_NARROW_METHODS2 (be_union_branch, AST_UnionBranch, be_decl)
-IMPL_NARROW_FROM_DECL (be_union_branch)
diff --git a/TAO/TAO_IDL/be/be_union_fwd.cpp b/TAO/TAO_IDL/be/be_union_fwd.cpp
deleted file mode 100644
index e695b8335e9..00000000000
--- a/TAO/TAO_IDL/be/be_union_fwd.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_union_fwd.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_UnionFwd that provides additional means for C++
-// mapping of a union.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-#include "be_union_fwd.h"
-#include "be_visitor.h"
-#include "ast_union.h"
-
-ACE_RCSID (be,
- be_union_fwd,
- "$Id$")
-
-be_union_fwd::be_union_fwd (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_StructureFwd (),
- AST_UnionFwd (),
- be_decl (),
- be_type (),
- be_structure_fwd ()
-{
-}
-
-be_union_fwd::be_union_fwd (AST_Union *dummy,
- UTL_ScopedName *n)
- : COMMON_Base (),
- AST_Decl (AST_Decl::NT_union_fwd,
- n),
- AST_Type (AST_Decl::NT_union_fwd,
- n),
- AST_StructureFwd (dummy,
- n),
- AST_UnionFwd (dummy,
- n),
- be_decl (AST_Decl::NT_union_fwd,
- n),
- be_type (AST_Decl::NT_union_fwd,
- n),
- be_structure_fwd (dummy,
- n)
-{
-}
-
-be_union_fwd::~be_union_fwd (void)
-{
-}
-
-void
-be_union_fwd::destroy (void)
-{
- this->be_structure_fwd::destroy ();
-}
-
-int
-be_union_fwd::accept (be_visitor *visitor)
-{
- return visitor->visit_union_fwd (this);
-}
-
-// Narrowing
-IMPL_NARROW_METHODS2 (be_union_fwd, AST_UnionFwd, be_type)
-IMPL_NARROW_FROM_DECL (be_union_fwd)
diff --git a/TAO/TAO_IDL/be/be_union_label.cpp b/TAO/TAO_IDL/be/be_union_label.cpp
deleted file mode 100644
index 2f1f63dc27b..00000000000
--- a/TAO/TAO_IDL/be/be_union_label.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// $Id$
-//
-
-#include "be_union_label.h"
-#include "be_visitor.h"
-
-ACE_RCSID (be,
- be_union_label,
- "$Id$")
-
-be_union_label::be_union_label (void)
- : AST_UnionLabel ()
-{
-}
-
-be_union_label::be_union_label (AST_UnionLabel::UnionLabel ul,
- AST_Expression *v)
- : AST_UnionLabel (ul,
- v)
-{
-}
-
-int
-be_union_label::accept (be_visitor *visitor)
-{
- return visitor->visit_union_label (this);
-}
-
-void
-be_union_label::destroy (void)
-{
- this->AST_UnionLabel::destroy ();
-}
-
diff --git a/TAO/TAO_IDL/be/be_util.cpp b/TAO/TAO_IDL/be/be_util.cpp
deleted file mode 100644
index fb257e3353e..00000000000
--- a/TAO/TAO_IDL/be/be_util.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_util.cpp
-//
-// = DESCRIPTION
-// Static helper methods used by multiple visitors.
-//
-// = AUTHOR
-// Gary Maxey
-//
-// ============================================================================
-
-#include "be_util.h"
-#include "utl_identifier.h"
-#include "ace/OS_NS_string.h"
-
-ACE_RCSID (be,
- be_util,
- "$Id$")
-
-void
-be_util::gen_nested_namespace_begin (TAO_OutStream *os, be_module *node)
-{
- char *item_name = 0;
-
- for (UTL_IdListActiveIterator i (node->name ()); !i.is_done (); i.next ())
- {
- item_name = i.item ()->get_string ();
-
- if (ACE_OS::strcmp (item_name, "") != 0)
- {
- // Leave the outermost root scope.
- *os << be_nl << "namespace " << item_name << be_nl
- << "{" << be_idt_nl;
- }
- }
-}
-
-void
-be_util::gen_nested_namespace_end (TAO_OutStream *os, be_module *node)
-{
- for (UTL_IdListActiveIterator i (node->name ()); !i.is_done (); i.next ())
- {
- if (ACE_OS::strcmp (i.item ()->get_string (), "") != 0)
- {
- // Leave the outermost root scope.
- *os << be_uidt_nl << "}";
- }
- }
-
- *os << be_nl << be_nl;
-}
diff --git a/TAO/TAO_IDL/be/be_valuebox.cpp b/TAO/TAO_IDL/be/be_valuebox.cpp
deleted file mode 100644
index 0efd7f4df4a..00000000000
--- a/TAO/TAO_IDL/be/be_valuebox.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_valuebox.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Valuebox that provides additional means for C++
-// mapping.
-//
-// = AUTHOR
-// Gary Maxey
-//
-// ============================================================================
-
-#include "be_valuebox.h"
-#include "be_type.h"
-#include "be_visitor.h"
-#include "global_extern.h"
-
-ACE_RCSID (be,
- be_valuebox,
- "be_valuebox.cpp Exp")
-
-// Default constructor.
-be_valuebox::be_valuebox (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_ConcreteType (),
- AST_ValueBox (),
- be_decl (),
- be_type ()
-{
- // Always the case (according to C++ mapping specification).
- this->size_type (AST_Type::VARIABLE);
-
- // Set the flag that says we have a valuetype in this IDL file.
- // This allows the correct #include to be generated (see be_codegen.cpp).
- idl_global->valuebase_seen_ = true;
-
- // Set the flag that says we have a valuetype in this IDL file.
- // This allows the correct #include to be generated (see be_codegen.cpp).
- idl_global->valuetype_seen_ = true;
-}
-
-be_valuebox::be_valuebox (AST_Type *boxed_type,
- UTL_ScopedName *n)
- : COMMON_Base (),
- AST_Decl (AST_Decl::NT_valuebox,
- n),
- AST_Type (AST_Decl::NT_valuebox,
- n),
- AST_ConcreteType (AST_Decl::NT_valuebox,
- n),
- AST_ValueBox (n,
- boxed_type),
- be_decl (AST_Decl::NT_valuebox,
- n),
- be_type (AST_Decl::NT_valuebox,
- n)
-{
- // Always the case (according to C++ mapping specification).
- this->size_type (AST_Type::VARIABLE);
-
- // Set the flag that says we have a valuetype in this IDL file.
- // This allows the correct #include to be generated (see be_codegen.cpp).
- idl_global->valuebase_seen_ = true;
-
- // Set the flag that says we have a valuetype in this IDL file.
- // This allows the correct #include to be generated (see be_codegen.cpp).
- idl_global->valuetype_seen_ = true;
-}
-
-// Accept a visitor.
-int
-be_valuebox::accept (be_visitor *visitor)
-{
- return visitor->visit_valuebox (this);
-}
-
-
-void
-be_valuebox::destroy (void)
-{
- // Call the destroy methods of our base classes.
- this->AST_Type::destroy ();
-}
-
-// Narrowing.
-IMPL_NARROW_METHODS2 (be_valuebox, AST_ValueBox, be_type)
-IMPL_NARROW_FROM_DECL (be_valuebox)
diff --git a/TAO/TAO_IDL/be/be_valuetype.cpp b/TAO/TAO_IDL/be/be_valuetype.cpp
deleted file mode 100644
index 6b81e89321f..00000000000
--- a/TAO/TAO_IDL/be/be_valuetype.cpp
+++ /dev/null
@@ -1,942 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_valuetype.cpp
-//
-// = DESCRIPTION
-// Extension of class AST_Interface and be_interface that provides
-// additional means for C++ mapping of an valuetype.
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-// derived from be_interface.cpp
-//
-// ============================================================================
-
-#include "be_valuetype.h"
-#include "be_visitor.h"
-#include "be_extern.h"
-#include "be_helper.h"
-#include "ast_module.h"
-#include "utl_identifier.h"
-#include "idl_defines.h"
-#include "nr_extern.h"
-#include "global_extern.h"
-#include "ace/Log_Msg.h"
-
-ACE_RCSID (be,
- be_valuetype,
- "$Id$")
-
-// Default constructor.
-be_valuetype::be_valuetype (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- UTL_Scope (),
- AST_Interface (),
- be_scope (),
- be_decl (),
- be_type (),
- be_interface (),
- AST_ValueType (),
- full_obv_skel_name_ (0)
-{
- // Always the case.
- this->size_type (AST_Type::VARIABLE);
-
- AST_Module *m = AST_Module::narrow_from_scope (this->defined_in ());
-
- if (m != 0)
- {
- m->set_has_nested_valuetype ();
- }
-
- // Always the case.
- this->has_constructor (true);
-}
-
-// Constructor used to build the AST.
-be_valuetype::be_valuetype (UTL_ScopedName *n,
- AST_Interface **inherits,
- long n_inherits,
- AST_ValueType *inherits_concrete,
- AST_Interface **inherits_flat,
- long n_inherits_flat,
- AST_Interface **supports,
- long n_supports,
- AST_Interface *supports_concrete,
- bool abstract,
- bool truncatable,
- bool custom)
- : COMMON_Base (0,
- abstract),
- AST_Decl (AST_Decl::NT_valuetype,
- n),
- AST_Type (AST_Decl::NT_valuetype,
- n),
- UTL_Scope (AST_Decl::NT_valuetype),
- AST_Interface (n,
- inherits,
- n_inherits,
- inherits_flat,
- n_inherits_flat,
- 0,
- abstract),
- be_scope (AST_Decl::NT_valuetype),
- be_decl (AST_Decl::NT_valuetype,
- n),
- be_type (AST_Decl::NT_valuetype,
- n),
- be_interface (n,
- inherits,
- n_inherits,
- inherits_flat,
- n_inherits_flat,
- 0,
- abstract),
- AST_ValueType (n,
- inherits,
- n_inherits,
- inherits_concrete,
- inherits_flat,
- n_inherits_flat,
- supports,
- n_supports,
- supports_concrete,
- abstract,
- truncatable,
- custom),
- full_obv_skel_name_ (0),
- supports_abstract_ (0),
- var_out_seq_decls_gen_ (0)
-{
- // Check that redefine() copies all members.
-
- // Always the case.
- this->size_type (AST_Type::VARIABLE);
-
- AST_Module *m = AST_Module::narrow_from_scope (this->defined_in ());
-
- if (m != 0)
- {
- m->set_has_nested_valuetype ();
- }
-
- // Always the case.
- this->has_constructor (true);
-
- for (long i = 0; i < this->pd_n_supports; ++i)
- {
- be_interface *intf =
- be_interface::narrow_from_decl (this->pd_supports[i]);
-
- if (intf->has_mixed_parentage ())
- {
- this->supports_abstract_ = true;
- break;
- }
- }
-
- if (this->imported ())
- {
- return;
- }
-
- // Set the flag that says we have a valuetype in this IDL file.
- if (this->is_defined ())
- {
- idl_global->valuetype_seen_ = true;
- }
- else
- {
- idl_global->fwd_valuetype_seen_ = true;
- }
-}
-
-be_valuetype::~be_valuetype (void)
-{
-}
-
-void
-be_valuetype::redefine (AST_Interface *from)
-{
- be_valuetype *bv = be_valuetype::narrow_from_decl (from);
- bv->var_out_seq_decls_gen_ = bv->var_out_seq_decls_gen_;
- this->AST_ValueType::redefine (from);
-}
-
-// Is true if non-virtual accessor and modifier should be generated
-// If #pragma TAO OBV opt_accessor (todo) is used or -Wb,obv_opt_accessor.
-bool
-be_valuetype::opt_accessor (void)
-{
- return be_global->obv_opt_accessor ();
-}
-
-// Compute stringified fully scoped skeleton name (OBV_name).
-void
-be_valuetype::compute_fullobvskelname (void)
-{
- this->compute_full_skel_name ("OBV_",
- this->full_obv_skel_name_);
-}
-
-// Retrieve the fully scoped skeleton name.
-const char*
-be_valuetype::full_obv_skel_name (void)
-{
- if (0 == this->full_obv_skel_name_)
- {
- compute_fullobvskelname ();
- }
-
- return this->full_obv_skel_name_;
-}
-
-const char *
-be_valuetype::fwd_helper_name (void) const
-{
- return this->fwd_helper_name_.fast_rep ();
-}
-
-be_valuetype::FactoryStyle
-be_valuetype::determine_factory_style (void)
-{
- FactoryStyle factory_style = FS_UNKNOWN;
-
-
- if (this->is_abstract ())
- {
- return FS_NO_FACTORY;
- }
-
- // Check whether we have at least one operation or not.
- bool have_operation = this->have_operation ();
- bool have_factory = 0;
-
- // Try only our own scope.
- if (this->nmembers () > 0)
- {
- // Initialize an iterator to iterate thru our scope
- // Continue until each element is visited.
- for (UTL_ScopeActiveIterator si (this,
- UTL_Scope::IK_decls);
- !si.is_done ();
- si.next())
- {
- AST_Decl *d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_valuetype::"
- "determine_factory_style"
- "bad node in this scope\n"),
- factory_style);
-
- }
-
- AST_Decl::NodeType node_type = d->node_type ();
-
- if (node_type == AST_Decl::NT_factory)
- {
- have_factory = 1;
- break;
- }
-
- } // end of for loop
- } // end of if
-
- if (!have_operation && !have_factory)
- {
- factory_style = FS_CONCRETE_FACTORY;
- }
- else if (have_operation && !have_factory)
- {
- factory_style = FS_NO_FACTORY;
- }
- else
- {
- factory_style = FS_ABSTRACT_FACTORY;
- }
-
- return factory_style;
-}
-
-bool
-be_valuetype::have_operation (void)
-{
- // Check whatever scope we get for operations/attributes.
-
- bool have_operation = false;
-
- // Operations are either operations or attributes of:
- // -its own
- // -derived (abstract VT | VT | abstract iface | iface)
- //
-
- // First try our own scope.
- if (this->nmembers () > 0)
- {
- // Initialize an iterator to iterate thru our scope
- // Continue until each element is checked.
- for (UTL_ScopeActiveIterator si (this,
- UTL_Scope::IK_decls);
- !si.is_done ();
- si.next())
- {
- AST_Decl *d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_valuetype::"
- "has_operation"
- "bad node in this scope\n"),
- 0);
-
- }
-
- AST_Decl::NodeType nt = d->node_type();
-
- if (nt == AST_Decl::NT_op || nt == AST_Decl::NT_attr)
- {
- have_operation = true;
- break;
- }
- } // end of for loop
- } // end of if
-
- if (! have_operation)
- {
- // Now traverse inheritance tree.
- long i; // loop index
- long n_inherits = this->n_inherits ();
- AST_Interface **inherits = this->inherits ();
-
- for (i = 0; i < n_inherits; ++i)
- {
- be_valuetype *vt = be_valuetype::narrow_from_decl (inherits[i]);
-
- if (vt != 0 && vt->have_operation ())
- {
- have_operation = true;
- break;
- }
- }
- }
-
- if (! have_operation)
- {
- // Check for operations on supported interfaces
- AST_Interface * supported = this->supports_concrete ();
-
- if (supported != 0)
- {
- be_interface *intf = be_interface::narrow_from_decl (supported);
-
- if (intf != 0)
- {
- have_operation = be_valuetype::have_supported_op (intf);
- }
- }
- }
-
- return have_operation;
-}
-
-bool
-be_valuetype::have_supported_op (be_interface * node)
-{
-
- bool have_supported_op = 0;
-
- if (node->nmembers () == 0)
- {
- return false;
- }
-
- // Initialize an iterator for supported interface elements
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- si.is_done ();
- si.next())
- {
- AST_Decl *d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_valuetype::"
- "have_supported_op"
- "bad node in this scope\n"),
- 0);
- }
-
- AST_Decl::NodeType nt = d->node_type ();
-
- // Check the type of each element in the supported interface
- if (nt == AST_Decl::NT_op || nt == AST_Decl::NT_attr)
- {
- have_supported_op = 1;
- break;
- }
- } // end for loop
-
- if (! have_supported_op)
- {
- // Now traverse inheritance tree.
- long i; // loop index
- long n_inherits = node->n_inherits ();
- AST_Interface **inherits = node->inherits ();
- for (i = 0; i < n_inherits; ++i)
- {
- be_interface * intf = be_interface::narrow_from_decl (inherits[i]);
-
- if (intf != 0)
- {
- have_supported_op = be_valuetype::have_supported_op (intf);
-
- if (have_supported_op)
- {
- break;
- }
- }
- }
- }
-
- return have_supported_op;
-}
-
-bool
-be_valuetype::will_have_factory (void)
-{
- FactoryStyle fs = this->determine_factory_style ();
-
- return (fs == FS_ABSTRACT_FACTORY || fs == FS_CONCRETE_FACTORY);
-}
-
-bool
-be_valuetype::has_member (void)
-{
- AST_ValueType *parent = this->pd_inherits_concrete;
-
- // We're looking for inherited members too.
- if (parent != 0)
- {
- be_valuetype *be_parent =
- be_valuetype::narrow_from_decl (parent);
-
- if (be_parent->has_member ())
- {
- return true;
- }
- }
-
- for (UTL_ScopeActiveIterator si (this, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next())
- {
- if (si.item ()->node_type () == AST_Decl::NT_field)
- {
- return true;
- }
- }
-
- return false;
-}
-
-int
-be_valuetype::gen_helper_header (char *, char *)
-{
- TAO_OutStream *os = tao_cg->client_header ();
-
- *os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << "namespace CORBA" << be_nl
- << "{"
- << be_idt_nl
- << "extern " << be_global->stub_export_macro () << " void add_ref ("
- << this->full_name () << " *);" << be_nl
- << "extern " << be_global->stub_export_macro () << " void remove_ref ("
- << this->full_name () << " *);";
-
- *os << be_uidt_nl
- << "}";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- return 0;
-}
-
-int
-be_valuetype::gen_helper_inline (char *, char *)
-{
- TAO_OutStream *os = tao_cg->client_inline ();
-
- // There is a problem, here. Looks like the if defined __ACE_INLINE
- // is not getting generated... Actually this is a much bigger
- // problem. Just hacking it up for the timebeing..
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "#if defined (__ACE_INLINE__)" << be_nl << be_nl
- << be_global->core_versioning_begin () << be_nl
- << "namespace CORBA" << be_nl
- << "{"
- << be_idt_nl
- << "extern " << be_global->stub_export_macro () << " void add_ref ("
- << this->full_name () << " *);" << be_nl
- << "extern " << be_global->stub_export_macro () << " void remove_ref ("
- << this->full_name () << " *);"
- << be_uidt_nl
- << "}" << be_nl << be_nl
- << be_global->core_versioning_end () << be_nl
- << "#endif /*__ACE_INLINE__*/";
-
- return 0;
-}
-
-
-int
-be_valuetype::gen_helper_stubs (char *, char *)
-{
- TAO_OutStream *os = tao_cg->client_stubs ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "void" << be_nl
- << "CORBA::add_ref (" << this->full_name () << " * vt)" << be_nl
- << "{" << be_idt_nl
- << "if (vt != 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "vt->_add_ref ();" << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "void" << be_nl
- << "CORBA::remove_ref (" << this->full_name () << " * vt)" << be_nl
- << "{" << be_idt_nl
- << "if (vt != 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "vt->_remove_ref ();" << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl
- << "}";
-
- return 0;
-}
-
-// Generate the forward declarations and static methods used by the
-// interface _var and _out template classes, as well as by the
-// template sequence classes for object references.
-void
-be_valuetype:: gen_var_out_seq_decls (void)
-{
- if (this->var_out_seq_decls_gen_ == 1)
- {
- return;
- }
-
- TAO_OutStream *os = tao_cg->client_header ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Generate the ifdefined macro for this interface.
- os->gen_ifdef_macro (this->flat_name (),
- "var_out");
-
- const char *lname = this->local_name ();
-
- *os << be_nl << be_nl
- << "class " << lname << ";" << be_nl
- << "typedef" << be_idt_nl
- << "TAO_Value_Var_T<" << be_idt << be_idt_nl
- << lname << be_uidt_nl
- << ">" << be_uidt_nl
- << lname << "_var;" << be_uidt_nl << be_nl
- << "typedef" << be_idt_nl
- << "TAO_Value_Out_T<" << be_idt << be_idt_nl
- << lname << be_uidt_nl
- << ">" << be_uidt_nl
- << lname << "_out;" << be_uidt;
-
- os->gen_endif ();
-
- this->var_out_seq_decls_gen_ = 1;
-}
-
-// For building the pre and postfix of private data fields.
-const char *
-be_valuetype::field_pd_prefix (void)
-{
- return "_pd_";
-}
-
-const char *
-be_valuetype::field_pd_postfix (void)
-{
- return "";
-}
-
-be_valuetype *
-be_valuetype::statefull_inherit (void)
-{
- if (this->pd_inherits_concrete != 0)
- {
- return be_valuetype::narrow_from_decl (this->pd_inherits_concrete);
- }
- else
- {
- return 0;
- }
-}
-
-// Accept a visitor.
-int
-be_valuetype::accept (be_visitor *visitor)
-{
- return visitor->visit_valuetype (this);
-}
-
-void
-be_valuetype::destroy (void)
-{
- delete [] this->full_obv_skel_name_;
- this->full_obv_skel_name_ = 0;
-
- this->be_interface::destroy ();
- this->AST_ValueType::destroy ();
-}
-
-ACE_CDR::ULong
-be_valuetype::data_members_count (AST_Field::Visibility vis)
-{
- ACE_CDR::ULong count = 0;
-
- for (UTL_ScopeActiveIterator si (this, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next())
- {
- AST_Decl *d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_valuetype::data_members_count - "
- "bad node in this scope\n"), 0);
- }
-
- AST_Field *field = AST_Field::narrow_from_decl (d);
-
- if (!field)
- {
- continue;
- }
-
- if (vis != AST_Field::vis_NA)
- {
- if (vis == field->visibility ()) ++count;
- }
- else
- {
- ++count;
- }
- } // end of for loop
- return count;
-}
-
-bool
-be_valuetype::in_recursion (ACE_Unbounded_Queue<AST_Type *> &list)
-{
- list.enqueue_tail (this);
-
- for (UTL_ScopeActiveIterator si (this, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next())
- {
- AST_Decl *d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_valuetype::in_recursion - "
- "bad node in this scope\n"),
- 0);
- }
-
- AST_Field *field = AST_Field::narrow_from_decl (d);
-
- if (!field)
- {
- continue;
- }
-
- AST_Type *type = field->field_type ();
-
- // A valuetype may contain itself as a member. This will not
- // cause a problem when checking if the valuetype itself is
- // recursive, but if another valuetype contains a recursive
- // one, the string compare below is not sufficient, and we
- // will go into an infinite recursion of calls to in_recursion ;-).
- // The check below will catch that use case.
- if (this == type)
- {
- this->in_recursion_ = 1;
- idl_global->recursive_type_seen_ = true;
- return this->in_recursion_;
- }
-
- if (!type)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_valuetype::in_recursion - "
- "bad base type\n"),
- 0);
- }
-
- // IDL doesn't have such a feature as name reuse so
- // just compare fully qualified names.
- if (this->match_names (this, list))
- {
- this->in_recursion_ = 1;
- idl_global->recursive_type_seen_ = true;
- return this->in_recursion_;
- }
-
- if (type->node_type () == AST_Decl::NT_typedef)
- {
- AST_Typedef *td = AST_Typedef::narrow_from_decl (type);
- type = td->primitive_base_type ();
- }
-
- // Now hand over to our field type.
- if (type->in_recursion (list))
- {
- this->in_recursion_ = 1;
- idl_global->recursive_type_seen_ = true;
- return this->in_recursion_;
- }
-
- } // end of for loop
-
- this->in_recursion_ = 0;
- return this->in_recursion_;
-}
-
-bool
-be_valuetype::supports_abstract (void) const
-{
- return this->supports_abstract_;
-}
-
-// Template method that traverses the inheritance graph in a breadth-first
-// style. The actual work on each element in the inheritance graph is carried
-// out by the function passed as argument.
-int
-be_valuetype::traverse_supports_list_graphs (
- be_interface::tao_code_emitter gen,
- TAO_OutStream *os,
- bool use_abstract_paths,
- bool use_concrete_paths
- )
-{
- bool abstract_paths_only = use_abstract_paths && !use_concrete_paths;
-
- long n_supports = this->n_supports ();
-
- if (n_supports == 0)
- {
- return 0;
- }
-
- // Make sure the queues are empty.
- this->insert_queue.reset ();
- this->del_queue.reset ();
-
- be_interface *supported_interface = 0;
-
- for (long i = 0; i < n_supports; ++i)
- {
- if (! use_abstract_paths
- && this->pd_supports[i]->is_abstract ())
- {
- continue;
- }
-
- if (! use_concrete_paths
- && ! this->pd_supports[i]->is_abstract ())
- {
- continue;
- }
-
- supported_interface =
- be_interface::narrow_from_decl (this->pd_supports[i]);
-
- // Insert a supported interface in the queue.
- if (this->insert_queue.enqueue_tail (supported_interface) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_valuetype::"
- "traverse_supports_list_graphs - "
- "error generating entries\n"),
- -1);
- }
- }
-
- be_code_emitter_wrapper wrapper (gen);
-
- return this->traverse_inheritance_graph (wrapper,
- os,
- abstract_paths_only);
-}
-
-int
-be_valuetype::traverse_concrete_inheritance_graph (tao_code_emitter gen,
- TAO_OutStream *os)
-{
- AST_Interface *supported = this->supports_concrete ();
-
- if (supported == 0)
- {
- return 0;
- }
-
- be_interface *concrete = be_interface::narrow_from_decl (supported);
-
- // Make sure the queues are empty.
- this->insert_queue.reset ();
- this->del_queue.reset ();
-
- // Insert the supported concrete interface in the queue.
- if (this->insert_queue.enqueue_tail (concrete) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_valuetype::"
- "traverse_concrete_inheritance_graph - "
- "error generating entries\n"),
- -1);
- }
-
- be_code_emitter_wrapper wrapper (gen);
-
- return this->traverse_inheritance_graph (wrapper,
- os);
-}
-
-int
-be_valuetype::abstract_supports_helper (be_interface *,
- be_interface *base,
- TAO_OutStream *os)
-{
- *os << "," << be_nl
- << "public virtual "
- << base->name ();
-
- return 0;
-}
-
-int
-be_valuetype::gen_skel_helper (be_interface *concrete,
- be_interface *ancestor,
- TAO_OutStream *os)
-{
- // If derived and ancestor are same, skip it.
- if (concrete == ancestor)
- {
- return 0;
- }
-
- // If an operation or an attribute is abstract (declared in an
- // abstract interface), we will either generate the full
- // definition (if there are no concrete interfaces between the
- // abstract ancestor and us) or, if there is a concrete ancestor
- // in between, we will catch its definition elsewhere in this
- // traversal.
- if (ancestor->is_abstract ())
- {
- return 0;
- }
-
- // Else generate code that does the cast to the appropriate type.
-
- if (ancestor->nmembers () > 0)
- {
- // If there are elements in ancestor scope i.e., any operations and
- // attributes defined by "ancestor", become methods on the derived class
- // which call the corresponding method of the base class by doing the
- // proper casting.
-
- for (UTL_ScopeActiveIterator si (ancestor, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- // Get the next AST decl node
- AST_Decl *d = si.item ();
-
- if (d->node_type () == AST_Decl::NT_op)
- {
- // Start from current indentation level.
- os->indent ();
-
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- if (os->stream_type () == TAO_OutStream::TAO_SVR_HDR)
- {
- // Generate the static method corresponding to this method.
- *os << "static void " << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest &req, " << be_nl
- << "void *obj," << be_nl
- << "void *context" << env_dflts << be_uidt_nl
- << ");" << be_uidt << "\n\n";
- }
- else
- { // Generate code in the inline file.
- // Generate the static method corresponding to this method.
- *os << "ACE_INLINE void "
- << concrete->full_skel_name () << "::"
- << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *context" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
- *os << ancestor->full_skel_name ()
- << "_ptr impl = ("
- << concrete->full_skel_name ()
- << "_ptr) obj;" << be_nl;
- *os << ancestor->full_skel_name ()
- << "::" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "req," << be_nl
- << "(" << ancestor->full_skel_name ()
- << "_ptr) impl," << be_nl
- << "context" << env_arg << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}\n";
- }
- }
- } // End of scope iterator.
- }
-
- return 0;
-}
-
-// Narrowing.
-IMPL_NARROW_METHODS2 (be_valuetype, be_interface, AST_ValueType)
-IMPL_NARROW_FROM_DECL (be_valuetype)
-IMPL_NARROW_FROM_SCOPE (be_valuetype)
diff --git a/TAO/TAO_IDL/be/be_valuetype_fwd.cpp b/TAO/TAO_IDL/be/be_valuetype_fwd.cpp
deleted file mode 100644
index 2146482f54c..00000000000
--- a/TAO/TAO_IDL/be/be_valuetype_fwd.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_valuetype_fwd.h
-//
-// = DESCRIPTION
-// Extension of class be_interface_fwd that provides additional
-// means for C++ mapping of an valuetype.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-// changed for valuetypes by Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-//
-// ============================================================================
-
-
-#include "be_valuetype_fwd.h"
-#include "be_visitor.h"
-#include "ast_interface.h"
-
-ACE_RCSID (be,
- be_valuetype_fwd,
- "$Id$")
-
-be_valuetype_fwd::be_valuetype_fwd (void)
- : COMMON_Base (),
- AST_Decl (),
- AST_Type (),
- AST_InterfaceFwd (),
- be_decl (),
- be_type (),
- be_interface_fwd (),
- AST_ValueTypeFwd ()
-{
-}
-
-be_valuetype_fwd::be_valuetype_fwd (AST_Interface *dummy,
- UTL_ScopedName *n)
- : COMMON_Base (dummy->is_local (),
- dummy->is_abstract ()),
- AST_Decl (AST_Decl::NT_valuetype_fwd,
- n),
- AST_Type (AST_Decl::NT_valuetype_fwd,
- n),
- AST_InterfaceFwd (dummy,
- n),
- be_decl (AST_Decl::NT_valuetype_fwd,
- n),
- be_type (AST_Decl::NT_valuetype_fwd,
- n),
- be_interface_fwd (dummy,
- n),
- AST_ValueTypeFwd (dummy,
- n)
-{
-}
-
-be_valuetype_fwd::~be_valuetype_fwd (void)
-{
-}
-
-int
-be_valuetype_fwd::accept (be_visitor *visitor)
-{
- return visitor->visit_valuetype_fwd (this);
-}
-
-void
-be_valuetype_fwd::destroy (void)
-{
- this->be_interface_fwd::destroy ();
-}
-
-// Narrowing.
-IMPL_NARROW_METHODS2 (be_valuetype_fwd, be_interface_fwd, AST_ValueTypeFwd)
-IMPL_NARROW_FROM_DECL (be_valuetype_fwd)
-
diff --git a/TAO/TAO_IDL/be/be_visitor.cpp b/TAO/TAO_IDL/be/be_visitor.cpp
deleted file mode 100644
index d5393a4c3af..00000000000
--- a/TAO/TAO_IDL/be/be_visitor.cpp
+++ /dev/null
@@ -1,224 +0,0 @@
-//
-// $Id$
-//
-/* -*- c++ -*- */
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor.h
-//
-// = DESCRIPTION
-// Abstract class for back end visitors.
-//
-// = NOTES
-// This is not a pure abstract class
-//
-// = AUTHOR
-// Aniruddha Gokhale and Carlos O'Ryan
-//
-// ============================================================================
-
-#include "be_visitor.h"
-#include "ace/config-all.h"
-
-ACE_RCSID (be,
- be_visitor,
- "$Id$")
-
-be_visitor::be_visitor (void)
-{
-}
-
-be_visitor::~be_visitor (void)
-{
-}
-
-// all the visit methods. Concrete visitors will selectively override each one
-int be_visitor::visit_decl (be_decl *)
-{
- return 0;
-}
-
-int be_visitor::visit_scope (be_scope *)
-{
- return 0;
-}
-
-int be_visitor::visit_type (be_type *)
-{
- return 0;
-}
-
-int be_visitor::visit_predefined_type (be_predefined_type *)
-{
- return 0;
-}
-
-int be_visitor::visit_module (be_module *)
-{
- return 0;
-}
-
-int be_visitor::visit_interface (be_interface *)
-{
- return 0;
-}
-
-int be_visitor::visit_interface_fwd (be_interface_fwd *)
-{
- return 0;
-}
-
-int be_visitor::visit_valuebox (be_valuebox *)
-{
- return 0;
-}
-
-int be_visitor::visit_valuetype (be_valuetype *)
-{
- return 0;
-}
-
-int be_visitor::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- return 0;
-}
-
-int be_visitor::visit_eventtype (be_eventtype *)
-{
- return 0;
-}
-
-int be_visitor::visit_eventtype_fwd (be_eventtype_fwd *)
-{
- return 0;
-}
-
-int be_visitor::visit_component (be_component *)
-{
- return 0;
-}
-
-int be_visitor::visit_component_fwd (be_component_fwd *)
-{
- return 0;
-}
-
-int be_visitor::visit_home (be_home *)
-{
- return 0;
-}
-
-int be_visitor::visit_factory (be_factory *)
-{
- return 0;
-}
-
-int be_visitor::visit_structure (be_structure *)
-{
- return 0;
-}
-
-int be_visitor::visit_structure_fwd (be_structure_fwd *)
-{
- return 0;
-}
-
-int be_visitor::visit_exception (be_exception *)
-{
- return 0;
-}
-
-int be_visitor::visit_expression (be_expression *)
-{
- return 0;
-}
-
-int be_visitor::visit_enum (be_enum *)
-{
- return 0;
-}
-
-int be_visitor::visit_operation (be_operation *)
-{
- return 0;
-}
-
-int be_visitor::visit_field (be_field *)
-{
- return 0;
-}
-
-int be_visitor::visit_argument (be_argument *)
-{
- return 0;
-}
-
-int be_visitor::visit_attribute (be_attribute *)
-{
- return 0;
-}
-
-int be_visitor::visit_union (be_union *)
-{
- return 0;
-}
-
-int be_visitor::visit_union_fwd (be_union_fwd *)
-{
- return 0;
-}
-
-int be_visitor::visit_union_branch (be_union_branch *)
-{
- return 0;
-}
-
-int be_visitor::visit_union_label (be_union_label *)
-{
- return 0;
-}
-
-int be_visitor::visit_constant (be_constant *)
-{
- return 0;
-}
-
-int be_visitor::visit_enum_val (be_enum_val *)
-{
- return 0;
-}
-
-int be_visitor::visit_array (be_array *)
-{
- return 0;
-}
-
-int be_visitor::visit_sequence (be_sequence *)
-{
- return 0;
-}
-
-int be_visitor::visit_string (be_string *)
-{
- return 0;
-}
-
-int be_visitor::visit_typedef (be_typedef *)
-{
- return 0;
-}
-
-int be_visitor::visit_root (be_root *)
-{
- return 0;
-}
-
-int be_visitor::visit_native (be_native *)
-{
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp
deleted file mode 100644
index 232bed31bea..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp
+++ /dev/null
@@ -1,858 +0,0 @@
-/**
- * @file be_visitor_amh_pre_proc.cpp
- *
- * $Id$
- *
- * This visitor creates for AMH implied IDL constructs the appropriate AST
- * (Abstract Syntax Tree) node, sets the corresponding interface or operation
- * strategy on it and enteres the nodes into the AST.
-*
-* @author Darrell Brunsch <brunsch@cs.wustl.edu>
-* @author Mayur Deshpande <mayur@ics.uci.edu>
-* @author Carlos O'Ryan <coryan@uci.edu>
-*/
-//=============================================================================
-
-#include "be_visitor_amh_pre_proc.h"
-#include "be_visitor_context.h"
-#include "be_root.h"
-#include "be_module.h"
-#include "be_interface.h"
-#include "be_valuetype.h"
-#include "be_attribute.h"
-#include "be_operation.h"
-#include "be_predefined_type.h"
-#include "be_argument.h"
-#include "be_extern.h"
-#include "utl_identifier.h"
-#include "utl_exceptlist.h"
-#include "global_extern.h"
-#include "ace/Log_Msg.h"
-
-ACE_RCSID (be,
- be_visitor_amh_pre_proc,
- "$Id$")
-
-be_visitor_amh_pre_proc::be_visitor_amh_pre_proc (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_amh_pre_proc::~be_visitor_amh_pre_proc (void)
-{
-}
-
-int
-be_visitor_amh_pre_proc::visit_root (be_root *node)
-{
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_pre_proc::"
- "visit_root - visit scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_amh_pre_proc::visit_module (be_module *node)
-{
- if (!node->imported () && this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_pre_proc::"
- "visit_module - visit scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_amh_pre_proc::visit_interface (be_interface *node)
-{
- // Do not generate AMH classes for any sort of implied IDL.
- if (node->original_interface () != 0)
- {
- return 0;
- }
-
- // Don't generate AMH classes for imported, local or abstract interfaces
- // either...
- // @@ Mayur, maybe we do want to insert the AMH node for imported
- // interfaces, not because we want to generate code for them, but
- // because the (imported-AMH-) node could be needed to generate a
- // non-imported, AMH node, for example, for a derived interface.
-
- // (JP) Havinq AMH_* nodes inherit directly from AMH_* base classes
- // is also a problem if the base interface is abstract, since at
- // the moment, no AMH code is generated for such interfaces. It
- // would be desirable to mimic the AMI design, where all AMI-related
- // classes inherit from a single base class, no matter what the
- // parentage of the IDL interface. Until we solve the problem of
- // AMH for abstract interfaces, I'm disabling all AMH generation
- // for interfaces having an abstract ancestor.
- if (node->imported ()
- || node->is_local ()
- || node->is_abstract ()
- || node->has_mixed_parentage ())
- {
- return 0;
- }
-
- // Create the exception holder, it needs to go before the response
- // handler, because the response handler uses an exception holder as
- // argument for some of its operations....
- be_valuetype *excep_holder =
- this->create_exception_holder (node);
- excep_holder->set_defined_in (node->defined_in ());
- excep_holder->original_interface (node);
-
- AST_Module *module =
- AST_Module::narrow_from_scope (node->defined_in ());
- module->set_has_nested_valuetype ();
-
- // Create the ResponseHandler class
- be_interface *response_handler =
- this->create_response_handler (node,
- excep_holder);
-
- if (response_handler == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_pre_proc::"
- "visit_interface - "
- "creating the response handler failed\n"),
- -1);
- }
- response_handler->set_defined_in (node->defined_in ());
-
- // Insert the response handler after the node.
- module->be_add_interface (response_handler,
- node);
-
- // Remember from whom we were cloned
- response_handler->original_interface (node);
-
- module->be_add_interface (excep_holder, node);
-
- return 0;
-}
-
-be_interface *
-be_visitor_amh_pre_proc::create_response_handler (
- be_interface *node,
- be_valuetype *exception_holder
- )
-{
- // Generate 'AMH_InterfaceResponseHandler'
- ACE_CString class_name;
- class_name += "AMH_";
- class_name += node->local_name ();
- class_name += "ResponseHandler";
-
- UTL_ScopedName *amh_name =
- dynamic_cast<UTL_ScopedName*> (node->name ()->copy ());
- Identifier *local_name = amh_name->last_component ();
- local_name->replace_string (class_name.c_str ());
-
- UTL_Scope *s = node->defined_in ();
- idl_global->scopes ().push (s);
-
- // @@ Mayur, you are not filling up the list of inherited classes,
- // however, you *are* using that same list in the amh_rh_sh.cpp and
- // amh_rh_sh.cpp file... you need to fill up the list, i.e. discover
- // the inherited classes in the original interface, change their
- // names and then use the symbol table to look up the
- // AMH-response-handler nodes.
- be_interface *response_handler = 0;
- ACE_NEW_RETURN (response_handler,
- be_interface (amh_name, // name
- 0, // list of inherited
- 0, // number of inherited
- 0, // list of ancestors
- 0, // number of ancestors
- 1, // local
- 0), // non-abstract
- 0);
-
- idl_global->scopes ().pop ();
-
- response_handler->set_name (amh_name);
- response_handler->set_defined_in (node->defined_in ());
- response_handler->set_imported (node->imported ());
- response_handler->set_line (node->line ());
- response_handler->set_file_name (node->file_name ());
- response_handler->gen_fwd_helper_name ();
-
- this->add_rh_node_members (node, response_handler, exception_holder);
-
- return response_handler;
-}
-
-int
-be_visitor_amh_pre_proc::add_rh_node_members ( be_interface *node,
- be_interface *response_handler,
- be_valuetype *exception_holder)
-{
- // Now our customized valuetype is created, we have to
- // add now the operations and attributes to the scope.
-
- this->elem_number_ = 0;
-
- // Initialize an iterator to iterate thru our scope.
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- AST_Decl *d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_pre_proc::"
- "add_rh_node_members - "
- "bad node in this scope\n"),
- 0);
- }
-
- AST_Decl::NodeType nt = d->node_type ();
- int status = 0;
-
- if (nt == AST_Decl::NT_attr)
- {
- be_attribute *attr = be_attribute::narrow_from_decl (d);
-
- if (attr != 0)
- {
- status =
- this->create_response_handler_attribute (attr,
- response_handler,
- exception_holder);
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_pre_proc::"
- "add_rh_node_members - "
- "attribute creation failed\n"),
- 0);
- }
- }
- }
- else if (nt == AST_Decl::NT_op)
- {
- be_operation* operation = be_operation::narrow_from_decl (d);
-
- if (operation != 0)
- {
- status =
- this->create_response_handler_operation (operation,
- response_handler,
- exception_holder);
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_pre_proc::"
- "add_rh_node_members - "
- "operation creation failed\n"),
- 0);
- }
- }
- }
- else
- {
- continue;
- }
- }
-
- return 1;
-}
-
-int
-be_visitor_amh_pre_proc::create_response_handler_operation (
- be_operation *node,
- be_interface *response_handler,
- be_valuetype *exception_holder
- )
-{
- if (!node)
- {
- return -1;
- }
-
- if (this->add_normal_reply (node, response_handler) == -1)
- {
- return -1;
- }
-
- return this->add_exception_reply (node,
- response_handler,
- exception_holder);
-}
-
-int
-be_visitor_amh_pre_proc::create_response_handler_attribute (
- be_attribute *node,
- be_interface *response_handler,
- be_valuetype *exception_holder
- )
-{
- // Temporarily generate the get operation.
- be_operation *get_operation = this->generate_get_operation (node);
-
- this->visit_operation (get_operation);
-
- be_operation_default_strategy *default_strategy = 0;
- ACE_NEW_RETURN (default_strategy,
- be_operation_default_strategy (get_operation),
- -1);
-
- be_operation_strategy *get_operation_strategy =
- get_operation->set_strategy (default_strategy);
-
- if (0 != get_operation_strategy)
- {
- be_operation_strategy *gos =
- node->set_get_strategy (get_operation_strategy);
-
- if (0 != gos)
- {
- gos->destroy ();
- delete gos;
- gos = 0;
- }
- }
-
- int status =
- this->create_response_handler_operation (get_operation,
- response_handler,
- exception_holder);
-
- get_operation->destroy ();
- delete get_operation;
- get_operation = 0;
-
- if (status == -1)
- {
- return -1;
- }
-
- if (node->readonly ())
- {
- return 0;
- }
-
- // Temporarily generate the set operation.
- be_operation *set_operation = this->generate_set_operation (node);
-
- this->visit_operation (set_operation);
-
- // Retrieve the strategy set by the visit operation.
- ACE_NEW_RETURN (default_strategy,
- be_operation_default_strategy (set_operation),
- -1);
-
- be_operation_strategy *set_operation_strategy =
- set_operation->set_strategy (default_strategy);
-
- // Assign it to the attribute as set_operation strategy.
- if (0 != set_operation_strategy)
- {
- be_operation_strategy *sos =
- node->set_set_strategy (set_operation_strategy);
-
- if (0 != sos)
- {
- sos->destroy ();
- delete sos;
- sos = 0;
- }
- }
-
- status =
- this->create_response_handler_operation (set_operation,
- response_handler,
- exception_holder);
-
- set_operation->destroy ();
- delete set_operation;
- set_operation = 0;
-
- return status;
-}
-
-int
-be_visitor_amh_pre_proc::add_exception_reply (be_operation *node,
- be_interface *response_handler,
- be_valuetype *exception_holder)
-{
- UTL_ScopedName *operation_name = node->compute_name ("",
- "_excep");
-
- be_operation *node_excep = 0;
- ACE_NEW_RETURN (node_excep,
- be_operation (be_global->void_type (),
- AST_Operation::OP_noflags,
- operation_name,
- 1,
- 0),
- -1);
-
- node_excep->set_name (operation_name);
-
- Identifier *arg_id = 0;
- ACE_NEW_RETURN (arg_id,
- Identifier ("holder"),
- -1);
-
- UTL_ScopedName *arg_name = 0;
- ACE_NEW_RETURN (arg_name,
- UTL_ScopedName (arg_id, 0),
- -1);
-
- be_argument *argument = 0;
- ACE_NEW_RETURN (argument,
- be_argument (AST_Argument::dir_IN,
- exception_holder,
- arg_name),
- -1);
-
- argument->set_name (arg_name);
- argument->set_defined_in (node_excep);
- node_excep->be_add_argument (argument);
-
- node_excep->set_defined_in (response_handler);
-
- if (0 == response_handler->be_add_operation (node_excep))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_amh_pre_proc::add_normal_reply (be_operation *node,
- be_interface *response_handler)
-{
- Identifier *id = 0;
- UTL_ScopedName *sn = 0;
-
- ACE_CString original_op_name (
- node->name ()->last_component ()->get_string ()
- );
-
- UTL_ScopedName *op_name =
- static_cast<UTL_ScopedName *> (response_handler->name ()->copy ());
-
- ACE_NEW_RETURN (id,
- Identifier (original_op_name.c_str ()),
- -1);
-
- ACE_NEW_RETURN (sn,
- UTL_ScopedName (id,
- 0),
- -1);
-
- op_name->nconc (sn);
-
- // Create the operation
- be_operation *operation = 0;
- ACE_NEW_RETURN (operation,
- be_operation (be_global->void_type (),
- AST_Operation::OP_noflags,
- op_name,
- 1,
- 0),
- -1);
-
- operation->set_name (op_name);
-
- // If return type is non-void add it as first argument
-
- if (!node->void_return_type ())
- {
- Identifier *arg_id = 0;
- ACE_NEW_RETURN (arg_id,
- Identifier ("return_value"),
- -1);
-
- UTL_ScopedName *arg_name = 0;
- ACE_NEW_RETURN (arg_name,
- UTL_ScopedName (arg_id, 0),
- -1);
-
- // Create the argument
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- node->return_type (),
- arg_name),
- -1);
-
- arg->set_name (arg_name);
-
- // Add the response handler to the argument list
- operation->be_add_argument (arg);
- }
-
- // Iterate over the arguments and put all the out and inout arguments
- // into the new method.
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- AST_Decl *d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_pre_proc::"
- "add_normal_reply - "
- "bad node in this scope\n"),
- -1);
-
- }
-
- //be_decl *arg = be_decl::narrow_from_decl (d);
- AST_Argument *original_arg = AST_Argument::narrow_from_decl (d);
-
- if (original_arg->direction () == AST_Argument::dir_INOUT ||
- original_arg->direction () == AST_Argument::dir_OUT)
- {
- // Create the argument
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- original_arg->field_type (),
- original_arg->name ()),
- -1);
-
- operation->be_add_argument (arg);
- }
- }
-
- operation->set_defined_in (response_handler);
-
- // We do not copy the exceptions because the exceptions
- // are delivered by the excep methods.
-
- // After having generated the operation we insert it into the
- // response handler interface.
- if (0 == response_handler->be_add_operation (operation))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_amh_pre_proc::visit_operation (be_operation *node)
-{
- // @@ Mayur, we do want to generate code for oneways! This is
- // needed to support reliable oneways with the SYNC_WITH_TARGET
- // policy.
- // We do nothing for oneways!
- if (node->flags () == AST_Operation::OP_oneway)
- {
- return 0;
- }
-
- // Set the proper strategy
- be_operation_amh_strategy *strategy = 0;
- ACE_NEW_RETURN (strategy,
- be_operation_amh_strategy (node),
- -1);
-
- be_operation_strategy *old_strategy = node->set_strategy (strategy);
-
- if (old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
-
- return 0;
-}
-
-be_valuetype *
-be_visitor_amh_pre_proc::create_exception_holder (be_interface *node)
-{
- // AMH exception holders require both of these.
- idl_global->valuetype_seen_ = true;
-
- idl_global->valuefactory_seen_ = true;
-
- const int inherit_count = 0;
- AST_Interface **p_intf = 0;
-
- UTL_ScopedName *excep_holder_name =
- node->compute_name ("AMH_",
- "ExceptionHolder");
-
- UTL_Scope *s = node->defined_in ();
- idl_global->scopes ().push (s);
-
- be_valuetype *excep_holder = 0;
- ACE_NEW_RETURN (excep_holder,
- be_valuetype (excep_holder_name,
- p_intf,
- inherit_count,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0),
- 0);
-
- idl_global->scopes ().pop ();
-
- excep_holder->set_name (excep_holder_name);
- excep_holder->set_defined_in (node->defined_in ());
- excep_holder->gen_fwd_helper_name ();
-
- // Now our customized valuetype is created, we have to
- // add now the operations and attributes to the scope.
-
- // initialize an iterator to iterate thru our scope
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- AST_Decl *d = si.item ();
-
- if (d == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_pre_proc::"
- "visit_interface - "
- "bad node in this scope\n"),
- 0);
- }
-
- be_decl *op = be_decl::narrow_from_decl (d);
- AST_Decl::NodeType nt = d->node_type ();
-
- if (nt == AST_Decl::NT_attr)
- {
- AST_Attribute *attribute = AST_Attribute::narrow_from_decl (d);
-
- if (attribute == 0)
- {
- return 0;
- }
-
- this->create_raise_operation (op,
- excep_holder,
- GET_OPERATION);
-
- if (!attribute->readonly ())
- {
- this->create_raise_operation (op,
- excep_holder,
- SET_OPERATION);
- }
- }
- else if (nt == AST_Decl::NT_op)
- {
- this->create_raise_operation (op,
- excep_holder,
- NORMAL);
- }
- else
- {
- continue;
- }
- }
-
- return excep_holder;
-}
-
-int
-be_visitor_amh_pre_proc::create_raise_operation (
- be_decl *node,
- be_valuetype *excep_holder,
- Operation_Kind operation_kind
- )
-{
- Identifier *id = 0;
- UTL_ScopedName *sn = 0;
- be_operation *orig_op = 0;
-
- if (operation_kind == NORMAL)
- {
- orig_op = be_operation::narrow_from_decl (node);
- }
-
- // Name the operation properly
- UTL_ScopedName *op_name =
- static_cast<UTL_ScopedName *> (excep_holder->name ()->copy ());
-
- ACE_CString new_local_name ("raise_");
-
- if (operation_kind == SET_OPERATION)
- {
- new_local_name += "set_";
- }
- else if (operation_kind == GET_OPERATION)
- {
- new_local_name += "get_";
- }
-
- new_local_name += node->name ()->last_component ()->get_string ();
-
- ACE_NEW_RETURN (id,
- Identifier (new_local_name.c_str ()),
- -1);
-
- ACE_NEW_RETURN (sn,
- UTL_ScopedName (id,
- 0),
- -1);
-
- op_name->nconc (sn);
-
- be_operation *operation = 0;
- ACE_NEW_RETURN (operation,
- be_operation (be_global->void_type (),
- AST_Operation::OP_noflags,
- op_name,
- 0,
- 0),
- -1);
-
- operation->set_name (op_name);
- operation->set_defined_in (excep_holder);
-
- if (operation_kind == NORMAL)
- {
- if (orig_op)
- {
- // Copy the exceptions.
- UTL_ExceptList *exceptions = orig_op->exceptions ();
-
- if (0 != exceptions)
- {
- operation->be_add_exceptions (exceptions->copy ());
- }
- }
- }
-
- // Set the proper strategy.
- be_operation_ami_exception_holder_raise_strategy *ehrs = 0;
- ACE_NEW_RETURN (
- ehrs,
- be_operation_ami_exception_holder_raise_strategy (operation),
- -1
- );
-
- be_operation_strategy *old_strategy =
- operation->set_strategy (ehrs);
-
- if (old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
-
- // After having generated the operation we insert it into the
- // exceptionholder valuetype.
- if (0 == excep_holder->be_add_operation (operation))
- {
- return -1;
- }
-
- return 0;
-}
-
-
-int
-be_visitor_amh_pre_proc::generate_name (ACE_CString &destination,
- const char *prefix,
- const char *middle_name,
- const char *suffix)
-{
- destination = prefix;
- destination += middle_name;
- destination += suffix;
- return 0;
-}
-
-
-
-be_operation *
-be_visitor_amh_pre_proc::generate_get_operation (be_attribute *node)
-{
- ACE_CString original_op_name (
- node->name ()->last_component ()->get_string ()
- );
- ACE_CString new_op_name = ACE_CString ("get_") + original_op_name;
-
- UTL_ScopedName *get_name =
- static_cast<UTL_ScopedName *> (node->name ()-> copy ());
- get_name->last_component ()->replace_string (new_op_name.c_str ());
-
- be_operation *operation = 0;
- ACE_NEW_RETURN (operation,
- be_operation (node->field_type (),
- AST_Operation::OP_noflags,
- get_name,
- 1,
- 0),
- 0);
-
- operation->set_name (get_name);
- operation->set_defined_in (node->defined_in ());
-
- return operation;
-}
-
-be_operation *
-be_visitor_amh_pre_proc::generate_set_operation (be_attribute *node)
-{
- ACE_CString original_op_name (
- node->name ()->last_component ()->get_string ()
- );
- ACE_CString new_op_name = ACE_CString ("set_") + original_op_name;
-
- UTL_ScopedName *set_op_name =
- dynamic_cast<UTL_ScopedName *> (node->name ()-> copy ());
- set_op_name->last_component ()->replace_string (new_op_name.c_str ());
-
- // argument type is the same as the attribute type
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- node->field_type (),
- set_op_name),
- 0);
-
- arg->set_name (dynamic_cast<UTL_ScopedName *> (node->name ()->copy ()));
-
- // create the operation
- be_operation *operation = 0;
- ACE_NEW_RETURN (operation,
- be_operation (be_global->void_type (),
- AST_Operation::OP_noflags,
- set_op_name,
- 0,
- 0),
- 0);
-
- operation->set_name (set_op_name);
- operation->set_defined_in (node->defined_in ());
- operation->be_add_argument (arg);
-
- return operation;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp
deleted file mode 100644
index 36a98bc6df6..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp
+++ /dev/null
@@ -1,1258 +0,0 @@
-//
-// $Id$
-//
-
-/* -*- c++ -*- */
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_ami_pre_proc.cpp
-//
-// = DESCRIPTION
-// This visitor creates for AMI implied IDL constructs
-// the appropriate AST (Abstract Syntax Tree) node,
-// sets the corresponding interface or operation strategy
-// on it and enteres the nodes into the AST.
-//
-// = AUTHOR
-// Michael Kircher <Michael.Kircher@mchp.siemens.de>
-//
-// ============================================================================
-
-#include "be_visitor_ami_pre_proc.h"
-#include "be_visitor_context.h"
-#include "be_root.h"
-#include "be_module.h"
-#include "be_interface.h"
-#include "be_interface_strategy.h"
-#include "be_valuetype.h"
-#include "be_operation.h"
-#include "be_operation_strategy.h"
-#include "be_attribute.h"
-#include "be_predefined_type.h"
-#include "be_argument.h"
-#include "be_global.h"
-#include "be_extern.h"
-#include "utl_identifier.h"
-#include "utl_exceptlist.h"
-#include "nr_extern.h"
-#include "global_extern.h"
-#include "ace/Log_Msg.h"
-
-ACE_RCSID (be,
- be_visitor_ami_pre_proc,
- "$Id$")
-
-
-be_visitor_ami_pre_proc::be_visitor_ami_pre_proc (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-
-}
-
-be_visitor_ami_pre_proc::~be_visitor_ami_pre_proc (void)
-{
-
-}
-
-int
-be_visitor_ami_pre_proc::visit_root (be_root *node)
-{
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_pre_proc::"
- "visit_root - "
- "visit scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_ami_pre_proc::visit_module (be_module *node)
-{
- // Skip this for now until we get AMI integrated with
- // CIAO.
- if (0 == ACE_OS::strcmp (node->local_name ()->get_string (), "Components"))
- {
- return 0;
- }
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_pre_proc::"
- "visit_module - "
- "visit scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_ami_pre_proc::visit_interface (be_interface *node)
-{
- // We check for an imported node after generating the reply handler.
- if (node->is_local () || node->is_abstract ())
- {
- return 0;
- }
-
- // The following 3 IF blocks are checks for CCM-related nodes, which
- // we want to skip until we get AMI integrated with CIAO.
-
- // Skip the *EventConsumer added for each eventtype.
- if (node->is_event_consumer ())
- {
- return 0;
- }
-
- // Check for home equivalent interface. The lookup will find the
- // home itself, which was declared first.
- Identifier *node_lname = node->AST_Decl::local_name ();
- AST_Decl *first_stored =
- node->defined_in ()->lookup_by_name_local (node_lname, 0);
-
- if (0 != first_stored && first_stored->node_type () == AST_Decl::NT_home)
- {
- return 0;
- }
-
- ACE_CString lname (node_lname->get_string ());
-
- // Skip the *Explict and *Implicit interfaces added for a home.
- if (lname.substr (lname.length () - 6) == "plicit")
- {
- UTL_Scope *s = node->defined_in ();
- Identifier local_id (lname.substr (0, lname.length () - 8).c_str ());
- AST_Decl *d = s->lookup_by_name_local (&local_id, 0);
- local_id.destroy ();
-
- if (0 != d)
- {
- return 0;
- }
- }
-
- AST_Module *module =
- AST_Module::narrow_from_scope (node->defined_in ());
-
- if (!module)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_pre_proc::"
- "visit_interface - "
- "module is null\n"),
- -1);
- }
-
- be_valuetype *excep_holder = this->create_exception_holder (node);
- be_interface *reply_handler = this->create_reply_handler (node,
- excep_holder);
- if (reply_handler)
- {
- reply_handler->set_defined_in (node->defined_in ());
-
- // Insert the ami handler after the node, the
- // exception holder will be placed between these two later.
- module->be_add_interface (reply_handler, node);
-
- // Remember from whom we were cloned
- reply_handler->original_interface (node);
-
- // If this was created for an imported node, it will be wrong
- // unless we set it.
- reply_handler->set_imported (node->imported ());
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_pre_proc::"
- "visit_interface - "
- "creating the reply handler failed\n"),
- -1);
- }
-
- // Set the proper strategy.
- be_interface_ami_strategy *bias = 0;
- ACE_NEW_RETURN (bias,
- be_interface_ami_strategy (node,
- reply_handler),
- -1);
- be_interface_strategy *old_strategy = node->set_strategy (bias);
-
- if (old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_pre_proc::"
- "visit_interface - "
- "visit scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_ami_pre_proc::visit_operation (be_operation *node)
-{
- if (node->flags () == AST_Operation::OP_oneway)
- {
- // We do nothing for oneways!
- return 0;
- }
-
- // If we're here, we're sure that the arg traits specialization
- // for this will be needed.
- be_global->messaging_exceptionholder ()->seen_in_operation (true);
-
- be_operation *sendc_marshaling =
- this->create_sendc_operation (node,
- 0); // for arguments = FALSE
-
- be_operation *sendc_arguments =
- this->create_sendc_operation (node,
- 1); // for arguments = TRUE
-
- if (0 != sendc_marshaling && 0 != sendc_arguments)
- {
- sendc_marshaling->set_defined_in (node->defined_in ());
-
- sendc_arguments->set_defined_in (node->defined_in ());
-
- // We do not copy the exceptions because the exceptions
- // are delivered by the excep methods.
-
- // Set the proper strategy, and store the specialized
- // marshaling and arguments operations in it.
- be_operation_ami_sendc_strategy * boass = 0;
- ACE_NEW_RETURN (boass,
- be_operation_ami_sendc_strategy (node,
- sendc_marshaling,
- sendc_arguments),
- -1);
-
- be_operation_strategy *old_strategy = node->set_strategy (boass);
-
- if (old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_ami_pre_proc::visit_attribute (be_attribute *node)
-{
- // Temporerily generate the set operation.
- be_operation *set_operation =
- this->generate_set_operation (node);
-
- this->visit_operation (set_operation);
-
- // Retrieve the strategy set by the visit operation.
- be_operation_default_strategy *bods = 0;
- ACE_NEW_RETURN (bods,
- be_operation_default_strategy (set_operation),
- -1);
-
- be_operation_strategy *set_operation_strategy =
- set_operation->set_strategy (bods);
-
- set_operation->destroy ();
- delete set_operation;
- set_operation = 0;
-
- // Assign it to the attribute as set_operation strategy.
- if (0 != set_operation_strategy)
- {
- be_operation_strategy *bos =
- node->set_set_strategy (set_operation_strategy);
-
- if (0 != bos)
- {
- bos->destroy ();
- delete bos;
- bos = 0;
- }
- }
-
- // Temporerily generate the get operation.
- be_operation *get_operation =
- this->generate_get_operation (node);
-
- this->visit_operation (get_operation);
-
- // Retrieve the strategy set by the visit operation.
- ACE_NEW_RETURN (bods,
- be_operation_default_strategy (get_operation),
- -1);
-
- be_operation_strategy *get_operation_strategy =
- get_operation->set_strategy (bods);
-
- get_operation->destroy ();
- delete get_operation;
- get_operation = 0;
-
- // Assign it to the attribute as get_operation strategy.
- if (0 != get_operation_strategy)
- {
- be_operation_strategy *bos =
- node->set_get_strategy (get_operation_strategy);
-
- if (0 != bos)
- {
- bos->destroy ();
- delete bos;
- bos = 0;
- }
- }
-
- return 0;
-}
-
-be_valuetype *
-be_visitor_ami_pre_proc::create_exception_holder (be_interface *)
-{
- return be_global->messaging_exceptionholder ();
-}
-
-be_interface *
-be_visitor_ami_pre_proc::create_reply_handler (be_interface *node,
- be_valuetype *excep_holder)
-{
- // We're at global scope here so we need to fool the scope stack
- // for a minute so the correct repo id can be calculated at
- // interface construction time.
- UTL_Scope *s = node->defined_in ();
- idl_global->scopes ().push (s);
-
- // Create the reply handler name.
- ACE_CString reply_handler_local_name;
- this->generate_name (reply_handler_local_name,
- "AMI_",
- node->name ()->last_component ()->get_string(),
- "Handler");
-
- UTL_ScopedName *reply_handler_name =
- static_cast<UTL_ScopedName *> (node->name ()->copy ());
- reply_handler_name->last_component ()->replace_string (
- reply_handler_local_name.c_str ()
- );
-
- long n_parents = 0;
- AST_Interface **p_intf = this->create_inheritance_list (node, n_parents);
-
- be_interface *reply_handler = 0;
- ACE_NEW_RETURN (reply_handler,
- be_interface (reply_handler_name, // name
- p_intf, // list of inherited
- n_parents, // number of inherited
- 0, // list of all ancestors
- 0, // number of ancestors
- 0, // non-local
- 0), // non-abstract
- 0);
-
- // Back to reality.
- idl_global->scopes ().pop ();
-
- reply_handler->set_name (reply_handler_name);
- reply_handler->set_defined_in (s);
- reply_handler->gen_fwd_helper_name ();
-
- // Now our customized reply handler is created, we have to
- // add the operations and attributes to the scope.
- // Imported nodes get admitted here, so they can get
- // the reply handler operations added, in case they are
- // needed in the inheritance graph traversal for a
- // child reply handler. However, no exception holder
- // stuff is executed for an imported node.
- if (node->nmembers () > 0)
- {
- this->elem_number_ = 0;
- // Initialize an iterator to iterate thru our scope.
-
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- AST_Decl *d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_pre_proc::visit_interface - "
- "bad node in this scope\n"),
- 0);
-
- }
-
- if (d->node_type () == AST_Decl::NT_attr)
- {
- be_attribute *attribute = be_attribute::narrow_from_decl (d);
-
- if (attribute == 0)
- {
- return 0;
- }
-
- be_operation *get_operation =
- this->generate_get_operation (attribute);
-
- this->create_reply_handler_operation (get_operation,
- reply_handler);
-
- this->create_excep_operation (get_operation,
- reply_handler,
- excep_holder);
-
- get_operation->destroy ();
- delete get_operation;
- get_operation = 0;
-
- if (!attribute->readonly ())
- {
- be_operation *set_operation =
- this->generate_set_operation (attribute);
-
- this->create_reply_handler_operation (set_operation,
- reply_handler);
-
- this->create_excep_operation (set_operation,
- reply_handler,
- excep_holder);
-
- set_operation->destroy ();
- delete set_operation;
- set_operation = 0;
- }
- }
- else
- {
- be_operation* operation = be_operation::narrow_from_decl (d);
-
- if (operation)
- {
- this->create_reply_handler_operation (operation,
- reply_handler);
-
- this->create_excep_operation (operation,
- reply_handler,
- excep_holder);
- }
- }
- } // end of while loop
- } // end of if
-
- return reply_handler;
-}
-
-int
-be_visitor_ami_pre_proc::create_raise_operation (
- be_decl *node,
- be_valuetype *excep_holder,
- Operation_Kind operation_kind
- )
-{
- be_operation *orig_op = 0;
-
- if (operation_kind == NORMAL)
- {
- orig_op = be_operation::narrow_from_decl (node);
-
- if (orig_op)
- {
- if (orig_op->flags () == AST_Operation::OP_oneway)
- {
- // We do nothing for oneways!
- return 0;
- }
- }
- }
-
- Identifier *id = 0;
- UTL_ScopedName *sn = 0;
-
- ACE_NEW_RETURN (id,
- Identifier ("void"),
- -1);
-
- ACE_NEW_RETURN (sn,
- UTL_ScopedName (id,
- 0),
- -1);
-
- // Create the return type, which is "void"
- be_predefined_type *rt = 0;
- ACE_NEW_RETURN (rt,
- be_predefined_type (AST_PredefinedType::PT_void,
- sn),
- -1);
-
- // Name the operation properly
- UTL_ScopedName *op_name =
- static_cast<UTL_ScopedName *> (excep_holder->name ()->copy ());
-
- ACE_CString new_local_name ("raise_");
-
- if (operation_kind == SET_OPERATION)
- {
- new_local_name += "set_";
- }
- else if (operation_kind == GET_OPERATION)
- {
- new_local_name += "get_";
- }
-
- new_local_name += node->name ()->last_component ()->get_string ();
-
- ACE_NEW_RETURN (id,
- Identifier (new_local_name.c_str ()),
- -1);
-
- ACE_NEW_RETURN (sn,
- UTL_ScopedName (id,
- 0),
- -1);
-
- op_name->nconc (sn);
-
- be_operation *operation = 0;
- ACE_NEW_RETURN (operation,
- be_operation (rt,
- AST_Operation::OP_noflags,
- op_name,
- 0,
- 0),
- -1);
-
- operation->set_name (op_name);
- operation->set_defined_in (excep_holder);
-
-#if defined (TAO_HAS_DEPRECATED_EXCEPTION_HOLDER)
- if (operation_kind == NORMAL)
- {
- if (orig_op)
- {
- // Copy the exceptions.
- UTL_ExceptList *exceptions = orig_op->exceptions ();
-
- if (0 != exceptions)
- {
- operation->be_add_exceptions (exceptions->copy ());
- }
- }
- }
-#endif
-
- // Set the proper strategy.
- be_operation_ami_exception_holder_raise_strategy *boaehrs = 0;
- ACE_NEW_RETURN (boaehrs,
- be_operation_ami_exception_holder_raise_strategy (operation),
- -1);
-
- be_operation_strategy *old_strategy = operation->set_strategy (boaehrs);
-
- if (old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
-
- // After having generated the operation we insert it into the
- // exceptionholder valuetype.
- if (0 == excep_holder->be_add_operation (operation))
- {
- return -1;
- }
-
- return 0;
-}
-
-be_operation *
-be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node,
- int for_arguments)
-{
- if (node->flags () == AST_Operation::OP_oneway)
- {
- // We do nothing for oneways!
- return 0;
- }
-
- Identifier *id = 0;
- UTL_ScopedName *sn = 0;
-
- // Create the new name
- // Prepend "sendc_" to the name of the operation
- ACE_CString original_op_name (
- node->name ()->last_component ()->get_string ()
- );
- ACE_CString new_op_name = ACE_CString ("sendc_") + original_op_name;
-
- UTL_ScopedName *op_name =
- static_cast<UTL_ScopedName *> (node->name ()->copy ());
- op_name->last_component ()->replace_string (new_op_name.c_str ());
-
- // Create the operation
- be_operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (be_global->void_type (),
- AST_Operation::OP_noflags,
- op_name,
- 0,
- 0),
- 0);
-
- op->set_name (op_name);
-
- // Create the first argument, which is a Reply Handler
-
- if (for_arguments)
- {
- // Look up the field type.
- UTL_Scope *s = node->defined_in ();
- be_decl *parent = be_scope::narrow_from_scope (s)->decl ();
-
- // Add the pre- and suffix
- ACE_CString handler_local_name;
- this->generate_name (handler_local_name,
- "AMI_",
- parent->name ()->last_component ()->get_string (),
- "Handler");
-
- UTL_ScopedName *field_name =
- static_cast<UTL_ScopedName *> (parent->name ()->copy ());
- field_name->last_component ()->replace_string (
- handler_local_name.c_str ()
- );
-
- AST_Decl *d = s->lookup_by_name (field_name, true);
- field_name->destroy ();
- delete field_name;
- field_name = 0;
-
- if (0 == d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_pre_proc::"
- "create_sendc_operation - "
- "lookup of reply handler failed\n"),
- 0);
- }
-
- be_interface *field_type = be_interface::narrow_from_decl (d);
-
- // Create the argument.
- ACE_NEW_RETURN (id,
- Identifier ("ami_handler"),
- 0);
-
- UTL_ScopedName *tmp = 0;
-
- ACE_NEW_RETURN (tmp,
- UTL_ScopedName (id,
- 0),
- 0);
-
- sn = (UTL_ScopedName *)op->name ()->copy ();
- sn->nconc (tmp);
-
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- field_type, // is also a valuetype
- sn),
- 0);
-
- arg->set_defined_in (op);
- arg->set_name (sn);
- op->be_add_argument (arg);
-
- if (field_type->imported ())
- {
- field_type->seen_in_operation (false);
- }
- }
-
- // Iterate over the arguments and put all the in and inout
- // into the new method.
- if (node->nmembers () > 0)
- {
- // initialize an iterator to iterate thru our scope
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- AST_Decl *d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_ami_pre_proc::create_sendc_method - "
- "bad node in this scope\n"
- ),
- 0
- );
-
- }
-
- AST_Argument *original_arg = AST_Argument::narrow_from_decl (d);
-
- if (original_arg->direction () == AST_Argument::dir_IN ||
- original_arg->direction () == AST_Argument::dir_INOUT)
- {
- // Create the argument.
- be_argument *arg = 0;
- UTL_ScopedName *new_name =
- (UTL_ScopedName *)original_arg->name ()->copy ();
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- original_arg->field_type (),
- new_name),
- 0);
-
- arg->set_defined_in (op);
- arg->set_name (new_name);
- op->be_add_argument (arg);
- }
- } // end of while loop
- } // end of if
-
- return op;
-}
-
-int
-be_visitor_ami_pre_proc::create_reply_handler_operation (
- be_operation *node,
- be_interface *reply_handler
- )
-{
- if (!node)
- {
- return -1;
- }
-
- if (node->flags () == AST_Operation::OP_oneway)
- {
- // We do nothing for oneways!
- return 0;
- }
-
- Identifier *id = 0;
- UTL_ScopedName *sn = 0;
-
- ACE_CString original_op_name (
- node->name ()->last_component ()->get_string ()
- );
-
- UTL_ScopedName *op_name =
- static_cast<UTL_ScopedName *> (reply_handler->name ()-> copy ());
-
- ACE_NEW_RETURN (id,
- Identifier (original_op_name.c_str ()),
- -1);
-
- ACE_NEW_RETURN (sn,
- UTL_ScopedName (id,
- 0),
- -1);
-
- op_name->nconc (sn);
-
- // Create the operation.
- be_operation *operation = 0;
- ACE_NEW_RETURN (operation,
- be_operation (be_global->void_type (),
- AST_Operation::OP_noflags,
- op_name,
- 0,
- 0),
- -1);
-
- operation->set_name (op_name);
-
- // If return type is non-void add it as first argument.
-
- if (!node->void_return_type ())
- {
- ACE_NEW_RETURN (id,
- Identifier ("ami_return_val"),
- -1);
-
- UTL_ScopedName *tmp = 0;
-
- ACE_NEW_RETURN (tmp,
- UTL_ScopedName (id,
- 0),
- -1);
-
- sn = (UTL_ScopedName *)operation->name ()->copy ();
- sn->nconc (tmp);
-
- // Create the argument.
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- node->return_type (),
- sn),
- -1);
-
- arg->set_defined_in (operation);
- arg->set_name (sn);
-
- // Add the reply handler to the argument list.
- operation->be_add_argument (arg);
- }
-
- // Iterate over the arguments and put all the in and inout
- // into the new method.
- if (node->nmembers () > 0)
- {
- // Initialize an iterator to iterate thru our scope.
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- AST_Decl *d = si.item ();
-
- if (d == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_pre_proc::"
- "create_reply_handler_operation - "
- "bad node in this scope\n"),
- -1);
-
- }
-
- AST_Argument *original_arg = AST_Argument::narrow_from_decl (d);
-
- if (original_arg->direction () == AST_Argument::dir_INOUT ||
- original_arg->direction () == AST_Argument::dir_OUT)
- {
- // Create the argument.
- be_argument *arg = 0;
- UTL_ScopedName *new_name =
- (UTL_ScopedName *)original_arg->name ()->copy ();
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- original_arg->field_type (),
- new_name),
- -1);
-
- arg->set_defined_in (operation);
- arg->set_name (new_name);
- operation->be_add_argument (arg);
- }
- } // end of while loop
- } // end of if
-
- // Set the proper strategy.
- be_operation_ami_handler_reply_stub_strategy *boahrss = 0;
- ACE_NEW_RETURN (boahrss,
- be_operation_ami_handler_reply_stub_strategy (operation),
- -1);
-
- be_operation_strategy *old_strategy = operation->set_strategy (boahrss);
-
- if (old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
-
- operation->set_defined_in (reply_handler);
-
-#if !defined (TAO_HAS_DEPRECATED_EXCEPTION_HOLDER)
- // Copy the exceptions.
- if (node->exceptions ())
- {
- UTL_ExceptList *exceptions = node->exceptions ();
-
- if (0 != exceptions)
- {
- operation->be_add_exceptions (exceptions->copy ());
- }
- }
-#endif
-
- // After having generated the operation we insert it into the
- // reply handler interface.
- if (0 == reply_handler->be_add_operation (operation))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ami_pre_proc::create_excep_operation (be_operation *node,
- be_interface *reply_handler,
- be_valuetype *excep_holder)
-{
- if (!node)
- {
- return -1;
- }
-
- if (node->flags () == AST_Operation::OP_oneway)
- {
- // We do nothing for oneways!
- return 0;
- }
-
- // Create the return type, which is "void".
- Identifier *id = 0;
- UTL_ScopedName *sn = 0;
-
- // Create the argument.
- ACE_NEW_RETURN (id,
- Identifier ("excep_holder"),
- -1);
-
- ACE_NEW_RETURN (sn,
- UTL_ScopedName (id,
- 0),
- -1);
-
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- excep_holder, // is also a valuetype
- sn),
- -1);
-
- arg->set_name (sn);
-
- UTL_ScopedName *tmp = (UTL_ScopedName *)sn->copy ();
-
- // Create the new name
- // Append _execp to the name of the operation
- ACE_CString original_op_name (
- node->name ()->last_component ()->get_string ()
- );
- ACE_CString new_op_name = original_op_name + ACE_CString ("_excep");
-
- UTL_ScopedName *op_name =
- static_cast<UTL_ScopedName *> (reply_handler->name ()->copy ());
-
- ACE_NEW_RETURN (id,
- Identifier (new_op_name.c_str ()),
- -1);
-
- ACE_NEW_RETURN (sn,
- UTL_ScopedName (id,
- 0),
- -1);
-
- op_name->nconc (sn);
-
- AST_PredefinedType *rt = be_global->void_type ();
-
- // Create the operation.
- be_operation *operation = 0;
- ACE_NEW_RETURN (operation,
- be_operation (rt,
- AST_Operation::OP_noflags,
- op_name,
- 0,
- 0),
- -1);
-
- operation->set_name (op_name);
- operation->be_add_argument (arg);
- operation->set_defined_in (reply_handler);
-
- UTL_ScopedName *arg_name = (UTL_ScopedName *)op_name->copy ();
- arg_name->nconc (tmp);
- arg->set_name (arg_name);
- arg->set_defined_in (operation);
-
- // We do not copy the exceptions because the exceptions
- // are delivered by the excep methods.
-
- // After having generated the operation we insert it into the
- // reply handler interface.
- if (0 == reply_handler->be_add_operation (operation))
- {
- return -1;
- }
-
- return 0;
-}
-
-// Visit the scope and its elements.
-int
-be_visitor_ami_pre_proc::visit_scope (be_scope *node)
-{
- // proceed if the number of members in our scope is greater than 0
- if (node->nmembers () > 0)
- {
- int number_of_elements = 0;
-
- {
- // initialize an iterator to iterate thru our scope
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- ++number_of_elements;
- }
- }
-
- AST_Decl **elements;
- ACE_NEW_RETURN (elements,
- AST_Decl *[number_of_elements],
- -1);
-
- {
- int position = 0;
-
- // Initialize an iterator to iterate thru our scope.
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- elements[position++] = si.item ();
- }
- }
-
- int elem_number = 0;
-
- // Continue until each element is visited.
- while (elem_number < number_of_elements)
- {
- AST_Decl *d = elements[elem_number];
-
- if (!d)
- {
- delete [] elements;
- elements = 0;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "bad node in this scope\n"),
- -1);
-
- }
-
- be_decl *bd = be_decl::narrow_from_decl (d);
-
- // Set the scope node as "node" in which the code is being
- // generated so that elements in the node's scope can use it
- // for code generation.
- this->ctx_->scope (node->decl ());
-
- // Set the node to be visited.
- this->ctx_->node (bd);
- ++elem_number;
-
-
- // Send the visitor.
- if (bd == 0 || bd->accept (this) == -1)
- {
- delete [] elements;
- elements = 0;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "codegen for scope failed\n"),
- -1);
- }
- } // end of while loop
-
- delete [] elements;
- elements = 0;
- } // end of if
-
- return 0;
-}
-
-// Helper methods
-
-int
-be_visitor_ami_pre_proc::generate_name (ACE_CString &destination,
- const char *prefix,
- const char *middle_name,
- const char *suffix)
-{
- destination = prefix;
- destination += middle_name;
- destination += suffix;
- return 0;
-}
-
-be_operation *
-be_visitor_ami_pre_proc::generate_get_operation (be_attribute *node)
-{
- ACE_CString original_op_name (
- node->name ()->last_component ()->get_string ()
- );
- ACE_CString new_op_name = ACE_CString ("get_") + original_op_name;
-
- UTL_ScopedName *get_name =
- static_cast<UTL_ScopedName *> (node->name ()->copy ());
- get_name->last_component ()->replace_string (new_op_name.c_str ());
-
- be_operation *operation = 0;
- ACE_NEW_RETURN (operation,
- be_operation (node->field_type (),
- AST_Operation::OP_noflags,
- get_name,
- 0,
- 0),
- 0);
-
- operation->set_name (get_name);
- operation->set_defined_in (node->defined_in ());
-
- return operation;
-}
-
-be_operation *
-be_visitor_ami_pre_proc::generate_set_operation (be_attribute *node)
-{
- ACE_CString original_op_name (
- node->name ()->last_component ()->get_string ()
- );
- ACE_CString new_op_name = ACE_CString ("set_") + original_op_name;
-
- UTL_ScopedName *set_name =
- static_cast<UTL_ScopedName *> (node->name ()-> copy ());
- set_name->last_component ()->replace_string (new_op_name.c_str ());
-
- // Argument type is the same as the attribute type.
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- node->field_type (),
- set_name),
- 0);
-
- arg->set_name ((UTL_ScopedName *) node->name ()->copy ());
-
- // Create the operation.
- be_operation *operation = 0;
- ACE_NEW_RETURN (operation,
- be_operation (be_global->void_type (),
- AST_Operation::OP_noflags,
- set_name,
- 0,
- 0),
- 0);
-
- operation->set_name (set_name);
- operation->set_defined_in (node->defined_in ());
- operation->be_add_argument (arg);
-
- return operation;
-}
-
-AST_Interface **
-be_visitor_ami_pre_proc::create_inheritance_list (be_interface *node,
- long &n_rh_parents)
-{
- AST_Interface **retval = 0;
-
- long n_parents = node->n_inherits ();
- AST_Interface **parents = node->inherits ();
- AST_Interface *parent = 0;
-
- for (long i = 0; i < n_parents; ++i)
- {
- parent = parents[i];
-
- if (parent->is_abstract ())
- {
- continue;
- }
-
- ++n_rh_parents;
- }
-
- if (n_rh_parents == 0)
- {
- be_interface *inherit_intf = be_global->messaging_replyhandler ();
-
- ACE_NEW_RETURN (retval,
- AST_Interface *[1],
- 0);
-
- retval[0] = inherit_intf;
- n_rh_parents = 1;
- }
- else
- {
- ACE_NEW_RETURN (retval,
- AST_Interface *[n_rh_parents],
- 0);
-
- ACE_CString prefix ("AMI_");
- ACE_CString suffix ("Handler");
- long index = 0;
-
- for (long j = 0; j < n_parents; ++j)
- {
- parent = parents[j];
-
- if (parent->is_abstract ())
- {
- continue;
- }
-
- ACE_CString rh_local_name =
- prefix + parent->local_name ()->get_string () + suffix;
-
- UTL_ScopedName *rh_parent_name =
- static_cast<UTL_ScopedName *> (parent->name ()->copy ());
-
- rh_parent_name->last_component ()->replace_string (
- rh_local_name.c_str ()
- );
-
- AST_Decl *d =
- node->defined_in ()->lookup_by_name (rh_parent_name,
- true);
-
- if (d != 0)
- {
- retval[index++] = AST_Interface::narrow_from_decl (d);
- }
-
- rh_parent_name->destroy ();
- delete rh_parent_name;
- rh_parent_name = 0;
- }
-
- // Just a sanity check until we're sure this works in all use cases.
- if (n_rh_parents != index)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "reply handler parent iteration mismatch\n"),
- 0);
- }
- }
-
- return retval;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp b/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp
deleted file mode 100644
index 36f7a3cb20c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp
+++ /dev/null
@@ -1,1165 +0,0 @@
-//=============================================================================
-/**
-* @file be_visitor_arg_traits.cpp
-*
-* $Id$
-*
-* This visitor generates template specializations for argument traits classes.
-*
-* @author Jeff Parsons <j.parsons@vanderbilt.edu>
-*/
-//=============================================================================
-
-#include "be_visitor_arg_traits.h"
-#include "be_visitor_context.h"
-#include "be_root.h"
-#include "be_module.h"
-#include "be_interface.h"
-#include "be_valuebox.h"
-#include "be_valuetype.h"
-#include "be_interface_fwd.h"
-#include "be_valuetype_fwd.h"
-#include "be_component_fwd.h"
-#include "be_component.h"
-#include "be_home.h"
-#include "be_eventtype.h"
-#include "be_eventtype_fwd.h"
-#include "be_operation.h"
-#include "be_attribute.h"
-#include "be_argument.h"
-#include "be_array.h"
-#include "be_enum.h"
-#include "be_predefined_type.h"
-#include "be_sequence.h"
-#include "be_string.h"
-#include "be_structure.h"
-#include "be_field.h"
-#include "be_union.h"
-#include "be_union_branch.h"
-#include "be_typedef.h"
-#include "be_helper.h"
-#include "be_extern.h"
-#include "utl_identifier.h"
-#include "idl_defines.h"
-#include "ace/Log_Msg.h"
-
-#include <string>
-
-
-ACE_RCSID (be,
- be_visitor_arg_traits,
- "$Id$")
-
-be_visitor_arg_traits::be_visitor_arg_traits (const char *S,
- be_visitor_context *ctx)
- : be_visitor_scope (ctx),
- S_ (ACE::strnew (S))
-{
-}
-
-be_visitor_arg_traits::~be_visitor_arg_traits (void)
-{
- delete [] this->S_;
-}
-
-int
-be_visitor_arg_traits::visit_root (be_root *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl
- << be_global->core_versioning_begin ();
-
- *os << be_nl << be_nl
- << "// Arg traits specializations." << be_nl
- << "namespace TAO" << be_nl
- << "{" << be_idt;
-
- if (be_global->ami_call_back ())
- {
- int status =
- this->visit_valuetype (be_global->messaging_exceptionholder ());
-
- if (-1 == status)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_root - visit "
- "Messaging::ExceptionHolder failed\n"),
- -1);
- }
- }
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_root - visit scope failed\n"),
- -1);
- }
-
- *os << be_uidt_nl
- << "}" << be_nl;
-
- *os << be_global->core_versioning_end () << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_module (be_module *node)
-{
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_module - visit scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_interface (be_interface *node)
-{
- if (this->generated (node))
- {
- return 0;
- }
-
- if (node->seen_in_operation ())
- {
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- std::string guard_suffix =
- std::string (this->S_) + std::string ("arg_traits");
-
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
- os->gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "class "
- << " " << this->S_ << "Arg_Traits<"
- << node->name () << ">" << be_idt_nl
- << ": public" << be_idt << be_idt_nl
- << "Object_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl
- << node->name () << "_ptr," << be_nl
- << node->name () << "_var," << be_nl
- << node->name () << "_out";
-
- if (ACE_OS::strlen (this->S_) == 0)
- {
- *os << "," << be_nl
- << "TAO::Objref_Traits<" << node->name () << ">";
- }
-
- *os << "," << be_nl << this->insert_policy() << " <"
- << node->name () << "_ptr>" << be_uidt_nl
- << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
-
- os->gen_endif ();
- }
-
- if (this->visit_scope (node) != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_interface - visit scope failed\n"),
- -1);
- }
-
- this->generated (node, true);
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_interface_fwd (be_interface_fwd *node)
-{
- // If a full definition with the same name in the same scope
- // has been seen, then it will have gone through visit_interface()
- // already.
- if (this->generated (node))
- {
- return 0;
- }
-
- be_interface *fd =
- be_interface::narrow_from_decl (node->full_definition ());
-
- // The logic in visit_interface() should handle what gets generated
- // and what doesn't.
- if (this->visit_interface (fd) != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_interface_fwd - code generation failed\n"),
- -1);
- }
-
- this->generated (node, true);
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_valuebox (be_valuebox *node)
-{
- if (this->generated (node))
- {
- return 0;
- }
-
- if (node->seen_in_operation ())
- {
- TAO_OutStream & os = *this->ctx_->stream ();
-
- os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- std::string guard_suffix =
- std::string (this->S_) + std::string ("arg_traits");
-
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
- os.gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
-
- os << be_nl << be_nl
- << "template<>" << be_nl
- << "class "
- << this->S_ << "Arg_Traits<"
- << node->name () << ">" << be_idt_nl
- << ": public" << be_idt << be_idt_nl
- << "Object_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl
- << node->name () << " *," << be_nl
- << node->name () << "_var," << be_nl
- << node->name () << "_out";
-
- // The SArgument classes don't need the traits parameter (yet?)
- if (ACE_OS::strlen (this->S_) == 0)
- {
- os << "," << be_nl
- << "TAO::Value_Traits<" << node->name () << ">";
- }
-
- os << "," << be_nl << this->insert_policy() << " <"
- << node->name () << "*>" << be_uidt_nl
- << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
-
- os.gen_endif ();
- }
-
- this->generated (node, true);
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_valuetype (be_valuetype *node)
-{
- if (this->generated (node))
- {
- return 0;
- }
-
- if (node->seen_in_operation ())
- {
- TAO_OutStream & os = *this->ctx_->stream ();
-
- os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- std::string guard_suffix =
- std::string (this->S_) + std::string ("arg_traits");
-
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
- os.gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
-
- os << be_nl << be_nl
- << "template<>" << be_nl
- << "class "
- << this->S_ << "Arg_Traits<"
- << node->name () << ">" << be_idt_nl
- << ": public" << be_idt << be_idt_nl
- << "Object_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl
- << node->name () << " *," << be_nl
- << node->name () << "_var," << be_nl
- << node->name () << "_out";
-
- // The SArgument classes don't need the traits parameter (yet?)
- if (ACE_OS::strlen (this->S_) == 0)
- {
- os << "," << be_nl
- << "TAO::Value_Traits<" << node->name () << ">";
- }
-
- os << "," << be_nl << this->insert_policy() << " <"
- << node->name () << "*>" << be_uidt_nl
- << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
-
- os.gen_endif ();
- }
-
- if (this->visit_scope (node) != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_valuetype - visit scope failed\n"),
- -1);
- }
-
- this->generated (node, true);
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- if (this->generated (node))
- {
- return 0;
- }
-
- be_valuetype *fd =
- be_valuetype::narrow_from_decl (node->full_definition ());
-
- // The logic in visit_valuetype() should handle what gets generated
- // and what doesn't.
- int status = this->visit_valuetype (fd);
-
- if (status != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_valuetype_fwd - code generation failed\n"),
- -1);
- }
-
- this->generated (node, true);
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_arg_traits::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
-
-int
-be_visitor_arg_traits::visit_operation (be_operation *node)
-{
- if (this->generated (node) || node->is_local () || node->imported ())
- {
- return 0;
- }
-
- AST_Type *rt = node->return_type ();
- AST_Decl::NodeType nt = rt->node_type ();
-
- // If our return type is an unaliased bounded (w)string, we create
- // an empty struct using the operation's flat name for the type,
- // and use this type as the Arg_Traits<> template parameter. All
- // this is necessary because there could be any number of such
- // return types, all identical, in the same interface, valuetype,
- // translation unit, or build, and we need a unique type for the
- // Arg_Traits<> template parameter.
- if (nt == AST_Decl::NT_string || nt == AST_Decl::NT_wstring)
- {
- AST_String *str = AST_String::narrow_from_decl (rt);
- unsigned long bound = str->max_size ()->ev ()->u.ulval;
-
- if (bound > 0)
- {
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- bool wide = (str->width () != 1);
-
- *os << be_nl << be_nl;
-
- bool const skel =
- (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_SS);
-
- // Avoid generating a duplicate structure in the skeleton
- // when generating Arg_Traits<> for ThruPOA and direct
- // collocation code.
- if (!skel
- || (skel && ACE_OS::strlen (this->S_) != 0))
- {
- *os << "struct " << node->flat_name () << " {};"
- << be_nl << be_nl;
- }
-
- *os << "template<>" << be_nl
- << "class "
- << this->S_ << "Arg_Traits<"
- << node->flat_name ()
- << ">" << be_idt_nl
- << ": public" << be_idt << be_idt_nl
- << "BD_String_" << this->S_ << "Arg_Traits_T<" << be_nl
- << "CORBA::" << (wide ? "W" : "") << "String_var," << be_nl
- << bound << "," << be_nl
- << this->insert_policy() << " <" << be_idt_nl
- << "ACE_OutputCDR::from_" << (wide ? "w" : "") << "string" << be_uidt_nl
- << ">"
- << be_uidt_nl
- << ">"
- << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
- }
- }
-
- // This will catch (in visit_argument() below) any parameters that
- // are unaliased, bounded (w)strings.
- if (this->visit_scope (node) != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_operation - visit scope failed\n"),
- -1);
- }
-
- this->generated (node, true);
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_attribute (be_attribute *node)
-{
- if (this->ctx_->alias () != 0 || this->generated (node))
- {
- return 0;
- }
-
- AST_String *st = AST_String::narrow_from_decl (node->field_type ());
-
- if (st == 0)
- {
- return 0;
- }
-
- unsigned long bound = st->max_size ()->ev ()->u.ulval;
-
- if (bound == 0)
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- bool wide = (st->width () != 1);
-
- // It is legal IDL to declare a bounded (w)string as an operation
- // parameter type. There could be any number of identical
- // declarations in the same build, translation unit, or even in
- // the same operation, so we use the argument's flat name to
- // declare an empty struct, and use that struct as the template
- // parameter for Arg_Traits<>.
-
- *os << be_nl;
-
- bool const skel =
- (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_SS);
-
- // Avoid generating a duplicate structure in the skeleton when
- // generating Arg_Traits<> for ThruPOA and direct collocation code.
- if (!skel
- || (skel && ACE_OS::strlen (this->S_) != 0))
- {
- *os << "struct " << node->flat_name () << " {};"
- << be_nl << be_nl;
- }
-
- *os << "template<>" << be_nl
- << "class "
- << this->S_ << "Arg_Traits<"
- << node->flat_name ()
- << ">" << be_idt_nl
- << ": public" << be_idt << be_idt_nl
- << "BD_String_" << this->S_ << "Arg_Traits_T<" << be_nl
- << "CORBA::" << (wide ? "W" : "") << "String_var," << be_nl
- << bound << "," << be_nl
- << this->insert_policy() << " <" << be_idt_nl
- << "ACE_OutputCDR::from_" << (wide ? "w" : "") << "string" << be_uidt_nl
- << ">"
- << be_uidt_nl
- << ">"
- << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
-
- this->generated (node, true);
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_argument (be_argument *node)
-{
- if (this->ctx_->alias () != 0 || this->generated (node))
- {
- return 0;
- }
-
- AST_Type *bt = node->field_type ();
- AST_Decl::NodeType nt = bt->node_type ();
-
- // We are interested here only in unaliased, bounded
- // (w)strings.
-
- if (nt != AST_Decl::NT_string && nt != AST_Decl::NT_wstring)
- {
- return 0;
- }
-
- be_string *st = be_string::narrow_from_decl (bt);
- unsigned long bound = st->max_size ()->ev ()->u.ulval;
-
- if (bound == 0)
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- bool wide = (st->width () != 1);
-
- // It is legal IDL to declare a bounded (w)string as an operation
- // parameter type. There could be any number of identical
- // declarations in the same build, translation unit, or even in
- // the same operation, so we use the argument's flat name to
- // declare an empty struct, and use that struct as the template
- // parameter for Arg_Traits<>.
- *os << be_nl << be_nl;
-
- bool const skel =
- (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_SS);
-
- // Avoid generating a duplicate structure in the skeleton when
- // generating Arg_Traits<> for ThruPOA and direct collocation code.
- if (!skel
- || (skel && ACE_OS::strlen (this->S_) != 0))
- {
- *os << "struct " << node->flat_name () << " {};"
- << be_nl << be_nl;
- }
-
- *os << "template<>" << be_nl
- << "class "
- << this->S_ << "Arg_Traits<"
- << node->flat_name ()
- << ">" << be_idt_nl
- << ": public" << be_idt << be_idt_nl
- << "BD_String_" << this->S_ << "Arg_Traits_T<" << be_nl
- << "CORBA::" << (wide ? "W" : "") << "String_var," << be_nl
- << bound << "," << be_nl
- << this->insert_policy() << " <" << be_idt_nl
- << "ACE_OutputCDR::from_" << (wide ? "w" : "") << "string" << be_uidt_nl
- << ">"
- << be_uidt_nl
- << ">"
- << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
-
- this->generated (node, true);
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_sequence (be_sequence *node)
-{
- if (this->generated (node) || !node->seen_in_operation ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- be_typedef *alias = this->ctx_->alias ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- std::string guard_suffix =
- std::string (this->S_) + std::string ("arg_traits");
-
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
- os->gen_ifdef_macro (alias->flat_name (), guard_suffix.c_str (), false);
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "class "
- << this->S_ << "Arg_Traits<"
- << alias->name () << ">" << be_idt_nl
- << ": public" << be_idt << be_idt_nl
- << "Var_Size_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl
- << alias->name () << "," << be_nl
- << this->insert_policy() << " <" << alias->name () << ">" << be_uidt_nl
- << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
-
- os->gen_endif ();
-
- this->generated (node, true);
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_string (be_string *node)
-{
- if ((this->generated (node) && !this->ctx_->alias())
- || !node->seen_in_operation ())
- {
- return 0;
- }
-
- unsigned long bound = node->max_size ()->ev ()->u.ulval;
- be_type *alias = this->ctx_->alias ();
-
- // Unbounded (w)string args are handled as a predefined type.
- // Bounded (w)strings must come in as a typedef - they can't
- // be used directly as arguments or return types.
- if (bound == 0)
- {
- return 0;
- }
-
- bool wide = (node->width () != 1);
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- std::string guard_suffix =
- std::string (this->S_) + std::string ("arg_traits");
-
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
-
- if (alias == 0)
- {
- os->gen_ifdef_macro (node->flat_name(), guard_suffix.c_str (), false);
- }
- else
- {
- // Form a unique macro name using the local name and the bound.
- unsigned long l = bound;
- int num_digits = 0;
- while (l > 0)
- {
- l /= 10 ;
- ++num_digits ;
- }
- size_t bound_length = num_digits + 1;
- char* bound_string = 0;
- ACE_NEW_RETURN (bound_string, char[bound_length], -1) ;
- ACE_OS::sprintf (bound_string, "%lu", bound);
-
- size_t cat_length = ACE_OS::strlen (alias->local_name ()->get_string ()) +
- ACE_OS::strlen (bound_string) +
- 1;
- char* cat_string = 0;
- ACE_NEW_RETURN (cat_string, char[cat_length], -1) ;
- ACE_OS::strcpy (cat_string, alias->local_name ()->get_string ()) ;
- ACE_OS::strcat (cat_string, bound_string);
-
- os->gen_ifdef_macro (cat_string, guard_suffix.c_str (), false);
-
- delete [] cat_string;
- delete [] bound_string;
- }
-
- bool const skel =
- (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_SS);
-
- // Avoid generating a duplicate structure in the skeleton when
- // generating Arg_Traits<> for ThruPOA and direct collocation code.
- if (!skel
- || (skel && ACE_OS::strlen (this->S_) != 0))
- {
- // A workaround 'dummy' type, since bounded (w)strings are all
- // generated as typedefs of (w)char *.
- *os << be_nl << be_nl
- << "struct ";
-
- if (alias == 0)
- {
- *os << node->flat_name ();
- }
- else
- {
- *os << alias->local_name () << "_" << bound;
- }
-
- *os << " {};";
- }
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "class "
- << this->S_ << "Arg_Traits<";
-
- if (0 == alias)
- {
- *os << node->flat_name ();
- }
- else
- {
- *os << alias->local_name () << "_" << bound;
- }
-
- *os << ">" << be_idt_nl
- << ": public" << be_idt << be_idt_nl
- << "BD_String_" << this->S_ << "Arg_Traits_T<"
- << be_idt << be_idt_nl
- << "CORBA::" << (wide ? "W" : "") << "String_var," << be_nl
- << bound << "," << be_nl
- << this->insert_policy() << " <" << be_idt << be_idt_nl
- << "ACE_OutputCDR::from_" << (wide ? "w" : "") << "string" << be_uidt_nl
- << ">"
- << be_uidt << be_uidt_nl
- << ">"
- << be_uidt << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
-
- os->gen_endif ();
-
- this->generated (node, true);
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_array (be_array *node)
-{
- if (this->generated (node) || !node->seen_in_operation ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // This should be generated even for imported nodes. The ifdef guard prevents
- // multiple declarations.
- ACE_CString suffix (this->S_);
- suffix += "arg_traits";
- os->gen_ifdef_macro (node->flat_name (), suffix.c_str (), false);
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "class "
- << this->S_ << "Arg_Traits<"
- << node->name () << "_tag>" << be_idt_nl
- << ": public" << be_idt << be_idt_nl;
-
- *os << (node->size_type () == AST_Type::FIXED ? "Fixed" : "Var")
- << "_Array_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl
- << node->name ()
- << (node->size_type () == AST_Type::VARIABLE ? "_out" : "_var")
- << "," << be_nl;
-
- *os << node->name () << "_forany";
-
- *os << "," << be_nl << this->insert_policy() << " <" << node->name () << "_forany" << ">";
-
- *os << be_uidt_nl
- << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
-
- os->gen_endif ();
-
- this->generated (node, true);
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_enum (be_enum *node)
-{
- if (this->generated (node) || !node->seen_in_operation ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- std::string guard_suffix =
- std::string (this->S_) + std::string ("arg_traits");
-
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
- os->gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "class "
- << this->S_ << "Arg_Traits<"
- << node->name () << ">" << be_idt_nl
- << ": public" << be_idt << be_idt_nl;
-
- *os << "Basic_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl
- << node->name () << "," << be_nl
- << this->insert_policy() << " <" << node->name () << ">" << be_uidt_nl
- << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
-
- os->gen_endif ();
-
- this->generated (node, true);
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_structure (be_structure *node)
-{
- if (this->generated (node) || !node->seen_in_operation ())
- {
- return 0;
- }
-
- // This should be generated even for imported nodes. The ifdef guard prevents
- // multiple declarations.
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- std::string guard_suffix =
- std::string (this->S_) + std::string ("arg_traits");
-
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
- os->gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "class "
- << this->S_ << "Arg_Traits<"
- << node->name () << ">" << be_idt_nl
- << ": public" << be_idt << be_idt_nl;
-
- *os << (node->size_type () == AST_Type::FIXED ? "Fixed" : "Var")
- << "_Size_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl;
-
- *os << node->name () << "," << be_nl << this->insert_policy() << " <" << node->name () << ">" << be_uidt_nl
- << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
-
- os->gen_endif ();
-
- /* Set this before visiting the scope so things like
-
- interface foo
- {
- struct bar
- {
- ....
- foo foo_member;
- };
-
- void op (in bar inarg);
- };
-
- will not cause infinite recursion in this visitor.
- */
-
- this->generated (node, true);
-
- if (this->visit_scope (node) != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_structure - visit scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- // Valuetypes may not be *declared* in a field, so this will
- // get handled elsewhere, and will also avoid nested valuetype
- // recursion. So we set the field node as processed (the
- // field *type* may not have been reached yet) and return.
- if (bt->base_node_type () == AST_Decl::NT_valuetype)
- {
- node->cli_traits_gen (true);
- return 0;
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- this->generated (node, true);
- this->generated (bt, true);
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_union (be_union *node)
-{
- if (this->generated (node) || !node->seen_in_operation ())
- {
- return 0;
- }
-
- // This should be generated even for imported nodes. The ifdef guard prevents
- // multiple declarations.
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- std::string guard_suffix =
- std::string (this->S_) + std::string ("arg_traits");
-
- // This should be generated even for imported nodes. The ifdef
- // guard prevents multiple declarations.
- os->gen_ifdef_macro (node->flat_name (), guard_suffix.c_str (), false);
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "class "
- << this->S_ << "Arg_Traits<"
- << node->name () << ">" << be_idt_nl
- << ": public" << be_idt << be_idt_nl;
-
- *os << (node->size_type () == AST_Type::FIXED ? "Fixed" : "Var")
- << "_Size_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl
- << node->name () << "," << be_nl << this->insert_policy() << " <"
- << node->name () << ">";
-
- *os << be_uidt_nl
- << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
-
- os->gen_endif ();
-
- /* Set this before visiting the scope so things like
-
- interface foo
- {
- struct bar
- {
- ....
- foo foo_member;
- };
-
- void op (in bar inarg);
- };
-
- will not cause infinite recursion in this visitor.
- */
-
- this->generated (node, true);
-
- int status = this->visit_scope (node);
-
- if (status != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_union - visit scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_union_branch (be_union_branch *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_union_branch - "
- "Bad union_branch type\n"),
- -1);
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_union_branch - "
- "codegen for union_branch type failed\n"),
- -1);
- }
-
- this->generated (node, true);
- return 0;
-}
-
-int
-be_visitor_arg_traits::visit_typedef (be_typedef *node)
-{
- if (this->generated (node) || !node->seen_in_operation ())
- {
- return 0;
- }
-
- this->ctx_->alias (node);
-
- // Make a decision based on the primitive base type.
- be_type *bt = node->primitive_base_type ();
-
- // We can't set seen_in_operation_ for the base type
- // in the be_typedef operation, since valuetype OBV
- // constructor code may reset it to FALSE, and the base
- // type may be used unaliased in another arg somewhere.
- // So we just set it to TRUE here, since we know it
- // has to be TRUE at this point. We also set the
- // 'generated' flag to false if the original value
- // of 'seen_in_operation' was false, since the base
- // type could have been processed already, as a member
- // for example, before the typedef was seen, which
- // would short-circuit things.
- if (!bt->seen_in_operation ())
- {
- bt->seen_in_operation (true);
- this->generated (bt, false);
- }
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arg_traits::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- this->generated (node, true);
- return 0;
-}
-
-bool
-be_visitor_arg_traits::generated (be_decl *node) const
-{
- if (ACE_OS::strcmp (this->S_, "") == 0)
- {
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CS:
- return node->cli_arg_traits_gen ();
- case TAO_CodeGen::TAO_ROOT_SS:
- return node->srv_arg_traits_gen ();
- default:
- return 0;
- }
- }
-
- return node->srv_sarg_traits_gen ();
-}
-
-void
-be_visitor_arg_traits::generated (be_decl *node,
- bool val)
-{
- if (ACE_OS::strcmp (this->S_, "") == 0)
- {
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CS:
- node->cli_arg_traits_gen (val);
- return;
- case TAO_CodeGen::TAO_ROOT_SS:
- node->srv_arg_traits_gen (val);
- return;
- default:
- return;
- }
- }
-
- node->srv_sarg_traits_gen (val);
-}
-
-int
-be_visitor_arg_traits::visit_component (be_component *node)
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_arg_traits::visit_component_fwd (be_component_fwd *node)
-{
- return this->visit_interface_fwd (node);
-}
-
-int
-be_visitor_arg_traits::visit_home (be_home *node)
-{
- return this->visit_interface (node);
-}
-
-const char *
-be_visitor_arg_traits::insert_policy (void)
-{
- if (be_global->any_support ())
- {
- return "TAO::Any_Insert_Policy_Stream";
- }
- else
- {
- return "TAO::Any_Insert_Policy_Noop";
- }
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_argument.cpp b/TAO/TAO_IDL/be/be_visitor_argument.cpp
deleted file mode 100644
index 1024f14f6bd..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_args.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Argument
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_visitor_argument.h"
-#include "be_visitor_context.h"
-#include "be_argument.h"
-#include "be_type.h"
-#include "be_array.h"
-#include "be_enum.h"
-#include "be_interface.h"
-#include "be_interface_fwd.h"
-#include "be_component.h"
-#include "be_component_fwd.h"
-#include "be_native.h"
-#include "be_predefined_type.h"
-#include "be_string.h"
-#include "be_typedef.h"
-#include "be_structure.h"
-#include "be_union.h"
-#include "be_sequence.h"
-#include "be_valuebox.h"
-#include "be_valuetype.h"
-#include "be_valuetype_fwd.h"
-#include "be_eventtype.h"
-#include "be_eventtype_fwd.h"
-#include "be_home.h"
-#include "be_operation.h"
-#include "be_helper.h"
-#include "utl_identifier.h"
-#include "nr_extern.h"
-#include "ace/Log_Msg.h"
-
-#include "be_visitor_argument/arglist.cpp"
-#include "be_visitor_argument/argument.cpp"
-#include "be_visitor_argument/marshal_ss.cpp"
-#include "be_visitor_argument/post_upcall_ss.cpp"
-#include "be_visitor_argument/upcall_ss.cpp"
-#include "be_visitor_argument/vardecl_ss.cpp"
-#include "be_visitor_argument/invoke_cs.cpp"
-#include "be_visitor_argument/paramlist.cpp"
-
-ACE_RCSID (be,
- be_visitor_argument,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp
deleted file mode 100644
index 97293ddf2a3..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp
+++ /dev/null
@@ -1,455 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// arglist.cpp
-//
-// = DESCRIPTION
-// Visitor that generates the parameters in an Operation signature
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_argument,
- arglist,
- "$Id$")
-
-
-// ************************************************************
-// be_visitor_args_arglist for parameter list in method declarations and
-// definitions
-// ************************************************************
-
-be_visitor_args_arglist::be_visitor_args_arglist (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_arglist::~be_visitor_args_arglist (void)
-{
-}
-
-int be_visitor_args_arglist::visit_argument (be_argument *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- // Retrieve the type.
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_arglist::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- // Different types have different mappings when used as in/out or
- // inout parameters. Let this visitor deal with the type.
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_arglist::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- *os << " " << node->local_name ();
- return 0;
-}
-
-int be_visitor_args_arglist::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "const " << this->type_name (node);
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node);
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_arglist::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << this->type_name (node);
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_arglist::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << this->type_name (node, "_ptr");
- break;
- case AST_Argument::dir_INOUT: // inout
- *os << this->type_name (node, "_ptr") << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_arglist::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << this->type_name (node, "_ptr");
- break;
- case AST_Argument::dir_INOUT: // inout
- *os << this->type_name (node, "_ptr") << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_arglist::visit_component (be_component *node)
-{
- return this->visit_interface (node);
-}
-
-int be_visitor_args_arglist::visit_component_fwd (be_component_fwd *node)
-{
- return this->visit_interface_fwd (node);
-}
-
-int be_visitor_args_arglist::visit_native (be_native *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << this->type_name (node);
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node) << " &";
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_arglist::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- AST_PredefinedType::PredefinedType pt = node->pt ();
-
- if (pt == AST_PredefinedType::PT_any)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "const " << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
- }
- else if (pt == AST_PredefinedType::PT_value)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << this->type_name (node) << " *";
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " *&";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
- }
- else if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- // The only PT_pseudo that doesn't take a _ptr suffix.
- bool is_tckind =
- (ACE_OS::strcmp (node->local_name ()->get_string (), "TCKind") == 0);
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- if (is_tckind)
- {
- *os << this->type_name (node);
- }
- else
- {
- *os << this->type_name (node, "_ptr");
- }
-
- break;
- case AST_Argument::dir_INOUT:
- if (is_tckind)
- {
- *os << this->type_name (node) << " &";
- }
- else
- {
- *os << this->type_name (node, "_ptr") << " &";
- }
-
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
- }
- else
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << this->type_name (node);
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
- }
-
- return 0;
-}
-
-int be_visitor_args_arglist::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "const " << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_arglist::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (node->width () == (long) sizeof (char))
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "const char *";
- break;
- case AST_Argument::dir_INOUT:
- *os << "char *&";
- break;
- case AST_Argument::dir_OUT:
- *os << "::CORBA::String_out";
- break;
- }
- }
- else
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "const ::CORBA::WChar *";
- break;
- case AST_Argument::dir_INOUT:
- *os << "::CORBA::WChar *&";
- break;
- case AST_Argument::dir_OUT:
- *os << "::CORBA::WString_out";
- break;
- }
- }
-
- return 0;
-}
-
-int be_visitor_args_arglist::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "const " << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_arglist::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "const " << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_arglist::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_arglist::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-
-int be_visitor_args_arglist::visit_valuetype (be_valuetype *node)
-{
- return this->emit_common (node);
-}
-
-int be_visitor_args_arglist::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "const " << this->type_name (node) << " *";
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " *&";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_arglist::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int be_visitor_args_arglist::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
-
-int
-be_visitor_args_arglist::visit_home (
- be_home *node
- )
-{
- return this->visit_interface (node);
-}
-
-int be_visitor_args_arglist::visit_valuebox (be_valuebox *node)
-{
- return this->emit_common (node);
-}
-
-
-int be_visitor_args_arglist::emit_common (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << this->type_name (node) << " *";
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " *&";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp b/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp
deleted file mode 100644
index 7cabfbea573..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// argument.cpp
-//
-// = DESCRIPTION
-// generic visitor for Argument node
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_argument,
- argument,
- "$Id$")
-
-be_visitor_args::be_visitor_args (be_visitor_context *ctx)
- : be_visitor_decl (ctx),
- fixed_direction_ (-1)
-{
-}
-
-be_visitor_args::~be_visitor_args (void)
-{
-}
-
-int be_visitor_args::visit_argument (be_argument *)
-{
- return -1;
-}
-
-// helper that returns the type name either as a nested type name (for header
-// files) or as a fully scoped name. In addition, we make sure that if the type
-// is an alias, we use that name
-const char *
-be_visitor_args::type_name (be_type *node,
- const char *suffix)
-{
- static char namebuf [NAMEBUFSIZE];
- ACE_OS::memset (namebuf,
- '\0',
- NAMEBUFSIZE);
-
- be_type *bt;
-
- // Use the typedefed name if that is the one used in the IDL defn.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- ACE_OS::sprintf (namebuf,
- "::%s",
- bt->full_name ());
-
- if (suffix)
- {
- ACE_OS::strcat (namebuf,
- suffix);
- }
-
- return namebuf;
-}
-
-// helper that returns the direction type of the argument
-AST_Argument::Direction
-be_visitor_args::direction (void)
-{
- if (this->fixed_direction_ != -1)
- {
- return AST_Argument::Direction (this->fixed_direction_);
- }
-
- // grab the argument node. We know that our context has stored the right
- // argument node
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- ACE_ASSERT (arg != 0);
- return arg->direction ();
-}
-
-void
-be_visitor_args::set_fixed_direction (AST_Argument::Direction direction)
-{
- this->fixed_direction_ = direction;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp
deleted file mode 100644
index 4001e6417e9..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp
+++ /dev/null
@@ -1,681 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// invoke_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating the code that passes arguments to the CDR operators
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_argument,
- invoke_cs,
- "$Id$")
-
-
-// ****************************************************************************
-// visitor for arguments passing to the CDR operators.
-// ****************************************************************************
-
-be_visitor_args_invoke_cs::
-be_visitor_args_invoke_cs (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_invoke_cs::
-~be_visitor_args_invoke_cs (void)
-{
-}
-
-int be_visitor_args_invoke_cs::visit_argument (be_argument *node)
-{
- this->ctx_->node (node); // save the argument node
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_invoke_cs::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- // Different types have different mappings when used as in/out or
- // inout parameters. Let this visitor deal with the type
-
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "(_tao_out << ";
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << "(_tao_in >> ";
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_invoke_cs::"
- "visit_argument - "
- "Bad substate\n"),
- -1);
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_invoke_cs::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << ")";
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << ")";
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_invoke_cs::"
- "visit_argument - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_invoke_cs::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << node->name () << "_forany ("
- << "(" << node->name () << "_slice *)"
- << arg->local_name () << ")";
- break;
- case AST_Argument::dir_INOUT:
- *os << node->name () << "_forany ("
- << arg->local_name () << ")";
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << "_tao_argument_" << arg->local_name ();
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_invoke_cs::"
- "visit_array - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_invoke_cs::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << arg->local_name ();
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_invoke_cs::"
- "visit_enum - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_invoke_cs::visit_interface (be_interface *)
-{
- return this->emit_common ();
-}
-
-int be_visitor_args_invoke_cs::visit_interface_fwd (be_interface_fwd *)
-{
- return this->emit_common ();
-}
-
-int be_visitor_args_invoke_cs::visit_valuebox (be_valuebox *)
-{
- return this->emit_common ();
-}
-
-int be_visitor_args_invoke_cs::visit_valuetype (be_valuetype *)
-{
- return this->emit_common ();
-}
-
-int
-be_visitor_args_invoke_cs::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- return this->emit_common ();
-}
-
-int be_visitor_args_invoke_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- case AST_PredefinedType::PT_any:
- case AST_PredefinedType::PT_long:
- case AST_PredefinedType::PT_ulong:
- case AST_PredefinedType::PT_longlong:
- case AST_PredefinedType::PT_ulonglong:
- case AST_PredefinedType::PT_short:
- case AST_PredefinedType::PT_ushort:
- case AST_PredefinedType::PT_float:
- case AST_PredefinedType::PT_double:
- case AST_PredefinedType::PT_longdouble:
- *os << arg->local_name ();
- break;
- case AST_PredefinedType::PT_char:
- *os << "::ACE_OutputCDR::from_char (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "::ACE_OutputCDR::from_wchar (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "::ACE_OutputCDR::from_boolean (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "::ACE_OutputCDR::from_octet (" << arg->local_name () << ")";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_invoke_cs::"
- "visit_predefined_type - "
- "Bad predefined type\n"),
- -1);
- }
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- case AST_PredefinedType::PT_any:
- case AST_PredefinedType::PT_long:
- case AST_PredefinedType::PT_ulong:
- case AST_PredefinedType::PT_longlong:
- case AST_PredefinedType::PT_ulonglong:
- case AST_PredefinedType::PT_short:
- case AST_PredefinedType::PT_ushort:
- case AST_PredefinedType::PT_float:
- case AST_PredefinedType::PT_double:
- case AST_PredefinedType::PT_longdouble:
- *os << arg->local_name ();
- break;
- case AST_PredefinedType::PT_char:
- *os << "::ACE_InputCDR::to_char (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "::ACE_InputCDR::to_wchar (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "::ACE_InputCDR::to_boolean (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "::ACE_InputCDR::to_octet (" << arg->local_name () << ")";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal_cs::"
- "visit_array - "
- "Bad predefined type\n"),
- -1);
- }
- break;
- case AST_Argument::dir_OUT:
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- *os << arg->local_name () << ".ptr ()";
- break;
- case AST_PredefinedType::PT_any:
- *os << "*" << arg->local_name () << ".ptr ()";
- break;
- case AST_PredefinedType::PT_long:
- case AST_PredefinedType::PT_ulong:
- case AST_PredefinedType::PT_longlong:
- case AST_PredefinedType::PT_ulonglong:
- case AST_PredefinedType::PT_short:
- case AST_PredefinedType::PT_ushort:
- case AST_PredefinedType::PT_float:
- case AST_PredefinedType::PT_double:
- case AST_PredefinedType::PT_longdouble:
- *os << arg->local_name ();
- break;
- case AST_PredefinedType::PT_char:
- *os << "::ACE_InputCDR::to_char (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "::ACE_InputCDR::to_wchar (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "::ACE_InputCDR::to_boolean (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "::ACE_InputCDR::to_octet (" << arg->local_name () << ")";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_invoke_cs::"
- "visit_array - "
- "Bad predefined type\n"),
- -1);
- }
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_invoke_cs::"
- "visit_array - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_invoke_cs::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- *os << "*" << arg->local_name () << ".ptr ()";
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_invoke_cs::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_invoke_cs::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- // We need to make a distinction between bounded and unbounded strings.
- if (node->max_size ()->ev ()->u.ulval == 0)
- {
- // Unbounded.
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- *os << arg->local_name () << ".ptr ()";
- break;
- }
- }
- else
- {
- // Bounded.
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- if (node->width () == (long) sizeof (char))
- {
- *os << "::ACE_InputCDR::to_string (";
- }
- else
- {
- *os << "::ACE_InputCDR::to_wstring (";
- }
-
- *os << arg->local_name () << ", "
- << node->max_size ()->ev ()->u.ulval << ")";
- break;
- case AST_Argument::dir_OUT:
- if (node->width () == (long) sizeof (char))
- {
- *os << "::ACE_InputCDR::to_string (";
- }
- else
- {
- *os << "::ACE_InputCDR::to_wstring (";
- }
-
- *os << arg->local_name () << ".ptr (), "
- << node->max_size ()->ev ()->u.ulval << ")";
- break;
- }
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_invoke_cs::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_invoke_cs::visit_structure (be_structure *node)
-{
- return this->emit_common2 (node);
-}
-
-int be_visitor_args_invoke_cs::visit_union (be_union *node)
-{
- return this->emit_common2 (node);
-}
-
-int be_visitor_args_invoke_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_invoke_cs::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_args_invoke_cs::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_args_invoke_cs::visit_component_fwd (
- be_component_fwd *node
- )
-{
- return this->visit_interface_fwd (node);
-}
-
-int
-be_visitor_args_invoke_cs::visit_eventtype (
- be_eventtype *node
- )
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_args_invoke_cs::visit_eventtype_fwd (
- be_eventtype_fwd *node
- )
-{
- return this->visit_valuetype_fwd (node);
-}
-
-int
-be_visitor_args_invoke_cs::visit_home (
- be_home *node
- )
-{
- return this->visit_interface (node);
-}
-
-
-int be_visitor_args_invoke_cs::emit_common (void)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- *os << arg->local_name () << ".ptr ()";
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_invoke_cs::"
- "emit_common - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_invoke_cs::emit_common2 (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- if (node->size_type () == AST_Type::VARIABLE)
- *os << "*" << arg->local_name () << ".ptr ()";
- else
- *os << arg->local_name ();
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_invoke_cs::"
- "emit_common2 - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp
deleted file mode 100644
index 39ea6f27f8c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp
+++ /dev/null
@@ -1,695 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// marshal_ss.cpp
-//
-// = DESCRIPTION
-// Visitor that generates code that passes the argument variable to the
-// marshal operations.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_argument,
- marshal_ss,
- "$Id$")
-
-
-// ************************************************************************
-// Visitor to generate code for passing argument to the marshal/demarshal
-// routines
-// ************************************************************************
-
-be_visitor_args_marshal_ss::
-be_visitor_args_marshal_ss (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_marshal_ss::
-~be_visitor_args_marshal_ss (void)
-{
-}
-
-int be_visitor_args_marshal_ss::visit_argument (be_argument *node)
-{
- this->ctx_->node (node);
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_marshal_ss::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- // Different types have different mappings when used as in/out or
- // inout parameters. Let this visitor deal with the type
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << be_nl << "(_tao_in >> ";
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << be_nl << "(_tao_out << ";
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_marshal_ss::"
- "visit_argument - "
- "Bad substate\n"),
- -1);
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_marshal_ss::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << ")";
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << ")";
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_marshal_ss::"
- "visit_argument - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_marshal_ss::visit_array (be_array *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "_tao_forany_" << arg->local_name ();
- break;
- case AST_Argument::dir_INOUT:
- *os << "_tao_forany_" << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- *os << "_tao_forany_" << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- *os << "_tao_forany_" << arg->local_name ();
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_marshal_ss::"
- "visit_array - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_marshal_ss::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << arg->local_name ();
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_marshal_ss::"
- "visit_enum - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_marshal_ss::visit_interface (be_interface *)
-{
- return this->emit_common ();
-}
-
-int be_visitor_args_marshal_ss::visit_interface_fwd (be_interface_fwd *)
-{
- return this->emit_common ();
-}
-
-int be_visitor_args_marshal_ss::visit_valuebox (be_valuebox *)
-{
- return this->emit_common ();
-}
-
-int be_visitor_args_marshal_ss::visit_valuetype (be_valuetype *)
-{
- return this->emit_common ();
-}
-
-int be_visitor_args_marshal_ss::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- return this->emit_common ();
-}
-
-int be_visitor_args_marshal_ss::visit_predefined_type (
- be_predefined_type *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- *os << arg->local_name () << ".out ()";
- break;
- case AST_PredefinedType::PT_any:
- case AST_PredefinedType::PT_long:
- case AST_PredefinedType::PT_ulong:
- case AST_PredefinedType::PT_longlong:
- case AST_PredefinedType::PT_ulonglong:
- case AST_PredefinedType::PT_short:
- case AST_PredefinedType::PT_ushort:
- case AST_PredefinedType::PT_float:
- case AST_PredefinedType::PT_double:
- case AST_PredefinedType::PT_longdouble:
- *os << arg->local_name ();
- break;
- case AST_PredefinedType::PT_char:
- *os << "::ACE_InputCDR::to_char (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "::ACE_InputCDR::to_wchar (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "::ACE_InputCDR::to_boolean (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "::ACE_InputCDR::to_octet (" << arg->local_name () << ")";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_marshal_ss::"
- "visit_predefined_type - "
- "Bad predefined type\n"),
- -1);
- }
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- *os << arg->local_name () << ".in ()";
- break;
- case AST_PredefinedType::PT_any:
- *os << arg->local_name ();
- break;
- case AST_PredefinedType::PT_long:
- case AST_PredefinedType::PT_ulong:
- case AST_PredefinedType::PT_longlong:
- case AST_PredefinedType::PT_ulonglong:
- case AST_PredefinedType::PT_short:
- case AST_PredefinedType::PT_ushort:
- case AST_PredefinedType::PT_float:
- case AST_PredefinedType::PT_double:
- case AST_PredefinedType::PT_longdouble:
- *os << arg->local_name ();
- break;
- case AST_PredefinedType::PT_char:
- *os << "::ACE_OutputCDR::from_char (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "::ACE_OutputCDR::from_wchar (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "::ACE_OutputCDR::from_boolean (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "::ACE_OutputCDR::from_octet (" << arg->local_name () << ")";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal_ss::"
- "visit_array - "
- "Bad predefined type\n"),
- -1);
- }
- break;
- case AST_Argument::dir_OUT:
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- *os << arg->local_name () << ".in ()";
- break;
- case AST_PredefinedType::PT_any:
- *os << arg->local_name () << ".in ()";
- break;
- case AST_PredefinedType::PT_long:
- case AST_PredefinedType::PT_ulong:
- case AST_PredefinedType::PT_longlong:
- case AST_PredefinedType::PT_ulonglong:
- case AST_PredefinedType::PT_short:
- case AST_PredefinedType::PT_ushort:
- case AST_PredefinedType::PT_float:
- case AST_PredefinedType::PT_double:
- case AST_PredefinedType::PT_longdouble:
- *os << arg->local_name ();
- break;
- case AST_PredefinedType::PT_char:
- *os << "::ACE_OutputCDR::from_char (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "::ACE_OutputCDR::from_wchar (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "::ACE_OutputCDR::from_boolean (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "::ACE_OutputCDR::from_octet (" << arg->local_name () << ")";
- break;
- default:
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal_ss::"
- "visit_array - "
- "Bad predefined type\n"
- ),
- -1
- );
- }
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_marshal_ss::"
- "visit_array - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_marshal_ss::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- *os << arg->local_name () << ".in ()";
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_marshal_ss::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_marshal_ss::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- // we need to make a distinction between bounded and unbounded strings
- if (node->max_size ()->ev ()->u.ulval == 0)
- {
- *os << arg->local_name () << ".out ()";
- }
- else
- {
- if (node->width () == (long) sizeof (char))
- {
- *os << "::ACE_InputCDR::to_string (";
- }
- else
- {
- *os << "::ACE_InputCDR::to_wstring (";
- }
-
- *os << arg->local_name () << ".out (), "
- << node->max_size ()->ev ()->u.ulval
- << ")";
- }
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- // we need to make a distinction between bounded and unbounded strings
- if (node->max_size ()->ev ()->u.ulval == 0)
- {
- // unbounded
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << arg->local_name () << ".in ()";
- break;
- }
- }
- else
- {
- // bounded
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- if (node->width () == (long) sizeof (char))
- {
- *os << "::ACE_OutputCDR::from_string ((char *)";
- }
- else
- {
- *os << "::ACE_OutputCDR::from_wstring ((CORBA::WChar *)";
- }
-
- *os << arg->local_name () << ".in (), "
- << node->max_size ()->ev ()->u.ulval << ")";
- break;
- }
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_marshal_ss::"
- "visit_string - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_marshal_ss::visit_structure (be_structure *node)
-{
- return this->emit_common2 (node);
-}
-
-int be_visitor_args_marshal_ss::visit_union (be_union *node)
-{
- return this->emit_common2 (node);
-}
-
-int be_visitor_args_marshal_ss::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_marshal_ss::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_args_marshal_ss::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_args_marshal_ss::visit_component_fwd (
- be_component_fwd *node
- )
-{
- return this->visit_interface_fwd (node);
-}
-
-int
-be_visitor_args_marshal_ss::visit_eventtype (
- be_eventtype *node
- )
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_args_marshal_ss::visit_eventtype_fwd (
- be_eventtype_fwd *node
- )
-{
- return this->visit_valuetype_fwd (node);
-}
-
-int
-be_visitor_args_marshal_ss::visit_home (
- be_home *node
- )
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_args_marshal_ss::emit_common ()
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name () << ".out ()";
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << arg->local_name () << ".in ()";
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_marshal_ss::emit_common - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-
-int
-be_visitor_args_marshal_ss::emit_common2 (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- if (node->size_type () == AST_Type::VARIABLE)
- *os << arg->local_name () << ".in ()";
- else
- *os << arg->local_name ();
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_marshal_ss::emit_common2 - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp
deleted file mode 100644
index e8f10292638..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// paramlist.cpp
-//
-// = DESCRIPTION
-// Visitor that generates the Dyanmic::ParameterList
-//
-// = AUTHOR
-// Kirthika Parameswaran <kirthika@cs.wustl.edu>
-// Ossama Othman <ossama@uci.edu>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_argument,
- paramlist,
- "$Id$")
-
-
-// ************************************************************
-// be_visitor_args_paramlist for parameter list in method declarations and
-// definitions
-// ************************************************************
-
-be_visitor_args_paramlist::be_visitor_args_paramlist (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_paramlist::~be_visitor_args_paramlist (void)
-{
-}
-
-int be_visitor_args_paramlist::visit_argument (be_argument *node)
-{
- // Get output stream.
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Save the argument node.
- this->ctx_->node (node);
-
- // We do not put "out" arguments into the arglist.
- if (this->direction () == AST_Argument::dir_OUT)
- {
- return 0;
- }
-
- // Retrieve the type.
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- // If node is typedef'd, we must strip it off.
- if (bt->node_type () == AST_Decl::NT_typedef)
- {
- be_typedef *td = be_typedef::narrow_from_decl (bt);
- bt = td->primitive_base_type ();
- }
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_arglist::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- // Generate valuetype check: this hack is needed as there is no
- // available way to check for valuetype type.
- // Any operators for valuetypes arent there so we dont add it to the
- // paramlist.
- if (bt->node_type () == AST_Decl::NT_interface)
- {
- be_valuetype *vt = be_valuetype::narrow_from_decl (node->field_type ());
-
- // @@ NOTE: If this check is removed, and insertion operators
- // for valuetypes are implemented, don't forget to also
- // remove the same valuetype check in
- // be_visitor_operation::count_non_out_parameters().
-
- // If it is a valuetype just return.
- if (vt)
- {
- return 0;
- }
- }
-
- // Amazed by the zillion os operators below? Its just to combat
- // side effects functions like type_name() have on the os stream.
- // This was causing a problem with the stubs not been generated accurately
- // on Linux using egcs.
- if (bt->node_type () == AST_Decl::NT_array)
- {
- *os << this->type_name (bt, "_forany");
- *os << " _tao_forany_" << node->local_name () << " (";
- *os << this->type_name (bt, "_dup");
- *os << " (";
-
- if (this->direction () != AST_Argument::dir_IN)
- {
- *os << "(const ::" << bt->name () << "_slice *) ";
- }
-
- *os << "this->";
- *os << node->local_name () << "_));" << be_nl;
- *os << "(*parameter_list)[len].argument <<= _tao_forany_" ;
- *os << node->local_name () << ";" << be_nl;
- }
- else
- {
- *os << "(*parameter_list)[len].argument <<= ";
- // Insertion into an Any has some special cases which need to be
- // dealt with.
-
- switch (bt->node_type ())
- {
- case AST_Decl::NT_pre_defined:
- case AST_Decl::NT_string:
- case AST_Decl::NT_wstring:
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_paramlist::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
- break;
-
- default:
- *os << " this->" << node->local_name () << "_;";
-
- }
- }
-
- *os << be_nl;
-
- // Set the appropriate mode for each parameter.
- switch (node->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "(*parameter_list)[len].mode = ::CORBA::PARAM_IN;" << be_nl;
- break;
- case AST_Argument::dir_INOUT:
- *os << "(*parameter_list)[len].mode = ::CORBA::PARAM_INOUT;" << be_nl;
- break;
- case AST_Argument::dir_OUT:
- *os << "(*parameter_list)[len].mode = ::CORBA::PARAM_OUT;" << be_nl;
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_args_paramlist::"
- "visit_argument - "
- "Bad context\n"),
- -1);
- }
-
- *os << "len++;" << be_nl;
-
-
- return 0;
-}
-
-int
-be_visitor_args_paramlist::visit_string (be_string *node)
-{
- // Get output stream.
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Get the argument.
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- // We need to make a distinction between bounded and unbounded strings.
- if (node->max_size ()->ev ()->u.ulval != 0)
- {
- // Bounded strings.
- if (node->width () == (long) sizeof (char))
- {
- *os << "::ACE_OutputCDR::from_string ((char *)";
- }
- else
- {
- *os << "::ACE_OutputCDR::from_wstring ((CORBA::WChar *)";
- }
-
- *os << arg->local_name () << "_, "
- << node->max_size ()->ev ()->u.ulval
- << ");";
- }
- else
- {
- *os << arg->local_name () <<"_;";
- }
-
- return 0;
-}
-
-int
-be_visitor_args_paramlist::visit_predefined_type (be_predefined_type *node)
-{
- // Get output stream.
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Get the argument.
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_boolean:
- *os << "::ACE_OutputCDR::from_boolean (this->";
- *os << arg->local_name () << "_);";
- break;
- case AST_PredefinedType::PT_char:
- *os << "::ACE_OutputCDR::from_char (this->";
- *os << arg->local_name () << "_);";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "::ACE_OutputCDR::from_wchar (this->";
- *os << arg->local_name () << "_);";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "::ACE_OutputCDR::from_octet (this->";
- *os << arg->local_name () << "_);";
- break;
- default:
- *os << arg->local_name () << "_;";
- break;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/post_upcall_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/post_upcall_ss.cpp
deleted file mode 100644
index 41c9e5b9d10..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/post_upcall_ss.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// post_upcall_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating code to do post-processing of arguments following an
-// upcall.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_argument,
- post_upcall_ss,
- "$Id$")
-
-// ************************************************************************
-// visitor for doing any post-processing after the upcall is made
-// ************************************************************************
-
-be_visitor_args_post_upcall_ss::be_visitor_args_post_upcall_ss (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_args_post_upcall_ss::~be_visitor_args_post_upcall_ss (void)
-{
-}
-
-int
-be_visitor_args_post_upcall_ss::visit_operation (be_operation *node)
-{
- return this->visit_scope (node);
-}
-
-int be_visitor_args_post_upcall_ss::visit_argument (be_argument *node)
-{
- this->ctx_->node (node); // save the argument node
-
- // retrieve the type
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_post_upcall::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- // Different types have different mappings when used as in/out or
- // inout parameters. Let this visitor deal with the type
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_post_upcall::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_post_upcall_ss::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- // if the current type is an alias, use that
- be_type *bt = node;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
-
- switch (arg->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- if (node->size_type () == be_type::VARIABLE)
- {
- *os << bt->name () << "_forany _tao_forany_"
- << arg->local_name () << " (" << be_idt << be_idt_nl
- << arg->local_name () << ".inout ()" << be_uidt_nl
- << ");\n" << be_uidt;
- }
- else
- {
- *os << bt->name () << "_forany _tao_forany_"
- << arg->local_name () << " (" << be_idt << be_idt_nl
- << arg->local_name () << be_uidt_nl
- << ");\n" << be_uidt;
- }
-
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_upcall_ss::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_post_upcall::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp
deleted file mode 100644
index e5b9a0f45f5..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp
+++ /dev/null
@@ -1,424 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// upcall_ss.cpp
-//
-// = DESCRIPTION
-// Visitor that generates code that passes argument variables to the
-// upcall.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_argument,
- upcall_ss,
- "$Id$")
-
-
-// ************************************************************************
-// visitor for passing arguments to the upcall
-// ************************************************************************
-
-be_visitor_args_upcall_ss::be_visitor_args_upcall_ss (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_upcall_ss::~be_visitor_args_upcall_ss (void)
-{
-}
-
-int be_visitor_args_upcall_ss::visit_argument (be_argument *node)
-{
- this->ctx_->node (node);
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_upcall_ss::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl;
-
- // Different types have different mappings when used as in/out or
- // inout parameters. Let this visitor deal with the type
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_upcall_ss::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_upcall_ss::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- // This is to placate some compilers which have
- // trouble with IN args that are multidimensional arrays.
- if (node->n_dims () > 1)
- {
- *os << "(const ::" << node->name () << "_slice *) ";
- }
-
- *os << arg->local_name ();
-
- break;
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
-
- break;
- case AST_Argument::dir_OUT:
- if (node->size_type () == AST_Type::VARIABLE)
- {
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- {
- *os << arg->local_name ();
- }
- else
- {
- *os << arg->local_name () << ".out ()";
- }
- }
- else
- {
- *os << arg->local_name ();
- }
-
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_upcall_ss::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << arg->local_name ();
-
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_upcall_ss::visit_interface (be_interface *)
-{
- return this->emit_common ();
-}
-
-int be_visitor_args_upcall_ss::visit_interface_fwd (be_interface_fwd *)
-{
- return this->emit_common ();
-}
-
-int be_visitor_args_upcall_ss::visit_valuebox (be_valuebox *)
-{
- return this->emit_common ();
-}
-
-int be_visitor_args_upcall_ss::visit_valuetype (be_valuetype *)
-{
- return this->emit_common ();
-}
-
-int be_visitor_args_upcall_ss::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- return this->emit_common ();
-}
-
-int be_visitor_args_upcall_ss::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
- AST_PredefinedType::PredefinedType pt = node->pt ();
-
- if (pt == AST_PredefinedType::PT_any)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
-
- break;
- case AST_Argument::dir_OUT:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- {
- *os << arg->local_name ();
- }
- else
- {
- *os << arg->local_name () << ".out ()";
- }
-
- break;
- }
- }
- else if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- {
- *os << arg->local_name ();
- }
- else
- {
- *os << arg->local_name () << ".in ()";
- }
-
- break;
- case AST_Argument::dir_INOUT:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- {
- *os << arg->local_name ();
- }
- else
- {
- *os << arg->local_name () << ".inout ()";
- }
-
- break;
- case AST_Argument::dir_OUT:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- {
- *os << arg->local_name ();
- }
- else
- {
- *os << arg->local_name () << ".out ()";
- }
-
- break;
- }
- }
- else
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << arg->local_name ();
-
- break;
- } // end switch direction
- } // end of else
-
- return 0;
-}
-
-int be_visitor_args_upcall_ss::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
-
- break;
- case AST_Argument::dir_OUT:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- {
- *os << arg->local_name ();
- }
- else
- {
- *os << arg->local_name () << ".out ()";
- }
-
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_upcall_ss::visit_string (be_string *)
-{
- return this->emit_common ();
-}
-
-int be_visitor_args_upcall_ss::visit_structure (be_structure *node)
-{
- return this->emit_common2 (node);
-}
-
-int be_visitor_args_upcall_ss::visit_union (be_union *node)
-{
- return this->emit_common2 (node);
-}
-
-int be_visitor_args_upcall_ss::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_upcall_ss::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_args_upcall_ss::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_args_upcall_ss::visit_component_fwd (
- be_component_fwd *node
- )
-{
- return this->visit_interface_fwd (node);
-}
-
-int
-be_visitor_args_upcall_ss::visit_eventtype (
- be_eventtype *node
- )
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_args_upcall_ss::visit_eventtype_fwd (
- be_eventtype_fwd *node
- )
-{
- return this->visit_valuetype_fwd (node);
-}
-
-int be_visitor_args_upcall_ss::emit_common (void)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- {
- *os << arg->local_name ();
- }
- else
- {
- *os << arg->local_name () << ".in ()";
- }
-
- break;
- case AST_Argument::dir_INOUT:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- {
- *os << arg->local_name ();
- }
- else
- {
- *os << arg->local_name () << ".inout ()";
- }
-
- break;
- case AST_Argument::dir_OUT:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- {
- *os << arg->local_name ();
- }
- else
- {
- *os << arg->local_name () << ".out ()";
- }
-
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_upcall_ss::emit_common2 (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
-
- break;
- case AST_Argument::dir_OUT:
- if (node->size_type () == AST_Type::VARIABLE)
- {
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- {
- *os << arg->local_name ();
- }
- else
- {
- *os << arg->local_name () << ".out ()";
- }
- }
- else
- {
- *os << arg->local_name ();
- }
-
- break;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp
deleted file mode 100644
index 2736db1b783..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp
+++ /dev/null
@@ -1,457 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// vardecl_ss.cpp
-//
-// = DESCRIPTION
-// Visitor that generates the variable declaration in the skeleton
-// corresponding to the Argument node
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_argument,
- vardecl_ss,
- "$Id$")
-
-
-// ************************************************************************
-// Visitor to generate code for argument variable declaration
-// ************************************************************************
-
-be_visitor_args_vardecl_ss::be_visitor_args_vardecl_ss (
- be_visitor_context *ctx
- )
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_vardecl_ss::~be_visitor_args_vardecl_ss (void)
-{
-}
-
-int be_visitor_args_vardecl_ss::visit_argument (be_argument *node)
-{
- this->ctx_->node (node);
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_vardecl_ss::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl;
-
- // Different types have different mappings when used as in/out or
- // inout parameters. Let this visitor deal with the type
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_vardecl_ss::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_vardecl_ss::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "::" << bt->name () << " " << arg->local_name () << ";" << be_nl
- << "::" << bt->name () << "_forany _tao_forany_"
- << arg->local_name () << " (" << be_idt << be_idt_nl
- << arg->local_name () << be_uidt_nl
- << ");" << be_uidt;
-
- break;
- case AST_Argument::dir_OUT:
- if (node->size_type () == be_type::VARIABLE)
- {
- *os << "::" << bt->name () << "_var " << arg->local_name ()
- << ";";
- }
- else
- {
- *os << bt->name () << " " << arg->local_name ()
- << ";";
- }
-
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_vardecl_ss::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << "::" << bt->name () << " " << arg->local_name () << ";";
-
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_vardecl_ss::visit_interface (be_interface *node)
-{
- return this->emit_common (node);
-}
-
-int be_visitor_args_vardecl_ss::visit_interface_fwd (be_interface_fwd *node)
-{
- return this->emit_common (node);
-}
-
-
-int be_visitor_args_vardecl_ss::visit_valuebox (be_valuebox *node)
-{
- return this->emit_common (node);
-}
-
-int be_visitor_args_vardecl_ss::visit_valuetype (be_valuetype *node)
-{
- return this->emit_common (node);
-}
-
-int be_visitor_args_vardecl_ss::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- return this->emit_common (node);
-}
-
-int be_visitor_args_vardecl_ss::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- AST_PredefinedType::PredefinedType pt = node->pt ();
-
- *os << "::" << bt->name ();
-
- if (pt == AST_PredefinedType::PT_any)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << " ";
- break;
- case AST_Argument::dir_OUT:
- *os << "_var ";
- break;
- }
-
- *os << arg->local_name () << ";";
- }
- else if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << "_var " << arg->local_name () << ";";
- }
- else
- {
- *os << " " << arg->local_name ();
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
-
- // @@@ (JP) This is a hack for VC7, which gets an internal
- // compiler error if these not initialized.
- // (02-12-09)
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- switch (pt)
- {
- case AST_PredefinedType::PT_boolean:
- case AST_PredefinedType::PT_short:
- case AST_PredefinedType::PT_long:
- case AST_PredefinedType::PT_ushort:
- case AST_PredefinedType::PT_ulong:
- case AST_PredefinedType::PT_ulonglong:
- case AST_PredefinedType::PT_float:
- case AST_PredefinedType::PT_double:
- case AST_PredefinedType::PT_octet:
- *os << " = 0";
- break;
- case AST_PredefinedType::PT_longlong:
- *os << " = ACE_CDR_LONGLONG_INITIALIZER";
- break;
- case AST_PredefinedType::PT_longdouble:
- *os << " = ACE_CDR_LONG_DOUBLE_INITIALIZER";
- break;
- default:
- break;
- }
-
- break;
- }
-
- *os << ";";
- }
-
- return 0;
-}
-
-int be_visitor_args_vardecl_ss::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "::" << bt->name () << " " << arg->local_name () << ";";
-
- break;
- case AST_Argument::dir_OUT:
- *os << "::" << bt->name () << "_var "
- << arg->local_name () << ";" << be_nl;
-
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_vardecl_ss::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- if (node->width () == (long) sizeof (char))
- {
- *os << "::CORBA::String_var " << arg->local_name () << ";";
- }
- else
- {
- *os << "::CORBA::WString_var " << arg->local_name () << ";";
- }
-
- break;
- case AST_Argument::dir_OUT:
- if (node->width () == (long )sizeof (char))
- {
- *os << "::CORBA::String_var " << arg->local_name () << ";";
- }
- else
- {
- *os << "::CORBA::WString_var " << arg->local_name () << ";";
- }
-
- break;
- }
-
- return 0;
-}
-
-int be_visitor_args_vardecl_ss::visit_structure (be_structure *node)
-{
- return this->emit_common2 (node);
-}
-
-int be_visitor_args_vardecl_ss::visit_union (be_union *node)
-{
- return this->emit_common2 (node);
-}
-
-int be_visitor_args_vardecl_ss::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_vardecl_ss::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_args_vardecl_ss::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_args_vardecl_ss::visit_component_fwd (
- be_component_fwd *node
- )
-{
- return this->visit_interface_fwd (node);
-}
-
-int
-be_visitor_args_vardecl_ss::visit_eventtype (
- be_eventtype *node
- )
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_args_vardecl_ss::visit_eventtype_fwd (
- be_eventtype_fwd *node
- )
-{
- return this->visit_valuetype_fwd (node);
-}
-
-
-int
-be_visitor_args_vardecl_ss::emit_common (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "::" << bt->name () << "_var " << arg->local_name () << ";";
-
- break;
- case AST_Argument::dir_OUT:
- *os << "::" << bt->name () << "_var "
- << arg->local_name () << ";";
-
- break;
- }
-
- return 0;
-}
-
-
-
-int
-be_visitor_args_vardecl_ss::emit_common2 (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_argument *arg = this->ctx_->be_node_as_argument ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "::" << bt->name () << " " << arg->local_name () << ";";
-
- break;
- case AST_Argument::dir_OUT:
- if (node->size_type () == be_type::VARIABLE)
- {
- *os << "::" << bt->name () << "_var "
- << arg->local_name () << ";";
- }
- else
- {
- *os << "::" << bt->name () << " " << arg->local_name () << ";";
- }
-
- break;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_array.cpp b/TAO/TAO_IDL/be/be_visitor_array.cpp
deleted file mode 100644
index ced70b4b433..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_array.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Array
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_enum.h"
-#include "be_type.h"
-#include "be_typedef.h"
-#include "be_predefined_type.h"
-#include "be_array.h"
-#include "be_string.h"
-#include "be_interface.h"
-#include "be_interface_fwd.h"
-#include "be_valuebox.h"
-#include "be_valuetype.h"
-#include "be_valuetype_fwd.h"
-#include "be_structure.h"
-#include "be_union.h"
-#include "be_sequence.h"
-#include "be_helper.h"
-#include "be_extern.h"
-#include "utl_identifier.h"
-#include "nr_extern.h"
-#include "ace/Log_Msg.h"
-
-#include "be_visitor_array.h"
-#include "be_visitor_context.h"
-#include "be_visitor_enum.h"
-#include "be_visitor_structure.h"
-#include "be_visitor_union.h"
-
-#include "be_visitor_array/array.cpp"
-#include "be_visitor_array/array_ch.cpp"
-#include "be_visitor_array/array_ci.cpp"
-#include "be_visitor_array/array_cs.cpp"
-#include "be_visitor_array/any_op_ch.cpp"
-#include "be_visitor_array/any_op_cs.cpp"
-#include "be_visitor_array/cdr_op_ch.cpp"
-#include "be_visitor_array/cdr_op_cs.cpp"
-#include "be_visitor_array/serializer_op_ch.cpp"
-#include "be_visitor_array/serializer_op_cs.cpp"
-
-ACE_RCSID (be,
- be_visitor_array,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_array/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_array/any_op_ch.cpp
deleted file mode 100644
index b3ec2642578..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/any_op_ch.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor for code generation of Arrays for the Any operators in the client
-// header.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_array,
- any_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Array visitor for generating Any operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_array_any_op_ch::be_visitor_array_any_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_array_any_op_ch::~be_visitor_array_any_op_ch (void)
-{
-}
-
-int
-be_visitor_array_any_op_ch::visit_array (be_array *node)
-{
- if (node->cli_hdr_any_op_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- const char *macro = this->ctx_->export_macro ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << macro << " void operator<<= (::CORBA::Any &, const " << node->name ()
- << "_forany &);" << be_nl;
- *os << macro << " ::CORBA::Boolean operator>>= (const ::CORBA::Any &, "
- << node->name () << "_forany &);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_hdr_any_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp
deleted file mode 100644
index facda38a048..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor for code generation of Arrays for the Any operators in the client
-// stubs.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_array,
- any_op_cs,
- "$Id$")
-
-
-// ***************************************************************************
-// Array visitor for generating Any operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_array_any_op_cs::be_visitor_array_any_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_array_any_op_cs::~be_visitor_array_any_op_cs (void)
-{
-}
-
-int
-be_visitor_array_any_op_cs::visit_array (be_array *node)
-{
- if (node->cli_stub_any_op_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl
- << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Since we don't generate CDR stream operators for types that
- // explicitly contain a local interface (at some level), we
- // must override these Any template class methods to avoid
- // calling the non-existent operators. The zero return value
- // will eventually cause CORBA::MARSHAL to be raised if this
- // type is inserted into an Any and then marshaled.
- if (node->is_local ())
- {
- *os << be_nl << be_nl
- << "namespace TAO" << be_nl
- << "{" << be_idt_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Array_Impl_T<" << be_idt << be_idt_nl
- << node->name () << "_slice," << be_nl
- << node->name () << "_forany" << be_uidt_nl
- << ">::marshal_value (TAO_OutputCDR &)" << be_uidt_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Array_Impl_T<" << be_idt << be_idt_nl
- << node->name () << "_slice," << be_nl
- << node->name () << "_forany" << be_uidt_nl
- << ">::demarshal_value (TAO_OutputCDR &)" << be_uidt_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}";
- }
-
- *os << "void operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << "const " << node->name () << "_forany &_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "TAO::Any_Array_Impl_T<" << be_idt << be_idt_nl
- << node->name () << "_slice," << be_nl
- << node->name () << "_forany" << be_uidt_nl
- << ">::insert ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "_forany::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem.nocopy ()" << be_idt_nl
- << "? _tao_elem.ptr ()" << be_nl
- << ": "
- << node->name () << "_dup (_tao_elem.in ())" << be_uidt << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << node->name () << "_forany &_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return" << be_idt_nl
- << "TAO::Any_Array_Impl_T<" << be_idt << be_idt_nl
- << node->name () << "_slice," << be_nl
- << node->name () << "_forany" << be_uidt_nl
- << ">::extract (" << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "_forany::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem.out ()" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt << be_uidt_nl
- << "}";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_stub_any_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_array/array.cpp b/TAO/TAO_IDL/be/be_visitor_array/array.cpp
deleted file mode 100644
index 0ce6c5133ad..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/array.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// array.cpp
-//
-// = DESCRIPTION
-// Generic visitor for code generation for Arrays
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_array,
- array,
- "$Id$")
-
-
-// ************************************************************************
-// generic visitor for array declaration
-// ************************************************************************
-
-be_visitor_array::be_visitor_array (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_array::~be_visitor_array (void)
-{
-}
-
-int be_visitor_array::visit_array (be_array *)
-{
- // Must be overloaded by derived visitors.
- return -1;
-}
-
-int
-be_visitor_array::visit_enum (be_enum *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array::visit_interface (be_interface *node)
-{
- return this->emit_common (node);
-}
-
-int
-be_visitor_array::visit_interface_fwd (be_interface_fwd *node)
-{
- return this->emit_common (node);
-}
-
-int
-be_visitor_array::visit_valuebox (be_valuebox *node)
-{
- return this->emit_common (node);
-}
-
-int
-be_visitor_array::visit_valuetype (be_valuetype *node)
-{
- return this->emit_common (node);
-}
-
-int
-be_visitor_array::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- return this->emit_common (node);
-}
-
-int
-be_visitor_array::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- AST_PredefinedType::PredefinedType pt = node->pt ();
-
- *os << "::";
-
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << node->name () << "_var";
- }
- else
- {
- *os << node->name ();
- }
-
- return 0;
-}
-
-int
-be_visitor_array::visit_sequence (be_sequence *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (node->width () == (long) sizeof (char))
- {
- *os << "TAO::String_Manager";
- }
- else
- {
- *os << "TAO::WString_Manager";
- }
-
- return 0;
-}
-
-int
-be_visitor_array::visit_structure (be_structure *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array::visit_union (be_union *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array::visit_typedef (be_typedef *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- AST_Type *pbt = node->primitive_base_type ();
- AST_Decl::NodeType nt = pbt->node_type ();
- AST_PredefinedType::PredefinedType pt = AST_PredefinedType:: PT_void;
- int result = 0;
-
- // We check for these first, because in these cases, we replace the
- // entire slice type with one of the strings below, instead of using
- // the node's type name, possibly suffixed with '_var'.
- if (nt == AST_Decl::NT_string)
- {
- *os << "TAO::String_Manager";
-
- return 0;
- }
- else if (nt == AST_Decl::NT_wstring)
- {
- *os << "TAO::WString_Manager";
-
- return 0;
- }
-
- result = this->visit_node (node);
-
- if (nt == AST_Decl::NT_pre_defined)
- {
- AST_PredefinedType *pdt = AST_PredefinedType::narrow_from_decl (pbt);
- pt = pdt->pt ();
- }
-
- // We must append a "_var" for typedefs of interfaces, CORBA::Objects or
- // typecodes.
- if (nt == AST_Decl::NT_interface
- || nt == AST_Decl::NT_interface_fwd
- || pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << "_var";
- }
-
- return result;
-}
-
-// helper
-int
-be_visitor_array::visit_node (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_ARRAY_CH)
- {
- *os << bt->nested_type_name (this->ctx_->scope ());
- }
- else
- {
- *os << bt->name ();
- }
-
- return 0;
-}
-
-int
-be_visitor_array::emit_common (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_ARRAY_CH)
- {
- *os << bt->nested_type_name (this->ctx_->scope (), "_var");
- }
- else
- {
- *os << bt->name () << "_var";
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp
deleted file mode 100644
index 90d84dd5a39..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// array_ch.cpp
-//
-// = DESCRIPTION
-// Visitor for Array code generation in client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_array,
- array_ch,
- "$Id$")
-
-// ************************************************************************
-// visitor for array declaration in client header
-// ************************************************************************
-
-be_visitor_array_ch::be_visitor_array_ch (be_visitor_context *ctx)
- : be_visitor_array (ctx)
-{
-}
-
-be_visitor_array_ch::~be_visitor_array_ch (void)
-{
-}
-
-int be_visitor_array_ch::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_decl *scope = this->ctx_->scope ();
-
- // Nothing to do if we are imported or code is already generated.
- if (node->imported () || node->cli_hdr_gen ())
- {
- return 0;
- }
-
- this->ctx_->node (node);
-
- // Retrieve the type.
- be_type *bt = be_type::narrow_from_decl (node->base_type ());
- AST_Decl::NodeType nt = bt->node_type ();
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_ch::"
- "visit_array - "
- "bad base type\n"),
- -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " __FILE__ << ":" << __LINE__;
-
- // Generate the ifdefined macro.
- os->gen_ifdef_macro (node->flat_name ());
-
- // If we contain an anonymous sequence,
- // generate code for the sequence here.
- if (nt == AST_Decl::NT_sequence)
- {
- if (this->gen_anonymous_base_type (bt,
- TAO_CodeGen::TAO_ROOT_CH)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_ch::"
- "visit_array - "
- "gen_anonymous_base_type failed\n"),
- -1);
- }
- }
-
- // If the array is an anonymous member and if its element type
- // is a declaration (not a reference), we must generate code for
- // the declaration.
- if (this->ctx_->alias () == 0 // Not a typedef.
- && bt->is_child (this->ctx_->scope ()))
- {
- int status = 0;
- be_visitor_context ctx (*this->ctx_);
-
- switch (nt)
- {
- case AST_Decl::NT_enum:
- {
- be_visitor_enum_ch ec_visitor (&ctx);
- status = bt->accept (&ec_visitor);
- break;
- }
- case AST_Decl::NT_struct:
- {
- be_visitor_structure_ch sc_visitor (&ctx);
- status = bt->accept (&sc_visitor);
- break;
- }
- case AST_Decl::NT_union:
- {
- be_visitor_union_ch uc_visitor (&ctx);
- status = bt->accept (&uc_visitor);
- break;
- }
- default:
- break;
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_ch::"
- "visit_array - "
- "array base type codegen failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl
- << "typedef ";
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_ch::"
- "visit_array - "
- "base type decl failed\n"),
- -1);
- }
-
- *os << " ";
-
- be_typedef *td = this->ctx_->tdef ();
-
- if (td == 0)
- {
- // We are dealing with an anonymous array case. Generate a typedef with
- // an _ prepended to the name.
- *os << "_";
- }
-
- *os << node->local_name ();
-
- if (node->gen_dimensions (os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_ch::"
- "visit_array - "
- "gen dimensions failed\n"),
- -1);
- }
-
- *os << ";" << be_nl;
-
- // Now define the slice type and other required operations
- *os << "typedef ";
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_ch::"
- "visit_array - "
- "base type decl failed\n"),
- -1);
- }
-
- *os << " ";
-
- char anon_p [2];
- ACE_OS::memset (anon_p,
- '\0',
- 2);
-
- if (this->ctx_->tdef ())
- {
- anon_p[0] = '\0';
- }
- else
- {
- ACE_OS::sprintf (anon_p,
- "_");
- }
-
- *os << anon_p << node->local_name () << "_slice";
-
- if (node->gen_dimensions (os, 1) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_ch::"
- "visit_array - "
- "gen slice dimensions failed\n"),
- -1);
- }
-
- *os << ";";
-
- *os << be_nl
- << "struct " << anon_p << node->nested_type_name (scope, "_tag")
- << " {};" << be_nl;
-
- // No _var or _out class for an anonymous (non-typedef'd) array.
- if (td != 0)
- {
- // Generate _var class decl.
- // An _out decl is generated only for a variable size array.
- if (node->size_type () == AST_Type::VARIABLE)
- {
- *os << be_nl << be_nl
- << "typedef" << be_idt_nl
- << "TAO_VarArray_Var_T<" << be_idt << be_idt_nl
- << node->local_name () << "," << be_nl
- << node->local_name () << "_slice," << be_nl
- << node->local_name () << "_tag" << be_uidt_nl
- << ">" << be_uidt_nl
- << node->local_name () << "_var;" << be_uidt;
-
- *os << be_nl << be_nl
- << "typedef" << be_idt_nl
- << "TAO_Array_Out_T<" << be_idt << be_idt_nl
- << node->local_name () << "," << be_nl
- << node->local_name () << "_var," << be_nl
- << node->local_name () << "_slice," << be_nl
- << node->local_name () << "_tag" << be_uidt_nl
- << ">" << be_uidt_nl
- << node->local_name () << "_out;" << be_uidt;
- }
- else
- {
- *os << be_nl << be_nl
- << "typedef" << be_idt_nl
- << "TAO_FixedArray_Var_T<" << be_idt << be_idt_nl
- << node->local_name () << "," << be_nl
- << node->local_name () << "_slice," << be_nl
- << node->local_name () << "_tag" << be_uidt_nl
- << ">" << be_uidt_nl
- << node->local_name () << "_var;" << be_uidt;
-
- *os << be_nl << be_nl
- << "typedef" << be_idt_nl << node->local_name () << be_nl
- << node->local_name () << "_out;" << be_uidt;
- }
- }
-
- // Generate _forany decl.
- *os << be_nl << be_nl
- << "typedef" << be_idt_nl
- << "TAO_Array_Forany_T<" << be_idt << be_idt_nl
- << anon_p << node->local_name () << "," << be_nl
- << anon_p << node->local_name () << "_slice," << be_nl
- << anon_p << node->local_name () << "_tag" << be_uidt_nl
- << ">" << be_uidt_nl
- << anon_p << node->local_name () << "_forany;" << be_uidt;
-
- *os << be_nl << be_nl;
-
- // The _alloc, _dup, copy, and free methods. If the node is nested, the
- // methods become static
- const char *storage_class = 0;
-
- if (node->is_nested ())
- {
- if (scope->node_type () != AST_Decl::NT_module)
- {
- storage_class = "static ";
- }
- else
- {
- storage_class = "TAO_NAMESPACE_STORAGE_CLASS ";
- }
- }
- else
- {
- storage_class = "TAO_EXPORT_MACRO ";
- }
-
- if (td != 0)
- {
- // Typedefed array.
- *os << storage_class << node->nested_type_name (scope, "_slice")
- << " *" << be_nl;
- *os << node->nested_type_name (scope, "_alloc") << " (void);"
- << be_nl << be_nl;
- *os << storage_class << "void" << be_nl
- << node->nested_type_name (scope, "_free")
- << " (" << be_idt << be_idt_nl;
- *os << node->nested_type_name (scope, "_slice")
- << " *_tao_slice " << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
- *os << storage_class << node->nested_type_name (scope, "_slice")
- << " *" << be_nl;
- *os << node->nested_type_name (scope, "_dup")
- << " (" << be_idt << be_idt_nl
- << "const ";
- *os << node->nested_type_name (scope, "_slice")
- << " *_tao_slice" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
- *os << storage_class << "void" << be_nl
- << node->nested_type_name (scope, "_copy")
- << " (" << be_idt << be_idt_nl;
- *os << node->nested_type_name (scope, "_slice") << " *_tao_to," << be_nl
- << "const ";
- *os << node->nested_type_name (scope, "_slice")
- << " *_tao_from" << be_uidt_nl
- << ");" << be_uidt << be_nl;
- }
- else
- {
- // Anonymous array.
- *os << storage_class << node->nested_type_name (scope, "_slice", "_")
- << " *" << be_nl;
- *os << node->nested_type_name (scope, "_alloc", "_")
- << " (void);" << be_nl << be_nl;
- *os << storage_class << "void" << be_nl
- << node->nested_type_name (scope, "_free", "_")
- << " (" << be_idt << be_idt_nl;
- *os << node->nested_type_name (scope, "_slice", "_")
- << " *_tao_slice" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
- *os << storage_class << node->nested_type_name (scope, "_slice", "_")
- << " *" << be_nl;
- *os << node->nested_type_name (scope, "_dup", "_")
- << " (" << be_idt << be_idt_nl
- << "const ";
- *os << node->nested_type_name (scope, "_slice", "_")
- << " *_tao_slice" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
- *os << storage_class << "void" << be_nl
- << node->nested_type_name (scope, "_copy", "_")
- << " (" << be_idt << be_idt_nl;
- *os << node->nested_type_name (scope, "_slice", "_")
- << " *_tao_to," << be_nl
- << "const ";
- *os << node->nested_type_name (scope, "_slice", "_")
- << " *_tao_from" << be_uidt_nl
- << ");" << be_uidt;
- }
-
- // Generate the endif macro.
- os->gen_endif ();
-
- node->cli_hdr_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp
deleted file mode 100644
index 821748d1328..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp
+++ /dev/null
@@ -1,366 +0,0 @@
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// array_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Arrays in the client inline.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_array,
- array_ci,
- "$Id$")
-
-
-// ************************************************************************
-// visitor for array declaration in client inline
-// ************************************************************************
-
-be_visitor_array_ci::be_visitor_array_ci (be_visitor_context *ctx)
- : be_visitor_array (ctx)
-{
-}
-
-be_visitor_array_ci::~be_visitor_array_ci (void)
-{
-}
-
-int be_visitor_array_ci::visit_array (be_array *node)
-{
- // Nothing to do if we are imported or code is already generated.
- if (node->imported () || node->cli_inline_gen ())
- {
- return 0;
- }
-
- this->ctx_->node (node); // save the array node
-
- // If we contain an anonymous sequence, generate code for it here.
- be_type *bt = be_type::narrow_from_decl (node->base_type ());
- AST_Decl::NodeType nt = bt->node_type ();
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_ci::"
- "visit_array - "
- "bad base type\n"),
- -1);
- }
-
- if (nt == AST_Decl::NT_sequence)
- {
- if (this->gen_anonymous_base_type (bt,
- TAO_CodeGen::TAO_ROOT_CI)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_ci::"
- "visit_array - "
- "gen_anonymous_base_type failed\n"),
- -1);
- }
- }
-
- // If the array is an anonymous member and if its element type
- // is a declaration (not a reference), we must generate code for
- // the declaration.
- if (this->ctx_->alias () == 0 // Not a typedef.
- && bt->is_child (this->ctx_->scope ()))
- {
- int status = 0;
- be_visitor_context ctx (*this->ctx_);
-
- switch (nt)
- {
- case AST_Decl::NT_struct:
- {
- be_visitor_structure_ci sc_visitor (&ctx);
- status = bt->accept (&sc_visitor);
- break;
- }
- case AST_Decl::NT_union:
- {
- be_visitor_union_ci uc_visitor (&ctx);
- status = bt->accept (&uc_visitor);
- break;
- }
- default:
- break;
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_ch::"
- "visit_array - "
- "array base type codegen failed\n"),
- -1);
- }
- }
-
- // To hold the full and local.
- char fname [NAMEBUFSIZE];
- char lname [NAMEBUFSIZE];
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
- ACE_OS::memset (lname,
- '\0',
- NAMEBUFSIZE);
-
- if (this->ctx_->tdef ())
- {
- // Typedefed node.
- ACE_OS::sprintf (fname, "%s",
- node->full_name ());
- ACE_OS::sprintf (lname, "%s",
- node->local_name ()->get_string ());
- }
- else
- {
- // For anonymous arrays ...
- // we have to generate a name for us that has an underscope prepended to
- // our local name. This needs to be inserted after the parents's name.
- if (node->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- node->local_name ()->get_string ());
- ACE_OS::sprintf (lname,
- "_%s",
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- node->full_name ());
- ACE_OS::sprintf (lname,
- "_%s",
- node->local_name ()->get_string ());
- }
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Generate the array traits specialization definitions,
- // guarded by #ifdef on unaliased array element type and length.
-
- ACE_CString unique;
-
- if (nt == AST_Decl::NT_typedef)
- {
- be_typedef *td = be_typedef::narrow_from_decl (bt);
- unique = td->primitive_base_type ()->flat_name ();
- }
- else
- {
- unique = bt->flat_name ();
- }
-
- char buf[NAMEBUFSIZE];
- unsigned long i;
-
- for (i = 0; i < node->n_dims (); ++i)
- {
- ACE_OS::memset (buf,
- '\0',
- NAMEBUFSIZE);
- ACE_OS::sprintf (buf,
- "_%ld",
- node->dims ()[i]->ev ()->u.ulval);
- unique += buf;
- }
-
- unique += "_traits";
-
- *os << be_nl << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << "TAO::Array_Traits<" << fname << "_forany>::free ("
- << be_idt << be_idt_nl
- << fname << "_slice * _tao_slice" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << fname << "_free (_tao_slice);" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "ACE_INLINE" << be_nl
- << fname << "_slice *" << be_nl
- << "TAO::Array_Traits<" << fname << "_forany>::dup ("
- << be_idt << be_idt_nl
- << "const " << fname << "_slice * _tao_slice" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return " << fname << "_dup (_tao_slice);" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << "TAO::Array_Traits<" << fname << "_forany>::copy ("
- << be_idt << be_idt_nl
- << fname << "_slice * _tao_to," << be_nl
- << "const " << fname << "_slice * _tao_from" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << fname << "_copy (_tao_to, _tao_from);" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << "TAO::Array_Traits<" << fname << "_forany>::zero ("
- << be_idt << be_idt_nl
- << fname << "_slice * _tao_slice" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- unsigned long ndims = node->n_dims ();
- be_array *primitive_type = 0;
-
- if (bt->node_type () == AST_Decl::NT_typedef)
- {
- // Base type of the array node is a typedef. We need to make sure that
- // this typedef is not to another array type. If it is, then we cannot
- // assign an array to another. We will have to invoke the underlying
- // array type's copy method for every array dimension.
-
- // There may be more than one level of typedef.
- be_type *tmp = bt;
-
- while (tmp->node_type () == AST_Decl::NT_typedef)
- {
- be_typedef *tdef = be_typedef::narrow_from_decl (tmp);
- tmp = be_type::narrow_from_decl (tdef->base_type ());
- }
-
- primitive_type = be_array::narrow_from_decl (tmp);
- }
-
- *os << "// Zero each individual element." << be_nl;
-
- // Generate nested loops for as many dimensions as there are.
- for (i = 0; i < ndims; ++i)
- {
- // Retrieve the ith dimension value.
- AST_Expression *expr = node->dims ()[i];
-
- if ((expr == 0) || ((expr != 0) && (expr->ev () == 0)))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cs::"
- "visit_array - "
- "bad array dimension\n"),
- -1);
- }
-
- if (expr->ev ()->et == AST_Expression::EV_ulong)
- {
- // Generate a loop for each dimension.
- *os << "for ( ::CORBA::ULong i" << i << " = 0; i" << i << " < "
- << expr->ev ()->u.ulval << "; ++i" << i << ")" << be_idt_nl
- << "{" << be_idt_nl;
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cs::"
- "visit_array - "
- "bad array dimension value\n"),
- -1);
- }
- }
-
- if (primitive_type)
- {
- // The base type is a typedef to another array type, so
- // we use the base type's copy method.
- *os << "// call the underlying _zero" << be_nl;
-
- * os << "TAO::Array_Traits< ";
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_cs::"
- "visit_array - "
- "base type decl failed\n"),
- -1);
- }
-
- * os << "_forany";
-
- * os << ">::";
-
- *os << "zero (_tao_slice";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- *os << ");";
- }
- else
- {
- // The base type is not a typedef to possibly another array type. In
- // such a case, assign each element.
-
- *os << "_tao_slice";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- *os << " = ";
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_ch::"
- "visit_array - "
- "base type decl failed\n"),
- -1);
- }
-
- *os << " ();";
- }
-
- for (i = 0; i < ndims; ++i)
- {
- // Add closing braces as many times as the number of dimensions.
- *os << be_uidt_nl << "}" << be_uidt;
- }
- *os << be_uidt_nl << "}";
-
- *os << be_nl << be_nl
- << "ACE_INLINE" << be_nl
- << fname << "_slice *" << be_nl
- << "TAO::Array_Traits<" << fname << "_forany>::alloc (void)"
- << be_idt << be_uidt_nl
- << "{" << be_idt_nl
- << "return " << fname << "_alloc ();" << be_uidt_nl
- << "}";
-
- *os << be_nl;
-
- node->cli_inline_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp
deleted file mode 100644
index 0dd7f2a54d2..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp
+++ /dev/null
@@ -1,358 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// array_cs.cpp
-//
-// = DESCRIPTION
-// Visitor for code generation of Arrays in the client stubs
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_array,
- array_cs,
- "$Id$")
-
-// ************************************************************************
-// visitor for array declaration in client stubs
-// ************************************************************************
-
-be_visitor_array_cs::be_visitor_array_cs (be_visitor_context *ctx)
- : be_visitor_array (ctx)
-{
-}
-
-be_visitor_array_cs::~be_visitor_array_cs (void)
-{
-}
-
-int be_visitor_array_cs::visit_array (be_array *node)
-{
- // Nothing to do if we are imported or code is already generated.
- if (node->imported () || (node->cli_stub_gen ()))
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- unsigned long i;
- this->ctx_->node (node);
-
- // Retrieve the type.
- be_type *bt = be_type::narrow_from_decl (node->base_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_cs::"
- "visit_array - "
- "Bad base type\n"),
- -1);
- }
-
- // To hold the full and local.
- char fname [NAMEBUFSIZE];
- char lname [NAMEBUFSIZE];
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
- ACE_OS::memset (lname,
- '\0',
- NAMEBUFSIZE);
-
- if (this->ctx_->tdef ())
- {
- // Typedefed node.
- ACE_OS::sprintf (fname, "%s",
- node->full_name ());
- ACE_OS::sprintf (lname, "%s",
- node->local_name ()->get_string ());
- }
- else
- {
- // For anonymous arrays ...
- // we have to generate a name for us that has an underscope prepended to
- // our local name. This needs to be inserted after the parents's name.
- if (node->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- node->local_name ()->get_string ());
- ACE_OS::sprintf (lname,
- "_%s",
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- node->full_name ());
- ACE_OS::sprintf (lname,
- "_%s",
- node->local_name ()->get_string ());
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // dup method.
- *os << fname << "_slice *" << be_nl
- << fname << "_dup (const " << fname
- << "_slice *_tao_src_array)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << fname << "_slice *_tao_dup_array =" << be_idt_nl
- << fname << "_alloc ();" << be_uidt_nl << be_nl;
- *os << "if (!_tao_dup_array)" << be_idt_nl
- << "{" << be_idt_nl
- << "return static_cast <" << fname
- << "_slice *> (0);" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl;
- *os << fname << "_copy (_tao_dup_array, _tao_src_array);" << be_nl;
- *os << "return _tao_dup_array;" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- // alloc method.
- *os << fname << "_slice *" << be_nl;
- *os << fname << "_alloc (void)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << fname << "_slice *retval = 0;" << be_nl;
- *os << "ACE_NEW_RETURN (retval, ";
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_cs::"
- "visit_array - "
- "base type decl failed\n"),
- -1);
- }
-
- if (node->gen_dimensions (os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cs::"
- "visit_array - "
- "dimensions codegen failed\n"),
- -1);
- }
-
- *os << ", 0);" << be_nl;
- *os << "return retval;" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- // free method.
- *os << "void" << be_nl
- << fname << "_free (" << be_idt << be_idt_nl
- << fname << "_slice *_tao_slice" << be_uidt_nl
- << ")" << be_uidt_nl;
- *os << "{" << be_idt_nl;
- *os << "delete [] _tao_slice;" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- // copy method.
- *os << "void " << be_nl;
- *os << fname << "_copy (" << be_idt << be_idt_nl
- << fname << "_slice * _tao_to," << be_nl
- << "const " << fname << "_slice *_tao_from" << be_uidt_nl
- << ")" << be_uidt_nl;
- *os << "{" << be_idt_nl;
- *os << "// Copy each individual element." << be_nl;
-
- unsigned long ndims = node->n_dims ();
-
- // Generate nested loops for as many dimensions as there are.
- for (i = 0; i < ndims; ++i)
- {
- // Retrieve the ith dimension value.
- AST_Expression *expr = node->dims ()[i];
-
- if ((expr == 0) || ((expr != 0) && (expr->ev () == 0)))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cs::"
- "visit_array - "
- "bad array dimension\n"),
- -1);
- }
-
- if (expr->ev ()->et == AST_Expression::EV_ulong)
- {
- // Generate a loop for each dimension.
- *os << "for ( ::CORBA::ULong i" << i << " = 0; i" << i << " < "
- << expr->ev ()->u.ulval << "; ++i" << i << ")" << be_idt_nl
- << "{" << be_idt_nl;
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cs::"
- "visit_array - "
- "bad array dimension value\n"),
- -1);
- }
- }
-
- // Now generate code such that every element of the array gets assigned
- // inside the innermost level of the nested loops generated above.
- be_array *primitive_type = 0;
-
- if (bt->node_type () == AST_Decl::NT_typedef)
- {
- // Base type of the array node is a typedef. We need to make sure that
- // this typedef is not to another array type. If it is, then we cannot
- // assign an array to another. We will have to invoke the underlying
- // array type's copy method for every array dimension.
-
- // There may be more than one level of typedef.
- be_type *tmp = bt;
-
- while (tmp->node_type () == AST_Decl::NT_typedef)
- {
- be_typedef *tdef = be_typedef::narrow_from_decl (tmp);
- tmp = be_type::narrow_from_decl (tdef->base_type ());
- }
-
- primitive_type = be_array::narrow_from_decl (tmp);
- }
-
- if (primitive_type)
- {
- // The base type is a typedef to another array type, so
- // we use the base type's copy method.
- *os << "// call the underlying _copy" << be_nl;
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_cs::"
- "visit_array - "
- "base type decl failed\n"),
- -1);
- }
-
- *os << "_copy (_tao_to";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- *os << ", ";
- *os << "_tao_from";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- *os << ");";
- }
- else
- {
- // The base type is not a typedef to possibly another array type. In
- // such a case, assign each element.
-
- *os << "_tao_to";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- *os << " = ";
- *os << "_tao_from";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- *os << ";";
- }
-
- for (i = 0; i < ndims; ++i)
- {
- // Add closing braces as many times as the number of dimensions.
- *os << be_uidt_nl << "}" << be_uidt;
- }
-
- *os << be_uidt_nl << "}";
-
- AST_Decl::NodeType nt = bt->node_type ();
-
- // If we contain an anonymous sequence,
- // generate code for the sequence here.
- if (nt == AST_Decl::NT_sequence)
- {
- if (this->gen_anonymous_base_type (bt,
- TAO_CodeGen::TAO_ROOT_CS)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cs::"
- "visit_array - "
- "gen_anonymous_base_type failed\n"),
- -1);
- }
- }
-
- // If the member's element type
- // is a declaration (not a reference), we must generate code for
- // the declaration.
- if (this->ctx_->alias () == 0 // Not a typedef.
- && bt->is_child (this->ctx_->scope ()))
- {
- int status = 0;
- be_visitor_context ctx (*this->ctx_);
-
- switch (nt)
- {
- case AST_Decl::NT_enum:
- {
- be_visitor_enum_cs ec_visitor (&ctx);
- status = bt->accept (&ec_visitor);
- break;
- }
- case AST_Decl::NT_struct:
- {
- be_visitor_structure_cs sc_visitor (&ctx);
- status = bt->accept (&sc_visitor);
- break;
- }
- case AST_Decl::NT_union:
- {
- be_visitor_union_cs uc_visitor (&ctx);
- status = bt->accept (&uc_visitor);
- break;
- }
- default:
- break;
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_ch::"
- "visit_array - "
- "array base type codegen failed\n"),
- -1);
- }
- }
-
- node->cli_stub_gen (true);
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp
deleted file mode 100644
index f8dc7f1965e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor for code generation of Arrays for the Cdr operators in the client
-// header.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_visitor_sequence/cdr_op_ch.h"
-
-ACE_RCSID (be_visitor_array,
- cdr_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Array visitor for generating CDR operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_array_cdr_op_ch::be_visitor_array_cdr_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_array_cdr_op_ch::~be_visitor_array_cdr_op_ch (void)
-{
-}
-
-int
-be_visitor_array_cdr_op_ch::visit_array (be_array *node)
-{
- if (node->cli_hdr_cdr_op_gen () || node->imported () || node->is_local ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_type *bt = be_type::narrow_from_decl (node->base_type ());
- AST_Decl::NodeType nt = bt->node_type ();
-
- // If the node is an array of anonymous sequence, we need to
- // generate the sequence's cdr operator declaration here.
- if (nt == AST_Decl::NT_sequence && bt->anonymous ())
- {
- be_visitor_sequence_cdr_op_ch visitor (this->ctx_);
-
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_cdr_op_ch::"
- "visit_array - "
- "accept on anonymous base type failed\n"),
- -1);
- }
- }
-
- // If the array is an anonymous member and if its element type
- // is a declaration (not a reference), we must generate code for
- // the declaration.
- if (this->ctx_->alias () == 0 && // Not a typedef.
- bt->is_child (this->ctx_->scope ()))
- {
- int status = 0;
- be_visitor_context ctx (*this->ctx_);
-
- switch (nt)
- {
- case AST_Decl::NT_enum:
- {
- be_visitor_enum_cdr_op_ch ec_visitor (&ctx);
- status = bt->accept (&ec_visitor);
- break;
- }
- case AST_Decl::NT_struct:
- {
- be_visitor_structure_cdr_op_ch sc_visitor (&ctx);
- status = bt->accept (&sc_visitor);
- break;
- }
- case AST_Decl::NT_union:
- {
- be_visitor_union_cdr_op_ch uc_visitor (&ctx);
- status = bt->accept (&uc_visitor);
- break;
- }
- default:
- break;
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_ch::"
- "visit_array - "
- "array base type codegen failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Generate the CDR << and >> operator declarations.
- *os << be_global->stub_export_macro () << " CORBA::Boolean"
- << " operator<< (TAO_OutputCDR &strm, const ";
-
- if (!this->ctx_->tdef ())
- {
- be_scope* scope = be_scope::narrow_from_scope (node->defined_in ());
- be_decl* parent = scope->decl ();
-
- *os << parent->full_name ()
- << "::_" << node->local_name ()
- << "_forany &_tao_array);" << be_nl;
- }
- else
- {
- *os << node->name () << "_forany &_tao_array);" << be_nl;
- }
-
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator>> (TAO_InputCDR &, ";
-
- if (!this->ctx_->tdef ())
- {
- be_scope* scope = be_scope::narrow_from_scope (node->defined_in ());
- be_decl* parent = scope->decl ();
-
- *os << parent->full_name ()
- << "::_" << node->local_name ()
- << "_forany &);";
- }
- else
- {
- *os << node->name () << "_forany &);";
- }
-
- *os << be_nl << be_global->core_versioning_end ();
-
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp
deleted file mode 100644
index 262dce2236d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp
+++ /dev/null
@@ -1,795 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor for code generation of Arrays for the CDR operators in the client
-// stubs.
-//
-// = AUTHOR
-// Jeff Parsons <parsons@cs.wustl.edu>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_array,
- cdr_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Array visitor for generating CDR operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_array_cdr_op_cs::be_visitor_array_cdr_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_array_cdr_op_cs::~be_visitor_array_cdr_op_cs (void)
-{
-}
-
-int
-be_visitor_array_cdr_op_cs::visit_array (be_array *node)
-{
- if (this->ctx_->alias ())
- {
- // We are here because we are visiting base type
- // of the array node which is itself an
- // array, i.e., this is a case of array of array.
- return this->visit_node (node);
- }
-
- if (node->cli_stub_cdr_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- // Retrieve the base type.
- be_type *bt = be_type::narrow_from_decl (node->base_type ());
- AST_Decl::NodeType nt = bt->node_type ();
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_array - "
- "Bad base type\n"),
- -1);
- }
-
- // If we contain an anonymous sequence,
- // generate code for the sequence here.
-
- if (nt == AST_Decl::NT_sequence)
- {
- if (this->gen_anonymous_base_type (bt,
- TAO_CodeGen::TAO_ROOT_CDR_OP_CS)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_array - "
- "gen_anonymous_base_type failed\n"),
- -1);
- }
- }
-
- // If the array is an anonymous member and if its element type
- // is a declaration (not a reference), we must generate code for
- // the declaration.
- if (this->ctx_->alias () == 0 // Not a typedef.
- && bt->is_child (this->ctx_->scope ()))
- {
- int status = 0;
- be_visitor_context ctx (*this->ctx_);
-
- switch (nt)
- {
- case AST_Decl::NT_enum:
- {
- be_visitor_enum_cdr_op_cs ec_visitor (&ctx);
- status = bt->accept (&ec_visitor);
- break;
- }
- case AST_Decl::NT_struct:
- {
- be_visitor_structure_cdr_op_cs sc_visitor (&ctx);
- status = bt->accept (&sc_visitor);
- break;
- }
- case AST_Decl::NT_union:
- {
- be_visitor_union_cdr_op_cs uc_visitor (&ctx);
- status = bt->accept (&uc_visitor);
- break;
- }
- default:
- break;
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_ch::"
- "visit_array - "
- "array base type codegen failed\n"),
- -1);
- }
- }
-
- // For anonymous arrays, the type name has a _ prepended. We compute the
- // full_name with or without the underscore and use it later on.
- char fname [NAMEBUFSIZE]; // to hold the full and
-
- // Save the node's local name and full name in a buffer for quick use later
- // on.
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (this->ctx_->tdef ())
- {
- ACE_OS::sprintf (fname, "%s", node->full_name ());
- }
- else
- {
- // For anonymous arrays ...
- // We have to generate a name for us that has an underscope prepended
- // to our local name. This needs to be inserted after the parents's
- // name.
-
- if (node->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- node->full_name ());
- }
- }
-
- // Generate the CDR << and >> operator defns.
-
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Set the sub state as generating code for the output operator.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
- *os << "::CORBA::Boolean operator<< (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &strm," << be_nl
- << "const " << fname << "_forany &_tao_array" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_cdr_op_cs::"
- "visit_array - "
- "Base type codegen failed\n"),
- -1);
- }
-
- *os << "}" << be_nl << be_nl;
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- *os << "::CORBA::Boolean operator>> (" << be_idt << be_idt_nl
- << "TAO_InputCDR &strm," << be_nl
- << fname << "_forany &_tao_array" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_cdr_op_cs::"
- "visit_array - "
- "Base type codegen failed\n"),
- -1);
- }
-
- *os << "}";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_stub_cdr_op_gen (1);
- return 0;
-}
-
-// Handle all the base types.
-
-int
-be_visitor_array_cdr_op_cs::visit_enum (be_enum *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_cs::visit_interface (be_interface *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_cs::visit_valuebox (be_valuebox *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_cs::visit_valuetype (be_valuetype *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_cs::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- case AST_PredefinedType::PT_value:
- case AST_PredefinedType::PT_any:
- // Let the helper handle this.
- return this->visit_node (node);
- case AST_PredefinedType::PT_void:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_predefined_type - "
- "Bad primitive type\n"),
- -1);
- default:
- // All other primitive types. Handle them as shown below.
- break;
- };
-
- // We get here if the "type" of individual elements of the array is a
- // primitive type. In this case, we treat the array as a single dimensional
- // array (even though it was multi-dimensional), and pass the total length
- // of the array as a cross product of the dimensions.
-
- unsigned long i;
-
- // Grab the array node.
- be_array *array = this->ctx_->be_node_as_array ();
-
- if (!node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_predefined_type - "
- "bad array node\n"),
- -1);
- }
-
- // We generate optimized code based on an optimized interface available from
- // the CDR class. These optimizations are applicable only to primitive
- // types.
- *os << "return" << be_idt_nl
- << "strm.";
-
- // Based on our substate, we may be reading from a stream or writing into a
- // stream.
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "read_";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "write_";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_predefined_type - "
- "bad sub state\n"),
- -1);
- }
-
- // Determine what kind of array are we reading/writing.
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_long:
- *os << "long_array";
- break;
- case AST_PredefinedType::PT_ulong:
- *os << "ulong_array";
- break;
- case AST_PredefinedType::PT_short:
- *os << "short_array";
- break;
- case AST_PredefinedType::PT_ushort:
- *os << "ushort_array";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "octet_array";
- break;
- case AST_PredefinedType::PT_char:
- *os << "char_array";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "wchar_array";
- break;
- case AST_PredefinedType::PT_float:
- *os << "float_array";
- break;
- case AST_PredefinedType::PT_double:
- *os << "double_array";
- break;
- case AST_PredefinedType::PT_longlong:
- *os << "longlong_array";
- break;
- case AST_PredefinedType::PT_ulonglong:
- *os << "ulonglong_array";
- break;
- case AST_PredefinedType::PT_longdouble:
- *os << "longdouble_array";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "boolean_array";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_predefined_type - "
- "bad primitive type for optimized code gen\n"),
- -1);
- }
-
- // Handle special case to avoid compiler errors.
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << " (" << be_idt << be_idt_nl
- << "reinterpret_cast <";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << " (" << be_idt << be_idt_nl
- << "reinterpret_cast <const ";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_predefined_type - "
- "bad substate in context\n"),
- -1);
- }
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_long:
- *os << "ACE_CDR::Long";
- break;
- case AST_PredefinedType::PT_ulong:
- *os << "ACE_CDR::ULong";
- break;
- case AST_PredefinedType::PT_short:
- *os << "ACE_CDR::Short";
- break;
- case AST_PredefinedType::PT_ushort:
- *os << "ACE_CDR::UShort";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "ACE_CDR::Octet";
- break;
- case AST_PredefinedType::PT_char:
- *os << "ACE_CDR::Char";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "ACE_CDR::WChar";
- break;
- case AST_PredefinedType::PT_float:
- *os << "ACE_CDR::Float";
- break;
- case AST_PredefinedType::PT_double:
- *os << "ACE_CDR::Double";
- break;
- case AST_PredefinedType::PT_longlong:
- *os << "ACE_CDR::LongLong";
- break;
- case AST_PredefinedType::PT_ulonglong:
- *os << "ACE_CDR::ULongLong";
- break;
- case AST_PredefinedType::PT_longdouble:
- *os << "ACE_CDR::LongDouble";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "ACE_CDR::Boolean";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_predefined_type - "
- "bad primitive type for optimized code gen\n"),
- -1);
- }
-
- // Handle special case to avoid compiler errors.
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << " *> (_tao_array.out ())," << be_nl;
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << " *> (_tao_array.in ())," << be_nl;
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_predefined_type - "
- "bad substate in context\n"),
- -1);
- }
-
- unsigned long ndims = array->n_dims ();
-
- // Generate a product of all the dimensions. This will be the total length
- // of the "unfolded" single dimensional array.
- for (i = 0; i < ndims; ++i)
- {
- // Retrieve the ith dimension value.
- AST_Expression *expr = array->dims ()[i];
-
- if ((expr == 0) || ((expr != 0) && (expr->ev () == 0)))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_predefined_type - "
- "bad array dimension\n"),
- -1);
- }
-
- if (i != 0)
- {
- // Do not generate the multiplication operator the first time in.
- *os << "*";
- }
-
- if (expr->ev ()->et == AST_Expression::EV_ulong)
- {
- // Generate a loop for each dimension.
- *os << expr->ev ()->u.ulval;
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_predefined_type - "
- "bad array dimension value\n"),
- -1);
- }
- }
-
- *os << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_array_cdr_op_cs::visit_sequence (be_sequence *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_cs::visit_string (be_string *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_cs::visit_structure (be_structure *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_cs::visit_union (be_union *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- // The node to be visited in the base primitve type that gets typedefed.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-// Helper.
-int
-be_visitor_array_cdr_op_cs::visit_node (be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- unsigned long i;
- be_array *node = this->ctx_->be_node_as_array ();
- AST_Decl::NodeType nt = bt->node_type ();
-
- if (!node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_node - "
- "bad array node\n"),
- -1);
- }
-
- // Initialize a boolean variable.
- *os << "CORBA::Boolean _tao_marshal_flag = true;" << be_nl;
-
- unsigned long ndims = node->n_dims ();
-
- // We get here if the "type" of individual elements of the array is not a
- // primitive type. In this case, we are left with no other alternative but to
- // encode/decode element by element.
-
- // generate nested loops for as many dimensions as there are
- for (i = 0; i < ndims; ++i)
- {
- // Retrieve the ith dimension value.
- AST_Expression *expr = node->dims ()[i];
-
- if ((expr == 0) || ((expr != 0) && (expr->ev () == 0)))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_node - "
- "bad array dimension\n"),
- -1);
- }
-
- if (expr->ev ()->et == AST_Expression::EV_ulong)
- {
- // Generate a loop for each dimension.
- *os << be_nl << "for ( ::CORBA::ULong i" << i
- << " = 0; i" << i << " < "
- << expr->ev ()->u.ulval << " && _tao_marshal_flag; ++i" << i
- << ")" << be_idt_nl
- << "{" << be_idt;
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_node - "
- "bad array dimension value\n"),
- -1);
- }
- }
-
- // @@ (JP) Need to factor out some of this into method call(s).
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << be_nl;
-
- // Handle the array of array case, where we need to pass the
- // forany type.
- if (nt == AST_Decl::NT_array)
- {
- *os << bt->name () << "_forany tmp ("
- << bt->name () << "_alloc ());" << be_nl;
- *os << "_tao_marshal_flag = (strm >> tmp);" << be_nl;
- *os << bt->name () << "_copy (_tao_array";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- *os << ", tmp.in ());" << be_nl;
- *os << bt->name () << "_free (tmp.inout ());";
- }
- else
- {
- *os << "_tao_marshal_flag = (strm >> ";
- *os << "_tao_array ";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- switch (bt->node_type ())
- {
- // The following have a _var type and must be
- // handled in a special way.
- case AST_Decl::NT_string:
- case AST_Decl::NT_wstring:
- case AST_Decl::NT_valuetype:
- case AST_Decl::NT_valuetype_fwd:
- case AST_Decl::NT_valuebox:
- *os << ".out ()";
- break;
- case AST_Decl::NT_pre_defined:
- {
- // We need to separately handle this case of pseudo
- // objects because they have a _var type.
- be_predefined_type *pt =
- be_predefined_type::narrow_from_decl (bt);
-
- if (!pt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_node - "
- "bad predefined type node\n"),
- -1);
- }
-
- AST_PredefinedType::PredefinedType pdt = pt->pt ();
-
- if (pdt == AST_PredefinedType::PT_pseudo
- || pdt == AST_PredefinedType::PT_object)
- {
- *os << ".out ()";
- }
- }
- default:
- break;
- }
-
- *os << ");";
- }
-
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << be_nl;
-
- // Handle the array of array case, where we need to pass the
- // forany type.
- if (nt == AST_Decl::NT_array)
- {
- *os << bt->name () << "_var tmp_var ("
- << bt->name () << "_dup (_tao_array";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- *os << "));" << be_nl;
- *os << bt->name () << "_forany tmp (tmp_var.inout ());" << be_nl;
- *os << "_tao_marshal_flag = (strm << tmp);";
- }
- else if (nt == AST_Decl::NT_interface
- || nt == AST_Decl::NT_interface_fwd)
- {
- *os << "_tao_marshal_flag = " << be_idt_nl
- << "TAO::Objref_Traits<" << bt->name () << ">::"
- << "marshal (_tao_array";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- *os << ".in (), strm);" << be_uidt;
- }
- else
- {
- *os << "_tao_marshal_flag = (strm << ";
- *os << "_tao_array ";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- switch (bt->node_type ())
- {
- // The following have a _var type and must be
- // handled in a special way.
- case AST_Decl::NT_string:
- case AST_Decl::NT_wstring:
- case AST_Decl::NT_valuetype:
- case AST_Decl::NT_valuetype_fwd:
- case AST_Decl::NT_valuebox:
- *os << ".in ()";
- break;
- case AST_Decl::NT_pre_defined:
- {
- // We need to separately handle this case of pseudo
- // objects because they have a _var type.
- be_predefined_type *pt =
- be_predefined_type::narrow_from_decl (bt);
-
- if (!pt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_node - "
- "bad predefined type node\n"),
- -1);
- }
-
- AST_PredefinedType::PredefinedType pdt = pt->pt ();
-
- if (pdt == AST_PredefinedType::PT_pseudo
- || pdt == AST_PredefinedType::PT_object)
- {
- *os << ".in ()";
- }
- }
- default:
- break;
- }
-
- *os << ");";
- }
-
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_node - "
- "bad sub state\n"),
- -1);
- }
-
- for (i = 0; i < ndims; ++i)
- {
- // Decrement indentation as many times as the number of dimensions.
- *os << be_uidt_nl << "}" << be_uidt;
- }
-
- *os << be_nl << be_nl << "return _tao_marshal_flag;" << be_uidt_nl;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_array/serializer_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_array/serializer_op_ch.cpp
deleted file mode 100644
index b08bb5db5bf..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/serializer_op_ch.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor for code generation of Arrays for the
-// TAO::DCPS::Serializer operators in the client header.
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_visitor_sequence/serializer_op_ch.h"
-
-ACE_RCSID (be_visitor_array,
- serializer_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Array visitor for generating Serializer operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_array_serializer_op_ch::be_visitor_array_serializer_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_array_serializer_op_ch::~be_visitor_array_serializer_op_ch (void)
-{
-}
-
-
-void
-be_visitor_array_serializer_op_ch::gen_arg_ref(be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (!this->ctx_->tdef ())
- {
- be_scope* scope = be_scope::narrow_from_scope (node->defined_in ());
- be_decl* parent = scope->decl ();
-
- *os << parent->full_name ()
- << "::_" << node->local_name ()
- << "_forany &);" << be_nl;
- }
- else
- {
- *os << node->name () << "_forany &);" << be_nl;
- }
-}
-
-int
-be_visitor_array_serializer_op_ch::visit_array (be_array *node)
-{
- if (node->cli_hdr_serializer_op_gen () || node->imported () || node->is_local ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_type *bt = be_type::narrow_from_decl (node->base_type ());
- AST_Decl::NodeType nt = bt->node_type ();
-
- // If the node is an array of anonymous sequence, we need to
- // generate the sequence's Serializer operator declaration here.
- if (nt == AST_Decl::NT_sequence && bt->anonymous ())
- {
- be_visitor_sequence_serializer_op_ch visitor (this->ctx_);
-
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_serializer_op_ch::"
- "visit_array - "
- "accept on anonymous base type failed\n"),
- -1);
- }
- }
-
- // If the array is an anonymous member and if its element type
- // is a declaration (not a reference), we must generate code for
- // the declaration.
- if (this->ctx_->alias () == 0 // Not a typedef.
- && bt->is_child (this->ctx_->scope ()))
- {
- int status = 0;
- be_visitor_context ctx (*this->ctx_);
-
- switch (nt)
- {
- case AST_Decl::NT_enum:
- {
- be_visitor_enum_serializer_op_ch ec_visitor (&ctx);
- status = bt->accept (&ec_visitor);
- break;
- }
- case AST_Decl::NT_struct:
- {
- be_visitor_structure_serializer_op_ch sc_visitor (&ctx);
- status = bt->accept (&sc_visitor);
- break;
- }
- case AST_Decl::NT_union:
- {
- be_visitor_union_serializer_op_ch uc_visitor (&ctx);
- status = bt->accept (&uc_visitor);
- break;
- }
- default:
- break;
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_ch::"
- "visit_array - "
- "array base type codegen failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Set the sub state as generating code for the size method
- *os << be_global->stub_export_macro ()
- << " size_t _dcps_max_marshaled_size ("
- << "const ";
- this->gen_arg_ref(node);
-
- *os << be_global->stub_export_macro ()
- << " ::CORBA::Boolean _tao_is_bounded_size ("
- << "const ";
- this->gen_arg_ref(node);
-
- *os << be_global->stub_export_macro ()
- << " size_t _dcps_find_size ("
- << "const ";
- this->gen_arg_ref(node);
-
- // Generate the Serializer << and >> operator declarations.
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator<< (TAO::DCPS::Serializer &, const ";
- this->gen_arg_ref(node);
-
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator>> (TAO::DCPS::Serializer &, ";
- this->gen_arg_ref(node);
-
- node->cli_hdr_serializer_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_array/serializer_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/serializer_op_cs.cpp
deleted file mode 100644
index e5e8505c325..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/serializer_op_cs.cpp
+++ /dev/null
@@ -1,1227 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor for code generation of Arrays for the
-// TAO::DCPS::Serializer operators in the client stubs.
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by
-// Jeff Parsons <parsons@cs.wustl.edu>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_array,
- serializer_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Array visitor for generating Serializer operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_array_serializer_op_cs::be_visitor_array_serializer_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_array_serializer_op_cs::~be_visitor_array_serializer_op_cs (void)
-{
-}
-
-int
-be_visitor_array_serializer_op_cs::visit_array (be_array *node)
-{
- if (this->ctx_->alias ())
- {
- // We are here because we are visiting base type
- // of the array node which is itself an
- // array, i.e., this is a case of array of array.
- return this->visit_node (node);
- }
-
- if (node->cli_stub_serializer_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- // Retrieve the base type.
- be_type *bt = be_type::narrow_from_decl (node->base_type ());
- AST_Decl::NodeType nt = bt->node_type ();
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_array - "
- "Bad base type\n"),
- -1);
- }
-
- // If we contain an anonymous sequence,
- // generate code for the sequence here.
-
- if (nt == AST_Decl::NT_sequence)
- {
- if (this->gen_anonymous_base_type (bt,
- TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_array - "
- "gen_anonymous_base_type failed\n"),
- -1);
- }
- }
-
- // If the array is an anonymous member and if its element type
- // is a declaration (not a reference), we must generate code for
- // the declaration.
- if (this->ctx_->alias () == 0 // Not a typedef.
- && bt->is_child (this->ctx_->scope ()))
- {
- int status = 0;
- be_visitor_context ctx (*this->ctx_);
-
- switch (nt)
- {
- case AST_Decl::NT_enum:
- {
- be_visitor_enum_serializer_op_cs ec_visitor (&ctx);
- status = bt->accept (&ec_visitor);
- break;
- }
- case AST_Decl::NT_struct:
- {
- be_visitor_structure_serializer_op_cs sc_visitor (&ctx);
- status = bt->accept (&sc_visitor);
- break;
- }
- case AST_Decl::NT_union:
- {
- be_visitor_union_serializer_op_cs uc_visitor (&ctx);
- status = bt->accept (&uc_visitor);
- break;
- }
- default:
- break;
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_ch::"
- "visit_array - "
- "array base type codegen failed\n"),
- -1);
- }
- }
-
- // For anonymous arrays, the type name has a _ prepended. We compute the
- // full_name with or without the underscore and use it later on.
- char fname [NAMEBUFSIZE]; // to hold the full and
-
- // Save the node's local name and full name in a buffer for quick use later
- // on.
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (this->ctx_->tdef ())
- {
- ACE_OS::sprintf (fname, "%s", node->full_name ());
- }
- else
- {
- // For anonymous arrays ...
- // We have to generate a name for us that has an underscope prepended
- // to our local name. This needs to be inserted after the parents's
- // name.
-
- if (node->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- node->full_name ());
- }
- }
-
- // Generate the Serializer << and >> operator defns.
-
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Set the sub state as generating code for the size method
- this->ctx_->sub_state (TAO_CodeGen::TAO_MAX_MARSHALED_SIZE);
- *os << "size_t _dcps_max_marshaled_size (" << be_idt << be_idt_nl
- << "const " << fname << "_forany &_tao_array" << be_uidt_nl
- <<")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_serializer_op_cs::"
- "visit_array - "
- "Base type codegen failed\n"),
- -1);
- }
-
- *os << "}" << be_nl << be_nl;
-
- // Set the sub state as generating code for the size method
- this->ctx_->sub_state (TAO_CodeGen::TAO_IS_BOUNDED_SIZE);
- *os << "::CORBA::Boolean _tao_is_bounded_size (" << be_idt << be_idt_nl
- << "const " << fname << "_forany &_tao_array" << be_uidt_nl
- <<")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_serializer_op_cs::"
- "visit_array - "
- "Base type codegen failed\n"),
- -1);
- }
-
- *os << "}" << be_nl << be_nl;
-
- // Set the sub state as generating code for the size method
- this->ctx_->sub_state (TAO_CodeGen::TAO_FIND_SIZE);
- *os << "size_t _dcps_find_size (" << be_idt << be_idt_nl
- << "const " << fname << "_forany &_tao_array" << be_uidt_nl
- <<")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_serializer_op_cs::"
- "visit_array - "
- "Base type codegen failed\n"),
- -1);
- }
-
- *os << "}" << be_nl << be_nl;
-
-
- // Set the sub state as generating code for the output operator.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
- *os << "::CORBA::Boolean operator<< (" << be_idt << be_idt_nl
- << "TAO::DCPS::Serializer &strm," << be_nl
- << "const " << fname << "_forany &_tao_array" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_serializer_op_cs::"
- "visit_array - "
- "Base type codegen failed\n"),
- -1);
- }
-
- *os << "}" << be_nl << be_nl;
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- *os << "::CORBA::Boolean operator>> (" << be_idt << be_idt_nl
- << "TAO::DCPS::Serializer &strm," << be_nl
- << fname << "_forany &_tao_array" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_serializer_op_cs::"
- "visit_array - "
- "Base type codegen failed\n"),
- -1);
- }
-
- *os << "}";
-
- node->cli_stub_serializer_op_gen (1);
- return 0;
-}
-
-// Handle all the base types.
-
-int
-be_visitor_array_serializer_op_cs::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- unsigned long i;
-
- // Grab the array node.
- be_array *array = this->ctx_->be_node_as_array ();
-
- if (!node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "bad array node\n"),
- -1);
- }
-
- // Check what is the code generation substate. Are we generating
- // code for the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- *os << "ACE_UNUSED_ARG (_tao_array);" << be_nl
- << "return true; // array of enum" << be_uidt_nl;
- break;
- case TAO_CodeGen::TAO_FIND_SIZE:
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- {
- *os << "ACE_UNUSED_ARG (_tao_array);" << be_nl;
- *os << "// array of enum = sizeof ( ::CORBA::ULong) * array size" << be_nl
- << "return _dcps_max_marshaled_size_ulong () * ";
-
- unsigned long ndims = array->n_dims ();
-
- // Generate a product of all the dimensions. This will be the total length
- // of the "unfolded" single dimensional array.
- for (i = 0; i < ndims; ++i)
- {
- // Retrieve the ith dimension value.
- AST_Expression *expr = array->dims ()[i];
-
- if ((expr == 0) || ((expr != 0) && (expr->ev () == 0)))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "bad array dimension\n"),
- -1);
- }
-
- if (i != 0)
- {
- // Do not generate the multiplication operator the first time in.
- *os << "*";
- }
-
- if (expr->ev ()->et == AST_Expression::EV_ulong)
- {
- // Generate a loop for each dimension.
- *os << expr->ev ()->u.ulval;
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "bad array dimension value\n"),
- -1);
- }
- }
-
- *os << ";" << be_uidt_nl;
- }
- break;
-
- default:
- return this->visit_node (node);
- }
- return 0;
-}
-
-int
-be_visitor_array_serializer_op_cs::visit_interface (be_interface *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_serializer_op_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_serializer_op_cs::visit_valuetype (be_valuetype *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_serializer_op_cs::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_serializer_op_cs::visit_predefined_type (
- be_predefined_type *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- case AST_PredefinedType::PT_value:
- case AST_PredefinedType::PT_any:
- // Let the helper handle this.
- return this->visit_node (node);
- case AST_PredefinedType::PT_void:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "Bad primitive type\n"),
- -1);
- default:
- // All other primitive types. Handle them as shown below.
- break;
- };
-
- // We get here if the "type" of individual elements of the array is a
- // primitive type. In this case, we treat the array as a single dimensional
- // array (even though it was multi-dimensional), and pass the total length
- // of the array as a cross product of the dimensions.
-
- unsigned long i;
-
- // Grab the array node.
- be_array *array = this->ctx_->be_node_as_array ();
-
- if (!node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "bad array node\n"),
- -1);
- }
-
- // Check what is the code generation substate. Are we generating
- // code for the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- // all predefined types are fixed size hence they are bounded.
- *os << "ACE_UNUSED_ARG(_tao_array);" << be_nl;
- *os << "return true;" << be_uidt_nl;
- return 0; // all done - no need to get the array size
- break;
-
- // all predefined types are fixed size so
- // _dcps_find_size() = _dcps_max_marshaled_size
- case TAO_CodeGen::TAO_FIND_SIZE:
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_octet:
- *os << "ACE_UNUSED_ARG(_tao_array);" << be_nl;
- *os << "return (_dcps_max_marshaled_size_octet () *";
- break;
- case AST_PredefinedType::PT_char:
- *os << "ACE_UNUSED_ARG(_tao_array);" << be_nl;
- *os << "return (_dcps_max_marshaled_size_char () *";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "ACE_UNUSED_ARG(_tao_array);" << be_nl;
- *os << "return (_dcps_max_marshaled_size_wchar () *";
- break;
- case AST_PredefinedType::PT_long:
- case AST_PredefinedType::PT_ulong:
- case AST_PredefinedType::PT_short:
- case AST_PredefinedType::PT_ushort:
- case AST_PredefinedType::PT_float:
- case AST_PredefinedType::PT_double:
- case AST_PredefinedType::PT_longlong:
- case AST_PredefinedType::PT_ulonglong:
- case AST_PredefinedType::PT_longdouble:
- // array size = slice type size * length
- // note: *(_tao_array.in ()) is the array's slice; hence base type
- *os << "return (_dcps_max_marshaled_size (*(_tao_array.in ())) * ";
- break;
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "ACE_UNUSED_ARG(_tao_array);" << be_nl;
- *os << "return (_dcps_max_marshaled_size_boolean () *";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "bad primitive type for _dcps_max_marshaled_size code gen\n"),
- -1);
- }
- break;
-
- case TAO_CodeGen::TAO_CDR_INPUT:
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- {
- // We generate optimized code based on an optimized interface available from
- // the Serializer class. These optimizations are applicable only to primitive
- // types.
- *os << " return strm.";
-
- // Based on our substate, we may be reading from a stream or writing into a
- // stream.
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "read_";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "write_";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "bad sub state\n"),
- -1);
- }
-
- // Determine what kind of array are we reading/writing.
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_long:
- *os << "long_array";
- break;
- case AST_PredefinedType::PT_ulong:
- *os << "ulong_array";
- break;
- case AST_PredefinedType::PT_short:
- *os << "short_array";
- break;
- case AST_PredefinedType::PT_ushort:
- *os << "ushort_array";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "octet_array";
- break;
- case AST_PredefinedType::PT_char:
- *os << "char_array";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "wchar_array";
- break;
- case AST_PredefinedType::PT_float:
- *os << "float_array";
- break;
- case AST_PredefinedType::PT_double:
- *os << "double_array";
- break;
- case AST_PredefinedType::PT_longlong:
- *os << "longlong_array";
- break;
- case AST_PredefinedType::PT_ulonglong:
- *os << "ulonglong_array";
- break;
- case AST_PredefinedType::PT_longdouble:
- *os << "longdouble_array";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "boolean_array";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "bad primitive type for optimized code gen\n"),
- -1);
- }
-
- // Handle special case to avoid compiler errors.
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << " ((";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << " ((const ";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "bad substate in context\n"),
- -1);
- }
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_long:
- *os << "ACE_CDR::Long *)";
- break;
- case AST_PredefinedType::PT_ulong:
- *os << "ACE_CDR::ULong *)";
- break;
- case AST_PredefinedType::PT_short:
- *os << "ACE_CDR::Short *)";
- break;
- case AST_PredefinedType::PT_ushort:
- *os << "ACE_CDR::UShort *)";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "ACE_CDR::Octet *)";
- break;
- case AST_PredefinedType::PT_char:
- *os << "ACE_CDR::Char *)";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "ACE_CDR::WChar *)";
- break;
- case AST_PredefinedType::PT_float:
- *os << "ACE_CDR::Float *)";
- break;
- case AST_PredefinedType::PT_double:
- *os << "ACE_CDR::Double *)";
- break;
- case AST_PredefinedType::PT_longlong:
- *os << "ACE_CDR::LongLong *)";
- break;
- case AST_PredefinedType::PT_ulonglong:
- *os << "ACE_CDR::ULongLong *)";
- break;
- case AST_PredefinedType::PT_longdouble:
- *os << "ACE_CDR::LongDouble *)";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "ACE_CDR::Boolean *)";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "bad primitive type for optimized code gen\n"),
- -1);
- }
-
- // Handle special case to avoid compiler errors.
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << " _tao_array.out (), ";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "_tao_array.in (), ";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "bad substate in context\n"),
- -1);
- }
- } // end TAO_CDR_INPUT/OUTPUT specific code.
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // This is done in serializer_op_cs and hacked into *.i.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "bad sub state\n"),
- -1);
- }
-
- unsigned long ndims = array->n_dims ();
-
- // Generate a product of all the dimensions. This will be the total length
- // of the "unfolded" single dimensional array.
- for (i = 0; i < ndims; ++i)
- {
- // Retrieve the ith dimension value.
- AST_Expression *expr = array->dims ()[i];
-
- if ((expr == 0) || ((expr != 0) && (expr->ev () == 0)))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "bad array dimension\n"),
- -1);
- }
-
- if (i != 0)
- {
- // Do not generate the multiplication operator the first time in.
- *os << "*";
- }
-
- if (expr->ev ()->et == AST_Expression::EV_ulong)
- {
- // Generate a loop for each dimension.
- *os << expr->ev ()->u.ulval;
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "bad array dimension value\n"),
- -1);
- }
- }
-
- *os << ");" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_array_serializer_op_cs::visit_sequence (be_sequence *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_serializer_op_cs::visit_string (be_string *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_serializer_op_cs::visit_structure (be_structure *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_serializer_op_cs::visit_union (be_union *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_serializer_op_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- // The node to be visited in the base primitve type that gets typedefed.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-// Helper.
-int
-be_visitor_array_serializer_op_cs::visit_node (be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- unsigned long i;
- be_array *node = this->ctx_->be_node_as_array ();
- AST_Decl::NodeType nt = bt->node_type ();
-
- if (!node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_node - "
- "bad array node\n"),
- -1);
- }
-
- unsigned long ndims = node->n_dims ();
-
- AST_Decl::NodeType bnt = bt->node_type ();
-
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- switch (bnt)
- {
- case AST_Decl::NT_string:
- case AST_Decl::NT_wstring:
- {
- be_string *str =
- be_string::narrow_from_decl (bt);
-
- if (!str)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_node - "
- "bad string node\n"),
- -1);
- }
-
- *os << "ACE_UNUSED_ARG(_tao_array);" << be_nl;
- if (0 == str->max_size ()->ev ()->u.ulval)
- *os << "return false; // array of unbounded string";
- else
- *os << "return true; // array of bounded string ";
- }
- break;
- case AST_Decl::NT_array:
- *os << "// use ULong instead of literal to avoid overload ambiguity"
- << be_nl << "::CORBA::ULong first = 0;" << be_nl
- << "// must use forany instead of a slice to avoid overload ambiguity"
- << be_nl
- << bt->name () << "_var tmp_var ("
- << bt->name () << "_dup (_tao_array";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[first]";
- }
-
- *os << "));" << be_nl;
- *os << bt->name () << "_forany tmp (tmp_var.inout ());" << be_nl;
- *os << "return _tao_is_bounded_size (tmp);";
- break;
- default:
- *os << "return _tao_is_bounded_size (*(_tao_array.in ()));";
- break;
- }
- *os << be_uidt_nl;
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- {
- switch (bnt)
- {
- case AST_Decl::NT_string:
- case AST_Decl::NT_wstring:
- {
- be_string *str =
- be_string::narrow_from_decl (bt);
-
- if (!str)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_node - "
- "bad string node\n"),
- -1);
- }
- *os << "ACE_UNUSED_ARG(_tao_array);" << be_nl;
- char buff[15];
- ACE_OS::sprintf(buff, "%ld", str->max_size ()->ev ()->u.ulval);
- *os << "return _dcps_max_marshaled_size_ulong () + (" << buff;
- }
- break;
- case AST_Decl::NT_array:
- *os << "// use ULong instead of literal to avoid overload ambiguity"
- << be_nl << "::CORBA::ULong first = 0;" << be_nl
- << "// must use forany instead of a slice to avoid overload ambiguity"
- << be_nl
- << bt->name () << "_var tmp_var ("
- << bt->name () << "_dup (_tao_array";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[first]";
- }
-
- *os << "));" << be_nl;
- *os << bt->name () << "_forany tmp (tmp_var.inout ());" << be_nl;
- *os << "return (_dcps_max_marshaled_size (tmp)";
- break;
- default:
- // array size = slice type size * length
- // note: *(_tao_array.in ()) is the array's slice; hence base type
- *os << "return (_dcps_max_marshaled_size (*(_tao_array.in ()))";
- break;
- }
- *os << " * ";
-
- //SHH - TBD - this array dim size code could be common
- // Generate a product of all the dimensions. This will be the total length
- // of the "unfolded" single dimensional array.
- for (i = 0; i < ndims; ++i)
- {
- // Retrieve the ith dimension value.
- AST_Expression *expr = node->dims ()[i];
-
- if ((expr == 0) || ((expr != 0) && (expr->ev () == 0)))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_node - "
- "bad array dimension\n"),
- -1);
- }
-
- if (i != 0)
- {
- // Do not generate the multiplication operator the first time in.
- *os << "*";
- }
-
- if (expr->ev ()->et == AST_Expression::EV_ulong)
- {
- // Generate a loop for each dimension.
- *os << expr->ev ()->u.ulval;
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_node - "
- "bad array dimension value\n"),
- -1);
- }
- }
-
- *os << ");" << be_uidt_nl;
-
- }
- break;
- case TAO_CodeGen::TAO_FIND_SIZE:
- case TAO_CodeGen::TAO_CDR_INPUT:
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- {
- if (TAO_CodeGen::TAO_FIND_SIZE == this->ctx_->sub_state ())
- {
- *os << "//iterate over the array to find the current size" << be_nl
- << "size_t the_length = 0;" << be_nl;
- }
- else
- {
- // Initialize a boolean variable.
- *os << "::CORBA::Boolean _tao_marshal_flag = true;" << be_nl;
- }
-
- unsigned long ndims = node->n_dims ();
-
- // We get here if the "type" of individual elements of the array is not a
- // primitive type. In this case, we are left with no other alternative but to
- // encode/decode element by element.
-
- // generate nested loops for as many dimensions as there are
- for (i = 0; i < ndims; ++i)
- {
- // Retrieve the ith dimension value.
- AST_Expression *expr = node->dims ()[i];
-
- if ((expr == 0) || ((expr != 0) && (expr->ev () == 0)))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_node - "
- "bad array dimension\n"),
- -1);
- }
-
- if (expr->ev ()->et == AST_Expression::EV_ulong)
- {
- // Generate a loop for each dimension.
- *os << be_nl << "for ( ::CORBA::ULong i" << i
- << " = 0; i" << i << " < "
- << expr->ev ()->u.ulval;
-
- if (TAO_CodeGen::TAO_FIND_SIZE != this->ctx_->sub_state ())
- *os << " && _tao_marshal_flag";
-
- *os << "; i" << i
- << "++)" << be_idt_nl
- << "{" << be_idt;
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_node - "
- "bad array dimension value\n"),
- -1);
- }
- }
-
- // @@ (JP) Need to factor out some of this into method call(s).
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_FIND_SIZE:
- {
- *os << be_nl;
- if (AST_Decl::NT_array == bnt)
- {
- *os << bt->name () << "_var tmp_var ("
- << bt->name () << "_dup (_tao_array";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- *os << "));" << be_nl;
- *os << bt->name () << "_forany tmp (tmp_var.inout ());" << be_nl;
- *os << "the_length += _dcps_find_size (tmp);";
- }
- else
- {
- if (AST_Decl::NT_string == bnt ||
- AST_Decl::NT_wstring == bnt )
- *os << "the_length += _dcps_max_marshaled_size_ulong() + "
- << "ACE_OS::strlen(_tao_array";
- else
- *os << "the_length += _dcps_find_size (_tao_array";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
- if (AST_Decl::NT_string == bnt ||
- AST_Decl::NT_wstring == bnt )
- *os << ".in()";
-
- *os << ");";
- }
- }
- break;
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << be_nl;
-
- // Handle the array of array case, where we need to pass the
- // forany type.
- if (nt == AST_Decl::NT_array)
- {
- *os << bt->name () << "_forany tmp ("
- << bt->name () << "_alloc ());" << be_nl;
- *os << "_tao_marshal_flag = (strm >> tmp);" << be_nl;
- *os << bt->name () << "_copy (_tao_array";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- *os << ", tmp.in ());" << be_nl;
- *os << bt->name () << "_free (tmp.inout ());";
- }
- else
- {
- *os << "_tao_marshal_flag = (strm >> ";
- *os << "_tao_array ";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- switch (bt->node_type ())
- {
- // The following have a _var type and must be
- // handled in a special way.
- case AST_Decl::NT_string:
- case AST_Decl::NT_wstring:
- case AST_Decl::NT_valuetype:
- case AST_Decl::NT_valuetype_fwd:
- *os << ".out ()";
- break;
- case AST_Decl::NT_pre_defined:
- {
- // We need to separately handle this case of pseudo
- // objects because they have a _var type.
- be_predefined_type *pt =
- be_predefined_type::narrow_from_decl (bt);
-
- if (!pt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_node - "
- "bad predefined type node\n"),
- -1);
- }
-
- AST_PredefinedType::PredefinedType pdt = pt->pt ();
-
- if (pdt == AST_PredefinedType::PT_pseudo
- || pdt == AST_PredefinedType::PT_object)
- {
- *os << ".out ()";
- }
- }
- default:
- break;
- }
-
- *os << ");";
- }
-
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << be_nl;
-
- // Handle the array of array case, where we need to pass the
- // forany type.
- if (nt == AST_Decl::NT_array)
- {
- *os << bt->name () << "_var tmp_var ("
- << bt->name () << "_dup (_tao_array";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- *os << "));" << be_nl;
- *os << bt->name () << "_forany tmp (tmp_var.inout ());" << be_nl;
- *os << "_tao_marshal_flag = (strm << tmp);";
- }
- else if (nt == AST_Decl::NT_interface
- || nt == AST_Decl::NT_interface_fwd)
- {
- *os << "_tao_marshal_flag = " << be_idt_nl;
-
- if (bt->is_defined ())
- {
- *os << "_tao_array";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- *os << ".in ()->marshal (strm);" << be_uidt;
- }
- else
- {
-
- AST_Decl *parent =
- ScopeAsDecl (bt->defined_in ());
-
- if (parent != 0 && parent->node_type () != AST_Decl::NT_root)
- {
- *os << parent->name () << "::";
- }
-
- *os << "TAO::Objref_Traits<" << bt->name () << ">::"
- << "tao_marshal (_tao_array";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- *os << ".in (), strm);" << be_uidt;
- }
- }
- else
- {
- *os << "_tao_marshal_flag = (strm << ";
- *os << "_tao_array ";
-
- for (i = 0; i < ndims; ++i)
- {
- *os << "[i" << i << "]";
- }
-
- switch (bt->node_type ())
- {
- // The following have a _var type and must be
- // handled in a special way.
- case AST_Decl::NT_string:
- case AST_Decl::NT_wstring:
- case AST_Decl::NT_valuetype:
- case AST_Decl::NT_valuetype_fwd:
- *os << ".in ()";
- break;
- case AST_Decl::NT_pre_defined:
- {
- // We need to separately handle this case of pseudo
- // objects because they have a _var type.
- be_predefined_type *pt =
- be_predefined_type::narrow_from_decl (bt);
-
- if (!pt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_node - "
- "bad predefined type node\n"),
- -1);
- }
-
- AST_PredefinedType::PredefinedType pdt = pt->pt ();
-
- if (pdt == AST_PredefinedType::PT_pseudo
- || pdt == AST_PredefinedType::PT_object)
- {
- *os << ".in ()";
- }
- }
- default:
- break;
- }
-
- *os << ");";
- }
-
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_node - "
- "bad sub state\n"),
- -1);
- }
-
- for (i = 0; i < ndims; ++i)
- {
- // Decrement indentation as many times as the number of dimensions.
- *os << be_uidt_nl << "}" << be_uidt;
- }
-
- if (TAO_CodeGen::TAO_FIND_SIZE == this->ctx_->sub_state ())
- {
- *os << be_nl << be_nl << "return the_length;" << be_uidt_nl;
- }
- else
- {
- *os << be_nl << be_nl << "return _tao_marshal_flag;" << be_uidt_nl;
- }
-
- } // end INPUT/OUTPUT_CDR case
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_node outter- "
- "bad sub state\n"),
- -1);
- } // end outer switch
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_attribute.cpp b/TAO/TAO_IDL/be/be_visitor_attribute.cpp
deleted file mode 100644
index 2e0ff1dc96c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_attribute.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_attribute.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Attribute
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_attribute.h"
-#include "be_operation.h"
-#include "be_predefined_type.h"
-#include "be_argument.h"
-
-#include "be_visitor_attribute.h"
-#include "be_visitor_context.h"
-#include "be_visitor_operation.h"
-
-#include "ast_generator.h"
-#include "utl_identifier.h"
-#include "utl_exceptlist.h"
-#include "global_extern.h"
-#include "ace/Log_Msg.h"
-
-#include "be_visitor_attribute/attribute.cpp"
-
-ACE_RCSID (be,
- be_visitor_attribute,
- "$Id$")
-
diff --git a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp b/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp
deleted file mode 100644
index 93bcd6f9c2e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp
+++ /dev/null
@@ -1,431 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// attribute.cpp
-//
-// = DESCRIPTION
-// Visitor for generation of code for Attribute
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_attribute,
- attribute,
- "$Id$")
-
-// Attribute gets mapped to one or possibly two operations based on whether
-// it is readonly or not. The two operations "get" and "set" the value of the
-// attribute.
-//
-// code generation for attributes is achieved by mapping an attribute node to
-// a corresponding operation node. The reason is that we do not want to
-// duplicate the code. However, an attribute node and an operation node have
-// different interfaces. Hence we need some form of an adapter that can take us
-// from an attribute node to an operation node. The following paragraph
-// describes how this is accomplished.
-//
-// For a "get" operation on the attribute, we create an operation node with the
-// same name as the attribute and a return type which is the same as the type
-// of the attribute. This operation has no arguments.
-//
-// For a "set" operation on the attribute (if it is not readonly), we create an
-// operation node with a "void" return type and an "in" parameter of the same
-// type as the attribute.
-
-// In both cases the context will hold sufficient information to indicate that
-// the operation node is really an attribute node.
-
-// *************************************************************************
-// primary visitor for "attribute". The context state decides the next state
-// *************************************************************************
-
-be_visitor_attribute::be_visitor_attribute (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_attribute::~be_visitor_attribute (void)
-{
-}
-
-int
-be_visitor_attribute::visit_attribute (be_attribute *node)
-{
- this->ctx_->node (node);
- this->ctx_->attribute (node);
-
-
- // first the "get" operation
- be_operation get_op (node->field_type (),
- AST_Operation::OP_noflags,
- node->name (),
- node->is_local (),
- node->is_abstract ());
-
- get_op.set_name ((UTL_IdList *) node->name ()->copy ());
- get_op.set_defined_in (node->defined_in ());
-
- UTL_ExceptList *get_exceptions = node->get_get_exceptions ();
-
- if (0 != get_exceptions)
- {
- get_op.be_add_exceptions (get_exceptions->copy ());
- }
-
- // Get the strategy from the attribute and hand it over
- // to the operation.
- be_operation_strategy *old_strategy =
- get_op.set_strategy (node->get_get_strategy ()->copy ());
-
- if (0 != old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
-
- be_visitor_context ctx (*this->ctx_);
- int status = 1;
-
- switch (this->ctx_->state ())
- {
- // These two cases are the only ones that could involved a strategy.
- case TAO_CodeGen::TAO_ROOT_CH:
- case TAO_CodeGen::TAO_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_SH:
- {
- be_visitor_operation_sh visitor (&ctx);
- status = get_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IH:
- {
- be_visitor_operation_ih visitor (&ctx);
- status = get_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SS:
- {
- be_visitor_operation_ss visitor (&ctx);
- status = get_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IS:
- {
- be_visitor_operation_is visitor (&ctx);
- status = get_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH:
- {
- be_visitor_operation_proxy_impl_xh visitor (&ctx);
- status = get_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS:
- {
- be_visitor_operation_direct_proxy_impl_ss visitor (&ctx);
- status = get_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH:
- {
- be_visitor_operation_smart_proxy_ch visitor (&ctx);
- status = get_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS:
- {
- be_visitor_operation_smart_proxy_cs visitor (&ctx);
- status = get_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_TIE_SH:
- {
- be_visitor_operation_tie_sh visitor (&ctx);
- status = get_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_TIE_SI:
- {
- be_visitor_operation_tie_si visitor (&ctx);
- status = get_op.accept (&visitor);
- break;
- }
- default:
- get_op.destroy ();
- return 0;
- }
-
- if (status == -1)
- {
- get_op.destroy ();
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for get_attribute failed\n"),
- -1);
- }
- else if (status == 1)
- {
- // Change the state depending on the kind of node strategy.
- ctx.state (get_op.next_state (ctx.state ()));
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor || (get_op.accept (visitor) == -1))
- {
- delete visitor;
- visitor = 0;
- get_op.destroy ();
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for get_attribute failed\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
-
- if (get_op.has_extra_code_generation (ctx.state ()))
- {
- // Change the state depending on the kind of node strategy.
- ctx.state (get_op.next_state (ctx.state (), 1));
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor || (get_op.accept (visitor) == -1))
- {
- delete visitor;
- visitor = 0;
- get_op.destroy ();
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for get_attribute failed\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
- }
- }
-
- get_op.destroy ();
-
- // Do nothing for readonly attributes.
- if (node->readonly ())
- {
- return 0;
- }
-
- status = 1;
-
- // Create the set method.
- Identifier id ("void");
- UTL_ScopedName sn (&id,
- 0);
-
- // The return type is "void".
- be_predefined_type rt (AST_PredefinedType::PT_void,
- &sn);
-
- // Argument type is the same as the attribute type.
- AST_Argument *arg =
- idl_global->gen ()->create_argument (AST_Argument::dir_IN,
- node->field_type (),
- node->name ());
-
- arg->set_name ((UTL_IdList *) node->name ()->copy ());
- // Create the operation.
- be_operation set_op (&rt,
- AST_Operation::OP_noflags,
- node->name (),
- node->is_local (),
- node->is_abstract ());
- set_op.set_name ((UTL_IdList *) node->name ()->copy ());
- set_op.set_defined_in (node->defined_in ());
- set_op.be_add_argument (arg);
-
- UTL_ExceptList *set_exceptions = node->get_set_exceptions ();
-
- if (0 != set_exceptions)
- {
- set_op.be_add_exceptions (set_exceptions->copy ());
- }
-
- // Get the strategy from the attribute and hand it over
- // to the operation, thereby deleting the old one.
- old_strategy =
- set_op.set_strategy (node->get_set_strategy ()->copy ());
-
- if (0 != old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
-
- ctx = *this->ctx_;
- status = 1;
-
- switch (this->ctx_->state ())
- {
- // These two cases are the only ones that could involved a strategy.
- case TAO_CodeGen::TAO_ROOT_CH:
- case TAO_CodeGen::TAO_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_SH:
- {
- be_visitor_operation_sh visitor (&ctx);
- status = set_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IH:
- {
- be_visitor_operation_ih visitor (&ctx);
- status = set_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SS:
- {
- be_visitor_operation_ss visitor (&ctx);
- status = set_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IS:
- {
- be_visitor_operation_is visitor (&ctx);
- status = set_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH:
- {
- be_visitor_operation_proxy_impl_xh visitor (&ctx);
- status = set_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS:
- {
- be_visitor_operation_direct_proxy_impl_ss visitor (&ctx);
- status = set_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH:
- {
- be_visitor_operation_smart_proxy_ch visitor (&ctx);
- status = set_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS:
- {
- be_visitor_operation_smart_proxy_cs visitor (&ctx);
- status = set_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_TIE_SH:
- {
- be_visitor_operation_tie_sh visitor (&ctx);
- status = set_op.accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_TIE_SI:
- {
- be_visitor_operation_tie_si visitor (&ctx);
- status = set_op.accept (&visitor);
- break;
- }
- default:
- // Error.
- set_op.destroy ();
- rt.destroy ();
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "bad codegen state\n"),
- -1);
- }
-
- if (status == 0)
- {
- set_op.destroy ();
- rt.destroy ();
- return 0;
- }
- else if (status == -1)
- {
- set_op.destroy ();
- rt.destroy ();
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for get_attribute failed\n"),
- -1);
- }
-
- // Change the state depending on the kind of node strategy
- ctx.state (set_op.next_state (ctx.state ()));
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor || (set_op.accept (visitor) == -1))
- {
- delete visitor;
- visitor = 0;
- set_op.destroy ();
- rt.destroy ();
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for set_attribute failed\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
-
- if (set_op.has_extra_code_generation (ctx.state ()))
- {
- // Change the state depending on the kind of node strategy
- ctx.state (set_op.next_state (ctx.state (), 1));
-
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor || (set_op.accept (visitor) == -1))
- {
- delete visitor;
- visitor = 0;
- set_op.destroy ();
- rt.destroy ();
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for set_attribute failed\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
- }
-
- set_op.destroy ();
- rt.destroy ();
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp
deleted file mode 100644
index a1268a29bec..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp
+++ /dev/null
@@ -1,1922 +0,0 @@
-/**
- * @file be_visitor_ccm_pre_proc.cpp
- *
- * $Id$
- *
- * @author Jeff Parsons
- */
-//=============================================================================
-
-#include "be_visitor_ccm_pre_proc.h"
-#include "be_visitor_context.h"
-#include "be_root.h"
-#include "be_operation.h"
-#include "be_argument.h"
-#include "be_exception.h"
-#include "be_structure.h"
-#include "be_sequence.h"
-#include "be_valuetype.h"
-#include "be_module.h"
-#include "be_field.h"
-#include "be_typedef.h"
-#include "be_component.h"
-#include "be_eventtype.h"
-#include "be_eventtype_fwd.h"
-#include "be_home.h"
-#include "be_extern.h"
-#include "ast_generator.h"
-#include "utl_exceptlist.h"
-#include "utl_namelist.h"
-#include "utl_err.h"
-#include "fe_interface_header.h"
-#include "global_extern.h"
-#include "nr_extern.h"
-
-ACE_RCSID (be,
- be_visitor_ccm_pre_proc,
- "$Id$")
-
-const char *EXCEP_NAMES[] =
- {
- "AlreadyConnected",
- "InvalidConnection",
- "NoConnection",
- "ExceededConnectionLimit",
- "CreateFailure",
- "RemoveFailure",
- "FinderFailure",
- "InvalidKey",
- "UnknownKeyValue",
- "DuplicateKeyValue",
- "CreateFailure",
- "FinderFailure"
- };
-
-const int N_EXCEPS = sizeof (EXCEP_NAMES) / sizeof (char *);
-be_exception *EXCEPS[N_EXCEPS];
-
-be_visitor_ccm_pre_proc::be_visitor_ccm_pre_proc (be_visitor_context *ctx)
- : be_visitor_scope (ctx),
- module_id_ ("Components"),
- cookie_ (0),
- already_connected_ (0),
- invalid_connection_ (0),
- no_connection_ (0),
- exceeded_connection_limit_ (0),
- create_failure_ (0),
- remove_failure_ (0),
- finder_failure_ (0),
- invalid_key_ (0),
- unknown_key_value_ (0),
- duplicate_key_value_ (0)
-{
-}
-
-be_visitor_ccm_pre_proc::~be_visitor_ccm_pre_proc (void)
-{
- this->module_id_.destroy ();
-}
-
-int
-be_visitor_ccm_pre_proc::visit_root (be_root *node)
-{
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_root - visit scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::visit_module (be_module *node)
-{
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_module - visit scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::visit_component (be_component *node)
-{
- if (this->lookup_cookie (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_component - "
- "Components::Cookie lookup failed\n"),
- -1);
- }
-
- if (this->lookup_exceptions (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_component - "
- "component exception lookups failed\n"),
- -1);
- }
-
- if (this->gen_provides (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_component - "
- "code generation for provides declarations failed\n"),
- -1);
- }
-
- if (this->gen_uses (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_component - "
- "code generation for uses declarations failed\n"),
- -1);
- }
-
- if (this->gen_emits (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_component - "
- "code generation for emits declarations failed\n"),
- -1);
- }
-
- if (this->gen_publishes (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_component - "
- "code generation for publishes declarations failed\n"),
- -1);
- }
-
- if (this->gen_consumes (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_component - "
- "code generation for consumes declarations failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::visit_home (be_home *node)
-{
- AST_Interface *xplicit = this->create_explicit (node);
-
- if (xplicit == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_home - "
- "code generation for explicit interface failed\n"),
- -1);
- }
-
- AST_Interface *implicit = this->create_implicit (node);
-
- if (implicit == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_home - "
- "code generation for implicit interface failed\n"),
- -1);
- }
-
- if (this->gen_factories (node, xplicit) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_home - "
- "code generation for factories declarations failed\n"),
- -1);
- }
-
- if (this->gen_finders (node, xplicit) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_home - "
- "code generation for finders declarations failed\n"),
- -1);
- }
-
- if (this->gen_implicit_ops (node, implicit) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_home - "
- "code generation for primary key "
- "operations failed\n"),
- -1);
- }
-
- if (this->create_equivalent (node, xplicit, implicit) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_home - "
- "code generation for equivalent interface failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::visit_eventtype (be_eventtype *node)
-{
- if (node->ccm_pre_proc_gen ())
- {
- return 0;
- }
-
- if (this->create_event_consumer (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "visit_eventtype - "
- "code generation for consumer failed\n"),
- -1);
- }
-
- node->ccm_pre_proc_gen (true);
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- be_eventtype *fd =
- be_eventtype::narrow_from_decl (node->full_definition ());
-
- return this->visit_eventtype (fd);
-}
-
-// ****************************************************************
-
-int
-be_visitor_ccm_pre_proc::gen_provides (be_component *node)
-{
- ACE_Unbounded_Queue<AST_Component::port_description> &s = node->provides ();
- AST_Component::port_description *pd = 0;
- AST_Operation *provides_op = 0;
-
- for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s);
- ! iter.done ();
- iter.advance ())
- {
- iter.next (pd);
- UTL_ScopedName *op_name =
- this->create_scoped_name ("provide_",
- pd->id->get_string (),
- 0,
- node);
- ACE_NEW_RETURN (provides_op,
- be_operation (pd->impl,
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- provides_op->set_defined_in (node);
- provides_op->set_imported (node->imported ());
- provides_op->set_name (op_name);
-
- if (0 == node->be_add_operation (provides_op))
- {
- return -1;
- }
-
- // Might as well clean up here instead of putting 5 loops in
- // AST_Component::destroy ().
- pd->id->destroy ();
- delete pd->id;
- pd->id = 0;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_uses (be_component *node)
-{
- ACE_Unbounded_Queue<AST_Component::port_description> &s = node->uses ();
- AST_Component::port_description *pd = 0;
-
- for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s);
- ! iter.done ();
- iter.advance ())
- {
- iter.next (pd);
-
- if (pd->is_multiple == false)
- {
- if (this->gen_connect_single (node, pd) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_uses - "
- "gen_connect_single failed\n"),
- -1);
- }
-
- if (this->gen_disconnect_single (node, pd) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_uses - "
- "gen_disconnect_single failed\n"),
- -1);
- }
-
- if (this->gen_get_connection_single (node, pd) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_uses - "
- "gen_get_connection_single failed\n"),
- -1);
- }
- }
- else
- {
- if (this->gen_connect_multiple (node, pd) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_uses - "
- "gen_connect_multiple failed\n"),
- -1);
- }
-
- if (this->gen_disconnect_multiple (node, pd) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_uses - "
- "gen_disconnect_multiple failed\n"),
- -1);
- }
-
- if (this->gen_get_connection_multiple (node, pd) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_uses - "
- "gen_get_connection_single failed\n"),
- -1);
- }
- }
-
- // Might as well clean up here instead of putting 5 loops in
- // AST_Component::destroy ().
- pd->id->destroy ();
- delete pd->id;
- pd->id = 0;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_emits (be_component *node)
-{
- ACE_Unbounded_Queue<AST_Component::port_description> &s = node->emits ();
- AST_Component::port_description *pd = 0;
-
- for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s);
- ! iter.done ();
- iter.advance ())
- {
- iter.next (pd);
-
- if (this->gen_emits_connect (node, pd) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_emits - "
- "gen_emits_connect failed\n"),
- -1);
- }
-
- if (this->gen_emits_disconnect (node, pd) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_emits - "
- "gen_emits_disconnect failed\n"),
- -1);
- }
-
- // Might as well clean up here instead of putting 5 loops in
- // AST_Component::destroy ().
- pd->id->destroy ();
- delete pd->id;
- pd->id = 0;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_publishes (be_component *node)
-{
- ACE_Unbounded_Queue<AST_Component::port_description> &s = node->publishes ();
- AST_Component::port_description *pd = 0;
-
- for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s);
- ! iter.done ();
- iter.advance ())
- {
- iter.next (pd);
-
- if (this->gen_subscribe (node, pd) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_publishes - "
- "gen_subscribe failed\n"),
- -1);
- }
-
- if (this->gen_unsubscribe (node, pd) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_publishes - "
- "gen_unsubscribe failed\n"),
- -1);
- }
-
- // Might as well clean up here instead of putting 5 loops in
- // AST_Component::destroy ().
- pd->id->destroy ();
- delete pd->id;
- pd->id = 0;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_consumes (be_component *node)
-{
- ACE_Unbounded_Queue<AST_Component::port_description> &s = node->consumes ();
- AST_Component::port_description *pd = 0;
-
- for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s);
- ! iter.done ();
- iter.advance ())
- {
- iter.next (pd);
-
- if (this->gen_get_consumer (node, pd) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_consumes - "
- "gen_consumes_get_connection failed\n"),
- -1);
- }
-
- // Might as well clean up here instead of putting 5 loops in
- // AST_Component::destroy ().
- pd->id->destroy ();
- delete pd->id;
- pd->id = 0;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_factories (be_home *node,
- AST_Interface *xplicit)
-{
- AST_Operation **item = 0;
-
- for (ACE_Unbounded_Queue_Iterator<AST_Operation *> i (node->factories ());
- ! i.done ();
- i.advance ())
- {
- i.next (item);
- (*item)->set_defined_in (xplicit);
- UTL_ScopedName *new_name =
- this->create_scoped_name (0,
- (*item)->local_name ()->get_string (),
- 0,
- xplicit);
- (*item)->set_name (new_name);
-
- if ((*item)->be_insert_exception (this->create_failure_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_factories - "
- "exception insertion failed\n"),
- -1);
- }
-
- if (0 == xplicit->be_add_operation (*item))
- {
- return -1;
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_finders (be_home *node,
- AST_Interface *xplicit)
-{
- AST_Operation **item = 0;
-
- for (ACE_Unbounded_Queue_Iterator<AST_Operation *> i (node->finders ());
- ! i.done ();
- i.advance ())
- {
- i.next (item);
- (*item)->set_defined_in (xplicit);
- UTL_ScopedName *new_name =
- this->create_scoped_name (0,
- (*item)->local_name ()->get_string (),
- 0,
- xplicit);
- (*item)->set_name (new_name);
-
- if ((*item)->be_insert_exception (this->finder_failure_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_factories - "
- "exception insertion failed\n"),
- -1);
- }
-
- if (0 == xplicit->be_add_operation (*item))
- {
- return -1;
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_implicit_ops (be_home *node,
- AST_Interface *implicit)
-{
- if (this->gen_create (node, implicit) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_implicit_ops - "
- "gen_create failed\n"),
- -1);
- }
-
- AST_ValueType *pk = node->primary_key ();
-
- if (pk == 0)
- {
- return 0;
- }
-
- if (this->gen_find_by_primary_key (node, implicit) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_implicit_ops - "
- "gen_find_by_primary_key failed\n"),
- -1);
- }
-
- if (this->gen_remove (node, implicit) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_implicit_ops - "
- "gen_remove failed\n"),
- -1);
- }
-
- if (this->gen_get_primary_key (node, implicit) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_implicit_ops - "
- "gen_get_primary_key failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// **************************************************************
-
-int
-be_visitor_ccm_pre_proc::gen_connect_single (
- be_component *node,
- AST_Component::port_description *pd
- )
-{
- if (pd == 0)
- {
- return -1;
- }
-
- UTL_ScopedName *op_full_name =
- this->create_scoped_name ("connect_",
- pd->id->get_string (),
- 0,
- node);
- be_operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (be_global->void_type (),
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- op->set_defined_in (node);
- op->set_imported (node->imported ());
- op->set_name (op_full_name);
- Identifier arg_id ("conxn");
- UTL_ScopedName arg_name (&arg_id,
- 0);
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- pd->impl,
- &arg_name),
- -1);
- arg_id.destroy ();
- op->be_add_argument (arg);
-
- UTL_ExceptList *tail = 0;
- ACE_NEW_RETURN (tail,
- UTL_ExceptList (this->invalid_connection_,
- 0),
- -1);
- UTL_ExceptList *connect_single = 0;
- ACE_NEW_RETURN (connect_single,
- UTL_ExceptList (this->already_connected_,
- tail),
- -1);
- op->be_add_exceptions (connect_single);
-
- if (0 == node->be_add_operation (op))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_disconnect_single (
- be_component *node,
- AST_Component::port_description *pd
- )
-{
- if (pd == 0)
- {
- return -1;
- }
-
- UTL_ScopedName *op_full_name =
- this->create_scoped_name ("disconnect_",
- pd->id->get_string (),
- 0,
- node);
- be_operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (pd->impl,
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- op->set_name (op_full_name);
- op->set_defined_in (node);
- op->set_imported (node->imported ());
- UTL_ExceptList *disconnect_single = 0;
- ACE_NEW_RETURN (disconnect_single,
- UTL_ExceptList (this->no_connection_,
- 0),
- -1);
- op->be_add_exceptions (disconnect_single);
-
- if (0 == node->be_add_operation (op))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_get_connection_single (
- be_component *node,
- AST_Component::port_description *pd
- )
-{
- if (pd == 0)
- {
- return -1;
- }
-
- UTL_ScopedName *op_full_name =
- this->create_scoped_name ("get_connection_",
- pd->id->get_string (),
- 0,
- node);
- be_operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (pd->impl,
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- op->set_name (op_full_name);
- op->set_defined_in (node);
-
- if (0 == node->be_add_operation (op))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_connect_multiple (
- be_component *node,
- AST_Component::port_description *pd
- )
-{
- if (pd == 0)
- {
- return -1;
- }
-
- UTL_ScopedName *op_full_name =
- this->create_scoped_name ("connect_",
- pd->id->get_string (),
- 0,
- node);
-
- be_operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (this->cookie_,
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- op->set_name (op_full_name);
- op->set_defined_in (node);
- op->set_imported (node->imported ());
- Identifier arg_id ("connection");
- UTL_ScopedName arg_name (&arg_id,
- 0);
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- pd->impl,
- &arg_name),
- -1);
- arg_id.destroy ();
- op->be_add_argument (arg);
- UTL_ExceptList *tail = 0;
- ACE_NEW_RETURN (tail,
- UTL_ExceptList (this->invalid_connection_,
- 0),
- -1);
- UTL_ExceptList *connect_multiple = 0;
- ACE_NEW_RETURN (connect_multiple,
- UTL_ExceptList (this->exceeded_connection_limit_,
- tail),
- -1);
- op->be_add_exceptions (connect_multiple);
-
- if (0 == node->be_add_operation (op))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_disconnect_multiple (
- be_component *node,
- AST_Component::port_description *pd
- )
-{
- if (pd == 0)
- {
- return -1;
- }
-
- UTL_ScopedName *op_full_name =
- this->create_scoped_name ("disconnect_",
- pd->id->get_string (),
- 0,
- node);
- be_operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (pd->impl,
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- op->set_name (op_full_name);
- op->set_defined_in (node);
- op->set_imported (node->imported ());
- Identifier arg_id ("ck");
- UTL_ScopedName arg_name (&arg_id,
- 0);
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- this->cookie_,
- &arg_name),
- -1);
- arg_id.destroy ();
- op->be_add_argument (arg);
- UTL_ExceptList *disconnect_multiple = 0;
- ACE_NEW_RETURN (disconnect_multiple,
- UTL_ExceptList (this->invalid_connection_,
- 0),
- -1);
- op->be_add_exceptions (disconnect_multiple);
-
- if (0 == node->be_add_operation (op))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_get_connection_multiple (
- be_component *node,
- AST_Component::port_description *pd
- )
-{
- if (pd == 0)
- {
- return -1;
- }
-
- UTL_ScopedName *op_full_name =
- this->create_scoped_name ("get_connections_",
- pd->id->get_string (),
- 0,
- node);
-
- // Look up the implied IDL typedef created in the front end.
- // It will be the return type of the created operation.
- ACE_CString connections_string (pd->id->get_string ());
- connections_string += "Connections";
- Identifier connections_id (connections_string.c_str ());
- UTL_ScopedName connections_name (&connections_id,
- 0);
- AST_Decl *d = node->lookup_by_name (&connections_name,
- true);
- be_typedef *td = be_typedef::narrow_from_decl (d);
- connections_id.destroy ();
-
- be_operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (td,
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- op->set_name (op_full_name);
- op->set_defined_in (node);
- op->set_imported (node->imported ());
-
- if (0 == node->be_add_operation (op))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_push_op (be_eventtype *node,
- AST_Interface *consumer)
-{
- UTL_ScopedName *op_full_name =
- this->create_scoped_name ("push_",
- node->local_name (),
- 0,
- consumer);
- be_operation *push_op = 0;
- ACE_NEW_RETURN (push_op,
- be_operation (be_global->void_type (),
- AST_Operation::OP_noflags,
- 0,
- false,
- false),
- -1);
- push_op->set_defined_in (consumer);
- push_op->set_imported (node->imported ());
- push_op->set_name (op_full_name);
- ACE_CString arg_string ("the_",
- 0,
- 0);
- arg_string += node->local_name ();
- Identifier arg_id (arg_string.fast_rep ());
- UTL_ScopedName arg_name (&arg_id,
- 0);
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- node,
- &arg_name),
- -1);
- arg_id.destroy ();
- push_op->be_add_argument (arg);
-
- if (0 == consumer->be_add_operation (push_op))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_subscribe (be_component *node,
- AST_Component::port_description *pd)
-{
- UTL_ScopedName *op_name =
- this->create_scoped_name ("subscribe_",
- pd->id->get_string (),
- 0,
- node);
- be_operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (this->cookie_,
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- op->set_defined_in (node);
- op->set_imported (node->imported ());
- op->set_name (op_name);
-
- AST_Interface *i = this->lookup_consumer (pd);
-
- if (i == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_subscribe - "
- "consumer lookup failed\n"),
- -1);
- }
-
- Identifier arg_id ("consumer");
- UTL_ScopedName arg_name (&arg_id,
- 0);
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- i,
- &arg_name),
- -1);
- op->be_add_argument (arg);
- UTL_ExceptList *subscribe = 0;
- ACE_NEW_RETURN (subscribe,
- UTL_ExceptList (this->exceeded_connection_limit_,
- 0),
- -1);
- op->be_add_exceptions (subscribe);
-
- if (0 == node->be_add_operation (op))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_unsubscribe (be_component *node,
- AST_Component::port_description *pd)
-{
- AST_Interface *i = this->lookup_consumer (pd);
-
- if (i == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_unsubscribe - "
- "consumer lookup failed\n"),
- -1);
- }
-
- UTL_ScopedName *op_name =
- this->create_scoped_name ("unsubscribe_",
- pd->id->get_string (),
- 0,
- node);
- be_operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (i,
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- op->set_defined_in (node);
- op->set_imported (node->imported ());
- op->set_name (op_name);
- Identifier arg_id ("ck");
- UTL_ScopedName arg_name (&arg_id,
- 0);
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- this->cookie_,
- &arg_name),
- -1);
- op->be_add_argument (arg);
- UTL_ExceptList *unsubscribe = 0;
- ACE_NEW_RETURN (unsubscribe,
- UTL_ExceptList (this->invalid_connection_,
- 0),
- -1);
- op->be_add_exceptions (unsubscribe);
-
- if (0 == node->be_add_operation (op))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_emits_connect (
- be_component *node,
- AST_Component::port_description *pd
- )
-{
- UTL_ScopedName *op_name =
- this->create_scoped_name ("connect_",
- pd->id->get_string (),
- 0,
- node);
- be_operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (be_global->void_type (),
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- op->set_name (op_name);
- op->set_defined_in (node);
- op->set_imported (node->imported ());
- AST_Interface *i = this->lookup_consumer (pd);
-
- if (i == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_emits_connect - "
- "consumer lookup failed\n"),
- -1);
- }
-
- Identifier arg_id ("consumer");
- UTL_ScopedName arg_name (&arg_id,
- 0);
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- i,
- &arg_name),
- -1);
- op->be_add_argument (arg);
- UTL_ExceptList *emits_connect = 0;
- ACE_NEW_RETURN (emits_connect,
- UTL_ExceptList (this->already_connected_,
- 0),
- -1);
- op->be_add_exceptions (emits_connect);
-
- if (0 == node->be_add_operation (op))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_emits_disconnect (
- be_component *node,
- AST_Component::port_description *pd
- )
-{
- AST_Interface *i = this->lookup_consumer (pd);
-
- if (i == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_emits_disconnect - "
- "consumer lookup failed\n"),
- -1);
- }
-
- UTL_ScopedName *op_name =
- this->create_scoped_name ("disconnect_",
- pd->id->get_string (),
- 0,
- node);
- be_operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (i,
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- op->set_name (op_name);
- op->set_defined_in (node);
- op->set_imported (node->imported ());
- UTL_ExceptList *emits_disconnect = 0;
- ACE_NEW_RETURN (emits_disconnect,
- UTL_ExceptList (this->no_connection_,
- 0),
- -1);
- op->be_add_exceptions (emits_disconnect);
-
- if (0 == node->be_add_operation (op))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_get_consumer (
- be_component *node,
- AST_Component::port_description *pd
- )
-{
- AST_Interface *i = this->lookup_consumer (pd);
-
- if (i == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ccm_pre_proc::"
- "gen_consumes_get_connection - "
- "consumer lookup failed\n"),
- -1);
- }
-
- UTL_ScopedName *op_name =
- this->create_scoped_name ("get_consumer_",
- pd->id->get_string (),
- 0,
- node);
- be_operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (i,
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- op->set_name (op_name);
- op->set_defined_in (node);
- op->set_imported (node->imported ());
-
- if (0 == node->be_add_operation (op))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_create (be_home *node,
- AST_Interface *implicit)
-{
- UTL_ScopedName *op_name = this->create_scoped_name (0,
- "create",
- 0,
- implicit);
- AST_Operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (node->managed_component (),
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- op->set_name (op_name);
- AST_ValueType *pk = node->primary_key ();
- UTL_ExceptList *exceps = 0;
- ACE_NEW_RETURN (exceps,
- UTL_ExceptList (this->create_failure_,
- 0),
- -1);
-
- if (pk != 0)
- {
- Identifier arg_id ("key");
- UTL_ScopedName arg_name (&arg_id,
- 0);
- AST_Argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- pk,
- &arg_name),
- -1);
- arg_id.destroy ();
- op->be_add_argument (arg);
- UTL_ExceptList *tail = 0;
- ACE_NEW_RETURN (tail,
- UTL_ExceptList (this->invalid_key_,
- 0),
- -1);
- UTL_ExceptList *middle = 0;
- ACE_NEW_RETURN (middle,
- UTL_ExceptList (this->duplicate_key_value_,
- tail),
- -1);
- exceps->nconc (middle);
- }
-
- op->be_add_exceptions (exceps);
- op->set_defined_in (implicit);
- op->set_imported (node->imported ());
-
- if (0 == implicit->be_add_operation (op))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_find_by_primary_key (be_home *node,
- AST_Interface *implicit)
-{
- UTL_ScopedName *op_name = this->create_scoped_name (0,
- "find_by_primary_key",
- 0,
- implicit);
- AST_Operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (node->managed_component (),
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- op->set_name (op_name);
- AST_ValueType *pk = node->primary_key ();
- Identifier arg_id ("key");
- UTL_ScopedName arg_name (&arg_id,
- 0);
- AST_Argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- pk,
- &arg_name),
- -1);
- arg_id.destroy ();
- op->be_add_argument (arg);
- UTL_ExceptList *tail = 0;
- ACE_NEW_RETURN (tail,
- UTL_ExceptList (this->invalid_key_,
- 0),
- -1);
- UTL_ExceptList *middle = 0;
- ACE_NEW_RETURN (middle,
- UTL_ExceptList (this->unknown_key_value_,
- tail),
- -1);
- UTL_ExceptList *exceps = 0;
- ACE_NEW_RETURN (exceps,
- UTL_ExceptList (this->finder_failure_,
- middle),
- -1);
- op->be_add_exceptions (exceps);
- op->set_defined_in (implicit);
- op->set_imported (node->imported ());
-
- if (0 == implicit->be_add_operation (op))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_remove (be_home *node,
- AST_Interface *implicit)
-{
- UTL_ScopedName *op_name = this->create_scoped_name (0,
- "remove",
- 0,
- implicit);
- AST_Operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (be_global->void_type (),
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- op->set_name (op_name);
- AST_ValueType *pk = node->primary_key ();
- Identifier arg_id ("key");
- UTL_ScopedName arg_name (&arg_id,
- 0);
- AST_Argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- pk,
- &arg_name),
- -1);
- arg_id.destroy ();
- op->be_add_argument (arg);
- UTL_ExceptList *tail = 0;
- ACE_NEW_RETURN (tail,
- UTL_ExceptList (this->invalid_key_,
- 0),
- -1);
- UTL_ExceptList *middle = 0;
- ACE_NEW_RETURN (middle,
- UTL_ExceptList (this->unknown_key_value_,
- tail),
- -1);
- UTL_ExceptList *exceps = 0;
- ACE_NEW_RETURN (exceps,
- UTL_ExceptList (this->remove_failure_,
- middle),
- -1);
- op->be_add_exceptions (exceps);
- op->set_defined_in (implicit);
- op->set_imported (node->imported ());
-
- if (0 == implicit->be_add_operation (op))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::gen_get_primary_key (be_home *node,
- AST_Interface *implicit)
-{
- UTL_ScopedName *op_name = this->create_scoped_name (0,
- "get_primary_key",
- 0,
- implicit);
- AST_Operation *op = 0;
- ACE_NEW_RETURN (op,
- be_operation (node->primary_key (),
- AST_Operation::OP_noflags,
- 0,
- 0,
- 0),
- -1);
- op->set_name (op_name);
- Identifier arg_id ("comp");
- UTL_ScopedName arg_name (&arg_id,
- 0);
- AST_Argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- node->managed_component (),
- &arg_name),
- -1);
- arg_id.destroy ();
- op->be_add_argument (arg);
- op->set_defined_in (implicit);
- op->set_imported (node->imported ());
-
- if (0 == implicit->be_add_operation (op))
- {
- return -1;
- }
-
- return 0;
-}
-
-// ********************************************************************
-
-int
-be_visitor_ccm_pre_proc::lookup_cookie (be_component *node)
-{
- if (this->cookie_ == 0)
- {
- Identifier local_id ("Cookie");
- UTL_ScopedName local_name (&local_id,
- 0);
- UTL_ScopedName cookie_name (&this->module_id_,
- &local_name);
- AST_Decl *d = node->lookup_by_name (&cookie_name,
- true);
- local_id.destroy ();
-
- if (d == 0)
- {
- idl_global->err ()->lookup_error (&cookie_name);
- return -1;
- }
-
- this->cookie_ = be_valuetype::narrow_from_decl (d);
-
- if (this->cookie_ == 0)
- {
- idl_global->err ()->valuetype_expected (d);
- return -1;
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::lookup_exceptions (be_component *node)
-{
- int status = 0;
-
- for (int i = 0; i < N_EXCEPS; ++i)
- {
- status = this->lookup_one_exception (node,
- EXCEP_NAMES[i],
- EXCEPS[i]);
-
- if (status == -1)
- {
- return -1;
- }
- }
-
- this->already_connected_ = EXCEPS[0];
- this->invalid_connection_ = EXCEPS[1];
- this->no_connection_ = EXCEPS[2];
- this->exceeded_connection_limit_ = EXCEPS[3];
- this->create_failure_ = EXCEPS[4];
- this->remove_failure_ = EXCEPS[5];
- this->finder_failure_ = EXCEPS[6];
- this->invalid_key_ = EXCEPS[7];
- this->unknown_key_value_ = EXCEPS[8];
- this->duplicate_key_value_ = EXCEPS[9];
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::lookup_one_exception (be_component *node,
- const char *name,
- be_exception *&result)
-{
- Identifier id (name);
- UTL_ScopedName local_name (&id,
- 0);
- UTL_ScopedName scoped_name (&this->module_id_,
- &local_name);
- AST_Decl *d = node->lookup_by_name (&scoped_name,
- true);
- id.destroy ();
-
- if (d == 0)
- {
- idl_global->err ()->lookup_error (&scoped_name);
- return -1;
- }
-
- result = be_exception::narrow_from_decl (d);
-
- if (result == 0)
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_ccm_pre_proc::create_event_consumer (be_eventtype *node)
-{
- AST_Interface *event_consumer = 0;
- UTL_Scope *s = node->defined_in ();
- AST_Module *m = AST_Module::narrow_from_scope (s);
-
- UTL_ScopedName *consumer_name =
- this->create_scoped_name (0,
- node->local_name (),
- "Consumer",
- ScopeAsDecl (node->defined_in ()));
-
- // We're at global scope here so we need to fool the scope stack
- // for a minute so the correct repo id can be calculated at
- // interface construction time.
- idl_global->scopes ().push (s);
-
- Identifier parent_id ("EventConsumerBase");
- UTL_ScopedName parent_local_name (&parent_id,
- 0);
- UTL_ScopedName parent_full_name (&this->module_id_,
- &parent_local_name);
- UTL_NameList parent_list (&parent_full_name,
- 0);
- FE_InterfaceHeader header (consumer_name,
- &parent_list,
- false,
- false,
- true);
- ACE_NEW_RETURN (event_consumer,
- be_interface (header.name (),
- header.inherits (),
- header.n_inherits (),
- header.inherits_flat (),
- header.n_inherits_flat (),
- false,
- false),
- -1);
- parent_id.destroy ();
-
- // Back to reality.
- idl_global->scopes ().pop ();
-
- event_consumer->set_defined_in (s);
- event_consumer->set_imported (node->imported ());
- event_consumer->set_name (consumer_name);
-
- // Set repo id to 0, so it will be recomputed on the next access,
- // and set the prefix to the eventtype's prefix. All this is
- // necessary in case the eventtype's prefix was modified after
- // its declaration. We assume 'implied IDL' means that the
- // derived event consumer interface should have the same prefix.
- event_consumer->repoID (0);
- event_consumer->prefix (const_cast<char*> (node->prefix ()));
-
- be_type::narrow_from_decl (event_consumer)->gen_fwd_helper_name ();
- m->be_add_interface (event_consumer);
- return this->gen_push_op (node,
- event_consumer);
-}
-
-AST_Interface *
-be_visitor_ccm_pre_proc::lookup_consumer (AST_Component::port_description *pd)
-{
- ACE_CString rettype_string (pd->impl->local_name ()->get_string ());
- rettype_string += "Consumer";
- Identifier rettype_id (rettype_string.fast_rep ());
- AST_Decl *d = pd->impl->defined_in ()->lookup_by_name_local (&rettype_id,
- 0);
- rettype_id.destroy ();
-
- if (d == 0)
- {
- return 0;
- }
-
- AST_Interface *i = AST_Interface::narrow_from_decl (d);
-
- if (i == 0)
- {
- idl_global->err ()->interface_expected (d);
- return 0;
- }
-
- return i;
-}
-
-AST_Interface *
-be_visitor_ccm_pre_proc::create_explicit (be_home *node)
-{
- UTL_NameList *parent_list = this->compute_inheritance (node);
- FE_InterfaceHeader header (0,
- parent_list,
- false,
- false,
- true);
-
- // We're at global scope here so we need to fool the scope stack
- // for a minute so the correct repo id can be calculated at
- // interface construction time.
- idl_global->scopes ().push (node->defined_in ());
-
- UTL_ScopedName *explicit_name =
- this->create_scoped_name (0,
- node->local_name (),
- "Explicit",
- ScopeAsDecl (node->defined_in ()));
-
- AST_Interface *i = 0;
- ACE_NEW_RETURN (i,
- be_interface (explicit_name,
- header.inherits (),
- header.n_inherits (),
- header.inherits_flat (),
- header.n_inherits_flat (),
- false,
- false),
- 0);
-
- // Back to reality.
- idl_global->scopes ().pop ();
-
- i->set_name (explicit_name);
- i->set_defined_in (node->defined_in ());
- i->set_imported (node->imported ());
- be_interface::narrow_from_decl (i)->gen_fwd_helper_name ();
-
- // Reuse the home's decls in the explicit interface. No need
- // to check for name clashes, redefinition, etc. because it
- // has already been done in the home and the explicit interface
- // is empty at this point. Later addition of factory and finder
- // operations will do these checks to make sure they don't
- // clash with the other decls.
- for (UTL_ScopeActiveIterator iter (node, UTL_Scope::IK_decls);
- ! iter.is_done ();
- iter.next ())
- {
- AST_Decl *d = iter.item ();
- d->set_defined_in (i);
- UTL_ScopedName *new_name =
- this->create_scoped_name (0,
- d->local_name ()->get_string (),
- 0,
- i);
- d->set_name (new_name);
- i->add_to_scope (d);
- }
-
- header.destroy ();
- parent_list->destroy ();
- delete parent_list;
- parent_list = 0;
-
- AST_Module *m = AST_Module::narrow_from_scope (node->defined_in ());
- m->be_add_interface (i);
- return i;
-}
-
-AST_Interface *
-be_visitor_ccm_pre_proc::create_implicit (be_home *node)
-{
- Identifier *parent_id = 0;
- ACE_NEW_RETURN (parent_id,
- Identifier ("KeylessCCMHome"),
- 0);
-
- UTL_ScopedName *parent_local_name = 0;
- ACE_NEW_RETURN (parent_local_name,
- UTL_ScopedName (parent_id, 0),
- 0);
-
- UTL_ScopedName *parent_full_name = 0;
- ACE_NEW_RETURN (parent_full_name,
- UTL_ScopedName (this->module_id_.copy (),
- parent_local_name),
- 0);
-
- UTL_NameList parent_list (parent_full_name, 0);
-
- UTL_NameList *parent_list_ptr = 0;
-
- if (node->primary_key () == 0)
- {
- parent_list_ptr = &parent_list;
- }
-
- FE_InterfaceHeader header (0,
- parent_list_ptr,
- false,
- false,
- true);
-
- // We're at global scope here so we need to fool the scope stack
- // for a minute so the correct repo id can be calculated at
- // interface construction time.
- idl_global->scopes ().push (node->defined_in ());
-
- UTL_ScopedName *implicit_name =
- this->create_scoped_name (0,
- node->local_name (),
- "Implicit",
- ScopeAsDecl (node->defined_in ()));
-
- AST_Interface *i = 0;
- ACE_NEW_RETURN (i,
- be_interface (implicit_name,
- header.inherits (),
- header.n_inherits (),
- header.inherits_flat (),
- header.n_inherits_flat (),
- false,
- false),
- 0);
-
- // Back to reality.
- idl_global->scopes ().pop ();
-
- header.destroy ();
- parent_list.destroy ();
-
- i->set_name (implicit_name);
- i->set_defined_in (node->defined_in ());
- i->set_imported (node->imported ());
-
- be_interface::narrow_from_decl (i)->gen_fwd_helper_name ();
- AST_Module *m = AST_Module::narrow_from_scope (node->defined_in ());
- m->be_add_interface (i);
-
- return i;
-}
-
-AST_Interface *
-be_visitor_ccm_pre_proc::create_equivalent (be_home *node,
- AST_Interface *xplicit,
- AST_Interface *implicit)
-{
- UTL_Scope *s = node->defined_in ();
- UTL_ScopedName *equiv_name =
- this->create_scoped_name (0,
- node->local_name (),
- 0,
- ScopeAsDecl (s));
- UTL_NameList tail (implicit->name (),
- 0);
- UTL_NameList parent_list (xplicit->name (),
- &tail);
- FE_InterfaceHeader header (0,
- &parent_list,
- false,
- false,
- true);
-
- // We're at global scope here so we need to fool the scope stack
- // for a minute so the correct repo id can be calculated at
- // interface construction time.
- idl_global->scopes ().push (node->defined_in ());
-
- AST_Interface *retval = 0;
- ACE_NEW_RETURN (retval,
- be_interface (equiv_name,
- header.inherits (),
- header.n_inherits (),
- header.inherits_flat (),
- header.n_inherits_flat (),
- false,
- false),
- 0);
-
- // Back to reality.
- idl_global->scopes ().pop ();
-
- // So we can skip typecode generation.
- retval->home_equiv (true);
-
- retval->set_name (equiv_name);
- retval->set_defined_in (s);
- retval->set_imported (node->imported ());
- be_interface::narrow_from_decl (retval)->gen_fwd_helper_name ();
- UTL_ScopedName *unmangled_name =
- static_cast<UTL_ScopedName *> (node->name ()->copy ());
- UTL_ScopedName *mangled_name =
- this->create_scoped_name (0,
- node->local_name (),
- "_tao_home_name_extension",
- ScopeAsDecl (s));
- node->set_name (mangled_name);
- AST_Module *m = AST_Module::narrow_from_scope (s);
- m->be_add_interface (retval);
- node->set_name (unmangled_name);
- return retval;
-}
-
-UTL_ScopedName *
-be_visitor_ccm_pre_proc::create_scoped_name (const char *prefix,
- const char *local_name,
- const char *suffix,
- AST_Decl *parent)
-{
- ACE_CString local_string (prefix,
- 0,
- 0);
- local_string += local_name;
- local_string += suffix;
- Identifier *local_id = 0;
- ACE_NEW_RETURN (local_id,
- Identifier (local_string.fast_rep ()),
- 0);
- UTL_ScopedName *last_segment = 0;
- ACE_NEW_RETURN (last_segment,
- UTL_ScopedName (local_id,
- 0),
- 0);
- UTL_ScopedName *full_name =
- static_cast<UTL_ScopedName *> (parent->name ()->copy ());
- full_name->nconc (last_segment);
- return full_name;
-}
-
-UTL_NameList *
-be_visitor_ccm_pre_proc::compute_inheritance (be_home *node)
-{
- UTL_NameList *retval = 0;
-
- if (node->base_home () == 0)
- {
- Identifier *local_id = 0;
- ACE_NEW_RETURN (local_id,
- Identifier ("CCMHome"),
- 0);
- UTL_ScopedName *local_name = 0;
- ACE_NEW_RETURN (local_name,
- UTL_ScopedName (local_id,
- 0),
- 0);
- UTL_ScopedName *full_name = 0;
- ACE_NEW_RETURN (full_name,
- UTL_ScopedName (this->module_id_.copy (),
- local_name),
- 0);
- ACE_NEW_RETURN (retval,
- UTL_NameList (full_name,
- 0),
- 0);
-
- }
- else
- {
- ACE_CString new_local (
- node->base_home ()->local_name ()->get_string ()
- );
- new_local += "Explicit";
- UTL_ScopedName *parent_name =
- static_cast<UTL_ScopedName *> (node->base_home ()->name ()->copy ());
- parent_name->last_component ()->replace_string (new_local.c_str ());
- ACE_NEW_RETURN (retval,
- UTL_NameList (parent_name,
- 0),
- 0);
- }
-
- long n_supports = node->n_inherits ();
- UTL_ScopedName *supported_name = 0;
- UTL_NameList *conc_value = 0;
-
- for (long i = 0; i < n_supports; ++i)
- {
- supported_name =
- static_cast<UTL_ScopedName *> (node->inherits ()[i]->name ()->copy ());
- ACE_NEW_RETURN (conc_value,
- UTL_NameList (supported_name,
- 0),
- 0);
- retval->nconc (conc_value);
- }
-
- return retval;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_component.cpp b/TAO/TAO_IDL/be/be_visitor_component.cpp
deleted file mode 100644
index ced6d9ed486..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_component.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Component.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-#include "be_component.h"
-#include "be_attribute.h"
-#include "be_typedef.h"
-#include "be_operation.h"
-#include "be_structure.h"
-#include "be_typedef.h"
-#include "ast_argument.h"
-
-#include "be_visitor_component.h"
-#include "be_visitor_attribute.h"
-#include "be_visitor_operation.h"
-#include "be_visitor_interface.h"
-#include "be_visitor_structure.h"
-#include "be_visitor_typedef.h"
-#include "be_visitor_typecode.h"
-#include "be_visitor_context.h"
-#include "be_helper.h"
-#include "be_extern.h"
-#include "idl_defines.h"
-#include "nr_extern.h"
-#include "ace/Log_Msg.h"
-
-#include "be_visitor_component/component.cpp"
-#include "be_visitor_component/component_ch.cpp"
-#include "be_visitor_component/component_ci.cpp"
-#include "be_visitor_component/component_cs.cpp"
-#include "be_visitor_component/component_sh.cpp"
-#include "be_visitor_component/component_si.cpp"
-#include "be_visitor_component/component_ss.cpp"
-#include "be_visitor_component/component_ih.cpp"
-#include "be_visitor_component/component_is.cpp"
-#include "be_visitor_component/any_op_ch.cpp"
-#include "be_visitor_component/any_op_cs.cpp"
-#include "be_visitor_component/cdr_op_ch.cpp"
-#include "be_visitor_component/cdr_op_cs.cpp"
-
-ACE_RCSID (be,
- be_visitor_component,
- "$Id$")
-
diff --git a/TAO/TAO_IDL/be/be_visitor_component/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_component/any_op_ch.cpp
deleted file mode 100644
index ff140c4ab35..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component/any_op_ch.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for an Component in the client
-// header.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_component,
- any_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Interface visitor for generating Any operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_component_any_op_ch::be_visitor_component_any_op_ch
-(be_visitor_context *ctx)
- : be_visitor_component (ctx)
-{
-}
-
-be_visitor_component_any_op_ch::~be_visitor_component_any_op_ch (void)
-{
-}
-
-int
-be_visitor_component_any_op_ch::visit_component (be_component *node)
-{
- be_visitor_context ctx (*this->ctx_);
- be_visitor_interface_any_op_ch visitor (&ctx);
- return visitor.visit_interface (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_component/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_component/any_op_cs.cpp
deleted file mode 100644
index 9abc8f02047..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component/any_op_cs.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-// $id: any_op_cs.cpp,v 1.12 1998/10/30 19:46:55 levine Exp $
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for Component in the stubs
-// file.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_component,
- any_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Interface visitor for generating Any operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_component_any_op_cs::be_visitor_component_any_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_component (ctx)
-{
-}
-
-be_visitor_component_any_op_cs::~be_visitor_component_any_op_cs (void)
-{
-}
-
-int
-be_visitor_component_any_op_cs::visit_component (be_component *node)
-{
- be_visitor_context ctx (*this->ctx_);
- be_visitor_interface_any_op_cs visitor (&ctx);
- return visitor.visit_interface (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_component/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_component/cdr_op_ch.cpp
deleted file mode 100644
index eba4a289938..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component/cdr_op_ch.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for components. This uses
-// compiled marshaling.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_component,
- cdr_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Interface visitor for generating CDR operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_component_cdr_op_ch::be_visitor_component_cdr_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_component (ctx)
-{
-}
-
-be_visitor_component_cdr_op_ch::~be_visitor_component_cdr_op_ch (void)
-{
-}
-
-int
-be_visitor_component_cdr_op_ch::visit_component (be_component *node)
-{
- be_visitor_context ctx (*this->ctx_);
- be_visitor_interface_cdr_op_ch visitor (&ctx);
- return visitor.visit_interface (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_component/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_component/cdr_op_cs.cpp
deleted file mode 100644
index d69ae7b8a06..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component/cdr_op_cs.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for components
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_component,
- cdr_op_cs,
- "$Id$")
-
-be_visitor_component_cdr_op_cs::be_visitor_component_cdr_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_component (ctx)
-{
-}
-
-be_visitor_component_cdr_op_cs::~be_visitor_component_cdr_op_cs (void)
-{
-}
-
-int
-be_visitor_component_cdr_op_cs::visit_component (be_component *node)
-{
- be_visitor_context ctx (*this->ctx_);
- be_visitor_interface_cdr_op_cs visitor (&ctx);
- return visitor.visit_interface (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_component/component.cpp b/TAO/TAO_IDL/be/be_visitor_component/component.cpp
deleted file mode 100644
index 70b53838e1f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component/component.cpp
+++ /dev/null
@@ -1,359 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// component.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Components. This is a generic visitor.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_component,
- component,
- "$Id$")
-
-// ******************************************************
-// Generic Component visitor
-// ******************************************************
-
-be_visitor_component::be_visitor_component (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_component::~be_visitor_component (void)
-{
-}
-
-int
-be_visitor_component::visit_attribute (be_attribute *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- case TAO_CodeGen::TAO_ROOT_CS:
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_IH:
- case TAO_CodeGen::TAO_ROOT_SS:
- case TAO_CodeGen::TAO_ROOT_IS:
- break;
- default:
- return 0; // nothing to be done
- }
-
- // Same visitor for all the above cases where an action is taken.
- be_visitor_attribute visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component::"
- "visit_attribute - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_component::visit_operation (be_operation *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified ased on what type of node we are visiting
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 1;
-
- switch (this->ctx_->state ())
- {
- // These first two cases may have the context state changed
- // by a strategy, so we use the visitor factory below.
- case TAO_CodeGen::TAO_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_SH:
- {
- be_visitor_operation_sh visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IH:
- {
- be_visitor_operation_ih visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SS:
- {
- be_visitor_operation_ss visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IS:
- {
- be_visitor_operation_is visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- case TAO_CodeGen::TAO_ROOT_CI:
- case TAO_CodeGen::TAO_ROOT_SI:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component::"
- "visit_operation - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == 0)
- {
- return 0;
- }
- else if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component::"
- "visit_operation - "
- "failed to accept visitor\n"),
- -1);
- }
-
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state ()));
-
- // Grab the appropriate visitor.
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component::"
- "visit_operation - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component::"
- "visit_operation - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
-
- // Do additional code generation is necessary.
- // Note, this call is delegated to the strategy connected to
- // the node.
- if (node->has_extra_code_generation (ctx.state ()))
- {
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state (), 1));
-
- // Grab the appropriate visitor.
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component::"
- "visit_operation - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component::"
- "visit_operation - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
- }
-
- return 0;
-}
-
-int
-be_visitor_component::visit_structure (be_structure *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_structure_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_structure_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_structure_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_structure_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_structure_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_structure_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_structure_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component::"
- "visit_structure - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_component::visit_typedef (be_typedef *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_typedef_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_typedef_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_typedef_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_typedef_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_typedef_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_typedef_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_typedef_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_IH:
- case TAO_CodeGen::TAO_ROOT_IS:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component::"
- "visit_typedef - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp
deleted file mode 100644
index 2c7bcb664d0..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp
+++ /dev/null
@@ -1,279 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// component_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Components in the client header.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_component,
- component_ch,
- "$Id$")
-
-// ******************************************************
-// Component visitor for client header
-// ******************************************************
-
-be_visitor_component_ch::be_visitor_component_ch (be_visitor_context *ctx)
- : be_visitor_component (ctx)
-{
-}
-
-be_visitor_component_ch::~be_visitor_component_ch (void)
-{
-}
-
-int
-be_visitor_component_ch::visit_component (be_component *node)
-{
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- // This will be a no-op if it has already been done by a forward
- // declaration.
- node->gen_var_out_seq_decls ();
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Now the interface definition itself.
- os->gen_ifdef_macro (node->flat_name ());
-
- if (!node->is_local () && !node->is_abstract ())
- {
- // Forward class declarations.
- *os << be_nl << be_nl
- << "class " << node->base_proxy_impl_name () << ";" << be_nl
- << "class " << node->remote_proxy_impl_name () << ";" << be_nl
- << "class " << node->base_proxy_broker_name () << ";" << be_nl
- << "class " << node->remote_proxy_broker_name () << ";"
- << be_nl << be_nl;
- }
-
- // Now generate the class definition.
- *os << "class " << be_global->stub_export_macro ()
- << " " << node->local_name () << be_idt_nl
- << ": public virtual ::" ;
-
- AST_Component *parent = node->base_component ();
-
- if (parent != 0)
- {
- *os << parent->name ();
- }
- else
- {
- *os << "Components::CCMObject";
- }
-
- long nsupports = node->n_inherits ();
-
- if (nsupports > 0)
- {
- *os << be_idt;
-
- for (long i = 0; i < nsupports; ++i)
- {
- *os << ", " << be_nl
- << "public virtual ::" << node->supports()[i]->name ();
- }
-
- *os << be_uidt;
- }
-
- *os << be_uidt_nl
- << "{" << be_nl
- << "public:" << be_idt_nl
-
- << "friend class TAO::Narrow_Utils<"
- << node->local_name () << ">;" << be_nl
-
- // Generate the _ptr_type and _var_type typedefs.
- << "typedef " << node->local_name () << "_ptr _ptr_type;"
- << be_nl
- << "typedef " << node->local_name () << "_var _var_type;"
- << be_nl
- << "typedef " << node->local_name () << "_out _out_type;"
- << be_nl;
-
- // Generate the static _duplicate, _narrow, and _nil operations.
- *os << "// The static operations." << be_nl
- << "static " << node->local_name () << "_ptr " << "_duplicate ("
- << node->local_name () << "_ptr obj);" << be_nl << be_nl
- << "static " << node->local_name () << "_ptr "
- << "_narrow (" << be_idt << be_idt_nl
- << "::CORBA::Object_ptr obj" << env_dflts << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // This method is defined in the header file to workaround old
- // g++ problems.
- *os << "static " << node->local_name () << "_ptr _nil (void)"
- << be_idt_nl << "{" << be_idt_nl
- << "return static_cast<" << node->local_name ()
- << "_ptr> (0);" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl;
-
- if (be_global->any_support ())
- {
- *os << "static void _tao_any_destructor (void *);";
- }
-
- // Generate code for the interface definition by traversing thru the
- // elements of its scope. We depend on the front-end to have made sure
- // that only legal syntactic elements appear in our scope.
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component_ch::"
- "visit_component - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- if (! node->is_abstract ())
- {
- node->analyze_parentage ();
- }
-
- // If we inherit from both CORBA::Object and CORBA::AbstractBase,
- // we have to override _add_ref() to avoid ambiguity. A comopnent
- // can have mixed parentage if it supports an abstract or mixed-
- // parentage interface.
- if (node->has_mixed_parentage ())
- {
- *os << be_nl << be_nl
- << "virtual void _add_ref (void);";
- }
-
- *os << be_nl << be_nl
- << "virtual ::CORBA::Boolean _is_a (" << be_idt << be_idt_nl
- << "const char *type_id" << env_dflts << be_uidt_nl
- << ");" << be_uidt;
-
- // The _interface_repository_id method.
- *os << be_nl << be_nl
- << "virtual const char* _interface_repository_id (void) const;";
-
- // The virtual marshal method, to prevent marshal of local iterfaces.
- *os << be_nl << "virtual ::CORBA::Boolean marshal (TAO_OutputCDR &cdr);";
-
- // Add the Proxy Broker member variable.
- *os << be_uidt_nl << be_nl
- << "private:" << be_idt_nl
- << "TAO::Collocation_Proxy_Broker *"
- << "the" << node->base_proxy_broker_name ()
- << "_;";
-
- *os << be_uidt_nl << be_nl
- << "protected:" << be_idt;
-
- // Generate the "protected" constructor so that users cannot
- // instantiate us.
-
- *os << be_nl
- << node->local_name () << " (void);";
-
- *os << be_nl << be_nl
- << "// These methods travese the inheritance tree and set the"
- << be_nl
- << "// parents piece of the given class in the right mode."
- << be_nl
- << "virtual void " << node->flat_name ()
- << "_setup_collocation (void);";
-
- *os << be_nl << be_nl
- << node->local_name () << " (" << be_idt << be_idt_nl
- << "IOP::IOR *ior," << be_nl
- << "TAO_ORB_Core *orb_core = 0" << be_uidt_nl
- << ");" << be_uidt;
-
- *os << be_nl << be_nl
- << node->local_name ()
- << " (" << be_idt << be_idt_nl << "TAO_Stub *objref, " << be_nl
- << "::CORBA::Boolean _tao_collocated = 0," << be_nl
- << "TAO_Abstract_ServantBase *servant = 0," << be_nl
- << "TAO_ORB_Core *oc = 0" << be_uidt_nl
- << ");" << be_uidt;
-
- // Friends declarations.
- *os << be_nl << be_nl
- << "friend class " << node->remote_proxy_impl_name () << ";"
- << be_nl
- << "friend class " << node->direct_proxy_impl_name () << ";";
-
- // Protected destructor.
- *os << be_nl << be_nl
- << "virtual ~" << node->local_name () << " (void);";
-
- // Private copy constructor and assignment operator. These are not
- // allowed, hence they are private.
- *os << be_uidt_nl << be_nl
- << "private:" << be_idt_nl;
- *os << node->local_name () << " (const "
- << node->local_name () << " &);"
- << be_nl
- << "void operator= (const " << node->local_name () << " &);";
-
- *os << be_uidt_nl
- << "};" << be_nl << be_nl;
-
- // List that generates proxy broker factory function pointer.
- be_global->non_local_interfaces.enqueue_tail (node);
-
- be_visitor_context ctx (*this->ctx_);
- if (be_global->gen_smart_proxies ())
- {
- *os << be_nl << be_nl;
- // Smart Proxy related classes.
- ctx.state (TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH);
- be_visitor_interface_smart_proxy_ch sp_visitor (&ctx);
-
- if (node->accept (&sp_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_component_ch::"
- "visit_component - "
- "codegen for smart proxy classes failed\n"),
- -1);
- }
- }
-
- os->gen_endif ();
-
- if (be_global->tc_support ())
- {
- be_visitor_typecode_decl td_visitor (&ctx);
-
- if (node->accept (&td_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component_ch::"
- "visit_component - "
- "TypeCode declaration failed\n"),
- -1);
- }
- }
-
- node->cli_hdr_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp
deleted file mode 100644
index 4b485a558af..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// component_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Components in the client inline.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_component,
- component_ci,
- "$Id$")
-
-// ******************************************************
-// Component visitor for client inline
-// ******************************************************
-
-be_visitor_component_ci::be_visitor_component_ci (be_visitor_context *ctx)
- : be_visitor_component (ctx)
-{
-}
-
-be_visitor_component_ci::~be_visitor_component_ci (void)
-{
-}
-
-int
-be_visitor_component_ci::visit_component (be_component *node)
-{
- if (node->imported () || node->cli_inline_gen ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl;
-
- os->gen_ifdef_macro (node->flat_name (), "");
-
- // Generate the constructor from stub and servant.
- node->gen_stub_ctor (os);
-
- *os << be_nl << be_nl
- << "ACE_INLINE" << be_nl;
- *os << node->name () << "::"
- << node->local_name () << " ("
- << be_idt << be_idt_nl
- << "IOP::IOR *ior," << be_nl
- << "TAO_ORB_Core *oc" << be_uidt_nl
- << ")" << be_uidt_nl
- << ": ::CORBA::Object (ior, oc)" << be_uidt_nl
- << "{" << be_nl
- << "}" ;
-
- os->gen_endif ();
- node->cli_inline_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp
deleted file mode 100644
index 4e8cc346e23..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp
+++ /dev/null
@@ -1,335 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// component_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Components in the client stub.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_component,
- component_cs,
- "$Id$")
-
-// ******************************************************
-// Component visitor for client stub
-// ******************************************************
-
-be_visitor_component_cs::be_visitor_component_cs (be_visitor_context *ctx)
- : be_visitor_component (ctx)
-{
-}
-
-be_visitor_component_cs::~be_visitor_component_cs (void)
-{
-}
-
-int
-be_visitor_component_cs::visit_component (be_component *node)
-{
- if (node->cli_stub_gen () || node->imported ())
- {
- return 0;
- }
-
- be_type *bt;
-
- // Set the right type.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- if (node->is_defined ())
- {
- *os << be_nl << be_nl
- << "// Traits specializations for " << node->name () << ".";
-
- *os << be_nl << be_nl
- << node->name () << "_ptr" << be_nl
- << "TAO::Objref_Traits<" << node->name () << ">::duplicate ("
- << be_idt << be_idt_nl
- << node->name () << "_ptr p" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return " << node->name () << "::_duplicate (p);" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "void" << be_nl
- << "TAO::Objref_Traits<" << node->name () << ">::release ("
- << be_idt << be_idt_nl
- << node->name () << "_ptr p" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::release (p);" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << node->name () << "_ptr" << be_nl
- << "TAO::Objref_Traits<" << node->name () << ">::nil (void)"
- << be_nl
- << "{" << be_idt_nl
- << "return " << node->name () << "::_nil ();" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "::CORBA::Boolean" << be_nl
- << "TAO::Objref_Traits<" << node->name () << ">::marshal ("
- << be_idt << be_idt_nl
- << "const " << node->name () << "_ptr p," << be_nl
- << "TAO_OutputCDR & cdr" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return cdr << p;" << be_uidt_nl
- << "}";
- }
-
- if (node->has_mixed_parentage ())
- {
- *os << be_nl << be_nl
- << "void" << be_nl
- << "CORBA::release ("
- << node->name ()
- << "_ptr p)" << be_nl
- << "{" << be_idt_nl
- << "::CORBA::AbstractBase_ptr abs = p;" << be_nl
- << "::CORBA::release (abs);" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "::CORBA::Boolean" << be_nl
- << "CORBA::is_nil ("
- << node->name ()
- << "_ptr p)" << be_nl
- << "{" << be_idt_nl
- << "::CORBA::Object_ptr obj = p;" << be_nl
- << "return ::CORBA::is_nil (obj);" << be_uidt_nl
- << "}";
- }
-
- // Generate the proxy broker factory function pointer definition.
- *os << be_nl << be_nl
- << "// Function pointer for collocation factory initialization."
- << be_nl
- << "TAO::Collocation_Proxy_Broker * " << be_nl
- << "(*" << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function_pointer) ("
- << be_idt << be_idt_nl
- << "::CORBA::Object_ptr obj" << be_uidt_nl
- << ") = 0;" << be_uidt;
-
- // Generate the destructor and default constructor.
- *os << be_nl << be_nl
- << node->name () << "::~" << node->local_name ()
- << " (void)" << be_nl;
- *os << "{}" << be_nl << be_nl;
-
- *os << node->name () << "::" << node->local_name ()
- << " (void)" << be_nl
- << "{" << be_idt_nl
- << "this->" << node->flat_name ()
- << "_setup_collocation ();" << be_uidt_nl
- << be_uidt << "}" << be_nl << be_nl;
-
- // Collocation setup method.
- *os << "void" << be_nl
- << node->name () << "::" << node->flat_name ()
- << "_setup_collocation (void)" << be_nl
- << "{" << be_idt_nl
- << "if ("<< "::" << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function_pointer)" << be_idt_nl
- << "this->the" << node->base_proxy_broker_name ()
- << "_ =" << be_idt_nl
- << "::" << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function_pointer (this);"
- << be_uidt << be_uidt_nl;
-
- AST_Component *base = node->base_component ();
-
- if (base != 0)
- {
- *os << be_nl
- << "this->" << base->flat_name ()
- << "_setup_collocation" << " ();";
- }
-
- *os << be_uidt_nl << "}" << be_nl << be_nl;
-
- if (be_global->any_support ())
- {
- *os << "void " << be_nl
- << node->name ()
- << "::_tao_any_destructor (void *_tao_void_pointer)" << be_nl
- << "{" << be_idt_nl
- << node->local_name () << " *_tao_tmp_pointer = static_cast<"
- << node->local_name () << " *> (_tao_void_pointer);" << be_nl
- << "::CORBA::release (_tao_tmp_pointer);" << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
-
- if (node->has_mixed_parentage ())
- {
- *os << "void" << be_nl
- << node->name () << "::_add_ref (void)" << be_nl
- << "{" << be_idt_nl
- << "this->::CORBA::Object::_add_ref ();"
- << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
-
- // The _narrow method.
- *os << node->full_name () << "_ptr" << be_nl << node->full_name ()
- << "::_narrow (" << be_idt << be_idt_nl
- << "::CORBA::Object_ptr"
- << " _tao_objref" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- *os << "return" << be_idt_nl
- << "TAO::Narrow_Utils<"
- << node->local_name () << ">::narrow (";
-
- *os << be_idt << be_idt_nl
- << "_tao_objref," << be_nl
- << "\"" << node->repoID () << "\"," << be_nl
- << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function_pointer" << env_arg << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // The _duplicate method
- *os << node->full_name () << "_ptr" << be_nl
- << node->full_name () << "::_duplicate ("
- << bt->nested_type_name (this->ctx_->scope ())
- << "_ptr obj)" << be_nl
- << "{" << be_idt_nl
- << "if (! ::CORBA::is_nil (obj))" << be_idt_nl
- << "{" << be_idt_nl
- << "obj->_add_ref ();" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "return obj;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // The is_a method.
- *os << "::CORBA::Boolean" << be_nl
- << node->full_name () << "::_is_a (" << be_idt << be_idt_nl
- << "const char *value" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "if (" << be_idt << be_idt_nl;
-
- AST_Component *ancestor = node;
-
- while (ancestor != 0)
- {
- *os << "!ACE_OS::strcmp (" << be_idt << be_idt_nl
- << "(char *)value," << be_nl
- << "\"" << ancestor->repoID () << "\"" << be_uidt_nl
- << ") ||" << be_uidt_nl;
-
- ancestor = ancestor->base_component ();
- }
-
- *os << "!ACE_OS::strcmp (" << be_idt << be_idt_nl
- << "(char *)value," << be_nl
- << "\"IDL:omg.org/Components/CCMObject:1.0\"" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << " )" << be_nl
- << "{" << be_idt_nl
- << "return true; // success using local knowledge" << be_uidt_nl
- << "}" << be_uidt_nl
- << "else" << be_idt_nl
- << "{" << be_idt_nl
- << "return this->::CORBA::Object::_is_a ("
- << be_idt << be_idt_nl
- << "value" << env_arg << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "const char*" << be_nl
- << node->full_name ()
- << "::_interface_repository_id (void) const"
- << be_nl
- << "{" << be_idt_nl
- << "return \"" << node->repoID ()
- << "\";" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "::CORBA::Boolean" << be_nl
- << node->name () << "::marshal (TAO_OutputCDR &cdr)" << be_nl
- << "{" << be_idt_nl
- << "return (cdr << this);" << be_uidt_nl
- << "}";
-
- // Generate code for the elements of the component.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component_cs::"
- "visit_component - "
- "codegen for scope failed\n"),
- -1);
- }
-
- be_visitor_context ctx (*this->ctx_);
-
- // Smart Proxy classes.
- if (be_global->gen_smart_proxies ())
- {
- ctx.state (TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS);
- be_visitor_interface_smart_proxy_cs isp_visitor (&ctx);
-
- if (node->accept (&isp_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_component_cs::"
- "visit_component - "
- "codegen for smart proxy classes failed\n"),
- -1);
- }
- }
-
- if (be_global->tc_support ())
- {
- // ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- TAO::be_visitor_objref_typecode tc_visitor (&ctx);
-
- if (node->accept (&tc_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component_cs::"
- "visit_component - "
- "TypeCode definition failed\n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ih.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ih.cpp
deleted file mode 100644
index 9b710986475..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component/component_ih.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// component_ih.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the implementation header
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_component,
- component_ih,
- "$Id$")
-
-// ************************************************************
-// Interface visitor for implementation header.
-// ************************************************************
-
-be_visitor_component_ih::be_visitor_component_ih (be_visitor_context *ctx)
- : be_visitor_component (ctx)
-{
-}
-
-be_visitor_component_ih::~be_visitor_component_ih (void)
-{
-}
-
-int
-be_visitor_component_ih::visit_component (be_component *node)
-{
- be_visitor_context ctx (*this->ctx_);
- be_visitor_interface_ih visitor (&ctx);
- return visitor.visit_interface (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_is.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_is.cpp
deleted file mode 100644
index 5acd37d6a98..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component/component_is.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// component_is.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Components
-// in the implementation skeletons file.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-// ************************************************************
-// Component visitor for implementation skeletons.
-// ************************************************************
-
-ACE_RCSID (be_visitor_component,
- component_is,
- "$Id$")
-
-be_visitor_component_is::be_visitor_component_is (be_visitor_context *ctx)
- : be_visitor_component (ctx)
-{
-}
-
-be_visitor_component_is::~be_visitor_component_is (void)
-{
-}
-
-int
-be_visitor_component_is::visit_component (be_component *node)
-{
- be_visitor_context ctx (*this->ctx_);
- be_visitor_interface_is visitor (&ctx);
- return visitor.visit_interface (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp
deleted file mode 100644
index f08209f25a7..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp
+++ /dev/null
@@ -1,306 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// component_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Components in the server header.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_component,
- component_sh,
- "$Id$")
-
-// ******************************************************
-// Component visitor for server header
-// ******************************************************
-
-be_visitor_component_sh::be_visitor_component_sh (be_visitor_context *ctx)
- : be_visitor_component (ctx)
-{
-}
-
-be_visitor_component_sh::~be_visitor_component_sh (void)
-{
-}
-
-int
-be_visitor_component_sh::visit_component (be_component *node)
-{
- if (node->srv_hdr_gen ()
- || node->imported ()
- || node->is_abstract ())
- {
- return 0;
- }
-
- if (be_global->gen_amh_classes ())
- {
- be_visitor_amh_interface_sh amh_intf (this->ctx_);
-
- if (amh_intf.visit_interface (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_component_sh::"
- "visit_component - "
- "codegen for AMH classes failed\n"),
- -1);
- }
- }
-
- if (this->generate_amh_classes (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_sh::"
- "visit_interface - "
- "codegen for AMH classes failed\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- ACE_CString class_name;
-
- // We shall have a POA_ prefix only if we are at the topmost level.
- if (!node->is_nested ())
- {
- // We are outermost.
- class_name += "POA_";
- class_name += node->local_name ();
- }
- else
- {
- class_name += node->local_name ();
- }
-
- *os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Generate the skeleton class name.
- *os << "class " << class_name.c_str () << ";" << be_nl;
-
- // Generate the _ptr declaration.
- *os << "typedef " << class_name.c_str () << " *" << class_name.c_str ()
- << "_ptr;" << be_nl << be_nl;
-
- if (be_global->gen_direct_collocation ())
- {
- *os << "class " << node->direct_proxy_impl_name () << ";" << be_nl;
- }
-
- if (be_global->gen_direct_collocation ())
- {
- *os << "class " << node->strategized_proxy_broker_name ()
- << ";" << be_nl;
- }
-
- *os << be_nl;
-
- // Now generate the class definition.
- *os << "class " << be_global->skel_export_macro ()
- << " " << class_name.c_str () << be_idt_nl << ": " << be_idt;
-
- AST_Component *base = node->base_component ();
-
- if (base != 0)
- {
- *os << "public virtual POA_" << base->name ();
- }
- else
- {
- *os << "public virtual POA_Components::CCMObject";
- }
-
- long nsupports = node->n_inherits ();
- AST_Interface **supports = node->supports ();
- AST_Interface *supported = 0;
-
- for (long i = 0; i < nsupports; ++i)
- {
- supported = supports[i];
-
- if (supported->is_abstract ())
- {
- continue;
- }
-
- *os << "," << be_nl;
- *os << "public virtual POA_" << supported->name ();
- }
-
- *os << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "protected:" << be_idt_nl;
-
- // Default constructor.
- *os << class_name.c_str () << " (void);" << be_uidt_nl << be_nl
- << "public:" << be_idt_nl;
-
- // Some useful typedefs.
- *os << "// Useful for template programming." << be_nl
- << "typedef ::" << node->name () << " _stub_type;" << be_nl
- << "typedef ::" << node->name () << "_ptr _stub_ptr_type;" << be_nl
- << "typedef ::" << node->name () << "_var _stub_var_type;"
- << be_nl << be_nl;
-
- // Copy constructor and destructor.
- *os << class_name.c_str () << " (const "
- << class_name.c_str () << "& rhs);" << be_nl
- << "virtual ~" << class_name.c_str () << " (void);" << be_nl << be_nl;
-
- // _is_a
- *os << "virtual ::CORBA::Boolean _is_a (" << be_idt << be_idt_nl
- << "const char* logical_type_id" << env_dflts << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add a skeleton for our _is_a method.
- *os << "static void _is_a_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest &req," << be_nl
- << "void *servant," << be_nl
- << "void *servant_upcall" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add a skeleton for our _non_existent method.
- *os << "static void _non_existent_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest &req," << be_nl
- << "void *servant," << be_nl
- << "void *servant_upcall" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add a skeleton for our _interface method.
- *os << "static void _interface_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest &req," << be_nl
- << "void *servant," << be_nl
- << "void *servant_upcall" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add a skeleton for our _component method.
- *os << "static void _component_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *servant_upcall" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add a skeleton for our _repository_id method.
- *os << "static void _repository_id_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest &req," << be_nl
- << "void *servant," << be_nl
- << "void *servant_upcall" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add the dispatch method.
- *os << "virtual void _dispatch (" << be_idt << be_idt_nl
- << "TAO_ServerRequest &req," << be_nl
- << "void *_servant_upcall" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // _this
- *os << "::" << node->full_name () << " *_this (" << be_idt << be_idt
- << env_dflts << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // _interface_repository_id
- *os << "virtual const char* _interface_repository_id "
- << "(void) const;";
-
- // Generate code for elements in the scope (e.g., operations).
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_component_sh::"
- "visit_component - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // Generate skeletons for operations of our base classes. These
- // skeletons just cast the pointer to the appropriate type
- // before invoking the call.
- int status =
- node->traverse_inheritance_graph (
- be_interface::gen_skel_helper,
- os
- );
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_component_sh::"
- "visit_component - "
- "inheritance graph traversal failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << "};" << be_nl << be_nl;
-
- be_visitor_context ctx (*this->ctx_);
-
- if (be_global->gen_direct_collocation ())
- {
- ctx = *this->ctx_;
- // Generate strategized proxy broker.
- be_visitor_interface_strategized_proxy_broker_sh ispb_visitor (&ctx);
-
- if (node->accept (&ispb_visitor) == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "be_visitor_component_sh::"
- "visit_component - "
- "codegen for collocated class failed\n"
- ),
- -1
- );
- }
- }
-
- ctx = *this->ctx_;
-
- // Generate the collocated class.
-
- ctx = *this->ctx_;
-
- if (be_global->gen_direct_collocation ())
- {
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH);
- be_visitor_interface_direct_proxy_impl_sh idpi_visitor (&ctx);
-
- if (node->accept (&idpi_visitor) == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "be_visitor_component_sh::"
- "visit_component - "
- "codegen for direct collocated class failed\n"
- ),
- -1
- );
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_component_sh::generate_amh_classes (be_component *node)
-{
- if (be_global->gen_amh_classes ())
- {
- be_visitor_amh_interface_sh amh_intf (this->ctx_);
- return amh_intf.visit_interface (node);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_si.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_si.cpp
deleted file mode 100644
index 1e54cc1218e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component/component_si.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// component_si.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Components in the server inline.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_component,
- component_si,
- "$Id$")
-
-// ******************************************************
-// Component visitor for server inline
-// ******************************************************
-
-be_visitor_component_si::be_visitor_component_si (be_visitor_context *ctx)
- : be_visitor_component (ctx)
-{
-}
-
-be_visitor_component_si::~be_visitor_component_si (void)
-{
-}
-
-int
-be_visitor_component_si::visit_component (be_component *node)
-{
- be_visitor_context ctx (*this->ctx_);
- be_visitor_interface_si visitor (&ctx);
- return visitor.visit_interface (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ss.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ss.cpp
deleted file mode 100644
index e318af98c75..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component/component_ss.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// component_si.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Components in the server skeleton.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_component,
- component_ss,
- "$Id$")
-
-// ******************************************************
-// Component visitor for server skeleton
-// ******************************************************
-
-be_visitor_component_ss::be_visitor_component_ss (be_visitor_context *ctx)
- : be_visitor_component (ctx)
-{
-}
-
-be_visitor_component_ss::~be_visitor_component_ss (void)
-{
-}
-
-int
-be_visitor_component_ss::visit_component (be_component *node)
-{
- be_visitor_context ctx (*this->ctx_);
- be_visitor_interface_ss visitor (&ctx);
- return visitor.visit_interface (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_component_fwd.cpp b/TAO/TAO_IDL/be/be_visitor_component_fwd.cpp
deleted file mode 100644
index baf29faad36..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component_fwd.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_component_fwd.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for forward declared Component
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-#include "be_component_fwd.h"
-#include "be_helper.h"
-
-#include "be_visitor_component_fwd.h"
-#include "be_visitor_interface_fwd.h"
-#include "be_visitor_context.h"
-
-#include "be_visitor_component_fwd/component_fwd_ch.cpp"
-#include "be_visitor_component_fwd/any_op_ch.cpp"
-#include "be_visitor_component_fwd/cdr_op_ch.cpp"
-
-ACE_RCSID (be,
- be_visitor_component_fwd,
- "$Id$")
-
diff --git a/TAO/TAO_IDL/be/be_visitor_component_fwd/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_component_fwd/any_op_ch.cpp
deleted file mode 100644
index bfa9474be87..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component_fwd/any_op_ch.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for a forward declared
-// component in the client header.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_component_fwd,
- any_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Generates Any operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_component_fwd_any_op_ch::be_visitor_component_fwd_any_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_component_fwd_any_op_ch::~be_visitor_component_fwd_any_op_ch (void)
-{
-}
-
-int
-be_visitor_component_fwd_any_op_ch::visit_component_fwd (
- be_component_fwd *node
- )
-{
- be_visitor_context ctx (*this->ctx_);
- be_visitor_interface_fwd_any_op_ch visitor (&ctx);
- return visitor.visit_interface_fwd (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_component_fwd/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_component_fwd/cdr_op_ch.cpp
deleted file mode 100644
index b532b2f8248..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component_fwd/cdr_op_ch.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for forward declared
-// components. This uses compiled marshaling.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_component_fwd,
- cdr_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Forward declared component visitor for generating CDR operator declarations
-// in the client header. Called if this node is not later defined in the file.
-// ***************************************************************************
-
-be_visitor_component_fwd_cdr_op_ch::be_visitor_component_fwd_cdr_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_component_fwd_cdr_op_ch::~be_visitor_component_fwd_cdr_op_ch (void)
-{
-}
-
-int
-be_visitor_component_fwd_cdr_op_ch::visit_component_fwd (be_component_fwd *node)
-{
- be_visitor_context ctx (*this->ctx_);
- be_visitor_interface_fwd_cdr_op_ch visitor (&ctx);
- return visitor.visit_interface_fwd (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_component_fwd/component_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_component_fwd/component_fwd_ch.cpp
deleted file mode 100644
index 8e3336853b4..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_component_fwd/component_fwd_ch.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// component_fwd_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Component_Fwd node in the client header.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_component_fwd,
- component_fwd_ch,
- "$Id$")
-
-// ********************************************************************
-// Visitor implementation for the Component_Fwd type
-// This one for the client header file
-// ********************************************************************
-
-be_visitor_component_fwd_ch::be_visitor_component_fwd_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_component_fwd_ch::~be_visitor_component_fwd_ch (void)
-{
-}
-
-// Visit the component_fwd_ch node and its scope.
-int
-be_visitor_component_fwd_ch::visit_component_fwd (be_component_fwd *node)
-{
- be_visitor_context ctx (*this->ctx_);
- be_visitor_interface_fwd_ch visitor (&ctx);
- return visitor.visit_interface_fwd (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_constant.cpp b/TAO/TAO_IDL/be/be_visitor_constant.cpp
deleted file mode 100644
index 31fe34ea8fc..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_constant.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_constant.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Constant
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_constant.h"
-#include "be_module.h"
-#include "be_helper.h"
-#include "be_extern.h"
-#include "be_typedef.h"
-#include "utl_identifier.h"
-
-#include "be_visitor_constant.h"
-#include "be_visitor_context.h"
-
-#include "be_visitor_constant/constant_ch.cpp"
-#include "be_visitor_constant/constant_cs.cpp"
-
-ACE_RCSID (be,
- be_visitor_constant,
- "$Id$")
-
diff --git a/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp b/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp
deleted file mode 100644
index 87eb012138e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// constant_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the Constant node in the client header.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_constant,
- constant_ch,
- "$Id$")
-
-
-// ********************************************************************
-// Visitor implementation for the Constant type
-// This one for the client header file
-// ********************************************************************
-
-be_visitor_constant_ch::be_visitor_constant_ch (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_constant_ch::~be_visitor_constant_ch (void)
-{
-}
-
-// Visit the Constant node and its scope.
-int
-be_visitor_constant_ch::visit_constant (be_constant *node)
-{
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // If we are defined in the outermost scope, then the value is assigned
- // to us here itself, else it will be in the *.cpp file.
-
- AST_Decl::NodeType nt = AST_Decl::NT_pre_defined;
- AST_Decl *tdef = node->constant_value ()->get_tdef ();
- AST_Decl::NodeType bnt = AST_Decl::NT_pre_defined;
- AST_Expression::ExprType etype = node->et ();
- AST_Decl::NodeType snt = node->defined_in ()->scope_node_type ();
-
- if (tdef != 0)
- {
- nt = tdef->node_type ();
- be_typedef *td = be_typedef:: narrow_from_decl (tdef);
- bnt = td->base_node_type ();
- }
-
- *os << be_nl << be_nl;
-
- if (! node->is_nested ())
- {
- *os << "const ";
-
- if (etype == AST_Expression::EV_enum)
- {
- *os << node->enum_full_name ();
- }
- else if (nt == AST_Decl::NT_typedef)
- {
- *os << tdef->name ();
- }
- else
- {
- *os << node->exprtype_to_string ();
- }
-
- *os << " " << node->local_name ();
- }
- // We are nested inside an interface or a valuetype.
- else
- {
- if (snt != AST_Decl::NT_module)
- {
- *os << "static ";
- }
- else if (!be_global->gen_inline_constants ())
- {
- *os << "TAO_NAMESPACE_STORAGE_CLASS ";
- }
-
- *os << "const ";
-
- if (etype == AST_Expression::EV_enum)
- {
- *os << node->enum_full_name ();
- }
- else if (nt == AST_Decl::NT_typedef)
- {
- if (bnt == AST_Decl::NT_string || bnt == AST_Decl::NT_wstring)
- {
- *os << node->exprtype_to_string ();
- }
- else
- {
- *os << tdef->name ();
- }
- }
- else
- {
- *os << node->exprtype_to_string ();
- }
-
- *os << " " << node->local_name ();
- }
-
- // If this is true, can't generate inline constants.
- bool forbidden_in_class = (snt != AST_Decl::NT_root
- && snt != AST_Decl::NT_module
- && (etype == AST_Expression::EV_string
- || etype == AST_Expression::EV_wstring
- || etype == AST_Expression::EV_float
- || etype == AST_Expression::EV_double
- || etype == AST_Expression::EV_longdouble));
-
- if (!node->is_nested ()
- || (be_global->gen_inline_constants () && !forbidden_in_class))
- {
- *os << " = " << node->constant_value ();
- }
-
- *os << ";";
-
- node->cli_hdr_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp b/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp
deleted file mode 100644
index 7323ebf54b6..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// constant_cs.cpp
-//
-// = DESCRIPTION
-// Visitor for code generation of Constant code in the client stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_constant,
- constant_cs,
- "$Id$")
-
-
-// ********************************************************************
-// Visitor implementation for the Constant type
-// This one for the client stubs file
-// ********************************************************************
-
-be_visitor_constant_cs::be_visitor_constant_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_constant_cs::~be_visitor_constant_cs (void)
-{
-}
-
-// visit the Constant_cs node and its scope
-int
-be_visitor_constant_cs::visit_constant (be_constant *node)
-{
-
- if (node->cli_stub_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- AST_Expression::ExprType etype = node->et ();
- AST_Decl::NodeType snt = node->defined_in ()->scope_node_type ();
-
- // If this is true, can't generate inline constants.
- bool forbidden_in_class = (snt != AST_Decl::NT_root
- && snt != AST_Decl::NT_module
- && (etype == AST_Expression::EV_string
- || etype == AST_Expression::EV_wstring
- || etype == AST_Expression::EV_float
- || etype == AST_Expression::EV_double
- || etype == AST_Expression::EV_longdouble));
-
- if (!node->is_nested ()
- || (be_global->gen_inline_constants () && !forbidden_in_class))
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (node->is_nested ())
- {
- // For those constants not defined in the outermost scope,
- // or in a module, they get assigned to their values in the source file.
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl << be_nl
- << "const ";
-
- if (node->et () == AST_Expression::EV_enum)
- {
- *os << node->enum_full_name ();
- }
- else
- {
- *os << node->exprtype_to_string ();
- }
-
- *os << " "
- << node->name () << " = " << node->constant_value ()
- << ";";
- }
-
- node->cli_stub_gen (true);
- return 0;
-}
-
-// The following needs to be done until the MSVC++ compiler fixes its
-// broken handling of namespaces (hopefully forthcoming in version 7).
-int
-be_visitor_constant_cs::gen_nested_namespace_begin (be_module *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- char *item_name = 0;
-
- for (UTL_IdListActiveIterator i (node->name ()); !i.is_done (); i.next ())
- {
- item_name = i.item ()->get_string ();
-
- if (ACE_OS::strcmp (item_name, "") != 0)
- {
- // leave the outermost root scope.
- *os << "namespace " << item_name << be_nl
- << "{" << be_nl;
- }
- }
-
- return 0;
-}
-
-// The following needs to be done until the MSVC++ compiler fixes its
-// broken handling of namespaces (hopefully forthcoming in version 7).
-int
-be_visitor_constant_cs::gen_nested_namespace_end (be_module *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- for (UTL_IdListActiveIterator i (node->name ()); !i.is_done (); i.next ())
- {
- if (ACE_OS::strcmp (i.item ()->get_string (), "") != 0)
- {
- // leave the outermost root scope.
- *os << "}" << be_nl;
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_context.cpp b/TAO/TAO_IDL/be/be_visitor_context.cpp
deleted file mode 100644
index d0bf0cd1a4b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_context.cpp
+++ /dev/null
@@ -1,654 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_context.cpp
-//
-// = DESCRIPTION
-// Maintains the context information for visitors
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_argument.h"
-#include "be_array.h"
-#include "be_attribute.h"
-#include "be_constant.h"
-#include "be_enum.h"
-#include "be_enum_val.h"
-#include "be_exception.h"
-#include "be_extern.h"
-#include "be_field.h"
-#include "be_interface.h"
-#include "be_interface_fwd.h"
-#include "be_module.h"
-#include "be_operation.h"
-#include "be_predefined_type.h"
-#include "be_root.h"
-#include "be_sequence.h"
-#include "be_string.h"
-#include "be_structure.h"
-#include "be_typedef.h"
-#include "be_union.h"
-#include "be_union_branch.h"
-
-#include "be_visitor_context.h"
-
-ACE_RCSID (be,
- be_visitor_context,
- "$Id$")
-
-
-// constructor
-be_visitor_context::be_visitor_context (void)
- : state_ (TAO_CodeGen::TAO_INITIAL),
- sub_state_ (TAO_CodeGen::TAO_SUB_STATE_UNKNOWN),
- os_ (0),
- scope_ (0),
- node_ (0),
- alias_ (0),
- tdef_ (0),
- attr_ (0),
- exception_ (0),
- comma_ (0),
- interface_ (0)
-{
-}
-
-be_visitor_context::be_visitor_context (const be_visitor_context &ctx)
- : state_ (ctx.state_),
- sub_state_ (ctx.sub_state_),
- os_ (ctx.os_),
- scope_ (ctx.scope_),
- node_ (ctx.node_),
- alias_ (ctx.alias_),
- tdef_ (ctx.tdef_),
- attr_ (ctx.attr_),
- exception_ (ctx.exception_),
- comma_ (ctx.comma_),
- interface_ (ctx.interface_)
-{
-}
-
-be_visitor_context &
-be_visitor_context::operator= (const be_visitor_context &ctx)
-{
- this->state_ = ctx.state_;
- this->sub_state_ = ctx.sub_state_;
- this->os_ = ctx.os_;
- this->scope_ = ctx.scope_;
- this->node_ = ctx.node_;
- this->alias_ = ctx.alias_;
- this->tdef_ = ctx.tdef_;
- this->attr_ = ctx.attr_;
- this->exception_ = ctx.exception_;
- this->comma_ = ctx.comma_;
- this->interface_ = ctx.interface_;
-
- return *this;
-}
-
-be_visitor_context::~be_visitor_context (void)
-{
- // we do not own anything
-}
-
-//= helpers
-
-void
-be_visitor_context::reset (void)
-{
- this->state_ = TAO_CodeGen::TAO_INITIAL;
- this->sub_state_ = TAO_CodeGen::TAO_SUB_STATE_UNKNOWN;
- this->os_ = 0;
- this->scope_ = 0;
- this->node_ = 0;
- this->alias_ = 0;
- this->tdef_ = 0;
- this->attr_ = 0;
- this->exception_ = 0;
- this->comma_ = 0;
-}
-
-void
-be_visitor_context::stream (TAO_OutStream *os)
-{
- this->os_ = os;
-}
-
-TAO_OutStream *
-be_visitor_context::stream (void)
-{
- return this->os_;
-}
-
-void
-be_visitor_context::scope (be_decl *s)
-{
- this->scope_ = s;
-}
-
-be_decl *
-be_visitor_context::scope (void)
-{
- return this->scope_;
-}
-
-void
-be_visitor_context::node (be_decl *n)
-{
- this->node_ = n;
-}
-
-be_decl *
-be_visitor_context::node (void)
-{
- return this->node_;
-}
-
-void
-be_visitor_context::state (TAO_CodeGen::CG_STATE st)
-{
- this->state_ = st;
-}
-
-TAO_CodeGen::CG_STATE
-be_visitor_context::state (void)
-{
- return this->state_;
-}
-
-void
-be_visitor_context::sub_state (TAO_CodeGen::CG_SUB_STATE st)
-{
- this->sub_state_ = st;
-}
-
-TAO_CodeGen::CG_SUB_STATE
-be_visitor_context::sub_state (void)
-{
- return this->sub_state_;
-}
-
-void
-be_visitor_context::tdef (be_typedef *node)
-{
- this->tdef_ = node;
-}
-
-be_typedef *
-be_visitor_context::tdef (void)
-{
- return this->tdef_;
-}
-
-void
-be_visitor_context::alias (be_typedef *node)
-{
- this->alias_ = node;
-}
-
-be_typedef *
-be_visitor_context::alias (void)
-{
- return this->alias_;
-}
-
-void
-be_visitor_context::attribute (be_attribute *node)
-{
- this->attr_ = node;
-}
-
-be_attribute *
-be_visitor_context::attribute (void)
-{
- return this->attr_;
-}
-
-void
-be_visitor_context::exception (bool ib)
-{
- this->exception_ = ib;
-}
-
-bool
-be_visitor_context::exception (void)
-{
- return this->exception_;
-}
-
-void
-be_visitor_context::comma (bool ib)
-{
- this->comma_ = ib;
-}
-
-bool
-be_visitor_context::comma (void)
-{
- return this->comma_;
-}
-
-void
-be_visitor_context::interface (be_interface *interface)
-{
- this->interface_ = interface;
-}
-
-be_interface *
-be_visitor_context::interface (void) const
-{
- return this->interface_;
-}
-
-// ****************************************************************
-
-be_argument *
-be_visitor_context::be_node_as_argument (void)
-{
- if (this->node_ != 0)
- {
- return be_argument::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_array *
-be_visitor_context::be_node_as_array (void)
-{
- if (this->node_ != 0)
- {
- return be_array::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_attribute *
-be_visitor_context::be_node_as_attribute (void)
-{
- if (this->node_ != 0)
- {
- return be_attribute::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_constant *
-be_visitor_context::be_node_as_constant (void)
-{
- if (this->node_ != 0)
- {
- return be_constant::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_enum *
-be_visitor_context::be_node_as_enum (void)
-{
- if (this->node_ != 0)
- {
- return be_enum::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_enum_val *
-be_visitor_context::be_node_as_enum_val (void)
-{
- if (this->node_ != 0)
- {
- return be_enum_val::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_exception *
-be_visitor_context::be_node_as_exception (void)
-{
- if (this->node_ != 0)
- {
- return be_exception::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_field *
-be_visitor_context::be_node_as_field (void)
-{
- if (this->node_ != 0)
- {
- return be_field::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_interface *
-be_visitor_context::be_node_as_interface (void)
-{
- if (this->node_ != 0)
- {
- return be_interface::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_interface_fwd *
-be_visitor_context::be_node_as_interface_fwd (void)
-{
- if (this->node_ != 0)
- {
- return be_interface_fwd::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_module *
-be_visitor_context::be_node_as_module (void)
-{
- if (this->node_ != 0)
- {
- return be_module::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_operation *
-be_visitor_context::be_node_as_operation (void)
-{
- if (this->node_ != 0)
- {
- return be_operation::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_predefined_type *
-be_visitor_context::be_node_as_predefined_type (void)
-{
- if (this->node_ != 0)
- {
- return be_predefined_type::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_root *
-be_visitor_context::be_node_as_root (void)
-{
- if (this->node_ != 0)
- {
- return be_root::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_sequence *
-be_visitor_context::be_node_as_sequence (void)
-{
- if (this->node_ != 0)
- {
- return be_sequence::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_string *
-be_visitor_context::be_node_as_string (void)
-{
- if (this->node_ != 0)
- {
- return be_string::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_structure *
-be_visitor_context::be_node_as_structure (void)
-{
- if (this->node_ != 0)
- {
- return be_structure::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_typedef *
-be_visitor_context::be_node_as_typedef (void)
-{
- if (this->node_ != 0)
- {
- return be_typedef::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_union *
-be_visitor_context::be_node_as_union (void)
-{
- if (this->node_ != 0)
- {
- return be_union::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_union_branch *
-be_visitor_context::be_node_as_union_branch (void)
-{
- if (this->node_ != 0)
- {
- return be_union_branch::narrow_from_decl (this->node_);
- }
- else
- {
- return 0;
- }
-}
-
-be_enum *
-be_visitor_context::be_scope_as_enum (void)
-{
- if (this->scope_ != 0)
- {
- return be_enum::narrow_from_decl (this->scope_);
- }
- else
- {
- return 0;
- }
-}
-
-be_exception *
-be_visitor_context::be_scope_as_exception (void)
-{
- if (this->scope_ != 0)
- {
- return be_exception::narrow_from_decl (this->scope_);
- }
- else
- {
- return 0;
- }
-}
-
-be_interface *
-be_visitor_context::be_scope_as_interface (void)
-{
- if (this->scope_ != 0)
- {
- return be_interface::narrow_from_decl (this->scope_);
- }
- else
- {
- return 0;
- }
-}
-
-be_module *
-be_visitor_context::be_scope_as_module (void)
-{
- if (this->scope_ != 0)
- {
- return be_module::narrow_from_decl (this->scope_);
- }
- else
- {
- return 0;
- }
-}
-
-be_operation *
-be_visitor_context::be_scope_as_operation (void)
-{
- if (this->scope_ != 0)
- {
- return be_operation::narrow_from_decl (this->scope_);
- }
- else
- {
- return 0;
- }
-}
-
-be_root *
-be_visitor_context::be_scope_as_root (void)
-{
- if (this->scope_ != 0)
- {
- return be_root::narrow_from_decl (this->scope_);
- }
- else
- {
- return 0;
- }
-}
-
-be_structure *
-be_visitor_context::be_scope_as_structure (void)
-{
- if (this->scope_ != 0)
- {
- return be_structure::narrow_from_decl (this->scope_);
- }
- else
- {
- return 0;
- }
-}
-
-be_union *
-be_visitor_context::be_scope_as_union (void)
-{
- if (this->scope_ != 0)
- {
- return be_union::narrow_from_decl (this->scope_);
- }
- else
- {
- return 0;
- }
-}
-
-const char *
-be_visitor_context::export_macro (void) const
-{
- switch (this->state_)
- {
- // If -GA is used, but the anyop macro hasn't been set,
- // default to the stub macro.
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- return (be_global->gen_anyop_files ()
- ? this->non_null_export_macro ()
- : be_global->stub_export_macro ());
- case TAO_CodeGen::TAO_ARRAY_CH:
- case TAO_CodeGen::TAO_INTERFACE_CH:
- case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH:
- case TAO_CodeGen::TAO_AMI_INTERFACE_CH:
- case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CH:
- case TAO_CodeGen::TAO_ROOT_CH:
- return be_global->stub_export_macro ();
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH:
- case TAO_CodeGen::TAO_INTERFACE_AMH_RH_SH:
- case TAO_CodeGen::TAO_ROOT_SH:
- return be_global->skel_export_macro ();
- default:
- return "";
- }
-}
-
-const char *
-be_visitor_context::non_null_export_macro (void) const
-{
- const char *anyop_export = be_global->anyop_export_macro ();
-
- return (ACE_OS::strcmp (anyop_export, "") == 0
- ? be_global->stub_export_macro ()
- : anyop_export);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_decl.cpp b/TAO/TAO_IDL/be/be_visitor_decl.cpp
deleted file mode 100644
index 379d71a67c8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_decl.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_decl.cpp
-//
-// = DESCRIPTION
-// Visitor for the base be_decl node. This serves to maintain the current
-// state (context) of code generation for the derived visitor.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_visitor_decl.h"
-#include "be_visitor_sequence.h"
-#include "be_visitor_context.h"
-#include "be_typedef.h"
-#include "be_type.h"
-#include "ace/Log_Msg.h"
-
-ACE_RCSID (be,
- be_visitor_decl,
- "$Id$")
-
-// Root visitor for client header
-be_visitor_decl::be_visitor_decl (be_visitor_context *ctx)
- : ctx_ (ctx)
-{
-}
-
-be_visitor_decl::~be_visitor_decl (void)
-{
-}
-
-be_visitor_context *
-be_visitor_decl::ctx (void)
-{
- return this->ctx_;
-}
-
-int
-be_visitor_decl::gen_anonymous_base_type (be_type *bt,
- TAO_CodeGen::CG_STATE cg_state)
-{
- be_typedef *tdef = be_typedef::narrow_from_decl (bt);
-
- if (!tdef)
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.state (cg_state);
-
- // In case our container was typedef'd.
- ctx.tdef (0);
-
- int status = 0;
-
- switch (cg_state)
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_sequence_ch visitor (&ctx);
- status = bt->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_sequence_cs visitor (&ctx);
- status = bt->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_sequence_cdr_op_cs visitor (&ctx);
- status = bt->accept (&visitor);
- break;
- }
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_decl::"
- "gen_anonymous_base_type - "
- "bad context state\n"),
- -1);
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_decl::"
- "gen_anonymous_base_type - "
- "anonymous base type codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_enum.cpp b/TAO/TAO_IDL/be/be_visitor_enum.cpp
deleted file mode 100644
index be1a2adce3d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_enum.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_enum.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Enum
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_enum.h"
-#include "be_enum_val.h"
-#include "be_helper.h"
-#include "be_extern.h"
-
-#include "be_visitor_enum.h"
-#include "be_visitor_context.h"
-
-#include "be_visitor_enum/enum_ch.cpp"
-#include "be_visitor_enum/enum_cs.cpp"
-#include "be_visitor_enum/any_op_ch.cpp"
-#include "be_visitor_enum/any_op_cs.cpp"
-#include "be_visitor_enum/cdr_op_ch.cpp"
-#include "be_visitor_enum/cdr_op_cs.cpp"
-#include "be_visitor_enum/serializer_op_ch.cpp"
-#include "be_visitor_enum/serializer_op_cs.cpp"
-
-ACE_RCSID (be,
- be_visitor_enum,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp
deleted file mode 100644
index 4b815165473..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Enums for the Any operators
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_enum,
- any_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Enum visitor for generating Any operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_enum_any_op_ch::be_visitor_enum_any_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_enum_any_op_ch::~be_visitor_enum_any_op_ch (void)
-{
-}
-
-int
-be_visitor_enum_any_op_ch::visit_enum (be_enum *node)
-{
- if (node->cli_hdr_any_op_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- const char *macro = this->ctx_->export_macro ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Generate the Any <<= and >>= operators.
- *os << be_nl << be_nl
- << macro << " void operator<<= (::CORBA::Any &, " << node->name ()
- << ");" << be_nl;
- *os << macro << " ::CORBA::Boolean operator>>= (const ::CORBA::Any &, "
- << node->name () << " &);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_hdr_any_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp
deleted file mode 100644
index effcd2e15ce..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Enum for the Any operators
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_enum,
- any_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Enum visitor for generating Any operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_enum_any_op_cs::be_visitor_enum_any_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_enum_any_op_cs::~be_visitor_enum_any_op_cs (void)
-{
-}
-
-int
-be_visitor_enum_any_op_cs::visit_enum (be_enum *node)
-{
- if (node->cli_stub_any_op_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Since we don't generate CDR stream operators for types that
- // explicitly contain a local interface (at some level), we
- // must override these Any template class methods to avoid
- // calling the non-existent operators. The zero return value
- // will eventually cause CORBA::MARSHAL to be raised if this
- // type is inserted into an Any and then marshaled.
- if (node->is_local ())
- {
- *os << "namespace TAO" << be_nl
- << "{" << be_idt_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Basic_Impl_T<" << node->name ()
- << ">::marshal_value (TAO_OutputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Basic_Impl_T<" << node->name ()
- << ">::demarshal_value (TAO_InputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
-
- // Generate the Any <<= and >>= operator declarations
- // Any <<= and >>= operators.
- *os << "void operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->name () << " _tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "TAO::Any_Basic_Impl_T<" << node->name () << ">::insert ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << node->name () << " &_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return" << be_idt_nl
- << "TAO::Any_Basic_Impl_T<" << node->name () << ">::extract ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem " << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_stub_any_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ch.cpp
deleted file mode 100644
index 2ea107d883b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ch.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Enums for the CDR operators
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_enum,
- cdr_op_ch,
- "$Id$")
-
-
-// ***************************************************************************
-// Enum visitor for generating Cdr operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_enum_cdr_op_ch::be_visitor_enum_cdr_op_ch (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_enum_cdr_op_ch::~be_visitor_enum_cdr_op_ch (void)
-{
-}
-
-int
-be_visitor_enum_cdr_op_ch::visit_enum (be_enum *node)
-{
- if (node->cli_hdr_cdr_op_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // generate the CDR << and >> operators
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator<< (TAO_OutputCDR &strm, " << node->name () << " _tao_enumerator);" << be_nl;
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator>> (TAO_InputCDR &strm, " << node->name () << " &_tao_enumerator);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_cs.cpp
deleted file mode 100644
index 25de2c55f4b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_cs.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Enum for the CDR operators
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_enum,
- cdr_op_cs,
- "$Id$")
-
-
-// ***************************************************************************
-// Enum visitor for generating CDR operator declarations in the client
-// stubs file.
-// ***************************************************************************
-
-be_visitor_enum_cdr_op_cs::be_visitor_enum_cdr_op_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_enum_cdr_op_cs::~be_visitor_enum_cdr_op_cs (void)
-{
-}
-
-int
-be_visitor_enum_cdr_op_cs::visit_enum (be_enum *node)
-{
- if (node->cli_stub_cdr_op_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << "::CORBA::Boolean operator<< (TAO_OutputCDR &strm, "
- << node->name () << " _tao_enumerator)" << be_nl
- << "{" << be_idt_nl
- << "return strm << static_cast< ::CORBA::ULong> (_tao_enumerator);"
- << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean operator>> (TAO_InputCDR &strm, "
- << node->name () << " & _tao_enumerator)" << be_nl
- << "{" << be_idt_nl
- << "::CORBA::ULong _tao_temp = 0;" << be_nl
- << "::CORBA::Boolean const _tao_success = strm >> _tao_temp;" << be_nl
- << be_nl
- << "if (_tao_success)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_enumerator = static_cast<" << node->name ()
- << "> (_tao_temp);" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "return _tao_success;" << be_uidt_nl
- << "}";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_stub_cdr_op_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp b/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp
deleted file mode 100644
index 583b177c659..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// enum_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Enums in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_visitor_typecode/typecode_decl.h"
-
-ACE_RCSID (be_visitor_enum,
- enum_ch,
- "$Id$")
-
-
-// ********************************************************************
-// Visitor implementation for the Enum type
-// This one for the client header file
-// ********************************************************************
-
-be_visitor_enum_ch::be_visitor_enum_ch (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_enum_ch::~be_visitor_enum_ch (void)
-{
-}
-
-// Visit the enum_ch node and its scope.
-int
-be_visitor_enum_ch::visit_enum (be_enum *node)
-{
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Comma to be generated by the scope visitor.
- this->ctx_->comma (1);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "enum " << node->local_name () << be_nl;
- *os << "{" << be_idt_nl;
-
- if (this->visit_scope (node) == 1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_enum_ch::"
- "visit_enum - "
- "scope generation failed\n"
- ),
- -1);
- }
-
- *os << be_uidt_nl;
- *os << "};" << be_nl << be_nl;
-
- // As per the ORBOS spec, we need the following typedef
- *os << "typedef " << node->local_name () << " &" << node->local_name ()
- << "_out;";
-
- if (be_global->tc_support ())
- {
- be_visitor_context ctx (*this->ctx_);
- be_visitor_typecode_decl visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_enum_ch::"
- "visit_enum - "
- "TypeCode declaration failed\n"
- ),
- -1);
- }
- }
-
- node->cli_hdr_gen (true);
- return 0;
-}
-
-int
-be_visitor_enum_ch::post_process (be_decl *bd)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Am I the last one?
- if (!this->last_node (bd))
- {
- *os << "," << be_nl;
- }
-
- return 0;
-}
-
-int
-be_visitor_enum_ch::visit_enum_val (be_enum_val *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << node->local_name ();
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_enum/enum_cs.cpp b/TAO/TAO_IDL/be/be_visitor_enum/enum_cs.cpp
deleted file mode 100644
index 452cfeb3a7a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_enum/enum_cs.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// enum_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Enums in the client stubs
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_visitor_typecode/enum_typecode.h"
-
-ACE_RCSID (be_visitor_enum,
- enum_cs,
- "$Id$")
-
-
-// ********************************************************************
-// Visitor implementation for the Enum type
-// This one for the client stubs file
-// ********************************************************************
-
-be_visitor_enum_cs::be_visitor_enum_cs (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_enum_cs::~be_visitor_enum_cs (void)
-{
-}
-
-// visit the Enum_cs node and its scope
-int
-be_visitor_enum_cs::visit_enum (be_enum *node)
-{
- if (node->cli_stub_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- if (be_global->tc_support ())
- {
- be_visitor_context ctx (*this->ctx_);
- // ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- TAO::be_visitor_enum_typecode visitor (&ctx);
-
- if (visitor.visit_enum (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_enum_cs::"
- "visit_enum - "
- "TypeCode definition failed\n"),
- -1);
- }
- }
-
- node->cli_stub_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_enum/serializer_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_enum/serializer_op_ch.cpp
deleted file mode 100644
index fa543f76d59..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_enum/serializer_op_ch.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Enums for the TAO::DCPS::Serializer operators
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_enum,
- serializer_op_ch,
- "$Id$")
-
-
-// ***************************************************************************
-// Enum visitor for generating Serializer operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_enum_serializer_op_ch::be_visitor_enum_serializer_op_ch (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_enum_serializer_op_ch::~be_visitor_enum_serializer_op_ch (void)
-{
-}
-
-int
-be_visitor_enum_serializer_op_ch::visit_enum (be_enum *node)
-{
- if (node->cli_hdr_serializer_op_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // generate the Serializer << and >> operators
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator<< (TAO::DCPS::Serializer &, const " << node->name ()
- << " &);" << be_nl;
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator>> (TAO::DCPS::Serializer &, "
- << node->name () << " &);";
-
- node->cli_hdr_serializer_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_enum/serializer_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_enum/serializer_op_cs.cpp
deleted file mode 100644
index 8ee3eab7b30..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_enum/serializer_op_cs.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Enum for the
-// TAO::DCPS::Serializer operators
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_enum,
- serializer_op_cs,
- "$Id$")
-
-
-// ***************************************************************************
-// Enum visitor for generating Serializer operator declarations in the client
-// stubs file.
-// ***************************************************************************
-
-be_visitor_enum_serializer_op_cs::be_visitor_enum_serializer_op_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_enum_serializer_op_cs::~be_visitor_enum_serializer_op_cs (void)
-{
-}
-
-int
-be_visitor_enum_serializer_op_cs::visit_enum (be_enum *node)
-{
- if (node->cli_stub_serializer_op_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "::CORBA::Boolean operator<< (TAO::DCPS::Serializer &strm, "
- << "const " << node->name () << " &_tao_enumval)" << be_nl
- << "{" << be_idt_nl
- << "::CORBA::ULong _tao_temp = _tao_enumval;" << be_nl
- << "return strm << _tao_temp;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean operator>> (TAO::DCPS::Serializer &strm, "
- << node->name () << " &_tao_enumval)" << be_nl
- << "{" << be_idt_nl
- << "::CORBA::ULong _tao_temp = 0;" << be_nl
- << "::CORBA::Boolean _tao_result = strm >> _tao_temp;" << be_nl << be_nl
- << "if (_tao_result == 1)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_enumval = static_cast<" << node->name ()
- << "> (_tao_temp);" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "return _tao_result;" << be_uidt_nl
- << "}";
-
- node->cli_stub_serializer_op_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_exception.cpp b/TAO/TAO_IDL/be/be_visitor_exception.cpp
deleted file mode 100644
index b1abf086343..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_exception.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Exception
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_field.h"
-#include "be_exception.h"
-#include "be_typedef.h"
-#include "be_enum.h"
-#include "be_interface.h"
-#include "be_interface_fwd.h"
-#include "be_valuebox.h"
-#include "be_valuetype.h"
-#include "be_valuetype_fwd.h"
-#include "be_array.h"
-#include "be_predefined_type.h"
-#include "be_string.h"
-#include "be_sequence.h"
-#include "be_structure.h"
-#include "be_union.h"
-#include "be_helper.h"
-#include "be_extern.h"
-
-#include "be_visitor_exception.h"
-#include "be_visitor_context.h"
-#include "be_visitor_field.h"
-#include "be_visitor_typecode.h"
-#include "ace/Log_Msg.h"
-
-#include "be_visitor_exception/exception.cpp"
-#include "be_visitor_exception/exception_ch.cpp"
-#include "be_visitor_exception/exception_ci.cpp"
-#include "be_visitor_exception/exception_cs.cpp"
-#include "be_visitor_exception/exception_ctor.cpp"
-#include "be_visitor_exception/ctor_assign.cpp"
-#include "be_visitor_exception/any_op_ch.cpp"
-#include "be_visitor_exception/any_op_cs.cpp"
-#include "be_visitor_exception/cdr_op_ch.cpp"
-#include "be_visitor_exception/cdr_op_cs.cpp"
-
-ACE_RCSID (be,
- be_visitor_exception,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_exception/any_op_ch.cpp
deleted file mode 100644
index 3682ee0670d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/any_op_ch.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the Any operators for Exceptions
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_exception,
- any_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Exception visitor for generating Any operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_exception_any_op_ch::be_visitor_exception_any_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_exception_any_op_ch::~be_visitor_exception_any_op_ch (void)
-{
-}
-
-int
-be_visitor_exception_any_op_ch::visit_exception (be_exception *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- const char *macro = this->ctx_->export_macro ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << be_nl << be_nl
- << macro << " void operator<<= (::CORBA::Any &, const " << node->name ()
- << " &); // copying version" << be_nl;
- *os << macro << " void operator<<= (::CORBA::Any &, " << node->name ()
- << "*); // noncopying version" << be_nl;
- *os << macro << " ::CORBA::Boolean operator>>= (const ::CORBA::Any &, "
- << node->name () << " *&); // deprecated\n";
- *os << macro << " ::CORBA::Boolean operator>>= (const ::CORBA::Any &, const "
- << node->name () << " *&);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- // All we have to do is to visit the scope and generate code.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception::visit_exception - "
- "codegen for scope failed\n"),
- -1);
- }
-
- node->cli_hdr_any_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_exception_any_op_ch::visit_field (be_field *node)
-{
- // First generate the type information.
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_any_op_ch::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_any_op_ch::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_exception_any_op_ch::visit_enum (be_enum *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- be_visitor_enum_any_op_ch visitor (this->ctx_);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_any_op_ch::"
- "visit_enum - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_exception_any_op_ch::visit_structure (be_structure *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- be_visitor_structure_any_op_ch visitor (this->ctx_);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_any_op_ch::"
- "visit_structure - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_exception_any_op_ch::visit_union (be_union *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- be_visitor_union_any_op_ch visitor (this->ctx_);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_any_op_ch::"
- "visit_union - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp
deleted file mode 100644
index f432f30d54a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp
+++ /dev/null
@@ -1,293 +0,0 @@
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the Any operators for Exceptions.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_exception,
- any_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Exception visitor for generating Any operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_exception_any_op_cs::be_visitor_exception_any_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_exception_any_op_cs::~be_visitor_exception_any_op_cs (void)
-{
-}
-
-int
-be_visitor_exception_any_op_cs::visit_exception (be_exception *node)
-{
- if (node->cli_stub_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl
- << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- if (!node->is_local ())
- {
- *os << be_nl << be_nl
- << "namespace TAO" << be_nl
- << "{" << be_idt_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Dual_Impl_T<" << node->name ()
- << ">::demarshal_value (" << be_idt << be_idt_nl
- << "TAO_InputCDR & cdr" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::String_var id;" << be_nl << be_nl
- << "if (!(cdr >> id.out ()))" << be_idt_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << (be_global->use_raw_throw () ? "try" :"ACE_TRY_NEW_ENV")
- << be_idt_nl
- << "{" << be_idt_nl
- << "this->value_->_tao_decode (cdr"
- << (be_global->use_raw_throw () ? "" : " ACE_ENV_ARG_PARAMETER")
- << ");" << ace_try_check << be_uidt_nl
- << "}" << be_uidt_nl
- << (be_global->use_raw_throw ()
- ? "catch ( ::CORBA::Exception &)"
- : "ACE_CATCHANY")
- << be_idt_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt
- << ace_endtry << be_nl << be_nl
- << "return true;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}";
- }
- // Since we don't generate CDR stream operators for types that
- // explicitly contain a local interface (at some level), we
- // must override these Any template class methods to avoid
- // calling the non-existent operators. The zero return value
- // will eventually cause CORBA::MARSHAL to be raised if this
- // type is inserted into an Any and then marshaled.
- else
- {
- *os << be_nl << be_nl
- << "namespace TAO" << be_nl
- << "{" << be_idt_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Dual_Impl_T<" << node->name ()
- << ">::marshal_value (TAO_OutputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Dual_Impl_T<" << node->name ()
- << ">::demarshal_value (TAO_InputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}";
- }
-
- // Copying insertion operator.
-
- *os << be_nl << be_nl
- << "// Copying insertion." << be_nl
- << "void operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << "const " << node->name () << " &_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "TAO::Any_Dual_Impl_T<" << node->name () << ">::insert_copy ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Non-copying insertion operator."
- *os << "// Non-copying insertion." << be_nl
- << "void operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->name () << " *_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "TAO::Any_Dual_Impl_T<" << node->name () << ">::insert ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Extraction to non-const pointer operator.
- *os << "// Extraction to non-const pointer (deprecated)." << be_nl
- << "::CORBA::Boolean operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << node->name () << " *&_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return _tao_any >>= const_cast<" << be_idt << be_idt_nl
- << "const " << node->name () << " *&> (" << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Extraction to const pointer operator.
- *os << "// Extraction to const pointer." << be_nl
- << "::CORBA::Boolean operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << "const " << node->name () << " *&_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return" << be_idt_nl
- << "TAO::Any_Dual_Impl_T<" << node->name () << ">::extract ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- // all we have to do is to visit the scope and generate code
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception::visit_exception - "
- "codegen for scope failed\n"),
- -1);
- }
-
- node->cli_stub_any_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_exception_any_op_cs::visit_field (be_field *node)
-{
- // First generate the type information.
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_any_op_cs::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_any_op_cs::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_exception_any_op_cs::visit_enum (be_enum *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- be_visitor_enum_any_op_cs visitor (this->ctx_);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_any_op_cs::"
- "visit_enum - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_exception_any_op_cs::visit_structure (be_structure *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- be_visitor_structure_any_op_cs visitor (this->ctx_);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_any_op_cs::"
- "visit_structure - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_exception_any_op_cs::visit_union (be_union *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- be_visitor_union_any_op_cs visitor (this->ctx_);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_any_op_cs::"
- "visit_union - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp
deleted file mode 100644
index 920e14412e7..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for exceptions. This uses
-// compiled marshaling.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_exception,
- cdr_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Exception visitor for generating CDR operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_exception_cdr_op_ch::be_visitor_exception_cdr_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_exception (ctx)
-{
-}
-
-be_visitor_exception_cdr_op_ch::~be_visitor_exception_cdr_op_ch (void)
-{
-}
-
-int
-be_visitor_exception_cdr_op_ch::visit_exception (be_exception *node)
-{
- if (node->cli_hdr_cdr_op_gen () || node->imported () || node->is_local ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << be_nl << be_nl
- << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator<< (TAO_OutputCDR &, const " << node->name ()
- << " &);" << be_nl;
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator>> (TAO_InputCDR &, "
- << node->name () << " &);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- // Set the substate as generating code for the types defined in our scope.
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_cdr_op_ch::"
- "visit_exception - "
- "codegen for scope failed\n"),
- -1);
- }
-
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp
deleted file mode 100644
index ce9d86f8d83..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for exceptions
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_exception,
- cdr_op_cs,
- "$Id$")
-
-be_visitor_exception_cdr_op_cs::be_visitor_exception_cdr_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_exception (ctx)
-{
-}
-
-be_visitor_exception_cdr_op_cs::~be_visitor_exception_cdr_op_cs (void)
-{
-}
-
-int
-be_visitor_exception_cdr_op_cs::visit_exception (be_exception *node)
-{
- if (node->cli_stub_cdr_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_cdr_op_cs::"
- "visit_exception - "
- "codegen for scope failed\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Set the sub state as generating code for the output operator.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
-
- *os << be_nl << be_nl
- << "::CORBA::Boolean operator<< (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &strm," << be_nl
- << "const " << node->name () << " &_tao_aggregate" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- // Do we have any members?
- if (node->nmembers () > 0)
- {
- be_visitor_context new_ctx (*this->ctx_);
- be_visitor_cdr_op_field_decl field_decl (&new_ctx);
- field_decl.visit_scope (node);
-
- // some members
- *os << "// First marshal the repository ID." << be_nl
- << "if (strm << _tao_aggregate._rep_id ())" << be_idt_nl
- << "{" << be_idt_nl
- << "// Now marshal the members (if any)." << be_nl
- << "return (" << be_idt_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_cdr_op_cs::"
- "visit_exception - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << " );" << be_uidt_nl
- << "}" << be_uidt_nl
- << "else" << be_idt_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl;
- }
- else
- {
- // No members.
- *os << "// Marshal the repository ID." << be_nl
- << "return (strm << _tao_aggregate._rep_id ());" << be_uidt_nl;
- }
-
- *os << "}" << be_nl << be_nl;
-
- // Set the substate as generating code for the input operator.
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT);
-
- *os << "::CORBA::Boolean operator>> (" << be_idt << be_idt_nl
- << "TAO_InputCDR &";
-
- if (node->nmembers () > 0)
- {
- *os << "strm," << be_nl
- << node->name () << " &_tao_aggregate" << be_uidt_nl
- << ")" << be_uidt_nl;
- }
- else
- {
- *os << "," << be_nl
- << node->name () << "&" << be_uidt_nl
- << ")" << be_uidt_nl;
- }
-
- *os << "{" << be_idt_nl;
-
- // WARNING: This method is not symmetric with respect to the
- // encoding function!
- // Exceptions are strange.... the repository ID is retrieved by the
- // caller, and they invoke this method only to demarshal the
- // members. While the marshaling method encodes both...
-
- // Do we have any members?
- if (node->nmembers () > 0)
- {
- be_visitor_context new_ctx (*this->ctx_);
- be_visitor_cdr_op_field_decl field_decl (&new_ctx);
- field_decl.visit_scope (node);
-
- // Some members.
- *os << "// Demarshal the members." << be_nl
- << "return (" << be_idt_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_cdr_op_cs::"
- "visit_exception - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << ");" << be_uidt_nl;
- }
- else
- {
- *os << "return true;" << be_uidt_nl;
- }
-
- *os << "}";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_stub_cdr_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_exception_cdr_op_cs::post_process (be_decl *bd)
-{
- // This checks for members of an enum 'non-scope' declared inside
- // the exception. If an enum val is actually a member, it will
- // have node type NT_field.
- if (bd->node_type () == AST_Decl::NT_enum_val)
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (!this->last_node (bd))
- {
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << " &&" << be_nl;
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- default:
- break;
- };
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp b/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp
deleted file mode 100644
index ea3c3fbdda0..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp
+++ /dev/null
@@ -1,424 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ctor_assign.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the special CTOR and assignment operator for
-// Exceptions.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_exception,
- ctor_assign,
- "$Id$")
-
-// ************************************************************************
-// Used for the body of the assignment operator and the copy constructor.
-// ************************************************************************
-
-be_visitor_exception_ctor_assign::be_visitor_exception_ctor_assign (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_exception_ctor_assign::~be_visitor_exception_ctor_assign (void)
-{
-}
-
-int
-be_visitor_exception_ctor_assign::visit_exception (be_exception *node)
-{
- // Save the argument node.
- this->ctx_->node (node);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_exception_ctor_assign::"
- "visit_exception - "
- "codegen for scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_exception_ctor_assign::visit_field (be_field *node)
-{
- // Save the argument node.
- this->ctx_->node (node);
-
- // Retrieve the type.
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_exception_ctor_assign::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- // Different types have different mappings when used as in/out or
- // inout parameters. Let this visitor deal with the type.
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_exception_ctor_assign::"
- "visit_field - "
- "cannot accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_exception_ctor_assign::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_decl *bd = this->ctx_->node ();
-
- *os << be_nl;
-
- if (ACE_OS::strcmp (bd->flat_name (), node->flat_name ()) != 0)
- {
- // We are typedef'd.
- *os << node->name ();
- }
- else
- {
- // We are anonymous.
- *os << "_" << bd->local_name ();
- }
-
- if (this->ctx_->exception ())
- {
- // Constructor from member args.
- *os << "_copy (this->" << bd->local_name ()
- << ", _tao_" << bd->local_name () << ");";
- }
- else
- {
- // Copy constructor and assignment operator.
- *os << "_copy (this->" << bd->local_name ()
- << ", _tao_excp." << bd->local_name () << ");";
- }
-
- return 0;
-}
-
-int
-be_visitor_exception_ctor_assign::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_decl *bd = this->ctx_->node ();
-
- *os << be_nl;
-
- if (this->ctx_->exception ()) // Special constructor.
- {
- *os << "this->" << bd->local_name () << " = _tao_"
- << bd->local_name () << ";";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = _tao_excp."
- << bd->local_name () << ";";
- }
-
- return 0;
-}
-
-int
-be_visitor_exception_ctor_assign::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_decl *bd = this->ctx_->node ();
-
- *os << be_nl;
-
- if (this->ctx_->exception ()) // Special constructor.
- {
- *os << "this->" << bd->local_name () << " = TAO::Objref_Traits<"
- << node->name () << ">::duplicate (_tao_"
- << bd->local_name () << ");";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = TAO::Objref_Traits<"
- << node->name () << ">::duplicate (_tao_excp."
- << bd->local_name () << ".in ());";
- }
-
- return 0;
-}
-
-int be_visitor_exception_ctor_assign::visit_interface_fwd (
- be_interface_fwd *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_decl *bd = this->ctx_->node ();
-
- *os << be_nl;
-
- if (this->ctx_->exception ()) // Special constructor.
- {
- *os << "this->" << bd->local_name () << " = " << node->name ()
- << "::_duplicate (_tao_" << bd->local_name () << ");";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = " << node->name ()
- << "::_duplicate (_tao_excp." << bd->local_name () << ".in ());";
- }
- return 0;
-}
-
-int
-be_visitor_exception_ctor_assign::visit_valuebox (be_valuebox *node)
-{
- return this->emit_valuetype_common (node);
-}
-
-int
-be_visitor_exception_ctor_assign::visit_valuetype (be_valuetype *node)
-{
- return this->emit_valuetype_common (node);
-}
-
-int be_visitor_exception_ctor_assign::visit_valuetype_fwd (
- be_valuetype_fwd *node
- )
-{
- return this->emit_valuetype_common (node);
-}
-
-int be_visitor_exception_ctor_assign::visit_predefined_type (
- be_predefined_type *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_decl *bd = this->ctx_->node ();
- AST_PredefinedType::PredefinedType pt = node->pt ();
-
- *os << be_nl;
-
- // Check if the type is an any.
- if (pt == AST_PredefinedType::PT_any)
- {
- if (this->ctx_->exception ()) // Special constructor.
- {
- *os << "this->" << bd->local_name () << " = _tao_"
- << bd->local_name () << ";";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = _tao_excp."
- << bd->local_name () << ";";
- }
- }
- else if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- if (this->ctx_->exception ()) // Special constructor.
- {
- *os << "this->" << bd->local_name () << " = "
- << node->name () << "::_duplicate (_tao_"
- << bd->local_name () << ");";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = "
- << node->name () << "::_duplicate (_tao_excp."
- << bd->local_name () << ".in ());";
- }
- }
- else // Simple predefined types.
- {
- if (this->ctx_->exception ()) // Special constructor.
- {
- *os << "this->" << bd->local_name () << " = _tao_"
- << bd->local_name () << ";";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = _tao_excp."
- << bd->local_name () << ";";
- }
- }
-
- return 0;
-}
-
-int be_visitor_exception_ctor_assign::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_decl *bd = this->ctx_->node ();
-
- *os << be_nl;
-
- if (this->ctx_->exception ()) // Special constructor.
- {
- *os << "this->" << bd->local_name () << " = _tao_" << bd->local_name ()
- << ";";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = _tao_excp."
- << bd->local_name () << ";";
- }
-
- return 0;
-}
-
-int be_visitor_exception_ctor_assign::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_decl *bd = this->ctx_->node ();
-
- *os << be_nl;
-
- if (this->ctx_->exception ()) // Special constructor.
- {
- if (node->width () == (long) sizeof (char))
- {
- *os << "this->" << bd->local_name ()
- << " = ::CORBA::string_dup (_tao_"
- << bd->local_name () << ");";
- }
- else
- {
- *os << "this->" << bd->local_name ()
- << " = ::CORBA::wstring_dup (_tao_"
- << bd->local_name () << ");";
- }
- }
- else
- {
- if (node->width () == (long) sizeof (char))
- {
- *os << "this->" << bd->local_name ()
- << " = ::CORBA::string_dup (_tao_excp."
- << bd->local_name () << ".in ());";
- }
- else
- {
- *os << "this->" << bd->local_name ()
- << " = ::CORBA::wstring_dup (_tao_excp."
- << bd->local_name () << ".in ());";
- }
- }
-
- return 0;
-}
-
-int be_visitor_exception_ctor_assign::visit_structure (be_structure *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_decl *bd = this->ctx_->node ();
-
- *os << be_nl;
-
- if (this->ctx_->exception ()) // Special constructor.
- {
- *os << "this->" << bd->local_name () << " = _tao_" << bd->local_name ()
- << ";";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = _tao_excp."
- << bd->local_name () << ";";
- }
-
- return 0;
-}
-
-int be_visitor_exception_ctor_assign::visit_union (be_union *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_decl *bd = this->ctx_->node ();
-
- *os << be_nl;
-
- if (this->ctx_->exception ()) // Special constructor.
- {
- *os << "this->" << bd->local_name () << " = _tao_" << bd->local_name ()
- << ";";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = _tao_excp."
- << bd->local_name () << ";";
- }
-
- return 0;
-}
-
-int be_visitor_exception_ctor_assign::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_exception_ctor_assign::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_exception_ctor_assign::emit_valuetype_common (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_decl *bd = this->ctx_->node ();
-
- *os << be_nl;
-
- if (this->ctx_->exception ()) // Special constructor.
- {
- *os << "::CORBA::add_ref (" << be_idt << be_idt_nl
- << "const_cast<" << be_idt << be_idt_nl
- << node->name () << " *> (" << be_nl
- << "_tao_" << bd->local_name () << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl;
- *os << "this->" << bd->local_name () << " = _tao_"
- << bd->local_name () << ";";
- }
- else
- {
- *os << "::CORBA::add_ref (" << be_idt << be_idt_nl
- << "const_cast<" << be_idt << be_idt_nl
- << node->name () << " *> (" << be_nl
- << "_tao_excp." << bd->local_name () << ".in ()" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl;
- *os << "this->" << bd->local_name () << " = _tao_excp."
- << bd->local_name () << ".in ();";
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception.cpp
deleted file mode 100644
index b805b899cf1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// .cpp
-//
-// = DESCRIPTION
-// Generic visitor generating code for Exceptions.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_exception,
- exception,
- "$Id$")
-
-
-// Generic exception visitor.
-be_visitor_exception::be_visitor_exception (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_exception::~be_visitor_exception (void)
-{
-}
-
-// Visit the Exception node and its scope.
-int
-be_visitor_exception::visit_exception (be_exception *)
-{
- // Must be overriden.
- return -1;
-}
-
-int
-be_visitor_exception::visit_field (be_field *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- // This switch is acceptable rather than having derived visitors overriding
- // this method and differing only in what state they set
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_field_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_field_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_field_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_field_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_field_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception::"
- "visit_field - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception::"
- "visit_field - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp
deleted file mode 100644
index 0bfdc169d89..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// exception_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Exception in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_visitor_typecode/typecode_decl.h"
-#include "global_extern.h"
-#include "utl_err.h"
-
-ACE_RCSID (be_visitor_exception,
- exception_ch,
- "$Id$")
-
-// ******************************************************
-// For client header.
-// ******************************************************
-
-be_visitor_exception_ch::be_visitor_exception_ch (be_visitor_context *ctx)
- : be_visitor_exception (ctx)
-{
-}
-
-be_visitor_exception_ch::~be_visitor_exception_ch (void)
-{
-}
-
-// Visit the Exception node and its scope.
-int be_visitor_exception_ch::visit_exception (be_exception *node)
-{
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- os->gen_ifdef_macro (node->flat_name ());
-
- *os << be_nl << be_nl << "class " << be_global->stub_export_macro ()
- << " " << node->local_name ()
- << " : public ::CORBA::UserException" << be_nl;
- *os << "{" << be_nl
- << "public:" << be_idt_nl;
-
- // Generate code for field members.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_ch::"
- "visit_exception - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_nl;
-
- // Constructors and destructor.
- *os << node->local_name () << " (void);" << be_nl
- << node->local_name () << " (const " << node->local_name ()
- << " &);" << be_nl
- << "~" << node->local_name () << " (void);\n" << be_nl;
-
- // Assignment operator.
- *os << node->local_name () << " &operator= (const "
- << node->local_name () << " &);" << be_nl << be_nl;
-
- if (be_global->any_support ())
- {
- *os << "static void _tao_any_destructor (void *);" << be_nl << be_nl;
- }
-
-
- *os << "static " << node->local_name ()
- << " *_downcast ( ::CORBA::Exception *);" << be_nl
- << "static const " << node->local_name ()
- << " *_downcast ( ::CORBA::Exception const *);" << be_nl << be_nl;
-
- *os << "static ::CORBA::Exception *_alloc (void);" << be_nl << be_nl;
-
- *os << "virtual ::CORBA::Exception *"
- << "_tao_duplicate (void) const;\n" << be_nl
- << "virtual void _raise (void) const;\n" << be_nl
- << "virtual void _tao_encode (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &cdr" << env_decl << be_uidt_nl
- << ") const;" << be_uidt_nl << be_nl
- << "virtual void _tao_decode (" << be_idt << be_idt_nl
- << "TAO_InputCDR &cdr" << env_decl << be_uidt_nl
- << ");" << be_uidt;
-
- // Generate constructor that takes each member as a parameter. We need a
- // new state. Such a constructor exists if we have members.
- if (node->member_count () > 0)
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CTOR_CH);
- be_visitor_exception_ctor visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception::"
- "visit_exception - "
- "codegen for ctor failed\n"),
- -1);
- }
- }
-
- if (be_global->tc_support ())
- {
- *os << be_nl << be_nl
- << "virtual ::CORBA::TypeCode_ptr _tao_type (void) const;";
- }
-
- *os << be_uidt_nl << "};";
-
- if (be_global->tc_support ())
- {
- be_visitor_context ctx (*this->ctx_);
- be_visitor_typecode_decl visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_ch::"
- "visit_exception - "
- "TypeCode declaration failed\n"),
- -1);
- }
- }
-
- os->gen_endif ();
- node->cli_hdr_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_ci.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_ci.cpp
deleted file mode 100644
index 25edecd0bac..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ci.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// exception_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Exception in the inline file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_exception,
- exception_ci,
- "$Id$")
-
-
-// ******************************************************
-// for client inline
-// ******************************************************
-
-be_visitor_exception_ci::be_visitor_exception_ci (be_visitor_context *ctx)
- : be_visitor_exception (ctx)
-{
-}
-
-be_visitor_exception_ci::~be_visitor_exception_ci (void)
-{
-}
-
-// visit the Exception node and its scope
-int be_visitor_exception_ci::visit_exception (be_exception *node)
-{
- if (node->cli_inline_gen () || node->imported ())
- {
- return 0;
- }
-
- // Generate inline code required of any anonymous types of members.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception::"
- "visit_exception -"
- "code for inline failed\n"),
- -1);
- }
-
- node->cli_inline_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp
deleted file mode 100644
index 376e6244a6a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp
+++ /dev/null
@@ -1,361 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// exception_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Exception in the stubs file
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_visitor_typecode/typecode_defn.h"
-
-ACE_RCSID (be_visitor_exception,
- exception_cs,
- "$Id$")
-
-// ***************************************************************************
-// For client stubs.
-// ***************************************************************************
-
-be_visitor_exception_cs::be_visitor_exception_cs (be_visitor_context *ctx)
- : be_visitor_exception (ctx)
-{
-}
-
-be_visitor_exception_cs::~be_visitor_exception_cs (void)
-{
-}
-
-// Visit the Exception_Cs node and its scope.
-int be_visitor_exception_cs::visit_exception (be_exception *node)
-{
- if (node->cli_stub_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- os->indent ();
-
- // Generate stub code required of any anonymous types of members.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception::"
- "visit_exception -"
- "code for stub failed\n"),
- -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Default constructor.
- *os << node->name () << "::" << node->local_name ()
- << " (void)" << be_idt_nl;
- *os << ": ::CORBA::UserException (" << be_idt << be_idt << be_idt_nl
- << "\"" << node->repoID () << "\"," << be_nl
- << "\"" << node->local_name () << "\"" << be_uidt_nl
- << ")" << be_uidt << be_uidt << be_uidt_nl;
- *os << "{" << be_nl;
- *os << "}" << be_nl << be_nl;
-
- // Destructor.
- *os << node->name () << "::~" << node->local_name ()
- << " (void)" << be_nl;
- *os << "{" << be_nl;
- *os << "}" << be_nl << be_nl;
-
- // Copy constructor.
- *os << node->name () << "::" << node->local_name () << " (const ::"
- << node->name () << " &_tao_excp)" << be_idt_nl;
- *os << ": ::CORBA::UserException (" << be_idt << be_idt << be_idt_nl
- << "_tao_excp._rep_id ()," << be_nl
- << "_tao_excp._name ()" << be_uidt_nl
- << ")" << be_uidt << be_uidt << be_uidt_nl;
- *os << "{";
-
- be_visitor_context ctx (*this->ctx_);
-
- if (node->nmembers () > 0)
- {
- *os << be_idt;
-
- // Assign each individual member.
- be_visitor_exception_ctor_assign visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_cs::"
- "visit_exception -"
- "codegen for scope failed\n"),
- -1);
- }
- }
-
- *os << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Assignment operator.
- *os << node->name () << "&" << be_nl;
- *os << node->name () << "::operator= (const ::"
- << node->name () << " &_tao_excp)" << be_nl
- << "{" << be_idt_nl
- << "this->::CORBA::UserException::operator= "
- << "(_tao_excp);";
-
- // Assign each individual member.
- ctx = *this->ctx_;
- be_visitor_exception_ctor_assign ca_visitor (&ctx);
-
- if (node->accept (&ca_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_cs::"
- "visit_exception -"
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_nl
- << "return *this;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- if (be_global->any_support ())
- {
- *os << "void "
- << node->name ()
- << "::_tao_any_destructor (void *_tao_void_pointer)" << be_nl
- << "{" << be_idt_nl
- << node->local_name () << " *_tao_tmp_pointer =" << be_idt_nl
- << "static_cast<"
- << node->local_name () << " *> (_tao_void_pointer);" << be_uidt_nl
- << "delete _tao_tmp_pointer;" << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
-
- // Non-const downcast method.
- *os << node->name () << " *" << be_nl;
- *os << node->name () << "::_downcast ( ::CORBA::Exception *_tao_excp)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return dynamic_cast<" << node->local_name ()
- << " *> (_tao_excp);" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- // Const downcast method.
- *os << "const " << node->name () << " *" << be_nl;
- *os << node->name () << "::_downcast ( ::CORBA::Exception const *_tao_excp)"
- << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return dynamic_cast<const " << node->local_name ()
- << " *> (_tao_excp);" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- // Generate the _alloc method.
- *os << "::CORBA::Exception *" << node->name ()
- << "::_alloc (void)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "::CORBA::Exception *retval = 0;" << be_nl
- << "ACE_NEW_RETURN (retval, ::" << node->name ()
- << ", 0);" << be_nl
- << "return retval;" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Exception *" << be_nl
- << node->name () << "::_tao_duplicate (void) const" << be_nl
- << "{" << be_idt_nl
- << "::CORBA::Exception *result = 0;" << be_nl
- << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
- << "result," << be_nl
- << "::" << node->name () << " (*this)," << be_nl
- << "0" << be_uidt_nl
- << ");" << be_uidt_nl
- << "return result;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "void " << node->name () << "::_raise (void) const" << be_nl
- << "{" << be_idt_nl
- << "TAO_RAISE (*this);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "void " << node->name ()
- << "::_tao_encode (" << be_idt << be_idt_nl;
-
- if (!node->is_local ())
- {
- *os << "TAO_OutputCDR &cdr" << env_decl << be_uidt_nl
- << ") const" << be_uidt_nl
- << "{" << be_idt_nl
- << "if (cdr << *this)" << be_idt_nl
- << "{" << be_idt_nl
- << "return;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl;
-
- if (be_global->use_raw_throw ())
- {
- *os << "throw ::CORBA::MARSHAL ();" << be_uidt_nl;
- }
- else
- {
- *os << "ACE_THROW ( ::CORBA::MARSHAL ());" << be_uidt_nl;
- }
-
- *os << "}" << be_nl << be_nl;
- }
- else
- {
- *os << "TAO_OutputCDR &" << env_decl << be_uidt_nl
- << ") const" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (be_global->use_raw_throw ())
- {
- *os << "throw ::CORBA::MARSHAL ();" << be_uidt_nl;
- }
- else
- {
- *os << "ACE_THROW ( ::CORBA::MARSHAL ());" << be_uidt_nl;
- }
-
- *os << "}" << be_nl << be_nl;
- }
-
- *os << "void " << node->name ()
- << "::_tao_decode (" << be_idt << be_idt_nl;
-
- if (!node->is_local ())
- {
- *os << "TAO_InputCDR &cdr" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "if (cdr >> *this)" << be_idt_nl
- << "{" << be_idt_nl
- << "return;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl;
-
- if (be_global->use_raw_throw ())
- {
- *os << "throw ::CORBA::MARSHAL ();" << be_uidt_nl;
- }
- else
- {
- *os << "ACE_THROW ( ::CORBA::MARSHAL ());" << be_uidt_nl;
- }
-
- *os << "}" << be_nl << be_nl;
- }
- else
- {
- *os << "TAO_InputCDR &" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (be_global->use_raw_throw ())
- {
- *os << "throw ::CORBA::MARSHAL ();" << be_uidt_nl;
- }
- else
- {
- *os << "ACE_THROW ( ::CORBA::MARSHAL ());" << be_uidt_nl;
- }
-
- *os << "}" << be_nl << be_nl;
- }
-
- // Constructor taking all members. It exists only if there are any
- // members.
- if (node->member_count () > 0)
- {
- // Generate the signature.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CTOR_CS);
- be_visitor_exception_ctor ec_visitor (&ctx);
-
- if (node->accept (&ec_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception::"
- "visit_exception - "
- "codegen for ctor failed\n"),
- -1);
- }
-
- *os << be_idt_nl
- << ": ::CORBA::UserException ("
- << be_idt << be_idt << be_idt_nl
- << "\"" << node->repoID () << "\"," << be_nl
- << "\"" << node->local_name () << "\"" << be_uidt_nl
- << ")" << be_uidt << be_uidt << be_uidt_nl;
- *os << "{" << be_idt;
-
- // Assign each individual member. We need yet another state.
- ctx = *this->ctx_;
-
- // Indicate that the special ctor is being generated.
- ctx.exception (1);
-
- be_visitor_exception_ctor_assign eca_visitor (&ctx);
-
- if (node->accept (&eca_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_cs::"
- "visit_exception -"
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << "}" << be_nl << be_nl;
- }
-
- // Switch streams to the *A.cpp file if we are using this option.
- if (be_global->gen_anyop_files ())
- {
- os = tao_cg->anyop_source ();
- *os << be_nl << be_nl;
- }
-
- if (be_global->tc_support ())
- {
- *os << "// TAO extension - the virtual _type method." << be_nl;
- *os << "::CORBA::TypeCode_ptr " << node->name ()
- << "::_tao_type (void) const" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return ::" << node->tc_name () << ";" << be_uidt_nl;
- *os << "}";
- }
-
- // Make sure we are generating to *C.cpp regardless of the above.
- os = tao_cg->client_stubs ();
-
- if (be_global->tc_support ())
- {
- ctx = *this->ctx_;
- TAO::be_visitor_struct_typecode tc_visitor (&ctx);
-
- if (tc_visitor.visit_exception (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_cs::"
- "visit_exception - "
- "TypeCode definition failed\n"),
- -1);
- }
- }
-
- node->cli_stub_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp
deleted file mode 100644
index 28303432bdf..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp
+++ /dev/null
@@ -1,462 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// exception_ctor.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the special constructor for Exceptions
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_exception,
- exception_ctor,
- "$Id$")
-
-
-// ************************************************************************
-// code to generate the special ctor
-// ************************************************************************
-
-be_visitor_exception_ctor::be_visitor_exception_ctor (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_exception_ctor::~be_visitor_exception_ctor (void)
-{
-}
-
-int
-be_visitor_exception_ctor::post_process (be_decl *bd)
-{
- // This checks for members of an enum 'non-scope' declared inside
- // the exception. If an enum val is actually a member, it will
- // have node type NT_field.
- if (bd->node_type () == AST_Decl::NT_enum_val)
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- if (!this->last_node (bd))
- {
- *os << "," << be_nl;
- }
-
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_exception (be_exception *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl << be_nl;
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- {
- *os << node->local_name ();
- }
- else
- {
- *os << node->name () << "::" << node->local_name ();
- }
-
- *os << " (" << be_idt << be_idt_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_exception_ctor_assign::"
- "visit_exception - "
- "codegen for scope failed\n"),
- -1);
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- {
- *os << be_uidt_nl << ");" << be_uidt;
- }
- else
- {
- *os << be_uidt_nl << ")" << be_uidt;
- }
-
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_field (be_field *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- // Retrieve the type.
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_exception_ctor::"
- "visit_exception - "
- "Bad field type\n"),
- -1);
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_exception_ctor::"
- "visit_field - "
- "cannot accept visitor\n"),
- -1);
- }
-
- *os << " _tao_" << node->local_name ();
-
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << "const ";
-
- be_typedef *tdef = be_typedef::narrow_from_decl (bt);
-
- if (this->ctx_->state () != TAO_CodeGen::TAO_EXCEPTION_CTOR_CH
- && !tdef)
- {
- *os << this->ctx_->scope ()->full_name () << "::";
- }
-
- if (!tdef)
- {
- *os << "_";
- }
-
- *os << bt->nested_type_name (this->ctx_->scope ());
-
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- {
- *os << bt->nested_type_name (this->ctx_->scope ());
- }
- else
- {
- *os << bt->name ();
- }
-
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- {
- *os << "const " << bt->nested_type_name (this->ctx_->scope (), "_ptr");
- }
- else
- {
- *os << "const " << bt->name () << "_ptr";
- }
-
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- {
- *os << "const " << bt->nested_type_name (this->ctx_->scope (), "_ptr");
- }
- else
- {
- *os << "const " << bt->name () << "_ptr";
- }
-
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_valuebox (be_valuebox *node)
-{
- return this->emit_common (node);
-}
-
-int be_visitor_exception_ctor::visit_valuetype (be_valuetype *node)
-{
- return this->emit_common (node);
-}
-
-int be_visitor_exception_ctor::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- return this->emit_common (node);
-}
-
-int be_visitor_exception_ctor::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
- be_typedef *td = this->ctx_->alias ();
-
- if (td != 0)
- {
- bt = td;
- }
- else
- {
- bt = node;
- }
-
- AST_PredefinedType::PredefinedType pt = node->pt ();
- const char *no_td_global = (td == 0 ? "::" : "");
-
- if (pt == AST_PredefinedType::PT_any)
- {
- if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- {
- *os << "const " << no_td_global
- << bt->nested_type_name (this->ctx_->scope ());
- }
- else
- {
- *os << "const ::" << bt->name ();
- }
-
- *os << " &";
-
- return 0;
- }
- else if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- {
- *os << "const " << no_td_global
- << bt->nested_type_name (this->ctx_->scope (), "_ptr ");
- }
- else
- {
- *os << "const ::" << bt->name () << "_ptr ";
- }
- }
- else
- {
- if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- {
- *os << no_td_global << bt->nested_type_name (this->ctx_->scope ());
- }
- else
- {
- *os << "::" << bt->name ();
- }
- }
-
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- {
- *os << "const " << bt->nested_type_name (this->ctx_->scope ());
- }
- else
- {
- *os << "const " << bt->name ();
- }
-
- *os << " &";
-
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- if (node->width () == (long) sizeof (char))
- {
- *os << "const char *";
- }
- else
- {
- *os << "const ::CORBA::WChar *";
- }
-
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- {
- *os << "const " << bt->nested_type_name (this->ctx_->scope ());
- }
- else
- {
- *os << "const " << bt->name ();
- }
-
- *os << " &";
-
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- {
- *os << "const " << bt->nested_type_name (this->ctx_->scope ());
- }
- else
- {
- *os << "const " << bt->name ();
- }
-
- *os << " &";
-
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_exception_ctor::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int be_visitor_exception_ctor::emit_common (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- {
- *os << "const " << bt->nested_type_name (this->ctx_->scope (), " *");
- }
- else
- {
- *os << "const " << bt->name () << " *";
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_factory.cpp b/TAO/TAO_IDL/be/be_visitor_factory.cpp
deleted file mode 100644
index 2a228ffe01d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_factory.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL Backend
-//
-// = FILENAME
-// be_visitor_factory.cpp
-//
-// = DESCRIPTION
-// Defines a factory that returns a specialized visitor object based on the
-// code generation state. This factory creates visitors associated with
-// Asynchronous Messaging Invocations (AMI) since, because of implied IDL,
-// state is not locally known at visitor creation time.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "ast_argument.h"
-
-#include "be_visitor_factory.h"
-#include "be_visitor_context.h"
-
-#include "be_visitor_decl.h"
-#include "be_visitor_scope.h"
-#include "be_visitor_interface/interface.h"
-#include "be_visitor_interface/interface_ch.h"
-#include "be_visitor_interface/ami_interface_ch.h"
-#include "be_visitor_valuetype/valuetype.h"
-#include "be_visitor_valuetype/valuetype_ch.h"
-#include "be_visitor_valuetype/valuetype_obv_ch.h"
-#include "be_visitor_valuetype/valuetype_obv_cs.h"
-#include "be_visitor_valuetype/ami_exception_holder_ch.h"
-#include "be_visitor_valuetype/ami_exception_holder_cs.h"
-#include "be_visitor_operation/operation.h"
-#include "be_visitor_operation/operation_ch.h"
-#include "be_visitor_operation/operation_cs.h"
-#include "be_visitor_operation/ami_ch.h"
-#include "be_visitor_operation/ami_cs.h"
-#include "be_visitor_operation/ami_handler_reply_stub_operation_ch.h"
-#include "be_visitor_operation/ami_handler_reply_stub_operation_cs.h"
-#include "be_visitor_operation/ami_exception_holder_operation_cs.h"
-
-ACE_RCSID (be,
- be_visitor_factory,
- "$Id$")
-
-TAO_Visitor_Factory::TAO_Visitor_Factory (void)
-{
-}
-
-TAO_Visitor_Factory::~TAO_Visitor_Factory (void)
-{
-}
-
-be_visitor *
-TAO_Visitor_Factory::make_visitor (be_visitor_context *ctx)
-{
- be_visitor *retval = 0;
-
- switch (ctx->state ())
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- ACE_NEW_RETURN (retval,
- be_visitor_interface_ch (ctx),
- 0);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CH:
- ACE_NEW_RETURN (retval,
- be_visitor_valuetype_obv_ch (ctx),
- 0);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CS:
- ACE_NEW_RETURN (retval,
- be_visitor_valuetype_obv_cs (ctx),
- 0);
- break;
- case TAO_CodeGen::TAO_OPERATION_CH:
- ACE_NEW_RETURN (retval,
- be_visitor_operation_ch (ctx),
- 0);
- break;
- case TAO_CodeGen::TAO_OPERATION_CS:
- ACE_NEW_RETURN (retval,
- be_visitor_operation_cs (ctx),
- 0);
- break;
- case TAO_CodeGen::TAO_AMI_INTERFACE_CH:
- ACE_NEW_RETURN (retval,
- be_visitor_ami_interface_ch (ctx),
- 0);
- break;
- case TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CH:
- ACE_NEW_RETURN (
- retval,
- be_visitor_operation_ami_handler_reply_stub_operation_ch (ctx),
- 0
- );
- break;
- case TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CS:
- ACE_NEW_RETURN (
- retval,
- be_visitor_operation_ami_handler_reply_stub_operation_cs (ctx),
- 0
- );
- break;
- case TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CH:
- ACE_NEW_RETURN (retval,
- be_visitor_operation_ami_ch (ctx),
- 0);
- break;
- case TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CS:
- ACE_NEW_RETURN (retval,
- be_visitor_operation_ami_cs (ctx),
- 0);
- break;
- case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_RAISE_OPERATION_CS:
- ACE_NEW_RETURN (
- retval,
- be_visitor_operation_ami_exception_holder_operation_cs (ctx),
- 0
- );
- break;
- case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CH:
- ACE_NEW_RETURN (retval,
- be_visitor_valuetype_ami_exception_holder_ch (ctx),
- 0);
- break;
- case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CS:
- ACE_NEW_RETURN (retval,
- be_visitor_valuetype_ami_exception_holder_cs (ctx),
- 0);
- break;
- default:
- // An error.
- return 0;
- }
-
- return retval;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_field.cpp b/TAO/TAO_IDL/be/be_visitor_field.cpp
deleted file mode 100644
index 1d3606b754e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_field.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// $Id$
-//
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_field.cpp
-//
-// = DESCRIPTION
-// Concrete visitor for the base "BE_Field" node
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_type.h"
-#include "be_field.h"
-#include "be_array.h"
-#include "be_typedef.h"
-#include "be_enum.h"
-#include "be_interface.h"
-#include "be_interface_fwd.h"
-#include "be_valuebox.h"
-#include "be_valuetype.h"
-#include "be_valuetype_fwd.h"
-#include "be_component.h"
-#include "be_component_fwd.h"
-#include "be_eventtype.h"
-#include "be_eventtype_fwd.h"
-#include "be_predefined_type.h"
-#include "be_sequence.h"
-#include "be_string.h"
-#include "be_structure.h"
-#include "be_union.h"
-#include "be_helper.h"
-#include "utl_identifier.h"
-
-#include "be_visitor_field.h"
-#include "be_visitor_array.h"
-#include "be_visitor_structure.h"
-#include "be_visitor_union.h"
-#include "be_visitor_context.h"
-#include "ace/Log_Msg.h"
-
-#include "be_visitor_field/field_ch.cpp"
-#include "be_visitor_field/field_ci.cpp"
-#include "be_visitor_field/field_cs.cpp"
-#include "be_visitor_field/cdr_op_ch.cpp"
-#include "be_visitor_field/cdr_op_cs.cpp"
-#include "be_visitor_field/serializer_op_ch.cpp"
-#include "be_visitor_field/serializer_op_cs.cpp"
-
-ACE_RCSID (be,
- be_visitor_field,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp
deleted file mode 100644
index 05f0fb84746..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating CDR operator declarator for field in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_visitor_array/cdr_op_ch.h"
-#include "be_visitor_enum/cdr_op_ch.h"
-#include "be_visitor_sequence/cdr_op_ch.h"
-#include "be_visitor_structure/structure.h"
-#include "be_visitor_structure/cdr_op_ch.h"
-#include "be_visitor_union/union.h"
-#include "be_visitor_union/cdr_op_ch.h"
-
-ACE_RCSID (be_visitor_field,
- cdr_op_ch,
- "$Id$")
-
-
-// **********************************************
-// Visitor for field in the client header file.
-// **********************************************
-
-// Constructor.
-be_visitor_field_cdr_op_ch::be_visitor_field_cdr_op_ch (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-// Destructor.
-be_visitor_field_cdr_op_ch::~be_visitor_field_cdr_op_ch (void)
-{
-}
-
-// Visit the field node.
-int
-be_visitor_field_cdr_op_ch::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// Visit operations on all possible data types that a field can be.
-
-int
-be_visitor_field_cdr_op_ch::visit_array (be_array *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
-
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- // This is the case for anonymous arrays.
-
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // First generate the array declaration.
- be_visitor_array_cdr_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_ch::visit_enum (be_enum *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined
- if (!this->ctx_->alias () // not a typedef.
- && node->is_child (this->ctx_->scope ()))
- {
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // First generate the enum declaration.
- be_visitor_enum_cdr_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_ch::visit_sequence (be_sequence *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // First generate the sequence declaration.
- be_visitor_sequence_cdr_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_sequence - "
- "codegen failed\n"
- ), -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_ch::visit_structure (be_structure *node)
-{
- // if not a typedef and we are defined in the use scope, we must be defined
-
- if (!this->ctx_->alias () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node); // set the node to be the node being visited. The scope
- // is still the same
-
- // first generate the struct declaration
- be_visitor_structure_cdr_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_struct - "
- "codegen failed\n"
- ), -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_ch::visit_typedef (be_typedef *node)
-{
- // Save the node for use in code generation and
- // indicate that the field of the field node
- // is a typedefed quantity.
- this->ctx_->alias (node);
-
- // Make a decision based on the primitive base type.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_typedef - "
- "Bad primitive type\n"
- ), -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-// visit union type
-int
-be_visitor_field_cdr_op_ch::visit_union (be_union *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // First generate the enum declaration.
- be_visitor_union_cdr_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp
deleted file mode 100644
index 80e7dbe755f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp
+++ /dev/null
@@ -1,981 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// field_cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Field in the client stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_visitor_array/cdr_op_cs.h"
-#include "be_visitor_sequence/cdr_op_cs.h"
-#include "be_visitor_structure/cdr_op_cs.h"
-#include "be_visitor_union/cdr_op_cs.h"
-
-ACE_RCSID (be_visitor_field,
- cdr_op_cs,
- "$Id$")
-
-
-// **********************************************
-// visitor for field in the client stubs file
-// **********************************************
-
-be_visitor_field_cdr_op_cs::be_visitor_field_cdr_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_field_cdr_op_cs::~be_visitor_field_cdr_op_cs (void)
-{
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_array (be_array *node)
-{
- // If the array is defined in this scope, we must generate
- // CDR stream operators for the array itself.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_array_cdr_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // Now generate the (de)marshaling code for the array as a
- // field.
-
- TAO_OutStream *os = this->ctx_->stream ();
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_array - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // For anonymous arrays, the type name has a _ prepended. We compute
- // the full_name with or without the underscore and use it later on.
- char fname [NAMEBUFSIZE];
-
- // Save the node's local name and full name in a buffer for quick
- // use later on.
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (this->ctx_->alias () == 0 // Not a typedef.
- && node->is_child (this->ctx_->scope ()))
- {
- // For anonymous arrays ...
- // we have to generate a name for us that has an underscore
- // prepended to our local name. This needs to be inserted after
- // the parents's name.
- if (node->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- node->full_name ());
- }
- }
- else
- {
- // Typedefed node.
- ACE_OS::sprintf (fname,
- "%s",
- node->full_name ());
- }
-
- // Check what is the code generation substate. Are we generating
- // code for the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> "
- << "_tao_aggregate_" << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << "
- << "_tao_aggregate_" << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // This is done in cdr_op_cs and hacked into *.i.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_array - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_enum (be_enum *node)
-{
- // If we are defined inside this scope, we must generate the
- /// CDR stream operators for us here.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_enum_cdr_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_enum - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_enum - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_interface - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- if (node->is_defined ())
- {
- if (f->is_abstract ())
- {
- *os << "(strm << _tao_aggregate."
- << f->local_name () << ".in ())";
- }
- else
- {
- *os << "::CORBA::Object::marshal (" << be_idt << be_idt_nl
- << "_tao_aggregate." << f->local_name () << ".in ()," << be_nl
- << "strm" << be_uidt_nl
- << ")" << be_uidt;
- }
- }
- else
- {
- *os << "TAO::Objref_Traits<" << node->name () << ">::marshal ("
- << be_idt << be_idt_nl
- << "_tao_aggregate." << f->local_name () << ".in ()," << be_nl
- << "strm" << be_uidt_nl
- << ")" << be_uidt;
- }
-
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because an interface cannot be declared inside a
- // structure.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_interface - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_component (be_component *node)
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_interface_fwd - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- if (node->is_defined ())
- {
- if (f->is_abstract ())
- {
- *os << "(strm << _tao_aggregate."
- << f->local_name () << ".in ())";
- }
- else
- {
- *os << "::CORBA::Object::marshal (" << be_idt << be_idt_nl
- << "_tao_aggregate." << f->local_name () << ".in ()," << be_nl
- << "strm" << be_uidt_nl
- << ")" << be_uidt;
- }
- }
- else
- {
- AST_Decl *parent = ScopeAsDecl (node->defined_in ());
-
- if (parent != 0 && parent->node_type () != AST_Decl::NT_root)
- {
- *os << parent->name () << "::";
- }
-
- *os << "TAO::Objref_Traits<" << node->name () << ">::marshal ("
- << be_idt << be_idt_nl
- << "_tao_aggregate." << f->local_name () << ".in ()," << be_nl
- << "strm" << be_uidt_nl
- << ")" << be_uidt;
- }
-
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because an interface cannot be declared inside a
- // structure.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_interface_fwd - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_component_fwd (be_component_fwd *node)
-{
- return this->visit_interface_fwd (node);
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_valuebox (be_valuebox *)
-{
- return this->emit_valuetype_common ();
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_valuetype (be_valuetype *)
-{
- return this->emit_valuetype_common ();
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- return this->emit_valuetype_common ();
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
-
-
-int
-be_visitor_field_cdr_op_cs::emit_valuetype_common (void)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "emit_common - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because a valuetype cannot be declared inside a
- // structure.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "emit_common - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-
-// Visit predefined type.
-int
-be_visitor_field_cdr_op_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_predefined_type - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- AST_PredefinedType::PredefinedType pt = node->pt ();
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << "(strm >> _tao_aggregate." << f->local_name ()
- << ".out ())";
- }
- else if (pt == AST_PredefinedType::PT_char)
- {
- *os << "(strm >> ::ACE_InputCDR::to_char (_tao_aggregate."
- << f->local_name () << "))";
- }
- else if (pt == AST_PredefinedType::PT_wchar)
- {
- *os << "(strm >> ::ACE_InputCDR::to_wchar (_tao_aggregate."
- << f->local_name () << "))";
- }
- else if (pt == AST_PredefinedType::PT_octet)
- {
- *os << "(strm >> ::ACE_InputCDR::to_octet (_tao_aggregate."
- << f->local_name () << "))";
- }
- else if (pt == AST_PredefinedType::PT_boolean)
- {
- *os << "(strm >> ::ACE_InputCDR::to_boolean (_tao_aggregate."
- << f->local_name () << "))";
- }
- else
- {
- *os << "(strm >> _tao_aggregate." << f->local_name () << ")";
- }
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())";
- }
- else if (pt == AST_PredefinedType::PT_char)
- {
- *os << "(strm << ::ACE_OutputCDR::from_char (_tao_aggregate."
- << f->local_name () << "))";
- }
- else if (pt == AST_PredefinedType::PT_wchar)
- {
- *os << "(strm << ::ACE_OutputCDR::from_wchar (_tao_aggregate."
- << f->local_name () << "))";
- }
- else if (pt == AST_PredefinedType::PT_octet)
- {
- *os << "(strm << ::ACE_OutputCDR::from_octet (_tao_aggregate."
- << f->local_name () << "))";
- }
- else if (pt == AST_PredefinedType::PT_boolean)
- {
- *os << "(strm << ::ACE_OutputCDR::from_boolean (_tao_aggregate."
- << f->local_name () << "))";
- }
- else
- {
- *os << "(strm << _tao_aggregate." << f->local_name () << ")";
- }
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_array - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_sequence (be_sequence *node)
-{
- // If the sequence is defined in this scope, generate its
- // CDR stream operators here.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_sequence_cdr_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // How generate the marshaling code for the sequence as a field.
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_sequence - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_sequence - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_string - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // check what is the code generation's substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_array - "
- "bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_structure (be_structure *node)
-{
- // If the struct is defined in this scope, generate its CDR stream
- // operators here.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_structure_cdr_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_struct - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // How generate the marshaling code for the struct as a field.
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_structure - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_structure - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_union (be_union *node)
-{
- // If the union is defined in this scope, generate its CDR stream
- // operators here.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_union_cdr_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_union - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // Now generate marshaling code for the union as a field.
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_union - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_union - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-// ****************************************************************
-
-be_visitor_cdr_op_field_decl::be_visitor_cdr_op_field_decl (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-// This is a field, but the action depends on the type of the field,
-// use this visitor to detect the type of the field.
-// Notice that this is why the parent visitor (who create us) cannot
-// do the job, because it may have another purpose for some or all of
-// the visit_* methods; in other words, while running a visitor to
-// generate CDR operators for structures we cannot use that one to
-// generate the code of each field, because visit_struct already has a
-// meaning in that visitor.
-int
-be_visitor_cdr_op_field_decl::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (bt == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_cdr_op_field_decl::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- // @@ Shouldn't this be saved in the visitor and not the context?!
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_cdr_op_field_decl::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_cdr_op_field_decl::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_cdr_op_field_decl::"
- "visit_array - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // For anonymous arrays, the type name has a _ prepended. We compute
- // the full_name with or without the underscore and use it later on.
- char fname [NAMEBUFSIZE];
-
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (this->ctx_->alias () == 0 // Not a typedef.
- && node->is_child (this->ctx_->scope ()))
- {
- // For anonymous arrays,
- // we have to generate a name for us that has an underscope
- // prepended to our local name. This needs to be inserted after
- // the parents's name.
-
- if (node->is_nested ())
- {
- be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- node->full_name ());
- }
- }
- else
- {
- // Typedefed node.
- ACE_OS::sprintf (fname,
- "%s",
- node->full_name ());
- }
-
- // Check what is the code generation substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << fname << "_forany "
- << "_tao_aggregate_" << f->local_name () << be_idt << be_idt_nl
- << "(const_cast<" << be_idt << be_idt_nl
- << fname << "_slice*> (" << be_nl
- << "_tao_aggregate." << f->local_name () << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl;
-
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_cdr_op_field_decl::"
- "visit_array - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-
-int
-be_visitor_cdr_op_field_decl::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node); // Save the typedef node for use in code
- // generation as we visit the base type.
-
- // The node to be visited in the base primitve type that gets typedefed.
- be_type *bt = node->primitive_base_type ();
-
- if (bt == 0 || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_cdr_op_field_decl::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp
deleted file mode 100644
index 710f8b1c8b8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp
+++ /dev/null
@@ -1,607 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// field_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Field node in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_visitor_enum/enum_ch.h"
-#include "be_visitor_sequence/sequence_ch.h"
-#include "nr_extern.h"
-
-ACE_RCSID (be_visitor_field,
- field_ch,
- "$Id$")
-
-// **********************************************
-// Visitor for field in the client header file.
-// **********************************************
-
-be_visitor_field_ch::be_visitor_field_ch (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_field_ch::~be_visitor_field_ch (void)
-{
-}
-
-int
-be_visitor_field_ch::visit_field (be_field *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- *os << be_nl;
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- // Now output the field name.
- *os << " " << node->local_name () << ";";
-
- return 0;
-}
-
-// Visit operations on all possible data types that a field can be.
-
-int
-be_visitor_field_ch::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- // This is the case for anonymous arrays.
-
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node); // set the node to be the node being visited. The scope
- // is still the same
-
- // First generate the array declaration
- ctx.state (TAO_CodeGen::TAO_ARRAY_CH);
- be_visitor_array_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
-
- ctx.state (TAO_CodeGen::TAO_ROOT_CH);
-
- // Having defined all array type and its supporting operations, now
- // generate the actual variable that is a field of the structure.
- *os << be_nl << be_nl << "_" << bt->local_name ();
- }
- else
- {
- // This was a typedefed array.
- // ACE_NESTED_CLASS macro generated by nested_type_name
- // is necessary if the struct, union, or valuetype containing this
- // field was not defined inside a module. In such a case, VC++
- // complains that the non-module scope is not yet fully defined.
- UTL_Scope *holds_container = this->ctx_->scope ()->defined_in ();
- AST_Decl *hc_decl = ScopeAsDecl (holds_container);
-
- if (hc_decl->node_type () != AST_Decl::NT_module)
- {
- *os << bt->nested_type_name (this->ctx_->scope ());
- }
- else
- {
- *os << bt->name ();
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_ch::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // First generate the enum declaration.
- be_visitor_enum_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // This was a typedefed array.
- // ACE_NESTED_CLASS macro generated by nested_type_name
- // is necessary if the struct, union, or valuetype containing this
- // field was not defined inside a module. In such a case, VC++
- // complains that the non-module scope is not yet fully defined.
- UTL_Scope *holds_container = this->ctx_->scope ()->defined_in ();
- AST_Decl *hc_decl = ScopeAsDecl (holds_container);
-
- if (hc_decl->node_type () != AST_Decl::NT_module)
- {
- *os << bt->nested_type_name (this->ctx_->scope ());
- }
- else
- {
- *os << bt->name ();
- }
-
- return 0;
-}
-
-int
-be_visitor_field_ch::visit_interface (be_interface *node)
-{
- return this->emit_common (node);
-}
-
-int
-be_visitor_field_ch::visit_interface_fwd (be_interface_fwd *node)
-{
- return this->emit_common (node);
-}
-
-int
-be_visitor_field_ch::visit_valuebox (be_valuebox *node)
-{
- return this->emit_common (node);
-}
-
-int
-be_visitor_field_ch::visit_valuetype (be_valuetype *node)
-{
- return this->emit_common (node);
-}
-
-int
-be_visitor_field_ch::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- return this->emit_common (node);
-}
-
-
-int
-be_visitor_field_ch::emit_common (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- // ACE_NESTED_CLASS macro generated by nested_type_name
- // is necessary if the struct, union, or valuetype containing this
- // field was not defined inside a module. In such a case, VC++
- // complains that the non-module scope is not yet fully defined.
- UTL_Scope *holds_container = this->ctx_->scope ()->defined_in ();
- AST_Decl *hc_decl = ScopeAsDecl (holds_container);
-
- if (hc_decl->node_type () != AST_Decl::NT_module)
- {
- *os << bt->nested_type_name (this->ctx_->scope (), "_var");
- }
- else
- {
- *os << bt->name () << "_var";
- }
-
- return 0;
-}
-
-int
-be_visitor_field_ch::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
- be_typedef *td = this->ctx_->alias ();
-
- if (td != 0)
- {
- bt = td;
- }
- else
- {
- bt = node;
- }
-
- // If we are a typedef of a basic type, ACE_NESTED_CLASS might
- // be emitted as part of the type name, in which case the '::'
- // would be incorrect for certain expansions of the macro.
- if (td == 0)
- {
- *os << "::";
- }
-
- if (node->pt () == AST_PredefinedType::PT_object)
- {
- *os << bt->name () << "_var";
- }
- else if (node->pt () == AST_PredefinedType::PT_value)
- {
- *os << bt->name () << " *";
- }
- else if (node->pt () == AST_PredefinedType::PT_pseudo)
- {
- // This was a typedefed array.
- // ACE_NESTED_CLASS macro generated by nested_type_name
- // is necessary if the struct, union, or valuetype containing this
- // field was not defined inside a module. In such a case, VC++
- // complains that the non-module scope is not yet fully defined.
- UTL_Scope *holds_container = this->ctx_->scope ()->defined_in ();
- AST_Decl *hc_decl = ScopeAsDecl (holds_container);
-
- if (hc_decl->node_type () != AST_Decl::NT_module)
- {
- *os << bt->nested_type_name (this->ctx_->scope (), "_var");
- }
- else
- {
- *os << bt->name () << "_var";
- }
- }
- else
- {
- // This was a typedefed array.
- // ACE_NESTED_CLASS macro generated by nested_type_name
- // is necessary if the struct, union, or valuetype containing this
- // field was not defined inside a module. In such a case, VC++
- // complains that the non-module scope is not yet fully defined.
- UTL_Scope *holds_container = this->ctx_->scope ()->defined_in ();
- AST_Decl *hc_decl = ScopeAsDecl (holds_container);
-
- if (hc_decl->node_type () != AST_Decl::NT_module)
- {
- *os << bt->nested_type_name (this->ctx_->scope ());
- }
- else
- {
- // All the predefined types are in the CORBA namespace,
- // so we go ahead and add the global :: qualifier.
- *os << bt->name ();
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_ch::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- // Put the field node into the (anonymous) sequence node, to be
- // used later for unique name generation.
- be_field *member_node =
- be_field::narrow_from_decl (this->ctx_->node ());
- node->field_node (member_node);
-
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // First generate the sequence declaration.
- be_visitor_sequence_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
-
- // If we are being reused by valutype, this would get generated
- // in the private section of the OBV_xx class, so we must
- // generate the typedef for that case elsewhere.
- if (this->ctx_->scope ()->node_type () != AST_Decl::NT_valuetype)
- {
- // Generate the anonymous sequence member typedef.
- be_decl *bs = this->ctx_->scope ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "typedef " << bt->nested_type_name (bs)
- << " _" << this->ctx_->node ()->local_name ()
- << "_seq;" << be_nl;
- }
- }
-
- // ACE_NESTED_CLASS macro generated by nested_type_name
- // is not necessary in all cases.
- be_typedef *tdef = be_typedef::narrow_from_decl (bt);
-
- // This was a typedefed array.
- // ACE_NESTED_CLASS macro generated by nested_type_name
- // is necessary if the struct, union, or valuetype containing this
- // field was not defined inside a module. In such a case, VC++
- // complains that the non-module scope is not yet fully defined.
- UTL_Scope *holds_container = this->ctx_->scope ()->defined_in ();
- AST_Decl *hc_decl = ScopeAsDecl (holds_container);
-
- if (hc_decl->node_type () != AST_Decl::NT_module
- || !tdef)
- {
- *os << bt->nested_type_name (this->ctx_->scope ());
- }
- else
- {
- *os << bt->name ();
- }
-
- return 0;
-}
-
-int
-be_visitor_field_ch::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (node->width () == (long) sizeof (char))
- {
- *os << "TAO::String_Manager";
- }
- else
- {
- *os << "TAO::WString_Manager";
- }
-
- return 0;
-}
-
-int
-be_visitor_field_ch::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!this->ctx_->alias () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- be_visitor_structure_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_struct - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // This was a typedefed array.
- // ACE_NESTED_CLASS macro generated by nested_type_name
- // is necessary if the struct, union, or valuetype containing this
- // field was not defined inside a module. In such a case, VC++
- // complains that the non-module scope is not yet fully defined.
- UTL_Scope *holds_container = this->ctx_->scope ()->defined_in ();
- AST_Decl *hc_decl = ScopeAsDecl (holds_container);
-
- if (hc_decl->node_type () != AST_Decl::NT_module)
- {
- *os << bt->nested_type_name (this->ctx_->scope ());
- }
- else
- {
- *os << bt->name ();
- }
-
- return 0;
-}
-
-// Visit typedefed type.
-int
-be_visitor_field_ch::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- // Make a decision based on the primitive base type.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- // Reset the alias.
- this->ctx_->alias (0);
- return 0;
-}
-
-// visit union type
-int
-be_visitor_field_ch::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- be_visitor_union_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_union - "
- "codegen failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl;
-
- // This was a typedefed array.
- // ACE_NESTED_CLASS macro generated by nested_type_name
- // is necessary if the struct, union, or valuetype containing this
- // field was not defined inside a module. In such a case, VC++
- // complains that the non-module scope is not yet fully defined.
- UTL_Scope *holds_container = this->ctx_->scope ()->defined_in ();
- AST_Decl *hc_decl = ScopeAsDecl (holds_container);
-
- if (hc_decl->node_type () != AST_Decl::NT_module)
- {
- *os << bt->nested_type_name (this->ctx_->scope ());
- }
- else
- {
- *os << bt->name ();
- }
-
- return 0;
-}
-
-int
-be_visitor_field_ch::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_field_ch::visit_component_fwd (
- be_component_fwd *node
- )
-{
- return this->visit_interface_fwd (node);
-}
-
-int
-be_visitor_field_ch::visit_eventtype (
- be_eventtype *node
- )
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_field_ch::visit_eventtype_fwd (
- be_eventtype_fwd *node
- )
-{
- return this->visit_valuetype_fwd (node);
-}
-
-
diff --git a/TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp b/TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp
deleted file mode 100644
index 9e753d25833..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp
+++ /dev/null
@@ -1,162 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// field_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Field in the client inline file
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_visitor_array/array_ci.h"
-#include "be_visitor_structure/structure_ci.h"
-#include "be_visitor_union/union_ci.h"
-
-ACE_RCSID (be_visitor_field,
- field_ci,
- "$Id$")
-
-
-be_visitor_field_ci::be_visitor_field_ci (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_field_ci::~be_visitor_field_ci (void)
-{
-}
-
-int
-be_visitor_field_ci::visit_field (be_field *node)
-{
- be_type *bt =
- be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ci::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ci::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// Visit operations on all possible data types that a field can be
-
-int
-be_visitor_field_ci::visit_array (be_array *node)
-{
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_array_ci visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ci::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_ci::visit_sequence (be_sequence *)
-{
- return 0;
-}
-
-int
-be_visitor_field_ci::visit_structure (be_structure *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_structure_ci visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ci::"
- "visit_struct - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_ci::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_field_ci::visit_union (be_union *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_union_ci visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ci::"
- "visit_union - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp b/TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp
deleted file mode 100644
index ba5b6dc0d68..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp
+++ /dev/null
@@ -1,205 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// field_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Field in the client stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_visitor_array/array_cs.h"
-#include "be_visitor_enum/enum_cs.h"
-#include "be_visitor_sequence/sequence_cs.h"
-#include "be_visitor_structure/structure_cs.h"
-#include "be_visitor_union/union_cs.h"
-
-ACE_RCSID (be_visitor_field,
- field_cs,
- "$Id$")
-
-
-// **********************************************
-// Visitor for field in the client stubs file.
-// **********************************************
-
-be_visitor_field_cs::be_visitor_field_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_field_cs::~be_visitor_field_cs (void)
-{
-}
-
-int
-be_visitor_field_cs::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cs::visit_array (be_array *node)
-{
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_array_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cs::visit_enum (be_enum *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_enum_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cs::visit_sequence (be_sequence *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_sequence_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cs::visit_structure (be_structure *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_structure_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_struct - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_field_cs::visit_union (be_union *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_union_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_union - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_field/serializer_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_field/serializer_op_ch.cpp
deleted file mode 100644
index 098301bb4c0..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_field/serializer_op_ch.cpp
+++ /dev/null
@@ -1,249 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating TAO::DCPS::Serializer operator declarator for field
-// in the client header
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_visitor_array/serializer_op_ch.h"
-#include "be_visitor_enum/serializer_op_ch.h"
-#include "be_visitor_sequence/serializer_op_ch.h"
-#include "be_visitor_structure/structure.h"
-#include "be_visitor_structure/serializer_op_ch.h"
-#include "be_visitor_union/union.h"
-#include "be_visitor_union/serializer_op_ch.h"
-
-ACE_RCSID (be_visitor_field,
- serializer_op_ch,
- "$Id$")
-
-
-// **********************************************
-// Visitor for field in the client header file.
-// **********************************************
-
-// Constructor.
-be_visitor_field_serializer_op_ch::be_visitor_field_serializer_op_ch (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-// Destructor.
-be_visitor_field_serializer_op_ch::~be_visitor_field_serializer_op_ch (void)
-{
-}
-
-// Visit the field node.
-int
-be_visitor_field_serializer_op_ch::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_ch::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_ch::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// Visit operations on all possible data types that a field can be.
-
-int
-be_visitor_field_serializer_op_ch::visit_array (be_array *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
-
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- // This is the case for anonymous arrays.
-
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // First generate the array declaration.
- be_visitor_array_serializer_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_ch::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_ch::visit_enum (be_enum *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined
- if (!this->ctx_->alias () // not a typedef.
- && node->is_child (this->ctx_->scope ()))
- {
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // First generate the enum declaration.
- be_visitor_enum_serializer_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_ch::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_ch::visit_sequence (be_sequence *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // First generate the sequence declaration.
- be_visitor_sequence_serializer_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_ch::"
- "visit_sequence - "
- "codegen failed\n"
- ), -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_ch::visit_structure (be_structure *node)
-{
- // if not a typedef and we are defined in the use scope, we must be defined
-
- if (!this->ctx_->alias () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node); // set the node to be the node being visited. The scope
- // is still the same
-
- // first generate the struct declaration
- be_visitor_structure_serializer_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_ch::"
- "visit_struct - "
- "codegen failed\n"
- ), -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_ch::visit_typedef (be_typedef *node)
-{
- // Save the node for use in code generation and
- // indicate that the field of the field node
- // is a typedefed quantity.
- this->ctx_->alias (node);
-
- // Make a decision based on the primitive base type.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_ch::"
- "visit_typedef - "
- "Bad primitive type\n"
- ), -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-// visit union type
-int
-be_visitor_field_serializer_op_ch::visit_union (be_union *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // First generate the enum declaration.
- be_visitor_union_serializer_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_ch::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_field/serializer_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_field/serializer_op_cs.cpp
deleted file mode 100644
index e599cc1c088..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_field/serializer_op_cs.cpp
+++ /dev/null
@@ -1,1137 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// field_serializer_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating TAO::DCPS::Serializer operators code for Field in
-// the client stubs file.
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_visitor_array/serializer_op_cs.h"
-#include "be_visitor_sequence/serializer_op_cs.h"
-#include "be_visitor_structure/serializer_op_cs.h"
-#include "be_visitor_union/serializer_op_cs.h"
-
-ACE_RCSID (be_visitor_field,
- serializer_op_cs,
- "$Id$")
-
-
-// **********************************************
-// visitor for field in the client stubs file
-// **********************************************
-
-be_visitor_field_serializer_op_cs::be_visitor_field_serializer_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_field_serializer_op_cs::~be_visitor_field_serializer_op_cs (void)
-{
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_array (be_array *node)
-{
- // If the array is defined in this scope, we must generate
- // CDR stream operators for the array itself.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_array_serializer_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // Now generate the (de)marshaling code for the array as a
- // field.
-
- TAO_OutStream *os = this->ctx_->stream ();
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_array - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // For anonymous arrays, the type name has a _ prepended. We compute
- // the full_name with or without the underscore and use it later on.
- char fname [NAMEBUFSIZE];
-
- // Save the node's local name and full name in a buffer for quick
- // use later on.
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (this->ctx_->alias () == 0 // Not a typedef.
- && node->is_child (this->ctx_->scope ()))
- {
- // For anonymous arrays ...
- // we have to generate a name for us that has an underscore
- // prepended to our local name. This needs to be inserted after
- // the parents's name.
- if (node->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- node->full_name ());
- }
- }
- else
- {
- // Typedefed node.
- ACE_OS::sprintf (fname,
- "%s",
- node->full_name ());
- }
-
- // Check what is the code generation substate. Are we generating
- // code for the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- *os << "_tao_is_bounded_size (_tao_aggregate_" << f->local_name ()
- << ")";
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- // get the size of an array typedef
- *os << "_dcps_max_marshaled_size (_tao_aggregate_" << f->local_name ()
- << ")";
- break;
- case TAO_CodeGen::TAO_FIND_SIZE:
- // get the size of an array typedef
- *os << "_dcps_find_size (_tao_aggregate_" << f->local_name ()
- << ")";
- break;
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> "
- << "_tao_aggregate_" << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << "
- << "_tao_aggregate_" << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // This is done in serializer_op_cs and hacked into *.i.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_array - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_enum (be_enum *node)
-{
- // If we are defined inside this scope, we must generate the
- /// Serializer stream operators for us here.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_enum_serializer_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_enum - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- *os << " true /* enum */";
- break;
- case TAO_CodeGen::TAO_FIND_SIZE:
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- // enums are serialized as CORBA::ULong
- *os << "_dcps_max_marshaled_size_ulong () /* enum */";
- break;
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_enum - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_interface - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- if (node->is_defined ())
- {
- if (f->is_abstract ())
- {
- *os << "(strm << _tao_aggregate."
- << f->local_name () << ".in ())";
- }
- else
- {
- *os << "::CORBA::Object::marshal (" << be_idt << be_idt_nl
- << "_tao_aggregate." << f->local_name () << ".in ()," << be_nl
- << "strm" << be_uidt_nl
- << ")" << be_uidt;
- }
- }
- else
- {
- *os << "TAO::Objref_Traits<" << node->name () << ">::marshal ("
- << be_idt << be_idt_nl
- << "_tao_aggregate." << f->local_name () << ".in ()," << be_nl
- << "strm" << be_uidt_nl
- << ")" << be_uidt;
- }
-
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because an interface cannot be declared inside a
- // structure.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_interface - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_component (be_component *node)
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_interface_fwd - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- if (node->is_defined ())
- {
- if (f->is_abstract ())
- {
- *os << "(strm << _tao_aggregate."
- << f->local_name () << ".in ())";
- }
- else
- {
- *os << "::CORBA::Object::marshal (" << be_idt << be_idt_nl
- << "_tao_aggregate." << f->local_name () << ".in ()," << be_nl
- << "strm" << be_uidt_nl
- << ")" << be_uidt;
- }
- }
- else
- {
- AST_Decl *parent = ScopeAsDecl (node->defined_in ());
-
- if (parent != 0 && parent->node_type () != AST_Decl::NT_root)
- {
- *os << parent->name () << "::";
- }
-
- *os << "TAO::Objref_Traits<" << node->name () << ">::marshal ("
- << be_idt << be_idt_nl
- << "_tao_aggregate." << f->local_name () << ".in ()," << be_nl
- << "strm" << be_uidt_nl
- << ")" << be_uidt;
- }
-
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because an interface cannot be declared inside a
- // structure.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_interface_fwd - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_component_fwd (be_component_fwd *node)
-{
- return this->visit_interface_fwd (node);
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_valuetype (be_valuetype *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_valuetype - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because a valuetype cannot be declared inside a
- // structure.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_valuetype - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_valuetype_fwd - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because a valuetype cannot be declared inside a
- // structure.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_valuetype_fwd - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
-
-// Visit predefined type.
-int
-be_visitor_field_serializer_op_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_predefined_type - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- AST_PredefinedType::PredefinedType pt = node->pt ();
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
-
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_predefined_type - TAO_IS_BOUNDED_SIZE "
- "object and psuedo are not supported by DDS\n"),
- -1);
- }
-
- else
- {
- *os << " true "; // all predefined types are bounded
- }
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- case TAO_CodeGen::TAO_FIND_SIZE: // the max and current sizes are the same for predefined types
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_predefined_type - TAO_MAX_MARSHALED_SIZE "
- "object and psuedo are not supported by DDS\n"),
- -1);
- }
- else if (pt == AST_PredefinedType::PT_char)
- {
- *os << "_dcps_max_marshaled_size (::ACE_OutputCDR::from_char (_tao_aggregate."
- << f->local_name () << "))";
- }
- else if (pt == AST_PredefinedType::PT_wchar)
- {
- *os << "_dcps_max_marshaled_size (::ACE_OutputCDR::from_wchar (_tao_aggregate."
- << f->local_name () << "))";
- }
- else if (pt == AST_PredefinedType::PT_octet)
- {
- *os << "_dcps_max_marshaled_size (::ACE_OutputCDR::from_octet (_tao_aggregate."
- << f->local_name () << "))";
- }
- else if (pt == AST_PredefinedType::PT_boolean)
- {
- *os << "_dcps_max_marshaled_size (::ACE_OutputCDR::from_boolean (_tao_aggregate."
- << f->local_name () << "))";
- }
- else
- {
- *os << "_dcps_max_marshaled_size (_tao_aggregate." << f->local_name () << ")";
- }
- break;
- case TAO_CodeGen::TAO_CDR_INPUT:
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << "(strm >> _tao_aggregate." << f->local_name ()
- << ".out ())";
- }
- else if (pt == AST_PredefinedType::PT_char)
- {
- *os << "(strm >> ::ACE_InputCDR::to_char (_tao_aggregate."
- << f->local_name () << "))";
- }
- else if (pt == AST_PredefinedType::PT_wchar)
- {
- *os << "(strm >> ::ACE_InputCDR::to_wchar (_tao_aggregate."
- << f->local_name () << "))";
- }
- else if (pt == AST_PredefinedType::PT_octet)
- {
- *os << "(strm >> ::ACE_InputCDR::to_octet (_tao_aggregate."
- << f->local_name () << "))";
- }
- else if (pt == AST_PredefinedType::PT_boolean)
- {
- *os << "(strm >> ::ACE_InputCDR::to_boolean (_tao_aggregate."
- << f->local_name () << "))";
- }
- else
- {
- *os << "(strm >> _tao_aggregate." << f->local_name () << ")";
- }
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())";
- }
- else if (pt == AST_PredefinedType::PT_char)
- {
- *os << "(strm << ::ACE_OutputCDR::from_char (_tao_aggregate."
- << f->local_name () << "))";
- }
- else if (pt == AST_PredefinedType::PT_wchar)
- {
- *os << "(strm << ::ACE_OutputCDR::from_wchar (_tao_aggregate."
- << f->local_name () << "))";
- }
- else if (pt == AST_PredefinedType::PT_octet)
- {
- *os << "(strm << ::ACE_OutputCDR::from_octet (_tao_aggregate."
- << f->local_name () << "))";
- }
- else if (pt == AST_PredefinedType::PT_boolean)
- {
- *os << "(strm << ::ACE_OutputCDR::from_boolean (_tao_aggregate."
- << f->local_name () << "))";
- }
- else
- {
- *os << "(strm << _tao_aggregate." << f->local_name () << ")";
- }
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_predefined_type - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_sequence (be_sequence *node)
-{
- // If the sequence is defined in this scope, generate its
- // Serializer stream operators here.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_sequence_serializer_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // How generate the marshaling code for the sequence as a field.
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_sequence - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- *os << "_tao_is_bounded_size (_tao_aggregate." << f->local_name ()
- << ")";
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- *os << "_dcps_max_marshaled_size (_tao_aggregate." << f->local_name ()
- << ")";
- break;
- case TAO_CodeGen::TAO_FIND_SIZE:
- *os << "_dcps_find_size (_tao_aggregate." << f->local_name ()
- << ")";
- break;
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_sequence - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_string - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // check what is the code generation's substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- if (0 == node->max_size ()->ev ()->u.ulval)
- *os << "false /* unbounded string */";
- else
- *os << "true /* bounded string */";
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- char buff[15];
- ACE_OS::sprintf(buff, "%ld", node->max_size ()->ev ()->u.ulval);
- *os << "_dcps_max_marshaled_size_ulong () + " << buff;
- break;
- case TAO_CodeGen::TAO_FIND_SIZE:
- *os << "_dcps_max_marshaled_size_ulong() + "
- << "ACE_OS::strlen(_tao_aggregate."
- << f->local_name () << ".in ())";
- break;
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_array - "
- "bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_structure (be_structure *node)
-{
- // If the struct is defined in this scope, generate its Serializer stream
- // operators here.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_structure_serializer_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_struct - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // How generate the marshaling code for the struct as a field.
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_structure - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- *os << "_tao_is_bounded_size (_tao_aggregate." << f->local_name ()
- << ")";
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- *os << "_dcps_max_marshaled_size (_tao_aggregate." << f->local_name ()
- << ")";
- break;
- case TAO_CodeGen::TAO_FIND_SIZE:
- *os << "_dcps_find_size (_tao_aggregate." << f->local_name ()
- << ")";
- break;
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_structure - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_field_serializer_op_cs::visit_union (be_union *node)
-{
- // If the union is defined in this scope, generate its Serializer stream
- // operators here.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_union_serializer_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_union - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // Now generate marshaling code for the union as a field.
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_union - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- *os << "_tao_is_bounded_size (_tao_aggregate." << f->local_name ()
- << ")";
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- *os << "_dcps_max_marshaled_size (_tao_aggregate." << f->local_name ()
- << ")";
- break;
- case TAO_CodeGen::TAO_FIND_SIZE:
- *os << "_dcps_find_size (_tao_aggregate." << f->local_name ()
- << ")";
- break;
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << _tao_aggregate." << f->local_name () << ")";
-
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_serializer_op_cs::"
- "visit_union - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-// ****************************************************************
-
-be_visitor_serializer_op_field_decl::be_visitor_serializer_op_field_decl (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-// This is a field, but the action depends on the type of the field,
-// use this visitor to detect the type of the field.
-// Notice that this is why the parent visitor (who create us) cannot
-// do the job, because it may have another purpose for some or all of
-// the visit_* methods; in other words, while running a visitor to
-// generate TAO::DCPS::Serializer operators for structures we cannot use that one to
-// generate the code of each field, because visit_struct already has a
-// meaning in that visitor.
-int
-be_visitor_serializer_op_field_decl::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (bt == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_serializer_op_field_decl::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- // @@ Shouldn't this be saved in the visitor and not the context?!
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_serializer_op_field_decl::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_serializer_op_field_decl::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_serializer_op_field_decl::"
- "visit_array - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // For anonymous arrays, the type name has a _ prepended. We compute
- // the full_name with or without the underscore and use it later on.
- char fname [NAMEBUFSIZE];
-
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (this->ctx_->alias () == 0 // Not a typedef.
- && node->is_child (this->ctx_->scope ()))
- {
- // For anonymous arrays,
- // we have to generate a name for us that has an underscope
- // prepended to our local name. This needs to be inserted after
- // the parents's name.
-
- if (node->is_nested ())
- {
- be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- node->full_name ());
- }
- }
- else
- {
- // Typedefed node.
- ACE_OS::sprintf (fname,
- "%s",
- node->full_name ());
- }
-
- // Check what is the code generation substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- case TAO_CodeGen::TAO_FIND_SIZE:
- case TAO_CodeGen::TAO_CDR_INPUT:
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << fname << "_forany "
- << "_tao_aggregate_" << f->local_name () << be_idt << be_idt_nl
- << "(const_cast<" << be_idt << be_idt_nl
- << fname << "_slice*> (" << be_nl
- << "_tao_aggregate." << f->local_name () << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl;
-
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_serializer_op_field_decl::"
- "visit_array - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-
-int
-be_visitor_serializer_op_field_decl::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node); // Save the typedef node for use in code
- // generation as we visit the base type.
-
- // The node to be visited in the base primitve type that gets typedefed.
- be_type *bt = node->primitive_base_type ();
-
- if (bt == 0 || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_serializer_op_field_decl::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_home.cpp b/TAO/TAO_IDL/be/be_visitor_home.cpp
deleted file mode 100644
index b3c720138a7..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_home.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_home.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for a component home.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-#include "be_home.h"
-
-#include "be_visitor_home.h"
-#include "be_visitor_typecode/typecode_defn.h"
-#include "be_visitor_typecode/objref_typecode.h"
-#include "be_visitor_context.h"
-#include "be_helper.h"
-#include "be_extern.h"
-#include "ace/Log_Msg.h"
-
-#include "be_visitor_home/home_ch.cpp"
-#include "be_visitor_home/home_cs.cpp"
-
-ACE_RCSID (be,
- be_visitor_home,
- "$Id$")
-
diff --git a/TAO/TAO_IDL/be/be_visitor_home/home_ch.cpp b/TAO/TAO_IDL/be/be_visitor_home/home_ch.cpp
deleted file mode 100644
index cbe0a71da1e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_home/home_ch.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// home_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Component Home node in the client header.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_home,
- home_ch,
- "$Id$")
-
-be_visitor_home_ch::be_visitor_home_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_home_ch::~be_visitor_home_ch (void)
-{
-}
-
-int
-be_visitor_home_ch::visit_home (be_home *node)
-{
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // All we do in this is generate a forward declaration of the class.
- *os << be_nl << be_nl << "class " << node->local_name () << ";";
-
- // Generate the ifdefined macro for the _ptr type.
- os->gen_ifdef_macro (node->flat_name (), "_ptr");
-
- // Generate the _ptr typedef.
- *os << be_nl << be_nl
- << "typedef " << node->local_name () << " *" << node->local_name ()
- << "_ptr;";
-
- os->gen_endif ();
-
- if (be_global->tc_support ())
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_typecode_decl tc_visitor (&ctx);
-
- if (node->accept (&tc_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_home_ch::"
- "visit_home - "
- "TypeCode definition failed\n"),
- -1);
- }
- }
-
- node->cli_hdr_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_home/home_cs.cpp b/TAO/TAO_IDL/be/be_visitor_home/home_cs.cpp
deleted file mode 100644
index d57f034cc09..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_home/home_cs.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// home_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Component Home node in the client source.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_home,
- home_cs,
- "$Id$")
-
-be_visitor_home_cs::be_visitor_home_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_home_cs::~be_visitor_home_cs (void)
-{
-}
-
-int
-be_visitor_home_cs::visit_home (be_home *node)
-{
- if (node->cli_stub_gen () || node->imported ())
- {
- return 0;
- }
-
- if (be_global->tc_support ())
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- TAO::be_visitor_objref_typecode tc_visitor (&ctx);
-
- // No double dispatch here so the objref_typecode visitor
- // can dynamic_cast the node to tell it's a home.
- if (tc_visitor.visit_interface (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_home_cs::"
- "visit_home - "
- "TypeCode definition failed\n"),
- -1);
- }
- }
-
- node->cli_stub_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface.cpp
deleted file mode 100644
index bab1d145dd5..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-// $Id$
-//
-/* -*- c++ -*- */
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_interface.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Interface
-//
-// = AUTHOR
-// Aniruddha Gokhale and Carlos O'Ryan
-//
-// ============================================================================
-
-#include "be_argument.h"
-#include "be_interface.h"
-#include "be_attribute.h"
-#include "be_constant.h"
-#include "be_enum.h"
-#include "be_exception.h"
-#include "be_module.h"
-#include "be_operation.h"
-#include "be_structure.h"
-#include "be_structure_fwd.h"
-#include "be_union.h"
-#include "be_union_fwd.h"
-#include "be_typedef.h"
-#include "be_predefined_type.h"
-#include "be_component.h"
-#include "be_helper.h"
-#include "be_extern.h"
-#include "be_util.h"
-#include "be_native.h"
-#include "utl_identifier.h"
-#include "utl_exceptlist.h"
-#include "nr_extern.h"
-
-#include "be_visitor_interface.h"
-#include "be_visitor_attribute.h"
-#include "be_visitor_constant.h"
-#include "be_visitor_enum.h"
-#include "be_visitor_exception.h"
-#include "be_visitor_structure.h"
-#include "be_visitor_structure_fwd.h"
-#include "be_visitor_typedef.h"
-#include "be_visitor_union.h"
-#include "be_visitor_union_fwd.h"
-#include "be_visitor_operation.h"
-#include "be_visitor_typecode.h"
-#include "be_visitor_context.h"
-#include "be_visitor_native.h"
-#include "ace/Auto_Ptr.h"
-
-#include "be_visitor_interface/interface.cpp"
-#include "be_visitor_interface/interface_ch.cpp"
-#include "be_visitor_interface/interface_ci.cpp"
-#include "be_visitor_interface/interface_cs.cpp"
-#include "be_visitor_interface/interface_sh.cpp"
-#include "be_visitor_interface/interface_ih.cpp"
-#include "be_visitor_interface/interface_si.cpp"
-#include "be_visitor_interface/interface_ss.cpp"
-#include "be_visitor_interface/interface_is.cpp"
-#include "be_visitor_interface/tie_sh.cpp"
-#include "be_visitor_interface/tie_si.cpp"
-#include "be_visitor_interface/any_op_ch.cpp"
-#include "be_visitor_interface/any_op_cs.cpp"
-#include "be_visitor_interface/cdr_op_ch.cpp"
-#include "be_visitor_interface/cdr_op_cs.cpp"
-#include "be_visitor_interface/smart_proxy_ch.cpp"
-#include "be_visitor_interface/smart_proxy_cs.cpp"
-#include "be_visitor_interface/ami_interface_ch.cpp"
-
-// Proxy Brokers
-#include "be_visitor_interface/strategized_proxy_broker_sh.cpp"
-#include "be_visitor_interface/strategized_proxy_broker_ss.cpp"
-
-// Proxy Impls
-#include "be_visitor_interface/direct_proxy_impl_sh.cpp"
-#include "be_visitor_interface/direct_proxy_impl_ss.cpp"
-
-// AMH
-#include "be_visitor_interface/amh_ch.cpp"
-#include "be_visitor_interface/amh_ss.cpp"
-#include "be_visitor_interface/amh_si.cpp"
-#include "be_visitor_interface/amh_sh.cpp"
-#include "be_visitor_interface/amh_rh_ss.cpp"
-#include "be_visitor_interface/amh_rh_sh.cpp"
-
-ACE_RCSID (be,
- be_visitor_interface,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_ch.cpp
deleted file mode 100644
index 8e9ca518f55..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/amh_ch.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-//=============================================================================
-/**
-* @file amh_ch.cpp
-*
-* $Id$
-*
-* Specialized interface visitor for AMH-RH generates code that is
-* specific to AMH interfaces.
-*
-* @author Mayur Deshpande <mayur@ics.uci.edu>
-*/
-//=============================================================================
-
-ACE_RCSID (be_visitor_interface,
- amh_ch,
- "$Id$")
-
-be_visitor_amh_interface_ch::be_visitor_amh_interface_ch (
- be_visitor_context *ctx
- )
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_amh_interface_ch::~be_visitor_amh_interface_ch (void)
-{
-}
-
-int
-be_visitor_amh_interface_ch::visit_interface (be_interface *node)
-{
- // If not already generated and not imported.
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- // This will be a no-op if it has already been done by a forward
- // declaration.
- node->gen_var_out_seq_decls ();
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Now the interface definition itself.
- os->gen_ifdef_macro (node->flat_name ());
-
- // Now generate the class definition.
- *os << "class " << be_global->stub_export_macro ()
- << " " << node->local_name () << be_idt_nl
- << ": " ;
-
- // If node interface inherits from other interfaces.
- if (node->n_inherits () > 0)
- {
- *os << be_idt;
-
- for (int i = 0; i < node->n_inherits (); i++)
- {
- *os << "public virtual "
- << node->inherits ()[i]->name ();
-
- if (i < node->n_inherits () - 1)
- {
- // Node has multiple inheritance, so put a comma.
- *os << "," << be_nl;
- }
- }
-
- *os << be_uidt << be_uidt_nl;
- }
- else
- {
- // We do not inherit from anybody, hence we do so from the base
- // CORBA::Object class.
- *os << "public virtual ::CORBA::Object" << be_uidt_nl;
- }
-
- // Generate the body.
-
- *os << "{" << be_nl
- << "public:" << be_idt_nl
-
- // Generate the _ptr_type and _var_type typedefs.
- << "typedef " << node->local_name () << "_ptr _ptr_type;"
- << be_nl
- << "typedef " << node->local_name () << "_var _var_type;"
- << be_nl
- << "typedef " << node->local_name () << "_out _out_type;"
- << be_nl;
-
- // Generate code for the interface definition by traversing thru the
- // elements of its scope. We depend on the front-end to have made sure
- // that only legal syntactic elements appear in our scope.
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "codegen for scope failed\n"), -1);
- }
-
- node->cli_hdr_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_sh.cpp
deleted file mode 100644
index b2bd001d7b0..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_sh.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-//=============================================================================
-/**
-* @file amh_rh_sh.cpp
-*
-* $Id$
-*
-* Specialized interface visitor for AMH-RH that generates code
-* for RH interfaces in skeleton source files
-*
-* @author Darrell Brunsch <brunsch@cs.wustl.edu>
-*/
-//=============================================================================
-
-ACE_RCSID (be_visitor_interface,
- amh_rh_sh,
- "$Id$")
-
-be_visitor_amh_rh_interface_sh::be_visitor_amh_rh_interface_sh (
- be_visitor_context *ctx
- )
- : be_visitor_interface_sh (ctx)
-{
-}
-
-be_visitor_amh_rh_interface_sh::~be_visitor_amh_rh_interface_sh (void)
-{
-}
-
-int
-be_visitor_amh_rh_interface_sh::visit_operation (be_operation *node)
-{
- be_visitor_amh_rh_operation_sh amh_rh_op (this->ctx_);
- return amh_rh_op.visit_operation (node);
-}
-
-int
-be_visitor_amh_rh_interface_sh::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate the skeleton class name, use the AMH-node name as a
- // basis, this is AMH_<InterfaceName>ResponseHandler...
- ACE_CString rh_base_class_name = node->local_name ();
- // ...and prepend either the "TAO_" prefix...
- ACE_CString rh_skel_class_name = "TAO_";
-
- if (!node->is_nested ())
- {
- // ...or the "POA_TAO_" prefix if we are in the global
- // namespace....
- rh_skel_class_name = "POA_TAO_";
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- rh_skel_class_name += rh_base_class_name.c_str ();
-
- *os << "class " << rh_skel_class_name.c_str () << ";" << be_nl;
-
- // Generate the _ptr declaration.
- *os << "typedef " << rh_skel_class_name.c_str () << " *"
- << rh_skel_class_name.c_str()
- << "_ptr;" << be_nl << be_nl;
-
- ACE_CString inherit_client_parent = node->client_enclosing_scope ();
- inherit_client_parent += rh_base_class_name;
-
- ACE_CString inherit_tao_parent = "TAO_AMH_Response_Handler";
-
- // Now generate the class definition
- *os << "class " << be_global->skel_export_macro ()
- << " " << rh_skel_class_name.c_str () << be_idt_nl
- << ": public " << inherit_tao_parent.c_str () << "," << be_idt_nl
- << "public ::" << inherit_client_parent.c_str () << be_uidt << be_uidt;
-
- *os << be_nl
- << "{" << be_nl
- << "public:" << be_idt_nl
- << rh_skel_class_name.c_str () << " (void);" << be_nl
- << "virtual ~" << rh_skel_class_name.c_str () << " (void);";
-
- // Generate code for elements in the scope (e.g., operations).
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_sh::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_uidt_nl
- << "};";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_ss.cpp
deleted file mode 100644
index dd51983df52..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_ss.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-//=============================================================================
-/**
-* @file amh_rh_ss.cpp
-*
-* $Id$
-*
-* Specialized interface visitor for AMH-ResponseHandler that generates code for
-* RH in the skeleton source files.
-*
-* @author Mayur Deshpande <mayur@ics.uci.edu>
-*/
-//=============================================================================
-
-ACE_RCSID (be_visitor_interface,
- amh_rh_ss,
- "$Id$")
-
-be_visitor_amh_rh_interface_ss::be_visitor_amh_rh_interface_ss (
- be_visitor_context *ctx
- )
- : be_visitor_interface_ss (ctx)
-{
-}
-
-be_visitor_amh_rh_interface_ss::~be_visitor_amh_rh_interface_ss (void)
-{
-}
-
-int
-be_visitor_amh_rh_interface_ss::visit_operation (be_operation *node)
-{
- be_visitor_amh_rh_operation_ss amh_rh_op (this->ctx_);
- return amh_rh_op.visit_operation (node);
-}
-
-int
-be_visitor_amh_rh_interface_ss::visit_interface (be_interface *node)
-{
- if (node->srv_skel_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // @@ Mayur, the exact same code is duplicated in amh_rh_sh.cpp,
- // need to fix that...
- // Generate the skeleton class name, use the AMH-node name as a
- // basis, this is AMH_<InterfaceName>ResponseHandler...
- ACE_CString rh_skel_prefix = "TAO_";
-
- char *buf;
- node->compute_full_name (rh_skel_prefix.c_str(), "", buf);
- ACE_CString rh_skel_full_scope_name ("POA_");
- rh_skel_full_scope_name += buf;
- // buf was allocated by ACE_OS::strdup, so we need to use free instead
- // of delete.
- ACE_OS::free (buf);
-
- ACE_CString rh_skel_class_name_prefix (rh_skel_prefix.c_str ());
-
- if (!node->is_nested ())
- {
- // ...or the "POA_TAO_" prefix if we are in the global
- // namespace....
- rh_skel_class_name_prefix = "POA_TAO_";
- }
-
- ACE_CString rh_skel_class_name (rh_skel_class_name_prefix);
- rh_skel_class_name += node->local_name ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << rh_skel_full_scope_name.c_str ()
- << "::" << rh_skel_class_name.c_str () << " (void)" << be_nl
- << ": TAO_AMH_Response_Handler ()," << be_idt_nl
- << "::" << node->full_name () << " ()" << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "}" << be_nl << be_nl;
-
- *os << rh_skel_full_scope_name.c_str ()
- << "::~" << rh_skel_class_name.c_str ()
- << " (void)" << be_nl;
- *os << "{" << be_nl;
- *os << "}";
-
-
- // Generate code for elements in the scope (e.g., operations)
- // We'll rely on the base class (be_visitor_scope) to do the
- // right thing for us.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp
deleted file mode 100644
index 19e7340f37c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp
+++ /dev/null
@@ -1,433 +0,0 @@
-//=============================================================================
-/**
-* @file amh_sh.cpp
-*
-* $Id$
-*
-* Specialized interface visitor for AMH generates code that is
-* specific to AMH interfaces.
-*
-* @author Darrell Brunsch <brunsch@cs.wustl.edu>
-*/
-//=============================================================================
-
-ACE_RCSID (be_visitor_interface,
- amh_sh,
- "$Id$")
-
-be_visitor_amh_interface_sh::be_visitor_amh_interface_sh (
- be_visitor_context *ctx
- )
- : be_visitor_interface_sh (ctx)
-{
-}
-
-be_visitor_amh_interface_sh::~be_visitor_amh_interface_sh (void)
-{
-}
-
-// The node is the original interface node but we 'tweak' with the
-// local_name and the the operation signatures to generate the AMH
-// skeleton on the 'fly'.
-
-int
-be_visitor_amh_interface_sh::visit_interface (be_interface *node)
-{
- if (node->srv_hdr_gen () || node->imported () || node->is_local ())
- {
- return 0;
- }
-
- // Do not generate AMH classes for any sort of implied IDL.
- if (node->original_interface () != 0)
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- ACE_CString class_name;
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // We shall have a POA_ prefix only if we are at the topmost level.
- if (!node->is_nested ())
- {
- // We are outermost.
- class_name += "POA_AMH_";
- class_name += node->local_name ();
- }
- else
- {
- class_name += "AMH_";
- class_name += node->local_name ();
- }
-
- // Generate the skeleton class name.
- *os << "class " << class_name.c_str () << ";" << be_nl;
-
- // Generate the _ptr declaration.
- *os << "typedef " << class_name.c_str () << " *" << class_name.c_str ()
- << "_ptr;" << be_nl << be_nl;
-
- // Now generate the class definition.
- *os << "class " << be_global->skel_export_macro ()
- << " " << class_name.c_str () << be_idt_nl << ": " << be_idt;
-
- long n_parents = node->n_inherits ();
-
- if (n_parents > 0)
- {
- for (int i = 0; i < n_parents; ++i)
- {
- ACE_CString amh_name ("POA_");
-
- // @@ The following code is *NOT* exception-safe.
- char *buf = 0;
- be_interface *base =
- be_interface::narrow_from_decl (node->inherits ()[i]);
- base->compute_full_name ("AMH_", "", buf);
- amh_name += buf;
- // buf was allocated by ACE_OS::strdup, so we need to use free
- // instead of delete.
- ACE_OS::free (buf);
-
- if (i != 0)
- {
- *os << ", ";
- }
-
- *os << "public virtual "
- << amh_name.c_str ()
- << be_nl;
- }
- }
- else
- {
- // We don't inherit from another user defined object, hence our
- // base class is the ServantBase class.
- *os << "public virtual PortableServer::ServantBase";
- }
-
- *os << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "protected:" << be_idt_nl
- << class_name.c_str () << " (void);" << be_uidt_nl << be_nl
- << "public:" << be_idt_nl;
-
- // No copy constructor for locality constraint interface.
- *os << class_name.c_str () << " (const " << class_name.c_str ()
- << "& rhs);" << be_nl
- << "virtual ~" << class_name.c_str () << " (void);\n\n"
- << be_nl
- << "virtual ::CORBA::Boolean _is_a (" << be_idt << be_idt_nl
- << "const char* logical_type_id" << env_dflts << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
-// *os << "virtual void* _downcast (" << be_idt << be_idt_nl
-// << "const char* logical_type_id" << be_uidt_nl
-// << ");" << be_uidt_nl << be_nl;
-
- // Add a skeleton for our _is_a method.
- *os << "static void _is_a_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *servant_upcall" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add a skeleton for our _non_existent method.
- *os << "static void _non_existent_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *servant_upcall" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add a skeleton for our _interface method.
- *os << "static void _interface_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *servant_upcall" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add a skeleton for our _component method.
- *os << "static void _component_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *servant_upcall" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add a skeleton for our _repository_id method.
- *os << "static void _repository_id_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *servant_upcall" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add the dispatch method.
- *os << "virtual void _dispatch (" << be_idt << be_idt_nl
- << "TAO_ServerRequest &req," << be_nl
- << "void *_servant_upcall" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- this->this_method (node);
-
- // The _interface_repository_id method.
- *os << be_nl
- << "virtual const char* _interface_repository_id "
- << "(void) const;";
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_interface_sh::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // Generate skeletons for operations of our base classes. These
- // skeletons just cast the pointer to the appropriate type
- // before invoking the call.
- if (node->traverse_inheritance_graph (be_interface::gen_skel_helper, os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_amh_interface_sh::"
- "visit_interface - "
- "inheritance graph traversal failed\n"),
- -1);
- }
-
- *os << be_uidt_nl
- << "};";
-
- return 0;
-}
-
-int
-be_visitor_amh_interface_sh::visit_operation (be_operation *node)
-{
- be_visitor_amh_operation_sh visitor (this->ctx_);
- return visitor.visit_operation (node);
-}
-
-int
-be_visitor_amh_interface_sh::visit_attribute (be_attribute *node)
-{
- be_visitor_amh_operation_sh visitor (this->ctx_);
- return visitor.visit_attribute (node);
-}
-
-int
-be_visitor_amh_interface_sh::add_original_members (be_interface *node,
- be_interface *amh_node)
-{
- if (!node || !amh_node)
- {
- return -1;
- }
-
- this->elem_number_ = 0;
-
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- AST_Decl *d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_amh_pre_proc::visit_interface - "
- "bad node in this scope\n"
- ),
- 0
- );
- }
-
- if (d->node_type () == AST_Decl::NT_attr)
- {
- be_attribute *attribute = be_attribute::narrow_from_decl (d);
-
- if (!attribute)
- {
- return 0;
- }
- }
- else
- {
- be_operation* operation = be_operation::narrow_from_decl (d);
-
- if (operation)
- {
- this->add_amh_operation (operation, amh_node);
- }
- }
- }
-
- return 0;
-}
-
-
-int
-be_visitor_amh_interface_sh::add_amh_operation (be_operation *node,
- be_interface *amh_node)
-{
- if (!node || !amh_node)
- {
- return -1;
- }
-
- // We do nothing for oneways!
- if (node->flags () == AST_Operation::OP_oneway)
- {
- return 0;
- }
-
- Identifier *id = 0;
- UTL_ScopedName *sn = 0;
-
- ACE_NEW_RETURN (id,
- Identifier ("void"),
- -1);
-
- ACE_NEW_RETURN (sn,
- UTL_ScopedName (id,
- 0),
- -1);
-
- // Create the return type, which is "void"
- be_predefined_type *rt = 0;
- ACE_NEW_RETURN (rt,
- be_predefined_type (AST_PredefinedType::PT_void,
- sn),
- -1);
-
- ACE_CString original_op_name (
- node->name ()->last_component ()->get_string ()
- );
-
- UTL_ScopedName *op_name =
- static_cast<UTL_ScopedName *> (amh_node->name ()->copy ());
-
- ACE_NEW_RETURN (id,
- Identifier (original_op_name.rep ()),
- -1);
-
- ACE_NEW_RETURN (sn,
- UTL_ScopedName (id,
- 0),
- -1);
-
- op_name->nconc (sn);
-
- // Create the operation
- be_operation *operation = 0;
- ACE_NEW_RETURN (operation,
- be_operation (rt, //node->return_type (),
- AST_Operation::OP_noflags,
- op_name,
- 0,
- 0),
- -1);
-
- operation->set_name (op_name);
-
- // Iterate over the arguments and put all the in and inout
- // into the new method.
- if (node->nmembers () > 0)
- {
- // Initialize an iterator to iterate thru our scope.
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- AST_Decl *d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_pre_proc::"
- "create_response_handler_operation - "
- "bad node in this scope\n"),
- -1);
-
- }
-
- AST_Argument *original_arg =
- AST_Argument::narrow_from_decl (d);
-
- if (original_arg->direction () == AST_Argument::dir_INOUT ||
- original_arg->direction () == AST_Argument::dir_IN)
- {
- // Create the argument.
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (original_arg->direction (),
- original_arg->field_type (),
- original_arg->name ()),
- -1);
-
- operation->be_add_argument (arg);
- }
- }
- }
-
- operation->set_defined_in (amh_node);
-
- // After having generated the operation we insert it into the
- // AMH node interface.
- if (0 == amh_node->be_add_operation (operation))
- {
- return -1;
- }
-
- return 0;
-}
-
-
-be_interface *
-be_visitor_amh_interface_sh::create_amh_class (ACE_CString name)
-{
- Identifier *id = 0;
- ACE_NEW_RETURN (id,
- Identifier (name.c_str ()),
- 0);
-
- UTL_ScopedName *amh_class_name = 0;
- ACE_NEW_RETURN (amh_class_name,
- UTL_ScopedName (id,
- 0),
- 0);
-
- be_interface *amh_class = 0;
- ACE_NEW_RETURN (amh_class,
- be_interface (amh_class_name, // name
- 0, // list of inherited
- 0, // number of inherited
- 0, // list of ancestors
- 0, // number of ancestors
- 0, // non-local
- 0), // non-abstract
- 0);
-
- amh_class->set_name (amh_class_name);
- return amh_class;
-}
-
-void
-be_visitor_amh_interface_sh::this_method (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- ACE_CString non_amh_name = node->client_enclosing_scope ();
- non_amh_name += node->local_name ();
-
- // Print out the _this() method. The _this() method for AMH
- // interfaces is "special", because the returned type is not exactly
- // the type of the class, but the original class that "implied" the
- // AMH one.
- *os << non_amh_name.c_str () << " *_this (" << be_idt << be_idt
- << env_dflts << be_uidt_nl
- << ");\n" << be_uidt;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_si.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_si.cpp
deleted file mode 100644
index 10118851bcf..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/amh_si.cpp
+++ /dev/null
@@ -1,230 +0,0 @@
-//=============================================================================
-/**
-* @file amh_si.cpp
-*
-* $Id$
-*
-* Specialized interface visitor for AMH generates code that is
-* specific to AMH interfaces.
-*
-* @author Jeff Parsons <j.parsons@vanderbilt.edu>
-*/
-//=============================================================================
-
-ACE_RCSID (be_visitor_interface,
- amh_si,
- "$Id$")
-
-be_visitor_amh_interface_si::be_visitor_amh_interface_si (
- be_visitor_context *ctx
- )
- : be_visitor_interface_si (ctx)
-{
-}
-
-be_visitor_amh_interface_si::~be_visitor_amh_interface_si (void)
-{
-}
-
-int
-be_visitor_amh_interface_si::visit_interface (be_interface *node)
-{
- if (node->srv_inline_gen () || node->imported () || node->is_local ())
- {
- return 0;
- }
-
- // Do not generate AMH classes for any sort of implied IDL.
- if (node->original_interface () != 0)
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- int status =
- node->traverse_inheritance_graph (
- be_visitor_amh_interface_si::gen_skel_helper,
- os
- );
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_amh_interface_si::"
- "visit_interface - "
- "inheritance graph traversal failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_amh_interface_si::gen_skel_helper (be_interface *derived,
- be_interface *ancestor,
- TAO_OutStream *os)
-{
- // If derived and ancestor are same, skip it.
- if (derived == ancestor)
- {
- return 0;
- }
-
- // If an operation or an attribute is abstract (declared in an
- // abstract interface), we will either generate the full
- // definition (if there are no concrete interfaces between the
- // abstract ancestor and us) or, if there is a concrete ancestor
- // in between, we will catch its definition elsewhere in this
- // traversal.
- if (ancestor->is_abstract ())
- {
- return 0;
- }
-
- // Else generate code that does the cast to the appropriate type.
-
- if (ancestor->nmembers () > 0)
- {
- // If there are elements in ancestor scope i.e., any operations and
- // attributes defined by "ancestor", become methods on the derived class
- // which call the corresponding method of the base class by doing the
- // proper casting.
-
- ACE_CString ancestor_name ("POA_");
- char *buf = 0;
- ancestor->compute_full_name ("AMH_", "", buf);
- ancestor_name += buf;
- // buf was allocated by ACE_OS::strdup, so we need to use free instead
- // of delete.
- ACE_OS::free (buf);
- buf = 0;
-
- const char *ancestor_amh_name = ancestor_name.fast_rep ();
-
- ACE_CString derived_name ("POA_");
- derived->compute_full_name ("AMH_", "", buf);
- derived_name += buf;
- // buf was allocated by ACE_OS::strdup, so we need to use free instead
- // of delete.
- ACE_OS::free (buf);
- buf = 0;
-
- const char *derived_amh_name = derived_name.fast_rep ();
-
- for (UTL_ScopeActiveIterator si (ancestor, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- // Get the next AST decl node
- AST_Decl *d = si.item ();
-
- if (d->node_type () == AST_Decl::NT_op)
- {
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl << be_nl;
-
- // Generate code in the inline file.
- // Generate the static method corresponding to this method.
- *os << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << derived_amh_name << "::"
- << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & req," << be_nl
- << "void * context," << be_nl
- << "void * obj" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
- *os << ancestor_amh_name
- << "* const impl = static_cast<"
- << derived_amh_name
- << " *> (obj);" << be_nl;
- *os << ancestor_amh_name
- << "::" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "req," << be_nl
- << "context," << be_nl
- << "impl" << env_arg << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}";
- }
- else if (d->node_type () == AST_Decl::NT_attr)
- {
- AST_Attribute *attr = AST_Attribute::narrow_from_decl (d);
-
- if (attr == 0)
- {
- return -1;
- }
-
- *os << be_nl << be_nl;
-
- // Generate code in the inline file.
- // Generate the static method corresponding to this method.
- *os << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << derived_amh_name << "::_get_"
- << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & req," << be_nl
- << "void * context," << be_nl
- << "void * obj" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- *os << ancestor_amh_name
- << "* const impl = static_cast<"
- << derived_amh_name
- << " *> (obj);" << be_nl;
-
- *os << ancestor_amh_name
- << "::_get_" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "req," << be_nl
- << "context," << be_nl
- << "impl" << env_arg << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}";
-
- if (!attr->readonly ())
- {
- *os << be_nl << be_nl;
-
- // Generate code in the inline file.
- // Generate the static method corresponding to
- // this method.
- *os << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << derived_amh_name
- << "::_set_" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & req," << be_nl
- << "void * context," << be_nl
- << "void * obj" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- *os << ancestor_amh_name
- << "* const impl = static_cast<"
- << derived_amh_name
- << " *> (obj);" << be_nl;
-
- *os << ancestor_amh_name
- << "::_set_" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "req," << be_nl
- << "context," << be_nl
- << "impl" << env_arg << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}";
- }
- }
- } // End of FOR
- }
-
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp
deleted file mode 100644
index 3760418d94b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp
+++ /dev/null
@@ -1,339 +0,0 @@
-//=============================================================================
-/**
-* @file amh_ss.cpp
-*
-* $Id$
-*
-* Specialized interface visitor for AMH.
-*
-* @author Darrell Brunsch <brunsch@cs.wustl.edu>
-*/
-//=============================================================================
-
-ACE_RCSID (be_visitor_interface,
- amh_ss,
- "$Id$")
-
-be_visitor_amh_interface_ss::be_visitor_amh_interface_ss (
- be_visitor_context *ctx
- )
- : be_visitor_interface_ss (ctx)
-{
-}
-
-be_visitor_amh_interface_ss::~be_visitor_amh_interface_ss (void)
-{
-}
-
-int
-be_visitor_amh_interface_ss::visit_operation (be_operation *node)
-{
- be_visitor_amh_operation_ss visitor (this->ctx_);
- return visitor.visit_operation (node);
-}
-
-int
-be_visitor_amh_interface_ss::visit_attribute (be_attribute *node)
-{
- be_visitor_amh_operation_ss visitor (this->ctx_);
- return visitor.visit_attribute (node);
-}
-
-int
-be_visitor_amh_interface_ss::visit_interface (be_interface *node)
-{
- // Do not generate AMH classes for any sort of implied IDL.
- if (node->original_interface () != 0)
- {
- return 0;
- }
-
- return be_visitor_interface_ss::visit_interface (node);
-}
-
-void
-be_visitor_amh_interface_ss::this_method (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // the _this () operation
- //const char *non_amh_name = node->full_name () + 4;
- ACE_CString non_amh_name = "";
- non_amh_name += node->client_enclosing_scope ();
- non_amh_name += node->local_name ();
-
- ACE_CString full_skel_name_holder =
- this->generate_full_skel_name (node);
- const char *full_skel_name = full_skel_name_holder.c_str ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << non_amh_name.c_str () << "*" << be_nl
- << full_skel_name
- << "::_this ("
- << (be_global->use_raw_throw () ? "void" : "ACE_ENV_SINGLE_ARG_DECL")
- << ")" << be_nl
- << "{" << be_idt_nl
- << "TAO_Stub *stub = this->_create_stub ("
- << (be_global->use_raw_throw () ? "" : "ACE_ENV_SINGLE_ARG_PARAMETER")
- << ");" << TAO_ACE_CHECK ("0") << be_nl << be_nl;
-
- *os << "TAO_Stub_Auto_Ptr safe_stub (stub);" << be_nl
- << "::CORBA::Object_ptr tmp = CORBA::Object::_nil ();" << be_nl
- << be_nl
- << "::CORBA::Boolean _tao_opt_colloc =" << be_idt_nl
- << "stub->servant_orb_var ()->orb_core ()->"
- << "optimize_collocation_objects ();" << be_uidt_nl << be_nl
- << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
- << "tmp," << be_nl
- << "::CORBA::Object (stub, _tao_opt_colloc, this)," << be_nl
- << "0" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- *os << "::CORBA::Object_var obj = tmp;" << be_nl
- << "(void) safe_stub.release ();" << be_nl << be_nl;
-
- *os << "typedef ::" << node->name () << " STUB_SCOPED_NAME;" << be_nl
- << "return" << be_idt_nl;
-
- if (!node->is_abstract ())
- {
- *os << "TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (";
- }
- else
- {
- *os << "TAO::AbstractBase_Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (";
- }
- *os << be_idt << be_idt_nl
- << "obj.in ()," << be_nl
- << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function_pointer" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}";
-
-}
-
-void
-be_visitor_amh_interface_ss::dispatch_method (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- ACE_CString full_skel_name_holder =
- this->generate_full_skel_name (node);
- const char *full_skel_name = full_skel_name_holder.c_str ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "void" << be_nl
- << full_skel_name << "::_dispatch (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & req," << be_nl
- << "void * context" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "this->asynchronous_upcall_dispatch (" << be_idt << be_idt_nl
- << "req," << be_nl
- << "context," << be_nl
- << "this" << env_arg << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}";
-}
-
-void
-be_visitor_amh_interface_ss::generate_send_reply (TAO_OutStream * os)
-{
- *os << be_nl << be_nl
- << "server_request.tao_send_reply ();";
-}
-
-int
-be_visitor_amh_interface_ss::generate_amh_classes (be_interface *)
-{
- // No AMH classes for the AMH classes... :-)
- return 0;
-}
-
-int
-be_visitor_amh_interface_ss::generate_proxy_classes (be_interface *)
-{
- // No Proxy or ProxyBrokers for the AMH classes
- return 0;
-}
-
-// ****************************************************************
-
-class TAO_IDL_Downcast_Implementation_Worker
- : public TAO_IDL_Inheritance_Hierarchy_Worker
-{
-public:
- TAO_IDL_Downcast_Implementation_Worker ();
-
- virtual int emit (be_interface *base,
- TAO_OutStream *os,
- be_interface *derived);
-};
-
-TAO_IDL_Downcast_Implementation_Worker::
-TAO_IDL_Downcast_Implementation_Worker (void)
-{
-}
-
-int
-TAO_IDL_Downcast_Implementation_Worker::
-emit (be_interface * /* derived */,
- TAO_OutStream *os,
- be_interface *base)
-{
- // @@ This whole thing would be more efficient if we could pass the
- // ACE_CString to compute_full_name, after all it uses that
- // internally.
- ACE_CString amh_name ("POA_");
-
- // @@ The following code is *NOT* exception-safe.
- char *buf = 0;
- base->compute_full_name ("AMH_", "", buf);
- amh_name += buf;
- // buf was allocated using ACE_OS::strdup, so we must use free instead
- // of delete.
- ACE_OS::free (buf);
-
- *os << "if (ACE_OS::strcmp (logical_type_id, \""
- << base->repoID () << "\") == 0)" << be_idt_nl
- << "return static_cast<"
- << amh_name.c_str () << "*> (this);" << be_uidt_nl;
-
- return 0;
-}
-
-// ****************************************************************
-
-class TAO_IDL_Copy_Ctor_Worker
- : public TAO_IDL_Inheritance_Hierarchy_Worker
-{
-public:
- TAO_IDL_Copy_Ctor_Worker (void);
-
- virtual int emit (be_interface *base,
- TAO_OutStream *os,
- be_interface *derived);
-};
-
-TAO_IDL_Copy_Ctor_Worker::
-TAO_IDL_Copy_Ctor_Worker (void)
-{
-}
-
-int
-TAO_IDL_Copy_Ctor_Worker::
-emit (be_interface *derived,
- TAO_OutStream *os,
- be_interface *base)
-{
- if (derived == base)
- {
- return 0;
- }
-
- *os << "," << be_idt_nl;
-
- if (base->is_nested ())
- {
- be_decl *scope;
- scope = be_scope::narrow_from_scope (base->defined_in ())->decl ();
-
- *os << "POA_" << scope->name () << "::AMH_"
- << base->local_name () << " (rhs)";
- }
- else
- {
- // @@ This whole thing would be more efficient if we could pass the
- // ACE_CString to compute_full_name, after all it uses that
- // internally.
- ACE_CString amh_name ("POA_");
-
- // @@ The following code is *NOT* exception-safe.
- char *buf = 0;
- base->compute_full_name ("AMH_", "", buf);
- amh_name += buf;
- // buf was allocated by ACE_OS::strdup, so we need to use free
- // instead of delete.
- ACE_OS::free (buf);
-
- *os << amh_name.c_str () << " (rhs)";
- }
-
- *os << be_uidt;
-
- return 0;
-}
-
-int
-be_visitor_amh_interface_ss::generate_copy_ctor (be_interface *node,
- TAO_OutStream *os)
-{
- // Make sure the queues are empty.
- node->get_insert_queue ().reset ();
- node->get_del_queue ().reset ();
-
-
- // Insert ourselves in the queue.
- if (node->get_insert_queue ().enqueue_tail (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::traverse_inheritance_graph - "
- "error generating entries\n"),
- -1);
- }
-
- TAO_IDL_Copy_Ctor_Worker worker;
- return node->traverse_inheritance_graph (worker, os);
-}
-
-// ****************************************************************
-
-ACE_CString
-be_visitor_amh_interface_ss::generate_flat_name (be_interface *node)
-{
- // @@ The following code is *NOT* exception-safe.
- char *buf = 0;
- node->compute_flat_name ("AMH_", "", buf);
-
- // @@ This whole thing would be more efficient if we could pass the
- // ACE_CString to compute_flat_name, after all it uses that
- // internally.
- ACE_CString result (buf);
- // buf was allocated using ACE_OS::strdup, so we must use free instead
- // of delete.
- ACE_OS::free (buf);
-
- return result;
-}
-
-ACE_CString
-be_visitor_amh_interface_ss::generate_local_name (be_interface *node)
-{
- ACE_CString local_name = "AMH_";
- local_name += node->local_name ();
- return local_name;
-}
-
-ACE_CString
-be_visitor_amh_interface_ss::generate_full_skel_name (be_interface *node)
-{
- // @@ This whole thing would be more efficient if we could pass the
- // ACE_CString to compute_full_name, after all it uses that
- // internally.
- ACE_CString result ("POA_");
-
- // @@ The following code is *NOT* exception-safe.
- char *buf = 0;
- node->compute_full_name ("AMH_", "", buf);
- result += buf;
- // buf was allocated using ACE_OS::strdup, so we must use free instead
- // of delete.
- ACE_OS::free (buf);
-
- return result;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_interface_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_interface_ch.cpp
deleted file mode 100644
index ee0f4219ad8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/ami_interface_ch.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_interface_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for AMI Interfaces in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale,
-// Michael Kircher
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- ami_interface_ch,
- "$Id$")
-
-// ******************************************************
-// Interface visitor for client header
-// ******************************************************
-
-be_visitor_ami_interface_ch::be_visitor_ami_interface_ch (
- be_visitor_context *ctx
- )
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_ami_interface_ch::~be_visitor_ami_interface_ch (void)
-{
-}
-
-int
-be_visitor_ami_interface_ch::visit_interface (be_interface *node)
-{
- // No need to check for code already having been generated. This
- // is a separate pass through the AST specific to AMI, and will
- // happen only once.
- if (node->imported () || node->is_local ())
- {
- return 0;
- }
-
- // Grab the stream.
- TAO_OutStream *os = this->ctx_->stream ();
- os->gen_ifdef_macro (node->replacement ()->flat_name (), "_ptr");
-
- // Forward declaration.
- *os << be_nl << be_nl
- << "class " << node->replacement ()->local_name () << ";" << be_nl;
-
- // Generate the _ptr declaration.
- *os << "typedef " << node->replacement ()->local_name ()
- << " *" << node->replacement ()->local_name ()
- << "_ptr;";
-
- os->gen_endif ();
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp
deleted file mode 100644
index 0ac3043f090..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for an Interface in the client
-// header.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- any_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Interface visitor for generating Any operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_interface_any_op_ch::be_visitor_interface_any_op_ch
-(be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_any_op_ch::~be_visitor_interface_any_op_ch (void)
-{
-}
-
-int
-be_visitor_interface_any_op_ch::visit_interface (be_interface *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ()
- || (node->is_local () && !be_global->gen_local_iface_anyops ()))
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- const char *macro = this->ctx_->export_macro ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- be_module *module = 0;
-
- if (node->is_nested () &&
- node->defined_in ()->scope_node_type () == AST_Decl::NT_module)
- {
- module = be_module::narrow_from_scope (node->defined_in ());
-
- if (!module)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_valuebox_any_op_ch::"
- "visit_valuebox - "
- "Error parsing nested name\n"),
- -1);
- }
-
- // Some compilers handle "any" operators in a namespace
- // corresponding to their module, others do not.
- *os << "\n\n#if defined (ACE_ANY_OPS_USE_NAMESPACE)\n";
-
- be_util::gen_nested_namespace_begin (os, module);
-
- // emit nested variation of any operators
- *os << macro << " void"
- << " operator<<= ( ::CORBA::Any &, " << node->local_name ()
- << "_ptr); // copying" << be_nl;
- *os << macro << " void"
- << " operator<<= ( ::CORBA::Any &, " << node->local_name ()
- << "_ptr *); // non-copying" << be_nl;
- *os << macro << " ::CORBA::Boolean"
- << " operator>>= (const ::CORBA::Any &, "
- << node->local_name () << "_ptr &);";
-
- be_util::gen_nested_namespace_end (os, module);
-
- // emit #else
- *os << "#else\n\n";
- }
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << macro << " void operator<<= (::CORBA::Any &, " << node->name ()
- << "_ptr); // copying" << be_nl;
- *os << macro << " void operator<<= (::CORBA::Any &, " << node->name ()
- << "_ptr *); // non-copying" << be_nl;
- *os << macro << " ::CORBA::Boolean operator>>= (const ::CORBA::Any &, "
- << node->name () << "_ptr &);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- if (module != 0)
- {
- *os << "\n\n#endif";
- }
-
- // All we have to do is to visit the scope and generate code.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_any_op_ch::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
-
- node->cli_hdr_any_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp
deleted file mode 100644
index fe23f84f78c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for Interface in the stubs
-// file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- any_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Interface visitor for generating Any operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_interface_any_op_cs::be_visitor_interface_any_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_any_op_cs::~be_visitor_interface_any_op_cs (void)
-{
-}
-
-int
-be_visitor_interface_any_op_cs::visit_interface (be_interface *node)
-{
- if (node->cli_stub_any_op_gen ()
- || node->imported ()
- || (node->is_local () && !be_global->gen_local_iface_anyops ()))
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // All template specializations must be generated before the instantiations
- // in the operators.
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- if (! node->is_abstract ())
- {
- *os << be_nl << be_nl
- << "namespace TAO" << be_nl
- << "{" << be_idt_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Impl_T<" << node->name () << ">::to_object ("
- << be_idt << be_idt_nl
- << "::CORBA::Object_ptr &_tao_elem" << be_uidt_nl
- << ") const" << be_uidt_nl
- << "{" << be_idt_nl
- << "_tao_elem = ::CORBA::Object::_duplicate (this->value_);" << be_nl
- << "return true;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}";
- }
-
- if (node->is_abstract () || node->has_mixed_parentage ())
- {
- *os << be_nl << be_nl
- << "namespace TAO" << be_nl
- << "{" << be_idt_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Impl_T<" << node->name ()
- << ">::to_abstract_base ("
- << be_idt << be_idt_nl
- << "::CORBA::AbstractBase_ptr &_tao_elem" << be_uidt_nl
- << ") const" << be_uidt_nl
- << "{" << be_idt_nl
- << "_tao_elem = ::CORBA::AbstractBase::_duplicate (this->value_);"
- << be_nl
- << "return true;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}";
- }
-
- // Since we don't generate CDR stream operators for types that
- // explicitly contain a local interface (at some level), we
- // must override these Any template class methods to avoid
- // calling the non-existent operators. The zero return value
- // will eventually cause CORBA::MARSHAL to be raised if this
- // type is inserted into an Any and then marshaled.
- if (node->is_local ())
- {
- *os << be_nl << be_nl
- << "namespace TAO" << be_nl
- << "{" << be_idt_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Impl_T<" << node->name ()
- << ">::marshal_value (TAO_OutputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Impl_T<" << node->name ()
- << ">::demarshal_value (TAO_InputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}";
- }
-
- *os << be_global->core_versioning_end () << be_nl;
-
- be_module *module = 0;
-
- if (node->is_nested () &&
- node->defined_in ()->scope_node_type () == AST_Decl::NT_module)
- {
- module = be_module::narrow_from_scope (node->defined_in ());
-
- if (!module)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_valuebox_any_op_cs::"
- "visit_valuebox - "
- "Error parsing nested name\n"),
- -1);
- }
-
- // Some compilers handle "any" operators in a namespace corresponding
- // to their module, others do not.
- *os << "\n\n#if defined (ACE_ANY_OPS_USE_NAMESPACE)\n";
-
- be_util::gen_nested_namespace_begin (os, module);
-
- // emit nested variation of any operators
- *os << be_nl << be_nl
- << "// Copying insertion." << be_nl
- << "void" << be_nl
- << "operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->local_name () << "_ptr _tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << node->local_name () << "_ptr _tao_objptr =" << be_idt_nl
- << node->local_name () << "::_duplicate (_tao_elem);" << be_uidt_nl
- << "_tao_any <<= &_tao_objptr;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "// Non-copying insertion." << be_nl
- << "void" << be_nl
- << "operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->local_name () << "_ptr *_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "TAO::Any_Impl_T<" << node->local_name () << ">::insert ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->local_name () << "::_tao_any_destructor," << be_nl
- << node->tc_name ()->last_component () << "," << be_nl
- << "*_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean" << be_nl
- << "operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << node->local_name () << "_ptr &_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return" << be_idt_nl
- << "TAO::Any_Impl_T<" << node->local_name () << ">::extract ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->local_name () << "::_tao_any_destructor," << be_nl
- << node->tc_name ()->last_component () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}";
-
- be_util::gen_nested_namespace_end (os, module);
-
- // emit #else
- *os << "#else\n";
- }
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << be_nl << be_nl
- << "// Copying insertion." << be_nl
- << "void" << be_nl
- << "operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->full_name () << "_ptr _tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << node->full_name () << "_ptr _tao_objptr =" << be_idt_nl
- << node->full_name () << "::_duplicate (_tao_elem);" << be_uidt_nl
- << "_tao_any <<= &_tao_objptr;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "// Non-copying insertion." << be_nl
- << "void" << be_nl
- << "operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->full_name () << "_ptr *_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "TAO::Any_Impl_T<" << node->name () << ">::insert ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "*_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean" << be_nl
- << "operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << node->full_name () << "_ptr &_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return" << be_idt_nl
- << "TAO::Any_Impl_T<" << node->name () << ">::extract ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- if (module != 0)
- {
- *os << "\n\n#endif";
- }
-
- // All we have to do is to visit the scope and generate code.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::visit_interface - "
- "codegen for scope failed\n"), -1);
- }
-
- node->cli_stub_any_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_broker_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_broker_ch.cpp
deleted file mode 100644
index 916f4cb041d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_broker_ch.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-//$Id$
-
-ACE_RCSID (be_visitor_interface,
- base_proxy_broker_ch,
- "$Id$")
-
-be_visitor_interface_base_proxy_broker_ch::
-be_visitor_interface_base_proxy_broker_ch (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
- // No-Op.
-}
-
-
-be_visitor_interface_base_proxy_broker_ch::
-~be_visitor_interface_base_proxy_broker_ch (void)
-{
- // No-Op.
-}
-
-int
-be_visitor_interface_base_proxy_broker_ch::visit_interface (
- be_interface *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl
- << "///////////////////////////////////////////////////////////////////////"
- << be_nl
- << "// Base Proxy Broker Declaration " << be_nl
- << "//" << be_nl << be_nl;
-
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Generate the class declaration.
- *os << "class " << be_global->stub_export_macro () << " "
- << node->base_proxy_broker_name () << be_nl << "{" << be_nl
- << "public:"
- << be_idt_nl; // idt = 1
-
-
-
- // Destructor
- *os << "virtual ~" << node->base_proxy_broker_name () << " (void);" << be_nl;
-
- // Accessor Method
- *os << "virtual " << node->base_proxy_impl_name () << " &"
- << "select_proxy ("
- << be_idt << be_idt_nl;
-
- *os << node->local_name () << " *object" << env_dflts << be_uidt_nl
- << ") = 0;"
- << be_uidt_nl // idt = 1
- << be_uidt_nl; // idt = 0
-
- // Constructor
- *os << "protected:" << be_idt_nl
- << node->base_proxy_broker_name () << " (void);" << be_nl
- << be_uidt_nl;
-
- *os << "};" << be_nl << be_nl;
-
- be_global->non_local_interfaces.enqueue_tail (node);
-
- *os << "//" << be_nl
- << "// End Base Proxy Broker Declaration " << be_nl
- << "///////////////////////////////////////////////////////////////////////"
- << be_nl << be_nl;
-
- return 0;
-}
-
-int be_visitor_interface_base_proxy_broker_ch::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_impl_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_impl_ch.cpp
deleted file mode 100644
index 0958fa5e06d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_impl_ch.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-//
-// $Id$
-//
-
-ACE_RCSID (be_visitor_interface,
- base_proxy_impl_ch,
- "$Id$")
-
-be_visitor_interface_base_proxy_impl_ch::
-be_visitor_interface_base_proxy_impl_ch (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
- // No-Op.
-}
-
-
-be_visitor_interface_base_proxy_impl_ch::
-~be_visitor_interface_base_proxy_impl_ch (void)
-{
- // No-Op.
-}
-
-int
-be_visitor_interface_base_proxy_impl_ch::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl
- << "///////////////////////////////////////////////////////////////////////"
- << be_nl
- << "// Base Proxy Impl. Declaration" << be_nl
- << "//" << be_nl << be_nl;
-
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Generate Class Declaration.
- *os << "class " << be_global->stub_export_macro ()
- << " " << node->base_proxy_impl_name () << be_idt_nl
- << ": ";
-
- int has_concrete_parent = 0;
-
- if (node->node_type () == AST_Decl::NT_component)
- {
- be_component *bc = be_component::narrow_from_decl (node);
- AST_Component *ac_base = bc->base_component ();
-
- if (ac_base != 0)
- {
- has_concrete_parent = 1;
- be_component *bc_base = be_component::narrow_from_decl (ac_base);
-
- *os << "public virtual "
- << bc_base->full_base_proxy_impl_name ();
- }
- }
-
- int n_parents = node->n_inherits ();
-
- if (n_parents > 0)
- {
- *os << be_idt;
-
- for (int i = 0; i < n_parents; ++i)
- {
- be_interface *inherited =
- be_interface::narrow_from_decl (node->inherits ()[i]);
-
- if (inherited->is_abstract ())
- {
- continue;
- }
-
- if (has_concrete_parent == 1)
- {
- // Node is the case of multiple
- // inheritance, so put a comma.
- *os << ", " << be_nl;
- }
-
- *os << "public virtual ";
- *os << inherited->full_base_proxy_impl_name ();
-
- has_concrete_parent = 1;
- }
-
- *os << be_uidt;
- }
-
- if (has_concrete_parent == 0)
- {
- *os << "public virtual TAO_Object_Proxy_Impl";
- }
-
- *os << be_uidt_nl << "{" << be_nl << "public:"
- << be_idt_nl;
-
- // Destructor Declaration.
- *os << "virtual ~" << node->base_proxy_impl_name () << " (void) {}";
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_base_proxy_impl_ch::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << be_nl;
-
- // Constructor Declaration.
- *os << "protected:" << be_idt_nl // idt = 1
- << node->base_proxy_impl_name () << " (void);"
- << be_uidt_nl;
-
- *os << "};" << be_nl << be_nl
- << "//" << be_nl
- << "// End Base Proxy Impl. Declaration" << be_nl
- << "///////////////////////////////////////////////////////////////////////"
- << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_interface_base_proxy_impl_ch::gen_abstract_ops_helper (
- be_interface *node,
- be_interface *base,
- TAO_OutStream *os
- )
-{
- if (node == base)
- {
- return 0;
- }
-
- AST_Decl *d = 0;
- be_visitor_context ctx;
- ctx.stream (os);
-
- for (UTL_ScopeActiveIterator si (base, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- d = si.item ();
-
- if (d == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_base_proxy_impl_ch"
- "::abstract_base_ops_helper - "
- "bad node in this scope\n"),
- -1);
- }
-
- if (d->node_type () == AST_Decl::NT_op)
- {
- UTL_ScopedName item_new_name (d->local_name (),
- 0);
-
- // We pass the node's is_abstract flag to the operation
- // constructor so we will get the right generated operation
- // body if we are regenerating an operation from an
- // abstract interface in a concrete interface or component.
- AST_Operation *op = AST_Operation::narrow_from_decl (d);
- be_operation new_op (op->return_type (),
- op->flags (),
- &item_new_name,
- op->is_local (),
- node->is_abstract ());
- new_op.set_defined_in (node);
- be_visitor_interface::add_abstract_op_args (op,
- new_op);
- be_visitor_operation_base_proxy_impl_ch op_visitor (&ctx);
- op_visitor.visit_operation (&new_op);
- }
- }
-
- return 0;
-}
-
-int be_visitor_interface_base_proxy_impl_ch::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
-
-
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp
deleted file mode 100644
index 7f580e93811..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for interfaces. This uses
-// compiled marshaling.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- cdr_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Interface visitor for generating CDR operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_interface_cdr_op_ch::be_visitor_interface_cdr_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_cdr_op_ch::~be_visitor_interface_cdr_op_ch (void)
-{
-}
-
-int
-be_visitor_interface_cdr_op_ch::visit_interface (be_interface *node)
-{
- // No CDR operations for locality constraint interfaces.
- if (node->cli_hdr_cdr_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Generate the CDR << and >> operator declarations.
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean "
- << "operator<< (TAO_OutputCDR &, const " << node->full_name ()
- << "_ptr );" << be_nl;
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean "
- << "operator>> (TAO_InputCDR &, "
- << node->full_name () << "_ptr &);" << be_nl;
-
- *os << be_global->core_versioning_end () << be_nl;
-
- // Set the substate as generating code for the types defined in our scope.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_SCOPE);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_cdr_op_ch::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_SUB_STATE_UNKNOWN);
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp
deleted file mode 100644
index 468e5c56e06..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for interfaces
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- cdr_op_cs,
- "$Id$")
-
-be_visitor_interface_cdr_op_cs::be_visitor_interface_cdr_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_cdr_op_cs::~be_visitor_interface_cdr_op_cs (void)
-{
-}
-
-int
-be_visitor_interface_cdr_op_cs::visit_interface (be_interface *node)
-{
- // No CDR operations for local interfaces.
- // already generated and/or we are imported. Don't do anything.
- if (node->cli_stub_cdr_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Set the substate as generating code for the types defined in our scope.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_SCOPE);
-
- // Visit the scope and generate code.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_cdr_op_cs::"
- "visit_interface - "
- "codegen for scope failed\n"), -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Set the sub state as generating code for the output operator.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
-
- *os << "::CORBA::Boolean operator<< (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &strm," << be_nl
- << "const " << node->full_name () << "_ptr _tao_objref" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (node->is_abstract ())
- {
- *os << "::CORBA::AbstractBase_ptr";
- }
- else if (node->node_type () == AST_Decl::NT_component)
- {
- *os << "Components::CCMObject_ptr";
- }
- else
- {
- *os << "::CORBA::Object_ptr";
- }
-
- *os << " _tao_corba_obj = _tao_objref;" << be_nl;
- *os << "return (strm << _tao_corba_obj);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Set the substate as generating code for the input operator.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_INPUT);
-
- *os << "::CORBA::Boolean operator>> (" << be_idt << be_idt_nl
- << "TAO_InputCDR &strm," << be_nl
- << node->full_name () << "_ptr &_tao_objref" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (node->is_abstract ())
- {
- *os << "::CORBA::AbstractBase_var obj;";
- }
- else if (node->node_type () == AST_Decl::NT_component)
- {
- *os << "Components::CCMObject_var obj;";
- }
- else
- {
- *os << "::CORBA::Object_var obj;";
- }
-
- *os << be_nl << be_nl
- << "if (!(strm >> obj.inout ()))" << be_idt_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "typedef ::" << node->name () << " RHS_SCOPED_NAME;"
- << be_nl << be_nl
- << "// Narrow to the right type." << be_nl;
-
- *os << "_tao_objref =" << be_idt_nl;
-
- if (!node->is_abstract ())
- {
- *os << "TAO::Narrow_Utils<RHS_SCOPED_NAME>::unchecked_narrow (";
- }
- else
- {
- *os << "TAO::AbstractBase_Narrow_Utils<RHS_SCOPED_NAME>::unchecked_narrow (";
- }
-
- *os << be_idt << be_idt_nl
- << "obj.in ()," << be_nl
- << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function_pointer" << be_uidt_nl
- << ");" << be_uidt_nl << be_uidt_nl;
-
- *os << "return true;" << be_uidt_nl
- << "}" << be_nl;
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_stub_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp
deleted file mode 100644
index f07aa96dbbb..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// $Id$
-//
-
-ACE_RCSID (be_visitor_interface,
- direct_proxy_impl_sh,
- "$Id$")
-
-be_visitor_interface_direct_proxy_impl_sh::
-be_visitor_interface_direct_proxy_impl_sh (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
- // No-Op.
-}
-
-be_visitor_interface_direct_proxy_impl_sh::
-~be_visitor_interface_direct_proxy_impl_sh (void)
-{
- // No-Op.
-}
-
-int
-be_visitor_interface_direct_proxy_impl_sh::visit_interface (
- be_interface *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl
- << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl << be_nl
- << "///////////////////////////////////////////////////////////////////////"
- << be_nl
- << "// Direct Impl. Declaration" << be_nl
- << "//" << be_nl << be_nl;
-
- // Generate Class Declaration.
- *os << "class " << be_global->skel_export_macro ()
- << " " << node->direct_proxy_impl_name ();
-
- bool first_concrete = true;
-
- if (node->n_inherits () > 0)
- {
- AST_Interface *parent = 0;
-
- for (int i = 0; i < node->n_inherits (); ++i)
- {
- parent = node->inherits ()[i];
-
- if (parent->is_abstract ())
- {
- continue;
- }
-
- be_interface *inherited =
- be_interface::narrow_from_decl (parent);
-
- if (first_concrete)
- {
- *os << be_nl
- << " : " << be_idt << be_idt;
- }
- else
- {
- *os << "," << be_nl;
- }
-
- first_concrete = false;
-
- *os << "public virtual ::"
- << inherited->full_direct_proxy_impl_name ();
- }
-
- if (!first_concrete)
- {
- *os << be_uidt << be_uidt;
- }
- }
-
- *os << be_nl
- << "{" << be_nl << "public:" << be_idt_nl;
-
- // Ctor
- *os << node->direct_proxy_impl_name () << " (void);" << be_nl << be_nl;
-
- // Dtor
- *os << "virtual ~" << node->direct_proxy_impl_name () << " (void);";
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) direct_proxy_impl_sh::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // Generate static collocated operations for operations of our base
- // classes.
- int status =
- node->traverse_inheritance_graph (
- be_interface::gen_colloc_op_decl_helper,
- os
- );
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_direct_proxy_impl_sh::"
- "visit_interface - "
- "inheritance graph traversal failed\n"),
- -1);
- }
-
- *os << be_uidt_nl
- << "};" << be_nl << be_nl
- << "//" << be_nl
- << "// Direct Proxy Impl. Declaration" << be_nl
- << "///////////////////////////////////////////////////////////////////////"
- << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_interface_direct_proxy_impl_sh::gen_abstract_ops_helper (
- be_interface *node,
- be_interface *base,
- TAO_OutStream *os
- )
-{
- if (!base->is_abstract ())
- {
- return 0;
- }
-
- AST_Decl *d = 0;
- be_visitor_context ctx;
- ctx.stream (os);
- ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH);
-
- for (UTL_ScopeActiveIterator si (base, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- d = si.item ();
-
- if (d == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_thru_poa_proxy_"
- "impl_sh::gen_abstract_ops_helper - "
- "bad node in this scope\n"),
- -1);
- }
-
- UTL_ScopedName item_new_name (d->local_name (),
- 0);
-
- // We pass the node's is_abstract flag to the operation
- // constructor so we will get the right generated operation
- // body if we are regenerating an operation from an
- // abstract interface in a concrete interface or component.
- if (d->node_type () == AST_Decl::NT_op)
- {
- be_operation *op = be_operation::narrow_from_decl (d);
- be_visitor_operation_proxy_impl_xh op_visitor (&ctx);
- op_visitor.visit_operation (op);
- }
- else if (d->node_type () == AST_Decl::NT_attr)
- {
- AST_Attribute *attr = AST_Attribute::narrow_from_decl (d);
- be_attribute new_attr (attr->readonly (),
- attr->field_type (),
- &item_new_name,
- attr->is_local (),
- attr->is_abstract ());
- new_attr.set_defined_in (node);
-
- UTL_ExceptList *get_exceptions = attr->get_get_exceptions ();
-
- if (0 != get_exceptions)
- {
- new_attr.be_add_get_exceptions (get_exceptions->copy ());
- }
-
- UTL_ExceptList *set_exceptions = attr->get_set_exceptions ();
-
- if (0 != set_exceptions)
- {
- new_attr.be_add_set_exceptions (set_exceptions->copy ());
- }
-
- be_visitor_attribute attr_visitor (&ctx);
- attr_visitor.visit_attribute (&new_attr);
- ctx.attribute (0);
- new_attr.destroy ();
- }
- }
-
- return 0;
-}
-
-int be_visitor_interface_direct_proxy_impl_sh::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_ss.cpp
deleted file mode 100644
index 97a20419a8c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_ss.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-//
-//$Id$
-//
-
-ACE_RCSID (be_visitor_interface,
- direct_proxy_impl_ss,
- "$Id$")
-
-be_visitor_interface_direct_proxy_impl_ss::
-be_visitor_interface_direct_proxy_impl_ss (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
- // No-Op.
-}
-
-be_visitor_interface_direct_proxy_impl_ss::
-~be_visitor_interface_direct_proxy_impl_ss (void)
-{
- // No-Op.
-}
-
-int
-be_visitor_interface_direct_proxy_impl_ss::visit_interface (
- be_interface *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- this->ctx_->node (node);
-
- *os << be_nl << be_nl
- << "///////////////////////////////////////////////////////////////////////"
- << be_nl
- << "// Direct Proxy Implementation" << be_nl
- << "//" << be_nl << be_nl;
-
- // Ctor Implementation
- *os << node->full_direct_proxy_impl_name () << "::"
- << node->direct_proxy_impl_name () << " (void)"
- << be_nl << "{}" << be_nl << be_nl;
-
- // Destructor Implementation
- *os << node->full_direct_proxy_impl_name () << "::~"
- << node->direct_proxy_impl_name () << " (void)"
- << be_nl << "{}" << be_nl << be_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_direct_collocated_ss::"
- "visit_scope - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_nl << be_nl
- << "//" << be_nl
- << "// End Direct Proxy Implementation" << be_nl
- << "///////////////////////////////////////////////////////////////////////";
-
- return 0;
-}
-
-int
-be_visitor_interface_direct_proxy_impl_ss::gen_abstract_ops_helper (
- be_interface *node,
- be_interface *base,
- TAO_OutStream *os
- )
-{
- if (!base->is_abstract ())
- {
- return 0;
- }
-
- AST_Decl *d = 0;
- be_visitor_context ctx;
- ctx.stream (os);
- ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS);
-
- for (UTL_ScopeActiveIterator si (base, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- d = si.item ();
-
- if (d == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_direct_proxy"
- "_impl_ss::gen_abstract_ops_helper - "
- "bad node in this scope\n"),
- -1);
- }
-
- AST_Decl::NodeType nt = d->node_type ();
-
- UTL_ScopedName *item_new_name = 0;
- UTL_ScopedName *new_name = 0;
-
- if (AST_Decl::NT_op == nt || AST_Decl::NT_attr == nt)
- {
- ACE_NEW_RETURN (item_new_name,
- UTL_ScopedName (d->local_name ()->copy (),
- 0),
- -1);
-
- new_name = (UTL_ScopedName *) node->name ()->copy ();
- new_name->nconc (item_new_name);
- }
- else
- {
- continue;
- }
-
- // We pass the node's is_abstract flag to the operation
- // constructor so we will get the right generated operation
- // body if we are regenerating an operation from an
- // abstract interface in a concrete interface or component.
- if (d->node_type () == AST_Decl::NT_op)
- {
- be_operation *op = be_operation::narrow_from_decl (d);
- UTL_ScopedName *old_name =
- (UTL_ScopedName *) op->name ()->copy ();
- op->set_name (new_name);
- op->set_defined_in (node);
- op->is_abstract (node->is_abstract ());
-
- be_visitor_operation_direct_proxy_impl_ss op_visitor (&ctx);
- op_visitor.visit_operation (op);
-
- op->set_name (old_name);
- op->set_defined_in (base);
- op->is_abstract (base->is_abstract ());
- }
- else if (d->node_type () == AST_Decl::NT_attr)
- {
- AST_Attribute *attr = AST_Attribute::narrow_from_decl (d);
- be_attribute new_attr (attr->readonly (),
- attr->field_type (),
- 0,
- attr->is_local (),
- attr->is_abstract ());
- new_attr.set_defined_in (node);
- new_attr.set_name (new_name);
-
- UTL_ExceptList *get_exceptions = attr->get_get_exceptions ();
-
- if (0 != get_exceptions)
- {
- new_attr.be_add_get_exceptions (get_exceptions->copy ());
- }
-
- UTL_ExceptList *set_exceptions = attr->get_set_exceptions ();
-
- if (0 != set_exceptions)
- {
- new_attr.be_add_set_exceptions (set_exceptions->copy ());
- }
-
- be_visitor_attribute attr_visitor (&ctx);
- attr_visitor.visit_attribute (&new_attr);
- ctx.attribute (0);
- new_attr.destroy ();
- }
- }
-
- return 0;
-}
-
-int be_visitor_interface_direct_proxy_impl_ss::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
-
-
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp
deleted file mode 100644
index 6619f38955d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp
+++ /dev/null
@@ -1,853 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces. This is a generic visitor.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- interface,
- "$Id$")
-
-// ******************************************************
-// Generic Interface visitor
-// ******************************************************
-
-be_visitor_interface::be_visitor_interface (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_interface::~be_visitor_interface (void)
-{
-}
-
-// This method must be overridden by the derived interface visitors.
-int
-be_visitor_interface::visit_interface (be_interface *)
-{
- return -1;
-}
-
-int
-be_visitor_interface::visit_scope (be_scope *node)
-{
- if (this->be_visitor_scope::visit_scope (node) == -1)
- {
- return -1;
- }
-
- be_interface *intf = be_interface::narrow_from_scope (node);
-
- if (intf == 0)
- {
- return 0;
- }
-
- if (intf->is_abstract ())
- {
- return 0;
- }
-
- if (! intf->has_mixed_parentage ())
- {
- return 0;
- }
-
- be_interface::tao_code_emitter helper = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- helper =
- be_visitor_interface_ch::gen_abstract_ops_helper;
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- helper =
- be_visitor_interface_cs::gen_abstract_ops_helper;
- break;
- case TAO_CodeGen::TAO_ROOT_SH:
- helper =
- be_visitor_interface_sh::gen_abstract_ops_helper;
- break;
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH:
- helper =
- be_visitor_interface_direct_proxy_impl_sh::gen_abstract_ops_helper;
- break;
- case TAO_CodeGen::TAO_ROOT_SS:
- helper =
- be_visitor_interface_ss::gen_abstract_ops_helper;
- break;
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS:
- helper =
- be_visitor_interface_direct_proxy_impl_ss::gen_abstract_ops_helper;
- break;
- default:
- break;
- }
-
- if (helper == 0)
- {
- return 0;
- }
-
- // 'abstract_paths_only' arg is FALSE here because we want to traverse
- // through concrete parents to get to all the abstract ones. The helper
- // will do nothing unless the base interface passed to it is abstract.
- int status =
- intf->traverse_inheritance_graph (helper,
- this->ctx_->stream (),
- false);
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_*::"
- "visit_scope - "
- "traversal of inheritance graph failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_interface::is_amh_rh_node (be_interface *node)
-{
- //If, is implied-IDL
- if (node->original_interface () != 0)
- {
- // and the name starts with AMH
- if (ACE_OS::strncmp (node->local_name (), "AMH", 3) == 0)
- {
- // then it is an AMH node.
- return 1;
- }
- }
-
- return 0;
-}
-
-void
-be_visitor_interface::add_abstract_op_args (AST_Operation *old_op,
- be_operation &new_op)
-{
- AST_Decl *d = 0;
-
- for (UTL_ScopeActiveIterator si (old_op, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- d = si.item ();
- new_op.add_to_scope (d);
- }
-
- UTL_ExceptList *excep_list = old_op->exceptions ();
-
- if (0 != excep_list)
- {
- new_op.be_add_exceptions (excep_list->copy ());
- }
-}
-
-// All common visit methods for interface visitor.
-
-int
-be_visitor_interface::visit_attribute (be_attribute *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // Same visitor for all the above cases where an action is taken.
- be_visitor_attribute visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_attribute - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_interface::visit_constant (be_constant *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_constant_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_constant_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_constant - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_interface::visit_native (be_native *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_native_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_native - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_interface::visit_enum (be_enum *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_enum_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_enum_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_enum_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_enum_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_enum_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_enum_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_enum - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-// visit an exception
-int
-be_visitor_interface::visit_exception (be_exception *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_exception_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_exception_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_exception_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_exception_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_exception_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_exception_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_exception_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_exception - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-// visit an operation
-int
-be_visitor_interface::visit_operation (be_operation *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified ased on what type of node we are visiting
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 1;
-
- switch (this->ctx_->state ())
- {
- // These first two cases may have the context state changed
- // by a strategy, so we use the visitor factory below.
- case TAO_CodeGen::TAO_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_SH:
- {
- be_visitor_operation_sh visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IH:
- {
- be_visitor_operation_ih visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SS:
- {
- be_visitor_operation_ss visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IS:
- {
- be_visitor_operation_is visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_TIE_SH:
- {
- be_visitor_operation_tie_sh visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_TIE_SI:
- {
- be_visitor_operation_tie_si visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH:
- {
- be_visitor_operation_smart_proxy_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS:
- {
- be_visitor_operation_smart_proxy_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH:
- {
- be_visitor_operation_proxy_impl_xh visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_INTERFACE_AMH_RH_SH:
- {
- be_visitor_amh_rh_operation_sh visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_INTERFACE_AMH_RH_SS:
- {
- be_visitor_amh_rh_operation_ss visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS:
- {
- be_visitor_operation_direct_proxy_impl_ss visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- case TAO_CodeGen::TAO_ROOT_CI:
- case TAO_CodeGen::TAO_ROOT_SI:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_operation - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == 0)
- {
- return 0;
- }
- else if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_operation - "
- "failed to accept visitor\n"),
- -1);
- }
-
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state ()));
-
-
- // Grab the appropriate visitor.
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_operation - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_operation - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
-
- // Do additional code generation is necessary.
- // Note, this call is delegated to the strategy connected to
- // the node.
- if (node->has_extra_code_generation (ctx.state ()))
- {
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state (), 1));
-
- // Grab the appropriate visitor.
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_operation - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_operation - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
- }
-
- return 0;
-}
-
-int
-be_visitor_interface::visit_structure (be_structure *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_structure_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_structure_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_structure_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_structure_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_structure_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_structure_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_structure_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_structure - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_interface::visit_structure_fwd (be_structure_fwd *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_structure_fwd_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_structure_fwd - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_interface::visit_union (be_union *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_union_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_union_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_union_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_union_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_union_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_union_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_union_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_union - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_interface::visit_union_fwd (be_union_fwd *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_union_fwd_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_union_fwd - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_interface::visit_typedef (be_typedef *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_typedef_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_typedef_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_typedef_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_typedef_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_typedef_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_typedef_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_typedef_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp
deleted file mode 100644
index 56028c21bbe..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp
+++ /dev/null
@@ -1,463 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- interface_ch,
- "$Id$")
-
-// ******************************************************
-// Interface visitor for client header
-// ******************************************************
-
-be_visitor_interface_ch::be_visitor_interface_ch (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_ch::~be_visitor_interface_ch (void)
-{
-}
-
-int
-be_visitor_interface_ch::visit_interface (be_interface *node)
-{
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- // This will be a no-op if it has already been done by a forward
- // declaration.
- node->gen_var_out_seq_decls ();
-
- TAO_OutStream *os = this->ctx_->stream ();
- long i;
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Now the interface definition itself.
- os->gen_ifdef_macro (node->flat_name ());
-
- // Now generate the class definition.
- *os << be_nl << be_nl
- << "class " << be_global->stub_export_macro ()
- << " " << node->local_name () << be_idt_nl
- << ": " ;
-
- long nparents = node->n_inherits ();
- int has_concrete_parent = 0;
-
- // If node interface inherits from other interfaces.
- if (nparents > 0)
- {
- *os << be_idt;
-
- for (i = 0; i < nparents; ++i)
- {
- if (! node->inherits ()[i]->is_abstract ())
- {
- has_concrete_parent = 1;
- }
-
- *os << "public virtual ::"
- << node->inherits ()[i]->name ();
-
- if (i < nparents - 1)
- {
- // Node has multiple inheritance, so put a comma.
- *os << "," << be_nl;
- }
- }
-
- if (has_concrete_parent == 1 || node->is_abstract ())
- {
- *os << be_uidt << be_uidt_nl;
- }
- else if (! node->is_abstract ())
- {
- *os << "," << be_nl;
- }
- }
-
- if (node->is_abstract () && nparents == 0)
- {
- *os << "public virtual ::CORBA::AbstractBase" << be_uidt_nl;
- }
-
- if (has_concrete_parent == 0 && ! node->is_abstract ())
- {
- *os << "public virtual ::CORBA::Object";
-
- if (nparents > 0)
- {
- *os << be_uidt;
- }
-
- *os << be_uidt_nl;
- }
-
- // Generate the body.
-
- *os << "{" << be_nl
- << "public:" << be_idt_nl;
-
- if (!node->is_local () && !node->is_abstract ())
- {
- *os << "friend class TAO::Narrow_Utils<"
- << node->local_name () << ">;" << be_nl;
- }
- else if (!node->is_local () && node->is_abstract ())
- {
- *os << "friend class TAO::AbstractBase_Narrow_Utils<"
- << node->local_name () << ">;" << be_nl;
- }
-
- *os << "typedef " << node->local_name () << "_ptr _ptr_type;"
- << be_nl
- << "typedef " << node->local_name () << "_var _var_type;"
- << be_nl
- << "typedef " << node->local_name () << "_out _out_type;"
- << be_nl << be_nl;
-
- // Generate the static _duplicate, _narrow, _unchecked_narrow and
- // _nil operations.
- *os << "// The static operations." << be_nl
- << "static " << node->local_name () << "_ptr " << "_duplicate ("
- << node->local_name () << "_ptr obj);" << be_nl << be_nl
- << "static void _tao_release ("
- << node->local_name () << "_ptr obj);" << be_nl << be_nl;
-
- if (this->gen_xxx_narrow ("_narrow",
- node,
- os) == false)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%P|%t) Error in "
- "be_visitor_interface_ch::"
- "visit_interface while generating "
- "_narrow () declaration \n"),
- -1);
- }
-
- if (this->gen_xxx_narrow ("_unchecked_narrow",
- node,
- os) == false)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%P|%t) Error in "
- "be_visitor_interface_ch::"
- "visit_interface while generating "
- "_unchecked_narrow () declaration \n"),
- -1);
- }
-
- // This method is defined in the header file to workaround old
- // g++ problems.
- *os << "static " << node->local_name () << "_ptr _nil (void)"
- << be_nl
- << "{" << be_idt_nl
- << "return static_cast<" << node->local_name ()
- << "_ptr> (0);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- bool gen_any_destructor =
- be_global->any_support ()
- && (!node->is_local () || be_global->gen_local_iface_anyops ());
-
- if (gen_any_destructor)
- {
- *os << "static void _tao_any_destructor (void *);";
- }
-
- // Generate code for the interface definition by traversing thru the
- // elements of its scope. We depend on the front-end to have made sure
- // that only legal syntactic elements appear in our scope.
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- if (node->is_local ())
- {
- if (node->convert_parent_ops (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "converting parent ops failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- if (node->session_component_child () == 1)
- {
- *os << "// These two are inherited from SessionComponent."
- << be_nl << be_nl
- << "virtual void ciao_preactivate (" << be_idt << be_idt
- << env_sngl_dflts << be_uidt_nl
- << ")" << be_nl
- << "ACE_THROW_SPEC ((" << be_idt_nl
- << "::CORBA::SystemException," << be_nl
- << "::Components::CCMException" << be_uidt_nl
- << "));" << be_uidt_nl << be_nl
- << "virtual void ciao_postactivate (" << be_idt << be_idt
- << env_sngl_dflts << be_uidt_nl
- << ")" << be_nl
- << "ACE_THROW_SPEC ((" << be_idt_nl
- << "::CORBA::SystemException," << be_nl
- << "::Components::CCMException" << be_uidt_nl
- << "));" << be_uidt_nl << be_nl;
- }
-
- // If we inherit from both CORBA::Object and CORBA::AbstractBase,
- // we have to override _add_ref() to avoid ambiguity.
- if (node->has_mixed_parentage ())
- {
- *os << "virtual void _add_ref (void);" << be_nl << be_nl;
- }
-
- // The _is_a method
- *os << "virtual ::CORBA::Boolean _is_a (" << be_idt << be_idt_nl
- << "const char *type_id" << env_dflts << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // The _interface_repository_id method.
- *os << "virtual const char* _interface_repository_id (void) const;";
-
- // The virtual marshal method, to prevent marshal of local iterfaces.
- *os << be_nl << "virtual ::CORBA::Boolean marshal (TAO_OutputCDR &cdr);";
-
- if (! node->is_local ())
- {
- // Add the Proxy Broker member variable.
- *os << be_uidt_nl
- << "private:" << be_idt_nl
- << "TAO::Collocation_Proxy_Broker *"
- << "the" << node->base_proxy_broker_name ()
- << "_;";
- }
-
- *os << be_uidt_nl << be_nl
- << "protected:" << be_idt_nl;
-
- if (! node->is_local ())
- {
- // Generate the "protected" constructor so that users cannot
- // instantiate us.
-
- if (! node->is_abstract ())
- {
- *os << "// Concrete interface only." << be_nl
- << node->local_name () << " (void);"
- << be_nl << be_nl;
- }
-
- *os << "// These methods travese the inheritance tree and set the"
- << be_nl
- << "// parents piece of the given class in the right mode."
- << be_nl
- << "virtual void " << node->flat_name ()
- << "_setup_collocation (void);" << be_nl << be_nl;
- }
-
- if (node->is_abstract () || node->is_local ())
- {
- // Protected default constructor for abstract interfaces.
- *os << "// Abstract or local interface only." << be_nl
- << node->local_name () << " (void);" << be_nl << be_nl;
- }
-
- if (node->is_abstract ())
- {
- // Protected copy constructor for abstract interfaces.
- *os << "// Protected for abstract interfaces." << be_nl
- << node->local_name () << " (const "
- << node->local_name () << " &);" << be_nl << be_nl;
- }
-
-
- // Local interfaces don't support stub objects.
- if (! node->is_local ())
- {
- if (! node->is_abstract ())
- {
- *os << "// Concrete non-local interface only." << be_nl
- << node->local_name () << " (" << be_idt << be_idt_nl
- << "IOP::IOR *ior," << be_nl
- << "TAO_ORB_Core *orb_core = 0" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
- }
-
- *os << "// Non-local interface only." << be_nl
- << node->local_name () << " (" << be_idt << be_idt_nl
- << "TAO_Stub *objref," << be_nl
- << "::CORBA::Boolean _tao_collocated = 0," << be_nl
- << "TAO_Abstract_ServantBase *servant = 0," << be_nl
- << "TAO_ORB_Core *orb_core = 0" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
- }
-
- // Protected destructor.
- *os << "virtual ~" << node->local_name () << " (void);";
-
- // Private copy constructor and assignment operator. These are not
- // allowed, hence they are private.
- *os << be_uidt_nl << be_nl
- << "private:" << be_idt_nl;
-
- // Abstract interfaces have a *protected* copy constructor.
- if (! node->is_abstract ())
- {
- *os << "// Private and unimplemented for concrete interfaces." << be_nl
- << node->local_name () << " (const "
- << node->local_name () << " &);" << be_nl << be_nl;
- }
-
- *os << "void operator= (const " << node->local_name () << " &);";
-
- // Generate the embedded RequestInfo classes per operation.
- // This is to be used by interceptors.
- be_visitor_context ctx (*this->ctx_);
-
- ctx = *this->ctx_;
-
- *os << be_uidt_nl;
- *os << "};";
-
- // Don't support smart proxies for local interfaces.
- if (! node->is_local ())
- {
- // List that generates proxy broker factory function pointer.
- be_global->non_local_interfaces.enqueue_tail (node);
-
- if (be_global->gen_smart_proxies ())
- {
- *os << be_nl << be_nl;
-
- // Smart Proxy related classes.
- ctx.state (TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH);
- be_visitor_interface_smart_proxy_ch sp_visitor (&ctx);
-
- if (node->accept (&sp_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ch::"
- "visit_interface - "
- "codegen for smart proxy classes failed\n"),
- -1);
- }
- }
- }
-
- os->gen_endif ();
-
- if (be_global->tc_support () && !node->home_equiv ())
- {
- be_visitor_typecode_decl td_visitor (&ctx);
-
- if (node->accept (&td_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "TypeCode declaration failed\n"),
- -1);
- }
- }
-
- node->cli_hdr_gen (true);
- return 0;
-}
-
-int
-be_visitor_interface_ch::gen_abstract_ops_helper (be_interface *node,
- be_interface *base,
- TAO_OutStream *os)
-{
- if (!base->is_abstract ())
- {
- return 0;
- }
-
- AST_Decl *d = 0;
- be_visitor_context ctx;
- ctx.stream (os);
-
- for (UTL_ScopeActiveIterator si (base, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- d = si.item ();
-
- if (d == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::"
- "gen_abstract_ops_helper - "
- "bad node in this scope\n"),
- -1);
- }
-
- if (d->node_type () == AST_Decl::NT_op)
- {
-
- be_operation *op = be_operation::narrow_from_decl (d);
- op->set_local (node->is_local ());
- ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
- be_visitor_operation_ch op_visitor (&ctx);
- op_visitor.visit_operation (op);
- op->set_local (base->is_local ());
- }
- }
-
- return 0;
-}
-
-bool
-be_visitor_interface_ch::gen_xxx_narrow (const char *nar,
- be_interface *node,
- TAO_OutStream *os)
-{
- *os << "static " << node->local_name () << "_ptr "
- << nar << " (" << be_idt << be_idt_nl;
-
- if (node->is_abstract ())
- {
- *os << "::CORBA::AbstractBase_ptr obj";
- }
- else
- {
- *os << "::CORBA::Object_ptr obj";
- }
-
- *os << env_dflts << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- return true;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
deleted file mode 100644
index 5f81239c45a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the client inline file
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- interface_ci,
- "$Id$")
-
-// **************************************************
-// Interface visitor for client inline
-// **************************************************
-
-be_visitor_interface_ci::be_visitor_interface_ci (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_ci::~be_visitor_interface_ci (void)
-{
-}
-
-int
-be_visitor_interface_ci::visit_interface (be_interface *node)
-{
- if (node->imported ())
- {
- return 0;
- }
-
- // Generate inline methods for elements of our scope.
- // This will always be done here for any non-imported node,
- // whether the _var and _out code has been generated already
- // at a forward declaration or not.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ci::"
- "visit_interface - "
- "codegen for scope failed\n"), -1);
- }
-
- // Nothing to generate for a local interface except from it scope.
- if (node->is_local ())
- {
- node->cli_inline_gen (true);
- return 0;
- }
-
- // A forward declared interface may have set this flag.
- if (node->cli_inline_gen ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- os->gen_ifdef_macro (node->flat_name (), "");
-
- if (node->is_abstract ())
- {
- *os << be_nl << be_nl
- << "ACE_INLINE" << be_nl
- << node->name () << "::" << node->local_name ()
- << " (void)" << be_nl
- << "{}" << be_nl << be_nl;
-
- *os << "ACE_INLINE" << be_nl
- << node->name () << "::" << node->local_name ()
- << " (const " << node->local_name () << " &rhs)" << be_idt_nl
- << ": ::CORBA::AbstractBase (rhs)" << be_uidt_nl
- << "{}";
- }
-
- // Generate the constructor from stub and servant.
- node->gen_stub_ctor (os);
-
- if (!node->is_local () && !node->is_abstract ())
- {
- *os << be_nl << be_nl
- << "ACE_INLINE" << be_nl;
- *os << node->name () << "::"
- << node->local_name () << " ("
- << be_idt << be_idt_nl
- << "IOP::IOR *ior," << be_nl
- << "TAO_ORB_Core *oc" << be_uidt_nl
- << ")" << be_nl;
- *os << ": ::CORBA::Object (ior, oc)," << be_idt_nl
- << "the"<< node->base_proxy_broker_name () << "_ (0)"
- << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "}" ;
- }
-
- os->gen_endif ();
- node->cli_inline_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
deleted file mode 100644
index 1ffea0d9e62..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
+++ /dev/null
@@ -1,659 +0,0 @@
-//
-// $Id$
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the client stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- interface_cs,
- "$Id$")
-
-
-// ************************************************************
-// Interface visitor for client stubs
-// ************************************************************
-
-be_visitor_interface_cs::be_visitor_interface_cs (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_cs::~be_visitor_interface_cs (void)
-{
-}
-
-int
-be_visitor_interface_cs::visit_interface (be_interface *node)
-{
- if (node->imported () || node->cli_stub_gen ())
- {
- return 0;
- }
-
- be_type *bt;
-
- // Set the right type.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- if (node->is_defined ())
- {
- *os << be_nl << be_nl
- << "// Traits specializations for " << node->name () << ".";
-
- *os << be_nl << be_nl
- << node->name () << "_ptr" << be_nl
- << "TAO::Objref_Traits<" << node->name () << ">::duplicate ("
- << be_idt << be_idt_nl
- << node->name () << "_ptr p" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return " << node->name () << "::_duplicate (p);" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "void" << be_nl
- << "TAO::Objref_Traits<" << node->name () << ">::release ("
- << be_idt << be_idt_nl
- << node->name () << "_ptr p" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::release (p);" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << node->name () << "_ptr" << be_nl
- << "TAO::Objref_Traits<" << node->name () << ">::nil (void)"
- << be_nl
- << "{" << be_idt_nl
- << "return " << node->name () << "::_nil ();" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "::CORBA::Boolean" << be_nl
- << "TAO::Objref_Traits<" << node->name () << ">::marshal ("
- << be_idt << be_idt_nl
- << "const " << node->name () << "_ptr p," << be_nl
- << "TAO_OutputCDR & cdr" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return ";
-
- if (node->is_abstract ())
- {
- *os << "cdr << p;";
- }
- else
- {
- *os << "::CORBA::Object::marshal (p, cdr);";
- }
-
- *os << be_uidt_nl
- << "}";
- }
-
- if (node->has_mixed_parentage ())
- {
- *os << be_nl << be_nl
- << "void" << be_nl
- << "CORBA::release ("
- << node->name ()
- << "_ptr p)" << be_nl
- << "{" << be_idt_nl
- << "::CORBA::AbstractBase_ptr abs = p;" << be_nl
- << "::CORBA::release (abs);" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "::CORBA::Boolean" << be_nl
- << "CORBA::is_nil ("
- << node->name ()
- << "_ptr p)" << be_nl
- << "{" << be_idt_nl
- << "::CORBA::Object_ptr obj = p;" << be_nl
- << "return ::CORBA::is_nil (obj);" << be_uidt_nl
- << "}";
- }
-
- if (!node->is_local ())
- {
- // Generate the proxy broker factory function pointer definition.
- *os << be_nl << be_nl
- << "// Function pointer for collocation factory initialization."
- << be_nl
- << "TAO::Collocation_Proxy_Broker * " << be_nl
- << "(*" << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function_pointer) ("
- << be_idt << be_idt_nl
- << "::CORBA::Object_ptr obj" << be_uidt_nl
- << ") = 0;" << be_uidt;
- }
-
- // Generate code for the elements of the interface.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_cs::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- if (node->is_local ())
- {
- *os << be_nl << be_nl
- << node->name () << "::" << node->local_name ()
- << " (void)" << be_nl
- << "{}";
- }
-
- if (! node->is_abstract () && ! node->is_local ())
- {
- *os << be_nl << be_nl
- << node->name () << "::" << node->local_name ()
- << " (void)" << be_nl
- << " : the" << node->base_proxy_broker_name () << "_ (0)" << be_nl
- << "{" << be_idt_nl
- << "this->" << node->flat_name ()
- << "_setup_collocation ();" << be_uidt_nl
- << be_uidt << "}";
- }
-
- if (! node->is_local ())
- {
- *os << be_nl << be_nl
- << "void" << be_nl
- << node->name () << "::" << node->flat_name ()
- << "_setup_collocation ()" << be_nl
- << "{" << be_idt_nl
- << "if (" << "::"
- << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function_pointer";
-
- // Right now (29-01-04) we don't support collocation for
- // abstract interfaces, and the 'collocated' arg will always
- // be 0. However, just to be safe, we add a
- // check for non-zero collocation factory function pointer
- // (which at present is also 0 for abstract interfaces),
- // in case the logic is changed in the future.
- if (node->is_abstract ())
- {
- *os << " && " << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function_pointer";
- }
-
- *os << ")" << be_idt_nl
- << "{" << be_idt_nl
- << "this->the" << node->base_proxy_broker_name ()
- << "_ =" << be_idt_nl
- << "::" << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function_pointer (";
-
- if (node->is_abstract ())
- {
- *os << be_idt << be_idt_nl
- << "this->equivalent_objref ()" << be_uidt_nl
- << ");" << be_uidt;
- }
- else
- {
- *os << "this);";
- }
-
- *os << be_uidt << be_uidt_nl
- << "}" << be_uidt;
-
- // Now we setup the immediate parents.
- long n_parents = node->n_inherits ();
- int has_parent = 0;
-
- if (n_parents > 0)
- {
- for (long i = 0; i < n_parents; ++i)
- {
- be_interface *inherited =
- be_interface::narrow_from_decl (node->inherits ()[i]);
-
- if (has_parent == 0)
- {
- *os << be_nl;
- }
-
- has_parent = 1;
-
- *os << be_nl
- << "this->" << inherited->flat_name ()
- << "_setup_collocation" << " ();";
- }
- }
-
- *os << be_uidt_nl << "}";
- }
-
- *os << be_nl << be_nl
- << node->name () << "::~" << node->local_name ()
- << " (void)" << be_nl;
- *os << "{}" << be_nl << be_nl;
-
- bool gen_any_destructor =
- be_global->any_support ()
- && (!node->is_local () || be_global->gen_local_iface_anyops ());
-
- if (gen_any_destructor)
- {
- *os << "void " << be_nl
- << node->name ()
- << "::_tao_any_destructor (void *_tao_void_pointer)" << be_nl
- << "{" << be_idt_nl
- << node->local_name () << " *_tao_tmp_pointer =" << be_idt_nl
- << "static_cast<"
- << node->local_name () << " *> (_tao_void_pointer);" << be_uidt_nl
- << "::CORBA::release (_tao_tmp_pointer);" << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
-
- if (node->has_mixed_parentage ())
- {
- *os << "void" << be_nl
- << node->name () << "::_add_ref (void)" << be_nl
- << "{" << be_idt_nl
- << "this->::CORBA::Object::_add_ref ();"
- << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
-
- // The _narrow method
- if (this->gen_xxx_narrow ("narrow",
- node) == false)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_cs::"
- "visit_interface - "
- "_narrow () method codegen failed\n"),
- -1);
- }
-
- // The _unchecked_narrow method
- if (this->gen_xxx_narrow ("unchecked_narrow",
- node) == false)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_cs::"
- "visit_interface - "
- "_unchecked_narrow () method codegen"
- " failed\n"),
- -1);
- }
-
-
- // The _duplicate method
- *os << node->full_name () << "_ptr" << be_nl
- << node->full_name () << "::_duplicate ("
- << bt->local_name ()
- << "_ptr obj)" << be_nl
- << "{" << be_idt_nl
- << "if (! ::CORBA::is_nil (obj))" << be_idt_nl
- << "{" << be_idt_nl
- << "obj->_add_ref ();" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "return obj;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // The _tao_release method
- *os << "void" << be_nl
- << node->full_name () << "::_tao_release ("
- << bt->local_name ()
- << "_ptr obj)" << be_nl
- << "{" << be_idt_nl
- << "::CORBA::release (obj);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
-
- // Empty implementations so the application can override or not.
- if (node->session_component_child () == 1)
- {
- *os << "// These two are inherited from SessionComponent."
- << be_nl << be_nl
- << "void" << be_nl
- << node->full_name () << "::ciao_preactivate ("
- << be_idt << be_idt
- << env_sngl_not << be_uidt_nl
- << ")" << be_uidt_nl
- << "ACE_THROW_SPEC (( ::CORBA::SystemException," << be_nl
- << " ::Components::CCMException))" << be_uidt_nl
- << "{" << be_nl
- << "}" << be_nl << be_nl
- << "void" << be_nl
- << node->full_name () << "::ciao_postactivate ("
- << be_idt << be_idt
- << env_sngl_not << be_uidt_nl
- << ")" << be_uidt_nl
- << "ACE_THROW_SPEC (( ::CORBA::SystemException," << be_nl
- << " ::Components::CCMException))" << be_uidt_nl
- << "{" << be_nl
- << "}" << be_nl << be_nl;
- }
-
- *os << "::CORBA::Boolean" << be_nl
- << node->full_name () << "::_is_a (" << be_idt << be_idt_nl
- << "const char *value";
-
- if (node->is_local () || node->is_abstract ())
- {
- *os << env_not;
- }
- else
- {
- *os << env_decl;
- }
-
- *os << be_uidt_nl << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "if (" << be_idt << be_idt_nl;
-
- int status =
- node->traverse_inheritance_graph (be_interface::is_a_helper,
- os);
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_cs::"
- "visit_interface - "
- "_is_a method codegen failed\n"),
- -1);
- }
-
- if (node->is_abstract () || node->has_mixed_parentage ())
- {
- *os << "!ACE_OS::strcmp (" << be_idt << be_idt_nl
- << "value," << be_nl
- << "\"IDL:omg.org/CORBA/AbstractBase:1.0\"" << be_uidt_nl
- << ")";
- }
- else if (node->is_local ())
- {
- *os << "!ACE_OS::strcmp (" << be_idt << be_idt_nl
- << "value," << be_nl
- << "\"IDL:omg.org/CORBA/LocalObject:1.0\"" << be_uidt_nl
- << ")";
- }
-
- if (node->has_mixed_parentage () || node->is_local ())
- {
- *os << " ||" << be_uidt_nl;
- }
- else if (node->is_abstract ())
- {
- *os << be_uidt << be_uidt_nl;
- }
-
- if (! node->is_abstract ())
- {
- *os << "!ACE_OS::strcmp (" << be_idt << be_idt_nl
- << "value," << be_nl
- << "\"IDL:omg.org/CORBA/Object:1.0\"" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl;
- }
-
- *os << ")" << be_nl
- << "{" << be_idt_nl
- << "return true; // success using local knowledge" << be_uidt_nl
- << "}" << be_uidt_nl
- << "else" << be_idt_nl
- << "{" << be_idt_nl;
-
- if (node->is_abstract () || node->is_local ())
- {
- *os << "return false;" << be_uidt_nl;
- }
- else
- {
- *os << "return this->::CORBA::Object::_is_a ("
- << be_idt << be_idt_nl
- << "value" << env_arg << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
- }
-
- *os << "}" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "const char* " << node->full_name ()
- << "::_interface_repository_id (void) const"
- << be_nl
- << "{" << be_idt_nl
- << "return \"" << node->repoID ()
- << "\";" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "::CORBA::Boolean" << be_nl;
-
- if (node->is_local ())
- {
- *os << node->name () << "::marshal (TAO_OutputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}";
- }
- else
- {
- *os << node->name () << "::marshal (TAO_OutputCDR &cdr)" << be_nl
- << "{" << be_idt_nl
- << "return (cdr << this);" << be_uidt_nl
- << "}";
- }
-
- if (! node->is_abstract ())
- {
- // Smart Proxy classes.
- if (! node->is_local () && be_global->gen_smart_proxies ())
- {
- be_visitor_context ctx (*this->ctx_);
-
- ctx.state (TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS);
- be_visitor_interface_smart_proxy_cs isp_visitor (&ctx);
-
- if (node->accept (&isp_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_cs::"
- "visit_interface - "
- "codegen for smart proxy classes failed\n"),
- -1);
- }
- }
- }
-
- if (be_global->tc_support () && !node->home_equiv ())
- {
-
- be_visitor_context ctx = *this->ctx_;
- // ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- TAO::be_visitor_objref_typecode tc_visitor (&ctx);
-
- if (node->accept (&tc_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_cs::"
- "visit_interface - "
- "TypeCode definition failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-bool
-be_visitor_interface_cs::gen_xxx_narrow (const char *pre,
- be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << node->full_name () << "_ptr" << be_nl
- << node->full_name () << "::_" << pre << " ("
- << be_idt << be_idt_nl;
-
- if (node->is_abstract ())
- {
- *os << "::CORBA::AbstractBase_ptr";
- }
- else
- {
- *os << "::CORBA::Object_ptr";
- }
-
- *os << " _tao_objref"
- << (node->is_local () ? env_not : env_decl)
- << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (node->is_local ())
- {
- *os << "return " << node->local_name () << "::_duplicate ("
- << be_idt << be_idt_nl
- << "dynamic_cast<" << node->local_name () << "_ptr> (_tao_objref)"
- << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- return true;
- }
- else if (be_global->gen_smart_proxies () &&
- !node->is_abstract ())
- {
- *os << node->full_name () << " *proxy = 0;" << be_nl << be_nl
- << "proxy = TAO::Narrow_Utils<"
- << node->local_name () << ">::" << pre << " (";
-
- *os << be_idt << be_idt_nl
- << "_tao_objref," << be_nl
- << "\"" << node->repoID () << "\"," << be_nl
- << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function_pointer" << env_arg << be_uidt_nl
- << ");" << be_uidt << be_nl
- << "return TAO_" << node->flat_name ()
- << "_PROXY_FACTORY_ADAPTER::instance ()->create_proxy (proxy);"
- << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
- else
- {
- *os << "return" << be_idt_nl;
-
- if (!node->is_abstract ())
- {
- *os << "TAO::Narrow_Utils<"
- << node->local_name () << ">::" << pre << " (";
- }
- else
- {
- *os << "TAO::AbstractBase_Narrow_Utils<"
- << node->local_name () << ">::" << pre <<" (";
- }
-
- *os << be_idt << be_idt_nl
- << "_tao_objref," << be_nl
- << "\"" << node->repoID () << "\"," << be_nl
- << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function_pointer" << env_arg << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
-
- return true;
-}
-
-int
-be_visitor_interface_cs::gen_abstract_ops_helper (be_interface *node,
- be_interface *base,
- TAO_OutStream *os)
-{
- // If the derived interface is local, the abstract parent's operation
- // was generated as pure virtual.
- if (!base->is_abstract () || node->is_local ())
- {
- return 0;
- }
-
- AST_Decl *d = 0;
- be_visitor_context ctx;
- ctx.stream (os);
-
- for (UTL_ScopeActiveIterator si (base, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- d = si.item ();
-
- if (d == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_cs::"
- "gen_abstract_ops_helper - "
- "bad node in this scope\n"),
- -1);
- }
-
- if (d->node_type () == AST_Decl::NT_op)
- {
- UTL_ScopedName *item_new_name = 0;
- ACE_NEW_RETURN (item_new_name,
- UTL_ScopedName (d->local_name ()->copy (),
- 0),
- -1);
-
- UTL_ScopedName *new_op_name =
- (UTL_ScopedName *)node->name ()->copy ();
- new_op_name->nconc (item_new_name);
-
- be_operation *op = be_operation::narrow_from_decl (d);
- UTL_ScopedName *old_op_name =
- (UTL_ScopedName *) op->name ()->copy ();
- op->set_name (new_op_name);
- op->set_defined_in (node);
- op->is_abstract (node->is_abstract ());
-
- ctx.state (TAO_CodeGen::TAO_OPERATION_CS);
- be_visitor_operation_cs op_visitor (&ctx);
- op_visitor.visit_operation (op);
-
- op->set_name (old_op_name);
- op->set_defined_in (base);
- op->is_abstract (base->is_abstract ());
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp
deleted file mode 100644
index d3f39e96cab..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp
+++ /dev/null
@@ -1,176 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface_ih.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the implementation header
-//
-// = AUTHOR
-// Yamuna Krishnamurthy (yamuna@cs.wustl.edu)
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- interface_ih,
- "$Id$")
-
-// ************************************************************
-// Interface visitor for implementation header.
-// ************************************************************
-
-be_visitor_interface_ih::be_visitor_interface_ih (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_ih::~be_visitor_interface_ih (void)
-{
-}
-
-int
-be_visitor_interface_ih::visit_interface (be_interface *node)
-{
- if (node->impl_hdr_gen () || node->imported () || node->is_abstract ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- static char namebuf [NAMEBUFSIZE];
-
-
- ACE_OS::memset (namebuf,
- '\0',
- NAMEBUFSIZE);
-
- // Generate the skeleton class name.
-
- ACE_OS::sprintf (namebuf, "%s", node->flat_name ());
-
- if (be_global->gen_impl_debug_info ())
- {
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
- }
-
- // Now generate the class definition.
- *os << "class " << be_global->stub_export_macro ()
- << " " << be_global->impl_class_prefix () << namebuf
- << be_global->impl_class_suffix () << be_idt_nl << ": public virtual ";
-
- // Inherit from the base skeleton name, unless the interface
- // is local.
- if (node->is_local ())
- {
- *os << node->full_name ();
- }
- else
- {
- *os << node->full_skel_name ();
- }
-
- if (node->is_local ())
- {
- *os << "," << be_idt_nl
- << "public virtual TAO_Local_RefCounted_Object"
- << be_uidt;
- }
-
- *os << be_uidt_nl
- << "{" << be_nl
- << "public:" << be_idt_nl
- << "// Constructor " << be_nl
- << be_global->impl_class_prefix () << namebuf
- << be_global->impl_class_suffix () << " (void);" << be_nl << be_nl;
-
- if (be_global->gen_copy_ctor () && !node->is_local ())
- {
- *os << "// Copy Constructor"<<be_nl
- << be_global->impl_class_prefix () << namebuf
- << be_global->impl_class_suffix () << " (const "
- << be_global->impl_class_prefix () << namebuf
- << be_global->impl_class_suffix () << "&);" <<be_nl <<be_nl;
- }
-
- if (be_global->gen_assign_op ())
- {
- *os << "// Copy Assignment" << be_nl
- << be_global->impl_class_prefix () << namebuf
- << be_global->impl_class_suffix () << "& " << "operator=(const "
- << be_global->impl_class_prefix () << namebuf
- << be_global->impl_class_suffix () << "&);" << be_nl << be_nl;
-
- }
-
- *os << "// Destructor " << be_nl
- << "virtual " << "~" << be_global->impl_class_prefix () << namebuf
- << be_global->impl_class_suffix () << " (void);";
-
-
- // Generate code for elements in the scope (e.g., operations).
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ih::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
-
- // Generate the code for the members of the derived classes.
- int status =
- node->traverse_inheritance_graph (
- be_visitor_interface_ih::method_helper,
- os
- );
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_tie_sh_ss::"
- "visit_interface - "
- "traversal of inhertance graph failed\n"),
- -1);
- }
-
-
- *os << be_uidt_nl
- << "};" << be_nl << be_nl;
-
- return 0;
-}
-
-
-// Helper method to generate members within the scope of the base classes.
-int
-be_visitor_interface_ih::method_helper (be_interface *derived,
- be_interface *node,
- TAO_OutStream *os)
-{
-
- if (strcmp (derived->flat_name (), node->flat_name ()) != 0)
- {
- be_visitor_context ctx;
- ctx.state (TAO_CodeGen::TAO_ROOT_IH);
- ctx.interface (derived);
- ctx.stream (os);
- be_visitor_interface_ih visitor (&ctx);
-
- if (visitor.visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_is::"
- "method_helper\n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp
deleted file mode 100644
index a7579c1a921..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp
+++ /dev/null
@@ -1,196 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface_is.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the implementation skeletons file.
-//
-// = AUTHOR
-// Yamuna Krishnamurthy (yamuna@cs.wustl.edu)
-//
-// ============================================================================
-
-// ************************************************************
-// Interface visitor for implementation skeletons.
-// ************************************************************
-
-ACE_RCSID (be_visitor_interface,
- interface_is,
- "$Id$")
-
-be_visitor_interface_is::be_visitor_interface_is (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_is::~be_visitor_interface_is (void)
-{
-}
-
-int
-be_visitor_interface_is::visit_interface (be_interface *node)
-{
- if (node->impl_skel_gen () || node->imported () || node->is_abstract ())
- {
- return 0;
- }
-
- this->ctx_->interface (node);
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate the skeleton class name.
-
- if (be_global->gen_impl_debug_info ())
- {
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
- }
-
- *os << "// Implementation skeleton constructor" << be_nl;
-
- // Find if we are at the top scope or inside some module.
- *os << be_global->impl_class_prefix () << node->flat_name ()
- << be_global->impl_class_suffix () <<"::"
- << be_global->impl_class_prefix () << node->flat_name ()
- << be_global->impl_class_suffix ()
- << " (void)" << be_nl;
-
- *os << "{" << be_nl
- << "}" << be_nl << be_nl;
-
- os->indent ();
- *os << "// Implementation skeleton destructor" << be_nl;
-
- *os << be_global->impl_class_prefix () << node->flat_name ()
- << be_global->impl_class_suffix () <<"::~"
- << be_global->impl_class_prefix () << node->flat_name ()
- << be_global->impl_class_suffix ()
- << " (void)" << be_nl;
-
- *os << "{" <<be_nl;
- *os << "}" << be_nl << be_nl;
-
- if (be_global->gen_copy_ctor () && !node->is_local ())
- {
- *os << "//Implementation Skeleton Copy Constructor" << be_nl;
-
- *os << be_global->impl_class_prefix () << node->flat_name ()
- << be_global->impl_class_suffix () <<"::"
- << be_global->impl_class_prefix () << node->flat_name ()
- << be_global->impl_class_suffix () << " (const "
- << be_global->impl_class_prefix () << node->flat_name ()
- << be_global->impl_class_suffix () << "& rhs)" << be_idt_nl
- << ": TAO_Abstract_ServantBase (rhs)," << be_nl
- << " TAO_ServantBase (rhs)";
-
- if (node->traverse_inheritance_graph (be_interface::copy_ctor_helper,
- os)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_is::visit_interface - "
- " copy ctor generation failed\n"),
- -1);
- }
-
- if (!node->is_local ())
- {
- *os << "," << be_nl;
-
- if (node->is_nested ())
- {
- be_decl *scope;
- scope = be_scope::narrow_from_scope (node->defined_in ())->decl ();
-
- *os << " POA_" << scope->name () << "::"
- << node->local_name () << " (rhs)";
- }
- else
- {
- *os << " " << node->full_skel_name () << " (rhs)";
- }
- }
-
- *os << be_uidt_nl
- << "{" << be_nl
- << "}" << be_nl << be_uidt_nl;
- }
-
- if (be_global->gen_assign_op ())
- {
- *os << "//Implementation Skeleton Copy Assignment" << be_nl;
-
- *os << be_global->impl_class_prefix () << node->flat_name ()
- << be_global->impl_class_suffix () << "& "
- << be_global->impl_class_prefix () << node->flat_name ()
- << be_global->impl_class_suffix () << "::operator=(const "
- << be_global->impl_class_prefix () << node->flat_name ()
- << be_global->impl_class_suffix () << "& t)" <<be_idt_nl
- << "{" << be_idt_nl
- << "return *this;" << be_uidt_nl
- << "}" << be_nl << be_uidt_nl;
- }
-
- // Generate code for elements in the scope (e.g., operations).
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- int status =
- node->traverse_inheritance_graph (
- be_visitor_interface_is::method_helper,
- os
- );
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_is::"
- "visit_interface - "
- "traversal of inhertance graph failed\n"),
- -1);
- }
-
- return 0;
-}
-
-
-// Helper method to generate the members in the scope of the base classes.
-int
-be_visitor_interface_is::method_helper (be_interface *derived,
- be_interface *node,
- TAO_OutStream *os)
-{
- if (ACE_OS::strcmp (derived->flat_name (), node->flat_name ()) != 0)
- {
- be_visitor_context ctx;
- ctx.state (TAO_CodeGen::TAO_ROOT_IS);
- ctx.interface (derived);
- ctx.stream (os);
- be_visitor_interface_is visitor (&ctx);
-
- if (visitor.visit_scope (node) == -1)
-
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_is::"
- "method_helper\n"),
- -1);
- }
-
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
deleted file mode 100644
index 82a0472a7ed..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
+++ /dev/null
@@ -1,406 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the server header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- interface_sh,
- "$Id$")
-
-// ************************************************************
-// Interface visitor for server header.
-// ************************************************************
-
-be_visitor_interface_sh::be_visitor_interface_sh (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_sh::~be_visitor_interface_sh (void)
-{
-}
-
-int
-be_visitor_interface_sh::visit_interface (be_interface *node)
-{
- if (node->srv_hdr_gen ()
- || node->imported ()
- || node->is_abstract ())
- {
- return 0;
- }
-
- // If this node is a AMH-RH node, then generate code for it
- if (node->is_local ())
- {
- if (this->is_amh_rh_node (node))
- {
- // Create amh_rh_visitors.
- be_visitor_amh_rh_interface_sh amh_rh_intf (this->ctx_);
- amh_rh_intf.visit_interface (node);
- }
-
- return 0;
- }
-
- if (this->generate_amh_classes (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_sh::"
- "visit_interface - "
- "codegen for AMH classes failed\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- ACE_CString class_name;
-
- // We shall have a POA_ prefix only if we are at the topmost level.
- if (!node->is_nested ())
- {
- // We are outermost.
- class_name += "POA_";
- class_name += node->local_name ();
- }
- else
- {
- class_name += node->local_name ();
- }
-
- *os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Generate the skeleton class name.
- *os << be_nl << be_nl
- << "class " << class_name.c_str () << ";" << be_nl;
-
- // Generate the _ptr declaration.
- *os << "typedef " << class_name.c_str () << " *" << class_name.c_str ()
- << "_ptr;";
-
-
- if (be_global->gen_direct_collocation ())
- {
- *os << be_nl << be_nl
- << "class " << node->direct_proxy_impl_name () << ";" << be_nl
- << "class " << node->strategized_proxy_broker_name () << ";";
- }
-
- // Now generate the class definition.
- *os << be_nl << be_nl
- << "class " << be_global->skel_export_macro ()
- << " " << class_name.c_str () << be_idt_nl << ": " << be_idt;
-
- long n_parents = node->n_inherits ();
- AST_Interface *parent = 0;
- int has_concrete_parent = 0;
-
- for (int i = 0; i < n_parents; ++i)
- {
- parent = node->inherits ()[i];
-
- if (parent->is_abstract ())
- {
- continue;
- }
-
- if (has_concrete_parent == 1)
- {
- *os << "," << be_nl;
- }
-
- *os << "public virtual " << "POA_"
- << parent->name ();
-
- has_concrete_parent = 1;
- }
-
- if (has_concrete_parent == 0)
- {
- // We don't inherit from another user defined object, hence our
- // base class is the ServantBase class.
- *os << "public virtual PortableServer::ServantBase";
- }
-
- *os << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "protected:" << be_idt_nl;
-
- // Default constructor.
- *os << class_name.c_str () << " (void);" << be_uidt_nl << be_nl
- << "public:" << be_idt_nl;
-
- // Some useful typedefs.
- *os << "// Useful for template programming." << be_nl
- << "typedef ::" << node->name () << " _stub_type;" << be_nl
- << "typedef ::" << node->name () << "_ptr _stub_ptr_type;" << be_nl
- << "typedef ::" << node->name () << "_var _stub_var_type;"
- << be_nl << be_nl;
-
- // Copy constructor and destructor.
- *os << class_name.c_str () << " (const "
- << class_name.c_str () << "& rhs);" << be_nl
- << "virtual ~" << class_name.c_str () << " (void);" << be_nl << be_nl;
-
- if (node->is_event_consumer ())
- {
- *os << "// Default implementation of CIAO-specific operation," << be_nl
- << "// overridden in derived class generated by the CIDL compiler."
- << be_nl
- << "virtual ::CORBA::Boolean ciao_is_substitutable ("
- << be_idt << be_idt_nl
- << "const char *event_repo_id" << env_dflts << be_uidt_nl
- << ")" << be_nl
- << "ACE_THROW_SPEC (( ::CORBA::SystemException));"
- << be_uidt_nl << be_nl;
- }
-
- // _is_a
- *os << "virtual ::CORBA::Boolean _is_a (" << be_idt << be_idt_nl
- << "const char* logical_type_id" << env_dflts << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add a skeleton for our _is_a method.
- *os << "static void _is_a_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & req," << be_nl
- << "void * servant_upcall," << be_nl
- << "void * servant" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add a skeleton for our _non_existent method.
- *os << "static void _non_existent_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & req," << be_nl
- << "void * servant_upcall," << be_nl
- << "void * servant" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add a skeleton for our _interface method.
- *os << "static void _interface_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & req," << be_nl
- << "void * servant_upcall," << be_nl
- << "void * servant" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add a skeleton for our _component method.
- *os << "static void _component_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & req," << be_nl
- << "void * servant_upcall," << be_nl
- << "void * servant" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Add a skeleton for our _repository_id method.
- *os << "static void _repository_id_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & req," << be_nl
- << "void * servant_upcall," << be_nl
- << "void * servant" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
-
- // Add the dispatch method.
- *os << "virtual void _dispatch (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & req," << be_nl
- << "void * servant_upcall" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- this->this_method (node);
-
- // The _interface_repository_id method.
- *os << be_nl
- << "virtual const char* _interface_repository_id "
- << "(void) const;";
-
- // Generate code for elements in the scope (e.g., operations).
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_sh::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // Generate skeletons for operations of our base classes. These
- // skeletons just cast the pointer to the appropriate type
- // before invoking the call.
- int status =
- node->traverse_inheritance_graph (
- be_interface::gen_skel_helper,
- os
- );
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_sh::"
- "visit_interface - "
- "inheritance graph traversal failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << "};";
-
- be_visitor_context ctx (*this->ctx_);
-
- if (be_global->gen_direct_collocation ())
- {
- ctx = *this->ctx_;
- // Generate strategized proxy broker.
- be_visitor_interface_strategized_proxy_broker_sh ispb_visitor (&ctx);
-
- if (node->accept (&ispb_visitor) == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "be_visitor_interface_sh::"
- "visit_interface - "
- "codegen for strategized proxy broker class failed\n"
- ),
- -1
- );
- }
- }
-
- ctx = *this->ctx_;
-
- // Generate the collocated class.
-
- ctx = *this->ctx_;
-
- if (be_global->gen_direct_collocation ())
- {
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH);
- be_visitor_interface_direct_proxy_impl_sh idpi_visitor (&ctx);
-
- if (node->accept (&idpi_visitor) == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "be_visitor_interface_sh::"
- "visit_interface - "
- "codegen for direct collocated class failed\n"
- ),
- -1
- );
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_interface_sh::gen_abstract_ops_helper (
- be_interface *node,
- be_interface *base,
- TAO_OutStream *os
- )
-{
- if (!base->is_abstract ())
- {
- return 0;
- }
-
- AST_Decl *d = 0;
- be_visitor_context ctx;
- ctx.stream (os);
- ctx.state (TAO_CodeGen::TAO_ROOT_SH);
-
- for (UTL_ScopeActiveIterator si (base, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- d = si.item ();
-
- if (d == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_sh::"
- "gen_abstract_ops_helper - "
- "bad node in this scope\n"),
- -1);
- }
-
- UTL_ScopedName item_new_name (d->local_name (),
- 0);
-
- if (d->node_type () == AST_Decl::NT_op)
- {
- be_operation *op = be_operation::narrow_from_decl (d);
- be_visitor_operation_sh op_visitor (&ctx);
- op_visitor.visit_operation (op);
- }
- else if (d->node_type () == AST_Decl::NT_attr)
- {
- AST_Attribute *attr = AST_Attribute::narrow_from_decl (d);
- be_attribute new_attr (attr->readonly (),
- attr->field_type (),
- &item_new_name,
- attr->is_local (),
- attr->is_abstract ());
- new_attr.set_defined_in (node);
-
- UTL_ExceptList *get_exceptions = attr->get_get_exceptions ();
-
- if (0 != get_exceptions)
- {
- new_attr.be_add_get_exceptions (get_exceptions->copy ());
- }
-
- UTL_ExceptList *set_exceptions = attr->get_set_exceptions ();
-
- if (0 != set_exceptions)
- {
- new_attr.be_add_set_exceptions (set_exceptions->copy ());
- }
-
- be_visitor_attribute attr_visitor (&ctx);
- attr_visitor.visit_attribute (&new_attr);
- ctx.attribute (0);
- new_attr.destroy ();
- }
- }
-
- return 0;
-}
-
-void
-be_visitor_interface_sh::this_method (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Print out the _this() method.
- *os << "::" << node->full_name () << " *_this (" << be_idt << be_idt_nl
- << env_dflts << be_uidt_nl
- << ");" << be_uidt << be_nl;
-}
-
-int
-be_visitor_interface_sh::generate_amh_classes (be_interface *node)
-{
- // We have to check for any abstract ancestor until AMH is integrated
- // with abstract interfaces. If the node itself is abstract, this
- // visitor would not be created.
- if (be_global->gen_amh_classes () && !node->has_mixed_parentage ())
- {
- be_visitor_amh_interface_sh amh_intf (this->ctx_);
- return amh_intf.visit_interface (node);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp
deleted file mode 100644
index 1f140530861..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface_si.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the server inline file
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- interface_si,
- "$Id$")
-
-
-// ************************************************************************
-// Interface visitor for server inline
-// ************************************************************************
-
-be_visitor_interface_si::be_visitor_interface_si (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_si::~be_visitor_interface_si (void)
-{
-}
-
-int
-be_visitor_interface_si::visit_interface (be_interface *node)
-{
- if (node->srv_inline_gen ()
- || node->imported ()
- || node->is_local ()
- || node->is_abstract ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Determine if we are in some form of a multiple inheritance.
- int status =
- node->traverse_inheritance_graph (be_interface::in_mult_inheritance_helper,
- 0);
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_si::visit_interface "
- "error determining mult inheritance\n"),
- -1);
- }
-
- // Generate skeletons for operations of our base classes. These skeletons
- // just cast the pointer to the appropriate type before invoking the
- // call. Hence we generate these in the inline file.
- status = node->traverse_inheritance_graph (be_interface::gen_skel_helper,
- os);
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_si::"
- "visit_interface - "
- "codegen for base class skeletons failed\n"),
- -1);
- }
-
- if (this->generate_amh_classes (node) == -1)
- {
- return -1;
- }
-
- if (be_global->gen_direct_collocation ())
- {
- status =
- node->traverse_inheritance_graph (
- be_interface::gen_colloc_op_defn_helper,
- os
- );
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_si::"
- "visit_interface - "
- "codegen for collocated base class "
- "skeletons failed\n"),
- -1);
- }
- }
-
- if (be_global->gen_tie_classes ())
- {
- // Generate the TIE class.
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_ROOT_TIE_SI);
- ctx.stream (tao_cg->server_template_inline ());
- be_visitor_interface_tie_si visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_sh::"
- "visit_interface - "
- "codegen for TIE class failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_interface_si::generate_amh_classes (be_interface *node)
-{
- // We have to check for an abstract ancestor until AMH is integrated
- // with abstract interfaces. If the node itself is abstract, this
- // visitor would not be created.
- if (be_global->gen_amh_classes () && !node->has_mixed_parentage ())
- {
- be_visitor_amh_interface_si amh_intf (this->ctx_);
- return amh_intf.visit_interface (node);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
deleted file mode 100644
index 7b52627a051..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
+++ /dev/null
@@ -1,1079 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the server skeletons file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "global_extern.h"
-#include "ast_generator.h"
-#include "ast_string.h"
-
-
-ACE_RCSID (be_visitor_interface,
- interface_ss,
- "$Id$")
-
-
-// ************************************************************
-// Interface visitor for server skeletons.
-// ************************************************************
-
-be_visitor_interface_ss::be_visitor_interface_ss (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_ss::~be_visitor_interface_ss (void)
-{
-}
-
-int
-be_visitor_interface_ss::visit_interface (be_interface *node)
-{
- if (node->srv_skel_gen () || node->imported () || node->is_abstract ())
- {
- return 0;
- }
-
- if (node->is_local ())
- {
- if (this->is_amh_rh_node (node))
- {
- // Create amh_rh_visitors.
- be_visitor_amh_rh_interface_ss amh_rh_ss_intf (this->ctx_);
- amh_rh_ss_intf.visit_interface (node);
- }
-
- return 0;
- }
-
- if (this->generate_amh_classes (node) == -1)
- {
- return -1;
- }
-
- ACE_CString full_skel_name_holder =
- this->generate_full_skel_name (node);
-
- const char *full_skel_name = full_skel_name_holder.c_str ();
-
- ACE_CString flat_name_holder =
- this->generate_flat_name (node);
-
- const char *flat_name = flat_name_holder.c_str ();
-
- int status = node->gen_operation_table (flat_name,
- full_skel_name);
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss::"
- "visit_interface - "
- "codegen for operation table failed\n"),
- -1);
- }
-
- if (this->generate_proxy_classes (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss::"
- "visit_interface - "
- "codegen for proxy classes\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Find if we are at the top scope or inside some module,
- // pre-compute the prefix that must be added to the local name in
- // each case.
- const char *local_name_prefix = "";
-
- if (!node->is_nested ())
- {
- local_name_prefix = "POA_";
- }
-
- ACE_CString node_local_name_holder =
- this->generate_local_name (node);
-
- const char *node_local_name = node_local_name_holder.c_str ();
-
- *os << full_skel_name << "::"
- << local_name_prefix << node_local_name
- << " (void)" << be_idt_nl;
-
- *os << ": TAO_ServantBase ()" << be_uidt_nl;
-
- // Default constructor body.
- *os << "{" << be_idt_nl
- << "this->optable_ = &tao_" << flat_name << "_optable;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // find if we are at the top scope or inside some module
- *os << full_skel_name << "::"
- << local_name_prefix << node_local_name << " ("
- << "const " << local_name_prefix << node_local_name << "& rhs)";
-
- *os << be_idt_nl
- << ": TAO_Abstract_ServantBase (rhs)," << be_nl
- << " TAO_ServantBase (rhs)";
-
- if (this->generate_copy_ctor (node, os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss::visit_interface - "
- " copy ctor generation failed\n"),
- -1);
- }
-
- *os << be_uidt_nl
- << "{" << be_nl
- << "}" << be_nl << be_nl;
-
- *os << full_skel_name << "::~"
- << local_name_prefix << node_local_name
- << " (void)" << be_nl;
- *os << "{" << be_nl;
- *os << "}";
-
- // Generate code for elements in the scope (e.g., operations).
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Generate code for the _is_a skeleton.
- {
- be_predefined_type rt (AST_PredefinedType::PT_boolean, 0);
- // @@ Cheat a little by placing a space before the operation name
- // to prevent the IDL compiler from interpreting the leading
- // underscore as an IDL escape.
- Identifier op_name (" _is_a");
- UTL_ScopedName scoped_name (&op_name, 0);
- be_operation is_a (&rt,
- AST_Operation::OP_noflags,
- &scoped_name,
- node->is_local (),
- node->is_abstract ());
- is_a.set_defined_in (node);
-
- auto_ptr<AST_String> s (
- idl_global->gen ()->create_string (
- idl_global->gen ()->create_expr ((idl_uns_long) 0,
- AST_Expression::EV_ulong)));
-
- Identifier arg_name ("repository_id");
- UTL_ScopedName scoped_arg_name (&arg_name, 0);
- AST_Argument *repository_id =
- idl_global->gen ()->create_argument (AST_Argument::dir_IN,
- s.get (),
- &scoped_arg_name);
-
- is_a.be_add_argument (repository_id);
-
- ACE_CString is_a_upcall_command_name =
- "_is_a_" + ACE_CString (node_local_name) + "_Upcall_Command" ;
-
- be_visitor_operation_upcall_command_ss upcall_command_visitor (this->ctx_);
- upcall_command_visitor.visit (&is_a,
- full_skel_name,
- is_a_upcall_command_name.c_str ());
-
- *os << be_nl << be_nl
- << "void " << full_skel_name
- << "::_is_a_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & server_request, " << be_nl
- << "void * TAO_INTERCEPTOR (servant_upcall)," << be_nl
- << "void * servant" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl;
- *os << "{" << be_idt;
-
- // Generate exception list.
- be_visitor_operation_exceptlist_ss exception_list (this->ctx_);
- exception_list.visit_operation (&is_a);
-
- be_visitor_operation_ss op_visitor (this->ctx_);
-
- *os << "TAO::SArg_Traits< ";
-
- op_visitor.gen_arg_template_param_name (&is_a,
- &rt,
- os);
-
- *os << ">::ret_val retval;";
-
- op_visitor.gen_skel_body_arglist (&is_a,
- os);
-
- *os << be_nl << be_nl
- << "TAO::Argument * const args[] =" << be_idt_nl
- << "{" << be_idt_nl
- << "&retval," << be_nl
- << "&_tao_" << arg_name.get_string ()
- << be_uidt_nl
- << "};" << be_uidt_nl << be_nl;
-
- *os << "static size_t const nargs = 2;" << be_nl << be_nl;
-
- // Get the right object implementation.
- *os << full_skel_name << " * const impl =" << be_idt_nl
- << "static_cast<"
- << full_skel_name << " *> (servant);"
- << be_uidt_nl;
-
- // Upcall_Command instantiation.
- *os << be_nl
- << is_a_upcall_command_name.c_str() << " command (" << be_idt_nl
- << "impl";
-
- if (!is_a.void_return_type ()
- || is_a.argument_count () > 0)
- {
- // server_request.operation_details () will be non-zero in the
- // thru-POA collocation case. Use them if available.
- *os << "," << be_nl;
-
- if (be_global->gen_thru_poa_collocation ())
- *os << "server_request.operation_details ()," << be_nl;
-
- *os << "args";
- }
-
- *os << ");" << be_uidt_nl << be_nl;
-
- *os << "TAO::Upcall_Wrapper upcall_wrapper;" << be_nl
- << "upcall_wrapper.upcall (server_request" << be_nl
- << " , args" << be_nl
- << " , nargs" << be_nl
- << " , command"
- << "\n#if TAO_HAS_INTERCEPTORS == 1" << be_nl
- << " , servant_upcall" << be_nl
- << " , exceptions" << be_nl
- << " , nexceptions"
- << "\n#endif /* TAO_HAS_INTERCEPTORS == 1 */" << be_nl
- << " "
- << (be_global->use_raw_throw () ? "" : "ACE_ENV_ARG_PARAMETER")
- << ");" << TAO_ACE_CHECK ();
-
- this->generate_send_reply (os);
-
- *os << be_uidt_nl
- << "}";
-
- is_a.destroy ();
- rt.destroy ();
- s.get ()->destroy ();
- }
-
- // Generate code for the _non_existent skeleton.
- {
- be_predefined_type rt (AST_PredefinedType::PT_boolean, 0);
- // @@ Cheat a little by placing a space before the operation name
- // to prevent the IDL compiler from interpreting the leading
- // underscore as an IDL escape.
- Identifier op_name (" _non_existent");
- UTL_ScopedName scoped_name (&op_name, 0);
- be_operation non_existent (&rt,
- AST_Operation::OP_noflags,
- &scoped_name,
- node->is_local (),
- node->is_abstract ());
- non_existent.set_defined_in (node);
-
- ACE_CString non_exist_upcall_command_name =
- "_non_existent_" + ACE_CString (node_local_name) + "_Upcall_Command" ;
-
- be_visitor_operation_upcall_command_ss upcall_command_visitor (this->ctx_);
- upcall_command_visitor.visit (&non_existent,
- full_skel_name,
- non_exist_upcall_command_name.c_str ());
-
- *os << be_nl << be_nl
- << "void " << full_skel_name
- << "::_non_existent_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & server_request, " << be_nl
- << "void * TAO_INTERCEPTOR (servant_upcall)," << be_nl
- << "void * servant" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl;
- *os << "{" << be_idt;
-
- // Generate exception list.
- be_visitor_operation_exceptlist_ss exception_list (this->ctx_);
- exception_list.visit_operation (&non_existent);
-
- be_visitor_operation_ss op_visitor (this->ctx_);
-
- *os << "TAO::SArg_Traits< ";
-
- op_visitor.gen_arg_template_param_name (&non_existent,
- &rt,
- os);
-
- *os << ">::ret_val retval;";
-
- op_visitor.gen_skel_body_arglist (&non_existent,
- os);
-
- *os << be_nl << be_nl
- << "TAO::Argument * const args[] =" << be_idt_nl
- << "{" << be_idt_nl
- << "&retval"
- << be_uidt_nl
- << "};" << be_uidt_nl << be_nl;
-
- *os << "static size_t const nargs = 1;" << be_nl << be_nl;
-
- // Get the right object implementation.
- *os << full_skel_name << " * const impl =" << be_idt_nl
- << "static_cast<"
- << full_skel_name << " *> (servant);"
- << be_uidt_nl;
-
- // Upcall_Command instantiation.
- *os << be_nl
- << non_exist_upcall_command_name.c_str() << " command (" << be_idt_nl
- << "impl";
-
- if (!non_existent.void_return_type ()
- || non_existent.argument_count () > 0)
- {
- // server_request.operation_details () will be non-zero in the
- // thru-POA collocation case. Use them if available.
- *os << "," << be_nl;
-
- if (be_global->gen_thru_poa_collocation ())
- *os << "server_request.operation_details ()," << be_nl;
-
- *os << "args";
- }
-
- *os << ");" << be_uidt_nl << be_nl;
-
- *os << "TAO::Upcall_Wrapper upcall_wrapper;" << be_nl
- << "upcall_wrapper.upcall (server_request" << be_nl
- << " , args" << be_nl
- << " , nargs" << be_nl
- << " , command"
- << "\n#if TAO_HAS_INTERCEPTORS == 1" << be_nl
- << " , servant_upcall" << be_nl
- << " , exceptions" << be_nl
- << " , nexceptions"
- << "\n#endif /* TAO_HAS_INTERCEPTORS == 1 */" << be_nl
- << " "
- << (be_global->use_raw_throw () ? "" : "ACE_ENV_ARG_PARAMETER")
- << ");" << TAO_ACE_CHECK ();
-
- this->generate_send_reply (os);
-
- *os << be_uidt_nl
- << "}";
-
- non_existent.destroy ();
- rt.destroy ();
- }
-
- // Generate code for the _repository_id skeleton.
- {
- auto_ptr<AST_String> s (
- idl_global->gen ()->create_string (
- idl_global->gen ()->create_expr ((idl_uns_long) 0,
- AST_Expression::EV_ulong)));
-
- // @@ Cheat a little by placing a space before the operation name
- // to prevent the IDL compiler from interpreting the leading
- // underscore as an IDL escape.
- Identifier op_name (" _repository_id");
- UTL_ScopedName scoped_name (&op_name, 0);
- be_operation repository_id (s.get (),
- AST_Operation::OP_noflags,
- &scoped_name,
- node->is_local (),
- node->is_abstract ());
- repository_id.set_defined_in (node);
-
- ACE_CString repository_id_upcall_command_name =
- "_repository_id_" + ACE_CString (node_local_name) + "_Upcall_Command" ;
-
- be_visitor_operation_upcall_command_ss upcall_command_visitor (this->ctx_);
- upcall_command_visitor.visit (&repository_id,
- full_skel_name,
- repository_id_upcall_command_name.c_str ());
-
- *os << be_nl << be_nl
- << "void " << full_skel_name
- << "::_repository_id_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & server_request, " << be_nl
- << "void * TAO_INTERCEPTOR (servant_upcall)," << be_nl
- << "void * servant" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl;
- *os << "{" << be_idt;
-
- // Generate exception list.
- be_visitor_operation_exceptlist_ss exception_list (this->ctx_);
- exception_list.visit_operation (&repository_id);
-
- be_visitor_operation_ss op_visitor (this->ctx_);
-
- *os << "TAO::SArg_Traits< ";
-
- op_visitor.gen_arg_template_param_name (&repository_id,
- s.get (),
- os);
-
- *os << ">::ret_val retval;";
-
- op_visitor.gen_skel_body_arglist (&repository_id,
- os);
-
- *os << be_nl << be_nl
- << "TAO::Argument * const args[] =" << be_idt_nl
- << "{" << be_idt_nl
- << "&retval"
- << be_uidt_nl
- << "};" << be_uidt_nl << be_nl;
-
- *os << "static size_t const nargs = 1;" << be_nl << be_nl;
-
- // Get the right object implementation.
- *os << full_skel_name << " * const impl =" << be_idt_nl
- << "static_cast<"
- << full_skel_name << " *> (servant);"
- << be_uidt_nl;
-
- // Upcall_Command instantiation.
- *os << be_nl
- << repository_id_upcall_command_name.c_str() << " command ("
- << be_idt_nl << "impl";
-
- if (!repository_id.void_return_type ()
- || repository_id.argument_count () > 0)
- {
- // server_request.operation_details () will be non-zero in the
- // thru-POA collocation case. Use them if available.
- *os << "," << be_nl;
-
- if (be_global->gen_thru_poa_collocation ())
- *os << "server_request.operation_details ()," << be_nl;
-
- *os << "args";
- }
-
- *os << ");" << be_uidt_nl << be_nl;
-
- *os << "TAO::Upcall_Wrapper upcall_wrapper;" << be_nl
- << "upcall_wrapper.upcall (server_request" << be_nl
- << " , args" << be_nl
- << " , nargs" << be_nl
- << " , command"
- << "\n#if TAO_HAS_INTERCEPTORS == 1" << be_nl
- << " , servant_upcall" << be_nl
- << " , exceptions" << be_nl
- << " , nexceptions"
- << "\n#endif /* TAO_HAS_INTERCEPTORS == 1 */" << be_nl
- << " "
- << (be_global->use_raw_throw () ? "" : "ACE_ENV_ARG_PARAMETER")
- << ");" << TAO_ACE_CHECK ();
-
- this->generate_send_reply (os);
-
- *os << be_uidt_nl
- << "}";
-
- repository_id.destroy ();
- s.get ()->destroy ();
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl << be_nl
- << "void " << full_skel_name
- << "::_interface_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & server_request, " << be_nl
- << "void * /* servant_upcall */," << be_nl
- << "void * servant" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl;
- *os << "{" << be_idt_nl;
- *os << "TAO_IFR_Client_Adapter *_tao_adapter =" << be_idt_nl
- << "ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance ("
- << be_idt << be_idt_nl
- << "TAO_ORB_Core::ifr_client_adapter_name ()" << be_uidt_nl
- << ");" << be_uidt_nl << be_uidt_nl;
- *os << "if (_tao_adapter == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "ACE_THROW ( ::CORBA::INTF_REPOS ( ::CORBA::OMGVMCID | 1,"
- << be_nl
- << " ::CORBA::COMPLETED_NO));"
- << be_uidt_nl
- << "}" << be_uidt_nl << be_nl;
-
- // Get the right object implementation.
- *os << full_skel_name << " * const impl =" << be_idt_nl
- << "static_cast<"
- << full_skel_name << " *> (servant);"
- << be_uidt_nl;
-
- *os << "::CORBA::InterfaceDef_ptr _tao_retval = " << be_idt_nl
- << "impl->_get_interface ("
- << (be_global->use_raw_throw ()
- ? ""
- : "ACE_ENV_SINGLE_ARG_PARAMETER")
- << ");" << be_uidt
- << TAO_ACE_CHECK () << be_nl << be_nl
- << "server_request.init_reply ();" << be_nl
- << "TAO_OutputCDR &_tao_out = *server_request.outgoing ();"
- << be_nl << be_nl
- << "::CORBA::Boolean const _tao_result =" << be_idt_nl
- << "_tao_adapter->interfacedef_cdr_insert (" << be_idt << be_idt_nl
- << "_tao_out," << be_nl
- << "_tao_retval" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl << be_nl
- << "_tao_adapter->dispose (_tao_retval);" << be_nl << be_nl;
-
- *os << "if (_tao_result == false)" << be_idt_nl
- << "{" << be_idt_nl
- << "ACE_THROW ( ::CORBA::MARSHAL ());" << be_uidt_nl
- << "}" << be_uidt;
-
- this->generate_send_reply (os);
-
- *os << be_uidt_nl
- << "}";
-
-
- // Generate code for the _component skeleton.
- {
- be_predefined_type rt (AST_PredefinedType::PT_object, 0);
- // @@ Cheat a little by placing a space before the operation name
- // to prevent the IDL compiler from interpreting the leading
- // underscore as an IDL escape.
-
- // Yes, _get_component()
- Identifier op_name (" _get_component");
- UTL_ScopedName scoped_name (&op_name, 0);
- be_operation get_component (&rt,
- AST_Operation::OP_noflags,
- &scoped_name,
- node->is_local (),
- node->is_abstract ());
- get_component.set_defined_in (node);
-
- ACE_CString get_component_upcall_command_name =
- "_get_component_" + ACE_CString (node_local_name) + "_Upcall_Command" ;
-
- be_visitor_operation_upcall_command_ss upcall_command_visitor (this->ctx_);
- upcall_command_visitor.visit (&get_component,
- full_skel_name,
- get_component_upcall_command_name.c_str());
-
- *os << be_nl << be_nl
- << "void " << full_skel_name
- << "::_component_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & server_request, " << be_nl
- << "void * TAO_INTERCEPTOR (servant_upcall)," << be_nl
- << "void * servant" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl;
- *os << "{" << be_idt;
-
- // Generate exception list.
- be_visitor_operation_exceptlist_ss exception_list (this->ctx_);
- exception_list.visit_operation (&get_component);
-
- be_visitor_operation_ss operation_visitor (this->ctx_);
-
- *os << "TAO::SArg_Traits< ";
-
- operation_visitor.gen_arg_template_param_name (&get_component,
- &rt,
- os);
-
- *os << ">::ret_val retval;";
-
- *os << be_nl << be_nl
- << "TAO::Argument * const args[] =" << be_idt_nl
- << "{" << be_idt_nl
- << "&retval"
- << be_uidt_nl
- << "};" << be_uidt_nl << be_nl;
-
- *os << "static size_t const nargs = 1;" << be_nl << be_nl;
-
- // Get the right object implementation.
- *os << full_skel_name << " * const impl =" << be_idt_nl
- << "static_cast<"
- << full_skel_name << " *> (servant);"
- << be_uidt_nl;
-
- // Upcall_Command instantiation.
- *os << be_nl
- << get_component_upcall_command_name.c_str ()
- << " command (" << be_idt_nl
- << "impl";
-
- if (!get_component.void_return_type ()
- || get_component.argument_count () > 0)
- {
- // server_request.operation_details () will be non-zero in the
- // thru-POA collocation case. Use them if available.
- *os << "," << be_nl;
-
- if (be_global->gen_thru_poa_collocation ())
- *os << "server_request.operation_details ()," << be_nl;
-
- *os << "args";
- }
-
- *os << ");" << be_uidt_nl << be_nl;
-
-
- *os << "TAO::Upcall_Wrapper upcall_wrapper;" << be_nl
- << "upcall_wrapper.upcall (server_request" << be_nl
- << " , args" << be_nl
- << " , nargs" << be_nl
- << " , command"
- << "\n#if TAO_HAS_INTERCEPTORS == 1" << be_nl
- << " , servant_upcall" << be_nl
- << " , exceptions" << be_nl
- << " , nexceptions"
- << "\n#endif /* TAO_HAS_INTERCEPTORS == 1 */" << be_nl
- << " "
- << (be_global->use_raw_throw () ? "" : "ACE_ENV_ARG_PARAMETER")
- << ");" << TAO_ACE_CHECK () << be_uidt_nl
- << "}";
-
- get_component.destroy ();
- rt.destroy ();
- }
-
- // Generate code for the _is_a override.
-
- *os << be_nl << be_nl
- << "::CORBA::Boolean " << full_skel_name
- << "::_is_a (" << be_idt << be_idt_nl
- << "const char* value" << env_not << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return" << be_idt_nl
- << "(" << be_idt_nl;
-
- if (node->traverse_inheritance_graph (be_interface::is_a_helper, os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss::"
- "visit_interface - "
- "traversal of inhertance graph failed\n"),
- -1);
- }
-
- *os << "!ACE_OS::strcmp (" << be_idt << be_idt_nl
- << "value," << be_nl
- << "\"IDL:omg.org/CORBA/Object:1.0\"" << be_uidt_nl
- << ")";
-
- if (node->has_mixed_parentage ())
- {
- *os << " ||" << be_uidt_nl
- << "!ACE_OS::strcmp (" << be_idt << be_idt_nl
- << "(char *)value," << be_nl
- << "\"IDL:omg.org/CORBA/AbstractBase:1.0\"" << be_uidt_nl
- << ")";
- }
-
- *os << be_uidt << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "const char* " << full_skel_name
- << "::_interface_repository_id (void) const"
- << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return \"" << node->repoID () << "\";" << be_uidt_nl;
- *os << "}";
-
- if (node->is_event_consumer ())
- {
- *os << be_nl << be_nl
- << "::CORBA::Boolean " << full_skel_name
- << "::ciao_is_substitutable (" << be_idt << be_idt_nl
- << "const char * /* event_repo_id */" << env_not << be_uidt_nl
- << ")" << be_nl
- << "ACE_THROW_SPEC (( ::CORBA::SystemException))" << be_uidt_nl
- << "{" << be_idt_nl
- << "return true;" << be_uidt_nl
- << "}";
- }
-
- // Print out dispatch method.
- this->dispatch_method (node);
-
- this->this_method (node);
-
- return 0;
-}
-
-int
-be_visitor_interface_ss::gen_abstract_ops_helper (be_interface *node,
- be_interface *base,
- TAO_OutStream *os)
-{
- if (!base->is_abstract ())
- {
- return 0;
- }
-
- AST_Decl *d = 0;
- be_visitor_context ctx;
- ctx.stream (os);
- ctx.state (TAO_CodeGen::TAO_ROOT_SS);
-
- for (UTL_ScopeActiveIterator si (base, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- d = si.item ();
-
- if (d == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ss::"
- "gen_abstract_ops_helper - "
- "bad node in this scope\n"),
- -1);
- }
-
- AST_Decl::NodeType nt = d->node_type ();
-
- UTL_ScopedName *item_new_name = 0;
- UTL_ScopedName *new_name = 0;
-
- if (AST_Decl::NT_op == nt || AST_Decl::NT_attr == nt)
- {
- ACE_NEW_RETURN (item_new_name,
- UTL_ScopedName (d->local_name ()->copy (),
- 0),
- -1);
-
- new_name = (UTL_ScopedName *) node->name ()->copy ();
- new_name->nconc (item_new_name);
- }
- else
- {
- continue;
- }
-
- // We pass the node's is_abstract flag to the operation
- // constructor so we will get the right generated operation
- // body if we are regenerating an operation from an
- // abstract interface in a concrete interface or component.
- if (AST_Decl::NT_op == nt)
- {
- be_operation *op = be_operation::narrow_from_decl (d);
- UTL_ScopedName *old_name =
- (UTL_ScopedName *) op->name ()->copy ();
- op->set_name (new_name);
- op->set_defined_in (node);
- op->is_abstract (node->is_abstract ());
-
- be_visitor_operation_ss op_visitor (&ctx);
- op_visitor.visit_operation (op);
-
- op->set_name (old_name);
- op->set_defined_in (base);
- op->is_abstract (base->is_abstract ());
- }
- else if (AST_Decl::NT_attr == nt)
- {
- AST_Attribute *attr = AST_Attribute::narrow_from_decl (d);
- be_attribute new_attr (attr->readonly (),
- attr->field_type (),
- 0,
- attr->is_local (),
- attr->is_abstract ());
- new_attr.set_defined_in (node);
- new_attr.set_name (new_name);
-
- UTL_ExceptList *get_exceptions = attr->get_get_exceptions ();
-
- if (0 != get_exceptions)
- {
- new_attr.be_add_get_exceptions (get_exceptions->copy ());
- }
-
- UTL_ExceptList *set_exceptions = attr->get_set_exceptions ();
-
- if (0 != set_exceptions)
- {
- new_attr.be_add_set_exceptions (set_exceptions->copy ());
- }
-
- be_visitor_attribute attr_visitor (&ctx);
- attr_visitor.visit_attribute (&new_attr);
- ctx.attribute (0);
- new_attr.destroy ();
- }
- }
-
- return 0;
-}
-
-void
-be_visitor_interface_ss::this_method (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // the _this () operation.
- *os << node->full_name () << " *" << be_nl
- << node->full_skel_name ()
- << "::_this ("
- << (be_global->use_raw_throw () ? "void" : "ACE_ENV_SINGLE_ARG_DECL")
- << ")" << be_nl
- << "{" << be_idt_nl
- << "TAO_Stub *stub = this->_create_stub ("
- << (be_global->use_raw_throw () ? "" : "ACE_ENV_SINGLE_ARG_PARAMETER")
- << ");"
- << TAO_ACE_CHECK ("0") << be_nl << be_nl
- << "TAO_Stub_Auto_Ptr safe_stub (stub);" << be_nl;
-
- *os << "::CORBA::Object_ptr tmp = CORBA::Object::_nil ();"
- << be_nl << be_nl
- << "::CORBA::Boolean const _tao_opt_colloc =" << be_idt_nl
- << "stub->servant_orb_var ()->orb_core ()->"
- << "optimize_collocation_objects ();" << be_uidt_nl << be_nl
- << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
- << "tmp," << be_nl
- << "::CORBA::Object (stub, _tao_opt_colloc, this)," << be_nl
- << "0" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- *os << "::CORBA::Object_var obj = tmp;" << be_nl
- << "(void) safe_stub.release ();" << be_nl << be_nl
- << "typedef ::" << node->name () << " STUB_SCOPED_NAME;" << be_nl
- << "return" << be_idt_nl
- << "TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow ("
- << be_idt << be_idt_nl
- << "obj.in ()," << be_nl
- << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function_pointer" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}";
-}
-
-void
-be_visitor_interface_ss::generate_send_reply (TAO_OutStream *)
-{
- // no-op for regular interfaces
-}
-
-void
-be_visitor_interface_ss::dispatch_method (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "void " << node->full_skel_name ()
- << "::_dispatch (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & req," << be_nl
- << "void * servant_upcall" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl;
- *os << "{" << be_idt_nl;
- *os << "this->synchronous_upcall_dispatch (req," << be_nl
- << " servant_upcall," << be_nl
- << " this" << be_nl
- << " "
- << (be_global->use_raw_throw () ? "" : "ACE_ENV_ARG_PARAMETER")
- << ");"
- << be_uidt_nl;
- *os << "}";
-}
-
-int
-be_visitor_interface_ss::generate_amh_classes (be_interface *node)
-{
- // We have to check for any abstract ancestor until AMH is integrated
- // with abstract interfaces. If the node itself is abstract, this
- // visitor would not be created.
- if (be_global->gen_amh_classes () && !node->has_mixed_parentage ())
- {
- be_visitor_amh_interface_ss amh_intf (this->ctx_);
- return amh_intf.visit_interface (node);
- }
-
- return 0;
-}
-
-int
-be_visitor_interface_ss::generate_proxy_classes (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor_context ctx = *this->ctx_;
-
- // Strategized Proxy Broker Implementation.
- if (be_global->gen_thru_poa_collocation ()
- || be_global->gen_direct_collocation ())
- {
-
- // Do not generate strategized proxy broker for thru-POA case.
- // It isn't necessary.
- if (be_global->gen_direct_collocation ())
- {
- ctx = *this->ctx_;
- be_visitor_interface_strategized_proxy_broker_ss ispb_visitor (&ctx);
-
- if (node->accept (&ispb_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss::"
- "generate_proxy_classes - "
- "codegen for Base Proxy Broker "
- "class failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Proxy Broker Factory Function.
- *os << be_nl << be_nl
- << "TAO::Collocation_Proxy_Broker *" << be_nl
- << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function ( ::CORBA::Object_ptr)" << be_nl
- << "{" << be_idt_nl
- << "return";
-
- if (be_global->gen_direct_collocation ())
- {
- *os << be_idt_nl
- << "::"
- << node->full_strategized_proxy_broker_name ()
- << "::" <<"the"
- << node->strategized_proxy_broker_name ()
- << " ();" << be_uidt;
- }
- else
- {
- // @@ HACK!
-
- // Dummy function pointer for the thru-POA case. It isn't
- // used to call a function but it is used to determine if
- // collocation is available.
-
- // @todo Change the way TAO's ORB_Core detects collocation,
- // or at least augment it so that we don't have to
- // resort this hack.
- *os << " reinterpret_cast<TAO::Collocation_Proxy_Broker *> (0xdead);"
- << " // Dummy";
- }
-
- *os << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Proxy Broker Function Pointer Initializer.
- *os << "int" << be_nl
- << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_Initializer (size_t)" << be_nl
- << "{" << be_idt_nl
- << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function_pointer = "
- << be_idt_nl
- << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function;"
- << be_uidt_nl
- << be_nl
- << "return 0;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "static int" << be_nl
- << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Stub_Factory_Initializer_Scarecrow =" << be_idt_nl
- << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_Initializer (" << be_idt << be_idt_nl
- << "reinterpret_cast<size_t> ("
- << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_Initializer)" << be_uidt_nl
- << ");" << be_uidt << be_uidt;
- }
-
- if (be_global->gen_direct_collocation ())
- {
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS);
- be_visitor_interface_direct_proxy_impl_ss idpi_visitor (&ctx);
-
- if (node->accept (&idpi_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_cs::"
- "generate_proxy_classes - "
- "codegen for Base Proxy Broker class failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_interface_ss::generate_copy_ctor (be_interface *node,
- TAO_OutStream *os)
-{
- return node->traverse_inheritance_graph (be_interface::copy_ctor_helper,
- os);
-}
-
-ACE_CString
-be_visitor_interface_ss::generate_flat_name (be_interface *node)
-{
- return ACE_CString (node->flat_name ());
-}
-
-ACE_CString
-be_visitor_interface_ss::generate_local_name (be_interface *node)
-{
- return ACE_CString (node->local_name ());
-}
-
-ACE_CString
-be_visitor_interface_ss::generate_full_skel_name (be_interface *node)
-{
- return ACE_CString (node->full_skel_name ());
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/proxy_brokers_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/proxy_brokers_ch.cpp
deleted file mode 100644
index 8b4a8415806..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/proxy_brokers_ch.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// $Id$
-//
-
-ACE_RCSID (be_visitor_interface,
- proxy_brokers_ch,
- "$Id$")
-
-be_visitor_interface_proxy_brokers_ch::be_visitor_interface_proxy_brokers_ch (
- be_visitor_context *ctx
- )
- : be_visitor_interface (ctx)
-{
- // No-Op.
-}
-
-
-be_visitor_interface_proxy_brokers_ch::~be_visitor_interface_proxy_brokers_ch (
- void
- )
-{
- // No-Op.
-}
-
-int
-be_visitor_interface_proxy_brokers_ch::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate Guards.
-
- // Generate the class declaration.
- *os << "// The Proxy Brokers are used by each interface to get" << be_nl
- << "// the right proxy for performing a call. In the new " << be_nl
- << "// collocation scheme, the proxy to be used can vary on" << be_nl
- << "// a call by call basis." << be_nl;
-
- // Code Generation for the proxy brokers base class.
- be_visitor_context ctx (*this->ctx_);
- be_visitor_interface_base_proxy_broker_ch bpb_visitor (&ctx);
-
- if (node->accept (&bpb_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ch::"
- "visit_interface - "
- "codegen for Base Proxy Broker class failed\n"),
- -1);
- }
-
- ctx = *this->ctx_;
- be_visitor_interface_remote_proxy_broker_ch rpb_visitor (&ctx);
-
- if (node->accept (&rpb_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ch::"
- "visit_interface - "
- "codegen for Remote Proxy Broker class failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_interface_proxy_brokers_ch::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/proxy_impls_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/proxy_impls_ch.cpp
deleted file mode 100644
index ae043a1c56e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/proxy_impls_ch.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// $Id$
-//
-
-ACE_RCSID (be_visitor_interface,
- base_proxy_broker_impl_ch,
- "$Id$")
-
-be_visitor_interface_proxy_impls_ch::be_visitor_interface_proxy_impls_ch (
- be_visitor_context *ctx
- )
- : be_visitor_interface (ctx)
-{
- // No-Op.
-}
-
-
-be_visitor_interface_proxy_impls_ch::~be_visitor_interface_proxy_impls_ch (
- void
- )
-{
- // No-Op.
-}
-
-int
-be_visitor_interface_proxy_impls_ch::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate Guards.
- *os << "// The Proxy Implementations are used by each interface to"
- << be_nl
- << "// perform a call. Each different implementation encapsulates"
- << be_nl
- << "// an invocation logic." << be_nl << be_nl;
-
- // Code Generation for the proxy imlpementations base class.
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH);
- be_visitor_interface_base_proxy_impl_ch bpi_visitor (&ctx);
-
- if (node->accept (&bpi_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_proxy_impls_ch::"
- "visit_interface - "
- "codegen for Base Proxy Impl. class failed\n"),
- -1);
- }
-
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH);
- be_visitor_interface_remote_proxy_impl_ch rpi_visitor (&ctx);
-
- if (node->accept (&rpi_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_proxy_impls_ch::"
- "visit_interface - "
- "codegen for Remote Proxy Broker class failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_interface_proxy_impls_ch::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp
deleted file mode 100644
index 12c8f672665..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// $Id$
-//
-
-ACE_RCSID (be_visitor_interface,
- be_visitor_interface_remote_proxy_broker_ch,
- "$Id$")
-
-be_visitor_interface_remote_proxy_broker_ch::
-be_visitor_interface_remote_proxy_broker_ch (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
- // No-Op.
-}
-
-
-be_visitor_interface_remote_proxy_broker_ch::
-~be_visitor_interface_remote_proxy_broker_ch (void)
-{
- // No-Op.
-}
-
-int
-be_visitor_interface_remote_proxy_broker_ch::visit_interface (
- be_interface *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate the class declaration.
- os->indent ();
-
- *os << be_nl
- << "///////////////////////////////////////////////////////////////////////"
- << be_nl
- << "// Remote Proxy Broker Declaration " << be_nl
- << "//" << be_nl << be_nl;
-
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "class " << be_global->stub_export_macro () << " "
- << node->remote_proxy_broker_name () << be_idt_nl
- << ": public virtual "
- << node->base_proxy_broker_name () << be_uidt_nl
- << "{" << be_nl
- << "public: " << be_idt_nl;
-
- // Constructor
- *os << node->remote_proxy_broker_name () << " (void);" << be_nl << be_nl;
-
- // Destructor
- *os << "virtual ~" << node->remote_proxy_broker_name () << " (void);"
- << be_nl << be_nl;
-
- // Accessor Method
- *os << "virtual " << node->base_proxy_impl_name () << " &"
- << "select_proxy ("
- << be_idt << be_idt_nl;
-
- *os << node->local_name () << " *object" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_uidt_nl;
-
- *os << "private:" << be_idt_nl
- << node->remote_proxy_impl_name () << " remote_proxy_impl_;"
- << be_uidt_nl << be_nl;
-
- *os << "public:" << be_idt_nl;
-
- // Factory Member Function declaration.
- *os << "// This member function is used to get an handle to the "
- << "unique instance" << be_nl
- << "// of the Remote Proxy Broker that is available for a given"
- << be_nl
- << "// interface." << be_nl
- << "static " << node->remote_proxy_broker_name ()
- << " *the" << node->remote_proxy_broker_name ()
- << " (void);" << be_uidt_nl;
-
- *os << "};" << be_nl << be_nl;
-
- *os << "//" << be_nl
- << "// End Remote Proxy Broker Declaration " << be_nl
- << "///////////////////////////////////////////////////////////////////////";
-
- return 0;
-}
-
-int be_visitor_interface_remote_proxy_broker_ch::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_cs.cpp
deleted file mode 100644
index 30d5a00dd13..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_cs.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// $Id$
-//
-
-ACE_RCSID (be_visitor_interface,
- remote_proxy_broker_cs,
- "$Id$")
-
-be_visitor_interface_remote_proxy_broker_cs::
-be_visitor_interface_remote_proxy_broker_cs (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
- // No-Op.
-}
-
-
-be_visitor_interface_remote_proxy_broker_cs::
-~be_visitor_interface_remote_proxy_broker_cs (void)
-{
- // No-Op.
-}
-
-int
-be_visitor_interface_remote_proxy_broker_cs::visit_interface (
- be_interface *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl;
-
- // Generate the class declaration.
- os->indent ();
-
- *os << be_nl
- << "///////////////////////////////////////////////////////////////////////"
- << be_nl
- << "// Remote & Base Proxy Broker Implementation" << be_nl
- << "//" << be_nl << be_nl;
-
- *os << node->full_base_proxy_broker_name () << "::"
- << node->base_proxy_broker_name () << " (void)" << be_nl
- << "{" << be_nl
- << "}" << be_nl << be_nl;
-
- *os << node->full_base_proxy_broker_name () << "::~"
- << node->base_proxy_broker_name () << " (void)" << be_nl
- << "{" << be_nl
- << "}" << be_nl << be_nl;
-
- // Generate the proxy broker factory function pointer definition.
- *os << node->full_base_proxy_broker_name () << " * (*"
- << node->flat_client_enclosing_scope ()
- << node->base_proxy_broker_name ()
- << "_Factory_function_pointer) ("
- << be_idt << be_idt_nl
- << "::CORBA::Object_ptr obj" << be_uidt_nl
- << ") = 0;" << be_uidt_nl << be_nl;
-
- *os << "// Factory Member function Implementation." << be_nl
- << node->full_remote_proxy_broker_name () << " *" << be_nl
- << node->full_remote_proxy_broker_name () << "::the"
- << node->remote_proxy_broker_name ()
- << " (void)" << be_nl
- << "{" << be_idt_nl
- << "static ::" << node->full_remote_proxy_broker_name ()
- << " remote_proxy_broker;" << be_nl
- << "return &remote_proxy_broker;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Ctor
- *os << node->full_remote_proxy_broker_name () << "::"
- << node->remote_proxy_broker_name () << " (void)" << be_nl
- << "{" << be_nl
- << "}" << be_nl << be_nl;
-
- // Dtor
- *os << node->full_remote_proxy_broker_name () << "::~"
- << node->remote_proxy_broker_name () << " (void)" << be_nl
- << "{" << be_nl
- << "}" << be_nl << be_nl;
-
- *os << node->full_base_proxy_impl_name () << "&" << be_nl
- <<node->full_remote_proxy_broker_name () << "::"
- << "select_proxy (" << be_idt << be_idt_nl
- << "::" << node->full_name () << " *" << env_not << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl // idt = 1
- << "return this->remote_proxy_impl_;"
- << be_uidt_nl << "}";
-
- *os << be_nl << be_nl
- << "//" << be_nl
- << "// End Remote & Base Proxy Broker Implementation" << be_nl
- << "///////////////////////////////////////////////////////////////////////";
-
- return 0;
-}
-
-int be_visitor_interface_remote_proxy_broker_cs::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_ch.cpp
deleted file mode 100644
index 6c83426fdee..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_ch.cpp
+++ /dev/null
@@ -1,169 +0,0 @@
-//
-// $Id$
-//
-
-ACE_RCSID (be_visitor_interface,
- remote_proxy_impl_ch,
- "$Id$")
-
-be_visitor_interface_remote_proxy_impl_ch::
-be_visitor_interface_remote_proxy_impl_ch (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
- // No-Op.
-}
-
-
-be_visitor_interface_remote_proxy_impl_ch::
-~be_visitor_interface_remote_proxy_impl_ch (void)
-{
- // No-Op.
-}
-
-int
-be_visitor_interface_remote_proxy_impl_ch::visit_interface (
- be_interface *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl
- << "///////////////////////////////////////////////////////////////////////"
- << be_nl
- << "// Remote Proxy Impl. Declaration" << be_nl
- << "//" << be_nl << be_nl;
-
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Generate Class Declaration.
- *os << "class " << be_global->stub_export_macro ()
- << " " << node->remote_proxy_impl_name () << be_idt_nl;
- *os << ": " << "public virtual " << node->base_proxy_impl_name ()
- << "," << be_idt_nl << "public virtual "
- << "TAO_Remote_Object_Proxy_Impl";
-
- if (node->node_type () == AST_Decl::NT_component)
- {
- be_component *bc = be_component::narrow_from_decl (node);
- AST_Component *ac_base = bc->base_component ();
-
- if (ac_base != 0)
- {
- be_component *bc_base = be_component::narrow_from_decl (ac_base);
-
- *os << "," << be_nl
- << "public virtual "
- << bc_base->full_remote_proxy_impl_name ();
- }
- }
-
- int nparents = node->n_inherits ();
-
- if (nparents > 0)
- {
- for (int i = 0; i < nparents; ++i)
- {
- be_interface *inherited =
- be_interface::narrow_from_decl (node->inherits ()[i]);
-
- if (inherited->is_abstract ())
- {
- continue;
- }
-
- *os << "," << be_nl;
- *os << "public virtual ";
- *os << inherited->full_remote_proxy_impl_name ();
- }
- }
-
- *os << be_uidt << be_uidt_nl;
- *os << "{" << be_nl << "public:" << be_idt_nl;
-
- // Constructor Declaration.
- *os << node->remote_proxy_impl_name () << " (void);"
- << be_nl << be_nl;
-
- // Destructor Declaration.
- *os << "virtual ~" << node->remote_proxy_impl_name () << " (void) {}";
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << "};" << be_nl;
- *os << be_nl
- << "//" << be_nl
- << "// End Remote Proxy Impl. Declaration" << be_nl
- << "///////////////////////////////////////////////////////////////////////"
- << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_interface_remote_proxy_impl_ch::gen_abstract_ops_helper (
- be_interface *node,
- be_interface *base,
- TAO_OutStream *os
- )
-{
- if (node == base)
- {
- return 0;
- }
-
- AST_Decl *d = 0;
- be_visitor_context ctx;
- ctx.stream (os);
-
- for (UTL_ScopeActiveIterator si (base, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- d = si.item ();
-
- if (d == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_remote_proxy_"
- "impl_ch::abstract_base_ops_helper - "
- "bad node in this scope\n"),
- -1);
- }
-
- if (d->node_type () == AST_Decl::NT_op)
- {
- UTL_ScopedName item_new_name (d->local_name (),
- 0);
-
- AST_Operation *op = AST_Operation::narrow_from_decl (d);
- be_operation new_op (op->return_type (),
- op->flags (),
- &item_new_name,
- op->is_local (),
- op->is_abstract ());
- new_op.set_defined_in (node);
- be_visitor_interface::add_abstract_op_args (op,
- new_op);
- be_visitor_operation_proxy_impl_xh op_visitor (&ctx);
- op_visitor.visit_operation (&new_op);
- }
- }
-
- return 0;
-}
-
-int be_visitor_interface_remote_proxy_impl_ch::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp
deleted file mode 100644
index c55d08b839e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-//
-// $Id$
-//
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// smart_proxy_ch.cpp
-//
-// = DESCRIPTION
-// This provides code generation for smart proxy classes for an
-// interface in the client header.
-//
-// = AUTHOR
-// Kirthika Parameswaran <kirthika@cs.wustl.edu>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- smart_proxy_ch,
- "$Id$")
-
-
-// ************************************************************
-// smart proxy class in header
-// ************************************************************
-
-be_visitor_interface_smart_proxy_ch::be_visitor_interface_smart_proxy_ch (
- be_visitor_context *ctx
- )
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_smart_proxy_ch::~be_visitor_interface_smart_proxy_ch (void)
-{
-}
-
-int be_visitor_interface_smart_proxy_ch::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "class " << be_global->stub_export_macro ()<< " "
- << "TAO_" << node->flat_name ()
- << "_Default_Proxy_Factory" << be_nl
- << "{" << be_nl
- << "public:" << be_idt_nl << be_nl
- << "TAO_" << node->flat_name ()
- << "_Default_Proxy_Factory (int permanent = 1);"
- << be_nl
- <<"// <permanent> signifies that the proxy factory will remain" <<be_nl
- <<"// registered with the Proxy Factory Adapter until the program"<<be_nl
- <<"// terminates. That is, it will be a one-shot factory for the "<<be_nl
- <<"// interface. If this value is set to 0, then the factory will"<<be_nl
- <<"// be unregistered after the first invocation providing the "<<be_nl
- << "// flexibility of having a different smart proxy per object "<<be_nl
- <<"// instead of per interface."<<be_nl<< be_nl
- << "virtual ~TAO_" << node->flat_name ()
- << "_Default_Proxy_Factory (void);" << be_nl << be_nl
- << "virtual "<< node->local_name ()
- << "_ptr create_proxy (" << be_idt << be_idt_nl
- << node->local_name ()
- << "_ptr proxy" << env_dflts << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "};\n\n";
-
- *os << "class " << be_global->stub_export_macro ()<< " "
- << "TAO_" << node->flat_name ()
- << "_Proxy_Factory_Adapter" << be_nl
- << "{" << be_nl
- << "public:" << be_idt_nl << be_nl
- << "friend class TAO_Singleton<TAO_" << node->flat_name ()
- << "_Proxy_Factory_Adapter, TAO_SYNCH_RECURSIVE_MUTEX>;" << be_nl << be_nl
- << "void register_proxy_factory (" << be_idt << be_idt_nl
- << "TAO_" << node->flat_name () << "_Default_Proxy_Factory *df,"<< be_nl
- << "int one_shot_factory = 1" << env_dflts << be_uidt_nl
- << ");" << be_uidt_nl << be_nl
- << "void unregister_proxy_factory (" << be_idt << be_idt
- << env_dflts << be_uidt_nl
- << ");" << be_uidt_nl << be_nl
- << node->local_name ()
- << "_ptr create_proxy (" << be_idt << be_idt_nl
- << node->local_name () << "_ptr proxy" << env_dflts << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl << be_nl
- << "protected:" << be_idt_nl
- << "TAO_" << node->flat_name ()
- << "_Proxy_Factory_Adapter (void);" << be_nl
- << "~TAO_" << node->flat_name ()
- << "_Proxy_Factory_Adapter (void);" << be_nl
- << "TAO_" << node->flat_name ()
- << "_Proxy_Factory_Adapter &operator= (" << be_idt << be_idt_nl
- << "const TAO_" << node->flat_name ()
- << "_Proxy_Factory_Adapter &" << be_uidt_nl
- << ");" << be_uidt_nl
- << "TAO_" << node->flat_name ()
- << "_Default_Proxy_Factory *proxy_factory_;" << be_nl
- << "int one_shot_factory_;" << be_nl
- << "int disable_factory_;"<<be_nl
- << "TAO_SYNCH_RECURSIVE_MUTEX lock_;" << be_uidt_nl
- << "};";
-
- *os << be_nl << be_nl
- << "typedef TAO_Singleton<TAO_"<<node->flat_name ()
- << "_Proxy_Factory_Adapter, TAO_SYNCH_RECURSIVE_MUTEX> TAO_"
- << node->flat_name ()<< "_PROXY_FACTORY_ADAPTER;"<<be_nl << be_nl;
-
- *os << "class " << be_global->stub_export_macro ()<< " "
- << "TAO_"<< node->flat_name ()
- << "_Smart_Proxy_Base" << be_idt_nl
- << ": public virtual "
- << bt->nested_type_name (this->ctx_->scope ());
-
-
- if (node->n_inherits () > 0)
- {
- long i;
-
- for (i = 0; i < node->n_inherits (); i++)
- {
- be_interface *inherited =
- be_interface::narrow_from_decl (node->inherits ()[i]);
- be_decl *scope = 0;
-
- if (inherited->is_nested ())
- {
- // Inherited node is used in the scope of "node" node.
- scope =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
- }
-
- *os << "," << be_nl << " public virtual ";
- *os << inherited->nested_sp_type_name (scope,
- "_Smart_Proxy_Base");
- }
- }
- else
- {
- *os << "," << be_nl << " public virtual TAO_Smart_Proxy_Base";
- }
-
- *os << be_uidt_nl;
-
- *os << "{" << be_nl
- << "public:" << be_idt_nl
- << "TAO_"<< node->flat_name () << "_Smart_Proxy_Base (void);"
- << be_nl
- // Just to keep Old g++ complier (version: 2.7.2.3) happy it's
- // necesssary to declare and define the destructor explicitly.
- << "~TAO_"<< node->flat_name () << "_Smart_Proxy_Base (void);"
- << be_nl
- // This method will delegate this method to the <base_proxy_>
- // member of the smart proxy and so the smart proxy's (nil)
- // stubobj will not be returned.
- << "virtual TAO_Stub *_stubobj (void) const;"
-<< be_nl
-// Another version of the above method..
-<< "virtual TAO_Stub *_stubobj (void);"
- << be_uidt_nl;
-
- // Generate code for the interface definition by traversing thru the
- // elements of its scope. We depend on the front-end to have made sure
- // that only legal syntactic elements appear in our scope.
- os->indent ();
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << "protected:" << be_idt_nl
- << "::" << node->full_name ()
- << "_ptr get_proxy (void);" << be_nl
- << "::" << node->full_name () << "_var proxy_;"
- << be_uidt_nl
- << "};\n\n";
-
- return 0;
-}
-
-int be_visitor_interface_smart_proxy_ch::visit_component (be_component *node)
-{
- return this->visit_interface (node);
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp
deleted file mode 100644
index 4c4c41b8013..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp
+++ /dev/null
@@ -1,359 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// smart_proxy_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for smart_proxy classes for an Interface in the
-// client proxy file.
-//
-// = AUTHOR
-// Kirthika Parameswaran <kirthika@cs.wustl.edu>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- smart_proxy_cs,
- "$Id$")
-
-// ************************************************************
-// be_visitor_interface_smart_proxy_cs
-// ************************************************************
-
-be_visitor_interface_smart_proxy_cs::be_visitor_interface_smart_proxy_cs (
- be_visitor_context *ctx
- )
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_smart_proxy_cs::~be_visitor_interface_smart_proxy_cs (
- void
- )
-{
-}
-
-int be_visitor_interface_smart_proxy_cs::visit_interface (be_interface *node)
-{
-
- if (be_global->gen_smart_proxies ())
- {
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- os->indent ();
-
- // Its necessary to take care of the nested case. The smart proxy classes
- // are in the same scope as the proxy.
- be_decl* scope = be_scope::narrow_from_scope (node->defined_in ())->decl ();
-
- *os << be_nl << be_nl
- << scope->full_name ();
-
- // Only if there exists any nesting "::" is needed!
- if (node->is_nested ())
- {
- *os << "::";
- }
-
- *os <<"TAO_"<< node->flat_name () << "_Default_Proxy_Factory::";
- *os << "TAO_"
- << node->flat_name () << "_Default_Proxy_Factory (int permanent)"
- << be_nl
- << "{" << be_idt_nl
- << "TAO_" << node->flat_name ()
- << "_PROXY_FACTORY_ADAPTER::instance ()->register_proxy_factory (this, permanent);"<< be_uidt_nl
- << "}\n\n";
-
- os->indent ();
-
- *os << scope->full_name ();
-
- // Only if there exists any nesting "::" is needed!
- if (node->is_nested ())
- *os << "::";
-
- *os << "TAO_"<< node->flat_name ()
- << "_Default_Proxy_Factory::~";
- *os <<"TAO_"
- << node->flat_name () << "_Default_Proxy_Factory (void)"
- << be_nl << be_uidt << be_uidt
- << "{" << be_nl
- << "}";
-
- *os << be_nl << be_nl
- << node->full_name () << "_ptr" << be_nl << be_uidt << be_uidt;
- *os << scope->full_name ();
-
- // Only if there exists any nesting "::" is needed!
- if (node->is_nested ())
- *os << "::";
-
- *os << "TAO_" << node->flat_name ()
- << "_Default_Proxy_Factory::create_proxy (" << be_idt << be_idt_nl
- << "::" << node->full_name ()
- << "_ptr proxy" << env_not << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << "{" << be_idt_nl
- << "return proxy;" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << scope->full_name ();
-
- // Only if there exists any nesting "::" is needed!
- if (node->is_nested ())
- {
- *os << "::";
- }
-
- *os << "TAO_" << node->flat_name () << "_Proxy_Factory_Adapter::";
- *os << "TAO_"
- << node->flat_name () << "_Proxy_Factory_Adapter (void)" << be_idt_nl
- << ": proxy_factory_ (0)," << be_idt_nl
- << "one_shot_factory_ (0)," << be_nl
- << "disable_factory_ (0)" << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "}\n\n";
-
- os->indent ();
- *os << scope->full_name ();
-
- // Only if there exists any nesting "::" is needed!
- if (node->is_nested ())
- {
- *os << "::";
- }
-
- *os << "TAO_" << node->flat_name () << "_Proxy_Factory_Adapter::";
- *os << "~TAO_"
- << node->flat_name () << "_Proxy_Factory_Adapter (void)" << be_nl
- << "{" << be_idt_nl
- << "// Making sure the factory which the adapter"
- << " has is destroyed with it."
- << be_nl
- << "if (this->proxy_factory_ != 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "delete this->proxy_factory_;" << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl
- << "}\n\n";
-
- os->indent ();
- *os << "void" << be_nl;
- *os << scope->full_name ();
-
- // Only if there exists any nesting "::" is needed!
- if (node->is_nested ())
- {
- *os << "::";
- }
-
- *os << "TAO_" << node->flat_name ()
- << "_Proxy_Factory_Adapter::register_proxy_factory (" << be_idt << be_idt_nl
- << "TAO_" << node->flat_name ()
- << "_Default_Proxy_Factory *df," << be_nl
- << "int one_shot_factory" << env_decl << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << "{" << be_idt_nl
- << "ACE_MT (" << be_idt << be_idt_nl
- << "ACE_GUARD (" << be_idt << be_idt_nl
- << "TAO_SYNCH_RECURSIVE_MUTEX," << be_nl
- << "ace_mon," << be_nl
- << "this->lock_" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ");" <<be_uidt_nl << be_nl
- << "// Remove any existing <proxy_factory_> and "
- << "replace with the new one." << be_nl
- << "this->unregister_proxy_factory ("
- << (be_global->use_raw_throw ()
- ? ""
- : "ACE_ENV_SINGLE_ARG_PARAMETER")
- << ");" << TAO_ACE_CHECK () << be_nl
- << "this->proxy_factory_ = df;" << be_nl
- << "this->one_shot_factory_ = one_shot_factory;" << be_uidt_nl
- << "}\n\n";
-
- os->indent ();
- *os << "void" << be_nl;
- *os << scope->full_name ();
-
- // Only if there exists any nesting "::" is needed!
- if (node->is_nested ())
- *os << "::";
-
- *os << "TAO_"<< node->flat_name ()
- << "_Proxy_Factory_Adapter::unregister_proxy_factory ("
- << be_idt << be_idt
- << env_sngl_not << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "ACE_MT (" << be_idt << be_idt_nl
- << "ACE_GUARD (" << be_idt << be_idt_nl
- << "TAO_SYNCH_RECURSIVE_MUTEX," << be_nl
- << "ace_mon," << be_nl
- << "this->lock_" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ");" <<be_uidt_nl << be_nl
- << "if (this->one_shot_factory_ == 1)" << be_idt_nl
- << "{" << be_idt_nl
- << "this->disable_factory_ = 1;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "if ("
- << "this->one_shot_factory_ == 0 && this->proxy_factory_ != 0)"
- << be_idt_nl
- << "{" << be_idt_nl
- << "delete "
- << "this->proxy_factory_;" << be_nl
- << "this->proxy_factory_ = 0;" << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl
- << "}\n\n";
-
- os->indent ();
- *os << node->full_name () << "_ptr" << be_nl;
- *os << scope->full_name ();
-
- // Only if there exists any nesting "::" is needed!
- if (node->is_nested ())
- *os << "::";
-
- *os << "TAO_"<< node->flat_name ()
- << "_Proxy_Factory_Adapter::create_proxy (" << be_idt << be_idt_nl
- << "::" << node->full_name ()
- << "_ptr proxy" << env_not << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << "{" << be_idt_nl
- << "ACE_MT (ACE_GUARD_RETURN ("
- << "TAO_SYNCH_RECURSIVE_MUTEX, ace_mon," << be_idt_nl
- << "this->lock_, 0));" << be_uidt_nl << be_nl
- << "// To take care of those <unchecked_narrow> methods where we " << be_nl
- << "// want to override the smart proxy factory if there exists one." << be_nl
- << "if (this->disable_factory_ == 1)" << be_idt_nl
- << "{" << be_idt_nl
- << "this->disable_factory_ = 0;" << be_nl
- << "return proxy;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "// Verify that an <proxy_factory_> is available else make one." << be_nl
- << "if ("
- <<"this->proxy_factory_ == 0)" << be_idt_nl
- << "ACE_NEW_RETURN ("
- << "this->proxy_factory_," << be_idt << be_idt_nl
- << "TAO_" << node->flat_name ()
- << "_Default_Proxy_Factory (0), " << be_nl
- << " 0);" << be_uidt_nl << be_uidt_nl << be_uidt_nl
- << "return "
- << "this->proxy_factory_->create_proxy (proxy);"
- << be_uidt << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << scope->full_name ();
-
- // Only if there exists any nesting "::" is needed!
- if (node->is_nested ())
- *os << "::";
-
- *os << "TAO_" << node->flat_name () << "_Smart_Proxy_Base::";
- *os << "TAO_"
- << node->flat_name () << "_Smart_Proxy_Base (void)" << be_uidt_nl
- << "{" << be_nl
- << "}" << be_nl << be_nl;
-
- os->indent ();
- *os << scope->full_name ();
-
- // Only if there exists any nesting "::" is needed!
- if (node->is_nested ())
- *os << "::";
-
- *os << "TAO_" << node->flat_name () << "_Smart_Proxy_Base::";
- *os << "~TAO_"
- << node->flat_name () << "_Smart_Proxy_Base (void)" <<be_nl
- << "{" << be_nl
- << "}\n\n";
-
- // Implement the <stubobj> method of the base class
- os->indent ();
- *os << "TAO_Stub *"<<be_nl;
- *os << scope->full_name ();
-
- // Only if there exists any nesting "::" is needed!
- if (node->is_nested ())
- *os << "::";
-
- *os << "TAO_" << node->flat_name () << "_Smart_Proxy_Base::";
- *os << "_stubobj (void) const"<<be_nl
- << "{" << be_idt_nl
- << "return this->base_proxy_->_stubobj ();"<< be_uidt_nl
- << "}"<< be_nl << be_nl;
-
- // Implement the <stubobj> method of the base class
- os->indent ();
- *os << "TAO_Stub *"<<be_nl;
- *os << scope->full_name ();
-
- // Only if there exists any nesting "::" is needed!
- if (node->is_nested ())
- *os << "::";
- *os << "TAO_" << node->flat_name () << "_Smart_Proxy_Base::";
- *os << "_stubobj (void)"<<be_nl
- << "{" << be_idt_nl
- << "return this->base_proxy_->_stubobj ();"<< be_uidt_nl
- << "}" << be_nl << be_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_smart_proxy_cs::"
- "visit_scope - "
- "codegen for scope failed\n"),
- -1);
- }
-
-
- os->indent ();
-
- *os << node->full_name() << "_ptr" << be_nl;
- *os << scope->full_name ();
-
- // Only if there exists any nesting "::" is needed!
- if (node->is_nested ())
- *os << "::";
-
- *os << "TAO_" << node->flat_name () << "_Smart_Proxy_Base::"
- << "get_proxy (void)" << be_idt_nl
- << be_uidt_nl;
-
- *os << "{" << be_idt_nl
- << "// Obtain the real proxy stored in <base_proxy_>" << be_nl
- << "if (CORBA::is_nil (this->proxy_.in ()))" << be_idt_nl
- << "{" << be_idt_nl
- << " // Verify whether factory is one-shot, if so disable"<<be_nl
- << " // factory temporarily or not else remove."<<be_nl
- << "TAO_"<< node->flat_name ()
- <<"_PROXY_FACTORY_ADAPTER::instance ()->unregister_proxy_factory ();"
- << be_nl << "this->proxy_ = " << "::" << node->full_name ()
- << "::_narrow (this->base_proxy_.in ());"
- << be_uidt_nl
- << "}" << be_uidt_nl
- << "return this->proxy_.in ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
- else
- {
- ACE_UNUSED_ARG (node);
- }
-
- return 0;
-}
-
-int be_visitor_interface_smart_proxy_cs::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp
deleted file mode 100644
index baf3709e1b7..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// $Id$
-//
-
-ACE_RCSID (be_visitor_interface,
- base_proxy_broker_sh,
- "$Id$")
-
-be_visitor_interface_strategized_proxy_broker_sh::
-be_visitor_interface_strategized_proxy_broker_sh (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
- // No-Op.
-}
-
-be_visitor_interface_strategized_proxy_broker_sh::
-~be_visitor_interface_strategized_proxy_broker_sh (void)
-{
- // No-Op.
-}
-
-int
-be_visitor_interface_strategized_proxy_broker_sh::visit_interface (
- be_interface *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl
- << "///////////////////////////////////////////////////////////////////////"
- << be_nl
- << "// Strategized Proxy Broker Declaration " << be_nl
- << "//" << be_nl << be_nl;
-
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "class " << be_global->skel_export_macro () << " "
- << node->strategized_proxy_broker_name () << be_idt_nl
- << ": public virtual "
- << "TAO::Collocation_Proxy_Broker" << be_uidt_nl << "{"
- << be_nl
- << "public: " << be_idt;
-
- // Constructor
- *os << be_nl
- << node->strategized_proxy_broker_name () << " (void);";
-
- // Destructor
- *os << be_nl << be_nl
- << "virtual ~" << node->strategized_proxy_broker_name () << " (void);";
-
- *os << be_nl << be_nl
- << "TAO::Collocation_Strategy" << be_nl
- << "get_strategy (" << be_idt << be_idt_nl
- << "::CORBA::Object_ptr obj" << env_decl << be_uidt_nl
- << ")" << be_nl
- << "ACE_THROW_SPEC (( ::CORBA::SystemException));" << be_uidt;
-
- *os << be_nl << be_nl
- << "void" << be_nl
- << "dispatch (" << be_idt << be_idt_nl
- << "::CORBA::Object_ptr obj," << be_nl
- << "::CORBA::Object_out forward_obj," << be_nl
- << "TAO::Argument ** args," << be_nl
- << "int num_args," << be_nl
- << "const char * op," << be_nl
- << "size_t op_len," << be_nl
- << "TAO::Collocation_Strategy strategy" << env_decl << be_uidt_nl
- << ")" << be_nl
- << "ACE_THROW_SPEC (( ::CORBA::Exception));";
-
- *os << be_uidt_nl << be_nl
- << "static " << node->strategized_proxy_broker_name ()
- << " *" << be_nl
- << "the" << node->strategized_proxy_broker_name ()
- << " (void);" << be_uidt_nl;
-
- *os << "};";
-
- *os << be_nl << be_nl
- << "//" << be_nl
- << "// End Strategized Proxy Broker Declaration " << be_nl
- << "///////////////////////////////////////////////////////////////////////"
- << be_nl << be_nl;
-
- return 0;
-}
-
-int be_visitor_interface_strategized_proxy_broker_sh::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp
deleted file mode 100644
index 80ce04b3f3f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// $Id$
-//
-
-ACE_RCSID (be_visitor_interface,
- strategized_proxy_broker_ss,
- "$Id$")
-
-be_visitor_interface_strategized_proxy_broker_ss::
-be_visitor_interface_strategized_proxy_broker_ss (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
- // No-Op.
-}
-
-
-be_visitor_interface_strategized_proxy_broker_ss::
-~be_visitor_interface_strategized_proxy_broker_ss (void)
-{
- // No-Op.
-}
-
-int
-be_visitor_interface_strategized_proxy_broker_ss::visit_interface (
- be_interface *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate the class declaration.
- os->indent ();
-
- *os << be_nl
- << "///////////////////////////////////////////////////////////////////////"
- << be_nl
- << "// Strategized Proxy Broker Implementation" << be_nl
- << "//" << be_nl << be_nl;
-
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "// Factory function Implementation." << be_nl
- << node->full_strategized_proxy_broker_name ()
- << " *" << be_nl
- << node->full_strategized_proxy_broker_name () << "::the"
- << node->strategized_proxy_broker_name ()
- << " (void)" << be_nl
- << "{" << be_idt_nl
- << "static " << node->full_strategized_proxy_broker_name () << be_nl
- << "strategized_proxy_broker;" << be_nl << be_nl
- << "return &strategized_proxy_broker;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Constructor Implementation.
- *os << node->full_strategized_proxy_broker_name () << "::"
- << node->strategized_proxy_broker_name () << " (void)" << be_nl
- << "{" << be_nl
- << "}" << be_nl << be_nl;
-
- // Destructor Implementation.
- *os << node->full_strategized_proxy_broker_name () << "::~"
- << node->strategized_proxy_broker_name () << " (void)" << be_nl
- << "{" << be_nl
- << "}" << be_nl << be_nl;
-
- // get_strategy() impementation.
- *os << "TAO::Collocation_Strategy" << be_nl
- << node->full_strategized_proxy_broker_name () << "::"
- << "get_strategy (" << be_idt << be_idt_nl
- << "::CORBA::Object_ptr obj" << env_decl << be_uidt_nl
- << ")" << be_nl
- << "ACE_THROW_SPEC (( ::CORBA::SystemException))" << be_uidt_nl
- << "{" << be_idt_nl
- << "TAO::Collocation_Strategy strategy =" << be_idt_nl
- << "TAO_ORB_Core::collocation_strategy (obj"
- << (be_global->use_raw_throw () ? "" : " ACE_ENV_ARG_PARAMETER")
- << ");" << be_uidt
- << TAO_ACE_CHECK ("TAO::TAO_CS_REMOTE_STRATEGY")
- << be_nl << be_nl
- << "return strategy;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // create_proxy implementation
- *os << "void" << be_nl
- << node->full_strategized_proxy_broker_name () << "::"
- << "dispatch (" << be_idt << be_idt_nl
- << "::CORBA::Object_ptr obj," << be_nl
- << "::CORBA::Object_out forward_obj," << be_nl
- << "TAO::Argument ** args," << be_nl
- << "int num_args," << be_nl
- << "const char * op," << be_nl
- << "size_t op_len," << be_nl
- << "TAO::Collocation_Strategy strategy" << env_decl << be_uidt_nl
- << ")" << be_nl
- << "ACE_THROW_SPEC (( ::CORBA::Exception))" << be_uidt_nl
- << "{" << be_idt_nl
- << "TAO::Direct_Collocation_Upcall_Wrapper collocation_upcall_wrapper;" << be_nl
- << "collocation_upcall_wrapper.upcall (" << be_idt_nl
- << "obj," << be_nl
- << "forward_obj," << be_nl
- << "args," << be_nl
- << "num_args," << be_nl
- << "op," << be_nl
- << "op_len," << be_nl
- << "strategy" << env_arg
- << ");" << be_uidt << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "//" << be_nl
- << "// End Strategized Proxy Broker Implementation" << be_nl
- << "///////////////////////////////////////////////////////////////////////";
-
- return 0;
-}
-
-int
-be_visitor_interface_strategized_proxy_broker_ss::visit_component (
- be_component *node
- )
-{
- return this->visit_interface (node);
-}
-
-void
-be_visitor_interface_strategized_proxy_broker_ss::gen_direct_operations (
- be_interface *,
- TAO_OutStream *
- )
-{
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp
deleted file mode 100644
index d5d3c41885a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// tie_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for TIE class for an Interface in the header
-// file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- tie_sh,
- "$Id$")
-
-// ************************************************************
-// Interface visitor for server header.
-// ************************************************************
-
-be_visitor_interface_tie_sh::be_visitor_interface_tie_sh (
- be_visitor_context *ctx
- )
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_tie_sh::~be_visitor_interface_tie_sh (void)
-{
-}
-
-int
-be_visitor_interface_tie_sh::visit_interface (be_interface *node)
-{
- if (node->imported () || node->is_abstract ())
- {
- return 0;
- }
-
- static char namebuf [NAMEBUFSIZE];
- static char tiename [NAMEBUFSIZE];
-
- ACE_OS::memset (namebuf,
- '\0',
- NAMEBUFSIZE);
- ACE_OS::memset (tiename,
- '\0',
- NAMEBUFSIZE);
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate the skeleton class name which will be used to determine the TIE
- // class name.
-
- // We shall have a POA_ prefix only if we are at the topmost level.
- if (node->is_nested ())
- {
- ACE_OS::sprintf (namebuf,
- "%s",
- node->local_name ());
- ACE_OS::sprintf (tiename,
- "%s_tie",
- node->local_name ());
- }
- else
- {
- // We are outermost.
- ACE_OS::sprintf (namebuf,
- "POA_%s",
- node->local_name ());
- ACE_OS::sprintf (tiename,
- "POA_%s_tie",
- node->local_name ());
- }
-
- // Now generate the class definition.
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "// TIE class: Refer to CORBA v2.2, Section 20.34.4" << be_nl;
- *os << "template <class T>" << be_nl;
- *os << "class " << " " << tiename << " : public " << namebuf << be_nl;
- *os << "{" << be_nl
- << "public:" << be_idt_nl
- << "/// the T& ctor" << be_nl
- << tiename << " (T &t);" << be_nl
- << "/// ctor taking a POA" << be_nl
- << tiename << " (T &t, PortableServer::POA_ptr poa);" << be_nl
- << "/// ctor taking pointer and an ownership flag" << be_nl
- << tiename << " (T *tp, ::CORBA::Boolean release = true);" << be_nl
- << "/// ctor with T*, ownership flag and a POA" << be_nl
- << tiename << " (" << be_idt << be_idt_nl
- << "T *tp," << be_nl
- << "PortableServer::POA_ptr poa," << be_nl
- << "::CORBA::Boolean release = true" << be_uidt_nl
- << ");" << be_uidt_nl
- << "/// dtor" << be_nl << be_nl
- << "~" << tiename << " (void);" << be_nl
- << "// TIE specific functions" << be_nl
- << "/// return the underlying object" << be_nl
- << "T *_tied_object (void);" << be_nl
- << "/// set the underlying object" << be_nl
- << "void _tied_object (T &obj);" << be_nl
- << "/// set the underlying object and the ownership flag" << be_nl
- << "void _tied_object (T *obj, ::CORBA::Boolean release = true);" << be_nl
- << "/// do we own it" << be_nl
- << "::CORBA::Boolean _is_owner (void);" << be_nl
- << "/// set the ownership" << be_nl << be_nl
- << "void _is_owner ( ::CORBA::Boolean b);" << be_nl
- << "// overridden ServantBase operations" << be_nl
- << "PortableServer::POA_ptr _default_POA (" << be_idt << be_idt
- << env_sngl_dflts << be_uidt_nl
- << ");" << be_uidt;
-
- int status =
- node->traverse_inheritance_graph (
- be_visitor_interface_tie_sh::method_helper,
- os
- );
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_tie_sh_ss::"
- "visit_interface - "
- "traversal of inhertance graph failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << be_nl
- << "private:" << be_idt_nl
- << "T *ptr_;" << be_nl
- << "PortableServer::POA_var poa_;" << be_nl
- << "::CORBA::Boolean rel_;" << be_nl << be_nl
- << "// copy and assignment are not allowed" << be_nl
- << tiename << " (const " << tiename << " &);" << be_nl
- << "void operator= (const " << tiename << " &);" << be_uidt_nl
- << "};";
-
- return 0;
-}
-
-int
-be_visitor_interface_tie_sh::visit_component (be_component *node)
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_interface_tie_sh::method_helper (be_interface *,
- be_interface *node,
- TAO_OutStream *os)
-{
- // Any methods from abstract parents have already been
- // "added" to the derived interface scope by the overridden
- // visit_scope() method in be_visitor_interface, so we can skip
- // this base interface, if it is abstract.
- if (node->is_abstract ())
- {
- return 0;
- }
-
- be_visitor_context ctx;
- ctx.state (TAO_CodeGen::TAO_ROOT_TIE_SH);
- ctx.stream (os);
- be_visitor_interface_tie_sh visitor (&ctx);
-
- if (visitor.visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_tie_sh::"
- "method_helper\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp b/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp
deleted file mode 100644
index b92c0a98860..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp
+++ /dev/null
@@ -1,252 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// tie_si.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for TIE classes for the Interface node in the
-// inline file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface,
- tie_si,
- "$Id$")
-
-
-// ************************************************************************
-// Interface visitor for server inline
-// ************************************************************************
-
-be_visitor_interface_tie_si::be_visitor_interface_tie_si (
- be_visitor_context *ctx
- )
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_tie_si::~be_visitor_interface_tie_si (void)
-{
-}
-
-int
-be_visitor_interface_tie_si::visit_interface (be_interface *node)
-{
- if (node->srv_inline_gen ()
- || node->imported ()
- || node->is_abstract ())
- {
- return 0;
- }
-
- static char fulltiename [NAMEBUFSIZE];
- static char localtiename [NAMEBUFSIZE];
- static char localskelname [NAMEBUFSIZE];
-
- ACE_OS::memset (fulltiename,
- '\0',
- NAMEBUFSIZE);
- ACE_OS::memset (localtiename,
- '\0',
- NAMEBUFSIZE);
- ACE_OS::memset (localskelname,
- '\0',
- NAMEBUFSIZE);
-
- // Generate the skeleton class name which will be used to determine the TIE
- // class name.
-
- // We are outermost.
- ACE_OS::sprintf (fulltiename,
- "%s_tie",
- node->full_skel_name ());
-
- if (!node->is_nested ())
- {
- ACE_OS::sprintf (localskelname,
- "POA_%s",
- node->local_name ());
- ACE_OS::sprintf (localtiename,
- "POA_%s_tie",
- node->local_name ());
- }
- else
- {
- ACE_OS::sprintf (localskelname,
- "%s",
- node->local_name ());
- ACE_OS::sprintf (localtiename,
- "%s_tie",
- node->local_name ());
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "template <class T> ACE_INLINE" << be_nl
- << fulltiename << "<T>::" << localtiename << " (T &t)" << be_nl
- << "\t: ptr_ (&t)," << be_nl
- << "\t poa_ (PortableServer::POA::_nil ())," << be_nl
- << "\t rel_ (0)" << be_nl
- << "{}" << be_nl << be_nl;
-
- *os << "template <class T> ACE_INLINE" << be_nl
- << fulltiename << "<T>::" << localtiename
- << " (T &t, PortableServer::POA_ptr poa)" << be_nl
- << "\t: ptr_ (&t)," << be_nl
- << "\t poa_ (PortableServer::POA::_duplicate (poa))," << be_nl
- << "\t rel_ (0)" << be_nl
- << "{}" << be_nl << be_nl;
-
- *os << "template <class T> ACE_INLINE" << be_nl
- << fulltiename << "<T>::" << localtiename
- << " (T *tp, ::CORBA::Boolean release)" << be_nl
- << "\t: ptr_ (tp)," << be_nl
- << "\t poa_ (PortableServer::POA::_nil ())," << be_nl
- << "\t rel_ (release)" << be_nl
- << "{}" << be_nl << be_nl;
-
- *os << "template <class T> ACE_INLINE" << be_nl
- << fulltiename << "<T>::" << localtiename
- << " (T *tp, PortableServer::POA_ptr poa, ::CORBA::Boolean release)"
- << be_nl
- << "\t: ptr_ (tp)," << be_nl
- << "\t poa_ (PortableServer::POA::_duplicate (poa))," << be_nl
- << "\t rel_ (release)" << be_nl
- << "{}" << be_nl << be_nl;
-
- *os << "template <class T> ACE_INLINE" << be_nl
- << fulltiename << "<T>::~" << localtiename << " (void)" << be_nl
- << "{" << be_idt_nl
- << "if (this->rel_)" << be_idt_nl
- << "{" << be_idt_nl
- << "delete this->ptr_;" << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "template <class T> ACE_INLINE T *" << be_nl
- << fulltiename << "<T>::_tied_object (void)" << be_nl
- << "{" << be_idt_nl
- << "return this->ptr_;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "template <class T> ACE_INLINE void" << be_nl
- << fulltiename << "<T>::_tied_object (T &obj)" << be_nl
- << "{" << be_idt_nl
- << "if (this->rel_)" << be_idt_nl
- << "{" << be_idt_nl
- << "delete this->ptr_;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "this->ptr_ = &obj;" << be_nl
- << "this->rel_ = 0;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "template <class T> ACE_INLINE void" << be_nl
- << fulltiename << "<T>::_tied_object (T *obj, "
- << "::CORBA::Boolean release)" << be_nl
- << "{" << be_idt_nl
- << "if (this->rel_)" << be_idt_nl
- << "{" << be_idt_nl
- << "delete this->ptr_;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "this->ptr_ = obj;" << be_nl
- << "this->rel_ = release;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "template <class T> ACE_INLINE ::CORBA::Boolean" << be_nl
- << fulltiename << "<T>::_is_owner (void)" << be_nl
- << "{" << be_idt_nl
- << "return this->rel_;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "template <class T> ACE_INLINE void" << be_nl
- << fulltiename << "<T>::_is_owner ( ::CORBA::Boolean b)" << be_nl
- << "{" << be_idt_nl
- << "this->rel_ = b;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "template <class T> ACE_INLINE "
- << "PortableServer::POA_ptr" << be_nl
- << fulltiename
- << "<T>::_default_POA ("
- << (be_global->use_raw_throw () ? "" : "ACE_ENV_SINGLE_ARG_DECL")
- << ")" << be_nl
- << "{" << be_idt_nl
- << "if (! ::CORBA::is_nil (this->poa_.in ()))" << be_idt_nl
- << "{" << be_idt_nl
- << "return PortableServer::POA::_duplicate (this->poa_.in ());"
- << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "return this->" << localskelname
- << "::_default_POA ("
- << (be_global->use_raw_throw () ? "" : "ACE_ENV_SINGLE_ARG_PARAMETER")
- << ");" << be_uidt_nl
- << "}";
-
- int status =
- node->traverse_inheritance_graph (
- be_visitor_interface_tie_si::method_helper,
- os
- );
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_tie_sh_ss::"
- "visit_interface - "
- "traversal of inhertance graph failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_interface_tie_si::visit_component (be_component *node)
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_interface_tie_si::method_helper (be_interface *derived,
- be_interface *node,
- TAO_OutStream *os)
-{
- // Any methods from abstract parents have already been
- // "added" to the derived interface scope by the overridden
- // visit_scope() method in be_visitor_interface, so we can skip
- // this base interface, if it is abstract.
- if (node->is_abstract ())
- {
- return 0;
- }
-
- be_visitor_context ctx;
- ctx.state (TAO_CodeGen::TAO_ROOT_TIE_SI);
- ctx.interface (derived);
- ctx.stream (os);
- be_visitor_interface_tie_si visitor (&ctx);
-
- if (visitor.visit_scope (node) == -1)
-
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_tie_si::"
- "method_helper\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp
deleted file mode 100644
index 1dc664073ea..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_interface_fwd.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Interface_Fwd
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_interface_fwd.h"
-#include "be_interface.h"
-#include "be_helper.h"
-#include "be_extern.h"
-
-#include "be_util.h"
-#include "be_module.h"
-
-#include "be_visitor_interface_fwd.h"
-#include "be_visitor_context.h"
-#include "ace/Log_Msg.h"
-
-#include "be_visitor_interface_fwd/interface_fwd_ch.cpp"
-#include "be_visitor_interface_fwd/cdr_op_ch.cpp"
-#include "be_visitor_interface_fwd/any_op_ch.cpp"
-
-ACE_RCSID (be,
- be_visitor_interface_fwd,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp
deleted file mode 100644
index d08ba25559b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for a forward declared interface
-// in the client header.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface_fwd,
- any_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Generates Any operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_interface_fwd_any_op_ch::be_visitor_interface_fwd_any_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_interface_fwd_any_op_ch::~be_visitor_interface_fwd_any_op_ch (void)
-{
-}
-
-int
-be_visitor_interface_fwd_any_op_ch::visit_interface_fwd (
- be_interface_fwd *node
- )
-{
- // Only a forward declared interface that is not defined in the same
- // translation unit needs to have this generated here. The Any operators
- // are needed by portable interceptor code if the interface is a
- // parameter of an operation.
- if (node->full_def_seen () || node->is_local ())
- {
- return 0;
- }
-
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- const char *macro = this->ctx_->export_macro ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- be_module *module = 0;
-
- if (node->is_nested () &&
- node->defined_in ()->scope_node_type () == AST_Decl::NT_module)
- {
- module = be_module::narrow_from_scope (node->defined_in ());
-
- if (0 == module)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_valuebox_any_op_ch::"
- "visit_interface_fwd - "
- "Error parsing nested name\n"),
- -1);
- }
-
- // Some compilers handle "any" operators in a namespace
- // corresponding to their module, others do not.
- *os << "\n\n#if defined (ACE_ANY_OPS_USE_NAMESPACE)\n";
-
- be_util::gen_nested_namespace_begin (os, module);
-
- *os << macro << " void"
- << " operator<<= ( ::CORBA::Any &, " << node->local_name ()
- << "_ptr); // copying" << be_nl;
- *os << macro << " void"
- << " operator<<= ( ::CORBA::Any &, " << node->local_name ()
- << "_ptr *); // non-copying" << be_nl;
- *os << macro << " ::CORBA::Boolean"
- << " operator>>= (const ::CORBA::Any &, "
- << node->local_name () << " *&);";
-
- be_util::gen_nested_namespace_end (os, module);
-
- // emit #else
- *os << "#else\n\n";
- }
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << macro << " void"
- << " operator<<= (::CORBA::Any &, " << node->name ()
- << "_ptr); // copying" << be_nl;
- *os << macro << " void"
- << " operator<<= (::CORBA::Any &, " << node->name ()
- << "_ptr *); // non-copying" << be_nl;
- *os << macro << " ::CORBA::Boolean"
- << " operator>>= (const ::CORBA::Any &, "
- << node->name () << " *&);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- if (module != 0)
- {
- *os << "\n\n#endif";
- }
-
- node->cli_hdr_any_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp
deleted file mode 100644
index 442d4bd54f0..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for forward declared
-// interfaces. This uses compiled marshaling.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface_fwd,
- cdr_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Forward declared interface visitor for generating CDR operator declarations
-// in the client header. Called if this node is not later defined in the file.
-// ***************************************************************************
-
-be_visitor_interface_fwd_cdr_op_ch::be_visitor_interface_fwd_cdr_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_interface_fwd_cdr_op_ch::~be_visitor_interface_fwd_cdr_op_ch (void)
-{
-}
-
-int
-be_visitor_interface_fwd_cdr_op_ch::visit_interface_fwd (be_interface_fwd *node)
-{
- // If this forward declared interface is defined later in the file,
- // the CDR operator declaration (along with the corresponding
- // declarations for members of the interface's scope) will be
- // generated then.
- if (node->full_def_seen () || node->is_local ())
- {
- return 0;
- }
-
- // No CDR operations for locality constraint interfaces.
- if (node->cli_hdr_cdr_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean "
- << "operator<< (TAO_OutputCDR &, const " << node->full_name ()
- << "_ptr );" << be_nl;
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean "
- << "operator>> (TAO_InputCDR &, "
- << node->full_name () << "_ptr &);\n";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp
deleted file mode 100644
index 5985b56e260..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface_fwd_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interface_Fwd node in the client header.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_interface_fwd,
- interface_fwd_ch,
- "$Id$")
-
-// ********************************************************************
-// Visitor implementation for the Interface_Fwd type
-// This one for the client header file
-// ********************************************************************
-
-be_visitor_interface_fwd_ch::be_visitor_interface_fwd_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_interface_fwd_ch::~be_visitor_interface_fwd_ch (void)
-{
-}
-
-// Visit the interface_fwd_ch node and its scope.
-int
-be_visitor_interface_fwd_ch::visit_interface_fwd (be_interface_fwd *node)
-{
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- AST_Interface *fd = node->full_definition ();
- be_interface *bfd = be_interface::narrow_from_decl (fd);
-
- // This will be a no-op if it has already been done for this node.
- bfd->gen_var_out_seq_decls ();
-
- // Copy the fwd helper name back to the forward declared interface node.
- node->fwd_helper_name (bfd->fwd_helper_name ());
-
- node->cli_hdr_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_module.cpp b/TAO/TAO_IDL/be/be_visitor_module.cpp
deleted file mode 100644
index c36fb8a088f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_module.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_module.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Module
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_module.h"
-#include "be_constant.h"
-#include "be_enum.h"
-#include "be_exception.h"
-#include "be_native.h"
-#include "be_interface.h"
-#include "be_interface_fwd.h"
-#include "be_structure.h"
-#include "be_structure_fwd.h"
-#include "be_typedef.h"
-#include "be_union.h"
-#include "be_union_fwd.h"
-#include "be_valuebox.h"
-#include "be_valuetype.h"
-#include "be_valuetype_fwd.h"
-#include "be_eventtype.h"
-#include "be_eventtype_fwd.h"
-#include "be_component.h"
-#include "be_component_fwd.h"
-#include "be_home.h"
-#include "be_extern.h"
-#include "be_helper.h"
-#include "utl_err.h"
-
-#include "be_visitor_module.h"
-#include "be_visitor_constant.h"
-#include "be_visitor_enum.h"
-#include "be_visitor_native.h"
-#include "be_visitor_exception.h"
-#include "be_visitor_interface.h"
-#include "be_visitor_interface_fwd.h"
-#include "be_visitor_structure.h"
-#include "be_visitor_structure_fwd.h"
-#include "be_visitor_typedef.h"
-#include "be_visitor_union.h"
-#include "be_visitor_union_fwd.h"
-#include "be_visitor_valuebox.h"
-#include "be_visitor_valuetype.h"
-#include "be_visitor_valuetype_fwd.h"
-#include "be_visitor_component.h"
-#include "be_visitor_component_fwd.h"
-#include "be_visitor_home.h"
-#include "be_visitor_context.h"
-
-#include "be_visitor_module/module.cpp"
-#include "be_visitor_module/module_ch.cpp"
-#include "be_visitor_module/module_sh.cpp"
-#include "be_visitor_module/module_ih.cpp"
-#include "be_visitor_module/any_op.cpp"
-#include "be_visitor_module/cdr_op.cpp"
-#include "be_visitor_module/serializer_op.cpp"
-
-ACE_RCSID (be,
- be_visitor_module,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_module/any_op.cpp b/TAO/TAO_IDL/be/be_visitor_module/any_op.cpp
deleted file mode 100644
index 5819d998f17..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_module/any_op.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for elements in the scope of
-// the Module.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_module,
- any_op,
- "$Id$")
-
-// ***************************************************************************
-// Module visitor for generating Any operator declarations in the client header
-// and stub
-// ***************************************************************************
-
-be_visitor_module_any_op::be_visitor_module_any_op (be_visitor_context *ctx)
- : be_visitor_module (ctx)
-{
-}
-
-be_visitor_module_any_op::~be_visitor_module_any_op (void)
-{
-}
-
-int
-be_visitor_module_any_op::visit_module (be_module *node)
-{
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::visit_module - "
- "codegen for scope failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_module/cdr_op.cpp b/TAO/TAO_IDL/be/be_visitor_module/cdr_op.cpp
deleted file mode 100644
index 540057da455..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_module/cdr_op.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the CDR operators for types defined in Module's
-// scope.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_module,
- cdr_op,
- "$Id: cdr_op.cpp,v 1.2 1999/05/28 02:16:43 coryan Exp ")
-
-// ***************************************************************************
-// Module visitor for generating CDR operator declarations in the client header
-// and stub
-// ***************************************************************************
-
-be_visitor_module_cdr_op::be_visitor_module_cdr_op (be_visitor_context *ctx)
- : be_visitor_module (ctx)
-{
-}
-
-be_visitor_module_cdr_op::~be_visitor_module_cdr_op (void)
-{
-}
-
-int
-be_visitor_module_cdr_op::visit_module (be_module *node)
-{
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module_cdr_op::visit_module - "
- "codegen for scope failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_module/module.cpp b/TAO/TAO_IDL/be/be_visitor_module/module.cpp
deleted file mode 100644
index c366cbbb5e2..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_module/module.cpp
+++ /dev/null
@@ -1,1231 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// module.cpp
-//
-// = DESCRIPTION
-// Generic visitor generating code for Module
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_module,
- module,
- "$Id$")
-
-
-// ******************************************************
-// Generic Module visitor
-// ******************************************************
-
-be_visitor_module::be_visitor_module (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_module::~be_visitor_module (void)
-{
-}
-
-int
-be_visitor_module::visit_module (be_module *node)
-{
- if (node->nmembers () == 0)
- {
- idl_global->err ()->error1 (UTL_Error::EIDL_EMPTY_MODULE,
- node);
- }
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::visit_module - "
- "codegen for scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// All common visit methods for module visitor.
-
-int
-be_visitor_module::visit_constant (be_constant *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_constant_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_constant_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_constant - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_module::visit_native (be_native *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_native_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::::"
- "visit_native - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_module::visit_enum (be_enum *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_enum_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_enum_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_enum_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_enum_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_enum_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_enum_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- be_visitor_enum_serializer_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_enum_serializer_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_enum - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_module::visit_exception (be_exception *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_exception_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_exception_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_exception_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_exception_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_exception_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_exception_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_exception_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- return 0; // nothing to be done for DCPS
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_exception - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_module::visit_interface (be_interface *node)
-{
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 1;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- // This is the only context state involved in strategies.
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_interface_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_interface_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SH:
- {
- be_visitor_interface_sh visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IH:
- {
- be_visitor_interface_ih visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SI:
- {
- be_visitor_interface_si visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SS:
- {
- be_visitor_interface_ss visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IS:
- {
- be_visitor_interface_is visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_interface_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_interface_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_interface_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_interface_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- return 0; // nothing to be done for DCPS
- break;
- }
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_interface - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == 0)
- {
- return 0;
- }
- else if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_interface - "
- "failed to accept visitor\n"),
- -1);
- }
-
- // Change the state depending on the kind of node strategy
- ctx.state (node->next_state (ctx.state ()));
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_interface - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_interface - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
-
- // Do additional code generation is necessary.
- // Note, this call is delegated to the strategy connected to
- // the node.
- if (node->has_extra_code_generation (ctx.state ()))
- {
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state (), 1));
-
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_interface - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_interface - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
- }
-
- ctx.state (TAO_CodeGen::TAO_ROOT_CH);
- return 0;
-}
-
-int
-be_visitor_module::visit_interface_fwd (be_interface_fwd *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_interface_fwd_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_interface_fwd_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_interface_fwd_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- return 0; // nothing to be done for DCPS
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_interface_fwd - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_module::visit_valuebox (be_valuebox *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_valuebox_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_valuebox_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_valuebox_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_valuebox_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_valuebox_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_valuebox_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_valuebox_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- {
- break;
- }
- default:
- return 0; // nothing to do.
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_valuebox - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_module::visit_valuetype (be_valuetype *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_valuetype_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_valuetype_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_valuetype_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_valuetype_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_valuetype_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- return 0; // nothing to be done for DCPS
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_valuetype_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_valuetype_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SH:
- {
- be_visitor_valuetype_sh visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SI:
- {
- be_visitor_valuetype_si visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SS:
- {
- be_visitor_valuetype_ss visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to do.
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_valuetype - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_module::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_valuetype_fwd_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_valuetype_fwd_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_valuetype_fwd_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- return 0; // nothing to be done for DCPS
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_valuetype_fwd - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_module::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_module::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
-
-int
-be_visitor_module::visit_component (be_component *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_component_ch visitor (&ctx);
- // So we can pick up the abstract ops helpers.
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CH);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_component_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_component_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_component_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_component_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- return 0; // nothing to be done for DCPS
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_component_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_component_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SH:
- {
- be_visitor_component_sh visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SI:
- {
- be_visitor_component_si visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SS:
- {
- be_visitor_component_ss visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IH:
- {
- be_visitor_component_ih visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IS:
- {
- be_visitor_component_is visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_component - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_component - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_module::visit_component_fwd (be_component_fwd *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_component_fwd_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_component_fwd_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_component_fwd - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_module::visit_home (be_home *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_home_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_home_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_home - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_module::visit_structure (be_structure *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_structure_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_structure_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_structure_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_structure_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_structure_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_structure_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_structure_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- be_visitor_structure_serializer_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_structure_serializer_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_structure - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_module::visit_structure_fwd (be_structure_fwd *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_structure_fwd_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_structure_fwd - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_module::visit_union (be_union *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_union_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_union_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_union_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_union_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_union_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_union_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_union_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- be_visitor_union_serializer_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_union_serializer_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_union - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_module::visit_union_fwd (be_union_fwd *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_union_fwd_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_union_fwd - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_module::visit_typedef (be_typedef *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_typedef_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_typedef_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_typedef_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_typedef_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_typedef_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_typedef_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_typedef_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- be_visitor_typedef_serializer_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_typedef_serializer_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_module/module_ch.cpp b/TAO/TAO_IDL/be/be_visitor_module/module_ch.cpp
deleted file mode 100644
index 11f1678c300..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_module/module_ch.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// module_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Module in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_module,
- module_ch,
- "$Id$")
-
-// ******************************************************
-// Module visitor for client header
-// ******************************************************
-
-be_visitor_module_ch::be_visitor_module_ch (be_visitor_context *ctx)
- : be_visitor_module (ctx)
-{
-}
-
-be_visitor_module_ch::~be_visitor_module_ch (void)
-{
-}
-
-int
-be_visitor_module_ch::visit_module (be_module *node)
-{
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- TAO_OutStream *aos = 0;
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "namespace " << node->local_name () << be_nl
- << "{" << be_idt;
-
- if (be_global->gen_anyop_files ())
- {
- aos = tao_cg->anyop_header ();
-
- *aos << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *aos << "namespace " << node->local_name () << be_nl
- << "{" << be_idt;
- }
-
- // Generate code for the module definition by traversing thru the
- // elements of its scope. We depend on the front-end to have made sure
- // that only legal syntactic elements appear in our scope.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module_ch::"
- "visit_module - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl;
-
- *os << be_nl
- << "} // module " << node->name ();
-
- if (be_global->gen_anyop_files ())
- {
- *aos << be_uidt_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl;
-
- *aos << be_nl
- << "} // module " << node->name () << be_nl;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_module/module_ih.cpp b/TAO/TAO_IDL/be/be_visitor_module/module_ih.cpp
deleted file mode 100644
index 92eacef28aa..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_module/module_ih.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// module_ih.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Module in the implementation header
-//
-// = AUTHOR
-// Yamuna Krishnamurthy (yamuna@cs.wustl.edu)
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_module,
- module_ih,
- "$Id$")
-
-// ************************************************************
-// Module visitor for server header
-// ************************************************************
-
-be_visitor_module_ih::be_visitor_module_ih (be_visitor_context *ctx)
- : be_visitor_module (ctx)
-{
-}
-
-be_visitor_module_ih::~be_visitor_module_ih (void)
-{
-}
-
-int
-be_visitor_module_ih::visit_module (be_module *node)
-{
- if (!node->impl_hdr_gen () && !node->imported ())
- {
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module_ih::"
- "visit_module - "
- "codegen for scope failed\n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp b/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp
deleted file mode 100644
index 7466b7aa0f6..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// module_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Module in the server header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_module,
- module_sh,
- "$Id$")
-
-// ************************************************************
-// Module visitor for server header
-// ************************************************************
-
-be_visitor_module_sh::be_visitor_module_sh (be_visitor_context *ctx)
- : be_visitor_module (ctx)
-{
-}
-
-be_visitor_module_sh::~be_visitor_module_sh (void)
-{
-}
-
-int
-be_visitor_module_sh::visit_module (be_module *node)
-{
- // Not generated and not imported.
- if (node->srv_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Generate the skeleton class name.
-
- // Now generate the class definition. The prefix POA_ is prepended to our
- // name only if we are the outermost module.
- *os << "namespace ";
-
- if (!node->is_nested ())
- {
- // We are outermost module.
- *os << "POA_" << node->local_name () << be_nl;
- }
- else
- {
- // We are inside another module.
- *os << node->local_name () << be_nl;
- }
-
- *os << "{" << be_idt_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module_sh::"
- "visit_module - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "} // module "
- << node->name ();
-
- return 0;
-
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_module/serializer_op.cpp b/TAO/TAO_IDL/be/be_visitor_module/serializer_op.cpp
deleted file mode 100644
index 46418fd81bb..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_module/serializer_op.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the TAO::DCPS::Serializer operators
-// for types defined in Module's scope.
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_module,
- serializer_op,
- "$Id: serializer_op.cpp,v 1.2 1999/05/28 02:16:43 coryan Exp ")
-
-// ***************************************************************************
-// Module visitor for generating Serializer operator declarations in the client header
-// and stub
-// ***************************************************************************
-
-be_visitor_module_serializer_op::be_visitor_module_serializer_op (be_visitor_context *ctx)
- : be_visitor_module (ctx)
-{
-}
-
-be_visitor_module_serializer_op::~be_visitor_module_serializer_op (void)
-{
-}
-
-int
-be_visitor_module_serializer_op::visit_module (be_module *node)
-{
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module_serializer_op::visit_module - "
- "codegen for scope failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_native.cpp b/TAO/TAO_IDL/be/be_visitor_native.cpp
deleted file mode 100644
index 1f0b7a45424..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_native.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_native.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for native
-//
-// = AUTHOR
-// Johnny Willemsen
-//
-// ============================================================================
-
-#include "be_native.h"
-#include "be_helper.h"
-#include "be_extern.h"
-
-#include "be_visitor_native.h"
-#include "be_visitor_context.h"
-
-#include "be_visitor_native/native_ch.cpp"
-
-ACE_RCSID (be,
- be_visitor_native,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp b/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp
deleted file mode 100644
index b92c9828434..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// enum_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Native in the client header
-//
-// = AUTHOR
-// Johnny Willemsen
-//
-// ============================================================================
-
-#include "be_visitor_typecode/typecode_decl.h"
-
-ACE_RCSID (be_visitor_native,
- native_ch,
- "$Id$")
-
-
-// ********************************************************************
-// Visitor implementation for the Native type
-// This one for the client header file
-// ********************************************************************
-
-be_visitor_native_ch::be_visitor_native_ch (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_native_ch::~be_visitor_native_ch (void)
-{
-}
-
-// Visit the native_ch node and its scope.
-int
-be_visitor_native_ch::visit_native (be_native *node)
-{
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- const char *node_name = node->full_name ();
- if (ACE_OS::strcmp (node_name, "PortableServer::ServantLocator::Cookie") == 0)
- *os << "typedef void *Cookie;" << be_nl;
- else if (ACE_OS::strcmp (node_name, "CORBA::VoidData") == 0)
- *os << "typedef void *VoidData;" << be_nl;
-
- node->cli_hdr_gen (true);
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation.cpp
deleted file mode 100644
index 6b5b8e35f33..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_operation.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Operation
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_argument.h"
-#include "be_array.h"
-#include "be_attribute.h"
-#include "be_enum.h"
-#include "be_exception.h"
-#include "be_interface_fwd.h"
-#include "be_native.h"
-#include "be_operation.h"
-#include "be_module.h"
-#include "be_predefined_type.h"
-#include "be_sequence.h"
-#include "be_string.h"
-#include "be_structure.h"
-#include "be_type.h"
-#include "be_typedef.h"
-#include "be_union.h"
-#include "be_valuebox.h"
-#include "be_valuetype.h"
-#include "be_valuetype_fwd.h"
-#include "be_component.h"
-#include "be_component_fwd.h"
-#include "be_eventtype.h"
-#include "be_eventtype_fwd.h"
-#include "be_home.h"
-#include "be_extern.h"
-#include "be_helper.h"
-#include "utl_identifier.h"
-#include "utl_exceptlist.h"
-#include "nr_extern.h"
-
-#include "be_visitor_operation.h"
-#include "be_visitor_argument.h"
-#include "be_visitor_context.h"
-#include "ace/Log_Msg.h"
-#include "ace/String_Base.h"
-
-#include "be_visitor_operation/operation.cpp"
-#include "be_visitor_operation/arglist.cpp"
-#include "be_visitor_operation/argument.cpp"
-#include "be_visitor_operation/argument_invoke.cpp"
-#include "be_visitor_operation/argument_marshal.cpp"
-#include "be_visitor_operation/exceptlist_cs.cpp"
-#include "be_visitor_operation/exceptlist_ss.cpp"
-#include "be_visitor_operation/operation_ch.cpp"
-#include "be_visitor_operation/operation_cs.cpp"
-#include "be_visitor_operation/operation_sh.cpp"
-#include "be_visitor_operation/operation_ih.cpp"
-#include "be_visitor_operation/operation_ss.cpp"
-#include "be_visitor_operation/operation_is.cpp"
-#include "be_visitor_operation/rettype.cpp"
-#include "be_visitor_operation/rettype_return_cs.cpp"
-#include "be_visitor_operation/tie_sh.cpp"
-#include "be_visitor_operation/tie_si.cpp"
-#include "be_visitor_operation/upcall_command_ss.cpp"
-
-// AMI
-#include "be_visitor_operation/ami_ch.cpp"
-#include "be_visitor_operation/ami_cs.cpp"
-#include "be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp"
-#include "be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp"
-#include "be_visitor_operation/ami_exception_holder_operation_cs.cpp"
-
-// Smart proxy
-#include "be_visitor_operation/smart_proxy_ch.cpp"
-#include "be_visitor_operation/smart_proxy_cs.cpp"
-
-// Collocation
-#include "be_visitor_operation/proxy_impl_xh.cpp"
-#include "be_visitor_operation/direct_proxy_impl_ss.cpp"
-
-// AMH
-#include "be_visitor_operation/amh_ss.cpp"
-#include "be_visitor_operation/amh_sh.cpp"
-#include "be_visitor_operation/amh_rh_ss.cpp"
-#include "be_visitor_operation/amh_rh_sh.cpp"
-
-ACE_RCSID (be,
- be_visitor_operation,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp
deleted file mode 100644
index 2bdca1eeb58..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// $Id$
-//
-//
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// amh_rh_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating AMH-RH skeleton code for Operation node in the
-// skeleton header.
-//
-// = AUTHOR
-// Mayur Deshpande <mayur@ics.uci.edu>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- operation_amh_rh_sh,
- "$Id$")
-
-// ******************************************************
-// Visitor for generating AMH-RH skeleton for "operation"
-// in skeleton header.
-// ******************************************************
-
-be_visitor_amh_rh_operation_sh::be_visitor_amh_rh_operation_sh (
- be_visitor_context *ctx
- )
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_amh_rh_operation_sh::~be_visitor_amh_rh_operation_sh (void)
-{
-}
-
-int
-be_visitor_amh_rh_operation_sh::visit_operation (be_operation *node)
-{
- // Nothing to be done for oneway operations.
- if (node->flags () == AST_Operation::OP_oneway)
- {
- return 0;
- }
-
- // Output stream.
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- be_interface *intf;
- intf = this->ctx_->attribute ()
- ? be_interface::narrow_from_scope (this->ctx_->attribute()->defined_in ())
- : be_interface::narrow_from_scope (node->defined_in ());
-
- if (!intf)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_rh_operation_sh::"
- "visit_operation - "
- "bad interface scope\n"),
- -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "virtual void ";
-
- // Step 2: Generate the method name
- // Check if we are an attribute node in disguise.
- if (this->ctx_->attribute ())
- {
- // Now check if we are a "get" or "set" operation.
- if (node->nmembers () == 1)
- {
- *os << "set_";
- }
- else
- {
- *os << "get_";
- }
- }
-
- *os << node->local_name();
-
- be_visitor_context ctx (*this->ctx_);
- be_visitor_operation_arglist visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_amh_rh_sh::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- *os << ";";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp
deleted file mode 100644
index 3983afa8dbd..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp
+++ /dev/null
@@ -1,253 +0,0 @@
-//=============================================================================
-/**
- * @file amh_rh_ss.cpp
- *
- * $Id$
- *
- * Creates code for AMH-RH operations.
- *
- * @author Mayur Deshpande <mayur@ics.uci.edu>
- */
-//=============================================================================
-
-ACE_RCSID (be_visitor_operation,
- amh_rh_ss,
- "$Id$")
-
-be_visitor_amh_rh_operation_ss::be_visitor_amh_rh_operation_ss (
- be_visitor_context *ctx
- )
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_amh_rh_operation_ss::~be_visitor_amh_rh_operation_ss (void)
-{
-}
-
-int
-be_visitor_amh_rh_operation_ss::visit_operation (be_operation *node)
-{
- // Nothing to be done for oneway operations.
- if (node->flags () == AST_Operation::OP_oneway)
- {
- return 0;
- }
-
- // Output stream.
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_interface *intf =
- be_interface::narrow_from_scope (node->defined_in ());
-
- if (this->ctx_->attribute () != 0)
- {
- intf = be_interface::narrow_from_scope (
- this->ctx_->attribute()->defined_in ()
- );
- }
-
- if (!intf)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_rh_operation_ss::"
- "visit_operation - "
- "bad interface scope\n"),
- -1);
- }
-
- char *buf;
- intf->compute_full_name ("TAO_", "", buf);
- ACE_CString response_handler_implementation_name ("POA_");
- response_handler_implementation_name += buf;
- // buf was allocated by ACE_OS::strdup, so we need to use free instead
- // of delete.
- ACE_OS::free (buf);
- buf = 0;
-
- // Step 1 : Generate return type: always void
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "void" << be_nl
- << response_handler_implementation_name.c_str () << "::";
-
- // Check if we are an attribute node in disguise
- if (this->ctx_->attribute ())
- {
- // now check if we are a "get" or "set" operation
- if (node->nmembers () == 1) // set
- {
- *os << "_set_";
- }
- else
- {
- *os << "_get_";
- }
- }
-
- *os << node->local_name ();
-
- // Step 2 : Generate the params of the method
- be_visitor_context ctx (*this->ctx_);
-
- // Set the substate because response handler operations without
- // parameters don't use the environment parameter in the body.
- ctx.sub_state (TAO_CodeGen::TAO_AMH_RESPONSE_HANDLER_OPERATION);
-
- be_visitor_operation_arglist visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_rh_operation_ss::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- int is_an_exception_reply = 0;
-
- // Find out if the operation is one of the *_excep() operations, the
- // conditions are:
- // 1) The local_name ends in _excep()
- // 2) There is exactly one argument
- // 3) The argument takes an implied valuetype generated from the
- // original interface
- // 4) The implied valuetype ends in ExceptionHolder
- const char *last_underbar = ACE_OS::strrchr (node->full_name (), '_');
-
- if (last_underbar != 0
- && ACE_OS::strcmp (last_underbar, "_excep") == 0)
- {
- if (node->nmembers () == 1)
- {
- UTL_ScopeActiveIterator i (node,
- UTL_Scope::IK_decls);
-
- if (!i.is_done ())
- {
- be_argument *argument =
- be_argument::narrow_from_decl (i.item ());
- be_valuetype *vt =
- be_valuetype::narrow_from_decl (argument->field_type ());
-
- if (vt != 0
- && vt->original_interface () == intf->original_interface ())
- {
- const char *last_E =
- ACE_OS::strrchr (vt->full_name (), 'E');
-
- if (last_E != 0
- && ACE_OS::strcmp (last_E, "ExceptionHolder") == 0)
- {
- is_an_exception_reply = 1;
- }
- }
- }
- }
- }
-
- if (is_an_exception_reply)
- {
- // Remove the trailing '_excep' from the operation name, we know
- // there is one from the checks above...
- ACE_CString operation_name (node->local_name ()->get_string ());
- ACE_CString::size_type const idx = operation_name.rfind ('_');
- ACE_ASSERT (idx != ACE_CString::npos);
- operation_name[idx] = '\0';
-
- *os << be_nl << "{" << be_idt_nl
- << (be_global->use_raw_throw () ? "try" : "ACE_TRY") << be_nl
- << "{" << be_idt_nl
- << "holder->raise_" << operation_name.c_str ()
- << " ("
- << (be_global->use_raw_throw ()
- ? ""
- : "ACE_ENV_SINGLE_ARG_PARAMETER")
- << ");" << ace_try_check << be_uidt_nl
- << "}" << be_nl
- << (be_global->use_raw_throw ()
- ? "catch ( ::CORBA::Exception& ex)"
- : "ACE_CATCH ( ::CORBA::Exception, ex)")
- << be_nl
- << "{" << be_idt_nl
- << "this->_tao_rh_send_exception (ex"
- << (be_global->use_raw_throw () ? "" : " ACE_ENV_ARG_PARAMETER")
- << ");" << TAO_ACE_CHECK () << be_uidt_nl
- << "}" << ace_endtry << be_uidt_nl
- << "}";
- }
- else
- {
- // Step 3: Generate actual code for the method
- *os << be_nl << "{" << be_idt_nl
- << "this->_tao_rh_init_reply ("
- << (be_global->use_raw_throw ()
- ? ""
- : "ACE_ENV_SINGLE_ARG_PARAMETER")
- << ");" << TAO_ACE_CHECK () << be_nl << be_nl;
-
- this->marshal_params (node);
-
- *os << be_nl
- << "this->_tao_rh_send_reply ("
- << (be_global->use_raw_throw ()
- ? ""
- : "ACE_ENV_SINGLE_ARG_PARAMETER")
- << ");" << be_uidt_nl
- << "}";
- }
-
- return 0;
-}
-
-
-int
-be_visitor_amh_rh_operation_ss::marshal_params (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor_context ctx;
-
- // Now make sure that we have some in and inout parameters. Otherwise, there
- // is nothing to be marshaled out.
- if (this->has_param_type (node, AST_Argument::dir_IN) ||
- this->has_param_type (node, AST_Argument::dir_INOUT))
- {
- // marshal the in and inout arguments
- *os << "if (!(" << be_idt << be_idt_nl;
-
- // Marshal each in and inout argument.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
- be_visitor_operation_argument_invoke visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_rh_operation_ss::"
- "gen_demarshal_params - "
- "codegen for demarshal failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << "))" << be_nl
- << "{" << be_idt_nl;
-
- // If marshaling fails, raise exception.
- if (this->gen_raise_exception (0,
- "::CORBA::MARSHAL",
- "") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) gen_raise_exception failed\n"),
- -1);
- }
-
- *os << be_uidt_nl
- << "}" << be_uidt_nl;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp
deleted file mode 100644
index 333063bd543..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp
+++ /dev/null
@@ -1,225 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// amh_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating AMH skeleton code for Operation node in the
-// skeleton header.
-//
-// = AUTHOR
-// Mayur Deshpande <mayur@ics.uci.edu>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- amh_sh,
- "$Id$")
-
-// ******************************************************
-// Visitor for generating AMH skeleton for "operation" in skeleton header.
-// ******************************************************
-
-be_visitor_amh_operation_sh::be_visitor_amh_operation_sh (
- be_visitor_context *ctx
- )
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_amh_operation_sh::~be_visitor_amh_operation_sh (void)
-{
-}
-
-int
-be_visitor_amh_operation_sh::visit_operation (be_operation *node)
-{
- // If there is an argument of type "native", return immediately.
- if (node->has_native ())
- {
- return 0;
- }
-
- // Output stream.
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- this->generate_shared_prologue (node, os, "");
-
- be_visitor_context ctx (*this->ctx_);
- be_visitor_args_arglist arglist_visitor (&ctx);
- arglist_visitor.set_fixed_direction (AST_Argument::dir_IN);
- ctx.scope (node);
-
- for (UTL_ScopeActiveIterator i (node, UTL_Scope::IK_decls);
- !i.is_done ();
- i.next ())
- {
- be_argument *argument =
- be_argument::narrow_from_decl (i.item ());
-
- if (argument == 0
- || argument->direction () == AST_Argument::dir_OUT)
- {
- continue;
- }
-
- *os << "," << be_nl;
-
- if (arglist_visitor.visit_argument (argument) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_operation_sh::"
- "visit_operation - "
- "codegen for upcall args failed\n"),
- -1);
- }
- }
-
- *os << env_decl << be_uidt_nl
- << ")" << be_uidt_nl;
-
- if (be_global->use_raw_throw ())
- {
- *os << "throw (";
- }
- else
- {
- *os << "ACE_THROW_SPEC ((";
- }
-
- *os << " ::CORBA::SystemException";
-
- if (be_global->use_raw_throw ())
- {
- *os << ")";
- }
- else
- {
- *os << "))";
- }
-
- *os << " = 0;";
-
- return 0;
-}
-
-int
-be_visitor_amh_operation_sh::visit_attribute (be_attribute *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- this->generate_shared_prologue (node, os, "_get_");
-
- if (!be_global->exception_support ())
- {
- *os << env_decl;
- }
-
- *os << be_uidt_nl
- << ")" << be_uidt_nl
- << "ACE_THROW_SPEC (( ::CORBA::SystemException)) = 0;" << be_nl;
-
- if (node->readonly ())
- {
- return 0;
- }
-
- this->generate_shared_prologue (node, os, "_set_");
-
- *os << "," << be_nl;
-
- be_argument the_argument (AST_Argument::dir_IN,
- node->field_type (),
- node->name ());
- be_visitor_context ctx (*this->ctx_);
- be_visitor_args_arglist visitor (&ctx);
-
- int status = visitor.visit_argument (&the_argument);
-
- the_argument.destroy ();
-
- if (-1 == status)
- {
- return -1;
- }
-
- if (!be_global->exception_support ())
- {
- *os << env_decl;
- }
-
- *os << be_uidt_nl << ")" << be_uidt_nl
- << "ACE_THROW_SPEC (( ::CORBA::SystemException)) = 0;" << be_nl;
-
- return 0;
-}
-
-void
-be_visitor_amh_operation_sh::generate_shared_prologue (
- be_decl *node,
- TAO_OutStream *os,
- const char *skel_prefix
- )
-{
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "static void " << skel_prefix
- << node->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest &_tao_req," << be_nl
- << "void *_tao_obj," << be_nl
- << "void *_tao_servant_upcall" << env_decl << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // We need the interface node in which this operation was defined. However,
- // if this operation node was an attribute node in disguise, we get this
- // information from the context
- be_interface *intf =
- be_interface::narrow_from_scope (node->defined_in ());
-
- if (this->ctx_->attribute () != 0)
- {
- intf = be_interface::narrow_from_scope (
- this->ctx_->attribute()->defined_in ()
- );
- }
-
- if (intf == 0)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_visitor_amh_operation_sh::"
- "visit_operation - "
- "bad interface scope\n"));
- return;
- }
-
- // Step 1 : Generate return type: always void
- *os << "virtual void ";
-
- // Step 2: Generate the method name
- *os << node->local_name() << " (" << be_idt << be_idt_nl;
-
- // STEP 3: Generate the argument list with the appropriate
- // mapping. For these we grab a visitor that generates the
- // parameter listing. We also generate the ResponseHandler
- // argument 'on the fly' and add it to the argument list
-
- char *buf;
- // @@ TODO this must be kept consistent with the code in
- // be_visitor_interface/amh_sh.cpp
- intf->compute_full_name ("AMH_", "ResponseHandler_ptr", buf);
-
- *os << buf << " _tao_rh";
- // buf was allocated by ACE_OS::strdup, so we must use free instead
- // of delete.
- ACE_OS::free (buf);
- buf = 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp
deleted file mode 100644
index 909176025cf..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp
+++ /dev/null
@@ -1,423 +0,0 @@
-//=============================================================================
-/**
-* @file amh_ss.cpp
-*
-* $Id$
-*
-* Creates code for AMH operations.
-*
-* @author Darrell Brunsch <brunsch@cs.wustl.edu>
-*/
-//=============================================================================
-
-ACE_RCSID (be_visitor_operation,
- amh_ss,
- "$Id$")
-
-#include "ace/SString.h"
-
-be_visitor_amh_operation_ss::be_visitor_amh_operation_ss (
- be_visitor_context *ctx
- )
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_amh_operation_ss::~be_visitor_amh_operation_ss (void)
-{
-}
-
-int
-be_visitor_amh_operation_ss::visit_operation (be_operation *node)
-{
- // If there is an argument of type "native", return immediately.
- if (node->has_native ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- if (this->generate_shared_prologue (node, os, "") == -1)
- {
- return -1;
- }
-
- int argument_count =
- node->count_arguments_with_direction (AST_Argument::dir_IN
- | AST_Argument::dir_INOUT);
-
- if (argument_count != 0)
- {
- // Declare variables for arguments.
- be_visitor_context vardecl_ctx = *this->ctx_;
- vardecl_ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_DECL_SS);
-
- be_visitor_args_vardecl_ss vardecl_visitor (&vardecl_ctx);
- vardecl_visitor.set_fixed_direction (AST_Argument::dir_IN);
-
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- be_argument *argument =
- be_argument::narrow_from_decl (si.item ());
-
- if (argument == 0
- || argument->direction () == AST_Argument::dir_OUT)
- {
- continue;
- }
-
- if (vardecl_visitor.visit_argument (argument) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_operation_ss::"
- "visit_operation - "
- "codegen for return var decl failed\n"),
- -1);
- }
- }
-
- *os << be_nl
- << "TAO_InputCDR & _tao_in ="
- << " *_tao_server_request.incoming ();" << be_nl << be_nl
- << "if (!(" << be_idt << be_idt;
-
- // Marshal each in and inout argument.
- be_visitor_context marshal_ctx = *this->ctx_;
- marshal_ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS);
- marshal_ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
-
- be_visitor_args_marshal_ss marshal_visitor (&marshal_ctx);
- marshal_visitor.set_fixed_direction (AST_Argument::dir_IN);
- int i = 0;
-
- for (UTL_ScopeActiveIterator sj (node, UTL_Scope::IK_decls);
- !sj.is_done ();
- sj.next ())
- {
- be_argument *argument =
- be_argument::narrow_from_decl (sj.item ());
-
- if (argument == 0
- || argument->direction () == AST_Argument::dir_OUT)
- {
- continue;
- }
-
- if (i++ != 0)
- {
- *os << " &&";
- }
-
- if (marshal_visitor.visit_argument (argument) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for demarshal failed\n"),
- -1);
- }
- }
-
- *os << be_uidt_nl << "))" << be_nl;
-
- // If marshaling fails, raise exception.
- if (this->gen_raise_exception (0,
- "::CORBA::MARSHAL",
- "") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) gen_raise_exception failed\n"),
- -1);
- }
-
- *os << be_uidt_nl;
- }
-
- if (this->generate_shared_section (node, os) == -1)
- {
- return -1;
- }
-
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS);
- be_visitor_args_upcall_ss visitor (&ctx);
- visitor.set_fixed_direction (AST_Argument::dir_IN);
-
- for (UTL_ScopeActiveIterator i (node, UTL_Scope::IK_decls);
- !i.is_done ();)
- {
- be_argument *argument =
- be_argument::narrow_from_decl (i.item ());
-
- i.next ();
-
- if (argument == 0
- || argument->direction () == AST_Argument::dir_OUT)
- {
- continue;
- }
-
- *os << ",";
-
- if (argument->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_amh_operation_ss::"
- "visit_operation - "
- "codegen for upcall args failed\n"),
- -1);
- }
- }
-
- *os << env_arg;
- }
-
- if (this->generate_shared_epilogue (os) == -1)
- {
- return -1;
- }
-
- return 0;
-
-}
-
-int
-be_visitor_amh_operation_ss::visit_attribute (be_attribute *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- if (this->generate_shared_prologue (node, os, "_get_") == -1)
- {
- return -1;
- }
-
- if (this->generate_shared_section (node, os) == -1)
- {
- return -1;
- }
-
- *os << env_arg;
-
- if (this->generate_shared_epilogue (os) == -1)
- {
- return -1;
- }
-
- if (node->readonly ())
- {
- return 0;
- }
-
- if (this->generate_shared_prologue (node, os, "_set_") == -1)
- {
- return -1;
- }
-
- be_argument the_argument (AST_Argument::dir_IN,
- node->field_type (),
- node->name ());
-
- int status = 0;
-
- {
- be_visitor_context ctx (*this->ctx_);
- be_visitor_args_vardecl_ss vardecl_visitor (&ctx);
-
- status = vardecl_visitor.visit_argument (&the_argument);
-
- if (-1 == status)
- {
- the_argument.destroy ();
- return -1;
- }
- }
-
- *os << be_nl
- << "TAO_InputCDR & _tao_in ="
- << " *_tao_server_request.incoming ();"
- << be_nl << be_nl
- << "if (!(" << be_idt << be_idt;
-
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- be_visitor_args_marshal_ss marshal_visitor (&ctx);
-
- status = marshal_visitor.visit_argument (&the_argument);
-
- if (-1 == status)
- {
- the_argument.destroy ();
- return -1;
- }
- }
-
- *os << be_uidt_nl << "))" << be_nl
- << "{" << be_idt_nl;
-
- // If marshaling fails, raise exception.
- status = this->gen_raise_exception (0,
- "::CORBA::MARSHAL",
- "");
- if (-1 == status)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) gen_raise_exception failed\n"),
- -1);
- }
-
- *os << be_uidt_nl
- << "}" << be_uidt_nl;
-
- if (-1 == this->generate_shared_section (node, os))
- {
- return -1;
- }
-
- *os << ",";
-
- {
- be_visitor_args_upcall_ss upcall_visitor (this->ctx_);
- status = upcall_visitor.visit_argument (&the_argument);
- the_argument.destroy ();
-
- if (-1 == status)
- {
- return -1;
- }
- }
-
- *os << env_arg;
-
- if (-1 == this->generate_shared_epilogue (os))
- {
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_amh_operation_ss::generate_shared_prologue (be_decl *node,
- TAO_OutStream *os,
- const char *skel_prefix)
-{
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // We need the interface node in which this operation was defined. However,
- // if this operation node was an attribute node in disguise, we get this
- // information from the context
- be_interface *intf =
- be_interface::narrow_from_scope (node->defined_in ());
-
- if (intf == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "bad interface scope\n"),
- -1);
- }
-
-
- char *buf;
- intf->compute_full_name ("AMH_", "", buf);
- ACE_CString amh_skel_name ("POA_");
- amh_skel_name += buf;
- // buf was allocated by ACE_OS::strdup, so we need to use free instead
- // of delete.
- ACE_OS::free (buf);
- buf = 0;
-
- *os << "void" << be_nl
- << amh_skel_name.c_str () << "::"
- << skel_prefix
- << node->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & _tao_server_request," << be_nl
- << "void * /* context */," << be_nl
- << "void * _tao_servant" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl;
-
- // Generate the actual code for the skeleton.
- // last argument - is always ACE_ENV_ARG_PARAMETER.
- *os << "{" << be_idt_nl;
-
- // Get the right object implementation.
- *os << amh_skel_name.c_str () << " * const _tao_impl =" << be_idt_nl
- << "static_cast<" << amh_skel_name.c_str () << " *> ("
- << "_tao_servant" << ");" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_amh_operation_ss::generate_shared_section (be_decl *node,
- TAO_OutStream *os)
-{
- be_interface *intf =
- be_interface::narrow_from_scope (node->defined_in ());
-
- // Create the response handler
- char *buf;
- intf->compute_full_name ("TAO_AMH_", "ResponseHandler", buf);
- ACE_CString response_handler_implementation_name ("POA_");
- response_handler_implementation_name += buf;
- // buf was allocated by ACE_OS::strdup, so we need to use free instead
- // of delete.
- ACE_OS::free (buf);
- buf = 0;
-
- *os << be_nl
- << "TAO_ORB_Core *orb_core =" << be_idt_nl
- << "_tao_server_request.orb ()->orb_core ();" << be_uidt_nl << be_nl
- << "TAO_AMH_BUFFER_ALLOCATOR* amh_allocator =" << be_idt_nl
- << "orb_core->lane_resources ().amh_response_handler_allocator ();"
- << be_uidt_nl << be_nl
- << "TAO::TAO_Buffer_Allocator<" << be_idt << be_idt_nl
- << response_handler_implementation_name.c_str () << "," << be_nl
- << "TAO_AMH_BUFFER_ALLOCATOR" << be_uidt_nl
- << "> buffer_allocator (amh_allocator);"
- << be_uidt_nl << be_nl
- << response_handler_implementation_name.c_str ()
- << "_ptr _tao_rh_ptr = "
- << be_idt_nl
- << "buffer_allocator.allocate();"
- << be_uidt_nl << be_nl
- << "if (!_tao_rh_ptr) " << be_idt_nl << "ACE_THROW ( ::CORBA::NO_MEMORY ());"
- << be_uidt_nl;
-
- // Initialize amh rh
- *os << be_nl << "_tao_rh_ptr->init (_tao_server_request, amh_allocator);" << be_nl
- << be_nl;
-
- *os << "ACE_Utils::Auto_Functor <"
- << response_handler_implementation_name.c_str ()
- << ", TAO::ARH_Refcount_Functor> safe_rd_(_tao_rh_ptr);"
- << be_nl;
-
- // Make the upcall.
- *os << be_nl << "_tao_impl->"
- << node->local_name () << " (" << be_idt << be_idt_nl
- << "safe_rd_.get ()";
-
- return 0;
-}
-
-int
-be_visitor_amh_operation_ss::generate_shared_epilogue (TAO_OutStream *os)
-{
- *os << be_uidt_nl << ");"
- << be_uidt << be_uidt_nl
- << "}";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp
deleted file mode 100644
index 499e8884793..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating AMI stub code for Operation node in the
-// client header.
-//
-// = AUTHOR
-// Alexander Babu Arulanthu <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- operation_ami_ch,
- "$Id$")
-
-// ******************************************************
-// Visitor for generating AMI stub for "operation" in client header.
-// ******************************************************
-
-be_visitor_operation_ami_ch::be_visitor_operation_ami_ch (
- be_visitor_context *ctx
- )
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ami_ch::~be_visitor_operation_ami_ch (void)
-{
-}
-
-int
-be_visitor_operation_ami_ch::visit_operation (be_operation *node)
-{
- // No sendc method for oneway operations.
- if (node->flags () == AST_Operation::OP_oneway)
- {
- return 0;
- }
-
- // Output stream.
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Every operation is declared virtual in the client code.
- *os << be_nl << be_nl
- << "virtual ";
-
- // STEP I: Return type is void.
- *os << "void ";
-
- // STEP 2: Generate the operation name.
-
- // First the sendc prefix.
- *os << "sendc_";
-
- // Check if we are an attribute node in disguise.
- if (this->ctx_->attribute ())
- {
- // Now check if we are a "get" or "set" operation.
- if (node->nmembers () == 1)
- {
- *os << "set_";
- }
- else
- {
- *os << "get_";
- }
- }
-
- *os << node->local_name ();
-
- // STEP 3: Generate the argument list with the appropriate
- // mapping. For these we grab a visitor that generates the
- // parameter listing.
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_CH);
- be_visitor_operation_arglist visitor (&ctx);
- be_operation *arguments = node->arguments ();
-
- // If a local node's parent has a sendc_* operation, we must
- // regenerate it as pure virtual, so we temporarily set the
- // strategy-related node to local, if necessary, and restore
- // it after the visitor returns.
- bool orig_local = arguments->is_local ();
- arguments->set_local (node->is_local ());
-
- if (node->arguments ()->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- arguments->set_local (orig_local);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp
deleted file mode 100644
index 9601c14d2ca..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp
+++ /dev/null
@@ -1,319 +0,0 @@
-//
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale,
-// Alexander Babu Arulanthu <alex@cs.wustl.edu>
-// Michael Kircher
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- operation_ami_cs,
- "$Id$")
-
-// ************************************************************
-// Operation visitor for client stubs
-// ************************************************************
-
-be_visitor_operation_ami_cs::be_visitor_operation_ami_cs (
- be_visitor_context *ctx
- )
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ami_cs::~be_visitor_operation_ami_cs (void)
-{
-}
-
-// Processing to be done after every element in the scope is
-// processed.
-int
-be_visitor_operation_ami_cs::post_process (be_decl *bd)
-{
- // all we do here is to insert a comma and a newline
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (!this->last_node (bd))
- {
- *os << ",\n";
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_ami_cs::visit_operation (be_operation *node)
-{
- // No sendc method for oneway operations.
- if (node->flags () == AST_Operation::OP_oneway)
- {
- return 0;
- }
-
- be_visitor_context ctx;
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Generate the return type mapping. Return type is simply void.
- *os << be_nl << be_nl
- << "void" << be_nl;
-
- // Generate the operation name.
-
- // Grab the scope name.
- be_decl *parent =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
-
- if (parent == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "scope name is nil\n"),
- -1);
- }
-
- // Generate the scope::operation name.
- *os << parent->full_name ()
- << "::sendc_";
-
- // Check if we are an attribute node in disguise.
- if (this->ctx_->attribute ())
- {
- // Now check if we are a "get" or "set" operation.
- if (node->nmembers () == 1)
- {
- *os << "set_";
- }
- else
- {
- *os << "get_";
- }
- }
-
- *os << node->local_name ()->get_string ();
-
- // Generate the argument list with the appropriate mapping (same as
- // in the header file)
- ctx = *this->ctx_;
- be_visitor_operation_arglist oa_visitor (&ctx);
-
- // Get the AMI version from the strategy class.
- be_operation *ami_op = node->arguments ();
-
- if (ami_op->accept (&oa_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- // Generate the actual code for the stub. However, if any of the argument
- // types is "native", we flag a MARSHAL exception.
- // last argument - is always ACE_ENV_ARG_PARAMETER
- *os << be_nl << "{" << be_idt;
-
- if (be_global->exception_support ())
- {
- *os << be_nl
- << "ACE_DECLARE_NEW_CORBA_ENV;";
- }
-
- if (node->has_native ()) // native exists => no stub
- {
- be_predefined_type bpt (AST_PredefinedType::PT_void,
- 0);
-
- int status = this->gen_raise_exception (&bpt,
- "::CORBA::MARSHAL",
- "");
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for has-native exception failed\n"),
- -1);
- }
- }
- else
- {
- *os << be_nl
- << "if (!this->is_evaluated ())" << be_idt_nl
- << "{" << be_idt_nl
- << "::CORBA::Object::tao_object_initialize (this);"
- << be_uidt_nl
- << "}" << be_uidt_nl << be_nl;
-
- *os << "if (this->the_TAO_" << parent->local_name ()
- << "_Proxy_Broker_ == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << parent->flat_name () << "_setup_collocation ("
- << ");" << be_uidt_nl
- << "}" << be_uidt;
- }
-
- *os << be_nl<< be_nl
- << "TAO::Arg_Traits<void>::ret_val _tao_retval;";
-
- // Declare the argument helper classes.
- this->gen_stub_body_arglist (ami_op, os, true);
-
- // Assemble the arg helper class pointer array.
- *os << be_nl << be_nl
- << "TAO::Argument *_the_tao_operation_signature [] =" << be_idt_nl
- << "{" << be_idt_nl
- << "&_tao_retval";
-
- AST_Argument *arg = 0;
- UTL_ScopeActiveIterator arg_list_iter (ami_op,
- UTL_Scope::IK_decls);
-
- // For a sendc_* operation, skip the reply handler (first argument).
- arg_list_iter.next ();
-
- for (; ! arg_list_iter.is_done (); arg_list_iter.next ())
- {
- arg = AST_Argument::narrow_from_decl (arg_list_iter.item ());
-
- *os << "," << be_nl
- << "&_tao_" << arg->local_name ();
- }
-
- *os << be_uidt_nl
- << "};" << be_uidt;
-
- be_interface *intf = be_interface::narrow_from_decl (parent);
-
- // Includes the reply handler, but we have to add 1 for the retval anyway.
- int nargs = ami_op->argument_count ();
-
- const char *lname = node->local_name ()->get_string ();
- size_t opname_len = ACE_OS::strlen (lname);
- ACE_CString opname;
-
- if (this->ctx_->attribute ())
- {
- // If we are a attribute node, add 5 for '_get_' or '_set_'.
- opname_len += 5;
-
- // Now check if we are a "get" or "set" operation.
- if (node->nmembers () == 1)
- {
- opname = "_set_";
- }
- else
- {
- opname = "_get_";
- }
- }
-
- opname += lname;
-
- *os << be_nl << be_nl
- << "TAO::Asynch_Invocation_Adapter _tao_call (" << be_idt << be_idt_nl
- << "this," << be_nl
- << "_the_tao_operation_signature," << be_nl
- << nargs << "," << be_nl
- << "\"" << opname.fast_rep () << "\"," << be_nl
- << opname_len << "," << be_nl
- << "this->the" << intf->base_proxy_broker_name () << "_"
- << be_uidt_nl
- << ");" << be_uidt;
-
- *os << be_nl << be_nl
- << "_tao_call.invoke (" << be_idt << be_idt_nl
- << "ami_handler," << be_nl
- << "&";
-
- if (parent->is_nested ())
- {
- be_decl *gparent =
- be_scope::narrow_from_scope (parent->defined_in ())->decl ();
-
- *os << gparent->name () << "::";
- }
-
- *os << "AMI_" << parent->local_name () << "Handler::"
- << opname.fast_rep () + (this->ctx_->attribute () != 0)
- << "_reply_stub" << env_arg << be_uidt_nl
- << ");" << be_uidt
- << TAO_ACE_CHECK ();
-
- *os << be_uidt_nl
- << "}";
-
- return 0;
-}
-
-// This method is used to generate the ParamData table entry.
-int
-be_visitor_operation_ami_cs::visit_argument (be_argument *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt; // argument type
-
- // Retrieve the type for this argument.
- bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- os->indent ();
- *os << "{" << bt->tc_name () << ", ";
-
- switch (node->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "PARAM_IN, ";
- break;
- case AST_Argument::dir_INOUT:
- *os << "PARAM_INOUT, ";
- break;
- case AST_Argument::dir_OUT:
- *os << "PARAM_OUT, ";
- break;
- }
-
- *os << "0}";
-
- return 0;
-}
-
-int
-be_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *node,
- be_type *bt)
-{
- // Nothing to be done here, we do not through any exceptions,
- // besides system exceptions, so we do not need an user exception table.
- ACE_UNUSED_ARG (node);
- ACE_UNUSED_ARG (bt);
-
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_exception_holder_operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_exception_holder_operation_cs.cpp
deleted file mode 100644
index 07a98139f2d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_exception_holder_operation_cs.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_exception_holder_operation_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the stubs file.
-//
-// = AUTHOR
-// Michael Kircher <Michael.Kircher@mchp.siemens.de>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- ami_exception_holder_operation_cs,
- "$Id$")
-
-// ************************************************************
-// Operation visitor for client stubs
-// ************************************************************
-
-be_visitor_operation_ami_exception_holder_operation_cs::
-be_visitor_operation_ami_exception_holder_operation_cs (
- be_visitor_context *ctx
- )
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ami_exception_holder_operation_cs::
-~be_visitor_operation_ami_exception_holder_operation_cs (void)
-{
-}
-
-int
-be_visitor_operation_ami_exception_holder_operation_cs::visit_operation (
- be_operation *
- )
-{
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp
deleted file mode 100644
index 75921685b61..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_reply_stub_operation_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for AMI Handler call back operation in
-// the client header.
-//
-// = AUTHOR
-// Aniruddha Gokhale and Alexander Babu Arulanthu
-// <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- ami_handler_reply_stub_operation_ch,
- "$Id$")
-
-// ************************************************************
-// Operation visitor for server header
-// ************************************************************
-
-be_visitor_operation_ami_handler_reply_stub_operation_ch::
-be_visitor_operation_ami_handler_reply_stub_operation_ch (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ami_handler_reply_stub_operation_ch::
-~be_visitor_operation_ami_handler_reply_stub_operation_ch (void)
-{
-}
-
-int
-be_visitor_operation_ami_handler_reply_stub_operation_ch::visit_operation (
- be_operation *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- // Generate the corresponding static skeleton method for this
- // operation only if there was no "native" type.
- if (!node->has_native ())
- {
- // Next line.
- *os << be_nl << be_nl
- << "static void ";
-
- // Check if we are an attribute node in disguise
- if (this->ctx_->attribute ())
- {
- // Now check if we are a "get" or "set" operation.
- if (node->nmembers () == 1)
- {
- *os << "_set_";
- }
- else
- {
- *os << "_get_";
- }
- }
-
- *os << node->local_name ()
- << "_reply_stub (" << be_idt << be_idt_nl;
-
- *os << "TAO_InputCDR &_tao_reply_cdr," << be_nl
- << "::Messaging::ReplyHandler_ptr _tao_reply_handler," << be_nl
- << "::CORBA::ULong reply_status";
-
- *os << env_dflts << be_uidt_nl
- << ");" << be_uidt;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp
deleted file mode 100644
index f2be62d4586..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp
+++ /dev/null
@@ -1,461 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_reply_stub_operation_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the stubs file.
-//
-// = AUTHOR
-// Alexander Babu Arulanthu <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- ami_handler_reply_stub_operation_cs,
- "$Id$")
-
-// ************************************************************
-// Operation visitor for client stubs.
-// ************************************************************
-
-be_visitor_operation_ami_handler_reply_stub_operation_cs::
-be_visitor_operation_ami_handler_reply_stub_operation_cs (
- be_visitor_context *ctx
- )
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ami_handler_reply_stub_operation_cs::
-~be_visitor_operation_ami_handler_reply_stub_operation_cs (void)
-{
-}
-
-// Processing to be done after every element in the scope is processed
-int
-be_visitor_operation_ami_handler_reply_stub_operation_cs::post_process (
- be_decl *bd
- )
-{
- // All we do here is to insert a comma and a newline.
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (!this->last_node (bd))
- {
- *os << ",\n";
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_reply_stub_operation_cs::visit_operation (
- be_operation *node
- )
-{
- be_type *bt;
- be_visitor_context ctx;
-
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- // Initialize the return type variable.
- bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_ami_handler_reply_stub_operation_cs::"
- "visit_operation - "
- "Bad return type\n"
- ),
- -1
- );
- }
-
- // Start with the current indentation level.
- os->indent ();
-
- // Generate the return type. Return type is simply void.
- *os << be_nl << "void" << be_nl;
-
- // Get the scope name.
- be_decl *parent =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
-
- if (!parent)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_reply_stub_operation_cs::"
- "visit_operation - "
- "node information not sufficient :-<\n"
- ),
- -1
- );
- }
-
- // Genereate scope name.
- *os << parent->full_name ();
-
- // Generate the operation name.
- *os << "::";
-
- // Check if we are an attribute node in disguise
- if (this->ctx_->attribute ())
- {
- // Now check if we are a "get" or "set" operation
- if (node->nmembers () == 1)
- {
- *os << "_set_";
- }
- else
- {
- *os << "_get_";
- }
- }
-
- *os << node->local_name () << "_reply_stub (" << be_idt_nl;
-
- // Generate the argument list.
- *os << "TAO_InputCDR &_tao_in, " << be_nl
- << "::Messaging::ReplyHandler_ptr _tao_reply_handler," << be_nl
- << "::CORBA::ULong reply_status"
- << env_decl << ")" << be_uidt << be_uidt_nl
- << "{" << be_idt_nl;
-
- *os << "// Retrieve Reply Handler object." << be_nl;
- *os << parent->full_name () << "_var "
- << "_tao_reply_handler_object =" << be_idt_nl;
-
- *os << parent->full_name ();
- *os << "::_narrow (_tao_reply_handler"
- << (be_global->use_raw_throw () ? "" : " ACE_ENV_ARG_PARAMETER")
- << ");" << be_uidt
- << TAO_ACE_CHECK () << be_nl << be_nl
- << "// Exception handling" << be_nl
- << "switch (reply_status)" << be_nl
- << "{" << be_idt_nl
- << "case TAO_AMI_REPLY_OK:" << be_nl
- << "{" << be_idt << "\n";
-
- // declare variables for arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_DECL_SS);
- be_visitor_operation_argument oad_visitor (&ctx);
-
- if (node->accept (&oad_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) ami_handler_reply_stub_operation_cs::"
- "visit_operation - "
- "codegen for return var decl failed\n"),
- -1);
- }
-
- // Demarshal parameters
- if (this->gen_marshal_and_invoke (node, bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%1) ami_handler_reply_stub_operation_cs::"
- "visit_operation - "
- "gen_demarshal_params failed\n"),
- -1);
- }
-
- *os << "break;" << be_uidt_nl
- << "}" << be_nl
- << "case TAO_AMI_REPLY_USER_EXCEPTION:" << be_nl
- << "case TAO_AMI_REPLY_SYSTEM_EXCEPTION:" << be_nl
- << "{" << be_idt_nl
- << "const ACE_Message_Block* cdr = _tao_in.start ();" << be_nl ;
-
- be_interface *original =
- (be_interface::narrow_from_decl (parent))->original_interface ();
-
- if (!original)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%1) ami_handler_reply_stub_operation_cs::"
- "visit_operation - "
- "original interface is not set\n"),
- -1);
- }
-
- const char *exception_data_arg = "0";
- const char *exception_count_arg = "0";
-
- // Don't do anything if the exception list is empty.
- if (node->exceptions ())
- {
- *os << be_nl << "static TAO::Exception_Data " << "exceptions_data [] = " << be_nl;
- *os << "{" << be_idt_nl;
-
- int excep_count = 0;
-
- be_exception *ex = 0;
-
- // Initialize an iterator to iterate thru the exception list.
- // Continue until each element is visited.
- // Iterator must be explicitly advanced inside the loop.
- for (UTL_ExceptlistActiveIterator ei (node->exceptions ());
- !ei.is_done ();)
- {
- ex = be_exception::narrow_from_decl (ei.item ());
-
- *os << "{" << be_idt_nl
- << "\"" << ex->repoID () << "\"," << be_nl;
- // Allocator method.
- *os << ex->name () << "::_alloc"
- << "\n#if TAO_HAS_INTERCEPTORS == 1" << be_nl;
-
- if (be_global->tc_support ())
- {
- *os << ", " << ex->tc_name ();
- }
- else
- {
- *os << ", 0";
- }
-
- *os << "\n#endif /* TAO_HAS_INTERCEPTORS */" << be_uidt_nl
- << "}";
-
- ++excep_count;
- ei.next ();
-
- if (!ei.is_done ())
- {
- *os << "," << be_nl;
- }
-
- }
-
- *os << be_uidt_nl << "};" << be_nl << be_nl;
-
- *os << "::CORBA::ULong exceptions_count = "
- << excep_count << ";\n" << be_nl;
-
- exception_data_arg = "exceptions_data";
- exception_count_arg = "exceptions_count";
- }
-
- *os << "::CORBA::OctetSeq "
- << "_tao_marshaled_exception (" << be_idt << be_idt_nl
- << "static_cast <CORBA::ULong> (cdr->length ())," << be_nl
- << "static_cast <CORBA::ULong> (cdr->length ())," << be_nl
- << "reinterpret_cast <unsigned char*> (cdr->rd_ptr ())," << be_nl
- << "0" << be_uidt_nl
- << ");" << be_uidt_nl;
-
- *os << "::Messaging::ExceptionHolder* exception_holder_ptr = 0;" << be_nl
- << "ACE_NEW (" << be_idt << be_idt_nl
- << "exception_holder_ptr," << be_nl
- << "::TAO::ExceptionHolder (" << be_idt_nl
- << "(reply_status == TAO_AMI_REPLY_SYSTEM_EXCEPTION)," << be_nl
- << "_tao_in.byte_order ()," << be_nl
- << "_tao_marshaled_exception," << be_nl
- << exception_data_arg << "," << be_nl
- << exception_count_arg << ")" << be_uidt_nl
- << ");" << be_uidt_nl << be_uidt_nl;
-
- *os << "::Messaging::ExceptionHolder_var exception_holder_var = "
- << "exception_holder_ptr;" << be_nl;
-
- *os << "_tao_reply_handler_object->"
- << node->local_name () << "_excep (" << be_idt << be_idt_nl
- << "exception_holder_var";
-
- if (!be_global->exception_support ())
- {
- *os << " ACE_ENV_ARG_PARAMETER";
- }
-
- *os << be_uidt_nl << ");" << be_uidt_nl;
-
- if (!be_global->exception_support ())
- {
- *os << "ACE_CHECK;" << be_nl;
- }
-
- *os << "break;" << be_uidt_nl
- << "}" << be_nl;
-
- *os << "case TAO_AMI_REPLY_NOT_OK:" << be_idt_nl
- << "// @@ Michael: Not even the spec mentions this case." << be_nl
- << "// We have to think about this case." << be_nl
- << "break;" << be_uidt << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- return 0;
-}
-
-// This method is used to generate the ParamData table entry.
-int
-be_visitor_operation_ami_handler_reply_stub_operation_cs::visit_argument (
- be_argument *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // Retrieve the type for this argument.
- bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_reply_stub_operation_cs::"
- "visit_argument - "
- "Bad argument type\n"
- ),
- -1
- );
- }
-
- os->indent ();
- *os << "{" << bt->tc_name () << ", ";
- switch (node->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "PARAM_IN, ";
- break;
- case AST_Argument::dir_INOUT:
- *os << "PARAM_INOUT, ";
- break;
- case AST_Argument::dir_OUT:
- *os << "PARAM_OUT, ";
- break;
- }
- *os << "0}";
-
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_reply_stub_operation_cs::gen_pre_stub_info (
- be_operation *node,
- be_type *
- )
-{
- // Check if this operation raises any exceptions. In that case, we must
- // generate a list of exception typecodes. This is not valid for
- // attributes
- if (!this->ctx_->attribute ())
- {
- be_visitor_context ctx = *this->ctx_;
- be_visitor_operation_exceptlist_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) "
- "be_visitor_operation_ami_handler_reply_stub_operation_cs::"
- "gen_pre_stub_info - "
- "Exceptionlist generation error\n"
- ),
- -1
- );
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_reply_stub_operation_cs::gen_marshal_and_invoke (
- be_operation *node,
- be_type *
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor_context ctx;
-
- os->indent ();
-
- *os << "// Demarshall all the arguments." << be_nl;
-
- if (this->has_param_type (node, AST_Argument::dir_IN))
- {
- *os << "if (!(\n" << be_idt << be_idt << be_idt;
-
- // demarshal each in and inout argument
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- be_visitor_operation_argument_marshal visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_reply_stub_operation_cs::"
- "gen_marshal_params - "
- "codegen for args failed\n"),
- -1);
- }
-
- *os << be_uidt << be_uidt_nl
- << " ))" << be_nl;
-
- if (be_global->use_raw_throw ())
- {
- *os << "throw ::CORBA::MARSHAL ();" << be_uidt_nl << be_nl;
- }
- else
- {
- *os << "ACE_THROW ( ::CORBA::MARSHAL ());" << be_uidt_nl << be_nl;
- }
- }
-
-
- // Invoke the callback method
- *os << "// Invoke the call back method." << be_nl
- << "_tao_reply_handler_object->";
-
- // Check if we are an attribute node in disguise.
- if (this->ctx_->attribute ())
- {
- // Now check if we are a "get" or "set" operation.
- if (node->nmembers () == 1)
- {
- *os << "set_";
- }
- else
- {
- *os << "get_";
- }
- }
-
- *os << node->local_name () << " (" << be_idt << be_idt_nl;
-
-
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS);
- be_visitor_operation_argument oau_visitor (&ctx);
-
- if (node->accept (&oau_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) ami_handler_reply_stub_operation_cs::"
- "visit_operation - "
- "codegen for making upcall failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << ");" << be_uidt
- << TAO_ACE_CHECK () << be_nl;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp
deleted file mode 100644
index 5988f4c0049..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp
+++ /dev/null
@@ -1,196 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// arglist.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the parameter list of the Operation signature.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- arglist,
- "$Id$")
-
-// ************************************************************
-// operation visitor to generate the argument list.
-// We have separated code generation for this from the 4 main
-// visitors to avoid code duplication and tight coupling
-// ************************************************************
-
-be_visitor_operation_arglist::be_visitor_operation_arglist (
- be_visitor_context *ctx
- )
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_arglist::~be_visitor_operation_arglist (void)
-{
-}
-
-int
-be_visitor_operation_arglist::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << " (" << be_idt << be_idt_nl;
-
- int arg_emitted = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XH:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XS:
- *os << "::CORBA::Object *_collocated_tao_target_";
-
- if (node->argument_count () > 0)
- {
- *os << "," << be_nl;
- }
-
- arg_emitted = 1;
- break;
- default:
- break;
- }
-
- // All we do is hand over code generation to our scope.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_arglist::"
- "visit_operation - "
- "codegen for scope failed\n"),
- -1);
- }
-
- if (this->gen_environment_decl (arg_emitted, node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_arglist::"
- "visit_operation - "
- "gen_environment_decl failed\n"),
- -1);
- }
-
- *os << be_uidt_nl
- << ")";
-
- // Now generate the throw specs.
- if (this->gen_throw_spec (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%N:%l) be_visitor_operation_arglist")
- ACE_TEXT ("::visit_operation - ")
- ACE_TEXT ("Failed to generate throw spec\n")),
- -1);
- }
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_CH:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_COLLOCATED_SH:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_IH:
- if (node->is_local ())
- {
- *os << " = 0";
- }
-
- break;
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XH:
- break;
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH:
- *os << " = 0";
- break;
- default:
- return 0;
- }
-
- *os << ";";
-
- return 0;
-}
-
-int
-be_visitor_operation_arglist::visit_argument (be_argument *node)
-{
- // Get the visitor that will dump the argument's mapping in the operation
- // signature.
- be_visitor_context ctx (*this->ctx_);
-
- // First grab the interface definition inside which this operation is
- // defined. We need this since argument types may very well be declared
- // inside the scope of the interface node. In such cases, we would like to
- // generate the appropriate relative scoped names.
- be_operation *op = this->ctx_->be_scope_as_operation ();
-
- if (!op)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arglist::"
- "visit_argument - "
- "Bad operation\n"),
- -1);
- }
-
- // We need the interface node in which this operation was defined. However,
- // if this operation node was an attribute node in disguise, we get this
- // information from the context
- be_interface *intf;
- intf = this->ctx_->attribute ()
- ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ())
- : be_interface::narrow_from_scope (op->defined_in ());
-
- if (!intf)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arglist::"
- "visit_argument - "
- "Bad interface\n"),
- -1);
- }
-
- // Set new scope.
- ctx.scope (intf);
-
- // Create a visitor.
- be_visitor_args_arglist visitor (&ctx);
-
- if (visitor.visit_argument (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arglist::"
- "visit_argument - "
- "codegen for arglist failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_arglist::post_process (be_decl *bd)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // if we are not the last node in the list of arguments, generate a comma
- // else decide if we are generating code to support true exceptions - in
- // which case there will not be any CORBA::Environment parameter
- if (!this->last_node (bd))
- {
- *os << "," << be_nl;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp b/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp
deleted file mode 100644
index fcd2fa84244..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp
+++ /dev/null
@@ -1,221 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// argument.cpp
-//
-// = DESCRIPTION
-// Visitor that calls the visitor for arguments.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- argument,
- "$Id$")
-
-// ************************************************************
-// Generic operation visitor to handle the pre/post
-// do_static_call/upcall stuff with arguments.
-// ************************************************************
-
-be_visitor_operation_argument::be_visitor_operation_argument (
- be_visitor_context *ctx
- )
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_argument::~be_visitor_operation_argument (void)
-{
-}
-
-int
-be_visitor_operation_argument::post_process (be_decl *bd)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // If we are not the last parameter, we insert a comma. This is only
- // applicable for the upcalls or the call to (de)marshal that we use in the
- // interpreted marshaling.
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS:
- case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS:
- case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS:
- if (!this->last_node (bd))
- {
- *os << "," << be_nl;
- }
-
- break;
- case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS:
- if (!this->last_node (bd))
- {
- *os << ",";
- }
-
- break;
- default:
- break;
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_argument::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // All we do is hand over code generation to our scope.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_argument::"
- "visit_operation - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // If we are supporting the alternate mapping, we must pass the
- // ACE_ENV_ARG_PARAMETER as the last parameter.
- if (!be_global->exception_support ())
- {
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS:
- case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS:
- // Applicable only to these cases where the actual upcall is made.
-
- // Use ACE_ENV_SINGLE_ARG_DECL or ACE_ENV_ARG_DECL depending on
- // whether the operation node has parameters.
- if (node->argument_count () > 0)
- {
- *os << env_arg;
- }
- else
- {
- *os << env_sngl_arg;
- }
-
- break;
- default:
- break;
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_argument::visit_argument (be_argument *node)
-{
- // Get the visitor that will dump the argument's mapping in the operation
- // signature.
- be_visitor_context ctx (*this->ctx_);
-
- // first grab the interface definition inside which this operation is
- // defined. We need this since argument types may very well be declared
- // inside the scope of the interface node. In such cases, we would like to
- // generate the appropriate relative scoped names.
- be_operation *op = this->ctx_->be_scope_as_operation ();
-
- if (!op)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arglist::"
- "visit_argument - "
- "Bad operation\n"),
- -1);
- }
-
- // We need the interface node in which this operation was defined. However,
- // if this operation node was an attribute node in disguise, we get this
- // information from the context.
- be_interface *intf;
- intf = this->ctx_->attribute ()
- ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ())
- : be_interface::narrow_from_scope (op->defined_in ());
-
- if (!intf)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arglist::"
- "visit_argument - "
- "Bad interface\n"),
- -1);
- }
-
- ctx.scope (intf);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS:
- {
- be_visitor_args_invoke_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_OPERATION_ARG_DECL_SS:
- {
- be_visitor_args_vardecl_ss visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS:
- {
- be_visitor_args_marshal_ss visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS:
- {
- be_visitor_args_marshal_ss visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS:
- {
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS);
- be_visitor_args_upcall_ss visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS:
- {
- be_visitor_args_upcall_ss visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_argument::"
- "visit_argument - "
- "Bad context\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_argument::"
-
- "visit_argument - "
- "codegen for argument failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp b/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp
deleted file mode 100644
index d222235b04d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// argument_invoke.cpp
-//
-// = DESCRIPTION
-// Visitor to pass arguments to the CDR operators. This one helps in
-// generating the && and the , at the right place. This one is for the
-// client stub side.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- argument_invoke,
- "$Id$")
-
-// ************************************************************
-// operation visitor to handle the passing of arguments to the CDR operators
-// ************************************************************
-
-be_visitor_operation_argument_invoke::be_visitor_operation_argument_invoke (
- be_visitor_context
- *ctx
- )
- : be_visitor_operation_argument (ctx),
- last_arg_printed_ (be_visitor_operation_argument_invoke::TAO_ARG_NONE)
-{
-}
-
-be_visitor_operation_argument_invoke::~be_visitor_operation_argument_invoke (
- void
- )
-{
-}
-
-int
-be_visitor_operation_argument_invoke::pre_process (be_decl *bd)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_argument *arg = be_argument::narrow_from_decl (bd);
-
- if (!arg)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_visitor_operation_argument_invoke"
- "::post_process - "
- "Bad argument node\n"),
- -1);
- }
-
- switch (arg->direction ())
- {
- case AST_Argument::dir_IN:
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- if (this->last_arg_printed_ !=
- be_visitor_operation_argument_invoke::TAO_ARG_NONE)
- *os << " &&" << be_nl;
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- // nothing
- }
- break;
- case AST_Argument::dir_INOUT:
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- if (this->last_arg_printed_ !=
- be_visitor_operation_argument_invoke::TAO_ARG_NONE)
- *os << " &&" << be_nl;
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- if (this->last_arg_printed_ !=
- be_visitor_operation_argument_invoke::TAO_ARG_NONE)
- *os << " &&" << be_nl;
- }
- break;
- case AST_Argument::dir_OUT:
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- // nothing
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- if (this->last_arg_printed_ !=
- be_visitor_operation_argument_invoke::TAO_ARG_NONE)
- *os << " &&" << be_nl;
- }
- break;
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_argument_invoke::post_process (be_decl *bd)
-{
- be_argument *arg = be_argument::narrow_from_decl (bd);
-
- if (!arg)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_visitor_operation_argument_invoke"
- "::post_process - "
- "Bad argument node\n"),
- -1);
- }
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- switch (arg->direction ())
- {
- case AST_Argument::dir_IN:
- // only these arguments get printed
- this->last_arg_printed_ =
- be_visitor_operation_argument_invoke::TAO_ARG_IN;
- break;
- case AST_Argument::dir_INOUT:
- // only these arguments get printed
- this->last_arg_printed_ =
- be_visitor_operation_argument_invoke::TAO_ARG_INOUT;
- break;
- case AST_Argument::dir_OUT:
- // these arguments don't get printed for the << operator on the stub
- break;
- }
- break;
- case TAO_CodeGen::TAO_CDR_INPUT:
- switch (arg->direction ())
- {
- case AST_Argument::dir_IN:
- // these arguments don't get printed for the >> on the stub
- break;
- case AST_Argument::dir_INOUT:
- // only these arguments get printed
- this->last_arg_printed_ =
- be_visitor_operation_argument_invoke::TAO_ARG_INOUT;
- break;
- case AST_Argument::dir_OUT:
- // only these arguments get printed
- this->last_arg_printed_ =
- be_visitor_operation_argument_invoke::TAO_ARG_OUT;
- break;
- }
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_visitor_operation_argument_invoke"
- "::post_process - "
- "Bad sub state\n"),
- -1);
- }
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp b/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp
deleted file mode 100644
index 3ee13e69a64..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp
+++ /dev/null
@@ -1,287 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// argument_marshal.cpp
-//
-// = DESCRIPTION
-// Visitor to pass arguments to the CDR operators. This one helps in
-// generating the && and the , at the right place. This one is for the
-// skeleton side.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- argument_marshal,
- "$Id$")
-
-// ************************************************************
-// operation visitor to handle the passing of arguments to the CDR operators
-// ************************************************************
-
-be_visitor_operation_argument_marshal::be_visitor_operation_argument_marshal (
- be_visitor_context
- *ctx
- )
- : be_visitor_operation_argument (ctx),
- last_arg_printed_ (be_visitor_operation_argument_marshal::TAO_ARG_NONE)
-{
-}
-
-be_visitor_operation_argument_marshal::~be_visitor_operation_argument_marshal (
- void
- )
-{
-}
-
-int
-be_visitor_operation_argument_marshal::pre_process (be_decl *bd)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_argument *arg = be_argument::narrow_from_decl (bd);
-
- if (!arg)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_visitor_operation_argument_marshal"
- "::post_process - "
- "Bad argument node\n"),
- -1);
- }
- switch (arg->direction ())
- {
- case AST_Argument::dir_IN:
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- if (this->last_arg_printed_ !=
- be_visitor_operation_argument_marshal::TAO_ARG_NONE)
- *os << " &&";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- // nothing
- }
- break;
- case AST_Argument::dir_INOUT:
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- if (this->last_arg_printed_ !=
- be_visitor_operation_argument_marshal::TAO_ARG_NONE)
- *os << " &&";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- if (this->last_arg_printed_ !=
- be_visitor_operation_argument_marshal::TAO_ARG_NONE)
- *os << " &&";
- }
- break;
- case AST_Argument::dir_OUT:
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- // nothing
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- if (this->last_arg_printed_ !=
- be_visitor_operation_argument_marshal::TAO_ARG_NONE)
- *os << " &&";
- }
- break;
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_argument_marshal::post_process (be_decl *bd)
-{
- be_argument *arg = be_argument::narrow_from_decl (bd);
-
- if (!arg)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_visitor_operation_argument_marshal"
- "::post_process - "
- "Bad argument node\n"),
- -1);
- }
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- switch (arg->direction ())
- {
- case AST_Argument::dir_IN:
- // only these arguments get printed
- this->last_arg_printed_ =
- be_visitor_operation_argument_marshal::TAO_ARG_IN;
- break;
- case AST_Argument::dir_INOUT:
- // only these arguments get printed
- this->last_arg_printed_ =
- be_visitor_operation_argument_marshal::TAO_ARG_INOUT;
- break;
- case AST_Argument::dir_OUT:
- // these arguments don't get printed for the << operator on the stub
- break;
- }
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- switch (arg->direction ())
- {
- case AST_Argument::dir_IN:
- // these arguments don't get printed for the >> on the stub
- break;
- case AST_Argument::dir_INOUT:
- // only these arguments get printed
- this->last_arg_printed_ =
- be_visitor_operation_argument_marshal::TAO_ARG_INOUT;
- break;
- case AST_Argument::dir_OUT:
- // only these arguments get printed
- this->last_arg_printed_ =
- be_visitor_operation_argument_marshal::TAO_ARG_OUT;
- break;
- }
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_visitor_operation_argument_marshal"
- "::post_process - "
- "Bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-// ****************************************************************
-
-be_visitor_args_decl::be_visitor_args_decl (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-int
-be_visitor_args_decl::visit_operation (be_operation *node)
-{
- return this->visit_scope (node);
-}
-
-int
-be_visitor_args_decl::visit_argument (be_argument *node)
-{
- this->ctx_->node (node); // save the argument node
-
- // retrieve the type of the argument
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- return bt->accept (this);
-}
-
-// visit array
-int
-be_visitor_args_decl::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // retrieve the field node
- be_argument *f = this->ctx_->be_node_as_argument ();
-
- if (f == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_args_decl::"
- "visit_array - "
- "cannot retrieve argument node\n"),
- -1);
- }
-
- // for anonymous arrays, the type name has a _ prepended. We compute
- // the full_name with or without the underscore and use it later on.
- char fname [NAMEBUFSIZE]; // to hold the full and
-
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (!this->ctx_->alias () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // For anonymous arrays ...
- // We have to generate a name for us that has an underscope
- // prepended to our local name. This needs to be inserted after
- // the parents's name.
-
- if (node->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
-
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- node->full_name ());
- }
- }
- else
- {
- // Typedefed node.
- ACE_OS::sprintf (fname,
- "%s",
- node->full_name ());
- }
-
- if (f->direction () != AST_Argument::dir_IN)
- {
- *os << fname << "_forany "
- << "_tao_argument_" << f->local_name () << " ("
- << be_idt << be_idt_nl
- << f->local_name ()
- << be_uidt_nl << ");" << be_uidt_nl;
- }
-
- return 0;
-}
-
-// visit typedef type
-int
-be_visitor_args_decl::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- // the node to be visited in the base primitve type that gets typedefed
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_args_decl::"
- "visit_typedef - "
- "Bad primitive type\n"
- ),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/base_proxy_impl_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/base_proxy_impl_ch.cpp
deleted file mode 100644
index 04890bc1de8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/base_proxy_impl_ch.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-// $Id$
-
-ACE_RCSID (be_visitor_operation,
- x_proxy_impl_xh,
- "$Id$")
-
-be_visitor_operation_base_proxy_impl_ch::
-be_visitor_operation_base_proxy_impl_ch (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_operation_base_proxy_impl_ch::
-~be_visitor_operation_base_proxy_impl_ch (void)
-{
-}
-
-int be_visitor_operation_base_proxy_impl_ch::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "virtual ";
-
- // STEP I: generate the return type.
- be_type *bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_sh::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- be_visitor_context ctx (*this->ctx_);
- be_visitor_operation_rettype oro_visitor (&ctx);
-
- if (bt->accept (&oro_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_sh::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
-
- // STEP 2: generate the operation name
- *os << " " << node->local_name ();
-
- // STEP 3: generate the argument list with the appropriate mapping. For these
- // we grab a visitor that generates the parameter listing
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_BASE_PROXY_IMPL_CH);
- be_visitor_operation_arglist oabpi_visitor (&ctx);
-
- if (node->accept (&oabpi_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_sh::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp
deleted file mode 100644
index 76b2b20752a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-// $Id$
-
-ACE_RCSID (be_visitor_operation,
- direct_proxy_impl_ss,
- "$Id$")
-
-be_visitor_operation_direct_proxy_impl_ss::
-be_visitor_operation_direct_proxy_impl_ss (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_direct_proxy_impl_ss::
-~be_visitor_operation_direct_proxy_impl_ss (void)
-{
-}
-
-int
-be_visitor_operation_direct_proxy_impl_ss::visit_operation (
- be_operation *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // We need the interface node in which this operation was defined. However,
- // if this operation node was an attribute node in disguise, we get this
- // information from the context.
- be_interface *intf = this->ctx_->attribute ()
- ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ())
- : be_interface::narrow_from_scope (node->defined_in ());
-
- if (!intf)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_direct_collocated_ss::"
- "visit_operation - "
- "bad interface scope\n"),
- -1);
- }
-
- *os << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "void" << be_nl
- << intf->full_direct_proxy_impl_name () << "::";
-
- // Check if we are an attribute node in disguise.
- if (this->ctx_->attribute ())
- {
- // Now check if we are a "get" or "set" operation.
- if (node->nmembers () == 1)
- {
- *os << "_set_";
- }
- else
- {
- *os << "_get_";
- }
- }
-
- *os << node->local_name () << " (" << be_idt << be_idt_nl
- << "TAO_Abstract_ServantBase *servant," << be_nl
- << "TAO::Argument **";
-
- if (!node->void_return_type () || node->nmembers () > 0)
- {
- *os << " args";
- }
-
- *os << "," << be_nl
- << "int" << env_decl << be_uidt_nl
- << ")";
-
- if (this->gen_throw_spec (node) != 0)
- {
- return -1;
- }
-
- *os << be_uidt_nl
- << "{" << be_idt_nl;
-
-#if 0
- << "TAO::Portable_Server::Servant_Upcall servant_upcall ("
- << be_idt << be_idt_nl
- << "obj->_stubobj ()"
- << "->servant_orb_var ()->orb_core ()"
- << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-#endif /*if 0*/
-
- if (!node->void_return_type ())
- {
- *os << "((TAO::Arg_Traits< ";
-
- this->gen_arg_template_param_name (node,
- node->return_type (),
- os);
-
- *os << ">::ret_val *) args[0])->arg () =" << be_idt_nl;
- }
-
- *os << "dynamic_cast<" << be_idt
- << intf->full_skel_name () << "_ptr>" << be_nl << "("
- << "servant)" << be_uidt_nl;
-
- be_visitor_context ctx;
-
- if (this->gen_invoke (ctx, node) == -1)
- {
- return -1;
- }
-
- if (!node->void_return_type ())
- {
- *os << be_uidt;
- }
-
- *os << be_uidt << be_uidt_nl;
-
- if (!be_global->exception_support ())
- {
- *os << "ACE_CHECK;";
- }
- *os << be_uidt_nl
- << "}" << be_nl;
-
- return 0;
-}
-
-
-
-int
-be_visitor_operation_direct_proxy_impl_ss::gen_invoke (
- be_visitor_context & /*ctx*/,
- be_operation *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "->" << node->local_name () << " ("
- << be_idt << be_idt << be_idt;
-
- UTL_ScopeActiveIterator si (node,
- UTL_Scope::IK_decls);
-
- if (si.is_done ())
- {
- *os << env_sngl_arg << be_uidt_nl
- << ");";
-
- return 0;
- }
-
- AST_Argument *arg = 0;
- int index = 1;
-
- for (; !si.is_done (); si.next (), ++index)
- {
- arg = AST_Argument::narrow_from_decl (si.item ());
-
- *os << (index == 1 ? "" : ",") << be_nl
- << "((TAO::Arg_Traits< ";
-
- this->gen_arg_template_param_name (arg,
- arg->field_type (),
- os);
-
- *os << ">::";
-
- switch (arg->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "in";
- break;
- case AST_Argument::dir_INOUT:
- *os << "inout";
- break;
- case AST_Argument::dir_OUT:
- *os << "out";
- default:
- break;
- }
-
- *os << "_arg_val *) args[" << index << "])->arg ()";
- }
-
- // End the upcall
- *os << env_arg << be_uidt_nl
- << ");";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp
deleted file mode 100644
index e5526734133..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// exceptlist_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the list of exceptions that an operation
-// raises.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- exceptlist_cs,
- "$Id$")
-
-// ****************************************************************************
-// visitor to generate the exception list for operations
-// ****************************************************************************
-
-be_visitor_operation_exceptlist_cs::be_visitor_operation_exceptlist_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_operation_exceptlist_cs::~be_visitor_operation_exceptlist_cs (void)
-{
-}
-
-int
-be_visitor_operation_exceptlist_cs::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Don't do anything if the exception list is empty.
- if (node->exceptions ())
- {
- *os << be_nl << be_nl
- << "static TAO::Exception_Data" << be_nl
- << "_tao_" << node->flat_name ()
- << "_exceptiondata [] = " << be_idt_nl;
- *os << "{" << be_idt_nl;
-
- be_exception *ex = 0;
-
- // Initialize an iterator to iterate thru the exception list.
- // Continue until each element is visited.
- // Iterator must be advanced explicitly inside the loop.
- for (UTL_ExceptlistActiveIterator ei (node->exceptions ());
- !ei.is_done ();)
- {
- ex = be_exception::narrow_from_decl (ei.item ());
-
- *os << "{" << be_idt_nl
- << "\"" << ex->repoID () << "\"," << be_nl
- << ex->name () << "::_alloc"
- << "\n#if TAO_HAS_INTERCEPTORS == 1" << be_nl;
-
- if (be_global->tc_support ())
- {
- *os << ", " << ex->tc_name ();
- }
- else
- {
- *os << ", 0";
- }
-
- *os << "\n#endif /* TAO_HAS_INTERCEPTORS */" << be_uidt_nl
- << "}";
-
- ei.next ();
-
- if (!ei.is_done ())
- {
- *os << "," << be_nl << be_nl;
- }
- }
-
- *os << be_uidt_nl << "};" << be_uidt;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_ss.cpp
deleted file mode 100644
index 1dcdda82daa..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_ss.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// exceptlist_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the list of exceptions that an operation
-// raises (skeleton/server side).
-//
-// = AUTHOR
-// Ossama Othman
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- exceptlist_ss,
- "$Id$")
-
-// ****************************************************************************
-// visitor to generate the exception list for operations (skeleton/server_side)
-// ****************************************************************************
-
-be_visitor_operation_exceptlist_ss::be_visitor_operation_exceptlist_ss (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_operation_exceptlist_ss::~be_visitor_operation_exceptlist_ss (void)
-{
-}
-
-int
-be_visitor_operation_exceptlist_ss::visit_operation (be_operation * node)
-{
- TAO_OutStream * const os = this->ctx_->stream ();
-
- *os << "\n#if TAO_HAS_INTERCEPTORS == 1" << be_nl;
-
- // When there are exceptions and typecode support is enabled, then generate
- // the typecodes of the user exceptions this operation can throw.
- if (node->exceptions () && be_global->tc_support ())
- {
- *os << "static ::CORBA::TypeCode_ptr const exceptions[] = " << be_idt_nl;
- *os << "{" << be_idt_nl;
-
- // Initialize an iterator to iterate thru the exception list.
- // Continue until each element is visited.
- // Iterator must be advanced explicitly inside the loop.
- for (UTL_ExceptlistActiveIterator ei (node->exceptions ());
- !ei.is_done ();)
- {
- be_exception * ex = be_exception::narrow_from_decl (ei.item ());
-
- *os << ex->tc_name ();
-
- ei.next ();
-
- if (!ei.is_done ())
- {
- *os << "," << be_nl;
- }
- }
-
- *os << be_uidt_nl << "};" << be_uidt_nl
- << "static ::CORBA::ULong const nexceptions = "
- << node->exceptions()->length () << ";";
- }
- else
- {
- *os << "static ::CORBA::TypeCode_ptr const * const exceptions = 0;"
- << be_nl
- << "static ::CORBA::ULong const nexceptions = 0;";
- }
-
- *os << "\n#endif /* TAO_HAS_INTERCEPTORS */" << be_nl << be_nl;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp
deleted file mode 100644
index 82d2cbccd4a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp
+++ /dev/null
@@ -1,711 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// operation.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- operation,
- "$Id$")
-
-// ************************************************************
-// Generic Operation visitor
-// ************************************************************
-
-be_visitor_operation::be_visitor_operation (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_operation::~be_visitor_operation (void)
-{
-}
-
-// Is the operation return type void?
-int
-be_visitor_operation::void_return_type (be_type *bt)
-{
- if (bt->node_type () == AST_Decl::NT_pre_defined)
- {
- AST_PredefinedType::PredefinedType pdt =
- be_predefined_type::narrow_from_decl (bt)->pt ();
-
- if (pdt == AST_PredefinedType::PT_void)
- {
- return 1;
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_operation::has_param_type (be_operation *node,
- AST_Argument::Direction dir)
-{
- return (node->count_arguments_with_direction (dir) != 0);
-}
-
-size_t
-be_visitor_operation::count_non_out_parameters (be_operation *node)
-{
- // @@ Once the valuetype issue discussed below is fixed we can
- // replace this routine with:
- //
- // return node->count_arguments_with_direction (AST_Argument::dir_IN
- // | AST_Argument::dir_INOUT);
- //
- size_t count = 0;
-
- // Initialize an iterator to iterate thru our scope.
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- be_argument *bd =
- be_argument::narrow_from_decl (si.item ());
-
- // We do not generate insertion operators for valuetypes
- // yet. Do not include them in the count.
- be_valuetype *vt =
- be_valuetype::narrow_from_decl (bd->field_type ());
-
- if (bd && (bd->direction () != AST_Argument::dir_OUT) && !vt)
- {
- ++count;
- }
- }
-
- return count;
-}
-
-int
-be_visitor_operation::is_amh_exception_holder (be_interface *node)
-{
- int is_an_amh_exception_holder = 0;
- const char *amh_underbar = "AMH_";
- const char *node_name = node->local_name ();
-
- if( amh_underbar[0] == node_name[0] &&
- amh_underbar[1] == node_name[1] &&
- amh_underbar[2] == node_name[2] &&
- amh_underbar[3] == node_name[3]
- ) // node name starts with "AMH_"
- {
- //ACE_DEBUG ((LM_DEBUG, "Passed first test of amh_excepholder \n"));
- const char *last_E = ACE_OS::strrchr (node->full_name (), 'E');
- if (last_E != 0
- && ACE_OS::strcmp (last_E, "ExceptionHolder") == 0)
- {
- //ACE_DEBUG ((LM_DEBUG, "be_visitor_operation: Passed second test of amh_excepholder \n"));
- is_an_amh_exception_holder = 1;
- }
- }
-
- return is_an_amh_exception_holder;
-}
-
-// Method to generate the throw specs for exceptions that are thrown by the
-// operation.
-int
-be_visitor_operation::gen_throw_spec (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- const char *throw_spec_open = "throw (";
- const char *throw_spec_close = ")";
-
- if (!be_global->use_raw_throw ())
- {
- throw_spec_open = "ACE_THROW_SPEC ((";
- throw_spec_close = "))";
- }
-
- UTL_Scope *scope = node->defined_in ();
- be_interface *iface = be_interface::narrow_from_scope (scope);
-
- /***************************************************************************/
- // 2.6
- // Generate the Right Throw Spec if it is an AMH ExceptionHolder
- /***************************************************************************/
- // Check if this is (IF and it's not VT) or (it is an AMH ExceptionHolder).
- if (iface != 0)
- {
- int is_amh_exception_holder = this->is_amh_exception_holder (iface);
- AST_Decl::NodeType nt = iface->node_type ();
-
- if (nt != AST_Decl::NT_valuetype || is_amh_exception_holder)
- {
- *os << be_nl << throw_spec_open;
- *os << be_idt_nl << "::CORBA::SystemException";
-
- if (node->exceptions ())
- {
- // Initialize an iterator to iterate thru the exception list.
- for (UTL_ExceptlistActiveIterator ei (node->exceptions ());
- !ei.is_done ();
- ei.next ())
- {
- be_exception *excp =
- be_exception::narrow_from_decl (ei.item ());
-
- if (excp == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation"
- "gen_throw_spec - "
- "bad exception node\n"),
- -1);
-
- }
-
- *os << "," << be_nl
- << "::" << excp->name ();
- }
- }
-
- *os << be_uidt_nl << throw_spec_close << be_uidt;
- }
- }
- /*******************************************************************************/
- return 0;
-}
-
-int
-be_visitor_operation::gen_environment_decl (int argument_emitted,
- be_operation *node)
-{
- // Generate the CORBA::Environment parameter for the alternative mapping.
- if (be_global->exception_support ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Use ACE_ENV_SINGLE_ARG_DECL or ACE_ENV_ARG_DECL depending on
- // whether the operation node has parameters.
- const char *env_decl = "ACE_ENV_SINGLE_ARG_DECL";
-
- if (this->ctx_->sub_state ()
- == TAO_CodeGen::TAO_AMH_RESPONSE_HANDLER_OPERATION
- && node->argument_count () == 0)
- {
- // Response handler operations don't use the environment arg
- // unless there are other args in the operation.
- env_decl = "ACE_ENV_SINGLE_ARG_DECL";
- this->ctx_->sub_state (TAO_CodeGen::TAO_SUB_STATE_UNKNOWN);
- }
- else if (argument_emitted || node->argument_count () > 0)
- {
- env_decl = "ACE_ENV_ARG_DECL";
- }
-
- TAO_CodeGen::CG_STATE cgs = this->ctx_->state ();
-
- if (node->argument_count () > 0
- || cgs == TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XH
- || cgs == TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XS)
- {
- *os << be_nl;
- }
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_CH:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_COLLOCATED_SH:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH:
- // Last argument is always CORBA::Environment.
- *os << env_decl << "_WITH_DEFAULTS";
- break;
- default:
- *os << env_decl;
- break;
- }
-
- return 0;
-}
-
-// Method that returns the appropriate CORBA::Environment variable.
-const char *
-be_visitor_operation::gen_environment_var (void)
-{
- static const char *ace_try_env_decl = "ACE_DECLARE_NEW_CORBA_ENV;";
- static const char *null_env_decl = "";
-
- // Check if we are generating stubs/skeletons for
- // true C++ exception support.
- if (be_global->exception_support ())
- {
- return ace_try_env_decl;
- }
- else
- {
- return null_env_decl;
- }
-}
-
-int
-be_visitor_operation::gen_raise_exception (be_type *return_type,
- const char *exception_name,
- const char *exception_arguments)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (be_global->use_raw_throw ())
- {
- *os << "throw "
- << exception_name << "(" << exception_arguments << ");\n";
- return 0;
- }
-
- int is_void =
- return_type == 0 || this->void_return_type (return_type);
-
- if (is_void)
- {
- *os << "ACE_THROW (";
- }
- else
- {
- *os << "ACE_THROW_RETURN (";
- }
-
- *os << exception_name << " (" << exception_arguments << ")";
-
- if (is_void)
- {
- *os << ");";
-
- return 0;
- }
-
- *os << ",";
-
- // Non-void return type.
- be_visitor_context ctx (*this->ctx_);
- be_visitor_operation_rettype_return_cs visitor (&ctx);
-
- if (return_type->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation::"
- "gen_raise_exception - "
- "codegen for return var failed\n"),
- -1);
- }
-
- *os << ");";
-
- return 0;
-}
-
-int
-be_visitor_operation::gen_stub_operation_body (
- be_operation *node,
- be_type *return_type
- )
-{
- be_interface *intf = this->ctx_->attribute ()
- ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ())
- : be_interface::narrow_from_scope (node->defined_in ());
-
- if (!intf)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_thru_poa_collocated_ss::"
- "visit_operation - "
- "bad interface scope\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor_context ctx;
-
- *os << be_nl << "{" << be_idt_nl;
-
- if (node->has_native ()) // native exists => no stub
- {
- if (this->gen_raise_exception (return_type,
- "::CORBA::MARSHAL",
- "") == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for native exception failed\n"
- ),
- -1
- );
- }
-
- *os << be_uidt_nl << "}";
-
- return 0;
- }
-
- if (!node->is_abstract ())
- {
- // If the object is lazily evaluated the proxy brker might well
- // be null. Initialize it now.
- *os << "if (!this->is_evaluated ())" << be_idt_nl
- << "{" << be_idt_nl
- << "::CORBA::Object::tao_object_initialize (this);"
- << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "if (this->the" << intf->base_proxy_broker_name () << "_ == 0)"
- << be_idt_nl
- << "{" << be_idt_nl
- << intf->flat_name () << "_setup_collocation ();"
- << be_uidt_nl
- << "}" << be_uidt_nl << be_nl;
- }
-
- // Declare return type helper class.
- *os << "TAO::Arg_Traits< ";
-
- this->gen_arg_template_param_name (node,
- return_type,
- os);
-
- *os << ">::ret_val _tao_retval;";
-
- // Declare the argument helper classes.
- this->gen_stub_body_arglist (node, os);
-
- *os << be_nl << be_nl
- << "TAO::Argument *_the_tao_operation_signature [] =" << be_idt_nl
- << "{" << be_idt_nl
- << "&_tao_retval";
-
- AST_Argument *arg = 0;
-
- for (UTL_ScopeActiveIterator arg_list_iter (node, UTL_Scope::IK_decls);
- ! arg_list_iter.is_done ();
- arg_list_iter.next ())
- {
- arg = AST_Argument::narrow_from_decl (arg_list_iter.item ());
-
- *os << "," << be_nl
- << "&_tao_" << arg->local_name ();
- }
-
- *os << be_uidt_nl
- << "};" << be_uidt;
-
- if (this->gen_pre_stub_info (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for exceptiondata failed\n"),
- -1);
- }
-
- // Use the name without the possible '_cxx_' here.
- size_t tmp_len =
- ACE_OS::strlen (node->original_local_name ()->get_string ());
-
- *os << be_nl << be_nl
- << "TAO::" << (node->is_abstract () ? "AbstractBase_" : "" )
- << "Invocation_Adapter _tao_call (" << be_idt << be_idt_nl
- << "this," << be_nl
- << "_the_tao_operation_signature," << be_nl
- << node->argument_count () + 1 << "," << be_nl
- << "\"";
-
- // Check if we are an attribute node in disguise.
- if (this->ctx_->attribute ())
- {
- // If we are a attribute node, add th elength of the operation
- // name.
- tmp_len += 5;
-
- // Now check if we are a "get" or "set" operation.
- if (node->nmembers () == 1)
- {
- *os << "_set_";
- }
- else
- {
- *os << "_get_";
- }
- }
-
- // original_local_name() strips off the leading '_cxx_' if any.
- *os << node->original_local_name () << "\"," << be_nl
- << tmp_len << "," << be_nl
- << "this->the" << intf->base_proxy_broker_name () << "_";
-
- if (node->flags () == AST_Operation::OP_oneway)
- {
- *os << "," << be_nl
- << "TAO::TAO_ONEWAY_INVOCATION";
- }
-
- *os << be_uidt_nl
- << ");" << be_uidt;
-
- *os << be_nl << be_nl;
-
- // Since oneways cannot raise user exceptions, we have that
- // case covered as well.
- if (node->exceptions ())
- {
- *os << "_tao_call.invoke (" << be_idt << be_idt_nl
- << "_tao_" << node->flat_name ()
- << "_exceptiondata," << be_nl
- << node->exceptions ()->length () << env_arg << be_uidt_nl
- << ");" << be_uidt;
- }
- else
- {
- *os << "_tao_call.invoke (0, 0"
- << (be_global->use_raw_throw () ? "" : " ACE_ENV_ARG_PARAMETER")
- << ");";
- }
-
- if (this->void_return_type (return_type))
- {
- *os << TAO_ACE_CHECK ();
- }
- else
- {
- *os << TAO_ACE_CHECK ("_tao_retval.excp ()");
- }
-
- if (!this->void_return_type (return_type))
- {
- *os << be_nl << be_nl
- << "return _tao_retval.retn ();";
- }
-
- *os << be_uidt_nl << "}";
-
- return 0;
-}
-
-int
-be_visitor_operation::gen_pre_stub_info (
- be_operation *node
- )
-{
- be_visitor_context ctx = *this->ctx_;
- be_visitor_operation_exceptlist_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_visitor_operation_cs::"
- "gen_pre_stub_info - "
- "Exceptionlist generation error\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_operation::gen_raise_interceptor_exception (
- be_type *bt,
- const char *excep,
- const char *completion_status
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (this->void_return_type (bt))
- {
- if (be_global->use_raw_throw ())
- {
- *os << "throw " << excep << "(" << completion_status << ");";
- }
- else
- {
- *os << "TAO_INTERCEPTOR_THROW (" << be_idt << be_idt_nl
- << excep << " (" << be_idt << be_idt_nl
- << completion_status << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ");" << be_uidt;
- }
- }
- else
- {
- if (bt->size_type () == AST_Type::VARIABLE
- || bt->base_node_type () == AST_Decl::NT_array)
- {
- *os << "TAO_INTERCEPTOR_THROW_RETURN (" << be_idt << be_idt_nl
- << excep << " (" << be_idt << be_idt_nl
- << completion_status << be_uidt_nl
- << ")," << be_uidt_nl
- << "0" << be_uidt_nl
- << ");" << be_uidt;
- }
- else
- {
- *os << "TAO_INTERCEPTOR_THROW_RETURN (" << be_idt << be_idt_nl
- << excep << " (" << be_idt << be_idt_nl
- << completion_status << be_uidt_nl
- << ")," << be_uidt_nl
- << "_tao_retval" << be_uidt_nl
- << ");" << be_uidt;
- }
- }
-
- return 0;
-}
-
-void
-be_visitor_operation::gen_stub_body_arglist (be_operation *node,
- TAO_OutStream *os,
- bool ami)
-{
- AST_Argument *arg = 0;
- UTL_ScopeActiveIterator arg_decl_iter (node, UTL_Scope::IK_decls);
-
- if (ami)
- {
- // Skip the reply handler (first argument).
- arg_decl_iter.next ();
- }
-
- for (; ! arg_decl_iter.is_done (); arg_decl_iter.next ())
- {
- arg = AST_Argument::narrow_from_decl (arg_decl_iter.item ());
-
- *os << be_nl
- << "TAO::Arg_Traits< ";
-
- this->gen_arg_template_param_name (arg,
- arg->field_type (),
- os);
-
- *os << ">::";
-
- switch (arg->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "in";
- break;
- case AST_Argument::dir_INOUT:
- *os << "inout";
- break;
- case AST_Argument::dir_OUT:
- *os << "out";
- default:
- break;
- }
-
- *os << "_arg_val _tao_" << arg->local_name () << " ("
- << arg->local_name () << ");";
- }
-}
-
-void
-be_visitor_operation::gen_arg_template_param_name (AST_Decl *scope,
- AST_Type *bt,
- TAO_OutStream *os)
-{
- AST_Typedef *alias = 0;
-
- if (bt->node_type () == AST_Decl::NT_typedef)
- {
- alias = AST_Typedef::narrow_from_decl (bt);
- }
-
- AST_Decl::NodeType nt = bt->unaliased_type ()->node_type ();
-
- if (nt == AST_Decl::NT_string || nt == AST_Decl::NT_wstring)
- {
- AST_String *s = AST_String::narrow_from_decl (bt->unaliased_type ());
- unsigned long bound = s->max_size ()->ev ()->u.ulval;
-
- // If the (w)string is unbounded, code is generated below by the
- // last line of this method, whether bt is a typedef or not.
- if (bound > 0)
- {
- *os << "::TAO::";
-
- if (alias != 0)
- {
- *os << alias->local_name () << "_" << bound;
- }
- else
- {
- // If we have an unaliased, bounded (w)string parameter,
- // we know that be_visitor_arg_traits has used an empty
- // struct of a type constructed from the flat name of
- // the parameter's 'enclosing scope' (the parameter
- // identifier for parameters, and the operation identifier
- // for return types) to get a unique type for the
- // Arg_Traits<> template parameter. So we generate it
- // the same way here, using the 'scope' argument's
- // flat name.
- *os << scope->flat_name ();
- }
-
- return;
- }
- }
-
- // We need the unaliased type name to make the code block below
- // work correctly.
- AST_Type *ut = bt->unaliased_type ();
- nt = ut->node_type ();
-
- // For the four predefined types below, we use the helper struct
- // type, in order to disambiguate the template parameter.
- if (nt == AST_Decl::NT_pre_defined)
- {
- AST_PredefinedType *pdt = AST_PredefinedType::narrow_from_decl (ut);
-
- switch (pdt->pt ())
- {
- case AST_PredefinedType::PT_boolean:
- *os << "::ACE_InputCDR::to_boolean";
- return;
- case AST_PredefinedType::PT_octet:
- *os << "::ACE_InputCDR::to_octet";
- return;
- case AST_PredefinedType::PT_char:
- *os << "::ACE_InputCDR::to_char";
- return;
- case AST_PredefinedType::PT_wchar:
- *os << "::ACE_InputCDR::to_wchar";
- return;
- case AST_PredefinedType::PT_void:
- break;
- default:
- *os << "::";
- break;
- }
- }
- else
- {
- *os << "::";
- }
- // For types other than the 4 above, don't unalias the type name
- // in case it is a sequence or array.
- *os << bt->name ();
-
- if (nt == AST_Decl::NT_array)
- {
- *os << "_tag";
- }
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp
deleted file mode 100644
index 795c4a63cd4..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// operation_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation node in the client header.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- operation_ch,
- "$Id$")
-
-// ******************************************************
-// Primary visitor for "operation" in client header.
-// ******************************************************
-
-be_visitor_operation_ch::be_visitor_operation_ch (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ch::~be_visitor_operation_ch (void)
-{
-}
-
-int
-be_visitor_operation_ch::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- this->ctx_->node (node);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Every operation is declared virtual in the client code.
- *os << "virtual ";
-
- // STEP I: generate the return type.
- be_type *bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ch::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- // Grab the right visitor to generate the return type.
- be_visitor_context ctx (*this->ctx_);
- be_visitor_operation_rettype or_visitor (&ctx);
-
- if (bt->accept (&or_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ch::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
-
- // STEP 2: generate the operation name.
- *os << " " << node->local_name ();
-
- // STEP 3: generate the argument list with the appropriate mapping. For these
- // we grab a visitor that generates the parameter listing.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_CH);
- be_visitor_operation_arglist oa_visitor (&ctx);
-
- if (node->accept (&oa_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
deleted file mode 100644
index f9304464aef..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// operation_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale & Angelo Corsaro
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- operation_cs,
- "$Id$")
-
-// ************************************************************
-// Operation visitor for client stubs
-// ************************************************************
-
-be_visitor_operation_cs::be_visitor_operation_cs (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_cs::~be_visitor_operation_cs (void)
-{
-}
-
-// Processing to be done after every element in the scope is processed.
-int
-be_visitor_operation_cs::post_process (be_decl *bd)
-{
- // All we do here is to insert a comma and a newline.
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (!this->last_node (bd))
- {
- *os << ",\n";
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_cs::visit_operation (be_operation *node)
-{
- be_interface *intf = this->ctx_->attribute ()
- ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ())
- : be_interface::narrow_from_scope (node->defined_in ());
-
- if (!intf)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "bad interface scope\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node for future use
-
- if (node->is_local ())
- {
- return 0;
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Retrieve the operation return type.
- be_type *bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- // Generate the return type mapping (same as in the header file)
- be_visitor_context ctx = *this->ctx_;
- be_visitor_operation_rettype rt_visitor = (&ctx);
-
- if (bt->accept (&rt_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
-
- // Generate the operation name
- *os << " " << node->name ();
-
- // Generate the argument list with the appropriate mapping (same as
- // in the header file)
- ctx = *this->ctx_;
- be_visitor_operation_arglist al_visitor (&ctx);
-
- if (node->accept (&al_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- return this->gen_stub_operation_body (node,
- bt);
-}
-
-int
-be_visitor_operation_cs::visit_argument (be_argument *node)
-{
- // This method is used to generate the ParamData table entry.
-
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- os->indent ();
- *os << "{" << bt->tc_name () << ", ";
-
- switch (node->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "PARAM_IN, ";
- break;
- case AST_Argument::dir_INOUT:
- *os << "PARAM_INOUT, ";
- break;
- case AST_Argument::dir_OUT:
- *os << "PARAM_OUT, ";
- break;
- }
-
- *os << "0}";
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp
deleted file mode 100644
index b9e49c20e28..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// operation_ih.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the implementation header
-//
-// = AUTHOR
-// Yamuna Krishnamurthy (yamuna@cs.wustl.edu)
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- operation_ih,
- "$Id$")
-
-// ************************************************************
-// Operation visitor for implementation header.
-// ************************************************************
-
-be_visitor_operation_ih::be_visitor_operation_ih (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ih::~be_visitor_operation_ih (void)
-{
-}
-
-int
-be_visitor_operation_ih::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- *os << be_nl << be_nl;
-
- if (be_global->gen_impl_debug_info ())
- {
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
- }
-
- // every operation is declared virtual in the client code
- *os << "virtual" << be_nl;
-
- // STEP I: generate the return type
- be_type *bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_sh::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- // grab the right visitor to generate the return type
- be_visitor_context ctx (*this->ctx_);
- be_visitor_operation_rettype oro_visitor (&ctx);
-
- if (bt->accept (&oro_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ih::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
-
- // STEP 2: generate the operation name
- *os << " " << node->local_name ();
-
- // STEP 3: generate the argument list with the appropriate mapping. For these
- // we grab a visitor that generates the parameter listing
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_IH);
- be_visitor_operation_arglist oa_visitor (&ctx);
-
- if (node->accept (&oa_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ih::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- return 0;
-}
-
-
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp
deleted file mode 100644
index e3390be880f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// operation_is.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the implementation skeleton
-//
-// = AUTHOR
-// Yamuna Krishnamurthy (yamuna@cs.wustl.edu)
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- operation_is,
- "$Id$")
-
-// ************************************************************
-// Operation visitor for implementation skeleton
-// ************************************************************
-
-be_visitor_operation_is::be_visitor_operation_is (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_is::~be_visitor_operation_is (void)
-{
-}
-
-int
-be_visitor_operation_is::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_interface *intf = this->ctx_->interface ();
-
- this->ctx_->node (node); // save the node
-
- // STEP I: generate the return type
- be_type *bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_is::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- if (be_global->gen_impl_debug_info ())
- {
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
- }
-
- be_visitor_context ctx (*this->ctx_);
- be_visitor_operation_rettype oro_visitor (&ctx);
-
- if (bt->accept (&oro_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_is::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
-
- const char *classname = 0;
-
- if (intf)
- {
- // If derived class/
- classname = intf->flat_name ();
- }
- else
- {
- classname = ScopeAsDecl (node->defined_in ())->flat_name ();
- }
-
- // STEP 2: generate the operation name
- *os << " " << be_global->impl_class_prefix () << classname
- << be_global->impl_class_suffix () << "::" << node->local_name ();
-
- // STEP 3: generate the argument list with the appropriate mapping. For these
- // we grab a visitor that generates the parameter listing
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_IS);
- be_visitor_operation_arglist oa_visitor (&ctx);
-
- if (node->accept (&oa_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_is::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- *os << be_nl << "{" << be_idt_nl;
- *os << "// Add your implementation here" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp
deleted file mode 100644
index 7bba7f41d3b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// operation_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the server header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- operation_sh,
- "$Id$")
-
-// ************************************************************
-// Operation visitor for server header
-// ************************************************************
-
-be_visitor_operation_sh::be_visitor_operation_sh (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_sh::~be_visitor_operation_sh (void)
-{
-}
-
-int
-be_visitor_operation_sh::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "virtual ";
-
- // STEP I: generate the return type.
- be_type *bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_sh::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- be_visitor_context ctx (*this->ctx_);
- be_visitor_operation_rettype oro_visitor (&ctx);
-
- if (bt->accept (&oro_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_sh::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
-
- // STEP 2: generate the operation name
- *os << " " << node->local_name ();
-
- // STEP 3: generate the argument list with the appropriate mapping. For these
- // we grab a visitor that generates the parameter listing
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_SH);
- be_visitor_operation_arglist oa_visitor (&ctx);
-
- if (node->accept (&oa_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_sh::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- // Generate the corresponding static skeleton method for this operation only
- // if there was no "native" type.
- if (!node->has_native ())
- {
- *os << be_nl << be_nl
- << "static void ";
-
- // Check if we are an attribute node in disguise.
- if (this->ctx_->attribute ())
- {
- // Now check if we are a "get" or "set" operation
- if (node->nmembers () == 1)
- {
- *os << "_set_";
- }
- else
- {
- *os << "_get_";
- }
- }
-
- *os << node->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & server_request," << be_nl
- << "void * servant_upcall," << be_nl
- << "void * servant" << env_decl << be_uidt_nl
- << ");" << be_uidt;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp
deleted file mode 100644
index 34adf67cb75..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp
+++ /dev/null
@@ -1,345 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// operation_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the server skeleton
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-
-ACE_RCSID (be_visitor_operation,
- operation_ss,
- "$Id$")
-
-// ************************************************************
-// Operation visitor for server skeletons
-// ************************************************************
-
-be_visitor_operation_ss::be_visitor_operation_ss (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ss::~be_visitor_operation_ss (void)
-{
-}
-
-// // Processing to be done after every element in the scope is processed.
-// int
-// be_visitor_operation_ss::post_process (be_decl *bd)
-// {
-// // All we do here is to insert a comma and a newline.
-// TAO_OutStream *os = this->ctx_->stream ();
-
-// if (!this->last_node (bd))
-// {
-// *os << ",\n";
-// }
-
-// return 0;
-// }
-
-int
-be_visitor_operation_ss::visit_operation (be_operation * node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt = 0;
-
- this->ctx_->node (node);
-
- os->indent ();
-
- // If there is an argument of type "native", return immediately.
- if (node->has_native ())
- {
- return 0;
- }
-
- // Retrieve the operation return type.
- bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- return this->gen_skel_operation_body (node, bt);
-}
-
-int
-be_visitor_operation_ss::visit_argument (be_argument *node)
-{
- // This method is used to generate the ParamData table entry.
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the type for this argument.
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- os->indent ();
- *os << "{" << bt->tc_name () << ", ";
- switch (node->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "::CORBA::ARG_IN, ";
- break;
- case AST_Argument::dir_INOUT:
- *os << "::CORBA::ARG_INOUT, ";
- break;
- case AST_Argument::dir_OUT:
- *os << "::CORBA::ARG_OUT, ";
- break;
- }
- *os << "0}";
-
- return 0;
-}
-
-int
-be_visitor_operation_ss::gen_pre_skel_info (be_operation * node)
-{
- be_visitor_context ctx = *this->ctx_;
- be_visitor_operation_exceptlist_ss visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_visitor_operation_ss::"
- "gen_pre_skel_info - "
- "Exception TypeCode list generation error\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_ss::gen_skel_operation_body (be_operation * node,
- be_type * return_type)
-{
- TAO_OutStream * const os = this->ctx_->stream ();
-
- // We need the interface node in which this operation was
- // defined. However, if this operation node was an attribute node
- // in disguise, we get this information from the context
- be_interface * const intf = this->ctx_->attribute ()
- ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ())
- : be_interface::narrow_from_scope (node->defined_in ());
-
- if (!intf)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "bad interface scope\n"),
- -1);
- }
-
- ACE_CString upcall_command_name =
- ACE_CString (node->local_name ()->get_string()) + "_" +
- ACE_CString (intf->local_name());
-
- // Check if we are an attribute node in disguise.
- if (this->ctx_->attribute ())
- {
- // Now check if we are a "get" or "set" operation.
- if (node->nmembers () == 1)
- {
- upcall_command_name = "_set_" + upcall_command_name;
- }
- else
- {
- upcall_command_name = "_get_" + upcall_command_name;
- }
- }
-
- // Generate the local class encapsulating the actual servant upcall
- // command/invocation.
- be_visitor_operation_upcall_command_ss upcall_command_visitor (this->ctx_);
- upcall_command_visitor.visit (node,
- intf->full_skel_name (),
- upcall_command_name.c_str ());
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "void " << intf->full_skel_name () << "::";
-
- // Check if we are an attribute node in disguise.
- if (this->ctx_->attribute ())
- {
- // Now check if we are a "get" or "set" operation.
- if (node->nmembers () == 1)
- {
- *os << "_set_";
- }
- else
- {
- *os << "_get_";
- }
- }
-
- *os << node->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "TAO_ServerRequest & server_request," << be_nl
- << "void * TAO_INTERCEPTOR (servant_upcall)," << be_nl
- << "void * servant" << env_decl << be_uidt_nl
- << ")" << be_uidt_nl;
-
- // Generate the actual code for the skeleton. However, if any of the
- // argument types is "native", we do not generate any skeleton
- // last argument - is always CORBA::Environment.
- *os << "{" << be_idt;
-
- // Generate all the tables and other pre-skel info.
- if (this->gen_pre_skel_info (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "gen_pre_skel_info failed\n"),
- -1);
- }
-
- // Declare return type helper class.
-
- *os << "TAO::SArg_Traits< ";
-
- this->gen_arg_template_param_name (node,
- return_type,
- os);
-
- *os << ">::ret_val retval;";
-
- // Declare the argument helper classes.
- this->gen_skel_body_arglist (node, os);
-
- *os << be_nl << be_nl
- << "TAO::Argument * const args[] =" << be_idt_nl
- << "{" << be_idt_nl
- << "&retval";
-
- for (UTL_ScopeActiveIterator arg_list_iter (node, UTL_Scope::IK_decls);
- ! arg_list_iter.is_done ();
- arg_list_iter.next ())
- {
- AST_Argument * const arg =
- AST_Argument::narrow_from_decl (arg_list_iter.item ());
-
- *os << "," << be_nl
- << "&_tao_" << arg->local_name ();
- }
-
- *os << be_uidt_nl
- << "};" << be_uidt_nl << be_nl;
-
- *os << "static size_t const nargs = "
- << (node->argument_count () + 1) << ";" << be_nl << be_nl;
-
- // Get the right object implementation.
- *os << intf->full_skel_name () << " * const impl =" << be_idt_nl
- << "static_cast<"
- << intf->full_skel_name () << " *> (servant);" << be_uidt << be_uidt_nl;
-
- // Upcall_Command instantiation.
- *os << be_idt_nl
- << upcall_command_name.c_str()
- << " command (" << be_idt_nl
- << "impl";
-
- if (!node->void_return_type () || node->argument_count () > 0)
- {
- // server_request.operation_details () will be non-zero in the
- // thru-POA collocation case. Use them if available.
- *os << "," << be_nl;
-
- if (be_global->gen_thru_poa_collocation ())
- *os << "server_request.operation_details ()," << be_nl;
-
- *os << "args";
- }
-
- *os << ");" << be_uidt_nl << be_nl;
-
-
- *os << "TAO::Upcall_Wrapper upcall_wrapper;" << be_nl
- << "upcall_wrapper.upcall (server_request" << be_nl
- << " , args" << be_nl
- << " , nargs" << be_nl
- << " , command"
- << "\n#if TAO_HAS_INTERCEPTORS == 1" << be_nl
- << " , servant_upcall" << be_nl
- << " , exceptions" << be_nl
- << " , nexceptions"
- << "\n#endif /* TAO_HAS_INTERCEPTORS == 1 */" << be_nl
- << " "
- << (be_global->use_raw_throw () ? "" : "ACE_ENV_ARG_PARAMETER")
- << ");" << TAO_ACE_CHECK () << be_uidt_nl
- << "}";
-
- return 0;
-}
-
-void
-be_visitor_operation_ss::gen_skel_body_arglist (be_operation * node,
- TAO_OutStream * os)
-{
- for (UTL_ScopeActiveIterator arg_decl_iter (node, UTL_Scope::IK_decls);
- ! arg_decl_iter.is_done ();
- arg_decl_iter.next ())
- {
- AST_Argument * const arg =
- AST_Argument::narrow_from_decl (arg_decl_iter.item ());
-
- *os << be_nl
- << "TAO::SArg_Traits< ";
-
- this->gen_arg_template_param_name (arg,
- arg->field_type (),
- os);
-
- *os << ">::";
-
- switch (arg->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "in";
- break;
- case AST_Argument::dir_INOUT:
- *os << "inout";
- break;
- case AST_Argument::dir_OUT:
- *os << "out";
- default:
- break;
- }
-
- *os << "_arg_val _tao_" << arg->local_name () << ";";
- }
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/proxy_impl_xh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/proxy_impl_xh.cpp
deleted file mode 100644
index 2990b9fde70..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/proxy_impl_xh.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-// $Id$
-
-ACE_RCSID (be_visitor_operation,
- proxy_impl_xh,
- "$Id$")
-
-be_visitor_operation_proxy_impl_xh::be_visitor_operation_proxy_impl_xh (
- be_visitor_context *ctx
- )
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_proxy_impl_xh::~be_visitor_operation_proxy_impl_xh (void)
-{
-}
-
-int be_visitor_operation_proxy_impl_xh::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "static void" << be_nl;
-
- // Check if we are an attribute node in disguise.
- if (this->ctx_->attribute ())
- {
- // Now check if we are a "get" or "set" operation.
- if (node->nmembers () == 1)
- {
- *os << "_set_";
- }
- else
- {
- *os << "_get_";
- }
- }
-
- *os << node->local_name () << " (" << be_idt << be_idt_nl
- << "TAO_Abstract_ServantBase *servant," << be_nl
- << "TAO::Argument ** args," << be_nl
- << "int num_args" << env_decl << be_uidt_nl
- << ")";
-
- if (this->gen_throw_spec (node) != 0)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_operation_proxy_impl_xh::"
- "visit_operation - "
- "throw spec generation failed\n"
- ),
- -1
- );
- }
-
- *os << ";";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/remote_proxy_impl_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/remote_proxy_impl_cs.cpp
deleted file mode 100644
index 49834dd76e3..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/remote_proxy_impl_cs.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-// $Id$
-
-ACE_RCSID (be_visitor_operation,
- be_visitor_operation_remote_proxy_impl_cs,
- "$Id$")
-
-// ************************************************************
-// Operation visitor for client stubs
-// ************************************************************
-
-be_visitor_operation_remote_proxy_impl_cs::
-be_visitor_operation_remote_proxy_impl_cs (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_remote_proxy_impl_cs::
-~be_visitor_operation_remote_proxy_impl_cs (void)
-{
-}
-
-// Processing to be done after every element in the scope is processed.
-int
-be_visitor_operation_remote_proxy_impl_cs::post_process (be_decl *bd)
-{
- // All we do here is to insert a comma and a newline.
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (!this->last_node (bd))
- {
- *os << "," << be_nl;
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_remote_proxy_impl_cs::visit_operation (
- be_operation *node
- )
-{
- if (node->is_local ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- // Retrieve the operation return type.
- be_type *bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_remote_proxy_impl_cs::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Generate the return type mapping (same as in the header file)
- be_visitor_context ctx = *this->ctx_;
- be_visitor_operation_rettype ort_visitor (&ctx);
-
- if (bt->accept (&ort_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_remote_proxy_impl_cs::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
-
- // Generate the operation name
- be_decl* scope = be_scope::narrow_from_scope (node->defined_in ())->decl ();
- be_interface *interface = be_interface::narrow_from_decl (scope);
-
- *os <<" " << interface->full_remote_proxy_impl_name ()
- << "::" << node->local_name ();
-
- // Generate the argument list with the appropriate mapping (same as
- // in the header file).
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XS);
- be_visitor_operation_arglist arglist_visitor (&ctx);
-
- if (node->accept (&arglist_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_remote_proxy_impl_cs::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- // Generate the code for the operation body.
- return this->gen_stub_operation_body (node,
- bt);
-}
-
-int
-be_visitor_operation_remote_proxy_impl_cs::visit_argument (be_argument *node)
-{
- // This method is used to generate the ParamData table entry.
-
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // Retrieve the type for this argument.
- bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_remote_proxy_impl_cs::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- os->indent ();
- *os << "{" << bt->tc_name () << ", ";
-
- switch (node->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "PARAM_IN, ";
- break;
- case AST_Argument::dir_INOUT:
- *os << "PARAM_INOUT, ";
- break;
- case AST_Argument::dir_OUT:
- *os << "PARAM_OUT, ";
- break;
- }
- *os << "0}";
-
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp
deleted file mode 100644
index d638fcb6eea..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp
+++ /dev/null
@@ -1,406 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// rettype.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for return type of the Operation node
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- rettype,
- "$Id$")
-
-
-// ****************************************************************************
-// Operation visitor for return types. This generates the mapping for a return
-// type in an operation signature
-// ****************************************************************************
-
-be_visitor_operation_rettype::be_visitor_operation_rettype (be_visitor_context
- *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_operation_rettype::~be_visitor_operation_rettype (void)
-{
-}
-
-int
-be_visitor_operation_rettype::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- // A typedefed return type.
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << "::" << bt->name () << "_slice *";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- // A typedefed return type.
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << "::" << bt->name ();
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- // A typedefed return type.
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << "::" << bt->name () << "_ptr";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- // A typedefed return type.
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << "::" << bt->name () << "_ptr";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_native (be_native *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- // A typedefed return type.
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << "::" << bt->name ();
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- // A typedefed return type.
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- AST_PredefinedType::PredefinedType pt = node->pt ();
-
- if (pt != AST_PredefinedType::PT_void)
- {
- *os << "::";
- }
-
- switch (pt)
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- *os << bt->name ();
-
- // If it's not TCKind, it's either Object, TypeCode or ValueBase.
- if (ACE_OS::strcmp (bt->local_name ()->get_string (), "TCKind") != 0)
- {
- *os << "_ptr";
- }
-
- break;
- case AST_PredefinedType::PT_any:
- case AST_PredefinedType::PT_value:
- {
- *os << bt->name () << " *";
-
- break;
- }
- default:
- {
- *os << bt->name ();
-
- break;
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_sequence (be_sequence *node)
-{
- // We should never directly be here because anonymous sequence return types
- // are not allowed.
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- // A typedefed return type.
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << "::" << bt->name () << " *";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (node->width () == (long) sizeof (char))
- {
- *os << "char *";
- }
- else
- {
- *os << "::CORBA::WChar *";
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- // A typedefed return type.
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << "::" << bt->name ();
-
- // Based on whether we are variable or not, we return a pointer or the
- // aggregate type.
- if (node->size_type () == AST_Type::VARIABLE)
- {
- *os << " *";
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_typedef (be_typedef *node)
-{
- // Set the alias node.
- this->ctx_->alias (node);
-
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- // A typedefed return type.
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << "::" << bt->name ();
-
- // Based on whether we are variable or not, we return a pointer or the
- // aggregate type.
- if (node->size_type () == AST_Type::VARIABLE)
- {
- *os << " *";
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- // A typedefed return type.
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << "::" << bt->name () << " *";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- // A typedefed return type.
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << "::" << bt->name () << " *";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_component (be_component *node)
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_operation_rettype::visit_component_fwd (be_component_fwd *node)
-{
- return this->visit_interface_fwd (node);
-}
-
-int
-be_visitor_operation_rettype::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_operation_rettype::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
-
-int
-be_visitor_operation_rettype::visit_home (be_home *node)
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_operation_rettype::visit_valuebox (be_valuebox *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- // A typedefed return type.
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << "::" << bt->name () << " *";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_return_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_return_cs.cpp
deleted file mode 100644
index fa7e91171b3..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_return_cs.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// rettype_return_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for returning the return type variable.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- rettype_return_cs,
- "$Id$")
-
-// ************************************************************
-// be_visitor_operation_rettype_return_cs
-//
-// code to generate the return statement of the stub.
-// ************************************************************
-
-be_visitor_operation_rettype_return_cs::
-be_visitor_operation_rettype_return_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_operation_rettype_return_cs::
-~be_visitor_operation_rettype_return_cs (void)
-{
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_array (be_array *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "_tao_retval._retn ()";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "_tao_retval";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "_tao_retval._retn ()";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "_tao_retval";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_valuebox (be_valuebox *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "_tao_retval._retn ()";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_valuetype (be_valuetype *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "_tao_retval._retn ()";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "_tao_retval._retn ()";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_predefined_type (
- be_predefined_type *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- *os << "_tao_retval._retn ()";
-
- break;
- case AST_PredefinedType::PT_any:
- *os << "_tao_retval._retn ()";
-
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- *os << "_tao_retval";
-
- break;
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "_tao_retval._retn ()";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "_tao_retval._retn ()";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (node->size_type () == AST_Type::VARIABLE)
- {
- *os << "_tao_retval._retn ()";
- }
- else
- {
- *os << "_tao_retval";
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_return_cs::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (node->size_type () == AST_Type::VARIABLE)
- {
- *os << "_tao_retval._retn ()";
- }
- else
- {
- *os << "_tao_retval";
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_component (be_component *node)
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_component_fwd (
- be_component_fwd *node
- )
-{
- return this->visit_interface_fwd (node);
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_eventtype_fwd (
- be_eventtype_fwd *node
- )
-{
- return this->visit_valuetype_fwd (node);
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_home (be_home *node)
-{
- return this->visit_interface (node);
-}
-
-
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_ch.cpp
deleted file mode 100644
index 1e34b2b8db5..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_ch.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// operation_smart_proxy_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation node in the client header.
-//
-// = AUTHOR
-// Kirthika Parameswaran <kirthika@cs.wustl.edu>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- smart_proxy_ch,
- "$Id$")
-
-// ******************************************************
-// Primary visitor for "operation" in client header.
-// ******************************************************
-
-be_visitor_operation_smart_proxy_ch::be_visitor_operation_smart_proxy_ch (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_operation_smart_proxy_ch::~be_visitor_operation_smart_proxy_ch (
- void
- )
-{
-}
-
-int
-be_visitor_operation_smart_proxy_ch::visit_operation (be_operation *node)
-{
-
- if (be_global->gen_smart_proxies ())
- {
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
- os->indent ();
-
- *os << "virtual ";
-
- // STEP I: generate the return type.
- be_type *bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_smart_proxy_ch::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- be_visitor_context ctx (*this->ctx_);
- be_visitor_operation_rettype or_visitor (&ctx);
-
- if (bt->accept (&or_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_smart_proxy_ch::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
-
- // STEP 2: generate the operation name.
- *os << " " << node->local_name ();
-
- // STEP 3: generate the argument list with the appropriate mapping. For these
- // we grab a visitor that generates the parameter listing
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_CH);
- be_visitor_operation_arglist oa_visitor (&ctx);
-
- if (node->accept (&oa_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_smart_proxy_ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- }
- else
- {
- ACE_UNUSED_ARG (node);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp
deleted file mode 100644
index 984a49b9da8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// operation_smart_proxy_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the stubs file.
-//
-// = AUTHOR
-// Kirthika Parameswaran <kirthika@cs.wustl.edu>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- operation_smart_proxy_cs,
- "$Id$")
-
-// ************************************************************
-// Operation visitor for client stubs
-// ************************************************************
-
-be_visitor_operation_smart_proxy_cs::be_visitor_operation_smart_proxy_cs (
- be_visitor_context *ctx
- )
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_smart_proxy_cs::~be_visitor_operation_smart_proxy_cs (
- void
- )
-{
-}
-
-int be_visitor_operation_smart_proxy_cs::visit_operation (be_operation *node)
-{
- if (be_global->gen_smart_proxies ())
- {
- TAO_OutStream *os = this->ctx_->stream ();
-
- // We need the interface node in which this operation was defined. However,
- // if this operation node was an attribute node in disguise, we get this
- // information from the context.
- be_interface *intf = this->ctx_->attribute ()
- ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ())
- : be_interface::narrow_from_scope (node->defined_in ());
-
- if (!intf)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_smart_proxy_cs::"
- "visit_operation - "
- "bad interface scope\n"),
- -1);
- }
-
- be_type *bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_smart_proxy_cs::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- // STEP 2: generate the return type mapping (same as in the header file).
- be_visitor_context ctx (*this->ctx_);
- be_visitor_operation_rettype oro_visitor (&ctx);
-
- if (bt->accept (&oro_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_smart_proxy_cs::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
-
- // Its necessary to take care of the nested case. The smart proxy classes
- // are in the same scope as the proxy (i.e. interface) but here the
- // node (i.e the operation) is already in a scope lower than intf
- // (i.e. be_interface), so for deciding the exact scope use intf.
-
- be_decl* scope = be_scope::narrow_from_scope (intf->defined_in ())->decl ();
-
- *os << " ";
- *os << scope->full_name ();
-
- // Only if there exists any nesting "::" is needed!
- if (intf->is_nested ())
- *os << "::";
-
- *os << "TAO_" << intf->flat_name () <<"_Smart_Proxy_Base::";
- *os << node->local_name () << " ";
-
- // STEP 4: generate the argument list with the appropriate mapping (same as
- // in the header file)
- ctx = *this->ctx_;
- be_visitor_operation_arglist oao_visitor (&ctx);
-
- if (node->accept (&oao_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- *os << "{" << be_idt << "\n";
-
- os->indent ();
-
- // Simply make the call and leave everything to the layer
- // above, i.e. the client code.
- if (!this->void_return_type (bt))
- {
- *os << "return ";
- }
-
- *os << "this->get_proxy ()";
-
- if (this->gen_invoke (ctx, node) == -1)
- return -1;
-
- *os << be_uidt_nl
- << "}\n\n";
- }
- else
- {
- ACE_UNUSED_ARG (node);
- }
-
- return 0;
-}
-
-int be_visitor_operation_smart_proxy_cs::gen_invoke (be_visitor_context &ctx,
- be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "->" << node->local_name () << " ("
- << be_idt << be_idt << "\n";
-
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS);
- be_visitor_operation_argument visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_smart_proxy_cs::"
- "gen_invoke - "
- "codegen for making upcall failed\n"),
- -1);
- }
-
- *os << be_uidt_nl
- << ");\n" << be_uidt;
-
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp
deleted file mode 100644
index a0fc6da455e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// tie_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for operations of the TIE class in the header
-// file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- tie_sh,
- "$Id$")
-
-// ************************************************************
-// Operation visitor for server header for TIE class operations.
-// ************************************************************
-
-be_visitor_operation_tie_sh::be_visitor_operation_tie_sh (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_operation_tie_sh::~be_visitor_operation_tie_sh (void)
-{
-}
-
-int
-be_visitor_operation_tie_sh::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- // STEP I: generate the return type.
- be_type *bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_tie_sh::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- be_visitor_context ctx (*this->ctx_);
- be_visitor_operation_rettype oro_visitor (&ctx);
-
- if (bt->accept (&oro_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_tie_sh::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
-
- // STEP 2: generate the operation name.
- *os << " " << node->local_name ();
-
- // STEP 3: generate the argument list with the appropriate mapping. For these
- // we grab a visitor that generates the parameter listing
- ctx = *this->ctx_;
- // we use the _CH state here because the _SH state produces pure virtual
- // methods.
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_CH);
- be_visitor_operation_arglist oa_visitor (&ctx);
-
- if (node->accept (&oa_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_tie_sh::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp b/TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp
deleted file mode 100644
index ffa3758d8c8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// tie_si.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for operations for the TIE class.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_operation,
- tie_si,
- "$Id$")
-
-// ************************************************************
-// Operation visitor for server inline for TIE class operations.
-// ************************************************************
-
-be_visitor_operation_tie_si::be_visitor_operation_tie_si (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_operation_tie_si::~be_visitor_operation_tie_si (void)
-{
-}
-
-int be_visitor_operation_tie_si::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_interface *intf = this->ctx_->interface ();
-
- if (!intf)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_tie_si::"
- "visit_operation - "
- "bad interface scope\n"),
- -1);
- }
-
- // Retrieve the operation return type.
- be_type *bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_tie_si::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- // Although unlikely it is possible that the 'T' in 'template class<T>' will
- // conflict with an argument name...
- ACE_CString template_name ("T");
- bool template_name_ok = false;
-
- while (!template_name_ok)
- {
- template_name_ok = true;
-
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- ! si.is_done () && template_name_ok;
- si.next ())
- {
- // Check for conflicts between the arg name and the proposed template
- // class identifier
- AST_Argument *arg =
- AST_Argument::narrow_from_decl (si.item ());
-
- if (! ACE_OS::strcmp (arg->local_name ()->get_string (),
- template_name.c_str ()))
- {
- // clash !
- template_name_ok = false;
- }
- }
-
- if (! template_name_ok)
- {
- // We had a clash - postfix an underscore and try again
- template_name += "_";
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "template <class " << template_name.c_str () << "> ACE_INLINE\n";
-
- // Generate the return type mapping (same as in the header file).
- be_visitor_context ctx (*this->ctx_);
- be_visitor_operation_rettype oro_visitor (&ctx);
-
- if (bt->accept (&oro_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_tie_si::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
-
- *os << " " << intf->full_skel_name () << "_tie<" << template_name.c_str () << ">::"
- << node->local_name () << " ";
-
- // STEP 4: generate the argument list with the appropriate mapping (same as
- // in the header file)
- ctx = *this->ctx_;
- be_visitor_operation_arglist oao_visitor (&ctx);
-
- if (node->accept (&oao_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- *os << be_nl << "{" << be_idt_nl;
-
- be_predefined_type *pdt = be_predefined_type::narrow_from_decl (bt);
-
- if (pdt == 0 || pdt->pt () != AST_PredefinedType::PT_void)
- {
- *os << "return ";
- }
-
- *os << "this->ptr_->" << node->local_name () << " (" << be_idt;
-
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS);
- be_visitor_operation_argument ocau_visitor (&ctx);
-
- if (node->accept (&ocau_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for making upcall failed\n"),
- -1);
- }
-
- *os << be_uidt_nl;
- *os << ");" << be_uidt_nl;
- *os << "}";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp
deleted file mode 100644
index bdf0aff984d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp
+++ /dev/null
@@ -1,410 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// upcall_command_ss.cpp
-//
-// = DESCRIPTION
-// Visitor that generates operation-specific TAO::Upcall_Command
-// objects in skeletons.
-//
-// = AUTHOR
-// Ossama Othman
-//
-// ============================================================================
-
-
-ACE_RCSID (be_visitor_operation,
- upcall_command_ss,
- "$Id$")
-
-be_visitor_operation_upcall_command_ss
-::be_visitor_operation_upcall_command_ss (
- be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_upcall_command_ss
-::~be_visitor_operation_upcall_command_ss (void)
-{
-}
-
-// The following needs to be done to deal until the MSVC compiler's broken
-// handling of namespaces is fixed (hopefully forthcoming in version 7).
-int
-be_visitor_operation_upcall_command_ss
-::gen_nested_namespace_begin (be_module *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- char *item_name = 0;
- bool first_level = true;
-
- for (UTL_IdListActiveIterator i (node->name ()); !i.is_done (); i.next ())
- {
- item_name = i.item ()->get_string ();
-
- if (ACE_OS::strcmp (item_name, "") != 0)
- {
- // Leave the outermost root scope.
- *os << "namespace ";
-
- if (first_level)
- {
- // We are outermost module.
- *os << "POA_";
- first_level = false;
- }
-
- *os << item_name << be_nl
- << "{" << be_idt_nl;
- }
- }
-
- return 0;
-}
-
-// The following needs to be done to deal until the MSVC compiler's broken
-// handling of namespaces is fixed (hopefully forthcoming in version 7).
-int
-be_visitor_operation_upcall_command_ss
-::gen_nested_namespace_end (be_module *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- for (UTL_IdListActiveIterator i (node->name ()); !i.is_done (); i.next ())
- {
- if (ACE_OS::strcmp (i.item ()->get_string (), "") != 0)
- {
- // Leave the outermost root scope.
- *os << be_uidt_nl << "}" << be_nl;
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_upcall_command_ss::visit (be_operation * node,
- char const * full_skel_name,
- char const * upcall_command_name)
-{
- be_interface * const intf = this->ctx_->attribute ()
- ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ())
- : be_interface::narrow_from_scope (node->defined_in ());
-
- be_module *module = 0;
-
- // Is our enclosing scope a module? We need this check because for
- // platforms that support namespaces, the typecode must be declared
- // extern.
- if (intf->is_nested () &&
- intf->defined_in ()->scope_node_type () == AST_Decl::NT_module)
- {
- module = be_module::narrow_from_scope (intf->defined_in ());
-
- if (!module || (this->gen_nested_namespace_begin (module) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_upcall_command_ss::visit - "
- "Error parsing nested name\n"),
- -1);
- }
- }
-
- be_visitor_context ctx (*this->ctx_);
-
- // save the node.
- this->ctx_->node (node);
-
- TAO_OutStream & os = *this->ctx_->stream ();
-
- os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Generate the operation-specific TAO::Upcall_Command concrete class.
-
- if (!intf)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_upcall_command_ss::"
- "visit - "
- "bad interface scope\n"),
- -1);
- }
-
- // Generate an operation-specific concrete TAO::Upcall_Command
- // class, an instance of which will be invoked by the
- // TAO::Upcall_Wrapper object.
-
- os << "class " << upcall_command_name << be_nl
- << " : public TAO::Upcall_Command" << be_nl
- << "{" << be_nl
- << "public:" << be_idt_nl ;
-
- // Generate constructor
- os << "inline " << upcall_command_name
- << " (" << be_idt_nl
- << full_skel_name << " * servant";
-
- // No need to accept an argument array parameter if the operation
- // has no arguments.
- if (!node->void_return_type () || node->argument_count () > 0)
- {
- os << "," << be_nl;
-
- if (be_global->gen_thru_poa_collocation ())
- os << "TAO_Operation_Details const * operation_details," << be_nl;
-
- os << "TAO::Argument * const args[])" << be_nl;
- }
- else
- {
- os << ")" << be_nl;
- }
-
- os << ": servant_ (servant)";
-
- // If the operation has no arguments don't generate a member
- // initializer for the class argument array member/attribute.
- if (!node->void_return_type () || node->argument_count () > 0)
- {
- os << be_idt_nl;
-
- if (be_global->gen_thru_poa_collocation ())
- {
- os << ", operation_details_ (operation_details)" << be_nl;
- }
-
- os << ", args_ (args)" << be_uidt;
- }
-
- os << be_uidt_nl;
-
- os << "{" << be_nl
- << "}" << be_nl << be_nl;
-
- // Generate execute() method.
- os << "virtual void execute ("
- << (be_global->use_raw_throw () ? "void" : "ACE_ENV_SINGLE_ARG_DECL")
- << ")" << be_nl
- << "{" << be_idt_nl;
-
- if (!node->void_return_type ())
- {
- os << "TAO::SArg_Traits< ";
-
-
- this->gen_arg_template_param_name (node,
- node->return_type (),
- &os);
-
- os << ">::ret_arg_type retval =" << be_idt_nl;
-
- if (be_global->gen_thru_poa_collocation ())
- {
- os << "TAO::Portable_Server::get_ret_arg< ";
-
- this->gen_arg_template_param_name (node,
- node->return_type (),
- &os);
-
- os << "> (" << be_idt_nl
- << "this->operation_details_," << be_nl
- << "this->args_);" << be_uidt;
- }
- else
- {
- os << "static_cast<TAO::SArg_Traits< ";
-
- this->gen_arg_template_param_name (node,
- node->return_type (),
- &os);
-
- os << ">::ret_val *> (this->args_[0])->arg ();";
- }
-
- os << be_uidt_nl << be_nl;
- }
-
- if (this->gen_upcall (node) == -1)
- {
- return -1;
- }
-
- os << "}" << be_uidt_nl << be_nl;
-
- // Generate class attributes.
- os << "private:" << be_idt_nl
- << full_skel_name << " * const servant_;";
-
- // Don't bother generating an argument array attribute if the
- // operation has no arguments.
- if (!node->void_return_type () || node->argument_count () > 0)
- {
- os << be_nl;
-
- if (be_global->gen_thru_poa_collocation ())
- os << "TAO_Operation_Details const * const operation_details_;" << be_nl;
-
- os << "TAO::Argument * const * const args_;";
- }
-
- os << be_uidt_nl
- << "};";
-
- if (module != 0)
- {
- if (this->gen_nested_namespace_end (module) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_upcall_command_ss::visit - "
- "Error parsing nested name\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_upcall_command_ss::gen_upcall (be_operation * node)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- UTL_ScopeActiveIterator si (node,
- UTL_Scope::IK_decls);
-
- unsigned int index = 1;
-
- for (; !si.is_done (); si.next (), ++index)
- {
- AST_Argument * const arg =
- AST_Argument::narrow_from_decl (si.item ());
-
- os << "TAO::SArg_Traits< ";
-
- this->gen_arg_template_param_name (arg,
- arg->field_type (),
- &os);
-
- os << ">::";
-
- switch (arg->direction ())
- {
- case AST_Argument::dir_IN:
- os << "in";
- break;
- case AST_Argument::dir_INOUT:
- os << "inout";
- break;
- case AST_Argument::dir_OUT:
- os << "out";
- default:
- break;
- }
-
- os << "_arg_type arg_" << index << " =" << be_idt_nl;
-
- if (be_global->gen_thru_poa_collocation ())
- {
- os << "TAO::Portable_Server::get_";
-
- switch (arg->direction ())
- {
- case AST_Argument::dir_IN:
- os << "in";
- break;
- case AST_Argument::dir_INOUT:
- os << "inout";
- break;
- case AST_Argument::dir_OUT:
- os << "out";
- default:
- break;
- }
-
- os << "_arg< ";
-
- this->gen_arg_template_param_name (arg,
- arg->field_type (),
- &os);
-
- os << "> (" << be_idt_nl
- << "this->operation_details_," << be_nl
- << "this->args_," << be_nl
- << index << ");" << be_uidt_nl;
- }
- else
- {
- os << "static_cast<TAO::SArg_Traits< ";
-
- this->gen_arg_template_param_name (arg,
- arg->field_type (),
- &os);
-
- os << ">::";
-
- switch (arg->direction ())
- {
- case AST_Argument::dir_IN:
- os << "in";
- break;
- case AST_Argument::dir_INOUT:
- os << "inout";
- break;
- case AST_Argument::dir_OUT:
- os << "out";
- default:
- break;
- }
-
- os << "_arg_val *> (this->args_[" << index << "])->arg ();"
- << be_nl;
- }
-
- os << be_uidt_nl;
-
- }
-
- if (!node->void_return_type ())
- {
- os << "retval =" << be_idt_nl;
- }
-
- os << "this->servant_->" << node->local_name () << " ("
- << be_idt;
-
- size_t const count = node->argument_count ();
-
- for (unsigned int i = 0; i < count; ++i)
- {
- os << be_nl
- << (i == 0 ? "" : ", ") << "arg_" << i + 1;
- }
-
- if (count > 0)
- {
- os << env_arg;
- }
- else
- {
- os << env_sngl_arg;
- }
-
- os << ");";
-
- if (!node->void_return_type ())
- {
- os << be_uidt;
- }
-
- os << be_uidt
- << TAO_ACE_CHECK () << be_uidt_nl;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_root.cpp b/TAO/TAO_IDL/be/be_visitor_root.cpp
deleted file mode 100644
index 3cee0de1265..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_root.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Root
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_constant.h"
-#include "be_enum.h"
-#include "be_exception.h"
-#include "be_interface.h"
-#include "be_interface_fwd.h"
-#include "be_module.h"
-#include "be_root.h"
-#include "be_structure.h"
-#include "be_structure_fwd.h"
-#include "be_typedef.h"
-#include "be_union.h"
-#include "be_union_fwd.h"
-#include "be_valuebox.h"
-#include "be_valuetype.h"
-#include "be_valuetype_fwd.h"
-#include "be_eventtype.h"
-#include "be_eventtype_fwd.h"
-#include "be_component.h"
-#include "be_component_fwd.h"
-#include "be_home.h"
-#include "be_helper.h"
-#include "be_extern.h"
-
-#include "be_visitor_root.h"
-#include "be_visitor_constant.h"
-#include "be_visitor_enum.h"
-#include "be_visitor_exception.h"
-#include "be_visitor_interface.h"
-#include "be_visitor_interface_fwd.h"
-#include "be_visitor_module.h"
-#include "be_visitor_structure.h"
-#include "be_visitor_structure_fwd.h"
-#include "be_visitor_typedef.h"
-#include "be_visitor_union.h"
-#include "be_visitor_union_fwd.h"
-#include "be_visitor_valuebox.h"
-#include "be_visitor_valuetype.h"
-#include "be_visitor_valuetype_fwd.h"
-#include "be_visitor_component.h"
-#include "be_visitor_component_fwd.h"
-#include "be_visitor_home.h"
-#include "be_visitor_traits.h"
-#include "be_visitor_arg_traits.h"
-#include "be_visitor_context.h"
-
-#include "be_visitor_root/root.cpp"
-#include "be_visitor_root/root_ch.cpp"
-#include "be_visitor_root/root_ci.cpp"
-#include "be_visitor_root/root_cs.cpp"
-#include "be_visitor_root/root_sh.cpp"
-#include "be_visitor_root/root_si.cpp"
-#include "be_visitor_root/root_ss.cpp"
-#include "be_visitor_root/root_sth.cpp"
-#include "be_visitor_root/root_is.cpp"
-#include "be_visitor_root/root_ih.cpp"
-#include "be_visitor_root/any_op.cpp"
-#include "be_visitor_root/cdr_op.cpp"
-#include "be_visitor_root/serializer_op.cpp"
-
-ACE_RCSID (be,
- be_visitor_root,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_root/any_op.cpp b/TAO/TAO_IDL/be/be_visitor_root/any_op.cpp
deleted file mode 100644
index 9455e261b8a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/any_op.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the Any operators for types defined in Root's
-// scope.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_root,
- any_op,
- "$Id$")
-
-// ***************************************************************************
-// Root visitor for generating Any operator declarations in the client header
-// and stub
-// ***************************************************************************
-
-be_visitor_root_any_op::be_visitor_root_any_op (be_visitor_context *ctx)
- : be_visitor_root (ctx)
-{
-}
-
-be_visitor_root_any_op::~be_visitor_root_any_op (void)
-{
-}
-
-int
-be_visitor_root_any_op::visit_root (be_root *node)
-{
- if (be_global->gen_anyop_files ())
- {
- // Switch streams, ctx will be reassigned when this
- // pass is done.
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- this->ctx_->stream (tao_cg->anyop_header ());
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- this->ctx_->stream (tao_cg->anyop_source ());
- break;
- default:
- break;
- }
- }
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::visit_root - "
- "codegen for scope failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp b/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp
deleted file mode 100644
index 24bee065237..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the CDR operators for types defined
-// in Root's scope.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_root,
- cdr_op,
- "$Id$")
-
-// ***************************************************************************
-// Root visitor for generating CDR operator declarations in the client header
-// and stub
-// ***************************************************************************
-
-be_visitor_root_cdr_op::be_visitor_root_cdr_op (be_visitor_context *ctx)
- : be_visitor_root (ctx)
-{
-}
-
-be_visitor_root_cdr_op::~be_visitor_root_cdr_op (void)
-{
-}
-
-int
-be_visitor_root_cdr_op::visit_root (be_root *node)
-{
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root_cdr_op::visit_root - "
- "codegen for scope failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_root/root.cpp b/TAO/TAO_IDL/be/be_visitor_root/root.cpp
deleted file mode 100644
index 9c3ce0b4462..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root.cpp
+++ /dev/null
@@ -1,1738 +0,0 @@
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// root.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the Root node. This is a generic visitor.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-ACE_RCSID (be_visitor_root,
- root,
- "$Id$")
-
-// Generic Root visitor
-be_visitor_root::be_visitor_root (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_root::~be_visitor_root (void)
-{
-}
-
-// This method must be overridden by the derived root visitors.
-int
-be_visitor_root::init (void)
-{
- return -1;
-}
-
-int be_visitor_root::visit_root (be_root *node)
-{
- // Open the appropriate output file based on what state we are in. The
- // overridden "init" method of derived classes will do the job.
- if (this->init () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::init - "
- "failed to initialize context\n"),
- -1);
- }
-
- // The SI and SS cases are caught in BE_produce()
- if (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_SH
- && !be_global->gen_skel_files ())
- {
- return 0;
- }
-
- TAO_OutStream * const os = this->ctx_->stream ();
-
- int status = 0;
- be_visitor_context ctx = *this->ctx_;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_arg_traits arg_visitor ("", &ctx);
- status = node->accept (&arg_visitor);
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_root - "
- "failed to generate stub arg traits\n"),
- -1);
- }
- }
-
- break;
- case TAO_CodeGen::TAO_ROOT_SS:
- {
- be_visitor_arg_traits arg_visitor ("S", &ctx);
- status = node->accept (&arg_visitor);
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_root - "
- "failed to generate skeleton arg traits\n"),
- -1);
- }
-
- if (be_global->gen_thru_poa_collocation ()
- || be_global->gen_direct_collocation ())
- {
- be_visitor_arg_traits arg_visitor ("", &ctx);
- status = node->accept (&arg_visitor);
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_root - "
- "failed to generate collocated skeleton arg traits\n"),
- -1);
- }
- }
- }
-
- break;
- default:
- break;
- }
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::visit_root - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // If we are generating the client header file, this is the place to
- // generate the proxy broker factory function pointer declarations
- // and the extern declarations for non-defined interfaces.
- if (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_CH)
- {
- be_interface *i = 0;
- be_interface_fwd *ifwd = 0;
- size_t index = 0;
-
- size_t size = be_global->non_local_interfaces.size ();
-
- if (size > 0)
- {
- *os << be_nl << be_nl
- << "// Proxy Broker Factory function pointer declarations."
- << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
- }
-
- for (index = 0; index < size; ++index)
- {
- be_global->non_local_interfaces.dequeue_head (i);
-
- *os << be_nl << be_nl
- << "extern " << be_global->stub_export_macro () << be_nl
- << "TAO::Collocation_Proxy_Broker *" << be_nl
- << "(*" << i->flat_client_enclosing_scope ()
- << i->base_proxy_broker_name ()
- << "_Factory_function_pointer) ("
- << be_idt << be_idt_nl
- << "::CORBA::Object_ptr obj" << be_uidt_nl
- << ");" << be_uidt;
- }
-
- size = be_global->non_defined_interfaces.size ();
-
- if (size > 0)
- {
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
- }
-
- for (index = 0; index < size; ++index)
- {
- be_global->non_defined_interfaces.dequeue_head (ifwd);
-
- *os << be_nl << be_nl;
-
- if (ifwd->is_valuetype ())
- {
- *os << "// External declarations for undefined valuetype"
- << be_nl << be_nl
- << "// " << ifwd->full_name () << be_nl;
-
- *os << be_global->stub_export_macro () << be_nl
- << "void" << be_nl
- << "tao_" << ifwd->flat_name ()
- << "_add_ref ("
- << be_idt << be_idt_nl
- << ifwd->full_name () << " *" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl
- << be_global->stub_export_macro () << be_nl
- << "void" << be_nl
- << "tao_" << ifwd->flat_name ()
- << "_remove_ref (" << be_idt << be_idt_nl
- << ifwd->full_name () << " *" << be_uidt_nl
- << ");" << be_uidt;
- }
- }
-
- size = be_global->mixed_parentage_interfaces.size ();
-
- if (size > 0)
- {
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << "// Overrides of CORBA::release and CORBA::is_nil for"
- << be_nl
- << "// interfaces that inherit from both CORBA::Object" << be_nl
- << "// and CORBA::AbstractBase." << be_nl << be_nl
- << "namespace CORBA" << be_nl
- << "{" << be_idt;
- }
-
- for (index = 0; index < size; ++index)
- {
- be_global->mixed_parentage_interfaces.dequeue_head (i);
-
- *os << be_nl
- << "TAO_NAMESPACE_STORAGE_CLASS void release ("
- << i->name () << "_ptr);" << be_nl
- << "TAO_NAMESPACE_STORAGE_CLASS ::CORBA::Boolean is_nil ("
- << i->name () << "_ptr);";
- }
-
- if (size > 0)
- {
- *os << be_uidt_nl
- << "}";
-
- *os << be_global->core_versioning_end () << be_nl;
- }
- }
-
- // Make one more pass over the entire tree and generate the OBV_ namespaces
- // and OBV_ classes.
-
- bool obv = 1;
- status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- ctx.state (TAO_CodeGen::TAO_MODULE_OBV_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- ctx.state (TAO_CodeGen::TAO_MODULE_OBV_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_MODULE_OBV_CS);
- break;
- default:
- obv = 0;
- break;
- }
-
- if (obv == 1)
- {
- be_visitor_obv_module visitor (&ctx);
- status = visitor.visit_scope (node);
- obv = 0;
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_root - "
- "failed to generate OBV_ things\n"),
- -1);
- }
- }
-
- status = 0;
- ctx = *this->ctx_;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_traits visitor (&ctx);
- status = node->accept (&visitor);
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_root - "
- "failed to generate traits\n"),
- -1);
- }
- }
-
- break;
- default:
- break;
- }
-
- // The next thing we need to do is make one more pass thru the entire tree
- // and generate code for all the <<= and >>= operators for all the
- // user-defined types.
-
- ctx = *this->ctx_;
- status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- ctx.state (TAO_CodeGen::TAO_ROOT_ANY_OP_CH);
-
- if (be_global->any_support ())
- {
- be_visitor_root_any_op visitor (&ctx);
- status = node->accept (&visitor);
-
- // Conditional switch to the *A.h stream is done
- // in the visitor constructor.
- if (be_global->gen_anyop_files ())
- {
- (void) tao_cg->end_anyop_header ();
- }
- }
-
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- ctx.state (TAO_CodeGen::TAO_ROOT_ANY_OP_CS);
-
- if (be_global->any_support ())
- {
- be_visitor_root_any_op visitor (&ctx);
- status = node->accept (&visitor);
-
- // Conditional switch to the *A.cpp stream is done
- // in the visitor constructor.
- if (be_global->gen_anyop_files ())
- {
- (void) tao_cg->end_anyop_source ();
- }
- }
-
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IH:
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_CI:
- case TAO_CodeGen::TAO_ROOT_IS:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- case TAO_CodeGen::TAO_ROOT_TIE_SH:
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_constant - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_root - "
- "failed to generate Any operators\n"),
- -1);
- }
-
- // Make another pass over the entire tree and generate the CDR operators.
- ctx = *this->ctx_;
- status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- ctx.state (TAO_CodeGen::TAO_ROOT_CDR_OP_CH);
- be_visitor_root_cdr_op visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- ctx.state (TAO_CodeGen::TAO_ROOT_CDR_OP_CS);
- be_visitor_root_cdr_op visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_IH:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- case TAO_CodeGen::TAO_ROOT_IS:
- case TAO_CodeGen::TAO_ROOT_TIE_SH:
- break; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_root - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (be_global->gen_dcps_type_support ())
- {
- // Make another pass over the entire tree and generate the
- // Serializer operators.
- ctx = *this->ctx_;
- status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- ctx.state (TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH);
- be_visitor_root_cdr_op visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- ctx.state (TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS);
- be_visitor_root_cdr_op visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_IH:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- case TAO_CodeGen::TAO_ROOT_IS:
- case TAO_CodeGen::TAO_ROOT_TIE_SH:
- break; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_root - "
- "Bad context state\n"),
- -1);
- }
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_root - "
- "failed to generate CDR operators\n"),
- -1);
- }
-
- // Generate any final code such as #endifs and/or EOF newlines.
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- (void) tao_cg->end_client_header ();
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- tao_cg->end_client_inline ();
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- tao_cg->end_client_stubs ();
- break;
- case TAO_CodeGen::TAO_ROOT_SH:
- (void) tao_cg->end_server_header ();
- break;
- case TAO_CodeGen::TAO_ROOT_IS:
- break;
- case TAO_CodeGen::TAO_ROOT_IH:
- (void) tao_cg->end_implementation_header (
- be_global->be_get_implementation_hdr_fname (0)
- );
- break;
- case TAO_CodeGen::TAO_ROOT_SI:
- if (be_global->gen_tie_classes ())
- {
- (void) tao_cg->end_server_template_inline ();
- }
-
- tao_cg->end_server_inline ();
- break;
- case TAO_CodeGen::TAO_ROOT_SS:
- if (be_global->gen_tie_classes ())
- {
- (void) tao_cg->end_server_template_skeletons ();
- }
-
- (void) tao_cg->end_server_skeletons ();
- break;
- case TAO_CodeGen::TAO_ROOT_TIE_SH:
- if (be_global->gen_tie_classes ())
- {
- (void) tao_cg->end_server_template_header ();
- }
-
- break;
- default:
- break;
- }
-
- // Make sure each file ends with a newline.
- *os << "\n";
-
- return 0;
-}
-
-// All common visit methods for root visitor.
-
-int
-be_visitor_root::visit_constant (be_constant *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_constant_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_constant_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_constant - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_root::visit_enum (be_enum *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_enum_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_enum_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_enum_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_enum_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_enum_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_enum_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- be_visitor_enum_serializer_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_enum_serializer_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_enum - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_root::visit_exception (be_exception *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_exception_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_exception_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_exception_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_exception_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_exception_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_exception_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_exception_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- return 0; // nothing to be done for DCPS
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_exception - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-// visit an interface
-int
-be_visitor_root::visit_interface (be_interface *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 1;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_interface_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_interface_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SH:
- {
- be_visitor_interface_sh visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IH:
- {
- be_visitor_interface_ih visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SI:
- {
- be_visitor_interface_si visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SS:
- {
- be_visitor_interface_ss visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IS:
- {
- be_visitor_interface_is visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_interface_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_interface_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_interface_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_interface_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- return 0; // nothing to be done for DCPS
- break;
- }
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_interface - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == 0)
- {
- return 0;
- }
- else if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_interface - "
- "failed to accept visitor\n"),
- -1);
- }
-
- // Change the state depending on the kind of node strategy
- ctx.state (node->next_state (ctx.state ()));
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_interface - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_interface - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
-
- // Do additional code generation is necessary.
- // Note, this call is delegated to the strategy connected to
- // the node.
- if (node->has_extra_code_generation (ctx.state ()))
- {
- // Change the state depending on the kind of node strategy
- ctx.state (node->next_state (ctx.state (), 1));
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_interface - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_interface - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
- }
-
- ctx.state (TAO_CodeGen::TAO_ROOT_CH);
- return 0;
-}
-
-int
-be_visitor_root::visit_interface_fwd (be_interface_fwd *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_interface_fwd_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_interface_fwd_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_interface_fwd_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- return 0; // nothing to be done for DCPS
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_interface_fwd - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_root::visit_valuebox (be_valuebox *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_valuebox_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_valuebox_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_valuebox_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_valuebox_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_valuebox_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_valuebox_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_valuebox_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- {
- break;
- }
- default:
- return 0; // nothing to do.
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_valuebox - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_root::visit_valuetype (be_valuetype *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_valuetype_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_valuetype_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_valuetype_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_valuetype_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_valuetype_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- return 0; // nothing to be done for DCPS
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_valuetype_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_valuetype_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SH:
- {
- be_visitor_valuetype_sh visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SI:
- {
- be_visitor_valuetype_si visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SS:
- {
- be_visitor_valuetype_ss visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to do.
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_valuetype - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_root::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_valuetype_fwd_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_valuetype_fwd_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_valuetype_fwd_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- return 0; // nothing to be done
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_valuetype_fwd - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_root::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_root::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
-
-int
-be_visitor_root::visit_component (be_component *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_component_ch visitor (&ctx);
- // This is the only context state involved in strategies.
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CH);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_component_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_component_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_component_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_component_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- return 0; // nothing to be done for DCPS
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_component_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_component_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SH:
- {
- be_visitor_component_sh visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SI:
- {
- be_visitor_component_si visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SS:
- {
- be_visitor_component_ss visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to do.
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_component - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_root::visit_component_fwd (be_component_fwd *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_component_fwd_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_component_fwd_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_component_fwd_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- return 0; // nothing to be done for DCPS
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_component_fwd - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_root::visit_home (be_home *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_home_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_home_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_home - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_root::visit_module (be_module *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_module_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_module visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_module visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SH:
- {
- be_visitor_module_sh visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- case TAO_CodeGen::TAO_ROOT_IS:
- {
- be_visitor_module visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_IH:
- {
- be_visitor_module_ih visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_module_any_op visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_module_cdr_op visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_module_serializer_op visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_module - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_module - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_root::visit_structure (be_structure *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_structure_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_structure_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_structure_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_structure_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_structure_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_structure_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_structure_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- be_visitor_structure_serializer_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_structure_serializer_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_structure - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_root::visit_structure_fwd (be_structure_fwd *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_structure_fwd_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_structure_fwd - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_root::visit_union (be_union *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_union_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_union_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_union_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_union_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_union_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_union_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_union_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- be_visitor_union_serializer_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_union_serializer_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_union - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_root::visit_union_fwd (be_union_fwd *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_union_fwd_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_interface_fwd - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_root::visit_typedef (be_typedef *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_typedef_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_typedef_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_typedef_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_typedef_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_typedef_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_typedef_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_typedef_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- be_visitor_typedef_serializer_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_typedef_serializer_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_typedef - "
- "failed to accept visitor"),
- -1);
- }
-
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp
deleted file mode 100644
index 26ab72be1cc..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// root_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Root in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_root,
- root_ch,
- "$Id$")
-
-// ********************************
-// Root visitor for client header
-// ********************************
-
-be_visitor_root_ch::be_visitor_root_ch (be_visitor_context *ctx)
- : be_visitor_root (ctx)
-{
-}
-
-be_visitor_root_ch::~be_visitor_root_ch (void)
-{
-}
-
-int
-be_visitor_root_ch::init (void)
-{
- // First open the client-side header file for writing
- if (tao_cg->start_client_header (be_global->be_get_client_hdr_fname ())
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root_ch::init - "
- "Error opening client header file\n"),
- -1);
- }
-
- // Initialize the stream.
- this->ctx_->stream (tao_cg->client_header ());
-
- // If this IDL file contains an non local interface declaration, generated a
- // forward declaration of the proxy broker for a possible collocated call.
- if (idl_global->non_local_iface_seen_)
- {
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl
- << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << be_nl << be_nl
- << "namespace TAO" << be_nl
- << "{" << be_idt_nl;
-
- *os << "class Collocation_Proxy_Broker;" << be_nl;
-
- if (idl_global->abstract_iface_seen_)
- {
- *os << "template<typename T> class AbstractBase_Narrow_Utils;" << be_nl;
- }
-
- *os << "template<typename T> class Narrow_Utils;" << be_uidt_nl
- << "}" ;
-
- *os << be_global->core_versioning_end () << be_nl;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_ci.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_ci.cpp
deleted file mode 100644
index 4a6001866d6..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_ci.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// root_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the Root in the client inline
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_root,
- root_ci,
- "$Id$")
-
-// *********************************
-// Root visitor for client inline
-// *********************************
-
-be_visitor_root_ci::be_visitor_root_ci (be_visitor_context *ctx)
- : be_visitor_root (ctx)
-{
-}
-
-be_visitor_root_ci::~be_visitor_root_ci (void)
-{
-}
-
-int
-be_visitor_root_ci::init (void)
-{
- // first open the client-side inline file for writing
- if (tao_cg->start_client_inline (be_global->be_get_client_inline_fname ())
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root_ci - "
- "Error opening client inline file\n"),
- -1);
- }
-
- this->ctx_->stream (tao_cg->client_inline ());
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp
deleted file mode 100644
index 2fcc8acd791..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// root_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Root in the client stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_root,
- root_cs,
- "$Id$")
-
-// ***********************************
-// Root visitor for client stubs
-// ***********************************
-
-be_visitor_root_cs::be_visitor_root_cs (be_visitor_context *ctx)
- : be_visitor_root (ctx)
-{
-}
-
-be_visitor_root_cs::~be_visitor_root_cs (void)
-{
-}
-
-int
-be_visitor_root_cs::init (void)
-{
- // first open the file
- if (tao_cg->start_client_stubs (be_global->be_get_client_stub_fname ())
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root_cs - "
- "Error opening client stub file\n"),
- -1);
- }
-
- // init stream
- this->ctx_->stream (tao_cg->client_stubs ());
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_ih.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_ih.cpp
deleted file mode 100644
index 5ff8eea3403..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_ih.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// root_ih.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Root in the server implementation header
-//
-// = AUTHOR
-// Yamuna Krishnamurthy (yamuna@cs.wustl.edu)
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_root,
- root_ih,
- "$Id$")
-
-// ***********************************
-// Root visitor for implementation header
-// ***********************************
-
-be_visitor_root_ih::be_visitor_root_ih (be_visitor_context *ctx)
- : be_visitor_root (ctx)
-{
-}
-
-be_visitor_root_ih::~be_visitor_root_ih (void)
-{
-}
-
-int
-be_visitor_root_ih::init (void)
-{
- if (tao_cg->start_implementation_header (
- be_global->be_get_implementation_hdr_fname ()
- )
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root_ih::init - "
- "Error :%p: Unable to open implementation header file : %s\n",
- "start_implementation_header",
- be_global->be_get_implementation_hdr_fname ()),
- -1);
- }
-
-
- this->ctx_->stream (tao_cg->implementation_header ());
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_is.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_is.cpp
deleted file mode 100644
index 82f3fe275c2..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_is.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// $Id$
-//
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// root_is.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the Root in the implementation skeletons file
-//
-// = AUTHOR
-// Yamuna Krishnamurthy (yamuna@cs.wustl.edu)
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_root,
- root_is,
- "$Id$")
-
-// ******************************************************
-// Root visitor for implementation skeletons
-// ******************************************************
-
-be_visitor_root_is::be_visitor_root_is (be_visitor_context *ctx)
- : be_visitor_root (ctx)
-{
-}
-
-be_visitor_root_is::~be_visitor_root_is (void)
-{
-}
-
-int
-be_visitor_root_is::init (void)
-{
- // First open the file for writing.
- if (tao_cg->start_implementation_skeleton (
- be_global->be_get_implementation_skel_fname ()
- )
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root_is::init - "
- "Error opening implementation skeletons file\n"),
- -1);
- }
-
- this->ctx_->stream (tao_cg->implementation_skeleton ());
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp
deleted file mode 100644
index affeb35db6c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// root_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Root in the server header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_root,
- root_sh,
- "$Id$")
-
-// ***********************************
-// Root visitor for server header
-// ***********************************
-
-be_visitor_root_sh::be_visitor_root_sh (be_visitor_context *ctx)
- : be_visitor_root (ctx)
-{
-}
-
-be_visitor_root_sh::~be_visitor_root_sh (void)
-{
-}
-
-int
-be_visitor_root_sh::init (void)
-{
- // open the file
- if (tao_cg->start_server_header (be_global->be_get_server_hdr_fname ())
- == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_root_sh::init - "
- "Error :%p: Unable to open server header file : %s\n",
- "start_server_header",
- be_global->be_get_server_hdr_fname ()
- ),
- -1
- );
- }
-
- // set the stream and the next state.
- this->ctx_->stream (tao_cg->server_header ());
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_si.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_si.cpp
deleted file mode 100644
index 77cd9ceb807..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_si.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// root_si.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the Root in the server inline file
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_root,
- root_si,
- "$Id$")
-
-// ***********************************************
-// Root visitor for server inline
-// ***********************************************
-
-be_visitor_root_si::be_visitor_root_si (be_visitor_context *ctx)
- : be_visitor_root (ctx)
-{
-}
-
-be_visitor_root_si::~be_visitor_root_si (void)
-{
-}
-
-int
-be_visitor_root_si::init (void)
-{
- // first open the file for writing
- if (tao_cg->start_server_inline (be_global->be_get_server_inline_fname ())
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root_si::init - "
- "server inline open failed\n"),
- -1);
- }
-
- if (be_global->gen_tie_classes ())
- {
- if (tao_cg->start_server_template_inline (
- be_global->be_get_server_template_inline_fname ()
- )
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root_si::init - "
- "Error opening server template inline file\n"),
- -1);
- }
- }
-
- // init stream
- this->ctx_->stream (tao_cg->server_inline ());
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp
deleted file mode 100644
index fcaf4307fac..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// root_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the Root in the server skeletons file
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_root,
- root_ss,
- "$Id$")
-
-// ******************************************************
-// Root visitor for server skeletons
-// ******************************************************
-
-be_visitor_root_ss::be_visitor_root_ss (be_visitor_context *ctx)
- : be_visitor_root (ctx)
-{
-}
-
-be_visitor_root_ss::~be_visitor_root_ss (void)
-{
-}
-
-int
-be_visitor_root_ss::init (void)
-{
- // first open the file for writing
- if (tao_cg->start_server_skeletons (
- be_global->be_get_server_skeleton_fname ()
- )
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root_ss::init - "
- "Error opening server skeletons file\n"),
- -1);
- }
-
- if (be_global->gen_tie_classes ())
- {
- if (tao_cg->start_server_template_skeletons (
- be_global->be_get_server_template_skeleton_fname ()
- )
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root_ss::init - "
- "Error opening server template skeleton file\n"),
- -1);
- }
- }
-
- // set stream
- this->ctx_->stream (tao_cg->server_skeletons ());
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp
deleted file mode 100644
index c0d397965d0..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// root_sth.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Root in the server template header
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_root,
- root_sth,
- "$Id$")
-
-// ****************************************
-// Root visitor for server template header
-// ****************************************
-
-be_visitor_root_sth::be_visitor_root_sth (be_visitor_context *ctx)
- : be_visitor_root (ctx)
-{
-}
-
-be_visitor_root_sth::~be_visitor_root_sth (void)
-{
-}
-
-int
-be_visitor_root_sth::init (void)
-{
- // Open the file.
- if (tao_cg->start_server_template_header (
- be_global->be_get_server_template_hdr_fname ()
- )
- == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_root_sth::init - "
- "Error:Unable to open server template header file : %s\n",
- be_global->be_get_server_template_hdr_fname ()
- ),
- -1
- );
- }
-
- // Set the stream and the next state.
- this->ctx_->stream (tao_cg->server_template_header ());
- return 0;
-}
-
-int
-be_visitor_root_sth::visit_scope (be_scope *node)
-{
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- AST_Decl *d = si.item ();
-
- if (d == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root_sth::visit_scope - "
- "bad node in this scope\n"),
- -1);
- }
-
- be_decl *bd = be_decl::narrow_from_decl (d);
-
- // Set the scope node as "node" in which the code is being
- // generated so that elements in the node's scope can use it
- // for code generation.
- this->ctx_->scope (node->decl ());
-
- // Set the node to be visited.
- this->ctx_->node (bd);
-
- // Send the visitor.
- if (bd == 0 || bd->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root_sth::visit_scope - "
- "codegen for scope failed\n"),
- -1);
-
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_root_sth::visit_module (be_module *node)
-{
- if (node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = tao_cg->server_template_header ();
-
- // Generate the skeleton class name.
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Now generate the class definition. The prefix POA_ is prepended to our
- // name only if we are the outermost module.
- *os << "namespace ";
-
- if (node->is_nested ())
- {
- // We are inside another module.
- *os << node->local_name () << be_nl;
- }
- else
- {
- // We are outermost module.
- *os << "POA_" << node->local_name () << be_nl;
- }
-
- *os << "{" << be_idt;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root_sth::"
- "visit_module - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << "} // module " << node->name ();
-
- return 0;
-}
-
-int
-be_visitor_root_sth::visit_interface (be_interface *node)
-{
- if (node->imported () || node->is_local ())
- {
- return 0;
- }
-
- // Generate the TIE class.
-
- this->ctx_->state (TAO_CodeGen::TAO_ROOT_TIE_SH);
- this->ctx_->node (node);
-
- be_visitor_interface_tie_sh visitor (this->ctx_);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_root_sth::"
- "visit_interface - "
- "codegen for TIE class failed\n"),
- -1);
- }
-
- this->ctx_->state (TAO_CodeGen::TAO_ROOT_TIE_SH);
-
- return 0;
-}
-
-int
-be_visitor_root_sth::visit_component (be_component *node)
-{
- return this->visit_interface (node);
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_root/serializer_op.cpp b/TAO/TAO_IDL/be/be_visitor_root/serializer_op.cpp
deleted file mode 100644
index 09ee1429df7..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/serializer_op.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the TAO::DCPS::Serializer operators
-// for types defined in Root's scope.
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_root,
- serializer_op,
- "$Id$")
-
-// ***************************************************************************
-// Root visitor for generating Serializer operator declarations in the client header
-// and stub
-// ***************************************************************************
-
-be_visitor_root_serializer_op::be_visitor_root_serializer_op (be_visitor_context *ctx)
- : be_visitor_root (ctx)
-{
-}
-
-be_visitor_root_serializer_op::~be_visitor_root_serializer_op (void)
-{
-}
-
-int
-be_visitor_root_serializer_op::visit_root (be_root *node)
-{
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root_serializer_op::visit_root - "
- "codegen for scope failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_scope.cpp b/TAO/TAO_IDL/be/be_visitor_scope.cpp
deleted file mode 100644
index 52504b81847..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_scope.cpp
+++ /dev/null
@@ -1,244 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_scope.cpp
-//
-// = DESCRIPTION
-// Visitor for the base be_scope node. This serves to maintain the current
-// state (context) of code generation for the derived visitor.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_argument.h"
-#include "be_scope.h"
-#include "be_visitor_scope.h"
-#include "be_visitor_context.h"
-#include "ace/Log_Msg.h"
-
-ACE_RCSID (be,
- be_visitor_scope,
- "$Id$")
-
-// ******************************************************
-// Generic visitor for a scope.
-// All elements that give rise to a scope inherit from
-// this class.
-// ******************************************************
-
-be_visitor_scope::be_visitor_scope (be_visitor_context *ctx)
- : be_visitor_decl (ctx),
- elem_number_ (0)
-{
-}
-
-be_visitor_scope::~be_visitor_scope (void)
-{
-}
-
-// Visit the scope and its elements.
-int
-be_visitor_scope::visit_scope (be_scope *node)
-{
- // Proceed if the number of members in our scope is greater than 0.
- this->elem_number_ = 0;
-
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- AST_Decl *d = si.item ();
-
- if (d == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "bad node in this scope\n"),
- -1);
- }
-
- be_decl *bd = be_decl::narrow_from_decl (d);
-
- // Set the scope node as "node" in which the code is being
- // generated so that elements in the node's scope can use it
- // for code generation.
- this->ctx_->scope (node->decl ());
-
- // Set the node to be visited.
- this->ctx_->node (bd);
- this->elem_number_++;
-
- // Do any pre processing using the next item info.
- if (this->pre_process (bd) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "pre processing failed\n"),
- -1);
- }
-
- // Send the visitor.
- if (bd == 0 || bd->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // Do any post processing using this item info.
- if (this->post_process (bd) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "post processing failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_scope::post_process (be_decl *)
-{
- return 0;
-}
-
-int
-be_visitor_scope::pre_process (be_decl *)
-{
- return 0;
-}
-
-int
-be_visitor_scope::elem_number (void)
-{
- // Return the current element that we are working on.
- return this->elem_number_;
-}
-
-// Find the element that succeeds "elem" in the list.
-int
-be_visitor_scope::next_elem (be_decl *elem,
- be_decl *&successor)
-{
- be_decl *ctx_scope = this->ctx_->scope ();
- be_scope *node = 0;
-
- if (ctx_scope != 0)
- {
- node = ctx_scope->scope ();
- }
-
- if (ctx_scope == 0 || node == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::next_elem - "
- "bad scope\n"),
- -1);
- }
-
- successor = 0;
-
- // Initialize an iterator to iterate thru our scope.
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- be_decl *bd = be_decl::narrow_from_decl (si.item ());
-
- if (bd == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::next_elem - "
- "bad node in this scope\n"),
- -1);
- }
-
- if (bd != elem)
- {
- continue;
- }
-
- // Find who is next to me.
- si.next ();
-
- if (si.is_done ())
- {
- // Nobody left in the list.
- return 0;
- }
-
- successor = be_decl::narrow_from_decl (si.item ());
-
- if (successor == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::next_elem - "
- "bad node in this scope\n"),
- -1);
- }
-
- // Nothing else to do.
- return 0;
- }
-
- return 0;
-}
-
-bool
-be_visitor_scope::last_node (be_decl *bd)
-{
- be_decl *next = 0;
- (void) this->next_elem (bd,
- next);
-
- if (next != 0)
- {
- // Not the last.
- return 0;
- }
-
- // I am the last one.
- return 1;
-}
-
-bool
-be_visitor_scope::last_inout_or_out_node (be_decl *)
-{
- // Return true if we are the last inout or out argument.
- be_decl *next = 0;
- (void) this->next_elem (this->ctx_->node (),
- next);
-
- while (next != 0)
- {
- be_argument *arg = be_argument::narrow_from_decl (next);
-
- if (arg->direction () == AST_Argument::dir_INOUT
- || arg->direction () == AST_Argument::dir_OUT)
- {
- // Not the last.
- return 0;
- }
-
- be_decl *next_next = 0;
- this->next_elem (next,
- next_next);
-
- next = next_next;
- }
-
- // I am the last one.
- return 1;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence.cpp b/TAO/TAO_IDL/be/be_visitor_sequence.cpp
deleted file mode 100644
index ef93fee6254..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_sequence.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Sequence
-//
-// = AUTHOR
-// Aniruddha Gokhale and Carlos O'Ryan
-//
-// ============================================================================
-
-#include "be_array.h"
-#include "be_enum.h"
-#include "be_exception.h"
-#include "be_interface.h"
-#include "be_interface_fwd.h"
-#include "be_component.h"
-#include "be_component_fwd.h"
-#include "be_home.h"
-#include "be_predefined_type.h"
-#include "be_sequence.h"
-#include "be_string.h"
-#include "be_structure.h"
-#include "be_structure_fwd.h"
-#include "be_union.h"
-#include "be_union_fwd.h"
-#include "be_type.h"
-#include "be_typedef.h"
-#include "be_valuebox.h"
-#include "be_valuetype.h"
-#include "be_valuetype_fwd.h"
-#include "be_eventtype.h"
-#include "be_eventtype_fwd.h"
-#include "be_helper.h"
-#include "be_extern.h"
-#include "ast_root.h"
-#include "utl_identifier.h"
-#include "nr_extern.h"
-#include "global_extern.h"
-
-#include "be_visitor_sequence.h"
-#include "be_visitor_context.h"
-#include "ace/Log_Msg.h"
-
-#include "be_visitor_sequence/any_op_ch.cpp"
-#include "be_visitor_sequence/any_op_cs.cpp"
-#include "be_visitor_sequence/cdr_op_ch.cpp"
-#include "be_visitor_sequence/cdr_op_cs.cpp"
-#include "be_visitor_sequence/serializer_op_ch.cpp"
-#include "be_visitor_sequence/serializer_op_cs.cpp"
-#include "be_visitor_sequence/buffer_type.cpp"
-#include "be_visitor_sequence/sequence_base.cpp"
-#include "be_visitor_sequence/sequence_ch.cpp"
-#include "be_visitor_sequence/sequence_cs.cpp"
-
-ACE_RCSID (be,
- be_visitor_sequence,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp
deleted file mode 100644
index 9195f4c7d3e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for the Sequence
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_sequence,
- any_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Sequence visitor for generating Any operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_sequence_any_op_ch::be_visitor_sequence_any_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_sequence_any_op_ch::~be_visitor_sequence_any_op_ch (void)
-{
-}
-
-int
-be_visitor_sequence_any_op_ch::visit_sequence (be_sequence *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- const char *macro = this->ctx_->export_macro ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Generate the Any <<= and >>= operators.
- *os << macro;
- *os << " void"
- << " operator<<= ( ::CORBA::Any &, const ";
- *os << node->name ();
- *os << " &); // copying version" << be_nl;
- *os << macro;
- *os << " void"
- << " operator<<= ( ::CORBA::Any &, ";
- *os << node->name ();
- *os << "*); // noncopying version" << be_nl;
- *os << macro;
- *os << " ::CORBA::Boolean"
- << " operator>>= (const ::CORBA::Any &, ";
- *os << node->name ();
- *os << " *&); // deprecated" << be_nl;
- *os << macro;
- *os << " ::CORBA::Boolean"
- << " operator>>= (const ::CORBA::Any &, const ";
- *os << node->name ();
- *os << " *&);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_hdr_any_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp
deleted file mode 100644
index a4699901a26..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operator for the Sequence node
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_sequence,
- any_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Sequence visitor for generating Any operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_sequence_any_op_cs::be_visitor_sequence_any_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_sequence_any_op_cs::~be_visitor_sequence_any_op_cs (void)
-{
-}
-
-int
-be_visitor_sequence_any_op_cs::visit_sequence (be_sequence *node)
-{
- if (node->cli_stub_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl
- << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Since we don't generate CDR stream operators for types that
- // explicitly contain a local interface (at some level), we
- // must override these Any template class methods to avoid
- // calling the non-existent operators. The zero return value
- // will eventually cause CORBA::MARSHAL to be raised if this
- // type is inserted into an Any and then marshaled.
- if (node->is_local ())
- {
- *os << "namespace TAO" << be_nl
- << "{" << be_idt_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Dual_Impl_T<" << node->name ()
- << ">::marshal_value (TAO_OutputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Dual_Impl_T<" << node->name ()
- << ">::demarshal_value (TAO_InputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl;
- }
-
- // Copying insertion.
- *os << be_nl << "// Copying insertion." << be_nl
- << "void operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << "const " << node->name () << " &_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
-
- << "if (0 == &_tao_elem) // Trying to de-reference NULL object" << be_idt_nl
- << "_tao_any <<= static_cast<" << node->name () << " *>( 0 ); // Use non-copying insertion of a NULL" << be_uidt_nl
- << "else" << be_idt_nl
-
- << "TAO::Any_Dual_Impl_T<" << node->name () << ">::insert_copy ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Non-copying insertion.
- *os << "// Non-copying insertion." << be_nl
- << "void operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->name () << " *_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "TAO::Any_Dual_Impl_T<" << node->name () << ">::insert ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Extraction to non-const pointer (deprecated, just calls the other).
- *os << "// Extraction to non-const pointer (deprecated)." << be_nl
- << "::CORBA::Boolean operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << node->name () << " *&_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return _tao_any >>= const_cast<" << be_idt << be_idt_nl
- << "const " << node->name () << " *&> (" << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Extraction to const pointer.
- *os << "// Extraction to const pointer." << be_nl
- << "::CORBA::Boolean operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << "const " << node->name () << " *&_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return" << be_idt_nl
- << "TAO::Any_Dual_Impl_T<" << node->name () << ">::extract ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_stub_any_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp
deleted file mode 100644
index 9442ec63130..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp
+++ /dev/null
@@ -1,283 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// buffer_type.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the internal buffer type of the Sequence node
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_sequence,
- buffer_type,
- "$Id$")
-
-// ****************************************************************
-// We have to generate the buffer type in the constructor
-// ****************************************************************
-
-be_visitor_sequence_buffer_type::be_visitor_sequence_buffer_type (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_sequence_buffer_type::~be_visitor_sequence_buffer_type (void)
-{
-}
-
-// helper
-int
-be_visitor_sequence_buffer_type::visit_node (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH)
- {
- *os << bt->nested_type_name (this->ctx_->scope ());
- }
- else
- {
- *os << bt->name ();
- }
-
- return 0;
-}
-
-int
-be_visitor_sequence_buffer_type::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- AST_PredefinedType::PredefinedType pt = node->pt ();
-
- *os << "::";
-
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << node->name () << "_ptr";
- }
- else if (pt == AST_PredefinedType::PT_value)
- {
- *os << node->name () << " *";
- }
- else
- {
- *os << node->name ();
- }
-
- return 0;
-}
-
-int
-be_visitor_sequence_buffer_type::visit_sequence (be_sequence *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_buffer_type::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH)
- {
- *os << node->nested_type_name (this->ctx_->scope (), "_ptr");
- }
- else
- {
- *os << node->name () << "_ptr";
- }
-
- return 0;
-}
-
-int
-be_visitor_sequence_buffer_type::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH)
- {
- *os << node->nested_type_name (this->ctx_->scope (), "_ptr");
- }
- else
- {
- *os << node->name () << "_ptr";
- }
-
- return 0;
-}
-
-int
-be_visitor_sequence_buffer_type::visit_component (be_component *node)
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_sequence_buffer_type::visit_component_fwd (be_component_fwd *node)
-{
- return this->visit_interface_fwd (node);
-}
-
-int
-be_visitor_sequence_buffer_type::visit_valuebox (be_valuebox *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH)
- {
- *os << node->nested_type_name (this->ctx_->scope (), " *");
- }
- else
- {
- *os << node->name () << " *";
- }
-
- return 0;
-}
-
-int
-be_visitor_sequence_buffer_type::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH)
- {
- *os << node->nested_type_name (this->ctx_->scope (), " *");
- }
- else
- {
- *os << node->name () << " *";
- }
-
- return 0;
-}
-
-int
-be_visitor_sequence_buffer_type::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH)
- {
- *os << node->nested_type_name (this->ctx_->scope (), " *");
- }
- else
- {
- *os << node->name () << " *";
- }
-
- return 0;
-}
-
-int
-be_visitor_sequence_buffer_type::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_sequence_buffer_type::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
-
-int
-be_visitor_sequence_buffer_type::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (node->width () == (long) sizeof (char))
- {
- *os << "::CORBA::Char *";
- }
- else
- {
- *os << "::CORBA::WChar *";
- }
-
- return 0;
-}
-
-int
-be_visitor_sequence_buffer_type::visit_structure (be_structure *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_buffer_type::visit_structure_fwd (be_structure_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_buffer_type::visit_union (be_union *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_buffer_type::visit_union_fwd (be_union_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_buffer_type::visit_enum (be_enum *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_buffer_type::visit_exception (be_exception *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_buffer_type::visit_array (be_array *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_buffer_type::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_sequence_buffer_type::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp
deleted file mode 100644
index 5f7d08577c2..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for sequences. This uses
-// compiled marshaling.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_sequence,
- cdr_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Sequence visitor for generating CDR operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_sequence_cdr_op_ch::be_visitor_sequence_cdr_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_sequence_cdr_op_ch::~be_visitor_sequence_cdr_op_ch (void)
-{
-}
-
-int
-be_visitor_sequence_cdr_op_ch::visit_sequence (be_sequence *node)
-{
- if (node->cli_hdr_cdr_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- be_type *base_type = be_type::narrow_from_decl (node->base_type ());
-
- // If our base type is an anonymous sequence, generate code for it here.
- if (base_type->node_type () == AST_Decl::NT_sequence)
- {
- if (base_type->accept (this) != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_sequence_cdr_op_ch::visit_sequence -"
- "codegen for nested anonymous sequence failed\n"),
- -1);
- }
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_type *bt = be_type::narrow_from_decl (node);
- be_typedef *tdef = be_typedef::narrow_from_decl (bt);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // If we're an anonymous sequence, we must protect against
- // being declared more than once.
- if (!tdef)
- {
- *os << "\n\n#if !defined _TAO_CDR_OP_"
- << node->flat_name () << "_H_"
- << "\n#define _TAO_CDR_OP_" << node->flat_name () << "_H_";
- }
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << be_nl << be_nl
- << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator<< (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &strm," << be_nl
- << "const " << node->name () << " &_tao_sequence" << be_uidt_nl
- << ");" << be_uidt_nl;
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator>> (" << be_idt << be_idt_nl
- << "TAO_InputCDR &strm," << be_nl
- << node->name () << " &_tao_sequence" << be_uidt_nl
- << ");" << be_uidt;
-
- *os << be_global->core_versioning_end () << be_nl;
-
- if (!tdef)
- {
- *os << "\n\n#endif /* _TAO_CDR_OP_"
- << node->flat_name () << "_H_ */";
- }
-
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp
deleted file mode 100644
index 2b45fca1bbe..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor for code generation of Sequences for the CDR operators
-// in the client stubs.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_sequence,
- cdr_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Sequence visitor for generating CDR operator declarations in the client
-// stubs file.
-// ***************************************************************************
-
-be_visitor_sequence_cdr_op_cs::be_visitor_sequence_cdr_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_sequence_cdr_op_cs::~be_visitor_sequence_cdr_op_cs (void)
-{
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_sequence (be_sequence *node)
-{
- if (this->ctx_->alias ())
- {
- // We are here because the base type of the sequence node is
- // itself a sequence i.e., this is a case of sequence of
- // typedef'd sequence. For the case of sequence of
- // anonymous sequence, see comment below.
- return this->visit_node (node);
- }
-
- if (node->cli_stub_cdr_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_type *bt =
- be_type::narrow_from_decl (node->base_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_sequence_cdr_op_cs::"
- "visit_sequence - "
- "Bad base type\n"),
- -1);
- }
-
- // Generate the CDR << and >> operator defns.
-
- // Save the sequence node for further use.
- this->ctx_->node (node);
-
- // If our element type is an anonymous sequence, generate code for it here.
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- int status =
- this->gen_anonymous_base_type (
- bt,
- TAO_CodeGen::TAO_ROOT_CDR_OP_CS
- );
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_cs::"
- "visit_sequence - "
- "gen_anonymous_base_type failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl;
-
- *os << "#if !defined _TAO_CDR_OP_"
- << node->flat_name () << "_CPP_" << be_nl
- << "#define _TAO_CDR_OP_" << node->flat_name () << "_CPP_"
- << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Set the sub state as generating code for the output operator.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
-
- *os << "::CORBA::Boolean operator<< (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &strm," << be_nl
- << "const " << node->name ()
- << " &_tao_sequence" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- *os << "return TAO::marshal_sequence(strm, _tao_sequence);"
- << be_uidt_nl;
-
- *os << "}" << be_nl << be_nl;
-
- // Set the sub state as generating code for the input operator.
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT);
-
- *os << "::CORBA::Boolean operator>> (" << be_idt << be_idt_nl
- << "TAO_InputCDR &strm";
-
- *os << "," << be_nl
- << node->name () << " &_tao_sequence";
-
- *os << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- *os << "return TAO::demarshal_sequence(strm, _tao_sequence);"
- << be_uidt_nl;
-
- *os << "}";
-
- *os << be_nl << be_global->core_versioning_end ();
-
- *os << be_nl
- << "#endif /* _TAO_CDR_OP_"
- << node->flat_name () << "_CPP_ */";
-
- node->cli_stub_cdr_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_array (be_array *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_enum (be_enum *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_interface (be_interface *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_component (be_component *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_component_fwd (be_component_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_home (be_home *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_valuebox (be_valuebox *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_valuetype (be_valuetype *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_eventtype (be_eventtype *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_predefined_type (
- be_predefined_type *node
- )
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_string (be_string *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_structure (be_structure *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_union (be_union *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_typedef (be_typedef *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_cdr_op_cs::visit_node (be_type *)
-{
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_base.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_base.cpp
deleted file mode 100644
index abf654712a0..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_base.cpp
+++ /dev/null
@@ -1,295 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// sequence_base.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the base type of the Sequence
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_sequence,
- sequence_base,
- "$Id$")
-
-// ****************************************************************
-// We have to generate the parameters for the template that implements
-// each sequence type.
-// ****************************************************************
-
-be_visitor_sequence_base::be_visitor_sequence_base (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_sequence_base::~be_visitor_sequence_base (void)
-{
-}
-
-
-int
-be_visitor_sequence_base::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "::" << node->name ();
-
- return 0;
-}
-
-// helper
-int
-be_visitor_sequence_base::visit_node (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_SEQUENCE_BASE_CH)
- {
- if (this->ctx_->sub_state ()
- == TAO_CodeGen::TAO_ARRAY_SEQ_CH_TEMPLATE_VAR)
- {
- *os << bt->nested_type_name (this->ctx_->scope (), "_var");
- }
- else
- {
- *os << bt->nested_type_name (this->ctx_->scope ());
- }
- }
- else
- {
- *os << bt->name ();
- }
-
- return 0;
-}
-
-int
-be_visitor_sequence_base::visit_sequence (be_sequence *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_base::visit_interface (be_interface *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_base::visit_interface_fwd (be_interface_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_base::visit_valuebox (be_valuebox *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_base::visit_valuetype (be_valuetype *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_base::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_base::visit_string (be_string *)
-{
- // NO-OP, we have ad-hoc classes from strings.
- return 0;
-}
-
-int
-be_visitor_sequence_base::visit_structure (be_structure *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_base::visit_structure_fwd (be_structure_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_base::visit_union (be_union *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_base::visit_union_fwd (be_union_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_base::visit_enum (be_enum *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_base::visit_exception (be_exception *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_base::visit_array (be_array *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_base::visit_typedef (be_typedef *node)
-{
- // Set the alias node.
- this->ctx_->alias (node);
-
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_sequence_base::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-be_visitor_sequence_base_template_args::
-be_visitor_sequence_base_template_args (be_visitor_context *ctx,
- be_sequence *seq)
- : be_visitor_sequence_base (ctx),
- beseq_ (seq)
-{
- // no-op
-}
-
-
-be_visitor_sequence_base_template_args::
-~be_visitor_sequence_base_template_args (void)
-{
- //no-op
-}
-
-int
-be_visitor_sequence_base_template_args::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_SEQUENCE_BASE_CH)
- {
- *os << bt->nested_type_name (this->ctx_->scope ()) << ",";
- *os << bt->nested_type_name (this->ctx_->scope (), "_var");
- }
- else
- {
- *os << bt->name () << ",";
- *os << bt->name () << "_var";
- }
-
- return 0;
-}
-
-int
-be_visitor_sequence_base_template_args::visit_interface_fwd (
- be_interface_fwd *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_SEQUENCE_BASE_CH)
- {
- *os << bt->nested_type_name (this->ctx_->scope ()) << ",";
- *os << bt->nested_type_name (this->ctx_->scope (), "_var");
- }
- else
- {
- *os << bt->name () << ",";
- *os << bt->name () << "_var";
- }
-
- return 0;
-}
-
-int
-be_visitor_sequence_base_template_args::visit_valuetype (be_valuetype *node)
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_sequence_base_template_args::visit_valuetype_fwd (
- be_valuetype_fwd *node
- )
-{
- return this->visit_interface_fwd (node);
-}
-
-int
-be_visitor_sequence_base_template_args::visit_predefined_type (
- be_predefined_type *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
- *os << "::" << node->name ();
-
- if (beseq_->managed_type () == be_sequence::MNG_PSEUDO
- || beseq_->managed_type () == be_sequence::MNG_OBJREF)
- {
- *os << ", ::" << node->name () << "_var";
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp
deleted file mode 100644
index 265e0b8261e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// sequence_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_sequence,
- sequence_ch,
- "$Id$")
-
-// Root visitor for client header.
-be_visitor_sequence_ch::be_visitor_sequence_ch (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_sequence_ch::~be_visitor_sequence_ch (void)
-{
-}
-
-int be_visitor_sequence_ch::visit_sequence (be_sequence *node)
-{
- if (node->defined_in () == 0)
- {
- // The node is a nested sequence, and has had no scope defined.
- node->set_defined_in (DeclAsScope (this->ctx_->scope ()));
- }
-
- // First create a name for ourselves.
- if (node->create_name (this->ctx_->tdef ()) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "failed creating name\n"),
- -1);
- }
-
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- be_type *bt = 0;
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the base type since we may need to do some code
- // generation for the base type.
- bt = be_type::narrow_from_decl (node->base_type ());
-
- if (bt == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "Bad element type\n"),
- -1);
- }
-
- bt->seen_in_sequence (true);
- AST_Decl::NodeType nt = bt->node_type ();
-
- // If our base type is an anonymouse sequence, we must create a name
- // and generate a class declaration for it as well.
- if (nt == AST_Decl::NT_sequence)
- {
- // Temporarily make the context's tdef node 0 so the nested call
- // to create_name will not get confused and give our anonymous
- // sequence element type the same name as we have.
- be_typedef *tmp = this->ctx_->tdef ();
- this->ctx_->tdef (0);
-
- if (bt->accept (this) != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "codegen for anonymous base type failed\n"),
- -1);
- }
-
- // Restore the tdef value.
- this->ctx_->tdef (tmp);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- os->gen_ifdef_macro (node->flat_name ());
-
- if (this->ctx_->tdef () != 0)
- {
- *os << be_nl << be_nl
- << "class " << node->local_name () << ";";
- }
-
- if (this->ctx_->tdef () != 0)
- {
- this->gen_varout_typedefs (node,
- bt);
- }
-
- *os << be_nl << be_nl
- << "class " << be_global->stub_export_macro () << " "
- << node->local_name () << be_idt_nl
- << ": public" << be_idt << be_idt_nl;
-
- if (node->gen_base_class_name (os, "", this->ctx_->scope ()) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "Base class name generation failed\n"),
- -1);
- }
-
- *os << be_uidt << be_uidt << be_uidt;
-
- *os << be_nl
- << "{" << be_nl
- << "public:" << be_idt;
-
- *os << be_nl
- << node->local_name () << " (void);";
-
- if (node->unbounded ())
- {
- *os << be_nl
- << node->local_name () << " ( ::CORBA::ULong max);";
- }
-
- *os << be_nl
- << node->local_name () << " (" << be_idt << be_idt;
-
- if (node->unbounded ())
- {
- *os << be_nl
- << "::CORBA::ULong max,";
- }
-
- *os << be_nl
- << "::CORBA::ULong length," << be_nl;
-
- // Generate the base type for the buffer.
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH);
- be_visitor_sequence_buffer_type bt_visitor (&ctx);
-
- if (bt->accept (&bt_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << "* buffer, " << be_nl
- << "::CORBA::Boolean release = false" << be_uidt_nl
- << ");" << be_uidt_nl;
- *os << node->local_name () << " (const " << node->local_name ()
- << " &);" << be_nl;
- *os << "virtual ~" << node->local_name () << " (void);";
-
- if (be_global->any_support () && !node->anonymous ())
- {
- *os << be_nl << be_nl
- << "static void _tao_any_destructor (void *);";
- }
-
- // Generate the _var_type typedef (only if we are not anonymous).
- if (this->ctx_->tdef () != 0)
- {
- *os << be_nl << be_nl
- << "typedef " << node->local_name () << "_var _var_type;"
- << be_nl
- << "typedef " << node->local_name () << "_out _out_type;"
- << be_nl << be_nl;
- }
-
- // TAO provides extensions for octet sequences, first find out if
- // the base type is an octet (or an alias for octet).
- be_predefined_type *predef = 0;
-
- if (bt->base_node_type () == AST_Type::NT_pre_defined)
- {
- be_typedef* alias =
- be_typedef::narrow_from_decl (bt);
-
- if (alias == 0)
- {
- predef = be_predefined_type::narrow_from_decl (bt);
- }
- else
- {
- predef =
- be_predefined_type::narrow_from_decl (
- alias->primitive_base_type ()
- );
- }
- }
-
- // Now generate the extension...
- if (predef != 0 && predef->pt () == AST_PredefinedType::PT_octet
- && node->unbounded ())
- {
- *os << "\n\n#if (TAO_NO_COPY_OCTET_SEQUENCES == 1)" << be_nl
- << node->local_name () << " (" << be_idt << be_idt_nl
- << "::CORBA::ULong length," << be_nl
- << "const ACE_Message_Block* mb" << be_uidt_nl
- << ")" << be_uidt_nl
- << " : TAO::unbounded_value_sequence< ::CORBA::Octet>"
- << " (length, mb) {}" << "\n"
- << "#endif /* TAO_NO_COPY_OCTET_SEQUENCE == 1 */";
- }
-
- *os << be_uidt_nl
- << "};";
-
- os->gen_endif ();
-
- node->cli_hdr_gen (1);
- return 0;
-}
-
-void
-be_visitor_sequence_ch::gen_varout_typedefs (be_sequence *node,
- be_type *elem)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl;
-
- AST_Type::SIZE_TYPE st = elem->size_type ();
-
- *os << "typedef" << be_idt_nl
- << (st == AST_Type::FIXED ? "TAO_FixedSeq_Var_T<"
- : "TAO_VarSeq_Var_T<")
- << be_idt << be_idt_nl
- << node->local_name ();
-
- *os << be_uidt_nl
- << ">" << be_uidt_nl
- << node->local_name () << "_var;" << be_uidt;
-
- *os << be_nl << be_nl
- << "typedef" << be_idt_nl
- << "TAO_Seq_Out_T<" << be_idt << be_idt_nl
- << node->local_name () << be_uidt_nl
- << ">" << be_uidt_nl
- << node->local_name () << "_out;" << be_uidt;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp
deleted file mode 100644
index c96fb72bab1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// sequence_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequences in the client stubs file
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_sequence,
- sequence_cs,
- "$Id$")
-
-// ************************************************************
-// Root visitor for client stub class
-// ************************************************************
-
-be_visitor_sequence_cs::be_visitor_sequence_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_sequence_cs::~be_visitor_sequence_cs (void)
-{
-}
-
-int be_visitor_sequence_cs::visit_sequence (be_sequence *node)
-{
- if (node->imported () || node->cli_stub_gen ())
- {
- return 0;
- }
-
- be_type *bt = be_type::narrow_from_decl (node->base_type ());
- AST_Decl::NodeType nt = bt->node_type ();
-
- // If our base type is an anonymous sequence, generate code for it here.
- if (nt == AST_Decl::NT_sequence)
- {
- if (bt->accept (this) != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "codegen for anonymous base type failed\n"),
- -1);
- }
-
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// "__FILE__ << ":" << __LINE__;
-
- os->gen_ifdef_macro (node->flat_name ());
-
- // default constructor
- *os << be_nl << be_nl
- << node->name () << "::" << node->local_name () << " (void)" << be_nl
- << "{}";
-
- // for unbounded sequences, we have a different set of constructors
- if (node->unbounded ())
- {
- *os << be_nl << be_nl
- << node->name () << "::" << node->local_name () << " ("
- << be_idt << be_idt_nl
- << "::CORBA::ULong max" << be_uidt_nl
- << ")" << be_nl
- << ": " << be_idt;
-
- // Pass it to the base constructor.
- if (node->gen_base_class_name (os, "", this->ctx_->scope ()) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "codegen for base sequence class failed\n"),
- -1);
- }
-
-
- *os << be_nl << "(max)" << be_uidt << be_uidt_nl
- << "{}";
- }
-
- // constructor with the buffer
- *os << be_nl << be_nl
- << node->name () << "::" << node->local_name () << " ("
- << be_idt << be_idt_nl;
-
- if (node->unbounded ())
- {
- // Unbounded seq takes this extra parameter.
- *os << "::CORBA::ULong max," << be_nl;
- }
-
- *os << "::CORBA::ULong length," << be_nl;
-
- // generate the base type for the buffer
- be_visitor_context ctx (*this->ctx_);
- be_visitor_sequence_buffer_type bt_visitor (&ctx);
-
- if (bt->accept (&bt_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << " * buffer," << be_nl
- << "::CORBA::Boolean release" << be_uidt_nl
- << ")" << be_uidt_nl
- << " : " << be_idt << be_idt;
-
- // Pass it to the base constructor.
- if (node->gen_base_class_name (os, "", this->ctx_->scope ()) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "codegen for base sequence class\n"),
- -1);
- }
-
- *os << be_nl << "(";
-
- if (node->unbounded ())
- {
- *os << "max, ";
- }
-
- *os << "length, buffer, release)" << be_uidt << be_uidt_nl
- << "{}";
-
- // Copy constructor.
- *os << be_nl << be_nl
- << node->name () << "::" << node->local_name ()
- << " (" << be_idt << be_idt_nl
- << "const " << node->local_name ()
- << " &seq" << be_uidt_nl
- << ")" << be_uidt_nl
- << " : " << be_idt << be_idt;
-
- // Pass it to the base constructor.
- if (node->gen_base_class_name (os, "", this->ctx_->scope ()) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "codegen for base sequence class\n"),
- -1);
- }
-
- *os << be_nl << "(seq)" << be_uidt << be_uidt_nl
- << "{}";
-
- // Destructor.
- *os << be_nl << be_nl
- << node->name () << "::~" << node->local_name ()
- << " (void)" << be_nl
- << "{}";
-
-
- if (be_global->any_support () && !node->anonymous ())
- {
- *os << be_nl << be_nl
- << "void "
- << node->name () << "::_tao_any_destructor (" << be_idt << be_idt_nl
- << "void * _tao_void_pointer" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << node->local_name () << " * _tao_tmp_pointer =" << be_idt_nl
- << "static_cast<" << node->local_name ()
- << " *> (_tao_void_pointer);" << be_uidt_nl
- << "delete _tao_tmp_pointer;" << be_uidt_nl
- << "}";
- }
-
- os->gen_endif ();
-
- node->cli_stub_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/serializer_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/serializer_op_ch.cpp
deleted file mode 100644
index cc9216fa8fb..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/serializer_op_ch.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for TAO::DCPS::Serializer operators for sequences.
-// This uses compiled marshaling.
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_sequence,
- serializer_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Sequence visitor for generating Serializer operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_sequence_serializer_op_ch::be_visitor_sequence_serializer_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_sequence_serializer_op_ch::~be_visitor_sequence_serializer_op_ch (void)
-{
-}
-
-int
-be_visitor_sequence_serializer_op_ch::visit_sequence (be_sequence *node)
-{
- if (node->cli_hdr_serializer_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- be_type *base_type = be_type::narrow_from_decl (node->base_type ());
-
- // If our base type is an anonymous sequence, generate code for it here.
- if (base_type->node_type () == AST_Decl::NT_sequence)
- {
- if (base_type->accept (this) != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_sequence_serializer_op_ch::visit_sequence -"
- "codegen for nested anonymous sequence failed\n"),
- -1);
- }
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_type *bt = be_type::narrow_from_decl (node);
- be_typedef *tdef = be_typedef::narrow_from_decl (bt);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // If we're an anonymous sequence, we must protect against
- // being declared more than once.
- if (!tdef)
- {
- *os << "\n\n#if !defined _TAO_SERIALIZER_OP_"
- << node->flat_name () << "_H_"
- << "\n#define _TAO_SERIALIZER_OP_" << node->flat_name () << "_H_";
- }
-
- *os << be_nl << be_nl;
-
- *os << be_global->stub_export_macro ()
- << " ::CORBA::Boolean _tao_is_bounded_size (" << be_idt << be_idt_nl
- << "const " << node->name () << " &" << be_uidt_nl
- << ");" << be_uidt_nl;
- *os << be_global->stub_export_macro ()
- << " size_t _dcps_max_marshaled_size (" << be_idt << be_idt_nl
- << "const " << node->name () << " &" << be_uidt_nl
- << ");" << be_uidt_nl;
- *os << be_global->stub_export_macro ()
- << " size_t _dcps_find_size (" << be_idt << be_idt_nl
- << "const " << node->name () << " &" << be_uidt_nl
- << ");" << be_uidt_nl;
-
- *os << be_nl << be_nl
- << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator<< (" << be_idt << be_idt_nl
- << "TAO::DCPS::Serializer &," << be_nl
- << "const " << node->name () << " &" << be_uidt_nl
- << ");" << be_uidt_nl;
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator>> (" << be_idt << be_idt_nl
- << "TAO::DCPS::Serializer &," << be_nl
- << node->name () << " &" << be_uidt_nl
- << ");" << be_uidt;
-
- if (!tdef)
- {
- *os << "\n\n#endif /* _TAO_SERIALIZER_OP_"
- << node->flat_name () << "_H_ */";
- }
-
- node->cli_hdr_serializer_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/serializer_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/serializer_op_cs.cpp
deleted file mode 100644
index 103a4281f78..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/serializer_op_cs.cpp
+++ /dev/null
@@ -1,1337 +0,0 @@
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor for code generation of Sequences for the
-// TAO::DCPS::Serializer operators in the client stubs.
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_sequence,
- serializer_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Sequence visitor for generating Serializer operator declarations in the client
-// stubs file.
-// ***************************************************************************
-
-be_visitor_sequence_serializer_op_cs::be_visitor_sequence_serializer_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_sequence_serializer_op_cs::~be_visitor_sequence_serializer_op_cs (void)
-{
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_sequence (be_sequence *node)
-{
- if (this->ctx_->alias ())
- {
- // We are here because the base type of the sequence node is
- // itself a sequence i.e., this is a case of sequence of
- // typedef'd sequence. For the case of sequence of
- // anonymous sequence, see comment below.
- return this->visit_node (node);
- }
-
- if (node->cli_stub_serializer_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_type *bt =
- be_type::narrow_from_decl (node->base_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_sequence_serializer_op_cs::"
- "visit_sequence - "
- "Bad base type\n"),
- -1);
- }
-
- // Generate the Serializer << and >> operator defns.
-
- // Save the sequence node for further use.
- this->ctx_->node (node);
-
- // If our element type is an anonymous sequence, generate code for it here.
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- int status =
- this->gen_anonymous_base_type (
- bt,
- TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS
- );
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_sequence - "
- "gen_anonymous_base_type failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "#if !defined _TAO_SERIALIZER_OP_"
- << node->flat_name () << "_CPP_" << be_nl
- << "#define _TAO_SERIALIZER_OP_" << node->flat_name () << "_CPP_"
- << be_nl << be_nl;
-
- // --- _tao_is_bounded_size ---
- this->ctx_->sub_state (TAO_CodeGen::TAO_IS_BOUNDED_SIZE);
-
- *os << "::CORBA::Boolean _tao_is_bounded_size (" << be_idt << be_idt_nl
- << "const " << node->name ()
- << " &_tao_sequence" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- this->visit_node (node);
- }
- else
- {
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_sequence_serializer_op_cs::"
- "visit_sequence - "
- "Base type codegen failed\n"),
- -1);
- }
- }
-
- *os << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // --- _dcps_max_marshaled_size ---
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_MAX_MARSHALED_SIZE);
-
- *os << "size_t _dcps_max_marshaled_size (" << be_idt << be_idt_nl
- << "const " << node->name ()
- << " &_tao_sequence" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- this->visit_node (node);
- }
- else
- {
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_sequence_serializer_op_cs::"
- "visit_sequence - "
- "Base type codegen failed\n"),
- -1);
- }
- }
-
- *os << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // --- _dcps_find_size ---
- this->ctx_->sub_state (TAO_CodeGen::TAO_FIND_SIZE);
-
- *os << "size_t _dcps_find_size (" << be_idt << be_idt_nl
- << "const " << node->name ()
- << " &_tao_sequence" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- this->visit_node (node);
- }
- else
- {
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_sequence_serializer_op_cs::"
- "visit_sequence - "
- "Base type codegen failed\n"),
- -1);
- }
- }
-
- *os << be_uidt_nl
- << "}" << be_nl << be_nl;
-
-
- // --- operator<< ---
-
- // Set the sub state as generating code for the output operator.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
-
- *os << "::CORBA::Boolean operator<< (" << be_idt << be_idt_nl
- << "TAO::DCPS::Serializer &strm," << be_nl
- << "const " << node->name ()
- << " &_tao_sequence" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- // First encode the sequence length.
- *os << "const ::CORBA::ULong _tao_seq_len = _tao_sequence.length ();"
- << be_nl << be_nl;
- *os << "if (strm << _tao_seq_len)" << be_idt_nl
- << "{" << be_idt_nl;
-
- // Now encode the sequence elements.
- *os << "// Encode all elements." << be_nl;
-
-
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- this->visit_node (node);
- }
- else
- {
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_sequence_serializer_op_cs::"
- "visit_sequence - "
- "Base type codegen failed\n"),
- -1);
- }
- }
-
- *os << "}" << be_uidt_nl << be_nl
- << "return 0;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // --- operator>> ---
-
- // Set the sub state as generating code for the input operator.
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT);
-
- *os << "::CORBA::Boolean operator>> (" << be_idt << be_idt_nl
- << "TAO::DCPS::Serializer &";
-
- if (! bt->is_local ())
- {
- *os << "strm";
- }
-
- *os << "," << be_nl
- << node->name () << " &";
-
- if (! bt->is_local ())
- {
- *os << "_tao_sequence";
- }
-
- *os << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (! bt->is_local ())
- {
- // First retrieve the length and adjust the sequence length accordingly.
- *os << "::CORBA::ULong _tao_seq_len;" << be_nl << be_nl;
- *os << "if (strm >> _tao_seq_len)" << be_idt_nl
- << "{" << be_idt_nl;
-
- // Now check if the length does not exceed the maximum. We do this only
- // for bounded sequences
- AST_Expression *expr = node->max_size ();
-
- if (expr == 0 || (expr != 0 && expr->ev () == 0))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_sequence - "
- "bad sequence dimension\n"),
- -1);
- }
-
- if (expr->ev ()->et == AST_Expression::EV_ulong)
- {
- if (expr->ev ()->u.ulval > 0)
- {
- // We are dealing with a bounded sequence. Check if we are within
- // bounds.
- *os << "if (_tao_seq_len <= _tao_sequence.maximum ())" << be_idt_nl
- << "{" << be_idt_nl;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_sequence - "
- "bad sequence dimension value\n"),
- -1);
- }
-
- *os << "// Set the length of the sequence." << be_nl
- << "_tao_sequence.length (_tao_seq_len);" << be_nl << be_nl;
-
- // Now we do a check for the sequence length to be non zero.
- // If length is 0 we return true.
- *os << "// If length is 0 we return true." << be_nl;
- *os << "if (0 >= _tao_seq_len) " << be_idt_nl
- << "{" << be_idt_nl;
- *os << "return 1;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl;
-
- *os << "// Retrieve all the elements." << be_nl;
-
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- this->visit_node (node);
- }
- else
- {
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_sequence_serializer_op_cs::"
- "visit_sequence - "
- "Base type codegen failed\n"),
- -1);
- }
- }
-
- if (expr->ev ()->u.ulval > 0)
- {
- // We are dealing with a bounded sequence.
- *os << be_nl << "}" << be_uidt << be_uidt;
- }
-
- *os << be_nl << "}" << be_uidt_nl << be_nl;
- }
-
- *os << "return 0;" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "#endif /* _TAO_SERIALIZER_OP_"
- << node->flat_name () << "_CPP_ */";
-
- node->cli_stub_serializer_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_array (be_array *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // We get here if the "type" of individual elements of the sequence is a
- // primitive type. In this case, we treat the sequence as a single
- // dimensional sequence (even of it was multi-dimensional), and pass
- // the total length of the sequence as a cross product of the
- // dimensions.
-
- be_sequence *sequence = this->ctx_->be_node_as_sequence ();
-
- if (!sequence)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_enum - "
- "bad sequence node\n"),
- -1);
- }
-
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- *os << "ACE_UNUSED_ARG(_tao_sequence);" << be_nl;
- if (sequence->unbounded ())
- *os << "return false; /* unbounded enum sequence */";
- else
- *os << "return true; /* bounded enum sequence */";
- break;
- case TAO_CodeGen::TAO_FIND_SIZE:
- *os << "//enum types are fixed size so OK to call max_marshaled_size"
- << be_nl;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- *os << "//sequence of enum = ulong for length + ulong for enum * length"
- << be_nl;
- *os << "return _dcps_max_marshaled_size_ulong () + "
- << "_dcps_max_marshaled_size_ulong () * "
- << be_idt << be_idt_nl;
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_FIND_SIZE:
- *os << "_tao_sequence.length();" << be_uidt << be_uidt;
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- *os << "_tao_sequence.maximum();" << be_uidt << be_uidt;
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_enum - "
- "bad sub_state for seq length\n"),
- -1);
- }
- break;
- default:
- return this->visit_node (node);
- }
- return 0;
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_interface (be_interface *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_component (be_component *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_component_fwd (be_component_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_home (be_home *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_valuetype (be_valuetype *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_eventtype (be_eventtype *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_predefined_type (
- be_predefined_type *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_object:
- case AST_PredefinedType::PT_value:
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_any:
- return this->visit_node (node);
- case AST_PredefinedType::PT_void:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_predefined_type - "
- "Bad primitive type\n"),
- -1);
- default:
- break;
- };
-
- // We get here if the "type" of individual elements of the sequence is a
- // primitive type. In this case, we treat the sequence as a single
- // dimensional sequence (even of it was multi-dimensional), and pass
- // the total length of the sequence as a cross product of the
- // dimensions.
-
- be_sequence *sequence = this->ctx_->be_node_as_sequence ();
-
- if (!sequence)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_predefined_type - "
- "bad sequence node\n"),
- -1);
- }
-
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- *os << "ACE_UNUSED_ARG(_tao_sequence);" << be_nl;
- if (sequence->unbounded ())
- *os << "return false; /* seq<predef'd> */";
- else
- *os << "return true; /* seq<predef'd,N> */";
- break;
- case TAO_CodeGen::TAO_FIND_SIZE:
- *os << "//primitive types are fixed size so OK to call max_marshaled_size"
- << be_nl;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_octet:
- *os << "return _dcps_max_marshaled_size_ulong () + "
- << "_dcps_max_marshaled_size_octet ()"
- << be_idt << be_idt_nl;
- break;
- case AST_PredefinedType::PT_char:
- *os << "return _dcps_max_marshaled_size_ulong () + "
- << "_dcps_max_marshaled_size_char ()"
- << be_idt << be_idt_nl;
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "return _dcps_max_marshaled_size_ulong () + "
- << "_dcps_max_marshaled_size_wchar ()"
- << be_idt << be_idt_nl;
- break;
- case AST_PredefinedType::PT_long:
- case AST_PredefinedType::PT_ulong:
- case AST_PredefinedType::PT_short:
- case AST_PredefinedType::PT_ushort:
- case AST_PredefinedType::PT_float:
- case AST_PredefinedType::PT_double:
- case AST_PredefinedType::PT_longlong:
- case AST_PredefinedType::PT_ulonglong:
- case AST_PredefinedType::PT_longdouble:
- *os << "//sequence is of a fixed sized predefined type = "
- << "sizeof(ULong) + type size * length" << be_nl;
- *os << node->name () << " a_base_value;" << be_nl;
- *os << "return _dcps_max_marshaled_size_ulong () + "
- << "_dcps_max_marshaled_size (a_base_value)"
- << be_idt << be_idt_nl;
- break;
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "return _dcps_max_marshaled_size_ulong () + "
- << "_dcps_max_marshaled_size_boolean ()"
- << be_idt << be_idt_nl;
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "bad primitive type for _dcps_max_marshaled_size code gen\n"),
- -1);
- }
-
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_FIND_SIZE:
- *os << " * _tao_sequence.length();" << be_uidt << be_uidt;
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- *os << " * _tao_sequence.maximum();" << be_uidt << be_uidt;
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_serializer_op_cs::"
- "visit_predefined_type - "
- "bad sub_state for seq length\n"),
- -1);
- }
- break;
- case TAO_CodeGen::TAO_CDR_INPUT:
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- {
- /*
- * Avoiding the work to make TAO::DCPS::Serializer handle the
- * TAO_NO_COPY_OCTET_SEQUENCES optimization.
- * TBD - support this optimization -- see corresponding CDR code.
- */
- *os << "return strm.";
-
- // Based on our substate, we may be reading from a stream or writing into a
- // stream/
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "read_";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "write_";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_predefined_type - "
- "bad sub state\n"),
- -1);
- }
-
- // Determine what kind of sequence are we reading/writing.
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_long:
- *os << "long_array";
- break;
- case AST_PredefinedType::PT_ulong:
- *os << "ulong_array";
- break;
- case AST_PredefinedType::PT_short:
- *os << "short_array";
- break;
- case AST_PredefinedType::PT_ushort:
- *os << "ushort_array";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "octet_array";
- break;
- case AST_PredefinedType::PT_char:
- *os << "char_array";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "wchar_array";
- break;
- case AST_PredefinedType::PT_float:
- *os << "float_array";
- break;
- case AST_PredefinedType::PT_double:
- *os << "double_array";
- break;
- case AST_PredefinedType::PT_longlong:
- *os << "longlong_array";
- break;
- case AST_PredefinedType::PT_ulonglong:
- *os << "ulonglong_array";
- break;
- case AST_PredefinedType::PT_longdouble:
- *os << "longdouble_array";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "boolean_array";
- break;
- default:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_predefined_type - "
- "bad primitive type for optimized code gen\n"),
- -1);
- }
-
- // Handle special case to avoid compiler errors.
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_char:
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << " ((char *)_tao_sequence.get_buffer (), ";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << " ((const char *)_tao_sequence.get_buffer (), ";
- break;
- default:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs"
- "::visit_predefined_type - "
- "bad codegen substate\n"),
- -1);
- }
- break;
- default:
- *os << " (_tao_sequence.get_buffer (), ";
- break;
- }
-
- *os << "_tao_sequence.length ());" << be_uidt_nl;
-
- } // end TAO_CDR_INPUT/OUTPUT case
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_predefined_type - outter "
- "bad sub state\n"),
- -1);
- } // end outter switch
-
- return 0;
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_string (be_string *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_structure (be_structure *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_union (be_union *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_sequence_serializer_op_cs::visit_node (be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_sequence *node = this->ctx_->be_node_as_sequence ();
-
- if (!node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "bad sequence node\n"),
- -1);
- }
-
- be_visitor_context ctx (*this->ctx_);
- be_visitor_sequence_base visitor (&ctx);
-
- // We get here if the "type" of individual elements of the sequence is not a
- // primitive type. In this case, we are left with no other alternative but
- // to encode/decode element by element.
-
- AST_Expression *expr = node->max_size ();
-
- if (expr == 0 || (expr != 0 && expr->ev () == 0))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "bad sequence dimension\n"),
- -1);
- }
-
- AST_Decl::NodeType nt = bt->node_type ();
- be_typedef *td = 0;
-
- if (nt == AST_Decl::NT_typedef)
- {
- td = be_typedef::narrow_from_decl (bt);
- nt = td->base_node_type ();
- }
-
-switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- if (node->unbounded ())
- {
- *os << "ACE_UNUSED_ARG(_tao_sequence);" << be_nl;
- *os << "return false; /* unbounded sequence */";
- }
- else
-
- switch (nt)
- {
- case AST_Decl::NT_enum:
- *os << "ACE_UNUSED_ARG(_tao_sequence);" << be_nl;
- *os << "return true; // bounded seqence of enums";
- break;
- case AST_Decl::NT_union:
- *os << "ACE_UNUSED_ARG(_tao_sequence);" << be_nl;
- *os << "// Always return false for a union because " << be_nl
- << "// _dcps_max_marshaled_size may produce an access violation."
- << be_nl
- << "return false; // seq of union " << bt->name () << be_uidt;
- break;
- case AST_Decl::NT_sequence:
- case AST_Decl::NT_struct:
- // its a type that should be defined in the generated code.
- *os << "ACE_UNUSED_ARG(_tao_sequence);" << be_nl;
- *os << bt->name () << " a_base_value;" << be_nl;
- *os << "return _tao_is_bounded_size (a_base_value);";
- break;
- case AST_Decl::NT_array:
- *os << "ACE_UNUSED_ARG(_tao_sequence);" << be_nl;
- *os << bt->name () << " a_base_value;" << be_nl;
- *os << bt->name () << "_forany tmp(a_base_value);" << be_nl;
- *os << "return _tao_is_bounded_size (tmp);" << be_uidt_nl;
- break;
- case AST_Decl::NT_string:
- case AST_Decl::NT_wstring:
- {
- be_string *str =
- be_string::narrow_from_decl (
- td == 0 ? bt : td->primitive_base_type ()
- );
-
- if (!str)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "bad string node\n"),
- -1);
- }
-
- *os << "ACE_UNUSED_ARG(_tao_sequence);" << be_nl;
- if (str->max_size ()->ev ()->u.ulval == 0)
- {
- // Unbounded string
- *os << "return false; /* bounded seq of unbounded strings */";
- }
- else
- {
- *os << "return true; /* bounded seq of bounded strings */";
- }
- }
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - is_bounded_size - "
- "unsupported sequence base type\n"),
- -1);
- break;
- }
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- switch (nt)
- {
- case AST_Decl::NT_enum:
- *os << "// sequence of enums" << be_nl
- << "return _dcps_max_marshaled_size_ulong () + " << be_idt_nl
- << "_tao_sequence.maximum() * " << be_nl
- << "_dcps_max_marshaled_size_ulong ();" << be_uidt;
- break;
- case AST_Decl::NT_union:
- *os << "ACE_UNUSED_ARG(_tao_sequence);" << be_nl;
- *os << "// do not try getting the _dcps_max_marshaled_size" << be_nl
- << "// doing so may produce an access violation" << be_nl
- << "return 100000; // seq of union " << bt->name () << be_uidt;
- break;
- case AST_Decl::NT_sequence:
- case AST_Decl::NT_struct:
- // its a type that should be defined in the generated code.
- *os << bt->name () << " a_base_value;" << be_nl
- << "return _dcps_max_marshaled_size_ulong () + " << be_idt_nl
- << "_tao_sequence.maximum() * " << be_nl
- << "_dcps_max_marshaled_size (a_base_value);" << be_uidt;
- break;
- case AST_Decl::NT_array:
- *os << bt->name () << " a_base_value;" << be_nl;
- *os << bt->name() << "_forany tmp(a_base_value);" << be_nl;
- *os << "return _dcps_max_marshaled_size_ulong () + " << be_idt_nl
- << "_tao_sequence.maximum() * " << be_nl;
- *os << "_dcps_max_marshaled_size (tmp);" << be_uidt_nl;
-
- break;
- case AST_Decl::NT_string:
- case AST_Decl::NT_wstring:
- {
- be_string *str =
- be_string::narrow_from_decl (
- td == 0 ? bt : td->primitive_base_type ()
- );
-
- if (!str)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "bad string node\n"),
- -1);
- }
-
- u_long max_size = str->max_size ()->ev ()->u.ulval;
- if (max_size == 0)
- *os << "// bounded seq of unbounded strings" << be_nl;
- else
- *os << "// bounded seq of bounded strings" << be_nl;
-
- char buff[15];
- ACE_OS::sprintf(buff, "%ld", max_size);
- *os << "return _dcps_max_marshaled_size_ulong () + " << be_nl
- << " _tao_sequence.maximum() * ";
- *os << "(_dcps_max_marshaled_size_ulong () + " << buff << ");";
-
- }
- break;
- case AST_Decl::NT_interface:
- *os << "//DCPS - Sequence of interfaces is not supported" << be_nl;
- *os << "return 77777;" << be_nl;
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - is_bounded_size - "
- "unsupported sequence base type\n"),
- -1);
- break;
- }
- break;
- case TAO_CodeGen::TAO_FIND_SIZE:
- {
- *os << "//iterate over the sequence to find the current size" << be_nl
- << "size_t the_length = _dcps_max_marshaled_size_ulong ();" << be_nl
- << "for ( ::CORBA::ULong i = 0; i < _tao_sequence.length(); "
- << "++i)" << be_idt_nl
- << "{" << be_idt_nl;
-
- switch (nt)
- {
- case AST_Decl::NT_enum:
- *os << "the_length += _dcps_max_marshaled_size_ulong (); // enum" << be_uidt_nl;
- break;
- case AST_Decl::NT_union:
- case AST_Decl::NT_sequence:
- case AST_Decl::NT_struct:
- // its a type that should be defined in the generated code.
- *os << "the_length += _dcps_find_size (_tao_sequence[i]);" << be_uidt_nl;
- break;
- case AST_Decl::NT_array:
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << "_var tmp_var (" << be_idt << be_idt_nl;
-
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << "_dup (_tao_sequence[i])" << be_uidt_nl
- << ");" << be_uidt_nl;
-
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << "_forany tmp (tmp_var.inout ());" << be_nl;
- *os << "the_length += _dcps_find_size (tmp);" << be_uidt_nl;
-
- break;
- case AST_Decl::NT_string:
- case AST_Decl::NT_wstring:
- *os << "the_length += _dcps_max_marshaled_size_ulong () + "
- << "ACE_OS::strlen (_tao_sequence[i]);" << be_uidt_nl;
- break;
- case AST_Decl::NT_interface:
- *os << "//DCPS - Sequence of interfaces is not supported" << be_nl;
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - is_bounded_size - "
- "unsupported sequence base type\n"),
- -1);
- break;
- }
-
-
- *os << "}" << be_uidt_nl
- << "return the_length;";
- }
- break;
- case TAO_CodeGen::TAO_CDR_INPUT:
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- {
- // Initialize a boolean variable.
- *os << "::CORBA::Boolean _tao_marshal_flag = true;" << be_nl << be_nl;
-
-
- if (expr->ev ()->et == AST_Expression::EV_ulong)
- {
- *os << "for ( ::CORBA::ULong i = 0; i < _tao_seq_len"
- << " && _tao_marshal_flag; "
- << "++i)" << be_idt_nl
- << "{" << be_idt_nl;
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "bad sequence dimension value\n"),
- -1);
- }
-
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- switch (nt)
- {
- case AST_Decl::NT_array:
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << "_forany tmp (";
-
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << "_alloc ());" << be_nl;
- *os << "_tao_marshal_flag = (strm >> tmp);" << be_nl;
-
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << "_copy (_tao_sequence[i], tmp.in ());" << be_nl;
-
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << "_free (tmp.inout ());" << be_uidt_nl;
-
- break;
- case AST_Decl::NT_string:
- case AST_Decl::NT_wstring:
- {
- be_string *str =
- be_string::narrow_from_decl (
- td == 0 ? bt : td->primitive_base_type ()
- );
-
- if (!str)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "bad string node\n"),
- -1);
- }
-
- if (str->max_size ()->ev ()->u.ulval == 0)
- {
- // Unbounded.
- *os << node->name ()
- << "::value_type * buffer = _tao_sequence.get_buffer();"
- << be_idt_nl;;
- *os << "_tao_marshal_flag = (strm >> buffer[i]);"
- << be_uidt_nl;
- }
- else
- {
- if (str->width () == (long) sizeof (char))
- {
- *os << "_tao_marshal_flag = (strm >> "
- << "::ACE_InputCDR::to_string (_tao_sequence[i].out (), ";
- }
- else
- {
- *os << "_tao_marshal_flag = (strm >> "
- << "::ACE_InputCDR::to_wstring (_tao_sequence[i].out (), ";
- }
-
- *os << str->max_size ()->ev ()->u.ulval << "));"
- << be_uidt_nl;
- }
- }
- break;
- case AST_Decl::NT_interface:
- case AST_Decl::NT_interface_fwd:
- case AST_Decl::NT_valuetype:
- case AST_Decl::NT_valuetype_fwd:
- *os << "//DCPS does not support interfaces and value types";
-
- break;
- case AST_Decl::NT_pre_defined:
- {
- // We need to separately handle this case of pseudo objects
- // because they have a _var type.
- be_predefined_type *pt =
- be_predefined_type::narrow_from_decl (
- td == 0 ? bt : td->primitive_base_type ()
- );
-
- if (!pt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "bad predefined type node\n"),
- -1);
- }
-
- switch (pt->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- case AST_PredefinedType::PT_value:
- *os << "_tao_marshal_flag = (strm >> _tao_sequence[i].out ());";
- break;
- case AST_PredefinedType::PT_char:
- *os << "_tao_marshal_flag =" << be_idt_nl
- << "(strm >> ::ACE_InputCDR::to_char (_tao_sequence[i]));"
- << be_uidt;
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "_tao_marshal_flag =" << be_idt_nl
- << "(strm >> ::ACE_InputCDR::to_wchar (_tao_sequence[i]));"
- << be_uidt;
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "_tao_marshal_flag =" << be_idt_nl
- << "(strm >> ::ACE_InputCDR::to_boolean (_tao_sequence[i]));"
- << be_uidt;
- break;
- case AST_PredefinedType::PT_octet:
- *os << "_tao_marshal_flag =" << be_idt_nl
- << "(strm >> ::ACE_InputCDR::to_octet (_tao_sequence[i]));"
- << be_uidt;
- break;
- default:
- *os << "_tao_marshal_flag = (strm >> _tao_sequence[i]);";
- break;
- }
- }
-
- break;
- default:
- *os << "_tao_marshal_flag = (strm >> _tao_sequence[i]);";
-
- break;
- }
-
- *os << be_uidt_nl
- << "}";
-
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- switch (nt)
- {
- case AST_Decl::NT_array:
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << "_var tmp_var (" << be_idt << be_idt_nl;
-
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << "_dup (_tao_sequence[i])" << be_uidt_nl
- << ");" << be_uidt_nl;
-
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << "_forany tmp (tmp_var.inout ());" << be_nl;
- *os << "_tao_marshal_flag = (strm << tmp);";
-
- break;
- case AST_Decl::NT_interface:
- case AST_Decl::NT_interface_fwd:
- *os << "//DCPS does not support interfaces";
-
- break;
- case AST_Decl::NT_string:
- case AST_Decl::NT_wstring:
- *os << "_tao_marshal_flag = (strm << _tao_sequence[i]);";
- break;
- case AST_Decl::NT_valuetype:
- case AST_Decl::NT_valuetype_fwd:
- *os << "//DCPS does not support value types";
-
- break;
- case AST_Decl::NT_pre_defined:
- {
- //SHH harris_s@ociweb.com - I am not sure you can every get here
- // predefined types are handled by be_visitor_sequence_serializer_op_cs::visit_predefined_type
- be_predefined_type *pt =
- be_predefined_type::narrow_from_decl (
- td == 0 ? bt : td->primitive_base_type ()
- );
-
- if (!pt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "bad predefined type node\n"),
- -1);
- }
-
- switch (pt->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- case AST_PredefinedType::PT_value:
- *os << "_tao_marshal_flag = (strm << _tao_sequence[i].in ());";
- break;
- case AST_PredefinedType::PT_char:
- *os << "_tao_marshal_flag =" << be_idt_nl
- << "(strm << ::ACE_OutputCDR::from_char (_tao_sequence[i]));"
- << be_uidt;
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "_tao_marshal_flag =" << be_idt_nl
- << "(strm << ::ACE_OutputCDR::from_wchar (_tao_sequence[i]));"
- << be_uidt;
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "_tao_marshal_flag =" << be_idt_nl
- << "(strm << ::ACE_OutputCDR::from_boolean (_tao_sequence[i]));"
- << be_uidt;
- break;
- case AST_PredefinedType::PT_octet:
- *os << "_tao_marshal_flag =" << be_idt_nl
- << "(strm << ::ACE_OutputCDR::from_octet (_tao_sequence[i]));"
- << be_uidt;
- break;
- default:
- *os << "_tao_marshal_flag = (strm << _tao_sequence[i]);";
- break;
- }
- }
-
- break;
- default:
- *os << "_tao_marshal_flag = (strm << _tao_sequence[i]);";
-
- break;
- }
-
- *os << be_uidt_nl
- << "}";
-
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "bad sub state\n"),
- -1);
- }
-
- *os << be_uidt_nl << be_nl;
- *os << "return _tao_marshal_flag;" << be_uidt_nl;
- }
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_serializer_op_cs::"
- "visit_node - "
- "bad sub state\n"),
- -1);
- break;
-} //outer switch
-
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_structure.cpp b/TAO/TAO_IDL/be/be_visitor_structure.cpp
deleted file mode 100644
index 69d2b266c0b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_structure.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Structure
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_field.h"
-#include "be_structure.h"
-#include "be_helper.h"
-#include "be_extern.h"
-
-#include "be_visitor_structure.h"
-#include "be_visitor_field.h"
-#include "be_visitor_typecode.h"
-#include "be_visitor_context.h"
-#include "ace/Log_Msg.h"
-
-#include "be_visitor_structure/structure.cpp"
-#include "be_visitor_structure/structure_ch.cpp"
-#include "be_visitor_structure/structure_ci.cpp"
-#include "be_visitor_structure/structure_cs.cpp"
-#include "be_visitor_structure/any_op_ch.cpp"
-#include "be_visitor_structure/any_op_cs.cpp"
-#include "be_visitor_structure/cdr_op_ch.cpp"
-#include "be_visitor_structure/cdr_op_cs.cpp"
-#include "be_visitor_structure/serializer_op_ch.cpp"
-#include "be_visitor_structure/serializer_op_cs.cpp"
-
-ACE_RCSID (be,
- be_visitor_structure,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_structure/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_structure/any_op_ch.cpp
deleted file mode 100644
index 3d30576a792..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/any_op_ch.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for structures
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_structure,
- any_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Structure visitor for generating Any operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_structure_any_op_ch::be_visitor_structure_any_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_structure (ctx)
-{
-}
-
-be_visitor_structure_any_op_ch::~be_visitor_structure_any_op_ch (void)
-{
-}
-
-int
-be_visitor_structure_any_op_ch::visit_structure (be_structure *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- const char *macro = this->ctx_->export_macro ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << macro << " void operator<<= (::CORBA::Any &, const " << node->name ()
- << " &); // copying version" << be_nl;
- *os << macro << " void operator<<= (::CORBA::Any &, " << node->name ()
- << "*); // noncopying version" << be_nl;
- *os << macro << " ::CORBA::Boolean operator>>= (const ::CORBA::Any &, "
- << node->name () << " *&); // deprecated\n";
- *os << macro << " ::CORBA::Boolean operator>>= (const ::CORBA::Any &, const "
- << node->name () << " *&);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- // All we have to do is to visit the scope and generate code.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure::visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
-
- node->cli_hdr_any_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_structure_any_op_ch::visit_field (be_field *node)
-{
- be_type *bt;
-
- // First generate the type information.
- bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_any_op_ch::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_any_op_ch::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_structure_any_op_ch::visit_union (be_union *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- be_visitor_union_any_op_ch visitor (this->ctx_);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_any_op_ch::"
- "visit_union - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_structure_any_op_ch::visit_enum (be_enum *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- be_visitor_enum_any_op_ch visitor (this->ctx_);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_any_op_ch::"
- "visit_enum - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp
deleted file mode 100644
index ec9ee323817..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp
+++ /dev/null
@@ -1,241 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for structures
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_structure,
- any_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Structure visitor for generating Any operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_structure_any_op_cs::be_visitor_structure_any_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_structure (ctx)
-{
-}
-
-be_visitor_structure_any_op_cs::~be_visitor_structure_any_op_cs (void)
-{
-}
-
-int
-be_visitor_structure_any_op_cs::visit_structure (be_structure *node)
-{
- if (node->cli_stub_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl
- << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Since we don't generate CDR stream operators for types that
- // explicitly contain a local interface (at some level), we
- // must override these Any template class methods to avoid
- // calling the non-existent operators. The zero return value
- // will eventually cause CORBA::MARSHAL to be raised if this
- // type is inserted into an Any and then marshaled.
- if (node->is_local ())
- {
- *os << be_nl << be_nl
- << "namespace TAO" << be_nl
- << "{" << be_idt_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Dual_Impl_T<" << node->name ()
- << ">::marshal_value (TAO_OutputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Dual_Impl_T<" << node->name ()
- << ">::demarshal_value (TAO_InputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}";
- }
-
- // Copying insertion.
- *os << "// Copying insertion." << be_nl
- << "void operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << "const " << node->name () << " &_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
-
- << "if (0 == &_tao_elem) // Trying to de-reference NULL object" << be_idt_nl
- << "_tao_any <<= static_cast<" << node->name () << " *>( 0 ); // Use non-copying insertion of a NULL" << be_uidt_nl
- << "else" << be_idt_nl
-
- << "TAO::Any_Dual_Impl_T<" << node->name () << ">::insert_copy ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Non-copying insertion.
- *os << "// Non-copying insertion." << be_nl
- << "void operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->name () << " *_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "TAO::Any_Dual_Impl_T<" << node->name () << ">::insert ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Extraction to non-const pointer (deprecated, just calls the other).
- *os << "// Extraction to non-const pointer (deprecated)." << be_nl
- << "::CORBA::Boolean operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << node->name () << " *&_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return _tao_any >>= const_cast<" << be_idt << be_idt_nl
- << "const " << node->name () << " *&> (" << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Extraction to const pointer.
- *os << "// Extraction to const pointer." << be_nl
- << "::CORBA::Boolean operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << "const " << node->name () << " *&_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return" << be_idt_nl
- << "TAO::Any_Dual_Impl_T<" << node->name () << ">::extract ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- // all we have to do is to visit the scope and generate code
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure::visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
-
- node->cli_stub_any_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_structure_any_op_cs::visit_field (be_field *node)
-{
- // First generate the type information.
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_any_op_cs::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_any_op_cs::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_structure_any_op_cs::visit_union (be_union *node)
-{
- if (node->cli_stub_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- be_visitor_union_any_op_cs visitor (this->ctx_);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_any_op_cs::"
- "visit_union - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_structure_any_op_cs::visit_enum (be_enum *node)
-{
- if (node->cli_stub_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- be_visitor_enum_any_op_cs visitor (this->ctx_);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_any_op_cs::"
- "visit_enum - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ch.cpp
deleted file mode 100644
index 8986fd0f56b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ch.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for structures. This uses
-// compiled marshaling.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_structure,
- cdr_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Structure visitor for generating CDR operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_structure_cdr_op_ch::be_visitor_structure_cdr_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_structure (ctx)
-{
-}
-
-be_visitor_structure_cdr_op_ch::~be_visitor_structure_cdr_op_ch (void)
-{
-}
-
-int
-be_visitor_structure_cdr_op_ch::visit_structure (be_structure *node)
-{
- if (node->cli_hdr_cdr_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator<< (TAO_OutputCDR &, const " << node->name ()
- << " &);" << be_nl;
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator>> (TAO_InputCDR &, "
- << node->name () << " &);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- // Set the substate as generating code for the types defined in our scope.
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_cdr_op_ch::"
- "visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
-
-
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp
deleted file mode 100644
index 2463764b749..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for structures
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_structure,
- cdr_op_cs,
- "$Id$")
-
-be_visitor_structure_cdr_op_cs::be_visitor_structure_cdr_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_structure (ctx)
-{
-}
-
-be_visitor_structure_cdr_op_cs::~be_visitor_structure_cdr_op_cs (void)
-{
-}
-
-int
-be_visitor_structure_cdr_op_cs::visit_structure (be_structure *node)
-{
- if (node->cli_stub_cdr_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- // Set the substate as generating code for the types defined in our scope.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_SCOPE);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_cdr_op_cs::"
- "visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Set the sub state as generating code for the output operator.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
-
- *os << "::CORBA::Boolean operator<< (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &strm," << be_nl
- << "const " << node->name () << " &_tao_aggregate" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- be_visitor_context new_ctx (*this->ctx_);
- be_visitor_cdr_op_field_decl field_decl (&new_ctx);
- field_decl.visit_scope (node);
-
- *os << "return" << be_idt_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_cdr_op_cs::"
- "visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << ";" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Set the substate as generating code for the input operator.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_INPUT);
-
- *os << "::CORBA::Boolean operator>> (" << be_idt << be_idt_nl
- << "TAO_InputCDR &";
-
- if (! node->is_local ())
- {
- *os << "strm";
- }
-
- *os << "," << be_nl
- << node->name () << " &";
-
- if (! node->is_local ())
- {
- *os << "_tao_aggregate";
- }
-
- *os << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (node->is_local ())
- {
- *os << "return false;";
- }
- else
- {
- new_ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- field_decl.visit_scope (node);
-
- *os << "return" << be_idt_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_cdr_op_cs"
- "::visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << ";" << be_uidt << be_uidt;
- }
-
- *os << be_uidt_nl << "}";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_stub_cdr_op_gen (true);
- return 0;
-}
-
-int
-be_visitor_structure_cdr_op_cs::post_process (be_decl *bd)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (!this->last_node (bd)
- && bd->node_type () != AST_Decl::NT_enum_val)
- {
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << " &&" << be_nl;
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- default:
- break;
- };
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_structure/serializer_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_structure/serializer_op_ch.cpp
deleted file mode 100644
index 7b5b502332b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/serializer_op_ch.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for TAO::DCPS::Serializer operators for
-// structures. This uses compiled marshaling.
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_structure,
- serializer_op_ch,
- "$Id$")
-
-#include "global_extern.h"
-
-// ***************************************************************************
-// Structure visitor for generating Serializer operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_structure_serializer_op_ch::be_visitor_structure_serializer_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_structure (ctx)
-{
-}
-
-be_visitor_structure_serializer_op_ch::~be_visitor_structure_serializer_op_ch (void)
-{
-}
-
-int
-be_visitor_structure_serializer_op_ch::visit_structure (be_structure *node)
-{
- if (node->cli_hdr_serializer_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- IDL_GlobalData::DCPS_Data_Type_Info* info;
- if (0 != (info = idl_global->is_dcps_type(node->name())))
- {
- *os << be_global->stub_export_macro ()
- << " ::CORBA::Boolean _dcps_has_key(const "
- << node->name() << "& val);" << be_nl;
-
- *os << "// This structure supports use of std::map with a key" << be_nl
- << "// defined by one or more #pragma DCPS_DATA_KEY lines." << be_nl
- << "struct " << be_global->stub_export_macro () << " "
- << node->name()->last_component() << "KeyLessThan " << be_nl
- << "{" << be_idt_nl
- << "bool operator() (" << be_idt << be_idt_nl
- << "const " << node->name() << "& v1," << be_nl
- << "const " << node->name() << "& v2) const" << be_uidt << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (info->key_list_.is_empty())
- {
- *os << "ACE_UNUSED_ARG(v1);" << be_nl;
- *os << "ACE_UNUSED_ARG(v2);" << be_nl;
- *os << "// if no DCPS_DATA_KEY values then return false" << be_nl
- << "// to allow use of map with just one entry" << be_nl;
- *os << "return false;" << be_nl;
- }
- else
- {
- *os << "return ";
- IDL_GlobalData::DCPS_Data_Type_Info_Iter iter (info->key_list_);
-
- for (ACE_CString *kp = 0;
- iter.next (kp) != 0;
- )
- {
- *os << "v1." << kp->c_str () << " < " << "v2." << kp->c_str ();
- iter.advance ();
- if (iter.done ())
- *os << ";" << be_uidt_nl;
- else
- *os << " || " << be_nl;
- }
- }
- *os << "}" << be_uidt_nl
- << "};" << be_nl << be_nl;
- }
-
- //- _dcps_max_marshaled_size(type) method
- *os << be_global->stub_export_macro ()
- << " size_t _dcps_max_marshaled_size (const "
- << node->name() << "& _tao_aggregate);" << be_nl;
- //- _tao_is_bounded_size(type) method
- *os << be_global->stub_export_macro ()
- << " ::CORBA::Boolean _tao_is_bounded_size (const "
- << node->name() << "& _tao_aggregate);" << be_nl;
- //- _dcps_find_size(type) method
- *os << be_global->stub_export_macro ()
- << " size_t _dcps_find_size (const "
- << node->name() << "& _tao_aggregate);" << be_nl;
-
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator<< (TAO::DCPS::Serializer &, const " << node->name ()
- << " &);" << be_nl;
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator>> (TAO::DCPS::Serializer &, "
- << node->name () << " &);";
-
-
- // Set the substate as generating code for the types defined in our scope.
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_serializer_op_ch::"
- "visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
-
-
- node->cli_hdr_serializer_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_structure/serializer_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/serializer_op_cs.cpp
deleted file mode 100644
index f99dbf45b27..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/serializer_op_cs.cpp
+++ /dev/null
@@ -1,311 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for TAO::DCPS::Serializer operators for structures
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_structure,
- serializer_op_cs,
- "$Id$")
-
-be_visitor_structure_serializer_op_cs::be_visitor_structure_serializer_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_structure (ctx)
-{
-}
-
-be_visitor_structure_serializer_op_cs::~be_visitor_structure_serializer_op_cs (void)
-{
-}
-
-int
-be_visitor_structure_serializer_op_cs::visit_structure (be_structure *node)
-{
- if (node->cli_stub_serializer_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- // Set the substate as generating code for the types defined in our scope.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_SCOPE);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_serializer_op_cs::"
- "visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- IDL_GlobalData::DCPS_Data_Type_Info* info;
- if (0 != (info = idl_global->is_dcps_type(node->name())))
- {
- *os << "::CORBA::Boolean _dcps_has_key (const "
- << node->name() << "& ) { " << be_idt_nl;
- if (info->key_list_.is_empty())
- *os << "return false;";
- else
- *os << "return true;";
- *os << be_uidt_nl << "}" << be_nl;
- }
-
- //- _dcps_max_marshaled_size(type) method
- this->ctx_->sub_state (TAO_CodeGen::TAO_MAX_MARSHALED_SIZE);
- *os << "size_t "
- << "_dcps_max_marshaled_size (const "
- << node->name() << "& _tao_aggregate)" << be_nl
- << "{" << be_idt_nl
- << "ACE_UNUSED_ARG (_tao_aggregate);"
- << " // sometimes not used - avoid warning" << be_nl;
-
- {
- be_visitor_context new_ctx (*this->ctx_);
- be_visitor_serializer_op_field_decl field_decl (&new_ctx);
- field_decl.visit_scope (node);
-#ifdef DCPS_DEBUG_IDL
- *os << "size_t result = 0;" << be_nl;
-#else
- *os << "return " << be_idt_nl;
-#endif
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_serializer_op_cs::"
- "visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
- }
- *os << ";" << be_uidt << be_uidt_nl;
-#ifdef DCPS_DEBUG_IDL
- *os << "return result;" << be_uidt_nl;
-#endif
- *os << "}" << be_nl << be_nl;
-
-
- //- _tao_is_bounded_size(type) method
- this->ctx_->sub_state (TAO_CodeGen::TAO_IS_BOUNDED_SIZE);
- *os << "::CORBA::Boolean _tao_is_bounded_size (const "
- << node->name() << "& _tao_aggregate)" << be_nl
- << "{" << be_idt_nl;
-
- {
- be_visitor_context new_ctx (*this->ctx_);
- be_visitor_serializer_op_field_decl field_decl (&new_ctx);
- field_decl.visit_scope (node);
-
- *os << "ACE_UNUSED_ARG (_tao_aggregate);"
- << " // often not used - avoid warning" << be_nl
- << "return" << be_idt_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_serializer_op_cs::"
- "visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
- }
- *os << ";" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- //- _dcps_find_size(type) method -- like max_marshaled_size but use len - not max.
- this->ctx_->sub_state (TAO_CodeGen::TAO_FIND_SIZE);
- *os << "size_t "
- << "_dcps_find_size(const "
- << node->name() << "& _tao_aggregate)" << be_nl
- << "{" << be_idt_nl
- << "ACE_UNUSED_ARG(_tao_aggregate);"
- << " // sometimes not used - avoid warning" << be_nl;
-
- {
- be_visitor_context new_ctx (*this->ctx_);
- be_visitor_serializer_op_field_decl field_decl (&new_ctx);
- field_decl.visit_scope (node);
-#ifdef DCPS_DEBUG_IDL
- *os << "size_t result = 0;" << be_nl;
-#else
- *os << "return " << be_idt_nl;
-#endif
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_serializer_op_cs::"
- "visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
- }
- *os << ";" << be_uidt << be_uidt_nl;
-#ifdef DCPS_DEBUG_IDL
- *os << "return result;" << be_uidt_nl;
-#endif
- *os << "}" << be_nl << be_nl;
-
-
- // Set the sub state as generating code for the output operator.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
-
- *os << "::CORBA::Boolean operator<< (" << be_idt << be_idt_nl
- << "TAO::DCPS::Serializer &strm," << be_nl
- << "const " << node->name () << " &_tao_aggregate" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- be_visitor_context new_ctx (*this->ctx_);
- be_visitor_serializer_op_field_decl field_decl (&new_ctx);
- field_decl.visit_scope (node);
-
- *os << "return" << be_idt_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_serializer_op_cs::"
- "visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << ";" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Set the substate as generating code for the input operator.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_INPUT);
-
- *os << "::CORBA::Boolean operator>> (" << be_idt << be_idt_nl
- << "TAO::DCPS::Serializer &";
-
- if (! node->is_local ())
- {
- *os << "strm";
- }
-
- *os << "," << be_nl
- << node->name () << " &";
-
- if (! node->is_local ())
- {
- *os << "_tao_aggregate";
- }
-
- *os << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (node->is_local ())
- {
- *os << "return 0;";
- }
- else
- {
- new_ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- field_decl.visit_scope (node);
-
- *os << "return" << be_idt_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_serializer_op_cs"
- "::visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << ";" << be_uidt << be_uidt;
- }
-
- *os << be_uidt_nl << "}";
-
- node->cli_stub_serializer_op_gen (true);
- return 0;
-}
-
-int
-be_visitor_structure_serializer_op_cs::post_process (be_decl *bd)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- case TAO_CodeGen::TAO_CDR_INPUT:
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- if (!this->last_node (bd))
- {
- *os << " &&" << be_nl;
- }
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- case TAO_CodeGen::TAO_FIND_SIZE:
-#ifdef DCPS_DEBUG_IDL
- *os << ";" << be_nl;
-#else
- if (!this->last_node (bd))
- {
- *os << " +" << be_nl;
- }
-#endif
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- default:
- break;
- };
-
- return 0;
-}
-
-int
-be_visitor_structure_serializer_op_cs::pre_process (be_decl *bd)
-{
-#ifdef DCPS_DEBUG_IDL
- TAO_OutStream *os = this->ctx_->stream ();
-#else
- ACE_UNUSED_ARG(bd);
-#endif
-
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- case TAO_CodeGen::TAO_FIND_SIZE:
-#ifdef DCPS_DEBUG_IDL
- *os << "result += ";
-#endif
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- case TAO_CodeGen::TAO_CDR_INPUT:
- case TAO_CodeGen::TAO_CDR_SCOPE:
- default:
- break;
- };
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_structure/structure.cpp b/TAO/TAO_IDL/be/be_visitor_structure/structure.cpp
deleted file mode 100644
index 7b766916e55..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/structure.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// structure.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Structures. This is a generic visitor.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_structure,
- structure,
- "$Id$")
-
-be_visitor_structure::be_visitor_structure (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_structure::~be_visitor_structure (void)
-{
-}
-
-int
-be_visitor_structure::visit_structure (be_structure *)
-{
- return -1; // Must be overriden.
-}
-
-int
-be_visitor_structure::visit_field (be_field *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- case TAO_CodeGen::TAO_INTERFACE_CH:
- case TAO_CodeGen::TAO_UNION_PUBLIC_CH:
- case TAO_CodeGen::TAO_UNION_PRIVATE_CH:
- case TAO_CodeGen::TAO_ARRAY_CH:
- {
- be_visitor_field_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_field_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- case TAO_CodeGen::TAO_UNION_PUBLIC_CS:
- {
- be_visitor_field_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_field_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_field_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- be_visitor_field_serializer_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_field_serializer_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure::"
- "visit_field - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure::"
- "visit_field - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_structure/structure_ch.cpp b/TAO/TAO_IDL/be/be_visitor_structure/structure_ch.cpp
deleted file mode 100644
index 180be301e35..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/structure_ch.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// structure_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Structure in the client header.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_structure,
- structure_ch,
- "$Id$")
-
-// ******************************************************
-// for client header
-// ******************************************************
-
-be_visitor_structure_ch::be_visitor_structure_ch (be_visitor_context *ctx)
- : be_visitor_structure (ctx)
-{
-}
-
-be_visitor_structure_ch::~be_visitor_structure_ch (void)
-{
-}
-
-// Visit the Structure node and its scope.
-int be_visitor_structure_ch::visit_structure (be_structure *node)
-{
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- // Evaluate the member in time for the decision to generate
- // the recursive typecode include in the stub source file.
- ACE_Unbounded_Queue<AST_Type *> list;
- (void) node->in_recursion (list);
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate the _var and _out typedefs.
- node->gen_common_varout (os);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl << be_nl
- << "struct " << be_global->stub_export_macro () << " "
- << node->local_name () << be_nl
- << "{" << be_idt_nl;
-
- // Generate the typedefs.
- *os << "typedef " << node->local_name () << "_var _var_type;"
- << be_nl
- << "typedef " << node->local_name () << "_out _out_type;"
- << be_nl << be_nl;
-
- if (be_global->any_support ())
- {
- *os << "static void _tao_any_destructor (void *);";
- }
-
- // Generate code for field members.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_ch::"
- "visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_uidt_nl;
- *os << "};";
-
- if (be_global->tc_support ())
- {
- be_visitor_context ctx (*this->ctx_);
- be_visitor_typecode_decl visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_ch::"
- "visit_structure - "
- "TypeCode declaration failed\n"),
- -1);
- }
- }
-
- node->cli_hdr_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_structure/structure_ci.cpp b/TAO/TAO_IDL/be/be_visitor_structure/structure_ci.cpp
deleted file mode 100644
index 8feffbd15ea..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/structure_ci.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// structure_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Structure in the inline file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_structure,
- structure_ci,
- "$Id$")
-
-// ******************************************************
-// for client inline
-// ******************************************************
-
-be_visitor_structure_ci::be_visitor_structure_ci (be_visitor_context *ctx)
- : be_visitor_structure (ctx)
-{
-}
-
-be_visitor_structure_ci::~be_visitor_structure_ci (void)
-{
-}
-
-// visit the Structure node and its scope
-int be_visitor_structure_ci::visit_structure (be_structure *node)
-{
- if (node->cli_inline_gen () || node->imported ())
- {
- return 0;
- }
-
- // All we have to do is to visit the scope.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_ci::"
- "visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
-
- node->cli_inline_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp
deleted file mode 100644
index 98c015f982e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// structure_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Structures in the client stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_structure,
- structure_cs,
- "$Id$")
-
-// ***************************************************************************
-// For client stubs.
-// ***************************************************************************
-
-be_visitor_structure_cs::be_visitor_structure_cs (be_visitor_context *ctx)
- : be_visitor_structure (ctx)
-{
-}
-
-be_visitor_structure_cs::~be_visitor_structure_cs (void)
-{
-}
-
-int
-be_visitor_structure_cs::visit_structure (be_structure *node)
-{
- if (node->cli_stub_gen () || node->imported ())
- {
- return 0;
- }
-
- if (be_global->tc_support ())
- {
- be_visitor_context ctx (*this->ctx_);
- // ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- TAO::be_visitor_struct_typecode visitor (&ctx);
-
- if (visitor.visit_structure (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_cs::"
- "visit_structure - "
- "TypeCode definition failed\n"),
- -1);
- }
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl;
- *os << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- if (be_global->any_support ())
- {
- *os << "void " << be_nl
- << node->name ()
- << "::_tao_any_destructor (" << be_idt << be_idt_nl
- << "void *_tao_void_pointer" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << node->local_name () << " *_tao_tmp_pointer =" << be_idt_nl
- << "static_cast<" << node->local_name ()
- << " *> (_tao_void_pointer);" << be_uidt_nl
- << "delete _tao_tmp_pointer;" << be_uidt_nl
- << "}";
- }
-
- // Do any code generation required for the scope members
- // all we have to do is to visit the scope.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_cs::"
- "visit_structure - "
- "codegen for scope failed\n"),
- -1);
- }
-
- node->cli_stub_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_structure_fwd.cpp b/TAO/TAO_IDL/be/be_visitor_structure_fwd.cpp
deleted file mode 100644
index 85cb72ef70f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure_fwd.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_structure_fwd.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for be_structure_fwd
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-#include "be_structure_fwd.h"
-#include "be_structure.h"
-
-#include "be_visitor_structure_fwd.h"
-#include "be_visitor_context.h"
-#include "be_helper.h"
-
-#include "be_visitor_structure_fwd/structure_fwd_ch.cpp"
-
-ACE_RCSID (be,
- be_visitor_structure_fwd,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_structure_fwd/structure_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_structure_fwd/structure_fwd_ch.cpp
deleted file mode 100644
index 0df96e7e10a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure_fwd/structure_fwd_ch.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// structure_fwd_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for be_structure_fwd node in the client header.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_structure_fwd,
- structure_fwd_ch,
- "$Id$")
-
-be_visitor_structure_fwd_ch::be_visitor_structure_fwd_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_structure_fwd_ch::~be_visitor_structure_fwd_ch (void)
-{
-}
-
-// Visit the interface_fwd_ch node.
-int
-be_visitor_structure_fwd_ch::visit_structure_fwd (be_structure_fwd *node)
-{
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_structure *fd =
- be_structure::narrow_from_decl (node->full_definition ());
-
- // This will be a no-op if it has already been done for this node.
- fd->gen_common_varout (os);
-
- node->cli_hdr_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_traits.cpp b/TAO/TAO_IDL/be/be_visitor_traits.cpp
deleted file mode 100644
index 0d0156419b0..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_traits.cpp
+++ /dev/null
@@ -1,488 +0,0 @@
-//=============================================================================
-/**
-* @file be_visitor_traits.cpp
-*
-* $Id$
-*
-* This visitor generates template specializations for traits of various
-* kinds for IDL declarations. These specialized template classes are then
-* used in other template classes in the ORB.
-*
-* @author Jeff Parsons <j.parsons@vanderbilt.edu>
-*/
-//=============================================================================
-
-#include "be_visitor_traits.h"
-#include "be_visitor_context.h"
-#include "be_root.h"
-#include "be_module.h"
-#include "be_interface.h"
-#include "be_valuebox.h"
-#include "be_valuetype.h"
-#include "be_valuebox.h"
-#include "be_interface_fwd.h"
-#include "be_valuetype_fwd.h"
-#include "be_eventtype.h"
-#include "be_eventtype_fwd.h"
-#include "be_component.h"
-#include "be_component_fwd.h"
-#include "be_field.h"
-#include "be_union_branch.h"
-#include "be_exception.h"
-#include "be_structure.h"
-#include "be_union.h"
-#include "be_array.h"
-#include "be_typedef.h"
-#include "be_helper.h"
-#include "be_extern.h"
-
-#include "utl_identifier.h"
-#include "idl_defines.h"
-
-#include "ace/Log_Msg.h"
-
-ACE_RCSID (be,
- be_visitor_traits,
- "$Id$")
-
-be_visitor_traits::be_visitor_traits (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_traits::~be_visitor_traits (void)
-{
-}
-
-int
-be_visitor_traits::visit_root (be_root *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl
- << be_global->core_versioning_begin ();
-
- *os << be_nl
- << "// Traits specializations." << be_nl
- << "namespace TAO" << be_nl
- << "{" << be_idt;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_traits::"
- "visit_root - visit scope failed\n"),
- -1);
- }
-
- *os << be_uidt_nl
- << "}";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_traits::visit_module (be_module *node)
-{
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_traits::"
- "visit_module - visit scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_traits::visit_interface (be_interface *node)
-{
- if (node->cli_traits_gen ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Since the three blocks below generate specialized (i.e., non-template)
- // classes, we don't want to generate them unless it's necessary - thus
- // the ifdef logic surrounding each one.
-
- if (!node->imported ())
- {
- os->gen_ifdef_macro (node->flat_name (), "traits", false);
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "struct " << be_global->stub_export_macro () << " Objref_Traits<"
- << " ::" << node->name () << ">" << be_nl
- << "{" << be_idt_nl
- << "static ::" << node->name () << "_ptr duplicate ("
- << be_idt << be_idt_nl
- << "::" << node->name () << "_ptr" << be_uidt_nl
- << ");" << be_uidt_nl
- << "static void release (" << be_idt << be_idt_nl
- << "::" << node->name () << "_ptr" << be_uidt_nl
- << ");" << be_uidt_nl
- << "static ::" << node->name () << "_ptr nil (void);" << be_nl
- << "static ::CORBA::Boolean marshal (" << be_idt << be_idt_nl
- << "const ::" << node->name () << "_ptr p," << be_nl
- << "TAO_OutputCDR & cdr" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "};";
-
- os->gen_endif ();
- }
-
- if (this->visit_scope (node) != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_traits::"
- "visit_interface - visit scope failed\n"),
- -1);
- }
-
- node->cli_traits_gen (true);
- return 0;
-}
-
-int
-be_visitor_traits::visit_interface_fwd (be_interface_fwd *node)
-{
- if (node->cli_traits_gen ())
- {
- return 0;
- }
-
- be_interface *fd =
- be_interface::narrow_from_decl (node->full_definition ());
-
- // We want to generate just the declaration of the Arg_Traits<>
- // specialization if the interface is forward declared but not defined.
- if (!fd->is_defined () && this->visit_interface (fd) != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_traits::"
- "visit_interface_fwd - code generation failed\n"),
- -1);
- }
-
- node->cli_traits_gen (true);
- return 0;
-}
-
-int
-be_visitor_traits::visit_valuetype (be_valuetype *node)
-{
- if (node->cli_traits_gen ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // I think we need to generate this only for non-defined forward
- // declarations.
- if (!node->imported ())
- {
- os->gen_ifdef_macro (node->flat_name (), "traits", false);
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "struct " << be_global->stub_export_macro () << " Value_Traits<"
- << node->name () << ">" << be_nl
- << "{" << be_idt_nl
- << "static void add_ref (" << node->name () << " *);" << be_nl
- << "static void remove_ref (" << node->name () << " *);"
- << be_nl
- << "static void release (" << node->name () << " *);"
- << be_uidt_nl
- << "};";
-
- os->gen_endif ();
- }
-
- int status = this->visit_scope (node);
-
- if (status != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_traits::"
- "visit_valuetype - visit scope failed\n"),
- -1);
- }
-
- node->cli_traits_gen (true);
- return 0;
-}
-
-int
-be_visitor_traits::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- if (node->cli_traits_gen ())
- {
- return 0;
- }
-
- be_valuetype *fd =
- be_valuetype::narrow_from_decl (node->full_definition ());
-
- // The logic in visit_valuetype() should handle what gets generated
- // and what doesn't.
- int status = this->visit_valuetype (fd);
-
- if (status != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_traits::"
- "visit_valuetype_fwd - code generation failed\n"),
- -1);
- }
-
- node->cli_traits_gen (true);
- return 0;
-}
-
-int
-be_visitor_traits::visit_valuebox (be_valuebox *node)
-{
- if (node->cli_traits_gen ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // I think we need to generate this only for non-defined forward
- // declarations.
- if (!node->imported ())
- {
- os->gen_ifdef_macro (node->flat_name (), "traits", false);
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "struct " << be_global->stub_export_macro () << " Value_Traits<"
- << node->name () << ">" << be_nl
- << "{" << be_idt_nl
- << "static void add_ref (" << node->name () << " *);" << be_nl
- << "static void remove_ref (" << node->name () << " *);"
- << be_nl
- << "static void release (" << node->name () << " *);"
- << be_uidt_nl
- << "};";
-
- os->gen_endif ();
- }
-
- node->cli_traits_gen (true);
- return 0;
-}
-
-int
-be_visitor_traits::visit_component (be_component *node)
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_traits::visit_component_fwd (be_component_fwd *node)
-{
- return this->visit_interface_fwd (node);
-}
-
-int
-be_visitor_traits::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_traits::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
-
-int
-be_visitor_traits::visit_field (be_field *node)
-{
- be_type *ft = be_type::narrow_from_decl (node->field_type ());
- AST_Decl::NodeType nt = ft->node_type ();
-
- // All we are trying to catch in here are anonymous array members.
- if (nt != AST_Decl::NT_array)
- {
- return 0;
- }
-
- if (ft->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_traits::"
- "visit_field - visit field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_traits::visit_union_branch (be_union_branch *node)
-{
- be_type *ft = be_type::narrow_from_decl (node->field_type ());
- AST_Decl::NodeType nt = ft->node_type ();
-
- // All we are trying to catch in here are anonymous array members.
- if (nt != AST_Decl::NT_array)
- {
- return 0;
- }
-
- if (ft->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_traits::"
- "visit_union_branch - visit field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_traits::visit_exception (be_exception *node)
-{
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_traits::"
- "visit_exception - visit scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_traits::visit_structure (be_structure *node)
-{
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_traits::"
- "visit_struct - visit scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_traits::visit_union (be_union *node)
-{
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_traits::"
- "visit_union - visit scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_traits::visit_array (be_array *node)
-{
- if (node->imported () || node->cli_traits_gen ())
- {
- return 0;
- }
-
- ACE_CString name_holder;
-
- if (node->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
- name_holder = parent->full_name ();
-
- name_holder += "::";
-
- if (!this->ctx_->alias ())
- {
- name_holder += "_";
- }
-
- name_holder += node->local_name ()->get_string ();
- }
- else
- {
- name_holder = node->full_name ();
- }
-
- const char *name = name_holder.fast_rep ();
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl
- << "template<>" << be_nl
- << "struct " << be_global->stub_export_macro () << " Array_Traits<"
- << be_idt << be_idt_nl
- << name << "_forany" << be_uidt_nl
- << ">" << be_uidt_nl
- << "{" << be_idt_nl
- << "static void free (" << be_idt << be_idt_nl
- << name << "_slice * _tao_slice"
- << be_uidt_nl
- << ");" << be_uidt_nl
- << "static " << name << "_slice * dup ("
- << be_idt << be_idt_nl
- << "const " << name << "_slice * _tao_slice"
- << be_uidt_nl
- << ");" << be_uidt_nl
- << "static void copy (" << be_idt << be_idt_nl
- << name << "_slice * _tao_to," << be_nl
- << "const " << name << "_slice * _tao_from"
- << be_uidt_nl
- << ");" << be_uidt_nl
- << "static " << name << "_slice * alloc (void);"
- << be_nl
- << "static void zero (" << be_idt << be_idt_nl
- << name << "_slice * _tao_slice"
- << be_uidt_nl
- << ");" << be_uidt
- << be_uidt_nl
- << "};";
-
- node->cli_traits_gen (true);
- return 0;
-}
-
-int
-be_visitor_traits::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- // Make a decision based on the primitive base type.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_traits::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- node->cli_traits_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode.cpp
deleted file mode 100644
index e8802efb7a0..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typecode.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_typecode.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for TypeCodes for various types
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_array.h"
-#include "be_enum.h"
-#include "be_enum_val.h"
-#include "be_exception.h"
-#include "be_field.h"
-#include "be_interface.h"
-#include "be_component.h"
-#include "be_home.h"
-#include "be_module.h"
-#include "be_predefined_type.h"
-#include "be_sequence.h"
-#include "be_string.h"
-#include "be_structure.h"
-#include "be_type.h"
-#include "be_typedef.h"
-#include "be_union.h"
-#include "be_union_branch.h"
-#include "be_valuebox.h"
-#include "be_valuetype.h"
-#include "be_eventtype.h"
-#include "be_helper.h"
-#include "be_extern.h"
-#include "utl_identifier.h"
-#include "ast_union_label.h"
-
-#include "be_visitor_typecode.h"
-#include "be_visitor_context.h"
-
-#include "be_visitor_typecode/typecode_decl.cpp"
-#include "be_visitor_typecode/typecode_defn.cpp"
-
-#include "be_visitor_typecode/alias_typecode.cpp"
-#include "be_visitor_typecode/enum_typecode.cpp"
-#include "be_visitor_typecode/objref_typecode.cpp"
-#include "be_visitor_typecode/struct_typecode.cpp"
-#include "be_visitor_typecode/union_typecode.cpp"
-#include "be_visitor_typecode/value_typecode.cpp"
-
-
-ACE_RCSID (be,
- be_visitor_typecode,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp
deleted file mode 100644
index c922bca275c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-// -*- C++ -*-
-
-//=============================================================================
-/**
- * @file alias_typecode.cpp
- *
- * $Id$
- *
- * Alias (typedef) TypeCode generation visitor.
- *
- * @author Ossama Othman <ossama@dre.vanderbilt.edu>
- */
-//=============================================================================
-
-
-TAO::be_visitor_alias_typecode::be_visitor_alias_typecode (
- be_visitor_context * ctx)
- : be_visitor_typecode_defn (ctx)
-{
-}
-
-int
-TAO::be_visitor_alias_typecode::visit_typedef (be_typedef * node)
-{
- be_type * const base = be_type::narrow_from_decl (node->base_type ());
-
-
- return this->common (node, base, "tk_alias");
-
-}
-
-
-int
-TAO::be_visitor_alias_typecode::visit_valuebox (be_valuebox * node)
-{
- be_type * const base = be_type::narrow_from_decl (node->boxed_type ());
-
- return this->common (node, base, "tk_value_box");
-}
-
-int
-TAO::be_visitor_alias_typecode::common (be_type * node,
- be_type * base,
- const char * tctype)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED);
-
- // Generate typecode for the base type, being careful to avoid doing
- // so for a typedef since that could recursively cause multiple base
- // type TypeCode definitions to be generated.
- if (!base || (base->node_type () != AST_Decl::NT_typedef
- && base->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%N:%l) be_visitor_alias_typecode")
- ACE_TEXT ("::common) - ")
- ACE_TEXT ("failed to generate base typecode\n")),
- -1);
- }
-
- // Generate the alias TypeCode instantiation.
- os
- << "static TAO::TypeCode::Alias<char const *," << be_nl
- << " ::CORBA::TypeCode_ptr const *," << be_nl
- << " TAO::Null_RefCount_Policy>"
- << be_idt_nl
- << "_tao_tc_" << node->flat_name () << " (" << be_idt_nl
- << "::CORBA::" << tctype << "," << be_nl
- << "\"" << node->repoID () << "\"," << be_nl
- << "\"" << node->original_local_name () << "\"," << be_nl
- << "&";
-
- if (this->gen_base_typecode_name (base) != 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%N:%l) be_visitor_alias_typecode::")
- ACE_TEXT ("common - problem generating base ")
- ACE_TEXT ("TypeCode name.\n")),
- -1);
-
-
- os << ");" << be_uidt_nl
- << be_uidt_nl;
-
- if (this->gen_typecode_ptr (node) != 0)
- return -1;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/enum_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/enum_typecode.cpp
deleted file mode 100644
index 2108aba8850..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typecode/enum_typecode.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-// -*- C++ -*-
-
-//=============================================================================
-/**
- * @file enum_typecode.cpp
- *
- * $Id$
- *
- * Enumeration TypeCode generation visitor.
- *
- * @author Ossama Othman <ossama@dre.vanderbilt.edu>
- */
-//=============================================================================
-
-
-#include "utl_scope.h"
-
-#include <string>
-
-
-TAO::be_visitor_enum_typecode::be_visitor_enum_typecode (
- be_visitor_context * ctx)
- : be_visitor_typecode_defn (ctx)
-{
-}
-
-int
-TAO::be_visitor_enum_typecode::visit_enum (be_enum * node)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl;
-
- static ACE_CString const tao_enumerators ("_tao_enumerators_");
- ACE_CString const enumerators_name (tao_enumerators
- + node->flat_name ());
-
- // Generate array containing enum field characteristics.
- os << "static char const * const "
- << enumerators_name.c_str ()
- << "[] =" << be_idt_nl
- << "{" << be_idt_nl;
-
- if (this->visit_members (node) != 0)
- return -1;
-
- os << be_uidt_nl
- << "};" << be_uidt_nl << be_nl;
-
- // Generate the TypeCode instantiation.
- os
- << "static TAO::TypeCode::Enum<char const *," << be_nl
- << " char const * const *," << be_nl
- << " TAO::Null_RefCount_Policy>"
- << be_idt_nl
- << "_tao_tc_" << node->flat_name () << " (" << be_idt_nl
- << "\"" << node->repoID () << "\"," << be_nl
- << "\"" << node->original_local_name () << "\"," << be_nl
- << "_tao_enumerators_" << node->flat_name () << "," << be_nl
- << node->member_count () << ");" << be_uidt_nl
- << be_uidt_nl;
-
- if (this->gen_typecode_ptr (node) != 0)
- return -1;
-
- return 0;
-}
-
-int
-TAO::be_visitor_enum_typecode::visit_members (be_enum * node)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- size_t const count = node->member_count ();
- size_t n = 0;
-
- for (UTL_ScopeActiveIterator i (node, UTL_Scope::IK_decls);
- !i.is_done ();
- i.next ())
- {
- AST_Decl * const d = i.item ();
- AST_EnumVal * const item = AST_EnumVal::narrow_from_decl (d);
-
- // os << item->name ();
- os << "\"" << item->original_local_name () << "\"";
-
- if (n < count - 1)
- os << ",";
-
- os << be_nl;
-
- ++n;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/objref_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/objref_typecode.cpp
deleted file mode 100644
index 8df2556f997..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typecode/objref_typecode.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-// -*- C++ -*-
-
-//=============================================================================
-/**
- * @file objref_typecode.cpp
- *
- * $Id$
- *
- * Object reference TypeCode generation visitor.
- *
- * @author Ossama Othman <ossama@dre.vanderbilt.edu>
- */
-//=============================================================================
-
-
-TAO::be_visitor_objref_typecode::be_visitor_objref_typecode (
- be_visitor_context * ctx)
- : be_visitor_typecode_defn (ctx)
-{
-}
-
-int
-TAO::be_visitor_objref_typecode::visit_interface (be_interface * node)
-{
- if (!node->is_defined ())
- return this->gen_forward_declared_typecode (node);
-
- static char const abstract_interface[] = "abstract_interface";
- static char const component[] = "component";
- static char const home[] = "home";
- static char const local_interface[] = "local_interface";
- static char const objref[] = "objref";
-
- char const * kind = 0;
-
- if (dynamic_cast<be_component *> (node))
- kind = component;
- else if (dynamic_cast<be_home *> (node))
- kind = home;
- else if (node->is_abstract ())
- kind = abstract_interface;
- else if (node->is_local ())
- kind = local_interface;
- else
- kind = objref;
-
- return this->visit_i (kind,
- node->flat_name (),
- node->repoID (),
- node->original_local_name ()->get_string (),
- node);
-}
-
-int
-TAO::be_visitor_objref_typecode::visit_native (be_native * /* node */)
-{
- return 0;
-// return this->visit_i ("native",
-// ,
-// ,
-// ,
-// node);
-}
-
-int
-TAO::be_visitor_objref_typecode::visit_i (char const * kind,
- char const * flat_name,
- char const * repository_id,
- char const * original_local_name,
- be_type * node)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Generate the TypeCode instantiation.
- os
- << "static TAO::TypeCode::Objref<char const *," << be_nl
- << " TAO::Null_RefCount_Policy>"
- << be_idt_nl
- << "_tao_tc_" << flat_name << " (" << be_idt_nl
- << "::CORBA::tk_" << kind << "," << be_nl
- << "\"" << repository_id << "\"," << be_nl
- << "\"" << original_local_name << "\");" << be_uidt_nl
- << be_uidt_nl;
-
- if (this->gen_typecode_ptr (node) != 0)
- return -1;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp
deleted file mode 100644
index 0ff1d7c32dd..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp
+++ /dev/null
@@ -1,218 +0,0 @@
-// -*- C++ -*-
-
-//=============================================================================
-/**
- * @file struct_typecode.cpp
- *
- * $Id$
- *
- * Structure TypeCode generation visitor.
- *
- * @author Ossama Othman <ossama@dre.vanderbilt.edu>
- */
-//=============================================================================
-
-
-#include <string>
-
-
-TAO::be_visitor_struct_typecode::be_visitor_struct_typecode (
- be_visitor_context * ctx)
- : be_visitor_typecode_defn (ctx)
- , is_recursive_ (false)
- , is_nested_ (false)
-{
-}
-
-int
-TAO::be_visitor_struct_typecode::visit_structure (be_structure * node)
-{
- if (!node->is_defined ())
- return this->gen_forward_declared_typecode (node);
-
- // Check if we are repeated.
- be_visitor_typecode_defn::QNode const * const qnode =
- this->queue_lookup (this->tc_queue_, node);
-
- ACE_Unbounded_Queue<AST_Type *> recursion_queue;
- if (qnode
- && node->in_recursion (recursion_queue))
- {
- this->is_recursive_ = true;
-
- return 0;
- }
- else if (this->queue_insert (this->tc_queue_, node, 0) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_struct_typecode::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
-
- if (this->recursion_detect_ || this->is_nested_)
- return 0;
-
- static bool const is_exception = false;
-
- return this->visit (node, is_exception);
-}
-
-int
-TAO::be_visitor_struct_typecode::visit_exception (be_exception * node)
-{
- if (this->recursion_detect_)
- return 0;
-
- // No need to check for recursion since exceptions are never
- // recursive.
-
- static bool const is_exception = true;
-
- return this->visit (node, is_exception);
-}
-
-int
-TAO::be_visitor_struct_typecode::visit (AST_Structure * node,
- bool is_exception)
-{
- this->is_nested_ = true;
-
- TAO_OutStream & os = *this->ctx_->stream ();
-
- os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- if (this->gen_member_typecodes (node) != 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "TAO::be_visitor_struct_typecode::visit_structure - "
- "Unable to generate structure/exception field "
- "TypeCodes.\n"),
- -1);
-
- static ACE_CString const tao_fields ("_tao_fields_");
- ACE_CString const fields_name (tao_fields
- + node->flat_name ());
-
- // Generate array containing struct field characteristics.
- os << "static TAO::TypeCode::Struct_Field<char const *, ::CORBA::TypeCode_ptr const *> const ";
-
- if (node->nfields () == 0)
- {
- // Should only be possible for user exceptions with no fields.
-
- os << "* const " << fields_name.c_str () << " = 0;" << be_nl;
- }
- else
- {
- os << fields_name.c_str () << "[] =" << be_idt_nl
- << "{" << be_idt_nl;
-
- if (this->visit_members (node) != 0)
- return -1;
-
- os << be_uidt_nl
- << "};" << be_uidt_nl;
- }
-
- static char const StringType[] = "char const *";
- static char const TypeCodeType[] = "::CORBA::TypeCode_ptr const *";
- static char const MemberArrayType[] =
- "TAO::TypeCode::Struct_Field<char const *, "
- "::CORBA::TypeCode_ptr const *> const *";
-
- // Generate the TypeCode instantiation.
- os << "static ";
-
- if (this->is_recursive_)
- {
- os << "TAO::TypeCode::Recursive_Type<" << be_idt_nl;
- }
-
- // -- TypeCodeBase --
- os
- << "TAO::TypeCode::Struct<" << StringType << "," << be_nl
- << " " << TypeCodeType << "," << be_nl
- << " " << MemberArrayType << "," << be_nl
- << " TAO::Null_RefCount_Policy>";
-
- if (this->is_recursive_)
- {
- os << "," << be_nl
- << TypeCodeType << "," << be_nl
- << MemberArrayType << " >" << be_uidt_nl;
- }
-
- os
- << be_idt_nl
- << "_tao_tc_" << node->flat_name () << " (" << be_idt_nl
- << "::CORBA::tk_" << (is_exception ? "except" : "struct") << ","
- << be_nl
- << "\"" << node->repoID () << "\"," << be_nl
- << "\"" << node->original_local_name () << "\"," << be_nl
- << "_tao_fields_" << node->flat_name () << "," << be_nl
- << node->nfields () << ");" << be_uidt_nl
- << be_uidt_nl;
-
-
- if (this->gen_typecode_ptr (be_type::narrow_from_decl (node)) != 0)
- return -1;
-
- return 0;
-}
-
-int
-TAO::be_visitor_struct_typecode::gen_member_typecodes (AST_Structure * node)
-{
- AST_Field ** member_ptr = 0;
-
- size_t const count = node->nfields ();
-
- for (size_t i = 0; i < count; ++i)
- {
- node->field (member_ptr, i);
-
- be_type * const member_type =
- be_type::narrow_from_decl ((*member_ptr)->field_type ());
-
- if (this->is_typecode_generation_required (member_type))
- member_type->accept (this);
- }
-
- return 0;
-}
-
-int
-TAO::be_visitor_struct_typecode::visit_members (AST_Structure * node)
-{
- AST_Field ** member_ptr = 0;
-
- size_t const count = node->nfields ();
-
- TAO_OutStream & os = *this->ctx_->stream ();
-
- for (size_t i = 0; i < count; ++i)
- {
- node->field (member_ptr, i);
-
- be_decl * const member_decl =
- be_decl::narrow_from_decl (*member_ptr);
-
- be_type * const member_type =
- be_type::narrow_from_decl ((*member_ptr)->field_type ());
-
- os << "{ "
- << "\"" << member_decl->original_local_name () << "\", "
- << "&" << member_type->tc_name ()
- << " }";
-
- if (i < count - 1)
- os << ",";
-
- os << be_nl;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp
deleted file mode 100644
index e29c13dc981..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp
+++ /dev/null
@@ -1,163 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// typecode_decl.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for TypeCode declaration for a type
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_typecode,
- typecode_decl,
- "$Id$")
-
-// ******************************************************
-// TypeCode declarations
-// ******************************************************
-
-be_visitor_typecode_decl::be_visitor_typecode_decl (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
- if (be_global->gen_anyop_files ())
- {
- // The context is always a copy, so this is ok.
- this->ctx_->stream (tao_cg->anyop_header ());
- }
-}
-
-be_visitor_typecode_decl::~be_visitor_typecode_decl (void)
-{
-}
-
-int
-be_visitor_typecode_decl::visit_type (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // If -GA is used but anyop macro isn't set, defaults to stub macro.
- const char *export_macro = (be_global->gen_anyop_files ()
- ? this->ctx_->non_null_export_macro ()
- : be_global->stub_export_macro ());
-
- if (node->is_nested ())
- {
- // We have a scoped name.
- // Is our enclosing scope a module? We need this check because
- // for platforms that support namespaces, the TypeCode must be
- // declared extern.
- if (node->defined_in ()->scope_node_type () == AST_Decl::NT_module)
- {
- *os << "extern " << export_macro << " ";
- }
- else
- {
- *os << "static ";
- }
-
- *os << "::CORBA::TypeCode_ptr const "
- << node->tc_name ()->last_component ()
- << ";";
- }
- else
- {
- // We are in the ROOT scope.
- *os << "extern " << export_macro
- << " ::CORBA::TypeCode_ptr const "
- << node->tc_name ()->last_component ()
- << ";";
- }
-
- return 0;
-}
-
-int
-be_visitor_typecode_decl::visit_array (be_array *node)
-{
- return this->visit_type (node);
-}
-
-int
-be_visitor_typecode_decl::visit_enum (be_enum *node)
-{
- return this->visit_type (node);
-}
-
-int
-be_visitor_typecode_decl::visit_exception (be_exception *node)
-{
- return this->visit_type (node);
-}
-
-int
-be_visitor_typecode_decl::visit_interface (be_interface *node)
-{
- return this->visit_type (node);
-}
-
-int
-be_visitor_typecode_decl::visit_component (be_component *node)
-{
- return this->visit_type (node);
-}
-
-int
-be_visitor_typecode_decl::visit_home (be_home *node)
-{
- return this->visit_type (node);
-}
-
-int
-be_visitor_typecode_decl::visit_sequence (be_sequence *node)
-{
- return this->visit_type (node);
-}
-
-int
-be_visitor_typecode_decl::visit_structure (be_structure *node)
-{
- return this->visit_type (node);
-}
-
-int
-be_visitor_typecode_decl::visit_typedef (be_typedef *node)
-{
- return this->visit_type (node);
-}
-
-int
-be_visitor_typecode_decl::visit_union (be_union *node)
-{
- return this->visit_type (node);
-}
-
-int
-be_visitor_typecode_decl::visit_valuebox (be_valuebox *node)
-{
- return this->visit_type (node);
-}
-
-int
-be_visitor_typecode_decl::visit_valuetype (be_valuetype *node)
-{
- return this->visit_type (node);
-}
-
-int
-be_visitor_typecode_decl::visit_eventtype (be_eventtype *node)
-{
- return this->visit_type (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp
deleted file mode 100644
index bdf612eb97e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp
+++ /dev/null
@@ -1,818 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// typecode_defn.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for TypeCode definitions for types.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_typecode,
- typecode_defn,
- "$Id$")
-
-#include "be_interface_fwd.h"
-
-// This is an implementation of C++ "scoped lock" idiom in order to
-// avoid repetitive code.
-class Scoped_Compute_Queue_Guard
-{
-public:
- Scoped_Compute_Queue_Guard (be_visitor_typecode_defn* );
- ~Scoped_Compute_Queue_Guard (void);
-
-private:
- be_visitor_typecode_defn* customer_;
-};
-
-Scoped_Compute_Queue_Guard::Scoped_Compute_Queue_Guard (
- be_visitor_typecode_defn* customer
- )
- :customer_ (customer)
-{
- if (customer_ != 0)
- {
- // Reset the compute queue to set the stage for computing our
- // encapsulation length.
- customer_->queue_reset (customer_->compute_queue_);
- }
-}
-
-Scoped_Compute_Queue_Guard::~Scoped_Compute_Queue_Guard (void)
-{
- if (customer_ != 0)
- {
- // Reset the compute queue since we must not affect computation of other
- // nodes.
- customer_->queue_reset (customer_->compute_queue_);
- }
-}
-
-// ******************************************************
-// TypeCode Definitions
-// ******************************************************
-
-be_visitor_typecode_defn::be_visitor_typecode_defn (be_visitor_context * ctx)
- : be_visitor_scope (ctx),
- recursion_detect_ (false),
- computed_tc_size_ (0),
- computed_encap_len_ (0),
- computed_scope_encap_len_ (0),
- tc_offset_ (0),
- index_ (-1)
-{
- if (be_global->gen_anyop_files ())
- {
- // The context is always a copy, so this is ok.
- this->ctx_->stream (tao_cg->anyop_source ());
- }
-}
-
-be_visitor_typecode_defn::~be_visitor_typecode_defn (void)
-{
- this->queue_reset (this->tc_queue_);
- this->queue_reset (this->compute_queue_);
-}
-
-// The following needs to be done to deal until the MSVC compiler's broken
-// handling of namespaces is fixed (hopefully forthcoming in version 7).
-int
-be_visitor_typecode_defn::gen_nested_namespace_begin (be_module *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- char *item_name = 0;
-
- for (UTL_IdListActiveIterator i (node->name ()); !i.is_done (); i.next ())
- {
- item_name = i.item ()->get_string ();
-
- if (ACE_OS::strcmp (item_name, "") != 0)
- {
- // Leave the outermost root scope.
- *os << "namespace " << item_name << be_nl
- << "{" << be_idt_nl;
- }
- }
-
- return 0;
-}
-
-// The following needs to be done to deal until the MSVC compiler's broken
-// handling of namespaces is fixed (hopefully forthcoming in version 7).
-int
-be_visitor_typecode_defn::gen_nested_namespace_end (be_module *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- for (UTL_IdListActiveIterator i (node->name ()); !i.is_done (); i.next ())
- {
- if (ACE_OS::strcmp (i.item ()->get_string (), "") != 0)
- {
- // Leave the outermost root scope.
- *os << be_uidt_nl << "}";
- }
- }
-
- *os << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode_ptr (be_type * node)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- if (node->node_type () == AST_Decl::NT_string
- || node->node_type () == AST_Decl::NT_wstring
- || node->node_type () == AST_Decl::NT_sequence)
- {
- // Don't bother generating a TypeCode_ptr for these types. They
- // are accessible only through an alias TypeCode.
-
- return 0;
- }
-
- // Is our enclosing scope a module? We need this check because for
- // platforms that support namespaces, the typecode must be declared
- // extern.
- if (node->is_nested () &&
- node->defined_in ()->scope_node_type () == AST_Decl::NT_module)
- {
- be_module * const module =
- be_module::narrow_from_scope (node->defined_in ());
-
- if (!module || (this->gen_nested_namespace_begin (module) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_typecode_defn::gen_typecode_ptr - "
- "Error parsing nested name\n"),
- -1);
- }
-
- os << "::CORBA::TypeCode_ptr const _tc_"
- << node->local_name ()
- << " =" << be_idt_nl
- << "&_tao_tc_"
- << node->flat_name () << ";"
- << be_uidt;
-
- if (this->gen_nested_namespace_end (module) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_typecode_defn::gen_typecode_ptr - "
- "Error parsing nested name\n"),
- -1);
- }
- }
- else
- {
- // outermost scope.
- os << "::CORBA::TypeCode_ptr const ";
-
- // Tc name generation.
- os << node->tc_name ();
-
- os << " =" << be_idt_nl
- << "&_tao_tc_";
-
- // Flat name generation.
- os << node->flat_name ();
-
- os << ";" << be_uidt;
- }
-
- return 0;
-}
-
-
-int
-be_visitor_typecode_defn::gen_base_typecode_name (be_type * base)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- if (base->is_nested ()
- && base->defined_in ()->scope_node_type () == AST_Decl::NT_module)
- {
- if (base->node_type () != AST_Decl::NT_string
- && base->node_type () != AST_Decl::NT_wstring
- && base->node_type () != AST_Decl::NT_sequence)
- {
- // Generate scope names only if types other than the ones
- // listed above since the corresponding TypeCodes are at the
- // file scope.
- os << base->tc_name ();
- }
- else
- {
- // Internally used TypeCodes.
- os << base->tc_name ();
- }
- }
- else
- {
- os << base->tc_name ();
- }
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_forward_declared_typecode (be_type * node)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- // Generate an extern TypeCode declaration to make sure TypeCodes
- // that refer to the corresponding TypeCode for the forward declared
- // interface have a valid reference to it.
-
- // Is our enclosing scope a module? We need this check because for
- // platforms that support namespaces, the typecode must be declared
- // extern.
- if (node->is_nested () &&
- node->defined_in ()->scope_node_type () == AST_Decl::NT_module)
- {
- be_module * const module =
- be_module::narrow_from_scope (node->defined_in ());
-
- if (!module || (this->gen_nested_namespace_begin (module) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_typecode_defn::"
- "gen_forward_declared_typecode - "
- "Error parsing nested name\n"),
- -1);
- }
-
- os << "extern ::CORBA::TypeCode_ptr const _tc_"
- << node->local_name () << ";";
-
- if (this->gen_nested_namespace_end (module) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_typecode_defn::"
- "gen_forward_declared_typecode - "
- "Error parsing nested name\n"),
- -1);
- }
- }
- else
- {
- // outermost scope.
- os << "extern ::CORBA::TypeCode_ptr const "
- << node->tc_name () << ";" << be_uidt_nl;
- }
-
- return 0;
-}
-
-bool
-be_visitor_typecode_defn::is_typecode_generation_required (be_type * node)
-{
- AST_Decl::NodeType const nt = node->node_type ();
-
- if (nt == AST_Decl::NT_interface
- || nt == AST_Decl::NT_interface_fwd
- || nt == AST_Decl::NT_valuetype
- || nt == AST_Decl::NT_valuetype_fwd)
- {
- // interfaces, valuetypes, eventtypes and components
-
- be_interface * const intf =
- be_interface::narrow_from_decl (node);
-
- if (intf && intf->is_defined ())
- {
- return false;
- }
- }
- else if (nt == AST_Decl::NT_struct
- || nt == AST_Decl::NT_union)
- {
- // structures and unions
-
- AST_Structure * const st =
- AST_Structure::narrow_from_decl (node);
-
- if (st && st->is_defined ())
- {
- return false;
- }
- }
-
- return true;
-}
-
-void
-be_visitor_typecode_defn::gen_begin_NS_for_anon (void)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- os << "namespace TAO" << be_nl
- << "{" << be_idt_nl
- << "namespace TypeCode" << be_nl
- << "{" << be_idt_nl
- << "namespace" << be_nl
- << "{" << be_idt_nl;
-}
-
-void
-be_visitor_typecode_defn::gen_end_NS_for_anon (void)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- os << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl;
-}
-
-int
-be_visitor_typecode_defn::visit_array (be_array *node)
-{
- be_type * const base = be_type::narrow_from_decl (node->base_type ());
-
- TAO_OutStream & os = *this->ctx_->stream ();
-
- os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // generate typecode for the base type
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED);
-
- // Generate typecode for the base type, being careful to avoid doing
- // so for a typedef since that could recursively cause multiple base
- // type TypeCode definitions to be generated.
- if (!base || (base->node_type () != AST_Decl::NT_typedef
- && base->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ACE_TEXT ("::visit_array) - ")
- ACE_TEXT ("failed to generate base typecode\n")),
- -1);
- }
-
- if (this->recursion_detect_)
- {
- return 0; // Nothing else to do.
- }
-
- // Multiple definition guards.
- // @todo Can we automate duplicate detection within the IDL compiler
- // itself?
- os << "\n#ifndef _TAO_TYPECODE_" << node->flat_name () << "_GUARD"
- << "\n#define _TAO_TYPECODE_" << node->flat_name () << "_GUARD"
- << be_nl;
-
- os << be_global->core_versioning_begin () << be_nl;
-
- // Namespace begin.
- this->gen_begin_NS_for_anon ();
-
- unsigned long const ndims = node->n_dims ();
-
- for (unsigned long i = 0; i < ndims; ++i)
- {
- os << "TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *," << be_nl
- << " TAO::Null_RefCount_Policy>"
- << be_idt_nl
- << node->flat_name ();
-
- unsigned long const inner_ndims = ndims - i - 1;
-
- for (unsigned long j = inner_ndims; j < ndims; ++j)
- {
- os << "_" << node->dims ()[j]->ev ()->u.ulval;
- }
-
- os << " (" << be_idt_nl
- << "::CORBA::tk_array," << be_nl
- << "&";
-
- if (i == 0)
- {
- if (this->gen_base_typecode_name (base) != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("be_visitor_typecode_defn::")
- ACE_TEXT ("visit_array - problem ")
- ACE_TEXT ("generating base ")
- ACE_TEXT ("TypeCode name.\n")),
- -1);
- }
- }
- else
- {
- os << "tc_" << node->flat_name ();
-
- for (unsigned long j = inner_ndims + 1; j < ndims; ++j)
- {
- os << "_" << node->dims ()[j]->ev ()->u.ulval;
- }
-
- }
-
- os << "," << be_nl
- << node->dims ()[inner_ndims] << ");" << be_uidt_nl
- << be_uidt_nl;
-
- os << "::CORBA::TypeCode_ptr const tc_"
- << node->flat_name ();
-
- if (inner_ndims != 0)
- {
- // Only generate the array dimension sizes for the inner
- // dimensions, not the outermost (leftmost) one.
- for (unsigned long k = inner_ndims; k < ndims; ++k)
- {
- os << "_" << node->dims ()[k]->ev ()->u.ulval;
- }
- }
-
- os << " ="
- << be_idt_nl
- << "&" << node->flat_name ();
-
- for (unsigned long n = inner_ndims; n < ndims; ++n)
- {
- os << "_" << node->dims ()[n]->ev ()->u.ulval;
- }
-
- os << ";" << be_uidt;
-
- if (i < ndims - 1)
- {
- os << be_nl << be_nl;
- }
- }
-
- // Namespace end,
- this->gen_end_NS_for_anon ();
-
- os << be_global->core_versioning_end ();
-
- os << "\n#endif /* _TAO_TYPECODE_" << node->flat_name () << "_GUARD */"
- << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::visit_interface (be_interface * node)
-{
- // Only handle forward declared interfaces here. Defined interfaces
- // have their own TypeCode visitor.
- if (node->is_defined ())
- {
- return 0;
- }
-
- return this->gen_forward_declared_typecode (node);
-}
-
-int
-be_visitor_typecode_defn::visit_component (be_component *node)
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_typecode_defn::visit_interface_fwd (be_interface_fwd * node)
-{
- return this->gen_forward_declared_typecode (node);
-}
-
-int
-be_visitor_typecode_defn::visit_sequence (be_sequence * node)
-{
- be_type * const base = be_type::narrow_from_decl (node->base_type ());
-
- TAO_OutStream & os = *this->ctx_->stream ();
-
- os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // generate typecode for the base type
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED);
-
- // Generate typecode for the base type, being careful to avoid doing
- // so for a typedef since that could recursively cause multiple base
- // type TypeCode definitions to be generated.
- if (!base || (base->node_type () != AST_Decl::NT_typedef
- && base->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ACE_TEXT ("::visit_sequence) - ")
- ACE_TEXT ("failed to generate base typecode\n")),
- -1);
- }
-
- if (this->recursion_detect_)
- {
- return 0; // Nothing else to do.
- }
-
- // Multiple definition guards.
- // @todo Can we automate duplicate detection within the IDL compiler
- // itself?
- os << "\n#ifndef _TAO_TYPECODE_" << node->flat_name () << "_GUARD"
- << "\n#define _TAO_TYPECODE_" << node->flat_name () << "_GUARD"
- << be_nl;
-
- // Namespace begin.
-
- os << be_global->core_versioning_begin () << be_nl;
-
- this->gen_begin_NS_for_anon ();
-
- os << "TAO::TypeCode::Sequence< ::CORBA::TypeCode_ptr const *," << be_nl
- << " TAO::Null_RefCount_Policy>"
- << be_idt_nl
- << node->flat_name () << "_" << node->max_size()->ev ()->u.ulval
-
- << " (" << be_idt_nl
- << "::CORBA::tk_sequence," << be_nl
- << "&";
-
- if (this->gen_base_typecode_name (base) != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ACE_TEXT ("visit_sequence - ")
- ACE_TEXT ("problem generating base ")
- ACE_TEXT ("TypeCode name.\n")),
- -1);
- }
-
- os << "," << be_nl
- << node->max_size () << ");" << be_uidt_nl
- << be_uidt_nl;
-
- os << "::CORBA::TypeCode_ptr const tc_"
- << node->flat_name () << "_" << node->max_size()->ev ()->u.ulval << " ="
- << be_idt_nl
- << "&" << node->flat_name () << "_" << node->max_size()->ev ()->u.ulval
- << ";" << be_uidt;
-
- // Namespace end.
- this->gen_end_NS_for_anon ();
-
- os << be_global->core_versioning_end ();
-
- os << "\n#endif /* _TAO_TYPECODE_" << node->flat_name () << "_GUARD */"
- << be_nl << be_nl;
-
- return 0; // this->gen_typecode_ptr (node);
-}
-
-int
-be_visitor_typecode_defn::visit_string (be_string * node)
-{
- if (node->max_size ()->ev()->u.ulval == 0)
- {
- // No need to generate a TypeCode for unbounded strings. Just
- // use the {w}string TypeCode constant.
- return 0;
- }
-
- if (this->recursion_detect_)
- {
- return 0; // Nothing else to do.
- }
-
- TAO_OutStream & os = *this->ctx_->stream ();
-
- os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Multiple definition guards.
- // @todo Can we automate duplicate detection within the IDL compiler
- // itself?
- os << "\n#ifndef _TAO_TYPECODE_" << node->flat_name () << "_GUARD"
- << "\n#define _TAO_TYPECODE_" << node->flat_name () << "_GUARD" << be_nl;
-
- // Namespace begin.
-
- os << be_global->core_versioning_begin () << be_nl;
-
- this->gen_begin_NS_for_anon ();
-
- // Generate the TypeCode instantiation.
- os
- << "TAO::TypeCode::String<TAO::Null_RefCount_Policy>"
- << be_idt_nl
- << node->flat_name () << " (" << be_idt_nl
- << "::CORBA::tk_" << (node->width () == 1 ? "string" : "wstring") << ","
- << be_nl
- << node->max_size () << ");" << be_uidt_nl
- << be_uidt_nl;
-
- os << "::CORBA::TypeCode_ptr const tc_"
- << node->flat_name () << " ="
- << be_idt_nl
- << "&" << node->flat_name () << ";" << be_uidt;
-
- // Namespace end.
- this->gen_end_NS_for_anon ();
-
- os << be_global->core_versioning_end ();
-
- os << "\n#endif /* _TAO_TYPECODE_" << node->flat_name () << "_GUARD */"
- << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::visit_structure (be_structure * node)
-{
- // Handle only forward declared structures here. Defined structures
- // have their own TypeCode visitor.
- if (node->is_defined ())
- {
- return 0;
- }
-
- return this->gen_forward_declared_typecode (node);
-}
-
-int
-be_visitor_typecode_defn::visit_typedef (be_typedef * node)
-{
- // Only used for recursion detection.
-
- // The only base types with no-op visitors that will be potentially
- // visited are strings and sequences. All others have their own
- // full-fledged visitors (e.g. objref_typecode, etc.)
-
- be_type * const base = be_type::narrow_from_decl (node->base_type ());
-
- this->recursion_detect_ = true;
-
- // Generate typecode for the base type, being careful to avoid doing
- // so a for a typedef since that could recursively cause multiple
- // base type TypeCode definitions to be generated.
- if (!base || (base->accept (this) == -1))
- {
- this->recursion_detect_ = false;
-
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ACE_TEXT ("::visit_typedef) - ")
- ACE_TEXT ("failed to visit base typecode\n")),
- -1);
- }
-
- this->recursion_detect_ = false;
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::visit_union (be_union *node)
-{
- // Only handle forward declared unions here. Defined unions
- // have their own TypeCode visitor.
- if (node->is_defined ())
- {
- return 0;
- }
-
- return this->gen_forward_declared_typecode (node);
-}
-
-int
-be_visitor_typecode_defn::visit_valuetype (be_valuetype * node)
-{
- // Only handle forward declared valuetypes here. Defined valuetypes
- // have their own TypeCode visitor.
- if (node->is_defined ())
- {
- return 0;
- }
-
- return this->gen_forward_declared_typecode (node);
-}
-
-int
-be_visitor_typecode_defn::visit_eventtype (be_eventtype * node)
-{
- return this->visit_valuetype (node);
-}
-
-// post processing
-int
-be_visitor_typecode_defn::post_process (be_decl *)
-{
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN)
- {
- this->computed_scope_encap_len_ += this->computed_encap_len_;
- }
-
- return 0;
-}
-
-// scope stack routines
-int
-be_visitor_typecode_defn::push (ACE_CDR::Long val)
-{
- if (this->index_ >= TAO_BE_VISITOR_TYPECODE_DEFN_MAX_STACK_SIZE)
- {
- return -1;
- }
-
- this->scope_stack_ [++this->index_] = val;
- return 0;
-}
-
-int
-be_visitor_typecode_defn::pop (ACE_CDR::Long &val)
-{
- if (this->index_ < 0)
- {
- return -1;
- }
-
- val = this->scope_stack_[this->index_--];
- return 0;
-}
-
-const be_visitor_typecode_defn::QNode *
-be_visitor_typecode_defn::queue_insert (
- ACE_Unbounded_Queue <be_visitor_typecode_defn::QNode *> &queue,
- be_type *node,
- ACE_CDR::Long offset
- )
-{
- be_visitor_typecode_defn::QNode *qnode = 0;
-
- ACE_NEW_RETURN (qnode, be_visitor_typecode_defn::QNode, 0);
-
- qnode->node = node;
- qnode->offset = offset;
-
- if (queue.enqueue_tail (qnode) == -1)
- {
- delete qnode;
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ACE_TEXT ("::queue_insert - failed\n")),
- 0);
- }
-
- return qnode;
-}
-
-const be_visitor_typecode_defn::QNode *
-be_visitor_typecode_defn::queue_lookup (
- ACE_Unbounded_Queue <be_visitor_typecode_defn::QNode *> &queue,
- be_type *node
- )
-{
- for (ACE_Unbounded_Queue_Iterator<be_visitor_typecode_defn::QNode *>
- iter (queue);
- !iter.done ();
- iter.advance ())
- {
- be_visitor_typecode_defn::QNode **addr, *item;
- iter.next (addr);
- item = *addr;
-
- if (!ACE_OS::strcmp (item->node->full_name (),
- node->full_name ()))
- {
- // Found.
- return item;
- }
- }
-
- return 0;
-}
-
-void
-be_visitor_typecode_defn::
-queue_reset (ACE_Unbounded_Queue <be_visitor_typecode_defn::QNode *> & queue)
-{
- while (!queue.is_empty ())
- {
- be_visitor_typecode_defn::QNode * qnode = 0;
- (void) queue.dequeue_head (qnode);
- delete qnode;
- }
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/union_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/union_typecode.cpp
deleted file mode 100644
index fcc83155482..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typecode/union_typecode.cpp
+++ /dev/null
@@ -1,224 +0,0 @@
-// -*- C++ -*-
-
-//=============================================================================
-/**
- * @file union_typecode.cpp
- *
- * $Id$
- *
- * Union TypeCode generation visitor.
- *
- * @author Ossama Othman <ossama@dre.vanderbilt.edu>
- */
-//=============================================================================
-
-
-TAO::be_visitor_union_typecode::be_visitor_union_typecode (
- be_visitor_context * ctx)
- : be_visitor_typecode_defn (ctx)
- , is_recursive_ (false)
- , is_nested_ (false)
-{
-}
-
-int
-TAO::be_visitor_union_typecode::visit_union (be_union * node)
-{
- if (!node->is_defined ())
- return this->gen_forward_declared_typecode (node);
-
- // Check if we are repeated.
- be_visitor_typecode_defn::QNode const * const qnode =
- this->queue_lookup (this->tc_queue_, node);
-
- ACE_Unbounded_Queue<AST_Type *> recursion_queue;
- if (qnode
- && node->in_recursion (recursion_queue))
- {
- this->is_recursive_ = true;
-
- return 0;
- }
- else if (this->queue_insert (this->tc_queue_, node, 0) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_typecode::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
-
- if (this->recursion_detect_ || this->is_nested_)
- return 0;
-
- this->is_nested_ = true;
-
- TAO_OutStream & os = *this->ctx_->stream ();
-
- os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- be_type * const discriminant_type =
- be_type::narrow_from_decl (node->disc_type ());
-
- ACE_ASSERT (discriminant_type != 0);
-
- if (this->gen_case_typecodes (node) != 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "TAO::be_visitor_union_typecode::visit_union - "
- "Unable to generate union field "
- "TypeCodes.\n"),
- -1);
-
- if (this->visit_cases (node) != 0)
- return -1;
-
- static char const StringType[] = "char const *";
- static char const TypeCodeType[] = "::CORBA::TypeCode_ptr const *";
- static char const MemberArrayType[] =
- "TAO::TypeCode::Case<char const *, "
- "::CORBA::TypeCode_ptr const *> const * const *";
-
- // Generate the TypeCode instantiation.
- os << "static ";
-
- if (this->is_recursive_)
- {
- os << "TAO::TypeCode::Recursive_Type<" << be_idt_nl;
- }
-
- // -- TypeCodeBase --
- os
- << "TAO::TypeCode::Union<" << StringType << "," << be_nl
- << " " << TypeCodeType << "," << be_nl
- << " " << MemberArrayType << "," << be_nl
- << " TAO::Null_RefCount_Policy>";
-
- if (this->is_recursive_)
- {
- os << "," << be_nl
- << TypeCodeType << "," << be_nl
- << MemberArrayType << " >" << be_uidt_nl;
- }
-
- os
- << be_idt_nl
- << "_tao_tc_" << node->flat_name () << " (" << be_idt_nl
- << "\"" << node->repoID () << "\"," << be_nl
- << "\"" << node->original_local_name () << "\"," << be_nl
- << "&" << discriminant_type->tc_name () << "," << be_nl
- << "_tao_cases_" << node->flat_name () << "," << be_nl
- << node->nfields () << ", "
- << node->default_index () << ");" << be_uidt_nl
- << be_uidt_nl;
-
- if (this->gen_typecode_ptr (be_type::narrow_from_decl (node)) != 0)
- return -1;
-
- return 0;
-}
-
-int
-TAO::be_visitor_union_typecode::gen_case_typecodes (be_union * node)
-{
- AST_Field ** member_ptr = 0;
-
- size_t const count = node->nfields ();
-
- for (size_t i = 0; i < count; ++i)
- {
- node->field (member_ptr, i);
-
- be_type * const member_type =
- be_type::narrow_from_decl ((*member_ptr)->field_type ());
-
- if (this->is_typecode_generation_required (member_type))
- member_type->accept (this);
- }
-
- return 0;
-}
-
-int
-TAO::be_visitor_union_typecode::visit_cases (be_union * node)
-{
- // Generate array containing union case/branch characterstics.
-
- be_type * const discriminant_type =
- be_type::narrow_from_decl (node->disc_type ());
-
- static ACE_CString tao_cases ("_tao_cases_");
- ACE_CString const fields_name (tao_cases
- + node->flat_name ());
-
- TAO_OutStream & os = *this->ctx_->stream ();
-
- // Start with static instances of each array element-to-be.
- size_t const count = node->nfields ();
-
- for (size_t i = 0; i < count; ++i)
- {
- AST_Field ** member_ptr = 0;
-
- node->field (member_ptr, i);
-
- be_type * const type =
- be_type::narrow_from_decl ((*member_ptr)->field_type ());
-
- be_union_branch * const branch =
- be_union_branch::narrow_from_decl (*member_ptr);
-
- ACE_ASSERT (branch != 0);
-
- os << "static TAO::TypeCode::Case_T<"
- << discriminant_type->full_name () << ", "
- << "char const *, ::CORBA::TypeCode_ptr const *> const "
- << fields_name.c_str () << "__" << i <<" (";
-
- if (branch->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- // Non-default case.
-
- // Generate the label value. Only the first label value is
- // used in the case where multiple labels are used for the
- // same union branch/case.
- branch->gen_label_value (&os, 0);
- }
- else
- {
- // Default case.
-
- ACE_ASSERT (branch->label ()->label_kind ()
- == AST_UnionLabel::UL_default);
-
- branch->gen_default_label_value (&os, node);
- }
-
- os << ", \"" << branch->original_local_name () << "\", "
- << "&" << type->tc_name ()
- << ");" << be_nl;
- }
-
- // Now generate the TAO::TypeCode::Case array.
- os << be_nl
- << "static TAO::TypeCode::Case<char const *, ::CORBA::TypeCode_ptr const *> const * const "
- << fields_name.c_str ()
- << "[] =" << be_idt_nl
- << "{" << be_idt_nl;
-
- for (size_t n = 0; n < count; ++n)
- {
- os << "&" << fields_name.c_str () << "__" << n;
-
- if (n < count - 1)
- os << ",";
-
- os << be_nl;
- }
-
- os << be_uidt_nl
- << "};" << be_uidt_nl << be_nl;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/value_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/value_typecode.cpp
deleted file mode 100644
index 14516069c35..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typecode/value_typecode.cpp
+++ /dev/null
@@ -1,300 +0,0 @@
-// -*- C++ -*-
-
-//=============================================================================
-/**
- * @file value_typecode.cpp
- *
- * $Id$
- *
- * Structure TypeCode generation visitor.
- *
- * @author Ossama Othman <ossama@dre.vanderbilt.edu>
- */
-//=============================================================================
-
-TAO::be_visitor_value_typecode::be_visitor_value_typecode (
- be_visitor_context * ctx)
- : be_visitor_typecode_defn (ctx)
- , is_recursive_ (false)
- , is_nested_ (false)
-{
-}
-
-int
-TAO::be_visitor_value_typecode::visit_valuetype (be_valuetype * node)
-{
- if (!node->is_defined ())
- {
- return this->gen_forward_declared_typecode (node);
- }
-
- // Check if we are repeated.
- be_visitor_typecode_defn::QNode const * const qnode =
- this->queue_lookup (this->tc_queue_, node);
-
- ACE_Unbounded_Queue<AST_Type *> recursion_queue;
- if (qnode
- && node->in_recursion (recursion_queue))
- {
- this->is_recursive_ = true;
-
- return 0;
- }
- else if (this->queue_insert (this->tc_queue_, node, 0) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_value_typecode::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
-
- if (this->recursion_detect_ || this->is_nested_)
- {
- return 0;
- }
-
- this->is_nested_ = true;
-
- TAO_OutStream & os = *this->ctx_->stream ();
-
- os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- if (this->gen_member_typecodes (node) != 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "TAO::be_visitor_value_typecode::visit_valuetype - "
- "Unable to generate valuetype/eventtype field "
- "TypeCodes.\n"),
- -1);
- }
-
- size_t const count =
- node->data_members_count (AST_Field::vis_PUBLIC)
- + node->data_members_count (AST_Field::vis_PRIVATE);
-
- ACE_CString const fields_name (ACE_CString ("_tao_fields_")
- + node->flat_name ());
-
- // Generate array containing value field characteristics.
- os << "static TAO::TypeCode::Value_Field<char const *, "
- << "::CORBA::TypeCode_ptr const *> const ";
-
- if (count == 0)
- {
- os << "* const " << fields_name.c_str () << " = 0;" << be_nl;
- }
- else
- {
- os << fields_name.c_str () << "[] =" << be_idt_nl
- << "{" << be_idt_nl;
-
- if (this->visit_members (node) != 0)
- {
- return -1;
- }
-
- os << be_uidt_nl
- << "};" << be_uidt_nl;
- }
-
- // Generate the TypeCode instantiation.
-
- static char const StringType[] = "char const *";
- static char const TypeCodeType[] = "::CORBA::TypeCode_ptr const *";
- static char const MemberArrayType[] =
- "TAO::TypeCode::Value_Field<char const *, "
- "::CORBA::TypeCode_ptr const *> const *";
-
- os << "static ";
-
- if (this->is_recursive_)
- {
- os << "TAO::TypeCode::Recursive_Type<" << be_idt_nl;
- }
-
- // -- TypeCodeBase --
- os
- << "TAO::TypeCode::Value<" << StringType << "," << be_nl
- << " " << TypeCodeType << "," << be_nl
- << " " << MemberArrayType << "," << be_nl
- << " TAO::Null_RefCount_Policy>";
-
- if (this->is_recursive_)
- {
- os << "," << be_nl
- << TypeCodeType << "," << be_nl
- << MemberArrayType << " >" << be_uidt_nl;
- }
-
- os << be_idt_nl
- << "_tao_tc_" << node->flat_name () << " (" << be_idt_nl
- << "::CORBA::tk_"
- << (dynamic_cast<be_eventtype *> (node) ? "event" : "value")
- << "," << be_nl
- << "\"" << node->repoID () << "\"," << be_nl
- << "\"" << node->original_local_name () << "\"," << be_nl;
-
- // ValueModifier
- //
- // TAO doesn't support CUSTOM or TRUNCATABLE valuetypes. Go
- // with VM_NONE or VM_ABSTRACT.
- os << "::CORBA::"
- << (node->is_abstract () ? "VM_ABSTRACT" : "VM_NONE") << "," << be_nl;
-
- // Concrete base type.
- AST_ValueType * const concrete_base =
- node->inherits_concrete ();
-
- if (concrete_base)
- {
- be_type * const base_type =
- be_type::narrow_from_decl (concrete_base);
-
- ACE_ASSERT (base_type);
-
- os << "&" << base_type->tc_name () << "," << be_nl;
- }
- else
- {
- // No concrete base.
- os << "&::CORBA::_tc_null," << be_nl;
- }
-
- // Fields
- os << "_tao_fields_" << node->flat_name () << "," << be_nl
- << count << ");" << be_uidt_nl
- << be_uidt_nl;
-
- if (this->gen_typecode_ptr (be_type::narrow_from_decl (node)) != 0)
- return -1;
-
- return 0;
-}
-
-int
-TAO::be_visitor_value_typecode::gen_member_typecodes (be_valuetype * node)
-{
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next())
- {
- AST_Decl * const d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_value_typecode::"
- "gen_member_typecodes - "
- "bad node in this scope\n"),
- 0);
- }
-
- AST_Field * const field = AST_Field::narrow_from_decl (d);
-
- if (!field
- || field->visibility () == AST_Field::vis_NA)
- {
- continue;
- }
-
- be_type * const member_type =
- be_type::narrow_from_decl (field->field_type ());
-
- if (this->is_typecode_generation_required (member_type))
- {
- member_type->accept (this);
- }
- else if (member_type == static_cast<be_type *> (node))
- {
- this->is_recursive_ = true;
- }
- }
-
- return 0;
-}
-
-int
-TAO::be_visitor_value_typecode::visit_members (be_valuetype * node)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- size_t const count =
- node->data_members_count (AST_Field::vis_PUBLIC)
- + node->data_members_count (AST_Field::vis_PRIVATE);
-
- size_t i = 0;
-
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next())
- {
- AST_Decl * const d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_value_typecode::"
- "visit_members - "
- "bad node in this scope\n"), 0);
- }
-
- AST_Field * const field = AST_Field::narrow_from_decl (d);
-
- if (!field)
- {
- continue;
- }
-
- AST_Field::Visibility const vis = field->visibility ();
-
- if (vis == AST_Field::vis_NA)
- {
- continue;
- }
-
- be_decl * const member_decl =
- be_decl::narrow_from_decl (field);
-
- be_type * const member_type =
- be_type::narrow_from_decl (field->field_type ());
-
- os << "{ "
- << "\"" << member_decl->original_local_name () << "\", "
- << "&" << member_type->tc_name () << ", ";
-
- switch (vis)
- {
- case AST_Field::vis_PUBLIC:
- os << "::CORBA::PUBLIC_MEMBER";
- break;
-
- case AST_Field::vis_PRIVATE:
- os << "::CORBA::PRIVATE_MEMBER";
- break;
-
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_value_typecode::"
- "visit_members - "
- "Unknown valuetype member visibility: %d.\n",
- vis),
- -1);
- };
-
- os << " }";
-
- if (i < count - 1)
- {
- os << ",";
- }
-
- os << be_nl;
-
- ++i;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef.cpp b/TAO/TAO_IDL/be/be_visitor_typedef.cpp
deleted file mode 100644
index 1e3ebf45077..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_typedef.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Typedef
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_array.h"
-#include "be_enum.h"
-#include "be_interface.h"
-#include "be_interface_fwd.h"
-#include "be_module.h"
-#include "be_predefined_type.h"
-#include "be_sequence.h"
-#include "be_string.h"
-#include "be_structure.h"
-#include "be_type.h"
-#include "be_typedef.h"
-#include "be_union.h"
-#include "be_valuebox.h"
-#include "be_valuetype.h"
-#include "be_extern.h"
-#include "be_helper.h"
-
-#include "be_visitor_typedef.h"
-#include "be_visitor_array.h"
-#include "be_visitor_enum.h"
-#include "be_visitor_sequence.h"
-#include "be_visitor_structure.h"
-#include "be_visitor_typecode.h"
-#include "be_visitor_union.h"
-#include "be_visitor_context.h"
-#include "utl_identifier.h"
-#include "ace/Log_Msg.h"
-
-#include "be_visitor_typedef/typedef.cpp"
-#include "be_visitor_typedef/typedef_ch.cpp"
-#include "be_visitor_typedef/typedef_ci.cpp"
-#include "be_visitor_typedef/typedef_cs.cpp"
-#include "be_visitor_typedef/any_op_ch.cpp"
-#include "be_visitor_typedef/any_op_cs.cpp"
-#include "be_visitor_typedef/cdr_op_ch.cpp"
-#include "be_visitor_typedef/cdr_op_cs.cpp"
-#include "be_visitor_typedef/serializer_op_ch.cpp"
-#include "be_visitor_typedef/serializer_op_cs.cpp"
-
-ACE_RCSID (be,
- be_visitor_typedef,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/any_op_ch.cpp
deleted file mode 100644
index eff9fa07eb2..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/any_op_ch.cpp
+++ /dev/null
@@ -1,293 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators of a Typedef node
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_typedef,
- any_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Typedef visitor for generating Any operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_typedef_any_op_ch::be_visitor_typedef_any_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_typedef (ctx)
-{
-}
-
-be_visitor_typedef_any_op_ch::~be_visitor_typedef_any_op_ch (void)
-{
-}
-
-int
-be_visitor_typedef_any_op_ch::visit_typedef (be_typedef *node)
-{
- if (node->cli_hdr_any_op_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // generate the Any <<= and >>= operator declarations
- // Any <<= and >>= operators
- os->indent ();
-
- // In general, we may have a chain of typedefs. i.e.,
- // typedef sequence<long> X;
- // typedef X Y;
- // typedef Y Z; and so on
- // The first time we will be in will be for node Z for which the code
- // generation has to take place. However, it is not enough to just generate
- // code that looks like -
- // typedef Y Z;
- // For different types (in this case we have a sequence), we will need
- // typedefs for the _var and _out types for Z. If it had been an array, we
- // will additionally have the _forany type as well as inlined *_alloc, _dup,
- // and _free methods.
- //
- // Finally, we need to differentiate between the case where we were
- // generating code for
- // typedef sequence<long> X; and
- // typedef Y Z; where Y was somehow aliased to the sequence. In the former
- // case, we will need to generate all the code for sequence<long> or whatever
- // the type maybe. In the latter, we just need typedefs for the type and all
- // associated _var, _out, and other types.
-
- be_type *bt; // base type
-
- if (this->ctx_->tdef ())
- {
- // The fact that we are here indicates that we were generating code for a
- // typedef node whose base type also happens to be another typedef-ed
- // (i.e. an alias) node for another (possibly alias) node.
-
- this->ctx_->alias (node); // save this alias
-
- // Grab the most primitive base type in the chain to avoid recusrsively.
- // going thru this visit method
- bt = node->primitive_base_type ();
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_ch::"
- "visit_typedef - "
- "bad primitive base type\n"),
- -1);
- }
-
- // accept on this base type, but generate code for the typedef node
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_ch::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
- this->ctx_->alias (0); // reset
- }
- else
- {
- // The context has not stored any "tdef" node. So we must be in here for
- // the first time.
- this->ctx_->tdef (node); // save the typedef node
-
- // Grab the immediate base type node.
- bt = node->primitive_base_type ();
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_ch::"
- "visit_typedef - "
- "bad base type\n"),
- -1);
- }
-
- // Accept on this base type, but generate code for the typedef node.
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_ch::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- this->ctx_->tdef (0); // reset
- }
-
- node->cli_hdr_any_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_typedef_any_op_ch::visit_array (be_array *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!bt->imported () &&
- bt->node_type () == AST_Decl::NT_array)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_array (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_ch::"
- "visit_array - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_any_op_ch::visit_enum (be_enum *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_enum)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_enum (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_ch::"
- "visit_enum - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_any_op_ch::visit_sequence (be_sequence *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_sequence (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_ch::"
- "visit_sequence - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_any_op_ch::visit_structure (be_structure *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_struct)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_structure (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_ch::"
- "visit_structure - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_any_op_ch::visit_union (be_union *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_union)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_union (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_ch::"
- "visit_union - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/any_op_cs.cpp
deleted file mode 100644
index 9e01f31dc19..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/any_op_cs.cpp
+++ /dev/null
@@ -1,275 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators in the client stubs
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_typedef,
- any_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Typedef visitor for generating Any operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_typedef_any_op_cs::be_visitor_typedef_any_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_typedef (ctx)
-{
-}
-
-be_visitor_typedef_any_op_cs::~be_visitor_typedef_any_op_cs (void)
-{
-}
-
-int
-be_visitor_typedef_any_op_cs::visit_typedef (be_typedef *node)
-{
- if (node->cli_stub_any_op_gen () || node->imported ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // generate the Any <<= and >>= operator declarations
- // Any <<= and >>= operators
- os->indent ();
-
- // In general, we may have a chain of typedefs. i.e.,
- // typedef sequence<long> X;
- // typedef X Y;
- // typedef Y Z; and so on
- // The first time we will be in will be for node Z for which the code
- // generation has to take place. However, it is not enough to just generate
- // code that looks like -
- // typedef Y Z;
- // For different types (in this case we have a sequence), we will need
- // typedefs for the _var and _out types for Z. If it had been an array, we
- // will additionally have the _forany type as well as inlined *_alloc, _dup,
- // and _free methods.
- //
- // Finally, we need to differentiate between the case where we were
- // generating code for
- // typedef sequence<long> X; and
- // typedef Y Z; where Y was somehow aliased to the sequence. In the former
- // case, we will need to generate all the code for sequence<long> or whatever
- // the type maybe. In the latter, we just need typedefs for the type and all
- // associated _var, _out, and other types.
-
- be_type *bt; // base type
-
- if (this->ctx_->tdef ())
- {
- // the fact that we are here indicates that we were generating code for a
- // typedef node whose base type also happens to be another typedef-ed
- // (i.e. an alias) node for another (possibly alias) node
-
- this->ctx_->alias (node); // save this alias
-
- // grab the most primitive base type in the chain to avoid recusrsively
- // going thru this visit method
- bt = node->primitive_base_type ();
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_cs::"
- "visit_typedef - "
- "bad primitive base type\n"
- ), -1);
- }
-
- // accept on this base type, but generate code for the typedef node
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_cs::"
- "visit_typedef - "
- "failed to accept visitor\n"
- ), -1);
- }
- this->ctx_->alias (0); // reset
- }
- else
- {
- // the context has not stored any "tdef" node. So we must be in here for
- // the first time
- this->ctx_->tdef (node); // save the typedef node
-
- // grab the immediate base type node
- bt = be_type::narrow_from_decl (node->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_cs::"
- "visit_typedef - "
- "bad base type\n"
- ), -1);
- }
-
- // accept on this base type, but generate code for the typedef node
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_cs::"
- "visit_typedef - "
- "failed to accept visitor\n"
- ), -1);
- }
-
- this->ctx_->tdef (0); // reset
- }
-
- node->cli_stub_any_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_typedef_any_op_cs::visit_array (be_array *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (!bt->imported () &&
- bt->node_type () == AST_Decl::NT_array) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_array (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_cs::"
- "visit_array - "
- "base class visitor failed \n"
- ), -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_any_op_cs::visit_enum (be_enum *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (bt->node_type () == AST_Decl::NT_enum) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_enum (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_cs::"
- "visit_enum - "
- "base class visitor failed \n"
- ), -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_any_op_cs::visit_sequence (be_sequence *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (bt->node_type () == AST_Decl::NT_sequence) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_sequence (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_cs::"
- "visit_sequence - "
- "base class visitor failed \n"
- ), -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_any_op_cs::visit_structure (be_structure *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (bt->node_type () == AST_Decl::NT_struct) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_structure (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_cs::"
- "visit_structure - "
- "base class visitor failed \n"
- ), -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_any_op_cs::visit_union (be_union *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (bt->node_type () == AST_Decl::NT_union) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_union (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_any_op_cs::"
- "visit_union - "
- "base class visitor failed \n"
- ), -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp
deleted file mode 100644
index e27d1750d14..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp
+++ /dev/null
@@ -1,293 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Cdr operators of a Typedef node
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_typedef,
- cdr_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Typedef visitor for generating Cdr operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_typedef_cdr_op_ch::be_visitor_typedef_cdr_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_typedef (ctx)
-{
-}
-
-be_visitor_typedef_cdr_op_ch::~be_visitor_typedef_cdr_op_ch (void)
-{
-}
-
-int
-be_visitor_typedef_cdr_op_ch::visit_typedef (be_typedef *node)
-{
- if (node->cli_hdr_cdr_op_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate the CDR << and >> operator declarations.
- os->indent ();
-
- // In general, we may have a chain of typedefs. i.e.,
- // typedef sequence<long> X;
- // typedef X Y;
- // typedef Y Z; and so on
- // The first time we will be in will be for node Z for which the code
- // generation has to take place. However, it is not enough to just generate
- // code that looks like -
- // typedef Y Z;
- // For different types (in this case we have a sequence), we will need
- // typedefs for the _var and _out types for Z. If it had been an array, we
- // will additionally have the _forcdr type as well as inlined *_alloc, _dup,
- // and _free methods.
- //
- // Finally, we need to differentiate between the case where we were
- // generating code for
- // typedef sequence<long> X; and
- // typedef Y Z; where Y was somehow aliased to the sequence. In the former
- // case, we will need to generate all the code for sequence<long> or whatever
- // the type maybe. In the latter, we just need typedefs for the type and all
- // associated _var, _out, and other types.
-
- be_type *bt; // base type
-
- if (this->ctx_->tdef ())
- {
- // The fact that we are here indicates that we were generating code for a
- // typedef node whose base type also happens to be another typedef-ed
- // (i.e. an alias) node for another (possibly alias) node.
-
- this->ctx_->alias (node); // save this alias
-
- // Grab the most primitive base type in the chain to avoid recusrsively
- // going thru this visit method.
- bt = node->primitive_base_type ();
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_ch::"
- "visit_typedef - "
- "bad primitive base type\n"),
- -1);
- }
-
- // Accept on this base type, but generate code for the typedef node.
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_ch::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- this->ctx_->alias (0); // reset
- }
- else
- {
- // The context has not stored cdr "tdef" node. So we must be in here for
- // the first time.
- this->ctx_->tdef (node); // save the typedef node
-
- // Grab the immediate base type node.
- bt = be_type::narrow_from_decl (node->base_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_ch::"
- "visit_typedef - "
- "bad base type\n"),
- -1);
- }
-
- // Accept on this base type, but generate code for the typedef node.
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_ch::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- this->ctx_->tdef (0);
- }
-
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_typedef_cdr_op_ch::visit_array (be_array *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!bt->imported () &&
- bt->node_type () == AST_Decl::NT_array)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_array (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_ch::"
- "visit_array - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_cdr_op_ch::visit_enum (be_enum *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_enum)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_enum (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_ch::"
- "visit_enum - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_cdr_op_ch::visit_sequence (be_sequence *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_sequence (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_ch::"
- "visit_sequence - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_cdr_op_ch::visit_structure (be_structure *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_struct)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_structure (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_ch::"
- "visit_structure - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_cdr_op_ch::visit_union (be_union *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_union)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_union (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_op_ch::"
- "visit_union - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp
deleted file mode 100644
index ba1e87f43be..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Cdr operators in the client stubs
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_typedef,
- cdr_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Typedef visitor for generating CDR operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_typedef_cdr_op_cs::be_visitor_typedef_cdr_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_typedef (ctx)
-{
-}
-
-be_visitor_typedef_cdr_op_cs::~be_visitor_typedef_cdr_op_cs (void)
-{
-}
-
-int
-be_visitor_typedef_cdr_op_cs::visit_typedef (be_typedef *node)
-{
- if (node->cli_stub_cdr_op_gen () || node->imported ())
- {
- return 0;
- }
-
- // In general, we may have a chain of typedefs. i.e.,
- // typedef sequence<long> X;
- // typedef X Y;
- // typedef Y Z; and so on
- // The first time we will be in will be for node Z for which the code
- // generation has to take place. However, it is not enough to just generate
- // code that looks like -
- // typedef Y Z;
- // For different types (in this case we have a sequence), we will need
- // typedefs for the _var and _out types for Z. If it had been an array, we
- // will additionally have the _forcdr type as well as inlined *_alloc, _dup,
- // and _free methods.
- //
- // Finally, we need to differentiate between the case where we were
- // generating code for
- // typedef sequence<long> X; and
- // typedef Y Z; where Y was somehow aliased to the sequence. In the former
- // case, we will need to generate all the code for sequence<long> or whatever
- // the type maybe. In the latter, we just need typedefs for the type and all
- // associated _var, _out, and other types.
-
- be_type *bt; // base type
-
- if (this->ctx_->tdef ())
- {
- // the fact that we are here indicates that we were generating code for a
- // typedef node whose base type also happens to be another typedef-ed
- // (i.e. an alias) node for another (possibly alias) node
-
- this->ctx_->alias (node); // save this alias
-
- // grab the most primitive base type in the chain to avoid recusrsively
- // going thru this visit method
- bt = node->primitive_base_type ();
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_cs::"
- "visit_typedef - "
- "bad primitive base type\n"),
- -1);
- }
-
- // accept on this base type, but generate code for the typedef node
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_cs::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- this->ctx_->alias (0); // reset
- }
- else
- {
- // the context has not stored cdr "tdef" node. So we must be in here for
- // the first time
- this->ctx_->tdef (node); // save the typedef node
-
- // grab the immediate base type node
- bt = be_type::narrow_from_decl (node->base_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_cs::"
- "visit_typedef - "
- "bad base type\n"),
- -1);
- }
-
- // accept on this base type, but generate code for the typedef node
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_cs::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- this->ctx_->tdef (0); // reset
- }
-
- node->cli_stub_cdr_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_typedef_cdr_op_cs::visit_array (be_array *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!bt->imported () &&
- bt->node_type () == AST_Decl::NT_array) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_array (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_cs::"
- "visit_array - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_cdr_op_cs::visit_sequence (be_sequence *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_sequence) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_sequence (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_cs::"
- "visit_sequence - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_cdr_op_cs::visit_structure (be_structure *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_struct) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_structure (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_cs::"
- "visit_structure - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_cdr_op_cs::visit_union (be_union *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_union) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_union (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cdr_op_cs::"
- "visit_union - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/serializer_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/serializer_op_ch.cpp
deleted file mode 100644
index 0c13f01a375..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/serializer_op_ch.cpp
+++ /dev/null
@@ -1,294 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for TAO::DCPS::Serializer operators
-// of a Typedef node
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_typedef,
- serializer_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Typedef visitor for generating Serializer operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_typedef_serializer_op_ch::be_visitor_typedef_serializer_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_typedef (ctx)
-{
-}
-
-be_visitor_typedef_serializer_op_ch::~be_visitor_typedef_serializer_op_ch (void)
-{
-}
-
-int
-be_visitor_typedef_serializer_op_ch::visit_typedef (be_typedef *node)
-{
- if (node->cli_hdr_serializer_op_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate the Serializer << and >> operator declarations.
- os->indent ();
-
- // In general, we may have a chain of typedefs. i.e.,
- // typedef sequence<long> X;
- // typedef X Y;
- // typedef Y Z; and so on
- // The first time we will be in will be for node Z for which the code
- // generation has to take place. However, it is not enough to just generate
- // code that looks like -
- // typedef Y Z;
- // For different types (in this case we have a sequence), we will need
- // typedefs for the _var and _out types for Z. If it had been an array, we
- // will additionally have the _forcdr type as well as inlined *_alloc, _dup,
- // and _free methods.
- //
- // Finally, we need to differentiate between the case where we were
- // generating code for
- // typedef sequence<long> X; and
- // typedef Y Z; where Y was somehow aliased to the sequence. In the former
- // case, we will need to generate all the code for sequence<long> or whatever
- // the type maybe. In the latter, we just need typedefs for the type and all
- // associated _var, _out, and other types.
-
- be_type *bt; // base type
-
- if (this->ctx_->tdef ())
- {
- // The fact that we are here indicates that we were generating code for a
- // typedef node whose base type also happens to be another typedef-ed
- // (i.e. an alias) node for another (possibly alias) node.
-
- this->ctx_->alias (node); // save this alias
-
- // Grab the most primitive base type in the chain to avoid recusrsively
- // going thru this visit method.
- bt = node->primitive_base_type ();
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_ch::"
- "visit_typedef - "
- "bad primitive base type\n"),
- -1);
- }
-
- // Accept on this base type, but generate code for the typedef node.
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_ch::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- this->ctx_->alias (0); // reset
- }
- else
- {
- // The context has not stored cdr "tdef" node. So we must be in here for
- // the first time.
- this->ctx_->tdef (node); // save the typedef node
-
- // Grab the immediate base type node.
- bt = be_type::narrow_from_decl (node->base_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_ch::"
- "visit_typedef - "
- "bad base type\n"),
- -1);
- }
-
- // Accept on this base type, but generate code for the typedef node.
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_ch::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- this->ctx_->tdef (0);
- }
-
- node->cli_hdr_serializer_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_typedef_serializer_op_ch::visit_array (be_array *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!bt->imported () &&
- bt->node_type () == AST_Decl::NT_array)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_array (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_ch::"
- "visit_array - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_serializer_op_ch::visit_enum (be_enum *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_enum)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_enum (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_ch::"
- "visit_enum - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_serializer_op_ch::visit_sequence (be_sequence *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_sequence (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_ch::"
- "visit_sequence - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_serializer_op_ch::visit_structure (be_structure *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_struct)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_structure (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_ch::"
- "visit_structure - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_serializer_op_ch::visit_union (be_union *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_union)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_union (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_op_ch::"
- "visit_union - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/serializer_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/serializer_op_cs.cpp
deleted file mode 100644
index 345dc70a1f3..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/serializer_op_cs.cpp
+++ /dev/null
@@ -1,264 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for TAO::DCPS::Serializer operators
-// in the client stubs
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_typedef,
- serializer_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Typedef visitor for generating Serializer operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_typedef_serializer_op_cs::be_visitor_typedef_serializer_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_typedef (ctx)
-{
-}
-
-be_visitor_typedef_serializer_op_cs::~be_visitor_typedef_serializer_op_cs (void)
-{
-}
-
-int
-be_visitor_typedef_serializer_op_cs::visit_typedef (be_typedef *node)
-{
- if (node->cli_stub_serializer_op_gen () || node->imported ())
- {
- return 0;
- }
-
- // In general, we may have a chain of typedefs. i.e.,
- // typedef sequence<long> X;
- // typedef X Y;
- // typedef Y Z; and so on
- // The first time we will be in will be for node Z for which the code
- // generation has to take place. However, it is not enough to just generate
- // code that looks like -
- // typedef Y Z;
- // For different types (in this case we have a sequence), we will need
- // typedefs for the _var and _out types for Z. If it had been an array, we
- // will additionally have the _forcdr type as well as inlined *_alloc, _dup,
- // and _free methods.
- //
- // Finally, we need to differentiate between the case where we were
- // generating code for
- // typedef sequence<long> X; and
- // typedef Y Z; where Y was somehow aliased to the sequence. In the former
- // case, we will need to generate all the code for sequence<long> or whatever
- // the type maybe. In the latter, we just need typedefs for the type and all
- // associated _var, _out, and other types.
-
- be_type *bt; // base type
-
- if (this->ctx_->tdef ())
- {
- // the fact that we are here indicates that we were generating code for a
- // typedef node whose base type also happens to be another typedef-ed
- // (i.e. an alias) node for another (possibly alias) node
-
- this->ctx_->alias (node); // save this alias
-
- // grab the most primitive base type in the chain to avoid recusrsively
- // going thru this visit method
- bt = node->primitive_base_type ();
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_cs::"
- "visit_typedef - "
- "bad primitive base type\n"),
- -1);
- }
-
- // accept on this base type, but generate code for the typedef node
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_cs::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- this->ctx_->alias (0); // reset
- }
- else
- {
- // the context has not stored cdr "tdef" node. So we must be in here for
- // the first time
- this->ctx_->tdef (node); // save the typedef node
-
- // grab the immediate base type node
- bt = be_type::narrow_from_decl (node->base_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_cs::"
- "visit_typedef - "
- "bad base type\n"),
- -1);
- }
-
- // accept on this base type, but generate code for the typedef node
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_cs::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- this->ctx_->tdef (0); // reset
- }
-
- node->cli_stub_serializer_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_typedef_serializer_op_cs::visit_array (be_array *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!bt->imported () &&
- bt->node_type () == AST_Decl::NT_array) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_array (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_cs::"
- "visit_array - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_serializer_op_cs::visit_sequence (be_sequence *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_sequence) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_sequence (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_cs::"
- "visit_sequence - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_serializer_op_cs::visit_structure (be_structure *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_struct) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_structure (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_cs::"
- "visit_structure - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_serializer_op_cs::visit_union (be_union *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_union) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_union (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_serializer_op_cs::"
- "visit_union - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp
deleted file mode 100644
index 001de4594ab..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp
+++ /dev/null
@@ -1,480 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// typedef.cpp
-//
-// = DESCRIPTION
-// Generic visitor generating code for Typedefs
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_typedef,
- typedef,
- "$Id$")
-
-// ******************************************************
-// Generic typedef visitor.
-// ******************************************************
-
-be_visitor_typedef::be_visitor_typedef (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_typedef::~be_visitor_typedef (void)
-{
-}
-
-int be_visitor_typedef::visit_typedef (be_typedef *)
-{
- return -1; // Must be overridden.
-}
-
-// All common visit methods for typedef visitor.
-
-int
-be_visitor_typedef::visit_array (be_array *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- ctx.state (TAO_CodeGen::TAO_ARRAY_CH);
- be_visitor_array_ch visitor (&ctx);
- status = node->accept (&visitor);
- ctx.state (TAO_CodeGen::TAO_ROOT_CH);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_array_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_array_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_array_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_array_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_array_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_array_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- be_visitor_array_serializer_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_array_serializer_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_array - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_array - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef::visit_enum (be_enum *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_enum_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_enum_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_enum_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_enum_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_enum_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_enum_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- be_visitor_enum_serializer_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_enum_serializer_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_enum - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_enum - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef::visit_sequence (be_sequence *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_sequence_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_sequence_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_sequence_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_sequence_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_sequence_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_sequence_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- be_visitor_sequence_serializer_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_sequence_serializer_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_sequence - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_sequence - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-// visit an structure
-int
-be_visitor_typedef::visit_structure (be_structure *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_structure_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_structure_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_structure_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_structure_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_structure_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_structure_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_structure_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- be_visitor_structure_serializer_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_structure_serializer_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_structure - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_structure - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef::visit_union (be_union *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- case TAO_CodeGen::TAO_INTERFACE_CH:
- {
- be_visitor_union_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_union_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_union_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_union_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_union_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_union_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_union_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- be_visitor_union_serializer_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_union_serializer_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_union - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_union - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp
deleted file mode 100644
index 1b0731237b2..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp
+++ /dev/null
@@ -1,649 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// typedef_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Typedef in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID(be_visitor_typedef,
- typedef_ch,
- "$Id$")
-
-// ******************************************************
-// Typedef visitor for client header
-// ******************************************************
-
-be_visitor_typedef_ch::be_visitor_typedef_ch (be_visitor_context *ctx)
- : be_visitor_typedef (ctx)
-{
-}
-
-be_visitor_typedef_ch::~be_visitor_typedef_ch (void)
-{
-}
-
-int
-be_visitor_typedef_ch::visit_typedef (be_typedef *node)
-{
- // In general, we may have a chain of typedefs. i.e.,
- // typedef sequence<long> X;
- // typedef X Y;
- // typedef Y Z; and so on
- // The first time we will be in will be for node Z for which the code
- // generation has to take place. However, it is not enough to just generate
- // code that looks like -
- // typedef Y Z;
- // For different types (in this case we have a sequence), we will need
- // typedefs for the _var and _out types for Z. If it had been an array, we
- // will additionally have the _forany type as well as inlined *_alloc, _dup,
- // and _free methods.
- //
- // Finally, we need to differentiate between the case where we were
- // generating code for
- // typedef sequence<long> X; and
- // typedef Y Z; where Y was somehow aliased to the sequence. In the former
- // case, we will need to generate all the code for sequence<long> or whatever
- // the type maybe. In the latter, we just need typedefs for the type and all
- // associated _var, _out, and other types.
-
- be_type *bt;
-
- if (this->ctx_->tdef ())
- {
- // The fact that we are here indicates that we were generating code for
- // a typedef node whose base type also happens to be another typedefed
- // (i.e. an alias) node for another (possibly alias) node.
-
- this->ctx_->alias (node);
-
- // Grab the most primitive base type in the chain to avoid recusrsively
- // going thru this visit method.
- bt = node->primitive_base_type ();
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_typedef - "
- "bad primitive base type\n"),
- -1);
- }
-
- // Accept on this base type, but generate code for the typedef node.
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- }
- else
- {
- // The context has not stored any "tdef" node. So we must be in here for
- // the first time.
- this->ctx_->tdef (node);
-
- // Grab the immediate base type node.
- bt = be_type::narrow_from_decl (node->base_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_typedef - "
- "bad base type\n"),
- -1);
- }
-
- // accept on this base type, but generate code for the typedef node.
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- // Generate the typecode decl for this typedef node.
- if (!node->imported () && be_global->tc_support ())
- {
- be_visitor_context ctx (*this->ctx_);
- be_visitor_typecode_decl visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_typedef - "
- "TypeCode declaration failed\n"),
- -1);
- }
- }
-
- this->ctx_->tdef (0);
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_typedef *tdef = this->ctx_->tdef ();
- be_decl *scope = this->ctx_->scope ();
- be_type *bt;
-
- // Is the base type an alias to an array node or an actual array node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- // Is our base type an array node? If so, generate code for that array node.
- // In the first layer of typedef for an array, cli_hdr_gen() causes us to
- // skip all the code reached from the first branch. Then the ELSE branch is
- // skipped and we fail to generate any typedefs for that node. Adding the
- // check for cli_hdr_gen() to the IF statement keeps it in. Subsequent
- // layers of typedef, if any, assign the context alias to bt, so we go
- // straight to the ELSE branch.
- if (bt->node_type () == AST_Decl::NT_array && bt->cli_hdr_gen () == 0)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_array (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_array - "
- "base class visitor failed \n"),
- -1);
- }
- }
- else
- {
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Base type is simply an alias to an array node. Simply output the
- // required typedefs.
-
- // Typedef the type and the _slice type.
- *os << "typedef " << bt->nested_type_name (scope)
- << " " << tdef->nested_type_name (scope) << ";" << be_nl;
- *os << "typedef " << bt->nested_type_name (scope, "_slice")
- << " " << tdef->nested_type_name (scope, "_slice") << ";" << be_nl;
- // Typedef the _var, _out, _tag types.
- *os << "typedef " << bt->nested_type_name (scope, "_var")
- << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl;
- *os << "typedef " << bt->nested_type_name (scope, "_out")
- << " " << tdef->nested_type_name (scope, "_out") << ";" << be_nl;
- *os << "typedef " << bt->nested_type_name (scope, "_tag")
- << " " << tdef->nested_type_name (scope, "_tag") << ";" << be_nl;
- *os << "typedef " << bt->nested_type_name (scope, "_forany")
- << " " << tdef->nested_type_name (scope, "_forany") << ";" << be_nl;
-
- // The _alloc, _dup, copy, and free methods
-
- // Since the function nested_type_name() contains a static buffer,
- // we can have only one call to it from any instantiation per stream
- // output statement.
-
- const char *static_decl = "";
- AST_Module *scope = AST_Module::narrow_from_scope (tdef->defined_in ());
-
- // If the typedef is not declared globally or in a module, the
- // associated array memory management function must be static.
- if (scope == 0)
- {
- static_decl = "static ";
- }
-
- const char *td_name = tdef->nested_type_name (scope);
-
- // If the array and the typedef are both declared inside
- // an interface or valuetype, for example, nested_type_name()
- // generates the scoped name, which, for the header file,
- // causes problems with some compilers. If the array and
- // the typedef are in different scopes of a reopened
- // module, nested_type_name() will generate the local
- // name for each, which is ok.
- if (tdef->defined_in () == node->defined_in ())
- {
- td_name = tdef->local_name ()->get_string ();
- }
-
- // _alloc
- *os << be_nl
- << "ACE_INLINE " << static_decl << be_nl
- << td_name << "_slice *" << be_nl
- << td_name << "_alloc (void);" << be_nl;
- // _dup
- *os << be_nl
- << "ACE_INLINE " << static_decl << be_nl
- << td_name << "_slice *" << be_nl
- << td_name << "_dup (" << be_idt << be_idt_nl
- << "const " << td_name << "_slice *_tao_slice" << be_uidt_nl
- << ");" << be_uidt_nl;
- // _copy
- *os << be_nl
- << "ACE_INLINE " << static_decl << be_nl
- << "void " << td_name << "_copy (" << be_idt << be_idt_nl
- << td_name << "_slice *_tao_to," << be_nl
- << "const " << td_name << "_slice *_tao_from" << be_uidt_nl
- << ");" << be_uidt_nl;
- // _free
- *os << be_nl
- << "ACE_INLINE " << static_decl << be_nl
- << "void " << td_name << "_free (" << be_idt << be_idt_nl
- << td_name << "_slice *_tao_slice" << be_uidt_nl
- << ");" << be_uidt;
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_typedef *tdef = this->ctx_->tdef ();
- be_decl *scope = this->ctx_->scope ();
- be_type *bt;
-
- // Typedef of a typedef?
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_enum)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_enum (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_enum - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // typedef the type and the _slice type.
- *os << "typedef " << bt->nested_type_name (scope)
- << " " << tdef->nested_type_name (scope) << ";" << be_nl;
- // Typedef the _out
- *os << "typedef " << bt->nested_type_name (scope, "_out")
- << " " << tdef->nested_type_name (scope, "_out") << ";";
-
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_typedef *tdef = this->ctx_->tdef ();
- be_decl *scope = this->ctx_->scope ();
- be_type *bt;
-
- // Typedef of a typedef?
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Typedef the object.
- *os << "typedef " << bt->nested_type_name (scope) << " "
- << tdef->nested_type_name (scope) << ";" << be_nl;
-
- // Typedef the _ptr.
- *os << "typedef " << bt->nested_type_name (scope, "_ptr")
- << " " << tdef->nested_type_name (scope, "_ptr") << ";" << be_nl;
-
- // Typedef the _var.
- *os << "typedef " << bt->nested_type_name (scope, "_var")
- << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl;
-
- // typedef the _out
- *os << "typedef " << bt->nested_type_name (scope, "_out")
- << " " << tdef->nested_type_name (scope, "_out") << ";" << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_interface_fwd (be_interface_fwd *)
-{
-// be_interface *fd =
-// be_interface::narrow_from_decl (node->full_definition ());
-// return this->visit_interface (fd);
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_typedef *tdef = this->ctx_->tdef ();
- be_decl *scope = this->ctx_->scope ();
- be_type *bt;
-
- // Typedef of a typedef?
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Typedef the type.
- *os << "typedef " << bt->nested_type_name (scope)
- << " " << tdef->nested_type_name (scope) << ";" << be_nl;
-
- AST_PredefinedType::PredefinedType pt = node->pt ();
-
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_any
- || pt == AST_PredefinedType::PT_object)
- {
- // Typedef the _ptr and _var.
- *os << "typedef " << bt->nested_type_name (scope, "_ptr")
- << " " << tdef->nested_type_name (scope, "_ptr") << ";" << be_nl;
- *os << "typedef " << bt->nested_type_name (scope, "_var")
- << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl;
- }
-
- // Typedef the _out.
- *os << "typedef " << bt->nested_type_name (scope, "_out")
- << " " << tdef->nested_type_name (scope, "_out") << ";";
-
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_typedef *tdef = this->ctx_->tdef ();
- be_decl *scope = this->ctx_->scope ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- if (node->width () == (long) sizeof (char))
- {
- *os << "typedef char *"
- << " " << tdef->nested_type_name (scope) << ";" << be_nl;
- // Typedef the _var and _out types.
- *os << "typedef ::CORBA::String_var"
- << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl;
- *os << "typedef ::CORBA::String_out"
- << " " << tdef->nested_type_name (scope, "_out") << ";";
- }
- else
- {
- *os << "typedef ::CORBA::WChar *"
- << " " << tdef->nested_type_name (scope) << ";" << be_nl;
- // Typedef the _var and _out types.
- *os << "typedef ::CORBA::WString_var"
- << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl;
- *os << "typedef ::CORBA::WString_out"
- << " " << tdef->nested_type_name (scope, "_out") << ";";
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_typedef *tdef = this->ctx_->tdef ();
- be_decl *scope = this->ctx_->scope ();
- be_type *bt;
-
- // Typedef of a typedef?
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_sequence (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_sequence - "
- "base class visitor failed \n"),
- -1);
- }
- }
- else
- {
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Typedef the type.
- *os << "typedef " << bt->nested_type_name (scope)
- << " " << tdef->nested_type_name (scope) << ";" << be_nl;
- // Typedef the _var and _out types.
- *os << "typedef " << bt->nested_type_name (scope, "_var")
- << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl;
- *os << "typedef " << bt->nested_type_name (scope, "_out")
- << " " << tdef->nested_type_name (scope, "_out") << ";";
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_typedef *tdef = this->ctx_->tdef ();
- be_decl *scope = this->ctx_->scope ();
- be_type *bt;
-
- // Typedef of a typedef?
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_struct)
- {
- // Let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_structure (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_structure - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Typedef the type.
- *os << "typedef " << bt->nested_type_name (scope)
- << " " << tdef->nested_type_name (scope) << ";" << be_nl;
- // typedef the _var and _out types.
- *os << "typedef " << bt->nested_type_name (scope, "_var")
- << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl;
- *os << "typedef " << bt->nested_type_name (scope, "_out")
- << " " << tdef->nested_type_name (scope, "_out") << ";";
-
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_typedef *tdef = this->ctx_->tdef ();
- be_decl *scope = this->ctx_->scope ();
- be_type *bt;
-
- // Typedef of a typedef?
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_union)
- {
- // Let the base class visitor handle this case.
- if (this->be_visitor_typedef::visit_union (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_union - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Typedef the type.
- *os << "typedef " << bt->nested_type_name (scope)
- << " " << tdef->nested_type_name (scope) << ";" << be_nl;
- // Typedef the _var and _out types.
- *os << "typedef " << bt->nested_type_name (scope, "_var")
- << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl;
- *os << "typedef " << bt->nested_type_name (scope, "_out")
- << " " << tdef->nested_type_name (scope, "_out") << ";";
-
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_valuebox (be_valuebox *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_typedef *tdef = this->ctx_->tdef ();
- be_decl *scope = this->ctx_->scope ();
- be_type *bt;
-
- // Typedef of a typedef?
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Typedef the object.
- *os << "typedef " << bt->nested_type_name (scope) << " "
- << tdef->nested_type_name (scope) << ";" << be_nl;
-
- // Typedef the _var.
- *os << "typedef " << bt->nested_type_name (scope, "_var")
- << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl;
-
- // typedef the _out
- *os << "typedef " << bt->nested_type_name (scope, "_out")
- << " " << tdef->nested_type_name (scope, "_out") << ";" << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_typedef *tdef = this->ctx_->tdef ();
- be_decl *scope = this->ctx_->scope ();
- be_type *bt;
-
- // Typedef of a typedef?
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Typedef the object.
- *os << "typedef " << bt->nested_type_name (scope) << " "
- << tdef->nested_type_name (scope) << ";" << be_nl;
-
- // Typedef the _var.
- *os << "typedef " << bt->nested_type_name (scope, "_var")
- << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl;
-
- // typedef the _out
- *os << "typedef " << bt->nested_type_name (scope, "_out")
- << " " << tdef->nested_type_name (scope, "_out") << ";" << be_nl;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp
deleted file mode 100644
index 15bffced400..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp
+++ /dev/null
@@ -1,318 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// typedef_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Typedefs in the client inline file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_typedef,
- typedef_ci,
- "$Id$")
-
-// ******************************************************
-// Typedef visitor for client inline
-// ******************************************************
-
-be_visitor_typedef_ci::be_visitor_typedef_ci (be_visitor_context *ctx)
- : be_visitor_typedef (ctx)
-{
-}
-
-be_visitor_typedef_ci::~be_visitor_typedef_ci (void)
-{
-}
-
-int
-be_visitor_typedef_ci::visit_typedef (be_typedef *node)
-{
- // In general, we may have a chain of typedefs. i.e.,
- // typedef sequence<long> X;
- // typedef X Y;
- // typedef Y Z; and so on
- // The first time we will be in will be for node Z for which the code
- // generation has to take place. However, it is not enough to just generate
- // code that looks like -
- // typedef Y Z;
- // For different types (in this case we have a sequence), we will need
- // typedefs for the _var and _out types for Z. If it had been an array, we
- // will additionally have the _forany type as well as inlined *_alloc
- // methods.
- //
- // Finally, we need to differentiate between the case where we were
- // generating code for
- // typedef sequence<long> X; and
- // typedef Y Z; where Y was somehow aliased to the sequence. In the former
- // case, we will need to generate all the code for sequence<long> or whatever
- // the type maybe. In the latter, we just need typedefs for the type and all
- // associated _var, _out, and other types.
-
- be_type *bt; // base type
-
- if (this->ctx_->tdef ())
- {
- // the fact that we are here indicates that we were generating code for a
- // typedef node whose base type also happens to be another typedef-ed
- // (i.e. an alias) node for another (possibly alias) node
-
- this->ctx_->alias (node); // save this alias
-
- // grab the most primitive base type in the chain to avoid recusrsively
- // going thru this visit method
- bt = node->primitive_base_type ();
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_typedef - "
- "bad primitive base type\n"),
- -1);
- }
-
- // accept on this base type
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- }
- else
- {
- // the context has not stored any "tdef" node. So we must be in here for
- // the first time
- this->ctx_->tdef (node); // save the typedef node
-
- // grab the immediate base type node
- bt = be_type::narrow_from_decl (node->base_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_typedef - "
- "bad base type\n"),
- -1);
- }
-
- // accept on this base type
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- this->ctx_->tdef (0);
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_ci::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_typedef *tdef = this->ctx_->tdef (); // typedef node
- be_type *bt;
-
- // This doesn't catch 'typedef of a typedef' if the node is
- // imported, so we check for that below before generating
- // any code.
- if (this->ctx_->alias ())
- {
- // Typedef of a typedef.
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- // Is our base type an array node? If so, generate code for that array node.
- // In the first layer of typedef for an array, cli_hdr_gen() causes us to
- // skip all the code reached from the first branch. Then the ELSE branch is
- // skipped and we fail to generate any typedefs for that node. Adding the
- // check for cli_hdr_gen() to the IF statement keeps it in. Subsequent
- // layers of typedef, if any, assign the context alias to bt, so we go
- // straight to the ELSE branch.
- if (bt->node_type () == AST_Decl::NT_array && bt->cli_inline_gen () == 0)
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_array (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ci::"
- "visit_array - "
- "base class visitor failed \n"),
- -1);
- }
- }
- else
- {
- if ((bt->imported () && tdef->imported ()) || bt->cli_inline_gen())
- {
- // Code below is generated in another file.
- return 0;
- }
-
- // generate the inline code for alloc, dup, copy, and free methods
-
- // alloc method
- *os << be_nl
- << "ACE_INLINE " << be_nl
- << tdef->name () << "_slice *" << be_nl;
- *os << tdef->name () << "_alloc (void)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return " << bt->name () << "_alloc ();" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- // dup method
- *os << "ACE_INLINE " << be_nl
- << tdef->name () << "_slice *" << be_nl;
- *os << tdef->name () << "_dup (" << be_idt << be_idt_nl
- << "const " << tdef->name ()
- << "_slice *_tao_src" << be_uidt_nl
- << ")" << be_uidt_nl;
- *os << "{" << be_idt_nl;
- *os << "return " << bt->name () << "_dup (_tao_src);" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- // copy method
- *os << "ACE_INLINE" << be_nl
- << "void" << be_nl;
- *os << tdef->name () << "_copy (" << be_idt << be_idt_nl
- << tdef->name ()
- << "_slice *_tao_dest," << be_nl
- << "const " << tdef->name () << "_slice *_tao_src" << be_uidt_nl
- << ")" << be_uidt_nl;
- *os << "{" << be_idt_nl;
- *os << bt->name () << "_copy (_tao_dest, _tao_src);" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- // free method
- *os << "ACE_INLINE" << be_nl
- << "void" << be_nl;
- *os << tdef->name () << "_free (" << be_idt << be_idt_nl
- << tdef->name () << "_slice *_tao_src" << be_uidt_nl
- << ")" << be_uidt_nl;
- *os << "{" << be_idt_nl;
- *os << bt->name () << "_free (_tao_src);" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
- }
-
- bt->cli_inline_gen (true);
- return 0;
-}
-
-int
-be_visitor_typedef_ci::visit_sequence (be_sequence *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_sequence) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_sequence (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ci::"
- "visit_sequence - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_ci::visit_structure (be_structure *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_struct) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_structure (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ci::"
- "visit_structure - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_ci::visit_union (be_union *node)
-{
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () == AST_Decl::NT_union) // direct typedef of a base node
- // type
- {
- // let the base class visitor handle this case
- if (this->be_visitor_typedef::visit_union (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ci::"
- "visit_union - "
- "base class visitor failed \n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp
deleted file mode 100644
index 647a18ab3c1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// typedef_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Typedef in the client stubs
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_typedef,
- typedef_cs,
- "$Id$")
-
-// ******************************************************
-// Typedef visitor for client stubs
-// ******************************************************
-
-be_visitor_typedef_cs::be_visitor_typedef_cs (be_visitor_context *ctx)
- : be_visitor_typedef (ctx)
-{
-}
-
-be_visitor_typedef_cs::~be_visitor_typedef_cs (void)
-{
-}
-
-int
-be_visitor_typedef_cs::visit_typedef (be_typedef *node)
-{
- // In general, we may have a chain of typedefs. i.e.,
- // typedef sequence<long> X;
- // typedef X Y;
- // typedef Y Z; and so on
- // The first time we will be in will be for node Z for which the code
- // generation has to take place. However, it is not enough to just generate
- // code that looks like -
- // typedef Y Z;
- // For different types (in this case we have a sequence), we will need
- // typedefs for the _var and _out types for Z. If it had been an array, we
- // will additionally have the _forany type as well as inlined *_alloc
- // methods.
- //
- // Finally, we need to differentiate between the case where we were
- // generating code for
- // typedef sequence<long> X; and
- // typedef Y Z; where Y was somehow aliased to the sequence. In the former
- // case, we will need to generate all the code for sequence<long> or whatever
- // the type maybe. In the latter, we just need typedefs for the type and all
- // associated _var, _out, and other types.
-
- be_type *bt; // base type
-
- if (this->ctx_->tdef ())
- {
- // The fact that we are here indicates that we were generating code for a
- // typedef node whose base type also happens to be another typedef-ed
- // (i.e. an alias) node for another (possibly alias) node.
-
- this->ctx_->alias (node); // save this alias
-
- // Grab the most primitive base type in the chain to avoid recusrsively
- // going thru this visit method.
- bt = node->primitive_base_type ();
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_typedef - "
- "bad primitive base type\n"),
- -1);
- }
-
- // Accept on this base type.
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- }
- else
- {
- // The context has not stored any "tdef" node. So we must be in here for
- // the first time.
- this->ctx_->tdef (node);
-
- // Grab the immediate base type node.
- bt = be_type::narrow_from_decl (node->base_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_typedef - "
- "bad base type\n"),
- -1);
- }
-
- // Accept on this base type.
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_ch::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- if (!node->imported () && be_global->tc_support ())
- {
- be_visitor_context ctx (*this->ctx_);
- // ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- TAO::be_visitor_alias_typecode visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef_cs::"
- "visit_typedef - "
- "TypeCode definition failed\n"),
- -1);
- }
-
- }
-
- this->ctx_->tdef (0);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union.cpp b/TAO/TAO_IDL/be/be_visitor_union.cpp
deleted file mode 100644
index dc35ee0b5c8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_union.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Union
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_enum.h"
-#include "be_typedef.h"
-#include "be_predefined_type.h"
-#include "be_union.h"
-#include "be_union_branch.h"
-#include "be_helper.h"
-#include "be_extern.h"
-#include "ast_union_label.h"
-
-#include "be_visitor_union.h"
-#include "be_visitor_enum.h"
-#include "be_visitor_context.h"
-#include "be_visitor_union_branch.h"
-#include "be_visitor_typecode.h"
-#include "be_visitor_context.h"
-#include "ace/Log_Msg.h"
-
-#include "be_visitor_union/discriminant_ch.cpp"
-#include "be_visitor_union/discriminant_ci.cpp"
-#include "be_visitor_union/discriminant_cs.cpp"
-#include "be_visitor_union/union.cpp"
-#include "be_visitor_union/union_ch.cpp"
-#include "be_visitor_union/union_ci.cpp"
-#include "be_visitor_union/union_cs.cpp"
-#include "be_visitor_union/any_op_ch.cpp"
-#include "be_visitor_union/any_op_cs.cpp"
-#include "be_visitor_union/cdr_op_ch.cpp"
-#include "be_visitor_union/cdr_op_cs.cpp"
-#include "be_visitor_union/serializer_op_ch.cpp"
-#include "be_visitor_union/serializer_op_cs.cpp"
-
-ACE_RCSID (be,
- be_visitor_union,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_union/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union/any_op_ch.cpp
deleted file mode 100644
index 897acca7ad6..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/any_op_ch.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for Union.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union,
- any_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Union visitor for generating Any operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_union_any_op_ch::be_visitor_union_any_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_union (ctx)
-{
-}
-
-be_visitor_union_any_op_ch::~be_visitor_union_any_op_ch (void)
-{
-}
-
-int
-be_visitor_union_any_op_ch::visit_union (be_union *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- const char *macro = this->ctx_->export_macro ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << macro << " void operator<<= (::CORBA::Any &, const " << node->name ()
- << " &); // copying version" << be_nl;
- *os << macro << " void operator<<= (::CORBA::Any &, " << node->name ()
- << "*); // noncopying version" << be_nl;
- *os << macro << " ::CORBA::Boolean operator>>= (const ::CORBA::Any &, "
- << node->name () << " *&); // deprecated\n";
- *os << macro << " ::CORBA::Boolean operator>>= (const ::CORBA::Any &, const "
- << node->name () << " *&);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union::visit_union - "
- "codegen for scope failed\n"),
- -1);
- }
-
- node->cli_hdr_any_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_union_any_op_ch::visit_union_branch (be_union_branch *node)
-{
- // First generate the type information.
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_any_op_ch::"
- "visit_union_branch - "
- "Bad field type\n"),
- -1);
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_any_op_ch::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_any_op_ch::visit_enum (be_enum *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- be_visitor_enum_any_op_ch visitor (this->ctx_);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_any_op_ch::"
- "visit_enum - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_any_op_ch::visit_structure (be_structure *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- be_visitor_structure_any_op_ch visitor (this->ctx_);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_any_op_ch::"
- "visit_structure - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp
deleted file mode 100644
index b84932013c1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp
+++ /dev/null
@@ -1,240 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for Union.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union,
- any_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Union visitor for generating Any operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_union_any_op_cs::be_visitor_union_any_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_union (ctx)
-{
-}
-
-be_visitor_union_any_op_cs::~be_visitor_union_any_op_cs (void)
-{
-}
-
-int
-be_visitor_union_any_op_cs::visit_union (be_union *node)
-{
- if (node->cli_stub_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl
- << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Since we don't generate CDR stream operators for types that
- // explicitly contain a local interface (at some level), we
- // must override these Any template class methods to avoid
- // calling the non-existent operators. The zero return value
- // will eventually cause CORBA::MARSHAL to be raised if this
- // type is inserted into an Any and then marshaled.
- if (node->is_local ())
- {
- *os << be_nl << be_nl
- << "namespace TAO" << be_nl
- << "{" << be_idt_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Dual_Impl_T<" << node->name ()
- << ">::marshal_value (TAO_OutputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Dual_Impl_T<" << node->name ()
- << ">::demarshal_value (TAO_InputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}";
- }
-
- // Copying insertion.
- *os << "// Copying insertion." << be_nl
- << "void operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << "const " << node->name () << " &_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
-
- << "if (0 == &_tao_elem) // Trying to de-reference NULL object" << be_idt_nl
- << "_tao_any <<= static_cast<" << node->name () << " *>( 0 ); // Use non-copying insertion of a NULL" << be_uidt_nl
- << "else" << be_idt_nl
-
- << "TAO::Any_Dual_Impl_T<" << node->name () << ">::insert_copy ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Non-copying insertion.
- *os << "// Non-copying insertion." << be_nl
- << "void operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->name () << " *_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "TAO::Any_Dual_Impl_T<" << node->name () << ">::insert ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Extraction to non-const pointer (deprecated, just calls the other).
- *os << "// Extraction to non-const pointer (deprecated)." << be_nl
- << "::CORBA::Boolean operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << node->name () << " *&_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return _tao_any >>= const_cast<" << be_idt << be_idt_nl
- << "const " << node->name () << " *&> (" << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Extraction to const pointer.
- *os << "// Extraction to const pointer." << be_nl
- << "::CORBA::Boolean operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << "const " << node->name () << " *&_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return" << be_idt_nl
- << "TAO::Any_Dual_Impl_T<" << node->name () << ">::extract ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- // All we have to do is to visit the scope and generate code.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union::visit_union - "
- "codegen for scope failed\n"),
- -1);
- }
-
- node->cli_stub_any_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_union_any_op_cs::visit_union_branch (be_union_branch *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_any_op_cs::"
- "visit_union_branch - "
- "Bad field type\n"),
- -1);
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_any_op_cs::"
- "visit_union_branch - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_any_op_cs::visit_enum (be_enum *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- be_visitor_enum_any_op_cs visitor (this->ctx_);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_any_op_cs::"
- "visit_enum - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_any_op_cs::visit_structure (be_structure *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- be_visitor_structure_any_op_cs visitor (this->ctx_);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_any_op_cs::"
- "visit_structure - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp
deleted file mode 100644
index f55a5c83d83..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for unions. This uses
-// compiled marshaling.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union,
- cdr_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Union visitor for generating CDR operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_union_cdr_op_ch::be_visitor_union_cdr_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_union (ctx)
-{
-}
-
-be_visitor_union_cdr_op_ch::~be_visitor_union_cdr_op_ch (void)
-{
-}
-
-int
-be_visitor_union_cdr_op_ch::visit_union (be_union *node)
-{
- if (node->cli_hdr_cdr_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator<< (TAO_OutputCDR &, const " << node->name ()
- << " &);" << be_nl;
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator>> (TAO_InputCDR &, "
- << node->name () << " &);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- // Set the substate as generating code for the types defined in our scope.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_SCOPE);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cdr_op_ch::"
- "visit_union - "
- "codegen for scope failed\n"),
- -1);
- }
-
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp
deleted file mode 100644
index 59a621cf4b2..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for unions
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union,
- cdr_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Union visitor for generating CDR operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_union_cdr_op_cs::be_visitor_union_cdr_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_union (ctx)
-{
-}
-
-be_visitor_union_cdr_op_cs::~be_visitor_union_cdr_op_cs (void)
-{
-}
-
-int
-be_visitor_union_cdr_op_cs::visit_union (be_union *node)
-{
- // already generated and/or we are imported. Don't do anything.
- if (node->cli_stub_cdr_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- // Set the substate as generating code for the types defined in our scope
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_SCOPE);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cdr_op_cs"
- "::visit_union - "
- "codegen for scope failed\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Set the sub state as generating code for the output operator.
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT);
-
- *os << "::CORBA::Boolean operator<< (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &strm," << be_nl
- << "const " << node->name () << " &_tao_union" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- switch (node->udisc_type ())
- {
- case AST_Expression::EV_bool:
- *os << "::ACE_OutputCDR::from_boolean tmp (_tao_union._d ());" << be_nl
- << "if ( !(strm << tmp) )" << be_idt_nl;
-
- break;
- case AST_Expression::EV_char:
- *os << "::ACE_OutputCDR::from_char tmp (_tao_union._d ());" << be_nl
- << "if ( !(strm << tmp) )" << be_idt_nl;
-
- break;
- case AST_Expression::EV_wchar:
- *os << "::ACE_OutputCDR::from_wchar tmp (_tao_union._d ());" << be_nl
- << "if ( !(strm << tmp) )" << be_idt_nl;
-
- break;
- default:
- *os << "if ( !(strm << _tao_union._d ()) )" << be_idt_nl;
-
- break;
- }
-
- *os << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "::CORBA::Boolean result = true;" << be_nl << be_nl
- << "switch (_tao_union._d ())" << be_nl
- << "{" << be_idt;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cdr_op_cs::"
- "visit_union - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // If there is no explicit default case, but there
- // is an implicit one, and the discriminant is an enum,
- // we need this to avert warnings in some compilers that
- // not all case values are included. If there is no
- // implicit default case, or the discriminator is not
- // an enum, this does no harm.
- if (node->gen_empty_default_label ())
- {
- *os << be_nl << "default:" << be_idt_nl;
- *os << "break;"<< be_uidt;
- }
-
- *os << be_uidt_nl << "}" << be_nl << be_nl
- << "return result;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Set the substate as generating code for the input operator.
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT);
- *os << "::CORBA::Boolean operator>> (" << be_idt << be_idt_nl
- << "TAO_InputCDR &strm," << be_nl
- << node->name () << " &_tao_union" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- be_type* disc_type =
- be_type::narrow_from_decl (node->disc_type ());
-
- // Generate a temporary to store the discriminant
- *os << disc_type->full_name ()
- << " " << "_tao_discriminant;" << be_nl;
-
- switch (node->udisc_type ())
- {
- case AST_Expression::EV_bool:
- *os << "::ACE_InputCDR::to_boolean tmp (_tao_discriminant);" << be_nl
- << "if ( !(strm >> tmp) )" << be_idt_nl;
-
- break;
- case AST_Expression::EV_char:
- *os << "::ACE_InputCDR::to_char tmp (_tao_discriminant);" << be_nl
- << "if ( !(strm >> tmp) )" << be_idt_nl;
-
- break;
- case AST_Expression::EV_wchar:
- *os << "::ACE_InputCDR::to_wchar tmp (_tao_discriminant);" << be_nl
- << "if ( !(strm >> tmp) )" << be_idt_nl;
-
- break;
- default:
- *os << "if ( !(strm >> _tao_discriminant) )" << be_idt_nl;
-
- break;
- }
-
- *os << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "::CORBA::Boolean result = true;" << be_nl << be_nl
- << "switch (_tao_discriminant)" << be_nl
- << "{" << be_idt;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cdr_op_cs::"
- "visit_union - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // If there is no explicit default case, but there
- // is an implicit one, and the discriminant is an enum,
- // we need this to avert warnings in some compilers that
- // not all case values are included. If there is no
- // implicit default case, or the discriminator is not
- // an enum, this does no harm.
- if (node->gen_empty_default_label ())
- {
- *os << be_nl;
- *os << "default:" << be_idt_nl;
- *os << "_tao_union._d (_tao_discriminant);" << be_nl;
- *os << "break;" << be_uidt;
- }
-
- *os << be_uidt_nl
- << "}" << be_nl << be_nl
- << "return result;" << be_uidt_nl
- << "}";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_stub_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp
deleted file mode 100644
index 124845ab053..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// discriminant_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for discriminant of the Union
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union,
- discriminant_ch,
- "$Id$")
-
-// *************************************************************************
-// Visitor for discriminant in client header file.
-// *************************************************************************
-
-be_visitor_union_discriminant_ch::be_visitor_union_discriminant_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_union_discriminant_ch::~be_visitor_union_discriminant_ch (void)
-{
-}
-
-int
-be_visitor_union_discriminant_ch::visit_enum (be_enum *node)
-{
- // Get the enclosing union backend.
- be_union *bu = this->ctx_->be_node_as_union ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Not a typedef and bt is defined inside the union.
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // First generate the enum declaration.
- be_visitor_enum_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_discriminant_ch::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // The set method.
- *os << be_nl << be_nl
- << "void _d (" << bt->nested_type_name (bu) << ");" << be_nl;
- // The get method.
- *os << bt->nested_type_name (bu) << " _d (void) const;";
-
- return 0;
-}
-
-int
-be_visitor_union_discriminant_ch::visit_predefined_type (be_predefined_type
- *node)
-{
- // get the enclosing union backend.
- be_union *bu = this->ctx_->be_node_as_union ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // The set method.
- *os << be_nl << be_nl
- << "void _d ( ::" << bt->nested_type_name (bu) << ");" << be_nl;
- // The get method.
- *os << "::" << bt->nested_type_name (bu) << " _d (void) const;";
-
- return 0;
-}
-
-int
-be_visitor_union_discriminant_ch::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- // The node to be visited in the base primitve type that gets typedefed.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_discriminant_ch::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp
deleted file mode 100644
index 2d3c9e0f119..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp
+++ /dev/null
@@ -1,264 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// discriminant_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for discriminant of the union.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union,
- discriminant_ci,
- "$Id$")
-
-// *************************************************************************
-// be_visitor_discriminant_ci - visitor for discriminant in client inline file
-// *************************************************************************
-
-be_visitor_union_discriminant_ci::be_visitor_union_discriminant_ci (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_union_discriminant_ci::~be_visitor_union_discriminant_ci (void)
-{
-}
-
-int
-be_visitor_union_discriminant_ci::visit_enum (be_enum *node)
-{
- be_union *bu =
- this->ctx_->be_node_as_union ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // now check if we need to generate the _default () method
- be_union::DefaultValue dv;
-
- if (bu->default_value (dv) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_discriminant_ci::"
- "visit_enum - "
- "computing default value failed\n"),
- -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- if ((dv.computed_ != 0) && (bu->default_index () == -1))
- {
- // Only if all cases are not covered AND there is no explicit
- // default, we get the _default () method.
- *os << "ACE_INLINE" << be_nl
- << "void " << be_nl
- << bu->name () << "::_default ()" << be_nl
- << "{" << be_idt_nl
- << "this->_reset ();" << be_nl
- << "this->disc_ = ";
-
- be_type* dt =
- be_type::narrow_from_decl (bu->disc_type ());
-
- if (dt == 0)
- {
- return -1;
- }
-
- // Find where was the enum defined, if it was defined in the globa
- // scope, then it is easy to generate the enum values....
- be_scope* scope =
- be_scope::narrow_from_scope (dt->defined_in ());
-
- if (scope == 0)
- {
- *os << node->value_to_name (dv.u.enum_val);
- return 0;
- }
-
- // The function value_to_name() takes care of adding
- // any necessary scoping to the output.
- *os << node->value_to_name (dv.u.enum_val);
- *os << ";" << be_uidt_nl << "}" << be_nl << be_nl;
- }
-
- // the set method
- *os << "// Accessor to set the discriminant." << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << bu->name () << "::_d (" << bt->name ()
- << " discval)" << be_nl
- << "{" << be_idt_nl
- << "this->disc_ = discval;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // the get method
- *os << "// Accessor to get the discriminant." << be_nl
- << "ACE_INLINE" << be_nl
- << bt->name () << be_nl
- << bu->name () << "::_d (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->disc_;" << be_uidt_nl
- << "}";
-
- return 0;
-}
-
-int
-be_visitor_union_discriminant_ci::visit_predefined_type (
- be_predefined_type *node
- )
-{
- be_union *bu =
- this->ctx_->be_node_as_union ();
-
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Now check if we need to generate the _default () method.
- be_union::DefaultValue dv;
-
- if (bu->default_value (dv) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_discriminant_ci::"
- "visit_enum - "
- "computing default value failed\n"),
- -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- if ((dv.computed_ != 0) && (bu->default_index () == -1))
- {
- // Only if all cases are not covered AND there is no explicit
- // default, we get the _default () method.
-
- *os << "ACE_INLINE" << be_nl
- << "void " << be_nl
- << bu->name () << "::_default ()" << be_nl
- << "{" << be_idt_nl
- << "this->_reset ();" << be_nl
- << "this->disc_ = ";
-
- switch (bu->udisc_type ())
- {
- case AST_Expression::EV_short:
- *os << dv.u.short_val;
-
- break;
- case AST_Expression::EV_ushort:
- *os << dv.u.ushort_val;
-
- break;
- case AST_Expression::EV_long:
- *os << dv.u.long_val;
-
- break;
- case AST_Expression::EV_ulong:
- *os << dv.u.ulong_val;
-
- break;
- case AST_Expression::EV_char:
- os->print ("'\\%d'", dv.u.char_val);
- break;
- case AST_Expression::EV_wchar:
- os->print ("L'\\%d'", dv.u.wchar_val);
- break;
- case AST_Expression::EV_bool:
- *os << (dv.u.bool_val == 0 ? "false" : "true");
-
- break;
- case AST_Expression::EV_longlong:
- case AST_Expression::EV_ulonglong:
- // Unimplemented.
- default:
- // Error caught earlier.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_discriminant_ci::"
- "visit_predefined_type - "
- "bad or unimplemented discriminant type\n"),
- -1);
- }
-
- *os << ";" << be_uidt_nl << "}";
- }
-
- // The set method.
- *os << be_nl << be_nl
- << "// Accessor to set the discriminant." << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << bu->name () << "::_d ( ::" << bt->name ()
- << " discval)" << be_nl
- << "{" << be_idt_nl
- << "this->disc_ = discval;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // The get method.
- *os << "// Accessor to get the discriminant." << be_nl
- << "ACE_INLINE" << be_nl
- << "::" << bt->name () << be_nl
- << bu->name () << "::_d (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->disc_;" << be_uidt_nl
- << "}";
-
- return 0;
-}
-
-int
-be_visitor_union_discriminant_ci::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- // The node to be visited in the base primitve type that gets typedefed.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_discriminant_ci::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union/discriminant_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/discriminant_cs.cpp
deleted file mode 100644
index e49c96162e9..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/discriminant_cs.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// discriminant_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for discriminant of the union
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union,
- discriminant_cs,
- "$Id$")
-
-// *************************************************************************
-// Visitor for discriminant in client stubs.
-// *************************************************************************
-
-be_visitor_union_discriminant_cs::be_visitor_union_discriminant_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_union_discriminant_cs::~be_visitor_union_discriminant_cs (void)
-{
-}
-
-int
-be_visitor_union_discriminant_cs::visit_enum (be_enum *node)
-{
- be_union *bu =
- this->ctx_->be_node_as_union (); // get the enclosing union backend
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // generate the typecode for the enum
- be_visitor_enum_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_discriminant_cs::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union/serializer_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union/serializer_op_ch.cpp
deleted file mode 100644
index 4fcef2945ff..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/serializer_op_ch.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for TAO::DCPS::Serializer operators for unions.
-// This uses compiled marshaling.
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union,
- serializer_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Union visitor for generating Serializer operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_union_serializer_op_ch::be_visitor_union_serializer_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_union (ctx)
-{
-}
-
-be_visitor_union_serializer_op_ch::~be_visitor_union_serializer_op_ch (void)
-{
-}
-
-int
-be_visitor_union_serializer_op_ch::visit_union (be_union *node)
-{
- if (node->cli_hdr_serializer_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- //- _dcps_max_marshaled_size(type) method
- *os << be_global->stub_export_macro ()
- << " size_t _dcps_max_marshaled_size (const "
- << node->name() << "& _tao_union);" << be_nl;
- //- _tao_is_bounded_size(type) method
- *os << be_global->stub_export_macro ()
- << " ::CORBA::Boolean _tao_is_bounded_size (const "
- << node->name() << "& _tao_union);" << be_nl;
- //- _dcps_find_size(type) method
- *os << be_global->stub_export_macro ()
- << " size_t _dcps_find_size (const "
- << node->name() << "& _tao_union);" << be_nl;
-
-
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator<< (TAO::DCPS::Serializer &, const " << node->name ()
- << " &);" << be_nl;
- *os << be_global->stub_export_macro () << " ::CORBA::Boolean"
- << " operator>> (TAO::DCPS::Serializer &, "
- << node->name () << " &);";
-
-
- // Set the substate as generating code for the types defined in our scope.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_SCOPE);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_serializer_op_ch::"
- "visit_union - "
- "codegen for scope failed\n"),
- -1);
- }
-
- node->cli_hdr_serializer_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union/serializer_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/serializer_op_cs.cpp
deleted file mode 100644
index 9befe5a698c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/serializer_op_cs.cpp
+++ /dev/null
@@ -1,468 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for TAO::DCPS::Serializer operators for unions
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union,
- serializer_op_cs,
- "$Id$")
-
-// ***************************************************************************
-// Union visitor for generating Serializer operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_union_serializer_op_cs::be_visitor_union_serializer_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_union (ctx)
-{
-}
-
-be_visitor_union_serializer_op_cs::~be_visitor_union_serializer_op_cs (void)
-{
-}
-
-int
-be_visitor_union_serializer_op_cs::visit_union (be_union *node)
-{
- // already generated and/or we are imported. Don't do anything.
- if (node->cli_stub_serializer_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- // Set the substate as generating code for the types defined in our scope
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_SCOPE);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_serializer_op_cs"
- "::visit_union - "
- "codegen for scope failed\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- //---------------------------------------------------------------
- // Set the sub state as generating code for _dcps_max_marshaled_size.
- this->ctx_->sub_state(TAO_CodeGen::TAO_MAX_MARSHALED_SIZE);
-
- *os << "size_t _dcps_max_marshaled_size (" << be_idt << be_idt_nl
- << "const " << node->name () << " &" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- ;
- *os << "// do not try getting the _dcps_max_marshaled_size" << be_nl
- << "// doing so may produce an access violation" << be_nl
- << "return 100000;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
-/*
- << "size_t max_size = 0;" << be_nl << be_nl;
-
- *os << "// find the maximum field size." << be_nl;
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_serializer_op_cs::"
- "visit_union - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_nl << "// now add in the size of the discriminant" << be_nl;
- switch (node->udisc_type ())
- {
- case AST_Expression::EV_bool:
- *os << "max_size += _dcps_max_marshaled_size ("
- << "ACE_OutputCDR::from_boolean (_tao_union._d ()));" << be_nl;
- break;
- case AST_Expression::EV_char:
- *os << "max_size += _dcps_max_marshaled_size ("
- << "ACE_OutputCDR::from_char (_tao_union._d ()));" << be_nl;
-
- break;
- case AST_Expression::EV_wchar:
- *os << "max_size += _dcps_max_marshaled_size ("
- << "ACE_OutputCDR::from_wchar (_tao_union._d ()));" << be_nl;
-
- break;
- default:
- // no need to cast the other dicriminant types
- *os << "max_size += _dcps_max_marshaled_size ("
- << "_tao_union._d ());" << be_nl;
-
- break;
- }
-
- *os << be_nl
- << "return max_size;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-*/
-
- //---------------------------------------------------------------
- // Set the sub state as generating code for _tao_is_bounded_size.
- this->ctx_->sub_state(TAO_CodeGen::TAO_IS_BOUNDED_SIZE);
- *os << "::CORBA::Boolean _tao_is_bounded_size (" << be_idt << be_idt_nl
- << "const " << node->name () << " &" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- ;
- *os << "// Always return false for a union because " << be_nl
- << "// _dcps_max_marshaled_size may produce an access violation."
- << be_nl
- << "return false;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-/*
- << "CORBA::Boolean is_bounded = true;"
- << " // all discrimenent types are bounded" << be_nl << be_nl;
-
- *os << "// bounded if all branches are bounded." << be_nl;
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_serializer_op_cs::"
- "visit_union - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_nl
- << "return is_bounded;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-*/
-
- //---------------------------------------------------------------
- // Set the sub state as generating code for _dcps_find_size.
- this->ctx_->sub_state(TAO_CodeGen::TAO_FIND_SIZE);
- *os << be_global->stub_export_macro ()
- << " size_t _dcps_find_size (const "
- << node->name() << "& _tao_union);" << be_nl;
-
- *os << "size_t _dcps_find_size (" << be_idt << be_idt_nl
- << "const " << node->name () << " &_tao_union" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "// all union discriminents are fixed size"
- << "so OK to use _dcps_max_marshaled_size" << be_nl
- << "size_t result = ";
-
- switch (node->udisc_type ())
- {
- case AST_Expression::EV_bool:
- *os << "_dcps_max_marshaled_size (::ACE_OutputCDR::from_boolean (_tao_union._d ()));" << be_nl;
- break;
- case AST_Expression::EV_char:
- *os << "_dcps_max_marshaled_size (::ACE_OutputCDR::from_char (_tao_union._d ()));" << be_nl;
- break;
- case AST_Expression::EV_wchar:
- *os << "_dcps_max_marshaled_size (::ACE_OutputCDR::from_wchar (_tao_union._d ()));" << be_nl;
- break;
- default:
- *os << "_dcps_max_marshaled_size (_tao_union._d ());" << be_nl;
- break;
- }
-
- *os << be_nl
- << "switch (_tao_union._d ())" << be_nl
- << "{" << be_idt;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_serializer_op_cs::"
- "visit_union - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // If there is no explicit default case, but there
- // is an implicit one, and the discriminant is an enum,
- // we need this to avert warnings in some compilers that
- // not all case values are included. If there is no
- // implicit default case, or the discriminator is not
- // an enum, this does no harm.
- if (node->gen_empty_default_label ())
- {
- *os << be_nl << "default:" << be_idt_nl;
- *os << "break;"<< be_uidt;
- }
-
- *os << be_uidt << be_uidt_nl << "}" << be_nl << be_nl
- << "return result;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- //---------------------------------------------------------------
- // Set the sub state as generating code for the output operator.
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT);
-
- *os << "::CORBA::Boolean operator<< (" << be_idt << be_idt_nl
- << "TAO::DCPS::Serializer &strm," << be_nl
- << "const " << node->name () << " &_tao_union" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- switch (node->udisc_type ())
- {
- case AST_Expression::EV_bool:
- *os << "::ACE_OutputCDR::from_boolean tmp (_tao_union._d ());" << be_nl
- << "if ( !(strm << tmp) )" << be_idt_nl;
-
- break;
- case AST_Expression::EV_char:
- *os << "::ACE_OutputCDR::from_char tmp (_tao_union._d ());" << be_nl
- << "if ( !(strm << tmp) )" << be_idt_nl;
-
- break;
- case AST_Expression::EV_wchar:
- *os << "::ACE_OutputCDR::from_wchar tmp (_tao_union._d ());" << be_nl
- << "if ( !(strm << tmp) )" << be_idt_nl;
-
- break;
- default:
- *os << "if ( !(strm << _tao_union._d ()) )" << be_idt_nl;
-
- break;
- }
-
- *os << "{" << be_idt_nl
- << "return 0;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "::CORBA::Boolean result = 1;" << be_nl << be_nl
- << "switch (_tao_union._d ())" << be_nl
- << "{" << be_idt;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_serializer_op_cs::"
- "visit_union - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // If there is no explicit default case, but there
- // is an implicit one, and the discriminant is an enum,
- // we need this to avert warnings in some compilers that
- // not all case values are included. If there is no
- // implicit default case, or the discriminator is not
- // an enum, this does no harm.
- if (node->gen_empty_default_label ())
- {
- *os << be_nl << "default:" << be_idt_nl;
- *os << "break;"<< be_uidt;
- }
-
- *os << be_uidt_nl << "}" << be_nl << be_nl
- << "return result;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- //---------------------------------------------------------------
- // Set the substate as generating code for the input operator.
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT);
- *os << "::CORBA::Boolean operator>> (" << be_idt << be_idt_nl
- << "TAO::DCPS::Serializer &strm," << be_nl
- << node->name () << " &_tao_union" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- be_type* disc_type =
- be_type::narrow_from_decl (node->disc_type ());
-
- // Generate a temporary to store the discriminant
- *os << disc_type->full_name ()
- << " " << "_tao_discriminant;" << be_nl;
-
- switch (node->udisc_type ())
- {
- case AST_Expression::EV_bool:
- *os << "::ACE_InputCDR::to_boolean tmp (_tao_discriminant);" << be_nl
- << "if ( !(strm >> tmp) )" << be_idt_nl;
-
- break;
- case AST_Expression::EV_char:
- *os << "::ACE_InputCDR::to_char tmp (_tao_discriminant);" << be_nl
- << "if ( !(strm >> tmp) )" << be_idt_nl;
-
- break;
- case AST_Expression::EV_wchar:
- *os << "::ACE_InputCDR::to_wchar tmp (_tao_discriminant);" << be_nl
- << "if ( !(strm >> tmp) )" << be_idt_nl;
-
- break;
- default:
- *os << "if ( !(strm >> _tao_discriminant) )" << be_idt_nl;
-
- break;
- }
-
- *os << "{" << be_idt_nl
- << "return 0;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "::CORBA::Boolean result = 1;" << be_nl << be_nl
- << "switch (_tao_discriminant)" << be_nl
- << "{" << be_idt;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_serializer_op_cs::"
- "visit_union - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // If there is no explicit default case, but there
- // is an implicit one, and the discriminant is an enum,
- // we need this to avert warnings in some compilers that
- // not all case values are included. If there is no
- // implicit default case, or the discriminator is not
- // an enum, this does no harm.
- if (node->gen_empty_default_label ())
- {
- *os << be_nl;
- *os << "default:" << be_idt_nl;
- *os << "_tao_union._d (_tao_discriminant);" << be_nl;
- *os << "break;" << be_uidt;
- }
-
- *os << be_uidt_nl
- << "}" << be_nl << be_nl
- << "return result;" << be_uidt_nl
- << "}";
-
- node->cli_stub_serializer_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_union_serializer_op_cs::pre_process (be_decl *bd)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_SCOPE:
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- return 0;
- break;
-
- case TAO_CodeGen::TAO_FIND_SIZE:
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- case TAO_CodeGen::TAO_CDR_INPUT:
- {
- // Enum val nodes are added just to help check reference
- // clashes, since an enum declared in our scope is not itself
- // a scope.
- if (bd->node_type () == AST_Decl::NT_enum_val)
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_union_branch* b =
- be_union_branch::narrow_from_decl (bd);
-
- *os << be_nl;
-
- for (unsigned long i = 0; i < b->label_list_length (); ++i)
- {
- // check if we are printing the default case
- if (b->label (i)->label_kind () == AST_UnionLabel::UL_default)
- {
- *os << "default:";
- }
- else
- {
- *os << "case ";
-
- b->gen_label_value (os, i);
-
- *os << ":";
- }
-
- if (i == (b->label_list_length () - 1))
- {
- *os << be_idt_nl;
- }
- else
- {
- *os << be_nl;
- }
- }
-
- *os << "{" << be_idt_nl;
- }
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_serializer_op_cs::"
- "pre_process - "
- "bad sub_state.\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_serializer_op_cs::post_process (be_decl *bd)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_SCOPE:
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- return 0;
- break;
-
- case TAO_CodeGen::TAO_FIND_SIZE:
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- case TAO_CodeGen::TAO_CDR_INPUT:
- {
-
- if (bd->node_type () == AST_Decl::NT_enum_val)
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_uidt_nl << "}" << be_nl
- << "break;" << be_uidt;
-
- }
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_serializer_op_cs::"
- "pre_process - "
- "bad sub_state.\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union/union.cpp b/TAO/TAO_IDL/be/be_visitor_union/union.cpp
deleted file mode 100644
index 30868bae313..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/union.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// union.cpp
-//
-// = DESCRIPTION
-// Generic visitor generating code for Unions
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union,
- union,
- "$Id$")
-
-be_visitor_union::be_visitor_union (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_union::~be_visitor_union (void)
-{
-}
-
-int
-be_visitor_union::visit_union (be_union *)
-{
- return -1; // Must be overriden.
-}
-
-int
-be_visitor_union::visit_union_branch (be_union_branch *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_UNION_PUBLIC_CH:
- {
- be_visitor_union_branch_public_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_UNION_PRIVATE_CH:
- {
- be_visitor_union_branch_private_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_union_branch_public_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_UNION_PUBLIC_CS:
- {
- be_visitor_union_branch_public_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_UNION_PUBLIC_ASSIGN_CS:
- {
- be_visitor_union_branch_public_assign_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_UNION_PUBLIC_RESET_CS:
- {
- be_visitor_union_branch_public_reset_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_union_branch_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_union_branch_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CH:
- {
- be_visitor_union_branch_serializer_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_SERIALIZER_OP_CS:
- {
- be_visitor_union_branch_serializer_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union::"
- "visit_union_branch - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union::"
- "visit_union_branch - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_cdr_op_cs::pre_process (be_decl *bd)
-{
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_SCOPE)
- {
- return 0;
- }
-
- // Enum val nodes are added just to help check reference
- // clashes, since an enum declared in our scope is not itself
- // a scope.
- if (bd->node_type () == AST_Decl::NT_enum_val)
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_union_branch* b =
- be_union_branch::narrow_from_decl (bd);
-
- *os << be_nl;
-
- for (unsigned long i = 0; i < b->label_list_length (); ++i)
- {
- // check if we are printing the default case
- if (b->label (i)->label_kind () == AST_UnionLabel::UL_default)
- {
- *os << "default:";
- }
- else
- {
- *os << "case ";
-
- b->gen_label_value (os, i);
-
- *os << ":";
- }
-
- if (i == (b->label_list_length () - 1))
- {
- *os << be_idt_nl;
- }
- else
- {
- *os << be_nl;
- }
- }
-
- *os << "{" << be_idt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_cdr_op_cs::post_process (be_decl *bd)
-{
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_SCOPE)
- {
- return 0;
- }
-
- if (bd->node_type () == AST_Decl::NT_enum_val)
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_uidt_nl << "}" << be_nl
- << "break;" << be_uidt;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp
deleted file mode 100644
index c108d763bd5..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// union_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Unions in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union,
- union_ch,
- "$Id$")
-
-// ******************************************************
-// For client header.
-// ******************************************************
-
-be_visitor_union_ch::be_visitor_union_ch (be_visitor_context *ctx)
- : be_visitor_union (ctx)
-{
-}
-
-be_visitor_union_ch::~be_visitor_union_ch (void)
-{
-}
-
-int be_visitor_union_ch::visit_union (be_union *node)
-{
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- // Evaluate the member in time for the decision to generate
- // the recursive typecode include in the stub source file.
- ACE_Unbounded_Queue<AST_Type *> list;
- (void) node->in_recursion (list);
-
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate _var and _out class typedefs.
- node->gen_common_varout (os);
-
- // Generate the ifdefined macro for the union type.
- os->gen_ifdef_macro (node->flat_name ());
-
- *os << be_nl << be_nl
- << "class " << be_global->stub_export_macro () << " "
- << node->local_name () << be_nl
- << "{" << be_nl
- << "public:" << be_idt_nl
-
- // Generate default and copy constructors.
- << node->local_name () << " (void);" << be_nl
- << node->local_name () << " (const " << node->local_name ()
- << " &);" << be_nl
- // Generate destructor.
- << "~" << node->local_name () << " (void);" << be_nl;
-
- if (be_global->any_support ())
- {
- *os << "static void _tao_any_destructor (void*);"
- << be_nl << be_nl;
- }
-
- // Generate assignment operator.
- *os << node->local_name () << " &operator= (const "
- << node->local_name () << " &);";
-
- // Retrieve the disriminant type.
- be_type *bt = be_type::narrow_from_decl (node->disc_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ch::"
- "visit_union - "
- "bad disciminant type\n"),
- -1);
- }
-
- // The discriminant type may have to be defined here if it was an enum
- // declaration inside of the union statement.
-
- be_visitor_union_discriminant_ch ud_visitor (&ctx);
-
- if (bt->accept (&ud_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ch::"
- " visit_union - "
- "codegen for discriminant failed\n"),
- -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Generate the typedefs.
- *os << be_nl << be_nl
- << "typedef " << node->local_name () << "_var _var_type;"
- << be_nl
- << "typedef " << node->local_name () << "_out _out_type;";
-
- // Now generate the public defn for the union branch members. For this,
- // set our state to reflect what we are aiming to do.
- this->ctx_->state (TAO_CodeGen::TAO_UNION_PUBLIC_CH);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ch::"
- "visit_union - "
- "codegen for public defn of union members\n"),
- -1);
- }
-
- // Now check if we need to generate the _default () method.
- be_union::DefaultValue dv;
-
- if (node->default_value (dv) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ch::"
- "visit_union - "
- "computing default value failed\n"),
- -1);
- }
-
- if ((dv.computed_ != 0) && (node->default_index () == -1))
- {
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Only if all cases are not covered AND there is no explicit
- // default, we get the _default () method.
- *os << be_nl << be_nl
- << "void _default (void);";
- }
-
- *os << be_uidt_nl;
-
- // Now generate the private data members of the union.
- *os << "private:" << be_idt_nl;
- *os << bt->nested_type_name (node) << " disc_;" << be_nl;
- *os << bt->nested_type_name (node) << " holder_;" << be_nl << be_nl;
- // Emit the ACE_NESTED_CLASS macro.
-
- // The members are inside of a union.
- *os << "union" << be_nl;
- *os << "{" << be_idt;
-
- this->ctx_->state (TAO_CodeGen::TAO_UNION_PRIVATE_CH);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ch::"
- "visit_union - "
- "codegen for private members of union\n"),
- -1);
- }
-
- *os << be_uidt_nl;
- *os << "} u_;";
-
- // The reset method (TAO extension).
- *os << be_nl << be_nl
- << "/// TAO extension - frees any allocated storage." << be_nl;
- *os << "void _reset (void);";
-
- *os << be_uidt_nl << "};";
-
- if (be_global->tc_support ())
- {
- ctx = *this->ctx_;
- be_visitor_typecode_decl tc_visitor (&ctx);
-
- if (node->accept (&tc_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ch::"
- "visit_union - "
- "TypeCode declaration failed\n"),
- -1);
- }
- }
-
- os->gen_endif ();
-
- node->cli_hdr_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp
deleted file mode 100644
index e0d5784c355..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// union_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Union in the client inline file
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union,
- union_ci,
- "$Id$")
-
-// ******************************************************
-// For client inline.
-// ******************************************************
-
-be_visitor_union_ci::be_visitor_union_ci (be_visitor_context *ctx)
- : be_visitor_union (ctx)
-{
-}
-
-be_visitor_union_ci::~be_visitor_union_ci (void)
-{
-}
-
-int be_visitor_union_ci::visit_union (be_union *node)
-{
- if (node->cli_inline_gen () || node->imported ())
- {
- return 0;
- }
-
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "// *************************************************************"
- << be_nl;
- *os << "// Inline operations for union " << node->name () << be_nl;
- *os << "// *************************************************************";
-
- // the discriminant type may have to be defined here if it was an enum
- // declaration inside of the union statement.
-
- be_type *bt = be_type::narrow_from_decl (node->disc_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ci::"
- "visit_union - "
- "bad discriminant type\n"),
- -1);
- }
-
- be_visitor_union_discriminant_ci visitor (&ctx);
-
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ci::"
- "visit union - "
- "codegen for discrminant failed\n"),
- -1);
- }
-
- // Now generate the implementation of the access methods for the
- // union. For this set our state.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ci::"
- "visit_union - "
- "codegen for scope failed\n"),
- -1);
- }
-
- node->cli_inline_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp
deleted file mode 100644
index 3405d6c8fb9..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp
+++ /dev/null
@@ -1,301 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// union_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Unions in the client stubs
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union,
- union_cs,
- "$Id$")
-
-// ******************************************************
-// For client stubs.
-// ******************************************************
-
-be_visitor_union_cs::be_visitor_union_cs (be_visitor_context *ctx)
- : be_visitor_union (ctx)
-{
-}
-
-be_visitor_union_cs::~be_visitor_union_cs (void)
-{
-}
-
-// Visit the Union_cs node and its scope.
-int be_visitor_union_cs::visit_union (be_union *node)
-{
- if (node->cli_stub_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_visitor_context ctx (*this->ctx_);
- // The discriminant type may have to be defined here if it was an enum
- // declaration inside of the union statement. We need to generate its
- // typecode.
-
- be_type *bt = be_type::narrow_from_decl (node->disc_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cs::"
- "visit_union - "
- "bad discriminant type\n"), -1);
- }
-
- be_visitor_union_discriminant_cs disc_visitor (&ctx);
-
- if (bt->accept (&disc_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cs::"
- "visit union - "
- "codegen for discrminant failed\n"),
- -1);
- }
-
- // First generate code for any of the members (if required, e.g.,
- // anonymous sequences, structs, unions, arrays).
- this->ctx_->state (TAO_CodeGen::TAO_UNION_PUBLIC_CS);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cs"
- "visit_union - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // Now generate the operations on the union such as the copy constructor
- // and the assignment operator.
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Generate the copy constructor and the assignment operator here.
- *os << be_nl << be_nl
- << node->name () << "::" << node->local_name () << " (void)" << be_nl
- << "{" << be_idt_nl
- << "ACE_OS::memset (&this->u_, 0, sizeof (this->u_));" << be_nl
- << "this->disc_ = ";
-
- // The default constructor must initialize the discriminator
- // to the first case label value found in the union declaration
- // so that, if the uninitialized union is inserted into an Any,
- // the Any destructor's call to deep_free() will work properly.
- UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- be_union_branch *ub = 0;
-
- // In case we have some bogus enum values from an enum declared
- // in our scope.
- while (ub == 0)
- {
- // Just get the union's first member.
- AST_Decl *d = si.item ();
-
- ub = be_union_branch::narrow_from_decl (d);
- si.next ();
- }
-
- // Get the first label in its list.
- AST_UnionLabel *ul = ub->label (0);
- AST_Union::DefaultValue dv;
-
- // This can indicate an error in the return value, but it is
- // caught elsewhere.
- (void) node->default_value (dv);
-
- bool test = dv.computed_ == 0
- && ul->label_kind () == AST_UnionLabel::UL_label;
-
- if (test)
- {
- ub->gen_label_value (os);
- }
- else
- {
- ub->gen_default_label_value (os, node);
- }
-
- *os << ";";
-
- *os << be_uidt_nl << "}" << be_nl << be_nl;
-
- this->ctx_->state (TAO_CodeGen::TAO_UNION_PUBLIC_ASSIGN_CS);
-
- // So we know we are generating the copy constructor.
- this->ctx_->sub_state (TAO_CodeGen::TAO_UNION_COPY_CONSTRUCTOR);
-
- *os << node->name () << "::" << node->local_name ()
- << " (const ::" << node->name () << " &u)"
- << be_nl;
- *os << "{" << be_idt_nl;
- *os << "this->disc_ = u.disc_;" << be_nl;
- *os << "switch (this->disc_)" << be_nl;
- *os << "{" << be_idt;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cs"
- "visit_union - "
- "codegen for copy ctor failed\n"),
- -1);
- }
-
- // If there is no explicit default case, but there
- // is an implicit one, and the discriminant is an enum,
- // we need this to avert warnings in some compilers that
- // not all case values are included. If there is no
- // implicit default case, or the discriminator is not
- // an enum, this does no harm.
- if (node->gen_empty_default_label ())
- {
- *os << be_nl
- << "default:" << be_nl
- << "break;";
- }
-
- *os << be_uidt_nl << "}" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << node->name () << "::~" << node->local_name ()
- << " (void)" << be_nl
- << "{" << be_idt_nl
- << "// Finalize." << be_nl
- << "this->_reset ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- if (be_global->any_support ())
- {
- *os << "void "
- << node->name ()
- << "::_tao_any_destructor (void *_tao_void_pointer)" << be_nl
- << "{" << be_idt_nl
- << node->local_name () << " *tmp =" << be_idt_nl
- << "static_cast<"
- << node->local_name () << " *> (_tao_void_pointer);" << be_uidt_nl
- << "delete tmp;" << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
-
- this->ctx_->state (TAO_CodeGen::TAO_UNION_PUBLIC_ASSIGN_CS);
-
- // Reset this for generating the assignment operator.
- this->ctx_->sub_state (TAO_CodeGen::TAO_SUB_STATE_UNKNOWN);
-
- // Assignment operator.
- *os << node->name () << " &" << be_nl;
- *os << node->name () << "::operator= (const ::"
- << node->name () << " &u)" << be_nl;
- *os << "{" << be_idt_nl;
- // First check for self-assignment.
- *os << "if (&u == this)" << be_idt_nl
- << "{" << be_idt_nl
- << "return *this;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl;
- // Reset and set the discriminant.
- *os << "this->_reset ();" << be_nl;
- *os << "this->disc_ = u.disc_;" << be_nl << be_nl;
- // now switch based on the disc value
- *os << "switch (this->disc_)" << be_nl;
- *os << "{" << be_idt;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cs"
- "visit_union - "
- "codegen for assign op failed\n"),
- -1);
- }
-
- // If there is no explicit default case, but there
- // is an implicit one, and the discriminant is an enum,
- // we need this to avert warnings in some compilers that
- // not all case values are included. If there is no
- // implicit default case, or the discriminator is not
- // an enum, this does no harm.
- if (node->gen_empty_default_label ())
- {
- *os << be_nl
- << "default:" << be_nl
- << "break;";
- }
-
- *os << be_uidt_nl
- << "}" << be_nl << be_nl;
- *os << "return *this;" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- // The reset method.
- this->ctx_->state (TAO_CodeGen::TAO_UNION_PUBLIC_RESET_CS);
-
- *os << "/// Reset method to reset old values of a union." << be_nl;
- *os << "void " << node->name () << "::_reset (void)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "switch (this->disc_)" << be_nl;
- *os << "{" << be_idt_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cs"
- "visit_union - "
- "codegen for reset failed\n"),
- -1);
- }
-
- // If there is no explicit default case, but there
- // is an implicit one, and the discriminant is an enum,
- // we need this to avert warnings in some compilers that
- // not all case values are included. If there is no
- // implicit default case, or the discriminator is not
- // an enum, this does no harm.
- if (node->gen_empty_default_label ())
- {
- *os << be_nl
- << "default:" << be_nl
- << "break;";
- }
-
- *os << be_uidt_nl << "}" << be_uidt_nl
- << "}";
-
- if (be_global->tc_support ())
- {
- ctx = *this->ctx_;
- // ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- TAO::be_visitor_union_typecode tc_visitor (&ctx);
-
- if (tc_visitor.visit_union (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cs::"
- "visit_union - "
- "TypeCode definition failed\n"),
- -1);
- }
- }
-
- node->cli_stub_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch.cpp
deleted file mode 100644
index 80aedbb4775..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// $Id$
-//
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_union_branch.cpp
-//
-// = DESCRIPTION
-// Concrete visitor for the base "BE_Union_Branch" node
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be_array.h"
-#include "be_enum.h"
-#include "be_interface.h"
-#include "be_interface_fwd.h"
-#include "be_predefined_type.h"
-#include "be_sequence.h"
-#include "be_string.h"
-#include "be_structure.h"
-#include "be_typedef.h"
-#include "be_union.h"
-#include "be_union_branch.h"
-#include "be_valuebox.h"
-#include "be_valuetype.h"
-#include "be_valuetype_fwd.h"
-#include "be_helper.h"
-#include "ast_union_label.h"
-#include "utl_identifier.h"
-#include "nr_extern.h"
-
-#include "be_visitor_union_branch.h"
-#include "be_visitor_array.h"
-#include "be_visitor_enum.h"
-#include "be_visitor_sequence.h"
-#include "be_visitor_structure.h"
-#include "be_visitor_union.h"
-#include "be_visitor_context.h"
-#include "ace/Log_Msg.h"
-
-#include "be_visitor_union_branch/private_ch.cpp"
-#include "be_visitor_union_branch/public_assign_cs.cpp"
-#include "be_visitor_union_branch/public_reset_cs.cpp"
-#include "be_visitor_union_branch/public_ch.cpp"
-#include "be_visitor_union_branch/public_ci.cpp"
-#include "be_visitor_union_branch/public_cs.cpp"
-#include "be_visitor_union_branch/cdr_op_ch.cpp"
-#include "be_visitor_union_branch/cdr_op_cs.cpp"
-#include "be_visitor_union_branch/serializer_op_ch.cpp"
-#include "be_visitor_union_branch/serializer_op_cs.cpp"
-
-ACE_RCSID (be,
- be_visitor_union_branch,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp
deleted file mode 100644
index 6e6507eebe3..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating CDR operator declarator for union_branch in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union_branch,
- cdr_op_ch,
- "$Id$")
-
-// **********************************************
-// Visitor for union_branch in the client header file.
-// **********************************************
-
-be_visitor_union_branch_cdr_op_ch::be_visitor_union_branch_cdr_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_union_branch_cdr_op_ch::~be_visitor_union_branch_cdr_op_ch (void)
-{
-}
-
-int
-be_visitor_union_branch_cdr_op_ch::visit_union_branch (be_union_branch *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ch::"
- "visit_union_branch - "
- "Bad union_branch type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ch::"
- "visit_union_branch - "
- "codegen for union_branch type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// Visit operations on all possible data types that a union_branch can be.
-
-int
-be_visitor_union_branch_cdr_op_ch::visit_array (be_array *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
-
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- // This is the case for anonymous arrays.
-
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- be_visitor_array_cdr_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ch::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_ch::visit_enum (be_enum *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- be_visitor_enum_cdr_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ch::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_ch::visit_sequence (be_sequence *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_sequence_cdr_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ch::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_ch::visit_structure (be_structure *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_structure_cdr_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ch::"
- "visit_struct - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_ch::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ch::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_ch::visit_union (be_union *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_union_cdr_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ch::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp
deleted file mode 100644
index dd2990bacba..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp
+++ /dev/null
@@ -1,1005 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// union_branch_cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Union_Branch in the client stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union_branch,
- cdr_op_cs,
- "$Id$")
-
-// **********************************************
-// Visitor for union_branch in the client stubs file.
-// **********************************************
-
-be_visitor_union_branch_cdr_op_cs::be_visitor_union_branch_cdr_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_union_branch_cdr_op_cs::~be_visitor_union_branch_cdr_op_cs (void)
-{
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::visit_union_branch (be_union_branch *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_union_branch - "
- "Bad union_branch type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_union_branch - "
- "codegen for union_branch type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::visit_array (be_array *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_array_cdr_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_array - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // For anonymous arrays, the type name has a _ prepended. We compute the
- // fullname with or without the underscore and use it later on.
- char fname [NAMEBUFSIZE]; // to hold the full and
-
- // Save the node's local name and full name in a buffer for quick
- // use later on.
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (!this->ctx_->alias () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // For anonymous arrays ...
- // we have to generate a name for us that has an underscore
- // prepended to our local name. This needs to be inserted after
- // the parents's name.
- if (node->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- node->full_name ());
- }
- }
- else
- {
- // Typedefed node.
- ACE_OS::sprintf (fname, "%s", node->full_name ());
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << fname << " _tao_union_tmp;" << be_nl
- << fname << "_forany _tao_union_helper ("
- << be_idt << be_idt_nl
- << "_tao_union_tmp" << be_uidt_nl
- << ");" << be_uidt_nl
- << "result = strm >> _tao_union_helper;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
-
- return 0;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << fname << "_forany _tao_union_tmp (" << be_idt << be_idt_nl
- << "_tao_union."
- << f->local_name () << " ()" << be_uidt_nl
- <<");" << be_uidt_nl
- << "result = strm << _tao_union_tmp;";
- return 0;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // This is done in cdr_op_cs.cpp and hacked into *.i.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_array - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_array - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << node->name () << " _tao_union_tmp =" << be_idt_nl
- << "static_cast<" << node->name () << "> (0UL);" << be_uidt_nl
- << "result = strm >> _tao_union_tmp;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
-
- return 0;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "result = strm << _tao_union." << f->local_name () << " ();";
- return 0;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_enum - "
- "bad sub state\n"),
- -1);
- }
-
- // Not a typedef and node is defined inside the union. Otherwise the cdr
- // operator is generated elsewhere.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_enum_cdr_op_cs visitor (&ctx);
-
- if (visitor.visit_enum (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_interface - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- if (node->is_local ())
- {
- *os << "result = false;";
- }
- else
- {
- *os << node->name () << "_var _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp.inout ();" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union."
- << f->local_name () << " (_tao_union_tmp.in ());" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
- }
-
- break;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
-
- *os << "result =" << be_idt_nl;
-
- if (f->is_abstract ())
- {
- *os << "(strm << _tao_union."
- << f->local_name () << " ());";
- }
- else
- {
- *os << "TAO::Objref_Traits<" << node->name () << ">::marshal ("
- << be_idt << be_idt_nl
- << "_tao_union." << f->local_name () << " ()," << be_nl
- << "strm" << be_uidt_nl
- << ");" << be_uidt;
- }
-
- *os << be_uidt;
-
- break;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because an interface cannot be declared inside a
- // union.
- break;
-
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_interface - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_interface_fwd - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- if (node->is_local ())
- {
- *os << "result = false;";
- }
- else
- {
- *os << node->name () << "_var _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp.inout ();" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union."
- << f->local_name () << " (_tao_union_tmp.in ());" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
- }
-
- break;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "result =" << be_idt_nl
- << "TAO::Objref_Traits<" << node->name () << ">::marshal ("
- << be_idt << be_idt_nl
- << "_tao_union." << f->local_name () << " ()," << be_nl
- << "strm" << be_uidt_nl
- << ");" << be_uidt << be_uidt;
- break;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because an interface cannot be forward declared
- // inside a union.
- break;
-
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_interface_fwd - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::visit_valuebox (be_valuebox *node)
-{
- return this->emit_valuetype_common (node);
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::visit_valuetype (be_valuetype *node)
-{
- return this->emit_valuetype_common (node);
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- return this->emit_valuetype_common (node);
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::emit_valuetype_common (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "emit_valuetype_common - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << node->name () << "_var _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp.inout ();" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union."
- << f->local_name () << " (_tao_union_tmp.in ());" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
-
- break;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "result = strm << _tao_union."
- << f->local_name () << " ();";
- break;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because an interface cannot be declared inside a
- // union.
- break;
-
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "emit_valuetype_common - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::visit_predefined_type (
- be_predefined_type *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_predefined_type - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- AST_PredefinedType::PredefinedType pt = node->pt ();
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- if (pt == AST_PredefinedType::PT_object)
- {
- *os << "::CORBA::Object_var _tao_union_tmp;" << be_nl;
-
- *os << "result = strm >> _tao_union_tmp.out ();" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name () << " (_tao_union_tmp.in ());";
-
- }
- else if (pt == AST_PredefinedType::PT_pseudo)
- {
- *os << "::CORBA::TypeCode_var _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp.out ();" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name () << " (_tao_union_tmp.in ());";
-
- }
- else if (pt == AST_PredefinedType::PT_value)
- {
- *os << "::CORBA::ValueBase * _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name () << " (_tao_union_tmp);";
-
- }
- else if (pt == AST_PredefinedType::PT_char)
- {
- *os << "::CORBA::Char _tao_union_tmp;" << be_nl
- << "::ACE_InputCDR::to_char _tao_union_helper "
- << "(_tao_union_tmp);" << be_nl
- << "result = strm >> _tao_union_helper;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);";
- }
- else if (pt == AST_PredefinedType::PT_wchar)
- {
- *os << "::CORBA::WChar _tao_union_tmp;" << be_nl
- << "::ACE_InputCDR::to_wchar _tao_union_helper "
- << "(_tao_union_tmp);" << be_nl
- << "result = strm >> _tao_union_helper;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);";
- }
- else if (pt == AST_PredefinedType::PT_octet)
- {
- *os << "::CORBA::Octet _tao_union_tmp;" << be_nl
- << "::ACE_InputCDR::to_octet _tao_union_helper "
- << "(_tao_union_tmp);" << be_nl
- << "result = strm >> _tao_union_helper;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);";
- }
- else if (pt == AST_PredefinedType::PT_boolean)
- {
- *os << "::CORBA::Boolean _tao_union_tmp;" << be_nl
- << "::ACE_InputCDR::to_boolean _tao_union_helper "
- << "(_tao_union_tmp);" << be_nl
- << "result = strm >> _tao_union_helper;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);";
- }
- else
- {
- *os << node->name () << " _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);";
- }
-
- *os << be_nl;
- *os << "_tao_union._d (_tao_discriminant);" << be_uidt_nl;
- *os << "}" << be_uidt;
-
- break;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
-
- *os << "result = ";
-
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << "strm << _tao_union." << f->local_name () << " ();";
- }
- else if (pt == AST_PredefinedType::PT_char)
- {
- *os << "strm << ::ACE_OutputCDR::from_char (_tao_union."
- << f->local_name () << " ());";
- }
- else if (pt == AST_PredefinedType::PT_wchar)
- {
- *os << "strm << ::ACE_OutputCDR::from_wchar (_tao_union."
- << f->local_name () << " ());";
- }
- else if (pt == AST_PredefinedType::PT_octet)
- {
- *os << "strm << ::ACE_OutputCDR::from_octet (_tao_union."
- << f->local_name () << " ());";
- }
- else if (pt == AST_PredefinedType::PT_boolean)
- {
- *os << "strm << ::ACE_OutputCDR::from_boolean (_tao_union."
- << f->local_name () << " ());";
- }
- else
- {
- *os << "strm << _tao_union." << f->local_name () << " ();";
- }
-
- break;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_array - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::visit_sequence (be_sequence *node)
-{
- // If the sequence is defined in this scope, generate its CDR stream
- // operators heree.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // Anonymous sequence
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_sequence_cdr_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // Now generate the CDR stream operators for the sequence as a
- // union branch.
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_sequence - "
- "cannot retrieve union_branch node\n"
- ), -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- {
- // If the typedef'd sequence is included from another
- // file, node->name() won't work. The following works
- // for all typedefs, external or not.
- be_typedef *td = this->ctx_->alias ();
-
- if (td)
- {
- *os << td->name ();
- }
- else
- {
- *os << node->name ();
- }
-
- *os << " _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union."
- << f->local_name () << " (_tao_union_tmp);" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
-
- return 0;
- }
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "result = strm << _tao_union."
- << f->local_name () << " ();";
- return 0;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_sequence - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_string - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- if (node->width () == (long) sizeof (char))
- {
- *os << "::CORBA::String_var _tao_union_tmp;" << be_nl;
- }
- else
- {
- *os << "::CORBA::WString_var _tao_union_tmp;" << be_nl;
- }
-
- *os << "result = strm >> _tao_union_tmp.out ();" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union."
- << f->local_name () << " (_tao_union_tmp);" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
-
- break;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "result = strm << _tao_union."
- << f->local_name () << " ();";
- break;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_array - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::visit_structure (be_structure *node)
-{
- // If the structure is defined in this scope. generate its CDR
- // stream operators here.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_structure_cdr_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_struct - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // How generate the CDR stream operators for the structure as
- // a union branch.
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_structure - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << node->name () << " _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
-
- return 0;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "result = strm << _tao_union."
- << f->local_name () << " ();";
- return 0;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_structure - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- // The node to be visited in the base primitve type that gets typedefed.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::visit_union (be_union *node)
-{
- // If the union is defined in this scope, generate its CDR
- // stream operators here.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_union_cdr_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_union - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // Now generate the CDR stream operators for the union as
- // a union branch.
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_union - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << node->name () << " _tao_union_tmp"
- << ";" << be_nl
- << "result = strm >> _tao_union_tmp;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt_nl;
-
- return 0;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "result = strm << _tao_union."
- << f->local_name () << " ();";
- return 0;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_union - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::explicit_default (void)
-{
- be_union *bu = be_union::narrow_from_decl (this->ctx_->scope ());
- int def_index = bu->default_index ();
-
- if (def_index != -1)
- {
- be_union_branch *ub =
- be_union_branch::narrow_from_decl (this->ctx_->node ());
-
- int i = 0;
-
- // Instantiate a scope iterator.
- for (UTL_ScopeActiveIterator si (bu, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- be_union_branch *bub = 0; // union branch node
-
- AST_Decl *d = si.item ();
-
- if (!d->imported ())
- {
- bub = be_union_branch::narrow_from_decl (d);
- }
-
- if (bub == ub)
- {
- return (i == def_index);
- }
- else
- {
- ++i;
- }
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp
deleted file mode 100644
index 41b1fd747bb..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp
+++ /dev/null
@@ -1,608 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// private_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Union branch for the private part of the
-// class.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union_branch,
- private_ch,
- "$Id$")
-
-// **********************************************
-// visitor for union_branch in the client header generating the private information
-// **********************************************
-
-// Constructor.
-be_visitor_union_branch_private_ch::be_visitor_union_branch_private_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-// Destructor.
-be_visitor_union_branch_private_ch::~be_visitor_union_branch_private_ch (void)
-{
-}
-
-// Visit the union_branch node.
-int
-be_visitor_union_branch_private_ch::visit_union_branch (be_union_branch *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_union_branch - "
- "Bad union_branch type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_union_branch - "
- "codegen for union_branch type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_array (be_array *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_array - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl;
-
- // Not a typedef and bt is defined inside the union.
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- // Case of anonymous array in union
- *os << "_" << bt->local_name () << "_slice *" << ub->local_name ()
- << "_;";
- }
- else
- {
- *os << bt->nested_type_name (bu, "_slice") << " *" << ub->local_name ()
- << "_;";
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_enum (be_enum *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_enum - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl;
-
- *os << bt->nested_type_name (bu) << " " << ub->local_name ()
- << "_;";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_interface (be_interface *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_interface - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl;
-
- *os << bt->nested_type_name (bu, "_var")
- << " *" << ub->local_name () << "_;";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_interface_fwd (be_interface_fwd *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_interface_fwd - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl;
-
- *os << bt->nested_type_name (bu, "_var")
- << " *" << ub->local_name () << "_;";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_valuebox (be_valuebox *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_valuebox - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl;
-
- *os << bt->nested_type_name (bu, "_var")
- << " *" << ub->local_name () << "_;";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_valuetype (be_valuetype *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_interface - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl;
-
- *os << bt->nested_type_name (bu, "_var")
- << " *" << ub->local_name () << "_;";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_interface_fwd - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl;
-
- *os << bt->nested_type_name (bu, "_var")
- << " *" << ub->local_name () << "_;";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_predefined_type (
- be_predefined_type *node
- )
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
- be_typedef *td = this->ctx_->alias ();
-
- // Check if we are visiting this node via a visit to a typedef node
- if (td != 0)
- {
- bt = td;
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_predefined_type - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl
- << (td == 0 ? "::" : "");
-
- if (node->pt () == AST_PredefinedType::PT_object)
- {
- *os << bt->name () << "_var"
- << " *" << ub->local_name () << "_;";
- }
- else if (node->pt () == AST_PredefinedType::PT_pseudo)
- {
- *os << bt->nested_type_name (bu, "_ptr")
- << " " << ub->local_name () << "_;";
- }
- else if (node->pt () == AST_PredefinedType::PT_value)
- {
- *os << bt->nested_type_name (bu, " *")
- << " " << ub->local_name () << "_;";
- }
- else if (node->pt () == AST_PredefinedType::PT_any)
- {
- // Cannot have an object inside of a union. In addition, an Any is a
- // variable data type.
- *os << bt->nested_type_name (bu) << " *" << ub->local_name ()
- << "_;";
- }
- else
- {
- *os << bt->nested_type_name (bu) << " " << ub->local_name ()
- << "_;";
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_sequence (be_sequence *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_sequence - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl;
-
- // C++ doesn't allow object instances inside unions, so we need a
- // pointer.
- *os << bt->nested_type_name (bu) << " *" << ub->local_name ()
- << "_;";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_string (be_string *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_string - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl;
-
- if (node->width () == (long) sizeof (char))
- {
- *os << "char *" << ub->local_name () << "_;";
- }
- else
- {
- *os << "::CORBA::WChar *" << ub->local_name () << "_;";
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_structure (be_structure *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_structure - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl;
-
- // If we are variable sized, we need a pointer type.
- if (node->size_type () == AST_Type::VARIABLE
- || node->has_constructor ())
- {
- *os << bt->nested_type_name (bu) << " *" << ub->local_name ()
- << "_;";
- }
- else
- {
- *os << bt->nested_type_name (bu) << " " << ub->local_name ()
- << "_;";
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- // The node to be visited in the base primitve type that gets typedefed.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_union (be_union *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_union - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl;
-
- // C++ doesn't allow object instances inside unions, so we need a
- // pointer.
- *os << bt->nested_type_name (bu) << " *" << ub->local_name ()
- << "_;";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp
deleted file mode 100644
index 202730f42c5..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp
+++ /dev/null
@@ -1,861 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// public_assign_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Union Branch for the assignment operator
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union_branch,
- public_assign_cs,
- "$Id$")
-
-// **********************************************
-// visitor for union_branch in the client stubs file generating the code for
-// the copy ctor and assignment operator
-// **********************************************
-
-// constructor
-be_visitor_union_branch_public_assign_cs::
-be_visitor_union_branch_public_assign_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-// destructor
-be_visitor_union_branch_public_assign_cs::
-~be_visitor_union_branch_public_assign_cs (void)
-{
-}
-
-// visit the union_branch node
-int
-be_visitor_union_branch_public_assign_cs::visit_union_branch (
- be_union_branch *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl;
-
- // This visitor is used when we are generating the copy ctor and
- // assignment operator for the union.
- // Individual assignment of the members takes place inside a case
- // statement because the type of member assigned is based on the value
- // of the discriminant
- for (unsigned long i = 0;
- i < node->label_list_length ();
- ++i)
- {
- // check if we are printing the default case
- if (node->label (i)->label_kind () == AST_UnionLabel::UL_default)
- {
- *os << "default:" << be_nl;
- }
- else
- {
- *os << "case ";
- node->gen_label_value (os, i);
- *os << ":" << be_nl;
- }
- }
-
- *os << "{" << be_idt_nl;
-
- // first generate the type information
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_assign_cs::"
- "visit_union_branch - "
- "Bad union_branch type\n"
- ), -1);
- }
-
- this->ctx_->node (node); // save the node
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_assign_cs::"
- "visit_union_branch - "
- "codegen for union_branch type failed\n"
- ), -1);
- }
-
- *os << "}" << be_nl;
- *os << "break;";
-
- return 0;
-}
-
-// =visit operations on all possible data types that a union_branch can be
-
-int
-be_visitor_union_branch_public_assign_cs::visit_array (be_array *node)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch (); // get union branch
- be_union *bu =
- this->ctx_->be_scope_as_union (); // get the enclosing union backend
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_assign_cs::"
- "visit_array - "
- "bad context information\n"
- ), -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // for anonymous arrays, the type name has a _ prepended. We compute the
- // full_name with or without the underscore and use it later on.
- char fname [NAMEBUFSIZE]; // to hold the full and
-
- // save the node's local name and full name in a buffer for quick use later
- // on
- ACE_OS::memset (fname, '\0', NAMEBUFSIZE);
-
- if (bt->node_type () != AST_Decl::NT_typedef // not a typedef
- && bt->is_child (bu)) // bt is defined inside the union
- {
- // for anonymous arrays ...
- // we have to generate a name for us that has an underscope prepended to
- // our local name. This needs to be inserted after the parents's name
-
- if (bt->is_nested ())
- {
- be_decl *parent = be_scope::narrow_from_scope (bt->defined_in ())->decl ();
- ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (),
- bt->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname, "_%s", bt->full_name ());
- }
- }
- else
- {
- // typedefed node
- ACE_OS::sprintf (fname, "%s", bt->full_name ());
- }
-
- // set the discriminant to the appropriate label
- *os << "// Make a deep copy." << be_nl;
- *os << "this->u_." << ub->local_name ()
- << "_ = " << be_idt_nl
- << fname << "_dup (u.u_."
- << ub->local_name () << "_);" << be_uidt << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_enum (be_enum *)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch (); // get union branch
- be_union *bu =
- this->ctx_->be_scope_as_union (); // get the enclosing union backend
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_assign_cs::"
- "visit_enum - "
- "bad context information\n"
- ), -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // set the discriminant to the appropriate label
- // valid label
- *os << "this->u_." << ub->local_name () << "_ = " << be_idt_nl
- << "u.u_."
- << ub->local_name () << "_;" << be_uidt << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_interface (be_interface *node)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch (); // get union branch
- be_union *bu =
- this->ctx_->be_scope_as_union (); // get the enclosing union backend
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_assign_cs::"
- "visit_interface - "
- "bad context information\n"
- ), -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- bool bt_is_defined = node->is_defined ();
-
- *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "else" << be_idt_nl
- << "{" << be_idt_nl;
-
- // So the template will work with the macro.
- *os << "typedef "
- << bt->name () << "_var OBJECT_FIELD;" << be_nl;
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_UNION_COPY_CONSTRUCTOR)
- {
- // We are generating the copy constructor.
- *os << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl;
-
- if (bt_is_defined)
- {
- *os << "OBJECT_FIELD (" << be_idt << be_idt_nl
- << bt->name () << "::_";
- }
- else
- {
- *os << "OBJECT_FIELD (" << be_idt << be_idt_nl
- << "TAO::Objref_Traits<" << node->name () << ">::";
- }
-
- *os << "duplicate (" << be_idt << be_idt_nl
- << "u.u_." << ub->local_name () << "_->in ()" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl << ")" << be_uidt << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
- }
- else
- {
- // We are generating the assignment operator.
- *os << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl;
-
- if (bt_is_defined)
- {
- *os << "OBJECT_FIELD (" << be_idt << be_idt_nl
- << bt->name () << "::_";
- }
- else
- {
- *os << "OBJECT_FIELD (" << be_idt << be_idt_nl
- << "TAO::Objref_Traits<" << node->name () << ">::";
- }
-
- *os << "duplicate (" << be_idt << be_idt_nl
- << "u.u_." << ub->local_name ()
- << "_->in ()" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl << ")," << be_uidt_nl
- << "*this" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
- }
-
- *os << "}" << be_uidt << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_interface_fwd (
- be_interface_fwd *node
- )
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch (); // get union branch
- be_union *bu =
- this->ctx_->be_scope_as_union (); // get the enclosing union backend
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_assign_cs::"
- "visit_interface_fwd - "
- "bad context information\n"
- ), -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- bool bt_is_defined = node->full_definition ()->is_defined ();
-
- *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "else" << be_idt_nl
- << "{" << be_idt_nl;
-
- // So the template will work with the macro.
- *os << "typedef "
- << bt->name () << "_var OBJECT_FIELD;" << be_nl;
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_UNION_COPY_CONSTRUCTOR)
- {
- // We are generating the copy constructor.
- *os << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl;
-
- if (bt_is_defined)
- {
- *os << "OBJECT_FIELD (" << be_idt << be_idt_nl
- << bt->name () << "::_";
- }
- else
- {
- *os << "OBJECT_FIELD (" << be_idt << be_idt_nl
- << "TAO::Objref_Traits<" << node->name () << ">::";
- }
-
- *os << "duplicate (" << be_idt << be_idt_nl
- << "u.u_." << ub->local_name () << "_->in ()" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl << ")" << be_uidt << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
- }
- else
- {
- // We are generating the assignment operator.
- *os << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl;
-
- if (bt_is_defined)
- {
- *os << "OBJECT_FIELD (" << be_idt << be_idt_nl
- << bt->name () << "::_";
- }
- else
- {
- *os << "OBJECT_FIELD (" << be_idt << be_idt_nl
- << "TAO::Objref_Traits<" << node->name () << ">::";
- }
-
- *os << "duplicate (" << be_idt << be_idt_nl
- << "u.u_." << ub->local_name ()
- << "_->in ()" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl << ")," << be_uidt_nl
- << "*this" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
- }
-
- *os << "}" << be_uidt << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_valuebox (be_valuebox *node)
-{
- return this->emit_valuetype_common (node);
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_valuetype (be_valuetype *node)
-{
- return this->emit_valuetype_common (node);
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_valuetype_fwd (
- be_valuetype_fwd *node
- )
-{
- return this->emit_valuetype_common (node);
-}
-
-int
-be_visitor_union_branch_public_assign_cs::emit_valuetype_common (be_type *node)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch (); // get union branch
- be_union *bu =
- this->ctx_->be_scope_as_union (); // get the enclosing union backend
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_assign_cs::"
- "emit_valuetype_common - "
- "bad context information\n"
- ), -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "else" << be_idt_nl
- << "{" << be_idt_nl;
-
- // So the template will work with the macro.
- *os << "typedef "
- << bt->name () << "_var OBJECT_FIELD;" << be_nl;
- *os << "::CORBA::add_ref (u.u_." << ub->local_name ()
- << "_->ptr ());" << be_nl;
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_UNION_COPY_CONSTRUCTOR)
- {
- // We are generating the copy constructor.
- *os << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << "OBJECT_FIELD (u.u_." << ub->local_name () << "_->in ())"
- << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
- }
- else
- {
- // We are generating the assignment operator.
- *os << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << "OBJECT_FIELD (u.u_." << ub->local_name () << "_->in ()),"
- << be_nl
- << "*this" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
- }
-
- *os << "}" << be_uidt << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_predefined_type (
- be_predefined_type *node
- )
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch (); // get union branch
- be_union *bu =
- this->ctx_->be_scope_as_union (); // get the enclosing union backend
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_assign_cs::"
- "visit_predefined_type - "
- "bad context information\n"
- ), -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // set the discriminant to the appropriate label
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_object:
- // So the template will work with the macro.
- *os << "typedef ::CORBA::Object_var OBJECT_FIELD;" << be_nl;
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_UNION_COPY_CONSTRUCTOR)
- {
- // We are generating the copy constructor.
- *os << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << "OBJECT_FIELD ( ::CORBA::Object"
- << "::_duplicate (u.u_." << ub->local_name ()
- << "_->in ()))" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
- }
- else
- {
- // We are generating the assignment operator.
- *os << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << "OBJECT_FIELD ( ::CORBA::Object"
- << "::_duplicate (u.u_." << ub->local_name ()
- << "_->in ()))," << be_nl
- << "*this" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
- }
-
- break;
- case AST_PredefinedType::PT_pseudo:
- *os << "this->u_." << ub->local_name () << "_ = "
- << bt->name () << "::_duplicate (u.u_."
- << ub->local_name () << "_);" << be_uidt_nl;
-
- break;
- case AST_PredefinedType::PT_any:
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_UNION_COPY_CONSTRUCTOR)
- {
- *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "else" << be_idt_nl
- << "{" << be_idt_nl
- << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << bt->name () << " (*u.u_."
- << ub->local_name () << "_)" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl;
- }
- else
- {
- *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "else" << be_idt_nl
- << "{" << be_idt_nl
- << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << bt->name () << " (*u.u_."
- << ub->local_name () << "_)," << be_nl
- << "*this" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl;
- }
-
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- *os << "this->u_." << ub->local_name () << "_ = "
- << "u.u_." << ub->local_name () << "_;" << be_uidt_nl;
-
- break;
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_sequence (be_sequence *node)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch (); // get union branch
- be_union *bu =
- this->ctx_->be_scope_as_union (); // get the enclosing union backend
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_assign_cs::"
- "visit_array - "
- "bad context information\n"
- ), -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_UNION_COPY_CONSTRUCTOR)
- {
- *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "else" << be_idt_nl
- << "{" << be_idt_nl
- << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << bt->name () << " (*u.u_."
- << ub->local_name () << "_)" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl;
- }
- else
- {
- *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "else" << be_idt_nl
- << "{" << be_idt_nl
- << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << bt->name () << " (*u.u_."
- << ub->local_name () << "_)," << be_nl
- << "*this" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl;
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_string (be_string *node)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch (); // get union branch
- be_union *bu =
- this->ctx_->be_scope_as_union (); // get the enclosing union backend
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_assign_cs::"
- "visit_array - "
- "bad context information\n"
- ), -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // set the discriminant to the appropriate label
- *os << "this->u_." << ub->local_name () << "_ = ";
-
- if (node->width () == (long) sizeof (char))
- {
- *os << "::CORBA::string_dup (u.u_.";
- }
- else
- {
- *os << "::CORBA::wstring_dup (u.u_.";
- }
-
- *os << ub->local_name () << "_);" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_structure (be_structure *node)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch (); // get union branch
- be_union *bu =
- this->ctx_->be_scope_as_union (); // get the enclosing union backend
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_assign_cs::"
- "visit_array - "
- "bad context information\n"
- ), -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (bt->size_type () == be_type::VARIABLE || node->has_constructor ())
- {
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_UNION_COPY_CONSTRUCTOR)
- {
- *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "else" << be_idt_nl
- << "{" << be_idt_nl
- << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << bt->name () << " (*u.u_."
- << ub->local_name () << "_)" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl;
- }
- else
- {
- *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "else" << be_idt_nl
- << "{" << be_idt_nl
- << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << bt->name () << " (*u.u_."
- << ub->local_name () << "_)," << be_nl
- << "*this" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl;
- }
- }
- else
- {
- *os << "this->u_." << ub->local_name () << "_ = u.u_."
- << ub->local_name () << "_;" << be_uidt_nl;
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node); // save the typedef node for use in code generation
- // as we visit the base type
-
- // the node to be visited in the base primitve type that gets typedefed
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_assign_cs::"
- "visit_typedef - "
- "Bad primitive type\n"
- ), -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_union (be_union *node)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch (); // get union branch
- be_union *bu =
- this->ctx_->be_scope_as_union (); // get the enclosing union backend
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_assign_cs::"
- "visit_array - "
- "bad context information\n"
- ), -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_UNION_COPY_CONSTRUCTOR)
- {
- *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "else" << be_idt_nl
- << "{" << be_idt_nl
- << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << bt->name () << " (*u.u_."
- << ub->local_name () << "_)" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl;
- }
- else
- {
- *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "else" << be_idt_nl
- << "{" << be_idt_nl
- << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << bt->name () << " (*u.u_."
- << ub->local_name () << "_)," << be_nl
- << "*this" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp
deleted file mode 100644
index 979a3c5f7c6..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp
+++ /dev/null
@@ -1,763 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// public_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Union_branch in the public part.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union_branch,
- public_ch,
- "$Id$")
-
-// **********************************************
-// Visitor for union_branch in the client header file.
-// **********************************************
-
-be_visitor_union_branch_public_ch::be_visitor_union_branch_public_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_union_branch_public_ch::~be_visitor_union_branch_public_ch (void)
-{
-}
-
-int
-be_visitor_union_branch_public_ch::visit_union_branch (be_union_branch *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_union_branch - "
- "Bad union_branch type\n"
- ),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_union_branch - "
- "codegen for union_branch type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// Visit operations on all possible data types that a union_branch can be.
-
-int
-be_visitor_union_branch_public_ch::visit_array (be_array *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_array - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Not a typedef and bt is defined inside the union.
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- // This is the case of an anonymous array inside a union.
-
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- ctx.state (TAO_CodeGen::TAO_ARRAY_CH);
- be_visitor_array_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_array - "
- "codegen failed\n"
- ),
- -1);
- }
-
- ctx.state (TAO_CodeGen::TAO_ROOT_CH);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Now use this array as a "type" for the subsequent declarator
- // the set method.
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " ("
- << "_" << bt->local_name () << ");" << be_nl;
- // The get method.
- *os << "_" << bt->local_name () << "_slice * " << ub->local_name ()
- << " (void) const; // get method";
- }
- else
- {
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Now use this array as a "type" for the subsequent declarator
- // the set method.
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu) << ");"
- << be_nl;
- // The get method.
- *os << bt->nested_type_name (bu, "_slice *") << " " << ub->local_name ()
- << " (void) const;";
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ch::visit_enum (be_enum *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_enum - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Not a typedef and bt is defined inside the union.
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_enum_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Now use this enum as a "type" for the subsequent declarator
- // the set method.
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu) << ");"
- << be_nl;
- // the get method.
- *os << bt->nested_type_name (bu) << " " << ub->local_name ()
- << " (void) const;";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ch::visit_interface (be_interface *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_interface - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Set method.
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu, "_ptr")
- << ");" << be_nl;
- // Get method.
- *os << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name ()
- << " (void) const;";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ch::visit_interface_fwd (be_interface_fwd *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_interface_fwd - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Set method.
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu, "_ptr")
- << ");" << be_nl;
- // Get method.
- *os << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name ()
- << " (void) const;";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ch::visit_valuebox (be_valuebox *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_valuebox - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Set method.
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu, "*")
- << ");" << be_nl;
- // Get method.
- *os << bt->nested_type_name (bu, "*") << " " << ub->local_name ()
- << " (void) const;";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ch::visit_valuetype (be_valuetype *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_valuetype - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Set method.
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu, "*")
- << ");" << be_nl;
- // Get method.
- *os << bt->nested_type_name (bu, "*") << " " << ub->local_name ()
- << " (void) const;";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ch::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_valuetype_fwd - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Set method.
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu, "*")
- << ")" << be_nl;
- // Get method.
- *os << bt->nested_type_name (bu, "*") << " " << ub->local_name ()
- << " (void) const;";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ch::visit_predefined_type (be_predefined_type *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
- be_typedef *td = this->ctx_->alias ();
-
- // Check if we are visiting this via a visit to a typedef node.
- if (td != 0)
- {
- bt = td;
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_predefined_type - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- const char *no_td_global = (td == 0 ? "::" : "");
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " (const " << no_td_global
- << bt->nested_type_name (bu, "_ptr") << ");" << be_nl;
- *os << no_td_global << bt->nested_type_name (bu, "_ptr") << " "
- << ub->local_name () << " (void) const;";
- break;
- case AST_PredefinedType::PT_value:
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " ( " << no_td_global
- << bt->nested_type_name (bu, " *") << ");" << be_nl;
- *os << no_td_global << bt->nested_type_name (bu, " *") << " "
- << ub->local_name () << " (void) const;";
- break;
- case AST_PredefinedType::PT_any:
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " (const " << no_td_global
- << bt->nested_type_name (bu) << " &);" << be_nl;
- *os << "const " << no_td_global<< bt->nested_type_name (bu) << " &"
- << ub->local_name () << " (void) const;" << be_nl;
- *os << no_td_global << bt->nested_type_name (bu) << " &"
- << ub->local_name () << " (void);";
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " ( " << no_td_global
- << bt->nested_type_name (bu) << ");" << be_nl;
- *os << no_td_global << bt->nested_type_name (bu) << " "
- << ub->local_name () << " (void) const;";
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ch::visit_sequence (be_sequence *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_sequence - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Not a typedef and bt is defined inside the union.
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_sequence_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Generate the anonymous sequence member typedef.
- // This provides a consistent name to use instead of the
- // implementation-specific name.
- *os << be_nl << be_nl
- << "typedef " << bt->nested_type_name (bu)
- << " _" << ub->local_name () << "_seq;";
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " (const "
- << bt->nested_type_name (bu) << " &);" << be_nl;
- *os << "const " << bt->nested_type_name (bu) << " &"
- << ub->local_name () << " (void) const;"
- << be_nl;
- *os << bt->nested_type_name (bu) << " &" << ub->local_name ()
- << " (void);";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ch::visit_string (be_string *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_string - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Three methods to set the string value
- if (node->width () == (long) sizeof (char))
- {
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " (char *);" << be_nl;
- *os << "void " << ub->local_name () << " (const char *);"
- << be_nl;
- *os << "void " << ub->local_name () << " (const ::CORBA::String_var&);"
- << be_nl;
- *os << "const char *" << ub->local_name ()
- << " (void) const;";
- }
- else
- {
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " ( ::CORBA::WChar *);" << be_nl;
- *os << "void " << ub->local_name () << " (const ::CORBA::WChar *);"
- << be_nl;
- *os << "void " << ub->local_name () << " (const ::CORBA::WString_var&);"
- << be_nl;
- *os << "const ::CORBA::WChar *" << ub->local_name ()
- << " (void) const;";
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ch::visit_structure (be_structure *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_structure - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Not a typedef and bt is defined inside the union.
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_structure_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_structure - "
- "codegen failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " (const "
- << bt->nested_type_name (bu) << " &);" << be_nl
- << "const " << bt->nested_type_name (bu) << " &"
- << ub->local_name () << " (void) const;"
- << be_nl
- << bt->nested_type_name (bu) << " &" << ub->local_name ()
- << " (void);";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ch::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- // Make a decision based on the primitive base type.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_spec_ch::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ch::visit_union (be_union *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_union - "
- "bad context information\n"
- ),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Not a typedef and bt is defined inside the union.
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_union_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_union - "
- "codegen failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_nl << be_nl
- << "void " << ub->local_name () << " (const "
- << bt->nested_type_name (bu) << " &);" << be_nl
- << "const " << bt->nested_type_name (bu) << " &"
- << ub->local_name () << " (void) const;"
- << be_nl
- << bt->nested_type_name (bu) << " &" << ub->local_name ()
- << " (void);";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp
deleted file mode 100644
index afcf5ee165f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp
+++ /dev/null
@@ -1,1252 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// public_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Union Branch in the client inline file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union_branch,
- public_ci,
- "$Id$")
-
-// *****************************************************
-// Visitor for union_branch in the client inline file.
-// *****************************************************
-
-// constructor
-be_visitor_union_branch_public_ci::be_visitor_union_branch_public_ci (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-// destructor
-be_visitor_union_branch_public_ci::~be_visitor_union_branch_public_ci (void)
-{
-}
-
-// visit the union_branch node
-int
-be_visitor_union_branch_public_ci::visit_union_branch (be_union_branch *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cs::"
- "visit_union_branch - "
- "Bad union_branch type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cs::"
- "visit_union_branch - "
- "codegen for union_branch type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// Visit operations on all possible data types that a union_branch can be.
-
-int
-be_visitor_union_branch_public_ci::visit_array (be_array *node)
-{
- be_union_branch *ub = this->ctx_->be_node_as_union_branch ();
- be_union *bu = this->ctx_->be_scope_as_union ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_enum - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // If bt is not a typedef and is defined inside the union.
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
-
- // Set the node to be the node being visited. Scope is still the same.
- ctx.node (node);
-
- // First generate the inline operations for this anonymous array type.
- be_visitor_array_ci visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // For anonymous arrays, the type name has a _ prepended. We compute the
- // full_name with or without the underscore and use it later on.
- char fname [NAMEBUFSIZE];
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- // If bt is not a typedef and is defined inside the union
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- // For anonymous arrays ...
- // We have to generate a name for us that has an underscope prepended to
- // our local name. This needs to be inserted after the parents's name.
-
- if (bt->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (bt->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- bt->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- bt->full_name ());
- }
- }
- else
- {
- // Typedefed node.
- ACE_OS::sprintf (fname,
- "%s",
- bt->full_name ());
- }
-
- // Set method.
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "// Accessor to set the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << bu->name () << "::" << ub->local_name () << " (" << fname
- << " val)" << be_nl
- << "{" << be_idt_nl
- << "// Set the discriminant value." << be_nl
- << "this->_reset ();" << be_nl
- << "this->disc_ = ";
-
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- ub->gen_label_value (os);
- }
- // Default label.
- else
- {
- ub->gen_default_label_value (os, bu);
- }
-
- *os << ";" << be_nl
- << "// Set the value." << be_nl
- << "this->u_." << ub->local_name () << "_ = "
- << fname << "_dup (val);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Get method.
- *os << "/// Retrieve the member." << be_nl
- << "ACE_INLINE" << be_nl
- << fname << "_slice *" << be_nl
- << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_enum (be_enum *node)
-{
- be_union_branch *ub = this->ctx_->be_node_as_union_branch ();
- be_union *bu = this->ctx_->be_scope_as_union ();
- be_type *bt;
-
- // heck if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_enum - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Set method.
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "/// Accessor to set the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << bu->name () << "::" << ub->local_name () << " (" << bt->name ()
- << " val)" << be_nl
- << "{" << be_idt_nl
- << "// Set the discriminant value." << be_nl
- << "this->_reset ();" << be_nl
- << "this->disc_ = ";
-
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- ub->gen_label_value (os);
- }
- // Default label.
- else
- {
- ub->gen_default_label_value (os, bu);
- }
-
- *os << ";" << be_nl
- << "// Set the value." << be_nl
- << "this->u_." << ub->local_name () << "_ = val;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Get method.
- *os << "/// Retrieve the member." << be_nl
- << "ACE_INLINE" << be_nl
- << bt->name () << be_nl
- << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_interface (be_interface *node)
-{
- be_union_branch *ub = this->ctx_->be_node_as_union_branch ();
- be_union *bu = this->ctx_->be_scope_as_union ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_interface - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Set method.
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "/// Accessor to set the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << bu->name () << "::" << ub->local_name () << " (" << bt->name ()
- << "_ptr val)" << be_nl
- << "{" << be_idt_nl
- << "// Set the discriminant value." << be_nl
- << "this->_reset ();" << be_nl
- << "this->disc_ = ";
-
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- ub->gen_label_value (os);
- }
- // Default label.
- else
- {
- ub->gen_default_label_value (os, bu);
- }
-
- bool bt_is_defined = node->is_defined ();
-
- *os << ";" << be_nl
- << "typedef "
- << bt->nested_type_name (bu, "_var")
- << " OBJECT_FIELD;" << be_nl
- << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl;
-
- if (bt_is_defined)
- {
- *os << "OBJECT_FIELD (" << be_idt << be_idt_nl
- << bt->name () << "::_";
- }
- else
- {
- *os << "OBJECT_FIELD (" << be_idt << be_idt_nl
- << "TAO::Objref_Traits<" << node->name () << ">::";
- }
-
- *os << "duplicate (val)" << be_uidt_nl << ")" << be_uidt << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Get method.
- *os << "/// Retrieve the member." << be_nl
- << "ACE_INLINE" << be_nl
- << bt->name () << "_ptr " << be_nl
- << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->u_." << ub->local_name () << "_->in ();" << be_uidt_nl
- << "}";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_interface_fwd (be_interface_fwd *node)
-{
- be_union_branch *ub = this->ctx_->be_node_as_union_branch ();
- be_union *bu = this->ctx_->be_scope_as_union ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_interface_fwd - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Set method.
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "/// Accessor to set the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << bu->name () << "::" << ub->local_name () << " (" << bt->name ()
- << "_ptr val)" << be_nl
- << "{" << be_idt_nl
- << "// Set the discriminant value." << be_nl
- << "this->_reset ();" << be_nl
- << "this->disc_ = ";
-
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- ub->gen_label_value (os);
- }
- // Default label.
- else
- {
- ub->gen_default_label_value (os, bu);
- }
-
- bool bt_is_defined = node->full_definition ()->is_defined ();
-
- *os << ";" << be_nl
- << "typedef "
- << bt->nested_type_name (bu, "_var")
- << " OBJECT_FIELD;" << be_nl
- << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl;
-
- if (bt_is_defined)
- {
- *os << "OBJECT_FIELD (" << be_idt << be_idt_nl
- << bt->name () << "::_";
- }
- else
- {
- *os << "OBJECT_FIELD (" << be_idt << be_idt_nl
- << "TAO::Objref_Traits<" << node->name () << ">::";
- }
-
- *os << "duplicate (val)" << be_uidt_nl << ")" << be_uidt << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Get method.
- *os << "/// Retrieve the member." << be_nl
- << "ACE_INLINE" << be_nl
- << bt->name () << "_ptr " << be_nl
- << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->u_." << ub->local_name () << "_->in ();" << be_uidt_nl
- << "}";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_valuebox (be_valuebox *node)
-{
- return this->emit_valuetype_common (node);
-}
-
-int
-be_visitor_union_branch_public_ci::visit_valuetype (be_valuetype *node)
-{
- return this->emit_valuetype_common (node);
-}
-
-int
-be_visitor_union_branch_public_ci::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- return this->emit_valuetype_common (node);
-}
-
-int
-be_visitor_union_branch_public_ci::emit_valuetype_common (be_type *node)
-{
- be_union_branch *ub = this->ctx_->be_node_as_union_branch ();
- be_union *bu = this->ctx_->be_scope_as_union ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "emit_valuetype_common - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Set method.
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "// Accessor to set the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << bu->name () << "::" << ub->local_name () << " (" << bt->name ()
- << " *val)" << be_nl
- << "{" << be_idt_nl
- << "// Set the discriminant value." << be_nl
- << "this->_reset ();" << be_nl
- << "this->disc_ = ";
-
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- ub->gen_label_value (os);
- }
- // Default label.
- else
- {
- ub->gen_default_label_value (os, bu);
- }
-
- *os << ";" << be_nl
- << "::CORBA::add_ref (val);" << be_nl
- << "typedef "
- << bt->nested_type_name (bu, "_var")
- << " OBJECT_FIELD;" << be_nl
- << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << "OBJECT_FIELD (val)" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Get method.
- *os << "/// Retrieve the member." << be_nl
- << "ACE_INLINE" << be_nl
- << bt->name () << "* " << be_nl
- << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->u_." << ub->local_name () << "_->in ();" << be_uidt_nl
- << "}";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_predefined_type (
- be_predefined_type *node
- )
-{
- be_union_branch *ub = this->ctx_->be_node_as_union_branch ();
- be_union *bu = this->ctx_->be_scope_as_union ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_interface - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Set method.
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "// Accessor to set the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << bu->name () << "::" << ub->local_name () << " (";
-
-
- AST_PredefinedType::PredefinedType pt = node->pt ();
-
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << "const ::" << bt->name () << "_ptr";
- }
- else if (pt == AST_PredefinedType::PT_value)
- {
- *os << "::" << bt->name () << " *";
- }
- else if (pt == AST_PredefinedType::PT_any)
- {
- *os << "const ::" << bt->name () << " &";
- }
- else
- {
- *os << bt->name ();
- }
-
- *os << " val)" << be_nl
- << "{" << be_idt_nl
- << "// Set the discriminant value." << be_nl
- << "this->_reset ();" << be_nl
- << "this->disc_ = ";
-
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- ub->gen_label_value (os);
- }
- else
- // We have an explicit default case.
- {
- ub->gen_default_label_value (os, bu);
- }
-
- *os << ";" << be_nl;
-
- switch (pt)
- {
- case AST_PredefinedType::PT_object:
- *os << "typedef ::CORBA::Object_var OBJECT_FIELD;" << be_nl
- << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << "OBJECT_FIELD ( ::CORBA::Object::_duplicate (val))"
- << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
-
- break;
- case AST_PredefinedType::PT_pseudo:
- *os << "this->u_." << ub->local_name () << "_ = ::"
- << bt->name () << "::_duplicate (val);" << be_uidt_nl;
-
- break;
- case AST_PredefinedType::PT_value:
- *os << "::CORBA::add_ref (val);" << be_nl
- << "this->u_." << ub->local_name ()
- << "_ = val;" << be_uidt_nl;
-
- break;
- case AST_PredefinedType::PT_any:
- *os << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name ()
- << "_," << be_nl
- << "::" << bt->name () << " (val)" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
-
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- *os << "// Set the value." << be_nl
- << "this->u_." << ub->local_name ()
- << "_ = val;" << be_uidt_nl;
-
- break;
- }
-
- *os << "}" << be_nl << be_nl;
-
- switch (pt)
- {
- case AST_PredefinedType::PT_object:
- // Get method.
- *os << "/// Retrieve the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "::" << bt->name () << "_ptr" << be_nl
- << bu->name () << "::" << ub->local_name ()
- << " (void) const" << be_nl
- << "{" << be_idt_nl;
- *os << "return this->u_." << ub->local_name ()
- << "_->in ();" << be_uidt_nl;
- *os << "}";
-
- break;
- case AST_PredefinedType::PT_pseudo:
- // Get method.
- *os << "/// Retrieve the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "::" << bt->name () << "_ptr" << be_nl
- << bu->name () << "::" << ub->local_name ()
- << " (void) const" << be_nl
- << "{" << be_idt_nl;
- *os << "return this->u_." << ub->local_name ()
- << "_;" << be_uidt_nl;
- *os << "}";
-
- break;
- case AST_PredefinedType::PT_value:
- // Get method.
- *os << "/// Retrieve the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "::" << bt->name () << " *" << be_nl
- << bu->name () << "::" << ub->local_name ()
- << " (void) const" << be_nl
- << "{" << be_idt_nl;
- *os << "return this->u_." << ub->local_name ()
- << "_;" << be_uidt_nl;
- *os << "}";
-
- break;
- case AST_PredefinedType::PT_any:
- // Get method with read-only access.
- *os << "/// Retrieve the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "const ::" << bt->name () << " &" << be_nl
- << bu->name () << "::" << ub->local_name ()
- << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Get method with read/write access
- *os << "/// Retrieve the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "::" << bt->name () << " &" << be_nl
- << bu->name () << "::" << ub->local_name ()
- << " (void)" << be_nl
- << "{" << be_idt_nl
- << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}";
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- // Get method.
- *os << "/// Retrieve the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "::" << bt->name () << be_nl
- << bu->name () << "::" << ub->local_name ()
- << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}";
-
- break;
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_sequence (be_sequence *node)
-{
- be_union_branch *ub = this->ctx_->be_node_as_union_branch ();
- be_union *bu = this->ctx_->be_scope_as_union ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_sequence - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // (1) Set from a const.
- *os << "/// Accessor to set the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << bu->name () << "::" << ub->local_name ()
- << " (const " << bt->name () << " &val)" << be_nl
- << "{" << be_idt_nl
- << "// Set the discriminant value." << be_nl
- << "this->_reset ();" << be_nl
- << "this->disc_ = ";
-
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- ub->gen_label_value (os);
- }
- else
- // We have an explicit default case.
- {
- ub->gen_default_label_value (os, bu);
- }
-
- *os << ";" << be_nl
- << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << bt->name () << " (val)" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Readonly get method.
- *os << "/// Readonly get method." << be_nl
- << "ACE_INLINE" << be_nl
- << "const " << bt->name () << " &" << be_nl
- << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Read/write get method.
- *os << "/// Read/write get method." << be_nl
- << "ACE_INLINE" << be_nl
- << bt->name () << " &" << be_nl
- << bu->name () << "::" << ub->local_name () << " (void)" << be_nl
- << "{" << be_idt_nl
- << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_string (be_string *node)
-{
- be_union_branch *ub = this->ctx_->be_node_as_union_branch ();
- be_union *bu = this->ctx_->be_scope_as_union ();
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_string - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Three methods to set the string value.
-
- // (1) Set method from char* or wchar*.
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "/// Accessor to set the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl;
-
- if (node->width () == (long) sizeof (char))
- {
- *os << bu->name () << "::" << ub->local_name () << " (char *val)";
- }
- else
- {
- *os << bu->name () << "::" << ub->local_name ()
- << " ( ::CORBA::WChar *val)";
- }
-
- *os << be_nl
- << "{" << be_idt_nl
- << "// Set the discriminant value." << be_nl
- << "this->_reset ();" << be_nl
- << "this->disc_ = ";
-
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- ub->gen_label_value (os);
- }
- else
- // We have an explicit default case.
- {
- ub->gen_default_label_value (os, bu);
- }
-
- *os << ";" << be_nl
- << "this->u_." << ub->local_name () << "_ = val;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // (2) Set method from const char * or const wchar *.
- *os << "// Accessor to set the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << bu->name () << "::" << ub->local_name ();
-
- if (node->width () == (long) sizeof (char))
- {
- *os << " (const char *val)" << be_nl << "{" << be_idt_nl;
- }
- else
- {
- *os << " (const ::CORBA::WChar *val)" << be_nl << "{" << be_idt_nl;
- }
-
- *os << "// Set the discriminant value." << be_nl
- << "this->_reset ();" << be_nl
- << "this->disc_ = ";
-
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- ub->gen_label_value (os);
- }
- else
- // We have an explicit default case.
- {
- ub->gen_default_label_value (os, bu);
- }
-
- *os << ";" << be_nl
- << "// Set the value." << be_nl
- << "this->u_." << ub->local_name () << "_ = ";
-
- if (node->width () == (long) sizeof (char))
- {
- *os << "::CORBA::string_dup (val);" << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
- else
- {
- *os << "::CORBA::wstring_dup (val);" << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
-
- // (3) Set from const String_var& or WString_var&
- *os << "/// Accessor to set the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << bu->name () << "::" << ub->local_name ();
-
- if (node->width () == (long) sizeof (char))
- {
- *os << " (const ::CORBA::String_var &val)" << be_nl;
- }
- else
- {
- *os << " (const ::CORBA::WString_var &val)" << be_nl;
- }
-
- *os << "{" << be_idt_nl
- << "// Set the discriminant value." << be_nl
- << "this->_reset ();" << be_nl
- << "this->disc_ = ";
-
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- ub->gen_label_value (os);
- }
- else
- // We have an explicit default case.
- {
- ub->gen_default_label_value (os, bu);
- }
-
- *os << ";" << be_nl
- << "// Set the value." << be_nl;
-
- if (node->width () == (long) sizeof (char))
- {
- *os << "::CORBA::String_var " << ub->local_name ();
- }
- else
- {
- *os << "::CORBA::WString_var " << ub->local_name ();
- }
-
- *os << "_var = val;" << be_nl
- << "this->u_." << ub->local_name () << "_ = "
- << ub->local_name () << "_var._retn ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "ACE_INLINE" << be_nl;
-
- // Get method.
- if (node->width () == (long) sizeof (char))
- {
- *os << "const char *" << be_nl;
- }
- else
- {
- *os << "const ::CORBA::WChar *" << be_nl;
- }
-
- *os << bu->name () << "::" << ub->local_name ()
- << " (void) const // get method" << be_nl
- << "{" << be_idt_nl
- << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_structure (be_structure *node)
-{
- be_union_branch *ub = this->ctx_->be_node_as_union_branch ();
- be_union *bu = this->ctx_->be_scope_as_union ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_structure - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // If bt is not a typedef and is defined inside the union
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
-
- // Set the node to be the node being visited. Scope is still the same.
- ctx.node (node);
-
- // First generate the struct declaration
- be_visitor_structure_ci visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_structure - "
- "codegen failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // (1) Set from a const.
- *os << "/// Accessor to set the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << bu->name () << "::" << ub->local_name ()
- << " (const " << bt->name () << " &val)" << be_nl
- << "{" << be_idt_nl
- << "// Set the discriminant value." << be_nl
- << "this->_reset ();" << be_nl
- << "this->disc_ = ";
-
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- ub->gen_label_value (os);
- }
- else
- // We have an explicit default case.
- {
- ub->gen_default_label_value (os, bu);
- }
-
- *os << ";" << be_nl;
-
- if (bt->size_type () == be_type::VARIABLE
- || node->has_constructor ())
- {
- *os << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << bt->name () << " (val)" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
- }
- else
- {
- *os << "this->u_." << ub->local_name () << "_ = val;" << be_uidt_nl;
- }
-
- *os << "}" << be_nl << be_nl;
-
- // Readonly get method.
- *os << "// Readonly get method." << be_nl
- << "ACE_INLINE" << be_nl
- << "const " << bt->name () << " &" << be_nl
- << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl
- << "{" << be_idt_nl;
-
- if (bt->size_type () == be_type::VARIABLE
- || node->has_constructor ())
- {
- *os << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl;
- }
- else
- {
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
- }
-
- *os << "}" << be_nl << be_nl;
-
- // Read/write get method.
- *os << "// Read/write get method." << be_nl
- << "ACE_INLINE" << be_nl
- << bt->name () << " &" << be_nl
- << bu->name () << "::" << ub->local_name () << " (void)" << be_nl
- << "{" << be_idt_nl;
-
- if (bt->size_type () == be_type::VARIABLE
- || node->has_constructor ())
- {
- *os << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl;
- }
- else
- {
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
- }
-
- *os << "}";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_typedef (be_typedef *node)
-{
- // Save the typedef node for use in code generation.
- this->ctx_->alias (node);
-
- // The node to be visited in the base primitve type that gets typedefed.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_union (be_union *node)
-{
- be_union_branch *ub = this->ctx_->be_node_as_union_branch ();
- be_union *bu = this->ctx_->be_scope_as_union ();
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_union - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // If bt is not a typedef and is defined inside the union
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
-
- // Set the node to be the node being visited. Scope is still the same.
- ctx.node (node);
-
- // First generate the union declaration.
- be_visitor_union_ci visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_union - "
- "codegen failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // (1) Set from a const.
- *os << "// Accessor to set the member." << be_nl
- << "ACE_INLINE" << be_nl
- << "void" << be_nl
- << bu->name () << "::" << ub->local_name ()
- << " (const " << bt->name () << " &val)" << be_nl
- << "{" << be_idt_nl
- << "// Set the discriminant value." << be_nl
- << "this->_reset ();" << be_nl
- << "this->disc_ = ";
-
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- ub->gen_label_value (os);
- }
- else
- // We have an explicit default case.
- {
- ub->gen_default_label_value (os, bu);
- }
-
- *os << ";" << be_nl
- << "ACE_NEW (" << be_idt << be_idt_nl
- << "this->u_." << ub->local_name () << "_," << be_nl
- << bt->name () << " (val)" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Readonly get method.
- *os << "// Readonly get method." << be_nl
- << "ACE_INLINE" << be_nl
- << "const " << bt->name () << " &" << be_nl
- << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Read/write get method.
- *os << "// Read/write get method." << be_nl
- << "ACE_INLINE" << be_nl
- << bt->name () << " &" << be_nl
- << bu->name () << "::" << ub->local_name () << " (void)" << be_nl
- << "{" << be_idt_nl
- << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_cs.cpp
deleted file mode 100644
index 5e4507d8ca6..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_cs.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// public_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Union Branch in the client stubs
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union_branch,
- public_cs,
- "$Id$")
-
-// **********************************************
-// Visitor for union_branch in the client stubs file.
-// **********************************************
-
-be_visitor_union_branch_public_cs::be_visitor_union_branch_public_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_union_branch_public_cs::~be_visitor_union_branch_public_cs (void)
-{
-}
-
-int
-be_visitor_union_branch_public_cs::visit_union_branch (be_union_branch *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_union_branch - "
- "Bad union_branch type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_union_branch - "
- "codegen for union_branch type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_cs::visit_array (be_array *node)
-{
- // If not a typedef and we are defined in the use scope, we must be
- // defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- // Anonymous array case.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_array_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_cs::visit_enum (be_enum *node)
-{
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_enum_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_cs::visit_sequence (be_sequence *node)
-{
- // If not a typedef and we are defined in the use scope, we must be
- // defined.
-
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- // Anonymous sequence case.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_sequence_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_cs::visit_string (be_string *)
-{
- return 0;
-}
-
-int
-be_visitor_union_branch_public_cs::visit_structure (be_structure *node)
-{
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_structure_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_struct - "
- "codegen failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_cs::visit_union (be_union *node)
-{
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_union_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_union - "
- "codegen failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp
deleted file mode 100644
index 37a40381b20..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp
+++ /dev/null
@@ -1,542 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// public_reset_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Union Branch in the client inline file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union_branch,
- public_reset_cs,
- "$Id$")
-
-// *****************************************************
-// visitor for union_branch in the client
-// stubs file for the reset method
-// *****************************************************
-
-be_visitor_union_branch_public_reset_cs::
-be_visitor_union_branch_public_reset_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_union_branch_public_reset_cs::
-~be_visitor_union_branch_public_reset_cs (void)
-{
-}
-
-// visit the union_branch node
-int
-be_visitor_union_branch_public_reset_cs::visit_union_branch (
- be_union_branch *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cs::"
- "visit_union_branch - "
- "Bad union_branch type\n"),
- -1);
- }
-
- this->ctx_->node (node); // save the node
-
- *os << be_nl;
-
- for (unsigned long i = 0; i < node->label_list_length (); ++i)
- {
- // check if we are printing the default case
- if (node->label (i)->label_kind () == AST_UnionLabel::UL_default)
- {
- *os << "default:";
- }
- else
- {
- *os << "case ";
- node->gen_label_value (os, i);
- *os << ":";
- }
- if (i == (node->label_list_length () - 1))
- *os << be_idt_nl;
- else
- *os << be_nl;
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cs::"
- "visit_union_branch - "
- "codegen for union_branch type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_reset_cs::visit_array (be_array *node)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch ();
- be_union *bu =
- this->ctx_->be_scope_as_union ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_reset_cs::"
- "visit_enum - "
- "bad context information\n"),
- -1);
- }
-
- // For anonymous arrays, the type name has a _ prepended. We compute the
- // full_name with or without the underscore and use it later on.
- char fname [NAMEBUFSIZE]; // to hold the full and.
-
- // save the node's local name and full name in a buffer for quick use later
- // on
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (bt->node_type () != AST_Decl::NT_typedef // not a typedef
- && bt->is_child (bu)) // bt is defined inside the union
- {
- // For anonymous arrays ...
- // We have to generate a name for us that has an underscope prepended to
- // our local name. This needs to be inserted after the parents's name.
-
- if (bt->is_nested ())
- {
- be_decl *parent = be_scope::narrow_from_scope (bt->defined_in ())->decl ();
- ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (),
- bt->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname, "_%s", bt->full_name ());
- }
- }
- else
- {
- ACE_OS::sprintf (fname, "%s", bt->full_name ());
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << fname << "_free (this->u_." << ub->local_name ()
- << "_);" << be_nl
- << "this->u_." << ub->local_name () << "_ = 0;" << be_nl
- << "break;" << be_uidt;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_reset_cs::visit_enum (be_enum *)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch ();
- be_union *bu =
- this->ctx_->be_scope_as_union ();
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_reset_cs::"
- "visit_enum - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- *os << "break;" << be_uidt;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_reset_cs::visit_interface (be_interface *)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch ();
- be_union *bu =
- this->ctx_->be_scope_as_union ();
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_reset_cs::"
- "visit_interface - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "delete this->u_."
- << ub->local_name () << "_;" << be_nl
- << "this->u_." << ub->local_name ()
- << "_ = 0;" << be_nl
- << "break;" << be_uidt;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_reset_cs::visit_interface_fwd (be_interface_fwd *)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch ();
- be_union *bu =
- this->ctx_->be_scope_as_union ();
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_reset_cs::"
- "visit_interface_fwd - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "delete this->u_."
- << ub->local_name () << "_;" << be_nl
- << "this->u_." << ub->local_name ()
- << "_ = 0;" << be_nl
- << "break;" << be_uidt;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_reset_cs::visit_valuebox (be_valuebox *)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch ();
- be_union *bu =
- this->ctx_->be_scope_as_union ();
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_reset_cs::"
- "visit_valuebox - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "delete this->u_."
- << ub->local_name () << "_;" << be_nl
- << "this->u_." << ub->local_name ()
- << "_ = 0;" << be_nl
- << "break;" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_reset_cs::visit_valuetype (be_valuetype *)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch ();
- be_union *bu =
- this->ctx_->be_scope_as_union ();
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_reset_cs::"
- "visit_valuetype - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "delete this->u_."
- << ub->local_name () << "_;" << be_nl
- << "this->u_." << ub->local_name ()
- << "_ = 0;" << be_nl
- << "break;" << be_uidt;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_reset_cs::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch ();
- be_union *bu =
- this->ctx_->be_scope_as_union ();
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_reset_cs::"
- "visit_valuetype_fwd - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "delete this->u_."
- << ub->local_name () << "_;" << be_nl
- << "this->u_." << ub->local_name ()
- << "_ = 0;" << be_nl
- << "break;" << be_uidt;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_reset_cs::visit_predefined_type (
- be_predefined_type *node
- )
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch ();
- be_union *bu =
- this->ctx_->be_scope_as_union ();
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_reset_cs::"
- "visit_predefined_type - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_object:
- *os << "delete this->u_."
- << ub->local_name () << "_;" << be_nl;
- *os << "this->u_." << ub->local_name ()
- << "_ = 0;" << be_nl
- << "break;" << be_uidt;
-
- break;
- case AST_PredefinedType::PT_pseudo:
- *os << "::CORBA::release (this->u_."
- << ub->local_name () << "_);" << be_nl;
- *os << "this->u_." << ub->local_name ()
- << "_ = 0;" << be_nl
- << "break;" << be_uidt;
-
- break;
- case AST_PredefinedType::PT_any:
- *os << "delete this->u_."
- << ub->local_name () << "_;" << be_nl
- << "this->u_." << ub->local_name ()
- << "_ = 0;" << be_nl
- << "break;" << be_uidt;
-
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- *os << "break;" << be_uidt;
-
- break;
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_reset_cs::visit_sequence (be_sequence *)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch ();
- be_union *bu =
- this->ctx_->be_scope_as_union ();
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_reset_cs::"
- "visit_sequence - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "delete this->u_."
- << ub->local_name () << "_;" << be_nl
- << "this->u_."
- << ub->local_name ()
- << "_ = 0;" << be_nl
- << "break;" << be_uidt;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_reset_cs::visit_string (be_string *node)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch ();
- be_union *bu =
- this->ctx_->be_scope_as_union ();
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_reset_cs::"
- "visit_string - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (node->width () == (long) sizeof (char))
- {
- *os << "::CORBA::string_free (this->u_.";
- }
- else
- {
- *os << "::CORBA::wstring_free (this->u_.";
- }
-
- *os << ub->local_name () << "_);" << be_nl
- << "this->u_."
- << ub->local_name ()
- << "_ = 0;" << be_nl
- << "break;" << be_uidt;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_reset_cs::visit_structure (be_structure *node)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch ();
- be_union *bu =
- this->ctx_->be_scope_as_union ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_reset_cs::"
- "visit_structure - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (bt->size_type () == be_type::VARIABLE
- || node->has_constructor ())
- {
- *os << "delete this->u_." << ub->local_name ()
- << "_;" << be_nl
- << "this->u_."
- << ub->local_name ()
- << "_ = 0;" << be_nl;
- }
-
- *os << "break;" << be_uidt;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_reset_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- // The node to be visited in the base primitve type that gets typedefed.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_reset_cs::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_union_branch_public_reset_cs::visit_union (be_union *)
-{
- be_union_branch *ub =
- this->ctx_->be_node_as_union_branch ();
- be_union *bu =
- this->ctx_->be_scope_as_union ();
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_reset_cs::"
- "visit_union - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "delete this->u_."
- << ub->local_name () << "_;" << be_nl
- << "this->u_."
- << ub->local_name () << "_ = 0;" << be_nl
- << "break;" << be_uidt;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/serializer_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/serializer_op_ch.cpp
deleted file mode 100644
index 5369b1d1d8a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/serializer_op_ch.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// serializer_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating Serializer operator declarator for union_branch
-// in the client header
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union_branch,
- serializer_op_ch,
- "$Id$")
-
-// **********************************************
-// Visitor for union_branch in the client header file.
-// **********************************************
-
-be_visitor_union_branch_serializer_op_ch::be_visitor_union_branch_serializer_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_union_branch_serializer_op_ch::~be_visitor_union_branch_serializer_op_ch (void)
-{
-}
-
-int
-be_visitor_union_branch_serializer_op_ch::visit_union_branch (be_union_branch *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_ch::"
- "visit_union_branch - "
- "Bad union_branch type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_ch::"
- "visit_union_branch - "
- "codegen for union_branch type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// Visit operations on all possible data types that a union_branch can be.
-
-int
-be_visitor_union_branch_serializer_op_ch::visit_array (be_array *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
-
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- // This is the case for anonymous arrays.
-
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- be_visitor_array_serializer_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_ch::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_ch::visit_enum (be_enum *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- be_visitor_enum_serializer_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_ch::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_ch::visit_sequence (be_sequence *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_sequence_serializer_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_ch::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_ch::visit_structure (be_structure *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_structure_serializer_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_ch::"
- "visit_struct - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_ch::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_ch::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_ch::visit_union (be_union *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_union_serializer_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_ch::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/serializer_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/serializer_op_cs.cpp
deleted file mode 100644
index 41c4c88334e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/serializer_op_cs.cpp
+++ /dev/null
@@ -1,1319 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// union_branch/serializer_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Union_Branch in the client stubs file.
-//
-// = AUTHOR
-// Scott Harris <harris_s@ociweb.com> based on code by Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union_branch,
- serializer_op_cs,
- "$Id$")
-
-// **********************************************
-// Visitor for union_branch in the client stubs file.
-// **********************************************
-
-be_visitor_union_branch_serializer_op_cs::be_visitor_union_branch_serializer_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_union_branch_serializer_op_cs::~be_visitor_union_branch_serializer_op_cs (void)
-{
-}
-
-int
-be_visitor_union_branch_serializer_op_cs::visit_union_branch (be_union_branch *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_union_branch - "
- "Bad union_branch type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_union_branch - "
- "codegen for union_branch type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_cs::visit_array (be_array *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_array_serializer_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_array - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // For anonymous arrays, the type name has a _ prepended. We compute the
- // fullname with or without the underscore and use it later on.
- char fname [NAMEBUFSIZE]; // to hold the full and
-
- // Save the node's local name and full name in a buffer for quick
- // use later on.
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (!this->ctx_->alias () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // For anonymous arrays ...
- // we have to generate a name for us that has an underscore
- // prepended to our local name. This needs to be inserted after
- // the parents's name.
- if (node->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- node->full_name ());
- }
- }
- else
- {
- // Typedefed node.
- ACE_OS::sprintf (fname, "%s", node->full_name ());
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- {
- //SHH - TBD - could avoid the counter by enclosing in {}
- // But this code is currently dead anyway because
- // unions always return false for _dcps_is_bounded and a large
- // number for _dcsp_max_marshaled_size.
- // This note applies to multiple locations in this file.
- static int tmp_counter = 0;
- char tmp_val_name[30];
- ACE_OS::sprintf(tmp_val_name, "tmp_array_val%d", tmp_counter++);
- *os << fname << "_forany " << tmp_val_name << " (" << be_idt << be_idt_nl
- << "_tao_union."
- << f->local_name () << " ()" << be_uidt_nl
- <<");" << be_uidt_nl;
- *os << "is_bounded = is_bounded && "
- << "_tao_is_bounded_size (" << tmp_val_name << ");"
- << be_nl;
- }
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- {
- static int tmp_counter = 0;
- char tmp_size_name[30];
- char tmp_val_name[30];
- ACE_OS::sprintf(tmp_size_name, "tmp_array_size%d", tmp_counter);
- ACE_OS::sprintf(tmp_val_name, "tmp_array_val%d", tmp_counter++);
- *os << f->field_type ()->name() << "_forany " << tmp_val_name
- << "; // is type of " << f->local_name () << be_nl;
- *os << "size_t " << tmp_size_name
- << " = _dcps_max_marshaled_size (" << tmp_val_name << ");" << be_nl
- << "if (" << tmp_size_name << " > max_size) " << be_idt_nl
- << "max_size = " << tmp_size_name << ";" << be_uidt_nl << be_nl;
- }
- break;
- case TAO_CodeGen::TAO_FIND_SIZE:
- *os << fname << "_forany _tao_union_tmp (" << be_idt << be_idt_nl
- << "_tao_union."
- << f->local_name () << " ()" << be_uidt_nl
- <<");" << be_uidt_nl;
- *os << "result += _dcps_find_size (_tao_union_tmp);";
- break;
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << fname << " _tao_union_tmp;" << be_nl
- << fname << "_forany _tao_union_helper ("
- << be_idt << be_idt_nl
- << "_tao_union_tmp" << be_uidt_nl
- << ");" << be_uidt_nl
- << "result = strm >> _tao_union_helper;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
-
- return 0;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << fname << "_forany _tao_union_tmp (" << be_idt << be_idt_nl
- << "_tao_union."
- << f->local_name () << " ()" << be_uidt_nl
- <<");" << be_uidt_nl
- << "result = strm << _tao_union_tmp;";
- return 0;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // This is done in serializer_op_cs.cpp and hacked into *.i.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_array - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_cs::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_array - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- *os << "// " << f->local_name ()
- << " is of an enum type; hence is bounded" << be_nl;
- return 0; // all done
- break;
- case TAO_CodeGen::TAO_FIND_SIZE:
- // enums are serialized as CORBA::ULong
- *os << "result += _dcps_max_marshaled_size_ulong (); /* enum */"
- << be_nl;
- return 0; // all done
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- // enums are serialized as CORBA::ULong
- *os << "if (_dcps_max_marshaled_size_ulong () > max_size)" << be_idt_nl
- << "max_size = _dcps_max_marshaled_size_ulong (); /* enum */"
- << be_uidt_nl << be_nl;
- return 0; // all done
- break;
- default:
- // do code in the rest of this method.
- break;
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << node->name () << " _tao_union_tmp"
- << ";" << be_nl
- << "result = strm >> _tao_union_tmp;" << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
-
- return 0;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "result = strm << _tao_union." << f->local_name () << " ();";
- return 0;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_enum - "
- "bad sub state\n"),
- -1);
- }
-
- // Not a typedef and node is defined inside the union. Otherwise the
- // Serializer operator is generated elsewhere.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_enum_serializer_op_cs visitor (&ctx);
-
- if (visitor.visit_enum (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_cs::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_interface - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- if (node->is_local ())
- {
- *os << "result = 0;";
- }
- else
- {
- *os << node->name () << "_var _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp.inout ();" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union."
- << f->local_name () << " (_tao_union_tmp.in ());" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
- }
-
- break;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- if (node->is_defined ())
- {
- if (f->is_abstract ())
- {
- *os << "(strm << _tao_union."
- << f->local_name () << " ());";
- }
- else
- {
- *os << "::CORBA::Object::marshal (" << be_idt << be_idt_nl
- << "_tao_union." << f->local_name () << " ()," << be_nl
- << "strm" << be_uidt_nl
- << ");" << be_uidt;
- }
- }
- else
- {
- *os << "result =" << be_idt_nl
- << "TAO::Objref_Traits<" << node->name () << ">::marshal ("
- << be_idt << be_idt_nl
- << "_tao_union." << f->local_name () << " ()," << be_nl
- << "strm" << be_uidt_nl
- << ");" << be_uidt << be_uidt;
- }
-
- break;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because an interface cannot be declared inside a
- // union.
- break;
-
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_interface - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_interface_fwd - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- if (node->is_local ())
- {
- *os << "result = 0;";
- }
- else
- {
- *os << node->name () << "_var _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp.inout ();" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union."
- << f->local_name () << " (_tao_union_tmp.in ());" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
- }
-
- break;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "result = _tao_union."
- << f->local_name () << " ()->marshal (strm);";
- break;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because an interface cannot be forward declared
- // inside a union.
- break;
-
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_interface_fwd - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_cs::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_valuetype - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << node->name () << "_var _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp.inout ();" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union."
- << f->local_name () << " (_tao_union_tmp.in ());" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
-
- break;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "result = strm << _tao_union."
- << f->local_name () << " ();";
- break;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because an interface cannot be declared inside a
- // union.
- break;
-
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_valuetype - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_cs::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_valuetype_fwd - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << node->name () << "_var _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp.inout ();" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union."
- << f->local_name () << " (_tao_union_tmp.in ());" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
-
- break;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "result = strm << _tao_union."
- << f->local_name () << " ();";
- break;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because an interface cannot be forward declared
- // inside a union.
- break;
-
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_valuetype_fwd - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_predefined_type - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- AST_PredefinedType::PredefinedType pt = node->pt ();
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- {
- static int tmp_counter = 0;
- char tmp_name[10];
- ACE_OS::sprintf(tmp_name, "tmp%d", tmp_counter++);
-
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << "PT_pseudo and PT_object not supported by -Gdcps";
- *os << be_nl << be_nl << "// above error is from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
- }
- else if (pt == AST_PredefinedType::PT_char)
- {
- *os << "size_t " << tmp_name << " = _dcps_max_marshaled_size ("
- << "::ACE_OutputCDR::from_char (_tao_union."
- << f->local_name () << " ()));" << be_nl
- << "if (" << tmp_name << " > max_size) max_size = "
- << tmp_name << ";" << be_nl;
- }
- else if (pt == AST_PredefinedType::PT_wchar)
- {
- *os << "size_t " << tmp_name << " = _dcps_max_marshaled_size ("
- << "::ACE_OutputCDR::from_wchar (_tao_union."
- << f->local_name () << " ()));" << be_nl
- << "if (" << tmp_name << " > max_size) max_size = "
- << tmp_name << ";" << be_nl;
- }
- else if (pt == AST_PredefinedType::PT_octet)
- {
- *os << "size_t " << tmp_name << " = _dcps_max_marshaled_size ("
- << "::ACE_OutputCDR::from_octet (_tao_union."
- << f->local_name () << " ()));" << be_nl
- << "if (" << tmp_name << " > max_size) max_size = "
- << tmp_name << ";" << be_nl;
- }
- else if (pt == AST_PredefinedType::PT_boolean)
- {
- *os << "size_t " << tmp_name << " = _dcps_max_marshaled_size ("
- << "::ACE_OutputCDR::from_boolean (_tao_union."
- << f->local_name () << " ()));" << be_nl
- << "if (" << tmp_name << " > max_size) max_size = "
- << tmp_name << ";" << be_nl;
- }
- else
- {
- *os << "size_t " << tmp_name
- << " = _dcps_max_marshaled_size (_tao_union."
- << f->local_name () << " ());" << be_nl
- << "if (" << tmp_name << " > max_size)" << be_idt_nl
- << "max_size = "<< tmp_name << ";" << be_uidt_nl << be_nl;
- }
- }
- break;
-
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << "PT_pseudo and PT_object not supported by -Gdcps";
- *os << be_nl << be_nl << "// above error is from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
- }
- else
- {
- *os << "// " << f->local_name ()
- << " is of a predefined type; hence is bounded" << be_nl;
- }
- break;
-
- case TAO_CodeGen::TAO_FIND_SIZE:
-
- *os << "result += ";
-
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << "PT_pseudo and PT_object not supported by -Gdcps";
- *os << be_nl << be_nl << "// above error is from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
- }
- else if (pt == AST_PredefinedType::PT_char)
- {
- *os << "_dcps_max_marshaled_size (::ACE_OutputCDR::from_char (_tao_union."
- << f->local_name () << " ()));";
- }
- else if (pt == AST_PredefinedType::PT_wchar)
- {
- *os << "_dcps_max_marshaled_size (::ACE_OutputCDR::from_wchar (_tao_union."
- << f->local_name () << " ()));";
- }
- else if (pt == AST_PredefinedType::PT_octet)
- {
- *os << "_dcps_max_marshaled_size (::ACE_OutputCDR::from_octet (_tao_union."
- << f->local_name () << " ()));";
- }
- else if (pt == AST_PredefinedType::PT_boolean)
- {
- *os << "_dcps_max_marshaled_size (::ACE_OutputCDR::from_boolean (_tao_union."
- << f->local_name () << " ()));";
- }
- else
- {
- // is predefined so _find_size = _dcps_max_marshaled_size
- *os << "_dcps_max_marshaled_size (_tao_union." << f->local_name () << " ());";
- }
-
- break;
-
- case TAO_CodeGen::TAO_CDR_INPUT:
- if (pt == AST_PredefinedType::PT_object)
- {
- *os << "::CORBA::Object_var _tao_union_tmp;" << be_nl;
-
- *os << "result = strm >> _tao_union_tmp.out ();" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name () << " (_tao_union_tmp.in ());";
-
- }
- else if (pt == AST_PredefinedType::PT_pseudo)
- {
- *os << "::CORBA::TypeCode_var _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp.out ();" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name () << " (_tao_union_tmp.in ());";
-
- }
- else if (pt == AST_PredefinedType::PT_value)
- {
- *os << "::CORBA::ValueBase * _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name () << " (_tao_union_tmp);";
-
- }
- else if (pt == AST_PredefinedType::PT_char)
- {
- *os << "::CORBA::Char _tao_union_tmp;" << be_nl
- << "::ACE_InputCDR::to_char _tao_union_helper "
- << "(_tao_union_tmp);" << be_nl
- << "result = strm >> _tao_union_helper;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);";
- }
- else if (pt == AST_PredefinedType::PT_wchar)
- {
- *os << "::CORBA::WChar _tao_union_tmp;" << be_nl
- << "::ACE_InputCDR::to_wchar _tao_union_helper "
- << "(_tao_union_tmp);" << be_nl
- << "result = strm >> _tao_union_helper;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);";
- }
- else if (pt == AST_PredefinedType::PT_octet)
- {
- *os << "::CORBA::Octet _tao_union_tmp;" << be_nl
- << "::ACE_InputCDR::to_octet _tao_union_helper "
- << "(_tao_union_tmp);" << be_nl
- << "result = strm >> _tao_union_helper;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);";
- }
- else if (pt == AST_PredefinedType::PT_boolean)
- {
- *os << "::CORBA::Boolean _tao_union_tmp;" << be_nl
- << "::ACE_InputCDR::to_boolean _tao_union_helper "
- << "(_tao_union_tmp);" << be_nl
- << "result = strm >> _tao_union_helper;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);";
- }
- else
- {
- *os << node->name () << " _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);";
- }
-
- *os << be_nl;
- *os << "_tao_union._d (_tao_discriminant);" << be_uidt_nl;
- *os << "}" << be_uidt;
-
- break;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
-
- *os << "result = ";
-
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << "strm << _tao_union." << f->local_name () << " ();";
- }
- else if (pt == AST_PredefinedType::PT_char)
- {
- *os << "strm << ::ACE_OutputCDR::from_char (_tao_union."
- << f->local_name () << " ());";
- }
- else if (pt == AST_PredefinedType::PT_wchar)
- {
- *os << "strm << ::ACE_OutputCDR::from_wchar (_tao_union."
- << f->local_name () << " ());";
- }
- else if (pt == AST_PredefinedType::PT_octet)
- {
- *os << "strm << ::ACE_OutputCDR::from_octet (_tao_union."
- << f->local_name () << " ());";
- }
- else if (pt == AST_PredefinedType::PT_boolean)
- {
- *os << "strm << ::ACE_OutputCDR::from_boolean (_tao_union."
- << f->local_name () << " ());";
- }
- else
- {
- *os << "strm << _tao_union." << f->local_name () << " ();";
- }
-
- break;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_array - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_cs::visit_sequence (be_sequence *node)
-{
- // If the sequence is defined in this scope, generate its Serializer stream
- // operators heree.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // Anonymous sequence
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_sequence_serializer_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // Now generate the Serializer stream operators for the sequence as a
- // union branch.
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_sequence - "
- "cannot retrieve union_branch node\n"
- ), -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- {
- static int tmp_counter = 0;
- char tmp_val_name[30];
- ACE_OS::sprintf(tmp_val_name, "tmp_seq_val%d", tmp_counter++);
- *os << f->field_type ()->name() << " " << tmp_val_name
- << "; // is type of " << f->local_name () << be_nl;
- *os << "is_bounded = is_bounded && "
- << "_tao_is_bounded_size (" << tmp_val_name << ");"
- << be_nl;
- }
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- {
- static int tmp_counter = 0;
- char tmp_size_name[30];
- char tmp_val_name[30];
- ACE_OS::sprintf(tmp_size_name, "tmp_seq_size%d", tmp_counter);
- ACE_OS::sprintf(tmp_val_name, "tmp_seq_val%d", tmp_counter++);
- *os << f->field_type ()->name() << " " << tmp_val_name
- << "; // is type of " << f->local_name () << be_nl;
- *os << "size_t " << tmp_size_name
- << " = _dcps_max_marshaled_size (" << tmp_val_name << ");" << be_nl
- << "if (" << tmp_size_name << " > max_size) " << be_idt_nl
- << "max_size = " << tmp_size_name << ";" << be_uidt_nl << be_nl;
- }
- break;
- case TAO_CodeGen::TAO_FIND_SIZE:
- //SHH - TBD - make sure this is a shallow copy.
- // But this code is currently dead anyway because
- // unions always return false for _dcps_is_bounded and a large
- // number for _dcsp_max_marshaled_size.
- // This note applies to multiple locations in this file.
- *os << f->field_type ()->name() << " tmp (_tao_union."
- << f->local_name () << " ());" << be_nl;
- *os << "result += _dcps_find_size (tmp);" << be_nl;
- break;
- case TAO_CodeGen::TAO_CDR_INPUT:
- {
- // If the typedef'd sequence is included from another
- // file, node->name() won't work. The following works
- // for all typedefs, external or not.
- be_typedef *td = this->ctx_->alias ();
-
- if (td)
- {
- *os << td->name ();
- }
- else
- {
- *os << node->name ();
- }
-
- *os << " _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union."
- << f->local_name () << " (_tao_union_tmp);" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
-
- return 0;
- }
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "result = strm << _tao_union."
- << f->local_name () << " ();";
- return 0;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_sequence - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_cs::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_string - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- if (0 == node->max_size ()->ev ()->u.ulval)
- *os << "is_bounded = is_bounded && false; /* unbounded string */"
- << be_nl;
- else
- *os << "// bounded string " << f->local_name ()
- << be_nl;
- break;
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- {
- static int tmp_counter = 0;
- char tmp_size_name[30];
- ACE_OS::sprintf(tmp_size_name, "tmp_string_size%d", tmp_counter++);
-
- char buff[15];
- ACE_OS::sprintf(buff, "%ld", node->max_size ()->ev ()->u.ulval);
- *os << "size_t " << tmp_size_name
- << " = _dcps_max_marshaled_size_ulong () + " << buff << ";" << be_nl
- << "if (" << tmp_size_name << ")" << be_idt_nl
- << "max_size = " << tmp_size_name << ";" << be_uidt_nl;
- }
- break;
- case TAO_CodeGen::TAO_FIND_SIZE:
- *os << "result += _dcps_max_marshaled_size_ulong() + " << be_idt_nl
- << "ACE_OS::strlen(_tao_union."
- << f->local_name () << " ());" << be_uidt_nl;
- break;
- case TAO_CodeGen::TAO_CDR_INPUT:
- if (node->width () == (long) sizeof (char))
- {
- *os << "::CORBA::String_var _tao_union_tmp;" << be_nl;
- }
- else
- {
- *os << "::CORBA::WString_var _tao_union_tmp;" << be_nl;
- }
-
- *os << "result = strm >> _tao_union_tmp.out ();" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union."
- << f->local_name () << " (_tao_union_tmp);" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
-
- break;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "result = strm << _tao_union."
- << f->local_name () << " ();";
- break;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_array - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_cs::visit_structure (be_structure *node)
-{
- // If the structure is defined in this scope. generate its Serializer
- // stream operators here.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_structure_serializer_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_struct - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // How generate the Serializer stream operators for the structure as
- // a union branch.
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_structure - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_MAX_MARSHALED_SIZE:
- {
- static int tmp_counter = 0;
- char tmp_size_name[30];
- char tmp_val_name[30];
- ACE_OS::sprintf(tmp_size_name, "tmp_struct_size%d", tmp_counter);
- ACE_OS::sprintf(tmp_val_name, "tmp_struct_val%d", tmp_counter++);
-
- *os << f->field_type ()->name() << " " << tmp_val_name
- << "; // is type of " << f->local_name () << be_nl;
- *os << "size_t " << tmp_size_name
- << " = _dcps_max_marshaled_size (" << tmp_val_name << ");" << be_nl
- << "if (" << tmp_size_name << " > max_size) " << be_idt_nl
- << "max_size = " << tmp_size_name << ";" << be_uidt_nl << be_nl;
- }
- break;
-
- case TAO_CodeGen::TAO_IS_BOUNDED_SIZE:
- {
- static int tmp_counter = 0;
- char tmp_size_name[30];
- char tmp_val_name[30];
- ACE_OS::sprintf(tmp_size_name, "tmp_struct_size%d", tmp_counter);
- ACE_OS::sprintf(tmp_val_name, "tmp_struct_val%d", tmp_counter++);
-
- *os << f->field_type ()->name() << " " << tmp_val_name
- << "; // is type of " << f->local_name () << be_nl;
- *os << "is_bounded = is_bounded && _tao_is_bounded_size ("
- << tmp_val_name << ");" << be_nl;
- }
- break;
-
- case TAO_CodeGen::TAO_FIND_SIZE:
- *os << "result += _dcps_find_size (_tao_union."
- << f->local_name () << " ());" << be_nl;
- break;
-
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << node->name () << " _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt;
-
- return 0;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "result = strm << _tao_union."
- << f->local_name () << " ();";
- return 0;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_structure - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- // The node to be visited in the base primitve type that gets typedefed.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_cs::visit_union (be_union *node)
-{
- // If the union is defined in this scope, generate its Serializer
- // stream operators here.
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_union_serializer_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_union - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // Now generate the Serializer stream operators for the union as
- // a union branch.
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the union_branch node.
- be_union_branch *f = this->ctx_->be_node_as_union_branch ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_union - "
- "cannot retrieve union_branch node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << node->name () << " _tao_union_tmp"
- << ";" << be_nl
- << "result = strm >> _tao_union_tmp;" << be_nl << be_nl
- << "if (result)" << be_idt_nl
- << "{" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);" << be_nl
- << "_tao_union._d (_tao_discriminant);" << be_uidt_nl
- << "}" << be_uidt_nl;
-
- return 0;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "result = strm << _tao_union."
- << f->local_name () << " ();";
- return 0;
-
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_serializer_op_cs::"
- "visit_union - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_serializer_op_cs::explicit_default (void)
-{
- be_union *bu = be_union::narrow_from_decl (this->ctx_->scope ());
- int def_index = bu->default_index ();
-
- if (def_index != -1)
- {
- be_union_branch *ub =
- be_union_branch::narrow_from_decl (this->ctx_->node ());
-
- int i = 0;
-
- // Instantiate a scope iterator.
- for (UTL_ScopeActiveIterator si (bu, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- be_union_branch *bub = 0; // union branch node
-
- AST_Decl *d = si.item ();
-
- if (!d->imported ())
- {
- bub = be_union_branch::narrow_from_decl (d);
- }
-
- if (bub == ub)
- {
- return (i == def_index);
- }
- else
- {
- ++i;
- }
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union_fwd.cpp b/TAO/TAO_IDL/be/be_visitor_union_fwd.cpp
deleted file mode 100644
index e50944b28e9..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_fwd.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_union_fwd.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for be_union_fwd
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-#include "be_union_fwd.h"
-#include "be_union.h"
-
-#include "be_visitor_union_fwd.h"
-#include "be_visitor_context.h"
-#include "be_helper.h"
-
-#include "be_visitor_union_fwd/union_fwd_ch.cpp"
-
-ACE_RCSID (be,
- be_visitor_union_fwd,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_union_fwd/union_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_fwd/union_fwd_ch.cpp
deleted file mode 100644
index a589e8eb0c4..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_fwd/union_fwd_ch.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// union_fwd_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for be_union_fwd node in the client header.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_union_fwd,
- union_fwd_ch,
- "$Id$")
-
-be_visitor_union_fwd_ch::be_visitor_union_fwd_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_union_fwd_ch::~be_visitor_union_fwd_ch (void)
-{
-}
-
-// Visit the interface_fwd_ch node and its scope.
-int
-be_visitor_union_fwd_ch::visit_union_fwd (be_union_fwd *node)
-{
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- be_union *fd = be_union::narrow_from_decl (node->full_definition ());
-
- // This will be a no-op if it has already been done for this node.
- fd->gen_common_varout (os);
-
- node->cli_hdr_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox.cpp
deleted file mode 100644
index c6d4bb2eaed..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuebox.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-
-// $Id$
-//
-/* -*- c++ -*- */
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_valuebox.cpp
-//
-// = DESCRIPTION
-// Concrete visitor for the Valuebox class
-//
-// = AUTHOR
-// Gary Maxey
-//
-// ============================================================================
-
-#include "be_array.h"
-#include "be_enum.h"
-#include "be_extern.h"
-#include "be_field.h"
-#include "be_helper.h"
-#include "be_interface.h"
-#include "be_interface_fwd.h"
-#include "be_module.h"
-#include "be_predefined_type.h"
-#include "be_sequence.h"
-#include "be_string.h"
-#include "be_structure.h"
-#include "be_typedef.h"
-#include "be_union.h"
-#include "be_union_branch.h"
-#include "be_util.h"
-#include "be_valuebox.h"
-#include "utl_identifier.h"
-
-#include "be_visitor_context.h"
-#include "be_visitor_sequence.h"
-#include "be_visitor_typecode.h"
-#include "be_visitor_union.h"
-#include "be_visitor_valuebox.h"
-#include "ace/Log_Msg.h"
-
-#include "be_visitor_valuebox/valuebox.cpp"
-#include "be_visitor_valuebox/valuebox_ch.cpp"
-#include "be_visitor_valuebox/valuebox_ci.cpp"
-#include "be_visitor_valuebox/valuebox_cs.cpp"
-#include "be_visitor_valuebox/any_op_ch.cpp"
-#include "be_visitor_valuebox/any_op_cs.cpp"
-#include "be_visitor_valuebox/cdr_op_ch.cpp"
-#include "be_visitor_valuebox/cdr_op_cs.cpp"
-#include "be_visitor_valuebox/field_ch.cpp"
-#include "be_visitor_valuebox/field_ci.cpp"
-#include "be_visitor_valuebox/union_member_ci.cpp"
diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_ch.cpp
deleted file mode 100644
index e763f9917c9..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_ch.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for a valuebox in the client
-// header.
-//
-// = AUTHOR
-// Gary Maxey
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuebox,
- any_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Valuebox visitor for generating Any operator declarations.
-// ***************************************************************************
-
-be_visitor_valuebox_any_op_ch::be_visitor_valuebox_any_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_valuebox (ctx)
-{
-}
-
-be_visitor_valuebox_any_op_ch::~be_visitor_valuebox_any_op_ch (void)
-{
-}
-
-int
-be_visitor_valuebox_any_op_ch::visit_valuebox (be_valuebox *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- const char *macro = this->ctx_->export_macro ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- be_module *module = 0;
-
- if (node->is_nested () &&
- node->defined_in ()->scope_node_type () == AST_Decl::NT_module)
- {
- module = be_module::narrow_from_scope (node->defined_in ());
-
- if (!module)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_valuebox_any_op_ch::"
- "visit_valuebox - "
- "Error parsing nested name\n"),
- -1);
- }
-
- // Some compilers handle "any" operatorrs in a namespace
- // corresponding to their module, others do not.
- *os << "\n\n#if defined (ACE_ANY_OPS_USE_NAMESPACE)\n";
-
- be_util::gen_nested_namespace_begin (os, module);
-
- // emit nested variation of any operators
- *os << macro << " void"
- << " operator<<= ( ::CORBA::Any &, " << node->local_name ()
- << " *); // copying" << be_nl;
-
- *os << macro << " void"
- << " operator<<= ( ::CORBA::Any &, " << node->local_name ()
- << " **); // non-copying" << be_nl;
-
- *os << macro << " ::CORBA::Boolean"
- << " operator>>= (const ::CORBA::Any &, "
- << node->local_name () << " *&);";
-
- be_util::gen_nested_namespace_end (os, module);
-
- // emit #else
- *os << "#else\n\n";
- }
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << macro << " void operator<<= (::CORBA::Any &, " << node->name ()
- << " *); // copying" << be_nl;
-
- *os << macro << " void operator<<= (::CORBA::Any &, " << node->name ()
- << " **); // non-copying" << be_nl;
-
- *os << macro << " ::CORBA::Boolean operator>>= (const ::CORBA::Any &, "
- << node->name () << " *&);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- if (module != 0)
- {
- *os << "\n\n#endif";
- }
-
- node->cli_hdr_any_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_cs.cpp
deleted file mode 100644
index 3d62e15856b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuebox/any_op_cs.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for valueboxes in the stubs
-// file.
-//
-// = AUTHOR
-// Gary Maxey
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuebox,
- any_op_cs,
- "$Id$")
-
-
-// ***************************************************************************
-// Valuebox visitor for generating Any operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_valuebox_any_op_cs::be_visitor_valuebox_any_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_valuebox (ctx)
-{
-}
-
-be_visitor_valuebox_any_op_cs::~be_visitor_valuebox_any_op_cs (void)
-{
-}
-
-int
-be_visitor_valuebox_any_op_cs::visit_valuebox (be_valuebox *node)
-{
- if (node->cli_stub_any_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate the Any <<= and >>= operator declarations
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // All template specializations must be generated before the instantiations
- // in the operators.
- *os << be_nl << be_nl
- << "namespace TAO" << be_nl
- << "{" << be_idt_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Impl_T<" << node->name () << ">::to_value ("
- << be_idt << be_idt_nl
- << "::CORBA::ValueBase *&_tao_elem" << be_uidt_nl
- << ") const" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::add_ref (this->value_);" << be_nl
- << "_tao_elem = this->value_;" << be_nl
- << "return true;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << be_global->core_versioning_end () << be_nl;
-
- be_module *module = 0;
-
- if (node->is_nested () &&
- node->defined_in ()->scope_node_type () == AST_Decl::NT_module)
- {
- module = be_module::narrow_from_scope (node->defined_in ());
-
- if (!module)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_valuebox_any_op_cs::"
- "visit_valuebox - "
- "Error parsing nested name\n"),
- -1);
- }
-
- // Some compilers handle "any" operators in a namespace corresponding
- // to their module, others do not.
- *os << "\n\n#if defined (ACE_ANY_OPS_USE_NAMESPACE)\n";
-
- be_util::gen_nested_namespace_begin (os, module);
-
- // emit nested variation of any operators
- *os << "// Copying insertion." << be_nl
- << "void" << be_nl
- << "operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->local_name () << " *_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::add_ref (_tao_elem);" << be_nl
- << "_tao_any <<= &_tao_elem;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "// Non-copying insertion." << be_nl
- << "void" << be_nl
- << "operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->local_name () << " **_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "TAO::Any_Impl_T<" << node->local_name () << ">::insert ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->local_name () << "::_tao_any_destructor," << be_nl
- << node->tc_name ()->last_component () << "," << be_nl
- << "*_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean" << be_nl
- << "operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << node->local_name () << " *&_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return" << be_idt_nl
- << "TAO::Any_Impl_T<" << node->local_name () << ">::extract ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->local_name () << "::_tao_any_destructor," << be_nl
- << node->tc_name ()->last_component () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- be_util::gen_nested_namespace_end (os, module);
-
- // emit #else
- *os << "#else\n\n";
- }
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << "// Copying insertion." << be_nl
- << "void" << be_nl
- << "operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->full_name () << " *_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::add_ref (_tao_elem);" << be_nl
- << "_tao_any <<= &_tao_elem;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "// Non-copying insertion." << be_nl
- << "void" << be_nl
- << "operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->full_name () << " **_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "TAO::Any_Impl_T<" << node->name () << ">::insert ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "*_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean" << be_nl
- << "operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << node->full_name () << " *&_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return" << be_idt_nl
- << "TAO::Any_Impl_T<" << node->name () << ">::extract ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << be_global->core_versioning_end () << be_nl;
-
- if (module != 0)
- {
- *os << "\n\n#endif";
- }
-
- node->cli_stub_any_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/cdr_op_ch.cpp
deleted file mode 100644
index cd35ccf737b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuebox/cdr_op_ch.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ch.cpp
-//
-// = DESCRIPTION
-// Concrete visitor for valueboxes.
-// This one provides code generation for the CDR operators.
-//
-// = AUTHOR
-// Gary Maxey
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuebox,
- cdr_op_ch,
- "$Id$")
-
-be_visitor_valuebox_cdr_op_ch::be_visitor_valuebox_cdr_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_valuebox (ctx)
-{
-}
-
-be_visitor_valuebox_cdr_op_ch::~be_visitor_valuebox_cdr_op_ch (void)
-{
-}
-
-int
-be_visitor_valuebox_cdr_op_ch::visit_valuebox (be_valuebox *node)
-{
- if (node->imported ()
- || node->cli_hdr_cdr_op_gen ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << be_global->stub_export_macro () << " "
- << "::CORBA::Boolean operator<< (TAO_OutputCDR &, const "
- << node->full_name () << " *);" << be_nl;
-
- *os << be_global->stub_export_macro () << " "
- << "::CORBA::Boolean operator>> (TAO_InputCDR &, "
- << node->full_name () << " *&);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/cdr_op_cs.cpp
deleted file mode 100644
index 42b42489d69..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuebox/cdr_op_cs.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Concrete visitor for valueboxes.
-// This one provides code generation for the CDR operators.
-//
-// = AUTHOR
-// Gary Maxey
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuebox,
- cdr_op_cs,
- "$Id$")
-
-be_visitor_valuebox_cdr_op_cs::be_visitor_valuebox_cdr_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_valuebox (ctx)
-{
-}
-
-be_visitor_valuebox_cdr_op_cs::~be_visitor_valuebox_cdr_op_cs (void)
-{
-}
-
-int
-be_visitor_valuebox_cdr_op_cs::visit_valuebox (be_valuebox *node)
-{
- // Already generated and/or we are imported. Don't do anything.
- if (node->cli_stub_cdr_op_gen ()
- || node->imported ()
- || ! node->is_defined ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- node->cli_stub_cdr_op_gen (true);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
-*os << be_global->core_versioning_begin () << be_nl;
-
- // Set the sub state as generating code for the output operator.
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT);
-
- *os << "::CORBA::Boolean" << be_nl
- << "operator<< (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &strm, " << be_nl
- << "const " << node->full_name ()
- << " *_tao_valuebox" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
- *os << "return" << be_idt_nl
- << "::CORBA::ValueBase::_tao_marshal (" << be_idt << be_idt_nl
- << "strm," << be_nl
- << "_tao_valuebox," << be_nl
- << "reinterpret_cast<ptrdiff_t> (&"
- << node->full_name () << "::_downcast)"
- << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean" << be_nl
- << "operator>> (" << be_idt << be_idt_nl
- << "TAO_InputCDR &strm," << be_nl
- << node->full_name ()
- << " *&_tao_valuebox" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
- *os << "return " << node->full_name ()
- << "::_tao_unmarshal (strm, _tao_valuebox);"
- << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << be_global->core_versioning_end () << be_nl;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/field_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/field_ch.cpp
deleted file mode 100644
index 1ac3ef40268..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuebox/field_ch.cpp
+++ /dev/null
@@ -1,536 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// field_ch.cpp
-//
-// = DESCRIPTION
-// Visitor for the structure fields in valuebox class.
-// This one generates code for access to strucuture members
-// in the client header.
-//
-// Based on be_visitor_union_branch/public_ch. In general we
-// generate the same method signatures as that visitor but cannot
-// use it directly because a valuebox is not a scope and because
-// the structure is visited prior to visiting the valuebox.
-//
-// = AUTHOR
-// Gary Maxey
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuebox,
- field_ch,
- "$Id$")
-
-
-be_visitor_valuebox_field_ch::be_visitor_valuebox_field_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_valuebox_field_ch::~be_visitor_valuebox_field_ch (void)
-{
-}
-
-int
-be_visitor_valuebox_field_ch::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ch::"
- "visit_field - "
- "Bad field type\n"
- ),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ch::"
- "visit_union_branch - "
- "codegen for valuebox field failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// Visit operations on all possible data types that a union_branch can be.
-
-int
-be_visitor_valuebox_field_ch::visit_array (be_array *node)
-{
- be_decl *field = this->ctx_->node ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ch::"
- "visit_array - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
-
- char fname [NAMEBUFSIZE];
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (bt->node_type () != AST_Decl::NT_typedef)
- {
- // For anonymous arrays ...
- // We have to generate a name for us that has an underscope prepended to
- // our local name. This needs to be inserted after the parent's name.
- if (bt->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (bt->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- bt->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- bt->full_name ());
- }
- }
- else
- { // Typedefed node.
- ACE_OS::sprintf (fname,
- "%s",
- bt->full_name ());
- }
-
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "void " << field->local_name () << " (" << fname << ");" << be_nl;
-
- *os << "const " << fname << "_slice *" << field->local_name ()
- << " (void) const;" << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ch::visit_enum (be_enum *node)
-{
- be_decl *field = this->ctx_->node ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ch::"
- "visit_enum - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (field, bt, "", "");
- this->emit_member_get (field, bt, "", "", "const");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ch::visit_interface (be_interface *node)
-{
- be_decl *field = this->ctx_->node ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ch::"
- "visit_interface - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (field, bt, "", "_ptr");
- this->emit_member_get (field, bt, "", "_ptr", "const");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ch::visit_interface_fwd (be_interface_fwd *node)
-{
- be_decl *field = this->ctx_->node ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ch::"
- "visit_interface_fwd - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (field, bt, "", "_ptr");
- this->emit_member_get (field, bt, "", "_ptr", "const");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ch::visit_valuetype (be_valuetype *)
-{
- // Valuetype is not a valid component of a valuebox
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ch::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- // Valuetype is not a valid component of a valuebox
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ch::visit_predefined_type (be_predefined_type *node)
-{
- be_decl *field = this->ctx_->node ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ch::"
- "visit_predefined_type - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- this->emit_member_set (field, bt, " ::", "_ptr");
- this->emit_member_get (field, bt, " ::", "_ptr", "const");
-
- break;
- case AST_PredefinedType::PT_any:
- this->emit_member_set (field, bt, "const ::", " &");
- this->emit_member_get (field, bt, "const ::", " &", "const");
- this->emit_member_get (field, bt, " ::", " &", "");
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- this->emit_member_set (field, bt, " ::", "");
- this->emit_member_get (field, bt, " ::", "", "const");
- }
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ch::visit_sequence (be_sequence *node)
-{
- be_decl *field = this->ctx_->node ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ch::"
- "visit_sequence - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (field, bt, "const ", " &");
- this->emit_member_get (field, bt, "const ", " &", "const");
- this->emit_member_get (field, bt, "", " &", "");
-
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ch::visit_string (be_string *node)
-{
- be_decl *field = this->ctx_->node ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ch::"
- "visit_string - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (field, bt, "", "");
- this->emit_member_set (field, bt, "const ", "");
-
- const char *string_type = "";
- if (node->node_type () == AST_Decl::NT_string)
- {
- string_type = "String";
- }
- else if (node->node_type () == AST_Decl::NT_wstring)
- {
- string_type = "WString";
- }
-
- *os << "void " << field->local_name ()
- << " (const ::CORBA::" << string_type << "_var &);" << be_nl;
-
- this->emit_member_get (field, bt, "const ", "", "const");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ch::visit_structure (be_structure *node)
-{
- be_decl *field = this->ctx_->node ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ch::"
- "visit_structure - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (field, bt, "const ", " &");
- this->emit_member_get (field, bt, "const ", " &", "const");
- this->emit_member_get (field, bt, "", " &", "");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ch::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- // Make a decision based on the primitive base type.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_spec_ch::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ch::visit_union (be_union *node)
-{
- be_decl *field = this->ctx_->node ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ch::"
- "visit_union - "
- "bad context information\n"
- ),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (field, bt, "const ", " &");
- this->emit_member_get (field, bt, "const ", " &", "const");
- this->emit_member_get (field, bt, "", " &", "");
-
- return 0;
-}
-
-
-void
-be_visitor_valuebox_field_ch::emit_member_set (be_decl *field,
- be_type *field_type,
- const char *const_arg,
- const char *arg_modifier)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "void " << field->local_name ()
- << " (" << const_arg << field_type->name () << arg_modifier << ");"
- << be_nl;
-
-}
-
-
-void
-be_visitor_valuebox_field_ch::emit_member_get (be_decl *field,
- be_type *field_type,
- const char *const_prefix,
- const char *type_suffix,
- const char *const_method)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << const_prefix << field_type->name () << type_suffix << " "
- << field->local_name () << " (void) " << const_method << ";" << be_nl;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/field_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/field_ci.cpp
deleted file mode 100644
index c183b8ef2cc..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuebox/field_ci.cpp
+++ /dev/null
@@ -1,614 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// field_ci.cpp
-//
-// = DESCRIPTION
-// Visitor for the Valuebox class.
-// This one generates code for accessor and modifier functions of
-// for valuebox struct members.
-//
-// = AUTHOR
-// Gary Maxey
-//
-// ============================================================================
-ACE_RCSID (be_visitor_valuebox,
- field_ci,
- "$Id$")
-
-be_visitor_valuebox_field_ci::be_visitor_valuebox_field_ci (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_valuebox_field_ci::~be_visitor_valuebox_field_ci (void)
-{
-}
-
-int
-be_visitor_valuebox_field_ci::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ci::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ci::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// Visit operations on all possible data types that a field can be
-
-int
-be_visitor_valuebox_field_ci::visit_array (be_array *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ci::"
- "visit_array - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- char fname [NAMEBUFSIZE];
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (bt->node_type () != AST_Decl::NT_typedef)
- {
- // For anonymous arrays ...
- // We have to generate a name for us that has an underscope prepended to
- // our local name. This needs to be inserted after the parent's name.
- if (bt->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (bt->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- bt->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- bt->full_name ());
- }
- }
- else
- {
- // Typedefed node.
- ACE_OS::sprintf (fname,
- "%s",
- bt->full_name ());
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "/// Modifier to set the member." << be_nl;
-
- *os << "ACE_INLINE void" << be_nl
- << vb_node->name () << "::" << field->local_name ()
- << " (" << fname << " val)" << be_nl
- << "{" << be_idt_nl
- << fname << "_copy ("
- << "this->_pd_value->" << field->local_name ()
- << ", val);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "/// Accessor to retrieve the member." << be_nl;
-
- *os << "ACE_INLINE const " << fname << "_slice *" << be_nl
- << vb_node->name () << "::" << field->local_name ()
- << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value->" << field->local_name ()
- << ";" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ci::visit_enum (be_enum *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ci::"
- "visit_enum - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
-
- this->emit_member_set (vb_node, field, bt, "", "");
- this->emit_member_get (vb_node, field, bt, "", "", "const", "");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ci::visit_interface (be_interface *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ci::"
- "visit_interface - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "// Modifier to set the member." << be_nl;
-
- *os << "ACE_INLINE void" << be_nl
- << vb_node->name () << "::" << field->local_name ()
- << " (" << bt->name () << "_ptr val)"
- << be_nl << "{" << be_idt_nl
- << "this->_pd_value->" << field->local_name ()
- << " = " << "TAO::Objref_Traits< ::" << bt->name ()
- << ">::duplicate (val);" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- this->emit_member_get (vb_node, field, bt, "", "_ptr", "const", ".in ()");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ci::visit_interface_fwd (be_interface_fwd *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ci::"
- "visit_interface_fwd - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "// Modifier to set the member." << be_nl;
-
- *os << "ACE_INLINE void" << be_nl
- << vb_node->name () << "::" << field->local_name ()
- << " (" << bt->name () << "_ptr val)"
- << be_nl << "{" << be_idt_nl
- << "this->_pd_value->" << field->local_name ()
- << " = " << "TAO::Objref_Traits< ::" << bt->name ()
- << ">::duplicate (val);" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- this->emit_member_get (vb_node, field, bt, "", "_ptr", "const", ".in ()");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ci::visit_valuetype (be_valuetype *)
-{
- // Valuetype is not a valid component of a valuebox
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ci::visit_eventtype (be_eventtype *)
-{
- // Valuetype is not a valid component of a valuebox
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ci::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- // Valuetype is not a valid component of a valuebox
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ci::visit_eventtype_fwd (be_eventtype_fwd *)
-{
- // Valuetype is not a valid component of a valuebox
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ci::visit_predefined_type (be_predefined_type *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ci::"
- "visit_predefined_type - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- *os << "// Modifier to set the member." << be_nl;
-
- *os << "ACE_INLINE void" << be_nl
- << vb_node->name () << "::" << field->local_name ()
- << " ( ::" << bt->name () << "_ptr val)"
- << be_nl << "{" << be_idt_nl
- << "this->_pd_value->" << field->local_name ()
- << " = ::" << bt->name() << "::_duplicate (val);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- this->emit_member_get (vb_node, field, bt, " ::", "_ptr", "const",
- ".in ()");
- break;
- case AST_PredefinedType::PT_any:
- this->emit_member_set (vb_node, field, bt, "const ::", " &");
- this->emit_member_get (vb_node, field, bt, "const ::", " &", "const", "");
- this->emit_member_get (vb_node, field, bt, " ::", " &", "", "");
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- this->emit_member_set (vb_node, field, bt, " ::", "");
- this->emit_member_get (vb_node, field, bt, " ::", "", "const", "");
- break;
- }
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ci::visit_sequence (be_sequence *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ci::"
- "visit_sequence - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (vb_node, field, bt, "const ", " &");
- this->emit_member_get (vb_node, field, bt, "const ", " &", "const", "");
- this->emit_member_get (vb_node, field, bt, "", " &", "", "");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ci::visit_string (be_string *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ci::"
- "visit_predefined_type - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (vb_node, field, bt, "", "");
- this->emit_member_set (vb_node, field, bt, "const ", "");
-
- *os << "// Modifier to set the member." << be_nl;
-
- const char *string_type = "";
- if (node->node_type () == AST_Decl::NT_string)
- {
- string_type = "String";
- }
- else if (node->node_type () == AST_Decl::NT_wstring)
- {
- string_type = "WString";
- }
-
- *os << "ACE_INLINE void" << be_nl
- << vb_node->name () << "::" << field->local_name ()
- << " (const ::CORBA::" << string_type << "_var & val)"
- << be_nl << "{" << be_idt_nl
- << "this->_pd_value->" << field->local_name ()
- << " = val;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- this->emit_member_get (vb_node, field, bt, "const ", "", "const", "");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ci::visit_structure (be_structure *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ci::"
- "visit_structure - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (vb_node, field, bt, "const ", " &");
- this->emit_member_get (vb_node, field, bt, "const ", " &", "const", "");
- this->emit_member_get (vb_node, field, bt, "", " &", "", "");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ci::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ci::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_valuebox_field_ci::visit_union (be_union *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_field_ci::"
- "visit_union - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (vb_node, field, bt, "const ", " &");
- this->emit_member_get (vb_node, field, bt, "const ", " &", "const", "");
- this->emit_member_get (vb_node, field, bt, "", " &", "", "");
-
- return 0;
-}
-
-void
-be_visitor_valuebox_field_ci::emit_member_set (be_decl *vb_node,
- be_decl *field,
- be_type *field_type,
- const char *const_arg,
- const char *arg_modifier)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "// Modifier to set the member." << be_nl;
-
- *os << "ACE_INLINE void" << be_nl
- << vb_node->name () << "::" << field->local_name ()
- << " (" << const_arg << field_type->name () << arg_modifier << " val)"
- << be_nl << "{" << be_idt_nl
- << "this->_pd_value->" << field->local_name ()
- << " = val;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
-}
-
-void
-be_visitor_valuebox_field_ci::emit_member_get (be_decl *vb_node,
- be_decl *field,
- be_type *field_type,
- const char *const_prefix,
- const char *type_suffix,
- const char *const_method,
- const char *access_modifier)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "/// Accessor to retrieve the member." << be_nl;
-
- *os << "ACE_INLINE " << const_prefix << field_type->name () << type_suffix
- << be_nl
- << vb_node->name () << "::" << field->local_name ()
- << " (void) " << const_method << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value->" << field->local_name () << access_modifier
- << ";" << be_uidt_nl
- << "}" << be_nl << be_nl;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/union_member_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/union_member_ci.cpp
deleted file mode 100644
index 792894f619a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuebox/union_member_ci.cpp
+++ /dev/null
@@ -1,568 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// union_member_ci.cpp
-//
-// = DESCRIPTION
-// Visitor for the Valuebox class.
-// This one generates code for accessor and modifier functions of
-// for valuebox union members.
-//
-// = AUTHOR
-// Gary Maxey
-//
-// ============================================================================
-ACE_RCSID (be_visitor_valuebox,
- union_member_ci,
- "$Id$")
-
-be_visitor_valuebox_union_member_ci::be_visitor_valuebox_union_member_ci (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_valuebox_union_member_ci::~be_visitor_valuebox_union_member_ci (void)
-{
-}
-
-int
-be_visitor_valuebox_union_member_ci::visit_union_member (be_union_branch *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_union_member_ci::"
- "visit_union_member - "
- "Bad field type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_union_member_ci::"
- "visit_union_member - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// Visit operations on all possible data types that a union member can be
-
-int
-be_visitor_valuebox_union_member_ci::visit_array (be_array *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_union_member_ci::"
- "visit_array - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- char fname [NAMEBUFSIZE];
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (bt->node_type () != AST_Decl::NT_typedef)
- {
- // For anonymous arrays ...
- // We have to generate a name for us that has an underscope prepended to
- // our local name. This needs to be inserted after the parent's name.
- if (bt->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (bt->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- bt->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- bt->full_name ());
- }
- }
- else
- {
- // Typedefed node.
- ACE_OS::sprintf (fname,
- "%s",
- bt->full_name ());
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "/// Modifier to set the member." << be_nl;
-
- *os << "ACE_INLINE void" << be_nl
- << vb_node->name () << "::" << field->local_name ()
- << " (" << fname << " val)" << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value->" << field->local_name ()
- << " (val);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "/// Accessor to retrieve the member." << be_nl;
-
- *os << "ACE_INLINE const " << fname << "_slice *" << be_nl
- << vb_node->name () << "::" << field->local_name ()
- << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value->" << field->local_name ()
- << " ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_valuebox_union_member_ci::visit_enum (be_enum *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_union_member_ci::"
- "visit_enum - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
-
- this->emit_member_set (vb_node, field, bt, "", "");
- this->emit_member_get (vb_node, field, bt, "", "", "const");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_union_member_ci::visit_interface (be_interface *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_union_member_ci::"
- "visit_interface - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (vb_node, field, bt, "", "_ptr");
- this->emit_member_get (vb_node, field, bt, "", "_ptr", "const");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_union_member_ci::visit_interface_fwd (be_interface_fwd *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_union_member_ci::"
- "visit_interface_fwd - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (vb_node, field, bt, "", "_ptr");
- this->emit_member_get (vb_node, field, bt, "", "_ptr", "const");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_union_member_ci::visit_valuetype (be_valuetype *)
-{
- // Valuetype is not a valid component of a valuebox
- return 0;
-}
-
-int
-be_visitor_valuebox_union_member_ci::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- // Valuetype is not a valid component of a valuebox
- return 0;
-}
-
-int
-be_visitor_valuebox_union_member_ci::visit_predefined_type (be_predefined_type *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_union_member_ci::"
- "visit_predefined_type - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- this->emit_member_set (vb_node, field, bt, " ::", "_ptr");
- this->emit_member_get (vb_node, field, bt, " ::", "_ptr", "const");
- break;
- case AST_PredefinedType::PT_any:
- this->emit_member_set (vb_node, field, bt, "const ::", " &");
- this->emit_member_get (vb_node, field, bt, "const ::", " &", "const");
- this->emit_member_get (vb_node, field, bt, "::", " &", "");
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- this->emit_member_set (vb_node, field, bt, " ::", "");
- this->emit_member_get (vb_node, field, bt, " ::", "", "const");
- break;
- }
-
- return 0;
-}
-
-int
-be_visitor_valuebox_union_member_ci::visit_sequence (be_sequence *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_union_member_ci::"
- "visit_sequence - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (vb_node, field, bt, "const ", " &");
- this->emit_member_get (vb_node, field, bt, "const ", " &", "const");
- this->emit_member_get (vb_node, field, bt, "", " &", "");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_union_member_ci::visit_string (be_string *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_union_member_ci::"
- "visit_predefined_type - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (vb_node, field, bt, "", "");
- this->emit_member_set (vb_node, field, bt, "const ", "");
-
- *os << "// Modifier to set the member." << be_nl;
-
- const char *string_type = "";
- if (node->node_type () == AST_Decl::NT_string)
- {
- string_type = "String";
- }
- else if (node->node_type () == AST_Decl::NT_wstring)
- {
- string_type = "WString";
- }
-
- *os << "ACE_INLINE void" << be_nl
- << vb_node->name () << "::" << field->local_name ()
- << " (const ::CORBA::" << string_type << "_var & val)"
- << be_nl << "{" << be_idt_nl
- << "this->_pd_value->" << field->local_name ()
- << " (val);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- this->emit_member_get (vb_node, field, bt, "const ", "", "const");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_union_member_ci::visit_structure (be_structure *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_union_member_ci::"
- "visit_structure - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (vb_node, field, bt, "const ", " &");
- this->emit_member_get (vb_node, field, bt, "const ", " &", "const");
- this->emit_member_get (vb_node, field, bt, "", " &", "");
-
- return 0;
-}
-
-int
-be_visitor_valuebox_union_member_ci::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_union_member_ci::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_valuebox_union_member_ci::visit_union (be_union *node)
-{
- be_decl *field = this->ctx_->node ();
- be_valuebox *vb_node = be_valuebox::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!field || !vb_node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_union_member_ci::"
- "visit_union - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_member_set (vb_node, field, bt, "const ", " &");
- this->emit_member_get (vb_node, field, bt, "const ", " &", "const");
- this->emit_member_get (vb_node, field, bt, "", " &", "");
-
- return 0;
-}
-
-void
-be_visitor_valuebox_union_member_ci::emit_member_set (be_decl *vb_node,
- be_decl *field,
- be_type *field_type,
- const char *const_arg,
- const char *arg_modifier)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "// Modifier to set the member." << be_nl;
-
- *os << "ACE_INLINE void" << be_nl
- << vb_node->name () << "::" << field->local_name ()
- << " (" << const_arg << field_type->name () << arg_modifier << " val)"
- << be_nl << "{" << be_idt_nl
- << "this->_pd_value->" << field->local_name ()
- << " (val);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
-}
-
-void
-be_visitor_valuebox_union_member_ci::emit_member_get (be_decl *vb_node,
- be_decl *field,
- be_type *field_type,
- const char *const_prefix,
- const char *type_suffix,
- const char *const_method)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "/// Accessor to retrieve the member." << be_nl;
-
- *os << "ACE_INLINE " << const_prefix << field_type->name () << type_suffix
- << be_nl
- << vb_node->name () << "::" << field->local_name ()
- << " (void) " << const_method << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value->" << field->local_name ()
- << " ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox.cpp
deleted file mode 100644
index e114bb204e2..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuebox.cpp
-//
-// = DESCRIPTION
-// Visitor for generation of code for valuebox
-//
-// = AUTHOR
-// Gary Maxey
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuebox,
- valuebox,
- "$Id$")
-
-be_visitor_valuebox::be_visitor_valuebox (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_valuebox::~be_visitor_valuebox (void)
-{
-}
-
-// This method must be overridden by the derived valuebox visitors.
-int
-be_visitor_valuebox::visit_valuebox (be_valuebox *)
-{
- return -1;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ch.cpp
deleted file mode 100644
index b815e058f82..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ch.cpp
+++ /dev/null
@@ -1,863 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuebox_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for valueboxes in the client header
-//
-// = AUTHOR
-// Gary Maxey
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuebox,
- valuebox_ch,
- "$Id: valuebox_ch.cpp Exp")
-
-// ******************************************************
-// Valuebox visitor for client header
-// ******************************************************
-
-be_visitor_valuebox_ch::be_visitor_valuebox_ch (be_visitor_context *ctx)
- : be_visitor_valuebox (ctx)
-{
-}
-
-be_visitor_valuebox_ch::~be_visitor_valuebox_ch (void)
-{
-}
-
-int
-be_visitor_valuebox_ch::visit_valuebox (be_valuebox *node)
-{
- // Nothing to do if we are imported or code is already generated.
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- this->ctx_->node (node); // save the node
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- os->gen_ifdef_macro (node->flat_name ());
-
- *os << be_nl << be_nl
- << "class " << node->local_name () << ";" ;
-
- // Generate the _var and _out template class declarations.
- *os << be_nl << be_nl
- << "typedef" << be_idt_nl
- << "TAO_Value_Var_T<" << be_idt << be_idt_nl
- << node->local_name () << be_uidt_nl
- << ">" << be_uidt_nl
- << node->local_name () << "_var;" << be_uidt_nl << be_nl
- << "typedef" << be_idt_nl
- << "TAO_Value_Out_T<" << be_idt << be_idt_nl
- << node->local_name () << be_uidt_nl
- << ">" << be_uidt_nl
- << node->local_name () << "_out;" << be_uidt;
-
- *os << be_nl << be_nl << "class " << be_global->stub_export_macro ()
- << " " << node->local_name ();
- *os << be_idt_nl <<": public virtual ::CORBA::DefaultValueRefCountBase";
-
- *os << be_uidt << be_nl
- << "{" << be_nl
- << "public:" << be_idt_nl
- << "typedef " << node->local_name () << " * _ptr_type;" << be_nl
- << "typedef " << node->local_name () << "_var _var_type;" << be_nl
- << "typedef " << node->local_name () << "_out _out_type;"
- << be_nl << be_nl;
-
- // _downcast method
- *os << "static " << node->local_name () << "* "
- << "_downcast ( ::CORBA::ValueBase *);" << be_nl;
-
- // _copy_value method
- *os << "::CORBA::ValueBase * _copy_value (void);" << be_nl << be_nl;
-
- // repository id methods
- *os << "virtual const char* "
- << "_tao_obv_repository_id (void) const;"
- << be_nl << be_nl
- << "virtual void "
- << "_tao_obv_truncatable_repo_ids (Repository_Id_List &) const;"
- << be_nl << be_nl
- << "static const char* "
- << "_tao_obv_static_repository_id (void);" << be_nl << be_nl;
-
- // unmarshal method
- *os << "static ::CORBA::Boolean _tao_unmarshal (" << be_idt << be_idt_nl
- << "TAO_InputCDR &," << be_nl
- << node->local_name () << " *&" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- be_type *bt = be_type::narrow_from_decl (node->boxed_type ());
-
- // Emit the type specific elements. The visit_* methods in this
- // module do that work.
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%N:%l) be_visitor_valuebox_ch::visit_valuebox - "
- "type-specific valuebox code generation failed\n"),
- -1);
- }
-
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Generate the "protected" destructor
-
- *os << be_uidt_nl << be_nl << "protected:" << be_idt_nl;
-
- *os << "virtual ~" << node->local_name () << " (void);" << be_nl;
-
- // Methods for marshalling and unmarshalling the value
- *os << "virtual ::CORBA::Boolean "
- << "_tao_marshal_v (TAO_OutputCDR &) const;" << be_nl;
- *os << "virtual ::CORBA::Boolean "
- << "_tao_unmarshal_v (TAO_InputCDR &);" << be_nl;
- *os << "virtual ::CORBA::Boolean "
- << "_tao_match_formal_type (ptrdiff_t ) const;" << be_nl;
-
- // Private unimplemented default assignment operator
- *os << be_uidt_nl << "private:" << be_idt_nl;
- *os << "void operator= (const " << node->local_name () << " & val);"
- << be_nl;
-
- *os << be_uidt_nl
- << "};";
-
- os->gen_endif ();
-
- // Generate typecode declaration.
- if (be_global->tc_support ())
- {
- be_visitor_context ctx (*this->ctx_);
- be_visitor_typecode_decl visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ch::"
- "visit_valuebox - "
- "TypeCode declaration failed\n"),
- -1);
- }
- }
-
- // Indicate that code is already generated for this node.
- node->cli_hdr_gen (true);
-
- return 0;
-}
-
-
-int
-be_visitor_valuebox_ch::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl;
-
- this->emit_default_constructor();
-
- // Public constructor that takes a const array argument
- this->emit_constructor_one_arg (node, "", "const ", "");
-
- // Public copy constructor
- this->emit_copy_constructor ();
-
- *os << be_nl << "// assignment operator" << be_nl;
-
- // Public assignment operator that takes a const array argument
- this->emit_assignment (node, "", "const ", "");
-
- // Public accessor and modifier methods
- *os << "// accessors and modifier" << be_nl;
-
- *os << "const " << node->full_name () << "_slice* "
- << "_value (void) const;" << be_nl;
-
- *os << node->full_name () << "_slice* " << "_value (void);" << be_nl;
-
- *os << "void" << " _value (const " << node->full_name () << " val);"
- << be_nl << be_nl;
-
- // Overloaded subscript operators
- *os << "const " << node->full_name ()
- << "_slice & operator[] ( ::CORBA::ULong index) const;" << be_nl;
-
- *os << node->full_name ()
- << "_slice & operator[] ( ::CORBA::ULong index);" << be_nl << be_nl;
-
- // Explicit conversion functions
- *os << "const " << node->full_name () << "_slice * _boxed_in (void) const;"
- << be_nl;
-
- *os << node->full_name () << "_slice * _boxed_inout (void);" << be_nl;
-
- *os << node->full_name () << "_slice * _boxed_out (void);" << be_nl
- << be_nl;
-
- // Member variable of underlying type;
- this->emit_boxed_member_var (node, "_var");
-
- return 0;
-}
-
-
-int
-be_visitor_valuebox_ch::visit_enum (be_enum *node)
-{
- return this->emit_for_predef_enum (node, "", false);
-}
-
-
-int
-be_visitor_valuebox_ch::visit_interface (be_interface *node)
-{
- return this->emit_for_predef_enum (node, "_ptr", false);
-}
-
-
-int
-be_visitor_valuebox_ch::visit_predefined_type (be_predefined_type *node)
-{
- return this->emit_for_predef_enum (node, "",
- node->pt () == AST_PredefinedType::PT_any);
-}
-
-
-int
-be_visitor_valuebox_ch::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ch.
- be_decl * vb_node = this->ctx_->node ();
-
- if (node->anonymous ())
- { // Our sequence is anonymous so we must generate a declaration
- // for it.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // First generate the sequence declaration.
- be_visitor_sequence_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ch::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // Retrieve the base type since we will need to do some code
- // generation for it.
- be_type *bt = be_type::narrow_from_decl (node->base_type ());
- if (bt == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ch::"
- "visit_sequence - "
- "Bad element type\n"),
- -1);
- }
-
- // Indicate that this type has been used as a sequence element.
- bt->seen_in_sequence (true);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- this->emit_default_constructor();
-
- if (node->unbounded ())
- {
- // Public constructor with one argument of type ULong
- *os << vb_node->local_name () << " ( ::CORBA::ULong max);" << be_nl;
- }
-
- // Public constructor for sequence with supplied buffer
- *os << vb_node->local_name () << " (" << be_idt << be_idt;
-
- if (node->unbounded ())
- {
- *os << be_nl << "::CORBA::ULong max,";
- }
-
- *os << be_nl << "::CORBA::ULong length," << be_nl;
-
- // Generate the base type for the buffer.
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH);
- be_visitor_sequence_buffer_type bt_visitor (&ctx);
- if (bt->accept (&bt_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%N:%l) be_visitor_valuebox_ch::visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << " * buf," << be_nl
- << "::CORBA::Boolean release = false" << be_uidt_nl << ");" << be_uidt_nl;
-
- // Public constructor with single argument of type const T&
- this->emit_constructor_one_arg (node, "", "const ", "&");
-
- // Public copy constructor
- this->emit_copy_constructor ();
-
- *os << be_nl << "// assignment operator" << be_nl;
-
- // Public assignment operator with one argument of type const T&
- this->emit_assignment (node, "", "const ", "&");
-
- // Public accessor and modifier methods
- this->emit_accessor_modifier (node);
-
- // Access to the boxed value for method signatures
- this->emit_boxed_access (node, "", "const ", "&", "*");
-
- // Generate accessors
-
- // Generate base type for sequence then remainder of operator []
- if (bt->accept (&bt_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%N:%l) be_visitor_valuebox_ch::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
- *os << "& operator[] ( ::CORBA::ULong index);" << be_nl;
-
- // Generate base type for sequence then remainder of operator []
- *os << "const ";
- if (bt->accept (&bt_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%N:%l) be_visitor_valuebox_ch::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
- *os << "& operator[] ( ::CORBA::ULong index) const;" << be_nl << be_nl;
-
-
- *os << "::CORBA::ULong maximum (void) const;" << be_nl;
-
- *os << "::CORBA::ULong length (void) const;" << be_nl;
-
- *os << "void length ( ::CORBA::ULong len);" << be_nl << be_nl;
-
- // Member variable of underlying type;
- this->emit_boxed_member_var (node, "_var");
-
- return 0;
-
-}
-
-
-int
-be_visitor_valuebox_ch::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- const char *string_type;
- const char *char_type;
- if (node->node_type () == AST_Decl::NT_string)
- {
- string_type = "String";
- char_type = "char";
- }
- else if (node->node_type () == AST_Decl::NT_wstring)
- {
- string_type = "WString";
- char_type = "::CORBA::WChar";
- }
- else
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ch::visit_string -"
- "unexpected string node type=%d\n", node->node_type ()));
- return -1;
- }
-
- // Retrieve the node being visited by this be_visitor_valuebox_ch.
- be_decl * vb_node = this->ctx_->node ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- this->emit_default_constructor();
-
- this->emit_constructor_one_arg (node, "", "", "");
-
- // Public constructor with one argument of type const char *
- this->emit_constructor_one_arg (node, "", "const ", "");
-
- // Public constructor with one argument of type const CORBA::String_var&
- *os << vb_node->local_name () << " (const ::CORBA::" << string_type
- << "_var& var);" << be_nl;
-
- // Public copy constructor
- this->emit_copy_constructor ();
-
- *os << "// assignment operators" << be_nl;
-
- // Public assignment operator with one argument of type char *
- this->emit_assignment (node, "", "", "");
-
- // Public assignment operator with one argument of type const char *
- this->emit_assignment (node, "", "const ", "");
-
- // Public assignment operator with one argument of type
- // const CORBA::String_var&
- *os << vb_node->local_name () << "& operator= (const ::CORBA::"
- << string_type << "_var& var);" << be_nl << be_nl;
-
- *os << "// accessor" << be_nl;
-
- // Accessor function takes no arguments and returns a const char *
- *os << "const " << node->full_name ()
- << " _value (void) const;" << be_nl << be_nl;
-
- *os << "// modifiers" << be_nl;
-
- // Modifier function with one argument of type char *
- *os << "void" << " _value (" << node->full_name () << " val);" << be_nl;
-
- // Modifier function with one argument of type const char *
- *os << "void" << " _value (const " << node->full_name () << " val);"
- << be_nl;
-
- // Modifier function with one argument of type const CORBA::String_var&
- *os << "void" << " _value (const ::CORBA::" << string_type << "_var& var);"
- << be_nl << be_nl;
-
- // Access to the boxed value for method signatures
- this->emit_boxed_access (node, "", "const ", "", "");
-
- // Overloaded subscript operators
- *os << "// allows access and modification using a slot." << be_nl;
- *os << char_type << " & operator[] ( ::CORBA::ULong slot);" << be_nl << be_nl;
-
- *os << "// allows only accessing thru a slot." << be_nl;
- *os << char_type << " operator[] ( ::CORBA::ULong slot) const;" << be_nl;
-
-
- // Member variable of underlying type;
- *os << be_uidt_nl << "private:" << be_idt_nl;
-
- *os << "::CORBA::" << string_type << "_var" << " _pd_value;" << be_nl;
-
- return 0;
-}
-
-
-int
-be_visitor_valuebox_ch::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- this->emit_default_constructor();
-
- // Public constructor with one argument of const T&
- this->emit_constructor_one_arg (node, "", "const ", "&");
-
- // Public copy constructor
- this->emit_copy_constructor ();
-
- *os << be_nl << "// assignment operator" << be_nl;
-
- // Public assignment operator with one argument of type const T&
- this->emit_assignment (node, "", "const ", "&");
-
- // Public accessor and modifier methods
- this->emit_accessor_modifier (node);
-
- // Access to the boxed value for method signatures
- if (node->size_type() == AST_Type::FIXED)
- {
- this->emit_boxed_access (node, "", "const ", "&", "");
- }
- else
- {
- this->emit_boxed_access (node, "", "const ", "&", "*");
- }
-
- // Now generate the accessor and modifier functions for each struct
- // member. These functions have the same signatures as
- // acessor and modifier functions for union members.
-
- AST_Decl *d;
- AST_Field *field;
- be_type *bt;
- be_visitor_context ctx (*this->ctx_);
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- d = si.item ();
-
- if (d == 0 || (field = AST_Field::narrow_from_decl (d)) == 0)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ch::visit_structure -"
- "bad node in this scope\n"));
- break;
- }
-
- bt = be_type::narrow_from_decl (field->field_type ());
-
- // Set the node to be visited
- ctx.node (be_decl::narrow_from_decl (d));
-
- // Create a visitor and use that to process the type.
- be_visitor_valuebox_field_ch visitor (&ctx);
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ch::visit_structure"
- " - codegen for struct type failed\n"));
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Member variable of underlying type;
- this->emit_boxed_member_var (node, "_var");
-
- return 0;
-
-
-}
-
-
-int
-be_visitor_valuebox_ch::visit_typedef (be_typedef *node)
-{
- // Make a decision based on the primitive base type.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%N:%l) be_visitor_valuebox_ch::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- return 0;
-}
-
-
-int
-be_visitor_valuebox_ch::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- this->emit_default_constructor();
-
- // Public constructor with single argument of type const T&
- this->emit_constructor_one_arg (node, "", "const ", "&");
-
- // Public copy constructor
- this->emit_copy_constructor ();
-
- *os << be_nl << "// assignment operator" << be_nl;
-
- // Public assignment operator with one argument of type const T&
- this->emit_assignment (node, "", "const ", "&");
-
- // Public accessor and modifier methods
- this->emit_accessor_modifier (node);
-
- // Access to the boxed value for method signatures
- if (node->size_type() == AST_Type::FIXED)
- {
- this->emit_boxed_access (node, "", "const ", "&", "");
- }
- else
- {
- this->emit_boxed_access (node, "", "const ", "&", "*");
- }
-
- // Now generate the accessor and modifier functions for each union
- // member.
-
- AST_Decl *d;
- AST_Field *field;
- be_type *bt;
- be_visitor_context ctx (*this->ctx_);
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- d = si.item ();
-
- if (d == 0 || (field = AST_Field::narrow_from_decl (d)) == 0)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ch::visit_union -"
- "bad node in this scope\n"));
- break;
- }
-
- bt = be_type::narrow_from_decl (field->field_type ());
-
- // Set the node to be visited
- ctx.node (be_decl::narrow_from_decl (d));
-
- // Create a visitor and use that to process the type.
- be_visitor_valuebox_field_ch visitor (&ctx);
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ch::visit_union"
- " - codegen for struct type failed\n"));
- }
- }
-
- // Retrieve the disriminant type.
- bt = be_type::narrow_from_decl (node->disc_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ch::visit_union - "
- "bad disciminant type\n"),
- -1);
- }
-
- // The discriminant type may have to be defined here if it was an enum
- // declaration inside of the union statement.
-
- be_visitor_union_discriminant_ch ud_visitor (&ctx);
-
- if (bt->accept (&ud_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ch::"
- " visit_union - "
- "codegen for discriminant failed\n"),
- -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
-
- // Member variable of underlying type;
- this->emit_boxed_member_var (node, "_var");
-
- return 0;
-}
-
-
-int
-be_visitor_valuebox_ch::emit_for_predef_enum(be_type *node,
- const char * type_suffix,
- bool is_any)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- this->emit_default_constructor ();
-
- if (is_any)
- {
- this->emit_constructor_one_arg (node, "", "const ", "&");
- }
- else
- { // Public constructor with one argument of underlying type
- this->emit_constructor_one_arg (node, type_suffix, "", "");
- }
-
- // Public copy constructor
- this->emit_copy_constructor ();
-
- *os << be_nl << "// assignment operator" << be_nl;
-
- if (is_any)
- { // Public assignment operator with one argument of type const T&
- this->emit_assignment (node, "", "const ::", "&");
-
- this->emit_accessor_modifier (node);
-
- // Access to the boxed value for method signatures
- this->emit_boxed_access (node, "", "const ::", "&", "*");
-
- // Member variable of underlying type;
- this->emit_boxed_member_var (node, "_var");
- }
- else
- { // Public assignment operator with one argument of underlying type
- this->emit_assignment (node, type_suffix, "", "");
-
- // Public accessor and modifier methods
- *os << "// accessor and modifier" << be_nl;
-
- *os << node->full_name () << type_suffix
- << " _value (void) const;" << be_nl;
-
- *os << "void" << " _value (" << node->full_name () << type_suffix
- << " val);" << be_nl << be_nl;
-
- // Access to the boxed value for method signatures
- this->emit_boxed_access (node, type_suffix, "", "", "");
-
- // Member variable of underlying type;
- this->emit_boxed_member_var (node, type_suffix);
- }
-
- return 0;
-}
-
-void
-be_visitor_valuebox_ch::emit_default_constructor (void)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ch.
- be_decl * vb_node = this->ctx_->node ();
-
- *os << be_nl << be_nl << "// constructors" << be_nl;
-
- // Public default constructor
- *os << vb_node->local_name () << " (void);" << be_nl;
-}
-
-void
-be_visitor_valuebox_ch::emit_constructor_one_arg (be_decl *node,
- const char * type_suffix,
- const char * const_prefix,
- const char * ref_modifier)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ch.
- be_decl * vb_node = this->ctx_->node ();
-
- // Public constructor with one argument of underlying type
- *os << vb_node->local_name () << " (" << const_prefix << node->full_name ()
- << type_suffix << ref_modifier << " val);" << be_nl;
-}
-
-void
-be_visitor_valuebox_ch::emit_copy_constructor (void)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ch.
- be_decl * vb_node = this->ctx_->node ();
-
- // Public Copy constructor
- *os << vb_node->local_name ()
- << " (const " << vb_node->local_name () << "& val);" << be_nl;
-}
-
-void
-be_visitor_valuebox_ch::emit_assignment (be_decl *node,
- const char * type_suffix,
- const char * const_prefix,
- const char * ref_modifier)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ch.
- be_decl * vb_node = this->ctx_->node ();
-
- *os << vb_node->local_name () << "& operator= (" << const_prefix
- << node->full_name () << type_suffix << ref_modifier << " val);"
- << be_nl << be_nl;
-}
-
-
-void
-be_visitor_valuebox_ch::emit_boxed_access (be_decl *node,
- const char * type_suffix,
- const char *const_prefix,
- const char *in_ref_modifier,
- const char *out_ref_modifier)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "// access to the boxed value for method signatures" << be_nl;
-
- // Access to the boxed value for method signatures
- *os << const_prefix << node->full_name () << type_suffix << in_ref_modifier
- << " _boxed_in (void) const;" << be_nl;
-
- *os << node->full_name () << type_suffix << "&"
- << " _boxed_inout (void);" << be_nl;
-
- *os << node->full_name () << type_suffix << out_ref_modifier << "&"
- << " _boxed_out (void);" << be_nl;
-
-}
-
-
-
-
-void
-be_visitor_valuebox_ch::emit_accessor_modifier (be_decl *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "// accessors and modifier" << be_nl;
-
- // Public accessor method (const)
- *os << "const " << node->full_name () << "& _value (void) const;" << be_nl;
-
- // Public accessor method
- *os << node->full_name () << "& _value (void);" << be_nl;
-
- // Public modifier method
- *os << "void" << " _value (const " << node->full_name () << "& val);"
- << be_nl << be_nl;
-}
-
-
-void
-be_visitor_valuebox_ch::emit_boxed_member_var (be_decl *node,
- const char * type_suffix)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Member variable of underlying type;
- *os << be_uidt_nl << "private:" << be_idt_nl;
-
- *os << node->full_name () << type_suffix << " _pd_value;" << be_nl;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp
deleted file mode 100644
index 8cefbec6f19..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp
+++ /dev/null
@@ -1,879 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuebox_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for valueboxes in the client inline file
-//
-// = AUTHOR
-// Gary Maxey
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuebox,
- valuebox_ci,
- "$Id: valuebox_ci.cpp Exp")
-
-be_visitor_valuebox_ci::be_visitor_valuebox_ci (be_visitor_context *ctx)
- : be_visitor_valuebox (ctx)
-{
-}
-
-be_visitor_valuebox_ci::~be_visitor_valuebox_ci (void)
-{
-}
-
-int
-be_visitor_valuebox_ci::visit_valuebox (be_valuebox *node)
-{
- // Nothing to do if we are imported or code is already generated.
- if (node->imported () || node->cli_inline_gen ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- this->ctx_->node (node); // save the node
-
- be_type *bt = be_type::narrow_from_decl (node->boxed_type ());
-
- // Emit the type specific elements. The visit_* methods in this
- // module do that work.
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%N:%l) be_visitor_valuebox_ci::visit_valuebox - "
- "type-specific valuebox code generation failed\n"),
- -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl;
-
- *os << "ACE_INLINE const char* " << be_nl
- << node->name () << "::_tao_obv_static_repository_id ()" << be_nl
- << "{" << be_idt_nl
- << "return \"" << node->repoID () << "\";" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Indicate that code is already generated for this node.
- node->cli_inline_gen (true);
-
- return 0;
-}
-
-int
-be_visitor_valuebox_ci::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ch.
- be_decl * vb_node = this->ctx_->node ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Public default constructor
- *os << "ACE_INLINE" << be_nl
- << vb_node->name () << "::" << vb_node->local_name () << " (void)"
- << be_nl << "{" << be_idt_nl
- << "this->_pd_value = " << node->full_name () << "_alloc ();"
- << be_uidt_nl << "}" << be_nl << be_nl;
-
- // Public constructor that takes a const array argument
- *os << "ACE_INLINE" << be_nl
- << vb_node->name () << "::" << vb_node->local_name () << " (const "
- << node->full_name () << " val)" << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value = " << node->full_name () << "_dup (val);"
- << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Public copy constructor
- *os << "ACE_INLINE" << be_nl
- << vb_node->name () << "::" << vb_node->local_name () << " (const "
- << vb_node->local_name () << "& val)" << be_idt_nl
- << ": ::CORBA::ValueBase (val)," << be_nl
- << " ::CORBA::DefaultValueRefCountBase (val)"
- << be_uidt_nl
- << "{" << be_idt_nl
- << "this->_pd_value = " << node->full_name ()
- << "_dup (val._pd_value.in ());" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Public assignment operator that takes a const array argument
- *os << "ACE_INLINE " << vb_node->name () << " &" << be_nl
- << vb_node->name () << "::operator= (const "
- << node->full_name () << " val)" << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value = " << node->full_name ()
- << "_dup (val);" << be_nl
- << "return *this;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Public accessor and modifier methods
- *os << "ACE_INLINE const " << node->full_name () << "_slice*" << be_nl
- << vb_node->name () << "::_value (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value.in ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "ACE_INLINE " << node->full_name () << "_slice*" << be_nl
- << vb_node->name () << "::_value (void)" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value.inout ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "ACE_INLINE void" << be_nl
- << vb_node->name () << "::_value (const " << node->full_name ()
- << " val)" << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value = " << node->full_name () << "_dup (val);"
- << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Overloaded subscript operators
- *os << "ACE_INLINE const " << node->full_name () << "_slice &" << be_nl
- << vb_node->name () << "::operator[] ( ::CORBA::ULong index) const"
- << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value[index];" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "ACE_INLINE "<< node->full_name () << "_slice &" << be_nl
- << vb_node->name () << "::operator[] ( ::CORBA::ULong index)" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value[index];" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Explicit conversion functions
- *os << "ACE_INLINE const " << node->full_name () << "_slice *" << be_nl
- << vb_node->name () << "::_boxed_in (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value.in ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "ACE_INLINE " << node->full_name () << "_slice *" << be_nl
- << vb_node->name () << "::_boxed_inout (void)" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value.inout ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "ACE_INLINE " << node->full_name () << "_slice *" << be_nl
- << vb_node->name () << "::_boxed_out (void)" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value.out ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_valuebox_ci::visit_enum (be_enum *node)
-{
- return this->emit_for_predef_enum (node, "", false);
-}
-
-int
-be_visitor_valuebox_ci::visit_interface (be_interface *node)
-{
- return this->emit_for_predef_enum (node, "_ptr", false);
-}
-
-int
-be_visitor_valuebox_ci::visit_predefined_type (be_predefined_type *node)
-{
- const char *marshal_arg;
- bool is_any = false;
-
- switch (node->pt())
- {
- case AST_PredefinedType::PT_boolean:
- marshal_arg = "::ACE_OutputCDR::from_boolean (this->_pd_value)";
- break;
-
- case AST_PredefinedType::PT_char:
- marshal_arg = "::ACE_OutputCDR::from_char (this->_pd_value)";
- break;
-
- case AST_PredefinedType::PT_wchar:
- marshal_arg = "::ACE_OutputCDR::from_wchar (this->_pd_value)";
- break;
-
- case AST_PredefinedType::PT_octet:
- marshal_arg = "::ACE_OutputCDR::from_octet (this->_pd_value)";
- break;
-
- case AST_PredefinedType::PT_any:
- marshal_arg = "this->_pd_value.in ()";
- is_any = true;
- break;
-
- default:
- marshal_arg = "this->_pd_value";
- break;
- }
-
- return this->emit_for_predef_enum (node, "", is_any);
-}
-
-int
-be_visitor_valuebox_ci::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ch.
- be_decl * vb_node = this->ctx_->node ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_default_constructor_alloc (node);
- this->emit_constructor_one_arg_alloc (node);
- this->emit_copy_constructor_alloc (node);
- this->emit_assignment_alloc (node);
- this->emit_accessor_modifier (node);
- this->emit_boxed_access(node, "*");
-
- // Generate maximum() accessor
- *os << "ACE_INLINE ::CORBA::ULong " << be_nl
- << vb_node->name () << "::maximum (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value->maximum ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Generate length() accessor
- *os << "ACE_INLINE ::CORBA::ULong " << be_nl
- << vb_node->name () << "::length (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value->length ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Generate length() setter
- *os << "ACE_INLINE void " << be_nl
- << vb_node->name () << "::length ( ::CORBA::ULong length)" << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value->length (length);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_valuebox_ci::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- const char *string_type;
- const char *char_type;
- if (node->node_type () == AST_Decl::NT_string)
- {
- string_type = "String";
- char_type = "::CORBA::Char";
- }
- else if (node->node_type () == AST_Decl::NT_wstring)
- {
- string_type = "WString";
- char_type = "::CORBA::WChar";
- }
- else
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ci::visit_string -"
- "unexpected string node type=%d\n", node->node_type ()));
- return -1;
- }
-
- // Retrieve the node being visited by this be_visitor_valuebox_ch.
- be_decl * vb_node = this->ctx_->node ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_default_constructor ();
- this->emit_constructor_one_arg (node, "");
- this->emit_copy_constructor ();
- this->emit_assignment (node, "");
-
- // Public constructor with one const argument of underlying type
- *os << "ACE_INLINE " << be_nl
- << vb_node->name () << "::" << vb_node->local_name () << " (const "
- << node->full_name () << " val)" << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value = val;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
-
- // Public constructor with one argument of type const CORBA::String_var&
- *os << "ACE_INLINE" << be_nl
- << vb_node->name () << "::" << vb_node->local_name ()
- << " (const ::CORBA::" << string_type << "_var& var)" << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value = var;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Public assignment operator with one argument of type const char *
- *os << "ACE_INLINE " << vb_node->name () << " &" << be_nl
- << vb_node->name () << "::operator= (const "
- << node->full_name () << " val)" << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value = val;" << be_nl
- << "return *this;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Public assignment operator with one argument of type
- // const CORBA::String_var&
- *os << "ACE_INLINE " << vb_node->name () << " &" << be_nl
- << vb_node->name () << "::operator= (const ::CORBA::"
- << string_type << "_var& var)"
- << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value = var;" << be_nl
- << "return *this;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Accessor function takes no arguments and returns a const char *
- *os << "ACE_INLINE const " << node->full_name () << be_nl
- << vb_node->name () << "::_value (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value.in ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Modifier function with one argument of type char *
- *os << "ACE_INLINE void" << be_nl
- << vb_node->name () << "::_value ("
- << node->full_name () << " val)" << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value = val;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Modifier function with one argument of type const char *
- *os << "ACE_INLINE void" << be_nl
- << vb_node->name () << "::_value (const "
- << node->full_name () << " val)" << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value = val;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Modifier function with one argument of type const CORBA::String_var&
- *os << "ACE_INLINE void" << be_nl
- << vb_node->name () << "::_value (const ::CORBA::" << string_type
- << "_var& var)" << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value = var;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Access to the boxed value for method signatures
- *os << "ACE_INLINE const " << node->full_name () << be_nl
- << vb_node->name () << "::_boxed_in (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value.in ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "ACE_INLINE " << node->full_name () << "&" << be_nl
- << vb_node->name () << "::_boxed_inout (void)" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value.inout ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "ACE_INLINE " << node->full_name () << "&" << be_nl
- << vb_node->name () << "::_boxed_out (void)" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value.out ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Overloaded subscript operators
- *os << "ACE_INLINE " << char_type << " &" << be_nl
- << vb_node->name () << "::operator[] ( ::CORBA::ULong slot)" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value[slot];" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "ACE_INLINE " << char_type << be_nl
- << vb_node->name () << "::operator[] ( ::CORBA::ULong slot) const" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value[slot];" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_valuebox_ci::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ch.
- be_decl * vb_node = this->ctx_->node ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_default_constructor_alloc (node);
- this->emit_constructor_one_arg_alloc (node);
- this->emit_copy_constructor_alloc (node);
- this->emit_assignment_alloc (node);
- this->emit_accessor_modifier (node);
- // Access to the boxed value for method signatures
- if (node->size_type() == AST_Type::FIXED)
- {
- this->emit_boxed_access (node, "");
- }
- else
- {
- this->emit_boxed_access (node, "*");
- }
-
- // Now generate the accessor and modifier functions for each struct
- // member. These functions have the same signatures as
- // acessor and modifier functions for union members.
- AST_Decl *d;
- be_field *field;
- be_visitor_context ctx (*this->ctx_);
- ctx.scope (vb_node);
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- d = si.item ();
-
- if (d == 0 || (field = be_field::narrow_from_decl (d)) == 0)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_cs::visit_structure -"
- "bad node in this scope\n"));
- break;
- }
-
- // Create a visitor and use that to process the field type.
- be_visitor_valuebox_field_ci visitor (&ctx);
- ctx.node (field);
-
- if (visitor.visit_field (field) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_cs::visit_structure - "
- "visit_field failed\n"
- ), -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_valuebox_ci::visit_typedef (be_typedef *node)
-{
- // Make a decision based on the primitive base type.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ci::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuebox_ci::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ci.
- be_decl * vb_node = this->ctx_->node ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_default_constructor_alloc (node);
- this->emit_constructor_one_arg_alloc (node);
- this->emit_copy_constructor_alloc (node);
- this->emit_assignment_alloc (node);
- this->emit_accessor_modifier (node);
- if (node->size_type() == AST_Type::FIXED)
- {
- this->emit_boxed_access (node, "");
- }
- else
- {
- this->emit_boxed_access (node, "*");
- }
-
- // Now generate the accessor and modifier functions for each union
- // member.
- AST_Decl *d;
- be_union_branch *member;
- be_visitor_context ctx (*this->ctx_);
- ctx.scope (vb_node);
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- d = si.item ();
-
- if (d == 0 || (member = be_union_branch::narrow_from_decl (d)) == 0)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ci::visit_union -"
- "bad node in this scope\n"));
- break;
- }
-
- // Create a visitor and use that to process the union member type.
- be_visitor_valuebox_union_member_ci visitor (&ctx);
- ctx.node (member);
-
- if (visitor.visit_union_member (member) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_cs::visit_structure - "
- "visit_field failed\n"
- ), -1);
- }
- }
-
-
- // Retrieve the disriminant type.
- be_type *bt;
- bt = be_type::narrow_from_decl (node->disc_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ci::visit_union - "
- "bad disciminant type\n"),
- -1);
- }
-
-
- // Generate modifier and accessor for discriminant
- *os << "ACE_INLINE void " << be_nl
- << vb_node->name () << "::_d (" << bt->nested_type_name (node) << " val)"
- << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value->_d (val);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "ACE_INLINE " << bt->nested_type_name (node) << be_nl
- << vb_node->name () << "::_d (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value->_d ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- return 0;
-}
-
-
-
-int
-be_visitor_valuebox_ci::emit_for_predef_enum (be_type *node,
- const char * type_suffix,
- bool is_any)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ci.
- be_decl * vb_node = this->ctx_->node ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- if (is_any)
- {
- this->emit_default_constructor_alloc (node);
- this->emit_copy_constructor_alloc (node);
- this->emit_constructor_one_arg_alloc (node);
- this->emit_assignment_alloc (node);
- this->emit_accessor_modifier (node);
- this->emit_boxed_access (node, "*");
- }
- else
- {
- this->emit_default_constructor ();
- this->emit_copy_constructor ();
- this->emit_constructor_one_arg (node, type_suffix);
- this->emit_assignment (node, type_suffix);
-
- // Public accessor method
- *os << "ACE_INLINE " << node->full_name () << type_suffix << be_nl
- << vb_node->name () << "::_value (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Public modifier method
- *os << "ACE_INLINE void" << be_nl
- << vb_node->name () << "::_value ("
- << node->full_name ()
- << type_suffix << " val)" << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value = val;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Explicit conversion functions
- *os << "ACE_INLINE " << node->full_name () << type_suffix << be_nl
- << vb_node->name () << "::_boxed_in (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "ACE_INLINE " << node->full_name () << type_suffix << "&" << be_nl
- << vb_node->name () << "::_boxed_inout (void)" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "ACE_INLINE " << node->full_name () << type_suffix << "&" << be_nl
- << vb_node->name () << "::_boxed_out (void)" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- }
-
- return 0;
-}
-
-void
-be_visitor_valuebox_ci::emit_default_constructor (void)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ci.
- be_decl * vb_node = this->ctx_->node ();
-
- // Public default constructor
- *os << "ACE_INLINE" << be_nl;
- *os << vb_node->name () << "::" << vb_node->local_name ()
- << " (void)" << be_nl;
- *os << "{}" << be_nl << be_nl;
-}
-
-void
-be_visitor_valuebox_ci::emit_default_constructor_alloc (be_decl *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ci
- be_decl * vb_node = this->ctx_->node ();
- bool node_not_pod =
- be_type::narrow_from_decl (node)->size_type () == AST_Type::VARIABLE;
-
- // Public default constructor
- *os << "ACE_INLINE " << be_nl
- << vb_node->name () << "::" << vb_node->local_name () << " (void)"
- << be_nl << "{" << be_idt_nl
- << node->full_name () << "* p = 0;" << be_nl
- << "ACE_NEW (" << be_idt_nl
- << "p," << be_nl
- << node->full_name ()
- << (node_not_pod ? " ()" : "") << ");" << be_uidt_nl
- << "this->_pd_value = p;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-}
-
-void
-be_visitor_valuebox_ci::emit_constructor_one_arg (be_decl *node,
- const char * type_suffix)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ci.
- be_decl * vb_node = this->ctx_->node ();
-
- // Public constructor with one argument of underlying type
- *os << "ACE_INLINE " << be_nl
- << vb_node->name () << "::" << vb_node->local_name () << " ("
- << node->full_name () << type_suffix << " val)" << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value = val;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-}
-
-void
-be_visitor_valuebox_ci::emit_constructor_one_arg_alloc (be_decl *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ci.
- be_decl * vb_node = this->ctx_->node ();
-
- // Public constructor with single argument of type const T&
- *os << "ACE_INLINE " << be_nl
- << vb_node->name () << "::" << vb_node->local_name ()
- << " (const " << node->full_name () << "& value)" << be_nl
- << "{" << be_idt_nl
- << node->full_name () << "* p = 0;" << be_nl
- << "ACE_NEW (" << be_idt_nl
- << "p," << be_nl
- << node->full_name () << " (value));" << be_uidt_nl
- << "this->_pd_value = p;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-}
-
-void
-be_visitor_valuebox_ci::emit_copy_constructor (void)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ci.
- be_decl * vb_node = this->ctx_->node ();
-
- // Public Copy constructor
- *os << "ACE_INLINE " << be_nl
- << vb_node->name () << "::" << vb_node->local_name ()
- << " (const " << vb_node->full_name () << "& val)" << be_idt_nl
- << ": ::CORBA::ValueBase (val)," << be_nl
- << " ::CORBA::DefaultValueRefCountBase (val)"
- << be_uidt_nl
- << "{" << be_idt_nl
- << "this->_pd_value = val._pd_value;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-}
-
-void
-be_visitor_valuebox_ci::emit_copy_constructor_alloc (be_decl *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ci.
- be_decl * vb_node = this->ctx_->node ();
-
- // Public copy constructor
- *os << "ACE_INLINE " << be_nl
- << vb_node->name () << "::" << vb_node->local_name () << " (const "
- << vb_node->full_name () << "& val)" << be_idt_nl
- << ": ::CORBA::ValueBase (val)," << be_nl
- << " ::CORBA::DefaultValueRefCountBase (val)"
- << be_uidt_nl
- << "{" << be_idt_nl
- << node->full_name () << "* p = 0;" << be_nl
- << "ACE_NEW (" << be_idt_nl
- << "p," << be_nl
- << node->full_name () << " (val._pd_value.in ()));" << be_uidt_nl
- << "this->_pd_value = p;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-}
-
-
-void
-be_visitor_valuebox_ci::emit_assignment (be_decl *node,
- const char * type_suffix)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ci.
- be_decl * vb_node = this->ctx_->node ();
-
- // Public assignment operator with one argument of underlying type
- *os << "ACE_INLINE " << vb_node->name () << " &" << be_nl
- << vb_node->name () << "::operator= ("
- << node->full_name () << type_suffix << " val)" << be_nl
- << "{" << be_idt_nl
- << "this->_pd_value = val;" << be_nl
- << "return *this;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-}
-
-void
-be_visitor_valuebox_ci::emit_assignment_alloc (be_decl *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ci.
- be_decl * vb_node = this->ctx_->node ();
-
- // Public assignment operator with one argument of type const T&
- *os << "ACE_INLINE " << vb_node->name () << " &" << be_nl
- << vb_node->name () << "::operator= (const "
- << node->full_name () << "& value)" << be_nl
- << "{" << be_idt_nl
- << node->full_name () << "* p = 0;" << be_nl
- << "ACE_NEW_RETURN (" << be_idt_nl
- << "p," << be_nl
- << node->full_name () << " (value)," << be_nl
- << "*this);" << be_uidt_nl << be_nl
- << "this->_pd_value = p;" << be_nl
- << "return *this;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-}
-
-
-void
-be_visitor_valuebox_ci::emit_accessor_modifier (be_decl *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ci.
- be_decl * vb_node = this->ctx_->node ();
-
- // Public accessor method (const)
- *os << "ACE_INLINE const " << node->full_name () << " &" << be_nl
- << vb_node->name () << "::_value (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value.in ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Public accessor method
- *os << "ACE_INLINE " << node->full_name () << " &" << be_nl
- << vb_node->name () << "::_value (void)" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value.inout ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Public modifier method
- *os << "ACE_INLINE void" << be_nl
- << vb_node->name () << "::_value (const "
- << node->full_name () << "& value)" << be_nl
- << "{" << be_idt_nl
- << node->full_name () << "* p = 0;" << be_nl
- << "ACE_NEW (" << be_idt_nl
- << "p," << be_nl
- << node->full_name () << " (value));" << be_uidt_nl
- << "this->_pd_value = p;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-}
-
-void
-be_visitor_valuebox_ci::emit_boxed_access (be_decl *node,
- const char *out_ref_modifier)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_ci.
- be_decl * vb_node = this->ctx_->node ();
-
- // Access to the boxed value for method signatures
- *os << "ACE_INLINE const " << node->full_name () << " &" << be_nl
- << vb_node->name () << "::_boxed_in (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value.in ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "ACE_INLINE " << node->full_name () << "&" << be_nl
- << vb_node->name () << "::_boxed_inout (void)" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value.inout ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "ACE_INLINE " << node->full_name ()
- << out_ref_modifier << "&" << be_nl
- << vb_node->name () << "::_boxed_out (void)" << be_nl
- << "{" << be_idt_nl
- << "return this->_pd_value.out ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp
deleted file mode 100644
index f67657fbad5..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_cs.cpp
+++ /dev/null
@@ -1,653 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuebox_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for valueboxes in the client stub file
-//
-// = AUTHOR
-// Gary Maxey
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuebox,
- valuebox_cs,
- "$Id: valuebox_cs.cpp Exp")
-
-be_visitor_valuebox_cs::be_visitor_valuebox_cs (be_visitor_context *ctx)
- : be_visitor_valuebox (ctx)
-{
-}
-
-be_visitor_valuebox_cs::~be_visitor_valuebox_cs (void)
-{
-}
-
-int
-be_visitor_valuebox_cs::visit_valuebox (be_valuebox *node)
-{
- // Nothing to do if we are imported or code is already generated.
- if (node->cli_stub_gen () || node->imported ())
- {
- return 0;
- }
-
- if (be_global->tc_support ())
- {
- be_visitor_context ctx (*this->ctx_);
- TAO::be_visitor_alias_typecode visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_cs::"
- "visit_valuebox - "
- "TypeCode definition failed\n"),
- -1);
- }
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- this->ctx_->node (node); // save the node
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- if (node->is_defined ())
- {
- *os << be_nl << be_nl
- << "void" << be_nl
- << "TAO::Value_Traits<" << node->name () << ">::add_ref ("
- << be_idt << be_idt_nl
- << node->name () << " * p" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::add_ref (p);" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "void" << be_nl
- << "TAO::Value_Traits<" << node->name () << ">::remove_ref ("
- << be_idt << be_idt_nl
- << node->name () << " * p" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::remove_ref (p);" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "void" << be_nl
- << "TAO::Value_Traits<" << node->name () << ">::release ("
- << be_idt << be_idt_nl
- << node->name () << " * p" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::remove_ref (p);" << be_uidt_nl
- << "}";
- }
-
- // The _downcast method.
- *os << be_nl << be_nl
- << node->name () << " *" << be_nl
- << node->name () << "::_downcast ( ::CORBA::ValueBase *v)" << be_nl
- << "{" << be_idt_nl
- << "return dynamic_cast< ::" << node->name () << " * > (v);"
- << be_uidt_nl << "}" << be_nl << be_nl;
-
- // _copy_value method
- *os << "::CORBA::ValueBase *" << be_nl
- << node->name () << "::_copy_value (void)" << be_nl
- << "{" << be_idt_nl
- << "::CORBA::ValueBase *result = 0;" << be_nl
- << "ACE_NEW_RETURN (" << be_idt_nl
- << "result," << be_nl
- << node->local_name () << " (*this)," << be_nl
- << "0);" << be_nl << be_uidt_nl
- << "return result;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // The _tao_obv_repository_id method.
- *os << "const char *" << be_nl
- << node->name () << "::_tao_obv_repository_id (void) const"
- << be_nl << "{" << be_idt_nl
- << "return this->_tao_obv_static_repository_id ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "void" << be_nl
- << node->name () << "::_tao_obv_truncatable_repo_ids (Repository_Id_List& ids) const" << be_nl
- << "{" << be_idt_nl
- << "ids.push_back (this->_tao_obv_static_repository_id ());" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // _tao_match_formal_type method. Generated because ValueBase interface
- // requires it. Since value boxes do not support inheritence, this can
- // simply return true.
- *os << "::CORBA::Boolean " << be_nl
- << node->name ()
- << "::_tao_match_formal_type (ptrdiff_t ) const" << be_nl
- << "{" << be_idt_nl
- << "return true;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- AST_Type * at = node->boxed_type()->unaliased_type();
- be_type *bt = be_type::narrow_from_decl (at);
- bool is_array = false;
-
- const char * unmarshal_arg;
- be_predefined_type *bpt = be_predefined_type::narrow_from_decl (bt);
- if (bpt != 0)
- {
- switch (bpt->pt())
- {
- case AST_PredefinedType::PT_boolean:
- unmarshal_arg = "::ACE_InputCDR::to_boolean (vb_object->_pd_value)";
- break;
-
- case AST_PredefinedType::PT_char:
- unmarshal_arg = "::ACE_InputCDR::to_char (vb_object->_pd_value)";
- break;
-
- case AST_PredefinedType::PT_wchar:
- unmarshal_arg = "::ACE_InputCDR::to_wchar (vb_object->_pd_value)";
- break;
-
- case AST_PredefinedType::PT_octet:
- unmarshal_arg = "::ACE_InputCDR::to_octet (vb_object->_pd_value)";
- break;
-
- case AST_PredefinedType::PT_any:
- // We need to help the ">>" operator for "any" because
- // a conversion operator is not available.
- unmarshal_arg = "vb_object->_pd_value.inout ()";
- break;
-
- default:
- unmarshal_arg = "vb_object->_pd_value";
- }
- }
- else if (be_array::narrow_from_decl (bt) != 0)
- {
- is_array = true;
- unmarshal_arg = "temp";
- }
- else
- {
- unmarshal_arg = "vb_object->_pd_value";
- }
-
- // The _tao_unmarshal method.
- *os << "::CORBA::Boolean " << be_nl
- << node->name () << "::_tao_unmarshal (" << be_idt << be_idt_nl
- << "TAO_InputCDR &strm," << be_nl
- << node->local_name () << " *&vb_object" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::Boolean is_null_object;" << be_nl
- << "if ( ::CORBA::ValueBase::_tao_validate_box_type (" << be_idt
- << be_idt << be_idt_nl
- << "strm," << be_nl
- << node->local_name () << "::_tao_obv_static_repository_id ()," << be_nl
- << "is_null_object"
- << be_uidt_nl
- << ") == false)" << be_uidt_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "vb_object = 0;" << be_nl
- << "if (is_null_object)" << be_idt_nl
- << "{" << be_idt_nl
- << "return true;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "ACE_NEW_RETURN (" << be_idt_nl
- << "vb_object," << be_nl
- << node->local_name () << "," << be_nl
- << "false);" << be_nl << be_uidt_nl;
-
- if (is_array)
- {
- *os << at->full_name() << "_forany temp (vb_object->_boxed_inout ());"
- << be_nl;
- }
- *os << "return (strm >> " << unmarshal_arg << ");" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // _tao_unmarshal_v method. Generated because ValueBase interface
- // requires it. But there is nothing for it to do in the valuebox
- // case.
- *os << "::CORBA::Boolean " << be_nl
- << node->name ()
- << "::_tao_unmarshal_v (TAO_InputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return true;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Emit the type specific elements. The visit_* methods in this
- // module do that work.
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%N:%l) be_visitor_valuebox_cs::visit_valuebox - "
- "type-specific valuebox code generation failed\n"),
- -1);
- }
-
- // Indicate that code is already generated for this node.
- node->cli_stub_gen (true);
-
- return 0;
-}
-
-int
-be_visitor_valuebox_cs::visit_array (be_array * node)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_cs.
- be_decl * const vb_node = this->ctx_->node ();
-
- os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_destructor ();
-
- // _tao_marshal_v method
- os << "::CORBA::Boolean " << be_nl
- << vb_node->name ()
- << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl
- << "{" << be_idt_nl
- << node->name () << "_forany temp (this->_pd_value.ptr ());" << be_nl
- << "return (strm << temp);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_valuebox_cs::visit_enum (be_enum *)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_cs.
- be_decl * const vb_node = this->ctx_->node ();
-
- os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_destructor ();
-
- static char const marshal_arg[] = "this->_pd_value";
-
- // _tao_marshal_v method
- os << "::CORBA::Boolean " << be_nl
- << vb_node->name ()
- << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl
- << "{" << be_idt_nl
- << "return (strm << " << marshal_arg << ");" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- return 0;
-}
-
-
-int
-be_visitor_valuebox_cs::visit_interface (be_interface *)
-{
- return this->emit_for_predef_enum ("this->_pd_value");
-}
-
-int
-be_visitor_valuebox_cs::visit_predefined_type (be_predefined_type * node)
-{
- char const * marshal_arg;
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_boolean:
- marshal_arg = "::ACE_OutputCDR::from_boolean (this->_pd_value)";
- break;
-
- case AST_PredefinedType::PT_char:
- marshal_arg = "::ACE_OutputCDR::from_char (this->_pd_value)";
- break;
-
- case AST_PredefinedType::PT_wchar:
- marshal_arg = "::ACE_OutputCDR::from_wchar (this->_pd_value)";
- break;
-
- case AST_PredefinedType::PT_octet:
- marshal_arg = "::ACE_OutputCDR::from_octet (this->_pd_value)";
- break;
-
- case AST_PredefinedType::PT_any:
- marshal_arg = "this->_pd_value.in ()";
- break;
-
- default:
- marshal_arg = "this->_pd_value";
- break;
- }
-
- return this->emit_for_predef_enum (marshal_arg);
-}
-
-int
-be_visitor_valuebox_cs::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_cs.
- be_decl * vb_node = this->ctx_->node ();
-
- if (node->anonymous ())
- { // Our sequence is anonymous so we must generate a declaration
- // for it.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // First generate the sequence definition
- be_visitor_sequence_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_cs::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // Retrieve the base type since we will need to do some code
- // generation for it.
- be_type *bt = be_type::narrow_from_decl (node->base_type ());
- if (bt == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_ch::"
- "visit_sequence - "
- "Bad element type\n"),
- -1);
- }
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH);
- be_visitor_sequence_buffer_type bt_visitor (&ctx);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- if (node->unbounded ())
- {
- // Public constructor with one argument of type ULong
- *os << vb_node->name () << "::" << vb_node->local_name ()
- << " ( ::CORBA::ULong max)" << be_nl
- << "{" << be_idt_nl
- << node->full_name () << "* p;" << be_nl
- << "ACE_NEW (" << be_idt_nl
- << "p," << be_nl
- << node->full_name () << " (max));" << be_uidt_nl
- << "this->_pd_value = p;" << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
-
- // Public constructor for sequence with supplied buffer
- *os << vb_node->name () << "::" << vb_node->local_name ()
- << " (" << be_idt;
-
- if (node->unbounded ())
- {
- *os << be_nl << "::CORBA::ULong max,";
- }
-
- *os << be_nl << "::CORBA::ULong length, " << be_nl;
-
-
- if (bt->accept (&bt_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_cs::"
- "visit_valuebox - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << " * buf," << be_nl
- << "::CORBA::Boolean release)" << be_uidt_nl
- << "{" << be_idt_nl
- << node->full_name () << "* p;" << be_nl
- << "ACE_NEW (" << be_idt_nl
- << "p," << be_nl
- << node->full_name () << " (";
-
- if (node->unbounded ())
- {
- *os << "max, ";
- }
-
- *os << "length, buf, release));" << be_uidt_nl
- << "this->_pd_value = p;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // end: Public constructor for sequence with supplied buffer
-
- this->emit_destructor ();
-
- // Accessor: non const
- if (bt->accept (&bt_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_cs::"
- "visit_valuebox - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << " & " << be_nl
- << vb_node->name () << "::operator[] ( ::CORBA::ULong index)" << be_nl
- << "{" << be_idt_nl
- << "return (";
-
- if (bt->accept (&bt_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_cs::"
- "visit_valuebox - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << "&) this->_pd_value->operator[] (index);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Accessor: const
- *os << "const ";
- if (bt->accept (&bt_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_cs::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
- *os << " &" << be_nl;
- *os << vb_node->name ()
- << "::operator[] ( ::CORBA::ULong index) const" << be_nl
- << "{" << be_idt_nl;
-
- switch (bt->node_type())
- {
- case AST_Decl::NT_wstring:
- *os << "TAO_SeqElem_WString_Manager mgr = this->_pd_value->operator[] "
- "(index); " << be_nl
- << "return mgr._retn ();" << be_uidt_nl;
- break;
-
- case AST_Decl::NT_string:
- *os << "TAO_SeqElem_String_Manager mgr = this->_pd_value->operator[] "
- "(index); " << be_nl
- << "return mgr._retn ();" << be_uidt_nl;
- break;
-
- default:
- *os << "return (";
-
- if (bt->accept (&bt_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_cs::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
-
- *os << "&) this->_pd_value->operator[] (index);" << be_uidt_nl;
-
- }
-
- *os << "}" << be_nl << be_nl;
-
- // _tao_marshal_v method
- *os << "::CORBA::Boolean " << be_nl
- << vb_node->name ()
- << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl
- << "{" << be_idt_nl
- << "return (strm << this->_pd_value.in ());" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_valuebox_cs::visit_string (be_string *)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_cs.
- be_decl * const vb_node = this->ctx_->node ();
-
- os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_destructor ();
-
- // _tao_marshal_v method
- os << "::CORBA::Boolean " << be_nl
- << vb_node->name ()
- << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl
- << "{" << be_idt_nl
- << "return (strm << this->_pd_value);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_valuebox_cs::visit_structure (be_structure *)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_cs.
- be_decl * const vb_node = this->ctx_->node ();
-
- os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_destructor ();
-
- // _tao_marshal_v method
- os << "::CORBA::Boolean " << be_nl
- << vb_node->name ()
- << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl
- << "{" << be_idt_nl
- << "return (strm << this->_pd_value.in ());" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_valuebox_cs::visit_typedef (be_typedef *node)
-{
- // Make a decision based on the primitive base type.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuebox_cs::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuebox_cs::visit_union (be_union *)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_cs.
- be_decl * const vb_node = this->ctx_->node ();
-
- os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_destructor ();
-
- // _tao_marshal_v method
- os << "::CORBA::Boolean " << be_nl
- << vb_node->name ()
- << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl
- << "{" << be_idt_nl
- << "return (strm << this->_pd_value.in ());" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- return 0;
-}
-
-void
-be_visitor_valuebox_cs::emit_destructor (void)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_cs.
- be_decl * const vb_node = this->ctx_->node ();
-
- // Protected destructor
- os << vb_node->name () << "::~" << vb_node->local_name () << " (void)"
- << be_nl << "{" << be_nl << "}" << be_nl << be_nl;
-}
-
-int
-be_visitor_valuebox_cs::emit_for_predef_enum (char const * marshal_arg)
-{
- TAO_OutStream & os = *this->ctx_->stream ();
-
- // Retrieve the node being visited by this be_visitor_valuebox_cs.
- be_decl * const vb_node = this->ctx_->node ();
-
- os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- this->emit_destructor ();
-
- // _tao_marshal_v method
- os << "::CORBA::Boolean " << be_nl
- << vb_node->name ()
- << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl
- << "{" << be_idt_nl
- << "return (strm << " << marshal_arg << ");" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype.cpp
deleted file mode 100644
index 2db4462bc35..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-
-// $Id$
-//
-/* -*- c++ -*- */
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_valuetype.cpp
-//
-// = DESCRIPTION
-// Concrete visitor for the Valuetype class
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-//
-// ============================================================================
-
-#include "be_argument.h"
-#include "be_array.h"
-#include "be_attribute.h"
-#include "be_constant.h"
-#include "be_enum.h"
-#include "be_exception.h"
-#include "be_component.h"
-#include "be_component_fwd.h"
-#include "be_eventtype.h"
-#include "be_eventtype_fwd.h"
-#include "be_factory.h"
-#include "be_field.h"
-#include "be_generator.h"
-#include "be_interface_fwd.h"
-#include "be_module.h"
-#include "be_predefined_type.h"
-#include "be_operation.h"
-#include "be_sequence.h"
-#include "be_string.h"
-#include "be_structure.h"
-#include "be_structure_fwd.h"
-#include "be_typedef.h"
-#include "be_union.h"
-#include "be_union_fwd.h"
-#include "be_valuebox.h"
-#include "be_valuetype.h"
-#include "be_valuetype_fwd.h"
-#include "be_helper.h"
-#include "be_extern.h"
-#include "utl_identifier.h"
-#include "utl_exceptlist.h"
-#include "be_util.h"
-
-#include "be_visitor_valuetype.h"
-#include "be_visitor_argument.h"
-#include "be_visitor_array.h"
-#include "be_visitor_field.h"
-#include "be_visitor_constant.h"
-#include "be_visitor_enum.h"
-#include "be_visitor_exception.h"
-#include "be_visitor_operation.h"
-#include "be_visitor_sequence.h"
-#include "be_visitor_structure.h"
-#include "be_visitor_structure_fwd.h"
-#include "be_visitor_typecode.h"
-#include "be_visitor_typedef.h"
-#include "be_visitor_union.h"
-#include "be_visitor_union_fwd.h"
-#include "be_visitor_context.h"
-
-#include "be_visitor_valuetype/valuetype.cpp"
-#include "be_visitor_valuetype/valuetype_ch.cpp"
-#include "be_visitor_valuetype/valuetype_ci.cpp"
-#include "be_visitor_valuetype/valuetype_cs.cpp"
-#include "be_visitor_valuetype/valuetype_sh.cpp"
-#include "be_visitor_valuetype/valuetype_si.cpp"
-#include "be_visitor_valuetype/valuetype_ss.cpp"
-#include "be_visitor_valuetype/valuetype_obv_ch.cpp"
-#include "be_visitor_valuetype/valuetype_obv_ci.cpp"
-#include "be_visitor_valuetype/valuetype_obv_cs.cpp"
-#include "be_visitor_valuetype/any_op_ch.cpp"
-#include "be_visitor_valuetype/any_op_cs.cpp"
-#include "be_visitor_valuetype/cdr_op_ch.cpp"
-#include "be_visitor_valuetype/cdr_op_cs.cpp"
-#include "be_visitor_valuetype/marshal_ch.cpp"
-#include "be_visitor_valuetype/marshal_cs.cpp"
-#include "be_visitor_valuetype/arglist.cpp"
-#include "be_visitor_valuetype/field_ch.cpp"
-#include "be_visitor_valuetype/field_ci.cpp"
-#include "be_visitor_valuetype/field_cs.cpp"
-#include "be_visitor_valuetype/field_cdr_ch.cpp"
-#include "be_visitor_valuetype/field_cdr_cs.cpp"
-#include "be_visitor_valuetype/obv_module.cpp"
-#include "be_visitor_valuetype/ami_exception_holder_ch.cpp"
-#include "be_visitor_valuetype/ami_exception_holder_cs.cpp"
-#include "be_visitor_valuetype/valuetype_init.cpp"
-#include "be_visitor_valuetype/valuetype_init_ch.cpp"
-#include "be_visitor_valuetype/valuetype_init_ci.cpp"
-#include "be_visitor_valuetype/valuetype_init_cs.cpp"
-#include "be_visitor_valuetype/valuetype_init_arglist_ch.cpp"
-
-ACE_RCSID (be,
- be_visitor_valuetype,
- "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_ch.cpp
deleted file mode 100644
index 84d1bd214c5..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_ch.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_exception_holder_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating exception holders for the AMI callback model.
-//
-// = AUTHOR
-// Michael Kircher <Michael.Kircher@mchp.siemens.de>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- ami_exception_holder_ch,
- "$Id$")
-
-// ******************************************************
-// Interface visitor for client header.
-// ******************************************************
-
-be_visitor_valuetype_ami_exception_holder_ch::
-be_visitor_valuetype_ami_exception_holder_ch (be_visitor_context *ctx)
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_ami_exception_holder_ch::
-~be_visitor_valuetype_ami_exception_holder_ch (void)
-{
-}
-
-int
-be_visitor_valuetype_ami_exception_holder_ch::visit_operation (
- be_operation *node
- )
-{
- be_visitor_context ctx (*this->ctx_);
-
- // Using the implementation class visitor is strange, but we
- // do it here because it's the only one that generates the
- // environment variable in the operation signature without
- // the trailing _WITH_DEFAULTS, which is what we want.
- // For performance reasons, we would rather there be a
- // compile error if the user does not pass an environment
- // variable, than create a default one, which causes extra
- // TSS activity.
- be_visitor_operation_ih visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_"
- "ami_exception_holder_ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_uidt;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_cs.cpp
deleted file mode 100644
index 726706a8ff1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_cs.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_exception_holder_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for excpetion holders.
-//
-// = AUTHOR
-// Michael Kircher
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- ami_exception_holder_cs,
- "$Id$")
-
-// ************************************************************
-// Interface visitor for client stubs
-// ************************************************************
-
-be_visitor_valuetype_ami_exception_holder_cs::
-be_visitor_valuetype_ami_exception_holder_cs (be_visitor_context *ctx)
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_ami_exception_holder_cs::
-~be_visitor_valuetype_ami_exception_holder_cs (void)
-{
-}
-
-int
-be_visitor_valuetype_ami_exception_holder_cs::visit_valuetype (
- be_valuetype *node
- )
-{
- ACE_UNUSED_ARG (node);
- return 0;
-}
-
-
-int
-be_visitor_valuetype_ami_exception_holder_cs::visit_operation (be_operation *node)
-{
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_RAISE_OPERATION_CS);
- be_visitor_operation_ami_exception_holder_operation_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ami_exception_holder_ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_ch.cpp
deleted file mode 100644
index 4d3b75db1e8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_ch.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for a valuetype in the client
-// header.
-//
-// = AUTHOR
-// Jeff Parsons <parsons@cs.wustl.edu>
-// Boris Kolpackov <bosk@ipmce.ru>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- any_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Valuetype visitor for generating Any operator declarations.
-// ***************************************************************************
-
-be_visitor_valuetype_any_op_ch::be_visitor_valuetype_any_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_any_op_ch::~be_visitor_valuetype_any_op_ch (void)
-{
-}
-
-int
-be_visitor_valuetype_any_op_ch::visit_valuetype (be_valuetype *node)
-{
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- const char *macro = this->ctx_->export_macro ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- be_module *module = 0;
-
- if (node->is_nested () &&
- node->defined_in ()->scope_node_type () == AST_Decl::NT_module)
- {
- module = be_module::narrow_from_scope (node->defined_in ());
-
- if (!module)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_valuebox_any_op_ch::"
- "visit_valuebox - "
- "Error parsing nested name\n"),
- -1);
- }
-
- // Some compilers handle "any" operators in a namespace
- // corresponding to their module, others do not.
- *os << "\n\n#if defined (ACE_ANY_OPS_USE_NAMESPACE)\n";
-
- be_util::gen_nested_namespace_begin (os, module);
-
- // emit nested variation of any operators
- *os << macro << " void"
- << " operator<<= ( ::CORBA::Any &, " << node->local_name ()
- << " *); // copying" << be_nl;
-
- *os << macro << " void"
- << " operator<<= ( ::CORBA::Any &, " << node->local_name ()
- << " **); // non-copying" << be_nl;
-
- *os << macro << " ::CORBA::Boolean"
- << " operator>>= (const ::CORBA::Any &, "
- << node->local_name () << " *&);";
-
- be_util::gen_nested_namespace_end (os, module);
-
- // emit #else
- *os << "#else\n\n";
- }
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << macro << " void operator<<= (::CORBA::Any &, " << node->name ()
- << " *); // copying" << be_nl;
-
- *os << macro << " void operator<<= (::CORBA::Any &, " << node->name ()
- << " **); // non-copying" << be_nl;
-
- *os << macro << " ::CORBA::Boolean operator>>= (const ::CORBA::Any &, "
- << node->name () << " *&);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- if (module != 0)
- {
- *os << "\n\n#endif";
- }
-
- node->cli_hdr_any_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_valuetype_any_op_ch::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp
deleted file mode 100644
index aa784e3a0e1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for valuetypes in the stubs
-// file.
-//
-// = AUTHOR
-// Jeff Parsons <parsons@cs.wustl.edu>
-// Boris Kolpackov <bosk@ipmce.ru>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- any_op_cs,
- "$Id$")
-
-
-// ***************************************************************************
-// Valuetype visitor for generating Any operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_valuetype_any_op_cs::be_visitor_valuetype_any_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_any_op_cs::~be_visitor_valuetype_any_op_cs (void)
-{
-}
-
-int
-be_visitor_valuetype_any_op_cs::visit_valuetype (be_valuetype *node)
-{
- if (node->cli_stub_any_op_gen ()
- || node->imported ()
- || node->is_local ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate the Any <<= and >>= operator declarations
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // All template specializations must be generated before the instantiations
- // in the operators.
- *os << be_nl << be_nl
- << "namespace TAO" << be_nl
- << "{" << be_idt_nl
- << "template<>" << be_nl
- << "::CORBA::Boolean" << be_nl
- << "Any_Impl_T<" << node->name () << ">::to_value ("
- << be_idt << be_idt_nl
- << "::CORBA::ValueBase *&_tao_elem" << be_uidt_nl
- << ") const" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::add_ref (this->value_);" << be_nl
- << "_tao_elem = this->value_;" << be_nl
- << "return true;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << be_global->core_versioning_end () << be_nl;
-
- be_module *module = 0;
-
- if (node->is_nested () &&
- node->defined_in ()->scope_node_type () == AST_Decl::NT_module)
- {
- module = be_module::narrow_from_scope (node->defined_in ());
-
- if (!module)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_valuebox_any_op_cs::"
- "visit_valuebox - "
- "Error parsing nested name\n"),
- -1);
- }
-
- // Some compiler handle "any" operators in a namespace corresponding
- // to their module, others do not.
- *os << "\n\n#if defined (ACE_ANY_OPS_USE_NAMESPACE)\n";
-
- be_util::gen_nested_namespace_begin (os, module);
-
- // emit nested variation of any operators
- *os << "// Copying insertion." << be_nl
- << "void" << be_nl
- << "operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->local_name () << " *_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::add_ref (_tao_elem);" << be_nl
- << "_tao_any <<= &_tao_elem;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "// Non-copying insertion." << be_nl
- << "void" << be_nl
- << "operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->local_name () << " **_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "TAO::Any_Impl_T<" << node->local_name () << ">::insert ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->local_name () << "::_tao_any_destructor," << be_nl
- << node->tc_name ()->last_component () << "," << be_nl
- << "*_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean" << be_nl
- << "operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << node->local_name () << " *&_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return" << be_idt_nl
- << "TAO::Any_Impl_T<" << node->local_name () << ">::extract ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->local_name () << "::_tao_any_destructor," << be_nl
- << node->tc_name ()->last_component () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- be_util::gen_nested_namespace_end (os, module);
-
- // emit #else
- *os << "#else\n";
- }
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << "// Copying insertion." << be_nl
- << "void" << be_nl
- << "operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->full_name () << " *_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::add_ref (_tao_elem);" << be_nl
- << "_tao_any <<= &_tao_elem;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "// Non-copying insertion." << be_nl
- << "void" << be_nl
- << "operator<<= (" << be_idt << be_idt_nl
- << "::CORBA::Any &_tao_any," << be_nl
- << node->full_name () << " **_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "TAO::Any_Impl_T<" << node->name () << ">::insert ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "*_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean" << be_nl
- << "operator>>= (" << be_idt << be_idt_nl
- << "const ::CORBA::Any &_tao_any," << be_nl
- << node->full_name () << " *&_tao_elem" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "return" << be_idt_nl
- << "TAO::Any_Impl_T<" << node->name () << ">::extract ("
- << be_idt << be_idt_nl
- << "_tao_any," << be_nl
- << node->name () << "::_tao_any_destructor," << be_nl
- << node->tc_name () << "," << be_nl
- << "_tao_elem" << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << be_global->core_versioning_end () << be_nl;
-
- if (module != 0)
- {
- *os << "\n\n#endif";
- }
-
- node->cli_stub_any_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_valuetype_any_op_cs::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp
deleted file mode 100644
index 87186a23ea3..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp
+++ /dev/null
@@ -1,303 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// arglist.cpp
-//
-// = DESCRIPTION
-// Visitor generating the parameter list of operations
-// in the Valuetype class.
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-// based on code from Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- arglist,
- "$Id$")
-
-// ************************************************************
-// Operation visitor to generate the argument list.
-// We have separated code generation for this from the 4 main
-// visitors to avoid code duplication and tight coupling.
-// ************************************************************
-
-be_visitor_obv_operation_arglist::be_visitor_obv_operation_arglist (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_obv_operation_arglist::~be_visitor_obv_operation_arglist (void)
-{
-}
-
-bool
-be_visitor_obv_operation_arglist::is_amh_exception_holder (be_operation *node)
-{
- UTL_Scope *scope = node->defined_in ();
- be_interface *iface = be_interface::narrow_from_scope (scope);
-
- if (iface != 0)
- {
- if (ACE_OS::strncmp (iface->local_name (), "AMH_", 4) == 0)
- {
- const char *last_E = ACE_OS::strrchr (iface->full_name (), 'E');
-
- if (last_E != 0
- && ACE_OS::strcmp (last_E, "ExceptionHolder") == 0)
- {
- return true;
- }
- }
- }
-
- return false;
-}
-
-int
-be_visitor_obv_operation_arglist::visit_operation (be_operation *node)
-{
- bool amh_valuetype = this->is_amh_exception_holder (node);
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << " (";
-
- if (!be_global->exception_support () || node->nmembers () > 0)
- {
- *os << be_idt << be_idt_nl;
-
- // All we do is hand over code generation to our scope.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_operation_arglist::"
- "visit_operation - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // Generate the ACE_ENV_ARG_DECL parameter for the alternative mapping.
- if (!be_global->exception_support ())
- {
- /***********************************************************/
- // If it ian an AMHExceptionHolder we are going to generate the
- // function definition "in-place" right here. Also all
- // AMHExceptionHolder 'raise' methods do not take any
- // parameters. So always declare
- // ACE_ENV_SINGLE_ARG_DECL_NOT_USED when generating argument
- // list for AMHExceptioHolders
- /***********************************************************/
- if (amh_valuetype)
- {
- *os << (be_global->use_raw_throw ()
- ? ""
- : "ACE_ENV_SINGLE_ARG_DECL");
- }
- /***********************************************************/
- else
- {
- // Use ACE_ENV_SINGLE_ARG_DECL or ACE_ENV_ARG_DECL
- // depending on whether the operation node has parameters.
-
- if (node->argument_count () == 0)
- {
- *os << (be_global->use_raw_throw ()
- ? ""
- : " ACE_ENV_SINGLE_ARG_DECL");
- }
- else
- {
- *os << (be_global->use_raw_throw ()
- ? ""
- : " ACE_ENV_ARG_DECL");
- }
- }
-
- if (!amh_valuetype)
- {
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_CH:
- // Last argument - is always ACE_ENV_ARG_DECL.
- *os << (be_global->use_raw_throw ()
- ? ""
- : "_WITH_DEFAULTS");
- break;
- default:
- break;
- }
- }
- }
-
- *os << be_uidt_nl
- << ")";
- }
- else
- {
- *os << "void)";
- }
-
- be_visitor_context ctx = *this->ctx_;
- be_visitor_operation operation_visitor (&ctx);
-
- if (operation_visitor.gen_throw_spec (node) == -1)
- {
- return -1;
- }
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_CH:
- // Each method is pure virtual in the Valuetype class.
- // BUT, not if it is an AMH ExceptionHolder!
- if (amh_valuetype)
- {
- *os << ";" << be_uidt;
- }
- else
- {
- *os << " = 0;" << be_uidt;
- }
- break;
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_CS:
- *os << be_uidt;
- break;
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IH:
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IS:
- default:
- break;
- }
-
- return 0;
-}
-
-int
-be_visitor_obv_operation_arglist::visit_argument (be_argument *node)
-{
- be_visitor_context ctx (*this->ctx_);
-
- // First grab the interface definition inside which this operation is
- // defined. We need this since argument types may very well be declared
- // inside the scope of the interface node. In such cases, we would like to
- // generate the appropriate relative scoped names.
- be_operation *op = this->ctx_->be_scope_as_operation ();
-
- if (!op)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arglist::"
- "visit_argument - "
- "Bad operation\n"),
- -1);
- }
-
- // We need the interface node in which this operation was defined. However,
- // if this operation node was an attribute node in disguise, we get this
- // information from the context.
- // %! use AST_Interface
- be_interface *intf = this->ctx_->attribute ()
- ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ())
- : be_interface::narrow_from_scope (op->defined_in ());
-
- if (!intf)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arglist::"
- "visit_argument - "
- "Bad interface\n"),
- -1);
- }
-
- ctx.scope (intf);
- ctx.node (node); // save the argument node
-
- // Retrieve the type.
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_arglist::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_CH:
- {
- be_visitor_args_arglist visitor (&ctx);
- status = bt->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_SH:
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IH:
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IS:
- {
- be_visitor_args_arglist visitor (&ctx);
- status = bt->accept (&visitor);
- break;
- }
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arglist::"
- "visit_argument - "
- "Bad context\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arglist::"
- "visit_argument - "
- "codegen for argument failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_obv_operation_arglist::post_process (be_decl *bd)
-// derived from be_visitor_operation_argument::post_process (be_decl *bd)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_CH:
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_SH:
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IH:
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IS:
- if (!this->last_node (bd))
- {
- *os << ", ";
- }
- else
- {
- *os << "";
- }
-
- break;
- default:
- break;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ch.cpp
deleted file mode 100644
index 2cfe3923843..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ch.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ch.cpp
-//
-// = DESCRIPTION
-// Concrete visitor for valuetypes.
-// This one provides code generation for the CDR operators.
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-// based on code from Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- cdr_op_ch,
- "$Id$")
-
-be_visitor_valuetype_cdr_op_ch::be_visitor_valuetype_cdr_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_cdr_op_ch::~be_visitor_valuetype_cdr_op_ch (void)
-{
-}
-
-int
-be_visitor_valuetype_cdr_op_ch::visit_valuetype (be_valuetype *node)
-{
- if (node->imported ()
- || node->cli_hdr_cdr_op_gen ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate helper functions declaration.
- if (node->gen_helper_header () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_cdr_op_ch::"
- "visit_valuetype - "
- "codegen for helper functions failed\n"),
- -1);
- }
-
- *os << be_nl << be_nl
- << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << be_global->stub_export_macro () << " "
- << "::CORBA::Boolean operator<< (TAO_OutputCDR &, const "
- << node->full_name () << " *);" << be_nl;
-
- *os << be_global->stub_export_macro () << " "
- << "::CORBA::Boolean operator>> (TAO_InputCDR &, "
- << node->full_name () << " *&);";
-
- *os << be_global->core_versioning_end () << be_nl;
-
- // Set the substate as generating code for the types defined in our scope.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_SCOPE);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_cdr_op_ch::"
- "visit_valuetype - "
- "codegen for scope failed\n"),
- -1);
- }
-
- if (!node->is_abstract ())
- {
- // Functions that marshal state.
- be_visitor_context new_ctx (*this->ctx_);
- be_visitor_valuetype_marshal_ch visitor (&new_ctx);
- visitor.visit_valuetype (node);
- }
-
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_valuetype_cdr_op_ch::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp
deleted file mode 100644
index 1b7ac0be4b3..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Concrete visitor for valuetypes.
-// This one provides code generation for the CDR operators.
-//
-// = AUTHOR
-// Boris Kolpackov <bosk@ipmce.ru>
-// based on code from Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-// based on code from Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- valuetype_cdr_op_cs,
- "$Id$")
-
-be_visitor_valuetype_cdr_op_cs::be_visitor_valuetype_cdr_op_cs (
- be_visitor_context *ctx
- )
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_cdr_op_cs::~be_visitor_valuetype_cdr_op_cs (void)
-{
-}
-
-int
-be_visitor_valuetype_cdr_op_cs::visit_valuetype (be_valuetype *node)
-{
- // Already generated and/or we are imported. Don't do anything.
- if (node->cli_stub_cdr_op_gen ()
- || node->imported ()
- || ! node->is_defined ())
- {
- return 0;
- }
-
- // Generate helper functions implementation.
- if (node->gen_helper_stubs () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_cdr_op_cs::"
- "visit_valuetype - "
- "codegen for helper functions failed\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- node->cli_stub_cdr_op_gen (true);
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_cdr_op_ci"
- "::visit_valuetype - "
- "codegen for scope failed\n"),
- -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- // Set the sub state as generating code for the output operator.
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT);
-
- *os << "::CORBA::Boolean" << be_nl
- << "operator<< (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &strm, " << be_nl
- << "const " << node->full_name ()
- << " *_tao_valuetype" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
- *os << "return" << be_idt_nl
- << "::CORBA::ValueBase::_tao_marshal (" << be_idt << be_idt_nl
- << "strm," << be_nl
- << "_tao_valuetype," << be_nl
- << "reinterpret_cast<ptrdiff_t> (&"
- << node->full_name () << "::_downcast)"
- << be_uidt_nl
- << ");" << be_uidt << be_uidt << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean" << be_nl
- << "operator>> (" << be_idt << be_idt_nl
- << "TAO_InputCDR &strm," << be_nl
- << node->full_name ()
- << " *&_tao_valuetype" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
- *os << "return " << node->full_name ()
- << "::_tao_unmarshal (strm, _tao_valuetype);"
- << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << be_global->core_versioning_end () << be_nl;
-
- if (!node->is_abstract ())
- {
- // Functions that marshal state.
- be_visitor_context new_ctx (*this->ctx_);
- be_visitor_valuetype_marshal_cs visitor (&new_ctx);
- visitor.visit_valuetype (node);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_cdr_op_cs::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-// @@@ (JP) The following three methods are a hack to get CDR
-// operators generated for anonymous array and sequence
-// valuetype members. This should be done like it is in structs,
-// but part of that mechanism is used by valuetypes for
-// generating code to marshal the state. Someday this should
-// be untangled and made consistent.
-
-int
-be_visitor_valuetype_cdr_op_cs::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (bt == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ci::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- // Save the node.
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_cdr_op_ci::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_cdr_op_cs::visit_sequence (be_sequence *node)
-{
- be_visitor_context ctx (*this->ctx_);
- be_visitor_sequence_cdr_op_cs visitor (&ctx);
- return node->accept (&visitor);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ch.cpp
deleted file mode 100644
index a72fc8de0b5..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ch.cpp
+++ /dev/null
@@ -1,216 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// field_cdr_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Field in the client header file.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- field_cdr_op_ch,
- "$Id$")
-
-// **********************************************
-// Visitor for field in the client header file.
-// **********************************************
-
-be_visitor_valuetype_field_cdr_ch::be_visitor_valuetype_field_cdr_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx),
- pre_ (""),
- post_ ("")
-{
-}
-
-be_visitor_valuetype_field_cdr_ch::~be_visitor_valuetype_field_cdr_ch (void)
-{
-}
-
-int
-be_visitor_valuetype_field_cdr_ch::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ch::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ch::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// Visit operations on all possible data types that a field can be
-
-int
-be_visitor_valuetype_field_cdr_ch::visit_array (be_array *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- // This is the case for anonymous arrays.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_array_cdr_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ch::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_ch::visit_enum (be_enum *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_enum_cdr_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ch::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_ch::visit_sequence (be_sequence *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_sequence_cdr_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ch::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_ch::visit_structure (be_structure *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_structure_cdr_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ch::"
- "visit_struct - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_ch::visit_typedef (be_typedef *node)
-{
- // Save the node for use in code generation and
- // indicate that the field of the field node
- // is a typedefed quantity.
- this->ctx_->alias (node);
-
- // Make a decision based on the primitive base type.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ch::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_ch::visit_union (be_union *node)
-{
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_union_cdr_op_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ch::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp
deleted file mode 100644
index c89015e7bcd..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp
+++ /dev/null
@@ -1,974 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// field_cdr_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Field in the client stubs file.
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-// derived from be_visitor_field/cdr_op_cs.cpp
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- field_cdr_op_cs,
- "$Id$")
-
-// **********************************************
-// Visitor for field in the client inline file.
-// **********************************************
-
-be_visitor_valuetype_field_cdr_cs::be_visitor_valuetype_field_cdr_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx),
- pre_ (""),
- post_ ("")
-{
-}
-
-be_visitor_valuetype_field_cdr_cs::~be_visitor_valuetype_field_cdr_cs (void)
-{
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_array - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // For anonymous arrays, the type name has a _ prepended. We compute
- // the full_name with or without the underscore and use it later on.
- char fname [NAMEBUFSIZE];
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- // For anonymous arrays ...
- // We have to generate a name for us that has an underscore
- // prepended to our local name. This needs to be inserted after
- // the parents's name.
-
- if (node->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- node->full_name ());
- }
- }
- else
- {
- // Typedefed node.
- ACE_OS::sprintf (fname,
- "%s",
- node->full_name ());
- }
-
- // Check what is the code generation substate. Are we generating
- // code for the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> "
- << "_tao_" << this->pre_ << f->local_name ()
- << this->post_ << ")";
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << "
- << "_tao_" << this->pre_ << f->local_name ()
- << this->post_ << ")";
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_array - "
- "bad sub state\n"),
- -1);
- }
-
- // If not a typedef and we are defined in the use scope, we must be defined.
- if (!this->ctx_->alias () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // This is the case for anonymous arrays.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_array_cdr_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_array - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generation substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> " << this->pre_ << f->local_name ()
- << this->post_ << ")";
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << this->pre_ << f->local_name ()
- << this->post_ << ")";
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_enum - "
- "bad sub state\n"),
- -1);
- }
-
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_enum_cdr_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_interface - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> " << this->pre_ << f->local_name ()
- << this->post_ << ".out ())";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "TAO::Objref_Traits< ::" << node->name ()
- << ">::marshal (" << be_idt << be_idt_nl
- << this->pre_ << f->local_name ()
- << this->post_ << ".in (), " << be_nl
- << "strm" << be_uidt_nl
- << ")" << be_uidt;
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because an interface cannit be declared inside a
- // structure.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_interface - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_interface_fwd - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> " << this->pre_ << f->local_name ()
- << this->post_ << ").out ()";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "TAO::Objref_Traits< ::" << node->name ()
- << ">::marshal (" << be_idt << be_idt_nl
- << this->pre_ << f->local_name ()
- << this->post_ << ".in (), " << be_nl
- << "strm" << be_uidt_nl
- << ")" << be_uidt;
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because an interface cannot be declared inside a
- // structure.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_interface_fwd - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_valuebox (be_valuebox * node)
-{
- return this->valuetype_common (node);
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::valuetype_common (be_type *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_valuetype - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> " << this->pre_ << f->local_name ()
- << this->post_ << ".out ())";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << this->pre_ << f->local_name ()
- << this->post_ << ".in ())";
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because a valuetype cannit be declared inside a
- // structure.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_valuetype - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_valuetype (be_valuetype * node)
-{
- return this->valuetype_common (node);
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_valuetype_fwd - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> " << this->pre_ << f->local_name ()
- << this->post_ << ").out ()";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << this->pre_ << f->local_name ()
- << this->post_ << ").in ()";
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because a valuetype cannot be declared inside a
- // structure.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_valuetype_fwd - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_component (be_component *node)
-{
- return this->visit_interface (node);
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_component_fwd (be_component_fwd *node)
-{
- return this->visit_interface_fwd (node);
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_predefined_type - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- AST_PredefinedType::PredefinedType pt = node->pt ();
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << "(strm >> " << this->pre_ << f->local_name ()
- << this->post_ << ".out ())";
- }
- else if (pt == AST_PredefinedType::PT_char)
- {
- *os << "(strm >> ::ACE_InputCDR::to_char ("
- << this->pre_ << f->local_name () << this->post_ << "))";
- }
- else if (pt == AST_PredefinedType::PT_wchar)
- {
- *os << "(strm >> ::ACE_InputCDR::to_wchar ("
- << this->pre_ << f->local_name () << this->post_ << "))";
- }
- else if (pt == AST_PredefinedType::PT_octet)
- {
- *os << "(strm >> ::ACE_InputCDR::to_octet ("
- << this->pre_ << f->local_name () << this->post_ << "))";
- }
- else if (pt == AST_PredefinedType::PT_boolean)
- {
- *os << "(strm >> ::ACE_InputCDR::to_boolean ("
- << this->pre_ << f->local_name () << this->post_ << "))";
- }
- else
- {
- *os << "(strm >> " << this->pre_ << f->local_name ()
- << this->post_ << ")";
- }
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- if (pt == AST_PredefinedType::PT_pseudo
- || pt == AST_PredefinedType::PT_object)
- {
- *os << "(strm << " << this->pre_ << f->local_name ()
- << this->post_ << ".in ())";
- }
- else if (pt == AST_PredefinedType::PT_char)
- {
- *os << "(strm << ::ACE_OutputCDR::from_char ("
- << this->pre_ << f->local_name () << this->post_ << "))";
- }
- else if (pt == AST_PredefinedType::PT_wchar)
- {
- *os << "(strm << ::ACE_OutputCDR::from_wchar ("
- << this->pre_ << f->local_name () << this->post_ << "))";
- }
- else if (pt == AST_PredefinedType::PT_octet)
- {
- *os << "(strm << ::ACE_OutputCDR::from_octet ("
- << this->pre_ << f->local_name () << this->post_ << "))";
- }
- else if (pt == AST_PredefinedType::PT_boolean)
- {
- *os << "(strm << ::ACE_OutputCDR::from_boolean ("
- << this->pre_ << f->local_name () << this->post_ << "))";
- }
- else
- {
- *os << "(strm << " << this->pre_ << f->local_name ()
- << this->post_ << ")";
- }
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_array - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_sequence - "
- "cannot retrieve field node\n" ),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> " << this->pre_ << f->local_name ()
- << this->post_ << ")";
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << this->pre_ << f->local_name ()
- << this->post_ << ")";
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_sequence - "
- "bad sub state\n"),
- -1);
- }
-
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- // Not a typedef AND
- // node is defined inside the valuetype.
- {
- // Anonymous sequence.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_sequence_cdr_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_string - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> " << this->pre_ << f->local_name ()
- << this->post_ << ".out ())";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << this->pre_ << f->local_name ()
- << this->post_ << ".in ())";
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_array - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_structure - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> " << this->pre_ << f->local_name ()
- << this->post_ << ")";
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << this->pre_ << f->local_name ()
- << this->post_ << ")";
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_structure - "
- "bad sub state\n"),
- -1);
- }
-
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_structure_cdr_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_struct - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- // The node to be visited in the base primitve type that gets typedefed.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_cs::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_union - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> " << this->pre_ << f->local_name ()
- << this->post_ << ")";
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << this->pre_ << f->local_name ()
- << this->post_ << ")";
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Proceed further.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_union - "
- "bad sub state\n"),
- -1);
- }
-
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_union_cdr_op_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_cs::"
- "visit_union - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-
-// ****************************************************************
-
-be_visitor_valuetype_field_cdr_decl::be_visitor_valuetype_field_cdr_decl (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-// This is a field, but the action depends on the type of the field,
-// use this visitor to detect the type of the field.
-// Notice that this is why the parent visitor (who create us) cannot
-// do the job, because it may have another purpose for some or all of
-// the visit_* methods; in other words, while running a visitor to
-// generate CDR operators for structures we cannot use that one to
-// generate the code of each field, because visit_struct already has a
-// meaning in that visitor.
-int
-be_visitor_valuetype_field_cdr_decl::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_decl::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- // @@ Shouldn't this be saved in the visitor and not the context?!
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_decl::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_decl::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Retrieve the field node.
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_decl::"
- "visit_array - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Retrieve the valuetype scope in which the code is generated.
- be_decl *sc = this->ctx_->scope ();
- be_valuetype *vt = be_valuetype::narrow_from_decl (sc);
-
- if (!vt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_decl::"
- "visit_array - "
- "cannot retrieve valuetype node\n"),
- -1);
- }
-
- // For anonymous arrays, the type name has a _ prepended. We compute
- // the full_name with or without the underscore and use it later on.
- char fname [NAMEBUFSIZE];
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (!this->ctx_->alias ()
- && node->is_child (this->ctx_->scope ()))
- {
- // For anonymous arrays ...
- // We have to generate a name for us that has an underscope
- // prepended to our local name. This needs to be inserted after
- // the parent's name.
-
- if (node->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- node->full_name ());
- }
- }
- else
- {
- // Typedefed node.
- ACE_OS::sprintf (fname,
- "%s",
- node->full_name ());
- }
-
- // Check what is the code generation substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << fname << "_forany "
- << "_tao_" << vt->field_pd_prefix () << f->local_name ()
- << vt->field_pd_postfix () << be_idt << be_idt_nl
- << "(const_cast<" << be_idt << be_idt_nl
- << fname << "_slice*> (" << be_nl
- << vt->field_pd_prefix () << f->local_name ()
- << vt->field_pd_postfix () << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl;
- return 0;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_decl::"
- "visit_array - "),
- -1);
- }
-}
-
-int
-be_visitor_valuetype_field_cdr_decl::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_cdr_op_field_decl::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp
deleted file mode 100644
index 5a245ed5c27..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp
+++ /dev/null
@@ -1,821 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// field_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating the accessor and modifier declarations
-// for valuetype fields in the valuetype class (header).
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-// derived from be_visitor_union_branch/public_ch.cpp
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- field_ch,
- "$Id$")
-
-be_visitor_valuetype_field_ch::be_visitor_valuetype_field_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
- setenclosings ("", ";");
-}
-
-be_visitor_valuetype_field_ch::~be_visitor_valuetype_field_ch (void)
-{
-}
-
-int
-be_visitor_valuetype_field_ch::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_union_branch - "
- "Bad type\n"),
- -1);
- }
-
- this->ctx_->node (node); // save the node
-
- this->visibility_ = node->visibility ();
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_union_branch - "
- "codegen failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// Visit operations on all possible data types (valuetype state member).
-
-int
-be_visitor_valuetype_field_ch::visit_array (be_array *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_array - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- // This is the case of an anonymous array inside a valuetype.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- ctx.state (TAO_CodeGen::TAO_ARRAY_CH);
- be_visitor_array_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
-
- ctx.state (TAO_CodeGen::TAO_ROOT_CH);
-
- // Now use this array as a "type" for the subsequent declarator
- // the set method.
- *os << pre_op () << "void " << ub->local_name () << " ("
- << "_" << bt->local_name () << ")"
- << post_op () << be_nl;
- // The get method.
- *os << pre_op () << "const _" << bt->local_name ()
- << "_slice * " << ub->local_name ()
- << " (void) const" << post_op () << be_nl;
- *os << pre_op () << "_" << bt->local_name ()
- << "_slice * " << ub->local_name ()
- << " (void)" << post_op ();
- }
- else
- {
- // Now use this array as a "type" for the subsequent declarator.
- // The set method.
- *os << pre_op () << "void " << ub->local_name () << " (const "
- << bt->name () << ")" << post_op () << be_nl;
- // The get method.
- *os << pre_op ()
- << bt->name () << "_slice *" << ub->local_name ()
- << " (void)" << post_op () << be_nl;
- // The get (read/write) method.
- *os << pre_op () << "const "
- << bt->name () << "_slice *" << ub->local_name ()
- << " (void) const" << post_op ();
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_ch::visit_enum (be_enum *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_enum - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_enum_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_enum - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // Now use this enum as a "type" for the subsequent declarator
- // the set method.
- *os << pre_op () << "void " << ub->local_name () << " ("
- << bt->name () << ")" << post_op () << be_nl;
- // The get method.
- *os << pre_op () << bt->name () << " " << ub->local_name ()
- << " (void) const" << post_op ();
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_ch::visit_interface (be_interface *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_interface - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Set method.
- *os << pre_op() << "void " << ub->local_name () << " ("
- << bt->name () << "_ptr"
- << ")" << post_op() << be_nl;
- // Get method.
- *os << pre_op()
- << bt->name () << "_ptr " << ub->local_name ()
- << " (void) const" << post_op();
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_ch::visit_interface_fwd (be_interface_fwd *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_interface_fwd - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Set method.
- *os << pre_op () << "void " << ub->local_name () << " ("
- << bt->name () << "_ptr"
- << ")" << post_op () << be_nl;
- // Get method.
- *os << pre_op ()
- << bt->name () << "_ptr " << ub->local_name ()
- << " (void) const" << post_op ();
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_ch::visit_valuebox (be_valuebox *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_valuebox - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Set method.
- *os << pre_op () << "void " << ub->local_name () << " ("
- << bt->name () << " *"
- << ")" << post_op () << be_nl;
- // Get method.
- *os << pre_op ()
- << bt->name () << " *" << ub->local_name ()
- << " (void) const" << post_op ();
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_ch::visit_valuetype (be_valuetype *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_valuetype - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Set method.
- *os << pre_op () << "void " << ub->local_name () << " ("
- << bt->name () << " *"
- << ")" << post_op () << be_nl;
- // Get method.
- *os << pre_op ()
- << bt->name () << " *" << ub->local_name ()
- << " (void) const" << post_op ();
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_ch::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_valuetype_field_ch::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_valuetype_fwd - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Set method.
- *os << pre_op () << "void " << ub->local_name () << " ("
- << bt->name () << " *"
- << ")" << post_op () << be_nl;
- // Get method.
- *os << pre_op ()
- << bt->name () << " *" << ub->local_name ()
- << " (void) const" << post_op ();
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_ch::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
-
-int
-be_visitor_valuetype_field_ch::visit_predefined_type (be_predefined_type *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_predefined_type - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- // Set method.
- *os << pre_op () << "void " << ub->local_name () << " ( ::"
- << bt->name () << "_ptr)"
- << post_op () << be_nl;
- // Get method.
- *os << pre_op ()
- << "::" << bt->name () << "_ptr " << ub->local_name ()
- << " (void) const" << post_op ();
- break;
- case AST_PredefinedType::PT_any:
- // Set method.
- *os << pre_op () << "void " << ub->local_name ()
- << " (const ::" << bt->name () << " &)"
- << post_op () << be_nl;
- // Get method (read-only).
- *os << pre_op () << "const ::" << bt->name () << " &"
- << ub->local_name () << " (void) const"
- << post_op () << be_nl;
- // Get method (read/write).
- *os << pre_op () << "::" << bt->name () << " &"
- << ub->local_name () << " (void)"
- << post_op ();
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- // Set method.
- *os << pre_op () << "void " << ub->local_name ()
- << " (const ::" << bt->name () << ")"
- << post_op () << be_nl;
- // Get method.
- *os << pre_op () << "::" << bt->name ()
- << " " << ub->local_name ()
- << " (void) const" << post_op ();
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_ch::visit_sequence (be_sequence *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_sequence - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Not a typedef and bt is defined here.
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- be_field *member_node =
- be_field::narrow_from_decl (this->ctx_->node ());
- node->field_node (member_node);
-
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_sequence_ch visitor (&ctx);
-
- if (this->visibility_ == AST_Field::vis_PRIVATE)
- {
- *os << be_uidt_nl << "public:" << be_idt_nl;
- }
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
-
- if (this->visibility_ == AST_Field::vis_PRIVATE)
- {
- *os << be_uidt_nl << be_nl << "protected:" << be_idt;
- }
-
- // Generate the anonymous sequence member typedef.
- // This provides a consistent name to use instead of the
- // implementation-specific name.
- *os << be_nl << be_nl << "typedef " << bt->nested_type_name (bu)
- << " _" << ub->local_name () << "_seq;" << be_nl;
- }
-
- // Set method.
- *os << pre_op () << "void " << ub->local_name () << " (const "
- << bt->name () << " &)"
- << post_op () << be_nl;
- // Read-only.
- *os << pre_op () << "const " << bt->name () << " &"
- << ub->local_name () << " (void) const"
- << post_op () << be_nl;
- // Read/write.
- *os << pre_op () << bt->name () << " &" << ub->local_name ()
- << " (void)"
- << post_op ();
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_ch::visit_string (be_string *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_string - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl<< "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Three methods to set the string value.
- if (node->width () == (long) sizeof (char))
- {
- *os << pre_op ()
- << "void " << ub->local_name () << " (char *val)"
- << post_op () << be_nl;
- *os << pre_op ()
- << "void " << ub->local_name () << " (const char *val)"
- << post_op () << be_nl;
- *os << pre_op ()
- << "void " << ub->local_name () << " (const ::CORBA::String_var &val)"
- << post_op () << be_nl;
- // Get method.
- *os << pre_op () << "const char *" << ub->local_name ()
- << " (void) const" << post_op ();
- }
- else
- {
- *os << pre_op ()
- << "void " << ub->local_name () << " ( ::CORBA::WChar *val)"
- << post_op () << be_nl;
- *os << pre_op ()
- << "void " << ub->local_name () << " (const ::CORBA::WChar *val)"
- << post_op () << be_nl;
- *os << pre_op ()
- << "void " << ub->local_name () << " (const ::CORBA::WString_var &val)"
- << post_op () << be_nl;
- // Get method.
- *os << pre_op() << "const ::CORBA::WChar *" << ub->local_name ()
- << " (void) const" << post_op();
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_ch::visit_structure (be_structure *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_structure - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl<< "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Not a typedef and bt is defined here.
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_structure_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_structure - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // Set method.
- *os << pre_op () << "void " << ub->local_name () << " (const "
- << bt->name () << " &)"
- << post_op () << be_nl;
- // Read-only.
- *os << pre_op () << "const " << bt->name () << " &";
- *os << ub->local_name () << " (void) const"
- << post_op () << be_nl
- // Read/write.
- << pre_op () << bt->name () << " &" << ub->local_name ()
- << " (void)" << post_op ();
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_ch::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- // Make a decision based on the primitive base type.
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_spec_ch::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_valuetype_field_ch::visit_union (be_union *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_decl *bu = this->ctx_->scope ();
- be_type *bt;
-
- // Check if we are visiting this via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_union - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl<< "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Not a typedef and bt is defined here.
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_union_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_union - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // Set method.
- *os << pre_op () << "void " << ub->local_name () << " (const "
- << bt->name () << " &)"
- << post_op () << be_nl;
- // Read-only.
- *os << pre_op () << "const " << bt->name () << " &"
- << ub->local_name () << " (void) const"
- << post_op () << be_nl;
- // Read/write.
- *os << pre_op () << bt->name () << " &" << ub->local_name ()
- << " (void)" << post_op ();
-
- return 0;
-}
-
-void
-be_visitor_valuetype_field_ch::setenclosings (const char *pre,
- const char *post)
-{
- pre_op_ = pre;
- post_op_ = post;
-}
-
-const char*
-be_visitor_valuetype_field_ch::pre_op (void)
-{
- return pre_op_;
-}
-
-const char*
-be_visitor_valuetype_field_ch::post_op (void)
-{
- return post_op_;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_ci.cpp
deleted file mode 100644
index 9574e2bca3d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ci.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// field_ci.cpp
-//
-// = DESCRIPTION
-// Visitor for the Valuetype class.
-// This one generates code for accessor and modifier functions of
-// valuetype state members (in the inline file).
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- field_ci,
- "$Id$")
-
-be_visitor_valuetype_field_ci::be_visitor_valuetype_field_ci (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx),
- in_obv_space_ (0)
-{
- setenclosings ("");
-}
-
-be_visitor_valuetype_field_ci::~be_visitor_valuetype_field_ci (void)
-{
-}
-
-int
-be_visitor_valuetype_field_ci::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// Visit operations on all possible data types that a field can be.
-
-int
-be_visitor_valuetype_field_ci::visit_array (be_array *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_valuetype *bu = be_valuetype::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ci::"
- "visit_array - "
- "bad context information\n"),
- -1);
- }
-
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_array_ci visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ci::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_ci::visit_structure (be_structure *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_valuetype *bu = be_valuetype::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ci::"
- "visit_structure - "
- "bad context information\n"),
- -1);
- }
-
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_structure_ci visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ci::"
- "visit_structure - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_ci::visit_union (be_union *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_valuetype *bu = be_valuetype::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ci::"
- "visit_union - "
- "bad context information\n"),
- -1);
- }
-
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_union_ci visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ci::"
- "visit_union - "
- "codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-void
-be_visitor_valuetype_field_ci::setenclosings (const char *pre)
-{
- this->pre_op_ = pre;
-}
-
-const char*
-be_visitor_valuetype_field_ci::pre_op ()
-{
- return this->pre_op_;
-}
-
-// Retrieve the fully scoped skeleton name.
-void
-be_visitor_valuetype_field_ci::op_name (be_valuetype *node,
- TAO_OutStream *os)
-{
- if (this->in_obv_space_)
- {
- *os << node->full_obv_skel_name ();
- }
- else
- {
- *os << node->name ();
- }
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp
deleted file mode 100644
index f5ae7a8e2de..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp
+++ /dev/null
@@ -1,1192 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// field_cs.cpp
-//
-// = DESCRIPTION
-// Visitor for the Valuetype class.
-// This one generates code for accessor and modifier functions of
-// valuetype state members (in the stub file).
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-// derived from be_visitor_union_branch/public_ci.cpp
-//
-// ============================================================================
-ACE_RCSID (be_visitor_valuetype,
- field_cs,
- "$Id$")
-
-be_visitor_valuetype_field_cs::be_visitor_valuetype_field_cs (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx),
- in_obv_space_ (0)
-{
- setenclosings ("");
-}
-
-be_visitor_valuetype_field_cs::~be_visitor_valuetype_field_cs (void)
-{
-}
-
-int
-be_visitor_valuetype_field_cs::visit_field (be_field *node)
-{
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- this->ctx_->node (node);
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// Visit operations on all possible data types that a field can be
-
-int
-be_visitor_valuetype_field_cs::visit_array (be_array *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_valuetype *bu = be_valuetype::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_array - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_array_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_array - "
- "codegen failed\n"),
- -1);
- }
- }
-
- // For anonymous arrays, the type name has a _ prepended. We compute the
- // full_name with or without the underscore and use it later on.
- char fname [NAMEBUFSIZE];
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
-
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- // For anonymous arrays ...
- // We have to generate a name for us that has an underscope prepended to
- // our local name. This needs to be inserted after the parent's name.
- if (bt->is_nested ())
- {
- be_decl *parent =
- be_scope::narrow_from_scope (bt->defined_in ())->decl ();
- ACE_OS::sprintf (fname,
- "%s::_%s",
- parent->full_name (),
- bt->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname,
- "_%s",
- bt->full_name ());
- }
- }
- else
- {
- // Typedefed node.
- ACE_OS::sprintf (fname,
- "%s",
- bt->full_name ());
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "// Accessor to set the member." << be_nl
- << this->pre_op () << "void" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " (const " << fname
- << " val)" << be_nl
- << "{" << be_idt_nl;
- *os << fname << "_copy ("
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << ", val);" << be_uidt_nl;
- *os << "}" << be_nl;
-
- *os << "/// Retrieve the member." << be_nl
- << this->pre_op () << "const " << fname << "_slice *" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " (void) const" << be_nl
- << "{" << be_idt_nl;
- *os << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix () << ";" << be_uidt_nl
- << "}\n" << be_nl;
-
- *os << "/// Retrieve the member." << be_nl
- << this->pre_op () << fname << "_slice *" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " (void)" << be_nl
- << "{" << be_idt_nl;
- *os << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix () << ";" << be_uidt_nl;
- *os << "}";
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_enum (be_enum *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_valuetype *bu = be_valuetype::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_enum - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "/// Accessor to set the member." << be_nl
- << this->pre_op() << "void" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " (" << bt->name ()
- << " val)" << be_nl
- << "{" << be_idt_nl;
-
- *os << "this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << " = val;" << be_uidt_nl;
-
- *os << "}" << be_nl;
-
- *os << "/// Retrieve the member." << be_nl
- << this->pre_op () << bt->name () << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " () const"
- << be_nl
- << "{" << be_idt_nl;
-
- *os << "return this->"
- << bu->field_pd_prefix() << ub->local_name ()
- << bu->field_pd_postfix ()
- << ";" << be_uidt_nl;
-
- *os << "}";
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_interface (be_interface *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_valuetype *bu = be_valuetype::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_interface - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "/// Accessor to set the member." << be_nl
- << this->pre_op () << "void" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " (" << bt->name ()
- << "_ptr val)" << be_nl
- << "{" << be_idt_nl;
-
- *os << "this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix () << " =" << be_idt_nl
- << "TAO::Objref_Traits< ::" << bt->name ()
- << ">::duplicate (val);" << be_uidt << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- *os << "/// Retrieve the member." << be_nl
- << this->pre_op () << bt->name () << "_ptr " << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " () const"
- << be_nl
- << "{" << be_idt_nl;
-
- *os << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << ".in ();" << be_uidt_nl;
-
- *os << "}";
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_valuetype *bu = be_valuetype::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_interface - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "// Accessor to set the member." << be_nl
- << this->pre_op () << "void" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " (" << bt->name ()
- << "_ptr val)" << be_nl
- << "{" << be_idt_nl;
-
- *os << "this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << " = " << bt->name () << "::_duplicate (val);" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- *os << "/// Retrieve the member" << be_nl
- << this->pre_op () << bt->name () << "_ptr " << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " () const"
- << be_nl
- << "{" << be_idt_nl;
-
- *os << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << ".in ();" << be_uidt_nl;
-
- *os << "}";
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_valuebox (be_valuebox *node)
-{
- return this->valuetype_common (node);
-}
-
-int
-be_visitor_valuetype_field_cs::valuetype_common (be_type *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_valuetype *bu = be_valuetype::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_interface - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "/// Accessor to set the member." << be_nl
- << this->pre_op () << "void" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " (" << bt->name ()
- << "* val)" << be_nl
- << "{" << be_idt_nl;
-
- *os << "::CORBA::add_ref (val);" << be_nl
- << "this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << " = val;" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- *os << "/// Retrieve the member" << be_nl
- << this->pre_op () << bt->name () << " *" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " () const"
- << be_nl
- << "{" << be_idt_nl;
-
- *os << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << ".in ();" << be_uidt_nl;
-
- *os << "}";
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_valuetype (be_valuetype *node)
-{
- return this->valuetype_common (node);
-}
-
-int
-be_visitor_valuetype_field_cs::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_valuetype_field_cs::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_valuetype *bu = be_valuetype::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_interface - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "/// Accessor to set the member." << be_nl
- << this->pre_op () << "void" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " (" << bt->name ()
- << "* val)" << be_nl
- << "{" << be_idt_nl;
-
- *os << "::CORBA::add_ref (val);" << be_nl
- << "this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << " = val;" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- *os << "/// Retrieve the member." << be_nl
- << this->pre_op () << bt->name () << " *" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " () const"
- << be_nl
- << "{" << be_idt_nl;
-
- *os << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix
- ()
- << ".in ();" << be_uidt_nl;
-
- *os << "}";
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
-
-int
-be_visitor_valuetype_field_cs::visit_predefined_type (be_predefined_type *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_valuetype *bu = be_valuetype::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_predef... - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "// Accessor to set the member." << be_nl
- << this->pre_op () << "void" << be_nl;
-
- this->op_name (bu, os);
-
- AST_PredefinedType::PredefinedType pt = node->pt ();
- bool is_object = (pt == AST_PredefinedType::PT_object
- || pt == AST_PredefinedType::PT_pseudo);
-
- // IN parameter semantics call for 'const' qualifier except
- // for interface types, which here are Object and TypeCode.
- *os << "::" << ub->local_name ()
- << " (" << (is_object ? "" : "const ") << bt->name ();
-
- if (is_object)
- {
- *os << "_ptr";
- }
- else if (pt == AST_PredefinedType::PT_any)
- {
- *os << " &";
- }
-
- *os << " val)" << be_nl
- << "{" << be_idt_nl;
-
- switch (pt)
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- *os << "this->" << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix () << " = ::"
- << bt->name () << "::_duplicate (val);" << be_uidt_nl;
-
- break;
- case AST_PredefinedType::PT_any:
- *os << "this->" << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix () << " = val;" << be_uidt_nl;
-
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- *os << "// Set the value." << be_nl
- << "this->" << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << " = val;" << be_uidt_nl;
-
- break;
- }
-
- *os << "}" << be_nl << be_nl;
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_object:
- *os << "// Retrieve the member" << be_nl
- << this->pre_op () << "::" << bt->name () << "_ptr" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name ()
- << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << ".in ();" << be_uidt_nl
- << "}";
-
- break;
- case AST_PredefinedType::PT_any:
- *os << "// Retrieve the member." << be_nl
- << this->pre_op () << "const ::" << bt->name () << " &" << be_nl;
-
- this->op_name (bu, os);
-
- *os << "::" << ub->local_name ()
- << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << ";" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "// Retrieve the member" << be_nl
- << this->pre_op () << "::" << bt->name () << " &" << be_nl;
-
- this->op_name (bu, os);
-
- *os << "::" << ub->local_name ()
- << " (void)" << be_nl
- << "{" << be_idt_nl
- << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << ";" << be_uidt_nl
- << "}";
-
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- *os << "// Retrieve the member" << be_nl
- << this->pre_op () << "::" << bt->name () << be_nl;
-
- this->op_name (bu, os);
-
- *os << "::" << ub->local_name ()
- << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << ";" << be_uidt_nl
- << "}";
-
- break;
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_sequence (be_sequence *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_valuetype *bu = be_valuetype::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_sequence - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (bt->node_type () != AST_Decl::NT_typedef // not a typedef
- && bt->is_child (bu)) // bt is defined inside the union
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_sequence_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_sequence - "
- "codegen failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // (1) set from a const
- *os << "// Accessor to set the member." << be_nl
- << this->pre_op () << "void" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name ()
- << " (const " << bt->name () << " &val)" << be_nl
- << "{" << be_idt_nl;
-
- *os << "this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << " = val;" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- *os << "// Readonly get method." << be_nl
- << this->pre_op () << "const " << bt->name () << " &" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name ()
- << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << ";" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "// Read/write get method." << be_nl
- << this->pre_op () << bt->name () << " &" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " (void)" << be_nl
- << "{" << be_idt_nl
- << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix()
- << ";" << be_uidt_nl
- << "}";
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_string (be_string *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_valuetype *bu = be_valuetype::narrow_from_decl (this->ctx_->scope ());
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_string - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Three methods to set the string value.
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "// Accessor to set the member." << be_nl
- << this->pre_op () << "void" << be_nl;
-
- this->op_name (bu,
- os);
-
- if (node->width () == (long) sizeof (char))
- {
- *os << "::" << ub->local_name () << " (char *val)";
- }
- else
- {
- *os << "::" << ub->local_name () << " ( ::CORBA::WChar *val)";
- }
-
- *os << be_nl
- << "{" << be_idt_nl;
- *os << "this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << " = (val);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // (2) Set method from const char * or const wchar*.
- *os << "// Accessor to set the member." << be_nl
- << this->pre_op () << "void" << be_nl;
-
- this->op_name (bu,
- os);
- *os << "::" << ub->local_name ();
-
- if (node->width () == (long) sizeof (char))
- {
- *os << " (const char *val)" << be_nl;
- }
- else
- {
- *os << " (const ::CORBA::WChar *val)" << be_nl;
- }
-
- *os << "{" << be_idt_nl;
-
- *os << "// Set the value." << be_nl
- << "this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << " = ";
-
- if (node->width () == (long) sizeof (char))
- {
- *os << "::CORBA::string_dup (val);" << be_uidt_nl;
- }
- else
- {
- *os << "::CORBA::wstring_dup (val);" << be_uidt_nl;
- }
-
- *os << "}" << be_nl << be_nl;
-
- // (3) Set from const String_var&.
- *os << "// Accessor to set the member." << be_nl
- << this->pre_op () << "void" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name ();
-
- if (node->width () == (long) sizeof (char))
- {
- *os << " (const ::CORBA::String_var &val)" << be_nl;
- }
- else
- {
- *os << " (const ::CORBA::WString_var &val)" << be_nl;
- }
-
- *os << "{" << be_idt_nl;
-
- if (node->width () == (long) sizeof (char))
- {
- *os << "::CORBA::String_var " << ub->local_name ();
- }
- else
- {
- *os << "::CORBA::WString_var " << ub->local_name ();
- }
-
- *os << "_var = val;" << be_nl
- << "this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << " = "
- << ub->local_name () << "_var._retn ();" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- if (node->width () == (long) sizeof (char))
- {
- *os << this->pre_op () << "const char *" << be_nl;
- }
- else
- {
- *os << this->pre_op () << "const ::CORBA::WChar *" << be_nl;
- }
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name ()
- << " (void) const // get method" << be_nl
- << "{" << be_idt_nl
- << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << ";" << be_uidt_nl
- << "}";
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_structure (be_structure *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_valuetype *bu = be_valuetype::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_structure - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_structure_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_structure - "
- "codegen failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // (1) Set from a const.
- *os << "// Accessor to set the member." << be_nl
- << this->pre_op () << "void" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name ()
- << " (const " << bt->name () << " &val)" << be_nl
- << "{" << be_idt_nl;
-
- *os << "this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << " = val;" << be_uidt_nl;
-
- *os << "}" << be_nl;
-
- *os << "// Readonly get method." << be_nl
- << this->pre_op () << "const " << bt->name () << " &" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " (void) const" << be_nl
- << "{" << be_idt_nl;
- *os << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << ";" << be_uidt_nl;
- *os << "}" << be_nl;
-
- *os << "// Read/write get method." << be_nl
- << this->pre_op () << bt->name () << " &" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " (void)" << be_nl
- << "{" << be_idt_nl;
- *os << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << ";" << be_uidt_nl;
- *os << "}";
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
- be_type *bt = node->primitive_base_type ();
-
- if (!bt || (bt->accept (this) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_typedef - "
- "Bad primitive type\n"),
- -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_union (be_union *node)
-{
- be_decl *ub = this->ctx_->node ();
- be_valuetype *bu = be_valuetype::narrow_from_decl (this->ctx_->scope ());
- be_type *bt;
-
- // Check if we are visiting this node via a visit to a typedef node.
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_union - "
- "bad context information\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (bt->node_type () != AST_Decl::NT_typedef
- && bt->is_child (bu))
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_union_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_union - "
- "codegen failed\n"),
- -1);
- }
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "// Accessor to set the member" << be_nl
- << this->pre_op () << "void" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name ()
- << " (const " << bt->name () << " &val)" << be_nl
- << "{" << be_idt_nl;
- *os << "this->" << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix () << " = val;" << be_uidt_nl;
- *os << "}" << be_nl;
-
- *os << "// Readonly get method." << be_nl
- << this->pre_op () << "const " << bt->name () << " &" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << ";" << be_uidt_nl
- << "}" << be_nl;
-
- *os << "// Read/write get method." << be_nl
- << this->pre_op () << bt->name () << " &" << be_nl;
-
- this->op_name (bu,
- os);
-
- *os << "::" << ub->local_name () << " (void)" << be_nl
- << "{" << be_idt_nl
- << "return this->"
- << bu->field_pd_prefix () << ub->local_name ()
- << bu->field_pd_postfix ()
- << ";" << be_uidt_nl
- << "}";
-
- return 0;
-}
-
-void
-be_visitor_valuetype_field_cs::setenclosings (const char *pre)
-{
- this->pre_op_ = pre;
-}
-
-const char*
-be_visitor_valuetype_field_cs::pre_op ()
-{
- return this->pre_op_;
-}
-
-// Retrieve the fully scoped skeleton name.
-void
-be_visitor_valuetype_field_cs::op_name (be_valuetype *node,
- TAO_OutStream *os)
-{
- if (this->in_obv_space_)
- {
- *os << node->full_obv_skel_name ();
- }
- else
- {
- *os << node->name ();
- }
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp
deleted file mode 100644
index 55aec2de444..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// marshal_ch.cpp
-//
-// = DESCRIPTION
-// Concrete visitor for valuetypes.
-// This one provides code generation for marshalling.
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-// based on code from Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- marshal_ch,
- "$Id$")
-
-// ***************************************************************************
-// Structure visitor for generating declarations
-// ***************************************************************************
-
-be_visitor_valuetype_marshal_ch::be_visitor_valuetype_marshal_ch (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_valuetype_marshal_ch::~be_visitor_valuetype_marshal_ch (void)
-{
-}
-
-int
-be_visitor_valuetype_marshal_ch::visit_valuetype (be_valuetype *node)
-{
- this->elem_number_ = 0;
-
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next())
- {
- AST_Decl *d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "bad node in this scope\n"),
- -1);
-
- }
-
- be_field *field = be_field::narrow_from_decl (d);
-
- if (field)
- {
- be_visitor_context ctx (*this->ctx_);
- be_visitor_valuetype_field_cdr_ch visitor (&ctx);
- visitor.pre_ = node->field_pd_prefix ();
- visitor.post_ = node->field_pd_postfix ();
-
- if (visitor.visit_field (field) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_marshal_ch::"
- "visit_valuetype - "
- "codegen for scope failed\n"),
- -1);
- }
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_marshal_ch::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp
deleted file mode 100644
index ef1bcb17051..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp
+++ /dev/null
@@ -1,302 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// marshal_cs.cpp
-//
-// = DESCRIPTION
-// Concrete visitor for valuetypes.
-// This one provides code generation for marshalling.
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- marshal_cs,
- "$Id$")
-
-be_visitor_valuetype_marshal_cs::be_visitor_valuetype_marshal_cs (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_valuetype_marshal_cs::~be_visitor_valuetype_marshal_cs (void)
-{
-}
-
-int
-be_visitor_valuetype_marshal_cs::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
-
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "::CORBA::Boolean" << be_nl;
-
- this->class_name (node, os);
-
- *os << "::_tao_marshal_state (TAO_OutputCDR &";
-
- be_valuetype *inh = node->statefull_inherit ();
-
- // If the valuetype has no fields, and no stateful inherit,
- // the stream arg is unused.
- if (inh != 0 || node->data_members_count () > 0)
- {
- *os << "strm";
- }
-
- *os << ", TAO_ChunkInfo&";
- // If the valuetype has no fields, and no stateful inherit,
- // the chunking helper arg is unused.
- if (inh != 0 || node->data_members_count () > 0)
- {
- *os << "ci";
- }
-
- *os << ") const" << be_nl
- << "{" << be_idt_nl;
-
- if (inh)
- {
- *os << "if (! ci.start_chunk (strm))" << be_idt_nl;
- *os << "return false;" << be_uidt_nl << be_nl;
-
- if (inh->opt_accessor ())
- {
- *os << "if (!this->";
-
- this->class_name (inh, os);
-
- *os << "::_tao_marshal_state (strm, ci))" << be_idt_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl;
- }
- // Can access base class only via virtual function.
- else
- {
- *os << "if (! this->_tao_marshal__"
- << inh->flat_name ()
- << " (strm, ci))" << be_idt_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl;
- }
- }
-
- be_visitor_context new_ctx = *this->ctx_;
- be_visitor_valuetype_field_cdr_decl field_out_cdr (&new_ctx);
- field_out_cdr.visit_scope (node);
-
- if (node->data_members_count () > 0)
- {
- *os << "if (! ci.start_chunk (strm))" << be_idt_nl;
- *os << "return false;" << be_uidt_nl << be_nl;
- *os << "CORBA::Boolean const ret = " << be_idt << be_idt_nl;
-
- // All we have to do is to visit the scope and generate code.
- this->gen_fields (node,
- *this->ctx_);
-
- *os << ";" << be_uidt << be_uidt_nl;
-
- *os << "if ( ! ret) " << be_idt_nl;
- *os << "return false; " << be_uidt_nl << be_nl;
- *os << "if (! ci.end_chunk (strm))" << be_idt_nl;
- *os << "return false;" << be_uidt_nl << be_nl;
- }
-
- if (inh)
- {
- *os << "if (! ci.end_chunk (strm))" << be_idt_nl;
- *os << "return false;" << be_uidt_nl << be_nl;
- }
-
- *os << "return true;" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
-
- // Set the substate as generating code for the input operator.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_INPUT);
-
- *os << "::CORBA::Boolean" << be_nl;
-
- this->class_name (node, os);
-
- *os << "::_tao_unmarshal_state (TAO_InputCDR &";
-
- // If the valuetype has no fields, and no stateful inherit,
- // the stream arg is unused.
- if (inh != 0 || node->data_members_count () > 0)
- {
- *os << "strm";
- }
-
- *os << ", TAO_ChunkInfo&";
- // If the valuetype has no fields, and no stateful inherit,
- // the chunking helper arg is unused.
- if (inh != 0 || node->data_members_count () > 0)
- {
- *os << "ci";
- }
-
- *os << ")" << be_nl
- << "{" << be_idt_nl;
-
- if (inh)
- {
- *os << "if (! ci.handle_chunking (strm))" << be_idt_nl;
- *os << "return false;" << be_uidt_nl << be_nl;
-
- if (inh->opt_accessor ())
- {
- *os << "if (!this->";
-
- this->class_name (inh, os);
-
- *os << "::_tao_unmarshal_state (strm, ci))" << be_idt_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl;
- }
- else // only can access base class via virtual function
- {
- *os << "if (! this->_tao_unmarshal__"
- << inh->flat_name ()
- << " (strm, ci))" << be_idt_nl
- << "{" << be_idt_nl
- << "return false;" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl;
- }
- }
-
- be_visitor_valuetype_field_cdr_decl field_in_cdr (&new_ctx);
- field_in_cdr.visit_scope (node);
-
- if (node->data_members_count () > 0)
- {
- *os << "if (! ci.handle_chunking (strm))" << be_idt_nl;
- *os << "return false;" << be_uidt_nl << be_nl;
- *os << "CORBA::Boolean const ret = " << be_idt << be_idt_nl;
-
- // All we have to do is to visit the scope and generate code.
- this->gen_fields (node,
- *this->ctx_);
-
- *os << ";" << be_uidt << be_uidt_nl;
-
- *os << "if ( ! ret) " << be_idt_nl;
- *os << "return false; " << be_uidt_nl << be_nl;
- *os << "if (this->require_truncation_)" << be_idt_nl;
- *os << "return ci.skip_chunks (strm);" << be_uidt_nl << be_nl;
- *os << "else" << be_idt_nl;
- *os << "return ci.handle_chunking (strm);" << be_uidt_nl << be_nl;
- }
- else
- *os << "return true;";
- *os << be_uidt_nl << "}" << be_nl << be_nl;
-
- *os << "void" << be_nl;
-
- this->class_name (node, os);
-
- *os << "::truncation_hook (void)" << be_nl
- << "{" << be_idt_nl
- << "this->require_truncation_ = true;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_valuetype_marshal_cs::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-void
-be_visitor_valuetype_marshal_cs::class_name (be_valuetype *node,
- TAO_OutStream *os)
-{
- if (node->opt_accessor ())
- {
- be_decl *scope =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
-
- *os << scope->name () << "::"
- << node->local_name ();
- }
- else
- {
- *os << node->full_obv_skel_name ();
- }
-}
-
-// Operations for field marshaling.
-int
-be_visitor_valuetype_marshal_cs::gen_fields (be_valuetype *node,
- be_visitor_context &ctx)
-{
- int n_processed = 0;
- TAO_OutStream *os = ctx.stream ();
- this->elem_number_ = 0;
-
- // Initialize an iterator to iterate thru our scope.
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next())
- {
- AST_Decl *d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "bad node in this scope\n"),
- -1);
- }
-
- be_field *field = be_field::narrow_from_decl (d);
-
- if (field)
- {
- if (n_processed > 0)
- {
- *os << " &&" << be_nl;
- }
-
- ++n_processed;
- be_visitor_valuetype_field_cdr_cs visitor (&ctx);
- visitor.pre_ = node->field_pd_prefix ();
- visitor.post_ = node->field_pd_postfix ();
-
- if (visitor.visit_field (field) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_marshal_cs::"
- "visit_valuetype - "
- "codegen for scope failed\n"),
- -1);
- }
- }
- }
-
- if (n_processed == 0)
- {
- *os << "true";
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp
deleted file mode 100644
index c69154e3dce..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp
+++ /dev/null
@@ -1,287 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// obv_module.cpp
-//
-// = DESCRIPTION
-// Concrete visitor for the Module class
-// This provides code generation for the module in the header
-// for the OBV_ namespace (see C++ mapping OMG 20.17)
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_obv_module,
- obv_module,
- "$Id$")
-
-// ************************************************************
-// OBV module visitor for server header.
-// ************************************************************
-
-be_visitor_obv_module::be_visitor_obv_module (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_obv_module::~be_visitor_obv_module (void)
-{
-}
-
-int
-be_visitor_obv_module::visit_module (be_module *node)
-{
- if (node->imported ())
- {
- return 0;
- }
-
- if (node->has_nested_valuetype ())
- {
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_MODULE_OBV_CH)
- {
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "namespace ";
-
- if (!node->is_nested ())
- {
- // We are outermost module, so prepend.
- *os << "OBV_" << node->local_name () << be_nl;
- }
- else
- {
- // We are inside another module.
- *os << node->local_name () << be_nl;
- }
-
- *os << "{" << be_idt;
- }
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_module - "
- "codegen for scope failed\n"),
- -1);
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_MODULE_OBV_CH)
- {
- *os << be_uidt_nl << "}";
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_obv_module::visit_valuetype (be_valuetype *node)
-{
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 1;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_MODULE_OBV_CH:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_OBV_CI:
- {
- // This context state is not involved in any strategies.
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CI);
- be_visitor_valuetype_obv_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_MODULE_OBV_CS:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CS);
- break;
- default:
- return 0;
- }
-
- if (status == 0)
- {
- return 0;
- }
- else if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "failed to accept visitor\n"),
- -1);
- }
-
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state ()));
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
-
- // Do addtional "extra" code generation if necessary.
- if (node->has_extra_code_generation (ctx.state ()))
- {
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state (), 1));
-
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
- }
-
- return 0;
-}
-
-int
-be_visitor_obv_module::visit_eventtype (be_eventtype *node)
-{
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 1;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_MODULE_OBV_CH:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_OBV_CI:
- {
- // This context state is not involved in any strategies.
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CI);
- be_visitor_valuetype_obv_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_MODULE_OBV_CS:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CS);
- break;
- default:
- return 0;
- }
-
- if (status == 0)
- {
- return 0;
- }
- else if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "failed to accept visitor\n"),
- -1);
- }
-
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state ()));
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
-
- // Do addtional "extra" code generation if necessary.
- if (node->has_extra_code_generation (ctx.state ()))
- {
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state (), 1));
-
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp
deleted file mode 100644
index ebbbd55dca8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp
+++ /dev/null
@@ -1,986 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Valuetypes. This is a generic visitor.
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-// based on interface.cpp from Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- valuetype,
- "$Id$")
-
-be_visitor_valuetype::be_visitor_valuetype (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_valuetype::~be_visitor_valuetype (void)
-{
-}
-
-int
-be_visitor_valuetype::visit_valuetype_scope (be_valuetype *node)
-{
- this->elem_number_ = 0;
-
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next())
- {
- AST_Decl *d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "bad node in this scope\n"),
- -1);
- }
-
- be_decl *bd = be_decl::narrow_from_decl (d);
- // Set the scope node as "node" in which the code is being
- // generated so that elements in the node's scope can use it
- // for code generation.
-
- this->ctx_->scope (node->decl ());
- this->ctx_->node (bd);
- this->elem_number_++;
-
- AST_Field *field = AST_Field::narrow_from_decl (d);
-
- if (field != 0 && field->visibility () == AST_Field::vis_PRIVATE)
- {
- this->begin_private ();
- }
- else
- {
- this->begin_public ();
- }
-
- if (bd == 0 || bd->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "codegen for scope failed\n"),
- -1);
-
- }
- }
-
- return 0;
-}
-
-// These two are called from visit_valuetype_scope()
-void
-be_visitor_valuetype::begin_public ()
-{
- // In derived visitors print "public:" in class definition
-}
-
-void
-be_visitor_valuetype::begin_private ()
-{
- // In derived visitors print "protected:" in class definition
-}
-
-// All common visit methods for valuetype visitor.
-
-int
-be_visitor_valuetype::visit_attribute (be_attribute *node)
-{
- this->ctx_->node (node);
- this->ctx_->attribute (node);
-
- be_operation get_op (node->field_type (),
- AST_Operation::OP_noflags,
- node->name (),
- 0,
- 0);
-
- get_op.set_name ((UTL_IdList *) node->name ()->copy ());
-
- if (this->visit_operation (&get_op) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for get_attribute failed\n"),
- -1);
- }
-
- get_op.destroy ();
-
- if (node->readonly ())
- {
- // Nothing else to do.
- return 0;
- }
-
- Identifier id ("void");
-
- UTL_ScopedName sn (&id,
- 0);
-
- be_predefined_type rt (AST_PredefinedType::PT_void,
- &sn);
-
- // Argument type is the same as the attribute type.
- AST_Argument *arg =
- idl_global->gen ()->create_argument (AST_Argument::dir_IN,
- node->field_type (),
- node->name ());
-
- arg->set_name ((UTL_IdList *) node->name ()->copy ());
-
- // Create the operation.
- be_operation set_op (&rt,
- AST_Operation::OP_noflags,
- node->name (),
- 0,
- 0);
-
- set_op.set_name ((UTL_IdList *) node->name ()->copy ());
- set_op.be_add_argument (arg);
-
- if (this->visit_operation (&set_op) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for set_attribute failed\n"),
- -1);
- }
-
- set_op.destroy ();
- rt.destroy ();
-
- return 0;
-}
-
-
-int
-be_visitor_valuetype::visit_constant (be_constant *node)
-{
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_constant_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_constant_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CH:
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CI:
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CS:
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- case TAO_CodeGen::TAO_ROOT_CI:
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_IH:
- case TAO_CodeGen::TAO_ROOT_IS:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- return 0; // Nothing to be done.
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_constant - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_constant - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype::visit_enum (be_enum *node)
-{
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_enum_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_enum_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_enum_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_enum_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_enum_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_enum_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CH:
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CI:
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CS:
- case TAO_CodeGen::TAO_ROOT_CI:
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_IH:
- case TAO_CodeGen::TAO_ROOT_IS:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- return 0; // Nothing to be done.
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_enum - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_enum - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype::visit_exception (be_exception *node)
-{
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_exception_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_exception_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_exception_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_exception_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_exception_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_exception_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_exception_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // Nothing to be done.
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_exception - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype::visit_structure (be_structure *node)
-{
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_structure_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_structure_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_structure_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_structure_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_structure_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_structure_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_structure_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // Nothing to be done.
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_structure - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype::visit_structure_fwd (be_structure_fwd *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_structure_fwd_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_structure_fwd - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype::visit_union (be_union *node)
-{
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_union_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_union_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_union_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_union_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_union_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_union_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_union_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CH:
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CI:
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CS:
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_IH:
- case TAO_CodeGen::TAO_ROOT_IS:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- return 0; // Nothing to be done.
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_union - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_union - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype::visit_union_fwd (be_union_fwd *node)
-{
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_union_fwd_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- default:
- return 0; // nothing to be done
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_union_fwd - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype::visit_typedef (be_typedef *node)
-{
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 0;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- {
- be_visitor_typedef_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CI:
- {
- be_visitor_typedef_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CS:
- {
- be_visitor_typedef_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- {
- be_visitor_typedef_any_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- {
- be_visitor_typedef_any_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- {
- be_visitor_typedef_cdr_op_ch visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- {
- be_visitor_typedef_cdr_op_cs visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CH:
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CI:
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CS:
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_IH:
- case TAO_CodeGen::TAO_ROOT_IS:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- return 0; // Nothing to be done.
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_typedef - "
- "Bad context state\n"),
- -1);
- }
- }
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_typedef - "
- "failed to accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype::visit_field (be_field *)
-{
- // Is overridden in derived visitors.
- return 0;
-}
-
-
-// Private data fields for scope.
-int
-be_visitor_valuetype::gen_pd (be_valuetype *node)
-{
- int n_processed = 0;
- this->elem_number_ = 0;
-
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next())
- {
- AST_Decl *d = si.item ();
-
- if (!d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "bad node in this scope\n"),
- -1);
- }
-
- be_field *field = be_field::narrow_from_decl (d);
-
- if (!field)
- {
- continue;
- }
-
- ++n_processed;
-
- // Set the scope node as "node" in which the code is being
- // generated so that elements in the node's scope can use it
- // for code generation.
- this->ctx_->scope (node->decl ());
-
- // Set the node to be visited.
- this->ctx_->node (field);
- this->elem_number_++;
-
- if (this->gen_field_pd (field) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "codegen for scope failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-// Private data for field.
-int
-be_visitor_valuetype::gen_field_pd (be_field *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // First generate the type information.
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
- be_valuetype *vt = be_valuetype::narrow_from_scope (node->defined_in ());
-
- if (!bt || !vt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_field - "
- "Bad field type\n"),
- -1);
- }
-
- // Instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting.
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- be_visitor_field_ch visitor (&ctx);
-
- *os << be_nl;
-
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_field - "
- "codegen for field type failed\n"),
- -1);
- }
-
- // Now output the field name.
- *os << " " << vt->field_pd_prefix ()
- << node->local_name ()
- << vt->field_pd_postfix () << ";";
-
- return 0;
-}
-
-void
-be_visitor_valuetype::gen_obv_init_constructor_args (be_valuetype *node,
- unsigned long &index)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- AST_ValueType *parent = node->inherits_concrete ();
-
- // Generate for inherited members first.
- if (parent != 0)
- {
- be_valuetype *be_parent =
- be_valuetype::narrow_from_decl (parent);
- this->gen_obv_init_constructor_args (be_parent, index);
- }
-
- be_visitor_context ctx (*this->ctx_);
- be_visitor_args_arglist visitor (&ctx);
-
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next())
- {
- be_field *f = be_field::narrow_from_decl (si.item ());
-
- if (f == 0)
- {
- continue;
- }
-
- *os << (index++ != 0 ? "," : "") << be_nl;
-
- ACE_CString arg_name ("_tao_init_");
- arg_name += f->local_name ()->get_string ();
- Identifier id (arg_name.c_str ());
- UTL_ScopedName sn (&id, 0);
- be_type *ft = be_type::narrow_from_decl (f->field_type ());
- bool seen = ft->seen_in_operation ();
-
- // This sets ft->seen_in_operation (true), so we have to
- // restore the original value below.
- be_argument arg (AST_Argument::dir_IN,
- ft,
- &sn);
- ft->seen_in_operation (seen);
- visitor.visit_argument (&arg);
-
- // AST_Argument inherits from AST_Field, which will destroy
- // its field type if it is anonymous - we don't want that.
- arg.be_decl::destroy ();
- arg.AST_Decl::destroy ();
- id.destroy ();
- }
-}
-
-// Generate the _init definition.
-int
-be_visitor_valuetype::gen_init_defn (be_valuetype *node)
-{
- if (node->is_abstract ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "class " << be_global->stub_export_macro ()
- << " " << node->local_name ()
- << "_init : public ::CORBA::ValueFactoryBase" << be_nl;
-
- // Generate the body.
- *os << "{" << be_nl
- << "public:" << be_idt_nl
- << "virtual ~" << node->local_name () << "_init (void);" << be_nl;
-
- *os << "virtual const char* tao_repository_id (void);\n" << be_nl;
- *os << "// create () goes here" << be_nl;
- *os << be_uidt_nl << "};" << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_valuetype::gen_init_impl (be_valuetype *node)
-{
- if (node->is_abstract ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- os->indent ();
-
- char fname [NAMEBUFSIZE]; // to hold the full and
- char lname [NAMEBUFSIZE]; // local _out names
-
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
- ACE_OS::sprintf (fname,
- "%s_init",
- node->full_name ());
-
- ACE_OS::memset (lname,
- '\0',
- NAMEBUFSIZE);
- ACE_OS::sprintf (lname,
- "%s_init",
- node->local_name ());
-
- // Destructor.
- *os << fname << "::~" << lname << " (void)" << be_nl
- << "{" << be_nl << "}\n\n";
-
- *os << "const char* " << be_nl
- << fname << "::tao_repository_id (void)" << be_nl
- << "{" << be_idt_nl
- << "return " << node->local_name ()
- << "::_tao_obv_static_repository_id ();"
- << be_uidt_nl << "}\n\n";
-
- return 0;
-}
-
-bool
-be_visitor_valuetype::obv_need_ref_counter (be_valuetype* node)
-{
- // Go thru our base VTs and see if one has already.
- for (int i = 0; i < node->n_inherits (); ++i)
- {
- be_valuetype *vt =
- be_valuetype::narrow_from_decl (node->inherits ()[i]);
-
- if (vt != 0)
- {
- if (be_visitor_valuetype::obv_have_ref_counter (vt))
- {
- return false;
- }
- }
- }
-
- // If we inherit from CORBA::Object and/or CORBA::AbstractBase
- // (in addition to CORBA::ValueBase) we have to override _add_ref()
- // and _remove_ref() by calling the one in DefaultValueRefCountBase
- // to avoid ambiguity.
- if (node->n_supports () > 0)
- {
- return true;
- }
-
- // VT needs RefCounter if it has concrete factory.
- if (be_valuetype::FS_CONCRETE_FACTORY == node->determine_factory_style ())
- {
- return true;
- }
-
- return false;
-}
-
-bool
-be_visitor_valuetype::obv_have_ref_counter (be_valuetype* node)
-{
-
- // Just try to find a VT with concrete factory in inheritance tree.
- if (node == 0)
- {
- return false;
- }
-
- if (node->determine_factory_style () == be_valuetype::FS_CONCRETE_FACTORY)
- {
- return true;
- }
-
- // Now go thru our base VTs.
- for (int i = 0; i < node->n_inherits (); ++i)
- {
- be_valuetype *vt = be_valuetype::narrow_from_decl (node->inherits ()[i]);
-
- if (vt != 0)
- {
- if (be_visitor_valuetype::obv_have_ref_counter (vt))
- {
- return true;
- }
- }
- }
-
- return false;
-}
-
-bool
-be_visitor_valuetype::is_amh_exception_holder (be_valuetype *node)
-{
- if (ACE_OS::strncmp (node->local_name (), "AMH_", 4) == 0)
- {
- const char *last_E =
- ACE_OS::strrchr (node->full_name (), 'E');
-
- if (last_E != 0
- && ACE_OS::strcmp (last_E, "ExceptionHolder") == 0)
- {
- return true;
- }
- }
-
- return false;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp
deleted file mode 100644
index fef8e7466a5..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp
+++ /dev/null
@@ -1,546 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Valuetypes in the client header
-// (see C++ mapping OMG 20.17)
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>,
-// based on interface_ch.cpp from Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- valuetype_ch,
- "$Id$")
-
-// ******************************************************
-// Valuetype visitor for client header
-// ******************************************************
-
-be_visitor_valuetype_ch::be_visitor_valuetype_ch (be_visitor_context *ctx)
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_ch::~be_visitor_valuetype_ch (void)
-{
-}
-
-int
-be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node)
-{
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- // Evaluate the member in time for the decision to generate
- // the recursive typecode include in the stub source file.
- ACE_Unbounded_Queue<AST_Type *> list;
- (void) node->in_recursion (list);
-
- // This will be a no-op if it has alread by done by a forward
- // declaration.
- node->gen_var_out_seq_decls ();
-
- TAO_OutStream *os = this->ctx_->stream ();
- int status = 0;
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Now the valuetype definition itself.
- os->gen_ifdef_macro (node->flat_name ());
-
- if (node->node_type () == AST_Decl::NT_eventtype)
- {
- *os << be_nl << be_nl
- << "class " << node->local_name () << "Consumer;" << be_nl
- << "typedef " << node->local_name () << "Consumer *"
- << node->local_name () << "Consumer_ptr;";
- }
-
- // Now generate the class definition.
- *os << be_nl << be_nl << "class " << be_global->stub_export_macro ()
- << " " << node->local_name ();
-
- // Node valuetype inherits from other valuetypes (OMG 20.17.9)
- // (ordinary (not abstract) interfaces ignored).
-
- *os << be_idt_nl << ": " << be_idt;
-
- long i; // loop index
- be_valuetype *inherited = 0;
- long n_inherits = node->n_inherits ();
- int inherits_eventtype = 0;
-
- if (n_inherits > 0)
- {
- for (i = 0; i < n_inherits; ++i)
- {
- inherited =
- be_valuetype::narrow_from_decl (node->inherits ()[i]);
-
- if (inherited->node_type () == AST_Decl::NT_eventtype)
- {
- inherits_eventtype = 1;
- }
-
- if (i > 0)
- {
- *os << "," << be_nl;
- }
-
- be_decl *scope = 0;
-
- if (inherited->is_nested ())
- {
- // Inherited node is used in the scope of "node" node.
- scope =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
- }
-
- // Dump the scoped name.
- *os << "public virtual ";
- *os << inherited->nested_type_name (scope);
- } // end of for loop
- }
-
- /***********************************************************************
- ** This is where we diverge for an ExceptionHolder ValueType.
- ** This is how we proceed:
- ** 1) Identify it is an AMH_ExceptionHolder class.
- ** 2) Inherit from CORBA::DefaultValueBaseRef i.e. provide a CONCRETE
- ** implementation for this ValueType! This is because the alternative
- ** design of deriving a concrete-exception-holder class that the IDL
- ** compiler again has to generate is superflous, unnecessary, more
- ** coe bloat and unnecessary information for the app-programmer. The
- ** changes required for this (n the *C.h file) are:
- ** 2.1) Generate the raise_method as non-abstract and provide a
- ** definition in place
- ** 2.2) Generate a new constructor that takes in a
- CORBA::Exception*
- ** 2.3) Make the destructor public (instead of protected)
- ** 2.4) Generate a private CORBA::Exception* field.
- ** 2.5) Generate the tao_marshal and tao_unmarshal methods as
- ** non-abstract.
- ** 2.6) Generate the right throw spec for the AMH ExceptionHolders
- ************************************************************************/
-
- /****************************************************************/
- // 1) Find out if the ValueType is an AMH_*ExceptionHolder
- bool is_an_amh_exception_holder = this->is_amh_exception_holder (node);
-
- if (is_an_amh_exception_holder)
- {
- if (n_inherits > 0)
- {
- *os << "," << be_nl;
- }
-
- *os << "public virtual ::CORBA::DefaultValueRefCountBase";
- }
- else if (node->node_type () == AST_Decl::NT_eventtype)
- {
- if (inherits_eventtype == 0)
- {
- if (n_inherits > 0)
- {
- *os << "," << be_nl;
- }
-
- *os << "public virtual ::Components::EventBase";
- }
- }
- else if (n_inherits == 0)
- {
- *os << "public virtual ::CORBA::ValueBase";
- }
-
- // Generate the supported interfaces.
- for (i = 0; i < node->n_supports (); ++i)
- {
- *os << "," << be_nl
- << "public virtual "
- << node->supports ()[i]->name ();
- }
-
- // Generate the body.
- *os << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "public:" << be_idt_nl
- << "typedef " << node->local_name () << " * _ptr_type;" << be_nl
- << "typedef " << node->local_name () << "_var _var_type;"
- << be_nl
- << "typedef " << node->local_name () << "_out _out_type;"
- << be_nl << be_nl;
-
- if (is_an_amh_exception_holder)
- {
- // Generate the constructor and destructor.
- *os << node->local_name () << " ( ::CORBA::Exception *ex)" << be_idt_nl
- << ": exception (ex)" << be_uidt_nl
- << "{}" << be_nl << be_nl
- << "virtual ~" << node->local_name () << " (void);"
- << be_nl << be_nl;
- }
-
- *os << "static " << node->local_name () << "* "
- << "_downcast ( ::CORBA::ValueBase *v);" << be_nl
- << be_nl
- << "// (TAO extensions or internals)" << be_nl
- << "static ::CORBA::Boolean _tao_unmarshal (" << be_idt << be_idt_nl
- << "TAO_InputCDR &strm," << be_nl
- << node->local_name () << " *&new_object" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl
- << "virtual const char* "
- << "_tao_obv_repository_id (void) const;"
- << be_nl << be_nl
- << "virtual void "
- << "_tao_obv_truncatable_repo_ids (Repository_Id_List &) const;"
- << be_nl << be_nl
- << "static const char* "
- << "_tao_obv_static_repository_id (void);" << be_nl << be_nl;
-
- if (be_global->any_support ())
- {
- *os << "static void _tao_any_destructor (void *);";
- }
-
- // Generate code for the valuetype definition.
- if (this->visit_valuetype_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ch::"
- "visit_valuetype - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // Generate pure virtual declarations of the operations in our
- // supported interfaces.
- status =
- node->traverse_supports_list_graphs (
- be_visitor_valuetype_ch::gen_supported_ops,
- os,
- false,
- true
- );
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ch::"
- "visit_valuetype - "
- "traversal of supported interfaces failed\n"),
- -1);
- }
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // If we inherit from CORBA::Object and/or CORBA::AbstractBase
- // (in addition to CORBA::ValueBase) we have to add these
- // to avoid ambiguity.
- if (node->n_supports () > 0)
- {
- *os << be_uidt_nl << be_nl << "public:" << be_idt_nl;
- *os << be_nl << "virtual void _add_ref (void) = 0;" << be_nl;
- *os << "virtual void _remove_ref (void) = 0;" << be_nl;
- *os << "virtual ::CORBA::ValueBase *_tao_to_value (void);";
- }
-
- // Generate the "protected" constructor so that users cannot
- // instantiate us.
- *os << be_uidt_nl << be_nl << "protected:" << be_idt_nl
- << node->local_name ()
- << " (void);" << be_nl;
-
- if (!is_an_amh_exception_holder)
- {
- *os << "virtual ~" << node->local_name () << " (void);"
- << be_nl << be_nl;
- }
-
- // Support for marshalling.
- if (!node->is_abstract () || is_an_amh_exception_holder)
- {
- *os << "virtual ::CORBA::Boolean "
- << "_tao_marshal_v (TAO_OutputCDR &) const;" << be_nl;
- *os << "virtual ::CORBA::Boolean "
- << "_tao_unmarshal_v (TAO_InputCDR &);" << be_nl;
- *os << "virtual ::CORBA::Boolean "
- << "_tao_match_formal_type (ptrdiff_t ) const;" << be_nl;
- }
-
- // Private member:
-
- // Private copy constructor and assignment operator. These are not
- // allowed, hence they are private.
- *os << be_uidt_nl << "private:" << be_idt_nl;
- *os << node->local_name () << " (const " << node->local_name () << " &);"
- << be_nl
- << "void operator= (const " << node->local_name () << " &);"
- << be_nl;
-
- /*********************************************************/
- // 2.4
- if (is_an_amh_exception_holder)
- {
- *os << be_nl
- << "::CORBA::Exception *exception;"
- << be_nl;
- }
- /*********************************************************/
-
-
- // Map fields to private data (if optimizing).
- if (node->opt_accessor ())
- {
- *os << be_uidt_nl << "protected:" << be_idt_nl;
- *os << "::CORBA::Boolean "
- << "_tao_marshal_state (TAO_OutputCDR &) const;" << be_nl
- << "::CORBA::Boolean "
- << "_tao_unmarshal_state (TAO_InputCDR &);" << be_nl
- << "virtual void "
- << "truncation_hook (void);"
- << be_uidt_nl << be_nl;
- *os << "private:" << be_idt_nl;
-
- this->gen_pd (node);
- }
- else // Need a way to access the state of derived OBV_ classes.
- {
- if (!node->is_abstract ())
- {
- *os << be_uidt_nl << "protected:" << be_idt_nl;
-
- if (is_an_amh_exception_holder)
- {
- *os << "virtual ::CORBA::Boolean" << be_nl
- << "_tao_marshal__" << node->flat_name ()
- << " (TAO_OutputCDR &, TAO_ChunkInfo &) const;"
- << be_nl << be_nl;
- *os << "virtual ::CORBA::Boolean" << be_nl
- << "_tao_unmarshal__" << node->flat_name ()
- << " (TAO_InputCDR &, TAO_ChunkInfo &);";
- }
- else
- {
- *os << "virtual ::CORBA::Boolean" << be_nl
- << "_tao_marshal__" << node->flat_name ()
- << " (TAO_OutputCDR &, TAO_ChunkInfo &) const = 0;"
- << be_nl << be_nl;
- *os << "virtual ::CORBA::Boolean" << be_nl
- << "_tao_unmarshal__" << node->flat_name ()
- << " (TAO_InputCDR &, TAO_ChunkInfo &) = 0;";
- }
- }
- }
-
- *os << be_uidt_nl
- << "};";
-
- os->gen_endif ();
-
- // Generate the _init -related declarations.
- be_visitor_context ctx (*this->ctx_);
- be_visitor_valuetype_init_ch visitor (&ctx);
-
- if (visitor.visit_valuetype (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ch::"
- "visit_valuetype - "
- "failed to generate _init construct.\n"),
- -1);
- }
-
- // Step last: generate typecode declaration.
- if (be_global->tc_support ())
- {
- be_visitor_context ctx (*this->ctx_);
- be_visitor_typecode_decl visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ch::"
- "visit_structure - "
- "TypeCode declaration failed\n"),
- -1);
- }
- }
-
- node->cli_hdr_gen (true);
-
- return 0;
-}
-
-int
-be_visitor_valuetype_ch::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_valuetype_ch::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl;
-
- // Every operation is declared public and virtual in the client code.
- *os << be_uidt_nl << "public:" << be_idt_nl << "virtual ";
-
- be_type *bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ch::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- be_visitor_context ctx (*this->ctx_);
- be_visitor_operation_rettype or_visitor (&ctx);
-
- if (bt->accept (&or_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ch::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
-
- *os << " " << node->local_name ();
-
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_CH);
- be_visitor_obv_operation_arglist ooa_visitor (&ctx);
-
- if (node->accept (&ooa_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_ch::visit_field (be_field *node)
-{
- be_valuetype *vt = be_valuetype::narrow_from_scope (node->defined_in ());
-
- if (!vt)
- {
- return -1;
- }
-
- be_visitor_context ctx (*this->ctx_);
- be_visitor_valuetype_field_ch visitor (&ctx);
-
- if (vt->opt_accessor ())
- {
- visitor.setenclosings ("",";");
- }
- else
- {
- visitor.setenclosings ("virtual "," = 0;");
- }
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_obv_ch::"
- "visit_field - codegen failed\n"),
- -1);
- }
-
- return 0;
-}
-
-
-void
-be_visitor_valuetype_ch::begin_public (void)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_uidt_nl << be_nl << "public:"
- << be_idt;
-}
-
-void
-be_visitor_valuetype_ch::begin_private (void)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_uidt_nl << be_nl << "protected:"
- << be_idt;
-}
-
-int
-be_visitor_valuetype_ch::gen_supported_ops (be_interface *,
- be_interface *base,
- TAO_OutStream *os)
-{
-
- AST_Decl *d = 0;
- be_visitor_context ctx;
- ctx.stream (os);
-
- for (UTL_ScopeActiveIterator si (base, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next ())
- {
- d = si.item ();
-
- if (d == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ch::"
- "gen_supported_ops - "
- "bad node in this scope\n"),
- -1);
- }
-
- AST_Decl::NodeType nt = d->node_type ();
- be_visitor_valuetype_ch visitor (&ctx);
-
- if (nt == AST_Decl::NT_op)
- {
- be_operation *op = be_operation::narrow_from_decl (d);
-
- if (visitor.visit_operation (op) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ch::"
- "gen_supported_ops - "
- "failed to accept visitor\n"),
- -1);
- }
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp
deleted file mode 100644
index eed0287f2ff..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Valuetypes in the client inline file
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-// based on code from Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- valuetype_ci,
- "$Id$")
-
-// **************************************************
-// Valuetype visitor for client inline.
-// **************************************************
-
-be_visitor_valuetype_ci::be_visitor_valuetype_ci (be_visitor_context *ctx)
- : be_visitor_valuetype (ctx),
- opt_accessor_ (0)
-{
-}
-
-be_visitor_valuetype_ci::~be_visitor_valuetype_ci (void)
-{
-}
-
-int
-be_visitor_valuetype_ci::visit_valuetype (be_valuetype *node)
-{
- if (node->cli_inline_gen () || node->imported ())
- {
- return 0;
- }
-
- if (node->opt_accessor ())
- {
- this->opt_accessor_ = 1;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << "ACE_INLINE" << be_nl;
- *os << node->name () << "::" << node->local_name () << " (void)" << be_nl;
-
- if (node->truncatable())
- {
- *os << "{" << be_idt_nl
- << "this->is_truncatable_ = true;" << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
- else
- *os << "{}" << be_nl << be_nl;
-
-
- *os << "ACE_INLINE const char* " << be_nl
- << node->name () << "::_tao_obv_static_repository_id ()" << be_nl
- << "{" << be_idt_nl
- << "return \"" << node->repoID () << "\";" << be_uidt_nl
- << "}";
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ci::"
- "visit_valuetype - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // Generate the _init-related code.
- be_visitor_context ctx (*this->ctx_);
- be_visitor_valuetype_init_ci visitor (&ctx);
-
- if (visitor.visit_valuetype (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ci::"
- "visit_valuetype - "
- "failed to generate _init construct.\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_ci::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_valuetype_ci::visit_field (be_field *node)
-{
- if (opt_accessor_)
- {
- be_visitor_context ctx (*this->ctx_);
- be_visitor_valuetype_field_cs visitor (&ctx);
- visitor.in_obv_space_ = 0;
- visitor.setenclosings ("ACE_INLINE ");
-
- if (visitor.visit_field (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ci::"
- "visit_field - "
- "visit_field failed\n"),
- -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp
deleted file mode 100644
index 8e577ec39bf..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp
+++ /dev/null
@@ -1,430 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Valuetypes in the client stubs file.
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-// based on code from Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- valuetype_cs,
- "$Id$")
-
-// ************************************************************
-// Valuetype visitor for client stubs.
-// ************************************************************
-
-be_visitor_valuetype_cs::be_visitor_valuetype_cs (be_visitor_context *ctx)
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_cs::~be_visitor_valuetype_cs (void)
-{
-}
-
-int
-be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node)
-{
- if (node->cli_stub_gen () || node->imported ())
- {
- return 0;
- }
-
- if (be_global->tc_support ())
- {
- be_visitor_context ctx (*this->ctx_);
- TAO::be_visitor_value_typecode tc_visitor (&ctx);
-
- if (tc_visitor.visit_valuetype (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_cs::"
- "visit_valuetype - "
- "TypeCode definition failed\n"),
- -1);
- }
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- if (node->is_defined ())
- {
- *os << be_nl << be_nl
- << "void" << be_nl
- << "TAO::Value_Traits<" << node->name () << ">::add_ref ("
- << be_idt << be_idt_nl
- << node->name () << " * p" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::add_ref (p);" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "void" << be_nl
- << "TAO::Value_Traits<" << node->name () << ">::remove_ref ("
- << be_idt << be_idt_nl
- << node->name () << " * p" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::remove_ref (p);" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "void" << be_nl
- << "TAO::Value_Traits<" << node->name () << ">::release ("
- << be_idt << be_idt_nl
- << node->name () << " * p" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::remove_ref (p);" << be_uidt_nl
- << "}";
- }
-
- // The _downcast method.
- *os << be_nl << be_nl
- << node->name () << " *" << be_nl << node->name ()
- << "::_downcast ( ::CORBA::ValueBase *v)" << be_nl
- << "{" << be_idt_nl
- << "return dynamic_cast< ::" << node->name ()
- << " * > (v);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // The _tao_obv_repository_id method.
- *os << "const char *" << be_nl
- << node->name () << "::_tao_obv_repository_id (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->_tao_obv_static_repository_id ();" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "void" << be_nl
- << node->name () << "::_tao_obv_truncatable_repo_ids (Repository_Id_List& ids) const" << be_nl
- << "{" << be_idt_nl
- << "ids.push_back (this->_tao_obv_static_repository_id ());";
-
- if (node->truncatable ())
- {
- *os << be_nl;
- *os << node->inherits_concrete ()->name () << "::_tao_obv_truncatable_repo_ids (ids);" << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
- }
- else
- *os << be_uidt_nl << "}" << be_nl << be_nl;
-
- if (be_global->any_support ())
- {
- *os << "void" << be_nl
- << node->name ()
- << "::_tao_any_destructor (void *_tao_void_pointer)" << be_nl
- << "{" << be_idt_nl
- << node->local_name () << " *_tao_tmp_pointer =" << be_idt_nl
- << "static_cast<" << be_idt
- << node->local_name () << " *> ("
- << "_tao_void_pointer);" << be_uidt << be_uidt_nl
- << "::CORBA::remove_ref (_tao_tmp_pointer);" << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
-
- // Generate destructor.
- //
- // @@ Do not inline this destructor. It is virtual. Inlining
- // virtual functions, including virtual destructors, wreaks havoc
- // with g++ >= 4.0 RTTI support when the
- // "-fvisibility-inlines-hidden" command line option is used.
- *os << node->name () << "::~" << node->local_name () << " (void)" << be_nl;
- *os << "{}\n" << be_nl;
-
- bool is_an_amh_exception_holder =
- this->is_amh_exception_holder (node);
-
- // Nothing to marshal if abstract valuetype.
- if (!node->is_abstract () && !is_an_amh_exception_holder)
- {
- // The virtual _tao_marshal_v method.
- *os << "::CORBA::Boolean " << be_nl
- << node->name ()
- << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl
- << "{" << be_idt_nl
- << "TAO_ChunkInfo ci(this->is_truncatable_ || this->chunking_);"
- << be_nl
- << "return ";
-
- if (node->opt_accessor ())
- {
- be_decl *scope =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
-
- *os << scope->name () << "::"
- << node->local_name ()
- << "::_tao_marshal_state (strm, ci);" << be_uidt_nl;
- }
- else
- {
- *os << "this->_tao_marshal__" << node->flat_name ()
- << " (strm, ci);" << be_uidt_nl;
- }
-
- *os << "}" << be_nl << be_nl;
-
- // The virtual _tao_unmarshal_v method.
- *os << "::CORBA::Boolean " << be_nl
- << node->name ()
- << "::_tao_unmarshal_v (TAO_InputCDR & strm)"
- << be_nl
- << "{" << be_idt_nl
- << "TAO_ChunkInfo ci(this->is_truncatable_ || this->chunking_ ,1);"
- << be_nl
- << "return ";
-
- if (node->opt_accessor ())
- {
- be_decl *scope =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
-
- *os << scope->name () << "::"
- << node->local_name ()
- <<"::_tao_unmarshal_state (strm,ci);" << be_uidt_nl;
- }
- else
- {
- *os << "this->_tao_unmarshal__" << node->flat_name ()
- << " (strm,ci);" << be_uidt_nl;
- }
-
- *os << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean " << be_nl
- << node->name ()
- << "::_tao_match_formal_type (ptrdiff_t formal_type_id) const"
- << be_nl
- << "{" << be_idt_nl
- << "return formal_type_id == reinterpret_cast<ptrdiff_t> ("
- << node->name() << "::_downcast);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- }
- else if (is_an_amh_exception_holder)
- {
- // @@ Do not inline. They're virtual. Inlining virtual
- // functions, including virtual destructors, wreaks havoc with
- // g++ >= 4.0 RTTI support when the
- // "-fvisibility-inlines-hidden" command line option is used.
-
- // The virtual _tao_marshal_v method.
- *os << "::CORBA::Boolean" << be_nl
- << node->name () << "::_tao_marshal_v (TAO_OutputCDR &) const"
- << be_nl
- << "{" << be_idt_nl
- << "return true;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // The virtual _tao_unmarshal_v method.
- *os << "::CORBA::Boolean" << be_nl
- << node->name () << "::_tao_unmarshal_v (TAO_InputCDR &)"
- << be_nl
- << "{" << be_idt_nl
- << "return true;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // The virtual _tao_match_formal_type method.
- *os << "::CORBA::Boolean " << be_nl
- << node->name ()
- << "::_tao_match_formal_type (ptrdiff_t ) const"
- << be_nl
- << "{" << be_idt_nl
- << "return false;"<< be_uidt_nl
- << "}" << be_nl << be_nl;
-
-
- if (!node->opt_accessor () && !node->is_abstract ())
- {
- *os << "::CORBA::Boolean" << be_nl
- << node->name () << "::_tao_marshal__" << node->flat_name ()
- << " (TAO_OutputCDR &, TAO_ChunkInfo&) const" << be_nl
- << "{" << be_idt_nl
- << "return true;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean" << be_nl
- << node->name () << "::_tao_unmarshal__" << node->flat_name ()
- << " (TAO_InputCDR &, TAO_ChunkInfo&)" << be_nl
- << "{" << be_idt_nl
- << "return true;" << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
- }
-
- // The static T::_tao_unmarshal method
-
- *os << "::CORBA::Boolean " << node->name()
- << "::_tao_unmarshal (" << be_idt << be_idt_nl
- << "TAO_InputCDR &strm," << be_nl
- << node->local_name () << " *&new_object" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "::CORBA::ValueBase *base = 0;" << be_nl
- << "::CORBA::Boolean retval =" << be_idt_nl
- << "::CORBA::ValueBase::_tao_unmarshal_pre (" << be_idt << be_idt_nl
- << "strm," << be_nl
- << "base," << be_nl
- << node->local_name () << "::_tao_obv_static_repository_id ()" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl << be_nl
- << "if (!retval)" << be_idt_nl
- << "return false;" << be_uidt_nl << be_nl
- << "if (base != 0 && ! base->_tao_unmarshal_v (strm))" << be_idt_nl
- << "return false;" << be_uidt_nl << be_nl
- << "// Now base must be null or point to the unmarshaled object." << be_nl
- << "// Align the pointer to the right subobject." << be_nl
- << "new_object = " << node->local_name () << "::_downcast (base);" << be_nl
- << "return true;" << be_uidt_nl
- << "}";
-
- // If we inherit from CORBA::Object and/or CORBA::AbstractBase
- // (in addition to CORBA::ValueBase) we have to add these
- // to avoid ambiguity.
- if (node->n_supports () > 0)
- {
- *os << be_nl << be_nl
- << "::CORBA::ValueBase *" << be_nl
- << node->name () << "::_tao_to_value (void)" << be_nl
- << "{" << be_idt_nl
- << "return this;" << be_uidt_nl
- << "}";
- }
-
- // Generate code for the elements of the valuetype.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_cs::"
- "visit_valuetype - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // Generate the _init-related code.
- be_visitor_context ctx (*this->ctx_);
- be_visitor_valuetype_init_cs vi_visitor (&ctx);
-
- if (vi_visitor.visit_valuetype (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ch::"
- "visit_valuetype - "
- "failed to generate _init construct.\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_cs::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_valuetype_cs::visit_operation (be_operation *node)
-{
- if (node->cli_stub_gen () || node->imported ())
- {
- return 0;
- }
-
- be_valuetype *parent =
- be_valuetype::narrow_from_scope (node->defined_in ());
-
- if (parent == 0 || ! this->is_amh_exception_holder (parent))
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // STEP I: Generate the return type.
- be_type *bt = be_type::narrow_from_decl (node->return_type ());
-
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_cs::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- // Grab the right visitor to generate the return type.
- be_visitor_context ctx (*this->ctx_);
- be_visitor_operation_rettype or_visitor (&ctx);
-
- if (bt->accept (&or_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_cs::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
-
- // STEP 2: Generate the operation name.
- *os << be_nl << parent->name () << "::" << node->local_name ();
-
- // STEP 3: Generate the argument list with the appropriate mapping. For these
- // we grab a visitor that generates the parameter listing.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_CS);
- be_visitor_obv_operation_arglist ooa_visitor (&ctx);
-
- if (node->accept (&ooa_visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_cs::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- // We need to throw an exceptions that was assigned in a
- // different place (by the app-developer). ACE_THROW does
- // not fit the bill since the ACE_THROW macro contructs the
- // exception passed to it. Also exception->_raise() is
- // ruled out since in platforms without native exception
- // support, the _raise() function does not do anything. Below we
- // explicitly take care of both cases (platforms with
- // and without native exception support).
- *os << be_nl
- << "{" << be_nl
- << "#if defined (TAO_HAS_EXCEPTIONS)" << be_idt_nl
- << "auto_ptr< ::CORBA::Exception> safety (this->exception);" << be_nl
- << "// Direct throw because we don't have the ACE_TRY_ENV." << be_nl
- << "this->exception->_raise ();" << be_uidt_nl
- << "#else" << be_idt_nl
- << "// We can not use ACE_THROW here." << be_nl
- << "ACE_TRY_ENV.exception (this->exception);" << be_uidt_nl
- << "#endif" << be_nl
- << "}"
- << be_uidt_nl;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init.cpp
deleted file mode 100644
index bc351d2fc65..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_init.cpp
-//
-// = DESCRIPTION
-// Coomon visitor for valuetypes factory construct
-// (see IDL to C++ mapping). Based on ptc/00-01-02.
-//
-// = AUTHOR
-// Boris Kolpackov <bosk@ipmce.ru>
-//
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- valuetype_init,
- "$Id$")
-
-be_visitor_valuetype_init::be_visitor_valuetype_init (
- be_visitor_context *ctx
- )
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_init::~be_visitor_valuetype_init (void)
-{
-}
-
-void
-be_visitor_valuetype_init::begin_public (void)
-{
-}
-
-void
-be_visitor_valuetype_init::begin_private (void)
-{
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_arglist_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_arglist_ch.cpp
deleted file mode 100644
index ba41ba1371a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_arglist_ch.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_init_arglist_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the parameter list of the OBV factory
-// signature.
-//
-// = AUTHOR
-// Boris Kolpackov <bosk@ipmce.ru>
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype_init,
- arglist_ch,
- "$Id$")
-
-be_visitor_valuetype_init_arglist_ch::be_visitor_valuetype_init_arglist_ch (
- be_visitor_context *ctx
- )
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_valuetype_init_arglist_ch::~be_visitor_valuetype_init_arglist_ch (
- void
- )
-{
-}
-
-int
-be_visitor_valuetype_init_arglist_ch::visit_factory (be_factory *node)
-{
- TAO_OutStream& os = *(this->ctx_->stream ());
-
- os << " (";
-
- if (node->nmembers () > 0)
- {
- os << be_idt << be_idt_nl;
-
- // All we do is hand over code generation to our scope.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_init_arglist_ch::"
- "visit_factory - "
- "codegen for scope failed\n"),
- -1);
- }
-
- os << be_uidt_nl
- << ")";
- }
- else
- {
- os << "void)" << be_idt;
- }
-
- // Now generate the throw specs.
- if (this->gen_throw_spec (node) == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- ACE_TEXT ("(%N:%l) be_visitor_valuetype_init_arglist_ch")
- ACE_TEXT ("::visit_factory - ")
- ACE_TEXT ("Failed to generate throw spec\n")
- ),
- -1
- );
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_init_arglist_ch::visit_argument (be_argument *node)
-{
- // Get the visitor that will dump the argument's mapping in the operation
- // signature.
- be_visitor_context ctx (*this->ctx_);
- be_visitor_args_arglist visitor (&ctx);
- int status = node->accept (&visitor);
-
- if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_init_arglist_ch::"
- "visit_argument - "
- "codegen for arglist failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_init_arglist_ch::post_process (be_decl *bd)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // If we are not the last node in the list of arguments, generate a comma.
- if (!this->last_node (bd))
- {
- *os << "," << be_nl;
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_init_arglist_ch::gen_throw_spec (be_factory *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (node->exceptions ())
- {
- const char *throw_spec_open = "throw (";
- const char *throw_spec_close = ")";
-
- if (!be_global->use_raw_throw ())
- {
- throw_spec_open = "ACE_THROW_SPEC ((";
- throw_spec_close = "))";
- }
-
- *os << be_nl << throw_spec_open << be_idt;
-
- bool first = true;
-
- // Initialize an iterator to iterate thru the exception list.
- for (UTL_ExceptlistActiveIterator ei (node->exceptions ());
- !ei.is_done ();
- ei.next ())
- {
- be_exception *excp =
- be_exception::narrow_from_decl (ei.item ());
-
- if (excp == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation"
- "gen_throw_spec - "
- "bad exception node\n"),
- -1);
-
- }
-
- *os << (first ? "" : ",") << be_nl
- << excp->name ();
-
- first = false;
- }
-
- *os << be_uidt_nl << throw_spec_close << be_uidt;
- }
-
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ch.cpp
deleted file mode 100644
index c68a18b7670..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ch.cpp
+++ /dev/null
@@ -1,194 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_init_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Valuetypes factory in the client header
-// (see IDL to C++ mapping). Based on ptc/00-01-02.
-//
-// = AUTHOR
-// Boris Kolpackov <bosk@ipmce.ru>
-//
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- valuetype_init_ch,
- "$Id$")
-
-be_visitor_valuetype_init_ch::be_visitor_valuetype_init_ch (
- be_visitor_context *ctx
- )
- : be_visitor_valuetype_init (ctx)
-{
-}
-
-be_visitor_valuetype_init_ch::~be_visitor_valuetype_init_ch (void)
-{
-}
-
-int
-be_visitor_valuetype_init_ch::visit_valuetype (be_valuetype *node)
-{
- if (node->is_abstract ())
- {
- return 0;
- }
-
- // There are three possible situations.
- // (1) If there is no initializers but at least one operation.
- // In this case we don't need to bother about factory.
- //
- // (2) There are no (operations or initializers) (i.e. only state
- // members) then we need a concrete type-specific factory
- // class whose create_for_unmarshal creates OBV_ class.
- //
- // (3) There is at least one operation and at least one initializer.
- // In this case we need to generate abstract factory class.
-
- be_valuetype::FactoryStyle factory_style =
- node->determine_factory_style ();
-
- if (factory_style == be_valuetype::FS_NO_FACTORY)
- {
- // Nothing to do.
- return 0;
- }
-
- TAO_OutStream& os = *(this->ctx_->stream ());
-
- // Generate the ifdef macro for the _init class.
- os.gen_ifdef_macro (node->flat_name (), "_init");
-
- os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- //@@ If I'm generating concrete class I need a RefCounter.
- os << "class " << be_global->stub_export_macro ()
- << " " << node->local_name ()
- << "_init : public virtual ::CORBA::ValueFactoryBase" << be_nl;
-
- // Generate the body.
- os << "{" << be_nl
- << "public:" << be_idt;
-
- if (factory_style == be_valuetype::FS_CONCRETE_FACTORY)
- {
- // Public constructor.
- os << be_nl
- << node->local_name () << "_init (void);";
- }
-
- if (this->visit_valuetype_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_init_ch::"
- "visit_valuetype - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // Generate _downcast method.
- os << be_nl << be_nl
- << "static " << node->local_name () << "_init* "
- << "_downcast ( ::CORBA::ValueFactoryBase *);";
-
- if (factory_style == be_valuetype::FS_CONCRETE_FACTORY)
- {
- //@@ Boris: create_for_unmarshal is still public...
- // generate create_for_unmarshal
- os << be_nl << be_nl
- << "virtual ::CORBA::ValueBase *" << be_nl
- << "create_for_unmarshal ("
- << be_idt << be_idt
- << env_sngl_dflts << be_uidt_nl
- << ");" << be_uidt;
-
- if (node->supports_abstract ())
- {
- os << be_nl << be_nl
- << "virtual ::CORBA::AbstractBase_ptr" << be_nl
- << "create_for_unmarshal_abstract (" << be_idt << be_idt
- << env_sngl_dflts << be_uidt_nl
- << ");" << be_uidt;
- }
- }
-
- os << be_nl << be_nl;
-
- // Proprietary extensions.
- os << "// TAO-specific extensions"
- << be_uidt_nl
- << "public:" << be_idt_nl;
- os << "virtual const char* tao_repository_id (void);";
-
- if (factory_style == be_valuetype::FS_ABSTRACT_FACTORY)
- {
- // Protected constructor.
- os << be_uidt_nl << be_nl
- << "protected:" << be_idt_nl;
- os << node->local_name () << "_init (void);";
- }
-
- // Protected virtual destructor.
- os << be_uidt_nl << be_nl << "protected:" << be_idt_nl;
- os << "virtual ~" << node->local_name () << "_init (void);";
-
- os << be_uidt_nl << "};";
-
- // Generate the endif macro.
- os.gen_endif ();
-
- return 0;
-}
-
-int
-be_visitor_valuetype_init_ch::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_valuetype_init_ch::visit_factory (be_factory *node)
-{
-
- TAO_OutStream& os = *(this->ctx_->stream ());
-
- be_valuetype *vt =
- be_valuetype::narrow_from_decl (this->ctx_->scope ());
-
-
- // STEP I: Generate preambule.
- os << be_nl << be_nl
- << "virtual " << vt->local_name () << "* ";
-
- // STEP 2: Generate the operation name.
- os << node->local_name ();
-
- // STEP 3: Generate the argument list with the appropriate mapping. For these
- // we grab a visitor that generates the parameter listing.
- be_visitor_context ctx (*this->ctx_);
- be_visitor_valuetype_init_arglist_ch visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_init_arglist__ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- // Make pure virtual.
- os << " = 0;";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ci.cpp
deleted file mode 100644
index 68e9b6f3bb1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ci.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_init_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Valuetypes factory in the client header
-// (see IDL to C++ mapping)
-//
-// = AUTHOR
-// Boris Kolpackov <bosk@ipmce.ru>
-//
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- valuetype_init_ci,
- "$Id$")
-
-be_visitor_valuetype_init_ci::be_visitor_valuetype_init_ci (
- be_visitor_context *ctx
- )
- : be_visitor_valuetype_init (ctx)
-{
-}
-
-be_visitor_valuetype_init_ci::~be_visitor_valuetype_init_ci (void)
-{
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_cs.cpp
deleted file mode 100644
index 07d27795d03..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_cs.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_init_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Valuetypes factory in the client header
-// (see IDL to C++ mapping)
-//
-// = AUTHOR
-// Boris Kolpackov <bosk@ipmce.ru>
-//
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- valuetype_init_cs,
- "$Id$")
-
-be_visitor_valuetype_init_cs::be_visitor_valuetype_init_cs (
- be_visitor_context *ctx
- )
- : be_visitor_valuetype_init (ctx)
-{
-}
-
-be_visitor_valuetype_init_cs::~be_visitor_valuetype_init_cs (void)
-{
-}
-
-int
-be_visitor_valuetype_init_cs::visit_valuetype (be_valuetype *node)
-{
- if (node->is_abstract ())
- {
- return 0;
- }
-
- // There are three possible situations.
- // (1) If there is no initializers but at least one operation.
- // In this case we don't need to bother about factory.
- //
- // (2) There are no (operations or initializers) (i.e. only state
- // members) then we need a concrete type-specific factory
- // class whose create_for_unmarshal creates OBV_ class.
- //
- // (3) There is at least one operation and at least one initializer.
- // In this case we need to generate abstract factory class.
-
- be_valuetype::FactoryStyle factory_style =
- node->determine_factory_style ();
-
- if (factory_style == be_valuetype::FS_NO_FACTORY)
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- char fname [NAMEBUFSIZE]; // to hold the full and
- char lname [NAMEBUFSIZE]; // local _out names
-
- ACE_OS::memset (fname,
- '\0',
- NAMEBUFSIZE);
- ACE_OS::sprintf (fname,
- "%s_init",
- node->full_name ());
-
- ACE_OS::memset (lname,
- '\0',
- NAMEBUFSIZE);
- ACE_OS::sprintf (lname,
- "%s_init",
- node->local_name ());
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // ctor
- *os << be_nl << be_nl
- << fname << "::" << lname << " (void)" << be_nl
- << "{" << be_nl << "}";
-
- // dtor
- *os << be_nl << be_nl
- << fname << "::~" << lname << " (void)" << be_nl
- << "{" << be_nl << "}";
-
- // The _downcast method.
- *os << be_nl << be_nl
- << node->name () << "_init *" << be_nl << node->name ()
- << "_init::_downcast ( ::CORBA::ValueFactoryBase *v)" << be_nl
- << "{" << be_idt_nl
- << "return dynamic_cast< ::" << node->name ()
- << "_init * > (v);" << be_uidt_nl
- << "}";
-
- // tao_repository_id
- *os << be_nl << be_nl
- << "const char* " << be_nl
- << fname << "::tao_repository_id (void)" << be_nl
- << "{" << be_idt_nl
- << "return ::" << node->full_name ()
- << "::_tao_obv_static_repository_id ();"
- << be_uidt_nl << "}";
-
-
- if (factory_style == be_valuetype::FS_CONCRETE_FACTORY)
- {
- // generate create_for_unmarshal()
- *os << be_nl << be_nl
- << "::CORBA::ValueBase *" << be_nl
- << fname << "::create_for_unmarshal" << " ("
- << (be_global->use_raw_throw ()
- ? "void"
- : "ACE_ENV_SINGLE_ARG_DECL")
- << ")" << be_nl
- << "{" << be_idt_nl
- << "::CORBA::ValueBase *ret_val = 0;" << be_nl
- << "ACE_NEW_THROW_EX (" << be_idt << be_idt_nl
- << "ret_val," << be_nl
- << "OBV_" << node->full_name () << "," << be_nl
- << "::CORBA::NO_MEMORY ()" << be_uidt_nl
- << ");" << be_uidt_nl
- << "return ret_val;"
- << be_uidt_nl << "}";
-
- if (node->supports_abstract ())
- {
- *os << be_nl << be_nl
- << "::CORBA::AbstractBase_ptr" << be_nl
- << fname << "::create_for_unmarshal_abstract ("
- << (be_global->use_raw_throw ()
- ? "void"
- : "ACE_ENV_SINGLE_ARG_DECL")
- << ")" << be_nl
- << "{" << be_idt_nl
- << "::CORBA::AbstractBase *ret_val = 0;" << be_nl
- << "ACE_NEW_THROW_EX (" << be_idt << be_idt_nl
- << "ret_val," << be_nl
- << "OBV_" << node->full_name () << "," << be_nl
- << "::CORBA::NO_MEMORY ()" << be_uidt_nl
- << ");" << be_uidt_nl
- << "return ret_val;"
- << be_uidt_nl << "}";
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_init_cs::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp
deleted file mode 100644
index 3a04f825b06..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp
+++ /dev/null
@@ -1,313 +0,0 @@
-
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_obv__ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Valuetypes in the client header
-// OBV_ class
-// (see C++ mapping OMG 20.17)
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>,
-// based on interface_ch.cpp from Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- valuetype_obv_ch,
- "$Id$")
-
-// ******************************************************
-// Valuetype visitor for client header
-// ******************************************************
-
-be_visitor_valuetype_obv_ch::be_visitor_valuetype_obv_ch (
- be_visitor_context *ctx
- )
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_obv_ch::~be_visitor_valuetype_obv_ch (void)
-{
-}
-
-
-// OBV_ class must be in OBV_ namespace.
-int
-be_visitor_valuetype_obv_ch::visit_valuetype (be_valuetype *node)
-{
- // Only visit non-abstract non-imported valuetype.
- if (node->is_abstract () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ ;
-
- // OBV_ class maps only to a typedef if we are optimizing accessors.
- if (node->opt_accessor ())
- {
- *os << be_nl << be_nl << "typedef " << node->full_name () << " ";
-
- if (!node->is_nested ())
- {
- *os << "OBV_";
- }
-
- *os << node->local_name () << ";" << be_nl;
- }
- else
- {
- // STEP 1: Generate the class name and the class name we inherit.
- os->gen_ifdef_macro (node->flat_name (), "_OBV");
-
- *os << be_nl << be_nl << "// OBV_ class" << be_nl;
- *os << "class " << be_global->stub_export_macro() << " ";;
-
- if (!node->is_nested())
- {
- *os << "OBV_";
- }
-
- *os << node->local_name () << be_idt_nl
- << ": public virtual "
- << node->full_name ();
-
- // STEP 1a (about which previous implementer forgot ):
- // Generate inheritance from corresponding OBV_ classes.
-
-//------>>>
-
- // Here we need to be careful. There are few cases to consider:
- //
- // (1) We have VT with concrete factory and no inhereted VT with
- // concrete factory then we need to mix-in RefCounter
- //
- // (2) We have VT with concerete factory and inheretence from
- // another (not abstract or empty abstract <would like to
- // know how to go there>) then its OBV_ already has mix-in
- //
- // (3) We have VT that supports an abstract interface. In this case,
- // we will add implementations of _add_ref and _remove_ref that
- // call this->DefaultValueRefCountBase and so it must be mixed in
- //
- // (4) The rest. Don't need to bother about anything, just inherit
- // whatever there is.
- //
-
- int i = 0;
- AST_Interface *inherited = 0;
-
- for (; i < node->n_inherits (); ++i)
- {
- inherited = node->inherits ()[i];
-
- // We need only concrete valuetypes.
- if (inherited->is_abstract ())
- {
- continue;
- }
-
- *os << "," << be_nl;
-
- // dump the scoped name.
- *os << " public virtual OBV_";
- *os << inherited->full_name();
- } // end of for loop
-
- if (this->obv_need_ref_counter (node))
- {
- *os << "," << be_nl;
-
- // dump the scoped name.
- *os << " public virtual ::CORBA::DefaultValueRefCountBase";
- }
-
- *os << be_uidt_nl;
-
-//------>>>
-
- // STEP 2: Generate the body ==
-
- *os << "{";
-
- // Generate code for the OBV_ class definition.
- if (this->visit_valuetype_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_obv_ch::"
- "visit_valuetype - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // If we inherit from CORBA::Object and/or CORBA::AbstractBase
- // (in addition to CORBA::ValueBase) we have to add these
- // to avoid ambiguity.
- if (node->n_supports () > 0)
- {
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ ;
-
- *os << be_nl << be_nl << "virtual void _add_ref (void);" << be_nl;
- *os << "virtual void _remove_ref (void);";
- }
-
- if (node->have_operation ())
- {
- this->begin_private ();
- }
- else
- {
- this->begin_public ();
- }
-
- *os << be_nl;
-
- // Default constructor.
- if (! node->is_nested ())
- {
- *os << "OBV_";
- }
-
- *os << node->local_name () << " (void);";
-
- // Initializing constructor.
- if (node->has_member ())
- {
- *os << be_nl;
-
- if (! node->is_nested ())
- {
- *os << "OBV_";
- }
-
- *os << node->local_name () << " (" << be_idt << be_idt;
-
- unsigned long index = 0;
- this->gen_obv_init_constructor_args (node, index);
-
- *os << be_uidt_nl
- << ");" << be_uidt;
- }
-
- // Virtual destructor.
- *os << be_nl << "virtual ~";
-
- if (! node->is_nested ())
- {
- *os << "OBV_";
- }
-
- *os << node->local_name () << " (void);";
-
- // Map fields to private data.
- if (!node->opt_accessor ())
- {
- *os << be_nl << be_uidt_nl << "protected:" << be_idt_nl;
-
- *os << "virtual ::CORBA::Boolean" << be_nl
- << "_tao_marshal__" << node->flat_name ()
- << " (TAO_OutputCDR &, TAO_ChunkInfo &) const;" << be_nl << be_nl;
-
- *os << "virtual ::CORBA::Boolean" << be_nl
- << "_tao_unmarshal__" << node->flat_name ()
- << " (TAO_InputCDR &, TAO_ChunkInfo &);" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean "
- << "_tao_marshal_state (TAO_OutputCDR &, TAO_ChunkInfo &) const;"
- << be_nl
- << "::CORBA::Boolean "
- << "_tao_unmarshal_state (TAO_InputCDR &, TAO_ChunkInfo &);"
- << be_nl
- << "virtual void "
- << "truncation_hook (void);"
- << be_uidt_nl << be_nl;
-
- *os << "private:" << be_idt;
-
- this->gen_pd (node);
- }
-
- *os << be_nl
- << "CORBA::Boolean require_truncation_;" << be_uidt_nl
- << "};";
-
- os->gen_endif ();
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_obv_ch::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_valuetype_obv_ch::visit_field (be_field *node)
-{
- be_valuetype *vt = be_valuetype::narrow_from_scope (node->defined_in ());
-
- if (!vt)
- {
- return -1;
- }
-
- // Only in OBV_ class, if we are not optimizing accessors (and modifiers).
- if (!vt->opt_accessor ())
- {
- be_visitor_context ctx (*this->ctx_);
- be_visitor_valuetype_field_ch visitor (&ctx);
-
- visitor.setenclosings ("virtual ",";");
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_obv_ch::"
- "visit_field - codegen failed\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-void
-be_visitor_valuetype_obv_ch::begin_public (void)
-{
- AST_Decl::NodeType nt = this->ctx_->node ()->node_type ();
-
- // These types are skipped in the OBV class.
- if (nt == AST_Decl::NT_attr || nt == AST_Decl::NT_op)
- {
- return;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- *os << be_uidt_nl << be_nl
- << "public:" << be_idt;
-}
-
-void
-be_visitor_valuetype_obv_ch::begin_private (void)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- *os << be_uidt_nl << be_nl
- << "protected:" << be_idt;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ci.cpp
deleted file mode 100644
index 66750c54136..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ci.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_obv_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Valuetypes
-// OBV_ class implementation
-// (see C++ mapping OMG 20.17)
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>,
-// based on interface_ch.cpp from Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- valuetype_obv_ci,
- "$Id$")
-
-// ******************************************************
-// Valuetype visitor for OBV_ class implementation
-// ******************************************************
-
-be_visitor_valuetype_obv_ci::be_visitor_valuetype_obv_ci (
- be_visitor_context *ctx
- )
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_obv_ci::~be_visitor_valuetype_obv_ci (void)
-{
-}
-
-
-// OBV_ class must be in OBV_ namespace
-int
-be_visitor_valuetype_obv_ci::visit_valuetype (be_valuetype *node)
-{
- // only visit non-abstract valuetype
- if (node->is_abstract ())
- {
- return 0;
- }
-
- TAO_OutStream *os; // output stream
-
- os = this->ctx_->stream ();
- os->indent ();
-
- // OBV_ class is only a typedef if we are optimizing accessors
- if (node->opt_accessor ())
- {
- }
- else
- {
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_obv_cs::"
- "visit_valuetype - "
- "visit_scope failed\n"
- ), -1);
- }
- } // if !opt_accessor ()
-
- return 0;
-}
-
-int
-be_visitor_valuetype_obv_ci::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_valuetype_obv_ci::visit_field (be_field *node)
-{
- be_visitor_context new_ctx (*this->ctx_);
- be_visitor_valuetype_field_ci visitor (&new_ctx);
-
- visitor.in_obv_space_ = 1;
-
- if (visitor.visit_field (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_obv_ci::"
- "visit_field - "
- "visit_field failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp
deleted file mode 100644
index b5123ed6be4..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp
+++ /dev/null
@@ -1,257 +0,0 @@
-
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_obv_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Valuetypes
-// OBV_ class implementation
-// (see C++ mapping OMG 20.17)
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>,
-// derived from interface_ch.cpp from Aniruddha Gokhale
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- valuetype_obv_cs,
- "$Id$")
-
-// ******************************************************
-// Valuetype visitor for OBV_ class implementation
-// ******************************************************
-
-be_visitor_valuetype_obv_cs::be_visitor_valuetype_obv_cs (
- be_visitor_context *ctx
- )
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_obv_cs::~be_visitor_valuetype_obv_cs (void)
-{
-}
-
-
-// OBV_ class must be in OBV_ namespace
-int
-be_visitor_valuetype_obv_cs::visit_valuetype (be_valuetype *node)
-{
- // only visit non-abstract non-imported valuetype
- if (node->is_abstract () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Default constructor.
- *os << node->full_obv_skel_name () << "::";
-
- if (! node->is_nested ())
- {
- *os << "OBV_";
- }
-
- *os << node->local_name () << " (void)" << be_nl;
- *os << ": require_truncation_ (false)" << be_nl
- << "{}" << be_nl << be_nl;
-
- // Initializing constructor.
- if (node->has_member ())
- {
- *os << node->full_obv_skel_name () << "::";
-
- if (! node->is_nested ())
- {
- *os << "OBV_";
- }
-
- *os << node->local_name () << " (" << be_idt << be_idt;
-
- unsigned long index = 0;
- this->gen_obv_init_constructor_args (node, index);
-
- *os << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ": require_truncation_ (false)" << be_nl
- << "{" << be_idt;
-
- this->gen_obv_init_constructor_inits (node);
-
- *os << be_uidt_nl
- << "}" << be_nl << be_nl;
- }
-
- // Destructor.
- *os << node->full_obv_skel_name () << "::~";
-
- if (! node->is_nested ())
- {
- *os << "OBV_";
- }
-
- *os << node->local_name () << " (void)" << be_nl
- << "{}";
-
-
- // OBV_ class has no accessors or modifiers if we are optimizing
- // or the valuetype is abstract.
- if (!node->opt_accessor ())
- {
- *os << be_nl << be_nl << "::CORBA::Boolean" << be_nl
- << node->full_obv_skel_name ()
- << "::_tao_marshal__" << node->flat_name ()
- << " (TAO_OutputCDR &strm, TAO_ChunkInfo& ci) const" << be_nl
- << "{" << be_idt_nl
- << "return _tao_marshal_state (strm, ci);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- *os << "::CORBA::Boolean" << be_nl
- << node->full_obv_skel_name ()
- << "::_tao_unmarshal__" << node->flat_name ()
- << " (TAO_InputCDR &strm, TAO_ChunkInfo& ci)" << be_nl
- << "{" << be_idt_nl
- << "return _tao_unmarshal_state (strm, ci);" << be_uidt_nl
- << "}";
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_obv_cs::"
- "visit_valuetype - "
- "visit_scope failed\n"),
- -1);
- }
-
- // If we inherit from CORBA::Object and/or CORBA::AbstractBase
- // (in addition to CORBA::ValueBase) we have to add these
- // to avoid ambiguity.
- if (node->n_supports () > 0)
- {
- *os << be_nl << be_nl << "void" << be_nl
- << node->full_obv_skel_name ()
- << "::_add_ref (void)" << be_nl
- << "{" << be_idt_nl
- << "this->::CORBA::DefaultValueRefCountBase::_add_ref ();"
- << be_uidt_nl
- << "}" << be_nl;
-
- *os << be_nl << "void" << be_nl
- << node->full_obv_skel_name ()
- << "::_remove_ref (void)" << be_nl
- << "{" << be_idt_nl
- << "this->::CORBA::DefaultValueRefCountBase::_remove_ref ();"
- << be_uidt_nl
- << "}";
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_obv_cs::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-int
-be_visitor_valuetype_obv_cs::visit_field (be_field *node)
-{
- be_visitor_context ctx = (*this->ctx_);
- be_visitor_valuetype_field_cs visitor (&ctx);
- visitor.in_obv_space_ = 1;
-
- if (visitor.visit_field (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_obv_cs::"
- "visit_field - "
- "visit_field failed\n"
- ), -1);
- }
-
- return 0;
-}
-
-void
-be_visitor_valuetype_obv_cs::gen_obv_init_base_constructor_args (
- be_valuetype *node,
- unsigned long &index
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
- AST_ValueType *parent = node->inherits_concrete ();
-
- // Generate for inherited members first.
- if (parent != 0)
- {
- be_valuetype *be_parent =
- be_valuetype::narrow_from_decl (parent);
- this->gen_obv_init_base_constructor_args (be_parent, index);
- }
-
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next())
- {
- // be_attribute doesn't inherit from be_field (unlike the
- // AST_* counterparts, so this screens attributes and operations.
- be_field *f = be_field::narrow_from_decl (si.item ());
-
- if (f == 0)
- {
- continue;
- }
-
- *os << (index++ != 0 ? "," : "") << be_nl
- << "_tao_init_" << f->local_name ();
- }
-}
-
-void
-be_visitor_valuetype_obv_cs::gen_obv_init_constructor_inits (
- be_valuetype *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
- AST_ValueType *parent = node->inherits_concrete ();
-
- // Generate for inherited members first.
- if (parent != 0)
- {
- be_valuetype *be_parent = be_valuetype::narrow_from_decl (parent);
- this->gen_obv_init_constructor_inits (be_parent);
- }
-
- for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
- !si.is_done ();
- si.next())
- {
- be_field *f = be_field::narrow_from_decl (si.item ());
-
- // be_attribute doesn't inherit from be_field (unlike the
- // AST_* counterparts, so this screens attributes and operations.
- if (f == 0)
- {
- continue;
- }
-
- *os << be_nl
- << f->local_name () << " (_tao_init_" << f->local_name ()
- << ");";
- }
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_sh.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_sh.cpp
deleted file mode 100644
index c17523bf982..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_sh.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for value types in the server header
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- valuetype_sh,
- "$Id$")
-
-
-// ************************************************************
-// Valuetype visitor for server header.
-// ************************************************************
-
-be_visitor_valuetype_sh::be_visitor_valuetype_sh (be_visitor_context *ctx)
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_sh::~be_visitor_valuetype_sh (void)
-{
-}
-
-int
-be_visitor_valuetype_sh::visit_valuetype (be_valuetype *node)
-{
- if (node->srv_hdr_gen () || node->imported () || node->is_abstract ())
- {
- return 0;
- }
-
- AST_Interface *concrete = node->supports_concrete ();
-
- // We generate a skeleton class only if the valuetype supports a
- // non-abstract interface.
- if (concrete == 0)
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- os->indent ();
- ACE_CString class_name;
-
- // We shall have a POA_ prefix only if we are at the topmost level.
- if (!node->is_nested ())
- {
- // We are outermost.
- class_name += "POA_";
- class_name += node->local_name ();
- }
- else
- {
- class_name += node->local_name ();
- }
-
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Generate the skeleton class name.
- *os << "class " << class_name.c_str () << ";" << be_nl;
-
- // Generate the _ptr declaration.
- *os << "typedef " << class_name.c_str () << " *" << class_name.c_str ()
- << "_ptr;" << be_nl;
-
- // Forward class declaration.
- *os << "// Forward Classes Declaration" << be_nl;
-
- if (be_global->gen_direct_collocation ())
- {
- *os << "class " << node->direct_proxy_impl_name () << ";" << be_nl;
- }
-
- if (be_global->gen_direct_collocation ())
- {
- *os << "class " << node->strategized_proxy_broker_name ()
- << ";" << be_nl;
- }
-
- *os << be_nl;
-
- // Now generate the class definition.
- *os << "class " << be_global->skel_export_macro ()
- << " " << class_name.c_str () << be_idt_nl << ": " << be_idt;
-
- *os << "public virtual " << "POA_"
- << concrete->name () << ",";
-
- *os << be_nl << "public virtual " << "::" << node->full_name ();
-
- *os << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "protected:" << be_idt_nl
- << class_name.c_str () << " (void);" << be_uidt_nl << be_nl
- << "public:" << be_idt_nl;
-
- *os << "virtual ~" << class_name.c_str () << " (void);" << be_nl << be_uidt_nl;
-
- // No copy constructor for locality constraint interface.
- *os << "private:" << be_idt_nl
- << class_name.c_str () << " (const " << class_name.c_str ()
- << "& rhs);" << be_uidt_nl;
-
-
- *os << "};" << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_valuetype_sh::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_si.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_si.cpp
deleted file mode 100644
index 34cd0b2f248..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_si.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_si.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the server inline file
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype,
- valuetype_si,
- "$Id$")
-
-
-// ************************************************************************
-// Valuetype visitor for server inline
-// ************************************************************************
-
-be_visitor_valuetype_si::be_visitor_valuetype_si (be_visitor_context *ctx)
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_si::~be_visitor_valuetype_si (void)
-{
-}
-
-int
-be_visitor_valuetype_si::visit_valuetype (be_valuetype *)
-{
- // Nothing needed for now, but the visitor is here just in case.
- return 0;
-}
-
-int
-be_visitor_valuetype_si::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp
deleted file mode 100644
index 65c98639643..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ss.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the server skeletons file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "nr_extern.h"
-
-ACE_RCSID (be_visitor_valuetype,
- valuetype_ss,
- "$Id$")
-
-
-// ************************************************************
-// Interface visitor for server skeletons.
-// ************************************************************
-
-be_visitor_valuetype_ss::be_visitor_valuetype_ss (be_visitor_context *ctx)
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_ss::~be_visitor_valuetype_ss (void)
-{
-}
-
-int
-be_visitor_valuetype_ss::visit_valuetype (be_valuetype *node)
-{
- if (node->srv_skel_gen () || node->imported () || node->is_abstract ())
- {
- return 0;
- }
-
- AST_Interface *concrete = node->supports_concrete ();
-
- // We generate a skeleton class only if the valuetype supports a
- // non-abstract interface.
- if (concrete == 0)
- {
- return 0;
- }
-
- // Generate the normal skeleton as usual.
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- os->indent ();
-
- ACE_CString full_skel_name_holder =
- this->generate_full_skel_name (node);
-
- const char *full_skel_name = full_skel_name_holder.c_str ();
-
- ACE_CString flat_name_holder =
- this->generate_flat_name (node);
-
- *os << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- // Find if we are at the top scope or inside some module,
- // pre-compute the prefix that must be added to the local name in
- // each case.
- const char *local_name_prefix = "";
-
- if (!node->is_nested ())
- {
- local_name_prefix = "POA_";
- }
-
- ACE_CString node_local_name_holder =
- this->generate_local_name (node);
-
- const char *node_local_name = node_local_name_holder.c_str ();
-
- *os << full_skel_name << "::"
- << local_name_prefix << node_local_name
- << " (void)" << be_nl
- << "{}" << be_nl << be_nl;
-
-// @@@ (JP) I'm commenting out the copy constructor for now. The
-// declaration in the skeleton header file has been made private. These
-// valuetypes (only if a concrete interface is supported) inherit
-// from the stub-side valuetype, which has a private umimplemented
-// copy constructor. This makes it impossible to call all the base
-// class copy constructors, which some compilers require. If there
-// is no fallout from this change, this code will be removed, if
-// there is a problem, we'll have to reevaluate the approach.
-/*
- *os << full_skel_name << "::"
- << local_name_prefix << node_local_name << " ("
- << "const " << local_name_prefix << node_local_name << "& rhs)";
-
- *os << be_idt_nl
- << ": TAO_Abstract_ServantBase (rhs)," << be_nl
- << " TAO_ServantBase (rhs)," << be_idt_nl;
-
- if (concrete->is_nested ())
- {
- AST_Decl *scope = ScopeAsDecl (concrete->defined_in ());
-
- *os << "POA_" << scope->name () << "::"
- << concrete->local_name () << " (rhs)," << be_nl;
- }
- else
- {
- be_interface *bd = be_interface::narrow_from_decl (concrete);
- *os << bd->full_skel_name () << " (rhs)," << be_nl;
- }
-
- *os << "ValueBase (rhs)" << be_uidt << be_uidt_nl
- << "{}" << be_nl << be_nl;
-*/
-
- *os << full_skel_name << "::~"
- << local_name_prefix << node_local_name
- << " (void)" << be_nl
- << "{}";
-
- return 0;
-}
-
-int
-be_visitor_valuetype_ss::visit_eventtype (be_eventtype *node)
-{
- return this->visit_valuetype (node);
-}
-
-ACE_CString
-be_visitor_valuetype_ss::generate_flat_name (be_valuetype *node)
-{
- return ACE_CString (node->flat_name ());
-}
-
-ACE_CString
-be_visitor_valuetype_ss::generate_local_name (be_valuetype *node)
-{
- return ACE_CString (node->local_name ());
-}
-
-ACE_CString
-be_visitor_valuetype_ss::generate_full_skel_name (be_valuetype *node)
-{
- return ACE_CString (node->full_skel_name ());
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd.cpp
deleted file mode 100644
index 2de72859f6d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_valuetype_fwd.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Valuetype_Fwd
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-//
-// ============================================================================
-
-#include "be_valuetype.h"
-#include "be_valuetype_fwd.h"
-#include "be_eventtype.h"
-#include "be_eventtype_fwd.h"
-#include "be_extern.h"
-#include "be_helper.h"
-#include "be_module.h"
-#include "be_util.h"
-
-#include "be_visitor_valuetype_fwd.h"
-#include "be_visitor_context.h"
-#include "ace/Log_Msg.h"
-
-#include "be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp"
-#include "be_visitor_valuetype_fwd/any_op_ch.cpp"
-#include "be_visitor_valuetype_fwd/cdr_op_ch.cpp"
-
-ACE_RCSID (be,
- be_visitor_valuetype_fwd,
- "$Id$")
-
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/any_op_ch.cpp
deleted file mode 100644
index ff1c24cacc4..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/any_op_ch.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for a forward declared
-// valuetype in the client header.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype_fwd,
- any_op_ch,
- "$Id$")
-
-// ***************************************************************************
-// Generates Any operator declarations in the client header
-// ***************************************************************************
-
-be_visitor_valuetype_fwd_any_op_ch::be_visitor_valuetype_fwd_any_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_valuetype_fwd_any_op_ch::~be_visitor_valuetype_fwd_any_op_ch (void)
-{
-}
-
-int
-be_visitor_valuetype_fwd_any_op_ch::visit_valuetype_fwd (
- be_valuetype_fwd *node
- )
-{
- AST_Interface *fd = node->full_definition ();
-
- // Only a forward declared interface that is not defined in the same file
- // needs to have this generated here. The Any operators are needed by
- // portable interceptor code if the interface is a parameter of an operation.
- if (fd->is_defined () != 0)
- {
- return 0;
- }
-
- if (node->cli_hdr_any_op_gen ()
- || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- const char *macro = this->ctx_->export_macro ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- be_module *module = 0;
-
- if (node->is_nested () &&
- node->defined_in ()->scope_node_type () == AST_Decl::NT_module)
- {
- module = be_module::narrow_from_scope (node->defined_in ());
-
- if (!module)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_valuebox_any_op_ch::"
- "visit_valuebox - "
- "Error parsing nested name\n"),
- -1);
- }
-
- // Some compilers handle "any" operators in a namespace
- // corresponding to their module, others do not.
- *os << "\n\n#if defined (ACE_ANY_OPS_USE_NAMESPACE)\n";
-
- *os << be_global->core_versioning_begin () << be_nl;
- be_util::gen_nested_namespace_begin (os, module);
-
- // emit nested variation of any operators
- *os << macro << " void"
- << " operator<<= ( ::CORBA::Any &, " << node->local_name ()
- << " *); // copying" << be_nl;
- *os << macro << " void"
- << " operator<<= ( ::CORBA::Any &, " << node->local_name ()
- << " **); // non-copying" << be_nl;
- *os << macro << " ::CORBA::Boolean"
- << " operator>>= (const ::CORBA::Any &, "
- << node->local_name () << " *&);";
-
- be_util::gen_nested_namespace_end (os, module);
- *os << be_global->core_versioning_end () << be_nl;
- // emit #else
- *os << "#else\n\n";
- }
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << macro << " void"
- << " operator<<= ( ::CORBA::Any &, " << node->name ()
- << " *); // copying" << be_nl;
- *os << macro << " void"
- << " operator<<= ( ::CORBA::Any &, " << node->name ()
- << " **); // non-copying" << be_nl;
- *os << macro << " ::CORBA::Boolean"
- << " operator>>= (const ::CORBA::Any &, "
- << node->name () << " *&);";
-
- *os << be_global->core_versioning_end () << be_nl;
- if (module != 0)
- {
- *os << "\n\n#endif";
- }
-
- node->cli_hdr_any_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_valuetype_fwd_any_op_ch::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp
deleted file mode 100644
index 8c19388a325..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// $Id$
-//
-
-// ================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_fwd_cdr_op_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for forward
-// declarations of valuetypes. This uses compiled marshaling.
-//
-// = AUTHOR
-// Boris Kolpackov <bosk@ipmce.ru>
-// base on code from Torsten Kuepper
-// based on code from Aniruddha Gokhale & Carlos O'Ryan (cdr_op_ci.cpp)
-//
-// ================================================================
-
-ACE_RCSID (be_visitor_valuetype_fwd,
- cdr_op_ch,
- "$Id$")
-
-be_visitor_valuetype_fwd_cdr_op_ch::be_visitor_valuetype_fwd_cdr_op_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_valuetype_fwd_cdr_op_ch::~be_visitor_valuetype_fwd_cdr_op_ch (void)
-{
-}
-
-int
-be_visitor_valuetype_fwd_cdr_op_ch::visit_valuetype_fwd (
- be_valuetype_fwd *node
- )
-{
- AST_Interface *fd = node->full_definition ();
- be_valuetype *bfd = be_valuetype::narrow_from_decl (fd);
-
- // If this forward declared vt is defined later in the file,
- // the CDR operator declaration (along with the corresponding
- // declarations for members of the interface's scope) will be
- // generated then.
- if (fd->is_defined ())
- {
- return 0;
- }
-
- // Check if it's imported vt or CDR ops already generated.
- if (node->cli_hdr_cdr_op_gen () || node->imported ())
- {
- return 0;
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_valuetype *fvd =
- be_valuetype::narrow_from_decl (node->full_definition ());
-
- if (fvd->gen_helper_header () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_fwd_cdr_op_ch::"
- "visit_valuetype_fwd - "
- "codegen for helper functions failed\n"),
- -1);
- }
-
- // generate the CDR << and >> operator declarations (prototypes)
-
- *os << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
-
- *os << be_global->core_versioning_begin () << be_nl;
-
- *os << be_global->stub_export_macro ()
- << " ::CORBA::Boolean operator<< (TAO_OutputCDR &, const "
- << node->full_name () << " *);" << be_nl;
-
- *os << be_global->stub_export_macro ()
- << " ::CORBA::Boolean operator>> (TAO_InputCDR &, "
- << node->full_name () << " *&);" << be_nl;
-
- *os << be_global->core_versioning_end () << be_nl;
-
- node->cli_hdr_cdr_op_gen (true);
- bfd->cli_hdr_cdr_op_gen (true);
-
- return 0;
-}
-
-int
-be_visitor_valuetype_fwd_cdr_op_ch::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ci.cpp
deleted file mode 100644
index 2b1638de626..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ci.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// $Id$
-//
-
-// ================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for forward
-// declarations of valuetypes. This uses compiled marshaling.
-//
-// = AUTHOR
-// Torsten Kuepper based on code from
-// Aniruddha Gokhale & Carlos O'Ryan (cdr_op_ci.cpp)
-//
-// ================================================================
-
-ACE_RCSID (be_visitor_valuetype_fwd,
- cdr_op_ci,
- "$Id$")
-
-// ****************************************************************
-// Interface visitor for generating CDR operator declarations in the
-// client header
-// ****************************************************************
-
-be_visitor_valuetype_fwd_cdr_op_ci::be_visitor_valuetype_fwd_cdr_op_ci (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_valuetype_fwd_cdr_op_ci::~be_visitor_valuetype_fwd_cdr_op_ci (
- void
- )
-{
-}
-
-int
-be_visitor_valuetype_fwd_cdr_op_ci::visit_valuetype_fwd (
- be_valuetype_fwd *node
- )
-{
- AST_Interface *fd = node->full_definition ();
- be_valuetype *bfd = be_valuetype::narrow_from_decl (fd);
-
- // Check if it's imported vt or CDR ops already generated.
- if (node->cli_inline_cdr_op_gen () || node->imported ())
- {
- return 0;
- }
-
- // Is we are defined leater then let the real VT to generate
- // all this stuff.
- if (bfd->is_defined ())
- {
- return 0;
- }
-
- // Generate helper functions declaration.
- if (bfd->gen_helper_inline () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_cdr_op_ch::"
- "visit_valuetype - "
- "codegen for helper functions failed\n"), -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // generate the CDR << and >> operator declarations (prototypes)
-
- //@@ Boris: Can I move this to be_valuetype? (as with _var, _out, etc?)
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__
- << be_nl << be_nl;
-
- //This is just declaration so no ACE_INLINE
- *os << be_global->stub_export_macro ()
- << " ::CORBA::Boolean operator<< (TAO_OutputCDR &, const "
- << node->full_name () << " *);" << be_nl;
-
- *os << be_global->stub_export_macro ()
- << " ::CORBA::Boolean operator>> (TAO_InputCDR &, "
- << node->full_name () << " *&);";
-
- // Done with this.
- node->cli_inline_cdr_op_gen (true);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp
deleted file mode 100644
index d5c8ecd8e5c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_fwd_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for ValueTypeFwd node in the client header.
-//
-// = AUTHOR
-// Boris Kolpackov <bosk@ipmce.ru>
-// based on code from Torsten Kuepper
-// based on code from Aniruddha Gokhale (interface_fwd_ch.cpp)
-//
-// ============================================================================
-
-ACE_RCSID (be_visitor_valuetype_fwd,
- valuetype_fwd_ch,
- "$Id$")
-
-be_visitor_valuetype_fwd_ch::be_visitor_valuetype_fwd_ch (
- be_visitor_context *ctx
- )
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_valuetype_fwd_ch::~be_visitor_valuetype_fwd_ch (void)
-{
-}
-
-// Visit the valuetype_fwd node and its scope.
-int
-be_visitor_valuetype_fwd_ch::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- if (node->cli_hdr_gen () || node->imported ())
- {
- return 0;
- }
-
- AST_Interface *fd = node->full_definition ();
- be_valuetype *bfd = be_valuetype::narrow_from_decl (fd);
-
- // This will be a no-op if it has already been done for this node.
- bfd->gen_var_out_seq_decls ();
-
- // Copy the fwd helper name back to the forward declared interface node.
- node->fwd_helper_name (bfd->fwd_helper_name ());
-
- node->cli_hdr_gen (true);
- return 0;
-}
-
-int
-be_visitor_valuetype_fwd_ch::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
-