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/Makefile.am93
-rw-r--r--TAO/TAO_IDL/be/be_args.cpp124
-rw-r--r--TAO/TAO_IDL/be/be_argument.cpp53
-rw-r--r--TAO/TAO_IDL/be/be_array.cpp246
-rw-r--r--TAO/TAO_IDL/be/be_attribute.cpp51
-rw-r--r--TAO/TAO_IDL/be/be_codegen.cpp1083
-rw-r--r--TAO/TAO_IDL/be/be_constant.cpp98
-rw-r--r--TAO/TAO_IDL/be/be_decl.cpp963
-rw-r--r--TAO/TAO_IDL/be/be_enum.cpp120
-rw-r--r--TAO/TAO_IDL/be/be_enum_val.cpp57
-rw-r--r--TAO/TAO_IDL/be/be_exception.cpp146
-rw-r--r--TAO/TAO_IDL/be/be_expression.cpp84
-rw-r--r--TAO/TAO_IDL/be/be_field.cpp67
-rw-r--r--TAO/TAO_IDL/be/be_generator.cpp449
-rw-r--r--TAO/TAO_IDL/be/be_helper.cpp389
-rw-r--r--TAO/TAO_IDL/be/be_init.cpp105
-rw-r--r--TAO/TAO_IDL/be/be_interface.cpp2231
-rw-r--r--TAO/TAO_IDL/be/be_interface_fwd.cpp512
-rw-r--r--TAO/TAO_IDL/be/be_module.cpp59
-rw-r--r--TAO/TAO_IDL/be/be_native.cpp61
-rw-r--r--TAO/TAO_IDL/be/be_operation.cpp166
-rw-r--r--TAO/TAO_IDL/be/be_predefined_type.cpp333
-rw-r--r--TAO/TAO_IDL/be/be_produce.cpp255
-rw-r--r--TAO/TAO_IDL/be/be_root.cpp97
-rw-r--r--TAO/TAO_IDL/be/be_scope.cpp76
-rw-r--r--TAO/TAO_IDL/be/be_sequence.cpp359
-rw-r--r--TAO/TAO_IDL/be/be_stream_factory.cpp44
-rw-r--r--TAO/TAO_IDL/be/be_string.cpp89
-rw-r--r--TAO/TAO_IDL/be/be_structure.cpp671
-rw-r--r--TAO/TAO_IDL/be/be_sunsoft.cpp165
-rw-r--r--TAO/TAO_IDL/be/be_type.cpp389
-rw-r--r--TAO/TAO_IDL/be/be_typedef.cpp88
-rw-r--r--TAO/TAO_IDL/be/be_union.cpp1045
-rw-r--r--TAO/TAO_IDL/be/be_union_branch.cpp110
-rw-r--r--TAO/TAO_IDL/be/be_union_label.cpp27
-rw-r--r--TAO/TAO_IDL/be/be_valuetype.cpp728
-rw-r--r--TAO/TAO_IDL/be/be_valuetype_fwd.cpp529
-rw-r--r--TAO/TAO_IDL/be/be_visitor.cpp180
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument.cpp49
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/ami_arglist.cpp323
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/ami_handler_arglist.cpp321
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/ami_handler_compiled_marshal_cs.cpp698
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/ami_handler_result_arg.cpp179
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/ami_handler_upcall_cs.cpp382
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/ami_handler_vardecl_cs.cpp509
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp357
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/argument.cpp85
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/compiled_marshal_cs.cpp777
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/compiled_marshal_ss.cpp769
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/docall_cs.cpp325
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp310
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/post_docall_compiled_cs.cpp207
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/post_docall_cs.cpp165
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/post_marshal_ss.cpp236
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/post_upcall_ss.cpp354
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/pre_docall_cs.cpp445
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/pre_invoke_cs.cpp58
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/pre_upcall_ss.cpp200
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp446
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp635
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array.cpp37
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/any_op_ch.cpp64
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp118
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/array.cpp152
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp517
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp641
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp309
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp115
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp646
-rw-r--r--TAO/TAO_IDL/be/be_visitor_attribute.cpp31
-rw-r--r--TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp231
-rw-r--r--TAO/TAO_IDL/be/be_visitor_constant.cpp32
-rw-r--r--TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp76
-rw-r--r--TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp136
-rw-r--r--TAO/TAO_IDL/be/be_visitor_context.cpp514
-rw-r--r--TAO/TAO_IDL/be/be_visitor_decl.cpp80
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum.cpp35
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp63
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp104
-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_ci.cpp78
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp113
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/enum_cs.cpp70
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception.cpp40
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/any_op_ch.cpp102
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp171
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp77
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ci.cpp186
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp60
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp323
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception.cpp110
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp147
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception_ci.cpp69
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp222
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp313
-rw-r--r--TAO/TAO_IDL/be/be_visitor_factory.cpp911
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field.cpp34
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp294
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp845
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp288
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp521
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp255
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp285
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface.cpp54
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/ami_handler_ch.cpp233
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/ami_handler_cs.cpp235
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ch.cpp127
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ci.cpp166
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_ch.cpp243
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_cs.cpp347
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_ch.cpp198
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_cs.cpp250
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp82
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp154
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp77
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ci.cpp144
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp58
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/collocated_ami_handler_ch.cpp174
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_sh.cpp147
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_ss.cpp173
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface.cpp793
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp348
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp139
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp244
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp157
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp145
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp239
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp91
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp424
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_sh.cpp116
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_ss.cpp188
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp167
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp208
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp32
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ci.cpp71
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp96
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ci.cpp64
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module.cpp36
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/any_op.cpp56
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/cdr_op.cpp56
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/module.cpp816
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/module_ch.cpp80
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/module_ih.cpp56
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp83
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation.cpp68
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_arglist.cpp186
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp98
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp787
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist.cpp325
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist_ch.cpp181
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_argument_marshal.cpp172
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation.cpp154
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_ch.cpp154
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_cs.cpp810
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_result_arg.cpp177
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp486
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp221
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/argument.cpp253
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp173
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp275
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/compiled_marshal.cpp500
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_sh.cpp124
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_ss.cpp226
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp94
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation.cpp149
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_ami_ch.cpp93
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_ami_cs.cpp901
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp122
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp937
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp125
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp175
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp148
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp821
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp315
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/rettype_assign_ss.cpp195
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/rettype_docall_cs.cpp172
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/rettype_is.cpp170
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/rettype_marshal_ss.cpp219
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/rettype_post_docall_cs.cpp124
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/rettype_post_upcall_ss.cpp153
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/rettype_pre_docall_cs.cpp174
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/rettype_pre_invoke_cs.cpp59
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/rettype_return_cs.cpp195
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp305
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_ss.cpp326
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_sh.cpp124
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_ss.cpp302
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp121
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp155
-rw-r--r--TAO/TAO_IDL/be/be_visitor_rettype.cpp3032
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root.cpp37
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/any_op.cpp56
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp71
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root.cpp1101
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp59
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_ci.cpp58
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp58
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_ih.cpp59
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_is.cpp65
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp70
-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.cpp69
-rw-r--r--TAO/TAO_IDL/be/be_visitor_scope.cpp240
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence.cpp52
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp66
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp139
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp154
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp68
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp73
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp593
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/elemtype.cpp222
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ch.cpp186
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ci.cpp346
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp183
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ch.cpp154
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ci.cpp320
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_cs.cpp130
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ch.cpp144
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ci.cpp263
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_cs.cpp155
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp175
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ci.cpp339
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp208
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ch.cpp167
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ci.cpp338
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_cs.cpp146
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/sequence_base.cpp194
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp630
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp574
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp385
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure.cpp38
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/any_op_ch.cpp102
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp171
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ch.cpp76
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ci.cpp151
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp59
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/structure.cpp110
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/structure_ch.cpp117
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/structure_ci.cpp74
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp78
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode.cpp41
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp128
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp3161
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef.cpp38
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/any_op_ch.cpp278
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/any_op_cs.cpp279
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp277
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ci.cpp279
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp279
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp479
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp466
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp275
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp149
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union.cpp41
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/any_op_ch.cpp102
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp276
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp75
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp171
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp64
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp142
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp215
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/discriminant_cs.cpp88
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/union.cpp122
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp238
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp160
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp234
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch.cpp38
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp295
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ci.cpp813
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp285
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp424
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp439
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp497
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp708
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp1016
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/public_cs.cpp261
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp434
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype.cpp50
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp220
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ch.cpp74
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ci.cpp113
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ci.cpp947
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp748
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp1050
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp50
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp200
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp145
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp840
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp419
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp133
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp210
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp176
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ci.cpp78
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp111
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype_fwd.cpp37
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ci.cpp74
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ch.cpp100
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ci.cpp85
298 files changed, 0 insertions, 80812 deletions
diff --git a/TAO/TAO_IDL/be/Makefile.am b/TAO/TAO_IDL/be/Makefile.am
deleted file mode 100644
index 0ef64553405..00000000000
--- a/TAO/TAO_IDL/be/Makefile.am
+++ /dev/null
@@ -1,93 +0,0 @@
-##----------------------------------------------------------------------------
-## $Id$
-##
-## Makefile.am for the TAO IDL compiler --- 'be' sub-directory
-##----------------------------------------------------------------------------
-
-##
-## Process this file with automake to create Makefile.in
-##
-
-## The number in AUTOMAKE_OPTIONS is the minimum required version automake
-## needed to process this file.
-AUTOMAKE_OPTIONS = 1.4
-
-INCLUDES = -I$(top_builddir) -I$(top_srcdir) \
- -I$(top_srcdir)/TAO_IDL/include \
- -I$(top_srcdir)/TAO_IDL/be_include
-
-noinst_LIBRARIES = libbe.a
-
-libbe_a_SOURCES = \
- be_args.cpp \
- be_argument.cpp \
- be_array.cpp \
- be_attribute.cpp \
- be_codegen.cpp \
- be_constant.cpp \
- be_decl.cpp \
- be_enum.cpp \
- be_enum_val.cpp \
- be_exception.cpp \
- be_expression.cpp \
- be_field.cpp \
- be_generator.cpp \
- be_helper.cpp \
- be_init.cpp \
- be_interface.cpp \
- be_interface_fwd.cpp \
- be_module.cpp \
- be_native.cpp \
- be_operation.cpp \
- be_operation_ami.cpp \
- be_predefined_type.cpp \
- be_produce.cpp \
- be_root.cpp \
- be_scope.cpp \
- be_sequence.cpp \
- be_stream_factory.cpp \
- be_string.cpp \
- be_structure.cpp \
- be_sunsoft.cpp \
- be_type.cpp \
- be_typedef.cpp \
- be_union.cpp \
- be_union_branch.cpp \
- be_union_label.cpp \
- be_visitor.cpp \
- be_visitor_argument.cpp \
- be_visitor_array.cpp \
- be_visitor_attribute.cpp \
- be_visitor_constant.cpp \
- be_visitor_context.cpp \
- be_visitor_decl.cpp \
- be_visitor_enum.cpp \
- be_visitor_exception.cpp \
- be_visitor_factory.cpp \
- be_visitor_field.cpp \
- be_visitor_interface.cpp \
- be_visitor_interface_fwd.cpp \
- be_visitor_module.cpp \
- be_visitor_operation.cpp \
- be_visitor_operation_ami.cpp \
- be_visitor_root.cpp \
- be_visitor_scope.cpp \
- be_visitor_sequence.cpp \
- be_visitor_structure.cpp \
- be_visitor_typecode.cpp \
- be_visitor_typedef.cpp \
- be_visitor_union.cpp \
- be_visitor_union_branch.cpp
-
-dist-hook:
- list=`find * -name CVS -prune -o -type d -print`; for p in $$list; do \
- $(mkinstalldirs) $(distdir)/$$p; \
- cp $$p/*.cpp $(distdir)/$$p; \
- done
-
-## Clean up some additional files/directories possibly created during
-## the configure script tests.
-clean-local:
- -rm -f *.bak *.rpo *.sym lib*.*_pure_* Makefile.old core
- -rm -rf ptrepository Templates.DB gcctemp.c gcctemp so_locations
-
diff --git a/TAO/TAO_IDL/be/be_args.cpp b/TAO/TAO_IDL/be/be_args.cpp
deleted file mode 100644
index 67bcd83d2b9..00000000000
--- a/TAO/TAO_IDL/be/be_args.cpp
+++ /dev/null
@@ -1,124 +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.
-
- */
-
-// be_args.cc - Collect command line arguments for the BE
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_args, "$Id$")
-
-/*
- * Prepare an argument for a BE
- *
- * Since this is the dummy BE, it doesn't do anything with the passed string
- */
-void
-BE_prep_arg(char *s, idl_bool)
-{
- const char arg_macro[]="export_macro=";
- const char arg_include[]="export_include=";
- const char arg_pch_include[]="pch_include=";
-#ifdef IDL_HAS_VALUETYPE
- const char obv_opt_accessor[]="obv_opt_accessor";
-#endif /* IDL_HAS_VALUETYPE */
-
- 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;
- idl_global->export_macro (val);
- }
- else if (ACE_OS::strstr (arg, arg_include) == arg)
- {
- char* val = arg + sizeof (arg_include) - 1;
- idl_global->export_include (val);
- }
- else if (ACE_OS::strstr (arg, arg_pch_include) == arg)
- {
- char* val = arg + sizeof (arg_pch_include) - 1;
- idl_global->pch_include (val);
- }
-# ifdef IDL_HAS_VALUETYPE
- else if (ACE_OS::strstr (arg, obv_opt_accessor) == arg)
- {
- idl_global->obv_opt_accessor (1);
- }
-# endif /* IDL_HAS_VALUETYPE */
- else
- {
- cerr << idl_global->prog_name ()
- << ": invalid or unknown argument <"
- << arg
- << "> to back end\n";
- }
- }
-}
diff --git a/TAO/TAO_IDL/be/be_argument.cpp b/TAO/TAO_IDL/be/be_argument.cpp
deleted file mode 100644
index f6ae7a8f713..00000000000
--- a/TAO/TAO_IDL/be/be_argument.cpp
+++ /dev/null
@@ -1,53 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_argument, "$Id$")
-
-/*
- * BE_Argument
- */
-
-be_argument::be_argument (void)
-{
-}
-
-be_argument::be_argument (AST_Argument::Direction d, AST_Type *ft,
- UTL_ScopedName *n, UTL_StrList *p)
- : AST_Argument (d, ft, n, p),
- AST_Field (AST_Decl::NT_argument, ft, n, p),
- AST_Decl (AST_Decl::NT_argument, n, p)
-{
-}
-
-
-int
-be_argument::accept (be_visitor *visitor)
-{
- return visitor->visit_argument (this);
-}
-
-// 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 dac2ad3fc56..00000000000
--- a/TAO/TAO_IDL/be/be_array.cpp
+++ /dev/null
@@ -1,246 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_array, "$Id$")
-
-/*
- * BE_Array
- */
-be_array::be_array (void)
- : tao_name_ (0)
-{
-}
-
-be_array::be_array (UTL_ScopedName *n, unsigned long ndims, UTL_ExprList *dims)
- : AST_Array (n, ndims, dims),
- AST_Decl (AST_Decl::NT_array, n, NULL),
- tao_name_ (0)
-{
-}
-
-be_array::~be_array (void)
-{
- if (this->tao_name_ == 0)
- delete[] tao_name_;
-}
-
-// create a name for ourselves
-const char*
-be_array::tao_name (void)
-{
- if (this->tao_name_ != 0)
- return this->tao_name_;
-
- be_type *bt = be_type::narrow_from_decl (this->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_array::"
- "tao_name - "
- "bad base type\n"),
- 0);
- }
-
- const char prefix[] = "_tc_tao_array_";
-
- int l = (ACE_OS::strlen (bt->local_name ()->get_string ())
- + ACE_OS::strlen (this->local_name ()->get_string ()) + 1
- + sizeof (prefix)
- + 5 * this->n_dims ());
-
- ACE_NEW_RETURN (this->tao_name_, char[l], 0);
-
- ACE_OS::sprintf (this->tao_name_, "%s%s_%s",
- prefix, this->local_name ()->get_string (),
- bt->local_name ()->get_string());
-
- for (unsigned int i = 0; i < this->n_dims (); ++i)
- {
- AST_Expression *expr = this->dims ()[i]; // retrieve the ith
-
- // dimension value
- if ((expr == NULL) || ((expr != NULL) && (expr->ev () == NULL)))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_array::"
- "tao_name - "
- "bad array dimension\n"),
- 0);
- }
-
- if (expr->ev ()->et != AST_Expression::EV_ulong)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_array::"
- "tao_name - "
- "bad dimension value\n"),
- 0);
- }
-
- char buf[16];
- ACE_OS::sprintf (buf, "_%04.4x", ((int)expr->ev ()->u.ulval));
- ACE_OS::strcat (this->tao_name_, buf);
- }
- return this->tao_name_;
-}
-
-int
-be_array::create_name (void)
-{
- char namebuf [NAMEBUFSIZE];
- unsigned long i;
- UTL_ScopedName *n = NULL;
- be_decl *scope; // scope in which we are defined
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); // reset the buffer
- // 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]; // retrieve the ith
-
- // dimension value
- if ((expr == NULL) || ((expr != NULL) && (expr->ev () == NULL)))
- {
- 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 () ;
-
- // add our local name as the last component
- n->nconc (new UTL_ScopedName (new Identifier (ACE_OS::strdup
- (namebuf), 1,
- 0, I_FALSE),
- NULL));
- // set the fully scoped name
- this->set_name (n);
- }
- else
- {
- // We better be not here because we must be inside some scope,
- // atleast the ROOT scope.
- return -1;
- }
- return 0;
-}
-
-// Code generation
-
-int
-be_array::gen_dimensions (TAO_OutStream *os, unsigned short slice)
-{
- unsigned long i; // loop index
-
- // print our dimensions
- for (i = (slice?1:0); i < this->n_dims (); i++)
- {
- AST_Expression *expr = this->dims ()[i]; // retrieve the ith
-
- // dimension value
- if ((expr == NULL) || ((expr != NULL) && (expr->ev () == NULL)))
- {
- 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;
-}
-
-// compute the size type of the node in question
-int
-be_array::compute_size_type (void)
-{
- be_type *type = be_type::narrow_from_decl (this->base_type ());
- if (!type)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_array::compute_size_type - "
- "bad base type\n"), -1);
- }
-
- // our size type is the same as our type
- this->size_type (type->size_type ());
- return 0;
-}
-
-int
-be_array::accept (be_visitor *visitor)
-{
- return visitor->visit_array (this);
-}
-
-// 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 28c377c9797..00000000000
--- a/TAO/TAO_IDL/be/be_attribute.cpp
+++ /dev/null
@@ -1,51 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_attribute, "$Id$")
-
-/*
- * BE_Attribute
- */
-be_attribute::be_attribute (void)
-{
-}
-
-be_attribute::be_attribute (idl_bool ro, AST_Type *ft, UTL_ScopedName *n,
- UTL_StrList *p)
- : AST_Attribute (ro, ft, n, p),
- AST_Field (AST_Decl::NT_attr, ft, n, p),
- AST_Decl (AST_Decl::NT_attr, n, p)
-{
-}
-
-int
-be_attribute::accept (be_visitor *visitor)
-{
- return visitor->visit_attribute (this);
-}
-
-// 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 0d943c59d16..00000000000
--- a/TAO/TAO_IDL/be/be_codegen.cpp
+++ /dev/null
@@ -1,1083 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_codegen.cpp
-//
-// = DESCRIPTION
-// Code generation
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_codegen, "$Id$")
-
-TAO_CodeGen *tao_cg = 0;
-
-/* BE global Data */
-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),
- gperf_input_stream_ (0),
- gperf_input_filename_ (0),
- curr_os_ (0),
- visitor_factory_ (0),
- strategy_ (TAO_PERFECT_HASH)
-{
-}
-
-// destructor
-TAO_CodeGen::~TAO_CodeGen (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_;
- this->curr_os_ = 0;
- // delete this->visitor_factory_;
-}
-
-// visitor factory method
-be_visitor *
-TAO_CodeGen::make_visitor (be_visitor_context *ctx)
-{
-
- if (!this->visitor_factory_)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "TAO_CodeGen::make_visitor - "
- "No Visitor Factory\n\n"),
- 0);
- }
-
- return this->visitor_factory_->make_visitor (ctx);
-}
-
-// change the string to all upcase
-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 upcase
- for (unsigned int i=0; i < ACE_OS::strlen (str); i++)
- {
- if (isalpha (str [i]))
- {
- upcase_str[i] = 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)
-{
- // @@ 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 ();
-
- // retrieve a specialized instance
- 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;
- else
- {
- // now generate the #if !defined clause
- static char macro_name [NAMEBUFSIZE];
-
- ACE_OS::memset (macro_name, '\0', NAMEBUFSIZE);
- 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;
- }
-
- ACE_OS::sprintf (macro_name, "_TAO_IDL_");
- // convert letters in fname to upcase
- for (int i=0; i < (suffix - fname); i++)
- {
- if (isalpha (fname [i]))
- macro_name[i+9] = toupper (fname [i]);
- else if (isdigit (fname [i]))
- macro_name[i+9] = fname[i];
- else
- macro_name[i+9] = '_';
- }
-
- ACE_OS::strcat (macro_name, "_H_");
-
- // generate the #ifndef ... #define statements
- this->client_header_->print ("#ifndef %s\n", macro_name);
- this->client_header_->print ("#define %s\n\n", macro_name);
-
- // Including standard files
-
- // 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)
- *this->client_header_ << "#include ";
-
- if (idl_global->changing_standard_include_files () == 1)
- *this->client_header_ << "\"";
- else
- *this->client_header_ << "<";
-
- *this->client_header_ << "tao/corba.h";
-
- if (idl_global->changing_standard_include_files () == 1)
- *this->client_header_ << "\"\n";
- else
- *this->client_header_ << ">\n";
-
- // Some compilers don't optimize the #ifndef header include
- // protection, but do optimize based on #pragma once.
- *this->client_header_ << "\n#if !defined (ACE_LACKS_PRAGMA_ONCE)\n"
- << "# pragma once\n"
- << "#endif /* ACE_LACKS_PRAGMA_ONCE */\n\n";
-
- // Other include files.
-
- if (idl_global->export_include () != 0)
- {
- *this->client_header_ << "#include \""
- << idl_global->export_include ()
- << "\"\n";
- }
-
- // Include the Messaging files if AMI is enabled.
- if (idl_global->ami_call_back () == I_TRUE)
- {
- // Include Messaging skeleton file.
- *this->client_header_ << "#include ";
-
- if (idl_global->changing_standard_include_files () == 1)
- *this->client_header_ << "\"";
- else
- *this->client_header_ << "<";
-
- *this->client_header_ << "tao/MessagingS.h";
-
- if (idl_global->changing_standard_include_files () == 1)
- *this->client_header_ << "\"\n";
- else
- *this->client_header_ << ">\n";
-
- // Including Asynch Invocation file.
- *this->client_header_ << "#include ";
-
- if (idl_global->changing_standard_include_files () == 1)
- *this->client_header_ << "\"";
- else
- *this->client_header_ << "<";
-
- *this->client_header_ << "tao/Asynch_Invocation.h";
-
- if (idl_global->changing_standard_include_files () == 1)
- *this->client_header_ << "\"\n";
- else
- *this->client_header_ << ">\n";
- }
-
- // 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];
-
- // 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 =
- IDL_GlobalData::be_get_client_hdr (&idl_name_str, 1);
-
- // Sanity check and then print.
- if (client_hdr != 0)
- {
- this->client_header_->print ("#include \"%s\"\n",
- client_hdr);
- }
- else
- {
- ACE_ERROR ((LM_WARNING,
- "WARNING, invalid file '%s' included\n",
- idl_name));
- }
- }
- *this->client_header_ << "\n";
-
- // generate the TAO_EXPORT_MACRO macro
- *this->client_header_ << "#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 "
- << idl_global->export_macro ()
- << be_nl;
-
- // Generate export macro for nested classes
- *this->client_header_
- << "#if defined (TAO_EXPORT_NESTED_CLASSES)\n"
- << "# if defined (TAO_EXPORT_NESTED_MACRO)\n"
- << "# undef TAO_EXPORT_NESTED_MACRO\n"
- << "# endif /* defined (TAO_EXPORT_NESTED_MACRO) */\n"
- << "# define TAO_EXPORT_NESTED_MACRO "
- << idl_global->export_macro ()
- << be_nl
- << "#endif /* TAO_EXPORT_NESTED_CLASSES */\n";
-
- *this->client_header_ << "#if defined(_MSC_VER)\n"
- << "#pragma warning(disable:4250)\n"
- << "#endif /* _MSC_VER */\n\n";
-
- 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 ();
-
- // retrieve a specialized instance
- 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;
- }
-
- // generate the include statement for the precompiled header file.
- if (idl_global->pch_include ())
- *this->client_stubs_ << "#include \""
- << idl_global->pch_include () << "\"\n\n";
-
- // 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_ << "#include \"" <<
- idl_global->be_get_client_hdr_fname (1) << "\"\n\n";
-
-#if 0 // Nanbor's collocation change
- *this->client_stubs_ << "#include \"" <<
- idl_global->be_get_server_hdr_fname (1) << "\"\n\n";
-#endif /* Nanbor */
-
- // generate the code that includes the inline file if not included in the
- // header file
- *this->client_stubs_ << "#if !defined (__ACE_INLINE__)\n";
- *this->client_stubs_ << "#include \"" <<
- idl_global->be_get_client_inline_fname (1) << "\"\n";
- *this->client_stubs_ << "#endif /* !defined INLINE */\n\n";
-
- 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 ();
-
- // retrieve a specialized instance
- this->client_inline_ = factory->make_outstream ();
- if (!this->client_inline_)
- {
- return -1;
- }
-
- return this->client_inline_->open (fname, TAO_OutStream::TAO_CLI_INL);
-}
-
-// 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)
-{
- // @@ 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 ();
-
- // retrieve a specialized instance
- 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;
- else
- {
- // now generate the #if !defined clause
- static char macro_name [NAMEBUFSIZE];
-
- ACE_OS::memset (macro_name, '\0', NAMEBUFSIZE);
- 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;
- }
-
- ACE_OS::sprintf (macro_name, "_TAO_IDL_");
- // convert letters in fname to upcase
- for (int i=0; i < (suffix - fname); i++)
- if (isalpha (fname [i]))
- macro_name[i+9] = toupper (fname [i]);
- else if (isdigit (fname [i]))
- macro_name[i+9] = fname[i];
- else
- macro_name[i+9] = '_';
-
- ACE_OS::strcat (macro_name, "_H_");
-
- this->server_header_->print ("#ifndef %s\n", macro_name);
- this->server_header_->print ("#define %s\n\n", macro_name);
-
- // 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 =
- IDL_GlobalData::be_get_server_hdr (&idl_name_str, 1);
-
- this->server_header_->print ("#include \"%s\"\n",
- server_hdr);
- }
- // the server header should include the client header
- *this->server_header_ << "#include \"" <<
- idl_global->be_get_client_hdr_fname (1) << "\"\n\n";
-
- // Some compilers don't optimize the #ifndef header include
- // protection, but do optimize based on #pragma once.
- *this->server_header_ << "\n#if !defined (ACE_LACKS_PRAGMA_ONCE)\n"
- << "# pragma once\n"
- << "#endif /* ACE_LACKS_PRAGMA_ONCE */\n\n";
-
- *this->server_header_ << "#if defined(_MSC_VER)\n"
- << "#pragma warning(disable:4250)\n"
- << "#endif /* _MSC_VER */\n\n";
-
- 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 ();
-
- // retrieve a specialized instance
- 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;
- else
- {
- // now generate the #if !defined clause
- static char macro_name [NAMEBUFSIZE];
-
- ACE_OS::memset (macro_name, '\0', NAMEBUFSIZE);
- 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;
- }
- ACE_OS::sprintf (macro_name, "_TAO_IDL_");
- // convert letters in fname to upcase
- for (int i=0; i < (suffix - fname); i++)
- if (isalpha (fname [i]))
- macro_name[i+9] = toupper (fname [i]);
- else if (isdigit (fname [i]))
- macro_name[i+9] = fname[i];
- else
- macro_name[i+9] = '_';
-
- ACE_OS::strcat (macro_name, "_H_");
-
- this->server_template_header_->print ("#ifndef %s\n", macro_name);
- this->server_template_header_->print ("#define %s\n\n", macro_name);
-
- *this->server_template_header_ << "#if defined(_MSC_VER)\n"
- << "#pragma warning(disable:4250)\n"
- << "#endif /* _MSC_VER */\n\n";
-
- 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 ();
-
- // retrieve a specialized instance
- 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;
- }
-
- // generate the include statement for the precompiled header file.
- if (idl_global->pch_include ())
- *this->server_skeletons_ << "#include \""
- << idl_global->pch_include () << "\"\n\n";
-
- // generate the include statement for the server header
- *this->server_skeletons_ << "#include \"" <<
- idl_global->be_get_server_hdr_fname (1) << "\"\n\n";
-
- // generate the code that includes the inline file if not included in the
- // header file
- *this->server_skeletons_ << "#if !defined (__ACE_INLINE__)\n";
- *this->server_skeletons_ << "#include \"" <<
- idl_global->be_get_server_inline_fname (1) << "\"\n";
- *this->server_skeletons_ << "#endif /* !defined INLINE */\n\n";
-
- 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 ();
-
- // retrieve a specialized instance
- 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;
- else
- {
- // now generate the #if !defined clause
- static char macro_name [NAMEBUFSIZE];
-
- ACE_OS::memset (macro_name, '\0', NAMEBUFSIZE);
- 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;
- }
-
- ACE_OS::sprintf (macro_name, "_TAO_IDL_");
- // convert letters in fname to upcase
- for (int i=0; i < (suffix - fname); i++)
- if (isalpha (fname [i]))
- macro_name[i+9] = toupper (fname [i]);
- else if (isdigit (fname [i]))
- macro_name[i+9] = fname[i];
- else
- macro_name[i+9] = '_';
-
- ACE_OS::strcat (macro_name, "_CPP_");
-
- this->server_template_skeletons_->print ("#ifndef %s\n", macro_name);
- this->server_template_skeletons_->print ("#define %s\n\n", macro_name);
-
- *this->server_template_skeletons_ << "#if defined(_MSC_VER)\n"
- << "#pragma warning(disable:4250)\n"
- << "#endif /* _MSC_VER */\n\n";
-
- // generate the include statement for the server header
- *this->server_template_skeletons_ << "#include \"" <<
- idl_global->be_get_server_template_hdr_fname (1) << "\"\n\n";
-
- // generate the code that includes the inline file if not included in the
- // header file
- *this->server_template_skeletons_ << "#if !defined (__ACE_INLINE__)\n";
- *this->server_template_skeletons_ << "#include \"" <<
- idl_global->be_get_server_template_inline_fname (1) << "\"\n";
- *this->server_template_skeletons_ << "#endif /* !defined INLINE */\n\n";
-
- 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 ();
-
- // retrieve a specialized instance
- this->server_inline_ = factory->make_outstream ();
- if (!this->server_inline_)
- {
- return -1;
- }
-
- return this->server_inline_->open (fname, TAO_OutStream::TAO_SVR_INL);
-}
-
-// 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 ();
-
- // retrieve a specialized instance
- this->server_template_inline_ = factory->make_outstream ();
- if (!this->server_template_inline_)
- {
- return -1;
- }
-
- return this->server_template_inline_->open (fname, TAO_OutStream::TAO_SVR_INL);
-}
-
-// get the server template inline stream
-TAO_OutStream *
-TAO_CodeGen::server_template_inline (void)
-{
- return this->server_template_inline_;
-}
-
-
-// set the server header stream.
-int
-TAO_CodeGen::start_implementation_header (const char *fname)
-{
- // @@ 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 ();
-
- // retrieve a specialized instance
- 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;
- else
- {
- // now generate the #ifndef clause
- static char macro_name [NAMEBUFSIZE];
-
- ACE_OS::memset (macro_name, '\0', NAMEBUFSIZE);
- 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;
- }
-
- for (int i=0; i < (suffix - fname); i++)
- if (isalpha (fname [i]))
- macro_name[i] = toupper (fname [i]);
- else if (isdigit (fname [i]))
- macro_name[i] = fname[i];
- else
- macro_name[i] = '_';
-
- ACE_OS::strcat (macro_name, "_H_");
-
- this->implementation_header_->print ("#ifndef %s\n", macro_name);
- this->implementation_header_->print ("#define %s\n\n", macro_name);
-
- // 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];
-
- // Stringifying the name.
- UTL_String idl_name_str (idl_name);
-
- const char* implementation_hdr =
- IDL_GlobalData::be_get_implementation_hdr (&idl_name_str, 1);
-
- this->implementation_header_->print ("#include \"%s\"\n",
- implementation_hdr);
- }
-
- *this->implementation_header_
- << "#if !defined (ACE_LACKS_PRAGMA_ONCE)\n"
- << "#pragma once\n"
- << "#endif /* ACE_LACKS_PRAGMA_ONCE */\n\n";
-
- const char* server_hdr =
- IDL_GlobalData::be_get_server_hdr_fname (1);
-
- *this->implementation_header_<< "#include \""<<server_hdr<<"\"\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)
-{
- // @@ 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 ();
-
- // retrieve a specialized instance
- 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;
- else
- {
-
-
-
- static char macro_name [NAMEBUFSIZE];
-
- ACE_OS::memset (macro_name, '\0', NAMEBUFSIZE);
- 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 upcase
- for (int i=0; i < (suffix - fname); i++)
- if (isalpha (fname [i]))
- macro_name[i] = fname [i];
- else
- macro_name[i] = fname[i];
-
-
- const char* impl_hdr =
- IDL_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
-
- // insert the code to include the inline file
- *this->client_header_ << "\n#if defined (__ACE_INLINE__)\n";
- *this->client_header_ << "#include \"" <<
- idl_global->be_get_client_inline_fname (1) << "\"\n";
- *this->client_header_ << "#endif /* defined INLINE */\n\n";
-
- *this->client_header_ << "#if defined(_MSC_VER)\n"
- << "#pragma warning(default:4250)\n"
- << "#endif /* _MSC_VER */\n";
-
- // code to put the last #endif
- *this->client_header_ << "\n#endif /* ifndef */\n";
- return 0;
-}
-
-int
-TAO_CodeGen::end_server_header (void)
-{
- // insert the template header
- *this->server_header_ << "#include \"" <<
- idl_global->be_get_server_template_hdr_fname (1) << "\"\n";
-
- // insert the code to include the inline file
- *this->server_header_ << "\n#if defined (__ACE_INLINE__)\n";
- *this->server_header_ << "#include \"" <<
- idl_global->be_get_server_inline_fname (1) << "\"\n";
- *this->server_header_ << "#endif /* defined INLINE */\n\n";
-
- *this->server_header_ << "#if defined(_MSC_VER)\n"
- << "#pragma warning(default:4250)\n"
- << "#endif /* _MSC_VER */\n";
-
- // code to put the last #endif
- *this->server_header_ << "\n#endif /* ifndef */\n";
- return 0;
-}
-
-int
-TAO_CodeGen::end_implementation_header (const char *fname)
-{
- static char macro_name [NAMEBUFSIZE];
-
- ACE_OS::memset (macro_name, '\0', NAMEBUFSIZE);
- 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 upcase
- for (int i=0; i < (suffix - fname); i++)
- if (isalpha (fname [i]))
- macro_name[i] = 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_ << "\n#endif /* %s */\n";
- this->implementation_header_->print ("\n#endif /* %s */\n", macro_name);
- return 0;
-}
-
-int
-TAO_CodeGen::end_server_template_header (void)
-{
- // insert the code to include the inline file
- *this->server_template_header_ << "\n#if defined (__ACE_INLINE__)\n";
- *this->server_template_header_ << "#include \"" <<
- idl_global->be_get_server_template_inline_fname (1) << "\"\n";
- *this->server_template_header_ << "#endif /* defined INLINE */\n\n";
-
- // insert the code to include the template source file
- *this->server_template_header_
- << "\n#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)\n";
- *this->server_template_header_ << "#include \"" <<
- idl_global->be_get_server_template_skeleton_fname (1) << "\"\n";
- *this->server_template_header_ << "#endif /* defined REQUIRED SOURCE */\n\n";
-
- // insert the code to include the template pragma
- *this->server_template_header_
- << "\n#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)\n";
- *this->server_template_header_ << "#pragma implementation (\"" <<
- idl_global->be_get_server_template_skeleton_fname (1) << "\")\n";
- *this->server_template_header_ << "#endif /* defined REQUIRED PRAGMA */\n\n";
-
- *this->server_template_header_ << "#if defined(_MSC_VER)\n"
- << "#pragma warning(default:4250)\n"
- << "#endif /* _MSC_VER */\n";
-
- // code to put the last #endif
- *this->server_template_header_ << "\n#endif /* ifndef */\n";
- return 0;
-}
-
-int
-TAO_CodeGen::end_server_template_skeletons (void)
-{
- // code to put the last #endif
- *this->server_template_skeletons_ << "\n#endif /* ifndef */\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)
- // 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_ = ACE::strnew (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)
-{
- // What strategy are we interested in? Interpreted or Compiled Marshaling?
- // This is the top level distinction we make and strategize our visitor
- // factory object accordingly
- if (idl_global->compiled_marshaling ())
- this->visitor_factory_ = TAO_COMPILED_VISITOR_FACTORY::instance ();
- else
- this->visitor_factory_ = TAO_INTERPRETIVE_VISITOR_FACTORY::instance ();
-}
-
-void
-TAO_CodeGen::lookup_strategy (LOOKUP_STRATEGY s)
-{
- this->strategy_ = s;
-}
-
-TAO_CodeGen::LOOKUP_STRATEGY
-TAO_CodeGen::lookup_strategy (void) const
-{
- return this->strategy_;
-}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Singleton<TAO_CodeGen, ACE_SYNCH_RECURSIVE_MUTEX>;
-template class ACE_Singleton<TAO_OutStream_Factory, ACE_SYNCH_RECURSIVE_MUTEX>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate ACE_Singleton<TAO_CodeGen, ACE_SYNCH_RECURSIVE_MUTEX>
-#pragma instantiate ACE_Singleton<TAO_OutStream_Factory, ACE_SYNCH_RECURSIVE_MUTEX>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/TAO/TAO_IDL/be/be_constant.cpp b/TAO/TAO_IDL/be/be_constant.cpp
deleted file mode 100644
index 46987ade449..00000000000
--- a/TAO/TAO_IDL/be/be_constant.cpp
+++ /dev/null
@@ -1,98 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_constant, "$Id$")
-
-/*
- * BE_Constant
- */
-be_constant::be_constant (void)
-{
- this->size_type (be_decl::FIXED);
-}
-
-be_constant::be_constant (AST_Expression::ExprType et,
- AST_Expression *v,
- UTL_ScopedName *n,
- UTL_StrList *p)
- : AST_Constant (et, v, n, p),
- AST_Decl (AST_Decl::NT_const, n, p)
-{
- this->size_type (be_decl::FIXED);
-}
-
-const char *
-be_constant::exprtype_to_string (void)
-{
- switch (this->et ())
- {
- case AST_Expression::EV_short:
- return "CORBA::Short";
- case AST_Expression::EV_ushort:
- return "CORBA::UShort";
- case AST_Expression::EV_long:
- return "CORBA::Long";
- case AST_Expression::EV_ulong:
- return "CORBA::ULong";
- case AST_Expression::EV_float:
- return "CORBA::Float";
- case AST_Expression::EV_double:
- return "CORBA::Double";
- case AST_Expression::EV_char:
- return "CORBA::Char";
- case AST_Expression::EV_octet:
- return "CORBA::Octet";
- case AST_Expression::EV_bool:
- return "CORBA::Boolean";
- case AST_Expression::EV_string:
- return "char *const";
- case AST_Expression::EV_any:
- return "CORBA::Any";
- case AST_Expression::EV_void:
- return "void";
- case AST_Expression::EV_none:
- return "none";
- case AST_Expression::EV_longlong:
- return "CORBA::LongLong";
- case AST_Expression::EV_ulonglong:
- return "CORBA::ULongLong";
- case AST_Expression::EV_wchar:
- return "CORBA::WChar";
- case AST_Expression::EV_longdouble:
- case AST_Expression::EV_wstring:
- return NULL;
- }
- return NULL;
-}
-
-int
-be_constant::accept (be_visitor *visitor)
-{
- return visitor->visit_constant (this);
-}
-
-// 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 b510a4c5b3a..00000000000
--- a/TAO/TAO_IDL/be/be_decl.cpp
+++ /dev/null
@@ -1,963 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_decl, "$Id$")
-
-// Default Constructor
-be_decl::be_decl (void)
- : cli_hdr_gen_ (I_FALSE),
- cli_stub_gen_ (I_FALSE),
- cli_inline_gen_ (I_FALSE),
- srv_hdr_gen_ (I_FALSE),
- impl_hdr_gen_ (I_FALSE),
- srv_skel_gen_ (I_FALSE),
- impl_skel_gen_ (I_FALSE),
- srv_inline_gen_ (I_FALSE),
- cli_hdr_any_op_gen_ (I_FALSE),
- cli_stub_any_op_gen_ (I_FALSE),
- cli_hdr_cdr_op_gen_ (I_FALSE),
- cli_stub_cdr_op_gen_ (I_FALSE),
- cli_inline_cdr_op_gen_ (I_FALSE),
- fullname_ (0),
- ami_handler_fullname_ (0),
- flatname_ (0),
- ami_handler_flatname_ (0),
- repoID_ (0),
- ami_handler_repoID_ (0),
- prefix_ (0),
- size_type_ (be_decl::SIZE_UNKNOWN)
-{
-}
-
-// Constructor
-be_decl::be_decl (AST_Decl::NodeType type,
- UTL_ScopedName *n,
- UTL_StrList *pragmas)
- : AST_Decl (type, n, pragmas),
- cli_hdr_gen_ (I_FALSE),
- cli_stub_gen_ (I_FALSE),
- cli_inline_gen_ (I_FALSE),
- srv_hdr_gen_ (I_FALSE),
- impl_hdr_gen_ (I_FALSE),
- srv_skel_gen_ (I_FALSE),
- impl_skel_gen_ (I_FALSE),
- srv_inline_gen_ (I_FALSE),
- cli_hdr_any_op_gen_ (I_FALSE),
- cli_stub_any_op_gen_ (I_FALSE),
- cli_hdr_cdr_op_gen_ (I_FALSE),
- cli_stub_cdr_op_gen_ (I_FALSE),
- fullname_ (0),
- ami_handler_fullname_ (0),
- flatname_ (0),
- ami_handler_flatname_ (0),
- repoID_ (0),
- ami_handler_repoID_ (0),
- prefix_ (0),
- size_type_ (be_decl::SIZE_UNKNOWN)
-{
-}
-
-//destructor
-be_decl::~be_decl (void)
-{
- if (this->fullname_ != 0)
- {
- delete[] this->fullname_;
- this->fullname_ = 0;
- }
- if (this->ami_handler_fullname_ != 0)
- {
- delete[] this->ami_handler_fullname_;
- this->ami_handler_fullname_ = 0;
- }
- if (this->flatname_ != 0)
- {
- delete[] this->flatname_;
- this->flatname_ = 0;
- }
- if (this->ami_handler_flatname_ != 0)
- {
- delete[] this->ami_handler_flatname_;
- this->ami_handler_flatname_ = 0;
- }
- if (this->repoID_ != 0)
- {
- delete[] this->repoID_;
- this->repoID_ = 0;
- }
- if (this->ami_handler_repoID_ != 0)
- {
- delete[] this->ami_handler_repoID_;
- this->ami_handler_repoID_ = 0;
- }
- if (this->prefix_ != 0)
- {
- delete[] this->prefix_;
- this->prefix_ = 0;
- }
-}
-
-// return our size type
-be_decl::SIZE_TYPE
-be_decl::size_type (void)
-{
- if (this->size_type_ == be_decl::SIZE_UNKNOWN)
- (void) this->compute_size_type ();
- return this->size_type_;
-}
-
-// set our size type and that of all our ancestors
-void
-be_decl::size_type (be_decl::SIZE_TYPE st)
-{
- // precondition - you cannot set somebody's sizetype to unknown
- ACE_ASSERT (st != be_decl::SIZE_UNKNOWN);
-
- // st can be VARIABLE or FIXED
- if (this->size_type_ == be_decl::SIZE_UNKNOWN) // not set yet
- this->size_type_ = st; // set it
- else if ((this->size_type_ == be_decl::FIXED) &&
- (st == be_decl::VARIABLE))
- // once we are VARIABLE, we cannot be FIXED. But if we were FIXED and then
- // get overwritten to VARIABLE, it is fine. Such a situation occurs only
- // when setting the sizes of structures and unions
- this->size_type_ = st;
-}
-
-const char*
-be_decl::fullname (void)
-{
- if (!this->fullname_)
- compute_fullname ();
-
- return this->fullname_;
-}
-
-const char*
-be_decl::ami_handler_fullname (void)
-{
- if (!this->ami_handler_fullname_)
- compute_ami_handler_name (this->fullname (),
- this->ami_handler_fullname_);
-
- return this->ami_handler_fullname_;
-}
-
-
-// compute stringified fully scoped name
-void
-be_decl::compute_fullname (void)
-{
- if (fullname_)
- return;
- else
- {
- long namelen;
- UTL_IdListActiveIterator *i;
- long first = I_TRUE;
- long second = I_FALSE;
-
- // in the first loop compute the total length
- namelen = 0;
- i = new UTL_IdListActiveIterator (this->name ());
- while (!(i->is_done ()))
- {
- if (!first)
- namelen += 2; // for "::"
- else if (second)
- first = second = I_FALSE;
- // print the identifier
- namelen += ACE_OS::strlen (i->item ()->get_string ());
- if (first)
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- // does not start with a ""
- first = I_FALSE;
- else
- second = I_TRUE;
- }
- i->next ();
- }
- delete i;
-
- this->fullname_ = new char [namelen+1];
- this->fullname_[0] = '\0';
- first = I_TRUE;
- second = I_FALSE;
- i = new UTL_IdListActiveIterator (this->name ());
- while (!(i->is_done ()))
- {
- if (!first)
- ACE_OS::strcat (this->fullname_, "::");
- else if (second)
- first = second = I_FALSE;
- // print the identifier
- ACE_OS::strcat (this->fullname_, i->item ()->get_string ());
- if (first)
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- // does not start with a ""
- first = I_FALSE;
- else
- second = I_TRUE;
- }
- i->next ();
- }
- delete i;
- }
- return;
-}
-
-const char*
-be_decl::flatname (void)
-{
- if (!this->flatname_)
- this->compute_flatname ();
-
- return this->flatname_;
-}
-
-const char*
-be_decl::ami_handler_flatname (void)
-{
- if (!this->ami_handler_flatname_)
- this->compute_flatname ("AMI_","_Handler");
-
- return this->ami_handler_flatname_;
-}
-
-
-// compute stringified flattened fully scoped name
-void
-be_decl::compute_flatname (void)
-{
- if (flatname_)
- return;
- else
- {
- long namelen;
- UTL_IdListActiveIterator *i;
- long first = I_TRUE;
- long second = I_FALSE;
-
- // in the first loop compute the total length
- namelen = 0;
- i = new UTL_IdListActiveIterator (this->name ());
-
- while (!(i->is_done ()))
- {
- if (!first)
- namelen += 1; // for "_"
- else if (second)
- first = second = I_FALSE;
- // print the identifier
- namelen += ACE_OS::strlen (i->item ()->get_string ());
- if (first)
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- // does not start with a ""
- first = I_FALSE;
- else
- second = I_TRUE;
- }
- i->next ();
- }
- delete i;
-
- this->flatname_ = new char [namelen+1];
- this->flatname_[0] = '\0';
- first = I_TRUE;
- second = I_FALSE;
- i = new UTL_IdListActiveIterator (this->name ());
- while (!(i->is_done ()))
- {
- if (!first)
- ACE_OS::strcat (this->flatname_, "_");
- else if (second)
- first = second = I_FALSE;
- // print the identifier
- ACE_OS::strcat (this->flatname_, i->item ()->get_string ());
- if (first)
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- // does not start with a ""
- first = I_FALSE;
- else
- second = I_TRUE;
- }
- i->next ();
- }
- delete i;
- }
- return;
-}
-
-
-
-char *
-be_decl::compute_flatname (const char *prefix, const char *suffix)
-{
- if (prefix == 0 || suffix == 0)
- return 0;
-
- 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_RETURN ((LM_ERROR,
- "(%N:%l) be_decl::"
- "compute_flat_name - "
- "scope name is nil\n"),
- 0);
- }
-
- // Parent name.
- result_str = ACE_CString (parent->fullname ());
-
- // _
- if (ACE_OS::strcmp (parent->fullname (), "") != 0)
- result_str += ACE_CString ("_");
-
- // Prefix.
- result_str += ACE_CString ("AMI_");
-
- // Local name.
- result_str += ACE_CString (this->local_name ()->get_string ());
-
- // Suffix.
- result_str += suffix_str;
- }
-
- this->ami_handler_flatname_ = result_str.rep ();
- return this->ami_handler_flatname_;
-}
-
-const char *
-be_decl::repoID (void)
-{
- if (!this->repoID_)
- this->compute_repoID ();
-
- return this->repoID_;
-}
-
-
-const char *
-be_decl::ami_handler_repoID (void)
-{
- if (!this->ami_handler_repoID_)
- this->compute_repoID ("AMI_","_Handler");
-
- return this->ami_handler_repoID_;
-}
-
-
-// compute stringified repository ID
-void
-be_decl::compute_repoID (void)
-{
- if (repoID_)
- return;
- else
- {
- long namelen;
- UTL_IdListActiveIterator *i;
- long first = I_TRUE;
- long second = I_FALSE;
-
- // in the first loop compute the total length
- namelen = 8; // for the prefix "IDL:" and suffix ":1.0"
- namelen += ACE_OS::strlen (this->prefix ()) + 1;
- i = new UTL_IdListActiveIterator (this->name ());
- while (!(i->is_done ()))
- {
- if (!first)
- namelen += 1; // for "/"
- else if (second)
- first = second = I_FALSE;
- // print the identifier
- namelen += ACE_OS::strlen (i->item ()->get_string ());
- if (first)
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- // does not start with a ""
- first = I_FALSE;
- else
- second = I_TRUE;
- }
- i->next ();
- }
- delete i;
-
- this->repoID_ = new char [namelen+1];
- this->repoID_[0] = '\0';
- ACE_OS::sprintf (this->repoID_, "%s", "IDL:");
- ACE_OS::strcat (this->repoID_, this->prefix ());
-
- // Add the "/" only if there is a prefix
- if (ACE_OS::strcmp (this->prefix (), "") != 0)
- ACE_OS::strcat (this->repoID_, "/");
-
- i = new UTL_IdListActiveIterator (this->name ());
- first = I_TRUE;
- second = I_FALSE;
- while (!(i->is_done ()))
- {
- if (!first)
- ACE_OS::strcat (this->repoID_, "/");
- else if (second)
- first = second = I_FALSE;
- // print the identifier
- ACE_OS::strcat (this->repoID_, i->item ()->get_string ());
- if (first)
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- // does not start with a ""
- first = I_FALSE;
- else
- second = I_TRUE;
- }
- i->next ();
- }
- delete i;
- ACE_OS::strcat (this->repoID_, ":1.0");
- }
- return;
-}
-
-// Apply the prefix and suffix to the local name and compute the
-// repoID. Both the parameters should be non-null.
-char *
-be_decl::compute_repoID (const char *prefix, const char *suffix)
-{
- // Prefix and suffix should be valid.
- if (prefix == 0 || suffix == 0)
- return 0;
-
- // First prepare the result without IDL: and :1.0 strings.
-
- // repoID without IDL: and :1.0 strings.
- char *result = 0;
-
- long namelen;
- UTL_IdListActiveIterator *i;
- long first = I_TRUE;
- long second = I_FALSE;
-
- // In the first loop compute the total length.
- namelen = 8; // for the prefix "IDL:" and suffix ":1.0"
- namelen += ACE_OS::strlen (this->prefix ()) + 1;
- i = new UTL_IdListActiveIterator (this->name ());
- while (!(i->is_done ()))
- {
- if (!first)
- namelen += 1; // for "/"
- else if (second)
- first = second = I_FALSE;
- // print the identifier
- namelen += ACE_OS::strlen (i->item ()->get_string ());
- if (first)
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- // does not start with a ""
- first = I_FALSE;
- else
- second = I_TRUE;
- }
- i->next ();
- }
- delete i;
-
- // Get the result.
-
- result = new char [namelen+1];
- result[0] = '\0';
-
- // Start the result with prefix.
- ACE_OS::sprintf (result, "%s", this->prefix ());
-
- // Add the "/" only if there is a prefix
- if (ACE_OS::strcmp (this->prefix (), "") != 0)
- ACE_OS::strcat (result, "/");
-
- i = new UTL_IdListActiveIterator (this->name ());
- first = I_TRUE;
- second = I_FALSE;
- while (!(i->is_done ()))
- {
- if (!first)
- ACE_OS::strcat (result, "/");
- else if (second)
- first = second = I_FALSE;
- // print the identifier
- ACE_OS::strcat (result, i->item ()->get_string ());
- if (first)
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- // does not start with a ""
- first = I_FALSE;
- else
- second = I_TRUE;
- }
- i->next ();
- }
- delete i;
-
- // Add prefix and suffix.
-
- // Search where the last / is. If it is not there put AMI_ right
- // after IDL: and _Handler after that and then the :1.0 string.
- // Otherwise put AMI after the last / and _Handler at the end and
- // then the 1.0 string.
-
- // CStrings are cool.
-
- ACE_CString result_str (result);
-
- // Return val. Release = 0 so that we can return the <c_str>.
- ACE_CString repoID ("IDL:", 0, 0);
-
- // Useful CStrings.
- ACE_CString prefix_str (prefix);
- ACE_CString suffix_str (suffix);
- ACE_CString version_str (":1.0");
-
- // Find the last /.
- int last_name_pos = result_str.rfind ('/');
-
- if (last_name_pos == ACE_CString::npos)
- {
- // '/' not present.
-
- // Add prefix + result.
- repoID += prefix_str;
-
- repoID += result_str;
-
- // Add suffix.
- repoID += suffix_str;
- }
- else
- {
- // '/' present.
-
- // IDl:<result except the last name>'/'. Watch get the last /
- // also.
- repoID += result_str.substring (0, last_name_pos+1);
-
- // Put prefix.
- repoID += prefix_str;
-
- // Put the last name.
- repoID += result_str.substr (last_name_pos + 1);
-
- // Add suffix.
- repoID += suffix_str;
- }
-
- // Add 1.0.
- repoID += version_str;
-
- // Delete result.
- delete result;
- result = 0;
-
- this->ami_handler_repoID_ = repoID.rep ();
-
- return this->ami_handler_repoID_;
-}
-
-
-int
-be_decl::compute_ami_handler_name (const char *name,
- char *&ami_handler_name)
-{
- int name_length = ACE_OS::strlen (name);
- int ami_handler_length = ACE_OS::strlen ("AMI__HANDLER");
-
- ACE_NEW_RETURN (ami_handler_name,
- char[name_length + ami_handler_length+1],
- -1);
-
- // copy it in
- ACE_OS::strcpy (ami_handler_name, name);
-
- const char *interface_name = 0;
- int 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(&ami_handler_name[name_length-ACE_OS::strlen(interface_name)],"AMI_");
- ACE_OS::strcpy(&ami_handler_name[name_length-ACE_OS::strlen(interface_name)+4],
- interface_name);
- ACE_OS::strcpy(&ami_handler_name[name_length+4],
- "_Handler");
-
- return 0;
-}
-
-
-
-void
-be_decl::compute_prefix ()
-{
- const char* pragma = 0;
- if (this->pragmas () != 0)
- {
- for (UTL_StrlistActiveIterator i (this->pragmas ());
- !i.is_done ();
- i.next ())
- {
- const char* s = i.item ()->get_string ();
-
- if (ACE_OS::strncmp (s, "#pragma prefix", 14) == 0)
- {
- pragma = s;
- }
- }
- }
-
- if (pragma != 0)
- {
- // Skip the space and the " also...
- const char* tmp = pragma + 16;
- const char* end = ACE_OS::strchr (tmp, '"');
-
- if (end == 0)
- {
- idl_global->err ()->syntax_error
- (IDL_GlobalData::PS_PragmaPrefixSyntax);
- this->prefix_ = ACE::strnew ("");
- return;
- }
- int l = end - tmp;
- this->prefix_ = new char[l+1];
- ACE_OS::strncpy (this->prefix_, tmp, end - tmp);
- this->prefix_[l] = 0;
- return;
- }
-
- // Could not find it in the local scope, try to recurse to the top
- // scope...
- if (this->defined_in () == 0)
- this->prefix_ = ACE::strnew ("");
- else
- {
- be_scope* scope =
- be_scope::narrow_from_scope (this->defined_in ());
- if (scope == 0)
- this->prefix_ = ACE::strnew ("");
- else
- this->prefix_ = ACE::strnew (scope->decl()->prefix ());
- }
-}
-
-const char*
-be_decl::prefix (void)
-{
- if (!this->prefix_)
- compute_prefix ();
- return this->prefix_;
-}
-
-idl_bool
-be_decl::is_nested (void)
-{
- be_decl *d;
-
- d = be_scope::narrow_from_scope (this->defined_in ())->decl ();
- // if we have an outermost scope and if that scope is not that of the Root,
- // then we are defined at some nesting level
- if (d && d->node_type () != AST_Decl::NT_root)
- return I_TRUE;
-
- return I_FALSE;
-}
-
-// compute the size type of the node in question
-int
-be_decl::compute_size_type (void)
-{
- return 0;
-}
-
-// 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_sequence:
- return be_sequence::narrow_from_decl (d);
- default:
- return (be_scope *)0;
- }
-}
-
-// boolean methods to test if code was already generated
-idl_bool
-be_decl::cli_hdr_gen (void)
-{
- return this->cli_hdr_gen_;
-}
-
-idl_bool
-be_decl::cli_stub_gen (void)
-{
- return this->cli_stub_gen_;
-}
-
-idl_bool
-be_decl::cli_hdr_any_op_gen (void)
-{
- return this->cli_hdr_any_op_gen_;
-}
-
-idl_bool
-be_decl::cli_stub_any_op_gen (void)
-{
- return this->cli_stub_any_op_gen_;
-}
-
-idl_bool
-be_decl::cli_hdr_cdr_op_gen (void)
-{
- return this->cli_hdr_cdr_op_gen_;
-}
-
-idl_bool
-be_decl::cli_stub_cdr_op_gen (void)
-{
- return this->cli_stub_cdr_op_gen_;
-}
-
-idl_bool
-be_decl::cli_inline_cdr_op_gen (void)
-{
- return this->cli_inline_cdr_op_gen_;
-}
-
-idl_bool
-be_decl::cli_inline_gen (void)
-{
- return this->cli_inline_gen_;
-}
-
-idl_bool
-be_decl::srv_hdr_gen (void)
-{
- return this->srv_hdr_gen_;
-}
-
-idl_bool
-be_decl::impl_hdr_gen (void)
-{
- return this->impl_hdr_gen_;
-}
-
-idl_bool
-be_decl::srv_skel_gen (void)
-{
- return this->srv_skel_gen_;
-}
-
-idl_bool
-be_decl::impl_skel_gen (void)
-{
- return this->impl_skel_gen_;
-}
-
-idl_bool
-be_decl::srv_inline_gen (void)
-{
- return this->srv_inline_gen_;
-}
-
-// set the flag indicating that code generation is done
-void
-be_decl::cli_hdr_gen (idl_bool val)
-{
- this->cli_hdr_gen_ = val;
-}
-
-void
-be_decl::cli_stub_gen (idl_bool val)
-{
- this->cli_stub_gen_ = val;
-}
-
-void
-be_decl::cli_hdr_any_op_gen (idl_bool val)
-{
- this->cli_hdr_any_op_gen_ = val;
-}
-
-void
-be_decl::cli_stub_any_op_gen (idl_bool val)
-{
- this->cli_stub_any_op_gen_ = val;
-}
-
-void
-be_decl::cli_hdr_cdr_op_gen (idl_bool val)
-{
- this->cli_hdr_cdr_op_gen_ = val;
-}
-
-void
-be_decl::cli_stub_cdr_op_gen (idl_bool val)
-{
- this->cli_stub_cdr_op_gen_ = val;
-}
-
-void
-be_decl::cli_inline_cdr_op_gen (idl_bool val)
-{
- this->cli_inline_cdr_op_gen_ = val;
-}
-
-void
-be_decl::cli_inline_gen (idl_bool val)
-{
- this->cli_inline_gen_ = val;
-}
-
-void
-be_decl::srv_hdr_gen (idl_bool val)
-{
- this->srv_hdr_gen_ = val;
-}
-
-void
-be_decl::impl_hdr_gen (idl_bool val)
-{
- this->impl_hdr_gen_ = val;
-}
-
-
-void
-be_decl::srv_skel_gen (idl_bool val)
-{
- this->srv_skel_gen_ = val;
-}
-
-void
-be_decl::srv_inline_gen (idl_bool val)
-{
- this->srv_inline_gen_ = val;
-}
-
-int
-be_decl::accept (be_visitor *visitor)
-{
- return visitor->visit_decl (this);
-}
-
-idl_bool
-be_decl::is_child (be_decl *node)
-{
- if (this->defined_in ())
- {
- be_decl *bd;
-
- bd = be_scope::narrow_from_scope (this->defined_in ())->decl ();
- if (!bd)
- return 0;
-
- if (!ACE_OS::strcmp (bd->fullname (), node->fullname ()))
- return 1; // true
- }
- return 0; // not a child
-}
-
-// 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 b5de42eebde..00000000000
--- a/TAO/TAO_IDL/be/be_enum.cpp
+++ /dev/null
@@ -1,120 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_enum, "$Id$")
-
-/*
- * BE_Enum
- */
-be_enum::be_enum (void)
-{
- this->size_type (be_decl::FIXED);
-}
-
-be_enum::be_enum (UTL_ScopedName *n, UTL_StrList *p)
- : AST_Enum (n, p),
- AST_Decl (AST_Decl::NT_enum, n, p),
- UTL_Scope (AST_Decl::NT_enum),
- member_count_ (-1)
-{
- this->size_type (be_decl::FIXED);
-}
-
-// compute total number of members
-int
-be_enum::compute_member_count (void)
-{
- UTL_ScopeActiveIterator *si; // iterator
- AST_Decl *d; // temp node
-
- this->member_count_ = 0;
-
- // if there are elements in this scope
- if (this->nmembers () > 0)
- {
- // instantiate a scope iterator.
- si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls);
-
- while (!(si->is_done ()))
- {
- // get the next AST decl node
- d = si->item ();
- if (!d->imported ())
- {
- this->member_count_++;
- }
- si->next ();
- } // end of while
- delete si; // free the iterator object
- }
- return 0;
-}
-
-// return the member count
-int
-be_enum::member_count (void)
-{
- if (this->member_count_ == -1)
- this->compute_member_count ();
-
- return this->member_count_;
-}
-
-// Convert a numeric value to the string name
-UTL_ScopedName *
-be_enum::value_to_name (const unsigned long v)
-{
- UTL_ScopeActiveIterator *iter;
- AST_EnumVal *item;
- AST_Decl *i;
-
- iter = new UTL_ScopeActiveIterator (this,
- IK_decls);
-
- while (!iter->is_done ())
- {
- i = iter->item ();
- item = AST_EnumVal::narrow_from_decl (i);
- if (item->constant_value ()->ev ()->u.ulval == v)
- {
- delete iter;
- return item->name ();
- }
- iter->next ();
- }
- delete iter;
- return NULL;
-}
-
-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 83404d97343..00000000000
--- a/TAO/TAO_IDL/be/be_enum_val.cpp
+++ /dev/null
@@ -1,57 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_enum_val, "$Id$")
-
-be_enum_val::be_enum_val (void)
-{
-}
-
-be_enum_val::be_enum_val (unsigned long v, UTL_ScopedName *n, UTL_StrList *p)
- : AST_Constant (AST_Expression::EV_ulong,
- AST_Decl::NT_enum_val,
- new AST_Expression(v),
- n,
- p),
- AST_Decl (AST_Decl::NT_enum_val, n, p)
-{
-}
-
-int
-be_enum_val::accept (be_visitor *visitor)
-{
- return visitor->visit_enum_val (this);
-}
-
-int
-be_enum_val::compute_size_type (void)
-{
- this->size_type_ = be_decl::FIXED;
- return 0;
-}
-
-// 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_exception.cpp b/TAO/TAO_IDL/be/be_exception.cpp
deleted file mode 100644
index d39abd6b4e4..00000000000
--- a/TAO/TAO_IDL/be/be_exception.cpp
+++ /dev/null
@@ -1,146 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_exception, "$Id$")
-
-/*
- * BE_Exception
- */
-be_exception::be_exception (void)
-{
- this->size_type (be_decl::VARIABLE); // always the case
-}
-
-be_exception::be_exception (UTL_ScopedName *n, UTL_StrList *p)
- : AST_Decl (AST_Decl::NT_except, n, p),
- AST_Structure (AST_Decl::NT_except, n, p),
- UTL_Scope (AST_Decl::NT_except),
- member_count_ (-1)
-{
- this->size_type (be_decl::VARIABLE); // always the case
-}
-
-// compute total number of members
-int
-be_exception::compute_member_count (void)
-{
- UTL_ScopeActiveIterator *si; // iterator
-
- this->member_count_ = 0;
-
- // if there are elements in this scope
- if (this->nmembers () > 0)
- {
- // instantiate a scope iterator.
- si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls);
-
- while (!(si->is_done ()))
- {
- // get the next AST decl node
- this->member_count_++;
- si->next ();
- } // end of while
- delete si; // free the iterator object
- }
- return 0;
-}
-
-// return the member count
-int
-be_exception::member_count (void)
-{
- if (this->member_count_ == -1)
- this->compute_member_count ();
-
- return this->member_count_;
-}
-
-// Are we or the parameter node involved in any recursion
-idl_bool
-be_exception::in_recursion (be_type *node)
-{
- if (!node)
- {
- // we are determining the recursive status for ourselves
- node = this;
- }
-
- // proceed if the number of members in our scope is greater than 0
- if (this->nmembers () > 0)
- {
- // initialize an iterator to iterate thru our scope
- UTL_ScopeActiveIterator *si;
- ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (this,
- UTL_Scope::IK_decls),
- -1);
- // continue until each element is visited
- while (!si->is_done ())
- {
- be_field *field = be_field::narrow_from_decl (si->item ());
- if (!field)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_exception::")
- ASYS_TEXT ("in_recursion - ")
- ASYS_TEXT ("bad field node\n")),
- 0);
- }
- be_type *type = be_type::narrow_from_decl (field->field_type ());
- if (!type)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_exception::")
- ASYS_TEXT ("in_recursion - ")
- ASYS_TEXT ("bad field type\n")),
- 0);
- }
- if (type->in_recursion (node))
- {
- delete si;
- return 1;
- }
- si->next ();
- } // end of while loop
- delete si;
- } // end of if
-
- // not in recursion
- return 0;
-}
-
-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 6fd245c4940..00000000000
--- a/TAO/TAO_IDL/be/be_expression.cpp
+++ /dev/null
@@ -1,84 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_expression, "$Id$")
-
-/*
- * BE_Expression
- */
-
-// the constructors
-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 (long l, AST_Expression::ExprType t)
- : AST_Expression (l, t)
-{
-}
-
-be_expression::be_expression (unsigned long l)
- : AST_Expression (l)
-{
-}
-
-be_expression::be_expression (UTL_String *s)
- : AST_Expression (s)
-{
-}
-
-be_expression::be_expression (char c)
- : AST_Expression (c)
-{
-}
-
-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_field.cpp b/TAO/TAO_IDL/be/be_field.cpp
deleted file mode 100644
index 6b9a4d2e143..00000000000
--- a/TAO/TAO_IDL/be/be_field.cpp
+++ /dev/null
@@ -1,67 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_field, "$Id$")
-
-/*
- * BE_Field
- */
-be_field::be_field (void)
-{
-}
-
-be_field::be_field (AST_Type *ft, UTL_ScopedName *n, UTL_StrList *p, Visibility vis)
- : AST_Field (ft, n, p, vis),
- AST_Decl (AST_Decl::NT_field, n, p)
-{
-}
-
-// compute the size type of the node in question
-int
-be_field::compute_size_type (void)
-{
- be_type *type = be_type::narrow_from_decl (this->field_type ());
- if (!type)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_field::compute_size_type - "
- "bad field type\n"), -1);
- }
-
- // our size type is the same as our type
- this->size_type (type->size_type ()); // as a side effect will also update
- // the size type of parent
- return 0;
-}
-
-int
-be_field::accept (be_visitor *visitor)
-{
- return visitor->visit_field (this);
-}
-
-// 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 f8608757e53..00000000000
--- a/TAO/TAO_IDL/be/be_generator.cpp
+++ /dev/null
@@ -1,449 +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.
-
- */
-
-// be_generator.cc
-//
-// 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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "ace/inc_user_config.h"
-
-ACE_RCSID(be, be_generator, "$Id$")
-
-/*
- * Constructor
- */
-
-/*
- * Private operations
- */
-
-/*
- * Public operations
- */
-
-/*
- * Inherited operations redefined here
- */
-
-/*
- * Construct a be_root node (a node representing the root of an AST of BE nodes)
- */
-AST_Root *
-be_generator::create_root(UTL_ScopedName *n,
- UTL_StrList *p)
-{
- return new be_root(n, p);
-}
-
-/*
- * Create a BE_PredefinedType node
- */
-AST_PredefinedType *
-be_generator::create_predefined_type(AST_PredefinedType::PredefinedType t,
- UTL_ScopedName *n,
- UTL_StrList *p)
-{
- return (AST_PredefinedType *) new be_predefined_type(t, n, p);
-}
-
-/*
- * Create a BE_Module node
- */
-AST_Module *
-be_generator::create_module(UTL_ScopedName *n, UTL_StrList *p)
-{
- return (AST_Module *) new be_module(n, p);
-}
-
-/*
- * Create a BE_Interface node
- */
-AST_Interface *
-be_generator::create_interface(UTL_ScopedName *n,
- AST_Interface **ih,
- long nih,
- UTL_StrList *p)
-{
- return (AST_Interface *) new be_interface(n, ih, nih, p);
-}
-
-/*
- * Create a BE_InterfaceFwd node
- */
-AST_InterfaceFwd *
-be_generator::create_interface_fwd(UTL_ScopedName *n, UTL_StrList *p)
-{
- return (AST_InterfaceFwd *) new be_interface_fwd(this->create_interface (n, 0, -1, p),
- n, p);
-}
-
-/*
- * Create a be_valuetype node
- */
-AST_Interface *
-be_generator::create_valuetype(UTL_ScopedName *n,
- AST_Interface **ih,
- long nih,
- UTL_StrList *p)
-{
-#ifdef IDL_HAS_VALUETYPE
- return (AST_Interface *) new be_valuetype(n, ih, nih, p);
-#else
- ACE_ASSERT (0);
- return 0;
-#endif /* IDL_HAS_VALUETYPE */
-}
-
-/*
- * Create a be_valuetype_fwd node
- */
-AST_InterfaceFwd *
-be_generator::create_valuetype_fwd(UTL_ScopedName *n, UTL_StrList *p)
-{
-#ifdef IDL_HAS_VALUETYPE
- return (AST_InterfaceFwd *) new be_valuetype_fwd(this->create_valuetype (n, 0, -1, p),
- n, p);
-#else
- ACE_ASSERT (0);
- return 0;
-#endif /* IDL_HAS_VALUETYPE */
-}
-
-/*
- * Create a BE_Exception node
- */
-AST_Exception *
-be_generator::create_exception(UTL_ScopedName *n, UTL_StrList *p)
-{
- return (AST_Exception *) new be_exception(n, p);
-}
-
-/*
- * Create a BE_Structure node
- */
-AST_Structure *
-be_generator::create_structure(UTL_ScopedName *n, UTL_StrList *p)
-{
- return (AST_Structure *) new be_structure(n, p);
-}
-
-/*
- * Create a BE_Enum node
- */
-AST_Enum *
-be_generator::create_enum(UTL_ScopedName *n, UTL_StrList *p)
-{
- return (AST_Enum *) new be_enum(n, p);
-}
-
-/*
- * Create a BE_Operation node
- */
-AST_Operation *
-be_generator::create_operation(AST_Type *rt,
- AST_Operation::Flags fl,
- UTL_ScopedName *n,
- UTL_StrList *p)
-{
- return (AST_Operation *) new be_operation(rt, fl, n, p);
-}
-
-/*
- * Create a BE_Field node
- */
-AST_Field *
-be_generator::create_field(AST_Type *ft, UTL_ScopedName *n, UTL_StrList *p,
- AST_Field::Visibility vis)
-{
- return (AST_Field *) new be_field(ft, n, p, vis);
-}
-
-/*
- * Create a BE_Argument node
- */
-AST_Argument *
-be_generator::create_argument(AST_Argument::Direction d,
- AST_Type *ft,
- UTL_ScopedName *n,
- UTL_StrList *p)
-{
- return (AST_Argument *) new be_argument(d, ft, n, p);
-}
-
-/*
- * Create a BE_Attribute node
- */
-AST_Attribute *
-be_generator::create_attribute(idl_bool ro,
- AST_Type *ft,
- UTL_ScopedName *n,
- UTL_StrList *p)
-{
- return (AST_Attribute *) new be_attribute(ro, ft, n, p);
-}
-
-/*
- * Create a BE_Union node
- */
-AST_Union *
-be_generator::create_union(AST_ConcreteType *dt,
- UTL_ScopedName *n,
- UTL_StrList *p)
-{
- return (AST_Union *) new be_union(dt, n, p);
-}
-
-/*
- * Create a BE_UnionBranch node
- */
-AST_UnionBranch *
-be_generator::create_union_branch(UTL_LabelList *ll,
- AST_Type *ft,
- UTL_ScopedName *n,
- UTL_StrList *p)
-{
- return (AST_UnionBranch *) new be_union_branch(ll, ft, n, p);
-}
-
-/*
- * Create a BE_UnionLabel node
- */
-AST_UnionLabel *
-be_generator::create_union_label(AST_UnionLabel::UnionLabel ul,
- AST_Expression *lv)
-{
- return (AST_UnionLabel *) new be_union_label(ul, lv);
-}
-
-/*
- * Create a BE_Constant node
- */
-AST_Constant *
-be_generator::create_constant(AST_Expression::ExprType et,
- AST_Expression *ev,
- UTL_ScopedName *n,
- UTL_StrList *p)
-{
- return (AST_Constant *) new be_constant (et, ev, n, p);
-}
-
-/*
- * Create a symbolic BE_Expression node
- */
-AST_Expression *
-be_generator::create_expr(UTL_ScopedName *n)
-{
- return (AST_Expression *) new be_expression (n);
-}
-
-/*
- * Create a BE_Expression node denoting a coercion
- */
-AST_Expression *
-be_generator::create_expr(AST_Expression *b, AST_Expression::ExprType t)
-{
- return (AST_Expression *) new be_expression (b, t);
-}
-
-/*
- * Create a BE_Expression node combining two other AST_Expression nodes
- */
-AST_Expression *
-be_generator::create_expr(AST_Expression::ExprComb c,
- AST_Expression *v1,
- AST_Expression *v2)
-{
- return (AST_Expression *) new be_expression (c, v1, v2);
-}
-
-/*
- * Create a BE_Expression node denoting a long integer
- */
-AST_Expression *
-be_generator::create_expr(long l)
-{
- return (AST_Expression *) new be_expression (l);
-}
-
-/*
- * Create a BE_Expression node denoting a long integer being used as a boolean
- */
-AST_Expression *
-be_generator::create_expr(long l, AST_Expression::ExprType t)
-{
- return (AST_Expression *) new be_expression (l, t);
-}
-
-/*
- * Create a BE_Expression node denoting an unsigned long integer
- */
-AST_Expression *
-be_generator::create_expr(unsigned long l)
-{
- return (AST_Expression *) new be_expression(l);
-}
-
-/*
- * Create a BE_Expression node denoting a char * (encapsulated as a String)
- */
-AST_Expression *
-be_generator::create_expr (UTL_String *s)
-{
- return (AST_Expression *) new be_expression (s);
-}
-
-/*
- * Create a BE_Expression node denoting a character
- */
-AST_Expression *
-be_generator::create_expr(char c)
-{
- return (AST_Expression *) new be_expression (c);
-}
-
-/*
- * Create a BE_Expression node denoting a 64-bit floating point number
- */
-AST_Expression *
-be_generator::create_expr (double d)
-{
- return (AST_Expression *) new be_expression (d);
-}
-
-/*
- * Create a BE_EnumVal node
- */
-AST_EnumVal *
-be_generator::create_enum_val(unsigned long v,
- UTL_ScopedName *n,
- UTL_StrList *p)
-{
- return (AST_EnumVal *) new be_enum_val(v, n, p);
-}
-
-/*
- * Create a BE_Array node
- */
-AST_Array *
-be_generator::create_array(UTL_ScopedName *n,
- unsigned long ndims,
- UTL_ExprList *dims)
-{
- return (AST_Array *) new be_array(n, ndims, dims);
-}
-
-/*
- * Create a BE_Sequence node
- */
-AST_Sequence *
-be_generator::create_sequence(AST_Expression *v, AST_Type *bt)
-{
- return (AST_Sequence *) new be_sequence(v, bt);
-}
-
-/*
- * Create a BE_String node
- */
-AST_String *
-be_generator::create_string(AST_Expression *v)
-{
- return (AST_String *) new be_string(v);
-}
-
-/*
- * Create a BE_string node for a wide string
- */
-AST_String *
-be_generator::create_wstring(AST_Expression *v)
-{
- return (AST_String *) new be_string(v, sizeof(ACE_OS::WChar));
-}
-
-/*
- * Create a BE_Typedef node
- */
-AST_Typedef *
-be_generator::create_typedef(AST_Type *bt, UTL_ScopedName *n, UTL_StrList *p)
-{
- return (AST_Typedef *) new be_typedef(bt, n, p);
-}
-
-/*
- * Construct an AST_Native node
- */
-AST_Native *
-be_generator::create_native (UTL_ScopedName *n,
- UTL_StrList *p)
-{
- return (AST_Native *) new be_native (n, p);
-}
diff --git a/TAO/TAO_IDL/be/be_helper.cpp b/TAO/TAO_IDL/be/be_helper.cpp
deleted file mode 100644
index 9483cac3d19..00000000000
--- a/TAO/TAO_IDL/be/be_helper.cpp
+++ /dev/null
@@ -1,389 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_helper, "$Id$")
-
-static const char copyright [] =
-"/* -*- C++ -*- */\n\n"
-"// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******\n"
-"// TAO and the TAO IDL Compiler have been developed by the Center for\n"
-"// Distributed Object Computing at Washington University, St. Louis.\n"
-"//\n"
-"// Information about TAO is available at:\n"
-"// http://www.cs.wustl.edu/~schmidt/TAO.html\n";
-
-TAO_NL::TAO_NL (void)
-{
-}
-
-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);
-
-// methods of the TAO_OutStream class
-
-TAO_OutStream::TAO_OutStream (void)
- : fp_ (NULL),
- indent_level_ (0)
-{
-}
-
-TAO_OutStream::~TAO_OutStream (void)
-{
- // close the underlying I/O handle only if it exists
- if (fp_)
- {
- ACE_OS::fclose (fp_);
- fp_ = NULL;
- }
- indent_level_ = 0;
-}
-
-int
-TAO_OutStream::open (const char *fname,
- TAO_OutStream::STREAM_TYPE st)
-{
- if (fname)
- {
- // file name exists, open an I/O file handle
- fp_ = ACE_OS::fopen (fname, "w");
- if (fp_)
- {
- 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 (fp_, "%s\n", copyright);
- ACE_OS::fflush (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)
- return this->indent ();
- else
- return 0; // do not indent output
-}
-
-// indentation
-int
-TAO_OutStream::decr_indent (unsigned short flag)
-{
- 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)
- return this->indent ();
- else
- return 0; // do not indent output
-}
-
-int
-TAO_OutStream::reset (void)
-{
- indent_level_ = 0;
- return 0;
-}
-
-// indented print
-int
-TAO_OutStream::indent (void)
-{
- int i;
- // based on the current indentation level, leave appropriate number of blank
- // spaces in the output
- if (this->indent_level_ > 0)
- {
- for (i = 0; i < this->indent_level_; i++)
- {
- ACE_OS::fprintf (this->fp_, " ");
- ACE_OS::fflush (this->fp_);
- }
- }
- 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 *flatname, const char *suffix)
-{
- static char macro [NAMEBUFSIZE];
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ACE_OS::memset (macro, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (macro, "_%s_", cg->upcase (flatname));
- if (suffix)
- {
- //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, cg->upcase (suffix));
- ACE_OS::strcat (macro, "_");
- }
-
- // append a suffix representing the stream type
- 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#if !defined (" << macro << ")\n";
- *this << "#define " << macro << "\n\n";
- return 0;
-}
-
-int
-TAO_OutStream::gen_endif (void)
-{
- *this << "\n#endif /* end #if !defined */\n\n";
- return 0;
-}
-
-
-// ifdef generation
-int
-TAO_OutStream::gen_ifdef_AHETI (void)
-{
- *this << "\n"
- << "#if !defined (TAO_USE_SEQUENCE_TEMPLATES)"
- << be_idt_nl;
- return 0;
-}
-
-int
-TAO_OutStream::gen_else_AHETI (void)
-{
- *this << "\n#else /* TAO_USE_SEQUENCE_TEMPLATES */"
- << be_nl;
- return 0;
-}
-
-int
-TAO_OutStream::gen_endif_AHETI (void)
-{
- *this << be_uidt
- << "\n#endif /* !TAO_USE_SEQUENCE_TEMPLATES */ "
- << be_nl;
- 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);
- ACE_OS::fflush (fp_);
- va_end (ap);
- return result;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const char *str)
-{
- ACE_OS::fprintf (this->fp_, "%s", str);
- ACE_OS::fflush (fp_);
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const ACE_CDR::UShort num)
-{
- ACE_OS::fprintf (this->fp_, "%hu", num);
- ACE_OS::fflush (fp_);
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const ACE_CDR::Short num)
-{
- ACE_OS::fprintf (this->fp_, "%hd", num);
- ACE_OS::fflush (fp_);
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const ACE_CDR::ULong num)
-{
- ACE_OS::fprintf (this->fp_, "%lu", num);
- ACE_OS::fflush (fp_);
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const ACE_CDR::Long num)
-{
- ACE_OS::fprintf (this->fp_, "%ld", num);
- ACE_OS::fflush (fp_);
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const unsigned long num)
-{
- ACE_OS::fprintf (this->fp_, "%lu", num);
- ACE_OS::fflush (fp_);
- return *this;
-}
-
-TAO_OutStream &
-TAO_OutStream::operator<< (const long num)
-{
- ACE_OS::fprintf (this->fp_, "%ld", num);
- ACE_OS::fflush (fp_);
- 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<< (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_init.cpp b/TAO/TAO_IDL/be/be_init.cpp
deleted file mode 100644
index 1c81b64f288..00000000000
--- a/TAO/TAO_IDL/be/be_init.cpp
+++ /dev/null
@@ -1,105 +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.
-
- */
-
-// BE_init.cc - Initialization for dummy BE
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-#include "../../tao/Version.h"
-
-ACE_RCSID(be, be_init, "$Id$")
-
-/*
- * Initialize the BE. The protocol requires only that this routine
- * return an instance of AST_Generator (or a subclass thereof).
- *
- * Remember that none of the FE initialization has been done, when you
- * add stuff here.
- */
-AST_Generator *
-BE_init()
-{
- tao_cg = TAO_CODEGEN::instance ();
- AST_Generator *g = new be_generator();
-
- if (g == NULL) {
- cerr << GTDEVEL("IDL: BE init failed to create generator, exiting\n");
- ACE_OS::exit (99);
- }
- return g;
-}
-
-/*
- * Print out a version string for the BE
- */
-void
-BE_version()
-{
- cerr << GTDEVEL("TAO C++ BE, version ")
- << GTDEVEL(TAO_VERSION)
- << endl;
-}
diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp
deleted file mode 100644
index 3636414d0cd..00000000000
--- a/TAO/TAO_IDL/be/be_interface.cpp
+++ /dev/null
@@ -1,2231 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be_visitor_interface.h"
-#include "be.h"
-
-ACE_RCSID(be, be_interface, "$Id$")
-
-/*
- * BE_Interface
- */
-
-// default constructor
-be_interface::be_interface (void)
- : full_skel_name_ (0),
- ami_handler_full_skel_name_ (0),
- skel_count_ (0),
- full_coll_name_ (0),
- cached_coll_name_type_ (-1),
- ami_handler_full_coll_name_ (0),
- local_coll_name_ (0),
- ami_handler_local_coll_name_ (0),
- ami_handler_local_name_ (0),
- in_mult_inheritance_ (-1)
-{
- this->size_type (be_decl::VARIABLE); // always the case
-}
-
-// constructor used to build the AST
-be_interface::be_interface (UTL_ScopedName *n, AST_Interface **ih, long nih,
- UTL_StrList *p)
- : AST_Interface (n, ih, nih, p),
- AST_Decl (AST_Decl::NT_interface, n, p),
- UTL_Scope (AST_Decl::NT_interface),
- full_skel_name_ (0),
- ami_handler_full_skel_name_ (0),
- skel_count_ (0),
- full_coll_name_ (0),
- ami_handler_full_coll_name_ (0),
- local_coll_name_ (0),
- ami_handler_local_coll_name_ (0),
- ami_handler_local_name_ (0),
- in_mult_inheritance_ (-1)
-{
- this->size_type (be_decl::VARIABLE); // always the case
-}
-
-be_interface::~be_interface (void)
-{
- if (this->full_skel_name_ != 0)
- {
- delete[] this->full_skel_name_;
- this->full_skel_name_ = 0;
- }
- if (this->ami_handler_full_skel_name_ != 0)
- {
- delete[] this->ami_handler_full_skel_name_;
- this->ami_handler_full_skel_name_ = 0;
- }
- if (this->full_coll_name_ != 0)
- {
- delete[] this->full_coll_name_;
- this->full_coll_name_ = 0;
- }
- if (this->ami_handler_full_coll_name_ != 0)
- {
- delete[] this->ami_handler_full_coll_name_;
- this->ami_handler_full_coll_name_ = 0;
- }
- if (this->local_coll_name_ != 0)
- {
- delete[] this->local_coll_name_;
- this->local_coll_name_ = 0;
- }
- if (this->ami_handler_local_coll_name_ != 0)
- {
- delete[] this->ami_handler_local_coll_name_;
- this->ami_handler_local_coll_name_ = 0;
- }
- if (this->ami_handler_local_name_ != 0)
- {
- delete[] this->ami_handler_local_name_;
- this->ami_handler_local_name_ = 0;
- }
-}
-
-// compute stringified fully qualified collocated class name.
-void
-be_interface::compute_coll_name (int type)
-{
- if (type == this->cached_coll_name_type_ && this->full_coll_name_ != 0)
- return;
- else
- {
- this->cached_coll_name_type_ = type;
- delete this->full_coll_name_;
- delete this->local_coll_name_;
- }
-
- static const char *collocated_names[] = { "_tao_thru_poa_collocated_",
- "_tao_direct_collocated_" };
- 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];
-
- int namelen = ACE_OS::strlen (collocated) + sizeof (poa) + 1;
-
- UTL_IdListActiveIterator *i;
- ACE_NEW (i, UTL_IdListActiveIterator (this->name ()));
- while (!i->is_done ())
- {
- // reserve 2 characters for "::".
- namelen += ACE_OS::strlen (i->item ()->get_string ()) + 2;
- i->next ();
- }
- delete i;
-
- ACE_NEW (this->full_coll_name_,
- char[namelen+1]);
- this->full_coll_name_[0] = 0; // null terminate the string...
-
- // Iterate again....
- ACE_NEW (i, UTL_IdListActiveIterator (this->name ()));
-
- // Only the first component get the "POA_" preffix.
- int poa_added = 0;
- while (!i->is_done ())
- {
- const char* item = i->item ()->get_string ();
-
- // Increase right away, so we can test for the final component
- // in the loop.
- i->next ();
-
- // We add the POA_ preffix only if the first component is not
- // the global scope...
- if (ACE_OS::strcmp (item, "") != 0)
- {
- if (!i->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);
- ACE_OS::strcat (this->full_coll_name_, item);
- }
- }
- }
- delete i;
-
- // Compute the local name for the collocated class.
- int localen = ACE_OS::strlen (collocated) + 1;
- localen += ACE_OS::strlen (this->local_name ()->get_string ());
- ACE_NEW (this->local_coll_name_, char[localen]);
- ACE_OS::strcpy(this->local_coll_name_, collocated);
- ACE_OS::strcat(this->local_coll_name_,
- this->local_name ()->get_string ());
-}
-
-const char *
-be_interface::full_coll_name (int type)
-{
- this->compute_coll_name (type);
-
- return this->full_coll_name_;
-}
-
-const char*
-be_interface::local_coll_name (int type) const
-{
- ACE_const_cast (be_interface*, this)->compute_coll_name (type);
-
- return this->local_coll_name_;
-}
-
-
-const char*
-be_interface::ami_handler_full_coll_name (void)
-{
- if (this->ami_handler_full_coll_name_ == 0)
- {
- // @@ Michael: We need to check this one. I am just passing 1
- // for the time being. (Alex).
- compute_ami_handler_name (this->full_coll_name(1),
- this->ami_handler_full_coll_name_);
- }
-
- return this->ami_handler_full_coll_name_;
-}
-
-const char*
-be_interface::ami_handler_local_coll_name (void)
-{
- if (this->ami_handler_local_coll_name_ == 0)
- {
- // @@ Michael: We need to check this one. I am just passing 1
- // for the time being. (Alex).
- compute_ami_handler_name (this->local_coll_name(1),
- this->ami_handler_local_coll_name_);
- }
-
- return this->ami_handler_local_coll_name_;
-}
-
-const char*
-be_interface::ami_handler_local_name (void)
-{
- if (this->ami_handler_local_name_ == 0)
- compute_ami_handler_name (this->local_name()->get_string (),
- this->ami_handler_local_name_);
-
- return this->ami_handler_local_name_;
-}
-
-// Generate collocated local and full names for the arbitrary local
-// name under the scope of this interface. Usefull to generate AMI
-// Handlers.
-int
-be_interface::compute_coll_names (const char *local_name,
- char *&coll_local_name,
- char *&coll_full_name)
-
-{
- const char collocated[] = "_tao_collocated_";
- const char poa[] = "POA_";
-
- // Reserve enough room for the "POA_" prefix, the "_tao_collocated_"
- // prefix and the local name and the (optional) "::"
- int namelen = sizeof (collocated) + sizeof (poa);
-
- UTL_IdListActiveIterator *i;
- ACE_NEW_RETURN (i, UTL_IdListActiveIterator (this->name ()), -1);
- while (!i->is_done ())
- {
- // reserve 2 characters for "::".
- namelen += ACE_OS::strlen (i->item ()->get_string ()) + 2;
- i->next ();
- }
- delete i;
-
- ACE_NEW_RETURN (coll_full_name,
- char[namelen+1],
- -1);
- coll_full_name[0] = 0; // null terminate the string...
-
- // Iterate again....
- ACE_NEW_RETURN (i, UTL_IdListActiveIterator (this->name ()), -1);
-
- // Only the first component get the "POA_" preffix.
- int poa_added = 0;
- while (!i->is_done ())
- {
- const char* item = i->item ()->get_string ();
-
- // Increase right away, so we can test for the final component
- // in the loop.
- i->next ();
-
- // We add the POA_ preffix only if the first component is not
- // the global scope...
- if (ACE_OS::strcmp (item, "") != 0)
- {
- if (!i->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 (coll_full_name, poa);
- poa_added = 1;
- }
- ACE_OS::strcat (coll_full_name, item);
- ACE_OS::strcat (coll_full_name, "::");
- }
- else
- {
- ACE_OS::strcat (coll_full_name, collocated);
- ACE_OS::strcat (coll_full_name, item);
- }
- }
- }
- delete i;
-
- // Compute the local name for the collocated class.
- int localen = sizeof (collocated);
- localen += ACE_OS::strlen (local_name);
- ACE_NEW_RETURN (coll_local_name, char[localen], -1);
- ACE_OS::strcpy(coll_local_name, collocated);
- ACE_OS::strcat(coll_local_name,
- local_name);
-
- return 0;
-}
-
-// compute stringified fully scoped skel name
-void
-be_interface::compute_fullskelname (void)
-{
- this->compute_fullskelname (this->full_skel_name_, "POA_");
-}
-
-void
-be_interface::compute_fullskelname (char *&skelname, const char *prefix)
-{
- if (skelname)
- return;
- else
- {
- long namelen;
- UTL_IdListActiveIterator *i;
- long first = I_TRUE;
- long second = I_FALSE;
-
- // in the first loop compute the total length
- namelen = ACE_OS::strlen (prefix);
- i = new UTL_IdListActiveIterator (this->name ());
- while (!(i->is_done ()))
- {
- if (!first)
- namelen += 2; // for "::"
- else if (second)
- first = second = I_FALSE;
- // print the identifier
- namelen += ACE_OS::strlen (i->item ()->get_string ()); //
- // additional 4 for the POA_ characters
- if (first)
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- // does not start with a ""
- first = I_FALSE;
- else
- second = I_TRUE;
- }
- i->next ();
- }
- delete i;
-
- skelname = new char [namelen+1];
- skelname[0] = '\0';
- first = I_TRUE;
- second = I_FALSE;
- ACE_OS::strcat (skelname, prefix);
- i = new UTL_IdListActiveIterator (this->name ());
- while (!(i->is_done ()))
- {
- if (!first)
- ACE_OS::strcat (skelname, "::");
- else if (second)
- first = second = I_FALSE;
- // print the identifier
- ACE_OS::strcat (skelname, i->item ()->get_string ());
- if (first)
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- // does not start with a ""
- first = I_FALSE;
- else
- second = I_TRUE;
- }
- i->next ();
- }
- delete i;
- }
- return;
-}
-
-// retrieve the fully scoped skeleton name
-const char*
-be_interface::full_skel_name (void)
-{
- if (!this->full_skel_name_)
- compute_fullskelname ();
-
- return this->full_skel_name_;
-}
-
-const char*
-be_interface::ami_handler_full_skel_name (void)
-{
- if (this->ami_handler_full_skel_name_ == 0)
- compute_ami_handler_name (this->full_skel_name(),
- this->ami_handler_full_skel_name_);
-
- return this->ami_handler_full_skel_name_;
-}
-
-
-// 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;
-}
-
-//gen copy constructors
-void
-be_interface::gen_copy_ctors (TAO_OutStream* os)
-{
- this->traverse_inheritance_graph(be_interface::gen_copy_ctors_helper,os);
- return;
-}
-
-int
-be_interface::gen_copy_ctors_helper (be_interface* node, be_interface* base, TAO_OutStream *os)
-{
- static int first = 0;
- if(node != base)
- {
- if(first)
- {
- *os << idl_global->impl_class_prefix () << base->flatname () << idl_global->impl_class_suffix () << " (t)"
- << ", " << base->full_skel_name () << " (t)";
- first = 0;
- }
- else
- {
- *os << ", " << idl_global->impl_class_prefix () << base->flatname () << idl_global->impl_class_suffix () << " (t)"
- << ", " << base->full_skel_name () << " (t)"; ;
-
- }
- }
- else
- {
- *os << ":";
- first = 1;
- }
-
- return 1;
-
-}
-
-//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 << idl_global->impl_class_prefix () << base->flatname () << idl_global->impl_class_suffix () << " ()";
- first = 0;
- }
- else
- {
- *os << ", " << idl_global->impl_class_prefix () << base->flatname () << idl_global->impl_class_suffix () << " ()";
-
- }
- }
- else
- {
- *os << ":";
- first = 1;
- }
-
- return 1;
-
-}
-
-
-// generate the var definition. If <interface_name> is not 0, generate
-// the var defn for that name. Otherwise, do it for the interface you
-// are visiting (this).
-int
-be_interface::gen_var_defn (char* interface_name)
-{
- TAO_OutStream *ch; // output stream
- TAO_NL nl; // end line
- char namebuf [NAMEBUFSIZE]; // names
-
- // Decide which name to use.
- if (interface_name == 0)
- interface_name = this->local_name ()->get_string ();
-
- // Buffer with name of the var class.
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (namebuf,
- "%s_var",
- interface_name);
-
- // Retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ch = cg->client_header ();
-
- // generate the var definition (always in the client header).
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- ch->indent (); // start with whatever was our current indent level
- *ch << "class " << idl_global->export_macro ()
- << " " << namebuf << nl;
- *ch << "{" << nl;
- *ch << "public:\n";
- ch->incr_indent ();
-
- // default constr
- *ch << namebuf << " (void); // default constructor" << nl;
- *ch << namebuf << " (" << interface_name << "_ptr);" << nl;
-
- // copy constructor
- *ch << namebuf << " (const " << namebuf <<
- " &); // copy constructor" << nl;
-
- // destructor
- *ch << "~" << namebuf << " (void); // destructor" << nl;
- *ch << nl;
-
- // assignment operator from a pointer
- *ch << namebuf << " &operator= (" << interface_name << "_ptr);" << nl;
-
- // assignment from _var
- *ch << namebuf << " &operator= (const " << namebuf <<
- " &);" << nl;
-
- // arrow operator
- *ch << interface_name << "_ptr operator-> (void) const;" << nl;
-
- *ch << nl;
-
- // other extra types (cast operators, [] operator, and others)
- *ch << "operator const " << interface_name << "_ptr &() const;" << nl;
- *ch << "operator " << interface_name << "_ptr &();" << nl;
-
- *ch << "// in, inout, out, _retn " << nl;
- // the return types of in, out, inout, and _retn are based on the parameter
- // passing rules and the base type
- *ch << interface_name << "_ptr in (void) const;" << nl;
- *ch << interface_name << "_ptr &inout (void);" << nl;
- *ch << interface_name << "_ptr &out (void);" << nl;
- *ch << interface_name << "_ptr _retn (void);" << nl;
-
- // generate an additional member function that returns the underlying pointer
- *ch << interface_name << "_ptr ptr (void) const;\n";
-
- *ch << "\n";
- ch->decr_indent ();
-
- // private
- *ch << "private:\n";
- ch->incr_indent ();
- *ch << interface_name << "_ptr ptr_;\n";
-
- ch->decr_indent ();
- *ch << "};\n\n";
-
- return 0;
-}
-
-// implementation of the _var class. All of these get generated in the
-// inline file.
-// If the argument is 0, then use the name in <this>, otherwise use
-// the name given. Just making the class more useful.
-int
-be_interface::gen_var_impl (char *interface_local_name,
- char *interface_full_name)
-{
- TAO_OutStream *ci; // output stream
- TAO_NL nl; // end line
- char fname [NAMEBUFSIZE]; // to hold the full and
- char lname [NAMEBUFSIZE]; // local _var names
-
- // Decide on the names to use.
- // Even if one argument is 0, there is no point using the
- // arguments. Let us then use the name in this node.
- if (interface_local_name == 0 || interface_full_name == 0)
- {
- interface_local_name = local_name ()->get_string ();
- interface_full_name = (char *) this->fullname ();
- }
-
- ACE_OS::memset (fname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (fname, "%s_var", interface_full_name);
-
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (lname, "%s_var", interface_local_name);
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ci = cg->client_inline ();
-
- // generate the var implementation in the inline file
- // Depending upon the data type, there are some differences which we
- // account for over here.
-
- ci->indent (); // start with whatever was our current indent level
-
- *ci << "// *************************************************************"
- << nl;
- *ci << "// Inline operations for class " << fname << nl;
- *ci << "// *************************************************************\n\n";
-
- // default constr
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname <<
- " (void) // default constructor" << nl;
- *ci << " " << ": ptr_ (" << interface_full_name << "::_nil ())" << nl;
- *ci << "{}\n\n";
-
- // constr from a _ptr
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << interface_full_name << "_ptr p)" << nl;
- *ci << " : ptr_ (p)" << nl;
- *ci << "{}\n\n";
-
- // the additional ptr () member function. This member function must be
- // defined before the remaining member functions including the copy
- // constructor because this inline function is used elsewhere. Hence to make
- // inlining of this function possible, we must define it before its use.
- ci->indent ();
- *ci << "ACE_INLINE " << interface_full_name << "_ptr " << nl;
- *ci << fname << "::ptr (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // copy constructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (const " << fname <<
- " &p) // copy constructor" << nl;
- *ci << " : ptr_ (" << interface_full_name << "::_duplicate (p.ptr ()))" << nl;
- *ci << "{}\n\n";
-
- // destructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::~" << lname << " (void) // destructor" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::release (this->ptr_);\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (" << interface_full_name <<
- "_ptr p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::release (this->ptr_);" << nl;
- *ci << "this->ptr_ = p;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from _var
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << fname <<
- " &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "if (this != &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::release (this->ptr_);" << nl;
- *ci << "this->ptr_ = " << interface_full_name << "::_duplicate (p.ptr ());\n";
- ci->decr_indent ();
- *ci << "}" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // other extra methods - cast operator ()
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator const " << interface_full_name <<
- "_ptr &() const // cast" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator " << interface_full_name << "_ptr &() // cast " << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // operator->
- ci->indent ();
- *ci << "ACE_INLINE " << interface_full_name << "_ptr " << nl;
- *ci << fname << "::operator-> (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // in, inout, out, and _retn
- ci->indent ();
- *ci << "ACE_INLINE " << interface_full_name << "_ptr" << nl;
- *ci << fname << "::in (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << interface_full_name << "_ptr &" << nl;
- *ci << fname << "::inout (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << interface_full_name << "_ptr &" << nl;
- *ci << fname << "::out (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::release (this->ptr_);" << nl;
- *ci << "this->ptr_ = " << interface_full_name << "::_nil ();" << nl;
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << interface_full_name << "_ptr " << nl;
- *ci << fname << "::_retn (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "// yield ownership of managed obj reference" << nl;
- *ci << interface_full_name << "_ptr val = this->ptr_;" << nl;
- *ci << "this->ptr_ = " << interface_full_name << "::_nil ();" << nl;
- *ci << "return val;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- return 0;
-}
-
-// Generate the out definition. If <interface_name> is not 0, generate
-// the out defn for that name. Otherwise, do it for the interface you
-// are visiting (this).
-int
-be_interface::gen_out_defn (char *interface_name)
-{
- TAO_OutStream *ch; // output stream
- TAO_NL nl; // end line
- char namebuf [NAMEBUFSIZE]; // to hold the _out name
-
- // Decide which name to use.
- if (interface_name == 0)
- interface_name = this->local_name ()->get_string ();
-
- // Create the buffer with the name of the out class.
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (namebuf,
- "%s_out",
- interface_name);
-
- // Retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ch = cg->client_header ();
-
- // generate the out definition (always in the client header)
- ch->indent (); // start with whatever was our current indent level
-
- *ch << "class " << idl_global->export_macro ()
- << " " << namebuf << nl;
- *ch << "{" << nl;
- *ch << "public:\n";
- ch->incr_indent ();
-
- // No default constructor
-
- // constructor from a pointer
- *ch << namebuf << " (" << interface_name << "_ptr &);" << nl;
- // constructor from a _var &
- *ch << namebuf << " (" << interface_name << "_var &);" << nl;
- // constructor from a _out &
- *ch << namebuf << " (const " << namebuf << " &);" << nl;
- // assignment operator from a _out &
- *ch << namebuf << " &operator= (const " << namebuf << " &);" << nl;
- // assignment operator from a pointer &, cast operator, ptr fn, operator
- // -> and any other extra operators
- // only interface allows assignment from var &
- *ch << namebuf << " &operator= (const " << interface_name << "_var &);" << nl;
- *ch << namebuf << " &operator= (" << interface_name << "_ptr);" << nl;
- // cast
- *ch << "operator " << interface_name << "_ptr &();" << nl;
- // ptr fn
- *ch << interface_name << "_ptr &ptr (void);" << nl;
- // operator ->
- *ch << interface_name << "_ptr operator-> (void);" << nl;
-
- *ch << "\n";
- ch->decr_indent ();
- *ch << "private:\n";
- ch->incr_indent ();
- *ch << interface_name << "_ptr &ptr_;\n";
-
- ch->decr_indent ();
- *ch << "};\n\n";
- return 0;
-}
-
-
-// Generate the out class definition. If <interface_name> is not 0,
-// generate the out defn for that name. Otherwise, do it for the
-// interface you are visiting (this).
-int
-be_interface::gen_out_impl (char *interface_local_name,
- char *interface_full_name)
-{
- TAO_OutStream *ci; // output stream
- TAO_NL nl; // end line
- char fname [NAMEBUFSIZE]; // to hold the full and
- char lname [NAMEBUFSIZE]; // local _out names
-
- // Even if one argument is 0, there is no point using the
- // arguments. Let us then use the name in this node.
- if (interface_local_name == 0 || interface_full_name == 0)
- {
- interface_local_name = local_name ()->get_string ();
- interface_full_name = (char *) this->fullname ();
- }
-
- ACE_OS::memset (fname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (fname, "%s_out", interface_full_name);
-
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (lname, "%s_out", interface_local_name);
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ci = cg->client_inline ();
-
- // generate the var implementation in the inline file
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- ci->indent (); // start with whatever was our current indent level
-
- *ci << "// *************************************************************"
- << nl;
- *ci << "// Inline operations for class " << fname << nl;
- *ci << "// *************************************************************\n\n";
-
- // constr from a _ptr
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << interface_full_name << "_ptr &p)" << nl;
- *ci << " : ptr_ (p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = " << interface_full_name << "::_nil ();\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // constructor from _var &
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << interface_full_name <<
- "_var &p) // constructor from _var" << nl;
- *ci << " : ptr_ (p.out ())" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::release (this->ptr_);" << nl;
- *ci << "this->ptr_ = " << interface_full_name << "::_nil ();\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // copy constructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (const " << fname <<
- " &p) // copy constructor" << nl;
- *ci << " : ptr_ (ACE_const_cast (" << fname << "&,p).ptr_)" << nl;
- *ci << "{}\n\n";
-
- // assignment operator from _out &
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << fname <<
- " &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = ACE_const_cast (" << fname << "&,p).ptr_;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from _var
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << interface_full_name <<
- "_var &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = " << interface_full_name << "::_duplicate (p.ptr ());" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from _ptr
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (" << interface_full_name <<
- "_ptr p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = p;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // other extra methods - cast operator ()
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator " << interface_full_name <<
- "_ptr &() // cast" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // ptr function
- ci->indent ();
- *ci << "ACE_INLINE " << interface_full_name << "_ptr &" << nl;
- *ci << fname << "::ptr (void) // ptr" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // operator->
- ci->indent ();
- *ci << "ACE_INLINE " << interface_full_name << "_ptr " << nl;
- *ci << fname << "::operator-> (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- return 0;
-}
-
-// helper.
-int
-be_interface::gen_operation_table (void)
-{
- TAO_OutStream *ss; // output stream.
- TAO_NL nl; // end line.
-
- // Retrieve the singleton instance of the CodeGen.
- TAO_CodeGen *cg = 0;
- cg = TAO_CODEGEN::instance ();
-
- // Check out the op_lookup_strategy.
- switch (cg->lookup_strategy ())
- {
- case TAO_CodeGen::TAO_DYNAMIC_HASH:
- // Init the outstream appropriately.
- ss = cg->server_skeletons ();
-
- // start from current indentation level.
- ss->indent ();
-
- // Start the table generation.
- *ss << "static const TAO_operation_db_entry " << this->flatname () <<
- "_operations [] = {\n";
- ss->incr_indent (0);
-
- // Traverse the graph.
- if (this->traverse_inheritance_graph (be_interface::gen_optable_helper, ss) == -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.
- ss->indent ();
- *ss << "{\"_is_a\", &" << this->full_skel_name () << "::_is_a_skel},\n";
- this->skel_count_++;
-
- ss->indent ();
- *ss << "{\"_non_existent\", &" << this->full_skel_name () << "::_non_existent_skel}\n";
- this->skel_count_++;
-
- ss->decr_indent ();
- *ss << "};" << nl << nl;
-
- // XXXASG - this code should be based on using different strategies for
- // demux - for next release
- *ss << "static const CORBA::Long _tao_" << this->flatname ()
- << "_optable_size = sizeof (ACE_Hash_Map_Entry<const char *,"
- << " TAO_Skeleton>) * (" << (3*this->skel_count_)
- << ");" << be_nl;
- *ss << "static char _tao_" << this->flatname () << "_optable_pool "
- << "[_tao_" << this->flatname () << "_optable_size];" << be_nl;
- *ss << "static ACE_Static_Allocator_Base _tao_" << this->flatname ()
- << "_allocator (_tao_" << this->flatname () << "_optable_pool, "
- << "_tao_" << this->flatname () << "_optable_size);" << be_nl;
- *ss << "static TAO_Dynamic_Hash_OpTable tao_"
- << this->flatname () << "_optable " << "(" << be_idt << be_idt_nl
- << this->flatname () << "_operations," << be_nl
- << this->skel_count_ << "," << be_nl
- << 2*this->skel_count_ << "," << be_nl
- << "&_tao_" << this->flatname () << "_allocator" << be_uidt_nl
- << ");" << be_uidt_nl;
-
- break;
-
- case TAO_CodeGen::TAO_LINEAR_SEARCH:
- // For generating linear search also, we are calling GPERF
- // only.
- case TAO_CodeGen::TAO_BINARY_SEARCH:
- // For generating binary search also, we are calling GPERF
- // only.
- case TAO_CodeGen::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.
- char *temp_file = 0;
- ACE_NEW_RETURN (temp_file,
- char [ACE_OS::strlen (idl_global->temp_dir ()) +
- ACE_OS::strlen (this->flatname ()) +
- ACE_OS::strlen (".gperf") + 1],
- -1);
- ACE_OS::sprintf (temp_file,
- "%s%s.gperf",
- idl_global->temp_dir (),
- this->flatname ());
-
- // Save this file name with the codegen singleton.
- 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.
- ss = factory->make_outstream ();
- if (ss == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss",
- "::",
- "visit_interface-",
- "make_outstream failed\n"),
- -1);
-
- // Store the outstream with the codegen singleton.
- cg->gperf_input_stream (ss);
-
- // Open the temp file.
- if (ss->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 (ss);
-
- // Traverse the graph.
- if (this->traverse_inheritance_graph (be_interface::gen_optable_helper, ss) == -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.
- ss->indent ();
- *ss << "_is_a" << ", &"
- << this->full_skel_name ()
- << "::_is_a_skel\n";
- this->skel_count_++;
-
- ss->indent ();
- *ss << "_non_existent, &"
- << this->full_skel_name ()
- << "::_non_existent_skel\n";
- 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 ();
- }
- break;
-
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_interface",
- "::",
- "gen_operation_table",
- "unknown op_lookup_strategy\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 *ss)
-{
- *ss << "class TAO_operation_db_entry {\n"
- << "public:\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)
-{
- UTL_ScopeActiveIterator *si;
- AST_Decl *d;
- TAO_OutStream *ss; // output stream
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- switch (cg->lookup_strategy ())
- {
- case TAO_CodeGen::TAO_DYNAMIC_HASH:
- // Init the outstream.
- ss = cg->server_skeletons ();
-
- // The major stuff.
- if (this->nmembers () > 0)
- {
- // if there are elements in this scope i.e., any operations and
- // attributes defined by "this" which happens to be the same as "derived"
- // or one of its ancestors.
-
- si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls);
- // instantiate a scope iterator.
-
- while (!(si->is_done ()))
- {
- // get the next AST decl node
- d = si->item ();
- if (d->node_type () == AST_Decl::NT_op)
- {
- // Start from current indentation level
- ss->indent ();
-
- // we are an operation node
- *ss << "{\"" << d->original_local_name () << "\", &"
- << derived->full_skel_name () << "::"
- << d->local_name () << "_skel},\n";
-
- derived->skel_count_++;
- }
- else if (d->node_type () == AST_Decl::NT_attr)
- {
- AST_Attribute *attr;
-
- // Start from current indentation level.
- ss->indent ();
-
- // Generate only the "get" entry if we are
- // readonly.
- *ss << "{\"_get_" << d->original_local_name ()
- << "\", &" << derived->full_skel_name ()
- << "::_get_" << d->local_name () << "_skel},\n";
-
- derived->skel_count_++;
-
- attr = AST_Attribute::narrow_from_decl (d);
- if (!attr)
- return -1;
-
- if (!attr->readonly ())
- {
- // the set method
- ss->indent (); // start from current indentation level
- *ss << "{\"_set_" << d->original_local_name ()
- << "\", &" << derived->full_skel_name ()
- << "::_set_" << d->local_name () << "_skel},\n";
- derived->skel_count_++;
- }
- }
- si->next ();
- } // end of while
- delete si; // free the iterator object
- }
- break;
-
- case TAO_CodeGen::TAO_LINEAR_SEARCH:
- case TAO_CodeGen::TAO_BINARY_SEARCH:
- case TAO_CodeGen::TAO_PERFECT_HASH:
- // We call GPERF for all these three strategies.
- // Init the outstream.
- ss = cg->gperf_input_stream ();
-
- if (this->nmembers () > 0)
- {
- // if there are elements in this scope i.e., any operations and
- // attributes defined by "this" which happens to be the same as "derived"
- // or one of its ancestors.
-
- si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls);
- // instantiate a scope iterator.
-
- while (!(si->is_done ()))
- {
- // Get the next AST decl node.
- d = si->item ();
-
- if (d->node_type () == AST_Decl::NT_op)
- {
- //
- // Generate operation name.
- //
-
- // Start from current indentation level
- ss->indent ();
-
- // We are an operation node. We use the original
- // operation name, not the one with _cxx_ in it.
- *ss << d->original_local_name () << ",\t&"
- << derived->full_skel_name () << "::"
- << d->local_name () << "_skel" << "\n";
-
- derived->skel_count_++;
- }
- else if (d->node_type () == AST_Decl::NT_attr)
- {
- AST_Attribute *attr;
-
- // Start from current indentation level
- ss->indent ();
-
- // Generate only the "get" entry if we are readonly
- *ss << "_get_" << d->original_local_name () << ",\t&"
- << derived->full_skel_name () << "::_get_"
- << d->local_name () << "_skel\n";
- derived->skel_count_++;
-
- attr = AST_Attribute::narrow_from_decl (d);
- if (!attr)
- return -1;
-
- if (!attr->readonly ())
- {
- // the set method
- ss->indent (); // start from current indentation level
- *ss << "_set_" << d->original_local_name () << ",\t&"
- << derived->full_skel_name () << "::_set_"
- << d->local_name () << "_skel\n";
- derived->skel_count_++;
- }
- }
- si->next ();
- } // end of while
- delete si; // free the iterator object
- }
- break;
-
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_interface",
- "::",
- "gen_optable_entries",
- "unknown op_lookup_strategy\n"),
- -1);
- }
- return 0;
-}
-
-// 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)
-{
- long i; // loop index
- ACE_Unbounded_Queue <be_interface*> queue; // Queue data structure needed for
- // breadth-first traversal of
- // inheritance tree
-
- // For a special case of a deeply nested inheritance graph and one specific
- // way of inheritance in which a node that was already visited, but is not present in
- // the queue, gets inserted at the tail. This situation arises when a node
- // multiply inherits from two or more interfaces in which the first parent is
- // higher up in the tree than the second parent. In addition, if the second
- // parent turns out to be a child of the first .
-
- ACE_Unbounded_Queue <be_interface*> del_queue; // queue of dequeued nodes to
- // be searched for the above case
-
- // insert ourselves in the Queue
- if (queue.enqueue_tail (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_interface::traverse_inheritance_graph - "
- "error generating entries\n"), -1);
- }
-
- // do until queue is empty
- while (!queue.is_empty ())
- {
- be_interface *bi; // element inside the queue
-
- // 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 (queue.dequeue_head (bi))
- {
- 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 (del_queue.enqueue_tail (bi) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::traverse_graph - "
- "enqueue_head failed\n"), -1);
- }
-
- // 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 (gen (this, bi, os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::traverse_graph - "
- "helper code gen failed\n"), -1);
- }
-
- // now check if the dequeued element has any ancestors. If yes, insert
- // them inside the queue making sure that there are no duplicates
- for (i=0; i < bi->n_inherits (); i++)
- {
- be_interface *parent; // parent of the dequeued element
-
- // initialize an iterator to search the queue for duplicates
- ACE_Unbounded_Queue_Iterator<be_interface*> q_iter (queue);
-
- // retrieve the next parent from which the dequeued element inherits
- parent = be_interface::narrow_from_decl (bi->inherits ()[i]);
- if (!parent)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::gen_server_skeletons - "
- "bad inherited interface\n"), -1);
- }
-
- // now insert this node at the tail of the queue, but make sure that
- // it doesn't already exist in the queue
- int found = 0;
- while (!q_iter.done ())
- {
- be_interface **temp; // queue element
-
- (void) q_iter.next (temp);
- if (!ACE_OS::strcmp (parent->fullname (), (*temp)->fullname ()))
- {
- // we exist in this queue and cannot be inserted
- found = 1;
- }
- if (found)
- break;
- (void) q_iter.advance ();
- } // end of while
-
- // initialize an iterator to search the del_queue for duplicates
- ACE_Unbounded_Queue_Iterator<be_interface*> del_q_iter (del_queue);
-
- while (!found && !del_q_iter.done ())
- {
- be_interface **temp; // queue element
-
- (void) del_q_iter.next (temp);
- if (!ACE_OS::strcmp (parent->fullname (), (*temp)->fullname ()))
- {
- // we exist in this del_queue and cannot be inserted
- found = 1;
- }
- if (found)
- break;
- (void) del_q_iter.advance ();
- } // end of while
-
- if (!found)
- {
- // insert the parent in the queue
- if (queue.enqueue_tail (parent) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::gen_server_skeletons - "
- "enqueue op failed\n"), -1);
- }
- }
- } // end of for loop
- } // end of while queue not empty
- return 0;
-}
-
-// helpers passed to the template method
-
-int
-be_interface::gen_optable_helper (be_interface *derived,
- be_interface *ancestor,
- TAO_OutStream * /*os*/)
-{
- // generate entries for the derived class using the properties of its
- // ancestors
- if (ancestor->gen_optable_entries (derived) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interface::gen_operation_table - "
- "error generating entries for inherited"
- "interfaces\n"), -1);
- }
- 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 (void)
-{
- // GPERF can give Binary search, Linear search and Perfect Hash
- // methods. Generate the class defintion according to that.
-
- // Codegen singleton.
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- // 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 (cg->lookup_strategy ())
- {
- case TAO_CodeGen::TAO_PERFECT_HASH:
- // Output a class definition deriving from
- // TAO_Perfect_Hash_OpTable.
- gen_perfect_hash_class_definition ();
-
- // Call GPERF and get the methods defined.
- if (gen_gperf_lookup_methods () == -1)
- return -1;
-
- // Create an instance of the correct class corresponding the
- // operation lookup strategy we are following.
- gen_perfect_hash_instance ();
-
- break;
-
- case TAO_CodeGen::TAO_BINARY_SEARCH:
- // Output a class definition deriving from
- // TAO_Binary_Search_OpTable.
- this->gen_binary_search_class_definition ();
-
- // Call GPERF and get the methods defined.
- if (gen_gperf_lookup_methods () == -1)
- return -1;
-
- // Create an instance of the correct class corresponding the
- // operation lookup strategy we are following.
- gen_binary_search_instance ();
-
- break;
-
- case TAO_CodeGen::TAO_LINEAR_SEARCH:
- // Output a class definition deriving from
- // TAO_Linear_Search_OpTable.
- gen_linear_search_class_definition ();
-
- // Call GPERF and get the methods defined.
- if (gen_gperf_lookup_methods () == -1)
- return -1;
-
- // Create an instance of the correct class corresponding the
- // operation lookup strategy we are following.
- gen_linear_search_instance ();
-
- 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 (void)
-{
- // Codegen singleton.
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- // Outstream.
- TAO_OutStream *ss = cg->server_skeletons ();
-
- *ss << "class " << "TAO_" << this->flatname () << "_Perfect_Hash_OpTable"
- << " : public TAO_Perfect_Hash_OpTable"
- << be_nl
- << "{"
- << be_nl
- << "private:"
- << be_nl
- << " unsigned int hash (const char *str, unsigned int len);"
- << be_nl
- << "public:"
- << be_nl
- << " const TAO_operation_db_entry * lookup (const char *str, unsigned int len);"
- << be_nl
- << "};"
- << "\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 (void)
-{
- // Codegen singleton.
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- // Outstream.
- TAO_OutStream *ss = cg->server_skeletons ();
-
- *ss << "class " << "TAO_" << this->flatname () << "_Binary_Search_OpTable"
- << " : public TAO_Binary_Search_OpTable"
- << be_nl
- << "{"
- << be_nl
- << "public:"
- << be_nl
- << " const TAO_operation_db_entry * lookup (const char *str);"
- << be_nl
- << "};"
- << "\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 (void)
-{
- // Codegen singleton.
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- // Outstream.
- TAO_OutStream *ss = cg->server_skeletons ();
-
- *ss << "class " << "TAO_" << this->flatname () << "_Linear_Search_OpTable"
- << " : public TAO_Linear_Search_OpTable"
- << be_nl
- << "{"
- << be_nl
- << "public:"
- << be_nl
- << " const TAO_operation_db_entry * lookup (const char *str);"
- << be_nl
- << "};"
- << "\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 (void)
-{
- // Using ACE_Process.
- ACE_Process process_manager;
- ACE_Process_Options process_options;
-
- // Codegen's singleton.
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- // Adjust the offset of the underlying file pointer.
- ACE_OS::rewind (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 (cg->gperf_input_stream ()->file ()) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p:File close failed on temp gperf's input file\n"),
- -1);
-
- // Open the temp file.
- ACE_HANDLE input = ACE::open_temp_file (cg->gperf_input_filename (),
- O_RDONLY);
-
- if (input == ACE_INVALID_HANDLE)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p:File open failed on gperf's temp input file\n"),
- -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.
-
- ACE_HANDLE output = ACE_OS::open (idl_global->be_get_server_skeleton_fname (),
- O_WRONLY | O_APPEND);
- if (output == ACE_INVALID_HANDLE)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p:File open failed on server skeleton file\n"),
- -1);
-
- // Set the handles now in the process options.
- process_options.set_handles (input, output);
-
- // Set the command line for the gperf program. Give the right
- // arguments for the operation lookup strategy that we are using.
- switch (cg->lookup_strategy ())
- {
- // Perfect Hashing.
- case TAO_CodeGen::TAO_PERFECT_HASH:
- process_options.command_line ("%s"
- " "
- "-m -M -J -c -C"
- " "
- "-D -E -T -f 0"
- " "
- "-F 0"
- " "
- "-a -o -t -p -K"
- " "
- "opname_ -L C++"
- " "
- "-Z TAO_%s_Perfect_Hash_OpTable"
- " "
- "-N lookup",
- idl_global->gperf_path (),
- this->flatname ());
- break;
-
- // Binary search methods from GPERF. Everythis and the -B flag.
- case TAO_CodeGen::TAO_BINARY_SEARCH:
- process_options.command_line ("%s"
- " "
- "-B"
- " "
- "-m -M -J -c -C"
- " "
- "-D -E -T -f 0"
- " "
- "-F 0"
- " "
- "-a -o -t -p -K"
- " "
- "opname_ -L C++"
- " "
- "-Z TAO_%s_Binary_Search_OpTable"
- " "
- "-N lookup",
- idl_global->gperf_path (),
- this->flatname ());
- break;
-
- // Linear search methods from GPERF. Everything and the -z flag.
- case TAO_CodeGen::TAO_LINEAR_SEARCH:
- process_options.command_line ("%s"
- " "
- "-b"
- " "
- "-m -M -J -c -C"
- " "
- "-D -E -T -f 0"
- " "
- "-F 0"
- " "
- "-a -o -t -p -K"
- " "
- "opname_ -L C++"
- " "
- "-Z TAO_%s_Linear_Search_OpTable"
- " "
- "-N lookup",
- idl_global->gperf_path (),
- this->flatname ());
- break;
-
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "tao_idl:ERROR:%N:%l:Unknown Operation Lookup Strategy\n"),
- -1);
- }
-
-
- // Spawn a process for gperf.
- if (process_manager.spawn (process_options) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "Error:%p:Couldnt spawn a process for gperf program\n"),
- -1);
-
- // Wait for gperf to complete.
- if (process_manager.wait () == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "Error:%p:Error on wait'ing for completion of gperf program.\n"),
- -1);
-
- // Adjust the file offset to the EOF for the server skeleton file.
- ACE_OS::fseek (cg->server_skeletons ()->file (), 0, SEEK_END);
-
- return 0;
-}
-
-// Create an instance of this perfect hash table.
-void
-be_interface::gen_perfect_hash_instance ()
-{
- // Codegen singleton.
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- // Outstream.
- TAO_OutStream *ss = cg->server_skeletons ();
-
- *ss << "static TAO_" << this->flatname () << "_Perfect_Hash_OpTable"
- << " "
- << "tao_" << this->flatname () << "_optable"
- << ";\n" << be_nl;
-}
-
-// Create an instance of the binary search optable.
-void
-be_interface::gen_binary_search_instance ()
-{
- // Codegen singleton.
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- // Outstream.
- TAO_OutStream *ss = cg->server_skeletons ();
-
- *ss << "static TAO_" << this->flatname () << "_Binary_Search_OpTable"
- << " "
- << "tao_" << this->flatname () << "_optable"
- << ";\n" << be_nl;
-}
-
-// Create an instance of this perfect hash table.
-void
-be_interface::gen_linear_search_instance ()
-{
- // Codegen singleton.
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- // Outstream.
- TAO_OutStream *ss = cg->server_skeletons ();
-
- *ss << "static TAO_" << this->flatname () << "_Linear_Search_OpTable"
- << " "
- << "tao_" << this->flatname () << "_optable"
- << ";\n" << be_nl;
-}
-
-int
-be_interface::is_a_helper (be_interface * /*derived*/,
- be_interface *bi,
- TAO_OutStream *os)
-{
- // emit the comparison code
- os->indent ();
- *os << "(!ACE_OS::strcmp ((char *)value, \"" << bi->repoID () <<
- "\")) ||\n";
-
- return 0;
-}
-
-int
-be_interface::downcast_helper (be_interface * /* derived */,
- be_interface *base,
- TAO_OutStream *os)
-{
- *os << "if (ACE_OS::strcmp (logical_type_id, \""
- << base->repoID () << "\") == 0)" << be_idt_nl
- << "return ACE_static_cast ("
- << base->full_skel_name () << "_ptr, this);" << be_uidt_nl;
- return 0;
-}
-
-int
-be_interface::gen_skel_helper (be_interface *derived,
- be_interface *ancestor,
- TAO_OutStream *os)
-{
- UTL_ScopeActiveIterator *si;
- AST_Decl *d;
- TAO_NL nl; // end line
-
- // if derived and ancestor are same, skip it
- if (derived == ancestor)
- 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
-
- si = new UTL_ScopeActiveIterator (ancestor, UTL_Scope::IK_decls);
- // instantiate a scope iterator.
-
- while (!(si->is_done ()))
- {
- // get the next AST decl node
- d = si->item ();
- if (d->node_type () == AST_Decl::NT_op)
- {
- os->indent (); // start from current indentation level
- 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
- << "CORBA::ServerRequest &req, " << be_nl
- << "void *obj," << be_nl
- << "void *context," << be_nl
- << "CORBA::Environment &env =" << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << 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 "
- << derived->full_skel_name () << "::"
- << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *context," << be_nl
- << "CORBA::Environment &env" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
- *os << ancestor->full_skel_name ()
- << "_ptr impl = ("
- << derived->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," << be_nl
- << " env" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}\n";
- }
- }
- else if (d->node_type () == AST_Decl::NT_attr)
- {
- AST_Attribute *attr;
-
- attr = AST_Attribute::narrow_from_decl (d);
- if (!attr)
- return -1;
-
- os->indent (); // start from current indentation level
- if (os->stream_type () == TAO_OutStream::TAO_SVR_HDR)
- {
- // generate the static method corresponding to this method
- *os << "static void _get_" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *context," << be_nl
- << "CORBA::Environment &env =" << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << 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 "
- << derived->full_skel_name () << "::_get_"
- << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *context," << be_nl
- << "CORBA::Environment &env" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << ancestor->full_skel_name ()
- << "_ptr impl = ("
- << derived->full_skel_name ()
- << "_ptr) obj;" << nl;
- *os << ancestor->full_skel_name ()
- << "::_get_" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "req," << be_nl
- << "(" << ancestor->full_skel_name ()
- << "_ptr) impl," << be_nl
- << "context," << be_nl
- << "env" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}\n";
- }
-
- if (!attr->readonly ())
- {
- // the set method
- os->indent (); // start from current indentation level
- if (os->stream_type () == TAO_OutStream::TAO_SVR_HDR)
- {
- // generate the static method corresponding to
- // this method
- *os << "static void _set_" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *context," << be_nl
- << "CORBA::Environment &env = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << 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 "
- << derived->full_skel_name ()
- << "::_set_" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *context," << be_nl
- << "CORBA::Environment &env" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << ancestor->full_skel_name ()
- << "_ptr impl = ("
- << derived->full_skel_name ()
- << "_ptr) obj;" << be_nl;
- *os << ancestor->full_skel_name ()
- << "::_set_" << d->local_name ()
- << "_skel (" << be_idt << be_idt_nl
- << "req," << be_nl
- << "(" << ancestor->full_skel_name ()
- << "_ptr) impl," << be_nl
- << "context," << be_nl
- << "env" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "}\n";
- }
-
- }
- }
- si->next ();
- } // end of while
- delete si; // free the iterator object
- }
- return 0;
-}
-
-int
-be_interface::copy_ctor_helper (be_interface *derived,
- be_interface *base,
- TAO_OutStream *os)
-{
- if (derived == base)
- // we are the same. Don't do anything, otherwise we will end up calling
- // ourself
- return 0;
-
- if (base->is_nested ())
- {
- be_decl *scope;
- scope = be_scope::narrow_from_scope (base->defined_in ())->decl ();
- *os << " ACE_NESTED_CLASS (POA_" << scope->name () << ","
- << base->local_name () << ") (rhs)," << be_nl;
- }
- else
- {
- *os << " " << base->full_skel_name () << " (rhs)," << be_nl;
- }
-
- 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;
-}
-
-// return the relative skeleton name (needed due to NT compiler insanity)
-const char *
-be_interface::relative_skel_name (const char *skelname)
-{
- return be_interface::relative_name (this->full_skel_name (),
- skelname);
-}
-
-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];
- // UNUSED: be_decl *def_scope = 0; // our defining scope
- char // hold the fully scoped name
- def_name [NAMEBUFSIZE],
- use_name [NAMEBUFSIZE];
- char // these point to the curr and next component in the scope
- *def_curr = def_name,
- *def_next,
- *use_curr = use_name,
- *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;
-}
-
-int
-be_interface::accept (be_visitor *visitor)
-{
- return visitor->visit_interface (this);
-}
-
-
-
-// Narrowing
-IMPL_NARROW_METHODS3 (be_interface, AST_Interface, be_scope, be_type)
-IMPL_NARROW_FROM_DECL (be_interface)
-IMPL_NARROW_FROM_SCOPE (be_interface)
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Node <be_interface*>;
-template class ACE_Unbounded_Queue <be_interface*>;
-template class ACE_Unbounded_Queue_Iterator <be_interface*>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate ACE_Node<be_interface*>
-#pragma instantiate ACE_Unbounded_Queue<be_interface*>
-#pragma instantiate ACE_Unbounded_Queue_Iterator<be_interface*>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
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 3d407fc41bd..00000000000
--- a/TAO/TAO_IDL/be/be_interface_fwd.cpp
+++ /dev/null
@@ -1,512 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_interface.h
-//
-// = DESCRIPTION
-// Extension of class AST_Interface_Fwd that provides additional means for C++
-// mapping of an interface.
-//
-// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_interface_fwd, "$Id$")
-
-/*
- * BE_InterfaceFwd
- */
-
-be_interface_fwd::be_interface_fwd (void)
-{
- this->size_type (be_decl::VARIABLE); // always the case
-}
-
-be_interface_fwd::be_interface_fwd (AST_Interface *dummy,
- UTL_ScopedName *n, UTL_StrList *p)
- : AST_InterfaceFwd (dummy, n, p),
- AST_Decl (AST_Decl::NT_interface_fwd, n, p)
-{
- this->size_type (be_decl::VARIABLE); // always the case
-}
-
-be_interface_fwd::~be_interface_fwd (void)
-{
-}
-
-// generate the var definition
-int
-be_interface_fwd::gen_var_defn (char *)
-{
- TAO_OutStream *ch; // output stream
- TAO_NL nl; // end line
- char namebuf [NAMEBUFSIZE]; // names
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (namebuf, "%s_var", this->local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ch = cg->client_header ();
-
- // generate the var definition (always in the client header).
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- ch->indent (); // start with whatever was our current indent level
- *ch << "class " << idl_global->export_macro ()
- << " " << namebuf << nl;
- *ch << "{" << nl;
- *ch << "public:\n";
- ch->incr_indent ();
-
- // default constr
- *ch << namebuf << " (void); // default constructor" << nl;
- *ch << namebuf << " (" << local_name () << "_ptr);" << nl;
-
- // copy constructor
- *ch << namebuf << " (const " << namebuf <<
- " &); // copy constructor" << nl;
-
- // destructor
- *ch << "~" << namebuf << " (void); // destructor" << nl;
- *ch << nl;
-
- // assignment operator from a pointer
- *ch << namebuf << " &operator= (" << local_name () << "_ptr);" << nl;
-
- // assignment from _var
- *ch << namebuf << " &operator= (const " << namebuf <<
- " &);" << nl;
-
- // arrow operator
- *ch << local_name () << "_ptr operator-> (void) const;" << nl;
-
- *ch << nl;
-
- // other extra types (cast operators, [] operator, and others)
- *ch << "operator const " << local_name () << "_ptr &() const;" << nl;
- *ch << "operator " << local_name () << "_ptr &();" << nl;
-
- *ch << "// in, inout, out, _retn " << nl;
- // the return types of in, out, inout, and _retn are based on the parameter
- // passing rules and the base type
- *ch << local_name () << "_ptr in (void) const;" << nl;
- *ch << local_name () << "_ptr &inout (void);" << nl;
- *ch << local_name () << "_ptr &out (void);" << nl;
- *ch << local_name () << "_ptr _retn (void);" << nl;
-
- // generate an additional member function that returns the underlying pointer
- *ch << local_name () << "_ptr ptr (void) const;\n";
-
- *ch << "\n";
- ch->decr_indent ();
-
- // private
- *ch << "private:\n";
- ch->incr_indent ();
- *ch << local_name () << "_ptr ptr_;\n";
-
- ch->decr_indent ();
- *ch << "};\n\n";
-
- return 0;
-}
-
-// implementation of the _var class. All of these get generated in the inline
-// file
-int
-be_interface_fwd::gen_var_impl (char *, char *)
-{
- TAO_OutStream *ci; // output stream
- TAO_NL nl; // end line
- char fname [NAMEBUFSIZE]; // to hold the full and
- char lname [NAMEBUFSIZE]; // local _var names
-
- ACE_OS::memset (fname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (fname, "%s_var", this->fullname ());
-
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (lname, "%s_var", local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ci = cg->client_inline ();
-
- // generate the var implementation in the inline file
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- ci->indent (); // start with whatever was our current indent level
-
- *ci << "// *************************************************************"
- << nl;
- *ci << "// Inline operations for class " << fname << nl;
- *ci << "// *************************************************************\n\n";
-
- // default constr
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname <<
- " (void) // default constructor" << nl;
- *ci << " " << ": ptr_ (" << this->name () << "::_nil ())" << nl;
- *ci << "{}\n\n";
-
- // constr from a _ptr
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << name () << "_ptr p)" << nl;
- *ci << " : ptr_ (p)" << nl;
- *ci << "{}\n\n";
-
- // the additional ptr () member function. This member function must be
- // defined before the remaining member functions including the copy
- // constructor because this inline function is used elsewhere. Hence to make
- // inlining of this function possible, we must define it before its use.
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "_ptr " << nl;
- *ci << fname << "::ptr (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // copy constructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (const " << fname <<
- " &p) // copy constructor" << nl;
- *ci << " : ptr_ (" << name () << "::_duplicate (p.ptr ()))" << nl;
- *ci << "{}\n\n";
-
- // destructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::~" << lname << " (void) // destructor" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::release (this->ptr_);\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (" << name () <<
- "_ptr p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::release (this->ptr_);" << nl;
- *ci << "this->ptr_ = p;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from _var
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << fname <<
- " &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "if (this != &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::release (this->ptr_);" << nl;
- *ci << "this->ptr_ = " << name () << "::_duplicate (p.ptr ());\n";
- ci->decr_indent ();
- *ci << "}" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // other extra methods - cast operator ()
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator const " << name () <<
- "_ptr &() const // cast" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator " << name () << "_ptr &() // cast " << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // operator->
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "_ptr " << nl;
- *ci << fname << "::operator-> (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // in, inout, out, and _retn
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "_ptr" << nl;
- *ci << fname << "::in (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "_ptr &" << nl;
- *ci << fname << "::inout (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "_ptr &" << nl;
- *ci << fname << "::out (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::release (this->ptr_);" << nl;
- *ci << "this->ptr_ = " << this->name () << "::_nil ();" << nl;
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "_ptr " << nl;
- *ci << fname << "::_retn (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "// yield ownership of managed obj reference" << nl;
- *ci << this->name () << "_ptr val = this->ptr_;" << nl;
- *ci << "this->ptr_ = " << this->name () << "::_nil ();" << nl;
- *ci << "return val;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- return 0;
-}
-
-// generate the _out definition
-int
-be_interface_fwd::gen_out_defn (char *)
-{
- TAO_OutStream *ch; // output stream
- TAO_NL nl; // end line
- char namebuf [NAMEBUFSIZE]; // to hold the _out name
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (namebuf, "%s_out", local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ch = cg->client_header ();
-
- // generate the out definition (always in the client header)
- ch->indent (); // start with whatever was our current indent level
-
- *ch << "class " << idl_global->export_macro ()
- << " " << namebuf << nl;
- *ch << "{" << nl;
- *ch << "public:\n";
- ch->incr_indent ();
-
- // No default constructor
-
- // constructor from a pointer
- *ch << namebuf << " (" << local_name () << "_ptr &);" << nl;
- // constructor from a _var &
- *ch << namebuf << " (" << local_name () << "_var &);" << nl;
- // constructor from a _out &
- *ch << namebuf << " (const " << namebuf << " &);" << nl;
- // assignment operator from a _out &
- *ch << namebuf << " &operator= (const " << namebuf << " &);" << nl;
- // assignment operator from a pointer &, cast operator, ptr fn, operator
- // -> and any other extra operators
- // only interface allows assignment from var &
- *ch << namebuf << " &operator= (const " << local_name () << "_var &);" << nl;
- *ch << namebuf << " &operator= (" << local_name () << "_ptr);" << nl;
- // cast
- *ch << "operator " << local_name () << "_ptr &();" << nl;
- // ptr fn
- *ch << local_name () << "_ptr &ptr (void);" << nl;
- // operator ->
- *ch << local_name () << "_ptr operator-> (void);" << nl;
-
- *ch << "\n";
- ch->decr_indent ();
- *ch << "private:\n";
- ch->incr_indent ();
- *ch << local_name () << "_ptr &ptr_;\n";
-
- ch->decr_indent ();
- *ch << "};\n\n";
-
- return 0;
-}
-
-int
-be_interface_fwd::gen_out_impl (char *, char *)
-{
- TAO_OutStream *ci; // output stream
- TAO_NL nl; // end line
- 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_out", this->fullname ());
-
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (lname, "%s_out", local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ci = cg->client_inline ();
-
- // generate the var implementation in the inline file
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- ci->indent (); // start with whatever was our current indent level
-
- *ci << "// *************************************************************"
- << nl;
- *ci << "// Inline operations for class " << fname << nl;
- *ci << "// *************************************************************\n\n";
-
- // constr from a _ptr
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << name () << "_ptr &p)" << nl;
- *ci << " : ptr_ (p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = " << this->name () << "::_nil ();\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // constructor from _var &
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << this->name () <<
- "_var &p) // constructor from _var" << nl;
- *ci << " : ptr_ (p.out ())" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::release (this->ptr_);" << nl;
- *ci << "this->ptr_ = " << this->name () << "::_nil ();\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // copy constructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (const " << fname <<
- " &p) // copy constructor" << nl;
- *ci << " : ptr_ (ACE_const_cast (" << fname
- << "&,p).ptr_)" << nl;
- *ci << "{}\n\n";
-
- // assignment operator from _out &
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << fname <<
- " &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = ACE_const_cast (" << fname << "&,p).ptr_;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from _var
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << this->name () <<
- "_var &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = " << this->name () << "::_duplicate (p.ptr ());" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from _ptr
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (" << this->name () <<
- "_ptr p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = p;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // other extra methods - cast operator ()
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator " << this->name () <<
- "_ptr &() // cast" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // ptr function
- ci->indent ();
- *ci << "ACE_INLINE " << this->name () << "_ptr &" << nl;
- *ci << fname << "::ptr (void) // ptr" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // operator->
- ci->indent ();
- *ci << "ACE_INLINE " << this->name () << "_ptr " << nl;
- *ci << fname << "::operator-> (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- return 0;
-}
-
-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_module.cpp b/TAO/TAO_IDL/be/be_module.cpp
deleted file mode 100644
index 058134399fe..00000000000
--- a/TAO/TAO_IDL/be/be_module.cpp
+++ /dev/null
@@ -1,59 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_module, "$Id$")
-
-/*
- * BE_Module
- */
-be_module::be_module (void)
-{
-}
-
-be_module::be_module (UTL_ScopedName *n, UTL_StrList *p)
- : AST_Module (n, p),
- AST_Decl (AST_Decl::NT_module, n, p),
- UTL_Scope (AST_Decl::NT_module)
-{
-}
-
-// compute the size type of the node in question
-int
-be_module::compute_size_type (void)
-{
- // our size does not matter
- return 0;
-}
-
-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 149d5956dee..00000000000
--- a/TAO/TAO_IDL/be/be_native.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_native.cpp
-//
-// = DESCRIPTION
-// The native IDL type
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_native, "$Id$")
-
-
-// be_native: New IDL type added by the POA spec
-/*
- * Constructor(s)
- */
-be_native::be_native (void)
-{
-}
-
-be_native::be_native (UTL_ScopedName *n,
- UTL_StrList *p)
- : AST_Native (n, p),
- AST_Decl (AST_Decl::NT_native, n, p)
-{
-}
-
-int
-be_native::gen_typecode (void)
-{
- return 0;
-}
-
-long
-be_native::tc_size (void)
-{
- return 0;
-}
-
-int
-be_native::accept (be_visitor *visitor)
-{
- return visitor->visit_native (this);
-}
-
-// Narrowing
-IMPL_NARROW_METHODS2(be_native, AST_Native, be_type)
-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 76f834dd1ab..00000000000
--- a/TAO/TAO_IDL/be/be_operation.cpp
+++ /dev/null
@@ -1,166 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_operation, "$Id$")
-
-/*
- * BE_Operation
- */
-be_operation::be_operation (void)
- : argument_count_ (-1),
- has_native_ (0)
-{
-}
-
-be_operation::be_operation (AST_Type *rt, AST_Operation::Flags fl,
- UTL_ScopedName *n, UTL_StrList *p)
- : AST_Operation (rt, fl, n, p),
- AST_Decl (AST_Decl::NT_op, n, p),
- UTL_Scope (AST_Decl::NT_op),
- argument_count_ (-1),
- has_native_ (0)
-{
-}
-
-// compute total number of members
-int
-be_operation::compute_argument_attr (void)
-{
- if (this->argument_count_ != -1)
- return 0;
-
- this->argument_count_ = 0;
-
- // if there are elements in this scope
- if (this->nmembers () > 0)
- {
- // instantiate a scope iterator.
- UTL_ScopeActiveIterator *si =
- new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls);
-
- while (!(si->is_done ()))
- {
- // get the next AST decl node
- AST_Decl *d = si->item ();
-
- if (d->node_type () == AST_Decl::NT_argument)
- {
- this->argument_count_++;
- be_argument *arg = be_argument::narrow_from_decl (d);
- be_type* type =
- be_type::narrow_from_decl (arg->field_type ());
-
- if (type->base_node_type () == AST_Decl::NT_native)
- this->has_native_ = 1;
- }
- si->next ();
- } // end of while
- delete si; // free the iterator object
- }
-
- be_type* type = be_type::narrow_from_decl (this->return_type ());
- if (type->base_node_type () == AST_Decl::NT_native)
- this->has_native_ = 1;
-
- return 0;
-}
-
-// return the member count
-int
-be_operation::argument_count (void)
-{
- this->compute_argument_attr ();
-
- return this->argument_count_;
-}
-
-// return if any argument or the return type is a <native> type.
-int
-be_operation::has_native (void)
-{
- this->compute_argument_attr ();
-
- return this->has_native_;
-}
-
-be_argument *
-be_operation::add_argument_to_scope (be_argument *arg)
-{
- this->add_to_scope (arg);
- this->add_to_referenced (arg, 0);
- return arg;
-}
-
-// compute the size type of the node in question
-int
-be_operation::compute_size_type (void)
-{
- UTL_ScopeActiveIterator *si;
- AST_Decl *d;
- be_decl *bd;
-
- if (this->nmembers () > 0)
- {
- // if there are elements in this scope
-
- si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls);
- // instantiate a scope iterator.
-
- while (!(si->is_done ()))
- {
- // get the next AST decl node
- d = si->item ();
- bd = be_decl::narrow_from_decl (d);
- if (bd != 0)
- {
- // our sizetype depends on the sizetype of our members. Although
- // previous value of sizetype may get overwritten, we are
- // guaranteed by the "size_type" call that once the value reached
- // be_decl::VARIABLE, nothing else can overwrite it.
- this->size_type (bd->size_type ());
- }
- else
- {
- ACE_DEBUG ((LM_DEBUG,
- "WARNING (%N:%l) be_operation::compute_size_type - "
- "narrow_from_decl returned 0\n"));
- }
- si->next ();
- } // end of while
- delete si; // free the iterator object
- }
- return 0;
-}
-
-int
-be_operation::accept (be_visitor *visitor)
-{
- return visitor->visit_operation (this);
-}
-
-// 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_predefined_type.cpp b/TAO/TAO_IDL/be/be_predefined_type.cpp
deleted file mode 100644
index b7232df5407..00000000000
--- a/TAO/TAO_IDL/be/be_predefined_type.cpp
+++ /dev/null
@@ -1,333 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_predefined_type, "$Id$")
-
-/*
- * BE_PredefinedType
- */
-be_predefined_type::be_predefined_type (void)
-{
-}
-
-be_predefined_type::be_predefined_type (AST_PredefinedType::PredefinedType t,
- UTL_ScopedName *n, UTL_StrList *p)
- : AST_PredefinedType (t, n, p),
- AST_Decl (AST_Decl::NT_pre_defined, n, p)
-{
- // generate a new Scoped Name for us such that we belong to the CORBA
- // namespace
- if (this->pt () != AST_PredefinedType::PT_void)
- {
-
- UTL_ScopedName *new_name = new UTL_ScopedName (new Identifier ("CORBA", 1, 0,
- I_FALSE),
- NULL);
- switch (this->pt ())
- {
- case AST_PredefinedType::PT_long:
- {
- new_name->nconc (new UTL_ScopedName (new Identifier ("Long", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_ulong:
- {
- new_name->nconc (new UTL_ScopedName (new Identifier ("ULong", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_short:
- {
- new_name->nconc (new UTL_ScopedName (new Identifier ("Short", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_ushort:
- {
- new_name->nconc (new UTL_ScopedName (new Identifier ("UShort", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_float:
- {
- new_name->nconc (new UTL_ScopedName (new Identifier ("Float", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_double:
- {
- new_name->nconc (new UTL_ScopedName (new Identifier ("Double", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_char:
- {
- new_name->nconc (new UTL_ScopedName (new Identifier ("Char", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_octet:
- {
- new_name->nconc (new UTL_ScopedName (new Identifier ("Octet", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_wchar:
- {
- new_name->nconc (new UTL_ScopedName (new Identifier ("WChar", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_boolean:
- {
- new_name->nconc (new UTL_ScopedName (new Identifier ("Boolean", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_longlong:
- {
- new_name->nconc (new UTL_ScopedName (new Identifier ("LongLong", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_ulonglong:
- {
- new_name->nconc (new UTL_ScopedName (new Identifier ("ULongLong", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_longdouble:
- {
- new_name->nconc (new UTL_ScopedName (new Identifier ("LongDouble", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_any:
- {
- new_name->nconc (new UTL_ScopedName (new Identifier ("Any", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_pseudo:
- {
- new_name->nconc (new UTL_ScopedName (new Identifier
- (n->last_component
- ()->get_string (), 1, 0,
- I_FALSE), NULL));
- }
- break;
- default:
- {
- new_name->nconc (new UTL_ScopedName (this->local_name (), NULL));
- }
- }
- this->set_name (new_name);
- }
-
- // computes the repoID
- compute_repoID ();
-
- // computes the fully scoped name
- compute_fullname ();
-
- // computes the fully scoped typecode name
- compute_tc_name ();
-
- // compute the flattened fully scoped name
- compute_flatname ();
-
-
-}
-
-// overriden method
-void
-be_predefined_type::compute_tc_name (void)
-{
- // start with the head as the CORBA namespace
- this->tc_name_ = new UTL_ScopedName (new Identifier ("CORBA", 1, 0, I_FALSE),
- NULL);
-
- switch (this->pt ())
- {
- case AST_PredefinedType::PT_void:
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_void", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_long:
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_long", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_longlong:
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_longlong", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_ulong:
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_ulong", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_ulonglong:
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_ulonglong", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_short:
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_short", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_ushort:
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_ushort", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_float:
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_float", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_double:
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_double", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_longdouble:
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_longdouble", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_char:
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_char", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_wchar:
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_wchar", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_octet:
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_octet", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_boolean:
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_boolean", 1, 0,
- I_FALSE), NULL));
- }
- break;
- case AST_PredefinedType::PT_any:
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier
- ("_tc_any",
- 1, 0,
- I_FALSE),
- NULL));
- }
- break;
- case AST_PredefinedType::PT_pseudo:
- {
- char tcname [100];
- ACE_OS::sprintf (tcname, "_tc_%s",
- this->name ()->last_component ()->get_string ());
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier
- (ACE_OS::strdup (tcname),
- 1, 0,
- I_FALSE), NULL));
- }
- break;
- default:
- ACE_ERROR ((LM_WARNING, "Unknown or invalid predefined type"));
- break;
- }
-}
-
-UTL_ScopedName *
-be_predefined_type::compute_tc_name (const char *prefix, const char *suffix)
-{
- return be_type::compute_tc_name (prefix, suffix);
-}
-
-// compute the size type of the node in question
-int
-be_predefined_type::compute_size_type (void)
-{
- switch (this->pt ())
- {
- case AST_PredefinedType::PT_any:
- case AST_PredefinedType::PT_pseudo:
- // we are variable length type
- this->size_type (be_decl::VARIABLE);
- break;
- default:
- this->size_type (be_decl::FIXED);
- }
- return 0;
-}
-
-void
-be_predefined_type::compute_repoID (void)
-{
- switch (this->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- if (!ACE_OS::strcmp (this->local_name ()->get_string (), "Object"))
- this->repoID_ = ACE::strnew ("IDL:omg.org/CORBA/Object:1.0");
- else
- be_decl::compute_repoID ();
- break;
- default:
- be_decl::compute_repoID ();
- break;
- }
-}
-
-int
-be_predefined_type::accept (be_visitor *visitor)
-{
- return visitor->visit_predefined_type (this);
-}
-
-// 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 018984e65d7..00000000000
--- a/TAO/TAO_IDL/be/be_produce.cpp
+++ /dev/null
@@ -1,255 +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.
-
- */
-
-// BE_produce.cc - Produce the work of the BE - does nothing in the
-// dummy BE
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_produce, "$Id$")
-
-/*
- * Do the work of this BE. This is the starting point for code generation.
- */
-
-void
-BE_produce (void)
-{
- be_root *root; // root of the AST made up of BE nodes
- be_visitor *visitor; // visitor for root
- be_visitor_context ctx; // context information for the visitor root
-
- // configure the CodeGen object with the strategy to generate the visitors
- // that can produce interpretive or compiled marshaling stubs and skeletons
- tao_cg->config_visitor_factory ();
-
- // get the root node and narrow it down to be the back-end root node
- AST_Decl *d = idl_global->root ();
- root = be_root::narrow_from_decl (d);
- if (!root)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_produce - "
- "No Root\n"));
- BE_abort ();
- }
-
- // Code generation involves six steps because of the six files that we
- // generate.
-
- // (1) generate client header
- // instantiate a visitor context
- ctx.state (TAO_CodeGen::TAO_ROOT_CH); // set the codegen state
- // get a root visitor
- visitor = tao_cg->make_visitor (&ctx);
- // generate code for the client header
- if (root->accept (visitor) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_produce - "
- "client header for Root failed\n"));
- BE_abort ();
- }
- // it is our responsibility to free up the visitor
- delete visitor;
-
- // (2) generate client inline
- // set the context information
- ctx.reset ();
- ctx.state (TAO_CodeGen::TAO_ROOT_CI);
- // create a visitor
- visitor = tao_cg->make_visitor (&ctx);
- // generate code for the client inline file
- if (root->accept (visitor) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_produce - "
- "client inline for Root failed\n"));
- BE_abort ();
- }
- // it is our responsibility to free up the visitor
- delete visitor;
-
-
- // (3) generate client stubs
- ctx.reset ();
- ctx.state (TAO_CodeGen::TAO_ROOT_CS);
- // create a visitor
- visitor = tao_cg->make_visitor (&ctx);
- // generate code for the client stubs
- if (root->accept (visitor) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_produce - "
- "client stubs for Root failed\n"));
- BE_abort ();
- }
- // it is our responsibility to free up the visitor
- delete visitor;
-
- // (4) generate server header
- ctx.reset ();
- ctx.state (TAO_CodeGen::TAO_ROOT_SH);
- // create a visitor
- visitor = tao_cg->make_visitor (&ctx);
- // generate code for the server header file
- if (root->accept (visitor) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_produce - "
- "server header for Root failed\n"));
- BE_abort ();
- }
- // it is our responsibility to free up the visitor
- delete visitor;
-
- // (5) generate server inline
- ctx.reset ();
- ctx.state (TAO_CodeGen::TAO_ROOT_SI);
- // create a visitor
- visitor = tao_cg->make_visitor (&ctx);
- // generate code for the server inline file
- if (root->accept (visitor) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_produce - "
- "server inline for Root failed\n"));
- BE_abort ();
- }
- // it is our responsibility to free up the visitor
- delete visitor;
-
- // (6) generate server skeletons
- ctx.reset ();
- ctx.state (TAO_CodeGen::TAO_ROOT_SS);
- // create a visitor
- visitor = tao_cg->make_visitor (&ctx);
- // generate code for the server skeletons
- if (root->accept (visitor) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_produce - "
- "server skeletons for Root failed\n"));
- BE_abort ();
- }
- // it is our responsibility to free up the visitor
- delete visitor;
-
- //check if the flags are set for generating the
- //the implementation header and skeleton files
- if(idl_global->gen_impl_files())
- {
- // (7) generate implementation skeleton header
-
- ctx.reset ();
- ctx.state (TAO_CodeGen::TAO_ROOT_IH);
- // create a visitor
- visitor = tao_cg->make_visitor (&ctx);
- // generate code for the implementation skeleton header
- if (root->accept (visitor) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_produce - "
- "implementation skeletons for Root failed\n"));
- BE_abort ();
- }
-
- // it is our responsibility to free up the visitor
- delete visitor;
-
- // (8) generate implementation skeleton header
-
- ctx.reset ();
- ctx.state (TAO_CodeGen::TAO_ROOT_IS);
- // create a visitor
- visitor = tao_cg->make_visitor (&ctx);
-
- // generate code for the implementation skeleton header
- if (root->accept (visitor) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_produce - "
- "implementation skeletons for Root failed\n"));
- BE_abort ();
- }
-
- // it is our responsibility to free up the visitor
- delete visitor;
- }
-}
-
-/*
- * Abort this run of the BE
- */
-void
-BE_abort (void)
-{
- ACE_ERROR ((LM_ERROR,
- "Fatal Error - Aborting\n"));
- ACE_OS::exit (1);
-}
diff --git a/TAO/TAO_IDL/be/be_root.cpp b/TAO/TAO_IDL/be/be_root.cpp
deleted file mode 100644
index 43aa5ffa9ca..00000000000
--- a/TAO/TAO_IDL/be/be_root.cpp
+++ /dev/null
@@ -1,97 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_root, "$Id$")
-
-// Default Constructor
-be_root::be_root (void)
-{
-}
-
-// Constructor used to build the root of the abstract syntax tree (AST)
-be_root::be_root (UTL_ScopedName *n, UTL_StrList *p)
- : AST_Root (n, p),
- AST_Decl (AST_Decl::NT_root, n, p),
- UTL_Scope (AST_Decl::NT_root)
-
-{
-}
-
-// 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 == NULL)
- return NULL;
-
- 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 == NULL)
- return NULL;
-
- 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 == NULL)
- return NULL;
-
- add_to_local_types (t);
-
- return t;
-}
-
-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 16dfb2defe9..00000000000
--- a/TAO/TAO_IDL/be/be_scope.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// $Id$
-//
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_scope, "$Id$")
-
-
-// Default Constructor
-be_scope::be_scope (void)
- : 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_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);
- default:
- return (be_decl *)0;
- }
-}
-
-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 5d88dabd8ac..00000000000
--- a/TAO/TAO_IDL/be/be_sequence.cpp
+++ /dev/null
@@ -1,359 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be, be_sequence, "$Id$")
-
-
-/*
- * BE_Sequence
- */
-be_sequence::be_sequence (void)
- : mt_ (be_sequence::MNG_UNKNOWN)
-{
- this->size_type (be_decl::VARIABLE); // always the case
-}
-
-be_sequence::be_sequence (AST_Expression *v, AST_Type *t)
- : AST_Sequence (v, t),
- AST_Decl (AST_Decl::NT_sequence,
- NULL,
- NULL),
- mt_ (be_sequence::MNG_UNKNOWN)
-{
- // check if we are bounded or unbounded. An expression value of 0 means
- // unbounded
- if (v->ev ()->u.ulval == 0)
- {
- this->unbounded_ = I_TRUE;
- }
- else
- {
- this->unbounded_ = I_FALSE;
- }
-
- this->size_type (be_decl::VARIABLE); // a sequence data type is always
- // VARIABLE
-}
-
-idl_bool
-be_sequence::unbounded (void) const
-{
- return this->unbounded_;
-}
-
-// helper to create_name
-char *
-be_sequence::gen_name (void)
-{
- char namebuf [NAMEBUFSIZE];
- be_type *bt; // base type;
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); // reset the buffer
- // retrieve the base type
- bt = be_type::narrow_from_decl (this->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_sequence::"
- "gen_name - "
- "bad base type\n"),
- 0);
- }
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- // our base type is an anonymous sequence
- be_sequence *seq;
- seq = be_sequence::narrow_from_decl (bt);
- if (!seq)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_sequence::"
- "gen_name - "
- "error converting base type to sequence\n"),
- 0);
- }
- seq->set_defined_in (this); // set ourselves as its parent
- this->fe_add_sequence (seq); // add the child to our scope
- ACE_OS::sprintf (namebuf, "_tao_seq_%s", seq->gen_name ());
- }
- else
- {
- ACE_OS::sprintf (namebuf, "_tao_seq_%s", bt->local_name ()->get_string ());
- }
- // append the size (if any)
- if (!this->unbounded_)
- {
- ACE_OS::sprintf (namebuf, "%s_%d", namebuf, this->max_size ()->ev
- ()->u.ulval);
- }
- return ACE_OS::strdup (namebuf);
-}
-
-// create a name for ourselves
-int
-be_sequence::create_name (be_typedef *node)
-{
- static char namebuf [NAMEBUFSIZE];
- UTL_ScopedName *n = NULL;
- be_decl *scope; // scope in which we are defined
-
- // if there is a typedef node, we use its name as our name
- if (node)
- {
- n = (UTL_ScopedName *)node->name ()->copy ();
- this->set_name (n); // set our name
- }
- else
- {
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); // reset the buffer
- ACE_OS::strcpy (namebuf, this->gen_name ()); // generate a local name
-
- // 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 () ;
-
- // add our local name as the last component
- n->nconc (new UTL_ScopedName (new Identifier (ACE_OS::strdup
- (namebuf), 1,
- 0, I_FALSE),
- NULL));
- // set the fully scoped name
- this->set_name (n);
- }
- else
- {
- // We better be not here because we must be inside some scope,
- // atleast the ROOT scope.
- return -1;
- }
- }
- 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
- {
- be_type *bt, *prim_type; // base types
-
- 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:
- this->mt_ = be_sequence::MNG_OBJREF;
- break;
- case AST_Decl::NT_string:
- this->mt_ = be_sequence::MNG_STRING;
- break;
- case AST_Decl::NT_pre_defined:
- {
- be_predefined_type *bpd = be_predefined_type::narrow_from_decl
- (prim_type);
- if (bpd->pt () == AST_PredefinedType::PT_pseudo)
- {
- // if this pseudo is a CORBA::Object, then the managed type is
- // an objref
- if (!ACE_OS::strcmp (bpd->local_name ()->get_string (),
- "Object"))
- this->mt_ = be_sequence::MNG_OBJREF;
- else
- this->mt_ = be_sequence::MNG_PSEUDO;
- }
- else
- {
- this->mt_ = be_sequence::MNG_NONE;
- }
- }
- break;
- default:
- this->mt_ = be_sequence::MNG_NONE;
- } // end of switch
- }
- 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 == NULL)
- return NULL;
-
- 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;
- bt = be_type::narrow_from_decl (this->base_type ());
- if (!bt)
- {
- ACE_DEBUG ((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_Sequence_%s",
- this->flatname());
- else
- ACE_OS::sprintf (namebuf,
- "_TAO_Bounded_Object_Sequence_%s_%d",
- this->flatname(),
- this->max_size ()->ev()->u.ulval);
- break;
- case be_sequence::MNG_STRING: // sequence of strings
- if (this->unbounded ())
- ACE_OS::sprintf (namebuf,
- "TAO_Unbounded_String_Sequence");
- else
- ACE_OS::sprintf (namebuf,
- "_TAO_Bounded_String_Sequence_%s",
- this->flatname());
- 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_Sequence<CORBA::Octet>");
- else
- ACE_OS::sprintf (namebuf,
- "_TAO_Unbounded_Sequence_%s",
- this->flatname());
- // or prim_type->flatname ());
- // ACE_DEBUG ((LM_DEBUG, "testing.... %d, %d = <%s>\n",
- // predef, predef->pt (), namebuf));
- }
- else
- ACE_OS::sprintf (namebuf,
- "_TAO_Bounded_Sequence_%s_%d",
- this->flatname(),
- //prim_type->flatname (),
- this->max_size()->ev()->u.ulval);
- break;
- }
-
- return namebuf;
-}
-
-idl_bool
-be_sequence::in_recursion (be_type *node)
-{
- if (!node)
- {
- // there has to be a parameter
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_sequence::")
- ASYS_TEXT ("in_recursion - ")
- ASYS_TEXT ("bad parameter node\n")),
- 0);
- }
-
- be_type *type = be_type::narrow_from_decl (this->base_type ());
- if (!type)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_sequence::")
- ASYS_TEXT ("in_recursion - ")
- ASYS_TEXT ("bad base type\n")),
- 0);
- }
-
- if (!ACE_OS::strcmp (node->fullname (), type->fullname ()))
- // they match
- return 1;
- else
- // not in recursion
- return 0;
-}
-
-// 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 bb662d03c5b..00000000000
--- a/TAO/TAO_IDL/be/be_stream_factory.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-// $Id$
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_sunsoft.h"
-
-ACE_RCSID(be, be_factory, "$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 o/p 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 ec94dc96710..00000000000
--- a/TAO/TAO_IDL/be/be_string.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_string.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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_string, "$Id$")
-
-
-/*
- * BE_String
- */
-be_string::be_string (void)
-{
- this->size_type (be_decl::VARIABLE); // always the case
-}
-
-be_string::be_string (AST_Expression *v)
- : AST_String (v),
- AST_Decl (AST_Decl::NT_string,
- new UTL_ScopedName(new Identifier("string", 1, 0, I_FALSE),
- NULL),
- NULL)
-{
- this->size_type (be_decl::VARIABLE); // always the case
-}
-
-be_string::be_string (AST_Expression *v, long wide)
- : AST_String (v, wide),
- AST_Decl (AST_Decl::NT_string,
- wide == 1
- ? new UTL_ScopedName(new Identifier("string",1,0,I_FALSE),
- NULL)
- : new UTL_ScopedName(new Identifier("wstring_t",
- 1,
- 0,
- I_FALSE),
- NULL),
- NULL)
-{
- this->size_type (be_decl::VARIABLE); // always the case
-}
-
-// overriden method
-void
-be_string::compute_tc_name (void)
-{
- // start with the head as the CORBA namespace
- this->tc_name_ = new UTL_ScopedName (new Identifier ("CORBA", 1, 0, I_FALSE),
- NULL);
-
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_string", 1, 0,
- I_FALSE), NULL));
-}
-
-UTL_ScopedName *
-be_string::compute_tc_name (const char *prefix, const char *suffix)
-{
- return be_type::compute_tc_name (prefix, suffix);
-}
-
-int
-be_string::accept (be_visitor *visitor)
-{
- return visitor->visit_string (this);
-}
-
-// 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 a926adf8fcd..00000000000
--- a/TAO/TAO_IDL/be/be_structure.cpp
+++ /dev/null
@@ -1,671 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_structure, "$Id$")
-
-
-/*
- * BE_Structure
- */
-be_structure::be_structure (void)
-{
-}
-
-be_structure::be_structure (UTL_ScopedName *n, UTL_StrList *p)
- : AST_Decl (AST_Decl::NT_struct, n, p),
- UTL_Scope (AST_Decl::NT_struct),
- member_count_ (-1)
-{
-}
-
-// compute total number of members
-int
-be_structure::compute_member_count (void)
-{
- UTL_ScopeActiveIterator *si; // iterator
-
- this->member_count_ = 0;
-
- // if there are elements in this scope
- if (this->nmembers () > 0)
- {
- // instantiate a scope iterator.
- si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls);
-
- while (!(si->is_done ()))
- {
- this->member_count_++;
- si->next ();
- } // end of while
- delete si; // free the iterator object
- }
- return 0;
-}
-
-// return the member count
-int
-be_structure::member_count (void)
-{
- if (this->member_count_ == -1)
- this->compute_member_count ();
-
- return this->member_count_;
-}
-
-// generate the _var definition for ourself
-int
-be_structure::gen_var_defn (char *)
-{
- TAO_OutStream *ch; // output stream
- TAO_NL nl; // end line
- char namebuf [NAMEBUFSIZE]; // names
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (namebuf, "%s_var", this->local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ch = cg->client_header ();
-
- // generate the var definition (always in the client header).
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- ch->indent (); // start with whatever was our current indent level
- *ch << "class " << idl_global->export_macro ()
- << " " << namebuf << nl;
- *ch << "{" << nl;
- *ch << "public:\n";
- ch->incr_indent ();
- // default constr
- *ch << namebuf << " (void); // default constructor" << nl;
- // constr
- *ch << namebuf << " (" << local_name () << " *);" << nl;
- // copy constructor
- *ch << namebuf << " (const " << namebuf <<
- " &); // copy constructor" << nl;
- // destructor
- *ch << "~" << namebuf << " (void); // destructor" << nl;
- *ch << nl;
- // assignment operator from a pointer
- *ch << namebuf << " &operator= (" << local_name () << " *);" << nl;
- // assignment from _var
- *ch << namebuf << " &operator= (const " << namebuf << " &);" << nl;
-
- // arrow operator
- *ch << local_name () << " *operator-> (void);" << nl;
- *ch << "const " << local_name () << " *operator-> (void) const;" << nl;
- *ch << nl;
-
- // other extra types (cast operators, [] operator, and others)
- *ch << "operator const " << local_name () << " &() const;" << nl;
- *ch << "operator " << local_name () << " &();" << nl;
- *ch << "operator " << local_name () << " &() const;" << nl;
- *ch << "// in, inout, out, _retn " << nl;
- // the return types of in, out, inout, and _retn are based on the parameter
- // passing rules and the base type
- if (this->size_type () == be_decl::FIXED)
- {
- *ch << "const " << local_name () << " &in (void) const;" << nl;
- *ch << local_name () << " &inout (void);" << nl;
- *ch << local_name () << " &out (void);" << nl;
- *ch << local_name () << " _retn (void);" << nl;
- }
- else
- {
- *ch << "const " << local_name () << " &in (void) const;" << nl;
- *ch << local_name () << " &inout (void);" << nl;
- *ch << local_name () << " *&out (void);" << nl;
- *ch << local_name () << " *_retn (void);" << nl;
- }
-
- // generate an additional member function that returns the underlying pointer
- *ch << local_name () << " *ptr (void) const;\n";
-
- *ch << "\n";
- ch->decr_indent ();
-
- // generate the private section
- *ch << "private:\n";
- ch->incr_indent ();
- *ch << local_name () << " *ptr_;\n";
- ch->decr_indent ();
- *ch << "};\n\n";
-
- return 0;
-}
-
-// implementation of the _var class. All of these get generated in the inline
-// file
-int
-be_structure::gen_var_impl (char *, char *)
-{
- TAO_OutStream *ci; // output stream
- TAO_NL nl; // end line
- char fname [NAMEBUFSIZE]; // to hold the full and
- char lname [NAMEBUFSIZE]; // local _var names
-
- ACE_OS::memset (fname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (fname, "%s_var", this->fullname ());
-
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (lname, "%s_var", local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ci = cg->client_inline ();
-
- ci->indent (); // start with whatever was our current indent level
-
- *ci << "// *************************************************************"
- << nl;
- *ci << "// Inline operations for class " << fname << nl;
- *ci << "// *************************************************************\n\n";
-
- // default constr
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname <<
- " (void) // default constructor" << nl;
- *ci << " " << ": ptr_ (0)" << nl;
- *ci << "{}\n\n";
-
- // constr from a pointer
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << name () << " *p)" << nl;
- *ci << " : ptr_ (p)" << nl;
- *ci << "{}\n\n";
-
- // copy constructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (const " << fname <<
- " &p) // copy constructor" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "if (p.ptr_)" << nl;
- *ci << " this->ptr_ = new " << this->name () << "(*p.ptr_);" << nl;
- *ci << "else" << nl;
- *ci << " this->ptr_ = 0;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // destructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::~" << lname << " (void) // destructor" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "delete this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from a pointer
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (" << name () <<
- " *p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "delete this->ptr_;" << nl;
- *ci << "this->ptr_ = p;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from _var
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << fname <<
- " &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "if (this != &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "delete this->ptr_;" << nl;
- *ci << "this->ptr_ = new " << this->name () << " (*p.ptr_);\n";
- ci->decr_indent ();
- *ci << "}" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // two arrow operators
- ci->indent ();
- *ci << "ACE_INLINE const " << this->name () << " *" << nl;
- *ci << fname << "::operator-> (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << this->name () << " *" << nl;
- *ci << fname << "::operator-> (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // other extra methods - 3 cast operator ()
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator const " << name () <<
- " &() const // cast" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return *this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator " << name () << " &() // cast " << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return *this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator " << name () << " &() const// cast " << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return *this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // in, inout, out, and _retn
- ci->indent ();
- *ci << "ACE_INLINE const " << name () << " &" << nl;
- *ci << fname << "::in (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return *this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << name () << " &" << nl;
- *ci << fname << "::inout (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return *this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // the out is handled differently based on our size type
- ci->indent ();
- if (this->size_type () == be_decl::VARIABLE)
- {
- *ci << "// mapping for variable size " << nl;
- *ci << "ACE_INLINE " << name () << " *&" << nl;
- *ci << fname << "::out (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "delete this->ptr_;" << nl;
- *ci << "this->ptr_ = 0;" << nl;
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << name () << " *" << nl;
- *ci << fname << "::_retn (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << this->name () << " *tmp = this->ptr_;" << nl;
- *ci << "this->ptr_ = 0;" << nl;
- *ci << "return tmp;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- }
- else
- {
- *ci << "// mapping for fixed size " << nl;
- *ci << "ACE_INLINE " << name () << " &" << nl;
- *ci << fname << "::out (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return *this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << name () << nl;
- *ci << fname << "::_retn (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return *this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- }
-
- // the additional ptr () member function
- ci->indent ();
- *ci << "ACE_INLINE " << name () << " *" << nl;
- *ci << fname << "::ptr (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- return 0;
-}
-
-// generate the _out definition
-int
-be_structure::gen_out_defn (char *)
-{
- TAO_OutStream *ch; // output stream
- TAO_NL nl; // end line
- char namebuf [NAMEBUFSIZE]; // to hold the _out name
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (namebuf, "%s_out", local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ch = cg->client_header ();
-
- // generate the out definition (always in the client header)
- ch->indent (); // start with whatever was our current indent level
-
- *ch << "class " << idl_global->export_macro ()
- << " " << namebuf << nl;
- *ch << "{" << nl;
- *ch << "public:\n";
- ch->incr_indent ();
-
- // No default constructor
-
- // constructor from a pointer
- *ch << namebuf << " (" << local_name () << " *&);" << nl;
- // constructor from a _var &
- *ch << namebuf << " (" << local_name () << "_var &);" << nl;
- // constructor from a _out &
- *ch << namebuf << " (const " << namebuf << " &);" << nl;
- // assignment operator from a _out &
- *ch << namebuf << " &operator= (const " << namebuf << " &);" << nl;
- // assignment operator from a pointer &, cast operator, ptr fn, operator
- // -> and any other extra operators
- // assignment
- *ch << namebuf << " &operator= (" << local_name () << " *);" << nl;
- // operator ()
- *ch << "operator " << local_name () << " *&();" << nl;
- // ptr fn
- *ch << local_name () << " *&ptr (void);" << nl;
- // operator ->
- *ch << local_name () << " *operator-> (void);" << nl;
-
- *ch << "\n";
- ch->decr_indent ();
- *ch << "private:\n";
- ch->incr_indent ();
- *ch << local_name () << " *&ptr_;" << nl;
- *ch << "// assignment from T_var not allowed" << nl;
- *ch << "void operator= (const " << local_name () << "_var &);\n";
-
- ch->decr_indent ();
- *ch << "};\n\n";
- return 0;
-}
-
-int
-be_structure::gen_out_impl (char *, char *)
-{
- TAO_OutStream *ci; // output stream
- TAO_NL nl; // end line
- 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_out", this->fullname ());
-
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (lname, "%s_out", local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ci = cg->client_inline ();
-
- // generate the var implementation in the inline file
-
- ci->indent (); // start with whatever was our current indent level
-
- *ci << "// *************************************************************"
- << nl;
- *ci << "// Inline operations for class " << fname << nl;
- *ci << "// *************************************************************\n\n";
-
- // constr from a pointer
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << name () << " *&p)" << nl;
- *ci << " : ptr_ (p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = 0;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // constructor from _var &
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << this->name () <<
- "_var &p) // constructor from _var" << nl;
- *ci << " : ptr_ (p.out ())" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "delete this->ptr_;" << nl;
- *ci << "this->ptr_ = 0;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // copy constructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (const " << fname <<
- " &p) // copy constructor" << nl;
- *ci << " : ptr_ (ACE_const_cast (" << fname << "&,p).ptr_)" << nl;
- *ci << "{}\n\n";
-
- // assignment operator from _out &
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << fname <<
- " &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = ACE_const_cast (" << fname << "&,p).ptr_;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment from _var is not allowed by a private declaration
-
- // assignment operator from pointer
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (" << this->name () <<
- " *p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = p;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // other extra methods - cast operator ()
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator " << this->name () <<
- " *&() // cast" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // ptr function
- ci->indent ();
- *ci << "ACE_INLINE " << this->name () << " *&" << nl;
- *ci << fname << "::ptr (void) // ptr" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // operator ->
- ci->indent ();
- *ci << "ACE_INLINE " << this->name () << " *" << nl;
- *ci << fname << "::operator-> (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
-
- return 0;
-}
-
-// compute the size type of the node in question
-int
-be_structure::compute_size_type (void)
-{
- UTL_ScopeActiveIterator *si;
- AST_Decl *d;
- be_decl *bd;
-
- if (this->nmembers () > 0)
- {
- // if there are elements in this scope
-
- si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls);
- // instantiate a scope iterator.
-
- while (!(si->is_done ()))
- {
- // get the next AST decl node
- d = si->item ();
- bd = be_decl::narrow_from_decl (d);
- if (bd != 0)
- {
- // our sizetype depends on the sizetype of our members. Although
- // previous value of sizetype may get overwritten, we are
- // guaranteed by the "size_type" call that once the value reached
- // be_decl::VARIABLE, nothing else can overwrite it.
- this->size_type (bd->size_type ());
- }
- else
- {
- ACE_DEBUG ((LM_DEBUG,
- "WARNING (%N:%l) be_structure::compute_size_type - "
- "narrow_from_decl returned 0\n"));
- }
- si->next ();
- } // end of while
- delete si; // free the iterator object
- }
- return 0;
-}
-
-// Are we or the parameter node involved in any recursion
-idl_bool
-be_structure::in_recursion (be_type *node)
-{
- if (!node)
- {
- // we are determining the recursive status for ourselves
- node = this;
- }
-
- // proceed if the number of members in our scope is greater than 0
- if (this->nmembers () > 0)
- {
- // initialize an iterator to iterate thru our scope
- UTL_ScopeActiveIterator *si;
- ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (this,
- UTL_Scope::IK_decls),
- -1);
- // continue until each element is visited
- while (!si->is_done ())
- {
- be_field *field = be_field::narrow_from_decl (si->item ());
- if (!field)
- // This will be an enum value or other legitimate non-field
- // member - in any case, no recursion.
- {
- si->next ();
- continue;
- }
- be_type *type = be_type::narrow_from_decl (field->field_type ());
- if (!type)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_structure::")
- ASYS_TEXT ("in_recursion - ")
- ASYS_TEXT ("bad field type\n")),
- 0);
- }
- if (type->in_recursion (node))
- {
- delete si;
- return 1;
- }
- si->next ();
- } // end of while loop
- delete si;
- } // end of if
-
- // not in recursion
- return 0;
-}
-
-int
-be_structure::accept (be_visitor *visitor)
-{
- return visitor->visit_structure (this);
-}
-
-// 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_sunsoft.cpp b/TAO/TAO_IDL/be/be_sunsoft.cpp
deleted file mode 100644
index 86cea07d781..00000000000
--- a/TAO/TAO_IDL/be/be_sunsoft.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-// $Id$
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-#include "be_sunsoft.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)
-{
- UTL_IdListActiveIterator *i = new UTL_IdListActiveIterator (idl);
- long first = I_TRUE;
- long second = I_FALSE;
-
- while (!(i->is_done ()))
- {
- if (!first)
- *this << "::";
- else if (second)
- first = second = I_FALSE;
- // print the identifier
- *this << i->item ();
- if (first)
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- // does not start with a ""
- first = I_FALSE;
- else
- second = I_TRUE;
- }
- i->next ();
- }
- 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", ev->u.usval);
- 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", ev->u.ulval);
- break;
- case AST_Expression::EV_longlong:
-#if ! defined (ACE_LACKS_LONGLONG_T)
- this->TAO_OutStream::print ("%ld", 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 ("%u", ev->u.ullval);
-#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 ("%f", 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 ("%ld", 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 ("%ld", ev->u.bval);
- break;
- case AST_Expression::EV_string:
- this->TAO_OutStream::print ("\"%s\"", ev->u.strval->get_string ());
- break;
- case AST_Expression::EV_wstring:
- break;
- default:
- break;
- }
- }
- else //
- {
- // XXXASG: need to add code here
- }
- return *this;
-}
diff --git a/TAO/TAO_IDL/be/be_type.cpp b/TAO/TAO_IDL/be/be_type.cpp
deleted file mode 100644
index 279348d9008..00000000000
--- a/TAO/TAO_IDL/be/be_type.cpp
+++ /dev/null
@@ -1,389 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_type, "$Id$")
-
-
-/*
- * BE_Type
- */
-
-be_type::be_type (void)
- : tc_name_ (0),
- type_name_ (0),
- nested_type_name_ (0)
-{
-}
-
-be_type::be_type (AST_Decl::NodeType nt, UTL_ScopedName *n, UTL_StrList *p)
- : AST_Decl (nt, n, p),
- tc_name_ (0),
- type_name_ (0),
- nested_type_name_ (0)
-{
-}
-
-be_type::~be_type (void)
-{
- if (this->nested_type_name_ != 0)
- {
- delete[] this->nested_type_name_;
- this->nested_type_name_ = 0;
- }
-}
-
-// 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->tc_name_ = NULL;
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- n = this->name ();
- while (n->tail () != NULL)
- {
- if (!this->tc_name_)
- {
- // does not exist
- this->tc_name_ = new UTL_ScopedName (n->head (), NULL);
- }
- else
- {
- this->tc_name_->nconc (new UTL_ScopedName (n->head (), NULL));
- }
- n = (UTL_ScopedName *)n->tail ();
- }
- ACE_OS::sprintf (namebuf, "_tc_%s", n->last_component ()->get_string ());
- if (!this->tc_name_)
- {
- // does not exist
- this->tc_name_ = new UTL_ScopedName (new Identifier (ACE_OS::strdup
- (namebuf), 1, 0, I_FALSE), NULL);
- }
- else
- {
- this->tc_name_->nconc (new UTL_ScopedName (new Identifier (ACE_OS::strdup
- (namebuf), 1,
- 0, I_FALSE), NULL));
- }
-
- return;
-}
-
-UTL_ScopedName *
-be_type::compute_tc_name (const char *prefix, const char *suffix)
-{
- // Both prefix and suffix has to be valid. Else return.
- if (prefix == 0 || suffix == 0)
- return 0;
-
- static char namebuf [NAMEBUFSIZE];
- UTL_ScopedName *n;
-
- UTL_ScopedName *result = NULL;
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- n = this->name ();
- while (n->tail () != NULL)
- {
- if (!result)
- {
- // does not exist
- result = new UTL_ScopedName (n->head (), NULL);
- }
- else
- {
- result->nconc (new UTL_ScopedName (n->head (), NULL));
- }
- n = (UTL_ScopedName *)n->tail ();
- }
-
- ACE_OS::sprintf (namebuf,
- "_tc_%s%s%s",
- prefix,
- n->last_component ()->get_string (),
- suffix);
-
- if (!result)
- {
- // does not exist
- result = new UTL_ScopedName (new Identifier (ACE_OS::strdup
- (namebuf), 1, 0, I_FALSE), NULL);
- }
- else
- {
- result->nconc (new UTL_ScopedName (new Identifier (ACE_OS::strdup
- (namebuf), 1,
- 0, I_FALSE), NULL));
- }
-
- return result;
-}
-
-// retrieve typecode name
-UTL_ScopedName *
-be_type::tc_name (const char *prefix, const char *suffix)
-{
- if (prefix != 0 && suffix != 0)
- {
- // Just compute and return the name.
- return compute_tc_name (prefix, suffix);
- }
-
- // Compute and init the member.
- if (!this->tc_name_)
- compute_tc_name ();
-
- return this->tc_name_;
-}
-
-// XXXASG - This code works. However, whether we should generate the
-// ACE_NESTED_CLASS macro or not should be based on an option to the
-// compiler. In this version, we choose to generate a relative path.
-
-// return the type name using the ACE_NESTED_CLASS macro
-const char *
-be_type::nested_type_name (be_decl *use_scope, const char *suffix, const char *prefix)
-{
- // 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. For such,
- // we emit a macro defined in the ACE library.
- //
-
- // 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
-
- if (this->nested_type_name_ == 0)
- ACE_NEW_RETURN (this->nested_type_name_, char[NAMEBUFSIZE], 0);
-
- be_decl *def_scope = 0; // our defining scope
- char // hold the fully scoped name
- def_name [NAMEBUFSIZE],
- use_name [NAMEBUFSIZE];
- char // these point to the prev, curr and next component in the scope
- *def_curr = def_name,
- *def_next = 0,
- *use_curr = use_name,
- *use_next = 0;
-
- int len_to_match = 0; // how many chars to compare
-
- // initialize the buffers
- ACE_OS::memset (this->nested_type_name_, '\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.
-
- def_scope = ((this->defined_in ())?
- (be_scope::narrow_from_scope (this->defined_in ())->decl ()):
- 0);
-
- if (def_scope && def_scope->node_type () != AST_Decl::NT_root && use_scope)
- // if both scopes exist and that we are not in the root scope
- {
- ACE_OS::strcpy (def_name, def_scope->fullname ());
- ACE_OS::strcpy (use_name, use_scope->fullname ());
-
- // 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)
- len_to_match = ACE_OS::strlen (def_curr)
- - ACE_OS::strlen (def_next);
- else
- len_to_match = ACE_OS::strlen (def_curr);
-
- if (use_next)
- {
- int len = ACE_OS::strlen (use_curr)
- - ACE_OS::strlen (use_next);
- if (len > len_to_match)
- len_to_match = len;
- }
- else
- {
- int len = ACE_OS::strlen (def_curr);
- if (len > len_to_match)
- len_to_match = len;
- }
-
- if (!ACE_OS::strncmp (def_curr, use_curr, len_to_match))
- {
- // initial prefix matches i.e., they have a common root
- // start by initializing the macro
-
- //@@ ACE_OS::sprintf (this->nested_type_name_, "ACE_NESTED_CLASS (");
- //@@ ACE_OS::strcat (this->nested_type_name_, def_curr,
- //len_to_match); // initialize the first argument
-
- // shift the curr scopes to the next level
- def_curr = (def_next ? (def_next + 2) : 0); // skip the ::
- use_curr = (use_next ? (use_next + 2) : 0); // skip the ::
-
- 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)
- len_to_match = ACE_OS::strlen (def_curr)
- - ACE_OS::strlen (def_next);
- else
- len_to_match = ACE_OS::strlen (def_curr);
-
- if (use_next)
- {
- int len = ACE_OS::strlen (use_curr)
- - ACE_OS::strlen (use_next);
- if (len > len_to_match)
- len_to_match = len;
- }
- else
- {
- int len = ACE_OS::strlen (def_curr);
- if (len > len_to_match)
- len_to_match = len;
- }
-
- if (!ACE_OS::strncmp (def_curr, use_curr, len_to_match))
- {
- // they have same prefix, append to arg1
- //@@ ACE_OS::strcat (this->nested_type_name_, "::");
- //@@ ACE_OS::strncat (this->nested_type_name_, def_curr,
- //len_to_match);
- def_curr = (def_next ? (def_next + 2) : 0); // skip the ::
- use_curr = (use_next ? (use_next + 2) : 0); // skip the ::
- }
- else
- {
- // 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
- //@@ ACE_OS::strcat (this->nested_type_name_, ", ");
-
- // copy the remaining def_name (if any left)
- if (def_curr)
- {
- ACE_OS::strcat (this->nested_type_name_, def_curr);
- ACE_OS::strcat (this->nested_type_name_, "::");
- }
-
- // append our local name
- if (prefix)
- ACE_OS::strcat (this->nested_type_name_, prefix);
- ACE_OS::strcat (this->nested_type_name_, this->local_name ()->get_string ());
- if (suffix)
- ACE_OS::strcat (this->nested_type_name_, suffix);
- //@@ ACE_OS::strcat (this->nested_type_name_, ")");
- return this->nested_type_name_;
- } // end of if the root prefixes match
- }
-
- // otherwise just emit our fullname
- if (prefix)
- ACE_OS::strcat (this->nested_type_name_, prefix);
- ACE_OS::strcat (this->nested_type_name_, this->fullname ());
- if (suffix)
- ACE_OS::strcat (this->nested_type_name_, suffix);
-
- return this->nested_type_name_;
-}
-
-// *****************************
-// CODE GENERATION
-// *****************************
-
-// generate the _var definition for ourself
-int
-be_type::gen_var_defn (char *)
-{
- return 0;
-}
-
-// implementation of the _var class. All of these get generated in the inline
-// file
-int
-be_type::gen_var_impl (char *, char *)
-{
- return 0;
-}
-
-// generate the _out definition
-int
-be_type::gen_out_defn (char *)
-{
- return 0;
-}
-
-int
-be_type::gen_out_impl (char *, char *)
-{
- return 0;
-}
-
-AST_Decl::NodeType
-be_type::base_node_type (void) const
-{
- return ACE_const_cast(be_type*, this)->node_type ();
-}
-
-idl_bool
-be_type::in_recursion (be_type *)
-{
- // be default we are not involved in recursion
- return 0;
-}
-
-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 5fa56ef674b..00000000000
--- a/TAO/TAO_IDL/be/be_typedef.cpp
+++ /dev/null
@@ -1,88 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_typedef, "$Id$")
-
-
-be_typedef::be_typedef (void)
-{
-}
-
-be_typedef::be_typedef (AST_Type *bt, UTL_ScopedName *n, UTL_StrList *p)
- : AST_Typedef (bt, n, p),
- AST_Decl (AST_Decl::NT_typedef, n, p)
-{
-}
-
-// 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;
-
- d = this;
- while (d && d->node_type () == AST_Decl::NT_typedef)
- {
- be_typedef *temp; // temporary
-
- temp = be_typedef::narrow_from_decl (d);
- d = be_type::narrow_from_decl (temp->base_type ());
- }
- return d;
-}
-
-// compute the size type of the node in question
-int
-be_typedef::compute_size_type (void)
-{
- be_type *type = be_type::narrow_from_decl (this->base_type ());
- if (!type)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_typedef::compute_size_type - "
- "bad base type\n"), -1);
- }
-
- // our size type is the same as our type
- this->size_type (type->size_type ());
- return 0;
-}
-
-AST_Decl::NodeType be_typedef::base_node_type (void) const
-{
- be_type *base = be_type::narrow_from_decl (ACE_const_cast(be_typedef*, this)->base_type ());
- return base->base_node_type ();
-}
-
-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 4aa4baa22fe..00000000000
--- a/TAO/TAO_IDL/be/be_union.cpp
+++ /dev/null
@@ -1,1045 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_union, "$Id$")
-
-
-/*
- * BE_Union
- */
-
-be_union::be_union (void)
-{
-}
-
-be_union::be_union (AST_ConcreteType *dt, UTL_ScopedName *n, UTL_StrList *p)
- : AST_Union (dt, n, p),
- AST_Structure (AST_Decl::NT_union, n, p),
- AST_Decl (AST_Decl::NT_union, n, p),
- UTL_Scope (AST_Decl::NT_union),
- member_count_ (-1),
- default_index_ (-2)
-{
- this->default_value_.computed_ = -2;
-}
-
-// compute total number of members
-int
-be_union::compute_member_count (void)
-{
- UTL_ScopeActiveIterator *si; // iterator
-
- this->member_count_ = 0;
-
- // if there are elements in this scope
- if (this->nmembers () > 0)
- {
- // instantiate a scope iterator.
- si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls);
-
- while (!(si->is_done ()))
- {
- this->member_count_++;
- si->next ();
- } // end of while
- delete si; // free the iterator object
- }
- return 0;
-}
-
-// compute total number of members
-int
-be_union::compute_default_index (void)
-{
- UTL_ScopeActiveIterator *si; // iterator
- AST_Decl *d; // temp node
- be_union_branch *bub; // union branch node
- int i = 0; // counter
-
- // if default case does not exist, it will have a value of -1 according to
- // the spec
- this->default_index_ = -1;
-
- // if there are elements in this scope
- if (this->nmembers () > 0)
- {
- // instantiate a scope iterator.
- si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls);
-
- while (!(si->is_done ()))
- {
- // get the next AST decl node
- d = si->item ();
- if (!d->imported ())
- {
- bub = be_union_branch::narrow_from_decl (d);
- for (unsigned long j = 0;
- j < bub->label_list_length ();
- ++j)
- {
- // check if we are printing the default case
- if (bub->label (j)->label_kind ()
- == AST_UnionLabel::UL_default)
- this->default_index_ = i; // zero based indexing
- i++;
- }
- }
- si->next ();
- } // end of while
- delete si; // free the iterator object
- }
- return 0;
-}
-
-// return the member count
-int
-be_union::member_count (void)
-{
- if (this->member_count_ == -1)
- this->compute_member_count ();
-
- return this->member_count_;
-}
-
-// return the default_index
-int
-be_union::default_index (void)
-{
- if (this->default_index_ == -2)
- this->compute_default_index ();
-
- return this->default_index_;
-}
-
-// generate the _var definition for ourself
-int
-be_union::gen_var_defn (char *)
-{
- TAO_OutStream *ch; // output stream
- TAO_NL nl; // end line
- char namebuf [NAMEBUFSIZE]; // names
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (namebuf, "%s_var", this->local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ch = cg->client_header ();
-
- // generate the var definition (always in the client header).
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- ch->indent (); // start with whatever was our current indent level
- *ch << "class " << idl_global->export_macro ()
- << " " << namebuf << nl;
- *ch << "{" << nl;
- *ch << "public:\n";
- ch->incr_indent ();
- // default constr
- *ch << namebuf << " (void); // default constructor" << nl;
- // constr
- *ch << namebuf << " (" << local_name () << " *);" << nl;
- // copy constructor
- *ch << namebuf << " (const " << namebuf <<
- " &); // copy constructor" << nl;
- // destructor
- *ch << "~" << namebuf << " (void); // destructor" << nl;
- *ch << nl;
- // assignment operator from a pointer
- *ch << namebuf << " &operator= (" << local_name () << " *);" << nl;
- // assignment from _var
- *ch << namebuf << " &operator= (const " << namebuf << " &);" << nl;
-
- // arrow operator
- *ch << local_name () << " *operator-> (void);" << nl;
- *ch << "const " << local_name () << " *operator-> (void) const;" << nl;
- *ch << nl;
-
- // other extra types (cast operators, [] operator, and others)
- *ch << "operator const " << local_name () << " &() const;" << nl;
- *ch << "operator " << local_name () << " &();" << nl;
- *ch << "operator " << local_name () << " &() const;" << nl;
- *ch << "// in, inout, out, _retn " << nl;
- // the return types of in, out, inout, and _retn are based on the parameter
- // passing rules and the base type
- if (this->size_type () == be_decl::FIXED)
- {
- *ch << "const " << local_name () << " &in (void) const;" << nl;
- *ch << local_name () << " &inout (void);" << nl;
- *ch << local_name () << " &out (void);" << nl;
- *ch << local_name () << " _retn (void);" << nl;
- }
- else
- {
- *ch << "const " << local_name () << " &in (void) const;" << nl;
- *ch << local_name () << " &inout (void);" << nl;
- *ch << local_name () << " *&out (void);" << nl;
- *ch << local_name () << " *_retn (void);" << nl;
- }
-
- // generate an additional member function that returns the underlying pointer
- *ch << local_name () << " *ptr(void) const;\n";
-
- *ch << "\n";
- ch->decr_indent ();
-
- // generate the private section
- *ch << "private:\n";
- ch->incr_indent ();
- *ch << local_name () << " *ptr_;\n";
- ch->decr_indent ();
- *ch << "};\n\n";
-
- return 0;
-}
-
-// implementation of the _var class. All of these get generated in the inline
-// file
-int
-be_union::gen_var_impl (char *, char *)
-{
- TAO_OutStream *ci; // output stream
- TAO_NL nl; // end line
- char fname [NAMEBUFSIZE]; // to hold the full and
- char lname [NAMEBUFSIZE]; // local _var names
-
- ACE_OS::memset (fname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (fname, "%s_var", this->fullname ());
-
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (lname, "%s_var", local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ci = cg->client_inline ();
-
- ci->indent (); // start with whatever was our current indent level
-
- *ci << "// *************************************************************"
- << nl;
- *ci << "// Inline operations for class " << fname << nl;
- *ci << "// *************************************************************\n\n";
-
- // default constr
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname <<
- " (void) // default constructor" << nl;
- *ci << " " << ": ptr_ (0)" << nl;
- *ci << "{}\n\n";
-
- // constr from a pointer
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << name () << " *p)" << nl;
- *ci << " : ptr_ (p)" << nl;
- *ci << "{}\n\n";
-
- // copy constructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (const " << fname <<
- " &p) // copy constructor" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "if (p.ptr_)" << nl;
- *ci << " this->ptr_ = new " << this->name () << "(*p.ptr_);" << nl;
- *ci << "else" << nl;
- *ci << " this->ptr_ = 0;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // destructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::~" << lname << " (void) // destructor" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "delete this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from a pointer
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (" << name () <<
- " *p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "delete this->ptr_;" << nl;
- *ci << "this->ptr_ = p;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from _var
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << fname <<
- " &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "if (this != &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "delete this->ptr_;" << nl;
- *ci << "this->ptr_ = new " << this->name () << " (*p.ptr_);\n";
- ci->decr_indent ();
- *ci << "}" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // two arrow operators
- ci->indent ();
- *ci << "ACE_INLINE const " << this->name () << " *" << nl;
- *ci << fname << "::operator-> (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << this->name () << " *" << nl;
- *ci << fname << "::operator-> (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // other extra methods - 3 cast operator ()
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator const " << name () <<
- " &() const // cast" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return *this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator " << name () << " &() // cast " << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return *this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator " << name () << " &() const// cast " << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return *this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // in, inout, out, and _retn
- ci->indent ();
- *ci << "ACE_INLINE const " << name () << " &" << nl;
- *ci << fname << "::in (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return *this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << name () << " &" << nl;
- *ci << fname << "::inout (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return *this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // the out is handled differently based on our size type
- ci->indent ();
- if (this->size_type () == be_decl::VARIABLE)
- {
- *ci << "// mapping for variable size " << nl;
- *ci << "ACE_INLINE " << name () << " *&" << nl;
- *ci << fname << "::out (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "delete this->ptr_;" << nl;
- *ci << "this->ptr_ = 0;" << nl;
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << name () << " *" << nl;
- *ci << fname << "::_retn (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << this->name () << " *tmp = this->ptr_;" << nl;
- *ci << "this->ptr_ = 0;" << nl;
- *ci << "return tmp;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- }
- else
- {
- *ci << "// mapping for fixed size " << nl;
- *ci << "ACE_INLINE " << name () << " &" << nl;
- *ci << fname << "::out (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return *this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << name () << nl;
- *ci << fname << "::_retn (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return *this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // the additional ptr () member function
- ci->indent ();
- *ci << "ACE_INLINE " << name () << " *" << nl;
- *ci << fname << "::ptr (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- }
-
- return 0;
-}
-
-// generate the _out definition
-int
-be_union::gen_out_defn (char *)
-{
- TAO_OutStream *ch; // output stream
- TAO_NL nl; // end line
- char namebuf [NAMEBUFSIZE]; // to hold the _out name
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (namebuf, "%s_out", local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ch = cg->client_header ();
-
- // generate the out definition (always in the client header)
- ch->indent (); // start with whatever was our current indent level
-
- *ch << "class " << idl_global->export_macro ()
- << " " << namebuf << nl;
- *ch << "{" << nl;
- *ch << "public:\n";
- ch->incr_indent ();
-
- // No default constructor
-
- // constructor from a pointer
- *ch << namebuf << " (" << local_name () << " *&);" << nl;
- // constructor from a _var &
- *ch << namebuf << " (" << local_name () << "_var &);" << nl;
- // constructor from a _out &
- *ch << namebuf << " (const " << namebuf << " &);" << nl;
- // assignment operator from a _out &
- *ch << namebuf << " &operator= (const " << namebuf << " &);" << nl;
- // assignment operator from a pointer &, cast operator, ptr fn, operator
- // -> and any other extra operators
- // assignment
- *ch << namebuf << " &operator= (" << local_name () << " *);" << nl;
- // operator ()
- *ch << "operator " << local_name () << " *&();" << nl;
- // ptr fn
- *ch << local_name () << " *&ptr (void);" << nl;
- // operator ->
- *ch << local_name () << " *operator-> (void);" << nl;
-
- *ch << "\n";
- ch->decr_indent ();
- *ch << "private:\n";
- ch->incr_indent ();
- *ch << local_name () << " *&ptr_;" << nl;
- *ch << "// assignment from T_var not allowed" << nl;
- *ch << "void operator= (const " << local_name () << "_var &);\n";
-
- ch->decr_indent ();
- *ch << "};\n\n";
- return 0;
-}
-
-int
-be_union::gen_out_impl (char *, char *)
-{
- TAO_OutStream *ci; // output stream
- TAO_NL nl; // end line
- 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_out", this->fullname ());
-
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (lname, "%s_out", local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ci = cg->client_inline ();
-
- // generate the var implementation in the inline file
-
- ci->indent (); // start with whatever was our current indent level
-
- *ci << "// *************************************************************"
- << nl;
- *ci << "// Inline operations for class " << fname << nl;
- *ci << "// *************************************************************\n\n";
-
- // constr from a pointer
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << name () << " *&p)" << nl;
- *ci << " : ptr_ (p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = 0;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // constructor from _var &
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << this->name () <<
- "_var &p) // constructor from _var" << nl;
- *ci << " : ptr_ (p.out ())" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "delete this->ptr_;" << nl;
- *ci << "this->ptr_ = 0;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // copy constructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (const " << fname <<
- " &p) // copy constructor" << nl;
- *ci << " : ptr_ (ACE_const_cast (" << fname << "&,p).ptr_)" << nl;
- *ci << "{}\n\n";
-
- // assignment operator from _out &
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << fname <<
- " &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = ACE_const_cast (" << fname << "&,p).ptr_;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment from _var is not allowed by a private declaration
-
- // assignment operator from pointer
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (" << this->name () <<
- " *p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = p;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // other extra methods - cast operator ()
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator " << this->name () <<
- " *&() // cast" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // ptr function
- ci->indent ();
- *ci << "ACE_INLINE " << this->name () << " *&" << nl;
- *ci << fname << "::ptr (void) // ptr" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // operator ->
- ci->indent ();
- *ci << "ACE_INLINE " << this->name () << " *" << nl;
- *ci << fname << "::operator-> (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
-
- return 0;
-}
-
-// compute the size type of the node in question
-int
-be_union::compute_size_type (void)
-{
- UTL_ScopeActiveIterator *si;
- AST_Decl *d;
- be_decl *bd;
-
- if (this->nmembers () > 0)
- {
- // if there are elements in this scope
-
- si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls);
- // instantiate a scope iterator.
-
- while (!(si->is_done ()))
- {
- // get the next AST decl node
- d = si->item ();
- bd = be_decl::narrow_from_decl (d);
- if (bd != 0)
- {
- // our sizetype depends on the sizetype of our members. Although
- // previous value of sizetype may get overwritten, we are
- // guaranteed by the "size_type" call that once the value reached
- // be_decl::VARIABLE, nothing else can overwrite it.
- this->size_type (bd->size_type ());
- }
- else
- {
- ACE_DEBUG ((LM_DEBUG,
- "WARNING (%N:%l) be_union::compute_size_type - "
- "narrow_from_decl returned 0\n"));
- }
- si->next ();
- } // end of while
- delete si; // free the iterator object
- }
- return 0;
-}
-
-// Are we or the parameter node involved in any recursion
-idl_bool
-be_union::in_recursion (be_type *node)
-{
- if (!node)
- {
- // we are determining the recursive status for ourselves
- node = this;
- }
-
- // proceed if the number of members in our scope is greater than 0
- if (this->nmembers () > 0)
- {
- // initialize an iterator to iterate thru our scope
- UTL_ScopeActiveIterator *si;
- ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (this,
- UTL_Scope::IK_decls),
- -1);
- // continue until each element is visited
- while (!si->is_done ())
- {
- be_union_branch *field = be_union_branch::narrow_from_decl (si->item ());
- if (!field)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_union::")
- ASYS_TEXT ("in_recursion - ")
- ASYS_TEXT ("bad field node\n")),
- 0);
- }
- be_type *type = be_type::narrow_from_decl (field->field_type ());
- if (!type)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_union::")
- ASYS_TEXT ("in_recursion - ")
- ASYS_TEXT ("bad field type\n")),
- 0);
- }
- if (type->in_recursion (node))
- {
- delete si;
- return 1;
- }
- si->next ();
- } // end of while loop
- delete si;
- } // end of if
-
- // not in recursion
- return 0;
-}
-
-// return the default value
-int
-be_union::default_value (be_union::DefaultValue &dv)
-{
- if (this->default_value_.computed_ == -2)
- {
- // we need to compute it
- if (this->compute_default_value () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_union::")
- ASYS_TEXT ("default_value - ")
- ASYS_TEXT ("Error computing ")
- ASYS_TEXT ("default value\n")),
- -1);
- }
- }
- dv = this->default_value_;
- return 0;
-}
-
-// determine the implicit default value (if any)
-int
-be_union::compute_default_value (void)
-{
- // check if we really need a default value. This will be true if there is an
- // explicit default case OR if an implicit default exists because not all
- // values of the discriminant type are covered by the cases.
-
- // compute the total true "case" labels i.e., exclude the "default" case
- int total_case_members = 0;
-
- // instantiate a scope iterator.
- UTL_ScopeActiveIterator *si
- = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls);
- while (!(si->is_done ()))
- {
- // get the next AST decl node
- be_union_branch *ub = be_union_branch::narrow_from_decl (si->item ());
- if (ub)
- {
- // if the label is a case label, increment by 1
- for (unsigned long i = 0;
- i < ub->label_list_length ();
- ++i)
- {
- if (ub->label (i)->label_kind () ==
- AST_UnionLabel::UL_label)
- total_case_members++;
- }
- }
- si->next ();
- }
- delete si;
-
- // Check if the total_case_members cover the entire
- // range of values that are permitted by the discriminant type. If they do,
- // then a default value is not necessary. However, if such an explicit
- // default case is provided, it must be flagged off as an error. Our
- // front-end is not able to handle such a case since it is a semantic error
- // and not a syntax error. Such an error is caught here.
-
- switch (this->udisc_type ())
- {
- case AST_Expression::EV_short:
- case AST_Expression::EV_ushort:
- if (total_case_members == ACE_UINT16_MAX+1)
- this->default_value_.computed_ = 0;
- break;
- case AST_Expression::EV_long:
- case AST_Expression::EV_ulong:
- if ((unsigned int) total_case_members > ACE_UINT32_MAX)
- this->default_value_.computed_ = 0;
- break;
- case AST_Expression::EV_longlong:
- case AST_Expression::EV_ulonglong:
- // error for now
- this->default_value_.computed_ = -1;
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_union::compute_default_value ")
- ASYS_TEXT ("- unimplemented discriminant type ")
- ASYS_TEXT ("(longlong or ulonglong)\n")),
- -1);
- ACE_NOTREACHED (break;)
- case AST_Expression::EV_char:
- if (total_case_members == ACE_OCTET_MAX+1)
- this->default_value_.computed_ = 0;
- break;
- case AST_Expression::EV_bool:
- if (total_case_members == 2)
- this->default_value_.computed_ = 0;
- break;
- case AST_Expression::EV_any:
- // has to be enum
- {
- be_decl *d = be_decl::narrow_from_decl (this->disc_type ());
- if (d->node_type () == AST_Decl::NT_typedef)
- {
- be_typedef *bt = be_typedef::narrow_from_decl (d);
- d = bt->primitive_base_type ();
- }
- be_enum *en = be_enum::narrow_from_decl (d);
- if (en)
- {
- if (total_case_members == en->member_count ())
- this->default_value_.computed_ = 0;
- }
- else
- {
- // error
- this->default_value_.computed_ = -1;
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_union::")
- ASYS_TEXT ("compute_default_value ")
- ASYS_TEXT ("- disc type not an ENUM\n")),
- -1);
- }
- }
- break;
- default:
- // error
- this->default_value_.computed_ = -1;
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_union::compute_default_value ")
- ASYS_TEXT ("- Bad discriminant type\n")),
- -1);
- ACE_NOTREACHED (break;)
- } // end of switch
-
- // if we have determined that we don't need a default case and even then a
- // default case was provided, flag this off as error
- if ((this->default_value_.computed_ == 0) &&
- (this->default_index () != -1))
- {
- // error
- this->default_value_.computed_ = -1;
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_union::compute_default_value ")
- ASYS_TEXT ("- default clause is invalid here\n")),
- -1);
- }
-
- // proceed only if necessary
- switch (this->default_value_.computed_)
- {
- case -1:
- // error. We should never be here because errors have already been caught
- // above
- return -1;
- case 0:
- // nothing more to do
- return 0;
- default:
- // proceed further down
- break;
- }
-
- // initialization of the default value data member
- switch (this->udisc_type ())
- {
- case AST_Expression::EV_short:
- this->default_value_.u.short_val = ACE_INT16_MIN;
- break;
- case AST_Expression::EV_ushort:
- this->default_value_.u.ushort_val = 0;
- break;
- case AST_Expression::EV_long:
- this->default_value_.u.long_val = ACE_INT32_MIN;
- break;
- case AST_Expression::EV_ulong:
- this->default_value_.u.ulong_val = 0;
- break;
- case AST_Expression::EV_char:
- this->default_value_.u.char_val = 0;
- break;
- case AST_Expression::EV_bool:
- this->default_value_.u.bool_val = 0;
- break;
- case AST_Expression::EV_any:
- this->default_value_.u.enum_val = 0;
- break;
- case AST_Expression::EV_longlong:
- case AST_Expression::EV_ulonglong:
- // unimplemented
- default:
- // error caught earlier.
- break;
- } // end of switch
-
- // proceed until we have found the appropriate default value
- while (this->default_value_.computed_ == -2)
- {
- si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls);
- // instantiate a scope iterator.
-
- int break_loop = 0;
-
- while (!(si->is_done ()) && !break_loop)
- {
- // get the next AST decl node
- be_union_branch *ub = be_union_branch::narrow_from_decl (si->item ());
- if (ub)
- {
- for (unsigned long i = 0;
- i < ub->label_list_length () && !break_loop;
- ++i)
- {
- if (ub->label (i)->label_kind () == AST_UnionLabel::UL_label)
- {
- // not a default
- AST_Expression *expr = ub->label (i)->label_val ();
- if (!expr)
- {
- // error
- this->default_value_.computed_ = -1;
- ACE_ERROR_RETURN
- ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_union::")
- ASYS_TEXT ("compute_default_value - ")
- ASYS_TEXT ("Bad case label value\n")),
- -1);
- }
-
- switch (expr->ev ()->et)
- {
- // check if they match in which case this
- // cannot be the implicit default value. So
- // start with a new value and try the whole loop
- // again because our case labels may not be sorted
- case AST_Expression::EV_short:
- if (this->default_value_.u.short_val
- == expr->ev ()->u.sval)
- {
- this->default_value_.u.short_val++;
- break_loop = 1;
- }
- break;
- case AST_Expression::EV_ushort:
- if (this->default_value_.u.ushort_val
- == expr->ev ()->u.usval)
- {
- this->default_value_.u.ushort_val++;
- break_loop = 1;
- }
- break;
- case AST_Expression::EV_long:
- if (this->default_value_.u.long_val
- == expr->ev ()->u.lval)
- {
- this->default_value_.u.long_val++;
- break_loop = 1;
- }
- break;
- case AST_Expression::EV_ulong:
- if (this->default_value_.u.ulong_val
- == expr->ev ()->u.ulval)
- {
- this->default_value_.u.ulong_val++;
- break_loop = 1;
- }
- break;
- case AST_Expression::EV_char:
- if (this->default_value_.u.char_val
- == expr->ev ()->u.cval)
- {
- this->default_value_.u.char_val++;
- break_loop = 1;
- }
- break;
- case AST_Expression::EV_bool:
- if (this->default_value_.u.bool_val
- == expr->ev ()->u.bval)
- {
- this->default_value_.u.bool_val++;
- break_loop = 1;
- }
- break;
- case AST_Expression::EV_any:
- // this is the case of enums. We maintain
- // evaluated values which always start with 0
- if (this->default_value_.u.enum_val
- == expr->ev ()->u.eval)
- {
- this->default_value_.u.enum_val++;
- break_loop = 1;
- }
- break;
- case AST_Expression::EV_longlong:
- case AST_Expression::EV_ulonglong:
- // unimplemented. right now flag as error.
- default:
- // error
- break;
- } // end of switch
- } // if label_Kind == label
- } // end of for loop going thru all labels
- } // if valid union branch
- si->next ();
- } // end of while scope iterator loop
- delete si; // free the iterator object
-
- // we have not aborted the inner loops which means we have found the
- // default value
- if (!break_loop)
- this->default_value_.computed_ = 1;
-
- } // end of outer while
-
- return 0;
-}
-
-// visitor method
-
-int
-be_union::accept (be_visitor *visitor)
-{
- return visitor->visit_union (this);
-}
-
-// 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 2328d31b26d..00000000000
--- a/TAO/TAO_IDL/be/be_union_branch.cpp
+++ /dev/null
@@ -1,110 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_union_branch, "$Id$")
-
-
-/*
- * BE_UnionBranch
- */
-be_union_branch::be_union_branch (void)
-{
-}
-
-be_union_branch::be_union_branch (UTL_LabelList *ll, AST_Type *ft,
- UTL_ScopedName *n, UTL_StrList *p)
- : AST_UnionBranch (ll, ft, n, p),
- AST_Field (AST_Decl::NT_union_branch, ft, n, p),
- AST_Decl (AST_Decl::NT_union_branch, n, p)
-{
-}
-
-// compute the size type of the node in question
-int
-be_union_branch::compute_size_type (void)
-{
- be_type *type = be_type::narrow_from_decl (this->field_type ());
- if (!type)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_field::compute_size_type - "
- "bad field type\n"), -1);
- }
-
- // our size type is the same as our type
- this->size_type (type->size_type ()); // as a side effect will also update
- // the size type of parent
- return 0;
-}
-
-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;
-
- // 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->fullname () << "::" << e->n ();
- return 0;
-}
-
-int
-be_union_branch::accept (be_visitor *visitor)
-{
- return visitor->visit_union_branch (this);
-}
-
-// 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_label.cpp b/TAO/TAO_IDL/be/be_union_label.cpp
deleted file mode 100644
index aeab28d0d56..00000000000
--- a/TAO/TAO_IDL/be/be_union_label.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// $Id$
-//
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_union_label, "$Id$")
-
-
-/*
- * BE_UnionLabel
- */
-be_union_label::be_union_label()
-{
-}
-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);
-}
diff --git a/TAO/TAO_IDL/be/be_valuetype.cpp b/TAO/TAO_IDL/be/be_valuetype.cpp
deleted file mode 100644
index 0b6c04a7472..00000000000
--- a/TAO/TAO_IDL/be/be_valuetype.cpp
+++ /dev/null
@@ -1,728 +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 "idl.h"
-#include "idl_extern.h"
-// #include "be_visitor_valuetype.h"
-#include "be.h"
-
-#ifdef IDL_HAS_VALUETYPE
-
-ACE_RCSID(be, be_valuetype, "$Id$")
-
-/*
- * BE_Valuetype
- */
-
-// default constructor
-be_valuetype::be_valuetype (void)
- : full_obv_skel_name_ (0),
- abstract_ (0)
-{
- this->size_type (be_decl::VARIABLE); // always the case
- (AST_Module::narrow_from_scope (this->defined_in ()))->set_has_nested_valuetype ();
-}
-
-// constructor used to build the AST
-be_valuetype::be_valuetype (UTL_ScopedName *n, AST_Interface **ih, long nih,
- UTL_StrList *p, idl_bool set_abstract)
- : be_interface (n, ih, nih, p),
- AST_Interface (n, ih, nih, p),
- AST_Decl (AST_Decl::NT_interface, n, p), // its like an interface
- UTL_Scope (AST_Decl::NT_interface),
- full_obv_skel_name_ (0),
- abstract_ (set_abstract)
-{
- // check that redefine() copy all members !
- // ---
- this->size_type (be_decl::VARIABLE); // always the case
- (AST_Module::narrow_from_scope (this->defined_in ()))->set_has_nested_valuetype ();
-}
-
-be_valuetype::~be_valuetype (void)
-{
-
-}
-
-void
-be_valuetype::redefine (AST_Interface *from, UTL_StrList *p)
-{
- this->AST_Interface::redefine (from, p);
- abstract_ = from->is_abstract_valuetype();
-}
-
-// Is true if no-virtual accessor and modifier should be generated
-// If #pragma TAO OBV opt_accessor (todo) is used or -Wb,obv_opt_accessor
-idl_bool
-be_valuetype::opt_accessor ()
-{
- return idl_global->obv_opt_accessor ();
-}
-
-idl_bool
-be_valuetype::is_valuetype ()
-{
- return 1;
-}
-
-idl_bool
-be_valuetype::is_abstract_valuetype ()
-{
- return abstract_;
-}
-
-void
-be_valuetype::set_abstract_valuetype ()
-{
- abstract_ = 1;
-}
-
-// compute stringified fully scoped skeleton name (OBV_name)
-void
-be_valuetype::compute_fullobvskelname (void)
-{
- this->compute_fullskelname (this->full_obv_skel_name_, "OBV_");
-}
-
-
-// retrieve the fully scoped skeleton name
-const char*
-be_valuetype::full_obv_skel_name (void)
-{
- if (!this->full_obv_skel_name_)
- compute_fullobvskelname ();
-
- return this->full_obv_skel_name_;
-}
-
-
-
-// generate the var definition
-int
-be_valuetype::gen_var_defn (char *)
-{
- TAO_OutStream *ch; // output stream
- TAO_NL nl; // end line
- char namebuf [NAMEBUFSIZE]; // names
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (namebuf, "%s_var", this->local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ch = cg->client_header ();
-
- // generate the var definition (always in the client header).
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- ch->indent (); // start with whatever was our current indent level
- *ch << "class " << idl_global->export_macro ()
- << " " << namebuf << nl;
- *ch << "{" << nl;
- *ch << "public:\n";
- ch->incr_indent ();
-
- // default constr
- *ch << namebuf << " (void); // default constructor" << nl;
- *ch << namebuf << " (" << local_name () << "*);" << nl;
- *ch << namebuf << " (const " << local_name () << "*); // (TAO extension)" << nl;
-
- // copy constructor
- *ch << namebuf << " (const " << namebuf <<
- " &); // copy constructor" << nl;
-
- // destructor
- *ch << "~" << namebuf << " (void); // destructor" << nl;
- *ch << nl;
-
- // assignment operator from a pointer
- *ch << namebuf << " &operator= (" << local_name () << "*);" << nl;
-
- // assignment from _var
- *ch << namebuf << " &operator= (const " << namebuf <<
- " &);" << nl;
-
- // arrow operator
- *ch << local_name () << "* operator-> (void) const;" << nl;
-
- *ch << nl;
-
- // other extra types (cast operators, [] operator, and others)
- *ch << "operator const " << local_name () << "* () const;" << nl;
- *ch << "operator " << local_name () << "* ();" << nl;
-
-/* %! &() or () ?
- *ch << "operator const " << local_name () << "* &() const;" << nl;
- *ch << "operator " << local_name () << "* &();" << nl;
-*/
- *ch << "// in, inout, out, _retn " << nl;
- // the return types of in, out, inout, and _retn are based on the parameter
- // passing rules and the base type
- *ch << local_name () << "* in (void) const;" << nl;
- *ch << local_name () << "* &inout (void);" << nl;
- *ch << local_name () << "* &out (void);" << nl;
- *ch << local_name () << "* _retn (void);" << nl;
-
- // generate an additional member function that returns the underlying pointer
- *ch << local_name () << "* ptr (void) const;\n";
-
- *ch << "\n";
- ch->decr_indent ();
-
- // private
- *ch << "private:\n";
- ch->incr_indent ();
- *ch << local_name () << "* ptr_;\n";
-
- ch->decr_indent ();
- *ch << "};\n\n";
-
- return 0;
-}
-
-// implementation of the _var class. All of these get generated in the inline
-// file
-int
-be_valuetype::gen_var_impl (char *, char *)
-{
- TAO_OutStream *ci; // output stream
- TAO_NL nl; // end line
- char fname [NAMEBUFSIZE]; // to hold the full and
- char lname [NAMEBUFSIZE]; // local _var names
-
- ACE_OS::memset (fname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (fname, "%s_var", this->fullname ());
-
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (lname, "%s_var", local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ci = cg->client_inline ();
-
- // generate the var implementation in the inline file
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- ci->indent (); // start with whatever was our current indent level
-
- *ci << "// *************************************************************"
- << nl;
- *ci << "// Inline operations for class " << fname << nl;
- *ci << "// *************************************************************\n\n";
-
- // default constr
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname <<
- " (void) // default constructor" << nl;
- *ci << " " << ": ptr_ (0)" << nl;
- *ci << "{}\n\n";
-
- // constr from a pointer
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << name () << "* p)" << nl;
- *ci << " : ptr_ (p)" << nl;
- *ci << "{}\n\n";
-
- // constr from a const pointer
- // TAO extension - it appears that there are problems with at least g++
- // which reclaims amguity between T(T*) and T(const T_var &)
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (const " << name () << "* p)" << nl;
- *ci << " : ptr_ (ACE_const_cast(" << name() << "*, p))" << nl;
- *ci << "{}\n\n";
-
- // the additional ptr () member function. This member function must be
- // defined before the remaining member functions including the copy
- // constructor because this inline function is used elsewhere. Hence to make
- // inlining of this function possible, we must define it before its use.
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "* " << nl;
- *ci << fname << "::ptr (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // copy constructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (const " << fname <<
- " &p) // copy constructor" << nl;
- *ci << "{" << be_idt_nl
- << "CORBA::add_ref (p.ptr ());" << be_nl
- << "this->ptr_ = p.ptr ();" << be_uidt_nl
- << "}\n\n";
-
- // destructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::~" << lname << " (void) // destructor" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::remove_ref (this->ptr_);\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (" << name () <<
- "* p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::remove_ref (this->ptr_);" << nl;
- *ci << "this->ptr_ = p;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from _var
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << fname <<
- " &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "if (this != &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::remove_ref (this->ptr_);" << nl
- << local_name() << "* tmp = p.ptr ();" << be_nl
- << "CORBA::add_ref (tmp);" << be_nl
- << "this->ptr_ = tmp;\n";
- ci->decr_indent ();
- *ci << "}" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // other extra methods - cast operator ()
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator const " << name () <<
- "* () const // cast" << nl; // %! &() ?
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator " << name () << "* () // cast " << nl; // %! &()?
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // operator->
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "* " << nl;
- *ci << fname << "::operator-> (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // in, inout, out, and _retn
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "*" << nl;
- *ci << fname << "::in (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "* &" << nl;
- *ci << fname << "::inout (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "* &" << nl;
- *ci << fname << "::out (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::remove_ref (this->ptr_);" << nl;
- *ci << "this->ptr_ = 0;" << nl;
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "* " << nl;
- *ci << fname << "::_retn (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "// yield ownership of managed obj reference" << nl;
- *ci << local_name () << "* tmp = this->ptr_;" << nl;
- *ci << "this->ptr_ = 0;" << nl;
- *ci << "return tmp;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- return 0;
-}
-
-// generate the _out definition
-int
-be_valuetype::gen_out_defn (char *)
-{
- TAO_OutStream *ch; // output stream
- TAO_NL nl; // end line
- char namebuf [NAMEBUFSIZE]; // to hold the _out name
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (namebuf, "%s_out", local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ch = cg->client_header ();
-
- // generate the out definition (always in the client header)
- ch->indent (); // start with whatever was our current indent level
-
- *ch << "class " << idl_global->export_macro ()
- << " " << namebuf << nl;
- *ch << "{" << nl;
- *ch << "public:\n";
- ch->incr_indent ();
-
- // No default constructor
-
- // constructor from a pointer
- *ch << namebuf << " (" << local_name () << "* &);" << nl;
- // constructor from a _var &
- *ch << namebuf << " (" << local_name () << "_var &);" << nl;
- // constructor from a _out &
- *ch << namebuf << " (const " << namebuf << " &);" << nl;
- // assignment operator from a _out &
- *ch << namebuf << " &operator= (const " << namebuf << " &);" << nl;
- // assignment operator from a pointer &, cast operator, ptr fn, operator
- // -> and any other extra operators
- // only interface allows assignment from var &
- *ch << namebuf << " &operator= (const " << local_name () << "_var &);" << nl;
- *ch << namebuf << " &operator= (" << local_name () << "*);" << nl;
- // cast
- *ch << "operator " << local_name () << "* &();" << nl;
- // ptr fn
- *ch << local_name () << "* &ptr (void);" << nl;
- // operator ->
- *ch << local_name () << "* operator-> (void);" << nl;
-
- *ch << "\n";
- ch->decr_indent ();
- *ch << "private:\n";
- ch->incr_indent ();
- *ch << local_name () << "* &ptr_;\n";
-
- ch->decr_indent ();
- *ch << "};\n\n";
- return 0;
-}
-
-int
-be_valuetype::gen_out_impl (char *, char *)
-{
- TAO_OutStream *ci; // output stream
- TAO_NL nl; // end line
- 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_out", this->fullname ());
-
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (lname, "%s_out", local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ci = cg->client_inline ();
-
- // generate the var implementation in the inline file
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- ci->indent (); // start with whatever was our current indent level
-
- *ci << "// *************************************************************"
- << nl;
- *ci << "// Inline operations for class " << fname << nl;
- *ci << "// *************************************************************\n\n";
-
- // constr from a pointer
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << name () << "* &p)" << nl;
- *ci << " : ptr_ (p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = 0;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // constructor from _var &
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << this->name () <<
- "_var &p) // constructor from _var" << nl;
- *ci << " : ptr_ (p.out ())" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::remove_ref (this->ptr_);" << nl;
- *ci << "this->ptr_ = 0;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // copy constructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (const " << fname <<
- " &p) // copy constructor" << nl;
- *ci << " : ptr_ (ACE_const_cast (" << fname << "&,p).ptr_)" << nl;
- *ci << "{}\n\n";
-
- // assignment operator from _out &
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << fname <<
- " &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = ACE_const_cast (" << fname << "&,p).ptr_;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from _var
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << this->name () <<
- "_var &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << local_name() << "* tmp = p.ptr ();" << be_nl
- << "CORBA::add_ref (tmp);" << be_nl
- << "this->ptr_ = tmp;" << be_nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from *
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (" << this->name () <<
- "* p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = p;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // other extra methods - cast operator ()
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator " << this->name () <<
- "* &() // cast" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // ptr function
- ci->indent ();
- *ci << "ACE_INLINE " << this->name () << "* &" << nl;
- *ci << fname << "::ptr (void) // ptr" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // operator->
- ci->indent ();
- *ci << "ACE_INLINE " << this->name () << "* " << nl;
- *ci << fname << "::operator-> (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- return 0;
-}
-
-#if 0
-// generate typecode.
-// Typecode for interface comprises the enumerated value followed by the
-// encapsulation of the parameters
-
-int
-be_valuetype::gen_typecode (void)
-{
- ACE_ASSERT(0);
-
- TAO_OutStream *cs; // output stream
- TAO_NL nl; // end line
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- cs = cg->client_stubs ();
- cs->indent (); // start from whatever indentation level we were at
-
- *cs << "CORBA::tk_objref, // typecode kind" << nl;
- *cs << this->tc_encap_len () << ", // encapsulation length\n";
- // now emit the encapsulation
- return this->gen_encapsulation ();
-}
-
-// generate encapsulation
-// An encapsulation for ourselves will be necessary when we are part of some
-// other IDL type and a typecode for that other type is being generated. This
-// will comprise our typecode kind. IDL types with parameters will additionally
-// have the encapsulation length and the entire typecode description
-int
-be_valuetype::gen_encapsulation (void)
-{
- ACE_ASSERT (0);
-
- TAO_OutStream *cs; // output stream
- TAO_NL nl; // end line
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
- long i, arrlen;
- ACE_UINT32 *arr;
-
- cs = cg->client_stubs ();
- cs->indent (); // start from whatever indentation level we were at
-
- // XXXASG - byte order must be based on what m/c we are generating code -
- // TODO
- *cs << "TAO_ENCAP_BYTE_ORDER, // byte order" << nl;
- // generate repoID
- *cs << (ACE_OS::strlen (this->repoID ())+1) << ", ";
- (void)this->tc_name2long (this->repoID (), arr, arrlen);
- for (i=0; i < arrlen; i++)
- {
- cs->print ("ACE_NTOHL (0x%x), ", arr[i]);
- }
- *cs << " // repository ID = " << this->repoID () << nl;
- // generate name
- *cs << (ACE_OS::strlen (this->local_name ()->get_string ())+1) << ", ";
- (void)this->tc_name2long(this->local_name ()->get_string (), arr, arrlen);
- for (i=0; i < arrlen; i++)
- {
- cs->print ("ACE_NTOHL (0x%x), ", arr[i]);
- }
- *cs << " // name = " << this->local_name () << ",\n";
-
- return 0;
-}
-
-// compute size of typecode
-long
-be_valuetype::tc_size (void)
-{
- ACE_ASSERT (0);
-
- return 4 + 4 + this->tc_encap_len ();
-}
-
-// compute the encapsulation length
-long
-be_valuetype::tc_encap_len (void)
-{
- ACE_ASSERT (0);
-
- if (this->encap_len_ == -1) // not computed yet
- {
- long slen;
-
- // Macro to avoid "warning: unused parameter" type warning.
- ACE_UNUSED_ARG (slen);
-
- this->encap_len_ = 4; // holds the byte order flag
-
- this->encap_len_ += this->repoID_encap_len (); // for repoID
-
- // do the same thing for the local name
- this->encap_len_ += this->name_encap_len ();
-
- }
- return this->encap_len_;
-}
-#endif
-
-// for building the pre and postfix of private data fields
-const char*
-be_valuetype::field_pd_prefix ()
-{
- return "_pd_";
-}
-
-const char*
-be_valuetype::field_pd_postfix ()
-{
- return "";
-}
-
-be_valuetype*
-be_valuetype::statefull_inherit ()
-{
- be_valuetype *rval;
- if (this->n_inherits () > 0)
- {
- rval = be_valuetype::narrow_from_decl (this->inherits ()[0]);
- if (rval && (rval->is_valuetype ()) && (!rval->is_abstract_valuetype ()))
- return rval;
- }
- return 0;
-}
-
-// accept a visitor
-int
-be_valuetype::accept (be_visitor *visitor)
-{
- return visitor->visit_valuetype (this);
-}
-
-// Narrowing
-IMPL_NARROW_METHODS1 (be_valuetype, be_interface)
-IMPL_NARROW_FROM_DECL (be_valuetype)
-IMPL_NARROW_FROM_SCOPE (be_valuetype)
-
-#endif /* IDL_HAS_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 a7a1d35ea38..00000000000
--- a/TAO/TAO_IDL/be/be_valuetype_fwd.cpp
+++ /dev/null
@@ -1,529 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#ifdef IDL_HAS_VALUETYPE
-
-ACE_RCSID(be, be_interface_fwd, "$Id$")
-
-/*
- * BE_ValuetypeFwd
- */
-
-
-be_valuetype_fwd::be_valuetype_fwd (void)
-{
-}
-
-be_valuetype_fwd::be_valuetype_fwd (AST_Interface *dummy,
- UTL_ScopedName *n, UTL_StrList *p)
- : be_interface_fwd (dummy, n, p),
- AST_InterfaceFwd (dummy, n, p),
- AST_Decl (AST_Decl::NT_interface_fwd, n, p)
-{
-}
-
-be_valuetype_fwd::~be_valuetype_fwd (void)
-{
-}
-
-
-void
-be_valuetype_fwd::set_abstract_valuetype ()
-{
- this->full_definition()->set_abstract_valuetype();
-}
-
-// generate the var definition
-int
-be_valuetype_fwd::gen_var_defn (char *)
-{
- ACE_ASSERT (0);
- TAO_OutStream *ch; // output stream
- TAO_NL nl; // end line
- char namebuf [NAMEBUFSIZE]; // names
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (namebuf, "%s_var", this->local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ch = cg->client_header ();
-
- // generate the var definition (always in the client header).
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- ch->indent (); // start with whatever was our current indent level
- *ch << "class " << idl_global->export_macro ()
- << " " << namebuf << nl;
- *ch << "{" << nl;
- *ch << "public:\n";
- ch->incr_indent ();
-
- // default constr
- *ch << namebuf << " (void); // default constructor" << nl;
- *ch << namebuf << " (" << local_name () << "_ptr);" << nl;
-
- // copy constructor
- *ch << namebuf << " (const " << namebuf <<
- " &); // copy constructor" << nl;
-
- // destructor
- *ch << "~" << namebuf << " (void); // destructor" << nl;
- *ch << nl;
-
- // assignment operator from a pointer
- *ch << namebuf << " &operator= (" << local_name () << "_ptr);" << nl;
-
- // assignment from _var
- *ch << namebuf << " &operator= (const " << namebuf <<
- " &);" << nl;
-
- // arrow operator
- *ch << local_name () << "_ptr operator-> (void) const;" << nl;
-
- *ch << nl;
-
- // other extra types (cast operators, [] operator, and others)
- *ch << "operator const " << local_name () << "_ptr &() const;" << nl;
- *ch << "operator " << local_name () << "_ptr &();" << nl;
-
- *ch << "// in, inout, out, _retn " << nl;
- // the return types of in, out, inout, and _retn are based on the parameter
- // passing rules and the base type
- *ch << local_name () << "_ptr in (void) const;" << nl;
- *ch << local_name () << "_ptr &inout (void);" << nl;
- *ch << local_name () << "_ptr &out (void);" << nl;
- *ch << local_name () << "_ptr _retn (void);" << nl;
-
- // generate an additional member function that returns the underlying pointer
- *ch << local_name () << "_ptr ptr (void) const;\n";
-
- *ch << "\n";
- ch->decr_indent ();
-
- // private
- *ch << "private:\n";
- ch->incr_indent ();
- *ch << local_name () << "_ptr ptr_;\n";
-
- ch->decr_indent ();
- *ch << "};\n\n";
-
- return 0;
-}
-
-// implementation of the _var class. All of these get generated in the inline
-// file
-int
-be_valuetype_fwd::gen_var_impl (char *, char *)
-{
- ACE_ASSERT (0);
- TAO_OutStream *ci; // output stream
- TAO_NL nl; // end line
- char fname [NAMEBUFSIZE]; // to hold the full and
- char lname [NAMEBUFSIZE]; // local _var names
-
- ACE_OS::memset (fname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (fname, "%s_var", this->fullname ());
-
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (lname, "%s_var", local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ci = cg->client_inline ();
-
- // generate the var implementation in the inline file
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- ci->indent (); // start with whatever was our current indent level
-
- *ci << "// *************************************************************"
- << nl;
- *ci << "// Inline operations for class " << fname << nl;
- *ci << "// *************************************************************\n\n";
-
- // default constr
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname <<
- " (void) // default constructor" << nl;
- *ci << " " << ": ptr_ (" << this->name () << "::_nil ())" << nl;
- *ci << "{}\n\n";
-
- // constr from a _ptr
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << name () << "_ptr p)" << nl;
- *ci << " : ptr_ (p)" << nl;
- *ci << "{}\n\n";
-
- // the additional ptr () member function. This member function must be
- // defined before the remaining member functions including the copy
- // constructor because this inline function is used elsewhere. Hence to make
- // inlining of this function possible, we must define it before its use.
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "_ptr " << nl;
- *ci << fname << "::ptr (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // copy constructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (const " << fname <<
- " &p) // copy constructor" << nl;
- *ci << " : ptr_ (" << name () << "::_duplicate (p.ptr ()))" << nl;
- *ci << "{}\n\n";
-
- // destructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::~" << lname << " (void) // destructor" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::release (this->ptr_);\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (" << name () <<
- "_ptr p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::release (this->ptr_);" << nl;
- *ci << "this->ptr_ = p;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from _var
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << fname <<
- " &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "if (this != &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::release (this->ptr_);" << nl;
- *ci << "this->ptr_ = " << name () << "::_duplicate (p.ptr ());\n";
- ci->decr_indent ();
- *ci << "}" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // other extra methods - cast operator ()
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator const " << name () <<
- "_ptr &() const // cast" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator " << name () << "_ptr &() // cast " << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // operator->
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "_ptr " << nl;
- *ci << fname << "::operator-> (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // in, inout, out, and _retn
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "_ptr" << nl;
- *ci << fname << "::in (void) const" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "_ptr &" << nl;
- *ci << fname << "::inout (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "_ptr &" << nl;
- *ci << fname << "::out (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::release (this->ptr_);" << nl;
- *ci << "this->ptr_ = " << this->name () << "::_nil ();" << nl;
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- ci->indent ();
- *ci << "ACE_INLINE " << name () << "_ptr " << nl;
- *ci << fname << "::_retn (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "// yield ownership of managed obj reference" << nl;
- *ci << this->name () << "_ptr val = this->ptr_;" << nl;
- *ci << "this->ptr_ = " << this->name () << "::_nil ();" << nl;
- *ci << "return val;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- return 0;
-}
-
-// generate the _out definition
-int
-be_valuetype_fwd::gen_out_defn (char *)
-{
- ACE_ASSERT (0);
- TAO_OutStream *ch; // output stream
- TAO_NL nl; // end line
- char namebuf [NAMEBUFSIZE]; // to hold the _out name
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (namebuf, "%s_out", local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ch = cg->client_header ();
-
- // generate the out definition (always in the client header)
- ch->indent (); // start with whatever was our current indent level
-
- *ch << "class " << idl_global->export_macro ()
- << " " << namebuf << nl;
- *ch << "{" << nl;
- *ch << "public:\n";
- ch->incr_indent ();
-
- // No default constructor
-
- // constructor from a pointer
- *ch << namebuf << " (" << local_name () << "_ptr &);" << nl;
- // constructor from a _var &
- *ch << namebuf << " (" << local_name () << "_var &);" << nl;
- // constructor from a _out &
- *ch << namebuf << " (const " << namebuf << " &);" << nl;
- // assignment operator from a _out &
- *ch << namebuf << " &operator= (const " << namebuf << " &);" << nl;
- // assignment operator from a pointer &, cast operator, ptr fn, operator
- // -> and any other extra operators
- // only valuetype allows assignment from var &
- *ch << namebuf << " &operator= (const " << local_name () << "_var &);" << nl;
- *ch << namebuf << " &operator= (" << local_name () << "_ptr);" << nl;
- // cast
- *ch << "operator " << local_name () << "_ptr &();" << nl;
- // ptr fn
- *ch << local_name () << "_ptr &ptr (void);" << nl;
- // operator ->
- *ch << local_name () << "_ptr operator-> (void);" << nl;
-
- *ch << "\n";
- ch->decr_indent ();
- *ch << "private:\n";
- ch->incr_indent ();
- *ch << local_name () << "_ptr &ptr_;\n";
-
- ch->decr_indent ();
- *ch << "};\n\n";
-
- return 0;
-}
-
-int
-be_valuetype_fwd::gen_out_impl (char *, char *)
-{
- ACE_ASSERT (0);
- TAO_OutStream *ci; // output stream
- TAO_NL nl; // end line
- 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_out", this->fullname ());
-
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (lname, "%s_out", local_name ()->get_string ());
-
- // retrieve a singleton instance of the code generator
- TAO_CodeGen *cg = TAO_CODEGEN::instance ();
-
- ci = cg->client_inline ();
-
- // generate the var implementation in the inline file
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- ci->indent (); // start with whatever was our current indent level
-
- *ci << "// *************************************************************"
- << nl;
- *ci << "// Inline operations for class " << fname << nl;
- *ci << "// *************************************************************\n\n";
-
- // constr from a _ptr
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << name () << "_ptr &p)" << nl;
- *ci << " : ptr_ (p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = " << this->name () << "::_nil ();\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // constructor from _var &
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << this->name () <<
- "_var &p) // constructor from _var" << nl;
- *ci << " : ptr_ (p.out ())" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "CORBA::release (this->ptr_);" << nl;
- *ci << "this->ptr_ = " << this->name () << "::_nil ();\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // copy constructor
- ci->indent ();
- *ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (const " << fname <<
- " &p) // copy constructor" << nl;
- *ci << " : ptr_ (ACE_const_cast (" << fname
- << "&,p).ptr_)" << nl;
- *ci << "{}\n\n";
-
- // assignment operator from _out &
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << fname <<
- " &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = ACE_const_cast (" << fname << "&,p).ptr_;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from _var
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (const " << this->name () <<
- "_var &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = " << this->name () << "::_duplicate (p.ptr ());" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // assignment operator from _ptr
- ci->indent ();
- *ci << "ACE_INLINE " << fname << " &" << nl;
- *ci << fname << "::operator= (" << this->name () <<
- "_ptr p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "this->ptr_ = p;" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // other extra methods - cast operator ()
- ci->indent ();
- *ci << "ACE_INLINE " << nl;
- *ci << fname << "::operator " << this->name () <<
- "_ptr &() // cast" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // ptr function
- ci->indent ();
- *ci << "ACE_INLINE " << this->name () << "_ptr &" << nl;
- *ci << fname << "::ptr (void) // ptr" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- // operator->
- ci->indent ();
- *ci << "ACE_INLINE " << this->name () << "_ptr " << nl;
- *ci << fname << "::operator-> (void)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "return this->ptr_;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
-
- return 0;
-}
-
-int
-be_valuetype_fwd::accept (be_visitor *visitor)
-{
- return visitor->visit_valuetype_fwd (this);
-}
-
-// Narrowing
-IMPL_NARROW_METHODS1 (be_valuetype_fwd, be_interface_fwd)
-IMPL_NARROW_FROM_DECL (be_valuetype_fwd)
-
-#endif /* IDL_HAS_VALUETYPE */
diff --git a/TAO/TAO_IDL/be/be_visitor.cpp b/TAO/TAO_IDL/be/be_visitor.cpp
deleted file mode 100644
index 44376118d82..00000000000
--- a/TAO/TAO_IDL/be/be_visitor.cpp
+++ /dev/null
@@ -1,180 +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 "idl.h"
-#include "be.h"
-#include "be_visitor.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;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-int be_visitor::visit_valuetype (be_valuetype *)
-{
- return 0;
-}
-
-int be_visitor::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- return 0;
-}
-#endif /* IDL_HAS_VALUETYPE */
-
-int be_visitor::visit_structure (be_structure *)
-{
- 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_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_argument.cpp b/TAO/TAO_IDL/be/be_visitor_argument.cpp
deleted file mode 100644
index b6c726568ba..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_args.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Argument
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-// include all the individual files
-#include "be_visitor_argument/arglist.cpp"
-#include "be_visitor_argument/argument.cpp"
-#include "be_visitor_argument/docall_cs.cpp"
-#include "be_visitor_argument/marshal_ss.cpp"
-#include "be_visitor_argument/post_docall_cs.cpp"
-#include "be_visitor_argument/post_docall_compiled_cs.cpp"
-#include "be_visitor_argument/post_marshal_ss.cpp"
-#include "be_visitor_argument/post_upcall_ss.cpp"
-#include "be_visitor_argument/pre_docall_cs.cpp"
-#include "be_visitor_argument/pre_upcall_ss.cpp"
-#include "be_visitor_argument/upcall_ss.cpp"
-#include "be_visitor_argument/vardecl_ss.cpp"
-#include "be_visitor_argument/compiled_marshal_cs.cpp"
-#include "be_visitor_argument/compiled_marshal_ss.cpp"
-#include "be_visitor_argument/pre_invoke_cs.cpp"
-#include "be_visitor_argument/ami_arglist.cpp"
-#include "be_visitor_argument/ami_handler_arglist.cpp"
-#include "be_visitor_argument/ami_handler_result_arg.cpp"
-#include "be_visitor_argument/ami_handler_compiled_marshal_cs.cpp"
-#include "be_visitor_argument/ami_handler_upcall_cs.cpp"
-#include "be_visitor_argument/ami_handler_vardecl_cs.cpp"
-
-ACE_RCSID(be, be_visitor_argument, "$Id$")
-
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/ami_arglist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/ami_arglist.cpp
deleted file mode 100644
index 943b74b6a3f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/ami_arglist.cpp
+++ /dev/null
@@ -1,323 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// arglist.cpp
-//
-// = DESCRIPTION
-// Visitor that generates the parameters in an Operation signature
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, ami_arglist, "$Id$")
-
-
-// ************************************************************
-// be_visitor_args_arglist for parameter list in method declarations and
-// definitions for AMI stubs.
-// ************************************************************
-
-be_visitor_args_ami_arglist::be_visitor_args_ami_arglist (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_ami_arglist::~be_visitor_args_ami_arglist (void)
-{
-}
-
-int
-be_visitor_args_ami_arglist::visit_argument (be_argument *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- 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_arglist::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- os->indent (); // start with current indentation level
-
- // Different types have different mappings when used as in/out or
- // inout parameters. Let this visitor deal with the type
-
- int result = bt->accept (this);
- if (result == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_arglist::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- // Print the variable name only if the type was printed already.
- if (result)
- *os << " " << node->local_name () << ",\n";
-
- return 0;
-}
-
-int
-be_visitor_args_ami_arglist::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "const " << this->type_name (node);
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_arglist::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node);
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_arglist::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT: // inout
- *os << this->type_name (node, "_ptr");
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_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:
- case AST_Argument::dir_INOUT: // inout
- *os << this->type_name (node, "_ptr");
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_arglist::visit_native (be_native *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node);
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_arglist::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- // check if the type is an any
- if (node->pt () == AST_PredefinedType::PT_any)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "const " << this->type_name (node) << " &";
- return 1;
- /* NOT REACHED */
- }
- }
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node, "_ptr");
- return 1;
- /* NOT REACHED */
- } // end switch direction
- } // end else if
- else // simple predefined types
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node);
- return 1;
- /* NOT REACHED */
- } // end switch direction
- } // end of else
-
- return 0;
-}
-
-int
-be_visitor_args_ami_arglist::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "const " << this->type_name (node) << " &";
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_arglist::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "const char *";
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_arglist::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "const " << this->type_name (node) << " &";
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_arglist::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "const " << this->type_name (node) << " &";
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_arglist::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
-
- int result = node->primitive_base_type ()->accept (this);
- if (result == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_ami_arglist::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
-
- this->ctx_->alias (0);
-
- return result;
-}
-
-
-#ifdef IDL_HAS_VALUETYPE
-
-int
-be_visitor_args_ami_arglist::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " *";
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_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:
- case AST_Argument::dir_INOUT:
- *os << "const " << this->type_name (node) << " *";
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_arglist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_arglist.cpp
deleted file mode 100644
index 7eed73d1933..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_arglist.cpp
+++ /dev/null
@@ -1,321 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_arglist.cpp
-//
-// = DESCRIPTION
-// Visitor that generates the parameters in an operation of the AMI
-// Reply Handler.
-//
-// = AUTHOR
-// Aniruddha Gokhale and Alexander Babu Arulanthu
-// <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, ami_handler_arglist, "$Id$")
-
-
-// ************************************************************
-// Visitor for parameter list in AMI Handler call back declarations
-// and definitions.
-// ************************************************************
-
-be_visitor_args_ami_handler_arglist::be_visitor_args_ami_handler_arglist (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_ami_handler_arglist::~be_visitor_args_ami_handler_arglist (void)
-{
-}
-
-int
-be_visitor_args_ami_handler_arglist::visit_argument (be_argument *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- 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_ami_handler_arglist::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- os->indent (); // start with current indentation level
-
- // Different types have different mappings when used as in/out or
- // inout parameters. Let this visitor deal with the type
-
- int result = bt->accept (this);
- if (result == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_ami_handler_arglist::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- // Print the variable name only if the type was printed already.
- if (result)
- *os << " " << node->local_name () << ",\n";
-
- return 0;
-}
-
-int
-be_visitor_args_ami_handler_arglist::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << "const " << this->type_name (node);
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_handler_arglist::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << this->type_name (node);
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_handler_arglist::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_ptr");
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_handler_arglist::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_ptr");
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_handler_arglist::visit_native (be_native *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << this->type_name (node);
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_handler_arglist::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- // check if the type is an any
- if (node->pt () == AST_PredefinedType::PT_any)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << "const " << this->type_name (node) << " &";
- return 1;
- /* NOT REACHED */
- } // end switch direction
- } // end of if
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_ptr");
- return 1;
- /* NOT REACHED */
- } // end switch direction
- } // end else if
- else // simple predefined types
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << this->type_name (node);
- return 1;
- /* NOT REACHED */
- } // end switch direction
- } // end of else
-
- return 0;
-}
-
-int
-be_visitor_args_ami_handler_arglist::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << "const " << this->type_name (node) << " &";
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_handler_arglist::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << "const char *";
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_handler_arglist::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << "const " << this->type_name (node) << " &";
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_handler_arglist::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << "const " << this->type_name (node) << " &";
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_handler_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_ami_handler_arglist::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 0;
-}
-
-
-#ifdef IDL_HAS_VALUETYPE
-
-int
-be_visitor_args_ami_handler_arglist::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << this->type_name (node) << " *";
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-int
-be_visitor_args_ami_handler_arglist::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << "const " << this->type_name (node) << " *";
- return 1;
- /* NOT REACHED */
- }
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_compiled_marshal_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_compiled_marshal_cs.cpp
deleted file mode 100644
index 7f2031f7604..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_compiled_marshal_cs.cpp
+++ /dev/null
@@ -1,698 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_compiled_marshal_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating the code that passes arguments to the CDR operators
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, ami_handler_compiled_marshal_cs, "$Id$")
-
-
-// ****************************************************************************
-// visitor for arguments passing to the CDR operators.
-// ****************************************************************************
-
-be_visitor_args_ami_handler_compiled_marshal_cs::
-be_visitor_args_ami_handler_compiled_marshal_cs (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_ami_handler_compiled_marshal_cs::
-~be_visitor_args_ami_handler_compiled_marshal_cs (void)
-{
-}
-
-int be_visitor_args_ami_handler_compiled_marshal_cs::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 ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_ami_handler_compiled_marshal_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
-
- //TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGS_DEMARSHAL_CS)
-
- 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->indent ();
- *os << "(_tao_in >> ";
- 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->indent ();
- *os << "(_tao_out << ";
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_ami_handler_compiled_marshal_cs::"
- "visit_argument - "
- "Bad substate\n"),
- -1);
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_ami_handler_compiled_marshal_cs::"
- "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:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << ")";
- 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_ami_handler_compiled_marshal_cs::"
- "visit_argument - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_ami_handler_compiled_marshal_cs::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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_forany_" << arg->local_name ();
- 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 << node->name () << "_forany ("
- << "(" << node->name () << "_slice *)"
- << arg->local_name () << ")";
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_ami_handler_compiled_marshal_cs::"
- "visit_array - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_compiled_marshal_cs::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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 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_ami_handler_compiled_marshal_cs::"
- "visit_enum - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_compiled_marshal_cs::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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 () << ".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_ami_handler_compiled_marshal_cs::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_compiled_marshal_cs::visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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 () << "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_ami_handler_compiled_marshal_cs::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-int be_visitor_args_ami_handler_compiled_marshal_cs::visit_valuetype (be_valuetype *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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 () << ".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_ami_handler_compiled_marshal_cs::"
- "visit_valuetype - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_compiled_marshal_cs::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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 () << "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_ami_handler_compiled_marshal_cs::"
- "visit_valuetype_fwd - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-int be_visitor_args_ami_handler_compiled_marshal_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get argument node
-
- 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:
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- *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 << "CORBA::Any::to_char (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "CORBA::Any::to_wchar (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "CORBA::Any::to_boolean (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "CORBA::Any::to_octet (" << arg->local_name () << ")";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_marshal_ss::"
- "visit_predefined_type - "
- "Bad predefined type\n"),
- -1);
- }
- 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:
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- 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 << "CORBA::Any::from_char (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "CORBA::Any::from_wchar (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "CORBA::Any::from_boolean (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "CORBA::Any::from_octet (" << arg->local_name () << ")";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_marshal_cs::"
- "visit_predefined_type - "
- "Bad predefined type\n"),
- -1);
- }
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_ami_handler_compiled_marshal_cs::"
- "visit_array - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_compiled_marshal_cs::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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 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_ami_handler_compiled_marshal_cs::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_compiled_marshal_cs::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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:
- // 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
- {
- *os << "CORBA::Any::to_string ("
- << arg->local_name () << ".out (), "
- << node->max_size ()->ev ()->u.ulval - 1
- << ")";
- }
- 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_ami_handler_compiled_marshal_cs::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_compiled_marshal_cs::visit_structure (be_structure *node)
-{
- ACE_UNUSED_ARG (node);
-
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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 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_ami_handler_compiled_marshal_cs::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_compiled_marshal_cs::visit_union (be_union *node)
-{
- ACE_UNUSED_ARG (node);
-
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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 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_ami_handler_compiled_marshal_cs::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_ami_handler_compiled_marshal_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_ami_handler_compiled_marshal_cs::"
- "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/ami_handler_result_arg.cpp b/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_result_arg.cpp
deleted file mode 100644
index 9a2b8872e9a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_result_arg.cpp
+++ /dev/null
@@ -1,179 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_result_arg.cpp
-//
-// = DESCRIPTION
-// Visitor that generates the result argument in a call back method
-// of a Reply Handler.
-//
-// = AUTHOR
-// Aniruddha Gokhale and Alexander Babu Arulanthu
-// <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_args, ami_handler_result_arg, "$Id$")
-
-
-// ************************************************************
-// Visitor for parameter list in AMI Handler call back declarations
-// and definitions.
-// ************************************************************
-
-be_visitor_args_ami_handler_result_arg::be_visitor_args_ami_handler_result_arg (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_ami_handler_result_arg::~be_visitor_args_ami_handler_result_arg (void)
-{
-}
-
-int
-be_visitor_args_ami_handler_result_arg::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- *os << "const " << this->type_name (node) << " _tao_retval, ";
- return 1;
-}
-
-int
-be_visitor_args_ami_handler_result_arg::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- *os << this->type_name (node) << " _tao_retval";
- return 1;
-}
-
-int
-be_visitor_args_ami_handler_result_arg::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- *os << this->type_name (node, "_ptr") << " _tao_retval";
- return 1;
-}
-
-int
-be_visitor_args_ami_handler_result_arg::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- *os << this->type_name (node, "_ptr") << " _tao_retval";
- return 1;
-}
-
-int
-be_visitor_args_ami_handler_result_arg::visit_native (be_native *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- *os << this->type_name (node) << " _tao_retval";
- return 1;
-}
-
-int
-be_visitor_args_ami_handler_result_arg::visit_predefined_type (be_predefined_type *node)
-{
-
- // Nothing to do if the return type is void.
- if (node->pt () == AST_PredefinedType::PT_void)
- return 0;
-
- // Get output stream.
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Check if the type is an any.
- if (node->pt () == AST_PredefinedType::PT_any)
- {
- *os << "const " << this->type_name (node) << " &" << " _tao_retval";
- }
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
- {
- *os << this->type_name (node, "_ptr") << " _tao_retval";
- }
- else
- {
- *os << this->type_name (node) << " _tao_retval";
- }
-
- return 1;
-}
-
-int
-be_visitor_args_ami_handler_result_arg::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- *os << "const " << this->type_name (node) << " &" << " _tao_retval";
- return 1;
-}
-
-int
-be_visitor_args_ami_handler_result_arg::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- *os << "const char *" << " _tao_retval";
- return 1;
-}
-
-int
-be_visitor_args_ami_handler_result_arg::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- *os << "const " << this->type_name (node) << " &" << " _tao_retval";
- return 1;
-}
-
-int
-be_visitor_args_ami_handler_result_arg::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- *os << "const " << this->type_name (node) << " &" << " _tao_retval";
- return 1;
-}
-
-int
-be_visitor_args_ami_handler_result_arg::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_ami_handler_result_arg::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 1;
-}
-
-
-#ifdef IDL_HAS_VALUETYPE
-
-int
-be_visitor_args_ami_handler_result_arg::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- *os << this->type_name (node) << " *" << " _tao_retval";
- return 1;
-}
-
-int
-be_visitor_args_ami_handler_result_arg::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- *os << "const " << this->type_name (node) << " *" << " _tao_retval";
- return 1;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_upcall_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_upcall_cs.cpp
deleted file mode 100644
index 344d2a61ce0..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_upcall_cs.cpp
+++ /dev/null
@@ -1,382 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_upcall_cs.cpp
-//
-// = DESCRIPTION
-// Visitor that generates code that passes argument variables to the
-// upcall.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-// Michael Kircher
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, upcall_cs, "$Id$")
-
-
-// ************************************************************************
-// visitor for passing arguments to the upcall
-// ************************************************************************
-
-be_visitor_args_ami_handler_upcall_cs::be_visitor_args_ami_handler_upcall_cs (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_ami_handler_upcall_cs::~be_visitor_args_ami_handler_upcall_cs (void)
-{
-}
-
-int be_visitor_args_ami_handler_upcall_cs::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_ami_handler_upcall_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
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_ami_handler_upcall_cs::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_ami_handler_upcall_cs::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_OUT:
- case AST_Argument::dir_INOUT:
- /*if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_upcall_cs)
- *os << arg->local_name ();
- else
- */
- os->indent ();
- if (node->size_type () == be_decl::VARIABLE)
- *os << arg->local_name () << ".in ()";
- else
- *os << arg->local_name ();
- break;
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_upcall_cs::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << arg->local_name ();
- break;
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_upcall_cs::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- /*if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_upcall_cs)
- *os << arg->local_name ();
- else
- */
- os->indent ();
- *os << arg->local_name () << ".in ()";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_upcall_cs::visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- /*if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_upcall_cs)
- *os << arg->local_name ();
- else
- */
- os->indent ();
- *os << arg->local_name () << ".in ()";
- break;
- }
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-int be_visitor_args_ami_handler_upcall_cs::visit_valuetype (be_valuetype *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- /*if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_upcall_cs)
- *os << arg->local_name ();
- else
- */
- os->indent ();
- *os << arg->local_name () << ".in ()";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_upcall_cs::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- /*if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_upcall_cs)
- *os << arg->local_name ();
- else
- */
- os->indent ();
- *os << arg->local_name () << ".in ()";
- break;
- }
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-
-int be_visitor_args_ami_handler_upcall_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // check if the type is an any
- if (node->pt () == AST_PredefinedType::PT_any)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- /*
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_upcall_cs)
- *os << arg->local_name ();
- else
- */
- os->indent ();
- *os << arg->local_name () << ".in ()";
- break;
- } // end switch direction
- } // end of if
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- /*if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_upcall_cs)
- *os << arg->local_name ();
- else
- */
- os->indent ();
- *os << arg->local_name () << ".in ()";
- break;
- } // end switch direction
- } // end else if
- else // simple predefined types
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << arg->local_name ();
- break;
- } // end switch direction
- } // end of else
-
- return 0;
-}
-
-int be_visitor_args_ami_handler_upcall_cs::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- /*if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_upcall_cs)
- *os << arg->local_name ();
- else
- */
- os->indent ();
- *os << arg->local_name () << ".in ()";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_upcall_cs::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // If we use it in conjunction with AMI Reply Handlers we do
- // not want to generate declarations for IN arguments
- if (this->direction () == AST_Argument::dir_IN
- && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS)
- return 0;
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- /*
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_upcall_cs)
- *os << arg->local_name ();
- else
- */
- os->indent ();
- *os << arg->local_name () << ".in ()";
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_upcall_cs::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- if (node->size_type () == be_decl::VARIABLE)
- *os << arg->local_name () << ".in ()";
- else
- *os << arg->local_name ();
- break;
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_upcall_cs::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- if (node->size_type () == be_decl::VARIABLE)
- *os << arg->local_name () << ".in ()";
- else
- *os << arg->local_name ();
- break;
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_upcall_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_ami_handler_upcall_cs::"
- "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/ami_handler_vardecl_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_vardecl_cs.cpp
deleted file mode 100644
index 820cd915573..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_vardecl_cs.cpp
+++ /dev/null
@@ -1,509 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_vardecl_cs.cpp
-//
-// = DESCRIPTION
-// Visitor that generates the variable declaration in the skeleton
-// corresponding to the Argument node
-//
-// = AUTHOR
-// Aniruddha Gokhale
-// Michael Kircher
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, ami_handler_vardecl_cs, "$Id$")
-
-
-// ************************************************************************
-// Visitor to generate code for argument variable declaration
-// ************************************************************************
-
-be_visitor_args_ami_handler_vardecl_cs::be_visitor_args_ami_handler_vardecl_cs (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_ami_handler_vardecl_cs::~be_visitor_args_ami_handler_vardecl_cs (void)
-{
-}
-
-int be_visitor_args_ami_handler_vardecl_cs::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_ami_handler_vardecl_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
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_ami_handler_vardecl_cs::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_ami_handler_vardecl_cs::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *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
- << ");\n" << be_uidt;
- break;
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_vardecl_cs::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << bt->name () << " " << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_vardecl_cs::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << "_var " << arg->local_name () << ";" << be_nl;
- *os << "CORBA::Object_var _tao_base_var_" << arg->local_name ()
- << ";" << be_nl;
- *os << "CORBA::Object_ptr &_tao_base_ptr_" << arg->local_name ()
- << " = _tao_base_var_" << arg->local_name () << ".out ();\n";
-#endif
- *os << bt->name () << "_var " << arg->local_name () << ";" << be_nl;
- *os << "CORBA::Object_var _tao_base_var_" << arg->local_name ()
- << ";\n";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_vardecl_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << "_var " << arg->local_name () << ";" << be_nl;
- *os << "CORBA::Object_var _tao_base_var_" << arg->local_name ()
- << ";" << be_nl;
- *os << "CORBA::Object_ptr &_tao_base_ptr_" << arg->local_name ()
- << " = _tao_base_var_" << arg->local_name () << ".out ();\n";
-#endif
- *os << bt->name () << "_var " << arg->local_name () << ";" << be_nl;
- *os << "CORBA::Object_var _tao_base_var_" << arg->local_name ()
- << ";\n";
- break;
- }
- return 0;
-}
-
-
-#ifdef IDL_HAS_VALUETYPE
-
-int be_visitor_args_ami_handler_vardecl_cs::visit_valuetype (be_valuetype *)
-{
- return -1;
-}
-
-int be_visitor_args_ami_handler_vardecl_cs::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- return -1;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-int be_visitor_args_ami_handler_vardecl_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- // check if the type is an any
- if (node->pt () == AST_PredefinedType::PT_any)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << bt->name () << " " << arg->local_name () << ";\n";
- break;
- } // end switch direction
- } // end of if
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << "_var " << arg->local_name ()
- << ";" << be_nl;
- *os << bt->name () << "_ptr &_tao_ptr_" << arg->local_name ()
- << " = " << arg->local_name () << ".out ();\n";
-#endif
- *os << bt->name () << "_var " << arg->local_name ()
- << ";\n";
- break;
- } // end switch direction
- } // end else if
- else // simple predefined types
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << bt->name () << " " << arg->local_name () << ";\n";
- break;
- } // end switch direction
- } // end of else
-
- return 0;
-}
-
-int be_visitor_args_ami_handler_vardecl_cs::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << bt->name () << " " << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_vardecl_cs::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
-#if 0 /* ASG */
- *os << "CORBA::String_var _tao_var_"
- << arg->local_name () << ";" << be_nl;
- *os << "char *&" << arg->local_name () << " = _tao_var_"
- << arg->local_name () << ".out ();" << be_nl;
-#endif
- *os << "CORBA::String_var "
- << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_vardecl_cs::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << bt->name () << " " << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_vardecl_cs::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << bt->name () << " " << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_ami_handler_vardecl_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_ami_handler_vardecl_cs::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 0;
-}
-
-
-// ************************************************************************
-// Visitor to generate code for argument variable declaration for compiled
-// marshaling. This provides only the overriden methods. The rest is handled by
-// the base class that works for interpretiveskeletons.
-// ************************************************************************
-
-be_compiled_visitor_args_ami_handler_vardecl_cs::
-be_compiled_visitor_args_ami_handler_vardecl_cs (be_visitor_context *ctx)
- : be_visitor_args_ami_handler_vardecl_cs (ctx)
-{
-}
-
-be_compiled_visitor_args_ami_handler_vardecl_cs::~be_compiled_visitor_args_ami_handler_vardecl_cs (void)
-{
-}
-
-int be_compiled_visitor_args_ami_handler_vardecl_cs::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << bt->name () << "_var " << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-int be_compiled_visitor_args_ami_handler_vardecl_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << bt->name () << "_var " << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-
-#ifdef IDL_HAS_VALUETYPE
-
-int be_compiled_visitor_args_ami_handler_vardecl_cs::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << bt->name () << "_var " << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-int
-be_compiled_visitor_args_ami_handler_vardecl_cs::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << bt->name () << "_var " << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
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 0463198b3b8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp
+++ /dev/null
@@ -1,357 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// arglist.cpp
-//
-// = DESCRIPTION
-// Visitor that generates the parameters in an Operation signature
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-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 (); // get output stream
- 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_arglist::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- os->indent (); // start with current indentation level
-
- // 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_native (be_native *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) << " &";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_arglist::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- // check if the type is an any
- if (node->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;
- } // end switch direction
- } // end of if
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << this->type_name (node, "_ptr");
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node, "_ptr") << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- } // end switch direction
- } // end else if
- else // simple predefined types
- {
- 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;
- } // end switch direction
- } // end of else
-
- return 0;
-}
-
-int be_visitor_args_arglist::visit_sequence (be_sequence *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_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- 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;
- }
- return 0;
-}
-
-int be_visitor_args_arglist::visit_structure (be_structure *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_union (be_union *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_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;
-}
-
-
-#ifdef IDL_HAS_VALUETYPE
-
-int be_visitor_args_arglist::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the 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_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;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
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 22e77c1924a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// argument.cpp
-//
-// = DESCRIPTION
-// generic visitor for Argument node
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, argument, "$Id$")
-
-be_visitor_args::be_visitor_args (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-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; // type to use
-
- // 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;
-
- // generate the NESTED_CLASS macro i.e., a relative path name to satisfy the
- // MSVC++ compiler
- switch (this->ctx_->stream ()->stream_type ())
- {
- case TAO_OutStream::TAO_CLI_HDR:
- ACE_OS::sprintf (namebuf, "%s", bt->nested_type_name
- (this->ctx_->scope (), suffix));
- break;
- default: // fullname for all other cases
- ACE_OS::sprintf (namebuf, "%s", bt->fullname ());
- 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)
-{
- // 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 ();
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/compiled_marshal_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/compiled_marshal_cs.cpp
deleted file mode 100644
index 18cae73c4c9..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/compiled_marshal_cs.cpp
+++ /dev/null
@@ -1,777 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// compiled_marshal_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating the code that passes arguments to the CDR operators
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, compiled_marshal_cs, "$Id$")
-
-
-// ****************************************************************************
-// visitor for arguments passing to the CDR operators.
-// ****************************************************************************
-
-be_visitor_args_compiled_marshal_cs::
-be_visitor_args_compiled_marshal_cs (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_compiled_marshal_cs::
-~be_visitor_args_compiled_marshal_cs (void)
-{
-}
-
-int be_visitor_args_compiled_marshal_cs::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 ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_marshal_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
-
- os->indent ();
-
- 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_compiled_marshal_cs::"
- "visit_argument - "
- "Bad substate\n"),
- -1);
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_marshal_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_compiled_marshal_cs::"
- "visit_argument - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_cs::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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:
- *os << "_tao_argument_" << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- if (node->size_type () == be_decl::VARIABLE)
- {
- *os << "_tao_argument_" << arg->local_name ();
- }
- else
- {
- *os << "_tao_argument_" << arg->local_name ();
- }
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_marshal_cs::"
- "visit_array - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_cs::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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_compiled_marshal_cs::"
- "visit_enum - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_cs::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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_compiled_marshal_cs::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_cs::visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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_compiled_marshal_cs::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-int be_visitor_args_compiled_marshal_cs::visit_valuetype (be_valuetype *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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_compiled_marshal_cs::"
- "visit_valuetype - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int
-be_visitor_args_compiled_marshal_cs::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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_compiled_marshal_cs::"
- "visit_valuetype - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-int be_visitor_args_compiled_marshal_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get argument node
-
- 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_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 << "CORBA::Any::from_char (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "CORBA::Any::from_wchar (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "CORBA::Any::from_boolean (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "CORBA::Any::from_octet (" << arg->local_name () << ")";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_marshal_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_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 << "CORBA::Any::to_char (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "CORBA::Any::to_wchar (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "CORBA::Any::to_boolean (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "CORBA::Any::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:
- *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 << "CORBA::Any::to_char (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "CORBA::Any::to_wchar (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "CORBA::Any::to_boolean (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "CORBA::Any::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;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_marshal_cs::"
- "visit_array - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_cs::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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_compiled_marshal_cs::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_cs::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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:
- *os << "CORBA::Any::to_string ("
- << arg->local_name () << ", "
- << node->max_size ()->ev ()->u.ulval - 1 << ")";
- break;
- case AST_Argument::dir_OUT:
- *os << "CORBA::Any::to_string ("
- << arg->local_name () << ".ptr (), "
- << node->max_size ()->ev ()->u.ulval - 1 << ")";
- break;
- }
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_marshal_cs::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_cs::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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 () == be_decl::VARIABLE)
- *os << "*" << arg->local_name () << ".ptr ()";
- else
- *os << arg->local_name ();
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_marshal_cs::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_cs::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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 () == be_decl::VARIABLE)
- *os << "*" << arg->local_name () << ".ptr ()";
- else
- *os << arg->local_name ();
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_marshal_cs::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_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_compiled_marshal_cs::"
- "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/compiled_marshal_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/compiled_marshal_ss.cpp
deleted file mode 100644
index 3a81f4c227a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/compiled_marshal_ss.cpp
+++ /dev/null
@@ -1,769 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// compiled_marshal_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating the code that passes arguments to the CDR operators
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, compiled_marshal_ss, "$Id$")
-
-
-// ****************************************************************************
-// visitor for arguments passing to the CDR operators.
-// ****************************************************************************
-
-be_visitor_args_compiled_marshal_ss::
-be_visitor_args_compiled_marshal_ss (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_compiled_marshal_ss::
-~be_visitor_args_compiled_marshal_ss (void)
-{
-}
-
-int be_visitor_args_compiled_marshal_ss::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 ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_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 (); // get output 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->indent ();
- *os << "(_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->indent ();
- *os << "(_tao_out << ";
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_marshal_ss::"
- "visit_argument - "
- "Bad substate\n"),
- -1);
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_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_compiled_marshal_ss::"
- "visit_argument - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_ss::visit_array (be_array *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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_compiled_marshal_ss::"
- "visit_array - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_ss::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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_compiled_marshal_ss::"
- "visit_enum - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_ss::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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_compiled_marshal_ss::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_ss::visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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_compiled_marshal_ss::"
- "visit_interface_fwd - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-int be_visitor_args_compiled_marshal_ss::visit_valuetype (be_valuetype *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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_compiled_marshal_ss::"
- "visit_valuetype - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_ss::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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_compiled_marshal_ss::"
- "visit_valuetype_fwd - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-int be_visitor_args_compiled_marshal_ss::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get argument node
-
- 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:
- *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 << "CORBA::Any::to_char (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "CORBA::Any::to_wchar (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "CORBA::Any::to_boolean (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "CORBA::Any::to_octet (" << arg->local_name () << ")";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_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:
- *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 << "CORBA::Any::from_char (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "CORBA::Any::from_wchar (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "CORBA::Any::from_boolean (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "CORBA::Any::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:
- *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 << "CORBA::Any::from_char (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "CORBA::Any::from_wchar (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "CORBA::Any::from_boolean (" << arg->local_name () << ")";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "CORBA::Any::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_compiled_marshal_ss::"
- "visit_array - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_ss::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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_compiled_marshal_ss::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_ss::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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
- {
- *os << "CORBA::Any::to_string ("
- << arg->local_name () << ".out (), "
- << node->max_size ()->ev ()->u.ulval - 1
- << ")";
- }
- 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:
- *os << "CORBA::Any::from_string ((char *)"
- << arg->local_name () << ".in (), "
- << node->max_size ()->ev ()->u.ulval - 1 << ")";
- break;
- }
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_marshal_ss::"
- "visit_string - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_ss::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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 () == be_decl::VARIABLE)
- *os << arg->local_name () << ".in ()";
- else
- *os << arg->local_name ();
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_marshal_ss::"
- "visit_structure - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_args_compiled_marshal_ss::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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 () == be_decl::VARIABLE)
- *os << arg->local_name () << ".in ()";
- else
- *os << arg->local_name ();
- break;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_compiled_marshal_ss::"
- "visit_union - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_compiled_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_compiled_marshal_ss::"
- "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/docall_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/docall_cs.cpp
deleted file mode 100644
index 2c8fdc8592b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/docall_cs.cpp
+++ /dev/null
@@ -1,325 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// docall_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating the code that passes arguments to the do_static_call
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, docall_cs, "$Id$")
-
-
-// ****************************************************************************
-// visitor for argument passing to do_static_call. The do_static_call
-// method takes an array with pointers to each argument (the type is
-// actually void*). The total number of parameters is determined by the
-// "calldata" parameter that must be passed before the variable list
-// starts.
-// Hence we pass the address of each argument. The case for _out is a bit
-// tricky where we must first retrieve the pointer, allocate memory
-// and pass it to do_static_call. This is done in the
-// "pre_do_static_call" processing.
-// ****************************************************************************
-
-be_visitor_args_docall_cs::be_visitor_args_docall_cs (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_docall_cs::~be_visitor_args_docall_cs (void)
-{
-}
-
-int be_visitor_args_docall_cs::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 ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_docall_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
- os->indent ();
- *os << "*_tao_arg = ";
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_docall_cs::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- *os << "; _tao_arg++;\n";
-
- return 0;
-}
-
-int be_visitor_args_docall_cs::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- 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 () == be_type::VARIABLE)
- // pass reference to the pointer to slice
- // *os << "_tao_base_" << arg->local_name ();
- *os << arg->local_name () << ".ptr ()";
- else
- *os << arg->local_name ();
- break;
- }
- return 0;
-}
-
-int be_visitor_args_docall_cs::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- // pass the address. Storage is already allocated
- *os << "&" << arg->local_name ();
- break;
- }
- return 0;
-}
-
-int be_visitor_args_docall_cs::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << "&_tao_base_" << arg->local_name ();
- break;
- }
- return 0;
-}
-
-int be_visitor_args_docall_cs::visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << "&_tao_base_" << arg->local_name ();
- break;
- }
- return 0;
-}
-
-int be_visitor_args_docall_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get argument node
-
- os->indent ();
- // check if the type is an any
- if (node->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:
- //*os << "_tao_base_" << arg->local_name ();
- *os << arg->local_name () << ".ptr ()";
- break;
- } // end switch direction
- } // end of if any
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g.,
- // CORBA::Object,
- // CORBA::TypeCode
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "&" << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- //*os << "&_tao_base_" << arg->local_name ();
- *os << "&" << arg->local_name () << ".ptr ()";
- break;
- } // end switch direction
- } // end else if pseudo
- else // simple predefined types
- {
- 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_docall_cs::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "&" << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- // *os << "_tao_base_" << arg->local_name ();
- *os << arg->local_name () << ".ptr ()";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_docall_cs::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "&" << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- //*os << "&_tao_base_" << arg->local_name ();
- *os << "&" << arg->local_name () << ".ptr ()";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_docall_cs::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "&" << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- {
- // check if the size type is VARIABLE
- if (node->size_type () == be_type::VARIABLE)
- // *os << "_tao_base_" << arg->local_name ();
- *os << arg->local_name () << ".ptr ()";
- else
- *os << "&" << arg->local_name ();
- }
- break;
- }
- return 0;
-}
-
-int be_visitor_args_docall_cs::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << "&" << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- {
- // check if the size type is VARIABLE
- if (node->size_type () == be_type::VARIABLE)
- //*os << "_tao_base_" << arg->local_name ();
- *os << arg->local_name () << ".ptr ()";
- else
- *os << "&" << arg->local_name ();
- }
- break;
- }
- return 0;
-}
-
-int be_visitor_args_docall_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_docall_cs::"
- "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/marshal_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp
deleted file mode 100644
index 4f20c0d2362..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp
+++ /dev/null
@@ -1,310 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-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); // 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_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
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_marshal_ss::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_marshal_ss::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- os->indent ();
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
- if (node->size_type () == be_type::VARIABLE)
- {
- *os << arg->local_name () << ".inout ()";
- }
- else
- {
- *os << arg->local_name ();
- }
- break;
- }
- return 0;
-}
-
-int be_visitor_args_marshal_ss::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << "&" << arg->local_name ();
- break;
- }
- return 0;
-}
-
-int be_visitor_args_marshal_ss::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << "&_tao_base_var_" << arg->local_name () << ".inout ()";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_marshal_ss::visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << "&_tao_base_var_" << arg->local_name () << ".inout ()";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_marshal_ss::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- // check if the type is an any
- if (node->pt () == AST_PredefinedType::PT_any)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- os->indent ();
- *os << "&" << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
- // *os << "_tao_ptr_" << arg->local_name ();
- *os << "&" << arg->local_name () << ".inout ()";
- break;
- } // end switch direction
- } // end of if
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- // *os << "&_tao_ptr_" << arg->local_name ();
- *os << "&" << arg->local_name () << ".inout ()";
- break;
- } // end switch direction
- } // end else if
- else // simple predefined types
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << "&" << arg->local_name ();
- break;
- } // end switch direction
- } // end of else
-
- return 0;
-}
-
-int be_visitor_args_marshal_ss::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- os->indent ();
- *os << "&" << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
- // *os << "_tao_ptr_" << arg->local_name ();
- *os << "&" << arg->local_name () << ".inout ()";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_marshal_ss::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- os->indent ();
- *os << "&" << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
- // *os << "&_tao_ptr_" << arg->local_name ();
- *os << "&" << arg->local_name () << ".inout ()";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_marshal_ss::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- os->indent ();
- *os << "&" << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
- if (node->size_type () == be_type::VARIABLE)
- // *os << "_tao_ptr_" << arg->local_name ();
- *os << "&" << arg->local_name () << ".inout ()";
- else
- *os << "&" << arg->local_name ();
- break;
- }
- return 0;
-}
-
-int be_visitor_args_marshal_ss::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- os->indent ();
- *os << "&" << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
- if (node->size_type () == be_type::VARIABLE)
- // *os << "_tao_ptr_" << arg->local_name ();
- *os << "&" << arg->local_name () << ".inout ()";
- else
- *os << "&" << arg->local_name ();
- break;
- }
- return 0;
-}
-
-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;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/post_docall_compiled_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/post_docall_compiled_cs.cpp
deleted file mode 100644
index 248523c8d3d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/post_docall_compiled_cs.cpp
+++ /dev/null
@@ -1,207 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// post_docall_compiled_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for post-processing of arguments following a
-// do_static_call, when compiled marshaling (default) is enabled.
-//
-// = AUTHOR
-// Jeff Parsons
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-
-// *************************************************************************
-// visitor for argument to do any post docall processing. Not all types need
-// this. Only those that have an _out type need this. In addition, interfaces
-// need it because we need to convert from the interface type to the base Object
-// type and vice versa.
-// *************************************************************************
-
-be_visitor_args_post_docall_compiled_cs::be_visitor_args_post_docall_compiled_cs
-(be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_post_docall_compiled_cs::~be_visitor_args_post_docall_compiled_cs (void)
-{
-}
-
-int
-be_visitor_args_post_docall_compiled_cs::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 ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_pre_docall_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
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_post_docall_compiled_cs::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_args_post_docall_compiled_cs::visit_interface (be_interface *)
-{
- // we must narrow the out object reference to the appropriate type
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- {
- os->indent ();
- // assign the narrowed obj reference
- *os << "CORBA::release (" << arg->local_name ()
- << ");\n";
- }
- break;
- default:
- break;
- }
- return 0;
-}
-
-int
-be_visitor_args_post_docall_compiled_cs::visit_interface_fwd (be_interface_fwd *)
-{
- // we must narrow the out object reference to the appropriate type
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- {
- os->indent ();
- // assign the narrowed obj reference
- *os << "CORBA::release (" << arg->local_name ()
- << ");\n";
- }
- break;
- default:
- break;
- }
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-int
-be_visitor_args_post_docall_compiled_cs::visit_valuetype (be_valuetype *)
-{
- // we must narrow the out object reference to the appropriate type
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- {
- os->indent ();
- *os << "CORBA::remove_ref (" << arg->local_name ()
- << ");\n";
- }
- break;
- default:
- break;
- }
- return 0;
-}
-
-int
-be_visitor_args_post_docall_compiled_cs::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- // we must narrow the out object reference to the appropriate type
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- {
- os->indent ();
- *os << "CORBA::remove_ref (" << arg->local_name ()
- << ");\n";
- }
- break;
- default:
- break;
- }
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-int
-be_visitor_args_post_docall_compiled_cs::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- os->indent ();
- *os << "CORBA::string_free (" << arg->local_name () << ");" << be_nl;
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int
-be_visitor_args_post_docall_compiled_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_post_docall_compiled_cs::"
- "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/post_docall_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/post_docall_cs.cpp
deleted file mode 100644
index 9aa12d3295c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/post_docall_cs.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// post_docall_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for post-processing of arguments following a
-// do_static_call
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, post_docall_cs, "$Id$")
-
-
-// *************************************************************************
-// visitor for argument to do any post docall processing. Not all types need
-// this. Only those that have an _out type need this. In addition, interfaces
-// need it because we need to convert from the interface type to the base Object
-// type and vice versa.
-// *************************************************************************
-
-be_visitor_args_post_docall_cs::be_visitor_args_post_docall_cs
-(be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_post_docall_cs::~be_visitor_args_post_docall_cs (void)
-{
-}
-
-int
-be_visitor_args_post_docall_cs::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 ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_pre_docall_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
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_pre_docall_cs::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_args_post_docall_cs::visit_interface (be_interface *node)
-{
- // we must narrow the out object reference to the appropriate type
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- {
- os->indent ();
- // assign the narrowed obj reference
- *os << arg->local_name () << " = " << node->name ()
- << "::_narrow (_tao_base_" << arg->local_name ()
- << ", ACE_TRY_ENV);" << be_nl;
- *os << "CORBA::release (_tao_base_" << arg->local_name ()
- << ");\n";
- }
- break;
- default:
- break;
- }
- return 0;
-}
-
-int
-be_visitor_args_post_docall_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- // we must narrow the out object reference to the appropriate type
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- switch (this->direction ())
- {
- case AST_Argument::dir_INOUT:
- {
- os->indent ();
- // assign the narrowed obj reference
- *os << arg->local_name () << " = " << node->name ()
- << "::_narrow (_tao_base_" << arg->local_name ()
- << ", ACE_TRY_ENV);" << be_nl;
- *os << "CORBA::release (_tao_base_" << arg->local_name ()
- << ");\n";
- }
- break;
- default:
- break;
- }
- return 0;
-}
-
-int
-be_visitor_args_post_docall_cs::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- *os << "CORBA::string_free (" << arg->local_name () << ");" << be_nl;
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int
-be_visitor_args_post_docall_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_post_docall_cs::"
- "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/post_marshal_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/post_marshal_ss.cpp
deleted file mode 100644
index a532881930a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/post_marshal_ss.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// post_marshal_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating code that does post-processing of arguments following
-// any marshaling. This involves any cleanup.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, post_marshal_ss, "$Id$")
-
-
-// ************************************************************************
-// visitor for doing any post-processing after the marshaling is done
-// ************************************************************************
-
-be_visitor_args_post_marshal_ss::be_visitor_args_post_marshal_ss (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_post_marshal_ss::~be_visitor_args_post_marshal_ss (void)
-{
-}
-
-int be_visitor_args_post_marshal_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_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
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_post_marshal_ss::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_post_marshal_ss::visit_array (be_array *)
-{
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_marshal_ss::visit_enum (be_enum *)
-{
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_marshal_ss::visit_interface (be_interface *)
-{
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT: // inout
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_marshal_ss::visit_interface_fwd (be_interface_fwd *)
-{
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT: // inout
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_marshal_ss::visit_predefined_type (be_predefined_type *node)
-{
- // check if the type is an any
- if (node->pt () == AST_PredefinedType::PT_any)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- } // end switch direction
- } // end of if
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- } // end switch direction
- } // end else if
- else // simple predefined types
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- } // end switch direction
- } // end of else
-
- return 0;
-}
-
-int be_visitor_args_post_marshal_ss::visit_sequence (be_sequence *)
-{
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_marshal_ss::visit_string (be_string *)
-{
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_marshal_ss::visit_structure (be_structure *)
-{
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_marshal_ss::visit_union (be_union *)
-{
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_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_post_marshal_ss::"
- "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/post_upcall_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/post_upcall_ss.cpp
deleted file mode 100644
index caa7a684efa..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/post_upcall_ss.cpp
+++ /dev/null
@@ -1,354 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-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_args (ctx)
-{
-}
-
-be_visitor_args_post_upcall_ss::~be_visitor_args_post_upcall_ss (void)
-{
-}
-
-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_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
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_post_upcall_ss::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_post_upcall_ss::visit_array (be_array *)
-{
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_upcall_ss::visit_enum (be_enum *)
-{
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_upcall_ss::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT: // inout
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << "_tao_base_var_" << arg->local_name ()
- << " = CORBA::Object::_duplicate ("
- << arg->local_name () << ".in ());\n";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_upcall_ss::visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT: // inout
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << "_tao_base_var_" << arg->local_name ()
- << " = CORBA::Object::_duplicate ("
- << arg->local_name () << ".in ());\n";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_upcall_ss::visit_predefined_type (be_predefined_type *node)
-{
- // check if the type is an any
- if (node->pt () == AST_PredefinedType::PT_any)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- } // end switch direction
- } // end of if
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- } // end switch direction
- } // end else if
- else // simple predefined types
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- } // end switch direction
- } // end of else
-
- return 0;
-}
-
-int be_visitor_args_post_upcall_ss::visit_sequence (be_sequence *)
-{
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_upcall_ss::visit_string (be_string *)
-{
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_upcall_ss::visit_structure (be_structure *)
-{
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int be_visitor_args_post_upcall_ss::visit_union (be_union *)
-{
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- 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_ss::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 0;
-}
-
-// ****************************************************************
-
-// ************************************************************************
-// visitor for doing any post-processing after the upcall is made
-// ************************************************************************
-
-be_visitor_compiled_args_post_upcall::be_visitor_compiled_args_post_upcall (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_compiled_args_post_upcall::~be_visitor_compiled_args_post_upcall (void)
-{
-}
-
-int
-be_visitor_compiled_args_post_upcall::visit_operation (be_operation *node)
-{
- return this->visit_scope (node);
-}
-
-int be_visitor_compiled_args_post_upcall::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_compiled_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_compiled_args_post_upcall::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_compiled_args_post_upcall::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_compiled_args_post_upcall::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_compiled_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/pre_docall_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/pre_docall_cs.cpp
deleted file mode 100644
index c1e594bed31..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/pre_docall_cs.cpp
+++ /dev/null
@@ -1,445 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// pre_docall_cs.cpp
-//
-// = DESCRIPTION
-// Visitor that generates code (if any) for pre-processing prior to call to
-// do_static_call in the client stub
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, pre_docall_cs, "$Id$")
-
-
-// *************************************************************************
-// visitor for argument to do any pre docall processing. Not all types need
-// this. Only those that have an _out type need this. In addition, interfaces
-// need it because we ned to convert from the interface type to the base Object
-// type and vice versa.
-// *************************************************************************
-
-be_visitor_args_pre_docall_cs::be_visitor_args_pre_docall_cs
-(be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_pre_docall_cs::~be_visitor_args_pre_docall_cs (void)
-{
-}
-
-int
-be_visitor_args_pre_docall_cs::void_return_type (void)
-{
- // is the operation return type void?
- be_argument *arg = this->ctx_->be_node_as_argument ();
- ACE_ASSERT (arg != 0);
- be_operation *op = be_operation::narrow_from_scope (arg->defined_in ());
- ACE_ASSERT (arg != 0);
-
- be_type *bt = be_type::narrow_from_decl (op->return_type ());
- if (bt->node_type () == AST_Decl::NT_pre_defined
- && (be_predefined_type::narrow_from_decl (bt)->pt ()
- == AST_PredefinedType::PT_void))
- return 1;
- else
- return 0;
-}
-
-int be_visitor_args_pre_docall_cs::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 ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_pre_docall_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
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_pre_docall_cs::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_args_pre_docall_cs::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (this->direction ())
- {
- case AST_Argument::dir_OUT:
- if (node->size_type () == be_decl::VARIABLE)
- {
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << "_slice *&_tao_base_" << arg->local_name ()
- << " = " << arg->local_name () << ".ptr ();" << be_nl;
- if (!this->void_return_type ())
- {
- *os << "ACE_ALLOCATOR_RETURN (_tao_base_" << arg->local_name ()
- << ", " << bt->name () << "_alloc (), _tao_retval);\n";
- }
- else
- {
- *os << "ACE_ALLOCATOR (_tao_base_" << arg->local_name ()
- << ", " << bt->name () << "_alloc ());\n";
- }
-#endif
- if (!this->void_return_type ())
- {
- *os << "ACE_ALLOCATOR_RETURN (" << arg->local_name ()
- << ".ptr (), " << bt->name () << "_alloc (), _tao_retval);\n";
- }
- else
- {
- *os << "ACE_ALLOCATOR (" << arg->local_name ()
- << ".ptr (), " << bt->name () << "_alloc ());\n";
- }
- }
- break;
- default:
- break;
- }
- return 0;
-
-}
-
-int
-be_visitor_args_pre_docall_cs::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- os->indent ();
- *os << "CORBA::Object_ptr _tao_base_" << arg->local_name ()
- << " = " << arg->local_name () << ";\n";
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << "CORBA::Object_ptr _tao_base_" << arg->local_name () << ";\n";
- break;
- default:
- break;
- }
- return 0;
-}
-
-int
-be_visitor_args_pre_docall_cs::visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- os->indent ();
- *os << "CORBA::Object_ptr _tao_base_" << arg->local_name ()
- << " = " << arg->local_name () << ";\n";
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << "CORBA::Object_ptr _tao_base_" << arg->local_name () << ";\n";
- break;
- default:
- break;
- }
- return 0;
-}
-
-int
-be_visitor_args_pre_docall_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- // get the argument node
- be_argument *arg = this->ctx_->be_node_as_argument ();
-
-#if 0
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-#endif
-
- // pre do_static_call processing is valid only for pseudo objects and for Any
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_OUT:
-#if 0
- os->indent ();
- *os << bt->name () << "_ptr &_tao_base_" << arg->local_name ()
- << " = " << arg->local_name () << ".ptr ();\n";
-#endif
- break;
- default:
- break;
- }
- }
- break;
- case AST_PredefinedType::PT_any:
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_OUT:
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << " *&_tao_base_" << arg->local_name ()
- << " = " << arg->local_name () << ".ptr ();" << be_nl;
- if (!this->void_return_type ())
- {
- *os << "ACE_NEW_RETURN (_tao_base_" << arg->local_name ()
- << ", CORBA::Any, _tao_retval);\n";
- }
- else
- {
- *os << "ACE_NEW (_tao_base_" << arg->local_name ()
- << ", CORBA::Any);\n";
- }
-#endif
- if (!this->void_return_type ())
- {
- *os << "ACE_NEW_RETURN (" << arg->local_name ()
- << ".ptr (), CORBA::Any, _tao_retval);\n";
- }
- else
- {
- *os << "ACE_NEW (" << arg->local_name ()
- << ".ptr (), CORBA::Any);\n";
- }
- break;
- default:
- break;
- }
- }
- break;
- default:
- break;
- }
- return 0;
-}
-
-int
-be_visitor_args_pre_docall_cs::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (this->direction ())
- {
- case AST_Argument::dir_OUT:
- // caller must have allocated the pointer
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << " *&_tao_base_" << arg->local_name ()
- << " = " << arg->local_name () << ".ptr ();" << be_nl;
- if (!this->void_return_type ())
- {
- *os << "ACE_NEW_RETURN (_tao_base_" << arg->local_name ()
- << ", " << bt->name () << ", _tao_retval);\n";
- }
- else
- {
- *os << "ACE_NEW (_tao_base_" << arg->local_name ()
- << ", " << bt->name () << ");\n";
- }
-#endif
- if (!this->void_return_type ())
- {
- *os << "ACE_NEW_RETURN (" << arg->local_name ()
- << ".ptr (), " << bt->name () << ", _tao_retval);\n";
- }
- else
- {
- *os << "ACE_NEW (" << arg->local_name ()
- << ".ptr (), " << bt->name () << ");\n";
- }
- break;
- default:
- break;
- }
- return 0;
-}
-
-int
-be_visitor_args_pre_docall_cs::visit_string (be_string *)
-{
- return 0;
-}
-
-int
-be_visitor_args_pre_docall_cs::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (node->size_type () == be_type::VARIABLE)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_OUT:
- // caller must have allocated the pointer
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << " *&_tao_base_" << arg->local_name ()
- << " = " << arg->local_name () << ".ptr ();" << be_nl;
- if (!this->void_return_type ())
- {
- *os << "ACE_NEW_RETURN (_tao_base_" << arg->local_name ()
- << ", " << bt->name () << ", _tao_retval);\n";
- }
- else
- {
- *os << "ACE_NEW (_tao_base_" << arg->local_name ()
- << ", " << bt->name () << ");\n";
- }
-#endif
- if (!this->void_return_type ())
- {
- *os << "ACE_NEW_RETURN (" << arg->local_name ()
- << ".ptr (), " << bt->name () << ", _tao_retval);\n";
- }
- else
- {
- *os << "ACE_NEW (" << arg->local_name ()
- << ".ptr (), " << bt->name () << ");\n";
- }
- break;
- default:
- break;
- }
- }
- return 0;
-}
-
-int
-be_visitor_args_pre_docall_cs::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (node->size_type () == be_type::VARIABLE)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_OUT:
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << " *&_tao_base_" << arg->local_name ()
- << " = " << arg->local_name () << ".ptr ();" << be_nl;
- if (!this->void_return_type ())
- {
- *os << "ACE_NEW_RETURN (_tao_base_" << arg->local_name ()
- << ", " << bt->name () << ", _tao_retval);\n";
- }
- else
- {
- *os << "ACE_NEW (_tao_base_" << arg->local_name ()
- << ", " << bt->name () << ");\n";
- }
-#endif
- if (!this->void_return_type ())
- {
- *os << "ACE_NEW_RETURN (" << arg->local_name ()
- << ".ptr (), " << bt->name () << ", _tao_retval);\n";
- }
- else
- {
- *os << "ACE_NEW (" << arg->local_name ()
- << ".ptr (), " << bt->name () << ");\n";
- }
- break;
- default:
- break;
- }
- }
- return 0;
-}
-
-int
-be_visitor_args_pre_docall_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_pre_docall_cs::"
- "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/pre_invoke_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/pre_invoke_cs.cpp
deleted file mode 100644
index ed862708579..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/pre_invoke_cs.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// pre_invoke_cs.cpp
-//
-// = DESCRIPTION
-// Visitor that generates code (if any) for pre-processing prior to call to
-// do_static_call in the client stub
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, pre_invoke_cs, "$Id$")
-
-
-// *************************************************************************
-// visitor for argument to do any pre invoke processing. Not all types need
-// this. Only those that have an _out type need this. This ne is for compiled
-// marshaling and overrides osme methods of the base class (which does the job
-// for interpretive marshaling)
-// *************************************************************************
-
-be_visitor_args_pre_invoke_cs::be_visitor_args_pre_invoke_cs
-(be_visitor_context *ctx)
- : be_visitor_args_pre_docall_cs (ctx)
-{
-}
-
-be_visitor_args_pre_invoke_cs::~be_visitor_args_pre_invoke_cs (void)
-{
-}
-
-int
-be_visitor_args_pre_invoke_cs::visit_interface (be_interface *)
-{
- // overriding action
- return 0;
-}
-
-int
-be_visitor_args_pre_invoke_cs::visit_interface_fwd (be_interface_fwd *)
-{
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/pre_upcall_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/pre_upcall_ss.cpp
deleted file mode 100644
index 9ab4133b028..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/pre_upcall_ss.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// pre_upcall_ss.cpp
-//
-// = DESCRIPTION
-// Visitor that generates any pre-processing of arguments prior to making
-// the upcall (in the skeleton).
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, pre_upcall_ss, "$Id$")
-
-
-// ************************************************************************
-// visitor for passing arguments to the upcall
-// ************************************************************************
-
-be_visitor_args_pre_upcall_ss::be_visitor_args_pre_upcall_ss (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_pre_upcall_ss::~be_visitor_args_pre_upcall_ss (void)
-{
-}
-
-int be_visitor_args_pre_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_pre_upcall_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
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_pre_upcall_ss::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_pre_upcall_ss::visit_array (be_array *)
-{
- return 0;
-}
-
-int be_visitor_args_pre_upcall_ss::visit_enum (be_enum *)
-{
- return 0;
-}
-
-int be_visitor_args_pre_upcall_ss::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT: // inout
- os->indent ();
- *os << arg->local_name () << " = " << node->name ()
- << "::_narrow (_tao_base_var_" << arg->local_name ()
- << ".in (), ACE_TRY_ENV);\n";
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int be_visitor_args_pre_upcall_ss::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT: // inout
- os->indent ();
- *os << arg->local_name () << " = " << node->name ()
- << "::_narrow (_tao_base_var_" << arg->local_name ()
- << ".in (), ACE_TRY_ENv);\n";
- break;
- case AST_Argument::dir_OUT:
- break;
- }
- return 0;
-}
-
-int be_visitor_args_pre_upcall_ss::visit_predefined_type (be_predefined_type *node)
-{
- // check if the type is an any
- if (node->pt () == AST_PredefinedType::PT_any)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- } // end switch direction
- } // end of if
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- } // end switch direction
- } // end else if
- else // simple predefined types
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- break;
- case AST_Argument::dir_INOUT:
- break;
- case AST_Argument::dir_OUT:
- break;
- } // end switch direction
- } // end of else
-
- return 0;
-}
-
-int be_visitor_args_pre_upcall_ss::visit_sequence (be_sequence *)
-{
- return 0;
-}
-
-int be_visitor_args_pre_upcall_ss::visit_string (be_string *)
-{
- return 0;
-}
-
-int be_visitor_args_pre_upcall_ss::visit_structure (be_structure *)
-{
- return 0;
-}
-
-int be_visitor_args_pre_upcall_ss::visit_union (be_union *)
-{
- return 0;
-}
-
-int be_visitor_args_pre_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_pre_upcall_ss::"
- "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 1e270712ea9..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp
+++ /dev/null
@@ -1,446 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-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); // 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_upcall_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
-
- 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 (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- 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 () == be_decl::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 (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- 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 *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- os->indent ();
- 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:
- // *os << arg->local_name ();
- 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_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- os->indent ();
- 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:
- // *os << arg->local_name ();
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".out ()";
- break;
- }
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-int be_visitor_args_upcall_ss::visit_valuetype (be_valuetype *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- os->indent ();
- 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:
- // *os << arg->local_name ();
- 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_valuetype_fwd (be_valuetype_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- os->indent ();
- 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:
- // *os << arg->local_name ();
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".out ()";
- break;
- }
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-
-int be_visitor_args_upcall_ss::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- os->indent ();
- // check if the type is an any
- if (node->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;
- } // end switch direction
- } // end of if
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::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:
- // *os << arg->local_name ();
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".out ()";
- break;
- } // end switch direction
- } // end else if
- else // simple predefined types
- {
- 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 (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- os->indent ();
- 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 *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- os->indent ();
- 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::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- os->indent ();
- 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 () == be_decl::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_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- os->indent ();
- 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 () == be_decl::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_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;
-}
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 c5829ca7f92..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp
+++ /dev/null
@@ -1,635 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-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); // 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_vardecl_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
-
- 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 (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- 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->indent ();
- *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
- << ");\n" << be_uidt;
- break;
-
- case AST_Argument::dir_OUT:
- os->indent ();
- if (node->size_type () == be_type::VARIABLE)
- {
- *os << bt->name () << "_var " << arg->local_name ()
- << ";\n\n";
- }
- else
- {
- *os << bt->name () << " " << arg->local_name ()
- << ";\n\n";
- }
- break;
- }
- return 0;
-}
-
-int be_visitor_args_vardecl_ss::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- 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->indent ();
- *os << bt->name () << " " << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_vardecl_ss::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- 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->indent ();
-#if 0 /* ASG */
- *os << bt->name () << "_var " << arg->local_name () << ";" << be_nl;
- *os << "CORBA::Object_var _tao_base_var_" << arg->local_name ()
- << ";" << be_nl;
- *os << "CORBA::Object_ptr &_tao_base_ptr_" << arg->local_name ()
- << " = _tao_base_var_" << arg->local_name () << ".out ();\n";
-#endif
- *os << bt->name () << "_var " << arg->local_name () << ";" << be_nl;
- *os << "CORBA::Object_var _tao_base_var_" << arg->local_name ()
- << ";\n";
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << "_var _tao_var_"
- << arg->local_name () << ";" << be_nl;
- *os << "CORBA::Object_ptr _tao_base_ptr_"
- << arg->local_name () << ";" << be_nl;
- *os << bt->name () << "_out " << arg->local_name ()
- << " (_tao_var_" << arg->local_name () << ".out ());\n";
-#endif
- *os << bt->name () << "_var "
- << arg->local_name () << ";" << be_nl;
- *os << "CORBA::Object_var _tao_base_var_"
- << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_vardecl_ss::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- 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->indent ();
-#if 0 /* ASG */
- *os << bt->name () << "_var " << arg->local_name () << ";" << be_nl;
- *os << "CORBA::Object_var _tao_base_var_" << arg->local_name ()
- << ";" << be_nl;
- *os << "CORBA::Object_ptr &_tao_base_ptr_" << arg->local_name ()
- << " = _tao_base_var_" << arg->local_name () << ".out ();\n";
-#endif
- *os << bt->name () << "_var " << arg->local_name () << ";" << be_nl;
- *os << "CORBA::Object_var _tao_base_var_" << arg->local_name ()
- << ";\n";
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << "_var _tao_var_"
- << arg->local_name () << ";" << be_nl;
- *os << "CORBA::Object_ptr _tao_base_ptr_"
- << arg->local_name () << ";" << be_nl;
- *os << bt->name () << "_out " << arg->local_name ()
- << " (_tao_var_" << arg->local_name () << ".out ());\n";
-#endif
- *os << bt->name () << "_var "
- << arg->local_name () << ";" << be_nl;
- *os << "CORBA::Object_var _tao_base_var_"
- << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-
-#ifdef IDL_HAS_VALUETYPE
-
-int be_visitor_args_vardecl_ss::visit_valuetype (be_valuetype *)
-{
- return -1;
-}
-
-int be_visitor_args_vardecl_ss::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- return -1;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-int be_visitor_args_vardecl_ss::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- // check if the type is an any
- if (node->pt () == AST_PredefinedType::PT_any)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- os->indent ();
- *os << bt->name () << " " << arg->local_name () << ";\n";
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << "_var _tao_var_"
- << arg->local_name () << ";" << be_nl;
- *os << bt->name () << "_ptr &_tao_ptr_" << arg->local_name ()
- << " = _tao_var_" << arg->local_name () << ".out ();" << be_nl;
- *os << bt->name () << "_out " << arg->local_name ()
- << " (_tao_ptr_" << arg->local_name () << ");\n";
-#endif
- *os << bt->name () << "_var "
- << arg->local_name () << ";\n";
- break;
- } // end switch direction
- } // end of if
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << "_var " << arg->local_name ()
- << ";" << be_nl;
- *os << bt->name () << "_ptr &_tao_ptr_" << arg->local_name ()
- << " = " << arg->local_name () << ".out ();\n";
-#endif
- *os << bt->name () << "_var " << arg->local_name ()
- << ";\n";
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << "_var _tao_var_"
- << arg->local_name () << ";" << be_nl;
- *os << bt->name () << "_ptr &_tao_ptr_" << arg->local_name ()
- << " = _tao_var_" << arg->local_name () << ".out ();" << be_nl;
- *os << bt->name () << "_out " << arg->local_name ()
- << " (_tao_ptr_" << arg->local_name () << ");" << be_nl;
-#endif
- *os << bt->name () << "_var "
- << arg->local_name () << ";\n";
- break;
- } // end switch direction
- } // end else if
- else // simple predefined types
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << bt->name () << " " << arg->local_name () << ";\n";
- break;
- } // end switch direction
- } // end of else
-
- return 0;
-}
-
-int be_visitor_args_vardecl_ss::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- 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->indent ();
- *os << bt->name () << " " << arg->local_name () << ";\n";
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << "_var _tao_var_"
- << arg->local_name () << ";" << be_nl;
- *os << bt->name () << " *&_tao_ptr_" << arg->local_name ()
- << " = _tao_var_" << arg->local_name () << ".out ();" << be_nl;
- *os << bt->name () << "_out " << arg->local_name ()
- << " (_tao_ptr_" << arg->local_name () << ");\n";
-#endif
- *os << bt->name () << "_var "
- << arg->local_name () << ";" << be_nl;
- break;
- }
- return 0;
-}
-
-int be_visitor_args_vardecl_ss::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- os->indent ();
-#if 0 /* ASG */
- *os << "CORBA::String_var _tao_var_"
- << arg->local_name () << ";" << be_nl;
- *os << "char *&" << arg->local_name () << " = _tao_var_"
- << arg->local_name () << ".out ();" << be_nl;
-#endif
- *os << "CORBA::String_var "
- << arg->local_name () << ";\n";
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
-#if 0 /* ASG */
- *os << "CORBA::String_var _tao_var_"
- << arg->local_name () << ";" << be_nl;
- *os << "char *&_tao_ptr_" << arg->local_name () << " = _tao_var_"
- << arg->local_name () << ".out ();" << be_nl;
- *os << "CORBA::String_out " << arg->local_name ()
- << " (_tao_ptr_" << arg->local_name () << ");\n";
-#endif
- *os << "CORBA::String_var "
- << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_vardecl_ss::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- 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->indent ();
- *os << bt->name () << " " << arg->local_name () << ";\n";
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
- // check if it is variable sized
- if (node->size_type () == be_type::VARIABLE)
- {
-#if 0 /* ASG */
- *os << bt->name () << "_var _tao_var_"
- << arg->local_name () << ";" << be_nl;
- *os << bt->name () << " *&_tao_ptr_" << arg->local_name ()
- << " = _tao_var_" << arg->local_name () << ".out ();" << be_nl;
- *os << bt->name () << "_out " << arg->local_name ()
- << " (_tao_ptr_" << arg->local_name () << ");\n";
-#endif
- *os << bt->name () << "_var "
- << arg->local_name () << ";\n";
- }
- else
- *os << bt->name () << " " << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_vardecl_ss::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- 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->indent ();
- *os << bt->name () << " " << arg->local_name () << ";\n";
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
- // check if it is variable sized
- if (node->size_type () == be_type::VARIABLE)
- {
-#if 0 /* ASG */
- *os << bt->name () << "_var _tao_var_"
- << arg->local_name () << ";" << be_nl;
- *os << bt->name () << " *&_tao_ptr_" << arg->local_name ()
- << " = _tao_var_" << arg->local_name () << ".out ();" << be_nl;
- *os << bt->name () << "_out " << arg->local_name ()
- << " (_tao_ptr_" << arg->local_name () << ");\n";
-#endif
- *os << bt->name () << "_var "
- << arg->local_name () << ";\n";
-
- }
- else
- *os << bt->name () << " " << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-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;
-}
-
-
-// ************************************************************************
-// Visitor to generate code for argument variable declaration for compiled
-// marshaling. This provides only the overriden methods. The rest is handled by
-// the base class that works for interpretiveskeletons.
-// ************************************************************************
-
-be_compiled_visitor_args_vardecl_ss::
-be_compiled_visitor_args_vardecl_ss (be_visitor_context *ctx)
- : be_visitor_args_vardecl_ss (ctx)
-{
-}
-
-be_compiled_visitor_args_vardecl_ss::~be_compiled_visitor_args_vardecl_ss (void)
-{
-}
-
-int be_compiled_visitor_args_vardecl_ss::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- 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->indent ();
- *os << bt->name () << "_var " << arg->local_name () << ";\n";
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << bt->name () << "_var "
- << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-int be_compiled_visitor_args_vardecl_ss::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- 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->indent ();
- *os << bt->name () << "_var " << arg->local_name () << ";\n";
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << bt->name () << "_var "
- << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-
-#ifdef IDL_HAS_VALUETYPE
-
-int be_compiled_visitor_args_vardecl_ss::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- 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->indent ();
- *os << bt->name () << "_var " << arg->local_name () << ";\n";
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << bt->name () << "_var "
- << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-int
-be_compiled_visitor_args_vardecl_ss::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- // if the current type is an alias, use that
- 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->indent ();
- *os << bt->name () << "_var " << arg->local_name () << ";\n";
- break;
- case AST_Argument::dir_OUT:
- os->indent ();
- *os << bt->name () << "_var "
- << arg->local_name () << ";\n";
- break;
- }
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
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 395a98fb319..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_array.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Array
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_array.h"
-
-// include all the individual files
-#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_ci.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 15237b1baf9..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/any_op_ch.cpp
+++ /dev/null
@@ -1,64 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_array.h"
-
-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 ();
-
- // generate the Any <<= and >>= operator declarations
- os->indent ();
- *os << "void " << idl_global->export_macro ()
- << " operator<<= (CORBA::Any &, const " << node->name ()
- << "_forany &);" << be_nl;
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator>>= (const CORBA::Any &, "
- << node->name () << "_forany &);\n";
-
- 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 06584bc7ddb..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp
+++ /dev/null
@@ -1,118 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_array.h"
-
-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 ();
-
- // generate the Any <<= and >>= operator declarations
- // Any <<= and >>= operators
- os->indent ();
- *os << "void operator<<= (CORBA::Any &_tao_any, const "
- << node->name () << "_forany &_tao_elem)" << be_nl
- << "{" << be_idt_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "if (_tao_elem.nocopy ()) // no copy" << be_idt_nl
- << "_tao_any.replace (" << node->tc_name () << ", "
- << "_tao_elem.in (), 1, ACE_TRY_ENV); // consume it" << be_uidt_nl
- << "else // copy" << be_idt_nl
- << "_tao_any.replace (" << node->tc_name () << ", " << node->name ()
- << "_dup (_tao_elem.in ()), 1, ACE_TRY_ENV);" << be_uidt_nl
- << "ACE_TRY_CHECK;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY {}" << be_nl
- << "ACE_ENDTRY;" << be_uidt_nl
- << "}\n\n";
-
- os->indent ();
- *os << "CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, "
- << node->name () << "_forany &_tao_elem)" << be_nl
- << "{" << be_idt_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "CORBA::TypeCode_var type = _tao_any.type ();" << be_nl
- << "if (!type->equal (" << node->tc_name ()
- << ", ACE_TRY_ENV)) return 0; // not equal" << be_nl
- << "ACE_TRY_CHECK;" << be_nl
- << "if (_tao_any.any_owns_data ())" << be_nl
- << "{" << be_idt_nl
- << "_tao_elem = (" << node->name () << "_slice *)_tao_any.value ();"
- << be_nl
- << "return 1;" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_nl // else Any does not own the data
- << "{" << be_idt_nl
- << "_tao_elem.out () = " << node->name () << "_alloc ();" << be_nl
- << "if (!_tao_elem.in ()) return 0;" << be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());"
- << be_nl
- << "if (stream.decode (" << node->tc_name ()
- << ", _tao_elem.inout (), 0, ACE_TRY_ENV)" << be_nl
- << " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
- << "{" << be_idt_nl
- << "((CORBA::Any *)&_tao_any)->replace ("
- << node->tc_name () << ", _tao_elem.inout (), 1, ACE_TRY_ENV);" << be_nl
- << "return 1;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_TRY_CHECK;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY" << be_nl
- << "{" << be_idt_nl
- << node->name () << "_free (_tao_elem._retn ());" << be_nl
- << "return 0;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_ENDTRY;" << be_nl
- << "return 0;" << be_uidt_nl
- << "}\n\n";
-
- 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 a19959e36a1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/array.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// array.cpp
-//
-// = DESCRIPTION
-// Generic visitor for code generation for Arrays
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_array.h"
-
-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)
-{
- 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;
-}
-
-int
-be_visitor_array::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_ARRAY_CH)
- *os << bt->nested_type_name (this->ctx_->scope (), "_var");
- else
- *os << bt->name () << "_var";
- return 0;
-}
-
-int
-be_visitor_array::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- if (node->pt () == AST_PredefinedType::PT_pseudo)
- *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 *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- // *os << "CORBA::String_var";
- *os << "TAO_String_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)
-{
- return this->visit_node (node);
-}
-
-// 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;
-}
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 c38780bdfdb..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp
+++ /dev/null
@@ -1,517 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// array_ch.cpp
-//
-// = DESCRIPTION
-// Visitor for Array code generation in client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_array.h"
-
-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 (); // get output stream
- be_type *bt; // base type
- be_decl *scope = this->ctx_->scope (); // scope in which it is used
-
- // 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); // save the array node
-
- // retrieve the type
- bt = be_type::narrow_from_decl (node->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_ch::"
- "visit_array - "
- "bad base type\n"),
- -1);
- }
-
- // generate the ifdefined macro
- os->gen_ifdef_macro (node->flatname ());
-
- // If we contain an anonymous sequence,
- // generate code for the sequence here.
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- if (this->gen_anonymous_base_type (bt,
- TAO_CodeGen::TAO_SEQUENCE_CH)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_ch::"
- "visit_array - "
- "gen_anonymous_base_type failed\n"),
- -1);
- }
- }
-
- os->indent ();
- *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 << " ";
- if (!this->ctx_->tdef ())
- {
- // 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 << " ";
- if (!this->ctx_->tdef ())
- {
- // we are dealing with an anonymous array case. Generate a typedef with
- // an _ prepended to the name
- *os << "_";
- }
- *os << 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 << ";\n";
-
- // typedef the _var, _out, and _forany types
- if (this->gen_var_defn (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_ch::"
- "visit_argument - "
- "var_defn failed\n"),
- -1);
- }
- // a class is generated for an out defn only for a variable length struct
- if (node->size_type () == be_decl::VARIABLE)
- {
- if (this->gen_out_defn (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_ch::"
- "visit_argument - "
- "out_defn failed\n"),
- -1);
- }
- }
- else
- {
- // fixed size
- os->indent ();
- // if we are a typedefed array, we can use the TYPE name to define an
- // _out type. However, for anonymous arrays that do not give rise to a
- // new type, we use the base type for defining an out type
- if (this->ctx_->tdef ())
- {
- *os << "typedef " << node->local_name () << " "
- << node->local_name () << "_out;\n";
- }
- else
- {
- *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 << " _" << node->local_name () << "_out";
- if (node->gen_dimensions (os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_ch::"
- "visit_array - "
- "gen dimensions failed\n"),
- -1);
- }
- *os << ";\n";
- }
- }
-
- if (this->gen_forany_defn (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_ch::"
- "visit_argument - "
- "forany_defn failed\n"),
- -1);
- }
- // the _alloc, _dup, copy, and free methods. If the node is nested, the
- // methods become static
- os->indent ();
- 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 = "";
-
- if (this->ctx_->tdef ())
- {
- // typedefed array
- *os << storage_class << node->nested_type_name (scope, "_slice") << " *";
- *os << node->nested_type_name (scope, "_alloc") << " (void);" << be_nl;
- *os << storage_class << "void " << node->nested_type_name (scope, "_free") << " (";
- *os << node->nested_type_name (scope, "_slice") << " *_tao_slice);" << be_nl;
- *os << storage_class << node->nested_type_name (scope, "_slice") << " *";
- *os << node->nested_type_name (scope, "_dup") << " (const ";
- *os << node->nested_type_name (scope, "_slice") << " *_tao_slice);" << be_nl;
- *os << storage_class << "void " << node->nested_type_name (scope, "_copy") << " (";
- *os << node->nested_type_name (scope, "_slice") << " *_tao_to, const ";
- *os << node->nested_type_name (scope, "_slice") << " *_tao_from);" << be_nl;
- }
- else
- {
- // anonymous array
- *os << storage_class << node->nested_type_name (scope, "_slice", "_") << " *";
- *os << node->nested_type_name (scope, "_alloc", "_") << " (void);" << be_nl;
- *os << storage_class << "void "
- << node->nested_type_name (scope, "_free", "_") << " (";
- *os << node->nested_type_name (scope, "_slice", "_") << " *_tao_slice);" << be_nl;
- *os << storage_class << node->nested_type_name (scope, "_slice", "_") << " *";
- *os << node->nested_type_name (scope, "_dup", "_") << " (const ";
- *os << node->nested_type_name (scope, "_slice", "_") << " *_tao_slice);" << be_nl;
- *os << storage_class << "void "
- << node->nested_type_name (scope, "_copy", "_") << " (";
- *os << node->nested_type_name (scope, "_slice", "_") << " *_tao_to, const ";
- *os << node->nested_type_name (scope, "_slice", "_") << " *_tao_from);" << be_nl;
- }
-
- *os << "\n";
-
-#if 0
- // Typecode for an anonymous array will not be required anywhere since we do
- // not generate the Any operators for anonymous types
-
- // is this a typedefined array? if so, then let the typedef deal with
- // generation of the typecode
- if (!this->ctx_->tdef ())
- {
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- be_visitor_context ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DECL);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_ch::"
- "visit_array - "
- "TypeCode declaration failed\n"
- ), -1);
- }
- delete visitor;
- }
-#endif /* 0 */
-
- // generate the endif macro
- os->gen_endif ();
-
- node->cli_hdr_gen (1);
- return 0;
-}
-
-// generate the var defn
-int
-be_visitor_array_ch::gen_var_defn (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- char namebuf [NAMEBUFSIZE]; // names
- char varnamebuf [NAMEBUFSIZE]; // var names
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::memset (varnamebuf, '\0', NAMEBUFSIZE);
- if (this->ctx_->tdef ())
- {
- // typedefed array
- ACE_OS::sprintf (namebuf, "%s", node->local_name ()->get_string ());
- ACE_OS::sprintf (varnamebuf, "%s_var", node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (namebuf, "_%s", node->local_name ()->get_string ());
- ACE_OS::sprintf (varnamebuf, "_%s_var", node->local_name ()->get_string ());
- }
-
- // generate the var definition (always in the client header).
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- os->indent (); // start with whatever was our current indent level
- *os << "class " << idl_global->export_macro ()
- << " " << varnamebuf << be_nl;
- *os << "{" << be_nl;
- *os << "public:" << be_idt_nl;
- // default constr
- *os << varnamebuf << " (void); // default constructor" << be_nl;
- // constr from pointer to slice
- *os << varnamebuf << " (" << namebuf << "_slice *);" << be_nl;
- // copy constructor
- *os << varnamebuf << " (const " << varnamebuf <<
- " &); // copy constructor" << be_nl;
- // destructor
- *os << "~" << varnamebuf << " (void); // destructor" << be_nl;
- *os << be_nl;
- // assignment operator from a pointer to slice
- *os << varnamebuf << " &operator= (" << namebuf << "_slice *);"
- << be_nl;
- // assignment from _var
- *os << varnamebuf << " &operator= (const " << varnamebuf << " &);" << be_nl;
-
- // arrow operator
- // nothing here
- *os << be_nl;
-
- // other extra types (cast operators, [] operator, and others)
- // overloaded [] operator
- *os << namebuf << "_slice &operator[] (CORBA::ULong index);"
- << be_nl;
- *os << "const " << namebuf
- << "_slice &operator[] (CORBA::ULong index) const;" << be_nl;
-
- // cast operators
- *os << "operator " << namebuf << "_slice * const &() const;"
- << be_nl;
- *os << "operator " << namebuf << "_slice *&();" << be_nl;
-
- // in, inout, out and _retn
- *os << "// in, inout, out, _retn " << be_nl;
- *os << "const " << namebuf << "_slice *in (void) const;" << be_nl;
- *os << namebuf << "_slice *inout (void);" << be_nl;
- *os << namebuf << "_slice *&out (void);" << be_nl;
- *os << namebuf << "_slice *_retn (void);" << be_nl;
-
- // generate an additional member function that returns the underlying pointer
- *os << namebuf << "_slice *ptr (void) const;" << be_uidt_nl;
-
- // generate the private section
- *os << "private:" << be_idt_nl;
- *os << namebuf << "_slice *ptr_;" << be_uidt_nl;
- *os << "};\n\n";
-
- return 0;
-}
-
-// generate the _out definition
-int
-be_visitor_array_ch::gen_out_defn (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- char namebuf [NAMEBUFSIZE]; // to hold the name
- char outnamebuf [NAMEBUFSIZE]; // to hold the _out name
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::memset (outnamebuf, '\0', NAMEBUFSIZE);
- if (this->ctx_->tdef ())
- {
- ACE_OS::sprintf (namebuf, "%s", node->local_name ()->get_string ());
- ACE_OS::sprintf (outnamebuf, "%s_out", node->local_name ()->get_string ());
- }
- else
- {
- // anonymous array
- ACE_OS::sprintf (namebuf, "_%s", node->local_name ()->get_string ());
- ACE_OS::sprintf (outnamebuf, "_%s_out", node->local_name ()->get_string ());
- }
-
- // generate the out definition (always in the client header)
- os->indent (); // start with whatever was our current indent level
-
- *os << "class " << idl_global->export_macro ()
- << " " << outnamebuf << be_nl;
- *os << "{" << be_nl;
- *os << "public:" << be_idt_nl;
-
- // No default constructor
-
- // constructor from a pointer to slice
- *os << outnamebuf << " (" << namebuf << "_slice *&);" << be_nl;
- // constructor from a _var &
- *os << outnamebuf << " (" << namebuf << "_var &);" << be_nl;
- // constructor from a _out &
- *os << outnamebuf << " (const " << outnamebuf << " &);" << be_nl;
- // assignment operator from a _out &
- *os << outnamebuf << " &operator= (const " << outnamebuf << " &);" << be_nl;
- // assignment from slice *
- *os << outnamebuf << " &operator= (" << namebuf << "_slice *);"
- << be_nl;
- // cast
- *os << "operator " << namebuf << "_slice *&();" << be_nl;
- // ptr fn
- *os << namebuf << "_slice *&ptr (void);" << be_nl;
- // operator [] instead of ->
- *os << namebuf << "_slice &operator[] (CORBA::ULong index);" << be_nl;
- *os << "const " << namebuf << "_slice &operator[] "
- << "(CORBA::ULong index) const;" << be_uidt_nl;
-
- *os << "private:" << be_idt_nl;
- *os << namebuf << "_slice *&ptr_;" << be_nl;
- *os << "// assignment from T_var not allowed" << be_nl;
- *os << "void operator= (const " << namebuf << "_var &);" << be_uidt_nl;
- *os << "};\n\n";
- return 0;
-}
-
-// generate the _var definition for ourself
-int
-be_visitor_array_ch::gen_forany_defn (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- char namebuf [NAMEBUFSIZE]; // names
- char foranyname [NAMEBUFSIZE]; // forany class names
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::memset (foranyname, '\0', NAMEBUFSIZE);
-
- if (this->ctx_->tdef ())
- {
- ACE_OS::sprintf (namebuf, "%s", node->local_name ()->get_string ());
- ACE_OS::sprintf (foranyname, "%s_forany", node->local_name ()->get_string ());
- }
- else
- {
- // anonymous array case
- ACE_OS::sprintf (namebuf, "_%s", node->local_name ()->get_string ());
- ACE_OS::sprintf (foranyname, "_%s_forany",
- node->local_name ()->get_string ());
- }
-
- // generate the forany definition (always in the client header).
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- os->indent (); // start with whatever was our current indent level
- *os << "class " << idl_global->export_macro ()
- << " " << foranyname << be_nl;
- *os << "{" << be_nl;
- *os << "public:" << be_idt_nl;
-
- // default constr
- *os << foranyname << " (void); // default constructor" << be_nl;
- // constr from pointer to slice
- *os << foranyname << " (" << namebuf << "_slice *, "
- << "CORBA::Boolean nocopy=0);" << be_nl;
- // copy constructor
- *os << foranyname << " (const " << foranyname
- << " &); // copy constructor" << be_nl;
- // destructor
- *os << "~" << foranyname << " (void); // destructor" << be_nl;
- *os << be_nl;
- // assignment operator from a pointer to slice
- *os << foranyname << " &operator= (" << namebuf << "_slice *);"
- << be_nl;
- // assignment from _var
- *os << foranyname << " &operator= (const " << foranyname << " &);" << be_nl;
-
- // arrow operator
- // nothing here
- *os << be_nl;
-
- // other extra types (cast operators, [] operator, and others)
- // overloaded [] operator
- *os << namebuf << "_slice &operator[] (CORBA::ULong index);"
- << be_nl;
- *os << "const " << namebuf
- << "_slice &operator[] (CORBA::ULong index) const;" << be_nl;
-
- // cast operators
- *os << "operator " << namebuf << "_slice * const &() const;"
- << be_nl;
- *os << "operator " << namebuf << "_slice *&();" << be_nl;
-
- // in, inout, out and _retn
- *os << "// in, inout, out, _retn " << be_nl;
- *os << "const " << namebuf << "_slice *in (void) const;" << be_nl;
- *os << namebuf << "_slice *inout (void);" << be_nl;
- *os << namebuf << "_slice *&out (void);" << be_nl;
- *os << namebuf << "_slice *_retn (void);" << be_nl;
-
- // generate an additional member function that returns the underlying pointer
- *os << namebuf << "_slice *ptr (void) const;" << be_nl;
-
- // additional member function that returns the NOCOPY flag
- *os << "CORBA::Boolean nocopy (void) const;" << be_uidt_nl;
-
- // generate the private section
- *os << "private:" << be_idt_nl;
- *os << "/* friend class CORBA_Any; */" << be_nl;
- *os << namebuf << "_slice *ptr_;" << be_nl;
- *os << "CORBA::Boolean nocopy_;" << be_uidt_nl;
- *os << "};\n\n";
-
- 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 b08c960285d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp
+++ /dev/null
@@ -1,641 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// array_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Arrays in the client inline.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_array.h"
-
-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 ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_array - "
- "bad base type\n"),
- -1);
- }
-
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- if (this->gen_anonymous_base_type (bt,
- TAO_CodeGen::TAO_SEQUENCE_CI)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_ci::"
- "visit_array - "
- "gen_anonymous_base_type failed\n"),
- -1);
- }
- }
-
- // generate code for the _var, _out, and _forany types
- if (this->gen_var_impl (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_ci::"
- "visit_array - "
- "var_defn failed\n"),
- -1);
- }
- if (node->size_type () == be_decl::VARIABLE)
- {
- if (this->gen_out_impl (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_ci::"
- "visit_array - "
- "out_defn failed\n"),
- -1);
- }
- }
-
- if (this->gen_forany_impl (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_ci::"
- "visit_array - "
- "forany_defn failed\n"),
- -1);
- }
-
- node->cli_inline_gen (1);
- return 0;
-}
-
-// implementation of the _var class. All of these get generated in the inline
-// file
-int
-be_visitor_array_ci::gen_var_impl (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- char nodename [NAMEBUFSIZE]; // node name
- char fname [NAMEBUFSIZE]; // to hold the full and
- char lname [NAMEBUFSIZE]; // local names of the var
- // save the node's local name and full name in a buffer for quick use later
- // on
- ACE_OS::memset (nodename, '\0', NAMEBUFSIZE);
- ACE_OS::memset (fname, '\0', NAMEBUFSIZE);
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- if (this->ctx_->tdef ())
- {
- // typedefed node
- ACE_OS::sprintf (nodename, "%s", node->fullname ());
- ACE_OS::sprintf (fname, "%s_var", node->fullname ());
- ACE_OS::sprintf (lname, "%s_var",
- 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 (nodename, "%s::_%s", parent->fullname (),
- node->local_name ()->get_string ());
- ACE_OS::sprintf (fname, "%s::_%s_var", parent->fullname (),
- node->local_name ()->get_string ());
- ACE_OS::sprintf (lname, "_%s_var",
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (nodename, "_%s", node->fullname ());
- ACE_OS::sprintf (fname, "_%s_var", node->fullname ());
- ACE_OS::sprintf (lname, "_%s_var",
- node->local_name ()->get_string ());
- }
- }
-
- // generate the var implementation in the inline file
-
- os->indent (); // start with whatever was our current indent level
-
- *os << "// *************************************************************"
- << be_nl;
- *os << "// Inline operations for class " << fname << be_nl;
- *os << "// *************************************************************\n\n";
-
- // default constr
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::" << lname <<
- " (void) // default constructor" << be_nl;
- *os << " " << ": ptr_ (0)" << be_nl;
- *os << "{}\n\n";
-
- // constr from a _slice *
- os->indent ();
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::" << lname << " (" << nodename << "_slice *p)" << be_nl;
- *os << " : ptr_ (p)" << be_nl;
- *os << "{}\n\n";
-
- // copy constructor (deep copy)
- os->indent ();
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::" << lname << " (const " << fname
- << " &p) // copy constructor" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "this->ptr_ = " << nodename << "_dup (p.ptr_);" << be_uidt_nl;
- *os << "}\n\n";
-
- // destructor
- os->indent ();
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::~" << lname << " (void) // destructor" << be_nl;
- *os << "{" << be_idt_nl;
- *os << nodename << "_free (this->ptr_);" << be_uidt_nl;
- *os << "}\n\n";
-
- // assignment operator
- os->indent ();
- *os << "ACE_INLINE " << fname << " &" << be_nl;
- *os << fname << "::operator= (" << nodename
- << "_slice *p)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "// is what we own the same that is being assigned to us?"
- << be_nl;
- *os << "if (this->ptr_ != p)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "// delete our stuff and assume ownership of p" << be_nl;
- *os << nodename << "_free (this->ptr_);" << be_nl;
- *os << "this->ptr_ = p;" << be_uidt_nl;
- *os << "}" << be_nl;
- *os << "return *this;" << be_uidt_nl;
- *os << "}\n\n";
-
- // assignment operator from _var
- os->indent ();
- *os << "ACE_INLINE " << fname << " &" << be_nl;
- *os << fname << "::operator= (const " << fname
- << " &p)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "if (this != &p)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "// not assigning to ourselves" << be_nl;
- *os << nodename << "_free (this->ptr_); // free old stuff" << be_nl;
- *os << "this->ptr_ = " << nodename
- << "_dup (p.ptr_);// deep copy" << be_uidt_nl;
- *os << "}" << be_nl;
- *os << "return *this;" << be_uidt_nl;
- *os << "}\n\n";
-
- // other extra methods - cast operators ()
- os->indent ();
- *os << "ACE_INLINE " << be_nl;
- *os << fname << "::operator " << nodename
- << "_slice * const &() const // cast" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_;" << be_uidt_nl;
- *os << "}\n\n";
-
- os->indent ();
- *os << "ACE_INLINE " << be_nl;
- *os << fname << "::operator " << nodename << "_slice *&() // cast " << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_;" << be_uidt_nl;
- *os << "}\n\n";
-
- // two operator []s instead of ->
- os->indent ();
- *os << "ACE_INLINE const " << nodename << "_slice &" << be_nl;
- *os << fname << "::operator[] (CORBA::ULong index) const" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_[index];" << be_uidt_nl;
- *os << "}\n\n";
-
- os->indent ();
- *os << "ACE_INLINE " << nodename << "_slice &" << be_nl;
- *os << fname << "::operator[] (CORBA::ULong index)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_[index];" << be_uidt_nl;
- *os << "}\n\n";
-
- // in, inout, out, and _retn
- os->indent ();
- *os << "ACE_INLINE const " << nodename << "_slice *" << be_nl;
- *os << fname << "::in (void) const" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_;" << be_uidt_nl;
- *os << "}\n\n";
-
- os->indent ();
- *os << "ACE_INLINE " << nodename << "_slice *" << be_nl;
- *os << fname << "::inout (void)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_;" << be_uidt_nl;
- *os << "}\n\n";
-
- os->indent ();
- *os << "ACE_INLINE " << nodename << "_slice * &" << be_nl;
- *os << fname << "::out (void)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << nodename << "_free (this->ptr_);" << be_nl;
- *os << "this->ptr_ = (" << nodename << "_slice *)0;" << be_nl;
- *os << "return this->ptr_;" << be_uidt_nl;
- *os << "}\n\n";
-
- os->indent ();
- *os << "ACE_INLINE " << nodename << "_slice *" << be_nl;
- *os << fname << "::_retn (void)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << nodename << "_slice *tmp = this->ptr_;" << be_nl;
- *os << "this->ptr_ = (" << nodename << "_slice *)0;" << be_nl;
- *os << "return tmp;" << be_uidt_nl;
- *os << "}\n\n";
-
- // the additional ptr () member function
- os->indent ();
- *os << "ACE_INLINE " << nodename << "_slice *" << be_nl;
- *os << fname << "::ptr (void) const" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_;" << be_uidt_nl;
- *os << "}\n\n";
-
- return 0;
-}
-
-int
-be_visitor_array_ci::gen_out_impl (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- char nodename [NAMEBUFSIZE]; // node name
- char fname [NAMEBUFSIZE]; // to hold the full and
- char lname [NAMEBUFSIZE]; // local names of the out class
- // save the node's local name and full name in a buffer for quick use later
- // on
- ACE_OS::memset (nodename, '\0', NAMEBUFSIZE);
- ACE_OS::memset (fname, '\0', NAMEBUFSIZE);
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- if (this->ctx_->tdef ())
- {
- // typedefed node
- ACE_OS::sprintf (nodename, "%s", node->fullname ());
- ACE_OS::sprintf (fname, "%s_out", node->fullname ());
- ACE_OS::sprintf (lname, "%s_out",
- 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 (nodename, "%s::_%s", parent->fullname (),
- node->local_name ()->get_string ());
- ACE_OS::sprintf (fname, "%s::_%s_out", parent->fullname (),
- node->local_name ()->get_string ());
- ACE_OS::sprintf (lname, "_%s_out",
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (nodename, "_%s", node->fullname ());
- ACE_OS::sprintf (fname, "_%s_out", node->fullname ());
- ACE_OS::sprintf (lname, "_%s_out",
- node->local_name ()->get_string ());
- }
- }
-
- // generate the out implementation in the inline file
-
- os->indent (); // start with whatever was our current indent level
-
- *os << "// *************************************************************"
- << be_nl;
- *os << "// Inline operations for class " << fname << be_nl;
- *os << "// *************************************************************\n\n";
-
- // constr from a pointer to slice
- os->indent ();
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::" << lname << " (" << nodename << "_slice *&p)" << be_nl;
- *os << " : ptr_ (p)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "this->ptr_ = 0;" << be_uidt_nl;
- *os << "}\n\n";
-
- // constructor from _var &
- os->indent ();
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::" << lname << " (" << nodename
- << "_var &p) // constructor from _var" << be_nl;
- *os << " : ptr_ (p.out ())" << be_nl;
- *os << "{" << be_idt_nl;
- *os << nodename << "_free (this->ptr_);" << be_nl;
- *os << "this->ptr_ = 0;" << be_uidt_nl;
- *os << "}\n\n";
-
- // copy constructor
- os->indent ();
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::" << lname << " (const " << fname
- << " &p) // copy constructor" << be_nl;
- *os << " : ptr_ (ACE_const_cast ("
- << fname << "&,p).ptr_)" << be_nl;
- *os << "{}\n\n";
-
- // assignment operator from _out &
- os->indent ();
- *os << "ACE_INLINE " << fname << " &" << be_nl;
- *os << fname << "::operator= (const " << fname
- << " &p)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "this->ptr_ = ACE_const_cast ("
- << fname << "&,p).ptr_;" << be_nl;
- *os << "return *this;" << be_uidt_nl;
- *os << "}\n\n";
-
- // assignment from _var is not allowed
-
- // assignment operator from _ptr
- os->indent ();
- *os << "ACE_INLINE " << fname << " &" << be_nl;
- *os << fname << "::operator= (" << nodename
- << "_slice *p)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "this->ptr_ = p;" << be_nl;
- *os << "return *this;" << be_uidt_nl;
- *os << "}\n\n";
-
- // other extra methods - cast operator ()
- os->indent ();
- *os << "ACE_INLINE " << be_nl;
- *os << fname << "::operator " << nodename
- << "_slice *&() // cast" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_;" << be_uidt_nl;
- *os << "}\n\n";
-
- // ptr function
- os->indent ();
- *os << "ACE_INLINE " << nodename << "_slice *&" << be_nl;
- *os << fname << "::ptr (void) // ptr" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_;" << be_uidt_nl;
- *os << "}\n\n";
-
- // operator [] instead of ->
- os->indent ();
- *os << "ACE_INLINE " << nodename << "_slice &" << be_nl;
- *os << fname << "::operator[] (CORBA::ULong index)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_[index];" << be_uidt_nl;
- *os << "}\n\n";
-
- return 0;
-}
-
-int
-be_visitor_array_ci::gen_forany_impl (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- char nodename [NAMEBUFSIZE]; // node name
- char fname [NAMEBUFSIZE]; // to hold the full and
- char lname [NAMEBUFSIZE]; // local names of the var
- // save the node's local name and full name in a buffer for quick use later
- // on
- ACE_OS::memset (nodename, '\0', NAMEBUFSIZE);
- ACE_OS::memset (fname, '\0', NAMEBUFSIZE);
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- if (this->ctx_->tdef ())
- {
- // typedefed node
- ACE_OS::sprintf (nodename, "%s", node->fullname ());
- ACE_OS::sprintf (fname, "%s_forany", node->fullname ());
- ACE_OS::sprintf (lname, "%s_forany",
- 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 (nodename, "%s::_%s", parent->fullname (),
- node->local_name ()->get_string ());
- ACE_OS::sprintf (fname, "%s::_%s_forany", parent->fullname (),
- node->local_name ()->get_string ());
- ACE_OS::sprintf (lname, "_%s_forany",
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (nodename, "_%s", node->fullname ());
- ACE_OS::sprintf (fname, "_%s_forany", node->fullname ());
- ACE_OS::sprintf (lname, "_%s_forany",
- node->local_name ()->get_string ());
- }
- }
-
- // generate the var implementation in the inline file
-
- os->indent (); // start with whatever was our current indent level
-
- *os << "// *************************************************************"
- << be_nl;
- *os << "// Inline operations for class " << fname << be_nl;
- *os << "// *************************************************************\n\n";
-
- // default constr
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::" << lname <<
- " (void) // default constructor" << be_nl;
- *os << " " << ": ptr_ (0)," << be_nl;
- *os << " nocopy_ (0)" << be_nl;
- *os << "{}\n\n";
-
- // constr from a _slice *
- os->indent ();
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::" << lname << " (" << nodename << "_slice *p, "
- << "CORBA::Boolean nocopy)" << be_nl;
- *os << " : ptr_ (p)," << be_nl;
- *os << " nocopy_ (nocopy)" << be_nl;
- *os << "{}\n\n";
-
- // copy constructor (deep copy)
- os->indent ();
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::" << lname << " (const " << fname
- << " &p) // copy constructor" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "this->ptr_ = " << nodename << "_dup (p.ptr_);" << be_nl;
- *os << "this->nocopy_ = p.nocopy_;" << be_uidt_nl;
- *os << "}\n\n";
-
- // destructor
- os->indent ();
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::~" << lname << " (void) // destructor" << be_nl;
- *os << "{" << be_nl;
- *os << " // don't do anything" << be_nl;
- *os << "}\n\n";
-
- // assignment operator
- os->indent ();
- *os << "ACE_INLINE " << fname << " &" << be_nl;
- *os << fname << "::operator= (" << nodename
- << "_slice *p)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "// is what we own the same that is being assigned to us?" <<
- be_nl;
- *os << "if (this->ptr_ != p)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "// delete our stuff and assume ownership of p" << be_nl;
- *os << nodename << "_free (this->ptr_);" << be_nl;
- *os << "this->ptr_ = p;" << be_uidt_nl;
- *os << "}" << be_nl;
- *os << "return *this;" << be_uidt_nl;
- *os << "}\n\n";
-
- // assignment operator from _forany
- os->indent ();
- *os << "ACE_INLINE " << fname << " &" << be_nl;
- *os << fname << "::operator= (const " << fname
- << " &p)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "if (this != &p)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "// not assigning to ourselves" << be_nl;
- *os << nodename << "_free (this->ptr_); // free old stuff" << be_nl;
- *os << "this->ptr_ = " << nodename
- << "_dup (p.ptr_);// deep copy" << be_nl;
- *os << "this->nocopy_ = p.nocopy_;" << be_uidt_nl;
- *os << "}" << be_nl;
- *os << "return *this;" << be_uidt_nl;
- *os << "}\n\n";
-
- // other extra methods - cast operators ()
- os->indent ();
- *os << "ACE_INLINE " << be_nl;
- *os << fname << "::operator " << nodename
- << "_slice * const &() const // cast" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_;" << be_uidt_nl;
- *os << "}\n\n";
-
- os->indent ();
- *os << "ACE_INLINE " << be_nl;
- *os << fname << "::operator " << nodename
- << "_slice *&() // cast " << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_;" << be_uidt_nl;
- *os << "}\n\n";
-
- // two operator []s instead of ->
- os->indent ();
- *os << "ACE_INLINE " << nodename << "_slice const &" << be_nl;
- *os << fname << "::operator[] (CORBA::ULong index) const" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_[index];" << be_uidt_nl;
- *os << "}\n\n";
-
- os->indent ();
- *os << "ACE_INLINE " << nodename << "_slice &" << be_nl;
- *os << fname << "::operator[] (CORBA::ULong index)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_[index];" << be_uidt_nl;
- *os << "}\n\n";
-
- // in, inout, out, and _retn
- os->indent ();
- *os << "ACE_INLINE const " << nodename << "_slice *" << be_nl;
- *os << fname << "::in (void) const" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_;" << be_uidt_nl;
- *os << "}\n\n";
-
- os->indent ();
- *os << "ACE_INLINE " << nodename << "_slice *" << be_nl;
- *os << fname << "::inout (void)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_;" << be_uidt_nl;
- *os << "}\n\n";
-
- os->indent ();
- *os << "ACE_INLINE " << nodename << "_slice * &" << be_nl;
- *os << fname << "::out (void)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_;" << be_uidt_nl;
- *os << "}\n\n";
-
- os->indent ();
- *os << "ACE_INLINE " << nodename << "_slice *" << be_nl;
- *os << fname << "::_retn (void)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_;" << be_uidt_nl;
- *os << "}\n\n";
-
- // the additional ptr () member function
- os->indent ();
- *os << "ACE_INLINE " << nodename << "_slice *" << be_nl;
- *os << fname << "::ptr (void) const" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->ptr_;" << be_uidt_nl;
- *os << "}\n\n";
-
- // the additional nocopy member function
- os->indent ();
- *os << "ACE_INLINE CORBA::Boolean" << be_nl;
- *os << fname << "::nocopy (void) const" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return this->nocopy_;" << be_uidt_nl;
- *os << "}\n\n";
-
- 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 981355135c5..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp
+++ /dev/null
@@ -1,309 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// array_cs.cpp
-//
-// = DESCRIPTION
-// Visitor for code generation of Arrays in the client stubs
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_array.h"
-
-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)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_type *bt; // base type
- unsigned long i;
-
- // nothing to do if we are imported or code is already generated
- if (node->imported () || (node->cli_stub_gen ()))
- return 0;
-
- this->ctx_->node (node); // save the array node
-
- // retrieve the type
- bt = be_type::narrow_from_decl (node->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_ci::"
- "visit_array - "
- "Bad base type\n"),
- -1);
- }
-
- char fname [NAMEBUFSIZE]; // to hold the full and
- char lname [NAMEBUFSIZE]; // local names of the var
- // save the node's local name and full name in a buffer for quick use later
- // on
- ACE_OS::memset (fname, '\0', NAMEBUFSIZE);
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- if (this->ctx_->tdef ())
- {
- // typedefed node
- ACE_OS::sprintf (fname, "%s", node->fullname ());
- 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->fullname (),
- node->local_name ()->get_string ());
- ACE_OS::sprintf (lname, "_%s",
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname, "_%s", node->fullname ());
- ACE_OS::sprintf (lname, "_%s",
- node->local_name ()->get_string ());
- }
- }
-
- // dup method
- os->indent ();
- *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 = " << fname
- << "_alloc ();" << be_nl;
- *os << "if (!_tao_dup_array) return (" << fname
- << "_slice *)0;" << be_nl;
- *os << fname << "_copy (_tao_dup_array, _tao_src_array);" << be_nl;
- *os << "return _tao_dup_array;" << be_uidt_nl;
- *os << "}\n\n";
-
- // alloc method
- os->indent (); // start from current indentation
- *os << fname << "_slice *" << be_nl;
- *os << fname << "_alloc (void)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return new ";
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_ci::"
- "visit_array - "
- "base type decl failed\n"),
- -1);
- }
-
- if (node->gen_dimensions (os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_array::"
- "gen_client - "
- "dimensions codegen failed\n"),
- -1);
- }
-
- *os << ";" << be_uidt_nl;
- *os << "}\n\n";
-
- // free method
- os->indent ();
- *os << "void" << be_nl
- << fname << "_free (" << fname
- << "_slice *_tao_slice)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "delete [] _tao_slice;" << be_uidt_nl;
- *os << "}\n\n";
-
- // copy method
- os->indent ();
- *os << "void " << be_nl;
- *os << fname << "_copy (" << fname << "_slice * _tao_to, "
- << "const " << fname << "_slice *_tao_from)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "// copy each individual element" << be_nl;
-
- // generate nested loops for as many dimensions as there are
- for (i = 0; i < node->n_dims (); i++)
- {
- // retrieve the ith dimension value
- AST_Expression *expr = node->dims ()[i];
- // dimension value
- if ((expr == NULL) || ((expr != NULL) && (expr->ev () == NULL)))
- {
- 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;
- }
- 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 < node->n_dims (); i++)
- {
- *os << "[i" << i << "]";
- }
- *os << ", ";
- *os << "_tao_from"; // generate the rvalue
- for (i = 0; i < node->n_dims (); 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"; // generate the lvalue
- for (i = 0; i < node->n_dims (); i++)
- {
- *os << "[i" << i << "]";
- }
- *os << " = ";
- *os << "_tao_from"; // generate the rvalue
- for (i = 0; i < node->n_dims (); i++)
- {
- *os << "[i" << i << "]";
- }
- *os << ";";
- }
- for (i = 0; i < node->n_dims (); i++)
- {
- // decrement indentation as many times as the number of dimensions
- *os << be_uidt;
- }
- *os << be_uidt_nl << "}\n\n";
-
- // If we contain an anonymous sequence,
- // generate code for the seuqence here.
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- if (this->gen_anonymous_base_type (bt,
- TAO_CodeGen::TAO_SEQUENCE_CS)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cs::"
- "visit_array - "
- "gen_anonymous_base_type failed\n"),
- -1);
- }
- }
-
-#if 0
- // typecode for anonymous arrays is not required since we do not generate the
- // Any operators for it and it cannot be used as a type
-
- // is this a typedefined array? if so, then let the typedef deal with
- // generation of the typecode
- if (!this->ctx_->tdef ())
- {
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- be_visitor_context ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DEFN);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cs::"
- "visit_array - "
- "TypeCode definition failed\n"
- ), -1);
- }
- delete visitor;
- }
-#endif /* 0 */
-
- node->cli_stub_gen (1);
-
- 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 3af1abc3abd..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp
+++ /dev/null
@@ -1,115 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_array.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 ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // generate the CDR << and >> operator declarations
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator<< (TAO_OutputCDR &, const ";
- // @@ TODO: this should be done in the node, it is absurd to repeat
- // this code all over the visitors!!!!
- if (!this->ctx_->tdef ())
- {
- be_scope* scope = be_scope::narrow_from_scope (node->defined_in ());
- be_decl* parent = scope->decl ();
- *os << parent->fullname ()
- << "::_" << node->local_name ()
- << "_forany &);" << be_nl;
- }
- else
- {
- *os << node->name () << "_forany &);" << be_nl;
- }
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " 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->fullname ()
- << "::_" << node->local_name ()
- << "_forany &);" << be_nl;
- }
- else
- {
- *os << node->name () << "_forany &);" << be_nl;
- }
-
- // If we contain an anonymous sequence,
- // generate code for the sequence here.
-
- // retrieve the type
- be_type *bt = be_type::narrow_from_decl (node->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_ch::"
- "visit_array - "
- "bad base type\n"),
- -1);
- }
-
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- if (this->gen_anonymous_base_type (bt,
- TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CH)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_ch::"
- "visit_array - "
- "gen_anonymous_base_type failed\n"),
- -1);
- }
- }
-
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp
deleted file mode 100644
index 5995c25313b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp
+++ /dev/null
@@ -1,646 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ci.cpp
-//
-// = DESCRIPTION
-// Visitor for code generation of Arrays for the CDR operators in the client
-// stubs.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_array.h"
-
-ACE_RCSID(be_visitor_array, cdr_op_ci, "$Id$")
-
-
-// ***************************************************************************
-// Array visitor for generating CDR operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_array_cdr_op_ci::be_visitor_array_cdr_op_ci
-(be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_array_cdr_op_ci::~be_visitor_array_cdr_op_ci (void)
-{
-}
-
-int
-be_visitor_array_cdr_op_ci::visit_array (be_array *node)
-{
- if (this->ctx_->alias ())
- {
- // we are here because the base type of the array node is itself an array
- // i.e., this is a case of array of array
- return this->visit_node (node);
- }
- else
- {
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_type *bt; // base type of the array
-
- if (node->cli_inline_cdr_op_gen () || node->imported ())
- return 0;
-
- // retrieve the type
- bt = be_type::narrow_from_decl (node->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_cdr_op_ci::"
- "visit_array - "
- "Bad base type\n"),
- -1);
- }
-
- // If we contain an anonymous sequence,
- // generate code for the sequence here.
-
- if (bt->node_type () == AST_Decl::NT_sequence)
- {
- // @@ (JP) TODO - change state arg to _CI when the rest of
- // the cdr_op files get unhacked.
- if (this->gen_anonymous_base_type (bt,
- TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CS)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_array - "
- "gen_anonymous_base_type failed\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_->tdef ())
- {
- // typedefed node
- ACE_OS::sprintf (fname, "%s", node->fullname ());
- }
- 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->fullname (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname, "_%s", node->fullname ());
- }
- }
-
- // generate the CDR << and >> operator defns
-
- // save the array node for further use
- this->ctx_->node (node);
-
- // set the sub state as generating code for the output operator
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
- *os << "ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, "
- << "const " << fname << "_forany &_tao_array)" << be_nl
- << "{" << be_idt_nl;
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_cdr_op_ci::"
- "visit_array - "
- "Base type codegen failed\n"),
- -1);
- }
- *os << "}\n\n";
-
- // set the sub state as generating code for the input operator
- os->indent ();
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- *os << "ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, "
- << fname << "_forany &_tao_array)" << be_nl
- << "{" << be_idt_nl;
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_array_cdr_op_ci::"
- "visit_array - "
- "Base type codegen failed\n"),
- -1);
- }
- *os << "}\n\n";
-
- node->cli_inline_cdr_op_gen (1);
- }
- return 0;
-}
-
-// handle all the base types
-
-int
-be_visitor_array_cdr_op_ci::visit_enum (be_enum *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_ci::visit_interface (be_interface *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_ci::visit_interface_fwd (be_interface_fwd *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_ci::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_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_ci::"
- "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
-
- // index
- 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_ci::"
- "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 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_ci::"
- "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:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_ci::"
- "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:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_ci::"
- "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:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_ci::"
- "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:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_ci::"
- "visit_predefined_type - "
- "bad substate in context\n"),
- -1);
- }
-
- // generate a product of all the dimensions. This will be the total length of
- // the "unfolded" single dimensional array.
- for (i = 0; i < array->n_dims (); i++)
- {
- // retrieve the ith dimension value
- AST_Expression *expr = array->dims ()[i];
- // dimension value
- if ((expr == NULL) || ((expr != NULL) && (expr->ev () == NULL)))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_ci::"
- "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_ci::"
- "visit_predefined_type - "
- "bad array dimension value\n"),
- -1);
- }
- }
- *os << ");" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_array_cdr_op_ci::visit_sequence (be_sequence *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_ci::visit_string (be_string *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_ci::visit_structure (be_structure *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_ci::visit_union (be_union *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_array_cdr_op_ci::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_array_cdr_op_ci::"
- "visit_typedef - "
- "Bad primitive type\n"
- ), -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-// helper
-int
-be_visitor_array_cdr_op_ci::visit_node (be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- unsigned long i;
- be_array *node = this->ctx_->be_node_as_array ();
-
- if (!node)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_ci::"
- "visit_node - "
- "bad array node\n"),
- -1);
- }
-
- // initialize a boolean variable
- *os << "CORBA::Boolean _tao_marshal_flag = 1;" << be_nl;
-
- // 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 < node->n_dims (); i++)
- {
- // retrieve the ith dimension value
- AST_Expression *expr = node->dims ()[i];
- // dimension value
- if ((expr == NULL) || ((expr != NULL) && (expr->ev () == NULL)))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_ci::"
- "visit_node - "
- "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 << " && _tao_marshal_flag; i" << i
- << "++)" << be_idt_nl;
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_ci::"
- "visit_node - "
- "bad array dimension value\n"),
- -1);
- }
- }
-
- // if the type was a string, an obj ref, or a pseudo-obj, we are dealing with
- // the _var type and hence we must use the appropriate in () and out () methods
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "_tao_marshal_flag = (strm >> ";
- // handle the array of array case in which case, we need to pass the
- // forany type
- if (bt->node_type () == AST_Decl::NT_array)
- {
- *os << bt->name () << "_forany ((" << bt->name ()
- << "_slice *) ";
- }
- *os << "_tao_array ";
- for (i = 0; i < node->n_dims (); 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_interface:
- case AST_Decl::NT_interface_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_cdr_op_ci::"
- "visit_node - "
- "bad predefined type node\n"),
- -1);
- }
- if (pt->pt () == AST_PredefinedType::PT_pseudo)
- {
- *os << ".out ()";
- }
- }
- default:
- break;
- }
- if (bt->node_type () == AST_Decl::NT_array)
- {
- *os << ")";
- }
- *os << ");";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "_tao_marshal_flag = (strm << ";
- // handle the array of array case in which case, we need to pass the
- // forany type
- if (bt->node_type () == AST_Decl::NT_array)
- {
- *os << bt->name () << "_forany ((" << bt->name ()
- << "_slice *) ";
- }
- *os << "_tao_array ";
- for (i = 0; i < node->n_dims (); i++)
- {
- *os << "[i" << i << "]";
- }
- switch (bt->node_type ())
- {
- // the follwoing three have a _var type and must be handled in a
- // special way
- case AST_Decl::NT_string:
- case AST_Decl::NT_interface:
- case AST_Decl::NT_interface_fwd:
- *os << ".in ()";
- break;
- case AST_Decl::NT_pre_defined:
- {
- 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_ci::"
- "visit_node - "
- "bad predefined type node\n"),
- -1);
- }
- if (pt->pt () == AST_PredefinedType::PT_pseudo)
- {
- *os << ".in ()";
- }
- }
- break;
- default:
- break;
- }
- if (bt->node_type () == AST_Decl::NT_array)
- {
- // array of array case
- *os << ")";
- }
- *os << ");";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_array_cdr_op_ci::"
- "visit_node - "
- "bad sub state\n"),
- -1);
- }
-
- for (i = 0; i < node->n_dims (); i++)
- {
- // decrement indentation as many times as the number of dimensions
- *os << be_uidt;
- }
- *os << be_nl;
- *os << "return _tao_marshal_flag;" << be_uidt_nl;
-
- 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 7b11a6294c2..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_attribute.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_attribute.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Attribute
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_attribute.h"
-
-// include all the individual files
-#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 78c24582e13..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp
+++ /dev/null
@@ -1,231 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// attribute.cpp
-//
-// = DESCRIPTION
-// Visitor for generation of code for Attribute
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_attribute.h"
-
-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); // save the node
- this->ctx_->attribute (node); // save this attribute node
-
- be_operation *op;
-
- // first the "get" operation
- op = new be_operation (node->field_type (), AST_Operation::OP_noflags,
- node->name (), 0);
- op->set_name (node->name ());
- be_visitor_context ctx (*this->ctx_);
-
- // this switch statement eliminates the need for different classes that have
- // exactly the same code except different states.
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ATTRIBUTE_CH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_CS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CS);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_SH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_SH);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_IH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_IH);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_SS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_SS);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_IS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_IS);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SH);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI:
- ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SI);
- break;
- default:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "bad codegen state\n"),
- -1);
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || !op || (op->accept (visitor) == -1))
- {
- delete visitor;
- delete op;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for get_attribute failed\n"),
- -1);
- }
- delete op;
- delete visitor;
- if (node->readonly ())
- return 0; // nothing else to do
-
- // the set method.
- // the return type is "void"
- be_predefined_type *rt = new be_predefined_type (AST_PredefinedType::PT_void,
- new UTL_ScopedName
- (new Identifier
- ("void", 1, 0, I_FALSE), 0),
- 0);
- // argument type is the same as the attribute type
- be_argument *arg = new be_argument (AST_Argument::dir_IN,
- node->field_type (),
- node->name (),
- 0);
- arg->set_name (node->name ());
- // create the operation
- op = new be_operation (rt, AST_Operation::OP_noflags,
- node->name (), 0);
- op->set_name (node->name ());
- op->add_argument_to_scope (arg);
-
- ctx = *this->ctx_;
- // this switch statement eliminates the need for different classes that have
- // exactly the same code except different states.
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ATTRIBUTE_CH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_CS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CS);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_SH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_SH);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_IH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_IH);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_SS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_SS);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_IS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_IS);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SH);
- break;
- case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI:
- ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SI);
- break;
- default:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "bad codegen state\n"),
- -1);
- }
-
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || !op || (op->accept (visitor) == -1))
- {
- delete visitor;
- delete op;
- delete arg;
- delete rt;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for set_attribute failed\n"),
- -1);
- }
- delete op;
- delete visitor;
- delete rt;
- delete arg;
- return 0;
-}
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 0281cbccf4d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_constant.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_constant.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Constant
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_constant.h"
-
-// include all the individual files
-#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 5f38c6e62fc..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp
+++ /dev/null
@@ -1,76 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_constant.h"
-
-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_Ch node and its scope
-int
-be_visitor_constant_ch::visit_constant (be_constant *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (!node->cli_hdr_gen () && !node->imported ())
- {
- // 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
-
- os->indent (); // start from whatever indentation level we were at
- // 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))
- *os << "TAO_NAMESPACE_STORAGE_CLASS ";
- else
- *os << "static ";
- *os << "const " << node->exprtype_to_string ()
- << " " << node->local_name ();
- if (!node->is_nested ())
- {
- // We were defined at the outermost scope. So we put the value in the
- // header itself
- *os << " = " << node->constant_value ();
- }
- *os << ";\n\n";
- node->cli_hdr_gen (I_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 2f40e9fbbf9..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp
+++ /dev/null
@@ -1,136 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_constant.h"
-
-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)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (!node->cli_stub_gen () && !node->imported ())
- {
- if (node->is_nested ())
- {
- if (node->defined_in ()->scope_node_type () == AST_Decl::NT_module)
- {
- *os << "TAO_NAMESPACE_TYPE (const "
- << node->exprtype_to_string () << ")" << be_nl;
- be_module *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_constant_cs::visit_constant - "
- "Error parsing nested name\n"),
- -1);
- }
- *os << "TAO_NAMESPACE_DEFINE (const "
- << node->exprtype_to_string () << ", "
- << node->local_name () << ", "
- << node->constant_value () << ")" << be_nl;
- if (this->gen_nested_namespace_end (module) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_constant_cs::visit_constant - "
- "Error parsing nested name\n"),
- -1);
- }
- }
- else
- {
- // for those constants not defined in the outer most scope, they get
- // assigned to their values in the impl file
- os->indent (); // start from whatever indentation level we were at
- *os << "const " << node->exprtype_to_string () << " "
- << node->name () << " = " << node->constant_value ()
- << ";\n\n";
- }
- }
- node->cli_stub_gen (I_TRUE);
- }
- return 0;
-}
-
-// the following needs to be done to deal with the most bizarre behavior of
-// MSVC++ compiler
-int
-be_visitor_constant_cs::gen_nested_namespace_begin (be_module *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- UTL_IdListActiveIterator *i;
-
- i = new UTL_IdListActiveIterator (node->name ());
- while (!(i->is_done ()))
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- {
- // leave the outermost root scope
- *os << "TAO_NAMESPACE_BEGIN (" << i->item ()->get_string ()
- << ")" << be_nl;
- }
- i->next ();
- }
- delete i;
- return 0;
-}
-
-// the following needs to be done to deal with the most bizarre behavior of
-// MSVC++ compiler
-int
-be_visitor_constant_cs::gen_nested_namespace_end (be_module *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- UTL_IdListActiveIterator *i;
-
- i = new UTL_IdListActiveIterator (node->name ());
- while (!(i->is_done ()))
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- {
- // leave the outermost root scope
- *os << "TAO_NAMESPACE_END" << be_nl;
- }
- i->next ();
- }
- delete i;
- 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 8102f332f78..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_context.cpp
+++ /dev/null
@@ -1,514 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_context.cpp
-//
-// = DESCRIPTION
-// Maintains the context information for visitors
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be, be_visitor_context, "$Id$")
-
-
-// constructor
-be_visitor_context::be_visitor_context (void)
- : state_ (TAO_CodeGen::TAO_UNKNOWN),
- 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 (idl_bool ib)
-{
- this->exception_ = ib;
-}
-
-idl_bool
-be_visitor_context::exception (void)
-{
- return this->exception_;
-}
-
-void
-be_visitor_context::comma (idl_bool ib)
-{
- this->comma_ = ib;
-}
-
-idl_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_;
-}
-
-// ****************************************************************
-
-// return the node as argument if possible
-be_argument *
-be_visitor_context::be_node_as_argument (void)
-{
- if (this->node_)
- return be_argument::narrow_from_decl (this->node_);
- else
- return (be_argument *)0;
-}
-
-// return the node as array if possible
-be_array *
-be_visitor_context::be_node_as_array (void)
-{
- if (this->node_)
- return be_array::narrow_from_decl (this->node_);
- else
- return (be_array *)0;
-}
-
-// return the node as attribute if possible
-be_attribute *
-be_visitor_context::be_node_as_attribute (void)
-{
- if (this->node_)
- return be_attribute::narrow_from_decl (this->node_);
- else
- return (be_attribute *)0;
-}
-
-// return the node as constant if possible
-be_constant *
-be_visitor_context::be_node_as_constant (void)
-{
- if (this->node_)
- return be_constant::narrow_from_decl (this->node_);
- else
- return (be_constant *)0;
-}
-
-// return the node as enum if possible
-be_enum *
-be_visitor_context::be_node_as_enum (void)
-{
- if (this->node_)
- return be_enum::narrow_from_decl (this->node_);
- else
- return (be_enum *)0;
-}
-
-// return the node as enum_val if possible
-be_enum_val *
-be_visitor_context::be_node_as_enum_val (void)
-{
- if (this->node_)
- return be_enum_val::narrow_from_decl (this->node_);
- else
- return (be_enum_val *)0;
-}
-
-// return the node as exception if possible
-be_exception *
-be_visitor_context::be_node_as_exception (void)
-{
- if (this->node_)
- return be_exception::narrow_from_decl (this->node_);
- else
- return (be_exception *)0;
-}
-
-// return the node as field if possible
-be_field *
-be_visitor_context::be_node_as_field (void)
-{
- if (this->node_)
- return be_field::narrow_from_decl (this->node_);
- else
- return (be_field *)0;
-}
-
-// return the node as interface if possible
-be_interface *
-be_visitor_context::be_node_as_interface (void)
-{
- if (this->node_)
- return be_interface::narrow_from_decl (this->node_);
- else
- return (be_interface *)0;
-}
-
-// return the node as interface_fwd if possible
-be_interface_fwd *
-be_visitor_context::be_node_as_interface_fwd (void)
-{
- if (this->node_)
- return be_interface_fwd::narrow_from_decl (this->node_);
- else
- return (be_interface_fwd *)0;
-}
-
-// return the node as module if possible
-be_module *
-be_visitor_context::be_node_as_module (void)
-{
- if (this->node_)
- return be_module::narrow_from_decl (this->node_);
- else
- return (be_module *)0;
-}
-
-// return the node as operation if possible
-be_operation *
-be_visitor_context::be_node_as_operation (void)
-{
- if (this->node_)
- return be_operation::narrow_from_decl (this->node_);
- else
- return (be_operation *)0;
-}
-
-// return the node as predefined_type if possible
-be_predefined_type *
-be_visitor_context::be_node_as_predefined_type (void)
-{
- if (this->node_)
- return be_predefined_type::narrow_from_decl (this->node_);
- else
- return (be_predefined_type *)0;
-}
-
-// return the node as root if possible
-be_root *
-be_visitor_context::be_node_as_root (void)
-{
- if (this->node_)
- return be_root::narrow_from_decl (this->node_);
- else
- return (be_root *)0;
-}
-
-// return the node as sequence if possible
-be_sequence *
-be_visitor_context::be_node_as_sequence (void)
-{
- if (this->node_)
- return be_sequence::narrow_from_decl (this->node_);
- else
- return (be_sequence *)0;
-}
-
-// return the node as string if possible
-be_string *
-be_visitor_context::be_node_as_string (void)
-{
- if (this->node_)
- return be_string::narrow_from_decl (this->node_);
- else
- return (be_string *)0;
-}
-
-// return the node as structure if possible
-be_structure *
-be_visitor_context::be_node_as_structure (void)
-{
- if (this->node_)
- return be_structure::narrow_from_decl (this->node_);
- else
- return (be_structure *)0;
-}
-
-// return the node as typedef if possible
-be_typedef *
-be_visitor_context::be_node_as_typedef (void)
-{
- if (this->node_)
- return be_typedef::narrow_from_decl (this->node_);
- else
- return (be_typedef *)0;
-}
-
-// return the node as union if possible
-be_union *
-be_visitor_context::be_node_as_union (void)
-{
- if (this->node_)
- return be_union::narrow_from_decl (this->node_);
- else
- return (be_union *)0;
-}
-
-// return the node as union_branch if possible
-be_union_branch *
-be_visitor_context::be_node_as_union_branch (void)
-{
- if (this->node_)
- return be_union_branch::narrow_from_decl (this->node_);
- else
- return (be_union_branch *)0;
-}
-
-// for scope
-
-// return the scope as enum if possible
-be_enum *
-be_visitor_context::be_scope_as_enum (void)
-{
- if (this->scope_)
- return be_enum::narrow_from_decl (this->scope_);
- else
- return (be_enum *)0;
-}
-
-// return the scope as exception if possible
-be_exception *
-be_visitor_context::be_scope_as_exception (void)
-{
- if (this->scope_)
- return be_exception::narrow_from_decl (this->scope_);
- else
- return (be_exception *)0;
-}
-
-// return the scope as interface if possible
-be_interface *
-be_visitor_context::be_scope_as_interface (void)
-{
- if (this->scope_)
- return be_interface::narrow_from_decl (this->scope_);
- else
- return (be_interface *)0;
-}
-
-// return the scope as module if possible
-be_module *
-be_visitor_context::be_scope_as_module (void)
-{
- if (this->scope_)
- return be_module::narrow_from_decl (this->scope_);
- else
- return (be_module *)0;
-}
-
-// return the scope as operation if possible
-be_operation *
-be_visitor_context::be_scope_as_operation (void)
-{
- if (this->scope_)
- return be_operation::narrow_from_decl (this->scope_);
- else
- return (be_operation *)0;
-}
-
-// return the scope as root if possible
-be_root *
-be_visitor_context::be_scope_as_root (void)
-{
- if (this->scope_)
- return be_root::narrow_from_decl (this->scope_);
- else
- return (be_root *)0;
-}
-
-// return the scope as structure if possible
-be_structure *
-be_visitor_context::be_scope_as_structure (void)
-{
- if (this->scope_)
- return be_structure::narrow_from_decl (this->scope_);
- else
- return (be_structure *)0;
-}
-
-// return the scope as union if possible
-be_union *
-be_visitor_context::be_scope_as_union (void)
-{
- if (this->scope_)
- return be_union::narrow_from_decl (this->scope_);
- else
- return (be_union *)0;
-}
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 8539de31d30..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_decl.cpp
+++ /dev/null
@@ -1,80 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_decl.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)
-{
- delete 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);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_decl::"
- "gen_anonymous_base_type - "
- "bad visitor to anonymous abase type\n"),
- -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_decl::"
- "gen_anonymous_base_type - "
- "anonymous base type codegen failed\n"),
- -1);
- }
-
- delete visitor;
- }
-
- 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 aaef1a06f60..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_enum.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_enum.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Enum
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_enum.h"
-
-// include all the individual files
-#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_ci.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 46b3c3013ed..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Enums for the Any operators
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_enum.h"
-
-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 ();
-
- // generate the Any <<= and >>= operators
- os->indent ();
- *os << "void " << idl_global->export_macro ()
- << " operator<<= (CORBA::Any &, " << node->name ()
- << ");" << be_nl;
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator>>= (const CORBA::Any &, "
- << node->name () << " &);\n";
-
- 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 279802dce72..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp
+++ /dev/null
@@ -1,104 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_enum.h"
-
-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 ();
-
- // generate the Any <<= and >>= operator declarations
- // Any <<= and >>= operators
- os->indent ();
- *os << "void operator<<= (CORBA::Any &_tao_any, "
- << node->name () << " _tao_elem)" << be_nl
- << "{" << be_idt_nl
- << node->name () << " *_any_val;" << be_nl
- << "ACE_NEW (_any_val, " << node->name ()
- << " (_tao_elem));" << be_nl
- << "if (!_any_val) return;" << be_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "_tao_any.replace (" << node->tc_name ()
- << ", _any_val, 1, ACE_TRY_ENV);" << be_nl
- << "ACE_TRY_CHECK;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY" << be_nl
- << "{" << be_idt_nl
- << "// free allocated storage" << be_nl
- << "delete _any_val;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_ENDTRY;" << be_uidt_nl
- << "}\n" << be_nl;
-
- *os << "CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, "
- << node->name () << " &_tao_elem)" << be_nl
- << "{" << be_idt_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "CORBA::TypeCode_var type = _tao_any.type ();" << be_nl
- << "if (!type->equal (" << node->tc_name ()
- << ", ACE_TRY_ENV)) return 0; // not equal" << be_nl
- << "ACE_TRY_CHECK;" << be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());"
- << be_nl
- << "if (stream.decode (" << node->tc_name ()
- << ", &_tao_elem, 0, ACE_TRY_ENV)" << be_nl
- << " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
- << " return 1;" << be_nl
- << "ACE_TRY_CHECK;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY" << be_nl
- << "{" << be_idt_nl
- << "return 0;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_ENDTRY;" << be_nl
- << "return 0;" << be_uidt_nl
- << "}\n\n";
-
- 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 7c35d00c706..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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_enum.h"
-
-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_scope (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 ();
-
-
- // generate the CDR << and >> operators
- os->indent ();
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator<< (TAO_OutputCDR &, const " << node->name ()
- << " &); // " << be_nl;
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator>> (TAO_InputCDR &, "
- << node->name () << " &);\n";
-
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ci.cpp
deleted file mode 100644
index 1530c7fb8ad..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ci.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ci.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Enum for the CDR operators
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_enum.h"
-
-ACE_RCSID(be_visitor_enum, cdr_op_ci, "$Id$")
-
-
-// ***************************************************************************
-// Enum visitor for generating CDR operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_enum_cdr_op_ci::be_visitor_enum_cdr_op_ci
-(be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_enum_cdr_op_ci::~be_visitor_enum_cdr_op_ci (void)
-{
-}
-
-int
-be_visitor_enum_cdr_op_ci::visit_enum (be_enum *node)
-{
- if (node->cli_inline_cdr_op_gen () || node->imported ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
-
- // generate CDR << and >> operators
- os->indent ();
- *os << "ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, "
- << "const " << node->name () << " &_tao_enumval)" << be_nl
- << "{" << be_idt_nl
- << "return strm.write_ulong ((CORBA::ULong) _tao_enumval);" << be_uidt_nl
- << "}\n\n";
-
- *os << "ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, "
- << node->name () << " &_tao_enumval)" << be_nl
- << "{" << be_idt_nl
- << "CORBA::ULong _tao_temp;" << be_nl
- << "if (strm.read_ulong (_tao_temp))" << be_nl
- << "{" << be_idt_nl
- << "ACE_OS::memcpy (&_tao_enumval, &_tao_temp, sizeof (CORBA::ULong));"
- << be_nl
- << "return 1;" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_idt_nl
- << "return 0;" << be_uidt << be_uidt_nl
- << "}\n\n";
-
- node->cli_inline_cdr_op_gen (1);
- 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 3ca5ff12115..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// enum_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Enums in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_enum.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)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->comma (1); // comma to be generated by the scope visitor
-
- if (!node->cli_hdr_gen () && !node->imported ())
- {
- os->indent (); // start from whatever indentation level we were at
- *os << "enum " << node->local_name () << be_nl;
- *os << "{\n";
- os->incr_indent ();
- 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->decr_indent ();
- *os << "};" << be_nl;
- // As per the ORBOS spec, we need the following typedef
- *os << "typedef " << node->local_name () << " &" << node->local_name ()
- << "_out;\n";
-
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- be_visitor *visitor;
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DECL);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (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 (I_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->indent ();
- *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 fde3be596e2..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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_enum.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 ())
- {
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- be_visitor *visitor;
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DEFN);
- ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_enum_cs::"
- "visit_enum - "
- "TypeCode definition failed\n"
- ), -1);
- }
-
- node->cli_stub_gen (I_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 953fae623d1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_exception.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Exception
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_exception.h"
-
-// include all the individual files
-#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_ci.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 d0c16445b30..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/any_op_ch.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the Any operators for Exceptions
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_exception.h"
-
-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 ();
-
- // generate the Any <<= and >>= operator declarations
- os->indent ();
- *os << "void " << idl_global->export_macro ()
- << " operator<<= (CORBA::Any &, const " << node->name ()
- << " &); // copying version" << be_nl;
- *os << "void " << idl_global->export_macro ()
- << " operator<<= (CORBA::Any &, " << node->name ()
- << "*); // noncopying version" << be_nl;
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator>>= (const CORBA::Any &, "
- << node->name () << " *&);\n";
-
-
- // 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)
-{
- be_type *bt; // field's type
-
- // 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_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;
-}
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 48500f83e6e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the Any operators for Exceptions.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_exception.h"
-
-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 ();
-
- // generate the Any <<= and >>= operator declarations
- // Any <<= and >>= operators
- os->indent ();
- *os << "void operator<<= (CORBA::Any &_tao_any, const "
- << node->name () << " &_tao_elem) // copying" << be_nl
- << "{" << be_idt_nl
- << node->name () << " *_tao_any_val = new " << node->name ()
- << " (_tao_elem);" << be_nl
- << "if (!_tao_any_val) return;" << be_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "_tao_any.replace (" << node->tc_name () << ", _tao_any_val, "
- << "1, ACE_TRY_ENV);" << be_nl
- << "ACE_TRY_CHECK;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY " << be_nl
- << "{" << be_idt_nl
- << "delete _tao_any_val;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_ENDTRY;" << be_uidt_nl
- << "}\n" << be_nl;
-
- *os << "void operator<<= (CORBA::Any &_tao_any, "
- << node->name () << " *_tao_elem) // non copying" << be_nl
- << "{" << be_idt_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "_tao_any.replace (" << node->tc_name () << ", "
- << "_tao_elem, 1, ACE_TRY_ENV); // consume it" << be_nl
- << "ACE_TRY_CHECK;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY {}" << be_nl
- << "ACE_ENDTRY;" << be_uidt_nl
- << "}\n" << be_nl;
-
- *os << "CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, "
- << node->name () << " *&_tao_elem)" << be_nl
- << "{" << be_idt_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "CORBA::TypeCode_var type = _tao_any.type ();" << be_nl
- << "if (!type->equal (" << node->tc_name ()
- << ", ACE_TRY_ENV)) return 0; // not equal" << be_nl
- << "ACE_TRY_CHECK;" << be_nl
- << "if (_tao_any.any_owns_data ())" << be_nl
- << "{" << be_idt_nl
- << "_tao_elem = (" << node->name () << " *)_tao_any.value ();"
- << be_nl
- << "return 1;" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_nl // else any does not own the data
- << "{" << be_idt_nl
- << "ACE_NEW_RETURN (_tao_elem, " << node->name () << ", 0);"
- << be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());"
- << be_nl
- << "if (stream.decode (" << node->tc_name ()
- << ", _tao_elem, 0, ACE_TRY_ENV)" << be_nl
- << " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
- << "{" << be_idt_nl
- << "((CORBA::Any *)&_tao_any)->replace ("
- << node->tc_name () << ", _tao_elem, 1, ACE_TRY_ENV);" << be_nl
- << "ACE_TRY_CHECK;" << be_nl
- << "return 1;" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_nl // decode failed
- << "{" << be_idt_nl
- << "delete _tao_elem;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY" << be_nl
- << "{" << be_idt_nl
- << "delete _tao_elem;" << be_nl
- << "return 0;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_ENDTRY;" << be_nl
- << "return 0;" << be_uidt_nl
- << "}\n\n";
-
-
- // 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)
-{
- be_type *bt; // field's type
-
- // 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_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;
-}
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 1910de4e68e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp
+++ /dev/null
@@ -1,77 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_exception.h"
-
-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 ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // generate the Cdr <<= and >>= operator declarations
- os->indent ();
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator<< (TAO_OutputCDR &, const " << node->name ()
- << " &); // " << be_nl;
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator>> (TAO_InputCDR &, "
- << node->name () << " &);\n";
-
-
- // set the substate as generating code for the types defined in our scope
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
- // 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_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_ci.cpp b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ci.cpp
deleted file mode 100644
index ce24bddbedb..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ci.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for exceptions
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_exception.h"
-#include "be_visitor_field.h"
-
-ACE_RCSID(be_visitor_exception, cdr_op_ci, "$Id$")
-
-// ***************************************************************************
-// Exception visitor for generating CDR operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_exception_cdr_op_ci::be_visitor_exception_cdr_op_ci
-(be_visitor_context *ctx)
- : be_visitor_exception (ctx)
-{
-}
-
-be_visitor_exception_cdr_op_ci::~be_visitor_exception_cdr_op_ci (void)
-{
-}
-
-int
-be_visitor_exception_cdr_op_ci::visit_exception (be_exception *node)
-{
- // already generated and/or we are imported. Don't do anything.
- if (node->cli_inline_cdr_op_gen () || node->imported ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // First generate code for our children. The reason we do this first is
- // because the inlined code for our children must be available before we use
- // it in our parent
-
- // set the substate as generating code for the types defined in our scope
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
- // 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_cdr_op_ci"
- "::visit_exception - "
- "codegen for scope failed\n"), -1);
- }
-
- // set the sub state as generating code for the output operator
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT);
- *os << "ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, "
- << "const " << node->name () << " &_tao_aggregate)" << be_nl
- << "{" << be_idt_nl;
- // do we have any members?
- if (node->nmembers () > 0)
- {
- be_visitor_context* new_ctx =
- new be_visitor_context (*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._id ())" << be_nl
- << "{" << be_idt_nl
- << "// now marshal the members (if any)" << be_nl
- << "if (" << be_idt_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_cdr_op_ci::"
- "visit_exception - "
- "codegen for scope failed\n"), -1);
- }
- *os << be_uidt_nl << ")"
- << be_idt_nl
- << "return 1;" << be_uidt_nl
- << "else" << be_idt_nl
- << "return 0;" << be_uidt << be_uidt_nl
- << "}" << be_nl
- << "else" << be_idt_nl
- << "return 0;" << be_uidt << be_uidt_nl;
- }
- else
- {
- // no members
- *os << "// first marshal the repository ID" << be_nl
- << "if (strm << _tao_aggregate._id ())" << be_idt_nl
- << "return 1;" << be_uidt_nl
- << "else" << be_idt_nl
- << "return 0;" << be_uidt << be_uidt_nl;
- }
- *os << "}\n\n";
-
- // set the substate as generating code for the input operator
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT);
- *os << "ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, "
- << node->name () << " &_tao_aggregate)" << be_nl
- << "{" << be_idt_nl;
- // retrieve the repository ID and compare with what we have
- *os << "// retrieve RepoID and verify if we are of that type" << be_nl;
- *os << "char *_tao_repoID;" << be_nl;
- *os << "if ((strm >> _tao_repoID) &&" << be_nl
- << " (_tao_aggregate._is_a (_tao_repoID)))" << be_nl
- << "{" << be_idt_nl;
- // do we have any members?
- if (node->nmembers () > 0)
- {
- be_visitor_context* new_ctx =
- new be_visitor_context (*this->ctx_);
- be_visitor_cdr_op_field_decl field_decl (new_ctx);
- field_decl.visit_scope (node);
-
- // some members
- *os << "// now marshal the members" << be_nl
- << "if (" << be_idt_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_cdr_op_ci::"
- "visit_exception - "
- "codegen for scope failed\n"), -1);
- }
- *os << be_uidt_nl << ")"
- << be_idt_nl
- << "return 1;" << be_uidt_nl
- << "else" << be_idt_nl
- << "return 0;" << be_uidt << be_uidt_nl;
- }
- else
- {
- *os << "return 1;" << be_uidt_nl;
- }
- *os << "}" << be_nl
- << "else" << be_idt_nl
- << "return 0;" << be_uidt << be_uidt_nl
- << "}\n\n";
-
- node->cli_inline_cdr_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_exception_cdr_op_ci::post_process (be_decl *bd)
-{
- 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/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp
deleted file mode 100644
index 22ddc620bcf..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for exceptions
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_exception.h"
-#include "be_visitor_field.h"
-
-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 ())
- return 0;
-
- // set the substate as generating code for the types defined in our
- // scope
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
- // 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_cdr_op_cs::"
- "visit_exception - "
- "codegen for scope failed\n"), -1);
- }
-
-
- node->cli_stub_cdr_op_gen (1);
- 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 5c3bff6388f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp
+++ /dev/null
@@ -1,323 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_exception.h"
-
-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)
-{
- this->ctx_->node (node); // save the argument 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)
-{
- 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_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 (); // get output stream
- be_decl *bd = this->ctx_->node ();
-
- os->indent ();
-
- if (ACE_OS::strcmp (bd->flatname (), node->flatname ()))
- {
- // 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 () << ");\n";
- }
- else
- {
- // Copy constructor and assignment operator.
- *os << "_copy (this->" << bd->local_name ()
- << ", _tao_excp." << bd->local_name () << ");\n";
- }
-
- return 0;
-}
-
-int be_visitor_exception_ctor_assign::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_decl *bd = this->ctx_->node ();
-
- os->indent ();
- if (this->ctx_->exception ()) // special ctor
- {
- *os << "this->" << bd->local_name () << " = _tao_" << bd->local_name ()
- << ";\n";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = _tao_excp." << bd->local_name ()
- << ";\n";
- }
- return 0;
-}
-
-int be_visitor_exception_ctor_assign::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_decl *bd = this->ctx_->node ();
-
- os->indent ();
- if (this->ctx_->exception ()) // special ctor
- {
- *os << "this->" << bd->local_name () << " = " << node->name ()
- << "::_duplicate (_tao_" << bd->local_name () << ");\n";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = " << node->name ()
- << "::_duplicate (_tao_excp." << bd->local_name () << ".in ());\n";
- }
- return 0;
-}
-
-int be_visitor_exception_ctor_assign::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_decl *bd = this->ctx_->node ();
-
- os->indent ();
- if (this->ctx_->exception ()) // special ctor
- {
- *os << "this->" << bd->local_name () << " = " << node->name ()
- << "::_duplicate (_tao_" << bd->local_name () << ");\n";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = " << node->name ()
- << "::_duplicate (_tao_excp." << bd->local_name () << ".in ());\n";
- }
- return 0;
-}
-
-int be_visitor_exception_ctor_assign::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_decl *bd = this->ctx_->node ();
-
- os->indent ();
- // check if the type is an any
- if (node->pt () == AST_PredefinedType::PT_any)
- {
- if (this->ctx_->exception ()) // special ctor
- {
- *os << "this->" << bd->local_name () << " = _tao_"
- << bd->local_name () << ";\n";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = _tao_excp."
- << bd->local_name () << ";\n";
- }
- } // end of if
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
- {
- if (this->ctx_->exception ()) // special ctor
- {
- *os << "this->" << bd->local_name () << " = "
- << node->name () << "::_duplicate (_tao_"
- << bd->local_name () << ");\n";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = "
- << node->name () << "::_duplicate (_tao_excp."
- << bd->local_name () << ".in ());\n";
- }
- } // end else if
- else // simple predefined types
- {
- if (this->ctx_->exception ()) // special ctor
- {
- *os << "this->" << bd->local_name () << " = _tao_"
- << bd->local_name () << ";\n";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = _tao_excp."
- << bd->local_name () << ";\n";
- }
- } // end of else
-
- return 0;
-}
-
-int be_visitor_exception_ctor_assign::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_decl *bd = this->ctx_->node ();
-
- os->indent ();
- if (this->ctx_->exception ()) // special ctor
- {
- *os << "this->" << bd->local_name () << " = _tao_" << bd->local_name ()
- << ";\n";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = _tao_excp." << bd->local_name ()
- << ";\n";
- }
- return 0;
-}
-
-int be_visitor_exception_ctor_assign::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_decl *bd = this->ctx_->node ();
-
- os->indent ();
- if (this->ctx_->exception ()) // special ctor
- {
- *os << "this->" << bd->local_name () << " = CORBA::string_dup (_tao_"
- << bd->local_name () << ");\n";
- }
- else
- {
- *os << "this->" << bd->local_name ()
- << " = CORBA::string_dup (_tao_excp." << bd->local_name ()
- << ".in ());\n";
- }
- return 0;
-}
-
-int be_visitor_exception_ctor_assign::visit_structure (be_structure *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_decl *bd = this->ctx_->node ();
-
- os->indent ();
- if (this->ctx_->exception ()) // special ctor
- {
- *os << "this->" << bd->local_name () << " = _tao_" << bd->local_name ()
- << ";\n";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = _tao_excp." << bd->local_name ()
- << ";\n";
- }
- return 0;
-}
-
-int be_visitor_exception_ctor_assign::visit_union (be_union *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_decl *bd = this->ctx_->node ();
-
- os->indent ();
- if (this->ctx_->exception ()) // special ctor
- {
- *os << "this->" << bd->local_name () << " = _tao_" << bd->local_name ()
- << ";\n";
- }
- else
- {
- *os << "this->" << bd->local_name () << " = _tao_excp." << bd->local_name ()
- << ";\n";
- }
- 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;
-}
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 71f9590bb4b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// .cpp
-//
-// = DESCRIPTION
-// Generic visitor generating code for Exceptions.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_exception.h"
-
-ACE_RCSID(be_visitor_exception, exception, "$Id$")
-
-
-// generic struct 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 *)
-{
- return -1; // must be overriden
-}
-
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_EXCEPTION_CH:
- ctx.state (TAO_CodeGen::TAO_FIELD_CH);
- break;
- case TAO_CodeGen::TAO_EXCEPTION_CI:
- ctx.state (TAO_CodeGen::TAO_FIELD_CI);
- break;
- case TAO_CodeGen::TAO_EXCEPTION_CS:
- ctx.state (TAO_CodeGen::TAO_FIELD_CS);
- break;
- case TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_FIELD_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_FIELD_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_FIELD_CDR_OP_CS);
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception::"
- "visit_field - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception::"
- "visit_field - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception::"
- "visit_field - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- 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 b724b9d6e7b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// exception_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Exception in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_exception.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)
-{
- TAO_OutStream *os; // output stream
-
- if (!node->cli_hdr_gen () && !node->imported ()) // not already generated and
- // not imported
- {
- os = this->ctx_->stream ();
-
- os->gen_ifdef_macro (node->flatname (), "_ptr");
-
- os->indent ();
- *os << "class " << node->local_name () << ";" << be_nl;
- // generate the _ptr declaration
- *os << "typedef " << node->local_name () << " *"
- << node->local_name () << "_ptr;" << be_nl;
- os->gen_endif ();
-
- os->gen_ifdef_macro (node->flatname ());
-
- os->indent ();
- *os << "class " << idl_global->export_macro ()
- << " " << node->local_name ()
- << " : public CORBA::UserException" << be_nl;
- *os << "{" << be_nl
- << "public:\n";
- os->incr_indent ();
-
- // 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); // default ctor" << be_nl;
- *os << node->local_name () << " (const " << node->local_name ()
- << " &); // copy ctor" << be_nl;
- *os << "~" << node->local_name () << " (void); // dtor" << be_nl;
-
- os->indent ();
- // assignment operator
- *os << node->local_name () << " &operator= (const "
- << node->local_name () << " &);\n\n";
-
- *os << be_nl
- << "virtual void _raise (void);\n" << be_nl
- << "static " << node->local_name ()
- << " *_narrow (CORBA::Exception *);\n\n";
-
- // 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 *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception::"
- "visit_exception - "
- "codegen for ctor failed\n"), -1);
- }
- delete visitor;
- }
-
-
- *os << be_nl
- << "// = TAO extension" << be_nl
- << "static CORBA::Exception *_alloc (void);\n" << be_uidt_nl
- << "}; // exception " << node->name ()
- << "\n" << be_nl;
-
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- be_visitor *visitor;
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DECL);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (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 7f7a34758b1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ci.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// exception_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Exception in the inline file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_exception.h"
-
-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)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- if (!node->cli_inline_gen () && !node->imported ())
- {
- os = this->ctx_->stream ();
- os->indent ();
- *os << "// *************************************************************"
- << be_nl;
- *os << "// Inline operations for exception " << node->name () << be_nl;
- *os << "// *************************************************************\n\n";
-
- // 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 (I_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 5745089998e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp
+++ /dev/null
@@ -1,222 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// exception_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Exception in the stubs file
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_exception.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)
-{
- TAO_OutStream *os; // output stream
-
- if (!node->cli_stub_gen () && !node->imported ())
- {
- 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);
- }
-
- // default constructor
- *os << "// default constructor" << be_nl;
- *os << node->name () << "::" << node->local_name () << " (void)" << be_nl;
- *os << " : CORBA_UserException ("
- << node->tc_name () << ")\n";
- *os << "{" << be_nl;
- *os << "}\n\n";
-
- // destructor
- os->indent ();
- *os << "// destructor - all members are of self managing types" << be_nl;
- *os << node->name () << "::~" << node->local_name () << " (void)" << be_nl;
- *os << "{" << be_nl;
- *os << "}\n\n";
-
- // copy constructor
- os->indent ();
- *os << "// copy constructor" << be_nl;
- *os << node->name () << "::" << node->local_name () << " (const "
- << node->name () << " &_tao_excp)" << be_nl;
- *os << " : CORBA_UserException ("
- << "_tao_excp._type ())" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- // assign each individual member
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CTOR_ASSIGN_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_cs::"
- "visit_exception -"
- "codegen for scope failed\n"), -1);
- }
- delete visitor;
- os->decr_indent ();
- *os << "}\n\n";
-
- // assignment operator
- os->indent ();
- *os << "// assignment operator" << be_nl;
- *os << node->name () << "&" << be_nl;
- *os << node->name () << "::operator= (const "
- << node->name () << " &_tao_excp)" << be_nl
- << "{\n" << be_idt_nl
- << "this->CORBA_UserException::operator= "
- << "(_tao_excp);\n";
- // assign each individual member
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CTOR_ASSIGN_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_cs::"
- "visit_exception -"
- "codegen for scope failed\n"), -1);
- }
- delete visitor;
- os->indent ();
- *os << "return *this;" << be_uidt_nl
- << "}\n\n";
-
- // narrow method
- os->indent ();
- *os << "// narrow" << be_nl;
- *os << node->name () << "_ptr " << be_nl;
- *os << node->name () << "::_narrow (CORBA::Exception *exc)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "if (!ACE_OS::strcmp (\"" << node->repoID ()
- << "\", exc->_id ())) // same type" << be_nl;
- *os << " return ACE_dynamic_cast (" << node->name () << "_ptr, exc);"
- << be_nl;
- *os << "else" << be_nl;
- *os << " return 0;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- *os << be_nl
- << "void " << node->name () << "::_raise ()" << be_nl
- << "{" << be_idt_nl
- << "TAO_RAISE(*this);" << be_uidt_nl
- << "}\n\n";
-
- // generate the _alloc method
- os->indent ();
- *os << "// TAO extension - the _alloc method" << be_nl;
- *os << "CORBA::Exception *" << node->name ()
- << "::_alloc (void)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return new " << node->name () << ";" << be_uidt_nl;
- *os << "}\n\n";
-
- // 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);
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception::"
- "visit_exception - "
- "codegen for ctor failed\n"), -1);
- }
- delete visitor;
-
- *os << " : CORBA_UserException "
- << " (CORBA::TypeCode::_duplicate (" << node->tc_name ()
- << "))" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- // assign each individual member. We need yet another state
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CTOR_ASSIGN_CS);
- ctx.exception (1); // indicate that the special ctor is being
- // generated
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_cs::"
- "visit_exception -"
- "codegen for scope failed\n"), -1);
- }
- delete visitor;
- os->decr_indent ();
- *os << "}\n\n";
- }
-
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DEFN);
- ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_cs::"
- "visit_exception - "
- "TypeCode definition failed\n"
- ), -1);
- }
-
- node->cli_stub_gen (I_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 6b3e59fdae6..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp
+++ /dev/null
@@ -1,313 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// exception_ctor.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the special constructor for Exceptions
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_exception.h"
-
-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)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- if (!this->last_node (bd))
- *os << ",\n";
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_exception (be_exception *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- this->ctx_->node (node); // save the argument node
-
- os->indent ();
- if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- *os << node->local_name ();
- else
- *os << node->name () << "::" << node->local_name ();
- *os << "(" << be_idt << "\n";
-
- 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 << ");\n\n";
- else
- *os << be_uidt << ")\n\n";
-
- 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);
- }
-
- os->indent ();
- 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 (); // get output stream
-
- // set the right type;
- 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 ()->fullname () << "::";
-
- 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 (); // get output stream
-
- // set the right type;
- 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 (); // get output stream
-
- // set the right type;
- 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 << "_ptr ";
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- // set the right type;
- 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 << "_ptr ";
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- // set the right type;
- be_type *bt;
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- // check if the type is an any
- if (node->pt () == AST_PredefinedType::PT_any)
- {
- 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;
- } // end of if
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
- {
- 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 << "_ptr ";
- } // end else if
- else // simple predefined types
- {
- if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH)
- *os << bt->nested_type_name (this->ctx_->scope ());
- else
- *os << bt->name ();
- } // end of else
-
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- // set the right type;
- 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 *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- *os << "const char *";
- return 0;
-}
-
-int be_visitor_exception_ctor::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- // set the right type;
- 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 (); // get output stream
-
- // set the right type;
- 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;
-}
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 bbb90a662dd..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_factory.cpp
+++ /dev/null
@@ -1,911 +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 all the commonly used
-// visitors that are not affected by decisions such as whether we use
-// compiled marshaling or interpretive marshaling.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-// individual visitors included only here
-#include "be_visitor_factory.h"
-
-#include "be_visitor_argument.h"
-#include "be_visitor_array.h"
-#include "be_visitor_attribute.h"
-#include "be_visitor_constant.h"
-#include "be_visitor_enum.h"
-#include "be_visitor_exception.h"
-#include "be_visitor_field.h"
-#include "be_visitor_interface.h"
-#include "be_visitor_interface_fwd.h"
-#include "be_visitor_valuetype.h"
-#include "be_visitor_valuetype_fwd.h"
-#include "be_visitor_module.h"
-#include "be_visitor_operation.h"
-#include "be_visitor_root.h"
-#include "be_visitor_sequence.h"
-#include "be_visitor_structure.h"
-#include "be_visitor_typecode.h"
-#include "be_visitor_typedef.h"
-#include "be_visitor_union.h"
-#include "be_visitor_union_branch.h"
-
-ACE_RCSID(be, be_visitor_factory, "$Id$")
-
-
-// The BASE abstract visitor factory
-TAO_Visitor_Factory::TAO_Visitor_Factory (void)
-{
-}
-
-// destructor
-TAO_Visitor_Factory::~TAO_Visitor_Factory (void)
-{
-}
-
-// The concrete visitor factory for visitors irrespective of the the marshaling
-// approaches used.
-//
-// This common visitor factory also deals with a 2nd level of code-generation
-// choices that the user has requested. This involves enabling/disabling
-// support for specific type of kind, e.g., generation of TypeCodes or Any
-// operators or Real C++ exception suport.
-TAO_Common_Visitor_Factory::TAO_Common_Visitor_Factory (void)
-{
-}
-
-// destructor
-TAO_Common_Visitor_Factory::~TAO_Common_Visitor_Factory (void)
-{
-}
-
-be_visitor *
-TAO_Common_Visitor_Factory::make_visitor (be_visitor_context *ctx)
-{
- TAO_CodeGen::CG_STATE st = ctx->state ();
- // create a new context so that ownership issues are not confused. This newly
- // created context is a copy of what was sent by the caller. The newly
- // created visitor will own this new copy.
- be_visitor_context *new_ctx = new be_visitor_context (*ctx);
- switch (st)
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- return new be_visitor_root_ch (new_ctx);
- case TAO_CodeGen::TAO_ROOT_CI:
- return new be_visitor_root_ci (new_ctx);
- case TAO_CodeGen::TAO_ROOT_CS:
- return new be_visitor_root_cs (new_ctx);
- case TAO_CodeGen::TAO_ROOT_SH:
- return new be_visitor_root_sh (new_ctx);
- case TAO_CodeGen::TAO_ROOT_SI:
- return new be_visitor_root_si (new_ctx);
- case TAO_CodeGen::TAO_ROOT_SS:
- return new be_visitor_root_ss (new_ctx);
- case TAO_CodeGen::TAO_ROOT_IH:
- return new be_visitor_root_ih (new_ctx);
- case TAO_CodeGen::TAO_ROOT_IS:
- return new be_visitor_root_is (new_ctx);
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- // this is the starting point for generation of all Any operators. If we
- // have the any support enabled, then go ahead
- if (idl_global->any_support ())
- return new be_visitor_root_any_op (new_ctx);
- else
- // return a NO_OP visitor
- return new be_visitor_decl (new_ctx);
-
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CI:
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- // this is the starting point for generation of all CDR operators. If we
- // do not use compiled marshaling, we do not need these operators
- if (idl_global->compiled_marshaling ())
- return new be_visitor_root_cdr_op (new_ctx);
- else
- // return a NO_OP visitor
- return new be_visitor_decl (new_ctx);
-
- case TAO_CodeGen::TAO_MODULE_CH:
- return new be_visitor_module_ch (new_ctx);
- case TAO_CodeGen::TAO_MODULE_SH:
- return new be_visitor_module_sh (new_ctx);
- case TAO_CodeGen::TAO_MODULE_IH:
- return new be_visitor_module_ih (new_ctx);
- case TAO_CodeGen::TAO_MODULE_CI:
- case TAO_CodeGen::TAO_MODULE_CS:
- case TAO_CodeGen::TAO_MODULE_SI:
- case TAO_CodeGen::TAO_MODULE_SS:
- case TAO_CodeGen::TAO_MODULE_IS:
- return new be_visitor_module (new_ctx);
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CH:
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CS:
- return new be_visitor_module_any_op (new_ctx);
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CH:
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CI:
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CS:
- return new be_visitor_module_cdr_op (new_ctx);
-
- case TAO_CodeGen::TAO_INTERFACE_CH:
- return new be_visitor_interface_ch (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_CI:
- return new be_visitor_interface_ci (new_ctx);
-
- case TAO_CodeGen::TAO_INTERFACE_CS:
- return new be_visitor_interface_cs (new_ctx);
-
- case TAO_CodeGen::TAO_INTERFACE_SH:
- return new be_visitor_interface_sh (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_IH:
- return new be_visitor_interface_ih (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_SI:
- return new be_visitor_interface_si (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_SS:
- return new be_visitor_interface_ss (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_IS:
- return new be_visitor_interface_is (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH:
- return new be_visitor_interface_thru_poa_collocated_sh (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS:
- return new be_visitor_interface_thru_poa_collocated_ss (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH:
- return new be_visitor_interface_direct_collocated_sh (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS:
- return new be_visitor_interface_direct_collocated_ss (new_ctx);
-
- case TAO_CodeGen::TAO_COLLOCATED_AMI_HANDLER_CH:
- return new be_visitor_interface_collocated_ami_handler_ch (new_ctx);
-
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH:
- return new be_visitor_interface_any_op_ch (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS:
- return new be_visitor_interface_any_op_cs (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
- return new be_visitor_interface_tie_sh (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
- return new be_visitor_interface_tie_si (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH:
- return new be_visitor_interface_cdr_op_ch (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI:
- return new be_visitor_interface_cdr_op_ci (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS:
- return new be_visitor_interface_cdr_op_cs (new_ctx);
-
- case TAO_CodeGen::TAO_INTERFACE_FWD_CH:
- return new be_visitor_interface_fwd_ch (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_FWD_CI:
- return new be_visitor_interface_fwd_ci (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CI:
- return new be_visitor_interface_fwd_cdr_op_ci (new_ctx);
- case TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CS:
- return new be_visitor_decl (new_ctx); // noop
-
-# ifdef IDL_HAS_VALUETYPE
-
- case TAO_CodeGen::TAO_VALUETYPE_CH:
- return new be_visitor_valuetype_ch (new_ctx);
- case TAO_CodeGen::TAO_VALUETYPE_CS:
- return new be_visitor_valuetype_cs (new_ctx);
- case TAO_CodeGen::TAO_VALUETYPE_CI:
- return new be_visitor_valuetype_ci (new_ctx);
-
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CH:
- return new be_visitor_valuetype_obv_ch (new_ctx);
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CI:
- return new be_visitor_decl (new_ctx); // currently NO-OP
- //return new be_visitor_valuetype_obv_ci (new_ctx);
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CS:
- return new be_visitor_valuetype_obv_cs (new_ctx);
-
- case TAO_CodeGen::TAO_FIELD_OBV_CH:
- return new be_visitor_valuetype_field_ch (new_ctx);
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_CH:
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_OBV_CH:
- //case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IH:
- //case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IS:
- //case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_OTHERS:
- return new be_visitor_obv_operation_arglist (new_ctx);
-
- case TAO_CodeGen::TAO_MODULE_OBV_CH:
- case TAO_CodeGen::TAO_MODULE_OBV_CI:
- case TAO_CodeGen::TAO_MODULE_OBV_CS:
- return new be_visitor_obv_module (new_ctx);
-
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CH:
- return new be_visitor_valuetype_cdr_op_ch (new_ctx);
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CI:
- return new be_visitor_valuetype_cdr_op_ci (new_ctx);
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CS:
- return new be_visitor_decl (new_ctx); // noop
-
- case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CH:
- case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CS:
- return new be_visitor_decl (new_ctx); // @@ TODO
-
-# endif /* IDL_HAS_VALUETYPE */
-
- case TAO_CodeGen::TAO_STRUCT_CH:
- return new be_visitor_structure_ch (new_ctx);
- case TAO_CodeGen::TAO_STRUCT_CS:
- return new be_visitor_structure_cs (new_ctx);
- case TAO_CodeGen::TAO_STRUCT_CI:
- return new be_visitor_structure_ci (new_ctx);
- case TAO_CodeGen::TAO_STRUCT_ANY_OP_CH:
- return new be_visitor_structure_any_op_ch (new_ctx);
- case TAO_CodeGen::TAO_STRUCT_ANY_OP_CS:
- return new be_visitor_structure_any_op_cs (new_ctx);
- case TAO_CodeGen::TAO_STRUCT_CDR_OP_CH:
- return new be_visitor_structure_cdr_op_ch (new_ctx);
- case TAO_CodeGen::TAO_STRUCT_CDR_OP_CI:
- return new be_visitor_structure_cdr_op_ci (new_ctx);
- case TAO_CodeGen::TAO_STRUCT_CDR_OP_CS:
- return new be_visitor_structure_cdr_op_cs (new_ctx);
-
- case TAO_CodeGen::TAO_CONSTANT_CH:
- return new be_visitor_constant_ch (new_ctx);
- case TAO_CodeGen::TAO_CONSTANT_CS:
- return new be_visitor_constant_cs (new_ctx);
-
- case TAO_CodeGen::TAO_ENUM_CH:
- return new be_visitor_enum_ch (new_ctx);
- case TAO_CodeGen::TAO_ENUM_CS:
- return new be_visitor_enum_cs (new_ctx);
- case TAO_CodeGen::TAO_ENUM_ANY_OP_CH:
- return new be_visitor_enum_any_op_ch (new_ctx);
- case TAO_CodeGen::TAO_ENUM_ANY_OP_CS:
- return new be_visitor_enum_any_op_cs (new_ctx);
- case TAO_CodeGen::TAO_ENUM_CDR_OP_CH:
- return new be_visitor_enum_cdr_op_ch (new_ctx);
- case TAO_CodeGen::TAO_ENUM_CDR_OP_CI:
- return new be_visitor_enum_cdr_op_ci (new_ctx);
- case TAO_CodeGen::TAO_ENUM_CDR_OP_CS:
- return new be_visitor_decl (new_ctx);
-
- case TAO_CodeGen::TAO_FIELD_CH:
- return new be_visitor_field_ch (new_ctx);
- case TAO_CodeGen::TAO_FIELD_CS:
- return new be_visitor_field_cs (new_ctx);
- case TAO_CodeGen::TAO_FIELD_CI:
- return new be_visitor_field_ci (new_ctx);
- case TAO_CodeGen::TAO_FIELD_CDR_OP_CH:
- return new be_visitor_field_cdr_op_ch (new_ctx);
- case TAO_CodeGen::TAO_FIELD_CDR_OP_CI:
- return new be_visitor_field_cdr_op_ci (new_ctx);
- case TAO_CodeGen::TAO_FIELD_CDR_OP_CS:
- return new be_visitor_field_cdr_op_cs (new_ctx);
-
- case TAO_CodeGen::TAO_UNION_CH:
- return new be_visitor_union_ch (new_ctx);
- case TAO_CodeGen::TAO_UNION_CI:
- return new be_visitor_union_ci (new_ctx);
- case TAO_CodeGen::TAO_UNION_CS:
- return new be_visitor_union_cs (new_ctx);
- case TAO_CodeGen::TAO_UNION_PUBLIC_CH:
- return new be_visitor_union_branch_public_ch (new_ctx);
- case TAO_CodeGen::TAO_UNION_PUBLIC_CI:
- return new be_visitor_union_branch_public_ci (new_ctx);
- case TAO_CodeGen::TAO_UNION_PUBLIC_CS:
- return new be_visitor_union_branch_public_cs (new_ctx);
- case TAO_CodeGen::TAO_UNION_PUBLIC_ASSIGN_CS:
- return new be_visitor_union_branch_public_assign_cs (new_ctx);
- case TAO_CodeGen::TAO_UNION_PUBLIC_RESET_CS:
- return new be_visitor_union_branch_public_reset_cs (new_ctx);
- case TAO_CodeGen::TAO_UNION_PUBLIC_ACCESS_CS:
- return new be_visitor_union_branch_public_access_cs (new_ctx);
- case TAO_CodeGen::TAO_UNION_PRIVATE_CH:
- return new be_visitor_union_branch_private_ch (new_ctx);
- case TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CH:
- return new be_visitor_union_discriminant_ch (new_ctx);
- case TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CI:
- return new be_visitor_union_discriminant_ci (new_ctx);
- case TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CS:
- return new be_visitor_union_discriminant_cs (new_ctx);
- case TAO_CodeGen::TAO_UNION_ANY_OP_CH:
- return new be_visitor_union_any_op_ch (new_ctx);
- case TAO_CodeGen::TAO_UNION_ANY_OP_CS:
- break;
- case TAO_CodeGen::TAO_UNION_CDR_OP_CH:
- return new be_visitor_union_cdr_op_ch (new_ctx);
- case TAO_CodeGen::TAO_UNION_CDR_OP_CI:
- return new be_visitor_union_cdr_op_ci (new_ctx);
- case TAO_CodeGen::TAO_UNION_CDR_OP_CS:
- return new be_visitor_union_cdr_op_cs (new_ctx);
- case TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CH:
- return new be_visitor_union_branch_cdr_op_ch (new_ctx);
- case TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CI:
- return new be_visitor_union_branch_cdr_op_ci (new_ctx);
- case TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CS:
- return new be_visitor_union_branch_cdr_op_cs (new_ctx);
-
- case TAO_CodeGen::TAO_SEQUENCE_CH:
- return new be_visitor_sequence_ch (new_ctx);
- case TAO_CodeGen::TAO_SEQUENCE_CI:
- return new be_visitor_sequence_ci (new_ctx);
- case TAO_CodeGen::TAO_SEQUENCE_CS:
- return new be_visitor_sequence_cs (new_ctx);
- case TAO_CodeGen::TAO_SEQUENCE_BASE_CH:
- case TAO_CodeGen::TAO_SEQUENCE_BASE_CI:
- case TAO_CodeGen::TAO_SEQUENCE_BASE_CS:
- return new be_visitor_sequence_base (new_ctx);
- case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH:
- case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CI:
- return new be_visitor_sequence_elemtype (new_ctx);
- case TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH:
- case TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CI:
- case TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CS:
- return new be_visitor_sequence_buffer_type (new_ctx);
- case TAO_CodeGen::TAO_SEQUENCE_ANY_OP_CH:
- return new be_visitor_sequence_any_op_ch (new_ctx);
- case TAO_CodeGen::TAO_SEQUENCE_ANY_OP_CS:
- return new be_visitor_sequence_any_op_cs (new_ctx);
- case TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CH:
- return new be_visitor_sequence_cdr_op_ch (new_ctx);
- case TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CI:
- return new be_visitor_sequence_cdr_op_ci (new_ctx);
- case TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CS:
- return new be_visitor_sequence_cdr_op_cs (new_ctx);
-
- case TAO_CodeGen::TAO_TYPEDEF_CH:
- return new be_visitor_typedef_ch (new_ctx);
- case TAO_CodeGen::TAO_TYPEDEF_CS:
- return new be_visitor_typedef_cs (new_ctx);
- case TAO_CodeGen::TAO_TYPEDEF_CI:
- return new be_visitor_typedef_ci (new_ctx);
- case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH:
- return new be_visitor_typedef_any_op_ch (new_ctx);
- case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS:
- return new be_visitor_typedef_any_op_cs (new_ctx);
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH:
- return new be_visitor_typedef_cdr_op_ch (new_ctx);
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI:
- return new be_visitor_typedef_cdr_op_ci (new_ctx);
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS:
- return new be_visitor_typedef_cdr_op_cs (new_ctx);
-
- case TAO_CodeGen::TAO_TYPECODE_DECL:
- case TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DECL:
- // Do we need TypeCode Support?
- if (idl_global->tc_support ())
- return new be_visitor_typecode_decl (new_ctx);
- else
- // return a NO_OP visitor
- return new be_visitor_decl (new_ctx);
-
- case TAO_CodeGen::TAO_TYPECODE_DEFN:
- case TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN:
- // Do we need TypeCode Support?
- if (idl_global->tc_support ())
- return new be_visitor_typecode_defn (new_ctx);
- else
- // return a NO_OP visitor
- return new be_visitor_decl (new_ctx);
-
- case TAO_CodeGen::TAO_ATTRIBUTE_CH:
- case TAO_CodeGen::TAO_ATTRIBUTE_CS:
- case TAO_CodeGen::TAO_ATTRIBUTE_SH:
- case TAO_CodeGen::TAO_ATTRIBUTE_IH:
- case TAO_CodeGen::TAO_ATTRIBUTE_SS:
- case TAO_CodeGen::TAO_ATTRIBUTE_IS:
- case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SH:
- case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI:
- case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SH:
- case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SS:
- case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SH:
- case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SS:
- return new be_visitor_attribute (new_ctx);
-
- case TAO_CodeGen::TAO_EXCEPTION_CH:
- return new be_visitor_exception_ch (new_ctx);
- case TAO_CodeGen::TAO_EXCEPTION_CI:
- return new be_visitor_exception_ci (new_ctx);
- case TAO_CodeGen::TAO_EXCEPTION_CS:
- return new be_visitor_exception_cs (new_ctx);
- case TAO_CodeGen::TAO_EXCEPTION_CTOR_CH:
- case TAO_CodeGen::TAO_EXCEPTION_CTOR_CS:
- return new be_visitor_exception_ctor (new_ctx);
- case TAO_CodeGen::TAO_EXCEPTION_CTOR_ASSIGN_CS:
- return new be_visitor_exception_ctor_assign (new_ctx);
- case TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CH:
- return new be_visitor_exception_any_op_ch (new_ctx);
- case TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CS:
- return new be_visitor_exception_any_op_cs (new_ctx);
- case TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CH:
- return new be_visitor_exception_cdr_op_ch (new_ctx);
- case TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CI:
- return new be_visitor_exception_cdr_op_ci (new_ctx);
- case TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CS:
- return new be_visitor_exception_cdr_op_cs (new_ctx);
-
- case TAO_CodeGen::TAO_ARRAY_CH:
- return new be_visitor_array_ch (new_ctx);
- case TAO_CodeGen::TAO_ARRAY_CI:
- return new be_visitor_array_ci (new_ctx);
- case TAO_CodeGen::TAO_ARRAY_CS:
- return new be_visitor_array_cs (new_ctx);
- case TAO_CodeGen::TAO_ARRAY_ANY_OP_CH:
- return new be_visitor_array_any_op_ch (new_ctx);
- case TAO_CodeGen::TAO_ARRAY_ANY_OP_CS:
- return new be_visitor_array_any_op_cs (new_ctx);
- case TAO_CodeGen::TAO_ARRAY_CDR_OP_CH:
- return new be_visitor_array_cdr_op_ch (new_ctx);
- case TAO_CodeGen::TAO_ARRAY_CDR_OP_CI:
- return new be_visitor_array_cdr_op_ci (new_ctx);
- case TAO_CodeGen::TAO_ARRAY_CDR_OP_CS:
- return new be_visitor_decl (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_AMI:
- // @@ Alex: I am not sure about this case, yet (Alex).
- // noop.
- return new be_visitor_decl (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_FWD_CH:
- return new be_visitor_interface_ami_handler_fwd_ch (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_FWD_CI:
- return new be_visitor_interface_ami_handler_fwd_ci (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CH:
- return new be_visitor_interface_ami_handler_servant_ch (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CS:
- return new be_visitor_interface_ami_handler_servant_cs (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_STUB_CH:
- return new be_visitor_interface_ami_handler_stub_ch (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_STUB_CS:
- return new be_visitor_interface_ami_handler_stub_cs (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RESULT_ARG:
- return new be_visitor_args_ami_handler_result_arg (new_ctx);
-
- default:
- // an error
- delete new_ctx;
- return 0;
- }
- return 0;
-}
-
-// The concrete visitor factory for operation visitors generating interpretive
-// stubs and skeletons
-
-TAO_Interpretive_Visitor_Factory::TAO_Interpretive_Visitor_Factory (void)
-{
-}
-
-// destructor
-TAO_Interpretive_Visitor_Factory::~TAO_Interpretive_Visitor_Factory (void)
-{
-}
-
-be_visitor *
-TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx)
-{
- TAO_CodeGen::CG_STATE st = ctx->state ();
- // create a new context so that ownership issues are not confused. This newly
- // created context is a copy of what was sent by the caller. The newly
- // created visitor will own this new copy.
- be_visitor_context *new_ctx = new be_visitor_context (*ctx);
-
- switch (st)
- {
- case TAO_CodeGen::TAO_UNION_ANY_OP_CS:
- return new be_visitor_union_any_op_interpretive_cs (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_CH:
- return new be_visitor_operation_ch (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_CS:
- return new be_interpretive_visitor_operation_cs (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_SH:
- return new be_visitor_operation_sh (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_IH:
- return new be_visitor_operation_ih (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_SS:
- return new be_interpretive_visitor_operation_ss (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_IS:
- return new be_visitor_operation_is (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH:
- return new be_visitor_operation_thru_poa_collocated_sh (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS:
- return new be_visitor_operation_thru_poa_collocated_ss (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH:
- return new be_visitor_operation_direct_collocated_sh (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS:
- return new be_visitor_operation_direct_collocated_ss (new_ctx);
-
- case TAO_CodeGen::TAO_COLLOCATED_AMI_HANDLER_OPERATION_CH:
- return new be_visitor_operation_ami_handler_operation_ch (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETTYPE_CH:
- case TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS:
- return new be_visitor_operation_rettype (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_RETTYPE_IS:
- return new be_visitor_operation_rettype_is (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS:
- return new be_visitor_operation_rettype_vardecl_cs (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_PRE_INVOKE_CS:
- return new be_visitor_operation_rettype_pre_docall_cs (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_INVOKE_CS:
- return new be_visitor_operation_rettype_docall_cs (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_POST_INVOKE_CS:
- return new be_visitor_operation_rettype_post_docall_cs (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS:
- return new be_visitor_operation_rettype_return_cs (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS:
- return new be_visitor_operation_exceptlist_cs (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS:
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS:
- return new be_visitor_operation_rettype_vardecl_ss (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_DEMARSHAL_SS:
- case TAO_CodeGen::TAO_OPERATION_RETVAL_MARSHAL_SS:
- return new be_visitor_operation_rettype_marshal_ss (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS:
- return new be_visitor_operation_rettype_assign_ss (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_POST_UPCALL_SS:
- return new be_visitor_operation_rettype_post_upcall_ss (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_CH:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_IH:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_IS:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_COLLOCATED_SH:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_OTHERS:
- return new be_visitor_operation_arglist (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_ARG_PRE_INVOKE_CS:
- case TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS:
- case TAO_CodeGen::TAO_AMI_OPERATION_ARG_INVOKE_CS:
- // @@ Michael case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_INVOKE_CS:
- case TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS:
- case TAO_CodeGen::TAO_OPERATION_ARG_PRE_UPCALL_SS:
- case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS:
- case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS:
- case TAO_CodeGen::TAO_OPERATION_ARG_POST_UPCALL_SS:
- case TAO_CodeGen::TAO_OPERATION_ARG_DECL_SS:
- case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS:
- case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS:
- case TAO_CodeGen::TAO_OPERATION_ARG_POST_MARSHAL_SS:
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DECL_CS:
- return new be_visitor_operation_argument (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_TIE_SH:
- return new be_visitor_operation_tie_sh (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_TIE_SI:
- return new be_visitor_operation_tie_si (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_CH:
- case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_OTHERS:
- return new be_visitor_args_arglist (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_PRE_INVOKE_CS:
- return new be_visitor_args_pre_docall_cs (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_INVOKE_CS:
- case TAO_CodeGen::TAO_AMI_ARGUMENT_INVOKE_CS:
- // @@ Michael case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS:
- return new be_visitor_args_docall_cs (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_POST_INVOKE_CS:
- return new be_visitor_args_post_docall_cs (new_ctx);
- case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS:
- return new be_visitor_args_vardecl_ss (new_ctx);
- case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS:
- return new be_visitor_args_pre_upcall_ss (new_ctx);
- case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS:
- case TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS:
- return new be_visitor_args_upcall_ss (new_ctx);
- case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS:
- return new be_visitor_args_post_upcall_ss (new_ctx);
- case TAO_CodeGen::TAO_ARGUMENT_DEMARSHAL_SS:
- case TAO_CodeGen::TAO_ARGUMENT_MARSHAL_SS:
- return new be_visitor_args_marshal_ss (new_ctx);
- case TAO_CodeGen::TAO_ARGUMENT_POST_MARSHAL_SS:
- return new be_visitor_args_post_marshal_ss (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_AMI_CH:
- return new be_visitor_operation_ami_ch (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_AMI_CS:
- return new be_interpretive_visitor_operation_ami_cs (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_AMI_ARGLIST_CH:
- case TAO_CodeGen::TAO_OPERATION_AMI_ARGLIST_CS:
- return new be_visitor_operation_ami_arglist (new_ctx);
-
- // case TAO_CodeGen::TAO_OPERATION_ARG_AMI:
- // return new be_visitor_operation_argument (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_AMI_ARGLIST_CH:
- return new be_visitor_args_ami_arglist (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_AMI_ARGLIST_CS:
- return new be_visitor_args_ami_arglist (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_OPERATION_CH:
- case TAO_CodeGen::TAO_AMI_HANDLER_STUB_OPERATION_CH:
- return new be_visitor_operation_ami_handler_operation_ch (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_STUB_OPERATION_CS:
- return new be_interpretive_visitor_operation_ami_handler_operation_cs (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CH:
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CS:
- return new be_visitor_operation_ami_handler_arglist (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_AMI_HANDLER_ARGLIST_CH:
- case TAO_CodeGen::TAO_ARGUMENT_AMI_HANDLER_ARGLIST_CS:
- return new be_visitor_args_ami_handler_arglist (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_SKELETON_CS:
- return new be_interpretive_visitor_operation_ami_handler_skeleton_cs (new_ctx);
-
- default:
- // cannot handle it; delegate it to the common visitor factory
- delete new_ctx;
- return TAO_COMMON_VISITOR_FACTORY::instance ()->make_visitor (ctx);
- }
-}
-
-// The concrete visitor factory for operation visitors generating compiled
-// stubs and skeletons
-
-TAO_Compiled_Visitor_Factory::TAO_Compiled_Visitor_Factory (void)
-{
-}
-
-// destructor
-TAO_Compiled_Visitor_Factory::~TAO_Compiled_Visitor_Factory (void)
-{
-}
-
-be_visitor *
-TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx)
-{
- TAO_CodeGen::CG_STATE st = ctx->state ();
- // create a new context so that ownership issues are not confused. This newly
- // created context is a copy of what was sent by the caller. The newly
- // created visitor will own this new copy.
- be_visitor_context *new_ctx = new be_visitor_context (*ctx);
-
- switch (st)
- {
- case TAO_CodeGen::TAO_UNION_ANY_OP_CS:
- return new be_visitor_union_any_op_compiled_cs (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_CH:
- return new be_visitor_operation_ch (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_CS:
- return new be_compiled_visitor_operation_cs (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_SH:
- return new be_visitor_operation_sh (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_SS:
- return new be_compiled_visitor_operation_ss (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_IS:
- return new be_visitor_operation_is (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_IH:
- return new be_visitor_operation_ih (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH:
- return new be_visitor_operation_thru_poa_collocated_sh (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS:
- return new be_visitor_operation_thru_poa_collocated_ss (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH:
- return new be_visitor_operation_direct_collocated_sh (new_ctx);
- case TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS:
- return new be_visitor_operation_direct_collocated_ss (new_ctx);
-
- case TAO_CodeGen::TAO_COLLOCATED_AMI_HANDLER_OPERATION_CH:
- return new be_visitor_operation_ami_handler_operation_ch (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETTYPE_CH:
- case TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS:
- return new be_visitor_operation_rettype (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS:
- return new be_visitor_operation_rettype_vardecl_cs (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_PRE_INVOKE_CS:
- return new be_visitor_operation_rettype_pre_invoke_cs (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_INVOKE_CS:
- return new be_visitor_operation_rettype_compiled_marshal (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_POST_INVOKE_CS:
- // this is a NO-OP
- return new be_visitor_decl (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS:
- return new be_visitor_operation_rettype_return_cs (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS:
- return new be_visitor_operation_exceptlist_cs (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS:
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS:
- return new be_compiled_visitor_operation_rettype_vardecl_ss (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_DEMARSHAL_SS:
- // this is a NO-OP
- return new be_visitor_decl (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_MARSHAL_SS:
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_MARSHAL_CS:
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DEMARSHAL_CS:
- return new be_visitor_operation_rettype_compiled_marshal (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS:
- return new be_visitor_operation_rettype_assign_ss (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_RETVAL_POST_UPCALL_SS:
- // this is a NO-OP
- return new be_visitor_decl (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_CH:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_IH:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_IS:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_COLLOCATED_SH:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_OTHERS:
- return new be_visitor_operation_arglist (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_ARG_PRE_INVOKE_CS:
- case TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS:
- case TAO_CodeGen::TAO_OPERATION_ARG_PRE_UPCALL_SS:
- case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS:
- case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS:
- case TAO_CodeGen::TAO_OPERATION_ARG_POST_UPCALL_SS:
- case TAO_CodeGen::TAO_OPERATION_ARG_DECL_SS:
- case TAO_CodeGen::TAO_OPERATION_ARG_POST_MARSHAL_SS:
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DECL_CS:
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS:
- return new be_visitor_operation_argument (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS:
- case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS:
- return new be_compiled_visitor_operation_argument_marshal (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_MARSHAL_CS:
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DEMARSHAL_CS:
- return new be_compiled_visitor_operation_ami_handler_argument_marshal (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS:
- case TAO_CodeGen::TAO_AMI_OPERATION_ARG_INVOKE_CS:
- // @@ Michael case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_INVOKE_CS:
- return new be_compiled_visitor_operation_argument_invoke (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_TIE_SH:
- return new be_visitor_operation_tie_sh (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_TIE_SI:
- return new be_visitor_operation_tie_si (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_CH:
- case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_OTHERS:
- return new be_visitor_args_arglist (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_PRE_INVOKE_CS:
- return new be_visitor_args_pre_invoke_cs (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_INVOKE_CS:
- case TAO_CodeGen::TAO_AMI_ARGUMENT_INVOKE_CS:
- // @@ Michael case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS:
- return new be_visitor_args_compiled_marshal_cs (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_POST_INVOKE_CS:
- return new be_visitor_args_post_docall_compiled_cs (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS:
- return new be_compiled_visitor_args_vardecl_ss (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS:
- return new be_compiled_visitor_args_ami_handler_vardecl_cs (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS:
- // this is a NO-OP
- return new be_visitor_decl (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS:
- case TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS:
- return new be_visitor_args_upcall_ss (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS:
- return new be_visitor_args_ami_handler_upcall_cs (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS:
- // this is a NO-OP
- return new be_visitor_decl (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_DEMARSHAL_SS:
- case TAO_CodeGen::TAO_ARGUMENT_MARSHAL_SS:
- return new be_visitor_args_compiled_marshal_ss (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_DEMARSHAL_CS:
- case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_MARSHAL_CS:
- return new be_visitor_args_ami_handler_compiled_marshal_cs (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_POST_MARSHAL_SS:
- // this is a NO-OP
- return new be_visitor_decl (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_AMI_CS:
- return new be_compiled_visitor_operation_ami_cs (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_AMI_CH:
- return new be_visitor_operation_ami_ch (new_ctx);
-
- case TAO_CodeGen::TAO_OPERATION_AMI_ARGLIST_CH:
- case TAO_CodeGen::TAO_OPERATION_AMI_ARGLIST_CS:
- return new be_visitor_operation_ami_arglist (new_ctx);
-
- // case TAO_CodeGen::TAO_OPERATION_ARG_AMI:
- // return new be_visitor_operation_argument (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_AMI_ARGLIST_CH:
- return new be_visitor_args_ami_arglist (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_AMI_ARGLIST_CS:
- return new be_visitor_args_ami_arglist (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_OPERATION_CH:
- case TAO_CodeGen::TAO_AMI_HANDLER_STUB_OPERATION_CH:
- return new be_visitor_operation_ami_handler_operation_ch (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_STUB_OPERATION_CS:
- return new be_compiled_visitor_operation_ami_handler_operation_cs (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CH:
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CS:
- return new be_visitor_operation_ami_handler_arglist (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_AMI_HANDLER:
- return new be_visitor_args_ami_handler_arglist (new_ctx);
-
- case TAO_CodeGen::TAO_ARGUMENT_AMI_HANDLER_ARGLIST_CH:
- case TAO_CodeGen::TAO_ARGUMENT_AMI_HANDLER_ARGLIST_CS:
- return new be_visitor_args_ami_handler_arglist (new_ctx);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_SKELETON_CS:
- return new be_compiled_visitor_operation_ami_handler_skeleton_cs (new_ctx);
-
- default:
- // cannot handle it; delegate it to the common visitor factory
- delete new_ctx;
- return TAO_COMMON_VISITOR_FACTORY::instance ()->make_visitor (ctx);
- }
-}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Singleton<TAO_Common_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX>;
-template class ACE_Singleton<TAO_Interpretive_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX>;
-template class ACE_Singleton<TAO_Compiled_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate ACE_Singleton<TAO_Common_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX>
-#pragma instantiate ACE_Singleton<TAO_Interpretive_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX>
-#pragma instantiate ACE_Singleton<TAO_Compiled_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
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 b219838d510..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_field.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// $Id$
-//
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_field.cpp
-//
-// = DESCRIPTION
-// Concrete visitor for the base "BE_Field" node
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_field.h"
-
-// include all the individual files
-#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_ci.cpp"
-#include "be_visitor_field/cdr_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 93be4a933f5..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp
+++ /dev/null
@@ -1,294 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_field.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); // save the 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
-
-// visit array type
-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 () // not a typedef
- && 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 struct declaration
- ctx.state (TAO_CodeGen::TAO_ARRAY_CDR_OP_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_array - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_array - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- return 0;
-}
-
-// visit enum type
-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); // set the node to be the node being visited. The scope
- // is still the same
-
- // first generate the enum declaration
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- return 0;
-}
-
-// visit sequence type
-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); // set the node to be the node being visited. The scope
- // is still the same
-
- // first generate the sequence declaration
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_sequence - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_sequence - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- return 0;
-}
-
-// visit structure type
-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
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_struct - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_struct - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- return 0;
-}
-
-// visit typedefed type
-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); // set the node to be the node being visited. The scope
- // is still the same
-
- // first generate the enum declaration
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ch::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp
deleted file mode 100644
index 78aa5dbb7e0..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp
+++ /dev/null
@@ -1,845 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// field_cdr_op_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Field in the client stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_field.h"
-
-ACE_RCSID(be_visitor_field, cdr_op_ci, "$Id$")
-
-
-// **********************************************
-// visitor for field in the client stubs file
-// **********************************************
-
-// constructor
-be_visitor_field_cdr_op_ci::be_visitor_field_cdr_op_ci (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-// destructor
-be_visitor_field_cdr_op_ci::~be_visitor_field_cdr_op_ci (void)
-{
-}
-
-// visit the field node
-int
-be_visitor_field_cdr_op_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_cdr_op_ci::"
- "visit_field - "
- "Bad field type\n"
- ), -1);
- }
-
- this->ctx_->node (node); // save the node
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ci::"
- "visit_field - "
- "codegen for field type failed\n"
- ), -1);
- }
- return 0;
-}
-
-// visit array
-int
-be_visitor_field_cdr_op_ci::visit_array (be_array *node)
-{
- TAO_OutStream *os; // output stream
- 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_field_cdr_op_ci::"
- "visit_array - "
- "cannot retrieve field 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->fullname (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname, "_%s", node->fullname ());
- }
- }
- else
- {
- // typedefed node
- ACE_OS::sprintf (fname, "%s", node->fullname ());
- }
-
- // 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_ci::"
- "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. Generate the <<, >> operators
- // for the type defined by the anonymous array
-
- // 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 declaration
- ctx.state (TAO_CodeGen::TAO_ARRAY_CDR_OP_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ci::"
- "visit_array - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ci::"
- "visit_array - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit enum type
-int
-be_visitor_field_cdr_op_ci::visit_enum (be_enum *node)
-{
- TAO_OutStream *os; // output stream
- 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_field_cdr_op_ci::"
- "visit_array - "
- "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_ci::"
- "visit_enum - "
- "bad sub state\n"
- ), -1);
- }
-
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the typcode for enums
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ci::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ci::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit interface type
-int
-be_visitor_field_cdr_op_ci::visit_interface (be_interface *)
-{
- TAO_OutStream *os; // output stream
- 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_field_cdr_op_ci::"
- "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:
- *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())";
- 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_field_cdr_op_ci::"
- "visit_interface - "
- "bad sub state\n"
- ), -1);
- }
- return 0;
-}
-
-// visit interface forward type
-int
-be_visitor_field_cdr_op_ci::visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os; // output stream
- 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_field_cdr_op_ci::"
- "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:
- *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())";
- 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_field_cdr_op_ci::"
- "visit_interface_fwd - "
- "bad sub state\n"
- ), -1);
- }
- return 0;
-}
-
-// visit predefined type
-int
-be_visitor_field_cdr_op_ci::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os; // output stream
- 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_field_cdr_op_ci::"
- "visit_predefined_type - "
- "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:
- // is a psuedo obj
- if (node->pt () == AST_PredefinedType::PT_pseudo)
- *os << "(strm >> _tao_aggregate." << f->local_name ()
- << ".out ())";
- else if (node->pt () == AST_PredefinedType::PT_char)
- *os << "(strm >> CORBA::Any::to_char (_tao_aggregate."
- << f->local_name () << "))";
- else if (node->pt () == AST_PredefinedType::PT_wchar)
- *os << "(strm >> CORBA::Any::to_wchar (_tao_aggregate."
- << f->local_name () << "))";
- else if (node->pt () == AST_PredefinedType::PT_octet)
- *os << "(strm >> CORBA::Any::to_octet (_tao_aggregate."
- << f->local_name () << "))";
- else if (node->pt () == AST_PredefinedType::PT_boolean)
- *os << "(strm >> CORBA::Any::to_boolean (_tao_aggregate."
- << f->local_name () << "))";
- else
- *os << "(strm >> _tao_aggregate." << f->local_name () << ")";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- // is a psuedo obj
- if (node->pt () == AST_PredefinedType::PT_pseudo)
- *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())";
- else if (node->pt () == AST_PredefinedType::PT_char)
- *os << "(strm << CORBA::Any::from_char (_tao_aggregate."
- << f->local_name () << "))";
- else if (node->pt () == AST_PredefinedType::PT_wchar)
- *os << "(strm << CORBA::Any::from_wchar (_tao_aggregate."
- << f->local_name () << "))";
- else if (node->pt () == AST_PredefinedType::PT_octet)
- *os << "(strm << CORBA::Any::from_octet (_tao_aggregate."
- << f->local_name () << "))";
- else if (node->pt () == AST_PredefinedType::PT_boolean)
- *os << "(strm << CORBA::Any::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_ci::"
- "visit_array - "
- "bad sub state\n"
- ), -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_ci::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os; // output stream
- 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_field_cdr_op_ci::"
- "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_ci::"
- "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 structure
- {
- // Anonymous sequence
- // 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
-
- // generate the inline code for structs
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ci::"
- "visit_sequence - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ci::"
- "visit_sequence - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit string type
-int
-be_visitor_field_cdr_op_ci::visit_string (be_string *)
-{
- TAO_OutStream *os; // output stream
- 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_field_cdr_op_ci::"
- "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 >> _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_ci::"
- "visit_array - "
- "bad sub state\n"
- ), -1);
- }
-
- return 0;
-}
-
-// visit structure type
-int
-be_visitor_field_cdr_op_ci::visit_structure (be_structure *node)
-{
- TAO_OutStream *os; // output stream
- 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_field_cdr_op_ci::"
- "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_ci::"
- "visit_structure - "
- "bad sub state\n"
- ), -1);
- }
-
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the inline code for structs
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ci::"
- "visit_struct - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ci::"
- "visit_struct - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit typedef type
-int
-be_visitor_field_cdr_op_ci::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_field_cdr_op_ci::"
- "visit_typedef - "
- "Bad primitive type\n"
- ), -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-// visit union type
-int
-be_visitor_field_cdr_op_ci::visit_union (be_union *node)
-{
- TAO_OutStream *os; // output stream
- 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_field_cdr_op_ci::"
- "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_ci::"
- "visit_union - "
- "bad sub state\n"
- ), -1);
- }
-
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the inline code for union
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ci::"
- "visit_union - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ci::"
- "visit_union - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- 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)
- {
- 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); // save the 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;
-}
-
-// visit array
-int
-be_visitor_cdr_op_field_decl::visit_array (be_array *node)
-{
- TAO_OutStream *os; // output stream
- 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_cdr_op_field_decl::"
- "visit_array - "
- "cannot retrieve field 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
-
- 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->fullname (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname, "_%s", node->fullname ());
- }
- }
- else
- {
- // typedefed node
- ACE_OS::sprintf (fname, "%s", node->fullname ());
- }
-
- // 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
- << "(ACE_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;
- return 0;
- 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);
- }
- ACE_NOTREACHED (return 0);
-}
-
-
-// visit typedef type
-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 || (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/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp
deleted file mode 100644
index 93f25b43b70..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp
+++ /dev/null
@@ -1,288 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_field.h"
-
-ACE_RCSID(be_visitor_field, cdr_op_cs, "$Id$")
-
-
-// **********************************************
-// visitor for field in the client stubs file
-// **********************************************
-
-// constructor
-be_visitor_field_cdr_op_cs::be_visitor_field_cdr_op_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-// destructor
-be_visitor_field_cdr_op_cs::~be_visitor_field_cdr_op_cs (void)
-{
-}
-
-// visit the field node
-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); // save the 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;
-}
-
-// visit array
-int
-be_visitor_field_cdr_op_cs::visit_array (be_array *node)
-{
- if (!this->ctx_->alias () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // this is the case for anonymous arrays. Generate the <<, >> operators
- // for the type defined by the anonymous array
-
- // 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. The scope
- // is still the same
- ctx.node (node);
-
- // first generate the declaration
- ctx.state (TAO_CodeGen::TAO_ARRAY_CDR_OP_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_array - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_array - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit enum type
-int
-be_visitor_field_cdr_op_cs::visit_enum (be_enum *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the typcode for enums
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ci::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_ci::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-int
-be_visitor_field_cdr_op_cs::visit_sequence (be_sequence *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // Anonymous sequence
- // instantiate a visitor context with a copy of our context. This info
- // will be modified based on what type of node we are visiting
-
- // set the node to be the node being visited. The scope is
- // still the same
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
-
- // generate the code for sequences
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_sequence - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_sequence - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit structure type
-int
-be_visitor_field_cdr_op_cs::visit_structure (be_structure *node)
-{
- 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_);
- // set the node to be the node being visited. The scope is
- // still the same
- ctx.node (node);
-
- // generate the inline code for structs
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_struct - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_struct - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit typedef type
-int
-be_visitor_field_cdr_op_cs::visit_typedef (be_typedef *node)
-{
- // save the typedef node for use in code generation as we visit the
- // base type
- 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_field_cdr_op_cs::"
- "visit_typedef - "
- "Bad primitive type\n"
- ), -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-// visit union type
-int
-be_visitor_field_cdr_op_cs::visit_union (be_union *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the inline code for union
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_union - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_union - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- 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 af980e349a4..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp
+++ /dev/null
@@ -1,521 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_field.h"
-
-ACE_RCSID(be_visitor_field, field_ch, "$Id$")
-
-
-// **********************************************
-// visitor for field in the client header file
-// **********************************************
-
-// constructor
-be_visitor_field_ch::be_visitor_field_ch (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-// destructor
-be_visitor_field_ch::~be_visitor_field_ch (void)
-{
-}
-
-// visit the field node
-int
-be_visitor_field_ch::visit_field (be_field *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt; // field's type
-
- os = this->ctx_->stream ();
- // 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_field_ch::"
- "visit_field - "
- "Bad field type\n"
- ), -1);
- }
-
- this->ctx_->node (node); // save the node
- 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 () << ";\n";
- return 0;
-}
-
-// =visit operations on all possible data types that a field can be
-
-// visit array type
-int
-be_visitor_field_ch::visit_array (be_array *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt;
-
- os = this->ctx_->stream ();
- // set the right type;
- 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 ()))
- {
- // 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 struct declaration
- ctx.state (TAO_CodeGen::TAO_ARRAY_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_array - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_array - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
-
- // having defined all array type and its supporting operations, now
- // generate the actual variable that is a field of the structure
- os->indent ();
- *os << "_" << bt->local_name ();
- }
- else
- {
- // this was a typedefed array
- os->indent (); // start from current indentation level
- *os << bt->nested_type_name (this->ctx_->scope ());
- }
- return 0;
-}
-
-// visit enum type
-int
-be_visitor_field_ch::visit_enum (be_enum *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt;
-
- os = this->ctx_->stream ();
-
- // set the right type;
- 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); // set the node to be the node being visited. The scope
- // is still the same
-
- // first generate the enum declaration
- ctx.state (TAO_CodeGen::TAO_ENUM_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- // now use this enum as a "type" for the subsequent declarator
- os->indent (); // start from current indentation level
- *os << bt->nested_type_name (this->ctx_->scope ());
-
- return 0;
-}
-
-// visit interface type
-int
-be_visitor_field_ch::visit_interface (be_interface *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt;
-
- os = this->ctx_->stream ();
- // set the right type;
- 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
- os->indent ();
- *os << "TAO_Object_Field_T<"
- << bt->nested_type_name (this->ctx_->scope (), "")
- << ",";
- // Must use another statement, nested_type_name has side effects...
- *os << bt->nested_type_name (this->ctx_->scope (), "_var")
- << ">";
- return 0;
-}
-
-// visit interface forward type
-int
-be_visitor_field_ch::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt;
-
- os = this->ctx_->stream ();
- // set the right type;
- 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
- os->indent ();
- *os << "TAO_Object_Field_T<"
- << bt->nested_type_name (this->ctx_->scope (), "") << ",";
- // Must use another statement, nested_type_name has side effects...
- *os << bt->nested_type_name (this->ctx_->scope (), "_var") << ">";
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-// visit valuetype type
-int
-be_visitor_field_ch::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt;
-
- os = this->ctx_->stream ();
- // set the right type;
- 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
- os->indent ();
- *os << bt->nested_type_name (this->ctx_->scope (), "")
- << "_var";
- return 0;
-}
-
-// visit valuetype forward type
-int
-be_visitor_field_ch::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt;
-
- os = this->ctx_->stream ();
- // set the right type;
- 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
- os->indent ();
- *os << bt->nested_type_name (this->ctx_->scope (), "")
- << "_var";
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-// visit predefined type
-int
-be_visitor_field_ch::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt;
-
- os = this->ctx_->stream ();
- // set the right type;
- 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
- os->indent (); // start from current indentation level
- if (node->pt () == AST_PredefinedType::PT_pseudo) // is a psuedo obj
- {
- // check if we are dealing with a CORBA::Object
- if (!ACE_OS::strcmp (node->local_name ()->get_string (), "Object"))
- {
- *os << "TAO_Object_Field_T<"
- << bt->name () << ","
- << bt->name () << "_var>";
- }
- else
- *os << bt->nested_type_name (this->ctx_->scope (), "_var");
- }
- else
- *os << bt->nested_type_name (this->ctx_->scope ());
- return 0;
-}
-
-// visit sequence type
-int
-be_visitor_field_ch::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt;
-
- os = this->ctx_->stream ();
- // set the right type;
- 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); // set the node to be the node being visited. The scope
- // is still the same
-
- // first generate the sequence declaration
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_sequence - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_sequence - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- os->indent (); // start from current indentation level
- *os << bt->nested_type_name (this->ctx_->scope ());
- return 0;
-}
-
-// visit string type
-int
-be_visitor_field_ch::visit_string (be_string *)
-{
- TAO_OutStream *os; // output stream
-
- os = this->ctx_->stream ();
- os->indent (); // start from current indentation level
- // set the right type;
-
-#if 0
- if (this->ctx_->alias ())
- {
- *os << this->ctx_->alias ()->nested_type_name (this->ctx_->scope ())
- << "_var";
- }
- else
- *os << "CORBA::String_var";
-#endif
- *os << "TAO_String_Manager";
- return 0;
-}
-
-// visit structure type
-int
-be_visitor_field_ch::visit_structure (be_structure *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt;
-
- os = this->ctx_->stream ();
- // set the right type;
- 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); // set the node to be the node being visited. The scope
- // is still the same
-
- // first generate the struct declaration
- ctx.state (TAO_CodeGen::TAO_STRUCT_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_struct - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_struct - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- os->indent (); // start from current indentation level
- *os << bt->nested_type_name (this->ctx_->scope ());
- return 0;
-}
-
-// visit typedefed type
-int
-be_visitor_field_ch::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node); // save the node for use in code generation and
- // indicate that the type of the field node
- // is a typedefed quantity
-
- // 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; // output stream
- be_type *bt;
-
- os = this->ctx_->stream ();
- // set the right type;
- 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); // set the node to be the node being visited. The scope
- // is still the same
-
- // first generate the union declaration
- ctx.state (TAO_CodeGen::TAO_UNION_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_union - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ch::"
- "visit_union - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- os->indent (); // start from current indentation level
- *os << bt->nested_type_name (this->ctx_->scope ());
- return 0;
-}
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 57d2daa7690..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp
+++ /dev/null
@@ -1,255 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_field.h"
-
-ACE_RCSID(be_visitor_field, field_ci, "$Id$")
-
-
-// **********************************************
-// visitor for field in the client inline file.
-//
-// Generate inline code for types that are defined
-// inside the structure
-// **********************************************
-
-// constructor
-be_visitor_field_ci::be_visitor_field_ci (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-// destructor
-be_visitor_field_ci::~be_visitor_field_ci (void)
-{
-}
-
-// visit the field node
-int
-be_visitor_field_ci::visit_field (be_field *node)
-{
- be_type *bt =
- be_type::narrow_from_decl (node->field_type ());
- // first generate the type information
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ci::"
- "visit_field - "
- "Bad field type\n"
- ), -1);
- }
-
- this->ctx_->node (node); // save the 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
-
-// visit array
-int
-be_visitor_field_ci::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 () // not a typedef
- && 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 struct declaration
- ctx.state (TAO_CodeGen::TAO_ARRAY_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ci::"
- "visit_array - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ci::"
- "visit_array - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit sequence
-int
-be_visitor_field_ci::visit_sequence (be_sequence *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // anonymous sequence
-
- // 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
-
- // generate the inline code for structs
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ci::"
- "visit_sequence - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ci::"
- "visit_sequence - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit structure type
-int
-be_visitor_field_ci::visit_structure (be_structure *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the inline code for structs
- ctx.state (TAO_CodeGen::TAO_STRUCT_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ci::"
- "visit_struct - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ci::"
- "visit_struct - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit typedef type
-int
-be_visitor_field_ci::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_ci::"
- "visit_typedef - "
- "Bad primitive type\n"
- ), -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-// visit union type
-int
-be_visitor_field_ci::visit_union (be_union *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the inline code for union
- ctx.state (TAO_CodeGen::TAO_UNION_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ci::"
- "visit_union - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_ci::"
- "visit_union - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- 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 756c8aa123b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp
+++ /dev/null
@@ -1,285 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_field.h"
-
-ACE_RCSID(be_visitor_field, field_cs, "$Id$")
-
-
-// **********************************************
-// visitor for field in the client stubs file
-// **********************************************
-
-// constructor
-be_visitor_field_cs::be_visitor_field_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-// destructor
-be_visitor_field_cs::~be_visitor_field_cs (void)
-{
-}
-
-// visit the field node
-int
-be_visitor_field_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_field_cs::"
- "visit_field - "
- "Bad field type\n"
- ), -1);
- }
-
- this->ctx_->node (node); // save the 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 array
-int
-be_visitor_field_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 () // not a typedef
- && 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 struct declaration
- ctx.state (TAO_CodeGen::TAO_ARRAY_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_array - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_array - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit enum type
-int
-be_visitor_field_cs::visit_enum (be_enum *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the typcode for enums
- ctx.state (TAO_CodeGen::TAO_ENUM_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-int
-be_visitor_field_cs::visit_sequence (be_sequence *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the inline code for structs
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_sequence - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_sequence - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit structure type
-int
-be_visitor_field_cs::visit_structure (be_structure *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the inline code for structs
- ctx.state (TAO_CodeGen::TAO_STRUCT_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_struct - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_struct - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit typedef type
-int
-be_visitor_field_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_ci::"
- "visit_typedef - "
- "Bad primitive type\n"
- ), -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-// visit union type
-int
-be_visitor_field_cs::visit_union (be_union *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the inline code for union
- ctx.state (TAO_CodeGen::TAO_UNION_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_union - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cs::"
- "visit_union - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- 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 1ac9ed473ea..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-// $Id$
-//
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_interface.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Interface
-//
-// = AUTHOR
-// Aniruddha Gokhale and Carlos O'Ryan
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-// include all the individual files
-#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/thru_poa_collocated_sh.cpp"
-#include "be_visitor_interface/thru_poa_collocated_ss.cpp"
-#include "be_visitor_interface/direct_collocated_sh.cpp"
-#include "be_visitor_interface/direct_collocated_ss.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_ci.cpp"
-#include "be_visitor_interface/cdr_op_cs.cpp"
-#include "be_visitor_interface/ami_handler_fwd_ch.cpp"
-#include "be_visitor_interface/ami_handler_fwd_ci.cpp"
-#include "be_visitor_interface/ami_handler_servant_ch.cpp"
-#include "be_visitor_interface/ami_handler_servant_cs.cpp"
-#include "be_visitor_interface/ami_handler_stub_ch.cpp"
-#include "be_visitor_interface/ami_handler_stub_cs.cpp"
-#include "be_visitor_interface/collocated_ami_handler_ch.cpp"
-
-ACE_RCSID(be, be_visitor_interface, "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_ch.cpp
deleted file mode 100644
index 678314b2855..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_ch.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating AMI Reply Handler code for Interfaces in the
-// client header.
-//
-// = AUTHOR
-// Aniruddha Gokhale and Alexander Babu Arulanthu
-// <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-ACE_RCSID(be_visitor_interface, ami_handler_ch, "$Id$")
-
-
-// ************************************************************
-// Interface visitor for server header
-// ************************************************************
-
-be_visitor_interface_ami_handler_ch::be_visitor_interface_ami_handler_ch (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_ami_handler_ch::~be_visitor_interface_ami_handler_ch (void)
-{
-}
-
-int
-be_visitor_interface_ami_handler_ch::visit_interface (be_interface *node)
-{
- TAO_OutStream *os; // output stream
- static char namebuf [NAMEBUFSIZE]; // holds the class name
-
- if (node->srv_hdr_gen () || node->imported ())
- return 0;
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
-
- os = this->ctx_->stream ();
-
- // Generate the skeleton class name.
-
- // Start with whatever indentation level we are at.
- os->indent ();
-
- // We shall have a POA_ prefix only if we are at the topmost level.
- if (!node->is_nested ())
- {
- // we are outermost
- ACE_OS::sprintf (namebuf,
- "POA_AMI_%s_Handler",
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (namebuf,
- "AMI_%s_Handler",
- node->local_name ()->get_string ());
- }
-
- *os << "class " << namebuf << ";" << be_nl;
-
- // generate the _ptr declaration
- *os << "typedef " << namebuf << " *" << namebuf
- << "_ptr;" << be_nl;
-
- // Now generate the class definition.
- // This class will inherit from the Messaging::ReplyHandler class.
- *os << "class " << idl_global->export_macro ()
- << " " << namebuf
- << " : public POA_Messaging::ReplyHandler"
- << be_nl;
-
- // Body of the class definition.
- *os << be_nl
- << "{" << be_nl;
-
- // Default constructor.
- *os << "protected:" << be_idt_nl
- << namebuf << " (void);\n" << be_uidt_nl;
-
- // Public portion starts.
- *os << "public:" << be_idt_nl
-
- // Copy constructor.
- << namebuf << " (const " << namebuf << "& rhs);" << be_nl
-
- // Destructor.
- << "virtual ~" << namebuf << " (void);\n\n"
-
- << be_nl;
-
- // Methods.
-
- // _is_a.
- *os << "virtual CORBA::Boolean _is_a (" << be_idt << be_idt_nl
- << "const char* logical_type_id," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // _down_cast.
- *os << "virtual void* _downcast (" << be_idt << be_idt_nl
- << "const char* logical_type_id" << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // add a skeleton for our _is_a method
- *os << "static void _is_a_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *context," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // add a skeleton for our _non_existent method
- *os << "static void _non_existent_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *context," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // add the dispatch method
- *os << "virtual void _dispatch (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &_tao_req," << be_nl
- << "void *_tao_context," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // Print out the _this() method.
- *os << node->name () << " *_this (" << be_idt << be_idt_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // The _interface_repository_id method.
- *os << "virtual const char* _interface_repository_id "
- << "(void) const;\n\n";
-
- // The _create_collocated_objref method.
- *os << "virtual void* _create_collocated_objref"
- << "(const char*, CORBA::ULong type, TAO_Stub *sobj);"
- << be_nl << be_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_ami_handler_ch::"
- "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_interface_ami_handler_ch::"
- "visit_interface - "
- "inheritance graph traversal failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << "};\n\n";
-
-#if 0
- //
- // @@ Alex: Do this:
- //
- // Generate the collocated class
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_INTERFACE_COLLOCATED_SH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ami_handler_ch::"
- "visit_interface - "
- "codegen for collocated class failed\n"),
- -1);
- }
-
- // generate the TIE class.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_INTERFACE_TIE_SH);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ami_handler_ch::"
- "visit_interface - "
- "codegen for TIE class failed\n"),
- -1);
- }
-#endif /* 0 */
-
- *os << "\n";
-
-#if 0
- ctx.stream (tao_cg->server_template_header ());
-#endif /* 0 */
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_cs.cpp
deleted file mode 100644
index 62eae6c6da5..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_cs.cpp
+++ /dev/null
@@ -1,235 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for AMI Handler class for an Interface.
-//
-// = AUTHOR
-// Alexander Babu Arulanthu <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-ACE_RCSID(be_visitor_interface, ami_handler_cs, "$Id$")
-
-
-// ************************************************************
-// Interface visitor for client stubs
-// ************************************************************
-
-be_visitor_ ami_handler_cs::be_visitor_ ami_handler_cs (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_ ami_handler_cs::~be_visitor_ ami_handler_cs (void)
-{
-}
-
-int
-be_visitor_ ami_handler_cs::visit_interface (be_interface *node)
-{
- // output stream.
- TAO_OutStream *os;
-
- if (node->cli_stub_gen () || node->imported ())
- return 0;
-
- os = this->ctx_->stream ();
-
- // Start with whatever indentation level we are at.
- os->indent ();
-
- // Create the full name for the AMI_<Interface name>_Handler
- // interface.
- char *full_name = 0;
-
- // Full name.
- // If there exists a scope name for this, then generate
- // "Scope::AMI_<Local Name>_Handler".
-
- size_t scope_len = 0;
-
- be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl ();
-
- if (parent != 0 &&
- parent->fullname () != 0 &&
- ACE_OS::strlen (parent->fullname ()))
- scope_len = ACE_OS::strlen (parent->fullname ()) + ACE_OS::strlen ("::");
-
- ACE_NEW_RETURN (full_name,
- char [scope_len +
- ACE_OS::strlen ("AMI_") +
- ACE_OS::strlen (node->local_name ()->get_string ()) +
- ACE_OS::strlen ("_Handler") +
- 1],
- -1);
-
- if (parent != 0 &&
- parent->fullname () != 0 &&
- ACE_OS::strlen (parent->fullname ()))
- ACE_OS::sprintf (full_name,
- "%s::AMI_%s_Handler",
- parent->fullname (),
- node->local_name ()->get_string ());
- else
- ACE_OS::sprintf (full_name,
- "AMI_%s_Handler",
- node->local_name ()->get_string ());
-
- // First generate the code for the static methods.
-
- // The _narrow method
- *os << full_name << "_ptr " << full_name
- << "::_narrow (" << be_idt << be_idt_nl
- << "CORBA::Object_ptr obj," << be_nl
- << "CORBA::Environment &env" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "if (CORBA::is_nil (obj))" << be_idt_nl
- << "return " << full_name << "::_nil ();" << be_uidt_nl
- << "if (!obj->_is_a (\"" << node->repoID () << "\", env))"
- << be_idt_nl
- << "return " << full_name << "::_nil ();" << be_uidt_nl;
-
- *os << "return " << full_name
- << "::_unchecked_narrow (obj, env);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // This may be necessary to work around a GCC compiler bug!
- // const char *skel_name = node->full_skel_name (); // unused at this time
- const char *coll_name = node->full_coll_name ();
- assert (coll_name != 0);
-
- // The _unchecked_narrow method
- *os << full_name << "_ptr " << full_name
- << "::_unchecked_narrow (" << be_idt << be_idt_nl
- << "CORBA::Object_ptr obj," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "ACE_UNUSED_ARG (ACE_TRY_ENV);" << be_nl
- << "if (CORBA::is_nil (obj))" << be_idt_nl
- << "return " << full_name << "::_nil ();" << be_uidt_nl;
-
- *os << "TAO_Stub* stub = obj->_stubobj ();" << be_nl
- << "stub->_incr_refcnt ();" << be_nl;
- *os << "void* servant = 0;" << be_nl;
- *os << "if (obj->_is_collocated () "
- << "&& obj->_servant() != 0)" << be_idt_nl
- << "servant = obj->_servant()->_downcast (\""
- << "IDL:omg.org/CORBA/Object:1.0\");" << be_uidt_nl;
-
- *os << "if (servant != 0)" << be_idt_nl << "{" << be_idt_nl
- // The collocated object reference factory is not working right (yet)
- << full_name << "_ptr retv = ACE_reinterpret_cast (" << be_idt << be_idt_nl
- << full_name << "_ptr," << be_nl
- << "ACE_reinterpret_cast (" << be_idt << be_idt_nl
- << "PortableServer::Servant," << be_nl
- << "servant" << be_uidt_nl
- << ")" << be_uidt_nl
- << "->_create_collocated_objref (" << be_idt << be_idt_nl
- << "\"" << node->repoID () << "\"," << be_nl
- << "TAO_ORB_Core::ORB_CONTROL," << be_nl
- << "stub" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl
- << "if (retv != 0)" << be_idt_nl
- << "return retv;" << be_uidt
- // So we are still using the old way to create collocated objref.
- << be_uidt_nl
- << "}" << be_uidt_nl;
-
- *os << "return new " << full_name << "(stub);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // The _duplicate method
- *os << full_name << "_ptr " << be_nl
- << full_name << "::_duplicate ("
- << full_name << "_ptr obj)" << be_nl
- << "{" << be_idt_nl
- << "if (!CORBA::is_nil (obj))" << be_idt_nl
- << "obj->_incr_refcnt ();" << be_uidt_nl
- << "return obj;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // generate code for the elements of the interface
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ ami_handler_cs::"
- "visit_interface - "
- "codegen for scope failed\n"), -1);
- }
-
- // generate the is_a method
- os->indent ();
- *os << "CORBA::Boolean " << full_name << "::_is_a (" <<
- "const CORBA::Char *value, CORBA::Environment &env)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "if (\n";
- os->incr_indent (0);
- if (node->traverse_inheritance_graph (be_interface::is_a_helper, os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ ami_handler_cs::"
- "visit_interface - "
- "_is_a method codegen failed\n"), -1);
- }
-
- os->indent ();
- *os << "(!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (env))))\n";
- *os << " return 1; // success using local knowledge\n";
- os->decr_indent ();
- *os << "else" << be_nl;
- *os << " return this->CORBA_Object::_is_a (value, env);\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- os->indent ();
- *os << "const char* " << full_name
- << "::_interface_repository_id (void) const"
- << be_nl
- << "{" << be_idt_nl
- << "return \"" << node->repoID () << "\";" << be_uidt_nl
- << "}\n\n";
-
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- be_visitor *visitor;
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DEFN);
- ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ ami_handler_cs::"
- "visit_interface - "
- "TypeCode definition failed\n"
- ), -1);
- }
-
- // @@ Alex: Make sure you have done the following in the other ami
- // visitors. (Alex).
- delete full_name;
- full_name = 0;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ch.cpp
deleted file mode 100644
index edd92eb656f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ch.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_fwd_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating fwd declaration code for the AMI Handler
-// interface.
-//
-// = AUTHOR
-// Aniruddha Gokhale and Alexander Babu Arulanthu
-// <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface_fwd.h"
-
-ACE_RCSID(be_visitor_interface_ami_handler_fwd, ami_handler_fwd_ch, "$Id$")
-
-
-// ********************************************************************
-// Visitor implementation generating fwd declaration code for the AMI
-// Handler interface.
-// ********************************************************************
-
-be_visitor_interface_ami_handler_fwd_ch::be_visitor_interface_ami_handler_fwd_ch (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_interface_ami_handler_fwd_ch::~be_visitor_interface_ami_handler_fwd_ch (void)
-{
-}
-
-// visit the interface node and its scope
-int
-be_visitor_interface_ami_handler_fwd_ch::visit_interface (be_interface *node)
-{
- // Grab the out stream.
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate code, if the client header is not generated already.
- if (!node->cli_hdr_gen () && !node->imported ())
- {
- // start from the current indentation.
- os->indent ();
-
- // Generate forward declaration class.
- *os << "class "
- << "AMI_" << node->local_name () << "_Handler" << ";"
- << be_nl;
-
- // Create a string "AMI_<interface name>_Handler". We can use
- // this for defining all _Var, _out,etc.
- char *interface_name = 0;
- ACE_NEW_RETURN (interface_name,
- char [ACE_OS::strlen ("AMI_") +
- ACE_OS::strlen (node->flatname ()) +
- ACE_OS::strlen ("_Handler") +
- // end of string
- 1],
- 0);
- ACE_OS::sprintf (interface_name,
- "AMI_%s_Handler",
- node->flatname ());
-
- // Generate the ifdefined macro for the _ptr type.
- os->gen_ifdef_macro (interface_name, "_ptr");
-
- // Generate the _ptr declaration
- *os << "typedef "
- << "AMI_" << node->local_name () << "_Handler"
- << " *"
- << "AMI_" << node->local_name () << "_Handler" << "_ptr;"
- << be_nl;
-
- // Generate the endif.
- os->gen_endif ();
-
- // Generate the var class.
-
- // Enclose under an ifdef macro
- os->gen_ifdef_macro (interface_name, "_var");
-
- // Generate the _var declaration.
- if (node->gen_var_defn (interface_name) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ami_handler_fwd_ch::"
- "visit_interface_fwd - "
- "codegen for _var failed\n"), -1);
- }
-
- // Gen an endif.
- os->gen_endif ();
-
- // Generate the our class.
-
- // Enclose under an ifdef macro.
- os->gen_ifdef_macro (interface_name, "_out");
-
- // Generate the _out declaration - ORBOS/97-05-15 pg 16-20
- // spec.
- if (node->gen_out_defn (interface_name) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ami_handler_fwd_ch::"
- "visit_interface_fwd - "
- "codegen for _out failed\n"), -1);
- }
-
- // Generate the endif macro.
- os->gen_endif ();
- }
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ci.cpp
deleted file mode 100644
index d4f94f6198a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ci.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_fwd_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Ami_<Interface>_Handler node in the
-// client inline.
-//
-// = AUTHOR
-// Aniruddha Gokhale and Alexander Babu Arulanthu
-// <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface_fwd.h"
-
-ACE_RCSID(be_visitor_interface_ami_handler_fwd, ami_handler_fwd_ci, "$Id$")
-
-
-// ********************************************************************
-// Visitor implementation for the Ami_Handler_Fwd type
-// This one for the client inline file
-// ********************************************************************
-
-be_visitor_interface_ami_handler_fwd_ci::be_visitor_interface_ami_handler_fwd_ci (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_interface_ami_handler_fwd_ci::~be_visitor_interface_ami_handler_fwd_ci (void)
-{
-}
-
-// visit the Ami_Handler_Fwd_ci node and its scope
-int
-be_visitor_interface_ami_handler_fwd_ci::visit_interface (be_interface *node)
-{
- if (node->cli_inline_gen () || node->imported ())
- return 0;
-
- // Generate code.
-
- // Get the out stream.
- TAO_OutStream *os;
- os = this->ctx_->stream ();
-
- // Start from the current indentation level.
- os->indent ();
-
- // Create the full name and local name for the AMI_<Interface
- // name>_Handler interface.
- char *full_name = 0;
- char *local_name = 0;
-
- // Full name.
- // If there exists a scope name for this, then generate
- // "Scope::AMI_<Local Name>_Handler".
-
- size_t scope_len = 0;
-
- be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl ();
-
- if (parent != 0 &&
- parent->fullname () != 0 &&
- ACE_OS::strlen (parent->fullname ()))
- scope_len = ACE_OS::strlen (parent->fullname ()) + ACE_OS::strlen ("::");
-
- ACE_NEW_RETURN (full_name,
- char [scope_len +
- ACE_OS::strlen ("AMI_") +
- ACE_OS::strlen (node->local_name ()->get_string ()) +
- ACE_OS::strlen ("_Handler") +
- 1],
- -1);
-
- if (parent != 0 &&
- parent->fullname () != 0 &&
- ACE_OS::strlen (parent->fullname ()))
- ACE_OS::sprintf (full_name,
- "%s::AMI_%s_Handler",
- parent->fullname (),
- node->local_name ()->get_string ());
- else
- ACE_OS::sprintf (full_name,
- "AMI_%s_Handler",
- node->local_name ()->get_string ());
-
- // Local name.
-
- ACE_NEW_RETURN (local_name,
- char [ACE_OS::strlen ("AMI_") +
- ACE_OS::strlen (node->local_name ()->get_string ()) +
- ACE_OS::strlen ("_Handler") +
- 1],
- -1);
-
- ACE_OS::sprintf (local_name,
- "AMI_%s_Handler",
- node->local_name ()->get_string ());
-
- // Generate the constructors and destructor.
-
- *os << "ACE_INLINE" << be_nl;
- *os << full_name << "::" << local_name
- << " (void) // default constructor" << be_nl;
- *os << "{}" << be_nl << be_nl;
-
- *os << "ACE_INLINE" << be_nl;
- *os << full_name << "::" << local_name
- << " (TAO_Stub *objref, TAO_ServantBase *_tao_servant, "
- << "CORBA::Boolean _tao_collocated) // constructor"
- << be_nl
- << " : CORBA_Object (objref, _tao_servant, _tao_collocated)"
- << be_nl
- << "{}" << be_nl << be_nl;
-
- *os << "ACE_INLINE" << be_nl;
- *os << full_name << "::~" << local_name
- << " (void) // destructor" << be_nl
- << "{}\n\n";
-
- // _nil method.
- *os << "ACE_INLINE "
- << full_name << "_ptr" << be_nl
- << full_name << "::_nil (void)" << be_nl
- << "{" << be_idt_nl
- << "return (" << full_name << "_ptr)0;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Generate the ifdefined macro for the _var type.
- os->gen_ifdef_macro (full_name, "_var");
- if (node->gen_var_impl (full_name, local_name) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ci::"
- "visit_interface - "
- "codegen for _var failed\n"), -1);
- }
- os->gen_endif ();
-
- // Generate the ifdefined macro for the _out type.
- os->gen_ifdef_macro (full_name, "_out");
- if (node->gen_out_impl (full_name,
- local_name) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ci::"
- "visit_interface - "
- "codegen for _out failed\n"), -1);
- }
- os->gen_endif ();
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_ch.cpp
deleted file mode 100644
index 899412c61fb..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_ch.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_servant_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating AMI Reply Handler code for Interfaces in the
-// client header.
-//
-// = AUTHOR
-// Aniruddha Gokhale and Alexander Babu Arulanthu
-// <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-ACE_RCSID(be_visitor_interface, ami_handler_servant_ch, "$Id$")
-
-
-// ************************************************************
-// Interface visitor for server header
-// ************************************************************
-
-be_visitor_interface_ami_handler_servant_ch::be_visitor_interface_ami_handler_servant_ch (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_ami_handler_servant_ch::~be_visitor_interface_ami_handler_servant_ch (void)
-{
-}
-
-int
-be_visitor_interface_ami_handler_servant_ch::visit_interface (be_interface *node)
-{
- // Output stream.
- TAO_OutStream *os;
-
- // Holds the class name.
- static char namebuf [NAMEBUFSIZE];
-
- // AMI_<Interface_Name>_Handler string.
- static char ami_handler [NAMEBUFSIZE];
-
- if (node->srv_hdr_gen () || node->imported ())
- return 0;
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::memset (ami_handler, '\0', NAMEBUFSIZE);
-
- os = this->ctx_->stream ();
-
- // Generate the skeleton class name.
-
- // Start with whatever indentation level we are at.
- os->indent ();
-
- // We shall have a POA_ prefix only if we are at the topmost level.
- if (!node->is_nested ())
- {
- // we are outermost
- ACE_OS::sprintf (namebuf,
- "POA_AMI_%s_Handler",
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (namebuf,
- "AMI_%s_Handler",
- node->local_name ()->get_string ());
- }
-
- // AMI Handler object's name.
- ACE_OS::sprintf (ami_handler,
- "AMI_%s_Handler",
- node->local_name ()->get_string ());
-
- *os << "class " << namebuf << ";" << be_nl;
-
- // generate the _ptr declaration
- *os << "typedef " << namebuf << " *" << namebuf
- << "_ptr;" << be_nl;
-
- // Now generate the class definition.
- // This class will inherit from the Messaging::ReplyHandler class.
- *os << "class " << idl_global->export_macro ()
- << " " << namebuf
- << " : public virtual POA_Messaging::ReplyHandler"
- << be_nl;
-
- // Body of the class definition.
- *os << be_nl
- << "{" << be_nl;
-
- // Default constructor.
- *os << "protected:" << be_idt_nl
- << namebuf << " (void);\n" << be_uidt_nl;
-
- // Public portion starts.
- *os << "public:" << be_idt_nl
-
- // Copy constructor.
- << namebuf << " (const " << namebuf << "& rhs);" << be_nl
-
- // Destructor.
- << "virtual ~" << namebuf << " (void);\n\n"
-
- << be_nl;
-
- // Methods.
-
- // _is_a.
- *os << "virtual CORBA::Boolean _is_a (" << be_idt << be_idt_nl
- << "const char* logical_type_id," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // _down_cast.
- *os << "virtual void* _downcast (" << be_idt << be_idt_nl
- << "const char* logical_type_id" << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // add a skeleton for our _is_a method
- *os << "static void _is_a_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *context," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // add a skeleton for our _non_existent method
- *os << "static void _non_existent_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *context," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // add the dispatch method
- *os << "virtual void _dispatch (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &_tao_req," << be_nl
- << "void *_tao_context," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // Print out the _this() method.
- *os << ami_handler << " *_this (" << be_idt << be_idt_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // The _interface_repository_id method.
- *os << "virtual const char* _interface_repository_id "
- << "(void) const;\n\n";
-
- // The _create_collocated_objref method.
- *os << "virtual void* _create_collocated_objref"
- << "(const char*, CORBA::ULong type, TAO_Stub *sobj);"
- << be_nl << be_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_ami_handler_servant_ch::"
- "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_interface_ami_handler_servant_ch::"
- "visit_interface - "
- "inheritance graph traversal failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << "};\n\n";
-
- // Generate the collocated class
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_COLLOCATED_AMI_HANDLER_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ami_handler_servant_ch::"
- "visit_interface - "
- "codegen for collocated class failed\n"),
- -1);
- }
-
-#if 0
- // @@ Do this (Alex).
- // generate the TIE class.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_INTERFACE_TIE_SH);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ami_handler_servant_ch::"
- "visit_interface - "
- "codegen for TIE class failed\n"),
- -1);
- }
-#endif /* 0 */
-
- *os << "\n";
-
-#if 0
- ctx.stream (tao_cg->server_template_header ());
-#endif /* 0 */
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_cs.cpp
deleted file mode 100644
index 6c3be5f1597..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_cs.cpp
+++ /dev/null
@@ -1,347 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_servant_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the server skeletons file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-ACE_RCSID(be_visitor_interface, ami_handler_servant_cs, "$Id$")
-
-
-// ************************************************************
-// Interface visitor for server skeletons
-// ************************************************************
-
-be_visitor_interface_ami_handler_servant_cs::be_visitor_interface_ami_handler_servant_cs (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_ami_handler_servant_cs::~be_visitor_interface_ami_handler_servant_cs (void)
-{
-}
-
-int
-be_visitor_interface_ami_handler_servant_cs::visit_interface (be_interface *node)
-{
- TAO_OutStream *os; // output stream
-
- if (node->srv_skel_gen () || node->imported ())
- return 0;
-
- os = this->ctx_->stream ();
-
- // generate the skeleton class name
-
- os->indent (); // start with whatever indentation level we are at
-
- /* @@ Michael
- if (node->gen_operation_table () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ami_handler_servant_cs::"
- "visit_interface - "
- "codegen for operation table failed\n"),
- -1);
- }
-
- */
- // constructor
- *os << "// skeleton constructor" << be_nl;
- // find if we are at the top scope or inside some module
- if (!node->is_nested ())
- {
- // we are outermost. So the POA_ prefix is prepended to our name
- *os << node->ami_handler_full_skel_name () << "::POA_" << node->ami_handler_local_name () <<
- " (void)" << be_nl;
- }
- else
- {
- // the POA_ prefix is prepended to our outermost module name
- *os << node->ami_handler_full_skel_name () << "::" << node->ami_handler_local_name () <<
- " (void)" << be_nl;
- }
-
- *os << "{" << be_idt_nl
- << "this->optable_ = &tao_" << node->flatname ()
- << "_optable;" << be_uidt_nl
- << "}\n\n";
-
- *os << "// copy ctor" << be_nl;
- // find if we are at the top scope or inside some module
- if (!node->is_nested ())
- {
- // we are outermost. So the POA_ prefix is prepended to our name
- *os << node->ami_handler_full_skel_name () << "::POA_"
- << node->ami_handler_local_name () << " ("
- << "const POA_" << node->ami_handler_local_name () << "& rhs)";
- }
- else
- {
- // the POA_ prefix is prepended to our outermost module name
- *os << node->ami_handler_full_skel_name () << "::"
- << node->ami_handler_local_name () << " (const "
- << node->ami_handler_local_name () << "& rhs)";
- }
- *os << be_idt_nl
- << ": ";
- if (node->traverse_inheritance_graph
- (be_interface::copy_ctor_helper, os) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ami_handler_servant_cs::visit_interface - "
- " copy ctor generation failed\n"), -1);
- *os << " TAO_ServantBase (rhs)" << be_uidt_nl
- << "{}\n" << be_nl;
-
- *os << "// skeleton destructor" << be_nl;
-
- if (!node->is_nested ())
- {
- // we are outermost. So the POA_ prefix is prepended to our name
- *os << node->ami_handler_full_skel_name () << "::~POA_" << node->ami_handler_local_name () <<
- " (void)" << be_nl;
- }
- else
- {
- // the POA_ prefix is prepended to our outermost module name
- *os << node->ami_handler_full_skel_name () << "::~" << node->ami_handler_local_name () <<
- " (void)" << be_nl;
- }
- *os << "{\n";
- *os << "}\n\n";
-
-
- // @@ Michael
- /*
- // generate code for elements in the scope (e.g., operations)
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ami_handler_servant_cs::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
- */
-
- // generate code for the _is_a skeleton
- os->indent ();
- *os << "void " << node->ami_handler_full_skel_name ()
- << "::_is_a_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &_tao_server_request, " << be_nl
- << "void * _tao_object_reference," << be_nl
- << "void * /* context */," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt_nl;
- *os << "{" << be_idt_nl;
- *os << "TAO_InputCDR &_tao_in = _tao_server_request.incoming ();" << be_nl;
- *os << node->ami_handler_full_skel_name () << " *_tao_impl = ("
- << node->ami_handler_full_skel_name () << " *) _tao_object_reference;" << be_nl;
- *os << "CORBA::Boolean _tao_retval = 0;" << be_nl;
- *os << "CORBA::String_var value;" << be_nl;
- *os << "if (!((_tao_in >> value.out ())))" << be_idt_nl;
- *os << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt_nl << be_nl;
- *os << "_tao_retval = _tao_impl->_is_a (value.in (), ACE_TRY_ENV);" << be_nl;
- *os << "ACE_CHECK;" << be_nl << be_nl;
- *os << "_tao_server_request.init_reply (ACE_TRY_ENV);" << be_nl;
- *os << "ACE_CHECK;" << be_nl;
- *os << "TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();" << be_nl;
- *os << "if (!((_tao_out << CORBA::Any::from_boolean (_tao_retval))))" << be_idt_nl;
- *os << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt << be_uidt_nl;
- *os << "}\n\n";
-
-
- // generate code for the _non_existent skeleton
- os->indent ();
- *os << "void " << node->ami_handler_full_skel_name ()
- << "::_non_existent_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &_tao_server_request, " << be_nl
- << "void * _tao_object_reference," << be_nl
- << "void * /* context */," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt_nl;
- *os << "{" << be_idt_nl;
- *os << node->ami_handler_full_skel_name () << " *_tao_impl = ("
- << node->ami_handler_full_skel_name () << " *) _tao_object_reference;" << be_nl;
- *os << "CORBA::Boolean _tao_retval = _tao_impl->_non_existent (ACE_TRY_ENV);" << be_nl;
- *os << "ACE_CHECK;" << be_nl << be_nl;
- *os << "_tao_server_request.init_reply (ACE_TRY_ENV);" << be_nl;
- *os << "ACE_CHECK;" << be_nl;
- *os << "TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();" << be_nl;
- *os << "if (!((_tao_out << CORBA::Any::from_boolean (_tao_retval))))" << be_idt_nl;
- *os << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt << be_uidt_nl;
- *os << "}\n\n";
-
-
- os->indent ();
- *os << "CORBA::Boolean " << node->ami_handler_full_skel_name ()
- << "::_is_a (" << be_idt << be_idt_nl
- << "const char* value," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "if (\n" << be_idt;
- if (node->traverse_inheritance_graph (be_interface::is_a_helper, os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ami_handler_servant_cs::"
- "visit_interface - "
- "traversal of inhertance graph failed\n"),
- -1);
- }
-
- os->indent ();
- *os << "(!ACE_OS::strcmp ((char *)value, "
- << "CORBA::_tc_Object->id (ACE_TRY_ENV))))"
- << be_idt_nl << "return 1;" << be_uidt_nl
- << "else" << be_idt_nl
- << "return 0;" << be_uidt << be_uidt << be_uidt_nl
- << "}\n\n";
-
- // the downcast method.
- os->indent ();
- *os << "void* " << node->ami_handler_full_skel_name ()
- << "::_downcast (" << be_idt << be_idt_nl
- << "const char* logical_type_id" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (node->traverse_inheritance_graph (be_interface::downcast_helper, os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ami_handler_servant_cs::"
- "visit_interface - "
- "traversal of inhertance graph failed\n"),
- -1);
- }
-
- *os << "if (ACE_OS::strcmp (logical_type_id, "
- << "\"IDL:omg.org/CORBA/Object:1.0\") == 0)" << be_idt_nl
- << "return ACE_static_cast(PortableServer::Servant, this);"
- << be_uidt_nl;
-
- *os << "return 0;" << be_uidt_nl
- << "}\n\n";
-
-
- // now the dispatch method
- os->indent ();
- *os << "void " << node->ami_handler_full_skel_name () <<
- "::_dispatch (CORBA::ServerRequest &req, " <<
- "void *context, CORBA::Environment &ACE_TRY_ENV)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "TAO_Skeleton skel; // pointer to skeleton for operation" << be_nl;
- *os << "const char *opname = req.operation (); // retrieve operation name"
- << be_nl;
- *os << "// find the skeleton corresponding to this opname" << be_nl;
- *os << "if (this->_find (opname, skel, req.operation_length ()) == -1)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "ACE_ERROR ((LM_ERROR, \"Bad operation <%s>\\n\", opname));" << be_nl;
- *os << "ACE_THROW (CORBA_BAD_OPERATION ());"
- //<< "ACE_TRY_ENV);" << be_uidt_nl;
- << be_uidt_nl;
- // *os << "env.exception (new CORBA_BAD_OPERATION ());" << be_nl;
- *os << "}" << be_nl;
- *os << "else" << be_idt_nl;
- *os << "skel (req, this, context, ACE_TRY_ENV);" << be_uidt << be_uidt_nl;
- *os << "}\n\n";
-
- os->indent ();
- *os << "const char* " << node->ami_handler_full_skel_name ()
- << "::_interface_repository_id (void) const"
- << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "return \"" << node->repoID () << "\";\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- *os << "\n";
-
- // the _this () operation
- *os << node->name () << "*" << be_nl
- << node->ami_handler_full_skel_name ()
- << "::_this (CORBA_Environment &ACE_TRY_ENV)" << be_nl
- << "{" << be_idt_nl
- << "TAO_Stub *stub = this->_create_stub (ACE_TRY_ENV);" << be_nl
- << "ACE_CHECK_RETURN (0);" << be_nl
- // << "if (ACE_TRY_ENV.exception () != 0)" << be_idt_nl
- // << "return 0;" << be_uidt_nl
-
- // @@ Michael: We need to check this value being passed. I am
- // passing 1 right now. (Alex).
- << "return new " << node->full_coll_name (1)
- << " (this, stub);" << be_uidt_nl;
-
- *os << "}\n\n";
-
- // the _create_collocated_objref method
- *os << "void*" << be_nl
- << node->ami_handler_full_skel_name ()
- << "::_create_collocated_objref (const char* repository_id, "
- << "CORBA::ULong type, TAO_Stub *stub)" << be_nl
- << "{" << be_idt_nl
- << "if (!ACE_OS::strcmp (\"" << node->repoID ()
- << "\", repository_id))" << be_idt_nl
- << "return ACE_static_cast (" << be_idt << be_idt_nl
- << node->name () << "_ptr," << be_nl
-
- // @@ Michael: We need to check this value being passed. I am
- // passing 1 right now. (Alex).
- << "new " << node->full_coll_name (1)
- << " (this, stub)" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl
- << "return 0;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // @@ Michael
- /*
- // generate the collocated class impl
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_INTERFACE_COLLOCATED_SS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ami_handler_servant_cs::"
- "visit_interface - "
- "Bad visitor for collocated class\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ami_handler_servant_cs::"
- "visit_interface - "
- "codegen for collocated class failed\n"),
- -1);
- }
- delete visitor;
-
- *os << "\n\n";
-
- */
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_ch.cpp
deleted file mode 100644
index c4ee9d201d3..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_ch.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_stub_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating default stub class for the AMI Handler in the
-// client header.
-//
-// = AUTHOR
-// Aniruddha Gokhale and Alexander Babu Arulanthu
-// <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-
-// ******************************************************
-// Interface visitor for client header
-// ******************************************************
-
-be_visitor_interface_ami_handler_stub_ch::be_visitor_interface_ami_handler_stub_ch (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_ami_handler_stub_ch::~be_visitor_interface_ami_handler_stub_ch (void)
-{
-}
-
-int
-be_visitor_interface_ami_handler_stub_ch::visit_interface (be_interface *node)
-{
- TAO_OutStream *os; // output stream
-
- // Not already generated and not imported.
- if (!node->cli_hdr_gen () && !node->imported ())
- {
- // Grab the stream.
- os = this->ctx_->stream ();
-
- // Ifdef guard.
-
- // Generate AMI_...name..._Handler string.
- char *ifdef_string = 0;
- ACE_NEW_RETURN (ifdef_string,
- char [ACE_OS::strlen ("AMI_") +
- ACE_OS::strlen (node->flatname ()) +
- ACE_OS::strlen ("_Handler") +
- // end of string
- 1],
- 0);
- ACE_OS::sprintf (ifdef_string,
- "AMI_%s_Handler",
- node->flatname ());
-
- os->gen_ifdef_macro (ifdef_string);
-
- // Prepare the local name for the class.
- char *local_name = 0;
- ACE_NEW_RETURN (local_name,
- char [ACE_OS::strlen ("AMI_") +
- ACE_OS::strlen (node->local_name ()->get_string ()) +
- ACE_OS::strlen ("_Handler") +
- // end of string
- 1],
- 0);
- ACE_OS::sprintf (local_name,
- "AMI_%s_Handler",
- node->local_name ()->get_string ());
-
- // Now generate the class definition.
-
- os->indent ();
-
- *os << "class " << idl_global->export_macro () << " "
- << local_name;
-
- // Node interface inherits from the Messaging::ReplyHandler
- // interface.
- *os << " : public virtual Messaging::ReplyHandler" << be_nl;
-
- // Generate the body.
-
- *os << "{" << be_nl
- << "public:" << be_nl
-
- // generate the _ptr_type and _var_type typedefs
- // but we must protect against certain versions of g++
- << "#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8"
- << be_idt_nl
- << "typedef " << local_name << "_ptr _ptr_type;" << be_nl
- << "typedef " << local_name << "_var _var_type;" << be_uidt_nl
- << "#endif /* __GNUC__ */\n" << be_idt_nl
-
- // generate the static _duplicate, _narrow, and _nil operations
- << "// the static operations" << be_nl
- << "static " << local_name << "_ptr " << "_duplicate ("
- << local_name << "_ptr obj);" << be_nl
- << "static " << local_name << "_ptr "
- << "_narrow (" << be_idt << be_idt_nl
- << "CORBA::Object_ptr obj," << be_nl
- << "CORBA::Environment &env = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl
- << "static " << local_name << "_ptr "
- << "_unchecked_narrow (" << be_idt << be_idt_nl
- << "CORBA::Object_ptr obj," << be_nl
- << "CORBA::Environment &env = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl
- << "static " << local_name << "_ptr " << "_nil (void);\n\n";
-
- // Visit the scope to generate the stubs for the call back
- // methods.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ami_handler_stub_ch::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
-
- // the _is_a method
- os->indent ();
- *os << "virtual CORBA::Boolean _is_a (" << be_idt << be_idt_nl
- << "const CORBA::Char *type_id, " << be_nl
- << "CORBA::Environment &env = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl
- << "virtual const char* "
- << "_interface_repository_id (void) const;\n" << be_uidt_nl;
-
- // generate the "protected" constructor so that users cannot instantiate
- // us
- *os << "protected:" << be_idt_nl
- << local_name << " (void);" << be_nl
- << local_name
- << " (TAO_Stub *objref, " << be_idt << be_idt_nl
- << "TAO_ServantBase *_tao_servant = 0, " << be_nl
- << "CORBA::Boolean _tao_collocated = 0" << be_uidt_nl
- << ");" << be_uidt_nl
- << "virtual ~" << local_name << " (void);" << be_uidt_nl;
-
- // private copy constructor and assignment operator. These are not
- // allowed, hence they are private.
- *os << "private:\n";
- os->incr_indent ();
- *os << local_name << " (const " << local_name << " &);"
- << be_nl
- << "void operator= (const " << local_name << " &);\n";
-
- os->decr_indent ();
- *os << "};\n\n";
- os->gen_endif ();
-
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- be_visitor *visitor;
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DECL);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ami_handler_stub_ch::"
- "visit_interface - "
- "TypeCode declaration failed\n"),
- -1);
- }
-
-
- // Delete the heap allocated vars.
- delete ifdef_string;
- ifdef_string = 0;
- delete local_name;
- local_name = 0;
- }
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_cs.cpp
deleted file mode 100644
index e75034bd185..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_cs.cpp
+++ /dev/null
@@ -1,250 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_stub_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for AMI Handler class for an Interface.
-//
-// = AUTHOR
-// Alexander Babu Arulanthu <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-ACE_RCSID(be_visitor_interface, ami_handler_stub_cs, "$Id$")
-
-
-// ************************************************************
-// Interface visitor for client stubs
-// ************************************************************
-
-be_visitor_interface_ami_handler_stub_cs::be_visitor_interface_ami_handler_stub_cs (be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_ami_handler_stub_cs::~be_visitor_interface_ami_handler_stub_cs (void)
-{
-}
-
-int
-be_visitor_interface_ami_handler_stub_cs::visit_interface (be_interface *node)
-{
- // output stream.
- TAO_OutStream *os;
-
- if (node->cli_stub_gen () || node->imported ())
- return 0;
-
- os = this->ctx_->stream ();
-
- // Start with whatever indentation level we are at.
- os->indent ();
-
- // Create the full name for the AMI_<Interface name>_Handler
- // interface.
- char *full_name = 0;
-
- // Full name.
- // If there exists a scope name for this, then generate
- // "Scope::AMI_<Local Name>_Handler".
-
- size_t scope_len = 0;
-
- be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl ();
-
- if (parent != 0 &&
- parent->fullname () != 0 &&
- ACE_OS::strlen (parent->fullname ()))
- scope_len = ACE_OS::strlen (parent->fullname ()) + ACE_OS::strlen ("::");
-
- ACE_NEW_RETURN (full_name,
- char [scope_len +
- ACE_OS::strlen ("AMI_") +
- ACE_OS::strlen (node->local_name ()->get_string ()) +
- ACE_OS::strlen ("_Handler") +
- 1],
- -1);
-
- if (parent != 0 &&
- parent->fullname () != 0 &&
- ACE_OS::strlen (parent->fullname ()))
- ACE_OS::sprintf (full_name,
- "%s::AMI_%s_Handler",
- parent->fullname (),
- node->local_name ()->get_string ());
- else
- ACE_OS::sprintf (full_name,
- "AMI_%s_Handler",
- node->local_name ()->get_string ());
-
- // First generate the code for the static methods.
-
- // The _narrow method
- *os << full_name << "_ptr " << full_name
- << "::_narrow (" << be_idt << be_idt_nl
- << "CORBA::Object_ptr obj," << be_nl
- << "CORBA::Environment &env" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "if (CORBA::is_nil (obj))" << be_idt_nl
- << "return " << full_name << "::_nil ();" << be_uidt_nl
- << "if (!obj->_is_a (\""
- << node->compute_repoID ("AMI_", "_Handler") << "\", env))"
- << be_idt_nl
- << "return " << full_name << "::_nil ();" << be_uidt_nl;
-
- *os << "return " << full_name
- << "::_unchecked_narrow (obj, env);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // This may be necessary to work around a GCC compiler bug!
- // const char *skel_name = node->full_skel_name (); // unused at this time
-
- // @@ Michael: We need to check this value being passed. I am
- // passing 1 right now. (Alex).
- const char *coll_name = node->full_coll_name (1);
- assert (coll_name != 0);
-
- // The _unchecked_narrow method
- *os << full_name << "_ptr " << full_name
- << "::_unchecked_narrow (" << be_idt << be_idt_nl
- << "CORBA::Object_ptr obj," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "ACE_UNUSED_ARG (ACE_TRY_ENV);" << be_nl
- << "if (CORBA::is_nil (obj))" << be_idt_nl
- << "return " << full_name << "::_nil ();" << be_uidt_nl;
-
- *os << "TAO_Stub* stub = obj->_stubobj ();" << be_nl
- << "stub->_incr_refcnt ();" << be_nl;
- *os << "void* servant = 0;" << be_nl;
- *os << "if (obj->_is_collocated () "
- << "&& obj->_servant() != 0)" << be_idt_nl
- << "servant = obj->_servant()->_downcast (\""
- << "IDL:omg.org/CORBA/Object:1.0\");" << be_uidt_nl;
-
- *os << "if (servant != 0)" << be_idt_nl << "{" << be_idt_nl
- // The collocated object reference factory is not working right (yet)
- << full_name << "_ptr retv = ACE_reinterpret_cast (" << be_idt << be_idt_nl
- << full_name << "_ptr," << be_nl
- << "ACE_reinterpret_cast (" << be_idt << be_idt_nl
- << "PortableServer::Servant," << be_nl
- << "servant" << be_uidt_nl
- << ")" << be_uidt_nl
- << "->_create_collocated_objref (" << be_idt << be_idt_nl
- << "\"" << node->compute_repoID ("AMI_", "_Handler") << "\"," << be_nl
- << "TAO_ORB_Core::ORB_CONTROL," << be_nl
- << "stub" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl
- << "if (retv != 0)" << be_idt_nl
- << "return retv;" << be_uidt
- // So we are still using the old way to create collocated objref.
- << be_uidt_nl
- << "}" << be_uidt_nl;
-
- *os << "return new " << full_name << "(stub);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // The _duplicate method
- *os << full_name << "_ptr " << be_nl
- << full_name << "::_duplicate ("
- << full_name << "_ptr obj)" << be_nl
- << "{" << be_idt_nl
- << "if (!CORBA::is_nil (obj))" << be_idt_nl
- << "obj->_incr_refcnt ();" << be_uidt_nl
- << "return obj;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // Generate code for the elements of the interface.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ami_handler_stub_cs::"
- "visit_interface - "
- "codegen for scope failed\n"), -1);
- }
-
- // generate the is_a method
- os->indent ();
- *os << "CORBA::Boolean " << full_name << "::_is_a (" <<
- "const CORBA::Char *value, CORBA::Environment &env)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "if (\n";
- os->incr_indent (0);
-
- // We know what to generate. We dont have to call traverse graph.
-
- // Current interface.
- *os << "(!ACE_OS::strcmp ((char *)value, "
- << "\""
- << node->compute_repoID ("AMI_", "_Handler")
- << "\""
- << ")) ||"
- << be_nl;
-
- // Reply Handler.
- *os << "(!ACE_OS::strcmp ((char *)value, "
- << "\""
- << "IDL:omg.org/Messaging/ReplyHandler:1.0"
- << "\""
- << ")) ||"
- << be_nl;
-
- os->indent ();
-
- *os << "(!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (env))))\n";
- *os << " return 1; // success using local knowledge\n";
- os->decr_indent ();
- *os << "else" << be_nl;
- *os << " return this->CORBA_Object::_is_a (value, env);\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- os->indent ();
-
- *os << "const char* " << full_name
- << "::_interface_repository_id (void) const"
- << be_nl
- << "{" << be_idt_nl
- << "return \"" << node->compute_repoID ("AMI_", "_Handler") << "\";" << be_uidt_nl
- << "}\n\n";
-
- // By using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO.
- be_visitor *visitor;
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN);
- ctx.sub_state (TAO_CodeGen::TAO_AMI_HANDLER_TC_DEFN_TYPECODE);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ami_handler_stub_cs::"
- "visit_interface - "
- "TypeCode definition failed\n"),
- -1);
- }
-
- delete full_name;
- full_name = 0;
-
- 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 4b5a6781d61..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp
+++ /dev/null
@@ -1,82 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-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 ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- os->indent ();
-
- // Generate the stub factory function pointer declaration
- *os << "extern " << node->name () << "_ptr (*_TAO_collocation_"
- << node->flatname () << "_Stub_Factory_function_pointer) ("
- << be_idt << be_idt_nl
- << "CORBA::Object_ptr obj" << be_uidt_nl
- << ");" << be_uidt_nl;
-
- // generate the Any <<= and >>= operator declarations
- os->indent ();
- *os << "// Any operators for interface " << node->name () << be_nl;
- *os << "void " << idl_global->export_macro ()
- << " operator<<= (CORBA::Any &, " << node->name ()
- << "_ptr);" << be_nl;
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator>>= (const CORBA::Any &, "
- << node->name () << " *&);\n";
-
- // 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_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 f3c758081c7..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp
+++ /dev/null
@@ -1,154 +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 Interface in the stubs
-// file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-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 ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- os->indent ();
- // Generate the stub factory function pointer definition.
- *os << node->name () << "_ptr (*";
-
- *os << "_TAO_collocation_"
- << node->flatname () << "_Stub_Factory_function_pointer) ("
- << be_idt << be_idt_nl
- << "CORBA::Object_ptr obj" << be_uidt_nl
- << ") = 0;" << be_uidt_nl;
-
-
- // generate the Any <<= and >>= operator declarations
- // Any <<= and >>= operators
- os->indent ();
- *os << "void operator<<= (CORBA::Any &_tao_any, "
- << node->name () << "_ptr _tao_elem)" << be_nl
- << "{" << be_idt_nl
- << "CORBA::Object_ptr *_tao_obj_ptr = 0;" << be_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr);" << be_nl
- << "*_tao_obj_ptr = " << node->name ()
- << "::_duplicate (_tao_elem);" << be_nl
- << "_tao_any.replace (" << node->tc_name () << ", "
- << "_tao_obj_ptr, 1, ACE_TRY_ENV);" << be_nl
- << "ACE_TRY_CHECK;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY" << be_nl
- << "{" << be_idt_nl
- << "delete _tao_obj_ptr;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_ENDTRY;" << be_uidt_nl
- << "}\n" << be_nl;
-
- *os << "CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, "
- << node->name () << "_ptr &_tao_elem)" << be_nl
- << "{" << be_idt_nl
- << "CORBA::Object_ptr *tmp = 0;" << be_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "_tao_elem = " << node->name () << "::_nil ();" << be_nl
- << "CORBA::TypeCode_var type = _tao_any.type ();" << be_nl
- << "if (!type->equal (" << node->tc_name ()
- << ", ACE_TRY_ENV)) return 0; // not equal" << be_nl
- << "ACE_TRY_CHECK;" << be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());"
- << be_nl
- << "CORBA::Object_var _tao_obj_var;" << be_nl
- << "ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0);" << be_nl
- << "if (stream.decode (" << node->tc_name ()
- << ", &_tao_obj_var.out (), 0, ACE_TRY_ENV)" << be_nl
- << " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
- << "{" << be_idt_nl
- << "_tao_elem = " << node->name ()
- << "::_narrow (_tao_obj_var.in (), ACE_TRY_ENV);" << be_nl
- << "ACE_TRY_CHECK;" << be_nl
- << "*tmp = (CORBA::Object_ptr) _tao_elem; // any owns the object"
- << be_nl
- << "((CORBA::Any *)&_tao_any)->replace ("
- << node->tc_name () << ", tmp, 1, ACE_TRY_ENV);" << be_nl
- << "ACE_TRY_CHECK;" << be_nl
- << "return 1;" << be_uidt_nl
- << "}" << be_nl
- << "// failure" << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY" << be_nl
- << "{" << be_idt_nl
- << "delete tmp;" << be_nl
- << "return 0;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_ENDTRY;" << be_nl
- << "return 0;" << be_uidt_nl
- << "}\n\n";
-
- *os << "#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)" << be_idt_nl
- << "template class TAO_Object_Field_T<"
- << node->name () << ","
- << node->name () << "_var>;" << be_uidt_nl
- << "template class TAO_Object_Manager<"
- << node->name () << ","
- << node->name () << "_var>;" << be_uidt_nl
- << "#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)" << be_nl
- << "# pragma instantiate TAO_Object_Field_T<"
- << node->name () << ","
- << node->name () << "_var>" << be_uidt_nl
- << "# pragma instantiate TAO_Object_Manager<"
- << node->name () << ","
- << node->name () << "_var>" << be_uidt_nl
- << "#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */\n\n";
-
- // 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/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp
deleted file mode 100644
index 0874e4517d1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp
+++ /dev/null
@@ -1,77 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-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)
-{
- 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 ();
- *os << "CORBA::Boolean " << idl_global->export_macro () << be_nl
- << "operator<< (TAO_OutputCDR &, const " << node->name ()
- << "_ptr );" << be_nl;
- *os << "CORBA::Boolean " << idl_global->export_macro () << be_nl
- << "operator>> (TAO_InputCDR &, "
- << node->name () << "_ptr &);\n";
-
-
- // set the substate as generating code for the types defined in our scope
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
- // 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_cdr_op_ch::"
- "visit_interface - "
- "codegen for scope failed\n"), -1);
- }
-
-
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ci.cpp
deleted file mode 100644
index eca259e8df1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ci.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for interfaces
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-ACE_RCSID(be_visitor_interface, cdr_op_ci, "$Id$")
-
-// ***************************************************************************
-// Interface visitor for generating CDR operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_interface_cdr_op_ci::be_visitor_interface_cdr_op_ci
-(be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_cdr_op_ci::~be_visitor_interface_cdr_op_ci (void)
-{
-}
-
-int
-be_visitor_interface_cdr_op_ci::visit_interface (be_interface *node)
-{
- // already generated and/or we are imported. Don't do anything.
- if (node->cli_inline_cdr_op_gen () || node->imported ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // First generate code for our children. The reason we do this first is
- // because the inlined code for our children must be available before we use
- // it in our parent, but we must forward declare the parent
- // operators, so code like this:
- //
- // // IDL
- // interface Foo {
- // exception Bar {Foo foo_member; };
- // };
- //
- // can work properly (the Foo::Bar operators need the Foo operators
- // defined).
- //
-
- // generate the CDR << and >> operator declarations
- os->indent ();
- *os << "ACE_INLINE CORBA::Boolean" << be_nl
- << "operator<< (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &," << be_nl
- << "const " << node->name () << "_ptr" << be_uidt_nl
- << ");" << be_uidt_nl;
- *os << "ACE_INLINE CORBA::Boolean" << be_nl
- << "operator>> (" << be_idt << be_idt_nl
- << "TAO_InputCDR &," << be_nl
- << node->name () << "_ptr &" << be_uidt_nl
- << ");" << be_uidt << "\n\n";
-
- // Now it really the type to generate the operators for the members
- // of the interface...
-
- // set the substate as generating code for the types defined in our scope
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
- // 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_cdr_op_ci"
- "::visit_interface - "
- "codegen for scope failed\n"), -1);
- }
-
- // set the sub state as generating code for the output operator
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT);
- // @@ TODO don't use the IIOP interpreter here, we should use << and
- // >> operators, or even the operator for the base CORBA::Object!!
- *os << "ACE_INLINE CORBA::Boolean" << be_nl
- << "operator<< (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &strm," << be_nl
- << "const " << node->name () << "_ptr _tao_objref" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
- *os << "CORBA::Object_ptr _tao_corba_obj = _tao_objref;" << be_nl;
- *os << "return (strm << _tao_corba_obj);" << be_uidt_nl
- << "}\n\n";
-
- // set the substate as generating code for the input operator
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT);
- // @@ TODO don't use the IIOP interpreter here, we should use << and
- // >> operators, or even the operator for the base CORBA::Object!!
- *os << "ACE_INLINE CORBA::Boolean" << be_nl
- << "operator>> (" << be_idt << be_idt_nl
- << "TAO_InputCDR &strm," << be_nl
- << node->name () << "_ptr &_tao_objref" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
- // hand over to the TAO's internal marshaling engine
- // *os << "CORBA::Environment env;" << be_nl;
- *os << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl;
- *os << "CORBA::Object_var obj;" << be_nl;
- *os << "if ((strm >> obj.inout ()) == 0)" << be_idt_nl
- << "return 0;" << be_uidt_nl
- << "// narrow to the right type" << be_nl;
- *os << "_tao_objref =" << be_idt_nl
- << node->name () << "::_narrow (" << be_idt << be_idt_nl
- << "obj.in ()," << be_nl
- << "ACE_TRY_ENV" << be_uidt_nl
- << ");" << be_uidt << be_uidt_nl;
- *os << "ACE_TRY_CHECK;" << be_nl;
- *os << "return 1;" << be_uidt_nl;
- *os << "}" << be_nl
- << "ACE_CATCHANY" << be_nl
- << "{" << be_idt_nl
- << "// do nothing" << be_uidt_nl
- << "}" << be_nl
- << "ACE_ENDTRY;" << be_nl
- << "return 0;" << be_uidt_nl;
- *os << "}\n\n";
-
- node->cli_inline_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 35e4c18f006..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for interfaces
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-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)
-{
- if (node->cli_stub_cdr_op_gen () || node->imported ())
- return 0;
-
- // set the substate as generating code for the types defined in our scope
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
- // 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_cdr_op_cs::"
- "visit_interface - "
- "codegen for scope failed\n"), -1);
- }
-
- node->cli_stub_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/collocated_ami_handler_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/collocated_ami_handler_ch.cpp
deleted file mode 100644
index 9f30a1799c1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/collocated_ami_handler_ch.cpp
+++ /dev/null
@@ -1,174 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// collocated_ami_handler_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for collocated classes for the Interface node
-// inside the server header.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-ACE_RCSID(be_visitor_interface, collocated_ami_handler_ch, "$Id$")
-
-
-// ************************************************************
-// collocated class in header
-// ************************************************************
-
-be_visitor_interface_collocated_ami_handler_ch::be_visitor_interface_collocated_ami_handler_ch
-(be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_collocated_ami_handler_ch::~be_visitor_interface_collocated_ami_handler_ch (void)
-{
-}
-
-int
-be_visitor_interface_collocated_ami_handler_ch::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Generate AMI_...name..._Handler string.
- char *ifdef_string = 0;
- ACE_NEW_RETURN (ifdef_string,
- char [ACE_OS::strlen ("AMI_") +
- ACE_OS::strlen (node->flatname ()) +
- ACE_OS::strlen ("_Handler") +
- // end of string
- 1],
- 0);
- ACE_OS::sprintf (ifdef_string,
- "AMI_%s_Handler",
- node->flatname ());
-
- os->gen_ifdef_macro (ifdef_string, "_collocated");
-
- // Prepare the local name for the class.
- char *local_name = 0;
- ACE_NEW_RETURN (local_name,
- char [ACE_OS::strlen ("AMI_") +
- ACE_OS::strlen (node->local_name ()->get_string ()) +
- ACE_OS::strlen ("_Handler") +
- // end of string
- 1],
- 0);
- ACE_OS::sprintf (local_name,
- "AMI_%s_Handler",
- node->local_name ()->get_string ());
-
- // Get the coll names.
- char *coll_local_name, *coll_full_name;
- node->compute_coll_names (local_name, coll_local_name, coll_full_name);
-
- // Output the class defn.
- os->indent ();
- *os << "class " << idl_global->export_macro ()
- << " " << coll_local_name;
- os->incr_indent ();
- *os << " : public virtual " << local_name;
-
- *os << "\n";
- os->decr_indent ();
- *os << "{" << be_nl;
- *os << "public:\n";
- os->incr_indent ();
-
- *os << coll_local_name << " (\n";
-
- os->incr_indent (0);
- os->incr_indent ();
-
- // XXXASG - can we make this a method to return the right name ??
- if (!node->is_nested ())
- {
- // The skeleton name is the outermost, we need to printout the
- // POA_ prefix that goes with it.
- *os << "POA_";
- }
-
- *os << local_name << "_ptr "
- << " servant," << be_nl;
-
- *os << "TAO_Stub *stub\n";
- os->decr_indent ();
- *os << ");\n";
- os->decr_indent (0);
-
- os->indent ();
-
- // _is_a method.
- *os << "virtual CORBA::Boolean _is_a" << be_idt
- << "(" << be_idt_nl
- << "const CORBA::Char *logical_type_id," << be_nl
- << "CORBA_Environment &TAO_IN_ENV = TAO_default_environment ()" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // _get_servant method.
-
- if (!node->is_nested ())
- {
- // The skeleton name is the outermost, we need to printout the
- // POA_ prefix that goes with it.
- *os << "POA_";
- }
-
- *os << local_name
- << "_ptr _get_servant (void) const;" << be_nl << be_nl;
-
- // _non_existent method.
- *os << "virtual CORBA::Boolean _non_existent" << be_idt
- << "(" << be_idt_nl
- << "CORBA_Environment &TAO_IN_ENV = TAO_default_environment ()" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- // Visit the scope to generate all the AMI call back hood methods.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_collocated_ami_handler_ch::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- os->decr_indent ();
-
- *os << be_nl << "private:\n";
- os->incr_indent ();
- if (!node->is_nested ())
- {
- // The skeleton name is the outermost, we need to printout the
- // POA_ prefix that goes with it.
- *os << "POA_";
- }
- *os << local_name << "_ptr servant_;\n";
- os->decr_indent ();
- *os << "};\n\n";
-
- os->gen_endif ();
-
- delete ifdef_string;
- delete local_name;
- delete coll_local_name;
- delete coll_full_name;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_sh.cpp
deleted file mode 100644
index 277da8eece2..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_sh.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// direct_collocated_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for direct_collocated classes for the Interface node
-// inside the server header.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-ACE_RCSID(be_visitor_interface, direct_collocated_sh, "$Id$")
-
-
-// ************************************************************
-// direct_collocated class in header
-// ************************************************************
-
-be_visitor_interface_direct_collocated_sh::be_visitor_interface_direct_collocated_sh
-(be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_direct_collocated_sh::~be_visitor_interface_direct_collocated_sh (void)
-{
-}
-
-int be_visitor_interface_direct_collocated_sh::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- os->gen_ifdef_macro (node->flatname (), "_direct_collocated");
-
- // output the class defn
- os->indent ();
- *os << "class " << idl_global->export_macro ()
- << " " << node->local_coll_name (be_interface::DIRECT);
- os->incr_indent ();
- *os << " : public virtual " << node->name ();
-
- // generate base classes if any
- if (node->n_inherits () > 0)
- {
- for (int i = 0; i < node->n_inherits (); ++i)
- {
- *os << "," << be_nl;
- be_interface* parent =
- be_interface::narrow_from_decl (node->inherits()[i]);
- *os << " public virtual "
- << be_interface::relative_name (parent->full_coll_name (be_interface::DIRECT),
- node->full_coll_name (be_interface::DIRECT));
- }
- }
- *os << "\n";
- os->decr_indent ();
- *os << "{" << be_nl;
- *os << "public:\n";
- os->incr_indent ();
-
- *os << node->local_coll_name (be_interface::DIRECT) << " (\n";
-
- os->incr_indent (0);
- os->incr_indent ();
-
- // XXXASG - can we make this a method to return the right name ??
- if (!node->is_nested ())
- {
- // The skeleton name is the outermost, we need to printout the
- // POA_ prefix that goes with it.
- *os << "POA_";
- }
-
- *os << node->local_name () << "_ptr "
- << " servant," << be_nl;
-
- *os << "TAO_Stub *stub\n";
- os->decr_indent ();
- *os << ");\n";
- os->decr_indent (0);
-
- os->indent ();
-
- *os << "virtual CORBA::Boolean _is_a" << be_idt
- << "(" << be_idt_nl
- << "const CORBA::Char *logical_type_id," << be_nl
- << "CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- if (!node->is_nested ())
- {
- // The skeleton name is the outermost, we need to printout the
- // POA_ prefix that goes with it.
- *os << "POA_";
- }
-
- *os << node->local_name ()
- << "_ptr _get_servant (void) const;" << be_nl << be_nl;
-
- *os << "virtual CORBA::Boolean _non_existent" << be_idt
- << "(" << be_idt_nl
- << "CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_direct_collocated_sh::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- os->decr_indent ();
-
- *os << be_nl << "private:\n";
- os->incr_indent ();
- if (!node->is_nested ())
- {
- // The skeleton name is the outermost, we need to printout the
- // POA_ prefix that goes with it.
- *os << "POA_";
- }
- *os << node->local_name () << "_ptr servant_;\n";
- os->decr_indent ();
- *os << "};\n\n";
-
- os->gen_endif ();
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_ss.cpp
deleted file mode 100644
index 46e690ae815..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_ss.cpp
+++ /dev/null
@@ -1,173 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// direct_collocated_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for direct_collocated classes for an Interface in the
-// server skeleton file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-ACE_RCSID(be_visitor_interface, direct_collocated_ss, "$Id$")
-
-
-// ************************************************************
-// be_visitor_interface_collacted_ss
-// ************************************************************
-
-be_visitor_interface_direct_collocated_ss::be_visitor_interface_direct_collocated_ss
-(be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_direct_collocated_ss::~be_visitor_interface_direct_collocated_ss (void)
-{
-}
-
-int be_visitor_interface_direct_collocated_ss::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = tao_cg->server_skeletons ();
-
- this->ctx_->node (node);
-
- *os << node->full_coll_name (be_interface::DIRECT) << "::"
- << node->local_coll_name (be_interface::DIRECT) << " (\n";
-
- os->incr_indent (0);
- os->incr_indent ();
- *os << node->full_skel_name () << "_ptr "
- << " servant," << be_nl;
-
- *os << "TAO_Stub *stub\n";
- os->decr_indent ();
- *os << ")\n";
- os->decr_indent (0);
-
- os->incr_indent ();
-
- if (node->is_nested ())
- {
- be_decl* scope =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
-
- *os << ": ACE_NESTED_CLASS ("
- << scope->name () << ","
- << node->local_name ()
- << ") ()," << be_nl;
- }
- else
- {
- *os << ": " << node->name ()
- << " ()," << be_nl;
- }
-
- // @@ We should call the constructor for all base classes, since we
- // are using multiple inheritance.
-
- if (node->traverse_inheritance_graph (be_visitor_interface_direct_collocated_ss::collocated_ctor_helper, os)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_direct_collocated_ss::"
- "visit_interface - "
- "codegen for base class ctor init failed\n"),
- -1);
- }
-
- *os << " CORBA_Object (stub, servant, 1)," << be_nl
- << " servant_ (servant)";
-
- *os << "\n";
- os->decr_indent ();
- *os << "{\n";
- *os << "}\n\n";
-
- os->indent ();
-
- // Generate _is_a implementation.
- *os << "CORBA::Boolean " << node->full_coll_name (be_interface::DIRECT) << "::"
- << "_is_a" << be_idt
- << "(" << be_idt_nl
- << "const CORBA::Char *logical_type_id," << be_nl
- << "CORBA_Environment &ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt_nl << be_nl;
- *os << "{" << be_idt_nl
- << "return this->servant_->_is_a (logical_type_id, ACE_TRY_ENV);" << be_uidt_nl
- << "}\n\n" << be_uidt_nl;
-
- // Generate _get_servant implementation.
- *os << node->full_skel_name () << "_ptr "
- << node->full_coll_name (be_interface::DIRECT) << "::"
- << "_get_servant (void) const\n"
- << "{\n";
- os->incr_indent ();
- *os << "return this->servant_;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- os->indent ();
-
- // Generate _non_existent implementation.
- *os << "CORBA::Boolean " << node->full_coll_name (be_interface::DIRECT) << "::"
- << "_non_existent" << be_idt
- << "(" << be_idt_nl
- << "CORBA_Environment &ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt_nl << be_nl;
- *os << "{" << be_idt_nl
- << "return this->servant_->_non_existent (ACE_TRY_ENV);" << be_uidt_nl
- << "}\n\n" << be_uidt_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);
- }
-
- return 0;
-}
-
-int
-be_visitor_interface_direct_collocated_ss::collocated_ctor_helper (be_interface *derived,
- be_interface *base,
- TAO_OutStream *os)
-{
- if (derived == base)
- // we are the same. Don't do anything, otherwise we will end up calling
- // ourself
- return 0;
-
- if (base->is_nested ())
- {
- be_decl *scope;
- scope = be_scope::narrow_from_scope (base->defined_in ())->decl ();
- *os << " ACE_NESTED_CLASS (POA_" << scope->name () << ","
- << base->local_coll_name (be_interface::DIRECT) << ") (servant, stub)," << be_nl;
- }
- else
- {
- *os << " " << base->full_coll_name (be_interface::DIRECT) << " (servant, stub)," << be_nl;
- }
-
- return 0;
-}
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 b9b7d3ba804..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp
+++ /dev/null
@@ -1,793 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces. This is a generic visitor.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-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;
-}
-
-// =all common visit methods for interface visitor
-
-// visit an attribute
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CS:
- ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_SH:
- ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_SH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_IH:
- ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_IH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_SS:
- ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_SS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_IS:
- ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_IS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH:
- ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH:
- ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS:
- ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS:
- ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
- ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_TIE_SH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
- ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI);
- break;
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH:
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS:
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH:
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI:
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS:
- case TAO_CodeGen::TAO_INTERFACE_CI:
- case TAO_CodeGen::TAO_INTERFACE_SI:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_attribute - "
- "Bad context state\n"),
- -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_attribute - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_attribute - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit a constant
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_CONSTANT_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CS:
- ctx.state (TAO_CodeGen::TAO_CONSTANT_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH:
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS:
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH:
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI:
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS:
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH:
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS:
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH:
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS:
- case TAO_CodeGen::TAO_INTERFACE_CI:
- case TAO_CodeGen::TAO_INTERFACE_SH:
- case TAO_CodeGen::TAO_INTERFACE_IH:
- case TAO_CodeGen::TAO_INTERFACE_IS:
- case TAO_CodeGen::TAO_INTERFACE_SI:
- case TAO_CodeGen::TAO_INTERFACE_SS:
- case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
- case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_constant - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_constant - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_constant - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-//visit an enum
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_ENUM_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CS:
- ctx.state (TAO_CodeGen::TAO_ENUM_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_ENUM_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_ENUM_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CI:
- case TAO_CodeGen::TAO_INTERFACE_SH:
- case TAO_CodeGen::TAO_INTERFACE_IH:
- case TAO_CodeGen::TAO_INTERFACE_IS:
- case TAO_CodeGen::TAO_INTERFACE_SI:
- case TAO_CodeGen::TAO_INTERFACE_SS:
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH:
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS:
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH:
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS:
- case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
- case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_enum - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_enum - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_enum - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- 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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CI:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CI);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CS:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_SH:
- case TAO_CodeGen::TAO_INTERFACE_IH:
- case TAO_CodeGen::TAO_INTERFACE_IS:
- case TAO_CodeGen::TAO_INTERFACE_SI:
- case TAO_CodeGen::TAO_INTERFACE_SS:
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH:
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS:
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH:
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS:
- case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
- case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_exception - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_exception - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_exception - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- 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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_SH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_SH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_IH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_IH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_SS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_SS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_IS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_IS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
- ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SI);
- break;
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS);
- break;
-
- case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CH:
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_OPERATION_CH);
- break;
-
- case TAO_CodeGen::TAO_AMI_HANDLER_STUB_CH:
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_STUB_OPERATION_CH);
- break;
-
- case TAO_CodeGen::TAO_AMI_HANDLER_STUB_CS:
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_STUB_OPERATION_CS);
- break;
-
- case TAO_CodeGen::TAO_COLLOCATED_AMI_HANDLER_CH:
- ctx.state (TAO_CodeGen::TAO_COLLOCATED_AMI_HANDLER_OPERATION_CH);
- break;
-
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH:
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS:
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH:
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI:
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS:
- case TAO_CodeGen::TAO_INTERFACE_CI:
- case TAO_CodeGen::TAO_INTERFACE_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);
- }
- }
-
- // 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);
- }
-
- // visit the node using this visitor
- 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;
-
- //
- // AMI Call back code generation.
- //
-
- // Return if AMI call back is not enabled.
- if (idl_global->ami_call_back () != I_TRUE)
- {
- return 0;
- }
-
- // Generate AMI <sendc_> method, for this operation, if you are
- // doing client header.
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_AMI_CH);
- break;
-
- case TAO_CodeGen::TAO_INTERFACE_CS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_AMI_CS);
- break;
-
- default:
- // We dont have to do anything for the other cases.
- return 0;
- }
-
- // 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);
- }
-
- // Visit the node using this visitor
- 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;
-
- return 0;
-}
-
-// Visit an structure.
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CI:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CI);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_SH:
- case TAO_CodeGen::TAO_INTERFACE_IH:
- case TAO_CodeGen::TAO_INTERFACE_IS:
- case TAO_CodeGen::TAO_INTERFACE_SI:
- case TAO_CodeGen::TAO_INTERFACE_SS:
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH:
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS:
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH:
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS:
- case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
- case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_structure - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_structure - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_structure - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit a union
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CI:
- ctx.state (TAO_CodeGen::TAO_UNION_CI);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_SH:
- case TAO_CodeGen::TAO_INTERFACE_IH:
- case TAO_CodeGen::TAO_INTERFACE_IS:
- case TAO_CodeGen::TAO_INTERFACE_SI:
- case TAO_CodeGen::TAO_INTERFACE_SS:
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH:
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS:
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH:
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS:
- case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
- case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_union - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_union - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_union - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit a typedef
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CI:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CI);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CS:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_INTERFACE_SH:
- case TAO_CodeGen::TAO_INTERFACE_IH:
- case TAO_CodeGen::TAO_INTERFACE_IS:
- case TAO_CodeGen::TAO_INTERFACE_SI:
- case TAO_CodeGen::TAO_INTERFACE_SS:
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH:
- case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS:
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH:
- case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS:
- case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
- case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_typedef - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_typedef - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_typedef - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- 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 805b95c7bd8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp
+++ /dev/null
@@ -1,348 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
- long i; // loop index
-
- if (!node->cli_hdr_gen () && !node->imported ()) // not already generated and
- // not imported
- {
- // Generate the AMI Reply Handler's forward declaration code, if
- // the option is enabled, for this interface.
-
- if (idl_global->ami_call_back () == I_TRUE)
- {
- // Set the context.
- be_visitor_context ctx (*this->ctx_);
-
- // Set the state.
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_FWD_CH);
-
- // Create the visitor.
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "Bad visitor\n"),
- -1);
- }
-
- // call the visitor on this interface.
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "code gen for ami handler fwd failed\n"),
- -1);
- }
- delete visitor;
- }
-
- // Grab the stream.
- os = this->ctx_->stream ();
-
- // == STEP 1: generate the class name and class names we inherit ==
-
- // generate the ifdefined macro for the _ptr type
- os->gen_ifdef_macro (node->flatname (), "_ptr");
-
-
- // the following two are required to be under the ifdef macro to avoid
- // multiple declarations
-
- os->indent (); // start with whatever indentation level we are at
- // forward declaration
- *os << "class " << node->local_name () << ";" << be_nl;
- // generate the _ptr declaration
- *os << "typedef " << node->local_name () << " *" << node->local_name ()
- << "_ptr;" << be_nl;
-
- os->gen_endif ();
-
- // generate the ifdefined macro for the var type
- os->gen_ifdef_macro (node->flatname (), "_var");
-
- // generate the _var declaration
- if (node->gen_var_defn () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "codegen for _var failed\n"), -1);
- }
- os->gen_endif ();
-
- // generate the ifdef macro for the _out class
- os->gen_ifdef_macro (node->flatname (), "_out");
-
- // generate the _out declaration - ORBOS/97-05-15 pg 16-20 spec
- if (node->gen_out_defn () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "codegen for _out failed\n"), -1);
- }
- // generate the endif macro
- os->gen_endif ();
-
- // now the interface definition itself
- os->gen_ifdef_macro (node->flatname ());
-
- // now generate the class definition
- *os << "class " << idl_global->export_macro ()
- << " " << node->local_name ();
-
- if (node->n_inherits () > 0) // node interface inherits from other
- // interfaces
- {
- *os << ": ";
- 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 << "public virtual ";
- *os << inherited->nested_type_name (scope); // dump the scoped name
- if (i < node->n_inherits () - 1) // node is the case of multiple
- // inheritance, so put a comma
- {
- *os << ", ";
- }
- } // end of for loop
- *os << be_nl;
- }
- else
- {
- // we do not inherit from anybody, hence we do so from the base
- // CORBA::Object class
- // Generate code that uses the macro. This is required to deal with
- // the MSVC++ insanity
- *os << " : public virtual ACE_CORBA_1 (Object)" << be_nl;
- }
-
- // generate the body
-
- *os << "{" << be_nl
- << "public:" << be_nl
-
- // generate the _ptr_type and _var_type typedefs
- // but we must protect against certain versions of g++
- << "#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8"
- << be_idt_nl
- << "typedef " << node->local_name () << "_ptr _ptr_type;" << be_nl
- << "typedef " << node->local_name () << "_var _var_type;" << be_uidt_nl
- << "#endif /* __GNUC__ */\n" << be_idt_nl
-
- // generate the static _duplicate, _narrow, and _nil operations
- << "// the static operations" << be_nl
- << "static " << node->local_name () << "_ptr " << "_duplicate ("
- << node->local_name () << "_ptr obj);" << be_nl
- << "static " << node->local_name () << "_ptr "
- << "_narrow (" << be_idt << be_idt_nl
- << "CORBA::Object_ptr obj," << be_nl
- << "CORBA::Environment &env = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl
- << "static " << node->local_name () << "_ptr "
- << "_unchecked_narrow (" << be_idt << be_idt_nl
- << "CORBA::Object_ptr obj," << be_nl
- << "CORBA::Environment &env = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");" << be_uidt_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 (" << node->name () << "_ptr)0;" << be_uidt_nl
- << "}" << be_uidt << "\n\n";
-
-
- // 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);
- }
- // the _is_a method
- os->indent ();
- *os << "virtual CORBA::Boolean _is_a (" << be_idt << be_idt_nl
- << "const CORBA::Char *type_id, " << be_nl
- << "CORBA::Environment &env = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl
- << "virtual const char* "
- << "_interface_repository_id (void) const;\n" << be_uidt_nl;
-
- // generate the "protected" constructor so that users cannot instantiate
- // us
- *os << "protected:" << be_idt_nl
- << node->local_name () << " (void);" << be_nl
- << node->local_name ()
- << " (TAO_Stub *objref, " << be_idt << be_idt_nl
- << "TAO_ServantBase *_tao_servant = 0, " << be_nl
- << "CORBA::Boolean _tao_collocated = 0" << be_uidt_nl
- << ");" << be_uidt_nl
- << "virtual ~" << node->local_name () << " (void);" << be_uidt_nl;
-
- // private copy constructor and assignment operator. These are not
- // allowed, hence they are private.
- *os << "private:\n";
- os->incr_indent ();
- *os << node->local_name () << " (const " << node->local_name () << " &);"
- << be_nl
- << "void operator= (const " << node->local_name () << " &);\n";
-
- os->decr_indent ();
- *os << "};\n\n";
- os->gen_endif ();
-
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- be_visitor *visitor;
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DECL);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "TypeCode declaration failed\n"
- ), -1);
- }
-
- // AMI
-
- // Generate code for the AMI Reply Handler.
-
- if (idl_global->ami_call_back () == I_TRUE)
- {
- // = Generate the default stub code for Handler.
-
- // Set the context.
- be_visitor_context ctx (*this->ctx_);
-
- // Set the state.
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_STUB_CH);
-
- // Create the visitor.
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "Bad visitor\n"),
- -1);
- }
-
- // Call the visitor on this interface.
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "code gen for ami handler default stub failed\n"),
- -1);
- }
- delete visitor;
-
- // = Generate the Servant Skeleton code.
-
- // Set the context.
- ctx = *this->ctx_;
-
- // Set the state.
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CH);
-
- // Create the visitor.
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "Bad visitor\n"),
- -1);
- }
-
- // call the visitor on this interface.
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "code gen for ami handler failed\n"),
- -1);
- }
- delete visitor;
- }
-
- node->cli_hdr_gen (I_TRUE);
- } // if !cli_hdr_gen
- return 0;
-}
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 c3f77bab5fc..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the client inline file
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
-
- if (node->cli_inline_gen () || node->imported ())
- return 0;
-
- os = this->ctx_->stream ();
-
- os->indent (); // start from the current indentation level
-
- // generate the constructors and destructor
- *os << "ACE_INLINE" << be_nl;
- *os << node->name () << "::" << node->local_name () <<
- " (void) // default constructor" << be_nl;
- *os << "{}" << be_nl << be_nl;
-
- *os << "ACE_INLINE" << be_nl;
- *os << node->name () << "::" << node->local_name () <<
- " (TAO_Stub *objref, TAO_ServantBase *_tao_servant, "
- << "CORBA::Boolean _tao_collocated) // constructor" << be_nl;
- *os << " : CORBA_Object (objref, _tao_servant, _tao_collocated)" << be_nl;
- *os << "{}" << be_nl << be_nl;
-
- *os << "ACE_INLINE" << be_nl;
- *os << node->name () << "::~" << node->local_name () <<
- " (void) // destructor" << be_nl;
- *os << "{}\n\n";
-
- // generate the ifdefined macro for the _var type
- os->gen_ifdef_macro (node->flatname (), "_var");
- if (node->gen_var_impl () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ci::"
- "visit_interface - "
- "codegen for _var failed\n"), -1);
- }
- os->gen_endif ();
-
- // generate the ifdefined macro for the _out type
- os->gen_ifdef_macro (node->flatname (), "_out");
- if (node->gen_out_impl () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ci::"
- "visit_interface - "
- "codegen for _out failed\n"), -1);
- }
- os->gen_endif ();
-
- // Generate inline methods for elements of our scope
- 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);
- }
-
- // If AMI is enabled, generate all the inline stuff for the
- // AMI_<interface_name>_Handler interface.
-
- if (idl_global->ami_call_back () == I_TRUE)
- {
- // Set the context.
- be_visitor_context ctx (*this->ctx_);
-
- // Set the state.
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_FWD_CI);
-
- // Create the visitor.
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ci::"
- "visit_interface - "
- "Bad visitor\n"),
- -1);
- }
-
- // Call the visitor on this interface.
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_ch::"
- "visit_interface - "
- "code gen for ami handler fwd failed\n"),
- -1);
- }
- delete visitor;
- }
-
- 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 ba5f7a2ba07..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
+++ /dev/null
@@ -1,244 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the client stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
-
- if (node->cli_stub_gen () || node->imported ())
- return 0;
-
- os = this->ctx_->stream ();
-
- os->indent (); // start with whatever indentation level we are at
-
- // first generate the code for the static methods
-
- // The _narrow method
- *os << node->name () << "_ptr " << node->name ()
- << "::_narrow (" << be_idt << be_idt_nl
- << "CORBA::Object_ptr obj," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "if (CORBA::is_nil (obj))" << be_idt_nl
- << "return " << node->name () << "::_nil ();" << be_uidt_nl
- << "CORBA::Boolean is_a = obj->_is_a (\""
- << node->repoID () << "\", ACE_TRY_ENV);" << be_nl
- << "ACE_CHECK_RETURN (" << node->name () << "::_nil ());" << be_nl
- << "if (is_a == 0)" << be_idt_nl
- << "return " << node->name () << "::_nil ();" << be_uidt_nl;
-
- *os << "return " << node->name ()
- << "::_unchecked_narrow (obj, ACE_TRY_ENV);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // This may be necessary to work around a GCC compiler bug!
-// const char *skel_name = node->full_skel_name (); // unused at this time
-// const char *coll_name = node->full_coll_name ();
-// assert (coll_name != 0);
-
- // The _unchecked_narrow method
- *os << node->name () << "_ptr " << node->name ()
- << "::_unchecked_narrow (" << be_idt << be_idt_nl
- << "CORBA::Object_ptr obj," << be_nl
- << "CORBA::Environment &" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "if (CORBA::is_nil (obj))" << be_idt_nl
- << "return " << node->name () << "::_nil ();" << be_uidt_nl;
-
- *os << "TAO_Stub* stub = obj->_stubobj ();" << be_nl
- << "stub->_incr_refcnt ();" << be_nl;
-
- *os << "if (obj->_is_collocated () && _TAO_collocation_" << node->flatname ()
- << "_Stub_Factory_function_pointer != 0)" << be_idt_nl
- << "{" << be_idt_nl
- << node->local_name () << "_ptr retv = _TAO_collocation_"
- << node->flatname ()
- << "_Stub_Factory_function_pointer (obj);" << be_nl
- << "if (retv != 0)" << be_idt_nl
- << "return retv;" << be_uidt << be_uidt_nl
- << "}" << be_uidt_nl;
-
- *os << "return new " << node->name () << "(stub);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // The _duplicate method
- *os << node->name () << "_ptr " << be_nl
- << node->name () << "::_duplicate ("
- << node->name () << "_ptr obj)" << be_nl
- << "{" << be_idt_nl
- << "if (!CORBA::is_nil (obj))" << be_idt_nl
- << "obj->_incr_refcnt ();" << be_uidt_nl
- << "return obj;" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // 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);
- }
-
- // generate the is_a method
- os->indent ();
- *os << "CORBA::Boolean " << node->name () << "::_is_a (" <<
- "const CORBA::Char *value, CORBA::Environment &ACE_TRY_ENV)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "if (\n";
- os->incr_indent (0);
- if (node->traverse_inheritance_graph (be_interface::is_a_helper, os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_cs::"
- "visit_interface - "
- "_is_a method codegen failed\n"), -1);
- }
-
- os->indent ();
- *os << "(!ACE_OS::strcmp ((char *)value, \"IDL:omg.org/CORBA/Object:1.0\")))\n";
- *os << " return 1; // success using local knowledge\n";
- os->decr_indent ();
- *os << "else" << be_nl;
- *os << " return this->CORBA_Object::_is_a (value, ACE_TRY_ENV);\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- os->indent ();
- *os << "const char* " << node->name ()
- << "::_interface_repository_id (void) const"
- << be_nl
- << "{" << be_idt_nl
- << "return \"" << node->repoID () << "\";" << be_uidt_nl
- << "}\n\n";
-
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- be_visitor *visitor;
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DEFN);
- ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_cs::"
- "visit_interface - "
- "TypeCode definition failed\n"),
- -1);
- }
-
- // AMI
-
- // Generate code for the AMI Reply Handler.
- if (idl_global->ami_call_back () == I_TRUE)
- {
- // = Generate the default stub code for Handler.
-
- // Set the context.
- be_visitor_context ctx (*this->ctx_);
-
- // Set the state.
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_STUB_CS);
-
- // Create the visitor.
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_cs::"
- "visit_interface - "
- "Bad visitor\n"),
- -1);
- }
-
- // Call the visitor on this interface.
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_cs::"
- "visit_interface - "
- "code gen for ami handler default stub failed\n"),
- -1);
- }
- delete visitor;
-
- // = Generate the Servant Skeleton code.
- // Set the context.
- ctx = *this->ctx_;
-
- // Set the state.
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CS);
-
- // Create the visitor.
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_cs::"
- "visit_interface - "
- "Bad visitor\n"),
- -1);
- }
-
- // Call the visitor on this interface.
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_cs::"
- "visit_interface - "
- "code gen for ami handler failed\n"),
- -1);
- }
- delete visitor;
- }
-
- 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 bbed2526a80..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp
+++ /dev/null
@@ -1,157 +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)
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
- long i; // loop index
- static char namebuf [NAMEBUFSIZE]; // holds the class name
-
-
- if (node->impl_hdr_gen () || node->imported ())
- return 0;
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
-
- os = this->ctx_->stream ();
-
- // generate the skeleton class name
-
- os->indent (); // start with whatever indentation level we are at
-
-
- ACE_OS::sprintf (namebuf, "%s", node->flatname ());
-
- *os << "//Class " << idl_global->impl_class_prefix ()<<namebuf << idl_global->impl_class_suffix ()<< be_nl;
- // now generate the class definition
- *os << "class " << idl_global->export_macro ()
- << " " <<idl_global->impl_class_prefix () << namebuf << idl_global->impl_class_suffix () << " : ";
- /*
- if (node->n_inherits () > 0)
- {
- // this interface inherits from other interfaces
- be_interface *intf; // inherited interface
-
-
- *os << "public virtual ";
-
- intf = be_interface::narrow_from_decl (node->inherits ()[0]);
- *os << idl_global->impl_class_prefix () << intf->flatname () << idl_global->impl_class_suffix ();//intf->relative_skel_name (node->full_skel_name ());
- for (i = 1; i < node->n_inherits (); i++)
- {
- *os << ", public virtual ";
- intf = be_interface::narrow_from_decl (node->inherits ()[i]);
- *os << idl_global->impl_class_prefix () <<intf->flatname () << idl_global->impl_class_suffix ();//intf->relative_skel_name (node->full_skel_name ());
- } // end of for loop
-
- //inherit from the base skeleton file
- *os<<", public virtual "<<node->full_skel_name ();
- }
-
- else
- {
- */
- //inherit from the base skeleton file
- *os<<"public virtual "<<node->full_skel_name ();
- // }
-
-
- *os << be_nl
- << "{" << be_nl
- << "public:" << be_idt_nl
- << "//Constructor " << be_nl
- << idl_global->impl_class_prefix () << namebuf << idl_global->impl_class_suffix () << " (void);" << be_nl << be_nl;
-
- if (idl_global->gen_copy_ctor ())
- {
- *os << "//Copy Constructor"<<be_nl
- << idl_global->impl_class_prefix () << namebuf << idl_global->impl_class_suffix () << " (const "
- << idl_global->impl_class_prefix () << namebuf << idl_global->impl_class_suffix () << "&);" <<be_nl <<be_nl;
- }
-
- if (idl_global->gen_assign_op ())
- {
- *os << "//Copy Assignment" << be_nl
- << idl_global->impl_class_prefix () << namebuf << idl_global->impl_class_suffix () << "& "
- << "operator=(const " << idl_global->impl_class_prefix () << namebuf << idl_global->impl_class_suffix () << "&);"<<be_nl << be_nl;
-
- }
-
- *os << "//Destructor " << be_nl
- << "virtual " << "~" << idl_global->impl_class_prefix () << namebuf << idl_global->impl_class_suffix () << " (void);" << 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_ih::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- if (node->n_inherits () > 0)
- {
- // this interface inherits from other interfaces
- be_interface *intf; // inherited interface
-
- for (i = 0; i < node->n_inherits (); i++)
- {
- intf = be_interface::narrow_from_decl (node->inherits ()[i]);
- // generate code for elements in the scope (e.g., operations)
- if (this->visit_scope (intf) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ih::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
- }
-
- }
-
- *os << "};" << be_nl <<be_nl;
- 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 6cb7079661e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp
+++ /dev/null
@@ -1,145 +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)
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-
-// ************************************************************
-// 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)
-{
- TAO_OutStream *os; // output stream
-
- if (node->impl_skel_gen () || node->imported ())
- return 0;
-
- os = this->ctx_->stream ();
-
- // generate the skeleton class name
-
- os->indent (); // start with whatever indentation level we are at
-
-
- // constructor
- *os << "// Implementation skeleton constructor" << be_nl;
- // find if we are at the top scope or inside some module
- *os << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () <<"::" << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () <<
- " (void)" << be_idt_nl;
-
-
- if(node->n_inherits () >0)
- {
- //generate the default constructors of all the base classes
- node->gen_def_ctors(os);
- }
- *os << "{" << be_nl
- << "}" << be_nl << be_uidt_nl;
-
- // destructor
- os->indent ();
- *os << "// Implementation skeleton destructor" << be_nl;
-
- *os << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () <<"::~" << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () <<
- " (void)" << be_idt_nl;
-
- *os << "{" <<be_nl;
- *os << "}" << be_nl <<be_uidt_nl;
-
- if (idl_global->gen_copy_ctor () )
- {
- *os << "//Implementation Skeleton Copy Constructor" << be_nl;
-
- *os <<idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () <<"::"
- << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () << " (const "
- << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () << "& t)"<< be_idt_nl;
- if(node->n_inherits () >0)
- {
- node->gen_copy_ctors(os);
- *os << ", TAO_ServantBase (t)" << be_nl;
- }
- *os << "{" << be_nl
- << "}" << be_nl << be_uidt_nl;
- }
-
- if (idl_global->gen_assign_op ())
- {
- *os << "//Implementation Skeleton Copy Assignment" << be_nl;
-
- *os << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () << "& "
- << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () << "::operator=(const "
- << idl_global->impl_class_prefix () << node->flatname () << idl_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);
- }
-
- if (node->n_inherits () > 0)
- {
- // this interface inherits from other interfaces
- be_interface *intf; // inherited interface
-
- for (int i = 0; i < node->n_inherits (); i++)
- {
- intf = be_interface::narrow_from_decl (node->inherits ()[i]);
- // generate code for elements in the scope (e.g., operations)
- if (this->visit_scope (intf) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ih::"
- "visit_interface - "
- "codegen for scope failed\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 a12411dae6d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
+++ /dev/null
@@ -1,239 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the server header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
- long i; // loop index
- static char namebuf [NAMEBUFSIZE]; // holds the class name
-
- if (node->srv_hdr_gen () || node->imported ())
- return 0;
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
-
- os = this->ctx_->stream ();
-
- // generate the skeleton class name
-
- os->indent (); // start with whatever indentation level we are at
-
- // we shall have a POA_ prefix only if we are at the topmost level
- if (!node->is_nested ())
- {
- // we are outermost
- ACE_OS::sprintf (namebuf, "POA_%s", node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (namebuf, "%s", node->local_name ()->get_string ());
- }
-
- *os << "class " << namebuf << ";" << be_nl;
-
- // generate the _ptr declaration
- *os << "typedef " << namebuf << " *" << namebuf
- << "_ptr;" << be_nl;
-
- // now generate the class definition
- *os << "class " << idl_global->export_macro ()
- << " " << namebuf << " : ";
- if (node->n_inherits () > 0)
- {
- // this interface inherits from other interfaces
- be_interface *intf; // inherited interface
-
- *os << "public virtual ";
- intf = be_interface::narrow_from_decl (node->inherits ()[0]);
- *os << intf->relative_skel_name (node->full_skel_name ());
- for (i = 1; i < node->n_inherits (); i++)
- {
- *os << ", public virtual ";
- intf = be_interface::narrow_from_decl (node->inherits ()[i]);
- *os << intf->relative_skel_name (node->full_skel_name ());
- } // end of for loop
- }
- 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_nl
- << "{" << be_nl
- << "protected:" << be_idt_nl
- << namebuf << " (void);\n" << be_uidt_nl
- << "public:" << be_idt_nl
- << namebuf << " (const " << namebuf << "& rhs);" << be_nl
- << "virtual ~" << namebuf << " (void);\n\n";
-
- *os << be_nl
- << "virtual CORBA::Boolean _is_a (" << be_idt << be_idt_nl
- << "const char* logical_type_id," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- *os << "virtual void* _downcast (" << be_idt << be_idt_nl
- << "const char* logical_type_id" << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // add a skeleton for our _is_a method
- *os << "static void _is_a_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *context," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // add a skeleton for our _non_existent method
- *os << "static void _non_existent_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &req," << be_nl
- << "void *obj," << be_nl
- << "void *context," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // add the dispatch method
- *os << "virtual void _dispatch (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &_tao_req," << be_nl
- << "void *_tao_context," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // Print out the _this() method.
- *os << node->name () << " *_this (" << be_idt << be_idt_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
-
- // the _interface_repository_id method.
- *os << "virtual const char* _interface_repository_id "
- << "(void) const;\n\n";
-
- // 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.
- if (node->traverse_inheritance_graph (be_interface::gen_skel_helper, os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_sh::"
- "visit_interface - "
- "inheritance graph traversal failed\n"),
- -1);
- }
-
-
- *os << be_uidt_nl << "};\n\n";
-
- be_visitor_context ctx (*this->ctx_);
- be_visitor *visitor = 0;
-
- // generate the collocated class
- if (idl_global->gen_thru_poa_collocation ())
- {
- ctx.state (TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_sh::"
- "visit_interface - "
- "codegen for thru_poa_collocated class failed\n"),
- -1);
- }
- }
-
- if (idl_global->gen_direct_collocation ())
- {
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_sh::"
- "visit_interface - "
- "codegen for direct_collocated class failed\n"),
- -1);
- }
- }
-
- // generate the TIE class.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_INTERFACE_TIE_SH);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_sh::"
- "visit_interface - "
- "codegen for TIE class failed\n"),
- -1);
- }
-
- *os << "\n";
- ctx.stream (tao_cg->server_template_header ());
-
- 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 6ac012bab0a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface_si.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interfaces in the server inline file
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
-
- if (node->srv_inline_gen () || node->imported ())
- return 0;
-
- os = this->ctx_->stream ();
-
- // determine if we are in some form of a multiple inheritance
- if (node->traverse_inheritance_graph
- (be_interface::in_mult_inheritance_helper, 0) == -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
- if (node->traverse_inheritance_graph (be_interface::gen_skel_helper, os)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_si::"
- "visit_interface - "
- "codegen for base class skeletons failed\n"), -1);
- }
-
- // generate the TIE class
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_INTERFACE_TIE_SI);
- ctx.stream (tao_cg->server_template_inline ());
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_sh::"
- "visit_interface - "
- "codegen for TIE class failed\n"),
- -1);
- }
-
- 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 4443ca6472d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
+++ /dev/null
@@ -1,424 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.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)
-{
- TAO_OutStream *os; // output stream
-
- if (node->srv_skel_gen () || node->imported ())
- return 0;
-
- os = this->ctx_->stream ();
-
- // generate the skeleton class name
-
- os->indent (); // start with whatever indentation level we are at
-
- if (node->gen_operation_table () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss::"
- "visit_interface - "
- "codegen for operation table failed\n"),
- -1);
- }
-
- // Collocation function pointer initializer.
- *os << node->name () << "_ptr _TAO_collocation_POA_"
- << node->flatname () << "_Stub_Factory (" << be_idt << be_idt_nl
- << "CORBA::Object_ptr obj" << be_uidt_nl
- << ")\n";
-
- os->incr_indent (0);
- *os << "{" << be_idt_nl
- << "TAO_Stub *stub = obj->_stubobj ();" << be_nl << be_nl
- << "switch (stub->servant_orb_var ()->orb_core"
- << " ()->get_collocation_strategy ())" << be_idt_nl
- << "{" << be_nl << "case TAO_ORB_Core::THRU_POA:" << be_idt_nl;
-
- if (idl_global->gen_thru_poa_collocation ())
- *os << "return new " << node->full_coll_name (be_interface::THRU_POA)
- << " (stub);" << be_uidt_nl;
- else
- *os << "break;" << be_uidt_nl;
-
- *os << "case TAO_ORB_Core::DIRECT:" << be_idt_nl;
-
- if (idl_global->gen_direct_collocation ())
- *os << "{" << be_idt_nl
- << "void *servant = ACE_reinterpret_cast (void*, obj->_servant ());" << be_nl
- << "if (servant != 0)" << be_idt_nl
- << "return new " << node->full_coll_name (be_interface::DIRECT)
- << " (ACE_reinterpret_cast (" << node->full_skel_name ()
- << "*, servant), stub);" << be_uidt << be_uidt_nl
- << "}" << be_uidt_nl;
-
- *os << "break;" << be_uidt_nl
- << "default:" << be_idt_nl
- << "break;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "return 0;" << be_uidt_nl
- << "}\n\n";
-
- *os << "int _TAO_collocation_POA_" << node->flatname ()
- << "_Stub_Factory_Initializer"
- << " (long dummy)" << be_nl
- << "{" << be_idt_nl
- << "ACE_UNUSED_ARG (dummy);" << be_nl << be_nl
- << "_TAO_collocation_" << node->flatname ()
- << "_Stub_Factory_function_pointer = " << be_idt_nl
- << "_TAO_collocation_POA_" << node->flatname ()
- << "_Stub_Factory;" << be_uidt_nl << be_nl
- << "return 0;" << be_uidt_nl << "}\n\n";
-
- *os << "static int _TAO_collocation_POA_" << node->flatname ()
- << "_Stub_Factory_Initializer_Scarecrow = " << be_idt_nl
- << "_TAO_collocation_POA_" << node->flatname ()
- << "_Stub_Factory_Initializer (ACE_reinterpret_cast "
- << "(long, _TAO_collocation_POA_"
- << node->flatname () << "_Stub_Factory_Initializer));"
- << be_uidt_nl;
-
- os->incr_indent (0);
-
- // constructor
- *os << "// skeleton constructor" << be_nl;
- // find if we are at the top scope or inside some module
- if (!node->is_nested ())
- {
- // we are outermost. So the POA_ prefix is prepended to our name
- *os << node->full_skel_name () << "::POA_" << node->local_name () <<
- " (void)" << be_nl;
- }
- else
- {
- // the POA_ prefix is prepended to our outermost module name
- *os << node->full_skel_name () << "::" << node->local_name () <<
- " (void)" << be_nl;
- }
-
- *os << "{" << be_idt_nl
- << "this->optable_ = &tao_" << node->flatname ()
- << "_optable;" << be_uidt_nl
- << "}\n\n";
-
- *os << "// copy ctor" << be_nl;
- // find if we are at the top scope or inside some module
- if (!node->is_nested ())
- {
- // we are outermost. So the POA_ prefix is prepended to our name
- *os << node->full_skel_name () << "::POA_"
- << node->local_name () << " ("
- << "const POA_" << node->local_name () << "& rhs)";
- }
- else
- {
- // the POA_ prefix is prepended to our outermost module name
- *os << node->full_skel_name () << "::"
- << node->local_name () << " (const "
- << node->local_name () << "& rhs)";
- }
- *os << be_idt_nl
- << ": ";
- if (node->traverse_inheritance_graph
- (be_interface::copy_ctor_helper, os) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss::visit_interface - "
- " copy ctor generation failed\n"), -1);
- *os << " TAO_ServantBase (rhs)" << be_uidt_nl
- << "{}\n" << be_nl;
-
- *os << "// skeleton destructor" << be_nl;
-
- if (!node->is_nested ())
- {
- // we are outermost. So the POA_ prefix is prepended to our name
- *os << node->full_skel_name () << "::~POA_" << node->local_name () <<
- " (void)" << be_nl;
- }
- else
- {
- // the POA_ prefix is prepended to our outermost module name
- *os << node->full_skel_name () << "::~" << node->local_name () <<
- " (void)" << be_nl;
- }
- *os << "{\n";
- *os << "}\n\n";
-
-
- // 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);
- }
-
- // generate code for the _is_a skeleton
- os->indent ();
- *os << "void " << node->full_skel_name ()
- << "::_is_a_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &_tao_server_request, " << be_nl
- << "void * _tao_object_reference," << be_nl
- << "void * /* context */," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt_nl;
- *os << "{" << be_idt_nl;
- *os << "TAO_InputCDR &_tao_in = _tao_server_request.incoming ();" << be_nl;
- *os << node->full_skel_name () << " *_tao_impl = ("
- << node->full_skel_name () << " *) _tao_object_reference;" << be_nl;
- *os << "CORBA::Boolean _tao_retval = 0;" << be_nl;
- *os << "CORBA::String_var value;" << be_nl;
- *os << "if (!((_tao_in >> value.out ())))" << be_idt_nl;
- *os << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt_nl << be_nl;
- *os << "_tao_retval = _tao_impl->_is_a (value.in (), ACE_TRY_ENV);" << be_nl;
- *os << "ACE_CHECK;" << be_nl << be_nl;
- *os << "_tao_server_request.init_reply (ACE_TRY_ENV);" << be_nl;
- *os << "ACE_CHECK;" << be_nl;
- *os << "TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();" << be_nl;
- *os << "if (!((_tao_out << CORBA::Any::from_boolean (_tao_retval))))" << be_idt_nl;
- *os << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt << be_uidt_nl;
- *os << "}\n\n";
-
-
- // generate code for the _non_existent skeleton
- os->indent ();
- *os << "void " << node->full_skel_name ()
- << "::_non_existent_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &_tao_server_request, " << be_nl
- << "void * _tao_object_reference," << be_nl
- << "void * /* context */," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt_nl;
- *os << "{" << be_idt_nl;
- *os << node->full_skel_name () << " *_tao_impl = ("
- << node->full_skel_name () << " *) _tao_object_reference;" << be_nl;
- *os << "CORBA::Boolean _tao_retval = _tao_impl->_non_existent (ACE_TRY_ENV);" << be_nl;
- *os << "ACE_CHECK;" << be_nl << be_nl;
- *os << "_tao_server_request.init_reply (ACE_TRY_ENV);" << be_nl;
- *os << "ACE_CHECK;" << be_nl;
- *os << "TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();" << be_nl;
- *os << "if (!((_tao_out << CORBA::Any::from_boolean (_tao_retval))))" << be_idt_nl;
- *os << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt << be_uidt_nl;
- *os << "}\n\n";
-
-
- os->indent ();
- *os << "CORBA::Boolean " << node->full_skel_name ()
- << "::_is_a (" << be_idt << be_idt_nl
- << "const char* value," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl
- << "if (\n" << be_idt;
- 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->indent ();
- *os << "(!ACE_OS::strcmp ((char *)value, "
- << "CORBA::_tc_Object->id (ACE_TRY_ENV))))"
- << be_idt_nl << "return 1;" << be_uidt_nl
- << "else" << be_idt_nl
- << "return 0;" << be_uidt << be_uidt << be_uidt_nl
- << "}\n\n";
-
- // the downcast method.
- os->indent ();
- *os << "void* " << node->full_skel_name ()
- << "::_downcast (" << be_idt << be_idt_nl
- << "const char* logical_type_id" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
-
- if (node->traverse_inheritance_graph (be_interface::downcast_helper, os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss::"
- "visit_interface - "
- "traversal of inhertance graph failed\n"),
- -1);
- }
-
- *os << "if (ACE_OS::strcmp (logical_type_id, "
- << "\"IDL:omg.org/CORBA/Object:1.0\") == 0)" << be_idt_nl
- << "return ACE_static_cast(PortableServer::Servant, this);"
- << be_uidt_nl;
-
- *os << "return 0;" << be_uidt_nl
- << "}\n\n";
-
-
- // now the dispatch method
- os->indent ();
- *os << "void " << node->full_skel_name () <<
- "::_dispatch (CORBA::ServerRequest &req, " <<
- "void *context, CORBA::Environment &ACE_TRY_ENV)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "TAO_Skeleton skel; // pointer to skeleton for operation" << be_nl;
- *os << "const char *opname = req.operation (); // retrieve operation name"
- << be_nl;
- *os << "// find the skeleton corresponding to this opname" << be_nl;
- *os << "if (this->_find (opname, skel, req.operation_length ()) == -1)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "ACE_ERROR ((LM_ERROR, \"Bad operation <%s>\\n\", opname));" << be_nl;
- *os << "ACE_THROW (CORBA_BAD_OPERATION ());"
- //<< "ACE_TRY_ENV);" << be_uidt_nl;
- << be_uidt_nl;
- // *os << "env.exception (new CORBA_BAD_OPERATION ());" << be_nl;
- *os << "}" << be_nl;
- *os << "else" << be_idt_nl;
- *os << "skel (req, this, context, ACE_TRY_ENV);" << be_uidt << be_uidt_nl;
- *os << "}\n\n";
-
- os->indent ();
- *os << "const char* " << node->full_skel_name ()
- << "::_interface_repository_id (void) const"
- << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "return \"" << node->repoID () << "\";\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- *os << "\n";
-
- // the _this () operation
- *os << node->name () << "*" << be_nl
- << node->full_skel_name ()
- << "::_this (CORBA_Environment &ACE_TRY_ENV)" << be_nl
- << "{" << be_idt_nl
- << "TAO_Stub *stub = this->_create_stub (ACE_TRY_ENV);" << be_nl
- << "ACE_CHECK_RETURN (0);" << be_nl
- << "switch (stub->servant_orb_var ()->orb_core ()->get_collocation_strategy ())" << be_idt_nl
- << "{" << be_nl
- << "case TAO_ORB_Core::THRU_POA:" << be_idt_nl;
-
- // Thru POA stub
- if (idl_global->gen_thru_poa_collocation ())
- *os << "return new "
- << node->full_coll_name (be_interface::THRU_POA) << " (stub);" << be_uidt_nl;
- else
- *os << "ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);" << be_uidt_nl;
-
- // Direct stub
- *os << "case TAO_ORB_Core::DIRECT:" << be_idt_nl;
- if (idl_global->gen_direct_collocation ())
- *os << "return new "
- << node->full_coll_name (be_interface::DIRECT) << " (this, stub);" << be_uidt_nl;
- else
- *os << "ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);" << be_uidt_nl;
-
- *os << "default:" << be_idt_nl
- << "ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0);" << be_uidt_nl
- << "}" << be_uidt << be_uidt_nl
- << "}\n\n";
-
- // the _create_collocated_objref method. If the idl compiler does
- // not generate the type of collocated stub but the orb is asking
- // for it, simply return null so a remote stub will be used.
- os->indent ();
-
- // generate the collocated class impl
- if (idl_global->gen_thru_poa_collocation ())
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss::"
- "visit_interface - "
- "Bad visitor for thru_poa collocated class\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss::"
- "visit_interface - "
- "codegen for thru_poa collocated class failed\n"),
- -1);
- }
- delete visitor;
- }
-
- if (idl_global->gen_direct_collocation ())
- {
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss::"
- "visit_interface - "
- "Bad visitor for direct collocated class\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_ss::"
- "visit_interface - "
- "codegen for direct collocated class failed\n"),
- -1);
- }
- delete visitor;
- }
-
- *os << "\n\n";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_sh.cpp
deleted file mode 100644
index 33fb7be9f5e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_sh.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// thru_poa_collocated_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for thru_poa_collocated classes for the Interface node
-// inside the server header.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-ACE_RCSID(be_visitor_interface, thru_poa_collocated_sh, "$Id$")
-
-
-// ************************************************************
-// thru_poa_collocated class in header
-// ************************************************************
-
-be_visitor_interface_thru_poa_collocated_sh::be_visitor_interface_thru_poa_collocated_sh
-(be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_thru_poa_collocated_sh::~be_visitor_interface_thru_poa_collocated_sh (void)
-{
-}
-
-int be_visitor_interface_thru_poa_collocated_sh::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- os->gen_ifdef_macro (node->flatname (), "_thru_poa_collocated");
-
- // output the class defn
- os->indent ();
- *os << "class " << idl_global->export_macro ()
- << " " << node->local_coll_name (be_interface::THRU_POA);
- os->incr_indent ();
- *os << " : public virtual " << node->name ();
-
- // generate base classes if any
- if (node->n_inherits () > 0)
- {
- for (int i = 0; i < node->n_inherits (); ++i)
- {
- *os << "," << be_nl;
- be_interface* parent =
- be_interface::narrow_from_decl (node->inherits()[i]);
- *os << " public virtual "
- << be_interface::relative_name (parent->full_coll_name (be_interface::THRU_POA),
- node->full_coll_name (be_interface::THRU_POA));
- }
- }
- *os << "\n";
- os->decr_indent ();
- *os << "{" << be_nl;
- *os << "public:\n";
- os->incr_indent ();
-
- *os << node->local_coll_name (be_interface::THRU_POA) << " (\n";
-
- os->incr_indent (0);
- os->incr_indent ();
-
- *os << "TAO_Stub *stub\n";
- os->decr_indent ();
- *os << ");\n";
- os->decr_indent (0);
-
- os->indent ();
-
- *os << "virtual CORBA::Boolean _is_a" << be_idt
- << "(" << be_idt_nl
- << "const CORBA::Char *logical_type_id," << be_nl
- << "CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- *os << "virtual CORBA::Boolean _non_existent" << be_idt
- << "(" << be_idt_nl
- << "CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()" << be_uidt_nl
- << ");" << be_uidt_nl << be_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_thru_poa_collocated_sh::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
- os->decr_indent ();
-
- *os << "};\n\n";
-
- os->gen_endif ();
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_ss.cpp
deleted file mode 100644
index d6d869d5553..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_ss.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// thru_poa_collocated_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for thru_poa_collocated classes for an Interface in the
-// server skeleton file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-ACE_RCSID(be_visitor_interface, thru_poa_collocated_ss, "$Id$")
-
-
-// ************************************************************
-// be_visitor_interface_collacted_ss
-// ************************************************************
-
-be_visitor_interface_thru_poa_collocated_ss::be_visitor_interface_thru_poa_collocated_ss
-(be_visitor_context *ctx)
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_interface_thru_poa_collocated_ss::~be_visitor_interface_thru_poa_collocated_ss (void)
-{
-}
-
-int be_visitor_interface_thru_poa_collocated_ss::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = tao_cg->server_skeletons ();
-
- this->ctx_->node (node);
-
- *os << node->full_coll_name (be_interface::THRU_POA) << "::"
- << node->local_coll_name (be_interface::THRU_POA) << " (" << be_idt_nl
- << "TAO_Stub *stub" << be_uidt_nl
- << ")\n";
- os->decr_indent (0);
-
- os->incr_indent ();
-
- if (node->is_nested ())
- {
- be_decl* scope =
- be_scope::narrow_from_scope (node->defined_in ())->decl ();
-
- *os << ": ACE_NESTED_CLASS ("
- << scope->name () << ","
- << node->local_name ()
- << ") ()," << be_nl;
- }
- else
- {
- *os << ": " << node->name ()
- << " ()," << be_nl;
- }
-
- // @@ We should call the constructor for all base classes, since we
- // are using multiple inheritance.
-
- if (node->traverse_inheritance_graph (be_visitor_interface_thru_poa_collocated_ss::collocated_ctor_helper, os)
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_thru_poa_collocated_ss::"
- "visit_interface - "
- "codegen for base class ctor init failed\n"),
- -1);
- }
-
- *os << " CORBA_Object (stub, 0, 1)\n";
-
- os->decr_indent ();
- *os << "{\n";
- *os << "}\n\n";
-
- os->indent ();
-
- // Generate _is_a implementation.
- *os << "CORBA::Boolean " << node->full_coll_name (be_interface::THRU_POA) << "::"
- << "_is_a" << be_idt
- << "(" << be_idt_nl
- << "const CORBA::Char *logical_type_id," << be_nl
- << "CORBA_Environment &ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt_nl << be_nl
- << "{" << be_idt_nl;
- *os <<"TAO_Object_Adapter::Servant_Upcall servant_upcall ("
- << be_idt << be_idt_nl
- << "*this->_stubobj ()->"
- << "servant_orb_var ()->orb_core ()->object_adapter ()"
- << be_uidt_nl
- << ");" << be_uidt_nl
- << "servant_upcall.prepare_for_upcall (" << be_idt << be_idt_nl
- << "this->_object_key ()," << be_nl
- << "\"" << "_is_a" << "\"," << be_nl
- << "ACE_TRY_ENV" << be_uidt_nl
- << ");" << be_uidt_nl
- << "ACE_CHECK_RETURN (0);" << be_nl;
- *os << "return ACE_reinterpret_cast (" << be_idt << be_idt_nl
- << node->full_skel_name () << "_ptr," << be_nl
- << "servant_upcall.servant ()->_downcast (" << be_idt << be_idt_nl
- << "\"" << node->repoID () << "\"" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ")->_is_a (logical_type_id, ACE_TRY_ENV);" << be_uidt << be_uidt_nl
- << "}\n\n" << be_uidt_nl;
-
- os->indent ();
-
- // Generate _non_existent implementation.
- *os << "CORBA::Boolean " << node->full_coll_name (be_interface::THRU_POA) << "::"
- << "_non_existent" << be_idt
- << "(" << be_idt_nl
- << "CORBA_Environment &ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt_nl << be_nl
- << "{" << be_idt_nl;
- *os <<"TAO_Object_Adapter::Servant_Upcall servant_upcall ("
- << be_idt << be_idt_nl
- << "*this->_stubobj ()->"
- << "servant_orb_var ()->orb_core ()->object_adapter ()"
- << be_uidt_nl
- << ");" << be_uidt_nl
- << "servant_upcall.prepare_for_upcall (" << be_idt << be_idt_nl
- << "this->_object_key ()," << be_nl
- << "\"" << "_non_existent" << "\"," << be_nl
- << "ACE_TRY_ENV" << be_uidt_nl
- << ");" << be_uidt_nl
- << "ACE_CHECK_RETURN (0);" << be_nl;
- *os << "return ACE_reinterpret_cast (" << be_idt << be_idt_nl
- << node->full_skel_name () << "_ptr," << be_nl
- << "servant_upcall.servant ()->_downcast (" << be_idt << be_idt_nl
- << "\"" << node->repoID () << "\"" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ")->_non_existent (ACE_TRY_ENV);" << be_uidt << be_uidt_nl
- << "}\n\n" << be_uidt_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_thru_poa_collocated_ss::"
- "visit_scope - "
- "codegen for scope failed\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_interface_thru_poa_collocated_ss::collocated_ctor_helper (be_interface *derived,
- be_interface *base,
- TAO_OutStream *os)
-{
- if (derived == base)
- // we are the same. Don't do anything, otherwise we will end up calling
- // ourself
- return 0;
-
- if (base->is_nested ())
- {
- be_decl *scope;
- scope = be_scope::narrow_from_scope (base->defined_in ())->decl ();
- *os << " ACE_NESTED_CLASS (POA_" << scope->name () << ","
- << base->local_coll_name (be_interface::THRU_POA) << ") (stub)," << be_nl;
- }
- else
- {
- *os << " " << base->full_coll_name (be_interface::THRU_POA) << " (stub)," << be_nl;
- }
-
- return 0;
-}
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 4892051d8b9..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp
+++ /dev/null
@@ -1,167 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
- static char namebuf [NAMEBUFSIZE]; // holds the class name
- static char tiename [NAMEBUFSIZE]; // holds the tie name
-
- if (node->srv_hdr_gen () || node->imported ())
- return 0;
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::memset (tiename, '\0', NAMEBUFSIZE);
-
- 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 ())
- {
- // we are outermost
- ACE_OS::sprintf (namebuf, "POA_%s", node->local_name ()->get_string ());
- ACE_OS::sprintf (tiename, "POA_%s_tie",
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (namebuf, "%s", node->local_name ()->get_string ());
- ACE_OS::sprintf (tiename, "%s_tie",
- node->local_name ()->get_string ());
- }
-
- // now generate the class definition
- os->indent (); // start with whatever indentation level we are at
-
- // Since templates nested inside of classes are broken on most C++ compilers,
- // we generate code for this inside a conditional macro. The code is
- // activated only if "namespaces" are supported on the platform
- if (node->is_nested ())
- {
- *os << "\n#if defined (ACE_HAS_USING_KEYWORD)" << be_nl;
- }
-
- *os << "// TIE class: Refer to CORBA v2.2, Section 20.34.4" << be_nl;
- *os << "template <class T>" << be_nl;
- *os << "class " << idl_global->export_macro ()
- << " " << tiename << " : public " << namebuf << be_nl;
- *os << "{" << be_nl
- << "public:" << be_idt_nl
- << tiename << " (T &t);" << be_nl
- << "// the T& ctor" << be_nl
- << tiename << " (T &t, PortableServer::POA_ptr poa);" << be_nl
- << "// ctor taking a POA" << be_nl
- << tiename << " (T *tp, CORBA::Boolean release=1);" << be_nl
- << "// ctor taking pointer and an ownership flag" << be_nl
- << tiename << " (T *tp, PortableServer::POA_ptr poa, "
- << "CORBA::Boolean release=1);" << be_nl
- << "// ctor with T*, ownership flag and a POA" << be_nl
- << "~" << tiename << " (void);" << be_nl
- << "// dtor" << be_nl << be_nl
- << "// TIE specific functions" << be_nl
- << "T *_tied_object (void);" << be_nl
- << "// return the underlying object" << be_nl
- << "void _tied_object (T &obj);" << be_nl
- << "// set the underlying object" << be_nl
- << "void _tied_object (T *obj, CORBA::Boolean release=1);" << be_nl
- << "// set the underlying object and the ownership flag" << be_nl
- << "CORBA::Boolean _is_owner (void);" << be_nl
- << "// do we own it" << be_nl
- << "void _is_owner (CORBA::Boolean b);" << be_nl
- << "// set the ownership" << be_nl << be_nl
- << "// overridden ServantBase operations" << be_nl
- << "PortableServer::POA_ptr _default_POA (" << be_idt << be_idt_nl
- << "CORBA::Environment &env = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");" << be_uidt << "\n";
-
- if (node->traverse_inheritance_graph (be_visitor_interface_tie_sh::method_helper, os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_tie_sh_ss::"
- "visit_interface - "
- "traversal of inhertance graph failed\n"),
- -1);
- }
-
- *os << be_uidt << "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
- << "};\n\n";
-
- if (node->is_nested ())
- {
- *os << "#endif /* ACE_HAS_USING_KEYWORD */\n";
- }
-
- return 0;
-}
-
-int
-be_visitor_interface_tie_sh::method_helper (be_interface *,
- be_interface *node,
- TAO_OutStream *os)
-{
- be_visitor_context ctx;
- ctx.state (TAO_CodeGen::TAO_INTERFACE_TIE_SH);
- ctx.stream (os);
- be_visitor* visitor = tao_cg->make_visitor (&ctx);
- if (visitor == 0 || visitor->visit_scope (node) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_tie_sh::"
- "method_helper\n"), -1);
- }
- delete visitor;
- 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 6b720a11366..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp
+++ /dev/null
@@ -1,208 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
- static char fulltiename [NAMEBUFSIZE]; // holds the class name
- static char localtiename [NAMEBUFSIZE]; // holds the tie name
- static char localskelname [NAMEBUFSIZE]; // holds the local skeleton name
-
- if (node->srv_inline_gen () || node->imported ())
- return 0;
-
- ACE_OS::memset (fulltiename, '\0', NAMEBUFSIZE);
- ACE_OS::memset (localtiename, '\0', NAMEBUFSIZE);
- ACE_OS::memset (localskelname, '\0', NAMEBUFSIZE);
-
- os = this->ctx_->stream ();
-
- // 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 ()->get_string ());
- ACE_OS::sprintf (localtiename, "POA_%s_tie",
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (localskelname, "%s",
- node->local_name ()->get_string ());
- ACE_OS::sprintf (localtiename, "%s_tie",
- node->local_name ()->get_string ());
- }
-
- if (node->is_nested ())
- {
- *os << "\n#if defined (ACE_HAS_USING_KEYWORD)\n";
- }
-
- os->indent (); // start with whatever indentation level we are at
-
- *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_) delete this->ptr_;" << 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_) delete this->ptr_;" << 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_) delete this->ptr_;" << 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 (CORBA::Environment &env)" << be_nl
- << "{" << be_idt_nl
- << "if (!CORBA::is_nil (this->poa_.in ()))" << be_idt_nl
- << "return PortableServer::POA::_duplicate (this->poa_.in ());\n"
- << be_uidt_nl
- << "return this->" << localskelname << "::_default_POA (env);" << be_uidt_nl
- << "}\n\n";
-
- if (node->traverse_inheritance_graph (be_visitor_interface_tie_si::method_helper, os) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_tie_sh_ss::"
- "visit_interface - "
- "traversal of inhertance graph failed\n"),
- -1);
- }
-
- if (node->is_nested ())
- {
- *os << "#endif /* ACE_HAS_USING_KEYWORD */\n";
- }
-
- return 0;
-}
-
-int
-be_visitor_interface_tie_si::method_helper (be_interface *derived,
- be_interface *node,
- TAO_OutStream *os)
-{
- be_visitor_context ctx;
- ctx.state (TAO_CodeGen::TAO_INTERFACE_TIE_SI);
- ctx.interface (derived);
- ctx.stream (os);
-
- be_visitor* visitor = tao_cg->make_visitor (&ctx);
- if (visitor == 0 || visitor->visit_scope (node) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_tie_sh::"
- "method_helper\n"), -1);
- }
- delete visitor;
- 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 19b900b04b7..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp
+++ /dev/null
@@ -1,32 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface_fwd.h"
-
-// include all the individual files
-#include "be_visitor_interface_fwd/interface_fwd_ch.cpp"
-#include "be_visitor_interface_fwd/interface_fwd_ci.cpp"
-#include "be_visitor_interface_fwd/cdr_op_ci.cpp"
-
-ACE_RCSID(be, be_visitor_interface_fwd, "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ci.cpp
deleted file mode 100644
index e7edc5c7ad5..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ci.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// $Id$
-//
-
-// ================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for forward
-// declarations of interfaces. This uses compiled marshaling.
-//
-// = AUTHOR
-// Aniruddha Gokhale & Carlos O'Ryan
-//
-// ================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface_fwd.h"
-
-ACE_RCSID(be_visitor_interface_fwd, cdr_op_ci, "$Id$")
-
-// ****************************************************************
-// Interface visitor for generating CDR operator declarations in the
-// client header
-// ****************************************************************
-
-be_visitor_interface_fwd_cdr_op_ci::
-be_visitor_interface_fwd_cdr_op_ci (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_interface_fwd_cdr_op_ci::
-~be_visitor_interface_fwd_cdr_op_ci (void)
-{
-}
-
-int
-be_visitor_interface_fwd_cdr_op_ci::
-visit_interface_fwd (be_interface_fwd *node)
-{
- if (node->cli_inline_cdr_op_gen () || node->imported ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // generate the CDR << and >> operator declarations
- os->indent ();
- *os << "ACE_INLINE CORBA::Boolean" << be_nl
- << "operator<< (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &," << be_nl
- << "const " << node->name () << "_ptr" << be_uidt_nl
- << ");" << be_uidt_nl;
- *os << "ACE_INLINE CORBA::Boolean" << be_nl
- << "operator>> (" << be_idt << be_idt_nl
- << "TAO_InputCDR &," << be_nl
- << node->name () << "_ptr &" << be_uidt_nl
- << ");" << be_uidt << "\n";
-
- node->cli_inline_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 7591f4d83be..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp
+++ /dev/null
@@ -1,96 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface_fwd.h"
-
-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)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (!node->cli_hdr_gen () && !node->imported ())
- {
- os->indent (); // start from the current
-
- // all we do in this is generate a forward declaration of the class
- *os << "class " << node->local_name () << ";" << be_nl;
-
- // generate the ifdefined macro for the _ptr type
- os->gen_ifdef_macro (node->flatname (), "_ptr");
-
- // generate the _ptr declaration
- *os << "typedef " << node->local_name () << " *" << node->local_name ()
- << "_ptr;\n";
-
- os->gen_endif ();
-
- // enclose under an ifdef macro
- os->gen_ifdef_macro (node->flatname (), "_var");
-
- // generate the _var declaration
- if (node->gen_var_defn () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_fwd_ch::"
- "visit_interface_fwd - "
- "codegen for _var failed\n"), -1);
- }
- // gen an endif
- os->gen_endif ();
-
- // enclose under an ifdef macro
- os->gen_ifdef_macro (node->flatname (), "_out");
-
- // generate the _out declaration - ORBOS/97-05-15 pg 16-20 spec
- if (node->gen_out_defn () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_fwd_ch::"
- "visit_interface_fwd - "
- "codegen for _out failed\n"), -1);
- }
- // generate the endif macro
- os->gen_endif ();
- node->cli_hdr_gen (I_TRUE);
- }
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ci.cpp
deleted file mode 100644
index 301ef9ce115..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ci.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// interface_fwd_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interface_Fwd node in the client inline.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_interface_fwd.h"
-
-ACE_RCSID(be_visitor_interface_fwd, interface_fwd_ci, "$Id$")
-
-
-// ********************************************************************
-// Visitor implementation for the Interface_Fwd type
-// This one for the client inline file
-// ********************************************************************
-
-be_visitor_interface_fwd_ci::be_visitor_interface_fwd_ci (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_interface_fwd_ci::~be_visitor_interface_fwd_ci (void)
-{
-}
-
-// visit the Interface_Fwd_ci node and its scope
-int
-be_visitor_interface_fwd_ci::visit_interface_fwd (be_interface_fwd *node)
-{
- if (!node->cli_inline_gen () && !node->imported ())
- {
-#if 0
- // We don't generate any code here.....
-
- // It is possible to generate the definitions for the _var and
- // _out types, but if we do that then the _duplicate() and
- // _nil() methods cannot be inlined.
-
- // Since these classes will be generated once the forward
- // declaration is resolved there is really no problem here
-#endif /* 0 */
-
- node->cli_inline_gen (I_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 1bd1b4ffe36..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_module.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_module.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Module
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_module.h"
-
-// include all the individual files
-#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"
-
-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 2d50f3b54d0..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_module/any_op.cpp
+++ /dev/null
@@ -1,56 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_module.h"
-
-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)
-{
- // 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_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 9f3fd486ddf..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_module/cdr_op.cpp
+++ /dev/null
@@ -1,56 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_module.h"
-
-ACE_RCSID(be_visitor_module, cdr_op, "$Id")
-
-
-// ***************************************************************************
-// 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)
-{
- // 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_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 95414c29cb3..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_module/module.cpp
+++ /dev/null
@@ -1,816 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// module.cpp
-//
-// = DESCRIPTION
-// Generic visitor generating code for Module
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_module.h"
-
-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)
-{
-}
-
-// visit the Module node and its scope
-int be_visitor_module::visit_module (be_module *node)
-{
- // 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_module::visit_module - "
- "codegen for scope failed\n"), -1);
- }
- return 0;
-}
-
-// =all common visit methods for module visitor
-
-// visit a constant
-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); // set the node to be the node being visited. The scope is
- // still the same
-
-
- // 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_MODULE_CH:
- ctx.state (TAO_CodeGen::TAO_CONSTANT_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CS:
- ctx.state (TAO_CodeGen::TAO_CONSTANT_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CH:
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CS:
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CH:
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CI:
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CS:
- case TAO_CodeGen::TAO_MODULE_CI:
- case TAO_CodeGen::TAO_MODULE_SH:
- case TAO_CodeGen::TAO_MODULE_IH:
- case TAO_CodeGen::TAO_MODULE_SI:
- case TAO_CodeGen::TAO_MODULE_SS:
- case TAO_CodeGen::TAO_MODULE_IS:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_constant - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_constant - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_constant - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-//visit an enum
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_MODULE_CH:
- ctx.state (TAO_CodeGen::TAO_ENUM_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CS:
- ctx.state (TAO_CodeGen::TAO_ENUM_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_ENUM_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_ENUM_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_CI:
- case TAO_CodeGen::TAO_MODULE_SH:
- case TAO_CodeGen::TAO_MODULE_IH:
- case TAO_CodeGen::TAO_MODULE_SI:
- case TAO_CodeGen::TAO_MODULE_SS:
- case TAO_CodeGen::TAO_MODULE_IS:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_enum - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_enum - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_enum - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit an exception
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_MODULE_CH:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CI:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CS:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_SH:
- case TAO_CodeGen::TAO_MODULE_IH:
- case TAO_CodeGen::TAO_MODULE_SI:
- case TAO_CodeGen::TAO_MODULE_SS:
- case TAO_CodeGen::TAO_MODULE_IS:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_exception - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_exception - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_exception - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit an interface
-int
-be_visitor_module::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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_MODULE_CH:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CI:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CS:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_SH:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_SH);
- break;
- case TAO_CodeGen::TAO_MODULE_IH:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_IH);
- break;
- case TAO_CodeGen::TAO_MODULE_SI:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_SI);
- break;
- case TAO_CodeGen::TAO_MODULE_SS:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_SS);
- break;
- case TAO_CodeGen::TAO_MODULE_IS:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_IS);
- break;
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS);
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_interface - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- 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);
- }
-
- // let the node accept this visitor
- 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;
- return 0;
-}
-
-// visit an interface_fwd
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_MODULE_CH:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CI:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CH:
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CS:
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CH:
- case TAO_CodeGen::TAO_MODULE_CS:
- case TAO_CodeGen::TAO_MODULE_SH:
- case TAO_CodeGen::TAO_MODULE_SI:
- case TAO_CodeGen::TAO_MODULE_SS:
- case TAO_CodeGen::TAO_MODULE_IH:
- case TAO_CodeGen::TAO_MODULE_IS:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_interface_fwd - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_interface_fwd - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_interface_fwd - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-// visit an valuetype
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_MODULE_CH:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CI:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CS:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_SH:
- case TAO_CodeGen::TAO_MODULE_IH:
- case TAO_CodeGen::TAO_MODULE_SI:
- case TAO_CodeGen::TAO_MODULE_SS:
- case TAO_CodeGen::TAO_MODULE_IS:
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CH:
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CS:
- return 0; // nothing to do, resp. not yet impl.
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_valuetype - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_valuetype - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_valuetype - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit an valuetype_fwd
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_MODULE_CH:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CI:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CH:
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CS:
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CH:
- case TAO_CodeGen::TAO_MODULE_CS:
- case TAO_CodeGen::TAO_MODULE_SH:
- case TAO_CodeGen::TAO_MODULE_SI:
- case TAO_CodeGen::TAO_MODULE_SS:
- case TAO_CodeGen::TAO_MODULE_IS:
- case TAO_CodeGen::TAO_MODULE_IH:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_valuetype_fwd - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_valuetype_fwd - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_valuetype_fwd - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-// visit an structure
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_MODULE_CH:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CI:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_SH:
- case TAO_CodeGen::TAO_MODULE_IH:
- case TAO_CodeGen::TAO_MODULE_SI:
- case TAO_CodeGen::TAO_MODULE_SS:
- case TAO_CodeGen::TAO_MODULE_IS:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_structure - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_structure - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_structure - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit an union
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_MODULE_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CI:
- ctx.state (TAO_CodeGen::TAO_UNION_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_SH:
- case TAO_CodeGen::TAO_MODULE_IH:
- case TAO_CodeGen::TAO_MODULE_SI:
- case TAO_CodeGen::TAO_MODULE_SS:
- case TAO_CodeGen::TAO_MODULE_IS:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_union - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_union - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_union - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit a typedef
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_MODULE_CH:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CI:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CS:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_MODULE_SH:
- case TAO_CodeGen::TAO_MODULE_SI:
- case TAO_CodeGen::TAO_MODULE_SS:
- case TAO_CodeGen::TAO_MODULE_IH:
- case TAO_CodeGen::TAO_MODULE_IS:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_typedef - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_typedef - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_typedef - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- 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 f109e3cd647..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_module/module_ch.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// module_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Module in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_module.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
-
- if (!node->cli_hdr_gen () && !node->imported ())
- {
- os = this->ctx_->stream ();
-
- // XXXASG - Modules really map to namespace. We need to see if our target
- // compiler supports namespaces or not. This visitor generates a class for a
- // module. We can have the factory generate another module visitor that can
- // generate namespaces
-
- os->indent (); // start from whatever indentation level we were at
- // now generate the class definition
- *os << "TAO_NAMESPACE " // << idl_global->export_macro ()
- << " " << node->local_name () << be_nl
- << "{\n";
- os->incr_indent (0);
-
- // 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
- << "}; // module " << node->name () << "\n\n";
-
- }
- 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 d2c47ea3bd4..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_module/module_ih.cpp
+++ /dev/null
@@ -1,56 +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)
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_module.h"
-
-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 ()) // not generated and not imported
- {
-
- 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);
- }
-
- }
- 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 f3080384f59..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// module_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Module in the server header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_module.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
-
- if (!node->srv_hdr_gen () && !node->imported ()) // not generated and not imported
- {
- os = this->ctx_->stream ();
-
- // generate the skeleton class name
-
- os->indent (); // start with whatever indentation level we are at
-
- // now generate the class definition. The prefix POA_ is prepended to our
- // name only if we are the outermost module
- *os << "TAO_NAMESPACE "; // << idl_global->export_macro ()
-
- 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_nl
- << be_idt;
-
- 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->decr_indent ();
- *os << "};\n\n";
- }
- 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 3b4c8db91ac..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_operation.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Operation
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-// include all the individual files
-#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/thru_poa_collocated_sh.cpp"
-#include "be_visitor_operation/thru_poa_collocated_ss.cpp"
-#include "be_visitor_operation/direct_collocated_sh.cpp"
-#include "be_visitor_operation/direct_collocated_ss.cpp"
-#include "be_visitor_operation/exceptlist_cs.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_is.cpp"
-#include "be_visitor_operation/rettype_assign_ss.cpp"
-#include "be_visitor_operation/rettype_docall_cs.cpp"
-#include "be_visitor_operation/rettype_marshal_ss.cpp"
-#include "be_visitor_operation/rettype_post_docall_cs.cpp"
-#include "be_visitor_operation/rettype_post_upcall_ss.cpp"
-#include "be_visitor_operation/rettype_pre_docall_cs.cpp"
-#include "be_visitor_operation/rettype_return_cs.cpp"
-#include "be_visitor_operation/rettype_vardecl_cs.cpp"
-#include "be_visitor_operation/rettype_vardecl_ss.cpp"
-#include "be_visitor_operation/tie_sh.cpp"
-#include "be_visitor_operation/tie_si.cpp"
-#include "be_visitor_operation/compiled_marshal.cpp"
-#include "be_visitor_operation/rettype_pre_invoke_cs.cpp"
-#include "be_visitor_operation/ami_ch.cpp"
-#include "be_visitor_operation/ami_cs.cpp"
-#include "be_visitor_operation/ami_arglist.cpp"
-#include "be_visitor_operation/ami_handler_operation_ch.cpp"
-#include "be_visitor_operation/ami_handler_arglist.cpp"
-#include "be_visitor_operation/ami_handler_operation_cs.cpp"
-#include "be_visitor_operation/ami_handler_skeleton_cs.cpp"
-#include "be_visitor_operation/ami_handler_argument_marshal.cpp"
-
-ACE_RCSID(be, be_visitor_operation, "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_arglist.cpp
deleted file mode 100644
index 17283768469..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_arglist.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_arglist.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the parameter list of the Operation signature.
-//
-// = AUTHOR
-// Alexander Babu Arulanthu <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, ami_arglist, "$Id$")
-
-
-// ************************************************************
-// operation visitor to generate the argument list for the AMI
-// stub.
-// We have separated code generation for this from the 4 main
-// visitors to avoid code duplication and tight coupling
- // ************************************************************
-
-be_visitor_operation_ami_arglist::be_visitor_operation_ami_arglist (be_visitor_context
- *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_operation_ami_arglist::~be_visitor_operation_ami_arglist (void)
-{
-}
-
-int
-be_visitor_operation_ami_arglist::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << " (" << be_idt << be_idt << "\n";
-
-
- // Start with current indentation level.
- os->indent ();
-
-
- be_decl *interface =
- be_interface::narrow_from_scope (node->defined_in ())->decl ();
- if (interface == 0)
- cerr << "Invalid interface";
-
- // AMI Handler argument.
- *os << "AMI_"
- << interface->fullname ()
- << "_Handler_ptr "
- << "_tao_ami_handler"
- << ",\n";
- // #endif /* TAO_IDL_HAS_AMI */
-
- // 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_ami_arglist::"
- "visit_operation - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // Last argument - is always CORBA::Environment.
-
- os->indent ();
-
- *os << "CORBA::Environment &ACE_TRY_ENV";
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_AMI_ARGLIST_CH)
- {
- *os << " = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt;
- }
-
- // Done with the argument list.
- *os << be_uidt_nl << ")" << be_uidt;
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_AMI_ARGLIST_CH)
- *os << ";";
-
- *os << "\n";
-
- return 0;
-}
-
-int
-be_visitor_operation_ami_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_ami_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_ami_arglist::"
- "visit_argument - "
- "Bad interface\n"),
- -1);
- }
- ctx.scope (intf); // set new scope
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OPERATION_AMI_ARGLIST_CH:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_AMI_ARGLIST_CH);
- break;
-
- case TAO_CodeGen::TAO_OPERATION_AMI_ARGLIST_CS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_AMI_ARGLIST_CS);
- break;
-
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_arglist::"
- "visit_argument - "
- "Bad context\n"),
- -1);
- }
- }
-
- // grab a visitor
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_arglist::"
- "visit_argument - "
- "Bad visitor\n"),
- -1);
- }
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_arglist::"
- "visit_argument - "
- "codegen for ami_arglist failed\n"),
- -1);
- }
- delete visitor;
- 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 dc8aa70a9af..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp
+++ /dev/null
@@ -1,98 +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>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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 ;
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node
-
- os->indent (); // start with the current indentation level
-
- // every operation is declared virtual in the client code
- *os << "virtual ";
-
- // STEP I: Return type is void.
- *os << "void ";
-
- // STEP 2: generate the operation name.
-
- // First the sendc prefix.
- *os << "sendc_";
- *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_AMI_ARGLIST_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_ami_ch::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- 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 3f87f4430db..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp
+++ /dev/null
@@ -1,787 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale and Alexander Babu Arulanthu
-// <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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;
-
- TAO_OutStream *os; // output stream
- be_visitor_context ctx; // visitor context
- be_visitor *visitor; // visitor
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node for future use
-
- os->indent (); // start with the current indentation level
-
- // Generate the return type mapping. Return type is simply void.
- *os << "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->fullname ()
- << "::"
- << "sendc_"
- << node->local_name ()->get_string ();
-
- // Generate the argument list with the appropriate mapping (same as
- // in the header file)
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_AMI_ARGLIST_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if ((!visitor) || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- // 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 CORBA::Environment
- *os << "{" << be_idt_nl;
-
- // Create the return type node. Return type is void.
- be_predefined_type *bt = 0;
- ACE_NEW_RETURN (bt,
- be_predefined_type (AST_PredefinedType::PT_void,
- new UTL_ScopedName
- (new Identifier
- ("void", 1, 0, I_FALSE), 0),
- 0),
- -1);
-
- // generate any pre stub info if and only if none of our parameters is of the
- // native type
- if (!node->has_native ())
- {
- // native type does not exist.
-
- // Generate any "pre" stub information such as tables or declarations
- // This is a template method and the actual work will be done by the
- // derived class
- if (this->gen_pre_stub_info (node, bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "gen_pre_stub_info failed\n"),
- -1);
- }
- }
-
- if (node->has_native ()) // native exists => no stub
- {
- if (this->gen_raise_exception (bt,
- "CORBA::MARSHAL",
- "") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for return var failed\n"),
- -1);
- }
- }
- else
- {
- // Generate code that retrieves the underlying stub object and then
- // invokes do_static_call on it.
- *os << be_nl
- << "TAO_Stub *istub = this->_stubobj ();" << be_nl
- << "if (istub == 0)" << be_idt_nl;
-
- // if the stub object was bad, then we raise a system exception
- if (this->gen_raise_exception (bt, "CORBA::INV_OBJREF",
- "") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for checking exception failed\n"),
- -1);
-
- }
- *os << be_uidt_nl << "\n";
-
- // do any pre marshal and invoke processing with return type. This
- // includes allocating memory, initialization.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_PRE_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for retval pre invoke failed\n"),
- -1);
- }
-
-#if 0
- // @@ I am not sure whether we need this.
- // Do any pre marshal and invoke stuff with arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_OPERATION_ARG_PRE_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for argument pre invoke failed\n"),
- -1);
- }
-#endif /* 0 */
-
- // Generate the code for marshaling in the parameters and transmitting
- // them.
- if (this->gen_marshal_and_invoke (node, bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for marshal and invoke failed\n"),
- -1);
-
- }
-
- // No return values.
- *os << "return;";
- } // end of if (!native)
-
- *os << be_uidt_nl << "}\n\n";
-
- return 0;
-}
-
-int
-be_visitor_operation_ami_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; // 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_raise_exception (be_type *bt,
- const char *excep,
- const char *completion_status)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- if (this->void_return_type (bt))
- {
- *os << "ACE_THROW ("
- << excep << " (" << completion_status << "));\n";
- }
- else
- {
- *os << "ACE_THROW_RETURN ("
- << excep << " (" << completion_status << "), ";
-
- // return the appropriate return value
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "gen_raise_exception - "
- "codegen for return var failed\n"),
- -1);
- }
- *os << ");\n";
- }
- return 0;
-}
-
-int
-be_visitor_operation_ami_cs::gen_check_exception (be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
- // check if there is an exception
- if (this->void_return_type (bt))
- {
- *os << "ACE_CHECK;\n";
- //<< "_tao_environment);\n";
- }
- else
- {
- *os << "ACE_CHECK_RETURN (";
- // << "_tao_environment, ";
-
- // return the appropriate return value
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "gen_check_exception - "
- "codegen failed\n"),
- -1);
- }
- *os << ");\n";
- }
-
- return 0;
-}
-
-// ************************************************************
-// Operation visitor for interpretive client stubs
-// ************************************************************
-
-be_interpretive_visitor_operation_ami_cs::
-be_interpretive_visitor_operation_ami_cs (be_visitor_context *ctx)
- : be_visitor_operation_ami_cs (ctx)
-{
-}
-
-be_interpretive_visitor_operation_ami_cs::~be_interpretive_visitor_operation_ami_cs (void)
-{
-}
-
-// concrete implementation of the template methods
-
-int
-be_interpretive_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- // Generate the TAO_Param_Data table
- os->indent ();
- *os << "static const TAO_Param_Data ";
- // 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->flatname () <<
- "_paramdata [] = " << be_nl;
- *os << "{\n";
- os->incr_indent ();
-
- // entry for the return type
- *os << "{" << bt->tc_name () << ", PARAM_RETURN, 0}";
- if (node->nmembers () > 0)
- *os << ",\n";
-
- // generate entries for the param data table for arguments
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_cs::"
- "gen_pre_stub_info - "
- "visit scope failed\n"),
- -1);
- }
- *os << "\n";
- os->decr_indent ();
- *os << "}; // " << node->flatname () << "_paramdata\n\n";
-
- // 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 ())
- {
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_interpretive_visitor_operation_ami_cs::"
- "gen_pre_stub_info - "
- "Exceptionlist generation error\n"),
- -1);
- }
- }
-
- // now generate the calldata table
- os->indent ();
- *os << "static const TAO_Call_Data ";
- // 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->flatname ()
- << "_calldata = " << 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->local_name () << "\", ";
-
- // are we oneway or two operation?
- if (node->flags () == AST_Operation::OP_oneway)
- {
- *os << "0, "; // for false
- }
- else
- {
- *os << "1, "; // for true
- }
- // insert the size of the paramdata table i.e., number of arguments + 1
- // for return type
- *os << (node->argument_count () + 1) << ", ";
-
- // insert the address of the paramdata table
- // first 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->flatname () << "_paramdata, ";
-
- // insert exception list (if any) - node for attributes
- if (this->ctx_->attribute ())
- *os << "0, 0};\n\n";
- else
- {
- if (node->exceptions ())
- {
- *os << node->exceptions ()->length ()
- << ", _tao_" << node->flatname () << "_exceptiondata};\n\n";
- }
- else
- *os << "0, 0};\n\n";
- }
- return 0;
-}
-
-int
-be_interpretive_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation
- *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
- *os << "void* _tao_arguments["
- << node->argument_count () + 1 << "];" << be_nl
- << "const void** _tao_arg = ACE_const_cast (const void**,_tao_arguments);" << be_nl
- << "*_tao_arg = ";
-
- // pass the appropriate return value to docall
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
- *os << "; _tao_arg++;\n";
-
- // pass each argument to do_static_call
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
-
- // call do_static_call with appropriate number of arguments
- os->indent ();
- *os << "istub->do_static_call (" << be_idt_nl
- << "ACE_TRY_ENV, " << 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->flatname () << "_calldata," << be_nl
- << "_tao_arguments" << be_uidt_nl
- << ");\n";
-
- os->indent ();
- // check if there is an exception
- if (this->gen_check_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
-
- }
-
- // do any post processing for the arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for args post do_static_call failed\n"),
- -1);
- }
-
- // do any post processing for the retval
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_POST_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for return type post do_static_call failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// ************************************************************
-// Operation visitor for compiled client stubs
-// ************************************************************
-
-be_compiled_visitor_operation_ami_cs::
-be_compiled_visitor_operation_ami_cs (be_visitor_context *ctx)
- : be_visitor_operation_ami_cs (ctx)
-{
-}
-
-be_compiled_visitor_operation_ami_cs::~be_compiled_visitor_operation_ami_cs (void)
-{
-}
-
-// concrete implementation of the template methods
-
-int
-be_compiled_visitor_operation_ami_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_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_compiled_visitor_operation_ami_cs::"
- "gen_pre_stub_info - "
- "Exceptionlist generation error\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_compiled_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
-
- // Create the GIOP_Invocation and grab the outgoing CDR stream.
- switch (node->flags ())
- {
- case AST_Operation::OP_oneway:
- // If it is a oneway, we wouldnt have come here to generate AMI
- // sendc method.
- break;
- default:
- *os << "TAO_GIOP_Twoway_Asynch_Invocation _tao_call ";
- }
- *os << "(" << be_idt << be_idt_nl
- << "istub," << be_nl;
-
- 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 ()
- << "\"," << be_nl
- << "istub->orb_core ()," << be_nl;
-
- // Next argument is the reply handler skeleton for this method.
-
- // Get the interface.
- be_decl *interface = be_interface::narrow_from_scope (node->defined_in ())->decl ();
-
- *os << "&AMI_" << interface->fullname () << "_Handler" << "::"
- << node->local_name () << "_skel," << be_nl;
-
- // Next argument is the ami handler passed in for this method.
- *os << "_tao_ami_handler" << be_uidt_nl
-
- << ");" << be_uidt_nl;
-
- *os << "\n" << be_nl
- << "for (;;)" << be_nl
- << "{" << be_idt_nl;
-
- *os << "_tao_call.start (ACE_TRY_ENV);" << be_nl;
- // Check if there is an exception.
- // Return type is void, so we know what to generate here.
- *os << "ACE_CHECK;";
-
- // Now make sure that we have some in and inout
- // parameters. Otherwise, there is nothing to be marshaled in.
- if (this->has_param_type (node, AST_Argument::dir_IN) ||
- this->has_param_type (node, AST_Argument::dir_INOUT))
- {
- *os << be_nl
- << "TAO_OutputCDR &_tao_out = _tao_call.out_stream ();"
- << be_nl
- << "if (!(\n" << be_idt << be_idt << be_idt;
-
- // Marshal each in and inout argument.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_OPERATION_ARG_INVOKE_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
- *os << be_uidt << be_uidt_nl
- << "))" << be_nl;
-
- // If marshaling fails, raise exception.
- if (this->gen_raise_exception (bt, "CORBA::MARSHAL",
- "") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_cs::"
- "gen_marshal_and invoke - "
- "codegen for return var failed\n"),
- -1);
- }
- *os << be_uidt;
- }
-
- *os << be_nl
- << "int _invoke_status =" << be_idt_nl;
- if (node->exceptions ())
- {
- *os << "_tao_call.invoke (_tao_" << node->flatname ()
- << "_exceptiondata, "
- << node->exceptions ()->length ()
- << ", ACE_TRY_ENV);";
- }
- else
- {
- *os << "_tao_call.invoke (0, 0, ACE_TRY_ENV);";
- }
-
- *os << be_uidt_nl;
-
- // Check if there is an exception.
- if (this->gen_check_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
- }
-
- *os << be_nl
- << "if (_invoke_status == TAO_INVOKE_RESTART)" << be_idt_nl
- << "continue;" << be_uidt_nl
- << "// if (_invoke_status == TAO_INVOKE_EXCEPTION)" << be_idt_nl
- << "// cannot happen" << be_uidt_nl
- << "if (_invoke_status != TAO_INVOKE_OK)" << be_nl
- << "{" << be_idt_nl;
-
- if (this->gen_raise_exception (bt,
- "CORBA::UNKNOWN",
- "TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_cs::"
- "gen_marshal_and invoke - "
- "codegen for return var failed\n"),
- -1);
- }
-
- *os << be_uidt_nl
- << "}" << be_nl
- << "break;" << be_nl
- << be_uidt_nl << "}" << be_nl;
-
- // Return type is void and we are going to worry about OUT or INOUT
- // parameters. Return from here.
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist.cpp
deleted file mode 100644
index 4670062f2df..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist.cpp
+++ /dev/null
@@ -1,325 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_arglist.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the parameter list of the AMI
-// Handler's call back Operation signature.
-//
-// = AUTHOR
-// Aniruddha Gokhale and Alexander Babu Arulanthu
-// <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, ami_handler_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_ami_handler_arglist::be_visitor_operation_ami_handler_arglist (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-// Visit the scope and its elements.
-// This implementation is the same as
-// <be_visitor_scope::visit_scope>. The variation is that it calls the
-// <post_process> only if the return value of the <accept> is 1. We
-// need to do this since we have to differentiate between an argument
-// that was printed and an argument that was skipped in the signature.
-
-int
-be_visitor_operation_ami_handler_arglist::visit_scope (be_scope *node)
-{
- // Proceed if the number of members in our scope is greater than 0.
- if (node->nmembers () > 0)
- {
- // initialize an iterator to iterate thru our scope
- UTL_ScopeActiveIterator *si;
- ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (node,
- UTL_Scope::IK_decls),
- -1);
- this->elem_number_ = 0;
- // continue until each element is visited
- while (!si->is_done ())
- {
- AST_Decl *d = si->item ();
- if (!d)
- {
- delete si;
- 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)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "pre processing failed\n"), -1);
- }
-
- // Send the visitor.
- int visitor_result = 0;
- if (bd == 0 || (visitor_result = bd->accept (this)) == -1)
- {
- delete si;
- 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 (visitor_result == 1)
- this->post_process (bd);
-
- // Next argument.
- si->next ();
- } // end of while loop
- delete si;
- } // end of if
-
- return 0;
-}
-
-be_visitor_operation_ami_handler_arglist::~be_visitor_operation_ami_handler_arglist (void)
-{
-}
-
-int
-be_visitor_operation_ami_handler_arglist::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << " (" << be_idt << be_idt << be_nl;
-
- // First argument is a the return value of the operation.
-
- // Indent.
- os->indent ();
-
- // Get 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_ami_handler_arglist::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- // Grab the visitor.
-
- be_visitor_context ctx = *this->ctx_;
-
- // Set the state.
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RESULT_ARG);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // Pass the visitor.
- int result_printed = bt->accept (visitor);
- if (result_printed == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_arglist::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
- delete visitor;
- visitor = 0;
-
- if (result_printed)
- *os << ", " << be_nl;
-
- // Rest of the arguments.
-
- // All we do is hand over code generation to our scope.
- int args_printed = this->visit_scope (node);
- if (args_printed == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_arglist::"
- "visit_operation - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // Generate the CORBA::Environment parameter for the alternative
- // mapping.
- if (!idl_global->exception_support ())
- {
- // If the operation node has parameters, then we need to insert
- // a comma.
- // @@ Fix this.
- // if (result_printed || args_printed)
- // *os << "," << be_nl;
-
- os->indent ();
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CH:
- // Last argument - is always CORBA::Environment
- *os << "CORBA::Environment &ACE_TRY_ENV";
- *os << " = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt;
- break;
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CS:
- // Last argument - is always CORBA::Environment.
- *os << "CORBA::Environment &ACE_TRY_ENV";
- break;
- }
- }
- *os << be_uidt_nl << ")" << be_uidt;
-
- // Now generate the throw specs.
- *os << be_idt_nl << "ACE_THROW_SPEC ((CORBA::SystemException))"
- << be_uidt_nl;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CH:
- *os << ";" << be_nl << be_nl;
- break;
- default:
- *os << be_nl;
- }
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_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_ami_handler_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_ami_handler_arglist::"
- "visit_argument - "
- "Bad interface\n"),
- -1);
- }
- ctx.scope (intf); // set new scope
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CH:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_AMI_HANDLER_ARGLIST_CH);
- break;
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_AMI_HANDLER_ARGLIST_CS);
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_handler_arglist::"
- "visit_argument - "
- "Bad context\n"),
- -1);
- }
- }
-
- // Grab a visitor.
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_arglist::"
- "visit_argument - "
- "Bad visitor\n"),
- -1);
- }
-
- // Pass the visitor.
-
- int result = node->accept (visitor);
- if (result == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_handler_arglist::"
- "visit_argument - "
- "codegen for ami_handler_arglist failed\n"),
- -1);
- }
- delete visitor;
- return result;
-}
-
-int
-be_visitor_operation_ami_handler_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 << ",\n";
- }
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist_ch.cpp
deleted file mode 100644
index 121f7509a5b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist_ch.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_arglist_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the parameter list of the AMI
-// Handler's call back Operation signature.
-//
-// = AUTHOR
-// Aniruddha Gokhale and Alexander Babu Arulanthu
-// <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, ami_handler_arglist_ch, "$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_ami_handler_arglist_ch::be_visitor_operation_ami_handler_arglist_ch (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ami_handler_arglist_ch::~be_visitor_operation_ami_handler_arglist_ch (void)
-{
-}
-
-int
-be_visitor_operation_ami_handler_arglist_ch::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << " (" << be_idt << be_idt << "\n";
-
- // 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_ami_handler_arglist_ch::"
- "visit_operation - "
- "codegen for scope failed\n"),
- -1);
- }
-
- // No argument for exception. What will you do if you get the
- // exception from the call back method?
-
- // Arglist is over.
- *os << be_uidt_nl << ")" << be_uidt;
-
- // @@ No THROW SPECs. You can do anything if the call back guy
- // throws an exception. But I am not too sure about
- // this. (Alex).
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CH:
- // Each method is pure virtual in the header.
- *os << " = 0;\n\n";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_handler_arglist_ch::"
- "visit_operation - "
- "Bad operation\n"),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_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_);
-
- // 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_ami_handler_arglist_ch::"
- "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_ami_handler_arglist_ch::"
- "visit_argument - "
- "Bad interface\n"),
- -1);
- }
- ctx.scope (intf); // set new scope
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_AMI_HANDLER_ARGLIST);
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_handler_arglist_ch::"
- "visit_argument - "
- "Bad context\n"),
- -1);
- }
- }
-
- // Grab a visitor.
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_handler_arglist_ch::"
- "visit_argument - "
- "Bad visitor\n"),
- -1);
- }
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_handler_arglist_ch::"
- "visit_argument - "
- "codegen for ami_handler_arglist_ch failed\n"),
- -1);
- }
- delete visitor;
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_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
- // 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 << ",\n";
- }
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_argument_marshal.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_argument_marshal.cpp
deleted file mode 100644
index 0707400379e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_argument_marshal.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, ami_handler_argument_marshal, "$Id$")
-
-
-// ************************************************************
-// operation visitor to handle the passing of arguments to the CDR operators
-// ************************************************************
-
-be_compiled_visitor_operation_ami_handler_argument_marshal::
-be_compiled_visitor_operation_ami_handler_argument_marshal (be_visitor_context
- *ctx)
- : be_visitor_operation_argument (ctx),
- last_arg_printed_ (be_compiled_visitor_operation_ami_handler_argument_marshal::TAO_ARG_NONE)
-{
-}
-
-be_compiled_visitor_operation_ami_handler_argument_marshal::
-~be_compiled_visitor_operation_ami_handler_argument_marshal (void)
-{
-}
-
-int
-be_compiled_visitor_operation_ami_handler_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_compiled_visitor_operation_ami_handler_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)
- {
- // nothing
- }
- 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_compiled_visitor_operation_ami_handler_argument_marshal::TAO_ARG_NONE)
- *os << " &&\n";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- if (this->last_arg_printed_ !=
- be_compiled_visitor_operation_ami_handler_argument_marshal::TAO_ARG_NONE)
- *os << " &&\n";
- }
- break;
- case AST_Argument::dir_OUT:
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- if (this->last_arg_printed_ !=
- be_compiled_visitor_operation_ami_handler_argument_marshal::TAO_ARG_NONE)
- *os << " &&\n";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- if (this->last_arg_printed_ !=
- be_compiled_visitor_operation_ami_handler_argument_marshal::TAO_ARG_NONE)
- *os << " &&\n";
- }
- break;
- }
-
- return 0;
-}
-
-int
-be_compiled_visitor_operation_ami_handler_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_compiled_visitor_operation_ami_handler_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:
- // these arguments don't get printed for the << operator on the stub
- break;
- case AST_Argument::dir_INOUT:
- // only these arguments get printed
- this->last_arg_printed_ =
- be_compiled_visitor_operation_ami_handler_argument_marshal::TAO_ARG_INOUT;
- break;
- case AST_Argument::dir_OUT:
- // only these arguments get printed
- this->last_arg_printed_ =
- be_compiled_visitor_operation_ami_handler_argument_marshal::TAO_ARG_OUT;
- 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_compiled_visitor_operation_ami_handler_argument_marshal::TAO_ARG_INOUT;
- break;
- case AST_Argument::dir_OUT:
- // only these arguments get printed
- this->last_arg_printed_ =
- be_compiled_visitor_operation_ami_handler_argument_marshal::TAO_ARG_OUT;
- break;
- }
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_compiled_visitor_operation_ami_handler_argument_marshal"
- "::post_process - "
- "Bad sub state\n"),
- -1);
- }
- return 0;
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation.cpp
deleted file mode 100644
index 30f38acf344..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_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>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, ami_handler_operation_ch, "$Id$")
-
-
-// ************************************************************
-// Operation visitor for server header
-// ************************************************************
-
-be_visitor_operation_ami_handler_operation_ch::be_visitor_operation_ami_handler_operation_ch (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ami_handler_operation_ch::~be_visitor_operation_ami_handler_operation_ch (void)
-{
-}
-
-int
-be_visitor_operation_ami_handler_operation_ch::visit_operation (be_operation *node)
-{
- TAO_OutStream *os; // output stream
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node
-
- os->indent (); // start with the current indentation level
-
- // every operation is declared virtual in the client code
- *os << "virtual ";
-
- // STEP I: generate the return type. Return type is simpy void.
- *os << "void ";
-
- // 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_);
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_ami_handler_operation_ch::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_operation_ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- // Generating the skeleton method.
-
- // Skeleton not necessary for collocated class.
- if (this->ctx_->state () == TAO_CodeGen::TAO_COLLOCATED_AMI_HANDLER_OPERATION_CH)
- {
- return 0;
- /* NOT REACHED */
- }
-
- // 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;
-
- // Indent.
- os->indent ();
-
- *os << "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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->local_name () <<
- "_skel (" << be_idt << be_idt_nl;
-
- // Different skeletons for the AMI Handler class and the servant
- // class.
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_OPERATION_CH:
- *os << "CORBA::ServerRequest &_tao_req, " << be_nl
- << "void *_tao_obj, " << be_nl
- << "void *_tao_context, " << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");" << be_uidt << "\n\n";
- break;
-
- case TAO_CodeGen::TAO_AMI_HANDLER_STUB_OPERATION_CH:
- *os << "TAO_InputCDR &_tao_reply_cdr, " << be_nl
- << "Messaging::ReplyHandler_ptr _tao_reply_handler, " << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");" << be_uidt << "\n\n";
- break;
-
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_operation_ch::"
- "visit_operation - "
- "Unknown state\n"),
- -1);
- }
- }
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_ch.cpp
deleted file mode 100644
index 30f38acf344..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_ch.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_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>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, ami_handler_operation_ch, "$Id$")
-
-
-// ************************************************************
-// Operation visitor for server header
-// ************************************************************
-
-be_visitor_operation_ami_handler_operation_ch::be_visitor_operation_ami_handler_operation_ch (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ami_handler_operation_ch::~be_visitor_operation_ami_handler_operation_ch (void)
-{
-}
-
-int
-be_visitor_operation_ami_handler_operation_ch::visit_operation (be_operation *node)
-{
- TAO_OutStream *os; // output stream
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node
-
- os->indent (); // start with the current indentation level
-
- // every operation is declared virtual in the client code
- *os << "virtual ";
-
- // STEP I: generate the return type. Return type is simpy void.
- *os << "void ";
-
- // 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_);
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_ami_handler_operation_ch::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_operation_ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- // Generating the skeleton method.
-
- // Skeleton not necessary for collocated class.
- if (this->ctx_->state () == TAO_CodeGen::TAO_COLLOCATED_AMI_HANDLER_OPERATION_CH)
- {
- return 0;
- /* NOT REACHED */
- }
-
- // 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;
-
- // Indent.
- os->indent ();
-
- *os << "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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->local_name () <<
- "_skel (" << be_idt << be_idt_nl;
-
- // Different skeletons for the AMI Handler class and the servant
- // class.
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_OPERATION_CH:
- *os << "CORBA::ServerRequest &_tao_req, " << be_nl
- << "void *_tao_obj, " << be_nl
- << "void *_tao_context, " << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");" << be_uidt << "\n\n";
- break;
-
- case TAO_CodeGen::TAO_AMI_HANDLER_STUB_OPERATION_CH:
- *os << "TAO_InputCDR &_tao_reply_cdr, " << be_nl
- << "Messaging::ReplyHandler_ptr _tao_reply_handler, " << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");" << be_uidt << "\n\n";
- break;
-
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_operation_ch::"
- "visit_operation - "
- "Unknown state\n"),
- -1);
- }
- }
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_cs.cpp
deleted file mode 100644
index 89d14a4d74e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_cs.cpp
+++ /dev/null
@@ -1,810 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_operation_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the stubs file.
-//
-// = AUTHOR
-// Alexander Babu Arulanthu <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, ami_handler_operation_cs, "$Id$")
-
-
-// ************************************************************
-// Operation visitor for client stubs
-// ************************************************************
-
-be_visitor_operation_ami_handler_operation_cs::be_visitor_operation_ami_handler_operation_cs (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ami_handler_operation_cs::~be_visitor_operation_ami_handler_operation_cs (void)
-{
-}
-
-// processing to be done after every element in the scope is processed
-int
-be_visitor_operation_ami_handler_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_operation_cs::visit_operation (be_operation *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt; // type node
- be_visitor_context ctx; // visitor context
- be_visitor *visitor; // visitor
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node for future use
-
- // Start with the current indentation level.
- os->indent ();
-
- // Init 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_operation_cs::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- // Generate the return type. Return type is simply void.
- *os << "void " << be_nl;
-
- // Get 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_handler_operation_cs::"
- "visit_operation - "
- "scopeless operation :-<\n"),
- -1);
- }
-
- // Genereate scope name.
- *os << parent->compute_name ("AMI_", "_Handler");
-
- // Generate the operation name.
- *os << "::" << 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_AMI_HANDLER_OPERATION_ARGLIST_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if ((!visitor) || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_operation_cs::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- os->indent ();
- // 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 CORBA::Environment
- *os << "{" << be_idt_nl;
-
- // Deal with differences between IDL mapping for true C++ exceptions and
- // alternate mapping. Since our code uses the ACE_TRY_ENV variable in a
- // number of places, for the true exception case, we will have to explicitly
- // declare the ACE_TRY_ENV variable.
- *os << this->gen_environment_var () << be_nl;
-
- // Generate any pre stub info if and only if none of our parameters is of the
- // native type.
- if (!node->has_native ())
- {
- // native type does not exist.
-
- // Generate any "pre" stub information such as tables or declarations
- // This is a template method and the actual work will be done by the
- // derived class
- if (this->gen_pre_stub_info (node, bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "gen_pre_stub_info failed\n"),
- -1);
- }
- }
-
- // Declaring return type is not necessary. Since return type is
- // void.
-
- // Native exists => no stub.
- if (node->has_native ())
- {
- if (this->gen_raise_exception (bt, "CORBA::MARSHAL", "") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_operation_cs::"
- "visit_operation - "
- "codegen for return var failed\n"),
- -1);
- }
- }
- else
- {
- os->indent ();
- // Generate code that retrieves the underlying stub object and then
- // invokes do_static_call on it.
- *os << be_nl
- << "TAO_Stub *istub = this->_stubobj ();" << be_nl
- << "if (istub == 0)" << be_idt_nl;
-
- // If the stub object was bad, then we raise a system
- // exception.
- *os << "ACE_THROW (CORBA::INTERNAL ());\n\n";
-
- *os << be_uidt;
-
- // do any pre marshal and invoke stuff with arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_PRE_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for argument pre invoke failed\n"),
- -1);
- }
-
- // Generate the code for marshaling in the parameters and transmitting
- // them.
- if (this->gen_marshal_and_invoke (node, bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for marshal and invoke failed\n"),
- -1);
-
- }
-
- // Return type is void,
-
- } // end of if (!native)
-
- *os << be_uidt_nl << "}" << be_nl << be_nl;
-
- // Generate the skeleton method.
-
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_SKELETON_CS);
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for AMI Handler skeleton failed\n"),
- -1);
- }
- delete visitor;
-
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_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; // 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_handler_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_operation_cs::gen_raise_exception (be_type *bt,
- const char *excep,
- const char *completion_status)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- if (this->void_return_type (bt))
- {
- *os << "ACE_THROW ("
- << excep << " (" << completion_status << "));\n";
- }
- else
- {
- *os << "ACE_THROW_RETURN ("
- << excep << " (" << completion_status << "), ";
-
- // return the appropriate return value
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_operation_cs::"
- "gen_raise_exception - "
- "codegen for return var failed\n"),
- -1);
- }
- *os << ");\n";
- }
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_operation_cs::gen_check_exception (be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
- // check if there is an exception
- if (this->void_return_type (bt))
- {
- *os << "ACE_CHECK;\n";
- //<< "_tao_environment);\n";
- }
- else
- {
- *os << "ACE_CHECK_RETURN (";
- // << "_tao_environment, ";
-
- // return the appropriate return value
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_operation_cs::"
- "gen_check_exception - "
- "codegen failed\n"),
- -1);
- }
- *os << ");" << be_nl;
- }
-
- return 0;
-}
-
-// ************************************************************
-// Operation visitor for interpretive client stubs
-// ************************************************************
-
-be_interpretive_visitor_operation_ami_handler_operation_cs::
-be_interpretive_visitor_operation_ami_handler_operation_cs (be_visitor_context *ctx)
- : be_visitor_operation_ami_handler_operation_cs (ctx)
-{
-}
-
-be_interpretive_visitor_operation_ami_handler_operation_cs::~be_interpretive_visitor_operation_ami_handler_operation_cs (void)
-{
-}
-
-// concrete implementation of the template methods
-
-int
-be_interpretive_visitor_operation_ami_handler_operation_cs::gen_pre_stub_info (be_operation *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- // Generate the TAO_Param_Data table
- os->indent ();
- *os << "static const TAO_Param_Data ";
- // 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->flatname () <<
- "_paramdata [] = " << be_nl;
- *os << "{\n";
- os->incr_indent ();
-
- // entry for the return type
- *os << "{" << bt->tc_name () << ", PARAM_RETURN, 0}";
- if (node->nmembers () > 0)
- *os << ",\n";
-
- // generate entries for the param data table for arguments
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_handler_operation_cs::"
- "gen_pre_stub_info - "
- "visit scope failed\n"),
- -1);
- }
-
- os->indent ();
- *os << be_nl;
- os->decr_indent ();
- *os << "}; // " << node->flatname () << "_paramdata\n\n";
-
- // 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 ())
- {
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_interpretive_visitor_operation_ami_handler_operation_cs::"
- "gen_pre_stub_info - "
- "Exceptionlist generation error\n"),
- -1);
- }
- }
-
- // now generate the calldata table
- os->indent ();
- *os << "static const TAO_Call_Data ";
- // 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->flatname ()
- << "_calldata = " << 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->local_name () << "\", ";
-
- // are we oneway or two operation?
- if (node->flags () == AST_Operation::OP_oneway)
- {
- *os << "0, "; // for false
- }
- else
- {
- *os << "1, "; // for true
- }
- // insert the size of the paramdata table i.e., number of arguments + 1
- // for return type
- *os << (node->argument_count () + 1) << ", ";
-
- // insert the address of the paramdata table
- // first 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->flatname () << "_paramdata, ";
-
- // insert exception list (if any) - node for attributes
- if (this->ctx_->attribute ())
- *os << "0, 0};\n\n";
- else
- {
- if (node->exceptions ())
- {
- *os << node->exceptions ()->length ()
- << ", _tao_" << node->flatname () << "_exceptiondata};\n\n";
- }
- else
- *os << "0, 0};\n\n";
- }
- return 0;
-}
-
-int
-be_interpretive_visitor_operation_ami_handler_operation_cs::
-gen_marshal_and_invoke (be_operation*node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
- *os << "void* _tao_arguments["
- << node->argument_count () + 1 << "];" << be_nl
- << "const void** _tao_arg = ACE_const_cast (const void**,_tao_arguments);" << be_nl
- << "*_tao_arg = ";
-
- // pass the appropriate return value to docall
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_handler_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
- *os << "; _tao_arg++;\n";
-
- // pass each argument to do_static_call
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_handler_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
- delete visitor;
- visitor=0;
-
- // call do_static_call with appropriate number of arguments
- os->indent ();
- *os << "istub->do_static_call (" << be_idt_nl
- << "ACE_TRY_ENV, " << 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->flatname () << "_calldata," << be_nl
- << "_tao_arguments" << be_uidt_nl
- << ");\n";
-
- os->indent ();
- // check if there is an exception
- if (this->gen_check_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_handler_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
-
- }
-
- // do any post processing for the arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_operation_cs::"
- "visit_operation - "
- "codegen for args post do_static_call failed\n"),
- -1);
- }
- delete visitor;
- visitor = 0;
-
- // do any post processing for the retval
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_POST_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_operation_cs::"
- "visit_operation - "
- "codegen for return type post do_static_call failed\n"),
- -1);
- }
- delete visitor;
-
- return 0;
-}
-
-// ************************************************************
-// Operation visitor for compiled client stubs
-// ************************************************************
-
-be_compiled_visitor_operation_ami_handler_operation_cs::
-be_compiled_visitor_operation_ami_handler_operation_cs (be_visitor_context *ctx)
- : be_visitor_operation_ami_handler_operation_cs (ctx)
-{
-}
-
-be_compiled_visitor_operation_ami_handler_operation_cs::~be_compiled_visitor_operation_ami_handler_operation_cs (void)
-{
-}
-
-// concrete implementation of the template methods
-
-int
-be_compiled_visitor_operation_ami_handler_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_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_compiled_visitor_operation_ami_handler_operation_cs::"
- "gen_pre_stub_info - "
- "Exceptionlist generation error\n"),
- -1);
- }
- delete visitor;
- }
-
- return 0;
-}
-
-int
-be_compiled_visitor_operation_ami_handler_operation_cs::
-gen_marshal_and_invoke (be_operation *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
-
- // Create the GIOP_Invocation and grab the outgoing CDR stream.
- switch (node->flags ())
- {
- case AST_Operation::OP_oneway:
- *os << "TAO_GIOP_Oneway_Invocation _tao_call ";
- break;
- default:
- *os << "TAO_GIOP_Twoway_Invocation _tao_call ";
- }
- *os << "(" << be_idt << be_idt_nl
- << "istub," << be_nl;
-
- 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->original_local_name ()
- << "\"," << be_nl
- << "istub->orb_core ()" << be_uidt_nl
- << ");" << be_uidt_nl;
-
- *os << "\n" << be_nl
- << "for (;;)" << be_nl
- << "{" << be_idt_nl;
-
- *os << "ACE_TRY_ENV.clear ();" << be_nl;
- *os << "_tao_call.start (ACE_TRY_ENV);" << be_nl;
- // Check if there is an exception.
- *os << "ACE_CHECK;";
-
- // Now make sure that we have some AMI result parameter or OUT or
- // INOUT parameters. Otherwise, there is nothing to be marshaled
- // in.
- if (!this->void_return_type (bt) ||
- this->has_param_type (node, AST_Argument::dir_OUT) ||
- this->has_param_type (node, AST_Argument::dir_INOUT))
- {
- *os << be_nl
- << "TAO_OutputCDR &_tao_out = _tao_call.out_stream ();"
- << be_nl
- << "if (!(\n" << be_idt << be_idt << be_idt;
-
- // @@ Michael: This has to be replaced witht he code in the
- // "#if 0" clause
- // Marshal the ami result argument, if the return type is not
- // void.
- if (!this->void_return_type (bt))
- {
- os->indent ();
- *os << "(_tao_out << _tao_retval)";
-
- // Print the && if there are OUT or INOUT arguements in the
- // signature.
- if (this->has_param_type (node, AST_Argument::dir_OUT) ||
- this->has_param_type (node, AST_Argument::dir_INOUT))
- *os << " &&\n";
- }
-
-#if 0
- // @@ This for giving the _tao_retval argument only. But
- // this may be needed for some data types.
- // But the one that is above is ok for basic types.
- // @@ We may need to do this.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_MARSHAL_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_handler_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
- delete visitor;
- visitor = 0;
-#endif /* 0 */
-
- // Marshal each out and inout argument.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_MARSHAL_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_handler_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
- delete visitor;
- visitor = 0;
-
- *os << be_uidt << be_uidt_nl
- << "))" << be_nl;
-
- // if marshaling fails, raise exception.
- *os << "ACE_THROW (CORBA::MARSHAL ());";
-
- *os << be_uidt;
- }
-
- *os << be_nl
- << "int _invoke_status =" << be_idt_nl;
- if (node->flags () == AST_Operation::OP_oneway)
- {
- // oneway operation
- *os << "_tao_call.invoke (ACE_TRY_ENV);";
- }
- else
- {
- if (node->exceptions ())
- {
- *os << "_tao_call.invoke (_tao_" << node->flatname ()
- << "_exceptiondata, "
- << node->exceptions ()->length ()
- << ", ACE_TRY_ENV);";
- }
- else
- {
- *os << "_tao_call.invoke (0, 0, ACE_TRY_ENV);";
- }
- }
-
- *os << be_uidt_nl;
-
- // Check if there is an exception.
- *os << "ACE_CHECK;";
-
- *os << be_nl
- << "if (_invoke_status == TAO_INVOKE_RESTART)" << be_idt_nl
- << "continue;" << be_uidt_nl
- << "// if (_invoke_status == TAO_INVOKE_EXCEPTION)" << be_idt_nl
- << "// cannot happen" << be_uidt_nl
- << "if (_invoke_status != TAO_INVOKE_OK)" << be_nl
- << "{" << be_idt_nl;
-
- // Check if there is an exception.
- *os << "ACE_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES));";
-
- *os << be_uidt_nl
- << "}" << be_nl
- << "break;" << be_nl
- << be_uidt_nl << "}" << be_nl;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_result_arg.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_result_arg.cpp
deleted file mode 100644
index ce3f1b178ce..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_result_arg.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_result_arg.cpp
-//
-// = DESCRIPTION
-// Visitor that generates the result argument in a call back method
-// of a Reply Handler.
-//
-// = AUTHOR
-// Aniruddha Gokhale and Alexander Babu Arulanthu
-// <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_operation, ami_handler_result_arg, "$Id$")
-
-
-// ************************************************************
-// Visitor for parameter list in AMI Handler call back declarations
-// and definitions.
-// ************************************************************
-
-be_visitor_operation_ami_handler_result_arg::be_visitor_operation_ami_handler_result_arg (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_operation_ami_handler_result_arg::~be_visitor_operation_ami_handler_result_arg (void)
-{
-}
-
-int
-be_visitor_operation_ami_handler_result_arg::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- be_type *bt = be_type::narrow_from_decl (node);
-
- *os << "const " << bt->type_name (node) << " _tao_ami_result";
-
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_result_arg::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- *os << this->type_name (node) << " _tao_ami_result" ;
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_result_arg::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- *os << this->type_name (node, "_ptr") << " _tao_ami_result";
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_result_arg::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- *os << this->type_name (node, "_ptr") << " _tao_ami_result";
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_result_arg::visit_native (be_native *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- *os << this->type_name (node) << " _tao_ami_result";
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_result_arg::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- // check if the type is an any
- if (node->pt () == AST_PredefinedType::PT_any)
- {
- *os << "const " << this->type_name (node) << " &" << " _tao_ami_result";
- }
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
- {
- *os << this->type_name (node, "_ptr") << " _tao_ami_result";
- }
- else // simple predefined types
- {
- *os << this->type_name (node) << " _tao_ami_result";
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_result_arg::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- *os << "const " << this->type_name (node) << " &" << " _tao_ami_result";
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_result_arg::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- *os << "const char *" << " _tao_ami_result";
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_result_arg::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- *os << "const " << this->type_name (node) << " &" << " _tao_ami_result";
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_result_arg::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- *os << "const " << this->type_name (node) << " &" << " _tao_ami_result";
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_result_arg::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_ami_handler_result_arg::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 0;
-}
-
-
-#ifdef IDL_HAS_VALUETYPE
-
-int
-be_visitor_operation_ami_handler_result_arg::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- *os << this->type_name (node) << " *" << " _tao_ami_result";
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_result_arg::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- *os << "const " << this->type_name (node) << " *" << " _tao_ami_result";
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp
deleted file mode 100644
index d6936926da6..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp
+++ /dev/null
@@ -1,486 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_handler_skeleton_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the stubs file.
-//
-// = AUTHOR
-// Alexander Babu Arulanthu <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, ami_handler_skeleton_cs, "$Id$")
-
-
-// ************************************************************
-// Operation visitor for client stubs
-// ************************************************************
-
-be_visitor_operation_ami_handler_skeleton_cs::be_visitor_operation_ami_handler_skeleton_cs (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ami_handler_skeleton_cs::~be_visitor_operation_ami_handler_skeleton_cs (void)
-{
-}
-
-// processing to be done after every element in the scope is processed
-int
-be_visitor_operation_ami_handler_skeleton_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_skeleton_cs::visit_operation (be_operation *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt; // type node
- be_visitor_context ctx; // visitor context
- be_visitor *visitor = 0; // visitor
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node for future use
-
- // Init 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_skeleton_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 == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_skeleton_cs::"
- "visit_operation - "
- "scopeless operation :-<\n"),
- -1);
- }
-
- // Genereate scope name.
- *os << parent->compute_name ("AMI_", "_Handler");
-
- // Generate the operation name.
- *os << "::" << node->local_name () << "_skel (" << be_idt_nl;
-
- // Generate the argument list.
- *os << "TAO_InputCDR &_tao_in, " << be_nl
- << "Messaging::ReplyHandler_ptr _tao_reply_handler," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV"<< be_uidt << be_uidt_nl
- << ")" << be_nl;
-
- // 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 CORBA::Environment
- *os << "{\n" << be_idt;
-
- // Deal with differences between IDL mapping for true C++ exceptions and
- // alternate mapping. Since our code uses the ACE_TRY_ENV variable in a
- // number of places, for the true exception case, we will have to explicitly
- // declare the ACE_TRY_ENV variable.
- *os << this->gen_environment_var () << be_nl;
-
- // Generate any pre stub info if and only if none of our parameters is of the
- // native type.
- if (!node->has_native ())
- {
- // native type does not exist.
-
- // Generate any "pre" stub information such as tables or declarations
- // This is a template method and the actual work will be done by the
- // derived class
- if (this->gen_pre_stub_info (node, bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "gen_pre_stub_info failed\n"),
- -1);
- }
- }
-
- os->indent();
-
- *os << "// Retrieve Reply Handler object." << be_nl;
- *os << parent->compute_name ("AMI_", "_Handler") << "_var "
- << "_tao_reply_handler_object =" << be_idt_nl;
-
- *os << parent->compute_name ("AMI_", "_Handler");
- *os << "::_narrow(_tao_reply_handler, ACE_TRY_ENV);" << be_uidt_nl;
-
- *os << "ACE_CHECK;" << be_nl << be_nl
- << "// @@ Error handling " << be_nl << be_nl;
-
- *os << "//Demarshall all the arguments.\n";
-
- // declare a return type variable
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) ami_handler_skeleton_cs::"
- "visit_operation - "
- "codegen for return var decl failed\n"),
- -1);
- }
- delete visitor;
- visitor = 0;
-
- // declare variables for arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DECL_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) ami_handler_skeleton_cs::"
- "visit_operation - "
- "codegen for return var decl failed\n"),
- -1);
- }
- delete visitor;
- visitor = 0;
-
- // Demarshal parameters
- if (this->gen_marshal_and_invoke (node, bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%1) ami_handler_skeleton_cs::"
- "visit_operation - "
- "gen_demarshal_params failed\n"),
- -1);
- }
-
- *os << be_uidt_nl << "};" << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_skeleton_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; // 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_handler_skeleton_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_skeleton_cs::gen_raise_exception (be_type *bt,
- const char *excep,
- const char *completion_status)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- if (this->void_return_type (bt))
- {
- *os << "ACE_THROW ("
- << excep << " (" << completion_status << "));\n";
- }
- else
- {
- *os << "ACE_THROW_RETURN ("
- << excep << " (" << completion_status << "), ";
-
- // return the appropriate return value
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_skeleton_cs::"
- "gen_raise_exception - "
- "codegen for return var failed\n"),
- -1);
- }
- *os << ");\n";
- }
- return 0;
-}
-
-int
-be_visitor_operation_ami_handler_skeleton_cs::gen_check_exception (be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
- // check if there is an exception
- if (this->void_return_type (bt))
- {
- *os << "ACE_CHECK;\n";
- //<< "_tao_environment);\n";
- }
- else
- {
- *os << "ACE_CHECK_RETURN (";
- // << "_tao_environment, ";
-
- // return the appropriate return value
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_skeleton_cs::"
- "gen_check_exception - "
- "codegen failed\n"),
- -1);
- }
- *os << ");\n";
- }
-
- return 0;
-}
-
-// ************************************************************
-// Operation visitor for interpretive client skeletons of the AMI reply handler
-// ************************************************************
-
-be_interpretive_visitor_operation_ami_handler_skeleton_cs::
-be_interpretive_visitor_operation_ami_handler_skeleton_cs (be_visitor_context *ctx)
- : be_visitor_operation_ami_handler_skeleton_cs (ctx)
-{
-}
-
-be_interpretive_visitor_operation_ami_handler_skeleton_cs::~be_interpretive_visitor_operation_ami_handler_skeleton_cs (void)
-{
-}
-
-// concrete implementation of the template methods
-
-int
-be_interpretive_visitor_operation_ami_handler_skeleton_cs::gen_pre_stub_info (be_operation *node,
- be_type *bt)
-{
- ACE_UNUSED_ARG (node);
- ACE_UNUSED_ARG (bt);
-
- // @@ Michael: To be done.
- return 0;
-}
-
-int
-be_interpretive_visitor_operation_ami_handler_skeleton_cs::
-gen_marshal_and_invoke (be_operation*node,
- be_type *bt)
-{
- ACE_UNUSED_ARG (node);
- ACE_UNUSED_ARG (bt);
-
- // @@ Michael: To be done.
- return 0;
-}
-
-// ************************************************************
-// Operation visitor for compiled client skeletons of the AMI reply handler
-// ************************************************************
-
-be_compiled_visitor_operation_ami_handler_skeleton_cs::
-be_compiled_visitor_operation_ami_handler_skeleton_cs (be_visitor_context *ctx)
- : be_visitor_operation_ami_handler_skeleton_cs (ctx)
-{
-}
-
-be_compiled_visitor_operation_ami_handler_skeleton_cs::~be_compiled_visitor_operation_ami_handler_skeleton_cs (void)
-{
-}
-
-// concrete implementation of the template methods
-
-int
-be_compiled_visitor_operation_ami_handler_skeleton_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_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_compiled_visitor_operation_ami_handler_skeleton_cs::"
- "gen_pre_stub_info - "
- "Exceptionlist generation error\n"),
- -1);
- }
- delete visitor;
- }
-
- return 0;
-}
-
-int
-be_compiled_visitor_operation_ami_handler_skeleton_cs::
-gen_marshal_and_invoke (be_operation *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor = 0;
- be_visitor_context ctx;
-
- os->indent ();
-
- *os << "if (!(\n" << be_idt << be_idt << be_idt;
-
- if (!this->void_return_type (bt))
- {
- // demarshal the return val
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DEMARSHAL_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_handler_skeleton_cs::"
- "gen_demarshal_params - "
- "codegen for return var failed\n"),
- -1);
- }
- delete visitor;
-
- // Print the && if there are OUT or INOUT arguements in the
- // signature.
- if (this->has_param_type (node, AST_Argument::dir_OUT) ||
- this->has_param_type (node, AST_Argument::dir_INOUT))
- *os << " &&\n";
- }
-
- if (this->has_param_type (node, AST_Argument::dir_INOUT) ||
- this->has_param_type (node, AST_Argument::dir_OUT))
- {
- // demarshal each in and inout argument
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DEMARSHAL_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_handler_skeleton_cs::"
- "gen_marshal_params - "
- "codegen for args failed\n"),
- -1);
- }
- delete visitor;
- }
-
- *os << be_uidt << be_uidt_nl
- << " ))" << be_nl
- << "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->"
- << node->local_name () << " (" << be_idt_nl;
-
- // if we have a non-void return type then pass it as the first argument
- if (!this->void_return_type (bt))
- *os << "_tao_retval,\n";
-
- // generate the argument list containing the inout and inout arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) ami_handler_skeleton_cs::"
- "visit_operation - "
- "codegen for making upcall failed\n"),
- -1);
- }
- delete visitor;
- visitor = 0;
-
- *os << be_nl << ");" << be_uidt_nl;
-
- *os << "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 a154fd94c07..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp
+++ /dev/null
@@ -1,221 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// arglist.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the parameter list of the Operation signature.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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 << "\n";
-
- // 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);
- }
-
- // generate the CORBA::Environment parameter for the alternative mapping
- if (!idl_global->exception_support ())
- {
- // if the operation node has parameters, then we need to insert a comma
- if (node->argument_count () > 0)
- *os << ",\n";
-
- os->indent ();
- 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 << "CORBA::Environment &ACE_TRY_ENV";
- *os << " = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt;
- break;
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_IS:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_IH:
- // last argument - is always CORBA::Environment
- *os << "CORBA::Environment &ACE_TRY_ENV";
- break;
- default:
- *os << "CORBA::Environment &ACE_TRY_ENV";
- break;
- }
- }
- *os << be_uidt_nl << ")" << be_uidt;
-
- // now generate the throw specs
- if (this->gen_throw_spec (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_operation_arglist")
- ASYS_TEXT ("::visit_operation - ")
- ASYS_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:
- *os << ";\n\n";
- break;
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH:
- // each method is pure virtual in the server header
- *os << " = 0;\n\n";
- break;
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_IS:
- default:
- *os << "\n";
- }
-
- 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);
- }
- ctx.scope (intf); // set new scope
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_CH:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_ARGLIST_CH);
- break;
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_OTHERS:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_IH:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_IS:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_COLLOCATED_SH:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_ARGLIST_OTHERS);
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arglist::"
- "visit_argument - "
- "Bad context\n"),
- -1);
- }
- }
-
- // grab a visitor
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arglist::"
- "visit_argument - "
- "Bad visitor\n"),
- -1);
- }
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arglist::"
- "visit_argument - "
- "codegen for arglist failed\n"),
- -1);
- }
- delete visitor;
- 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 << ",\n";
- }
- 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 a36fd00d9a4..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp
+++ /dev/null
@@ -1,253 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// argument.cpp
-//
-// = DESCRIPTION
-// Visitor that calls the visitor for arguments.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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.
- if (!this->last_node (bd))
- {
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS:
- case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS:
- case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS:
- case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS:
- *os << ",\n";
- break;
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS:
- {
- // @@ Michael
- // In the case of of AMI, we do not want to
- // print a comma for in arguments.
- // This is due to the concept of post processing,
- // which I was not able to prevent to be executed
- // in the case of in arguments.
- be_argument *arg = this->ctx_->be_node_as_argument ();
- ACE_ASSERT (arg != 0);
- if (arg->direction () != AST_Argument::dir_IN)
- *os << ",\n";
- }
- 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
- // CORBA::Environment parameter as the last parameter
- if (!idl_global->exception_support ())
- {
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS:
- case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS:
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS:
- // applicable only to these cases where the actual upcall is made
-
- // last argument is the environment
- if (node->argument_count () > 0)
- // insert a comma only if there were previous parameters
- *os << ",\n";
- os->indent ();
- *os << "ACE_TRY_ENV";
- 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); // set new scope
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OPERATION_ARG_PRE_INVOKE_CS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_PRE_INVOKE_CS);
- break;
- case TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_INVOKE_CS);
- break;
- case TAO_CodeGen::TAO_AMI_OPERATION_ARG_INVOKE_CS:
- ctx.state (TAO_CodeGen::TAO_AMI_ARGUMENT_INVOKE_CS);
- break;
-// @@ Michael case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_INVOKE_CS:
-// ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS);
-// break;
- case TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_POST_INVOKE_CS);
- break;
- case TAO_CodeGen::TAO_OPERATION_ARG_DECL_SS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS);
- break;
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DECL_CS:
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS);
- break;
- case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_DEMARSHAL_SS);
- break;
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DEMARSHAL_CS:
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_DEMARSHAL_CS);
- break;
- case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_MARSHAL_SS);
- break;
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_MARSHAL_CS:
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_MARSHAL_CS);
- break;
- case TAO_CodeGen::TAO_OPERATION_ARG_PRE_UPCALL_SS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS);
- break;
- case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS);
- break;
- case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS);
- break;
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS:
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS);
- break;
- case TAO_CodeGen::TAO_OPERATION_ARG_POST_UPCALL_SS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS);
- break;
- case TAO_CodeGen::TAO_OPERATION_ARG_POST_MARSHAL_SS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_POST_MARSHAL_SS);
- break;
- // case TAO_CodeGen::TAO_OPERATION_ARG_AMI:
- // ctx.state (TAO_CodeGen::TAO_ARGUMENT_AMI);
- // break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_argument::"
- "visit_argument - "
- "Bad context\n"),
- -1);
- }
- }
-
- // grab a visitor
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_argument::"
- "visit_argument - "
- "Bad visitor\n"),
- -1);
- }
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_argument::"
-
- "visit_argument - "
- "codegen for argument failed\n"),
- -1);
- }
- delete visitor;
- 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 ab97bf649f1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp
+++ /dev/null
@@ -1,173 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, argument_invoke, "$Id$")
-
-
-// ************************************************************
-// operation visitor to handle the passing of arguments to the CDR operators
-// ************************************************************
-
-be_compiled_visitor_operation_argument_invoke::
-be_compiled_visitor_operation_argument_invoke (be_visitor_context
- *ctx)
- : be_visitor_operation_argument (ctx),
- last_arg_printed_ (be_compiled_visitor_operation_argument_invoke::TAO_ARG_NONE)
-{
-}
-
-be_compiled_visitor_operation_argument_invoke::
-~be_compiled_visitor_operation_argument_invoke (void)
-{
-}
-
-int
-be_compiled_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_compiled_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_compiled_visitor_operation_argument_invoke::TAO_ARG_NONE)
- *os << " &&\n";
- }
- 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_compiled_visitor_operation_argument_invoke::TAO_ARG_NONE)
- *os << " &&\n";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- if (this->last_arg_printed_ !=
- be_compiled_visitor_operation_argument_invoke::TAO_ARG_NONE)
- *os << " &&\n";
- }
- 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_compiled_visitor_operation_argument_invoke::TAO_ARG_NONE)
- *os << " &&\n";
- }
- break;
- }
-
- return 0;
-}
-
-int
-be_compiled_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_compiled_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_compiled_visitor_operation_argument_invoke::TAO_ARG_IN;
- break;
- case AST_Argument::dir_INOUT:
- // only these arguments get printed
- this->last_arg_printed_ =
- be_compiled_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_compiled_visitor_operation_argument_invoke::TAO_ARG_INOUT;
- break;
- case AST_Argument::dir_OUT:
- // only these arguments get printed
- this->last_arg_printed_ =
- be_compiled_visitor_operation_argument_invoke::TAO_ARG_OUT;
- break;
- }
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_compiled_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 700c11a34ed..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp
+++ /dev/null
@@ -1,275 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, argument_marshal, "$Id$")
-
-
-// ************************************************************
-// operation visitor to handle the passing of arguments to the CDR operators
-// ************************************************************
-
-be_compiled_visitor_operation_argument_marshal::
-be_compiled_visitor_operation_argument_marshal (be_visitor_context
- *ctx)
- : be_visitor_operation_argument (ctx),
- last_arg_printed_ (be_compiled_visitor_operation_argument_marshal::TAO_ARG_NONE)
-{
-}
-
-be_compiled_visitor_operation_argument_marshal::
-~be_compiled_visitor_operation_argument_marshal (void)
-{
-}
-
-int
-be_compiled_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_compiled_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_compiled_visitor_operation_argument_marshal::TAO_ARG_NONE)
- *os << " &&\n";
- }
- 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_compiled_visitor_operation_argument_marshal::TAO_ARG_NONE)
- *os << " &&\n";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- if (this->last_arg_printed_ !=
- be_compiled_visitor_operation_argument_marshal::TAO_ARG_NONE)
- *os << " &&\n";
- }
- 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_compiled_visitor_operation_argument_marshal::TAO_ARG_NONE)
- *os << " &&\n";
- }
- break;
- }
-
- return 0;
-}
-
-int
-be_compiled_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_compiled_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_compiled_visitor_operation_argument_marshal::TAO_ARG_IN;
- break;
- case AST_Argument::dir_INOUT:
- // only these arguments get printed
- this->last_arg_printed_ =
- be_compiled_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_compiled_visitor_operation_argument_marshal::TAO_ARG_INOUT;
- break;
- case AST_Argument::dir_OUT:
- // only these arguments get printed
- this->last_arg_printed_ =
- be_compiled_visitor_operation_argument_marshal::TAO_ARG_OUT;
- break;
- }
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_compiled_visitor_operation_argument_marshal"
- "::post_process - "
- "Bad sub state\n"),
- -1);
- }
- return 0;
-}
-
-// ****************************************************************
-
-be_visitor_compiled_args_decl::be_visitor_compiled_args_decl (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-int
-be_visitor_compiled_args_decl::visit_operation (be_operation *node)
-{
- return this->visit_scope (node);
-}
-
-int
-be_visitor_compiled_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_compiled_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_compiled_args_decl::"
- "visit_array - "
- "cannot retrieve argument 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
-
- 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->fullname (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname, "_%s", node->fullname ());
- }
- }
- else
- {
- // typedefed node
- ACE_OS::sprintf (fname, "%s", node->fullname ());
- }
-
- 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_compiled_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_compiled_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/compiled_marshal.cpp b/TAO/TAO_IDL/be/be_visitor_operation/compiled_marshal.cpp
deleted file mode 100644
index 675a5807d94..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/compiled_marshal.cpp
+++ /dev/null
@@ -1,500 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// compiled_marshal.cpp
-//
-// = DESCRIPTION
-// Visitor generating the code that passes retval to the CDR operators. The
-// "OUTPUT" substate deals with the server side skeletons whereas the
-// "INPUT" substate deals with the client stubs. Also notice that the type
-// of parameter passed to the operator depends on the manner in which the
-// variable is declared i.e., in the skeleton, we may have _var types but
-// not in the stubs.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, compiled_marshal, "$Id$")
-
-
-// ****************************************************************************
-// visitor for arguments passing to the CDR operators.
-// ****************************************************************************
-
-be_visitor_operation_rettype_compiled_marshal::
-be_visitor_operation_rettype_compiled_marshal (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_operation_rettype_compiled_marshal::
-~be_visitor_operation_rettype_compiled_marshal (void)
-{
-}
-
-int be_visitor_operation_rettype_compiled_marshal::
-visit_operation (be_operation *node)
-{
- this->ctx_->node (node); // save the argument node
-
- // retrieve the type of the argument
- be_type *bt = be_type::narrow_from_decl (node->return_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "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)
- {
- os->indent ();
- *os << "(_tao_out << ";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- os->indent ();
- *os << "(_tao_in >> ";
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_operation - "
- "Bad substate\n"),
- -1);
- }
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_operation - "
- "cannot accept visitor\n"),
- -1);
- }
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- *os << ")";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- *os << ")";
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_operation - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_operation_rettype_compiled_marshal::visit_array (be_array *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
-#if 0
- *os << node->name () << "_forany (";
- if (node->size_type () == be_decl::VARIABLE)
- *os << "(" << node->name () << "_slice *)"
- << "_tao_retval.in ()" << ")";
- else
- *os << "_tao_retval" << ")";
-#else
- *os << "_tao_retval_forany";
-#endif
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- *os << "_tao_retval_forany";
- // *os << node->name () << "_forany ("
- // << "_tao_retval" << ")";
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_array - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_operation_rettype_compiled_marshal::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- *os << "_tao_retval";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- *os << "_tao_retval";
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_enum - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_operation_rettype_compiled_marshal::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- *os << "_tao_retval.in ()";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- *os << "_tao_retval";
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_operation_rettype_compiled_marshal::visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- *os << "_tao_retval.in ()";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- *os << "_tao_retval";
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-int be_visitor_operation_rettype_compiled_marshal::visit_valuetype (be_valuetype *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- *os << "_tao_retval.in ()";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- *os << "_tao_retval";
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_valuetype - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_operation_rettype_compiled_marshal::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- *os << "_tao_retval.in ()";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- *os << "_tao_retval";
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_valuetype - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-int be_visitor_operation_rettype_compiled_marshal::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- *os << "_tao_retval.in ()";
- break;
- case AST_PredefinedType::PT_any:
- *os << "_tao_retval.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 << "_tao_retval";
- break;
- case AST_PredefinedType::PT_char:
- *os << "CORBA::Any::from_char (_tao_retval)";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "CORBA::Any::from_wchar (_tao_retval)";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "CORBA::Any::from_boolean (_tao_retval)";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "CORBA::Any::from_octet (_tao_retval)";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_array - "
- "Bad predefined type\n"),
- -1);
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- *os << "_tao_retval";
- break;
- case AST_PredefinedType::PT_any:
- *os << "*_tao_retval";
- 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 << "_tao_retval";
- break;
- case AST_PredefinedType::PT_char:
- *os << "CORBA::Any::to_char (_tao_retval)";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "CORBA::Any::to_wchar (_tao_retval)";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "CORBA::Any::to_boolean (_tao_retval)";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "CORBA::Any::to_octet (_tao_retval)";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_array - "
- "Bad predefined type\n"),
- -1);
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_array - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_operation_rettype_compiled_marshal::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- *os << "_tao_retval.in ()";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- *os << "*_tao_retval";
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_operation_rettype_compiled_marshal::visit_string (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- // differentiate between bounded and unbounded
- if (node->max_size ()->ev ()->u.ulval == 0)
- {
- *os << "_tao_retval.in ()";
- }
- else
- {
- *os << "CORBA::Any::from_string ((char *)_tao_retval.in (), "
- << node->max_size ()->ev ()->u.ulval - 1 << ")";
- }
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- // differentiate between bounded and unbounded
- if (node->max_size ()->ev ()->u.ulval == 0)
- // unbounded
- *os << "_tao_retval";
- else
- *os << "CORBA::Any::to_string (_tao_retval, "
- << node->max_size ()->ev ()->u.ulval - 1 << ")";
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_operation_rettype_compiled_marshal::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- if (node->size_type () == be_decl::VARIABLE)
- *os << "_tao_retval.in ()";
- else
- *os << "_tao_retval";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- if (node->size_type () == be_decl::VARIABLE)
- *os << "*_tao_retval";
- else
- *os << "_tao_retval";
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
- return 0;
-}
-
-int be_visitor_operation_rettype_compiled_marshal::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT)
- {
- if (node->size_type () == be_decl::VARIABLE)
- *os << "_tao_retval.in ()";
- else
- *os << "_tao_retval";
- }
- else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT)
- {
- if (node->size_type () == be_decl::VARIABLE)
- *os << "*_tao_retval";
- else
- *os << "_tao_retval";
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_compiled_marshal::"
- "visit_interface - "
- "Bad substate\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_operation_rettype_compiled_marshal::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_compiled_marshal::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_sh.cpp
deleted file mode 100644
index 19c9b14417e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_sh.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// direct_collocated_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for direct_collocated operation in the server header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, direct_collocated_sh, "$Id$")
-
-
-// *************************************************************************
-// be_visitor_operation_direct_collocated_sh --
-// This visitor generates code for the direct_collocated operation signature in a
-// server header file
-// *************************************************************************
-
-be_visitor_operation_direct_collocated_sh::be_visitor_operation_direct_collocated_sh
-(be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_operation_direct_collocated_sh::~be_visitor_operation_direct_collocated_sh (void)
-{
-}
-
-int be_visitor_operation_direct_collocated_sh::visit_operation (be_operation *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt; // type node representing the return type
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node
-
- os->indent (); // start with the current indentation level
-
- // every operation is declared virtual in the client code
- *os << "virtual ";
-
- // STEP I: generate the return 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_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_sh::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_sh::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
- delete visitor;
-
- // 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_COLLOCATED_SH);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_sh::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_sh::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_ss.cpp
deleted file mode 100644
index 3d4a0bdcf15..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_ss.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// direct_collocated_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for direct_collocated Operation in the skeleton.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, direct_collocated_ss, "$Id$")
-
-
-// *************************************************************************
-// be_visitor_operation_direct_collocated_ss --
-// This visitor generates code for the direct_collocated operation signature in a
-// server skeletons file
-// *************************************************************************
-
-be_visitor_operation_direct_collocated_ss::be_visitor_operation_direct_collocated_ss
-(be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_operation_direct_collocated_ss::~be_visitor_operation_direct_collocated_ss (void)
-{
-}
-
-int be_visitor_operation_direct_collocated_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;
- 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);
- }
-
- // 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_direct_collocated_ss::"
- "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_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_direct_collocated_ss::"
- "visit_operation - "
- "Bad visitor for return type\n"),
- -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_direct_collocated_ss::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
- delete visitor;
-
- *os << " " << intf->full_coll_name (be_interface::DIRECT) << "::"
- << node->local_name () << " ";
-
- // STEP 4: generate the argument list with the appropriate mapping (same as
- // in the header file)
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_OTHERS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_cs::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- *os << "{" << be_idt << "\n";
-
- os->indent ();
-
- if (!this->void_return_type (bt))
- {
- *os << "return ";
- }
-
- *os << "this->servant_";
- if (this->gen_invoke (ctx, node) == -1)
- return -1;
-
- *os << be_uidt_nl
- << "}\n\n";
-
- return 0;
-}
-
-int be_visitor_operation_direct_collocated_ss::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 *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_direct_collocated_ss::"
- "gen_invoke - "
- "codegen for making upcall failed\n"),
- -1);
- }
-
- // end the upcall
- *os << be_uidt_nl
- << ");\n" << be_uidt;
- return 0;
-}
-
-int
-be_visitor_operation_direct_collocated_ss::gen_check_exception (be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
- // check if there is an exception
- if (!this->void_return_type (bt))
- {
- *os << "ACE_CHECK_RETURN (";
- // << "_tao_environment, ";
-
- // return the appropriate return value
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_direct_collocated_cs::"
- "gen_check_exception - "
- "codegen failed\n"),
- -1);
- }
- *os << ");\n";
- }
- else
- {
- *os << "ACE_CHECK;\n";
- //<< "_tao_environment);\n";
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_direct_collocated_ss::void_return_type (be_type *bt)
-{
- // is the operation return type void?
-
- if (bt->node_type () == AST_Decl::NT_pre_defined
- && (be_predefined_type::narrow_from_decl (bt)->pt ()
- == AST_PredefinedType::PT_void))
- return 1;
- else
- 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 771706f01af..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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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 (); // grab the out stream
- // don't do anything if the exception list is empty
- if (node->exceptions ())
- {
- os->indent ();
- *os << "static TAO_Exception_Data " << "_tao_" << node->flatname ()
- << "_exceptiondata [] = " << be_nl;
- *os << "{" << be_idt_nl;
- // initialize an iterator to iterate thru the exception list
- UTL_ExceptlistActiveIterator *ei;
- ACE_NEW_RETURN (ei,
- UTL_ExceptlistActiveIterator (node->exceptions ()),
- -1);
- // continue until each element is visited
- while (!ei->is_done ())
- {
- be_exception *excp = be_exception::narrow_from_decl (ei->item ());
-
- if (excp == 0)
- {
- delete ei;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_exceptlist_cs"
- "visit_operation - "
- "codegen for scope failed\n"), -1);
-
- }
- *os << "{";
- // the typecode name
- *os << excp->tc_name ();
- *os << ", ";
- // allocator method
- *os << excp->name () << "::_alloc}";
- ei->next ();
- if (!ei->is_done ())
- {
- *os << ",\n";
- os->indent ();
- }
- // except the last one is processed?
-
- } // end of while loop
- delete ei;
- *os << be_uidt_nl << "};\n\n";
- } // end of if
- 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 b1331e90d75..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// operation.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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)
-{
-}
-
-
-int
-be_visitor_operation::void_return_type (be_type *bt)
-{
- // is the operation return type void?
-
- if (bt->node_type () == AST_Decl::NT_pre_defined
- && (be_predefined_type::narrow_from_decl (bt)->pt ()
- == AST_PredefinedType::PT_void))
- return 1;
- else
- return 0;
-}
-
-int
-be_visitor_operation::has_param_type (be_operation *node,
- AST_Argument::Direction dir)
-{
- // proceed if the number of members in our scope is greater than 0
- if (node->nmembers () > 0)
- {
- // initialize an iterator to iterate thru our scope
- UTL_ScopeActiveIterator *si;
- ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (node,
- UTL_Scope::IK_decls),
- 0);
- // continue until each element is visited
- while (!si->is_done ())
- {
- be_argument *bd = be_argument::narrow_from_decl (si->item ());
- if (bd && (bd->direction () == dir))
- return 1;
-
- si->next ();
- } // end of while loop
- delete si;
- } // end of if
-
- // not of the type we are looking for
- return 0;
-}
-
-//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
-
- *os << be_idt_nl << "ACE_THROW_SPEC (("
- << be_idt_nl << "CORBA::SystemException";
- if (node->exceptions ())
- {
-
- // initialize an iterator to iterate thru the exception list
- UTL_ExceptlistActiveIterator *ei;
- ACE_NEW_RETURN (ei,
- UTL_ExceptlistActiveIterator (node->exceptions ()),
- -1);
- // continue until each element is visited
- while (!ei->is_done ())
- {
- be_exception *excp = be_exception::narrow_from_decl (ei->item ());
-
- if (excp == 0)
- {
- delete ei;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation"
- "gen_throw_spec - "
- "bad exception node\n"), -1);
-
- }
-
- *os << "," << be_nl;
- // allocator method
- *os << excp->name ();
- ei->next ();
- } // end of while loop
- delete ei;
- } // end of if
- *os << be_uidt_nl << "))"<< be_uidt;
-
- return 0;
-
-}
-
-//Method that returns the appropriate CORBA::Environment variable
-const char *
-be_visitor_operation::gen_environment_var ()
-{
- 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 (idl_global->exception_support ())
- {
- return ace_try_env_decl;
- }
- else
- {
- return null_env_decl;
- }
-}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ami_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ami_ch.cpp
deleted file mode 100644
index 91baf32300b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ami_ch.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// operation_ami_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating AMI stub code for Operation node in the
-// client header.
-//
-// = AUTHOR
-// Alexander Babu Arulanthu <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node
-
- os->indent (); // start with the current indentation level
-
- // every operation is declared virtual in the client code
- *os << "virtual ";
-
- // STEP I: Return type is void.
- *os << "void ";
-
- // STEP 2: generate the operation name.
-
- // First the sendc prefix.
- *os << "sendc_";
- *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_AMI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_ami_ch::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ami_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ami_cs.cpp
deleted file mode 100644
index 9db88553f3d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ami_cs.cpp
+++ /dev/null
@@ -1,901 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// ami_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale and Alexander Babu Arulanthu
-// <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
- be_visitor_context ctx; // visitor context
- be_visitor *visitor; // visitor
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node for future use
-
- os->indent (); // start with the current indentation level
-
- // Generate the return type mapping. Return type is simply void.
- *os << "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->fullname ()
- << "::"
- << "sendc_"
- << node->local_name ()->get_string ();
-
- // Generate the argument list with the appropriate mapping (same as
- // in the header file)
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_AMI);
- visitor = tao_cg->make_visitor (&ctx);
- if ((!visitor) || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- // 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 CORBA::Environment
- *os << "{" << be_idt_nl;
-
- // Create the return type node. Return type is void.
- be_predefined_type *bt = 0;
- ACE_NEW_RETURN (bt,
- be_predefined_type (AST_PredefinedType::PT_void,
- new UTL_ScopedName
- (new Identifier
- ("void", 1, 0, I_FALSE), 0),
- 0),
- -1);
-
- // generate any pre stub info if and only if none of our parameters is of the
- // native type
- if (!node->has_native ())
- {
- // native type does not exist.
-
- // Generate any "pre" stub information such as tables or declarations
- // This is a template method and the actual work will be done by the
- // derived class
- if (this->gen_pre_stub_info (node, bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "gen_pre_stub_info failed\n"),
- -1);
- }
- }
-
- if (node->has_native ()) // native exists => no stub
- {
- if (this->gen_raise_exception (bt,
- "CORBA::MARSHAL",
- "") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for return var failed\n"),
- -1);
- }
- }
- else
- {
- // Generate code that retrieves the underlying stub object and then
- // invokes do_static_call on it.
- *os << be_nl
- << "TAO_Stub *istub = this->_stubobj ();" << be_nl
- << "if (istub == 0)" << be_idt_nl;
-
- // if the stub object was bad, then we raise a system exception
- if (this->gen_raise_exception (bt, "CORBA::INV_OBJREF",
- "") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for checking exception failed\n"),
- -1);
-
- }
- *os << be_uidt_nl << "\n";
-
- // do any pre marshal and invoke processing with return type. This
- // includes allocating memory, initialization.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_PRE_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for retval pre invoke failed\n"),
- -1);
- }
-
- // do any pre marshal and invoke stuff with arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_PRE_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for argument pre invoke failed\n"),
- -1);
- }
-
- // generate the code for marshaling in the parameters and transmitting
- // them
- if (this->gen_marshal_and_invoke (node, bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for marshal and invoke failed\n"),
- -1);
-
- }
-
- // No return values.
- *os << "return;";
- } // end of if (!native)
-
- *os << be_uidt_nl << "}\n\n";
-
- return 0;
-}
-
-int
-be_visitor_operation_ami_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; // 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_raise_exception (be_type *bt,
- const char *excep,
- const char *completion_status)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- if (this->void_return_type (bt))
- {
- *os << "ACE_THROW ("
- << excep << " (" << completion_status << "));\n";
- }
- else
- {
- *os << "ACE_THROW_RETURN ("
- << excep << " (" << completion_status << "), ";
-
- // return the appropriate return value
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "gen_raise_exception - "
- "codegen for return var failed\n"),
- -1);
- }
- *os << ");\n";
- }
- return 0;
-}
-
-int
-be_visitor_operation_ami_cs::gen_check_exception (be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
- // check if there is an exception
- if (this->void_return_type (bt))
- {
- *os << "ACE_CHECK;\n";
- //<< "_tao_environment);\n";
- }
- else
- {
- *os << "ACE_CHECK_RETURN (";
- // << "_tao_environment, ";
-
- // return the appropriate return value
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "gen_check_exception - "
- "codegen failed\n"),
- -1);
- }
- *os << ");\n";
- }
-
- return 0;
-}
-
-// ************************************************************
-// Operation visitor for interpretive client stubs
-// ************************************************************
-
-be_interpretive_visitor_operation_ami_cs::
-be_interpretive_visitor_operation_ami_cs (be_visitor_context *ctx)
- : be_visitor_operation_ami_cs (ctx)
-{
-}
-
-be_interpretive_visitor_operation_ami_cs::~be_interpretive_visitor_operation_ami_cs (void)
-{
-}
-
-// concrete implementation of the template methods
-
-int
-be_interpretive_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- // Generate the TAO_Param_Data table
- os->indent ();
- *os << "static const TAO_Param_Data ";
- // 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->flatname () <<
- "_paramdata [] = " << be_nl;
- *os << "{\n";
- os->incr_indent ();
-
- // entry for the return type
- *os << "{" << bt->tc_name () << ", PARAM_RETURN, 0}";
- if (node->nmembers () > 0)
- *os << ",\n";
-
- // generate entries for the param data table for arguments
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_cs::"
- "gen_pre_stub_info - "
- "visit scope failed\n"),
- -1);
- }
- *os << "\n";
- os->decr_indent ();
- *os << "}; // " << node->flatname () << "_paramdata\n\n";
-
- // 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 ())
- {
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_interpretive_visitor_operation_ami_cs::"
- "gen_pre_stub_info - "
- "Exceptionlist generation error\n"),
- -1);
- }
- }
-
- // now generate the calldata table
- os->indent ();
- *os << "static const TAO_Call_Data ";
- // 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->flatname ()
- << "_calldata = " << 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->local_name () << "\", ";
-
- // are we oneway or two operation?
- if (node->flags () == AST_Operation::OP_oneway)
- {
- *os << "0, "; // for false
- }
- else
- {
- *os << "1, "; // for true
- }
- // insert the size of the paramdata table i.e., number of arguments + 1
- // for return type
- *os << (node->argument_count () + 1) << ", ";
-
- // insert the address of the paramdata table
- // first 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->flatname () << "_paramdata, ";
-
- // insert exception list (if any) - node for attributes
- if (this->ctx_->attribute ())
- *os << "0, 0};\n\n";
- else
- {
- if (node->exceptions ())
- {
- *os << node->exceptions ()->length ()
- << ", _tao_" << node->flatname () << "_exceptiondata};\n\n";
- }
- else
- *os << "0, 0};\n\n";
- }
- return 0;
-}
-
-int
-be_interpretive_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation
- *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
- *os << "void* _tao_arguments["
- << node->argument_count () + 1 << "];" << be_nl
- << "const void** _tao_arg = ACE_const_cast (const void**,_tao_arguments);" << be_nl
- << "*_tao_arg = ";
-
- // pass the appropriate return value to docall
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
- *os << "; _tao_arg++;\n";
-
- // pass each argument to do_static_call
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
-
- // call do_static_call with appropriate number of arguments
- os->indent ();
- *os << "istub->do_static_call (" << be_idt_nl
- << "ACE_TRY_ENV, " << 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->flatname () << "_calldata," << be_nl
- << "_tao_arguments" << be_uidt_nl
- << ");\n";
-
- os->indent ();
- // check if there is an exception
- if (this->gen_check_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
-
- }
-
- // do any post processing for the arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for args post do_static_call failed\n"),
- -1);
- }
-
- // do any post processing for the retval
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_POST_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for return type post do_static_call failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// ************************************************************
-// Operation visitor for compiled client stubs
-// ************************************************************
-
-be_compiled_visitor_operation_ami_cs::
-be_compiled_visitor_operation_ami_cs (be_visitor_context *ctx)
- : be_visitor_operation_ami_cs (ctx)
-{
-}
-
-be_compiled_visitor_operation_ami_cs::~be_compiled_visitor_operation_ami_cs (void)
-{
-}
-
-// concrete implementation of the template methods
-
-int
-be_compiled_visitor_operation_ami_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_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_compiled_visitor_operation_ami_cs::"
- "gen_pre_stub_info - "
- "Exceptionlist generation error\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_compiled_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation
- *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
-
- // create the GIOP_Invocation and grab the outgoing CDR stream
- switch (node->flags ())
- {
- case AST_Operation::OP_oneway:
- *os << "TAO_GIOP_Oneway_Invocation _tao_call ";
- break;
- default:
- *os << "TAO_GIOP_Twoway_Invocation _tao_call ";
- }
- *os << "(" << be_idt << be_idt_nl
- << "istub," << be_nl;
-
- 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 ()
- << "\"," << be_nl
- << "istub->orb_core ()" << be_uidt_nl
- << ");" << be_uidt_nl;
-
- *os << "\n" << be_nl
- << "for (;;)" << be_nl
- << "{" << be_idt_nl;
-
- // *os << "ACE_TRY_ENV.clear ();" << be_nl
- *os << "_tao_call.start (ACE_TRY_ENV);" << be_nl;
- // check if there is an exception
- if (this->gen_check_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
-
- }
-
- // now make sure that we have some in and inout parameters. Otherwise, there
- // is nothing to be marshaled in
- if (this->has_param_type (node, AST_Argument::dir_IN) ||
- this->has_param_type (node, AST_Argument::dir_INOUT))
- {
- *os << be_nl
- << "TAO_OutputCDR &_tao_out = _tao_call.out_stream ();"
- << be_nl
- << "if (!(\n" << be_idt << be_idt << be_idt;
-
- // 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);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
- *os << be_uidt << be_uidt_nl
- << "))" << be_nl;
-
- // if marshaling fails, raise exception
- if (this->gen_raise_exception (bt, "CORBA::MARSHAL",
- "") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_cs::"
- "gen_marshal_and invoke - "
- "codegen for return var failed\n"),
- -1);
- }
- *os << be_uidt;
- }
-
- *os << be_nl
- << "int _invoke_status =" << be_idt_nl;
- if (node->flags () == AST_Operation::OP_oneway)
- {
- // oneway operation
- *os << "_tao_call.invoke (ACE_TRY_ENV);";
- }
- else
- {
- if (node->exceptions ())
- {
- *os << "_tao_call.invoke (_tao_" << node->flatname ()
- << "_exceptiondata, "
- << node->exceptions ()->length ()
- << ", ACE_TRY_ENV);";
- }
- else
- {
- *os << "_tao_call.invoke (0, 0, ACE_TRY_ENV);";
- }
- }
-
- *os << be_uidt_nl;
- // check if there is an exception
- if (this->gen_check_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
- }
-
- *os << be_nl
- << "if (_invoke_status == TAO_INVOKE_RESTART)" << be_idt_nl
- << "continue;" << be_uidt_nl
- << "// if (_invoke_status == TAO_INVOKE_EXCEPTION)" << be_idt_nl
- << "// cannot happen" << be_uidt_nl
- << "if (_invoke_status != TAO_INVOKE_OK)" << be_nl
- << "{" << be_idt_nl;
-
- if (this->gen_raise_exception (bt,
- "CORBA::UNKNOWN",
- "TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_cs::"
- "gen_marshal_and invoke - "
- "codegen for return var failed\n"),
- -1);
- }
-
- *os << be_uidt_nl
- << "}" << be_nl
- << "break;" << be_nl
- << be_uidt_nl << "}" << be_nl;
-
- // the code below this is for 2way operations only
-
- if (this->void_return_type (bt) &&
- !this->has_param_type (node, AST_Argument::dir_INOUT) &&
- !this->has_param_type (node, AST_Argument::dir_OUT))
- {
- return 0;
- }
-
- // Do any post_invoke stuff that might be necessary.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for args in post do_static_call\n"),
- -1);
- }
-
-
- // Generate any temporary variables to demarshal the arguments
- ctx = *this->ctx_;
- be_visitor_compiled_args_decl vis1 (new be_visitor_context (ctx));
- if (node->accept (&vis1) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_cs::"
- "gen_pre_stub_info - "
- "codegen for pre args failed\n"),
- -1);
- }
-
- if (!this->void_return_type (bt))
- {
- // Generate any temporary variables to demarshal the return value
- ctx = *this->ctx_;
- be_visitor_context *new_ctx =
- new be_visitor_context (ctx);
- be_visitor_operation_compiled_rettype_post_docall vis2 (new_ctx);
- if (bt->accept (&vis2) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_cs::"
- "gen_pre_stub_info - "
- "codegen rettype [post docall] failed\n"),
- -1);
- }
- }
-
- // check if there was a user exception, else demarshal the
- // return val (if any) and parameters (if any) that came with
- // the response message
- *os << "TAO_InputCDR &_tao_in = _tao_call.inp_stream ();" << be_nl
- << "if (!(\n" << be_idt << be_idt << be_idt;
-
- if (!this->void_return_type (bt))
- {
- // demarshal the return val
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_INVOKE_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var failed\n"),
- -1);
- }
- }
-
- if (this->has_param_type (node, AST_Argument::dir_INOUT) ||
- this->has_param_type (node, AST_Argument::dir_OUT))
- {
- if (!this->void_return_type (bt))
- *os << " &&\n";
-
- // demarshal each out and inout argument
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var failed\n"),
- -1);
- }
- }
-
- if (!this->void_return_type (bt) ||
- this->has_param_type (node, AST_Argument::dir_INOUT) ||
- this->has_param_type (node, AST_Argument::dir_OUT))
- {
-
- *os << be_uidt << be_uidt << be_nl
- << "))" << be_nl;
- // if marshaling fails, raise exception
- if (this->gen_raise_exception (bt, "CORBA::MARSHAL",
- "TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_cs::"
- "gen_marshal_and invoke - "
- "codegen for return var failed\n"),
- -1);
- }
- *os << be_uidt;
- }
-
- return 0;
-}
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 ad20f9bd7a8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// operation_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation node in the client header.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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; // output stream
- be_type *bt; // type node
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node
-
- os->indent (); // start with the current indentation level
-
- // every operation is declared virtual in the client code
- *os << "virtual ";
-
- // STEP I: generate the return 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_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_ch::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ch::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
- delete visitor;
-
- // 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);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_ch::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- 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 980cbb496c8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
+++ /dev/null
@@ -1,937 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// operation_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
- be_type *bt; // type node
- be_visitor_context ctx; // visitor context
- be_visitor *visitor; // visitor
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node for future use
-
- os->indent (); // start with the current indentation level
-
- // 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_cs::"
- "visit_operation - "
- "Bad return type\n"),
- -1);
- }
-
- // Generate the return type mapping (same as in the header file)
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS);
- visitor = tao_cg->make_visitor (&ctx);
-
- if ((!visitor) || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
- delete visitor;
-
- // Generate the operation name
- *os << " " << node->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_OTHERS);
- visitor = tao_cg->make_visitor (&ctx);
- if ((!visitor) || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- // 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 CORBA::Environment
- *os << "{" << be_idt_nl;
-
- // Deal with differences between IDL mapping for true C++ exceptions and
- // alternate mapping. Since our code uses the ACE_TRY_ENV variable in a
- // number of places, for the true exception case, we will have to explicitly
- // declare the ACE_TRY_ENV variable.
- *os << this->gen_environment_var () << "\n";
-
- // Generate any pre stub info if and only if none of our parameters is of the
- // native type.
- if (!node->has_native ())
- {
- // native type does not exist.
-
- // Generate any "pre" stub information such as tables or declarations
- // This is a template method and the actual work will be done by the
- // derived class
- if (this->gen_pre_stub_info (node, bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "gen_pre_stub_info failed\n"),
- -1);
- }
- }
-
- // Declare return type.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for return var decl failed\n"),
- -1);
- }
-
- if (node->has_native ()) // native exists => no stub
- {
- if (this->gen_raise_exception (bt, "CORBA::MARSHAL",
- "") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for return var failed\n"),
- -1);
- }
- }
- else
- {
- // Generate code that retrieves the underlying stub object and then
- // invokes do_static_call on it.
- *os << be_nl
- << "TAO_Stub *istub = this->_stubobj ();" << be_nl
- << "if (istub == 0)" << be_idt_nl;
-
- // if the stub object was bad, then we raise a system exception
- if (this->gen_raise_exception (bt, "CORBA::INTERNAL",
- "") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for checking exception failed\n"),
- -1);
-
- }
- *os << be_uidt_nl << "\n";
-
- // do any pre marshal and invoke processing with return type. This
- // includes allocating memory, initialization.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_PRE_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for retval pre invoke failed\n"),
- -1);
- }
-
- // do any pre marshal and invoke stuff with arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_PRE_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for argument pre invoke failed\n"),
- -1);
- }
-
- // generate the code for marshaling in the parameters and transmitting
- // them
- if (this->gen_marshal_and_invoke (node, bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for marshal and invoke failed\n"),
- -1);
-
- }
-
- if (!this->void_return_type (bt))
- {
- // now generate the normal successful return statement
- os->indent ();
- *os << "return ";
- // return the appropriate return value
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for return var failed\n"),
- -1);
- }
- *os << ";";
- }
- } // end of if (!native)
-
- *os << be_uidt_nl << "}\n\n";
-
- return 0;
-}
-
-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; // 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_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_cs::gen_raise_exception (be_type *bt,
- const char *excep,
- const char *completion_status)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- if (this->void_return_type (bt))
- {
- *os << "ACE_THROW ("
- << excep << " (" << completion_status << "));\n";
- }
- else
- {
- *os << "ACE_THROW_RETURN ("
- << excep << " (" << completion_status << "), ";
-
- // return the appropriate return value
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "gen_raise_exception - "
- "codegen for return var failed\n"),
- -1);
- }
- *os << ");\n";
- }
- return 0;
-}
-
-int
-be_visitor_operation_cs::gen_check_exception (be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
- // check if there is an exception
- if (this->void_return_type (bt))
- {
- *os << "ACE_CHECK;\n";
- //<< "_tao_environment);\n";
- }
- else
- {
- *os << "ACE_CHECK_RETURN (";
- // << "_tao_environment, ";
-
- // return the appropriate return value
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "gen_check_exception - "
- "codegen failed\n"),
- -1);
- }
- *os << ");\n";
- }
-
- return 0;
-}
-
-// ************************************************************
-// Operation visitor for interpretive client stubs
-// ************************************************************
-
-be_interpretive_visitor_operation_cs::
-be_interpretive_visitor_operation_cs (be_visitor_context *ctx)
- : be_visitor_operation_cs (ctx)
-{
-}
-
-be_interpretive_visitor_operation_cs::~be_interpretive_visitor_operation_cs (void)
-{
-}
-
-// concrete implementation of the template methods
-
-int
-be_interpretive_visitor_operation_cs::gen_pre_stub_info (be_operation *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- // Generate the TAO_Param_Data table
- os->indent ();
- *os << "static const TAO_Param_Data ";
- // 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->flatname () <<
- "_paramdata [] = " << be_nl;
- *os << "{\n";
- os->incr_indent ();
-
- // entry for the return type
- *os << "{" << bt->tc_name () << ", PARAM_RETURN, 0}";
- if (node->nmembers () > 0)
- *os << ",\n";
-
- // generate entries for the param data table for arguments
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_cs::"
- "gen_pre_stub_info - "
- "visit scope failed\n"),
- -1);
- }
- *os << "\n";
- os->decr_indent ();
- *os << "}; // " << node->flatname () << "_paramdata\n\n";
-
- // 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 ())
- {
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_interpretive_visitor_operation_cs::"
- "gen_pre_stub_info - "
- "Exceptionlist generation error\n"),
- -1);
- }
- }
-
- // now generate the calldata table
- os->indent ();
- *os << "static const TAO_Call_Data ";
- // 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->flatname ()
- << "_calldata = " << 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->local_name () << "\", ";
-
- // are we oneway or two operation?
- if (node->flags () == AST_Operation::OP_oneway)
- {
- *os << "0, "; // for false
- }
- else
- {
- *os << "1, "; // for true
- }
- // insert the size of the paramdata table i.e., number of arguments + 1
- // for return type
- *os << (node->argument_count () + 1) << ", ";
-
- // insert the address of the paramdata table
- // first 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->flatname () << "_paramdata, ";
-
- // insert exception list (if any) - node for attributes
- if (this->ctx_->attribute ())
- *os << "0, 0};\n\n";
- else
- {
- if (node->exceptions ())
- {
- *os << node->exceptions ()->length ()
- << ", _tao_" << node->flatname () << "_exceptiondata};\n\n";
- }
- else
- *os << "0, 0};\n\n";
- }
- return 0;
-}
-
-int
-be_interpretive_visitor_operation_cs::gen_marshal_and_invoke (be_operation
- *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
- *os << "void* _tao_arguments["
- << node->argument_count () + 1 << "];" << be_nl
- << "const void** _tao_arg = ACE_const_cast (const void**,_tao_arguments);" << be_nl
- << "*_tao_arg = ";
-
- // pass the appropriate return value to docall
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
- *os << "; _tao_arg++;\n";
-
- // pass each argument to do_static_call
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
-
- // call do_static_call with appropriate number of arguments
- os->indent ();
- *os << "istub->do_static_call (" << be_idt_nl
- << "ACE_TRY_ENV, " << 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->flatname () << "_calldata," << be_nl
- << "_tao_arguments" << be_uidt_nl
- << ");\n";
-
- os->indent ();
- // check if there is an exception
- if (this->gen_check_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
-
- }
-
- // do any post processing for the arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for args post do_static_call failed\n"),
- -1);
- }
-
- // do any post processing for the retval
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_POST_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for return type post do_static_call failed\n"),
- -1);
- }
-
- return 0;
-}
-
-// ************************************************************
-// Operation visitor for compiled client stubs
-// ************************************************************
-
-be_compiled_visitor_operation_cs::
-be_compiled_visitor_operation_cs (be_visitor_context *ctx)
- : be_visitor_operation_cs (ctx)
-{
-}
-
-be_compiled_visitor_operation_cs::~be_compiled_visitor_operation_cs (void)
-{
-}
-
-// concrete implementation of the template methods
-
-int
-be_compiled_visitor_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_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_compiled_visitor_operation_cs::"
- "gen_pre_stub_info - "
- "Exceptionlist generation error\n"),
- -1);
- }
- }
-
- return 0;
-}
-
-int
-be_compiled_visitor_operation_cs::gen_marshal_and_invoke (be_operation
- *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
-
- // create the GIOP_Invocation and grab the outgoing CDR stream
- switch (node->flags ())
- {
- case AST_Operation::OP_oneway:
- *os << "TAO_GIOP_Oneway_Invocation _tao_call ";
- break;
- default:
- *os << "TAO_GIOP_Twoway_Invocation _tao_call ";
- }
- *os << "(" << be_idt << be_idt_nl
- << "istub," << be_nl;
-
- 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->original_local_name ()
- << "\"," << be_nl
- << "istub->orb_core ()" << be_uidt_nl
- << ");" << be_uidt_nl;
-
- *os << "\n" << be_nl
- << "for (;;)" << be_nl
- << "{" << be_idt_nl;
-
- // *os << "ACE_TRY_ENV.clear ();" << be_nl;
- *os << "_tao_call.start (ACE_TRY_ENV);\n";
- // check if there is an exception
- if (this->gen_check_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
-
- }
-
- // now make sure that we have some in and inout parameters. Otherwise, there
- // is nothing to be marshaled in
- if (this->has_param_type (node, AST_Argument::dir_IN) ||
- this->has_param_type (node, AST_Argument::dir_INOUT))
- {
- *os << be_nl
- << "TAO_OutputCDR &_tao_out = _tao_call.out_stream ();"
- << be_nl
- << "if (!(\n" << be_idt << be_idt << be_idt;
-
- // 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);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
- *os << be_uidt << be_uidt_nl
- << "))" << be_nl;
-
- // if marshaling fails, raise exception
- if (this->gen_raise_exception (bt, "CORBA::MARSHAL",
- "") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and invoke - "
- "codegen for return var failed\n"),
- -1);
- }
- *os << be_uidt;
- }
-
- *os << be_nl
- << "int _invoke_status =" << be_idt_nl;
- if (node->flags () == AST_Operation::OP_oneway)
- {
- // oneway operation
- *os << "_tao_call.invoke (ACE_TRY_ENV);";
- }
- else
- {
- if (node->exceptions ())
- {
- *os << "_tao_call.invoke (_tao_" << node->flatname ()
- << "_exceptiondata, "
- << node->exceptions ()->length ()
- << ", ACE_TRY_ENV);";
- }
- else
- {
- *os << "_tao_call.invoke (0, 0, ACE_TRY_ENV);";
- }
- }
-
- *os << be_uidt_nl;
- // check if there is an exception
- if (this->gen_check_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
- }
-
- *os << be_nl
- << "if (_invoke_status == TAO_INVOKE_RESTART)" << be_idt_nl
- << "continue;" << be_uidt_nl
- << "// if (_invoke_status == TAO_INVOKE_EXCEPTION)" << be_idt_nl
- << "// cannot happen" << be_uidt_nl
- << "if (_invoke_status != TAO_INVOKE_OK)" << be_nl
- << "{" << be_idt_nl;
-
- if (this->gen_raise_exception (bt,
- "CORBA::UNKNOWN",
- "TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and invoke - "
- "codegen for return var failed\n"),
- -1);
- }
-
- *os << be_uidt_nl
- << "}" << be_nl
- << "break;" << be_nl
- << be_uidt_nl << "}" << be_nl;
-
- // the code below this is for 2way operations only
-
- if (this->void_return_type (bt) &&
- !this->has_param_type (node, AST_Argument::dir_INOUT) &&
- !this->has_param_type (node, AST_Argument::dir_OUT))
- {
- return 0;
- }
-
- // Do any post_invoke stuff that might be necessary.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for args in post do_static_call\n"),
- -1);
- }
-
-
- // Generate any temporary variables to demarshal the arguments
- ctx = *this->ctx_;
- be_visitor_compiled_args_decl vis1 (new be_visitor_context (ctx));
- if (node->accept (&vis1) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_pre_stub_info - "
- "codegen for pre args failed\n"),
- -1);
- }
-
- if (!this->void_return_type (bt))
- {
- // Generate any temporary variables to demarshal the return value
- ctx = *this->ctx_;
- be_visitor_context *new_ctx =
- new be_visitor_context (ctx);
- be_visitor_operation_compiled_rettype_post_docall vis2 (new_ctx);
- if (bt->accept (&vis2) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_pre_stub_info - "
- "codegen rettype [post docall] failed\n"),
- -1);
- }
- }
-
- // check if there was a user exception, else demarshal the
- // return val (if any) and parameters (if any) that came with
- // the response message
- *os << "TAO_InputCDR &_tao_in = _tao_call.inp_stream ();" << be_nl
- << "if (!(\n" << be_idt << be_idt << be_idt;
-
- if (!this->void_return_type (bt))
- {
- // demarshal the return val
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_INVOKE_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var failed\n"),
- -1);
- }
- }
-
- if (this->has_param_type (node, AST_Argument::dir_INOUT) ||
- this->has_param_type (node, AST_Argument::dir_OUT))
- {
- if (!this->void_return_type (bt))
- *os << " &&\n";
-
- // demarshal each out and inout argument
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var failed\n"),
- -1);
- }
- }
-
- if (!this->void_return_type (bt) ||
- this->has_param_type (node, AST_Argument::dir_INOUT) ||
- this->has_param_type (node, AST_Argument::dir_OUT))
- {
-
- *os << be_uidt << be_uidt << be_nl
- << "))" << be_nl;
- // if marshaling fails, raise exception
- if (this->gen_raise_exception (bt, "CORBA::MARSHAL",
- "TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_marshal_and invoke - "
- "codegen for return var failed\n"),
- -1);
- }
- *os << be_uidt;
- }
-
- 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 67a50e5b36f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp
+++ /dev/null
@@ -1,125 +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)
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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; // output stream
- be_type *bt; // type node representing the return type
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node
-
- os->indent (); // start with the current indentation level
-
- // every operation is declared virtual in the client code
- *os << "virtual ";
-
- // STEP I: generate the return 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_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_ih::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ih::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
- delete visitor;
-
- // 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);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_ih::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ih::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- //generate the exceptions that are thrown by the operation
- //Don't have to do it here. It will be done as part of the argument list generatio
- //this->gen_throw_spec (node);
-
- 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 4e366f6ef46..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp
+++ /dev/null
@@ -1,175 +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)
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-#include "ace/SString.h"
-
-#include "be_visitor_operation.h"
-
-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; // output stream
- be_type *bt; // type node representing the return type
-
- //cout<<"Within visit_operation "<<endl;
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node
-
- os->indent (); // start with the current indentation level
-
-
-
-
- // STEP I: generate the return 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);
- }
-
- // grab the right visitor to generate the return type
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_is::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_is::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
- delete visitor;
-
-
- ACE_CString str(node->flatname ());
-
-
- int lnmlength = ACE_OS::strlen (node->local_name ()->get_string ());
-
- int fnmlength = ACE_OS::strlen (node->flatname ());
- fnmlength--;
-
- char * classname = str.substr (0,(fnmlength-lnmlength) ).rep ();
-
- // STEP 2: generate the operation name
- *os << " " << idl_global->impl_class_prefix () << classname << idl_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);
- visitor = tao_cg->make_visitor (&ctx);
-
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_is::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_is::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- //generate the excetions thrown by the operation
- // this->gen_throw_spec (node);
-
- *os <<be_idt_nl << "{"<<be_idt_nl;
- *os << "//Add your implementation here"<<be_uidt_nl;
-
- //Code to generate teh return statement in the operations.....
- //Can be uncommented when required
-
- /*
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_IS);
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_is::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
-
- if (bt->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_is::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
- delete visitor;
- */
-
- *os << "}" << be_nl << be_uidt_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 05bca9d22d2..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// operation_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the server header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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; // output stream
- be_type *bt; // type node representing the return type
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node
-
- os->indent (); // start with the current indentation level
-
- // every operation is declared virtual in the client code
- *os << "virtual ";
-
- // STEP I: generate the return 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_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_sh::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_sh::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
- delete visitor;
-
- // 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);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_sh::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_sh::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- // generate the corresponding static skeleton method for this operation only
- // if there was no "native" type
- if (!node->has_native ())
- {
- os->indent ();
- *os << "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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->local_name () <<
- "_skel (" << be_idt << be_idt_nl
- << "CORBA::ServerRequest &_tao_req, " << be_nl
- << "void *_tao_obj, " << be_nl
- << "void *_tao_context, " << be_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");" << be_uidt << "\n\n";
- }
-
- 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 d4ac4d925ed..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp
+++ /dev/null
@@ -1,821 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// operation_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Operation in the server skeleton
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-#include "be_visitor_argument.h"
-
-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; // output stream
- be_type *bt; // type node for return type
-
- os = this->ctx_->stream (); // grab the o/p stream
- this->ctx_->node (node); // save the node for future use
-
- os->indent (); // start with the current indentation level
-
- // 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);
- }
-
- // 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 (node->defined_in ());
-
- if (!intf)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "bad interface scope\n"),
- -1);
- }
-
- // generate the signature of the static skeleton
- os->indent ();
- *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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->local_name ()
- << "_skel (" << be_idt << be_idt_nl;
-
- if (node->flags () == AST_Operation::OP_oneway
- && !this->has_param_type (node, AST_Argument::dir_IN))
- {
- *os << "CORBA::ServerRequest &/* _tao_server_request */, " << be_nl;
- }
- else
- {
- *os << "CORBA::ServerRequest &_tao_server_request, " << be_nl;
- }
-
- *os << "void *_tao_object_reference, " << be_nl
- << "void * /* context */, " << be_nl
- << "CORBA::Environment &ACE_TRY_ENV" << be_uidt << be_uidt_nl
- << ")" << be_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 << "{\n" << be_idt;
-
- // generate all the tables and other pre-skel info
- if (this->gen_pre_skel_info (node, bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "gen_pre_skel_info failed\n"),
- -1);
- }
-
- os->indent ();
- // get the right object implementation.
- *os << intf->full_skel_name () << " *_tao_impl = ("
- << intf->full_skel_name () << " *)_tao_object_reference;\n\n";
-
- // declare a return type variable
- be_visitor_context ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for return var decl failed\n"),
- -1);
- }
-
- // declare variables for arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_DECL_SS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for return var decl failed\n"),
- -1);
- }
-
- // Demarshal parameters
- if (this->gen_demarshal_params (node, bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "gen_demarshal_params failed\n"),
- -1);
- }
-
- // do pre upcall processing if any
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_PRE_UPCALL_SS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for pre upcall failed\n"),
- -1);
- }
- // make the upcall and assign to the return val
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for retval assignment failed\n"),
- -1);
- }
-
- // make the upcall
- *os << "_tao_impl->" << node->local_name () << " (" << be_idt << "\n";
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for making upcall failed\n"),
- -1);
- }
-
- // end the upcall
- *os << be_uidt_nl << ");\n";
-
- if (node->flags () != AST_Operation::OP_oneway)
- {
- os->indent ();
- *os << "ACE_CHECK;\n";
- }
-
- // do any post processing for the arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_POST_UPCALL_SS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for args in post upcall failed\n"),
- -1);
- }
-
- // check if we are oneway in which case, we are done
- if (node->flags () == AST_Operation::OP_oneway)
- {
- // we are done. Nothing else to do, except closing the function body.
- os->decr_indent ();
- *os << "}\n\n";
- return 0;
- }
-
- // marshal outgoing parameters
- if (this->gen_marshal_params (node, bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "gen_marshal_params failed\n"),
- -1);
- }
-
- // do any post processing for the retval
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_POST_UPCALL_SS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for return type post upcall failed\n"),
- -1);
- }
-
- // do any post processing for the arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_POST_MARSHAL_SS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for args in post marshal failed\n"),
- -1);
- }
-
- os->decr_indent ();
- *os << "}\n\n";
- return 0;
-}
-
-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 ();
- 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_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_raise_exception (be_type *,
- const char *excep,
- const char *completion_status,
- const char * /* env */)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- os->indent ();
- *os << "ACE_THROW ("
- << excep << " (" << completion_status << ") "
- << ");\n";
- return 0;
-}
-
-int
-be_visitor_operation_ss::gen_check_exception (be_type *, const char * /* env */)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- os->indent ();
- // check if there is an exception
- *os << "ACE_CHECK;\n";
- // << env << ");\n";
-
- return 0;
-}
-
-
-// *********************************************************************
-// Operation visitor for server skeletons using interpretive marshaling
-// *********************************************************************
-
-be_interpretive_visitor_operation_ss::
-be_interpretive_visitor_operation_ss (be_visitor_context *ctx)
- : be_visitor_operation_ss (ctx)
-{
-}
-
-be_interpretive_visitor_operation_ss::
-~be_interpretive_visitor_operation_ss (void)
-{
-}
-
-int
-be_interpretive_visitor_operation_ss::gen_pre_skel_info (be_operation *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor_context ctx;
-
- os->indent ();
- // generate the param_data and call_data tables. We generate these if and
- // only if none of our arguments is of "native" type. Native types cannot be
- // marshaled.
- // native type does not exist. Generate the static tables
-
- // generate the TAO_Param_Data_Skel table
- *os << "static const TAO_Param_Data_Skel ";
- // 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->flatname () <<
- "_paramdata [] = " << be_nl;
- *os << "{\n";
- os->incr_indent ();
-
- // entry for the return type
- *os << "{" << bt->tc_name () << ", 0, 0}";
- if (node->nmembers () > 0)
- *os << ",\n";
-
- // generate entries for the param data table for arguments
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "visit scope failed\n"),
- -1);
- }
- *os << "\n";
- os->decr_indent ();
- *os << "}; // " << node->flatname () << "_paramdata\n\n";
-
- // now generate the calldata table
- os->indent ();
- *os << "static const TAO_Call_Data_Skel ";
- // 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->flatname ()
- << "_calldata = " << 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->local_name () << "\", ";
-
- // are we oneway or two operation?
- if (node->flags () == AST_Operation::OP_oneway)
- {
- *os << "0, "; // for false
- }
- else
- {
- *os << "1, "; // for true
- }
- // insert the size of the paramdata table i.e., number of arguments + 1
- // for return type
- *os << (node->argument_count () + 1) << ", ";
-
- // insert the address of the paramdata table
- // 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->flatname () << "_paramdata};\n\n";
-
- return 0;
-}
-
-int
-be_interpretive_visitor_operation_ss::gen_demarshal_params (be_operation *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- // setup parameters for demarshaling and demarshal them
- os->indent ();
- *os << "_tao_server_request.demarshal (" << be_idt_nl
- << "ACE_TRY_ENV, " << 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->flatname () << "_calldata,\n";
-
- // pass the appropriate return value to the demarshal operation
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_DEMARSHAL_SS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for return var in demarshal failed\n"),
- -1);
- }
- // insert a comma after the return val if there are arguments
- if (node->argument_count () > 0)
- *os << ",\n";
-
- // pass each argument to the demarshal operation
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for argument in demarshal failed\n"),
- -1);
- }
-
- // end the demarshal call
- *os << be_uidt_nl;
- *os << ");" << be_nl;
-
- *os << "ACE_CHECK;\n";
-
- return 0;
-}
-
-int
-be_interpretive_visitor_operation_ss::gen_marshal_params (be_operation *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- // setup parameters for marshaling and marshal them into the
- // outgoing stream
- os->indent ();
- *os << "_tao_server_request.marshal (" << be_idt_nl
- << "ACE_TRY_ENV, " << be_nl
- // << "_tao_skel_environment, " << 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->flatname () << "_calldata,\n";
-
- // pass the appropriate return value to the marshal operation
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_MARSHAL_SS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for return var in marshal failed\n"),
- -1);
- }
- // insert a comma after the return val if there are arguments
- if (node->argument_count () > 0)
- {
- *os << ",\n";
- }
-
- // pass each argument to the marshal operation
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for argument in marshal failed\n"),
- -1);
- }
- // end the marshal call
- *os << be_uidt_nl;
- *os << ");\n";
-
- return 0;
-}
-
-// *********************************************************************
-// Operation visitor for server skeletons using compiled marshaling
-// *********************************************************************
-
-be_compiled_visitor_operation_ss::
-be_compiled_visitor_operation_ss (be_visitor_context *ctx)
- : be_visitor_operation_ss (ctx)
-{
-}
-
-be_compiled_visitor_operation_ss::
-~be_compiled_visitor_operation_ss (void)
-{
-}
-
-int
-be_compiled_visitor_operation_ss::gen_pre_skel_info (be_operation *node,
- be_type *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // now make sure that we have some in and inout parameters. Otherwise, there
- // is nothing to be marshaled in
- if (this->has_param_type (node, AST_Argument::dir_IN) ||
- this->has_param_type (node, AST_Argument::dir_INOUT))
- {
- // instantiate a TAO_InputCDR variable
- os->indent ();
- *os << "TAO_InputCDR &_tao_in = _tao_server_request.incoming ();\n";
- }
-
- return 0;
-}
-
-int
-be_compiled_visitor_operation_ss::gen_demarshal_params (be_operation *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- // now make sure that we have some in and inout parameters. Otherwise, there
- // is nothing to be marshaled in
- if (this->has_param_type (node, AST_Argument::dir_IN) ||
- this->has_param_type (node, AST_Argument::dir_INOUT))
- {
- os->indent ();
-
- // demarshal the in and inout arguments
- *os << "if (!(\n" << be_idt;
-
- // marshal 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);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ss::"
- "gen_demarshal_params - "
- "codegen for demarshal failed\n"),
- -1);
- }
- *os << be_uidt_nl << "))\n" << be_idt;
-
- // if marshaling fails, raise exception
- if (this->gen_raise_exception (bt, "CORBA::MARSHAL",
- "",
- "ACE_TRY_ENV") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ss::"
- "gen_marshal_and invoke - "
- "codegen for return var failed\n"),
- -1);
- }
- *os << be_uidt << "\n";
-
- };
-
- return 0;
-}
-
-int
-be_compiled_visitor_operation_ss::gen_marshal_params (be_operation *node,
- be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- // setup parameters for marshaling and marshal them into the
- // outgoing stream
- // the code below this is for 2way operations only
-
- // We will be here only if we are 2way
- // first initialize a reply message
- os->indent ();
- *os << "_tao_server_request.init_reply (ACE_TRY_ENV);\n";
-
- // We still need the following check because we maybe 2way and yet have no
- // parameters and a void return type
- if (this->void_return_type (bt) &&
- !this->has_param_type (node, AST_Argument::dir_INOUT) &&
- !this->has_param_type (node, AST_Argument::dir_OUT))
- {
- return 0;
- }
-
- // grab the incoming stream
- os->indent ();
- *os << "ACE_CHECK;" << be_nl;
-
- // Create temporary variables for the out and return parameters..
- if (!this->void_return_type (bt))
- {
- ctx = *this->ctx_;
- be_visitor_context *new_ctx =
- new be_visitor_context (ctx);
- be_visitor_operation_compiled_rettype_post_upcall visitor (new_ctx);
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ss::"
- "gen_marshal_params - "
- "codegen for return var [post upcall] failed\n"),
- -1);
- }
- }
-
- // Generate any temporary variables to demarshal the arguments
- ctx = *this->ctx_;
- be_visitor_compiled_args_post_upcall vis1 (new be_visitor_context (ctx));
- if (node->accept (&vis1) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_cs::"
- "gen_pre_stub_info - "
- "codegen for pre args failed\n"),
- -1);
- }
-
- *os << "TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();" << be_nl;
- *os << "if (!(\n" << be_idt;
-
- if (!this->void_return_type (bt))
- {
- // demarshal the return val and each inout and out argument
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_MARSHAL_SS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ss::"
- "gen_marshal_params - "
- "codegen for return var failed\n"),
- -1);
- }
- }
-
- if (this->has_param_type (node, AST_Argument::dir_INOUT) ||
- this->has_param_type (node, AST_Argument::dir_OUT))
- {
-
- if (!this->void_return_type (bt))
- // we have already printed the return val. SO put a &&
- *os << " &&\n";
-
- // marshal each in and inout argument
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ss::"
- "gen_marshal_params - "
- "codegen for args failed\n"),
- -1);
- }
- }
-
- *os << be_uidt_nl << "))\n" << be_idt;
- // if marshaling fails, raise exception
- if (this->gen_raise_exception (bt, "CORBA::MARSHAL",
- "",
- "ACE_TRY_ENV") == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ss::"
- "gen_marshal_params - "
- "codegen for raising exception failed\n"),
- -1);
- }
- *os << be_uidt << be_uidt << "\n";
-
- 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 860210a7aab..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp
+++ /dev/null
@@ -1,315 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// rettype.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for return type of the Operation node
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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 (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_RETTYPE_CH)
- *os << bt->nested_type_name (this->ctx_->scope (), "_slice") << " *";
- else
- *os << bt->name () << "_slice *";
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_enum (be_enum *node)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_RETTYPE_CH)
- *os << bt->nested_type_name (this->ctx_->scope ());
- else
- *os << bt->name ();
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_interface (be_interface *node)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_RETTYPE_CH)
- *os << bt->nested_type_name (this->ctx_->scope (), "_ptr");
- else
- *os << bt->name () << "_ptr";
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_interface_fwd (be_interface_fwd *node)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_RETTYPE_CH)
- *os << bt->nested_type_name (this->ctx_->scope (), "_ptr");
- else
- *os << bt->name () << "_ptr";
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_native (be_native *node)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_RETTYPE_CH)
- *os << bt->nested_type_name (this->ctx_->scope ()) << " *";
- else
- *os << bt->name () << " *";
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_predefined_type (be_predefined_type *node)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_RETTYPE_CH)
- *os << bt->nested_type_name (this->ctx_->scope (), "_ptr");
- else
- *os << bt->name () << "_ptr";
- break;
- case AST_PredefinedType::PT_any:
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_RETTYPE_CH)
- *os << bt->nested_type_name (this->ctx_->scope ()) << " *";
- else
- *os << bt->name () << " *";
- break;
- default:
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_RETTYPE_CH)
- *os << bt->nested_type_name (this->ctx_->scope ());
- else
- *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 (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_RETTYPE_CH)
- *os << bt->nested_type_name (this->ctx_->scope ()) << " *";
- else
- *os << bt->name () << " *";
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_string (be_string * /* node*/)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- *os << "char *";
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_structure (be_structure *node)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_RETTYPE_CH)
- *os << bt->nested_type_name (this->ctx_->scope ());
- else
- *os << bt->name ();
-
- // based on whether we are variable or not, we return a pointer or the
- // aggregate type
- if (node->size_type () == be_decl::VARIABLE)
- *os << " *";
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_typedef (be_typedef *node)
-{
-
- this->ctx_->alias (node); // set the 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 (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_RETTYPE_CH)
- *os << bt->nested_type_name (this->ctx_->scope ());
- else
- *os << bt->name ();
-
- // based on whether we are variable or not, we return a pointer or the
- // aggregate type
- if (node->size_type () == be_decl::VARIABLE)
- *os << " *";
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-int
-be_visitor_operation_rettype::visit_valuetype (be_valuetype *node)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_RETTYPE_CH)
- *os << bt->nested_type_name (this->ctx_->scope (), " *");
- else {
- *os << bt->name () << " *";
- }
- return 0;
-}
-
-int
-be_visitor_operation_rettype::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_RETTYPE_CH)
- *os << bt->nested_type_name (this->ctx_->scope (), "*");
- else {
- *os << bt->name () << " *";
- }
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_assign_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_assign_ss.cpp
deleted file mode 100644
index fae87d2e2e5..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_assign_ss.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// rettype_assign_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for assigning the return value of upcall to the
-// return type variable.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, rettype_assign_ss, "$Id$")
-
-
-// ****************************************************************************
-// visitor for assignment to a return value variable from the upcall
-// ****************************************************************************
-
-be_visitor_operation_rettype_assign_ss::
-be_visitor_operation_rettype_assign_ss (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_operation_rettype_assign_ss::
-~be_visitor_operation_rettype_assign_ss (void)
-{
-}
-
-int
-be_visitor_operation_rettype_assign_ss::visit_array (be_array *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "_tao_retval = ";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_assign_ss::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "_tao_retval = ";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_assign_ss::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "_tao_retval = ";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_assign_ss::
-visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "_tao_retval = ";
-
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-int
-be_visitor_operation_rettype_assign_ss::visit_valuetype (be_valuetype *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "_tao_retval = ";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_assign_ss::
-visit_valuetype_fwd (be_valuetype_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "_tao_retval = ";
-
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-int
-be_visitor_operation_rettype_assign_ss::
-visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_void:
- break;
- case AST_PredefinedType::PT_pseudo:
- case AST_PredefinedType::PT_any:
- default:
- *os << "_tao_retval = ";
- break;
- }
- return 0;
-}
-
-int
-be_visitor_operation_rettype_assign_ss::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "_tao_retval = ";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_assign_ss::visit_string (be_string * /* node*/)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "_tao_retval = ";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_assign_ss::visit_structure (be_structure *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "_tao_retval = ";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_assign_ss::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node); // set the alias node
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_assign_ss::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_operation_rettype_assign_ss::visit_union (be_union *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "_tao_retval = ";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_docall_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_docall_cs.cpp
deleted file mode 100644
index 1e21d6a8106..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_docall_cs.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// rettype_docall_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for passing the return type variable to the
-// do_static_call method in the stub.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, rettype_docall_cs, "$Id$")
-
-
-// *****************************************************************************
-// be_visitor_operation_rettype_docall_cs
-//
-// This visitor generates code that passes the return type variable to the
-// do_static_call method
-// *****************************************************************************
-
-be_visitor_operation_rettype_docall_cs::be_visitor_operation_rettype_docall_cs
-(be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_operation_rettype_docall_cs::
-~be_visitor_operation_rettype_docall_cs (void)
-{
-}
-
-int
-be_visitor_operation_rettype_docall_cs::visit_array (be_array *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "_tao_retval";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_docall_cs::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "&_tao_retval";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_docall_cs::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "&_tao_base_retval";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_docall_cs::visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "&_tao_base_retval";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_docall_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_void:
- *os << "0";
- break;
- case AST_PredefinedType::PT_any:
- *os << "_tao_retval";
- break;
- default:
- *os << "&_tao_retval";
- break;
- }
- return 0;
-}
-
-int
-be_visitor_operation_rettype_docall_cs::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "_tao_retval";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_docall_cs::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "&_tao_retval";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_docall_cs::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- // check if the struct is variable
- if (node->size_type () == be_type::VARIABLE)
- *os << "_tao_retval";
- else
- *os << "&_tao_retval";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_docall_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node); // set the alias node
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_docall_cs::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_operation_rettype_docall_cs::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- // check if the union is variable
- if (node->size_type () == be_type::VARIABLE)
- *os << "_tao_retval";
- else
- *os << "&_tao_retval";
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_is.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_is.cpp
deleted file mode 100644
index d0a7b793551..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_is.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// rettype.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for return type of the Operation node
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, rettype_is, "$Id$")
-
-
-// ****************************************************************************
-// Operation visitor for return types. This generates the mapping for a return
-// type in an operation signature
-// ****************************************************************************
-
-be_visitor_operation_rettype_is::be_visitor_operation_rettype_is (be_visitor_context
- *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_operation_rettype_is::~be_visitor_operation_rettype_is (void)
-{
-}
-
-int
-be_visitor_operation_rettype_is::visit_array (be_array *)
-{
-
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- *os << "return 0;" <<be_nl;
- return 0;
-}
-
-int
-be_visitor_operation_rettype_is::visit_enum (be_enum *)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- *os << "return 0;" <<be_nl;
- return 0;
-}
-
-int
-be_visitor_operation_rettype_is::visit_interface (be_interface *)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- *os << "return 0;" <<be_nl;
- return 0;
-}
-
-int
-be_visitor_operation_rettype_is::visit_interface_fwd (be_interface_fwd *)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- *os << "return 0;" <<be_nl;
- return 0;
-}
-
-int
-be_visitor_operation_rettype_is::visit_native (be_native *)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- *os << "return 0;" <<be_nl;
- return 0;
-}
-
-int
-be_visitor_operation_rettype_is::visit_predefined_type (be_predefined_type *node)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_void:
- *os << "return;" <<be_nl;
- break;
- default:
- *os << "return 0;" <<be_nl;
- break;
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_is::visit_sequence (be_sequence *)
-{
-
-
- // we should never directly be here because anonymous sequence return types
- // are not allowed
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- *os << "return 0;" <<be_nl;
- return 0;
-}
-
-int
-be_visitor_operation_rettype_is::visit_string (be_string * /* node*/)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
-
- *os << "return 0;" <<be_nl;
- return 0;
-}
-
-int
-be_visitor_operation_rettype_is::visit_structure (be_structure *)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- *os << "return 0;" <<be_nl;
- return 0;
-}
-
-int
-be_visitor_operation_rettype_is::visit_typedef (be_typedef *node)
-{
-
- this->ctx_->alias (node); // set the 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_is::visit_union (be_union *)
-{
-
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- *os << "return 0;" <<be_nl;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_marshal_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_marshal_ss.cpp
deleted file mode 100644
index b1aadb26abe..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_marshal_ss.cpp
+++ /dev/null
@@ -1,219 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// rettype_marshal_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for marshaling the return type variable
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, rettype_marshal_ss, "$Id$")
-
-
-// ****************************************************************************
-// Visitor that passes the return value to the marshal/demarshal routine
-// ****************************************************************************
-
-be_visitor_operation_rettype_marshal_ss::
-be_visitor_operation_rettype_marshal_ss (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_operation_rettype_marshal_ss::
-~be_visitor_operation_rettype_marshal_ss (void)
-{
-}
-
-int
-be_visitor_operation_rettype_marshal_ss::visit_array (be_array *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- //*os << "_tao_ptr_retval";
- *os << "_tao_retval.inout ()";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_marshal_ss::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "&_tao_retval";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_marshal_ss::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- // *os << "&_tao_ptr_retval";
- *os << "&_tao_retval.inout ()";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_marshal_ss::
-visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- // *os << "&_tao_ptr_retval";
- *os << "&_tao_retval.inout ()";
-
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-int
-be_visitor_operation_rettype_marshal_ss::visit_valuetype (be_valuetype *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- // *os << "&_tao_ptr_retval";
- *os << "&_tao_retval.inout ()";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_marshal_ss::
-visit_valuetype_fwd (be_valuetype_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- // *os << "&_tao_ptr_retval";
- *os << "&_tao_retval.inout ()";
-
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-int
-be_visitor_operation_rettype_marshal_ss::
-visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_void:
- os->indent ();
- *os << "0";
- break;
- case AST_PredefinedType::PT_pseudo:
- os->indent ();
- //*os << "&_tao_ptr_retval";
- *os << "&_tao_retval.inout ()";
- break;
- case AST_PredefinedType::PT_any:
- os->indent ();
- // *os << "_tao_ptr_retval";
- *os << "&_tao_retval.inout ()";
- break;
- default:
- os->indent ();
- *os << "&_tao_retval";
- break;
- }
- return 0;
-}
-
-int
-be_visitor_operation_rettype_marshal_ss::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- // *os << "_tao_ptr_retval";
- *os << "&_tao_retval.inout ()";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_marshal_ss::visit_string (be_string * /* node*/)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- // *os << "&_tao_ptr_retval";
- *os << "&_tao_retval.inout ()";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_marshal_ss::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- if (node->size_type () == be_type::VARIABLE)
- //*os << "_tao_ptr_retval";
- *os << "&_tao_retval.inout ()";
- else
- *os << "&_tao_retval";
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_marshal_ss::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node); // set the alias node
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_marshal_ss::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_operation_rettype_marshal_ss::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- if (node->size_type () == be_type::VARIABLE)
- // *os << "_tao_ptr_retval";
- *os << "&_tao_retval.inout ()";
- else
- *os << "&_tao_retval";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_post_docall_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_post_docall_cs.cpp
deleted file mode 100644
index 9c43261e406..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_post_docall_cs.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// rettype_post_docall_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for return type post processing following a
-// do_static_call.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, rettype_post_docall_cs, "$Id$")
-
-
-// *******************************************************************************
-// be_visitor_operation_rettype_post_docall_cs
-//
-// This visitor generates code that passes the return type variable to the
-// do_static_call method
-// ********************************************************************************
-
-be_visitor_operation_rettype_post_docall_cs::
-be_visitor_operation_rettype_post_docall_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_operation_rettype_post_docall_cs::
-~be_visitor_operation_rettype_post_docall_cs (void)
-{
-}
-
-int
-be_visitor_operation_rettype_post_docall_cs::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
- *os << "_tao_retval = " << bt->name ()
- << "::_narrow (_tao_base_retval, ACE_TRY_ENV);" << be_nl;
- *os << "CORBA::release (_tao_base_retval);\n";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_post_docall_cs::
-visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
- *os << "_tao_retval = " << bt->name ()
- << "::_narrow (_tao_base_retval, ACE_TRY_ENV);" << be_nl;
- *os << "CORBA::release (_tao_base_retval);\n";
- return 0;
-}
-
-// ****************************************************************
-
-be_visitor_operation_compiled_rettype_post_docall::
- be_visitor_operation_compiled_rettype_post_docall (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-int
-be_visitor_operation_compiled_rettype_post_docall::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt = node;
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
-
- *os << bt->name () << "_forany _tao_retval_forany ("
- << be_idt << be_idt_nl
- << "_tao_retval" << be_uidt_nl
- << ");\n" << be_uidt;
- return 0;
-}
-
-int
-be_visitor_operation_compiled_rettype_post_docall::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node); // set the alias node
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_post_docall::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_post_upcall_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_post_upcall_ss.cpp
deleted file mode 100644
index d30a99cc54f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_post_upcall_ss.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// rettype_post_upcall_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for post-processing of return type after an
-// upcall is made
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, rettype_post_upcall_ss, "$Id$")
-
-
-// ****************************************************************************
-// visitor to do any post processing for return type after an upcall
-// ****************************************************************************
-
-be_visitor_operation_rettype_post_upcall_ss::be_visitor_operation_rettype_post_upcall_ss (be_visitor_context
- *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_operation_rettype_post_upcall_ss::~be_visitor_operation_rettype_post_upcall_ss (void)
-{
-}
-
-int
-be_visitor_operation_rettype_post_upcall_ss::visit_array (be_array *)
-{
- return 0;
-}
-
-int
-be_visitor_operation_rettype_post_upcall_ss::visit_enum (be_enum *)
-{
- return 0;
-}
-
-int
-be_visitor_operation_rettype_post_upcall_ss::visit_interface (be_interface *)
-{
- return 0;
-}
-
-int
-be_visitor_operation_rettype_post_upcall_ss::visit_interface_fwd (be_interface_fwd *)
-{
- return 0;
-}
-
-int
-be_visitor_operation_rettype_post_upcall_ss::visit_predefined_type (be_predefined_type *)
-{
- return 0;
-}
-
-int
-be_visitor_operation_rettype_post_upcall_ss::visit_sequence (be_sequence *)
-{
- return 0;
-}
-
-int
-be_visitor_operation_rettype_post_upcall_ss::visit_string (be_string * /* node*/)
-{
- return 0;
-}
-
-int
-be_visitor_operation_rettype_post_upcall_ss::visit_structure (be_structure *)
-{
- return 0;
-}
-
-int
-be_visitor_operation_rettype_post_upcall_ss::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node); // set the alias node
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_post_upcall_ss::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_operation_rettype_post_upcall_ss::visit_union (be_union *)
-{
- return 0;
-}
-
-// ****************************************************************
-
-be_visitor_operation_compiled_rettype_post_upcall::
- be_visitor_operation_compiled_rettype_post_upcall (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-int
-be_visitor_operation_compiled_rettype_post_upcall::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt = node;
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
-
- *os << bt->name () << "_forany _tao_retval_forany ("
- << be_idt << be_idt_nl
- << "_tao_retval.inout ()" << be_uidt_nl
- << ");\n" << be_uidt;
- return 0;
-}
-
-int
-be_visitor_operation_compiled_rettype_post_upcall::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node); // set the alias node
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_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_operation/rettype_pre_docall_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_pre_docall_cs.cpp
deleted file mode 100644
index f6f656853e4..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_pre_docall_cs.cpp
+++ /dev/null
@@ -1,174 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// rettype_pre_docall_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for doing any pre-processing of return type prior
-// to making the do_static_call.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, rettype_pre_docall_cs, "$Id$")
-
-
-// *****************************************************************************
-// be_visitor_operation_rettype_pre_docall_cs
-//
-// This visitor generates code that passes the return type variable to the
-// do_static_call method
-// *****************************************************************************
-
-be_visitor_operation_rettype_pre_docall_cs::
-be_visitor_operation_rettype_pre_docall_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_operation_rettype_pre_docall_cs::
-~be_visitor_operation_rettype_pre_docall_cs (void)
-{
-}
-
-int
-be_visitor_operation_rettype_pre_docall_cs::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
- *os << "ACE_ALLOCATOR_RETURN (_tao_retval, " << bt->name ()
- << "_alloc (), _tao_retval);\n";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_pre_docall_cs::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "CORBA::Object_ptr _tao_base_retval = CORBA::Object::_nil ();\n";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_pre_docall_cs::visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "CORBA::Object_ptr _tao_base_retval = CORBA::Object::_nil ();\n";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_pre_docall_cs::
-visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_any:
- os->indent ();
- *os << "ACE_NEW_RETURN (_tao_retval, CORBA::Any, _tao_retval);\n";
- break;
- default:
- break;
- }
- return 0;
-}
-
-int
-be_visitor_operation_rettype_pre_docall_cs::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
- *os << "ACE_NEW_RETURN (_tao_retval, " << bt->name () << ", _tao_retval);\n";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_pre_docall_cs::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- // check if the union is variable
- if (node->size_type () == be_type::VARIABLE)
- {
- os->indent ();
- *os << "ACE_NEW_RETURN (_tao_retval, " << bt->name () << ", _tao_retval);\n";
- }
- return 0;
-}
-
-int
-be_visitor_operation_rettype_pre_docall_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node); // set the alias node
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_pre_docall_cs::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_operation_rettype_pre_docall_cs::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- // check if the union is variable
- if (node->size_type () == be_type::VARIABLE)
- {
- os->indent ();
- *os << "ACE_NEW_RETURN (_tao_retval, " << bt->name () << ", _tao_retval);\n";
- }
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_pre_invoke_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_pre_invoke_cs.cpp
deleted file mode 100644
index 5b0c21c3a24..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_pre_invoke_cs.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// rettype_pre_invoke_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for doing any pre-processing of return type prior
-// to making the do_static_call.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, rettype_pre_invoke_cs, "$Id$")
-
-
-// *****************************************************************************
-// be_visitor_operation_rettype_pre_invoke_cs
-//
-// *****************************************************************************
-
-be_visitor_operation_rettype_pre_invoke_cs::
-be_visitor_operation_rettype_pre_invoke_cs (be_visitor_context *ctx)
- : be_visitor_operation_rettype_pre_docall_cs (ctx)
-{
-}
-
-be_visitor_operation_rettype_pre_invoke_cs::
-~be_visitor_operation_rettype_pre_invoke_cs (void)
-{
-}
-
-int
-be_visitor_operation_rettype_pre_invoke_cs::visit_interface (be_interface *)
-{
- // don't do anything. This is the overriding action
- return 0;
-}
-
-int
-be_visitor_operation_rettype_pre_invoke_cs::visit_interface_fwd (be_interface_fwd *)
-{
- 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 49e1870f8d3..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_return_cs.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// rettype_return_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for returning the return type variable.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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 *)
-{
- // Grab the out stream
- TAO_OutStream *os = this->ctx_->stream ();
-
- // os->indent ();
- // *os << "return _tao_retval;\n";
-
- *os << "_tao_retval";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_enum (be_enum *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- //os->indent ();
- // *os << "return _tao_retval;\n";
- *os << "_tao_retval";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- // os->indent ();
- // *os << "return _tao_retval;\n";
- *os << "_tao_retval";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- //os->indent ();
- // *os << "return _tao_retval;\n";
- *os << "_tao_retval";
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-int
-be_visitor_operation_rettype_return_cs::visit_valuetype (be_valuetype *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- //os->indent ();
- // *os << "return _tao_retval;\n";
- *os << "_tao_retval";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- //os->indent ();
- // *os << "return _tao_retval;\n";
- *os << "_tao_retval";
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-int
-be_visitor_operation_rettype_return_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- //os->indent ();
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_void:
- // *os << "return;\n";
- break;
- default:
- // *os << "return _tao_retval;\n";
- *os << "_tao_retval";
- break;
- }
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_sequence (be_sequence *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- //os->indent ();
- // *os << "return _tao_retval;\n";
- *os << "_tao_retval";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- //os->indent ();
- // *os << "return _tao_retval;\n";
- *os << "_tao_retval";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_structure (be_structure *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- //os->indent ();
- // *os << "return _tao_retval;\n";
- *os << "_tao_retval";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_return_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node); // set the 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 *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- //os->indent ();
- // *os << "return _tao_retval;\n";
- *os << "_tao_retval";
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp
deleted file mode 100644
index 5873b0d412f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp
+++ /dev/null
@@ -1,305 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// rettype_vardecl_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for return type variable declaration in the stubs.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, rettype_vardecl_cs, "$Id$")
-
-
-// ************************************************************
-// be_visitor_operation_rettype_vardecl_cs
-// This visitor generates code for variable declaration and initialization
-// of the return type.
-// ************************************************************
-
-be_visitor_operation_rettype_vardecl_cs::
-be_visitor_operation_rettype_vardecl_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_operation_rettype_vardecl_cs::
-~be_visitor_operation_rettype_vardecl_cs (void)
-{
-}
-
-int
-be_visitor_operation_rettype_vardecl_cs::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
-
- *os << bt->name () << "_slice *_tao_retval = 0;";
-
- *os << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_cs::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
-
- *os << bt->name () << " _tao_retval = (" << bt->name () << ")0;";
-
- *os << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_cs::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
- *os << bt->name () << "_ptr _tao_retval = " << bt->name () << "::_nil ();";
-
- *os << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
- *os << bt->name () << "_ptr _tao_retval = " << bt->name () << "::_nil ();";
-
- *os << be_nl << be_nl;
-
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-int
-be_visitor_operation_rettype_vardecl_cs::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
-
- *os << bt->name () << "* _tao_retval = 0;";
-
- *os << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_cs::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
- *os << bt->name () << "* _tao_retval = 0;";
-
- *os << be_nl << be_nl;
-
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-int
-be_visitor_operation_rettype_vardecl_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- os->indent ();
- *os << bt->name () << "_ptr _tao_retval = 0;";
- break;
- case AST_PredefinedType::PT_any:
- os->indent ();
- *os << bt->name () << "* _tao_retval = 0;";
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- os->indent ();
- *os << bt->name () << " _tao_retval = 0;";
- break;
- }
-
- *os << be_nl << be_nl;
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_cs::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 (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
- *os << bt->name () << "* _tao_retval = 0;";
-
- *os << be_nl << be_nl;
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_cs::visit_string (be_string * /* node*/)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << "char* _tao_retval = 0;";
-
- *os << be_nl << be_nl;
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_cs::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
-
- // based on whether we are variable or not, we return a pointer or the
- // aggregate type
- if (node->size_type () == be_decl::VARIABLE)
- {
- *os << bt->name () << "* _tao_retval = 0;" << be_nl;
- }
- else
- {
- *os << bt->name () << " _tao_retval;" << be_nl;
- *os << "ACE_OS::memset (&_tao_retval, 0, sizeof (" << bt->name () << "));"
- << be_nl;
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_cs::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node); // set the alias node
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_vardecl_cs::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_cs::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
-
- // based on whether we are variable or not, we return a pointer or the
- // aggregate type
- if (node->size_type () == be_decl::VARIABLE)
- {
- *os << bt->name () << "* _tao_retval = 0;";
- }
- else
- {
- *os << bt->name () << " _tao_retval;";
- }
-
- *os << be_nl;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_ss.cpp
deleted file mode 100644
index 88901556894..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_ss.cpp
+++ /dev/null
@@ -1,326 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// rettype_vardecl_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for return type variable declaration in the
-// skeleton file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, rettype_vardecl_ss, "$Id$")
-
-
-// ************************************************************************
-// be_visitor_operation_rettype_vardecl_ss
-// This visitor generates code for variable declaration and initialization
-// of the return type.
-// ************************************************************************
-
-be_visitor_operation_rettype_vardecl_ss::be_visitor_operation_rettype_vardecl_ss
-(be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_operation_rettype_vardecl_ss::
-~be_visitor_operation_rettype_vardecl_ss (void)
-{
-}
-
-int
-be_visitor_operation_rettype_vardecl_ss::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
- *os << bt->name () << "_var _tao_retval;\n\n";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_ss::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
- *os << bt->name () << " _tao_retval;\n";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_ss::visit_interface (be_interface *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- // due to the virtual inheritance and the fact that we will be passing the
- // address of the objref to the marshaling routine, we use the base
- // CORBA::Object_ptr as the type for the return value even though the actual
- // return type may be some derived class
- *os << "CORBA::Object_var _tao_retval = CORBA::Object::_nil ();\n";
-#if 0 /* ASG */
- *os << "CORBA::Object_var _tao_retval = CORBA::Object::_nil ();\n";
- *os << "CORBA::Object_ptr &_tao_ptr_retval = _tao_retval.out ();\n";
-#endif
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_ss::
-visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- // due to the virtual inheritance and the fact that we will be passing the
- // address of the objref to the marshaling routine, we use the base
- // CORBA::Object_ptr as the type for the return value even though the actual
- // return type may be some derived class
-#if 0 /* ASG */
- *os << "CORBA::Object_var _tao_retval = CORBA::Object::_nil ();\n";
- *os << "CORBA::Object_ptr &_tao_ptr_retval = _tao_retval.out ();\n";
-#endif
- *os << "CORBA::Object_var _tao_retval = CORBA::Object::_nil ();\n";
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-// like be_compiled_visitor_operation_rettype_vardecl_ss
-int
-be_visitor_operation_rettype_vardecl_ss::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << node->name () << "_var _tao_retval;\n";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_ss::
-visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << node->name () << "_var _tao_retval;\n";
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-int
-be_visitor_operation_rettype_vardecl_ss::
-visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << "_var _tao_retval;\n";
- *os << bt->name () << "_ptr &_tao_ptr_retval = _tao_retval.out ();\n";
-#endif
- *os << bt->name () << "_var _tao_retval;\n";
- break;
- case AST_PredefinedType::PT_any:
- os->indent ();
-#if 0 /* ASG */
- *os << bt->name () << "_var _tao_retval;\n";
- *os << bt->name () << "_ptr &_tao_ptr_retval = _tao_retval.out ();\n";
-#endif
- *os << bt->name () << "_var _tao_retval;\n";
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- os->indent ();
- *os << bt->name () << " _tao_retval = 0;\n";
- break;
- }
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_ss::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 (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
-#if 0 /* ASg */
- *os << bt->name () << "_var _tao_retval;\n";
- *os << bt->name () << " *&_tao_ptr_retval = _tao_retval.out ();\n";
-#endif
- *os << bt->name () << "_var _tao_retval;\n";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_ss::visit_string (be_string * /* node*/)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
-#if 0 /* ASG */
- *os << "CORBA::String_var _tao_retval;\n";
- *os << "char *&_tao_ptr_retval = _tao_retval.out ();\n";
-#endif
- *os << "CORBA::String_var _tao_retval;\n";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_ss::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
- // based on whether we are variable or not, we return a pointer or the
- // aggregate type
- if (node->size_type () == be_decl::VARIABLE)
- {
-#if 0 /* ASG */
- *os << bt->name () << "_var _tao_retval;\n";
- *os << bt->name () << " *&_tao_ptr_retval = _tao_retval.out ();\n";
-#endif
- *os << bt->name () << "_var _tao_retval;\n";
- }
- else
- *os << bt->name () << " _tao_retval;\n";
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_ss::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node); // set the alias node
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_rettype_vardecl_ss::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_operation_rettype_vardecl_ss::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
- be_type *bt; // return type
-
- if (this->ctx_->alias ()) // a typedefed return type
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- os->indent ();
- // based on whether we are variable or not, we return a pointer or the
- // aggregate type
- if (node->size_type () == be_decl::VARIABLE)
- {
-#if 0 /* ASG */
- *os << bt->name () << "_var _tao_retval;\n";
- *os << bt->name () << " *&_tao_ptr_retval = _tao_retval.out ();\n";
-#endif
- *os << bt->name () << "_var _tao_retval;\n";
- }
- else
- *os << bt->name () << " _tao_retval;\n";
- return 0;
-}
-
-
-// ********************************************************************************
-// be_visitor_operation_rettype_vardecl_ss
-// This visitor generates code for variable declaration and initialization
-// of the return type.
-// ********************************************************************************
-
-be_compiled_visitor_operation_rettype_vardecl_ss
-::be_compiled_visitor_operation_rettype_vardecl_ss
-(be_visitor_context *ctx)
- : be_visitor_operation_rettype_vardecl_ss (ctx)
-{
-}
-
-be_compiled_visitor_operation_rettype_vardecl_ss::
-~be_compiled_visitor_operation_rettype_vardecl_ss (void)
-{
-}
-
-int
-be_compiled_visitor_operation_rettype_vardecl_ss::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << node->name () << "_var _tao_retval;\n";
- return 0;
-}
-
-int
-be_compiled_visitor_operation_rettype_vardecl_ss::
-visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // grab the out stream
-
- os->indent ();
- *os << node->name () << "_var _tao_retval;\n";
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_sh.cpp
deleted file mode 100644
index c098696d347..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_sh.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// thru_poa_collocated_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for thru_poa_collocated operation in the server header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, thru_poa_collocated_sh, "$Id$")
-
-
-// *************************************************************************
-// be_visitor_operation_thru_poa_collocated_sh --
-// This visitor generates code for the thru_poa_collocated operation signature in a
-// server header file
-// *************************************************************************
-
-be_visitor_operation_thru_poa_collocated_sh::be_visitor_operation_thru_poa_collocated_sh
-(be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_operation_thru_poa_collocated_sh::~be_visitor_operation_thru_poa_collocated_sh (void)
-{
-}
-
-int be_visitor_operation_thru_poa_collocated_sh::visit_operation (be_operation *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt; // type node representing the return type
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node
-
- os->indent (); // start with the current indentation level
-
- // every operation is declared virtual in the client code
- *os << "virtual ";
-
- // STEP I: generate the return 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_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_sh::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_sh::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
- delete visitor;
-
- // 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_COLLOCATED_SH);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_sh::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_sh::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_ss.cpp
deleted file mode 100644
index 78c7b56db5f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_ss.cpp
+++ /dev/null
@@ -1,302 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// thru_poa_collocated_ss.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for thru_poa_collocated Operation in the skeleton.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-ACE_RCSID(be_visitor_operation, thru_poa_collocated_ss, "$Id$")
-
-
-// *************************************************************************
-// be_visitor_operation_thru_poa_collocated_ss --
-// This visitor generates code for the thru_poa_collocated operation signature in a
-// server skeletons file
-// *************************************************************************
-
-be_visitor_operation_thru_poa_collocated_ss::be_visitor_operation_thru_poa_collocated_ss
-(be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_operation_thru_poa_collocated_ss::~be_visitor_operation_thru_poa_collocated_ss (void)
-{
-}
-
-int be_visitor_operation_thru_poa_collocated_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;
- 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);
- }
-
- // 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_thru_poa_collocated_ss::"
- "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_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_thru_poa_collocated_ss::"
- "visit_operation - "
- "Bad visitor for return type\n"),
- -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_thru_poa_collocated_ss::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
- delete visitor;
-
- *os << " " << intf->full_coll_name (be_interface::THRU_POA) << "::"
- << node->local_name () << " ";
-
- // STEP 4: generate the argument list with the appropriate mapping (same as
- // in the header file)
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_OTHERS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_cs::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- *os << "{" << be_idt << "\n";
-
- if (!idl_global->exception_support ())
- {
- // Declare a return type
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_thru_poa_collocated_ss::"
- "visit_operation - "
- "codegen for return var decl failed\n"),
- -1);
- }
-
- if (!this->void_return_type (bt))
- {
- os->indent ();
- *os << "ACE_UNUSED_ARG (";
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_thru_poa_collocated_cs::"
- "gen_check_exception - "
- "codegen failed\n"),
- -1);
- }
- *os << ");\n";
- }
- }
-
- os->indent ();
-
- *os <<"TAO_Object_Adapter::Servant_Upcall servant_upcall ("
- << be_idt << be_idt_nl
- << "*this->_stubobj ()->servant_orb_var ()->orb_core ()->object_adapter ()"
- << be_uidt_nl
- << ");" << be_uidt_nl
- << "servant_upcall.prepare_for_upcall (" << be_idt << be_idt_nl
- << "this->_object_key ()," << be_nl
- << "\"" << node->original_local_name () << "\"";
- if (!idl_global->exception_support ())
- *os << "," << be_nl
- << "ACE_TRY_ENV" << be_uidt_nl
- << ");\n" << be_uidt;
- else
- *os << be_uidt_nl << ");\n" << be_uidt;
-
- // check if there is an exception
- if (!idl_global->exception_support ())
- if (this->gen_check_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_thru_poa_collocated_ss::"
- "visit_operation - "
- "codegen for checking exception failed\n"),
- -1);
- }
-
- os->indent ();
-
- if (!this->void_return_type (bt))
- {
- *os << "return ";
- }
-
- *os << "ACE_reinterpret_cast (" << be_idt << be_idt_nl
- << intf->full_skel_name () << "_ptr," << be_nl
- << "servant_upcall.servant ()->_downcast (" << be_idt << be_idt_nl
- << "\"" << intf->repoID () << "\"" << be_uidt_nl
- << ")" << be_uidt << be_uidt_nl
- << ")" << be_uidt;
-
- if (this->gen_invoke (ctx, node) == -1)
- return -1;
-
- if (this->void_return_type (bt))
- {
- os->indent ();
- *os << "return;";
- }
-
- *os << be_uidt_nl
- << "}\n\n";
-
- return 0;
-}
-
-int be_visitor_operation_thru_poa_collocated_ss::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 *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_thru_poa_collocated_ss::"
- "gen_invoke - "
- "codegen for making upcall failed\n"),
- -1);
- }
-
- // end the upcall
- *os << be_uidt_nl
- << ");\n" << be_uidt;
- return 0;
-}
-
-int
-be_visitor_operation_thru_poa_collocated_ss::gen_check_exception (be_type *bt)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
- // check if there is an exception
- if (!this->void_return_type (bt))
- {
- *os << "ACE_CHECK_RETURN (";
- // << "_tao_environment, ";
-
- // return the appropriate return value
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_thru_poa_collocated_cs::"
- "gen_check_exception - "
- "codegen failed\n"),
- -1);
- }
- *os << ");\n";
- }
- else
- {
- *os << "ACE_CHECK;\n";
- //<< "_tao_environment);\n";
- }
-
- return 0;
-}
-
-int
-be_visitor_operation_thru_poa_collocated_ss::void_return_type (be_type *bt)
-{
- // is the operation return type void?
-
- if (bt->node_type () == AST_Decl::NT_pre_defined
- && (be_predefined_type::narrow_from_decl (bt)->pt ()
- == AST_PredefinedType::PT_void))
- return 1;
- else
- 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 08c28a0d6ee..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp
+++ /dev/null
@@ -1,121 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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; // output stream
- be_type *bt; // type node representing the return type
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node
-
- os->indent (); // start with the current indentation level
-
- // STEP I: generate the return 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);
- }
-
- // grab the right visitor to generate the return type
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_tie_sh::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_tie_sh::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
- delete visitor;
-
- // 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);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_tie_sh::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_tie_sh::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
- 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 098429b1537..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// tie_si.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for operations for the TIE class.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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);
- }
-
- os->indent ();
- *os << "template <class T> ACE_INLINE\n";
-
- // generate the return type mapping (same as in the header file)
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_tie_si::"
- "visit_operation - "
- "Bad visitor for return type\n"),
- -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_tie_si::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
- delete visitor;
-
- *os << " " << intf->full_skel_name () << "_tie<T>::"
- << node->local_name () << " ";
-
- // STEP 4: generate the argument list with the appropriate mapping (same as
- // in the header file)
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_OTHERS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_cs::"
- "visit_operation - "
- "Bad visitor for argument list\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- *os << "{" << be_idt_nl;
-
- if (bt->node_type () != AST_Decl::NT_pre_defined
- || be_predefined_type::narrow_from_decl (bt)->pt () != AST_PredefinedType::PT_void)
- {
- *os << "return ";
- }
-
- *os << "this->ptr_->" << node->local_name () << " (" << be_idt << "\n";
-
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for making upcall failed\n"),
- -1);
- }
- // end the upcall
- *os << be_uidt_nl;
- *os << ");" << be_uidt_nl;
- *os << "}\n\n";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_rettype.cpp b/TAO/TAO_IDL/be/be_visitor_rettype.cpp
deleted file mode 100644
index eb1cf5095d9..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_rettype.cpp
+++ /dev/null
@@ -1,3032 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_rettype.cpp
-//
-// = DESCRIPTION
-// Visitor generating the first argument of an ami handler's call
-// back hook method.
-//
-// = AUTHOR
-// Alexander Babu Arulanthu <alex@cs.wustl.edu>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_rettype.h"
-
-ACE_RCSID(be, be_visitor_rettype, "$Id$")
-
-
-// ******************************************************
-// TypeCode Definitions
-// ******************************************************
-
-be_visitor_rettype_ami_handler_result_arg::be_visitor_rettype_ami_handler_result_arg (be_visitor_context *ctx)
- : be_visitor_scope (ctx),
- computed_tc_size_ (0),
- computed_encap_len_ (0),
- computed_scope_encap_len_ (0),
- tc_offset_ (0),
- index_ (-1)
-
-{
-}
-
-be_visitor_rettype_ami_handler_result_arg::~be_visitor_rettype_ami_handler_result_arg (void)
-{
- this->queue_reset (this->tc_queue_);
- this->queue_reset (this->compute_queue_);
-}
-
-// the visit methods will be called for the top-level node whose typecode is
-// being generated
-
-int
-be_visitor_rettype_ami_handler_result_arg::visit_type (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // reset the queue
- this->queue_reset (this->tc_queue_);
- this->tc_offset_ = 0;
-
- // check if optimized typecodes are desired OR if the node is involved in
- // some form of recursion
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_rettype_ami_handler_result_arg::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- os->indent (); // start from current indentation level
-
- // generate the typecode information here
- *os << "static const CORBA::Long _oc_" << node->flatname () << "[] ="
- << be_nl;
- *os << "{" << be_idt << "\n";
-
- // add the sizeof the enum tk_* and the encap length that we do not put into
- // this array but which will exist in the CDR buffer
-
- this->tc_offset_ = 4 + 4;
-
-
- // note that we just need the parameters here and hence we generate the
- // encapsulation for the parameters
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_rettype_ami_handler_result_arg::"
- "visit_type - "
- "codegen for typecode encapsulation failed\n"),
- -1);
- }
- *os << be_uidt << "};" << be_nl;
-
- *os << "static CORBA::TypeCode _tc_TAO_tc_" << node->flatname ()
- << " (";
- switch (node->node_type ())
- {
- case AST_Decl::NT_array:
- *os << "CORBA::tk_array";
- break;
- case AST_Decl::NT_enum:
- *os << "CORBA::tk_enum";
- break;
- case AST_Decl::NT_except:
- *os << "CORBA::tk_except";
- break;
- case AST_Decl::NT_interface:
- *os << "CORBA::tk_objref";
- break;
- case AST_Decl::NT_sequence:
- *os << "CORBA::tk_sequence";
- break;
- case AST_Decl::NT_struct:
- *os << "CORBA::tk_struct";
- break;
- case AST_Decl::NT_typedef:
- *os << "CORBA::tk_alias";
- break;
- case AST_Decl::NT_union:
- *os << "CORBA::tk_union";
- break;
- default:
- return -1; // error
- }
-
- *os << ", sizeof (_oc_" << node->flatname ()
- << "), (char *) &_oc_" << node->flatname ()
- << ", 0, sizeof (" << node->name () << "));" << be_nl;
-
- // 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)
- {
- *os << "TAO_NAMESPACE_TYPE (CORBA::TypeCode_ptr)" << be_nl;
- be_module *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_rettype_ami_handler_result_arg::visit_type - "
- "Error parsing nested name\n"),
- -1);
- }
- *os << "TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_"
- << node->local_name () << ", &_tc_TAO_tc_"
- << node->flatname () << ")" << be_nl;
- if (this->gen_nested_namespace_end (module) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_rettype_ami_handler_result_arg::visit_type - "
- "Error parsing nested name\n"),
- -1);
- }
- }
- else
- {
- // outermost scope.
- *os << "CORBA::TypeCode_ptr " << node->tc_name () << " = &_tc_TAO_tc_"
- << node->flatname () << ";\n\n";
- }
- return 0;
-}
-
-// the following needs to be done to deal with the most bizarre behavior of
-// MSVC++ compiler
-int
-be_visitor_rettype_ami_handler_result_arg::gen_nested_namespace_begin (be_module *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- UTL_IdListActiveIterator *i;
-
- i = new UTL_IdListActiveIterator (node->name ());
- while (!(i->is_done ()))
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- {
- // leave the outermost root scope
- *os << "TAO_NAMESPACE_BEGIN (" << i->item ()->get_string ()
- << ")" << be_nl;
- }
- i->next ();
- }
- delete i;
- return 0;
-}
-
-// the following needs to be done to deal with the most bizarre behavior of
-// MSVC++ compiler
-int
-be_visitor_rettype_ami_handler_result_arg::gen_nested_namespace_end (be_module *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- UTL_IdListActiveIterator *i;
-
- i = new UTL_IdListActiveIterator (node->name ());
- while (!(i->is_done ()))
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- {
- // leave the outermost root scope
- *os << "TAO_NAMESPACE_END" << be_nl;
- }
- i->next ();
- }
- delete i;
- return 0;
-}
-
-int
-be_visitor_rettype_ami_handler_result_arg::visit_array (be_array *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_rettype_ami_handler_result_arg::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_rettype_ami_handler_result_arg::visit_enum (be_enum *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- return this->visit_scope (node);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_rettype_ami_handler_result_arg::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_rettype_ami_handler_result_arg::visit_enum_val (be_enum_val *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_rettype_ami_handler_result_arg::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_rettype_ami_handler_result_arg::visit_exception (be_exception *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- return this->visit_scope (node);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_rettype_ami_handler_result_arg::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_rettype_ami_handler_result_arg::visit_field (be_field *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_rettype_ami_handler_result_arg::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_rettype_ami_handler_result_arg::visit_interface (be_interface *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_rettype_ami_handler_result_arg::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_rettype_ami_handler_result_arg::visit_interface_fwd (be_interface_fwd *)
-{
- // nothing to do
- return 0;
-}
-
-int
-be_visitor_rettype_ami_handler_result_arg::visit_predefined_type (be_predefined_type *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- // top level typecodes are defined in the CORBA library. If we show up
- // here, then it is an error
- break;
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_rettype_ami_handler_result_arg::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_rettype_ami_handler_result_arg::visit_sequence (be_sequence *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_rettype_ami_handler_result_arg::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_string (be_string *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- // top level typecode for string is not permitted. It has to be a
- // typedefed string
- break;
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_structure (be_structure *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- return this->visit_scope (node);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_typedef (be_typedef *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_union (be_union *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- return this->visit_scope (node);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_union_branch (be_union_branch *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-// methods that actually produce the typecode and the encapsulations
-
-
-int
-be_visitor_typecode_defn::gen_typecode (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // we do not do typecode optimization for anonymous arrays
-
- *os << "CORBA::tk_array, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (array) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("gen_typecode - ")
- ASYS_TEXT ("gen_encapsulation failed for array\n")),
- -1);
- }
-
- *os << be_uidt << "\n";
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_type *bt; // base type
- unsigned long i;
-
- os->indent (); // start from the current indentation level
-
- // retrieve the base type
- bt = be_type::narrow_from_decl (node->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_array::gen_encapsulation - "
- "bad base type\n"),
- -1);
- }
-
- // compute the typecode size
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE);
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_encapsulation (array) - ")
- ASYS_TEXT ("Failed to get typecode size\n")),
- -1);
- }
-
- for (i = 0; i < (node->n_dims () - 1); i++)
- {
- unsigned long rem_encap_len;
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- *os << "CORBA::tk_array, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- rem_encap_len
- = (node->n_dims () - (i + 1)) * (4 + 4)
- + (node->n_dims () - (i + 2)) * (4 + 4)
- + this->computed_tc_size_;
- *os << rem_encap_len << ", // encapsulation length" << be_idt_nl;
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
-
- // now generate the typecode of the base type
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order\n";
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED);
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_array::gen_encapsulation - "
- "base type typecode gen failed\n"),
- -1);
- }
-
- os->indent ();
- // now reduce the indentation appropriately
- for (i = (node->n_dims () - 1); i > 0; i--)
- {
- *os << node->dims ()[i] << "," << be_uidt_nl;
- // size of the dimension which is a 4 byte quantity
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- *os << node->dims ()[0] << ",\n";
- // size of the dimension which is a 4 byte quantity
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
- if (qnode)
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
- {
- if (idl_global->opt_tc ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- *os << "CORBA::tk_enum, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (enum) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect computation of other
- // nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (enum) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
-
- *os << be_uidt << "\n";
-
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate repoID
- this->gen_repoID (node);
-
- // generate name
- os->indent ();
- this->gen_name (node);
-
- // generate the member count
- os->indent ();
- *os << node->member_count () << ", // member count\n";
- // size of the member length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // hand over to the scope to generate the typecode for elements
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_encapsulation (enum) - ")
- ASYS_TEXT ("cannot generate typecode for members\n")),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_enum_val *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // generate name
- this->gen_name (node);
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_exception *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
- if (qnode)
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- *os << "CORBA::tk_except, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (exception) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect computation of other
- // nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (exception) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
-
- *os << be_uidt << "\n";
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_exception *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate repoID
- this->gen_repoID (node);
-
- // generate name
- os->indent ();
- this->gen_name (node);
-
- // generate the member count
- os->indent ();
- *os << node->member_count () << ", // member count\n";
- // size of the member count
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // hand over to the scope to generate the typecode for elements
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_encapsulation (exception) - ")
- ASYS_TEXT ("cannot generate typecode for members\n")),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_field *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_type *bt; // our type node
-
- os->indent (); // start from whatever indentation level we were at
-
- // generate name
- this->gen_name (node);
-
- // hand over code generation to our type node
- bt = be_type::narrow_from_decl (node->field_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_encapsulation (field) - ")
- ASYS_TEXT ("failed to generate typecode\n")),
- -1);
- }
- // revert the state to what it was before because we may be dealing with
- // subsequent fields for which we have to be in the "gen scope"
- // substate
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE);
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
- if (qnode)
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- *os << "CORBA::tk_objref, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (interface) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect computation of other
- // nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (interface) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
- *os << be_uidt << "\n";
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate repoID
- this->gen_repoID (node);
-
- // generate name
- os->indent ();
- this->gen_name (node);
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_interface_fwd *)
-{
- // nothing to do here
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_interface_fwd *)
-{
- // nothing to be done
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from the current indentation level
-
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_void:
- *os << "CORBA::tk_void,\n\n";
- break;
- case AST_PredefinedType::PT_short:
- *os << "CORBA::tk_short,\n\n";
- break;
- case AST_PredefinedType::PT_ushort:
- *os << "CORBA::tk_ushort,\n\n";
- break;
- case AST_PredefinedType::PT_long:
- *os << "CORBA::tk_long,\n\n";
- break;
- case AST_PredefinedType::PT_ulong:
- *os << "CORBA::tk_ulong,\n\n";
- break;
- case AST_PredefinedType::PT_longlong:
- *os << "CORBA::tk_longlong,\n\n";
- break;
- case AST_PredefinedType::PT_ulonglong:
- *os << "CORBA::tk_ulonglong,\n\n";
- break;
- case AST_PredefinedType::PT_float:
- *os << "CORBA::tk_float,\n\n";
- break;
- case AST_PredefinedType::PT_double:
- *os << "CORBA::tk_double,\n\n";
- break;
- case AST_PredefinedType::PT_longdouble:
- *os << "CORBA::tk_longdouble,\n\n";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "CORBA::tk_boolean,\n\n";
- break;
- case AST_PredefinedType::PT_char:
- *os << "CORBA::tk_char,\n\n";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "CORBA::tk_octet,\n\n";
- break;
- case AST_PredefinedType::PT_any:
- *os << "CORBA::tk_any,\n\n";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "CORBA::tk_wchar,\n\n";
- break;
- case AST_PredefinedType::PT_pseudo:
- {
- if (!ACE_OS::strcmp (node->local_name ()->get_string (), "TypeCode"))
- *os << "CORBA::tk_TypeCode,\n\n";
- else
- if (!ACE_OS::strcmp (node->local_name ()->get_string (), "Object"))
- {
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
- if (qnode)
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- *os << "CORBA::tk_objref," << be_nl;
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (predefined) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect
- // computation of other nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_
- << ", // encapsulation length" << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (predefined objref) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
- *os << be_uidt << "\n";
- }
- }
- }
- break;
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_predefined_type *node)
-{
- // this one is valid only for "Object"
- if (!ACE_OS::strcmp (node->local_name ()->get_string (), "Object"))
- {
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate repoID
- this->gen_repoID (node);
-
- // generate name
- os->indent ();
- this->gen_name (node);
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // no typecode optimization for anonymous sequences
-
- *os << "CORBA::tk_sequence, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (sequence) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect computation of other
- // nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (sequence) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
- *os << be_uidt << "\n";
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_type *bt; // base type
-
- os->indent ();
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order\n";
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // emit typecode of element type
- bt = be_type::narrow_from_decl (node->base_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_encapsulation (sequence) - ")
- ASYS_TEXT ("failed to generate typecode\n")),
- -1);
- }
-
- // emit the sequence bounds (0 if unbounded)
- os->indent ();
- *os << node->max_size () << ",\n";
- // size of the bound length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- // no typecode optimizations for anonymous strings
-
- os->indent (); // start from the current indentation level
- // emit the enumeration
- *os << "CORBA::tk_string, " << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // emit the string bounds (0 if unbounded)
- *os << node->max_size () << ", // string length\n";
- // size of the bounds
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_string *)
-{
- // nothing to be done here
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
- if (qnode)
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- *os << "CORBA::tk_struct, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (struct) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect computation of other
- // nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (structure) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
- *os << be_uidt << "\n";
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate repoID
- this->gen_repoID (node);
-
- // generate name
- os->indent ();
- this->gen_name (node);
-
- // generate the member count
- os->indent ();
- *os << node->member_count () << ", // member count\n";
- // size of the member count
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // hand over to the scope to generate the typecode for elements
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE);
- if (node->accept (this) == -1)
- {
- ACE_ERROR ((LM_ERROR, "be_structure: cannot generate typecode for members\n"));
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_typedef *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
- if (qnode)
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- *os << "CORBA::tk_alias, // typecode kind for typedefs" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (typedef) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect computation of other
- // nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (typedef) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
-
- *os << be_uidt << "\n";
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_typedef *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_type *bt; // base type
-
- os->indent (); // start from whatever indentation level we were at
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate repoID
- this->gen_repoID (node);
-
- // generate name
- os->indent ();
- this->gen_name (node);
-
- // generate typecode for the base type
- bt = be_type::narrow_from_decl (node->base_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_encapsulation (typedef) - ")
- ASYS_TEXT ("failed to generate typecode\n")),
- -1);
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
- if (qnode)
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- *os << "CORBA::tk_union, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (union) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect computation of other
- // nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (union) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
- *os << be_uidt << "\n";
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_type *discrim;
-
- os->indent (); // start from whatever indentation level we were at
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate repoID
- this->gen_repoID (node);
-
- // generate name
- os->indent ();
- this->gen_name (node);
-
- // generate typecode for discriminant
- discrim = be_type::narrow_from_decl (node->disc_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED);
- if (discrim->accept (this) == -1)
- {
- ACE_ERROR ((LM_ERROR, "be_union: cannot generate typecode for discriminant\n"));
- return -1;
- }
-
- // generate the default used flag
- os->indent ();
- *os << node->default_index () << ", // default used index" << be_nl;
- // size of the default index used
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate the member count
- *os << node->member_count () << ", // member count\n";
- // size of the member count
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // hand over to the scope to generate the typecode for elements
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE);
- if (node->accept (this) == -1)
- {
- ACE_ERROR ((LM_ERROR, "be_union: cannot generate code for members\n"));
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_union_branch *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_type *bt; // our type node
-
- be_union *ub = this->ctx_->be_scope_as_union ();
-
- ACE_UINT32 buf[1];
- ACE_OS::memset (buf, 0, sizeof (buf));
-
- for (unsigned long i = 0;
- i < node->label_list_length ();
- ++i)
- {
- os->indent ();
-
- // emit the case label value
- if (node->label (i)->label_kind () == AST_UnionLabel::UL_label)
- {
- AST_Expression *expression = node->label (i)->label_val ();
- AST_Expression::AST_ExprValue *ev = expression->ev ();
- switch (ub->udisc_type ())
- {
- case AST_Expression::EV_char:
- os->print ("ACE_IDL_NCTOHL (0x%02.2x)", (unsigned char)ev->u.cval);
- // size of bool/char aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
- case AST_Expression::EV_bool:
- os->print ("ACE_IDL_NCTOHL (0x%02.2x)", (unsigned char)ev->u.bval);
- // size of bool/char aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
- case AST_Expression::EV_wchar:
- case AST_Expression::EV_short:
- os->print ("ACE_IDL_NSTOHL (0x%04.4x)", (unsigned short)ev->u.sval);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_ushort:
- os->print ("ACE_IDL_NSTOHL (0x%04.4x)", (unsigned short)ev->u.usval);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_long:
- os->print ("0x%08.8x", (unsigned long)ev->u.lval);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_ulong:
- os->print ("0x%08.8x", ev->u.ulval);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_any:
- // enum
- os->print ("0x%08.8x", (unsigned long)ev->u.eval);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_ulonglong:
- case AST_Expression::EV_longlong:
- // unimplemented yet
-
- default:
- ACE_ERROR_RETURN ((LM_DEBUG,
- "be_union_branch: (%N:%l) Label value "
- "type (%d) is invalid\n", ev->et), -1);
- ACE_NOTREACHED (break;)
- }
-
- *os << ", // union case label (evaluated value)" << be_nl;
- }
- else
- {
- // default case
- be_union::DefaultValue dv;
- if (ub->default_value (dv) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode::"
- "gen_encapsulation (union_branch) - "
- "computing default value failed\n"),
- -1);
- }
-
- switch (ub->udisc_type ())
- {
- case AST_Expression::EV_char:
- os->print ("ACE_IDL_NCTOHL (0x%02.2x)", (unsigned char)dv.u.char_val);
- // size of bool/char aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
- case AST_Expression::EV_bool:
- os->print ("ACE_IDL_NCTOHL (0x%02.2x)", (unsigned char)dv.u.bool_val);
- // size of bool/char aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
- case AST_Expression::EV_wchar:
- case AST_Expression::EV_short:
- os->print ("ACE_IDL_NSTOHL (0x%04.4x)", (unsigned short)dv.u.short_val);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_ushort:
- os->print ("ACE_IDL_NSTOHL (0x%04.4x)", (unsigned short)dv.u.ushort_val);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_long:
- os->print ("0x%08.8x", (unsigned long)dv.u.long_val);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_ulong:
- os->print ("0x%08.8x", (unsigned long)dv.u.ulong_val);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_any:
- // enum
- os->print ("0x%08.8x", (unsigned long)dv.u.enum_val);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_ulonglong:
- case AST_Expression::EV_longlong:
- // unimplemented yet
-
- default:
- ACE_ERROR_RETURN ((LM_DEBUG,
- "be_union_branch: (%N:%l) Label value "
- "type (%d) is invalid\n", ub->udisc_type ()),
- -1);
- ACE_NOTREACHED (break;)
- }
-
- *os << ", // union default label (evaluated value)" << be_nl;
- }
-
- // emit name
- this->gen_name (node);
-
- // hand over code generation to our type node
- bt = be_type::narrow_from_decl (node->field_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_encapsulation (union_branch) - ")
- ASYS_TEXT ("failed to generate typecode\n")),
- -1);
- }
- } // end of for loop
-
- // revert the state
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE);
- return 0;
-}
-
-
-// = methods for computing typecode and encapsulation sizes
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_array *node)
-{
- // 4 bytes for enumeration, 4 bytes for storing encap length val, followed by the
- // actual encapsulation
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (array) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- return this->computed_tc_size_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_array *node)
-{
- // Suppose "N" is the number of dimensions, then for a N dimensional array,
- // we will have N encapsulations. The innermost encapsulation will hold the
- // typecode of the real base type.
- // Thus, we will have N byte order flags and dimensions, and N-1 tk_array
- // enumerations, encapsulation lengths, and dimensions.
-
- be_type *bt; // base type
-
- bt = be_type::narrow_from_decl (node->base_type ());
-
- ACE_CDR::Long encap_len =
- // N byte order flags and dimensions
- node->n_dims () * (4 + 4)
- +
- // N-1 of tk_array and that many encapsulation lengths
- (node->n_dims () - 1) * (4 + 4);
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (array) - ")
- ASYS_TEXT ("cannot compute tc size for base\n")),
- -1);
- }
-
- this->computed_encap_len_ = encap_len + this->computed_tc_size_;
- return this->computed_encap_len_;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_enum *node)
-{
- // while computing the encapsulation length we must keep in mind the typecode
- // that has gotten generated until this point. Hence, we must first check the
- // "tc_queue" to ensure if are already there somewhere in a previous
- // encapsulation in which case we must count only the bytes for the
- // indirection. If we are not already generated, we must then check if we
- // have already been counted in the current computation or not by checking
- // for our presence in the compute queue. In both cases, we only include the
- // 8 bytes in the computation
- if (this->queue_lookup (this->tc_queue_, node) ||
- this->queue_lookup (this->compute_queue_, node))
- {
- this->computed_tc_size_ = 4 + 4;
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->compute_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "compute_tc_size (enum) - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- // 4 bytes for enumeration, 4 bytes for storing encap length val, followed by the
- // actual encapsulation
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (enum) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- }
- return this->computed_tc_size_;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_enum *node)
-{
- ACE_CDR::Long encap_len;
- encap_len = 4; // holds the byte order flag
-
- encap_len +=
- this->repoID_encap_len (node); // repoID storage
-
- // do the same thing for the local name
- encap_len += this->name_encap_len (node);
-
- encap_len += 4; // to hold the member count
-
- // save the current value of scope len and start with a fresh one for our
- // scope length computation
- if (this->push (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (enum) - ")
- ASYS_TEXT ("push failed\n")),
- -1);
- }
- this->computed_scope_encap_len_ = 0;
-
- // compute encap length for members
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (enum) - ")
- ASYS_TEXT ("cannot compute scope tc size\n")),
- -1);
- }
-
- this->computed_encap_len_ = encap_len + this->computed_scope_encap_len_;
-
- // pop off the previous value of computed_scope_len_
- if (this->pop (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (enum) - ")
- ASYS_TEXT ("pop failed\n")),
- -1);
- }
-
- return this->computed_encap_len_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_enum_val *node)
-{
- this->computed_encap_len_ = this->name_encap_len (node);
- return this->computed_encap_len_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_exception *node)
-{
- // while computing the encapsulation length we must keep in mind the typecode
- // that has gotten generated until this point. Hence, we must first check the
- // "tc_queue" to ensure if are already there somewhere in a previous
- // encapsulation in which case we must count only the bytes for the
- // indirection. If we are not already generated, we must then check if we
- // have already been counted in the current computation or not by checking
- // for our presence in the compute queue. In both cases, we only include the
- // 8 bytes in the computation
- if (this->queue_lookup (this->tc_queue_, node) ||
- this->queue_lookup (this->compute_queue_, node))
- {
- this->computed_tc_size_ = 4 + 4;
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->compute_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "compute_tc_size (exception) - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (array) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- }
- return this->computed_tc_size_;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_exception *node)
-{
- ACE_CDR::Long encap_len;
- encap_len = 4; // holds the byte order flag
-
- encap_len += this->repoID_encap_len (node); // repoID
-
- // do the same thing for the local name
- encap_len += this->name_encap_len (node);
-
- encap_len += 4; // to hold the member count
-
- // save the current value of scope len and start with a fresh one for our
- // scope length computation
- if (this->push (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (exception) - ")
- ASYS_TEXT ("push failed\n")),
- -1);
- }
- this->computed_scope_encap_len_ = 0;
-
- // compute encap length for members
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (exception) - ")
- ASYS_TEXT ("cannot compute scope tc size\n")),
- -1);
- }
-
- this->computed_encap_len_ = encap_len + this->computed_scope_encap_len_;
-
- // pop off the previous value of computed_scope_len_
- if (this->pop (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (exception) - ")
- ASYS_TEXT ("pop failed\n")),
- -1);
- }
-
- return this->computed_encap_len_;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_field *node)
-{
- be_type *bt;
-
- // struct member is represented as the "name" followed by the typecode
-
- ACE_CDR::Long encap_len =
- this->name_encap_len (node); // for name
-
- // add to this, the size of our typecode
- bt = be_type::narrow_from_decl (node->field_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (array) - ")
- ASYS_TEXT ("cannot compute tc size\n")),
- -1);
- }
-
- // note that we must add typecode size of base type
- this->computed_encap_len_ = encap_len + this->computed_tc_size_;
-
- // revert the sub state
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN);
-
- return this->computed_encap_len_;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_interface *node)
-{
- // while computing the encapsulation length we must keep in mind the typecode
- // that has gotten generated until this point. Hence, we must first check the
- // "tc_queue" to ensure if are already there somewhere in a previous
- // encapsulation in which case we must count only the bytes for the
- // indirection. If we are not already generated, we must then check if we
- // have already been counted in the current computation or not by checking
- // for our presence in the compute queue. In both cases, we only include the
- // 8 bytes in the computation
- if (this->queue_lookup (this->tc_queue_, node) ||
- this->queue_lookup (this->compute_queue_, node))
- {
- this->computed_tc_size_ = 4 + 4;
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->compute_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "compute_tc_size (interface) - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (interface) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- }
- return this->computed_tc_size_;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_interface *node)
-{
- this->computed_encap_len_ = 4; // holds the byte order flag
-
- this->computed_encap_len_ +=
- this->repoID_encap_len (node); // for repoID
-
- // do the same thing for the local name
- this->computed_encap_len_ +=
- this->name_encap_len (node);
-
- return this->computed_encap_len_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_interface_fwd *)
-{
- return 0;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_interface_fwd *)
-{
- return 0;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_predefined_type *node)
-{
- if (!ACE_OS::strcmp (node->local_name ()->get_string (),
- "Object")) // not same
- {
- // while computing the encapsulation length we must keep in mind the typecode
- // that has gotten generated until this point. Hence, we must first check the
- // "tc_queue" to ensure if are already there somewhere in a previous
- // encapsulation in which case we must count only the bytes for the
- // indirection. If we are not already generated, we must then check if we
- // have already been counted in the current computation or not by checking
- // for our presence in the compute queue. In both cases, we only include the
- // 8 bytes in the computation
- if (this->queue_lookup (this->tc_queue_, node) ||
- this->queue_lookup (this->compute_queue_, node))
- {
- this->computed_tc_size_ = 4 + 4;
- }
- else
- {
-
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->compute_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "compute_tc_size (predefined type) - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (predefined objref) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- }
- }
- else
- this->computed_tc_size_ = 4;
-
- return this->computed_tc_size_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_predefined_type *node)
-{
- if (!ACE_OS::strcmp (node->local_name ()->get_string (),
- "Object")) // not same
- {
- this->computed_encap_len_ = 4; // holds the byte order flag
-
- this->computed_encap_len_ +=
- this->repoID_encap_len (node); // for repoID
-
- // do the same thing for the local name
- this->computed_encap_len_ +=
- this->name_encap_len (node);
- }
- else
- this->computed_encap_len_ = 0;
-
- return this->computed_encap_len_;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_sequence *node)
-{
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (sequence) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- return this->computed_tc_size_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_sequence *node)
-{
- be_type *bt; // base type
-
- ACE_CDR::Long encap_len = 4; // holds the byte order flag
-
- // add the encapsulation length of our base type
- bt = be_type::narrow_from_decl (node->base_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (sequence) - ")
- ASYS_TEXT ("cannot compute tc size\n")),
- -1);
- }
-
- this->computed_encap_len_ = encap_len + this->computed_tc_size_;
- this->computed_encap_len_ += 4; // to hold the max size
-
- return this->computed_encap_len_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_string *)
-{
- this->computed_tc_size_ = 4 + 4;
- return this->computed_tc_size_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_string *)
-{
- this->computed_encap_len_ = 0;
- return this->computed_encap_len_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_structure *node)
-{
- // while computing the encapsulation length we must keep in mind the typecode
- // that has gotten generated until this point. Hence, we must first check the
- // "tc_queue" to ensure if are already there somewhere in a previous
- // encapsulation in which case we must count only the bytes for the
- // indirection. If we are not already generated, we must then check if we
- // have already been counted in the current computation or not by checking
- // for our presence in the compute queue. In both cases, we only include the
- // 8 bytes in the computation
- if (this->queue_lookup (this->tc_queue_, node) ||
- this->queue_lookup (this->compute_queue_, node))
- {
- this->computed_tc_size_ = 4 + 4;
- }
- else
- {
-
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->compute_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "compute_tc_size (structure) - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (structure) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- }
- return this->computed_tc_size_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_structure *node)
-{
- ACE_CDR::Long encap_len = 4; // holds the byte order flag
-
- encap_len += this->repoID_encap_len (node); // repoID
-
- // do the same thing for the local name
- encap_len += this->name_encap_len (node);
-
- encap_len += 4; // to hold the member count
-
- // save the current value of scope len and start with a fresh one for our
- // scope length computation
- if (this->push (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (struct) - ")
- ASYS_TEXT ("push failed\n")),
- -1);
- }
- this->computed_scope_encap_len_ = 0;
-
- // compute encap length for members
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (structure) - ")
- ASYS_TEXT ("cannot compute scope tc size\n")),
- -1);
- }
-
- this->computed_encap_len_ = encap_len + this->computed_scope_encap_len_;
-
- // pop off the previous value of computed_scope_len_
- if (this->pop (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (struct) - ")
- ASYS_TEXT ("pop failed\n")),
- -1);
- }
-
- return this->computed_encap_len_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_typedef *node)
-{
- // while computing the encapsulation length we must keep in mind the typecode
- // that has gotten generated until this point. Hence, we must first check the
- // "tc_queue" to ensure if are already there somewhere in a previous
- // encapsulation in which case we must count only the bytes for the
- // indirection. If we are not already generated, we must then check if we
- // have already been counted in the current computation or not by checking
- // for our presence in the compute queue. In both cases, we only include the
- // 8 bytes in the computation
- if (this->queue_lookup (this->tc_queue_, node) ||
- this->queue_lookup (this->compute_queue_, node))
- {
- this->computed_tc_size_ = 4 + 4;
- }
- else
- {
-
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->compute_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "compute_tc_size (typedef) - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (array) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- }
- return this->computed_tc_size_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_typedef *node)
-{
- be_type *bt; // base type
- ACE_CDR::Long encap_len = 4; // holds the byte order flag
-
- encap_len +=
- this->repoID_encap_len (node); // repoID
-
- // do the same thing for the local name
- encap_len +=
- this->name_encap_len (node);
-
- // add the encapsulation length of our base type
- bt = be_type::narrow_from_decl (node->base_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (typedef) - ")
- ASYS_TEXT ("cannot compute tc size\n")),
- -1);
- }
-
- this->computed_encap_len_ = encap_len + this->computed_tc_size_;
- return this->computed_encap_len_;
-
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_union *node)
-{
- // while computing the encapsulation length we must keep in mind the typecode
- // that has gotten generated until this point. Hence, we must first check the
- // "tc_queue" to ensure if are already there somewhere in a previous
- // encapsulation in which case we must count only the bytes for the
- // indirection. If we are not already generated, we must then check if we
- // have already been counted in the current computation or not by checking
- // for our presence in the compute queue. In both cases, we only include the
- // 8 bytes in the computation
- if (this->queue_lookup (this->tc_queue_, node) ||
- this->queue_lookup (this->compute_queue_, node))
- {
- this->computed_tc_size_ = 4 + 4;
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->compute_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "compute_tc_size (union) - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (union) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- }
- return this->computed_tc_size_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_union *node)
-{
- be_type *discrim;
-
- ACE_CDR::Long encap_len = 4; // holds the byte order flag
-
- encap_len += this->repoID_encap_len (node); // for repoID
-
- // do the same thing for the local name
- encap_len += this->name_encap_len (node); // for name
-
- // add encapsulation size of discriminant typecode
- discrim = be_type::narrow_from_decl (node->disc_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE);
- if (!discrim || discrim->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (union) - ")
- ASYS_TEXT ("cannot compute tc size\n")),
- -1);
- }
-
- encap_len += this->computed_tc_size_;
-
- encap_len += 4; // to hold the "default used" flag
- encap_len += 4; // to hold the member count
-
- // save the current value of scope len and start with a fresh one for our
- // scope length computation
- if (this->push (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (union) - ")
- ASYS_TEXT ("push failed\n")),
- -1);
- }
- this->computed_scope_encap_len_ = 0;
-
- // compute encap length for members
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (union) - ")
- ASYS_TEXT ("cannot compute scope tc size\n")),
- -1);
- }
-
- this->computed_encap_len_ = encap_len + this->computed_scope_encap_len_;
-
- // pop off the previous value of computed_scope_len_
- if (this->pop (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (union) - ")
- ASYS_TEXT ("pop failed\n")),
- -1);
- }
-
- return this->computed_encap_len_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_union_branch *node)
-{
- be_type *bt;
-
- ACE_CDR::Long encap_len = 0;
-
- for (unsigned long i = 0;
- i < node->label_list_length ();
- ++i)
- {
- encap_len += 4; // case label;
- encap_len +=
- this->name_encap_len (node); // for name
-
- bt = be_type::narrow_from_decl (node->field_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (union branch) - ")
- ASYS_TEXT ("cannot compute tc size\n")),
- -1);
- }
- encap_len += this->computed_tc_size_;
- }
-
- this->computed_encap_len_ = encap_len;
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN);
- return this->computed_encap_len_;
-}
-
-// helpers that accomplish a common task - that of generating the repository
-// IDs and names in a TypeCode description
-
-void
-be_visitor_typecode_defn::gen_repoID (be_decl *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- int flag = 0;
-
- // check if we want to generate optimized typecodes. In such a case, there is
- // no need to generate the repoID (unless we are an object reference or an
- // exception in which case it is mandatory to have the repository ID)
- // generate repoID
-
- if (idl_global->opt_tc ())
- {
- switch (node->node_type ())
- {
- case AST_Decl::NT_interface:
- case AST_Decl::NT_interface_fwd:
- case AST_Decl::NT_except:
- flag = 0;
- break;
- case AST_Decl::NT_pre_defined:
- if (!ACE_OS::strcmp (node->local_name ()->get_string (),
- "Object"))
- flag = 0;
- else
- flag = 1;
- break;
- default:
- flag = 1;
- }
- }
-
- // XXXASG -- there is still some doubts in my mind about whether repoID
- // *must* be supplied or not as per spec 2.3a. So I am not going to allow
- // optimizations here.
- // flag = 0;
-
- if (flag)
- {
- // optimized case
- *os << "1, 0x0,";
- *os << " // repository ID = " << node->repoID ();
- // size of the repoID filed
- this->tc_offset_ += (2 * sizeof (ACE_CDR::ULong));
- }
- else
- {
- // unoptimized case
- *os << (ACE_OS::strlen (node->repoID ()) + 1) << ", ";
-
- ACE_CDR::ULong *arr, i, arrlen;
- (void) this->tc_name2long (node->repoID (), arr, arrlen);
- for (i = 0; i < arrlen; i++)
- {
- os->print ("ACE_NTOHL (0x%x), ", arr[i]);
- }
- *os << " // repository ID = " << node->repoID ();
- // size of the repoID field
- this->tc_offset_ += (arrlen + 1) * sizeof (ACE_CDR::ULong);
- }
- *os << "\n";
- return;
-}
-
-void
-be_visitor_typecode_defn::gen_name (be_decl *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // generate name
- if (idl_global->opt_tc ())
- {
- *os << "1, 0x0,";
- *os << " // name = " << node->local_name ();
- // size of the name field
- this->tc_offset_ += (2 * sizeof (ACE_CDR::ULong));
- }
- else
- {
- ACE_CDR::ULong *arr, i, arrlen;
- *os << (ACE_OS::strlen (node->local_name ()->get_string ()) + 1) << ", ";
- (void) this->tc_name2long (node->local_name ()->get_string (), arr, arrlen);
- for (i = 0; i < arrlen; i++)
- {
- os->print ("ACE_NTOHL (0x%x), ", arr[i]);
- }
- *os << " // name = " << node->local_name ();
- // size of the name field
- this->tc_offset_ += (arrlen + 1) * sizeof (ACE_CDR::ULong);
- }
- *os << "\n";
- return;
-}
-
-// return the length in bytes to hold the repoID inside a typecode. This
-// comprises 4 bytes indicating the length of the string followed by the actual
-// string represented as longs.
-ACE_CDR::ULong
-be_visitor_typecode_defn::repoID_encap_len (be_decl *node)
-{
- int flag = 0;
-
- // check if we want to generate optimized typecodes. In such a case, there is
- // no need to generate the repoID (unless we are an object reference or an
- // exception in which case it is mandatory to have the repository ID)
- // generate repoID
-
- if (idl_global->opt_tc ())
- {
- switch (node->node_type ())
- {
- case AST_Decl::NT_interface:
- case AST_Decl::NT_interface_fwd:
- case AST_Decl::NT_except:
- flag = 0;
- break;
- case AST_Decl::NT_pre_defined:
- if (!ACE_OS::strcmp (node->local_name ()->get_string (),
- "Object"))
- flag = 0;
- else
- flag = 1;
- break;
- default:
- flag = 1;
- }
- }
-
- // XXXASG -- there is still some doubts in my mind about whether repoID
- // *must* be supplied or not as per spec 2.3a. So I am not going to allow
- // optimizations here.
- //flag = 0;
-
- if (flag)
- {
- return 4 + 4;
- }
- else
- {
- ACE_CDR::ULong slen = ACE_OS::strlen (node->repoID ()) + 1;
- // + 1 for NULL terminating char
-
- // the number of bytes to hold the string must be a multiple of 4 since this
- // will be represented as an array of longs
- return 4 + 4 * (slen/4 + (slen%4 ? 1:0));
- }
-}
-
-// return the length in bytes to hold the name inside a typecode. This
-// comprises 4 bytes indicating the length of the string followed by the actual
-// string represented as longs.
-ACE_CDR::ULong
-be_visitor_typecode_defn::name_encap_len (be_decl *node)
-{
- if (idl_global->opt_tc ())
- {
- return 4 + 4;
- }
- else
- {
- ACE_CDR::ULong slen =
- ACE_OS::strlen (node->local_name ()->get_string ()) + 1;
-
- // the number of bytes to hold the string must be a multiple of 4 since this
- // will be represented as an array of longs
- return 4 + 4 * (slen/4 + (slen%4 ? 1:0));
- }
-}
-
-// converts a string name into an array of 4 byte longs
-int
-be_visitor_typecode_defn::tc_name2long (const char *name,
- ACE_CDR::ULong *&larr,
- ACE_CDR::ULong &arrlen)
-{
- const int bytes_per_word = sizeof (ACE_CDR::ULong);
- static ACE_CDR::ULong buf [NAMEBUFSIZE];
- ACE_CDR::ULong i, slen;
-
- slen = ACE_OS::strlen (name) + 1; // 1 for NULL terminating
-
- // compute the number of bytes necessary to hold the name rounded to
- // the next multiple of 4 (i.e., size of long)
- arrlen = slen / bytes_per_word + (slen % bytes_per_word ? 1 : 0);
-
- ACE_OS::memset (buf, 0, sizeof (buf));
- larr = buf;
- ACE_OS::memcpy (buf, name, slen);
- for (i = 0; i < arrlen; i++)
- larr [i] = ACE_HTONL (larr [i]);
- return 0;
-}
-
-// 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;
-
- 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,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_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->fullname (),
- node->fullname ()))
- {
- // 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;
- (void) queue.dequeue_head (qnode);
- delete qnode;
- }
- return;
-}
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 770f575be95..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_root.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Root
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-#include "be_visitor_root.h"
-
-// include all the individual files
-#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_is.cpp"
-#include "be_visitor_root/root_ih.cpp"
-#include "be_visitor_root/any_op.cpp"
-#include "be_visitor_root/cdr_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 9d31730b5c7..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/any_op.cpp
+++ /dev/null
@@ -1,56 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_root.h"
-
-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)
-{
- // 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_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 36f9214da42..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp
+++ /dev/null
@@ -1,71 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_root.h"
-
-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)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_CDR_OP_CH)
- {
- *os << be_nl
- << "#ifndef __ACE_INLINE__\n\n";
- }
-
- // 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_root_cdr_op::visit_root - "
- "codegen for scope failed\n"), -1);
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_CDR_OP_CH)
- {
- *os << be_nl
- << "#endif /* __ACE_INLINE__ */\n\n";
- }
-
- 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 ecd3cc52ddd..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root.cpp
+++ /dev/null
@@ -1,1101 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// root.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the Root node. This is a generic visitor.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_root.h"
-
-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;
-}
-
-// visit the Root node and its scope
-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);
- }
-
- // 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_root::visit_root - "
- "codegen for scope failed\n"), -1);
- }
-
-
- be_visitor *visitor;
- be_visitor_context ctx (*this->ctx_);
-
-#ifdef IDL_HAS_VALUETYPE
- // make one more pass over the entire tree and generate the OBV_ namespaces
- // and OBV_ classes
-
- idl_bool obv = 0;
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- obv = 1;
- ctx.state (TAO_CodeGen::TAO_MODULE_OBV_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- obv = 1;
- ctx.state (TAO_CodeGen::TAO_MODULE_OBV_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- obv = 1;
- ctx.state (TAO_CodeGen::TAO_MODULE_OBV_CS);
- break;
- }
- if (obv)
- {
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_root - "
- "NUL visitor\n"
- ), -1);
- }
-
- if (visitor->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_root - "
- "failed to generate OBV_ things\n"
- ), -1);
- }
- delete visitor;
- }
-#endif /* IDL_HAS_VALUETYPE */
-
-
- // 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.
- //
- // XXXASG - this part of the code may be conditionally generated because at
- // times it is not necessary to have these operators at all. TO-DO.
-
- ctx = *this->ctx_;
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- ctx.state (TAO_CodeGen::TAO_ROOT_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_ROOT_ANY_OP_CS);
- break;
-
- case TAO_CodeGen::TAO_ROOT_IH:
- (void) tao_cg->end_implementation_header (idl_global->be_get_implementation_hdr_fname (0));
- break;
- case TAO_CodeGen::TAO_ROOT_SH:
- (void) tao_cg->end_server_header ();
- (void) tao_cg->end_server_template_header ();
- return 0;
-
- case TAO_CodeGen::TAO_ROOT_CI:
- break;
- case TAO_CodeGen::TAO_ROOT_IS:
- break;
- case TAO_CodeGen::TAO_ROOT_SI:
- return 0; // nothing to be done
- case TAO_CodeGen::TAO_ROOT_SS:
- (void) tao_cg->end_server_template_skeletons ();
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_constant - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- // *ASG* - this is a tempoaray hack soln so that our CDR operators get
- // generated in the *.i file rather than the *.cpp file
- if (this->ctx_->state () != TAO_CodeGen::TAO_ROOT_CI
- && this->ctx_->state () != TAO_CodeGen::TAO_ROOT_IH
- && this->ctx_->state () != TAO_CodeGen::TAO_ROOT_IS)
- {
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_root - "
- "NUL visitor\n"
- ), -1);
- }
-
- // generate the << and >> operators for all the user-defined
- // data types in the outermost scope
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_root - "
- "failed to generate Any operators\n"
- ), -1);
- }
- delete visitor;
- }
-
- // make one more pass over the entire tree and generate the CDR << and >>
- // operators for compiled marshaling. Again, this code can be conditionally
- // generated if compiled marshaling is desired.
- ctx = *this->ctx_;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- ctx.state (TAO_CodeGen::TAO_ROOT_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- ctx.state (TAO_CodeGen::TAO_ROOT_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_ROOT_CDR_OP_CS);
- break;
- 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:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_constant - "
- "Bad context state\n"
- ), -1);
- }
- } visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_root - "
- "NUL visitor\n"
- ), -1);
- }
-
- // generate the << and >> operators for all the user-defined data types in
- // the outermost scope
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_root - "
- "failed to generate CDR operators\n"
- ), -1);
- }
- delete visitor;
-
- // generate any final code such as #endifs
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_ROOT_CH:
- (void) tao_cg->end_client_header ();
- break;
- default:
- break;
- }
- return 0;
-}
-
-// =all common visit methods for root visitor
-
-// visit a constant
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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:
- ctx.state (TAO_CodeGen::TAO_CONSTANT_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_CONSTANT_CS);
- 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_CI:
- 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_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- case TAO_CodeGen::TAO_ROOT_IS:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_constant - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_constant - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_constant - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-//visit an enum
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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:
- ctx.state (TAO_CodeGen::TAO_ENUM_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_ENUM_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_ENUM_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_ENUM_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- case TAO_CodeGen::TAO_ROOT_IS:
- case TAO_CodeGen::TAO_ROOT_IH:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_enum - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_enum - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_enum - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit an exception
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- case TAO_CodeGen::TAO_ROOT_IS:
- case TAO_CodeGen::TAO_ROOT_IH:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_exception - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_exception - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_exception - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- 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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_SH:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_SH);
- break;
- case TAO_CodeGen::TAO_ROOT_IH:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_IH);
- break;
- case TAO_CodeGen::TAO_ROOT_SI:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_SI);
- break;
- case TAO_CodeGen::TAO_ROOT_SS:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_SS);
- break;
- case TAO_CodeGen::TAO_ROOT_IS:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_IS);
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS);
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_interface - "
- "Bad context state\n"
- ), -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);
- }
-
- // let the node accept this visitor
- 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;
- return 0;
-}
-
-// visit an interface_fwd
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- case TAO_CodeGen::TAO_ROOT_CS:
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- case TAO_CodeGen::TAO_ROOT_IS:
- case TAO_CodeGen::TAO_ROOT_IH:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_interface_fwd - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_interface_fwd - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_interface_fwd - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-// visit an valuetype
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CS);
- break;
- 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_ANY_OP_CH:
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- return 0; // nothing to do, resp. not yet impl.
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_valuetype - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_valuetype - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_valuetype - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit an valuetype_fwd
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- case TAO_CodeGen::TAO_ROOT_CS:
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- case TAO_CodeGen::TAO_ROOT_IS:
- case TAO_CodeGen::TAO_ROOT_IH:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_valuetype_fwd - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_valuetype_fwd - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_valuetype_fwd - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-// visit an module
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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:
- ctx.state (TAO_CodeGen::TAO_MODULE_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- ctx.state (TAO_CodeGen::TAO_MODULE_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_MODULE_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_SH:
- ctx.state (TAO_CodeGen::TAO_MODULE_SH);
- break;
- case TAO_CodeGen::TAO_ROOT_SI:
- ctx.state (TAO_CodeGen::TAO_MODULE_SI);
- break;
- case TAO_CodeGen::TAO_ROOT_SS:
- ctx.state (TAO_CodeGen::TAO_MODULE_SS);
- break;
- case TAO_CodeGen::TAO_ROOT_IS:
- ctx.state (TAO_CodeGen::TAO_MODULE_IS);
- break;
- case TAO_CodeGen::TAO_ROOT_IH:
- ctx.state (TAO_CodeGen::TAO_MODULE_IH);
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_MODULE_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_MODULE_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_MODULE_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_MODULE_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_MODULE_CDR_OP_CS);
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_module - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_module - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_module - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit an structure
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- case TAO_CodeGen::TAO_ROOT_IS:
- case TAO_CodeGen::TAO_ROOT_IH:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_structure - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_structure - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_structure - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit an union
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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:
- ctx.state (TAO_CodeGen::TAO_UNION_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- ctx.state (TAO_CodeGen::TAO_UNION_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- case TAO_CodeGen::TAO_ROOT_IS:
- case TAO_CodeGen::TAO_ROOT_IH:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_union - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_union - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_union - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit an typedef
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CI:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_ROOT_SH:
- case TAO_CodeGen::TAO_ROOT_SI:
- case TAO_CodeGen::TAO_ROOT_SS:
- case TAO_CodeGen::TAO_ROOT_IS:
- case TAO_CodeGen::TAO_ROOT_IH:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_typedef - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_typedef - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root::"
- "visit_typedef - "
- "failed to accept visitor"
- ), -1);
- }
- delete visitor;
- 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 29a3dacdfb9..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// root_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Root in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_root.h"
-
-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 (idl_global->be_get_client_hdr_fname ())
- == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_visitor_root_ch::init - "
- "Error opening client header file\n"));
- return -1;
- }
-
- // init the stream
- this->ctx_->stream (tao_cg->client_header ());
- 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 d7ca5008cba..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_ci.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// root_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the Root in the client inline
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_root.h"
-
-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 (idl_global->be_get_client_inline_fname ())
- == -1)
- {
- ACE_ERROR ((LM_ERROR,
- "(%N:%l) be_visitor_root_ci - "
- "Error opening client inline file\n"));
- return -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 a6d0bc90b54..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// root_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Root in the client stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_root.h"
-
-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 (idl_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 98370a45a42..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_ih.cpp
+++ /dev/null
@@ -1,59 +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)
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_root.h"
-
-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)
-{
- // open the file
- if (tao_cg->start_implementation_header (idl_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",
- idl_global->be_get_implementation_hdr_fname ()),
- -1);
- }
-
-
- // set the stream and the next state
- 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 5cf2a47ffce..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_is.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-// ============================================================================
-//
-// = 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)
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_root.h"
-
-//ACE_RCSID(be_visitor_root, root_ss, "$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 (idl_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);
- }
- /*
- if (tao_cg->start_server_template_skeletons
- (idl_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->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 f8c1eebbc21..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// root_sh.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Root in the server header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_root.h"
-
-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 (idl_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",
- idl_global->be_get_server_hdr_fname ()),
- -1);
- }
-
- if (tao_cg->start_server_template_header (idl_global->be_get_server_template_hdr_fname ())
- == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_root_sh::init - "
- "Error:Unable to openin server template header file : %s\n",
- idl_global->be_get_server_template_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 5a4ec77261c..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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_root.h"
-
-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 (idl_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 (tao_cg->start_server_template_inline
- (idl_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 c5557f3fa80..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp
+++ /dev/null
@@ -1,69 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_root.h"
-
-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 (idl_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 (tao_cg->start_server_template_skeletons
- (idl_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_scope.cpp b/TAO/TAO_IDL/be/be_visitor_scope.cpp
deleted file mode 100644
index f2fb9d62921..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_scope.cpp
+++ /dev/null
@@ -1,240 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_scope.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
- if (node->nmembers () > 0)
- {
- // initialize an iterator to iterate thru our scope
- UTL_ScopeActiveIterator *si;
- ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (node,
- UTL_Scope::IK_decls),
- -1);
- this->elem_number_ = 0;
- // continue until each element is visited
- while (!si->is_done ())
- {
- AST_Decl *d = si->item ();
- if (!d)
- {
- delete si;
- 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)
- {
- delete si;
- 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)
- {
- delete si;
- 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)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "post processing failed\n"), -1);
- }
- si->next ();
- } // end of while loop
- delete si;
- } // end of if
-
-
-#if 0
- // For debugging the prefix...
- be_decl* decl = node->decl ();
- ACE_DEBUG ((LM_DEBUG, "Enter scope <%s> : [%s]\n",
- decl->fullname (), decl->prefix ()));
- if (decl->pragmas () != 0)
- {
- for (UTL_StrlistActiveIterator i(decl->pragmas ());
- !i.is_done ();
- i.next ())
- {
- String* s = i.item ();
-
- ACE_DEBUG ((LM_DEBUG, " pragma = <%s>\n", s->get_string ()));
- }
- }
-#endif
-
- 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_scope *node = 0;
-
- if (!this->ctx_->scope () ||
- !(node = this->ctx_->scope ()->scope ()))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::next_elem - "
- "bad scope\n"), -1);
-
- }
-
- successor = 0;
- // proceed if the number of members in our scope is greater than 0
- if (node->nmembers () > 0)
- {
- // initialize an iterator to iterate thru our scope
- UTL_ScopeActiveIterator *si;
- ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (node,
- UTL_Scope::IK_decls),
- -1);
- // continue until each element is visited
- while (!si->is_done ())
- {
- be_decl *bd = be_decl::narrow_from_decl (si->item ());
- if (!bd)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::next_elem - "
- "bad node in this scope\n"), -1);
-
- }
-
- if (bd == elem)
- {
- // find who is next to me
- si->next ();
- if (si->is_done ())
- {
- // nobody left in the list
- delete si;
- return 0;
- }
- successor = be_decl::narrow_from_decl (si->item ());
- if (!successor)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::next_elem - "
- "bad node in this scope\n"), -1);
-
- }
- // nothing else to do
- delete si;
- return 0;
- }
- else
- // proceed to the next element
- si->next ();
- } // end of while loop
- delete si;
- } // end of if
- return 0;
-}
-
-idl_bool
-be_visitor_scope::last_node (be_decl *bd)
-{
- be_decl *next = 0;
- (void) this->next_elem (bd, next);
- if (next)
- // not the last
- return 0;
-
- // 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 a5fa66377e0..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence.cpp
+++ /dev/null
@@ -1,52 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-#include "be_visitor_sequence.h"
-
-// include all the individual files
-#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_ci.cpp"
-#include "be_visitor_sequence/cdr_op_cs.cpp"
-#include "be_visitor_sequence/buffer_type.cpp"
-#include "be_visitor_sequence/elemtype.cpp"
-#include "be_visitor_sequence/sequence_base.cpp"
-#include "be_visitor_sequence/sequence_ch.cpp"
-#include "be_visitor_sequence/sequence_ci.cpp"
-#include "be_visitor_sequence/sequence_cs.cpp"
-#include "be_visitor_sequence/gen_unbounded_sequence_ch.cpp"
-#include "be_visitor_sequence/gen_bounded_sequence_ch.cpp"
-#include "be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp"
-#include "be_visitor_sequence/gen_bounded_obj_sequence_ch.cpp"
-#include "be_visitor_sequence/gen_bounded_str_sequence_ch.cpp"
-#include "be_visitor_sequence/gen_unbounded_sequence_ci.cpp"
-#include "be_visitor_sequence/gen_bounded_sequence_ci.cpp"
-#include "be_visitor_sequence/gen_unbounded_obj_sequence_ci.cpp"
-#include "be_visitor_sequence/gen_bounded_obj_sequence_ci.cpp"
-#include "be_visitor_sequence/gen_bounded_str_sequence_ci.cpp"
-#include "be_visitor_sequence/gen_unbounded_sequence_cs.cpp"
-#include "be_visitor_sequence/gen_bounded_sequence_cs.cpp"
-#include "be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp"
-#include "be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp"
-#include "be_visitor_sequence/gen_bounded_str_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 f1223cd7642..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for the Sequence
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-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 ();
-
- // generate the Any <<= and >>= operators
- os->indent ();
- *os << "void " << idl_global->export_macro ()
- << " operator<<= (CORBA::Any &, const " << node->name ()
- << " &); // copying version" << be_nl;
- *os << "void " << idl_global->export_macro ()
- << " operator<<= (CORBA::Any &, " << node->name ()
- << "*); // noncopying version" << be_nl;
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator>>= (const CORBA::Any &, "
- << node->name () << " *&);\n";
-
- 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 79fb96574fe..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp
+++ /dev/null
@@ -1,139 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-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 ();
-
- // Any <<= and >>= operators
- os->indent ();
- *os << "void operator<<= (" << be_idt << be_idt_nl
- << "CORBA::Any &_tao_any," << be_nl
- << "const " << node->name () << " &_tao_elem" << be_uidt_nl
- << ") // copying" << be_uidt_nl
- << "{" << be_idt_nl
- << node->name () << " *_tao_any_val;" << be_nl
- << "ACE_NEW (_tao_any_val, " << node->name ()
- << " (_tao_elem));" << be_nl
- << "if (!_tao_any_val) return;" << be_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "_tao_any.replace (" << node->tc_name ()
- << ", _tao_any_val, 1, ACE_TRY_ENV);"
- << " // copy the value" << be_nl
- << "ACE_TRY_CHECK; " << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY" << be_nl
- << "{" << be_idt_nl
- << "delete _tao_any_val;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_ENDTRY;" << be_uidt_nl
- << "}\n" << be_nl;
-
- *os << "void operator<<= (CORBA::Any &_tao_any, "
- << node->name () << " *_tao_elem) // non copying" << be_nl
- << "{" << be_idt_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "_tao_any.replace (" << node->tc_name () << ", "
- << "_tao_elem, 0, ACE_TRY_ENV);" << be_nl
- << "ACE_TRY_CHECK;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY {}" << be_nl
- << "ACE_ENDTRY;" << be_uidt_nl
- << "}\n" << be_nl;
-
- *os << "CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, "
- << node->name () << " *&_tao_elem)" << be_nl
- << "{" << be_idt_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "CORBA::TypeCode_var type = _tao_any.type ();" << be_nl
- << "if (!type->equal (" << node->tc_name ()
- << ", ACE_TRY_ENV)) return 0; // not equal" << be_nl
- << "ACE_TRY_CHECK;" << be_nl
- << "if (_tao_any.any_owns_data ())" << be_nl
- << "{" << be_idt_nl
- << "_tao_elem = (" << node->name () << " *)_tao_any.value ();"
- << be_nl
- << "return 1;" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_nl // else any does not own the data
- << "{" << be_idt_nl
- << "ACE_NEW_RETURN (_tao_elem, " << node->name () << ", 0);"
- << be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());"
- << be_nl
- << "if (stream.decode (" << node->tc_name ()
- << ", _tao_elem, 0, ACE_TRY_ENV)" << be_nl
- << " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
- << "{" << be_idt_nl
- << "((CORBA::Any *)&_tao_any)->replace ("
- << node->tc_name () << ", _tao_elem, 1, ACE_TRY_ENV);"
- << be_nl
- << "ACE_TRY_CHECK;" << be_nl
- << "return 1;" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_nl // decode failed
- << "{" << be_idt_nl
- << "delete _tao_elem;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY" << be_nl
- << "{" << be_idt_nl
- << "delete _tao_elem;" << be_nl
- << "return 0;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_ENDTRY;" << be_nl
- << "return 0;" << be_uidt_nl
- << "}\n\n";
-
- 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 5ffe0a8aced..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp
+++ /dev/null
@@ -1,154 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-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 ();
- if (node->pt () == AST_PredefinedType::PT_pseudo)
- *os << node->name () << "_ptr";
- 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_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- *os << "char *";
- 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_union (be_union *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); // set the 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 773a7f26d73..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp
+++ /dev/null
@@ -1,68 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-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 ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // generate the CDR << and >> operator declarations
- os->indent ();
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator<< (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &," << be_nl
- << "const " << node->name () << " &" << be_uidt_nl
- << ");" << be_uidt_nl;
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator>> (" << be_idt << be_idt_nl
- << "TAO_InputCDR &," << be_nl
- << node->name () << " &" << be_uidt_nl
- << ");" << be_uidt << "\n\n";
-
-
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp
deleted file mode 100644
index c2da5f9d78d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ci.cpp
-//
-// = DESCRIPTION
-// Visitor for code generation of Sequences for the CDR operators
-// in the client stubs.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, cdr_op_ci, "$Id$")
-
-
-// ***************************************************************************
-// Sequence visitor for generating CDR operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_sequence_cdr_op_ci::be_visitor_sequence_cdr_op_ci
-(be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_sequence_cdr_op_ci::~be_visitor_sequence_cdr_op_ci (void)
-{
-}
-
-int
-be_visitor_sequence_cdr_op_ci::visit_sequence (be_sequence *node)
-{
- if (node->cli_inline_cdr_op_gen () || node->imported ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Sequences are *always* generated in the .cpp file, it doesn't
- // save all that time to generate them inline and this breaks
- // the dependencies for recursive types.
-
- os->indent ();
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator<< (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &," << be_nl
- << "const " << node->name () << " &" << be_uidt_nl
- << ");" << be_uidt_nl;
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator>> (" << be_idt << be_idt_nl
- << "TAO_InputCDR &," << be_nl
- << node->name () << " &" << be_uidt_nl
- << ");" << be_uidt << "\n\n";
-
- node->cli_inline_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 63a7cde5c2c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp
+++ /dev/null
@@ -1,593 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = 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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-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
- // sequence
- return this->visit_node (node);
- }
- else
- {
- if (node->cli_stub_cdr_op_gen () || node->imported ())
- 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);
-
- // 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;
-
- // first encode the sequence length
- *os << "if (strm << _tao_sequence.length ())" << be_nl
- << "{" << be_idt_nl;
- // now encode the sequence elements
- *os << "// encode all elements" << be_nl;
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_sequence_cdr_op_cs::"
- "visit_sequence - "
- "Base type codegen failed\n"),
- -1);
- }
- *os << "}" << be_nl
- << "return 0; // error" << be_uidt_nl
- << "}\n\n";
-
- // set the sub state as generating code for the input operator
- os->indent ();
- 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_sequence" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
- // first retrieve the length and adjust the sequence length accordingly
- *os << "CORBA::ULong _tao_seq_len;" << be_nl;
- *os << "if (strm >> _tao_seq_len)" << be_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 ();
- // dimension value
- if ((expr == NULL) || ((expr != NULL) && (expr->ev () == NULL)))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cdr_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_nl
- << "{" << be_idt_nl;
- }
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cdr_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;
- *os << "// retrieve all the elements" << be_nl;
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_sequence_cdr_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_uidt_nl;
- }
- *os << "}" << be_nl
- << "return 0; // error" << be_uidt_nl
- << "}\n\n";
-
- node->cli_stub_cdr_op_gen (1);
- }
- return 0;
-}
-
-// handle all the base types
-
-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_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- 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_sequence_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 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
-
- // grab the sequence node
- be_sequence *sequence = this->ctx_->be_node_as_sequence ();
-
- if (!sequence)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cdr_op_cs::"
- "visit_predefined_type - "
- "bad sequence node\n"),
- -1);
- }
-
- // handle octet sequences using the optimizations provided by the TAO ORB
- // Core. If these optimizations are not available, then use the normal form
-
- if (node->pt () == AST_PredefinedType::PT_octet && sequence->unbounded ())
- {
- *os << "\n#if defined (TAO_NO_COPY_OCTET_SEQUENCES)" << be_nl;
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- {
- *os << "if (ACE_BIT_DISABLED (strm.start ()->flags (),"
- << "ACE_Message_Block::DONT_DELETE))" << be_nl
- << "{" << be_idt_nl
- << "TAO_Unbounded_Sequence<CORBA::Octet> *oseq = " << be_nl
- << " ACE_static_cast(TAO_Unbounded_Sequence<CORBA::Octet>*, "
- << "&_tao_sequence);" << be_nl
- << "oseq->replace (_tao_seq_len, strm.start ());"
- << be_nl
- << "oseq->mb ()->wr_ptr (oseq->mb()->rd_ptr () + "
- << "_tao_seq_len);" << be_nl
- << "strm.skip_bytes (_tao_seq_len);" << be_nl
- << "return 1;" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_idt_nl
- << "return strm.read_octet_array ("
- << "_tao_sequence.get_buffer (), _tao_seq_len);"
- << be_uidt_nl;
- }
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- {
- *os << "{" << be_idt_nl
- << "TAO_Unbounded_Sequence<CORBA::Octet> *oseq = " << be_nl
- << " ACE_static_cast (TAO_Unbounded_Sequence<CORBA::Octet>*, "
- << "(" << sequence->name () << " *)&_tao_sequence);" << be_nl
- << "if (oseq->mb ())" << be_idt_nl
- << "return strm.write_octet_array_mb (oseq->mb ());"
- << be_uidt_nl
- << "else" << be_idt_nl
- << "return strm.write_octet_array ("
- << "_tao_sequence.get_buffer (), _tao_sequence.length ());"
- << be_uidt << be_uidt_nl
- << "}" << be_nl;
- }
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cdr_op_cs::"
- "visit_predefined_type - "
- "bad sub state\n"),
- -1);
- }
- *os << "\n#else /* TAO_NO_COPY_OCTET_SEQUENCES */" << be_nl;
- }
-
- *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_cdr_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_cdr_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_cdr_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;
-
- if (node->pt () == AST_PredefinedType::PT_octet && sequence->unbounded ())
- *os << "\n#endif /* TAO_NO_COPY_OCTET_SEQUENCES */" << be_nl;
- return 0;
-}
-
-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)
-{
- 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_sequence_cdr_op_cs::"
- "visit_typedef - "
- "Bad primitive type\n"
- ), -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-// helper
-int
-be_visitor_sequence_cdr_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_cdr_op_cs::"
- "visit_node - "
- "bad sequence node\n"),
- -1);
- }
-
- // initialize a boolean variable
- *os << "CORBA::Boolean _tao_marshal_flag = 1;" << be_nl;
-
- // 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 ();
- // dimension value
- if ((expr == NULL) || ((expr != NULL) && (expr->ev () == NULL)))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cdr_op_cs::"
- "visit_node - "
- "bad sequence dimension\n"),
- -1);
- }
- if (expr->ev ()->et == AST_Expression::EV_ulong)
- {
- *os << "for (CORBA::ULong i = 0; i < _tao_sequence.length ()"
- << " && _tao_marshal_flag; "
- << "i++)" << be_idt_nl;
- }
- else
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cdr_op_cs::"
- "visit_node - "
- "bad sequence dimension value\n"),
- -1);
- }
-
- // if the type was a string, an obj ref, or a pseudo-obj, we are dealing with
- // a manager type and hence we must use the appropriate in () and out ()
- // methods.
- //
-
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "_tao_marshal_flag = (strm >> ";
- switch (bt->node_type ())
- {
- case AST_Decl::NT_string:
- {
- be_string *str = be_string::narrow_from_decl (bt);
-
- if (!str)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cdr_op_cs::"
- "visit_node - "
- "bad string node\n"),
- -1);
- }
- if (str->max_size ()->ev ()->u.ulval == 0)
- {
- // unbounded
- *os << "_tao_sequence[i].out ()";
- }
- else
- {
- *os << "CORBA::Any::to_string (_tao_sequence[i].out (), "
- << str->max_size ()->ev ()->u.ulval << ")";
- }
- }
- break;
- case AST_Decl::NT_interface:
- case AST_Decl::NT_interface_fwd:
- *os << "_tao_sequence[i].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_sequence_cdr_op_cs::"
- "visit_node - "
- "bad predefined type node\n"),
- -1);
- }
- if (pt->pt () == AST_PredefinedType::PT_pseudo)
- {
- *os << "_tao_sequence[i].out ()";
- }
- else
- {
- *os << "_tao_sequence[i]";
- }
- }
- break;
- default:
- *os << "_tao_sequence[i]";
- }
- *os << ");";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "_tao_marshal_flag = (strm << _tao_sequence[i]";
- switch (bt->node_type ())
- {
- case AST_Decl::NT_string:
- case AST_Decl::NT_interface:
- case AST_Decl::NT_interface_fwd:
- *os << ".in ()";
- break;
- case AST_Decl::NT_pre_defined:
- {
- be_predefined_type *pt = be_predefined_type::narrow_from_decl (bt);
- if (!pt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cdr_op_cs::"
- "visit_node - "
- "bad predefined type node\n"),
- -1);
- }
- if (pt->pt () == AST_PredefinedType::PT_pseudo)
- {
- *os << ".in ()";
- }
- }
- default:
- break;
- }
- *os << ");";
- break;
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cdr_op_cs::"
- "visit_node - "
- "bad sub state\n"),
- -1);
- }
-
- *os << be_uidt_nl;
- *os << "return _tao_marshal_flag;" << be_uidt_nl;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/elemtype.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/elemtype.cpp
deleted file mode 100644
index 01632c2bdfd..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/elemtype.cpp
+++ /dev/null
@@ -1,222 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// elemtype.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the element type for the Sequence
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, elemtype, "$Id$")
-
-
-// ***********************************************************
-// sequence element type visitor for return types of [] methods
-// ***********************************************************
-
-
-be_visitor_sequence_elemtype::
-be_visitor_sequence_elemtype (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_sequence_elemtype::~be_visitor_sequence_elemtype (void)
-{
-}
-
-// helper
-int
-be_visitor_sequence_elemtype::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_SEQELEM_RETTYPE_CH)
- *os << bt->nested_type_name (this->ctx_->scope ()) << " &";
- else
- *os << bt->name () << " &";
- return 0;
-}
-
-int
-be_visitor_sequence_elemtype::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- {
- int is_pseudo_object =
- ACE_OS::strcmp (node->local_name ()->get_string (),
- "Object") != 0;
- if (is_pseudo_object)
- {
- *os << "TAO_Pseudo_Object_Manager<";
- }
- else
- {
- *os << "TAO_Object_Manager<";
- }
- if (this->ctx_->state () == TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH)
- {
- *os << bt->nested_type_name (this->ctx_->scope ()) << ","
- << bt->nested_type_name (this->ctx_->scope ()) << "_var> ";
- }
- else
- {
- *os << bt->name () << ","
- << bt->name () <<"_var> ";
- }
- }
- break;
- default:
- if (this->ctx_->state () == TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH)
- *os << bt->nested_type_name (this->ctx_->scope ()) << " &";
- else
- *os << bt->name () << " &";
- }
- return 0;
-}
-
-int
-be_visitor_sequence_elemtype::visit_sequence (be_sequence *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_elemtype::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_SEQELEM_RETTYPE_CH)
- {
- *os << "TAO_Object_Manager<"
- << bt->nested_type_name (this->ctx_->scope ()) << ","
- << bt->nested_type_name (this->ctx_->scope ()) << "_var> ";
- }
- else
- *os << "TAO_Object_Manager<"
- << bt->name () << ","
- << bt->name () << "_var> ";
-
- return 0;
-}
-
-int
-be_visitor_sequence_elemtype::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_SEQELEM_RETTYPE_CH)
- {
- *os << "TAO_Object_Manager<"
- << bt->nested_type_name (this->ctx_->scope ()) << ","
- << bt->nested_type_name (this->ctx_->scope ()) << "_var> ";
- }
- else
- *os << "TAO_Object_Manager<"
- << bt->name () << ","
- << bt->name () << "_var>";
-
- os->gen_endif_AHETI();
-
- return 0;
-}
-
-int
-be_visitor_sequence_elemtype::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << "TAO_SeqElem_String_Manager ";
- return 0;
-}
-
-int
-be_visitor_sequence_elemtype::visit_structure (be_structure *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_elemtype::visit_union (be_union *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_elemtype::visit_enum (be_enum *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_elemtype::visit_exception (be_exception *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_elemtype::visit_array (be_array *node)
-{
- return this->visit_node (node);
-}
-
-int
-be_visitor_sequence_elemtype::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_elemtype::"
- "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/gen_bounded_obj_sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ch.cpp
deleted file mode 100644
index 144c6fbefb7..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ch.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// gen_bounded_obj_sequence_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client header
-//
-// = AUTHOR
-// Michael Kircher
-//
-// Modifications by Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, gen_bounded_obj_sequence_ch, "$Id$")
-
-
-int
-be_visitor_sequence_ch::gen_bounded_obj_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- // generate the class name
- be_type *pt; // base types
-
- 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);
- pt = t->primitive_base_type ();
- }
- else
- pt = bt;
-
-
- const char * class_name = node->instance_name ();
-
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // !! branching in either compile time template instantiation
- // or manual template instantiation
- os->gen_ifdef_AHETI();
-
- os->gen_ifdef_macro (class_name);
-
- os->indent ();
-
- *os << "class " << class_name
- << " : public TAO_Bounded_Base_Sequence" << be_nl
- << "{" << be_nl
- << "public:" << be_idt_nl
- << "// = Initialization and termination methods." << be_nl
- << be_nl;
-
- // default constructor
- *os << class_name << " (void);" << be_nl;
-
- // constructor
- *os << class_name << " (CORBA::ULong length," << be_idt_nl;
- // the accept is here the first time used and if an
- // error occurs, it will occur here. Later no check
- // for errors will be done.
- if (pt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
- *os <<"* *value," << be_nl
- << "CORBA::Boolean release = 0);" << be_uidt_nl;
-
- // constructor
- *os << class_name << " (const " << class_name << " &rhs);" << be_nl
- << "// Copy constructor." << be_nl;
-
- // destructor
- *os << "virtual ~" << class_name << " (void);" << be_nl
- << "// destructor" << be_nl;
-
- // operator=
- *os << class_name << " &operator= (const " << class_name << " &rhs);" << be_nl
- << "// Assignment from another Bounded sequence." << be_nl;
-
- be_predefined_type *prim = be_predefined_type::narrow_from_decl (pt);
- int is_pseudo_object =
- pt->node_type () == AST_Decl::NT_pre_defined
- && prim && prim->pt () == AST_PredefinedType::PT_pseudo
- && ACE_OS::strcmp (prim->local_name ()->get_string (),
- "Object") != 0;
-
- // operator[]
- if (is_pseudo_object)
- {
- *os << "TAO_Pseudo_Object_Manager<";
- }
- else
- {
- *os << "TAO_Object_Manager<";
- }
-
- *os << pt->name () << ","
- << pt->name () << "_var>"
- << " operator[] (CORBA::ULong index) const;"
- << "// Read-write accessor." << be_nl;
-
- // allocbuf
- *os << "static ";
- pt->accept (visitor);
- *os << " **allocbuf (CORBA::ULong length); "
- << "// Allocate storage for a sequence.." << be_nl;
-
- // freebuf
- *os << "static void freebuf (";
- pt->accept (visitor);
- *os << " **buffer);" << be_nl;
-
- // allocate_buffer
- *os << "// The Base_Sequence functions, please see tao/sequence.h" << be_nl
- << "virtual void _allocate_buffer (CORBA::ULong length);" << be_nl;
-
- // deallocate_buffer
- *os << "virtual void _deallocate_buffer (void);" << be_nl;
-
- // get_buffer
- pt->accept(visitor);
- *os << "* *get_buffer (CORBA::Boolean orphan = 0);" << be_nl;
-
- // get_buffer
- *os << "const ";
- pt->accept (visitor);
- *os << "* *get_buffer (void) const;" << be_nl;
-
- // _shrink_buffer
- *os << "virtual void _shrink_buffer (CORBA::ULong nl, CORBA::ULong ol);" << be_nl;
-
- if (!is_pseudo_object)
- {
- // Pseudo objects do not require this methods.
- *os << "virtual void _downcast (" << be_idt << be_idt_nl
- << "void* target," << be_nl
- << "CORBA_Object *src," << be_nl
- << "CORBA_Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl;
-
- *os << "virtual CORBA_Object* _upcast (void *src) const;" << be_nl;
- }
- *os << be_uidt_nl << "};\n";
-
- os->gen_endif ();
-
- // generate #endif for AHETI
- os->gen_endif_AHETI ();
-
- delete visitor;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ci.cpp
deleted file mode 100644
index 8f4c05ee2a1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ci.cpp
+++ /dev/null
@@ -1,346 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// gen_bounded_obj_sequence_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client inline
-//
-// = AUTHOR
-// Michael Kircher
-//
-// Modifications by Aniruddha Gokhale
-// ============================================================================
-
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, gen_bounded_obj_sequence_ci, "$Id$")
-
-
-int
-be_visitor_sequence_ci::gen_bounded_obj_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- // generate the class name
- be_type *pt; // base types
-
- 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);
- pt = t->primitive_base_type ();
- }
- else
- pt = bt;
-
- const char * class_name = node->instance_name ();
-
- static char full_class_name [NAMEBUFSIZE];
- ACE_OS::memset (full_class_name, '\0', NAMEBUFSIZE);
-
- if (node->is_nested ())
- {
- ACE_OS::sprintf (full_class_name, "%s::%s",
- be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (),
- class_name);
- }
- else
- {
- ACE_OS::sprintf (full_class_name, "%s",
- class_name);
- }
-
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // !! branching in either compile time template instantiation
- // or manual template instatiation
- os->gen_ifdef_AHETI();
-
- os->gen_ifdef_macro (class_name);
-
- os->indent ();
-
- // first generate the static methods since they are used by others. Sinc
- // ethey are inlined, their definition needs to come before their use else
- // some compilers give lost of warnings.
-
- // allocbuf
- *os << "ACE_INLINE "; pt->accept (visitor);
- *os << " **" << be_nl;
- *os << full_class_name << "::allocbuf (CORBA::ULong /* length */) "
- << "// Allocate storage for a sequence.." << be_nl
- << "{" << be_idt_nl;
- // the accept is here the first time used and if an
- // error occurs, it will occur here. Later no check
- // for errors will be done.
- if (pt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
- *os <<" **buf = 0;" << be_nl
- << be_nl
- << "ACE_NEW_RETURN (buf, ";
- pt->accept (visitor);
- *os << "*[" << node->max_size () << "], 0);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = 0; i < " << node->max_size () << "; i++)" << be_idt_nl
- << "buf[i] = ";
- pt->accept (visitor);
- *os << "::_nil ();" << be_uidt_nl
- << be_nl
- << "return buf;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // freebuf
- *os << "ACE_INLINE void" << be_nl
- << full_class_name << "::freebuf (";
- pt->accept (visitor);
- *os << " **buffer)" << be_nl
- << "{" << be_idt_nl
- << "for (CORBA::ULong i = 0; i < " << node->max_size () << "; ++i)" << be_idt_nl
- << "if (buffer[i] != ";
- pt->accept (visitor);
- *os << "::_nil ())" << be_nl
- << "{" << be_idt_nl
- << "CORBA::release (buffer[i]);" << be_nl
- << "buffer[i] = ";
- pt->accept (visitor);
- *os << "::_nil ();" << be_uidt_nl
- << "}" << be_uidt_nl
- << be_nl
- << "delete[] buffer;" << be_uidt_nl
- << "} " << be_nl
- << be_nl;
-
- // constructor
- *os << "// default ctor" << be_nl;
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name << " (void)" << be_idt_nl
- << " : TAO_Bounded_Base_Sequence (" << node->max_size ()
- << ", " << full_class_name << "::allocbuf (" << node->max_size () << "))" << be_uidt_nl
- << "{" << be_nl
- << "}" << be_nl
- << be_nl;
-
- // constructor
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name
- << " (CORBA::ULong length," << be_idt_nl;
- pt->accept (visitor);
- *os <<"* *value," << be_nl
- << "CORBA::Boolean release)" << be_uidt_nl
- << "// Constructor from data." << be_nl
- << " : TAO_Bounded_Base_Sequence (" << node->max_size () << ", length, value, release)" << be_nl
- << "{" << be_nl
- << "}" << be_nl
- << be_nl;
-
- // constructor
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name << " (const "
- << full_class_name << " &rhs)" << be_nl
- << "// Copy constructor." << be_idt_nl
- << ": TAO_Bounded_Base_Sequence (rhs)" << be_uidt_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os <<" **tmp1 = allocbuf (" << node->max_size () << ");" << be_nl;
- pt->accept(visitor);
- *os <<" ** const tmp2 = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << "** ACE_CAST_CONST, rhs.buffer_);" << be_nl
- << "for (CORBA::ULong i = 0; i < rhs.length_; i++)" << be_idt_nl
- << "tmp1[i] = "; pt->accept (visitor); *os << "::_duplicate (tmp2[i]);" << be_uidt_nl
- << "this->buffer_ = tmp1;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // assignment operator
- *os << "ACE_INLINE " << full_class_name << " &" << be_nl
- << full_class_name << "::operator= (const "
- << full_class_name << " &rhs)" << be_nl
- << "// Assignment from another Bounded sequence." << be_nl
- << "{" << be_idt_nl
- << "if (this == &rhs)" << be_idt_nl
- << "return *this;" << be_uidt_nl
- << be_nl
- << "if (this->release_)" << be_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os <<" **tmp = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " **, this->buffer_);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_nl
- << "{" << be_idt_nl
- << "CORBA::release (tmp[i]);" << be_nl
- << "tmp[i] = ";
- pt->accept (visitor);
- *os << "::_nil ();" << be_uidt_nl
- << "}" << be_nl
- << "// No need to reallocate the buffer since it is always of size" << be_nl
- << "// " << node->max_size () << "" << be_nl
- << "#if 0" << be_idt_nl
- << "if (this->maximum_ < rhs.maximum_)" << be_nl
- << "{" << be_idt_nl
- << full_class_name << "::freebuf (tmp);" << be_nl
- << "this->buffer_ = " << full_class_name << "::allocbuf (rhs.maximum_);" << be_uidt_nl
- << "}" << be_uidt_nl
- << "#endif /* 0 */" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_idt_nl
- << "this->buffer_ = " << full_class_name << "::allocbuf (rhs.maximum_);" << be_uidt_nl
- << be_nl
- << "TAO_Bounded_Base_Sequence::operator= (rhs);" << be_nl
- << be_nl;
- pt->accept(visitor);
- *os <<" **tmp1 = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " **, this->buffer_);" << be_nl;
- pt->accept(visitor);
- *os <<" ** const tmp2 = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " ** ACE_CAST_CONST, rhs.buffer_);" << be_nl
- << "for (CORBA::ULong i=0; i < rhs.length_; ++i)" << be_idt_nl
- << "tmp1[i] = ";
- pt->accept (visitor);
- *os << "::_duplicate (tmp2[i]);" << be_uidt_nl
- << "return *this;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // operator[]
- be_predefined_type *prim = be_predefined_type::narrow_from_decl (pt);
- int is_pseudo_object =
- pt->node_type () == AST_Decl::NT_pre_defined
- && prim && prim->pt () == AST_PredefinedType::PT_pseudo
- && ACE_OS::strcmp (prim->local_name ()->get_string (),
- "Object") != 0;
-
- // operator[]
- if (is_pseudo_object)
- {
- *os << "ACE_INLINE TAO_Pseudo_Object_Manager<";
- }
- else
- {
- *os << "ACE_INLINE TAO_Object_Manager<";
- }
-
- *os << pt->name () << ","
- << pt->name () << "_var>" << be_nl
- << full_class_name << "::operator[] (CORBA::ULong index) const"
- << " // Read-write accessor." << be_nl
- << "{" << be_idt_nl
- << "ACE_ASSERT (index < this->maximum_);" << be_nl;
-
- pt->accept(visitor);
- *os <<" **const tmp = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " ** ACE_CAST_CONST, this->buffer_);" << be_nl;
-
- if (is_pseudo_object)
- {
- *os << "return TAO_Pseudo_Object_Manager<";
- }
- else
- {
- *os << "return TAO_Object_Manager<";
- }
-
- *os << pt->name () << ","
- << pt->name () << "_var> "
- << "(tmp + index, this->release_);" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // get_buffer
- *os << "ACE_INLINE ";
- pt->accept(visitor);
- *os << " **" << be_nl;
- *os << full_class_name << "::get_buffer (CORBA::Boolean orphan)" << be_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os << " **result = 0;" << be_nl
- << "if (orphan == 0)" << be_nl
- << "{" << be_idt_nl
- << "// We retain ownership." << be_nl
- << "if (this->buffer_ == 0)" << be_nl
- << "{" << be_idt_nl
- << "result = " << full_class_name << "::allocbuf (this->maximum_);" << be_nl
- << "this->buffer_ = result;" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_nl
- << "{" << be_idt_nl
- << "result = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << "**, this->buffer_);" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "else // if (orphan == 1)" << be_nl
- << "{" << be_idt_nl
- << "if (this->release_ != 0)" << be_nl
- << "{" << be_idt_nl
- << "// We set the state back to default and relinquish" << be_nl
- << "// ownership." << be_nl
- << "result = ACE_reinterpret_cast(";
- pt->accept (visitor);
- *os << "**,this->buffer_);" << be_nl
- << "this->maximum_ = 0;" << be_nl
- << "this->length_ = 0;" << be_nl
- << "this->buffer_ = 0;" << be_nl
- << "this->release_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "return result;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // get_buffer
- *os << "ACE_INLINE const ";
- pt->accept (visitor);
- *os << "* *" << be_nl
- << full_class_name << "::get_buffer (void) const" << be_nl
- << "{" << be_idt_nl
- << "return ACE_reinterpret_cast(const ";
- pt->accept (visitor);
- *os << " ** ACE_CAST_CONST, this->buffer_);" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- os->gen_endif ();
-
- // generate #endif for AHETI
- os->gen_endif_AHETI();
-
- delete visitor;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp
deleted file mode 100644
index 8ff1a215796..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// gen_bounded_obj_sequence_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client impl
-//
-// = AUTHOR
-// Michael Kircher
-//
-// Modifications by Aniruddha Gokhale
-// ============================================================================
-
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, gen_bounded_obj_sequence_cs, "$Id$")
-
-
-int
-be_visitor_sequence_cs::gen_bounded_obj_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- // generate the class name
- be_type *pt; // base types
-
- 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);
- pt = t->primitive_base_type ();
- }
- else
- pt = bt;
-
- const char * class_name = node->instance_name ();
-
- static char full_class_name [NAMEBUFSIZE];
- ACE_OS::memset (full_class_name, '\0', NAMEBUFSIZE);
-
- if (node->is_nested ())
- {
- ACE_OS::sprintf (full_class_name, "%s::%s",
- be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (),
- class_name);
- }
- else
- {
- ACE_OS::sprintf (full_class_name, "%s",
- class_name);
- }
-
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // !! branching in either compile time template instantiation
- // or manual template instatiation
- os->gen_ifdef_AHETI();
-
- os->gen_ifdef_macro (class_name);
-
- os->indent ();
-
- // first generate the static methods since they are used by others. Sinc
- // ethey are inlined, their definition needs to come before their use else
- // some compilers give lost of warnings.
-
- // allocate_buffer
- *os << "// The Base_Sequence functions, please see tao/sequence.h" << be_nl
- << "void " << be_nl
- << full_class_name << "::_allocate_buffer (CORBA::ULong length)" << be_nl
- << "{" << be_idt_nl
- << "// For this class memory is never reallocated so the implementation" << be_nl
- << "// is *really* simple." << be_nl
- << "this->buffer_ = " << full_class_name << "::allocbuf (length);" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // deallocate_buffer
- *os << "void" << be_nl
- << full_class_name << "::_deallocate_buffer (void)" << be_nl
- << "{" << be_idt_nl
- << "if (this->buffer_ == 0 || this->release_ == 0)" << be_idt_nl
- << "return;" << be_uidt_nl;
- pt->accept(visitor);
- *os <<" **tmp = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " **, this->buffer_);" << be_nl
- << full_class_name << "::freebuf (tmp);" << be_nl
- << "this->buffer_ = 0;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // destructor
- *os << full_class_name << "::~" << class_name << " (void)" << be_nl
- << "// destructor" << be_nl
- << "{" << be_idt_nl
- << "this->_deallocate_buffer ();" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // _shrink_buffer
- *os << "void" << be_nl
- << full_class_name << "::_shrink_buffer (CORBA::ULong nl, CORBA::ULong ol)" << be_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os <<" **tmp = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " **, this->buffer_);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = nl; i < ol; ++i)" << be_nl
- << "{" << be_idt_nl
- << "CORBA::release (tmp[i]);" << be_nl
- << "tmp[i] = ";
- pt->accept (visitor);
- *os << "::_nil ();" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}\n" << be_nl;
-
- be_predefined_type *prim = be_predefined_type::narrow_from_decl (pt);
- if ((pt->node_type () != AST_Decl::NT_pre_defined) ||
- (prim && (prim->pt () == AST_PredefinedType::PT_pseudo) &&
- (!ACE_OS::strcmp (prim->local_name ()->get_string (), "Object"))))
- {
- // Pseudo objects do not require this methods.
- *os << "void" << be_nl
- << full_class_name << "::_downcast (" << be_idt << be_idt_nl
- << "void* target," << be_nl
- << "CORBA_Object *src," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
- pt->accept (visitor);
- *os << " **tmp = ACE_static_cast (";
- pt->accept (visitor);
- *os << "**, target);" << be_nl
- << "*tmp = ";
- pt->accept (visitor);
- *os << "::_narrow (src, ACE_TRY_ENV);" << be_uidt_nl
- << "}\n" << be_nl;
-
- *os << "CORBA_Object*" << be_nl
- << full_class_name << "::_upcast (void *src) const" << be_nl
- << "{" << be_idt_nl;
- pt->accept (visitor);
- *os << " **tmp = ACE_static_cast (";
- pt->accept (visitor);
- *os << "**, src);" << be_nl
- << "return *tmp;" << be_uidt_nl
- << "}" << be_nl;
- }
-
- os->gen_endif ();
-
- // generate #endif for AHETI
- os->gen_endif_AHETI();
-
- delete visitor;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ch.cpp
deleted file mode 100644
index 15778c7e2d0..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ch.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// gen_bounded_sequence_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client header
-//
-// = AUTHOR
-// Michael Kircher
-//
-// Modifications by Aniruddha Gokhale
-//
-// ============================================================================
-
-//#include "idl.h"
-//#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, gen_bounded_sequence_ch, "$Id$")
-
-
-int
-be_visitor_sequence_ch::gen_bounded_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- // generate the class name
- be_type *pt; // base types
-
- 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);
- pt = t->primitive_base_type ();
- }
- else
- pt = bt;
-
-
- const char * class_name = node->instance_name ();
-
-
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // !! branching in either compile time template instantiation
- // or manual template instatiation
- os->gen_ifdef_AHETI();
-
- os->gen_ifdef_macro (class_name);
-
- os->indent ();
-
- *os << "class " << class_name << " : public TAO_Bounded_Base_Sequence" << be_nl
- << "{" << be_nl
- << "public:" << be_idt_nl
- << "// = Initialization and termination methods." << be_nl
- << be_nl;
-
- // default Constructor
- *os << class_name << " (void);" << be_nl;
-
- // constructor
- *os << class_name << " (CORBA::ULong length," << be_idt_nl;
- pt->accept (visitor);
- *os <<" *data," << be_nl
- << "CORBA::Boolean release = 0);" << be_uidt_nl;
-
- // constructor
- *os << class_name << " (const " << class_name << " &rhs);" << be_nl
- << "// Copy constructor." << be_nl;
-
- // operator=
- *os << class_name << " &operator= (const " << class_name << " &rhs);" << be_nl
- << "// Assignment operator. " << be_nl;
-
- // destructor
- *os << "virtual ~" << class_name << " (void); // Dtor." << be_nl;
-
- // Accessors
- // operator[]
- *os << "// = Accessors." << be_nl;
- pt->accept(visitor);
- *os <<" &operator[] (CORBA::ULong i);// operator []" << be_nl;
-
- // operator[]
- *os << "const ";
- pt->accept (visitor);
- *os << " &operator[] (CORBA::ULong i) const;" << be_nl;
-
- // Static Operations
- *os << "// = Static operations." << be_nl
- << "static ";
- pt->accept (visitor);
- *os << " *allocbuf (CORBA::ULong); // Allocate storage for the sequence." << be_nl;
-
- // free_buf
- *os << "static void freebuf (";
- pt->accept (visitor);
- *os << " *buffer); // Free the sequence." << be_nl;
-
- // allocate_buffer
- *os << "virtual void _allocate_buffer (CORBA::ULong length);" << be_nl;
-
- // deallocate_buffer
- *os << "virtual void _deallocate_buffer (void);" << be_nl;
-
- // get_buffer
- pt->accept(visitor);
- *os << " *get_buffer (CORBA::Boolean orphan = 0);" << be_nl;
-
- // get_buffer
- *os << "const ";
- pt->accept (visitor);
- *os << " *get_buffer (void) const;" << be_nl;
-
- // replace
- *os << "void replace (CORBA::ULong max," << be_idt_nl
- << "CORBA::ULong length," << be_nl;
- pt->accept(visitor);
- *os <<" *data," << be_nl
- << "CORBA::Boolean release = 0);" << be_uidt << be_uidt_nl;
-
- *os << "};\n";
-
- os->gen_endif (); // endif macro
-
- // generate #endif for AHETI
- os->gen_endif_AHETI();
-
- delete visitor;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ci.cpp
deleted file mode 100644
index 167d7a4b79c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ci.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// gen_bounded_sequence_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client inline
-//
-// = AUTHOR
-// Michael Kircher
-//
-// Modifications by Aniruddha Gokhale
-//
-// ============================================================================
-
-//#include "idl.h"
-//#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, gen_bounded_sequence_ci, "$Id$")
-
-
-int
-be_visitor_sequence_ci::gen_bounded_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- // generate the class name
- be_type *pt; // base types
-
- 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);
- pt = t->primitive_base_type ();
- }
- else
- pt = bt;
-
- const char * class_name = node->instance_name ();
-
- static char full_class_name [NAMEBUFSIZE];
- ACE_OS::memset (full_class_name, '\0', NAMEBUFSIZE);
-
- if (node->is_nested ())
- {
- ACE_OS::sprintf (full_class_name, "%s::%s",
- be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (),
- class_name);
- }
- else
- {
- ACE_OS::sprintf (full_class_name, "%s",
- class_name);
- }
-
-
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // !! branching in either compile time template instantiation
- // or manual template instatiation
- os->gen_ifdef_AHETI();
-
- os->gen_ifdef_macro (class_name);
-
- os->indent ();
-
- // first generate the static methods since they are used by others. Sinc
- // ethey are inlined, their definition needs to come before their use else
- // some compilers give lost of warnings.
-
- // Static Operations
- // allocbuf
- *os << "// = Static operations." << be_nl
- << "ACE_INLINE ";
-
- // the accept is here the first time used and if an
- // error occurs, it will occur here. Later no check
- // for errors will be done.
- if (pt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence::"
- "gen_bounded_sequence - "
- "base type visit failed\n"),
- -1);
- }
- *os << " *" << be_nl
- << full_class_name << "::allocbuf (CORBA::ULong) "
- << "// Allocate storage for the sequence." << be_nl
- << "{" << be_idt_nl
- << "return new ";
- pt->accept (visitor);
- *os << "[" << node->max_size () << "];" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // free_buf
- *os << "ACE_INLINE void " << be_nl
- << full_class_name << "::freebuf (";
- pt->accept (visitor);
- *os << " *buffer) // Free the sequence." << be_nl
- << "{" << be_idt_nl
- << "delete [] buffer;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // Constructor
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name << " (void)" << be_nl
- << "// Default constructor." << be_nl
- << " : TAO_Bounded_Base_Sequence (" << node->max_size ()
- << ", 0, " << full_class_name << "::allocbuf (" << node->max_size ()
- << "), 0)" << be_nl
- << "{" << be_nl
- << "}" << be_nl
- << be_nl;
-
- // constructor
- *os << "ACE_INLINE" << be_nl;
- *os << full_class_name << "::" << class_name << " (CORBA::ULong length," << be_idt_nl;
- pt->accept (visitor);
- *os <<" *data," << be_nl
- << "CORBA::Boolean release)" << be_uidt_nl
- << "// Constructor using the data and memory management flag." << be_nl
- << " : TAO_Bounded_Base_Sequence (" << node->max_size () << ", length, data, release)" << be_nl
- << "{" << be_nl
- << "}" << be_nl
- << be_nl;
-
- // constructor
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name
- << " (const " << full_class_name << " &rhs)" << be_nl
- << "// Copy constructor." << be_idt_nl
- << ": TAO_Bounded_Base_Sequence (rhs)" << be_uidt_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os <<" *tmp1 = " << full_class_name << "::allocbuf (" << node->max_size ()
- << ");" << be_nl
- << be_nl;
- pt->accept(visitor);
- *os <<" * const tmp2 = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " * ACE_CAST_CONST, rhs.buffer_);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl
- << "tmp1[i] = tmp2[i];" << be_uidt_nl
- << be_nl
- << "this->buffer_ = tmp1;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // operator=
- *os << "ACE_INLINE " << full_class_name << " &" << be_nl
- << full_class_name << "::operator= (const " << full_class_name << " &rhs)" << be_nl
- << "// Assignment operator. " << be_nl
- << "{" << be_idt_nl
- << "if (this == &rhs)" << be_idt_nl
- << "return *this;" << be_uidt_nl
- << be_nl
- << "if (this->release_)" << be_nl
- << "{" << be_nl
- << "}" << be_nl
- << "else" << be_idt_nl
- << "this->buffer_ = " << full_class_name << "::allocbuf (rhs.maximum_);" << be_nl
- << be_nl
- <<"TAO_Bounded_Base_Sequence::operator= (rhs);" << be_nl
- << be_nl;
- pt->accept(visitor);
- *os <<"* tmp1 = ACE_reinterpret_cast (";
- pt->accept(visitor);
- *os << " *, this->buffer_);" << be_nl;
- pt->accept(visitor);
- *os <<"* const tmp2 = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " * ACE_CAST_CONST, rhs.buffer_);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl
- << "tmp1[i] = tmp2[i];" << be_uidt_nl
- << be_nl
- << "return *this;" << be_uidt_nl << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // Accessors
- *os << "// = Accessors." << be_nl;
- *os << "ACE_INLINE ";
- pt->accept(visitor);
- *os << " &" << be_nl;
- *os << full_class_name << "::operator[] (CORBA::ULong i)// operator []" << be_nl
- << "{" << be_idt_nl
- << "ACE_ASSERT (i < this->maximum_);" << be_nl;
- pt->accept(visitor);
- *os <<" *tmp = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << "*,this->buffer_);" << be_nl
- << "return tmp[i];" << be_uidt_nl
- << "}" << be_nl;
-
- *os << "ACE_INLINE const ";
- pt->accept (visitor);
- *os << " &" << be_nl
- << full_class_name << "::operator[] (CORBA::ULong i) const// operator []" << be_nl
- << "{" << be_idt_nl
- << "ACE_ASSERT (i < this->maximum_);" << be_nl
- << "const ";
- pt->accept (visitor);
- *os << "* tmp = ACE_reinterpret_cast (const ";
- pt->accept (visitor);
- *os << "* ACE_CAST_CONST,this->buffer_);" << be_nl
- << "return tmp[i];" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // get_buffer
- *os << "ACE_INLINE ";
- pt->accept(visitor);
- *os << " *" << be_nl
- << full_class_name << "::get_buffer (CORBA::Boolean orphan)" << be_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os << " *result = 0;" << be_nl
- << "if (orphan == 0)" << be_nl
- << "{" << be_idt_nl
- << "// We retain ownership." << be_nl
- << "if (this->buffer_ == 0)" << be_nl
- << "{" << be_idt_nl
- << "result = " << full_class_name << "::allocbuf (this->maximum_);" << be_nl
- << "this->buffer_ = result;" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_nl
- << "{" << be_idt_nl
- << "result = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << "*, this->buffer_);" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "else // if (orphan == 1)" << be_nl
- << "{" << be_idt_nl
- << "if (this->release_ != 0)" << be_nl
- << "{" << be_idt_nl
- << "// We set the state back to default and relinquish" << be_nl
- << "// ownership." << be_nl
- << "result = ACE_reinterpret_cast(";
- pt->accept (visitor);
- *os << "*,this->buffer_);" << be_nl
- << "this->maximum_ = 0;" << be_nl
- << "this->length_ = 0;" << be_nl
- << "this->buffer_ = 0;" << be_nl
- << "this->release_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "return result;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // get_buffer
- *os << "ACE_INLINE const ";
- pt->accept (visitor);
- *os << " *" << be_nl
- << full_class_name << "::get_buffer (void) const" << be_nl
- << "{" << be_idt_nl
- << "return ACE_reinterpret_cast(const ";
- pt->accept (visitor);
- *os << " * ACE_CAST_CONST, this->buffer_);" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // replace
- *os << "ACE_INLINE void " << be_nl
- << full_class_name << "::replace (CORBA::ULong max," << be_idt_nl
- << "CORBA::ULong length," << be_nl;
- pt->accept(visitor);
- *os <<" *data," << be_nl
- << "CORBA::Boolean release)" << be_uidt_nl
- << "{" << be_idt_nl
- << "this->maximum_ = max;" << be_nl
- << "this->length_ = length;" << be_nl
- << "if (this->buffer_ && this->release_ == 1)" << be_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os <<"* tmp = ACE_reinterpret_cast(";
- pt->accept (visitor);
- *os << "* ACE_CAST_CONST, this->buffer_);" << be_nl
- << full_class_name << "::freebuf (tmp);" << be_uidt_nl
- << "}" << be_nl
- << "this->buffer_ = data;" << be_nl
- << "this->release_ = release;" << be_uidt_nl
- << "}" << be_nl;
-
- os->gen_endif (); // endif macro
-
- // generate #endif for AHETI
- os->gen_endif_AHETI();
-
- delete visitor;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_cs.cpp
deleted file mode 100644
index 0b72e049306..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_cs.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// gen_bounded_sequence_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client inline
-//
-// = AUTHOR
-// Michael Kircher
-//
-// Modifications by Aniruddha Gokhale
-//
-// ============================================================================
-
-//#include "idl.h"
-//#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, gen_bounded_sequence_cs, "$Id$")
-
-
-int
-be_visitor_sequence_cs::gen_bounded_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- // generate the class name
- be_type *pt; // base types
-
- 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);
- pt = t->primitive_base_type ();
- }
- else
- pt = bt;
-
- const char * class_name = node->instance_name ();
-
- static char full_class_name [NAMEBUFSIZE];
- ACE_OS::memset (full_class_name, '\0', NAMEBUFSIZE);
-
- if (node->is_nested ())
- {
- ACE_OS::sprintf (full_class_name, "%s::%s",
- be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (),
- class_name);
- }
- else
- {
- ACE_OS::sprintf (full_class_name, "%s",
- class_name);
- }
-
-
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // !! branching in either compile time template instantiation
- // or manual template instatiation
- os->gen_ifdef_AHETI();
-
- os->gen_ifdef_macro (class_name);
-
- os->indent ();
-
- // allocate_buffer
- *os << "void " << be_nl
- << full_class_name << "::_allocate_buffer (CORBA::ULong /* length */)" << be_nl
- << "// allocate a buffer of the requested length. The buffer is allocated for the" << be_nl
- << "// right type" << be_nl
- << "{" << be_idt_nl
- << "this->buffer_ = " << full_class_name << "::allocbuf ("
- << node->max_size () << ");" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // deallocate_buffer
- *os << "void " << be_nl
- << full_class_name << "::_deallocate_buffer (void)" << be_nl
- << "// deallocate the buffer" << be_nl
- << "{" << be_idt_nl
- << "if (this->buffer_ == 0 || this->release_ == 0)" << be_idt_nl
- << "return;" << be_uidt_nl;
- pt->accept(visitor);
- *os <<" *tmp = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " *, this->buffer_);" << be_nl
- << full_class_name << "::freebuf (tmp);" << be_nl
- << "this->buffer_ = 0;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // destructor
- *os << full_class_name << "::~" << class_name << " (void) // Dtor." << be_nl
- << "{" << be_idt_nl
- << "this->_deallocate_buffer ();" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- os->gen_endif (); // endif macro
-
- // generate #endif for AHETI
- os->gen_endif_AHETI();
-
- delete visitor;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ch.cpp
deleted file mode 100644
index bb34ba31db0..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ch.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// gen_bounded_str_sequence_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client header
-//
-// = AUTHOR
-// Michael Kircher
-//
-// Modifications by Aniruddha Gokhale
-// ============================================================================
-
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, gen_bounded_str_sequence_ch, "$Id$")
-
-
-int
-be_visitor_sequence_ch::gen_bounded_str_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- // generate the class name
- be_type *pt; // base types
-
- 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);
- pt = t->primitive_base_type ();
- }
- else
- pt = bt;
-
-
- const char * class_name = node->instance_name ();
-
-
- // get the visitor for the type of the sequence
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // !! branching in either compile time template instantiation
- // or manual template instatiation
- os->gen_ifdef_AHETI();
-
- os->gen_ifdef_macro (class_name);
-
- os->indent ();
- // the accept is here the first time used and if an
- // error occurs, it will occur here. Later no check
- // for errors will be done.
- if (pt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
-
-
- *os << "class " << class_name << " : public TAO_Bounded_Base_Sequence" << be_nl
- << "{" << be_nl
- << "public:" << be_idt_nl;
-
- // constructor
- *os << class_name << " (void);" << be_nl;
-
- // constructor
- *os << class_name << " (CORBA::ULong length," << be_idt_nl
- << "char* *value," << be_nl
- << "CORBA::Boolean release = 0);" << be_uidt_nl;
-
- // constructor
- *os << class_name << " (const " << class_name << " &rhs);" << be_nl;
-
- // operator=
- *os << class_name << " &operator= (const " << class_name << " &rhs);" << be_nl;
-
- // destructor
- *os << "virtual ~" << class_name << " (void);" << be_nl;
-
- // operator[]
- *os << "TAO_SeqElem_String_Manager operator[] (CORBA::ULong index) const;" << be_nl
- << "// read-write accessor" << be_nl;
-
- // allocbuf
- *os << "static char **allocbuf (CORBA::ULong length);" << be_nl;
-
- // freebuf
- *os << "static void freebuf (char **buffer);" << be_nl;
-
- // allocate_buffer
- *os << "virtual void _allocate_buffer (CORBA::ULong length);" << be_nl;
-
- // deallocate_buffer
- *os << "virtual void _deallocate_buffer (void);" << be_nl;
-
- // get_buffer
- *os << "char* *get_buffer (CORBA::Boolean orphan = 0);" << be_nl;
-
- // get_buffer
- *os << "const char* *get_buffer (void) const;" << be_nl;
-
- // shrink_buffer
- *os << "virtual void _shrink_buffer (CORBA::ULong nl,CORBA::ULong ol);"
- << be_uidt_nl;
-
- *os << "};\n";
-
- os->gen_endif (); // endif macro
-
- // generate #endif for AHETI
- os->gen_endif_AHETI();
-
-
- delete visitor;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ci.cpp
deleted file mode 100644
index bc74e1f12de..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ci.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// gen_bounded_str_sequence_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client inline
-//
-// = AUTHOR
-// Michael Kircher
-//
-// Modifications by Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, gen_bounded_str_sequence_ci, "$Id$")
-
-
-int
-be_visitor_sequence_ci::gen_bounded_str_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- const char * class_name = node->instance_name ();
-
- static char full_class_name [NAMEBUFSIZE];
- ACE_OS::memset (full_class_name, '\0', NAMEBUFSIZE);
-
- if (node->is_nested ())
- {
- ACE_OS::sprintf (full_class_name, "%s::%s",
- be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (),
- class_name);
- }
- else
- {
- ACE_OS::sprintf (full_class_name, "%s",
- class_name);
- }
-
-
- // get the visitor for the type of the sequence
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // !! branching in either compile time template instantiation
- // or manual template instatiation
- os->gen_ifdef_AHETI();
-
- os->gen_ifdef_macro (class_name);
-
- os->indent ();
-
-#if 0 /* Why is this here? ASG */
- // generate the class name
- be_type *pt; // base types
-
- 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);
- pt = t->primitive_base_type ();
- }
- else
- pt = bt;
-
- // the accept is here the first time used and if an
- // error occurs, it will occur here. Later no check
- // for errors will be done.
- if (pt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
-#endif /* 0 */
-
- // first generate the static methods since they are used by others. Since
- // they are inlined, their definition needs to come before their use else
- // some compilers (e.g., g++) produce lots of warnings.
-
- // allocbuf
- *os << "ACE_INLINE char **" << be_nl
- << full_class_name << "::allocbuf (CORBA::ULong /* length */)" << be_nl
- << "{" << be_idt_nl
- << "char **buf = 0;" << be_nl
- << "ACE_NEW_RETURN (buf, char *[" << node->max_size () << "], 0);" << be_nl
- << "for (CORBA::ULong i = 0; i < " << node->max_size () << "; i++)" << be_idt_nl
- << "buf[i] = 0;" << be_uidt_nl
- << "return buf;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // freebuf
- *os << "ACE_INLINE void " << be_nl
- << full_class_name << "::freebuf (char **buffer)" << be_nl
- << "{" << be_idt_nl
- << "for (CORBA::ULong i = 0; i < " << node->max_size () << "; ++i)" << be_nl
- << "{" << be_idt_nl
- << "if (buffer[i] != 0)" << be_nl
- << "{" << be_idt_nl
- << "CORBA::string_free (buffer[i]);" << be_nl
- << "buffer[i] = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "delete [] buffer;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // constructor
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name << " (void)" << be_nl
- << " : TAO_Bounded_Base_Sequence (" << node->max_size ()
- << ", " << full_class_name << "::allocbuf(" << node->max_size () << "))" << be_nl
- << "{" << be_nl
- << "}" << be_nl
- << be_nl;
-
- // constructor
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name << " (CORBA::ULong length," << be_idt_nl
- << "char* *value," << be_nl
- << "CORBA::Boolean release)" << be_uidt_nl
- << " : TAO_Bounded_Base_Sequence (" << node->max_size () << ", length, value, release)" << be_nl
- << "{" << be_nl
- << "}" << be_nl
- << be_nl;
-
- // constructor
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name << " (const " << full_class_name << " &rhs)" << be_idt_nl
- << ": TAO_Bounded_Base_Sequence (rhs)" << be_uidt_nl
- << "{" << be_idt_nl
- << "char **tmp1 = " << full_class_name << "::allocbuf (this->maximum_);" << be_nl
- << "char ** const tmp2 = ACE_reinterpret_cast (char ** ACE_CAST_CONST, rhs.buffer_);" << be_nl
- << be_nl
- << "for (CORBA::ULong i=0; i < rhs.length_; i++)" << be_idt_nl
- << "tmp1[i] = CORBA::string_dup (tmp2[i]);" << be_uidt_nl
- << be_nl
- << "this->buffer_ = tmp1;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // operator=
- *os << "ACE_INLINE " << full_class_name << "& " << be_nl
- << full_class_name << "::operator= (const " << full_class_name << " &rhs)" << be_nl
- << "{" << be_idt_nl
- << "if (this == &rhs)" << be_idt_nl
- << "return *this;" << be_uidt_nl
- << be_nl
- << "if (this->release_)" << be_nl
- << "{ " << be_idt_nl
- << "char **tmp = ACE_reinterpret_cast (char **, this->buffer_);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_nl
- << "{" << be_idt_nl
- << "CORBA::string_free (tmp[i]);" << be_nl
- << "tmp[i] = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_idt_nl
- << "this->buffer_ = " << full_class_name << "::allocbuf (rhs.maximum_);" << be_uidt_nl
- << be_nl
- << "TAO_Bounded_Base_Sequence::operator= (rhs);" << be_nl
- << be_nl
- << "char **tmp1 = ACE_reinterpret_cast (char **, this->buffer_);" << be_nl
- << "char ** const tmp2 = ACE_reinterpret_cast (char ** ACE_CAST_CONST, rhs.buffer_);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = 0; i < rhs.length_; i++)" << be_idt_nl
- << "tmp1[i] = CORBA::string_dup (tmp2[i]);" << be_uidt_nl
- << "return *this;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // operator[]
- *os << "ACE_INLINE TAO_SeqElem_String_Manager " << be_nl
- << full_class_name << "::operator[] (CORBA::ULong index) const" << be_nl
- << "// read-write accessor" << be_nl
- << "{" << be_idt_nl
- << "ACE_ASSERT (index < this->maximum_);" << be_nl
- << "char **const tmp = ACE_reinterpret_cast (char ** ACE_CAST_CONST, this->buffer_);" << be_nl
- << "return TAO_SeqElem_String_Manager (tmp + index, this->release_);" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // get_buffer
- *os << "ACE_INLINE char**" << be_nl
- << full_class_name << "::get_buffer (CORBA::Boolean orphan)" << be_nl
- << "{" << be_idt_nl
- << "char **result = 0;" << be_nl
- << "if (orphan == 0)" << be_nl
- << "{" << be_idt_nl
- << "// We retain ownership. " << be_nl
- << "if (this->buffer_ == 0)" << be_nl
- << "{" << be_idt_nl
- << "result = " << full_class_name << "::allocbuf (this->maximum_);" << be_nl
- << "this->buffer_ = result;" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_nl
- << "{" << be_idt_nl
- << "result = ACE_reinterpret_cast (char **, this->buffer_);" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "else // if (orphan == 1)" << be_nl
- << "{" << be_idt_nl
- << "if (this->release_ != 0)" << be_nl
- << "{" << be_idt_nl
- << "// We set state back to default and relinquish" << be_nl
- << "// ownership." << be_nl
- << "result = ACE_reinterpret_cast (char **, this->buffer_);" << be_nl
- << "this->maximum_ = 0;" << be_nl
- << "this->length_ = 0;" << be_nl
- << "this->buffer_ = 0;" << be_nl
- << "this->release_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "return result;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // get_buffer
- *os << "ACE_INLINE const char**" << be_nl
- << full_class_name << "::get_buffer (void) const" << be_nl
- << "{" << be_idt_nl
- << "return ACE_reinterpret_cast (const char ** ACE_CAST_CONST, this->buffer_);" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- os->gen_endif (); // endif macro
-
- // generate #endif for AHETI
- os->gen_endif_AHETI();
-
-
- delete visitor;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_cs.cpp
deleted file mode 100644
index 07a34995988..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_cs.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// gen_bounded_str_sequence_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client impl
-//
-// = AUTHOR
-// Michael Kircher
-//
-// Modifications by Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, gen_bounded_str_sequence_cs, "$Id$")
-
-
-int
-be_visitor_sequence_cs::gen_bounded_str_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- const char * class_name = node->instance_name ();
-
- static char full_class_name [NAMEBUFSIZE];
- ACE_OS::memset (full_class_name, '\0', NAMEBUFSIZE);
-
- if (node->is_nested ())
- {
- ACE_OS::sprintf (full_class_name, "%s::%s",
- be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (),
- class_name);
- }
- else
- {
- ACE_OS::sprintf (full_class_name, "%s",
- class_name);
- }
-
-
- // get the visitor for the type of the sequence
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // !! branching in either compile time template instantiation
- // or manual template instatiation
- os->gen_ifdef_AHETI();
-
- os->gen_ifdef_macro (class_name);
-
- os->indent ();
-
-#if 0 /* Why is this here? ASG */
- // generate the class name
- be_type *pt; // base types
-
- 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);
- pt = t->primitive_base_type ();
- }
- else
- pt = bt;
-
- // the accept is here the first time used and if an
- // error occurs, it will occur here. Later no check
- // for errors will be done.
- if (pt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
-#endif /* 0 */
-
- // allocate_buffer
- *os << "void" << be_nl
- << full_class_name << "::_allocate_buffer (CORBA::ULong /* length */)" << be_nl
- << "{" << be_idt_nl
- << "// For this class memory is never reallocated so the implementation" << be_nl
- << "// is *really* simple." << be_nl
- << "this->buffer_ = " << full_class_name << "::allocbuf ("
- << node->max_size () << ");" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // deallocate_buffer
- *os << "void" << be_nl
- << full_class_name << "::_deallocate_buffer (void)" << be_nl
- << "{" << be_idt_nl
- << "if (this->buffer_ == 0 || this->release_ == 0)" << be_idt_nl
- << "return;" << be_uidt_nl
- << "char **tmp = ACE_reinterpret_cast (char **, this->buffer_);" << be_nl
- << full_class_name << "::freebuf (tmp);" << be_nl
- << "this->buffer_ = 0;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // destructor
- *os << full_class_name << "::~" << class_name << " (void)" << be_nl
- << "{" << be_idt_nl
- << "this->_deallocate_buffer ();" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // shrink_buffer
- *os << "void" << be_nl
- << full_class_name << "::_shrink_buffer (CORBA::ULong nl, CORBA::ULong ol)" << be_nl
- << "{" << be_idt_nl
- << "char **tmp = ACE_reinterpret_cast (char **,this->buffer_);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = nl; i < ol; ++i)" << be_nl
- << "{" << be_idt_nl
- << "CORBA::string_free (tmp[i]);" << be_nl
- << "tmp[i] = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl;
-
- os->gen_endif (); // endif macro
-
- // generate #endif for AHETI
- os->gen_endif_AHETI();
-
-
- delete visitor;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp
deleted file mode 100644
index 5e2594fc4a8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp
+++ /dev/null
@@ -1,175 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// gen_unbounded_obj_sequence_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client header
-//
-// = AUTHOR
-// Michael Kircher
-//
-// Modifications by Aniruddha Gokhale
-//
-// ============================================================================
-
-
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, gen_unbounded_obj_sequence_ch, "$Id$")
-
-
-int
-be_visitor_sequence_ch::gen_unbounded_obj_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- // generate the class name
- be_type *pt; // base types
-
- 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);
- pt = t->primitive_base_type ();
- }
- else
- pt = bt;
-
-
- const char * class_name = node->instance_name ();
-
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // !! branching in either compile time template instantiation
- // or manual template instatiation
- os->gen_ifdef_AHETI();
-
- os->gen_ifdef_macro (class_name);
-
- os->indent ();
-
- *os << "class " << class_name << " : public TAO_Unbounded_Base_Sequence" << be_nl
- << "{" << be_nl
- << "public:" << be_idt_nl
- << "// = Initialization and termination methods." << be_nl
- << be_nl;
-
- // constructor
- *os << class_name << " (void);" << be_nl;
-
- // constructor
- *os << class_name << " (CORBA::ULong maximum);" << be_nl;
-
- // constructor
- *os << class_name << " (CORBA::ULong maximum," << be_idt_nl
- << "CORBA::ULong length," << be_nl;
- pt->accept (visitor);
- *os <<"* *value," << be_nl
- << "CORBA::Boolean release = 0);" << be_uidt_nl;
-
- // constructor
- *os << class_name << "(const " << class_name << " &rhs);" << be_nl;
-
- // destructor
- *os << "virtual ~" << class_name << " (void);" << be_nl;
-
- // operator=
- *os << class_name << " &operator= (const " << class_name << " &rhs);" << be_nl;
-
- // operator[]
- be_predefined_type *prim = be_predefined_type::narrow_from_decl (pt);
- int is_pseudo_object =
- pt->node_type () == AST_Decl::NT_pre_defined
- && prim && prim->pt () == AST_PredefinedType::PT_pseudo
- && ACE_OS::strcmp (prim->local_name ()->get_string (),
- "Object") != 0;
-
- if (is_pseudo_object)
- {
- *os << "TAO_Pseudo_Object_Manager<";
- }
- else
- {
- *os << "TAO_Object_Manager<";
- }
-
- *os << pt->name () << ","
- << pt->name () << "_var>"
- << " operator[] (CORBA::ULong index) const;" << be_nl;
-
- // allocbuf
- *os << "static ";
- pt->accept (visitor);
- *os << " **allocbuf (CORBA::ULong nelems);" << be_nl;
-
- // freebuf
- *os << "static void freebuf (";
- pt->accept (visitor);
- *os << " **buffer);" << be_nl;
-
- // allocate_buffer
- *os << "// The Base_Sequence functions, please see tao/Sequence.h" << be_nl
- << "virtual void _allocate_buffer (CORBA::ULong length);" << be_nl;
-
- // deallocate_buffer
- *os << "virtual void _deallocate_buffer (void);" << be_nl;
-
- // get_buffer
- pt->accept(visitor);
- *os << "* *get_buffer (CORBA::Boolean orphan = 0);" << be_nl;
-
- // get_buffer
- *os << "const ";
- pt->accept (visitor);
- *os << "* *get_buffer (void) const;" << be_nl;
-
- // shrink_buffer
- *os << "virtual void _shrink_buffer (CORBA::ULong nl, CORBA::ULong ol);" << be_nl;
-
- if (!is_pseudo_object)
- {
- // Pseudo objects do not require this methods.
- *os << "virtual void _downcast (" << be_idt << be_idt_nl
- << "void* target," << be_nl
- << "CORBA_Object *src," << be_nl
- << "CORBA_Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");" << be_uidt_nl;
-
- *os << "virtual CORBA_Object* _upcast (void *src) const;" << be_nl;
- }
- *os << be_uidt_nl << "};\n";
-
- os->gen_endif (); // endif macro
-
- // generate #endif for AHETI
- os->gen_endif_AHETI();
-
- delete visitor;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ci.cpp
deleted file mode 100644
index 16d8728477c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ci.cpp
+++ /dev/null
@@ -1,339 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// gen_unbounded_obj_sequence_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client inline.
-//
-// = AUTHOR
-// Michael Kircher
-//
-// Modifications by Aniruddha Gokhale
-//
-// ============================================================================
-
-
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, gen_unbounded_obj_sequence_ci, "$Id$")
-
-
-int
-be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- // generate the class name
- be_type *pt; // base types
-
- 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);
- pt = t->primitive_base_type ();
- }
- else
- pt = bt;
-
-
- const char * class_name = node->instance_name ();
-
- static char full_class_name [NAMEBUFSIZE];
- ACE_OS::memset (full_class_name, '\0', NAMEBUFSIZE);
-
- if (node->is_nested ())
- {
- ACE_OS::sprintf (full_class_name, "%s::%s",
- be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (),
- class_name);
- }
- else
- {
- ACE_OS::sprintf (full_class_name, "%s",
- class_name);
- }
-
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // !! branching in either compile time template instantiation
- // or manual template instatiation
- os->gen_ifdef_AHETI();
-
- os->gen_ifdef_macro (class_name);
-
- os->indent ();
-
- // allocbuf
- *os << "ACE_INLINE ";
- // the accept is here the first time used and if an
- // error occurs, it will occur here. Later no check
- // for errors will be done.
- if (pt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "gen_unbounded_obj_sequence - "
- "base type visit failed\n"),
- -1);
- }
- *os << " **" << be_nl
- << full_class_name << "::allocbuf (CORBA::ULong nelems)" << be_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os <<" **buf = 0;" << be_nl
- << be_nl
- << "ACE_NEW_RETURN (buf, ";
- pt->accept (visitor);
- *os << "*[nelems], 0);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = 0; i < nelems; i++)" << be_idt_nl
- << "buf[i] = ";
- pt->accept (visitor);
- *os << "::_nil ();" << be_uidt_nl
- << be_nl
- << "return buf;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // freebuf
- *os << "ACE_INLINE void " << be_nl
- << full_class_name << "::freebuf (";
- pt->accept (visitor);
- *os << " **buffer)" << be_nl
- << "{" << be_idt_nl
- << "if (buffer == 0)" << be_idt_nl
- << "return;" << be_uidt_nl
- << "delete[] buffer;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // constructor
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name << " (void)" << be_nl
- << "{" << be_nl
- << "}" << be_nl
- << be_nl;
-
- // constructor
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name << " (CORBA::ULong maximum)" << be_idt_nl
- << ": TAO_Unbounded_Base_Sequence (maximum, "
- << full_class_name << "::allocbuf (maximum))" << be_uidt_nl
- << "{" << be_nl
- << "}" << be_nl
- << be_nl;
-
- // constructor
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name << " (CORBA::ULong maximum," << be_idt_nl
- << "CORBA::ULong length," << be_nl;
- pt->accept (visitor);
- *os <<"* *value," << be_nl
- << "CORBA::Boolean release)" << be_uidt_nl
- << ": TAO_Unbounded_Base_Sequence (maximum, length, value, release)" << be_nl
- << "{" << be_nl
- << "}" << be_nl
- << be_nl;
-
- // constructor
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name << "(const "
- << full_class_name << " &rhs)" << be_idt_nl
- << ": TAO_Unbounded_Base_Sequence (rhs)" << be_uidt_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os <<" **tmp1 = " << full_class_name << "::allocbuf (this->maximum_);" << be_nl;
- pt->accept(visitor);
- *os <<" ** const tmp2 = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " ** ACE_CAST_CONST, rhs.buffer_);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = 0; i < rhs.length_; ++i)" << be_idt_nl
- << "tmp1[i] = ";
- pt->accept (visitor); *os << "::_duplicate (tmp2[i]);" << be_uidt_nl
- << be_nl
- << "this->buffer_ = tmp1;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // operator=
- *os << "ACE_INLINE " << full_class_name << " &" << be_nl
- << full_class_name << "::operator= (const " << full_class_name << " &rhs)" << be_nl
- << "{" << be_idt_nl
- << "if (this == &rhs)" << be_idt_nl
- << "return *this;" << be_uidt_nl
- << be_nl
- << "if (this->release_)" << be_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os <<" **tmp = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " **, this->buffer_);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_nl
- << "{" << be_idt_nl
- << "CORBA::release (tmp[i]);" << be_nl
- << "tmp[i] = ";
- pt->accept (visitor);
- *os << "::_nil ();" << be_uidt_nl
- << "}" << be_nl
- << "if (this->maximum_ < rhs.maximum_)" << be_nl
- << "{" << be_idt_nl
- << full_class_name << "::freebuf (tmp);" << be_nl
- << "this->buffer_ = " << full_class_name
- << "::allocbuf (rhs.maximum_);" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_idt_nl
- << "this->buffer_ = " << full_class_name
- << "::allocbuf (rhs.maximum_);" << be_uidt_nl
- << be_nl
- << "TAO_Unbounded_Base_Sequence::operator= (rhs);" << be_nl
- << be_nl;
- pt->accept(visitor);
- *os <<" **tmp1 = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " **, this->buffer_);" << be_nl;
- pt->accept(visitor);
- *os <<" ** const tmp2 = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " ** ACE_CAST_CONST, rhs.buffer_);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = 0; i < rhs.length_; ++i)" << be_idt_nl
- << "tmp1[i] = ";
- pt->accept (visitor);
- *os << "::_duplicate (tmp2[i]);" << be_uidt_nl
- << be_nl
- << "return *this;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // operator[]
- be_predefined_type *prim = be_predefined_type::narrow_from_decl (pt);
- int is_pseudo_object =
- pt->node_type () == AST_Decl::NT_pre_defined
- && prim && prim->pt () == AST_PredefinedType::PT_pseudo
- && ACE_OS::strcmp (prim->local_name ()->get_string (),
- "Object") != 0;
-
- if (is_pseudo_object)
- {
- *os << "ACE_INLINE TAO_Pseudo_Object_Manager<";
- }
- else
- {
- *os << "ACE_INLINE TAO_Object_Manager<";
- }
-
- *os << pt->name () << ","
- << pt->name () << "_var>" << be_nl
- << full_class_name << "::operator[] (CORBA::ULong index) const" << be_nl
- << "// read-write accessor" << be_nl
- << "{" << be_idt_nl
- << "ACE_ASSERT (index < this->maximum_);" << be_nl;
- pt->accept(visitor);
- *os <<" ** const tmp = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " ** ACE_CAST_CONST, this->buffer_);" << be_nl;
- if (is_pseudo_object)
- {
- *os << "return TAO_Pseudo_Object_Manager<";
- }
- else
- {
- *os << "return TAO_Object_Manager<";
- }
-
- *os << pt->name () << ","
- << pt->name () << "_var>"
- << " (tmp + index, this->release_);" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // get_buffer
- *os << "ACE_INLINE ";
- pt->accept(visitor);
- *os << "* *" << be_nl
- << full_class_name << "::get_buffer (CORBA::Boolean orphan)" << be_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os << " **result = 0;" << be_nl
- << "if (orphan == 0)" << be_nl
- << "{" << be_idt_nl
- << "// We retain ownership." << be_nl
- << "if (this->buffer_ == 0)" << be_nl
- << "{" << be_idt_nl
- << "result = " << full_class_name << "::allocbuf (this->maximum_);" << be_nl
- << "this->buffer_ = result;" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_nl
- << "{" << be_idt_nl
- << "result = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << "**, this->buffer_);" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "else // if (orphan == 1)" << be_nl
- << "{" << be_idt_nl
- << "if (this->release_ != 0)" << be_nl
- << "{" << be_idt_nl
- << "// We set the state back to default and relinquish" << be_nl
- << "// ownership." << be_nl
- << "result = ACE_reinterpret_cast(";
- pt->accept (visitor);
- *os << "**,this->buffer_);" << be_nl
- << "this->maximum_ = 0;" << be_nl
- << "this->length_ = 0;" << be_nl
- << "this->buffer_ = 0;" << be_nl
- << "this->release_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "return result;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // get_buffer
- *os << "ACE_INLINE ";
- *os << "const ";
- pt->accept (visitor);
- *os << "* *" << be_nl
- << full_class_name << "::get_buffer (void) const" << be_nl
- << "{" << be_idt_nl
- << "return ACE_reinterpret_cast(const ";
- pt->accept (visitor);
- *os << " ** ACE_CAST_CONST, this->buffer_);" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- os->gen_endif (); // endif macro
-
- // generate #endif for AHETI
- os->gen_endif_AHETI();
-
- delete visitor;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp
deleted file mode 100644
index b42030ec7ab..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp
+++ /dev/null
@@ -1,208 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// gen_unbounded_obj_sequence_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client inline.
-//
-// = AUTHOR
-// Michael Kircher
-//
-// Modifications by Aniruddha Gokhale
-//
-// ============================================================================
-
-
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, gen_unbounded_obj_sequence_cs, "$Id$")
-
-
-int
-be_visitor_sequence_cs::gen_unbounded_obj_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- // generate the class name
- be_type *pt; // base types
-
- 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);
- pt = t->primitive_base_type ();
- }
- else
- pt = bt;
-
-
- const char * class_name = node->instance_name ();
-
- static char full_class_name [NAMEBUFSIZE];
- ACE_OS::memset (full_class_name, '\0', NAMEBUFSIZE);
-
- if (node->is_nested ())
- {
- ACE_OS::sprintf (full_class_name, "%s::%s",
- be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (),
- class_name);
- }
- else
- {
- ACE_OS::sprintf (full_class_name, "%s",
- class_name);
- }
-
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // !! branching in either compile time template instantiation
- // or manual template instatiation
- os->gen_ifdef_AHETI();
-
- os->gen_ifdef_macro (class_name);
-
- os->indent ();
-
- // allocate_buffer
- *os << "// The Base_Sequence functions, please see tao/Sequence.h" << be_nl
- << "void" << be_nl
- << full_class_name << "::_allocate_buffer (CORBA::ULong length)" << be_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os <<" **tmp = 0;" << be_nl
- << "tmp = " << full_class_name << "::allocbuf (length);" << be_nl
- << be_nl
- << "if (this->buffer_ != 0)" << be_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os <<" **old = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << "**, this->buffer_);" << be_nl
- << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl
- << "if (!this->release_)" << be_idt_nl
- << "tmp[i] = ";
- pt->accept (visitor);
- *os << "::_duplicate (old[i]);" << be_uidt_nl
- << "else" << be_idt_nl
- << "tmp[i] = old[i];" << be_uidt_nl << be_uidt_nl
- << "if (this->release_)" << be_idt_nl
- << "delete[] old;" << be_uidt_nl << be_uidt_nl
- << "}" << be_nl
- << "this->buffer_ = tmp;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // deallocate_buffer
- *os << "void" << be_nl
- << full_class_name << "::_deallocate_buffer (void)" << be_nl
- << "{" << be_idt_nl
- << "if (this->buffer_ == 0 || this->release_ == 0)" << be_idt_nl
- << "return;" << be_uidt_nl;
- pt->accept(visitor);
- *os <<" **tmp = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << "**, this->buffer_);" << be_nl
- << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_nl
- << "{" << be_idt_nl
- << "CORBA::release (tmp[i]);" << be_nl
- << "tmp[i] = ";
- pt->accept (visitor);
- *os << "::_nil ();" << be_uidt_nl
- << "}" << be_nl
- << full_class_name << "::freebuf (tmp);" << be_nl
- << "this->buffer_ = 0;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // destructor
- *os << full_class_name << "::~" << class_name << " (void)" << be_nl
- << "{" << be_idt_nl
- << "this->_deallocate_buffer ();" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // shrink_buffer
- *os << "void" << be_nl
- << full_class_name << "::_shrink_buffer (CORBA::ULong nl, CORBA::ULong ol)" << be_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os <<" **tmp = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << "**, this->buffer_);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = nl; i < ol; ++i)" << be_nl
- << "{" << be_idt_nl
- << "CORBA::release (tmp[i]);" << be_nl
- << "tmp[i] = ";
- pt->accept (visitor);
- *os << "::_nil ();" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl;
-
-
- be_predefined_type *prim = be_predefined_type::narrow_from_decl (pt);
- if ((pt->node_type () != AST_Decl::NT_pre_defined) ||
- (prim && (prim->pt () == AST_PredefinedType::PT_pseudo) &&
- (!ACE_OS::strcmp (prim->local_name ()->get_string (), "Object"))))
- {
- // Pseudo objects do not require this methods.
- *os << "void " << be_nl
- << full_class_name << "::_downcast (" << be_idt << be_idt_nl
- << "void* target," << be_nl
- << "CORBA_Object *src," << be_nl
- << "CORBA_Environment &ACE_TRY_ENV"
- << be_uidt_nl
- << ")" << be_uidt_nl
- << "{" << be_idt_nl;
- pt->accept (visitor);
- *os << " **tmp = ACE_static_cast (";
- pt->accept (visitor);
- *os << "**, target);" << be_nl
- << "*tmp = ";
- pt->accept (visitor);
- *os << "::_narrow (src, ACE_TRY_ENV);" << be_uidt_nl
- << "}\n" << be_nl;
-
- *os << "CORBA_Object*" << be_nl
- << full_class_name << "::_upcast (void *src) const" << be_nl
- << "{" << be_idt_nl;
- pt->accept (visitor);
- *os << " **tmp = ACE_static_cast (";
- pt->accept (visitor);
- *os << "**, src);" << be_nl
- << "return *tmp;" << be_uidt_nl
- << "}" << be_nl;
- }
-
- os->gen_endif (); // endif macro
-
- // generate #endif for AHETI
- os->gen_endif_AHETI();
-
- delete visitor;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ch.cpp
deleted file mode 100644
index b9307c1ce0f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ch.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// gen_unbounded_sequence_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client header
-//
-// = AUTHOR
-// Michael Kircher
-//
-// Modifications by Aniruddha Gokhale
-//
-// ============================================================================
-
-//#include "idl.h"
-//#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, gen_unbounded_sequence_ch, "$Id$")
-
-
-int
-be_visitor_sequence_ch::gen_unbounded_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- // generate the class name
- be_type *pt; // base types
-
- 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);
- pt = t->primitive_base_type ();
- }
- else
- pt = bt;
-
-
- const char * class_name = node->instance_name ();
-
-
- // get the visitor for the type of the sequence
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // !! branching in either compile time template instantiation
- // or manual template instatiation
- os->gen_ifdef_AHETI();
-
- os->gen_ifdef_macro (class_name);
-
- os->indent ();
-
- *os << "class TAO_EXPORT_NESTED_MACRO "
- << class_name << " : public TAO_Unbounded_Base_Sequence" << be_nl
- << "{" << be_nl
- << "public:" << be_idt_nl
- << "// = Initialization and termination methods." << be_nl
- << be_nl;
- // constructor
- *os << class_name << " (void); // Default constructor." << be_nl;
-
- // constructor
- *os << class_name << " (CORBA::ULong maximum); " << be_nl;
-
- // constructor
- *os << class_name << " (CORBA::ULong maximum," << be_idt_nl
- << "CORBA::ULong length," << be_nl;
- // the accept is here the first time used and if an
- // error occurs, it will occur here. Later no check
- // for errors will be done.
- if (pt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
- *os << " *data," << be_nl
- << "CORBA::Boolean release = 0);" << be_uidt_nl;
-
- // constructor
- *os << class_name << " (const " << class_name << " &rhs);" << be_nl;
-
- // operator =
- *os << class_name << " &operator= (const " << class_name << " &rhs);" << be_nl;
-
- // destructor
- *os << "virtual ~" << class_name << " (void); // Dtor." << be_nl;
-
- // Accessors
- *os << "// = Accessors." << be_nl;
- pt->accept (visitor);
- *os <<" &operator[] (CORBA::ULong i);" << be_nl;
-
- // operator[]
- *os << "const ";
- pt->accept (visitor);
- *os << " &operator[] (CORBA::ULong i) const;" << be_nl;
-
- // Static operations
- *os << "// = Static operations." << be_nl
- << "static ";
- pt->accept (visitor);
- *os << " *allocbuf (CORBA::ULong size);" << be_nl;
-
- *os << "static void freebuf (";
- pt->accept (visitor);
- *os << " *buffer);" << be_nl;
-
- // allocate_buffer
- *os << "virtual void _allocate_buffer (CORBA::ULong length);" << be_nl;
-
- // deallocate_buffer
- *os << "virtual void _deallocate_buffer (void);" << be_nl;
-
- // Implement the TAO_Base_Sequence methods (see Sequence.h)
- *os << "// Implement the TAO_Base_Sequence methods (see Sequence.h)" << be_nl
- << be_nl;
- pt->accept(visitor);
- *os << " *get_buffer (CORBA::Boolean orphan = 0);" << be_nl;
-
- // get_buffer
- *os << "const ";
- pt->accept (visitor);
- *os << " *get_buffer (void) const;" << be_nl;
-
- // replace
- *os << "void replace (CORBA::ULong max," << be_idt_nl
- << "CORBA::ULong length," << be_nl;
- pt->accept(visitor);
- *os <<" *data," << be_nl
- << "CORBA::Boolean release);" << be_uidt << be_uidt_nl;
-
- *os << "};\n";
-
- os->gen_endif (); // endif macro
-
- // generate #endif for AHETI
- os->gen_endif_AHETI();
-
- delete visitor;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ci.cpp
deleted file mode 100644
index 9348769b863..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ci.cpp
+++ /dev/null
@@ -1,338 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// gen_unbounded_sequence_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client inline
-//
-// = AUTHOR
-// Michael Kircher
-//
-// Modifications by Aniruddha Gokhale
-//
-// ============================================================================
-
-//#include "idl.h"
-//#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, gen_unbounded_sequence_ci, "$Id$")
-
-
-int
-be_visitor_sequence_ci::gen_unbounded_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- // generate the class name
- be_type *pt; // base types
-
- 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);
- pt = t->primitive_base_type ();
- }
- else
- pt = bt;
-
-
- const char * class_name = node->instance_name ();
-
- static char full_class_name [NAMEBUFSIZE];
- ACE_OS::memset (full_class_name, '\0', NAMEBUFSIZE);
-
- if (node->is_nested ())
- {
- ACE_OS::sprintf (full_class_name, "%s::%s",
- be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (),
- class_name);
- }
- else
- {
- ACE_OS::sprintf (full_class_name, "%s",
- class_name);
- }
-
- // get the visitor for the type of the sequence
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // !! branching in either compile time template instantiation
- // or manual template instatiation
- os->gen_ifdef_AHETI();
-
- os->gen_ifdef_macro (class_name);
-
- os->indent ();
-
- // Static operations
- // allocbuf
- *os << "// = Static operations." << be_nl
- << "ACE_INLINE ";
- // the accept is here the first time used and if an
- // error occurs, it will occur here. Later no check
- // for errors will be done.
- if (pt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "gen_unbounded_sequence - "
- "base type visit failed\n"),
- -1);
- }
- *os << " *" << be_nl
- << full_class_name << "::allocbuf (CORBA::ULong size)" << be_nl
- << "// Allocate storage for the sequence." << be_nl
- << "{" << be_idt_nl
- << "return new ";
- pt->accept (visitor);
- *os << "[size];" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- *os << "ACE_INLINE void "
- << full_class_name << "::freebuf (";
- pt->accept (visitor);
- *os << " *buffer)" << be_nl
- << "// Free the sequence." << be_nl
- << "{" << be_idt_nl
- << "delete [] buffer;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // constructor
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name << " (void) // Default constructor." << be_nl
- << "{" << be_nl
- << "}" << be_nl
- << be_nl;
-
- // constructor
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name << " (CORBA::ULong maximum) "
- << "// Constructor using a maximum length value." << be_idt_nl
- << ": TAO_Unbounded_Base_Sequence (maximum, "
- << full_class_name << "::allocbuf (maximum))"
- << be_uidt_nl
- << "{" << be_nl
- << "}" << be_nl
- << be_nl;
-
- // constructor
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name << " (CORBA::ULong maximum," << be_idt_nl
- << "CORBA::ULong length," << be_nl;
- pt->accept (visitor);
- *os << " *data," << be_nl
- << "CORBA::Boolean release)" << be_uidt_nl
- << ": TAO_Unbounded_Base_Sequence (maximum, length, data, release)" << be_nl
- << "{" << be_nl
- << "}" << be_nl
- << be_nl;
-
- // constructor
- *os << "ACE_INLINE" << be_nl
- << full_class_name << "::" << class_name << " (const "
- << full_class_name << " &rhs)" << be_nl
- << "// Copy constructor." << be_idt_nl;
- *os << ": TAO_Unbounded_Base_Sequence (rhs)" << be_uidt_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os <<" *tmp1 = " << full_class_name << "::allocbuf (this->maximum_);" << be_nl;
- pt->accept(visitor);
- *os << " * const tmp2 = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " * ACE_CAST_CONST, rhs.buffer_);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl
- << "tmp1[i] = tmp2[i];" << be_uidt_nl
- << be_nl
- << "this->buffer_ = tmp1;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // operator =
- *os << "ACE_INLINE " << full_class_name << " &" << be_nl
- << full_class_name << "::operator= (const " << full_class_name << " &rhs)" << be_nl
- << "// Assignment operator." << be_nl
- << "{" << be_idt_nl
- << "if (this == &rhs)" << be_idt_nl
- << "return *this;" << be_uidt_nl
- << be_nl
- << "if (this->release_)" << be_nl
- << "{" << be_idt_nl
- << "if (this->maximum_ < rhs.maximum_)" << be_nl
- << "{" << be_idt_nl
- << "// free the old buffer" << be_nl;
- pt->accept (visitor);
- *os <<" *tmp = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " *, this->buffer_);" << be_nl
- << full_class_name << "::freebuf (tmp);" << be_nl
- << "this->buffer_ = " << full_class_name
- << "::allocbuf (rhs.maximum_);" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_idt_nl
- << "this->buffer_ = " << full_class_name
- << "::allocbuf (rhs.maximum_);" << be_uidt_nl
- << be_nl
- << "TAO_Unbounded_Base_Sequence::operator= (rhs);" << be_nl
- << be_nl;
- pt->accept (visitor);
- *os <<" *tmp1 = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " *, this->buffer_);" << be_nl;
- pt->accept (visitor);
- *os <<" * const tmp2 = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " * ACE_CAST_CONST, rhs.buffer_);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl
- << "tmp1[i] = tmp2[i];" << be_uidt_nl
- << be_nl
- << "return *this;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // Accessors
- *os << "// = Accessors." << be_nl;
- *os << "ACE_INLINE ";
- pt->accept (visitor);
- *os <<" &" << be_nl
- << full_class_name << "::operator[] (CORBA::ULong i)" << be_nl
- << "// operator []" << be_nl
- << "{" << be_idt_nl
- << "ACE_ASSERT (i < this->maximum_);" << be_nl;
- pt->accept (visitor);
- *os <<"* tmp = ACE_reinterpret_cast(";
- pt->accept (visitor);
- *os << "*,this->buffer_);" << be_nl
- << "return tmp[i];" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // operator[]
- *os << "ACE_INLINE const ";
- pt->accept (visitor);
- *os << " &" << be_nl
- << full_class_name << "::operator[] (CORBA::ULong i) const" << be_nl
- << "// operator []" << be_nl
- << "{" << be_idt_nl
- << "ACE_ASSERT (i < this->maximum_);" << be_nl;
- pt->accept (visitor);
- *os <<" * const tmp = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << "* ACE_CAST_CONST, this->buffer_);" << be_nl
- << "return tmp[i];" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // Implement the TAO_Base_Sequence methods (see Sequence.h)
- *os << "// Implement the TAO_Base_Sequence methods (see Sequence.h)" << be_nl
- << be_nl;
- *os << "ACE_INLINE ";
- pt->accept(visitor);
- *os << " *" << be_nl
- << full_class_name << "::get_buffer (CORBA::Boolean orphan)" << be_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os <<" *result = 0;" << be_nl
- << "if (orphan == 0)" << be_nl
- << "{" << be_idt_nl
- << "// We retain ownership." << be_nl
- << "if (this->buffer_ == 0)" << be_nl
- << "{" << be_idt_nl
- << "result = " << full_class_name << "::allocbuf (this->length_);" << be_nl
- << "this->buffer_ = result;" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_nl
- << "{" << be_idt_nl
- << "result = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << "*, this->buffer_);" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "else // if (orphan == 1)" << be_nl
- << "{" << be_idt_nl
- << "if (this->release_ != 0)" << be_nl
- << "{" << be_idt_nl
- << "// We set the state back to default and relinquish" << be_nl
- << "// ownership." << be_nl
- << "result = ACE_reinterpret_cast(";
- pt->accept (visitor);
- *os << "*,this->buffer_);" << be_nl
- << "this->maximum_ = 0;" << be_nl
- << "this->length_ = 0;" << be_nl
- << "this->buffer_ = 0;" << be_nl
- << "this->release_ = 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "return result;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // get_buffer
- *os << "ACE_INLINE const ";
- pt->accept (visitor);
- *os << " *" << be_nl
- << full_class_name << "::get_buffer (void) const" << be_nl
- << "{" << be_idt_nl
- << "return ACE_reinterpret_cast(const ";
- pt->accept (visitor);
- *os << " * ACE_CAST_CONST, this->buffer_);" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // replace
- *os << "ACE_INLINE void" << be_nl
- << full_class_name << "::replace (CORBA::ULong max," << be_nl
- << "CORBA::ULong length," << be_nl;
- pt->accept(visitor);
- *os <<" *data," << be_nl
- << "CORBA::Boolean release)" << be_nl
- << "{" << be_idt_nl
- << "this->maximum_ = max;" << be_nl
- << "this->length_ = length;" << be_nl
- << "if (this->buffer_ && this->release_ == 1)" << be_nl
- << "{" << be_idt_nl;
- pt->accept(visitor);
- *os <<" *tmp = ACE_reinterpret_cast(";
- pt->accept (visitor);
- *os << "*,this->buffer_);" << be_nl
- << full_class_name << "::freebuf (tmp);" << be_uidt_nl
- << "}" << be_nl
- << "this->buffer_ = data;" << be_nl
- << "this->release_ = release;" << be_uidt_nl
- << "}" << be_nl;
-
- os->gen_endif (); // endif macro
-
- // generate #endif for AHETI
- os->gen_endif_AHETI();
-
- delete visitor;
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_cs.cpp
deleted file mode 100644
index 93c7138ba1a..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_cs.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// gen_unbounded_sequence_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client impl
-//
-// = AUTHOR
-// Michael Kircher
-//
-// Modifications by Aniruddha Gokhale
-//
-// ============================================================================
-
-//#include "idl.h"
-//#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, gen_unbounded_sequence_cs, "$Id$")
-
-
-int
-be_visitor_sequence_cs::gen_unbounded_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- // generate the class name
- be_type *pt; // base types
-
- 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);
- pt = t->primitive_base_type ();
- }
- else
- pt = bt;
-
-
- const char * class_name = node->instance_name ();
-
- static char full_class_name [NAMEBUFSIZE];
- ACE_OS::memset (full_class_name, '\0', NAMEBUFSIZE);
-
- if (node->is_nested ())
- {
- ACE_OS::sprintf (full_class_name, "%s::%s",
- be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (),
- class_name);
- }
- else
- {
- ACE_OS::sprintf (full_class_name, "%s",
- class_name);
- }
-
- // get the visitor for the type of the sequence
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- // !! branching in either compile time template instantiation
- // or manual template instatiation
- os->gen_ifdef_AHETI();
-
- os->gen_ifdef_macro (class_name);
-
- os->indent ();
-
- // allocate_buffer
- *os << "void" << be_nl
- << full_class_name << "::_allocate_buffer (CORBA::ULong length)" << be_nl
- << "{" << be_idt_nl;
- pt->accept (visitor);
- *os << "* tmp = 0;" << be_nl
- << "tmp = " << full_class_name << "::allocbuf (length);" << be_nl
- << be_nl
- << "if (this->buffer_ != 0)" << be_nl
- << "{" << be_idt_nl;
- pt->accept (visitor);
- *os <<" *old = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " *,this->buffer_);" << be_nl
- << be_nl
- << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl
- << "tmp[i] = old[i];" << be_uidt_nl
- << be_nl
- << "if (this->release_)" << be_idt_nl
- << full_class_name << "::freebuf (old);" << be_uidt_nl << be_uidt_nl
- << "}" << be_nl
- << "this->buffer_ = tmp;" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- // deallocate_buffer
- *os << "void" << be_nl
- << full_class_name << "::_deallocate_buffer (void)" << be_nl
- << "{" << be_idt_nl
- << "if (this->buffer_ == 0 || this->release_ == 0)" << be_idt_nl
- << "return;" << be_uidt_nl
- << be_nl;
- pt->accept(visitor);
- *os <<" *tmp = ACE_reinterpret_cast (";
- pt->accept (visitor);
- *os << " *,this->buffer_);" << be_nl
- << be_nl
- << full_class_name << "::freebuf (tmp);" << be_nl
- << "this->buffer_ = 0;" << be_uidt_nl
- << "} " << be_nl
- << be_nl;
-
- // destructor
- *os << full_class_name << "::~" << class_name << " (void) // Dtor." << be_nl
- << "{" << be_idt_nl
- << "this->_deallocate_buffer ();" << be_uidt_nl
- << "}" << be_nl
- << be_nl;
-
- os->gen_endif (); // endif macro
-
- // generate #endif for AHETI
- os->gen_endif_AHETI();
-
- delete visitor;
- 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 0b3bb8a627e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_base.cpp
+++ /dev/null
@@ -1,194 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// sequence_base.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for the base type of the Sequence
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-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)
- *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_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_union (be_union *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)
-{
- this->ctx_->alias (node); // set the 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 = node;
-
- if (this->ctx_->alias ())
- bt = this->ctx_->alias ();
-
- 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 ()
- << "," << bt->name () << "_var";
-
- return 0;
-
-}
-
-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 26a8f5c15ba..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp
+++ /dev/null
@@ -1,630 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// sequence_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-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::gen_base_sequence_class (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
-
- // !! branching in either compile time template instantiation
- // or manual template instatiation
- os->gen_ifdef_AHETI();
-
- // this is the instantiation branch
- *os << node->instance_name ();
-
- os->gen_else_AHETI();
-
- // generate the appropriate sequence type
- switch (node->managed_type ())
- {
- case be_sequence::MNG_OBJREF:
- if (node->unbounded ())
- *os << "TAO_Unbounded_Object_Sequence<";
- else
- *os << "TAO_Bounded_Object_Sequence<";
- break;
- case be_sequence::MNG_PSEUDO:
- if (node->unbounded ())
- *os << "TAO_Unbounded_Pseudo_Sequence<";
- else
- *os << "TAO_Bounded_Pseudo_Sequence<";
- break;
- case be_sequence::MNG_STRING:
- if (node->unbounded ())
- *os << "TAO_Unbounded_String_Sequence";
- else
- *os << "TAO_Bounded_String_Sequence";
- break;
- default: // not a managed type
- if (node->unbounded ())
- *os << "TAO_Unbounded_Sequence<";
- else
- *os << "TAO_Bounded_Sequence<";
- break;
- }
-
- be_visitor_context *ctx;
- ACE_NEW_RETURN (ctx,
- be_visitor_context (*this->ctx_),
- 0);
- be_visitor_sequence_base_template_args visitor (ctx, node);
- ctx->state (TAO_CodeGen::TAO_SEQUENCE_BASE_CH);
- //be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
- //delete visitor;
-
- // find out if the sequence is of a managed type and if it is bounded or not
- if (node->managed_type () == be_sequence::MNG_STRING)
- {
- if (!node->unbounded ())
- {
- *os << "<" << node->max_size () << ">";
- }
- }
- else
- {
- if (node->unbounded ())
- {
- *os << ">";
- }
- else
- {
- *os << ", " << node->max_size () << ">";
- }
- }
-
- os->gen_endif_AHETI();
-
- return 0;
-}
-
-
-int
-be_visitor_sequence_ch::instantiate_sequence (be_sequence *node)
-{
- be_type *bt;
-
- bt = be_type::narrow_from_decl (node->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "gen_instantiate_template_name - "
- "Bad element type\n"), -1);
- }
-
- // generate the appropriate sequence type
- switch (node->managed_type ())
- {
- case be_sequence::MNG_PSEUDO:
- case be_sequence::MNG_OBJREF:
- if (node->unbounded ())
- this->gen_unbounded_obj_sequence (node);
- else
- this->gen_bounded_obj_sequence (node);
- break;
- case be_sequence::MNG_STRING: // sequence of strings
- if (!node->unbounded ())
- this->gen_bounded_str_sequence (node);
- // else
- // inheriting from the right class is enough
- break;
- default: // not a managed type
- if (node->unbounded ())
- {
-#if 1
- // 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 ());
- }
- }
- if (predef != 0)
- {
- if (predef->pt() != AST_PredefinedType::PT_octet)
- this->gen_unbounded_sequence (node);
- }
- else
- this->gen_unbounded_sequence (node);
-#else
- // @@ This needs to be fixed. (Michael)
- be_predefined_type * bpt =
- be_predefined_type::narrow_from_decl (node->base_type());
- if (bpt)
- {
- if (bpt->pt() != AST_PredefinedType::PT_octet)
- this->gen_unbounded_sequence (node);
- }
- else
- this->gen_unbounded_sequence (node);
-#endif
- }
- else
- this->gen_bounded_sequence (node);
- break;
- }
-
- return 0;
-}
-
-
-int be_visitor_sequence_ch::visit_sequence (be_sequence *node)
-{
- be_type *bt; // type node
- TAO_OutStream *os = this->ctx_->stream ();
-
- // 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;
-
- // instantiation
-
- if (this->instantiate_sequence (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "codegen. for the primitive type sequence\n"), -1);
- }
-
- // end of instantiation
-
- // generate the ifdefined macro for the sequence type
- os->gen_ifdef_macro (node->flatname ());
-
- os->indent (); // start with the current indentation level
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- *os << "// *************************************************************"
- << be_nl
- << "// " << node->local_name () << be_nl
- << "// *************************************************************"
- << be_nl << be_nl;
-
- // generate a typedef to a parametrized sequence
- *os << "class " << idl_global->export_macro ()
- << " " << node->local_name () << " : public ";
-
- if (this->gen_base_sequence_class (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "codegen for base sequence class\n"), -1);
- }
-
- *os << "{" << be_nl
- << "public:" << be_idt_nl
- << node->local_name () << " (void); // default ctor" << be_nl;
- // for unbounded sequences, we have a different set of constructors
- if (node->unbounded ())
- {
- *os << node->local_name () << " (CORBA::ULong max); // uses max size"
- << be_nl;
- }
-
- *os << node->local_name () << " (" << 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_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "Bad visitor\n"), -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
- delete visitor;
- *os << " *buffer, " << be_nl
- << "CORBA::Boolean release=0" << be_uidt_nl
- << ");" << be_nl;
- *os << node->local_name () << " (const " << node->local_name ()
- << " &); // copy ctor" << be_nl;
- *os << "~" << node->local_name () << " (void); // dtor\n";
-
- // 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"
- << "#if defined(TAO_NO_COPY_OCTET_SEQUENCES)" << 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
- << " : " << node->instance_name ()
- << " (length, mb) {}" << "\n"
- << "#endif /* TAO_NO_COPY_OCTET_SEQUENCE */\n\n";
- }
-
- os->decr_indent ();
- *os << "};" << be_nl;
-
- // define a _ptr type. This is just an extension for convenience
- *os << "typedef " << node->local_name () << " *"
- << node->local_name () << "_ptr;\n";
-
-#if 0
- if (!this->ctx_->tdef ())
- {
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DECL);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "TypeCode declaration failed\n"
- ), -1);
- }
- }
-#endif
-
- os->gen_endif (); // endif macro
-
- // generate the ifdefined macro for the var type
- os->gen_ifdef_macro (node->flatname (), "_var");
-
- // generate the var and out types
- if (this->gen_var_defn (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "codegen for _var failed\n"), -1);
- }
-
- os->gen_endif ();
-
- // generate the ifdefined macro for the _out type
- os->gen_ifdef_macro (node->flatname (), "_out");
-
- if (this->gen_out_defn (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "codegen for _out failed\n"),
- -1);
- }
- os->gen_endif ();
- node->cli_hdr_gen (1);
-
- return 0;
-}
-
-// generate the _var definition for ourself
-int
-be_visitor_sequence_ch::gen_var_defn (be_sequence *node)
-{
- TAO_OutStream *os; // output stream
- char namebuf [NAMEBUFSIZE]; // names
- be_type *bt; // base type
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (namebuf, "%s_var", node->local_name ()->get_string ());
-
- os = this->ctx_->stream ();
-
- *os << "// *************************************************************"
- << be_nl;
- *os << "// class " << node->name () << "_var" << be_nl;
- *os << "// *************************************************************\n\n";
-
- // retrieve base type
- bt = be_type::narrow_from_decl (node->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "gen_var_defn - "
- "Bad base type\n"),
- -1);
- }
-
- // generate the var definition (always in the client header).
- // Depending upon the data type, there are some differences which we account
- // for over here.
-
- os->indent (); // start with whatever was our current indent level
- *os << "class " << idl_global->export_macro ()
- << " " << namebuf << be_nl;
- *os << "{" << be_nl;
- *os << "public:\n";
- os->incr_indent ();
- // default constr
- *os << namebuf << " (void); // default constructor" << be_nl;
- // constr
- *os << namebuf << " (" << node->local_name () << " *);" << be_nl;
- // copy constructor
- *os << namebuf << " (const " << namebuf <<
- " &); // copy constructor" << be_nl;
- // destructor
- *os << "~" << namebuf << " (void); // destructor" << be_nl;
- *os << be_nl;
- // assignment operator from a pointer
- *os << namebuf << " &operator= (" << node->local_name () << " *);" << be_nl;
- // assignment from _var
- *os << namebuf << " &operator= (const " << namebuf <<
- " &);" << be_nl;
-
- // arrow operator
- *os << node->local_name () << " *operator-> (void);" << be_nl;
- *os << "const " << node->local_name () << " *operator-> (void) const;" << be_nl;
- *os << be_nl;
-
- // other extra types (cast operators, [] operator, and others)
-
- // cast operator
- *os << "operator const " << node->local_name () << " &() const;" << be_nl;
- *os << "operator " << node->local_name () << " &();" << be_nl;
- *os << "operator " << node->local_name () << " &() const;" << be_nl;
-
- // overloaded [] operator. The const version is not required for sequences
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "gen_var_defn - "
- "Bad visitor\n"), -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_sequence::"
- "gen_var_defn - "
- "[] ret type gen failed\n"),
- -1);
- }
- delete visitor;
-
- *os << "operator[] (CORBA::ULong index);" << be_nl;
-
- *os << "// in, inout, out, _retn " << be_nl;
- // the return types of in, out, inout, and _retn are based on the parameter
- // passing rules and the base type
- *os << "const " << node->local_name () << " &in (void) const;" << be_nl;
- *os << node->local_name () << " &inout (void);" << be_nl;
- *os << node->local_name () << " *&out (void);" << be_nl;
- *os << node->local_name () << " *_retn (void);" << be_nl;
-
- // generate an additional member function that returns the underlying pointer
- *os << node->local_name () << " *ptr (void) const;\n";
-
- *os << "\n";
- os->decr_indent ();
-
- // generate the private section
- *os << "private:\n";
- os->incr_indent ();
- *os << node->local_name () << " *ptr_;\n";
-
- os->decr_indent ();
- *os << "};\n\n";
-
- return 0;
-}
-
-// generate the _out definition
-int
-be_visitor_sequence_ch::gen_out_defn (be_sequence *node)
-{
- TAO_OutStream *os; // output stream
- char namebuf [NAMEBUFSIZE]; // to hold the _out name
- be_type *bt; // base type
-
- ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (namebuf, "%s_out", node->local_name ()->get_string ());
- os = this->ctx_->stream ();
-
- // retrieve base type
- bt = be_type::narrow_from_decl (node->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "gen_out_defn - "
- "Bad base type\n"),
- -1);
- }
-
- // generate the out definition (always in the client header)
- os->indent (); // start with whatever was our current indent level
-
- *os << "class " << idl_global->export_macro () << " "
- << namebuf << be_nl;
- *os << "{" << be_nl;
- *os << "public:\n";
- os->incr_indent ();
-
- // No default constructor
-
- // constructor from a pointer
- *os << namebuf << " (" << node->local_name () << " *&);" << be_nl;
- // constructor from a _var &
- *os << namebuf << " (" << node->local_name () << "_var &);" << be_nl;
- // constructor from a _out &
- *os << namebuf << " (const " << namebuf << " &);" << be_nl;
- // assignment operator from a _out &
- *os << namebuf << " &operator= (const " << namebuf << " &);" << be_nl;
- // assignment operator from a pointer &, cast operator, ptr fn, operator
- // -> and any other extra operators
- // assignment
- *os << namebuf << " &operator= (" << node->local_name () << " *);" << be_nl;
- // operator ()
- *os << "operator " << node->local_name () << " *&();" << be_nl;
- // ptr fn
- *os << node->local_name () << " *&ptr (void);" << be_nl;
- // operator ->
- *os << node->local_name () << " *operator-> (void);" << be_nl;
-
- // overloaded [] operator only for sequence. The const version is not
- // required
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "gen_out_defn - "
- "Bad visitor\n"), -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_sequence::"
- "gen_var_defn - "
- "[] ret type gen failed\n"),
- -1);
- }
- delete visitor;
- *os << "operator[] (CORBA::ULong index);" << be_nl;
- *os << "\n";
- os->decr_indent ();
- *os << "private:\n";
- os->incr_indent ();
-
- *os << node->local_name () << " *&ptr_;" << be_nl;
- *os << "// assignment from T_var not allowed" << be_nl;
- *os << "void operator= (const " << node->local_name () << "_var &);\n";
-
- os->decr_indent ();
- *os << "};\n\n";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp
deleted file mode 100644
index d30852ffa11..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp
+++ /dev/null
@@ -1,574 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// sequence_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequence in the client inline file
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-ACE_RCSID(be_visitor_sequence, sequence_ci, "$Id$")
-
-
-// ***********************************************************
-// sequence visitor for inline generation
-// ***********************************************************
-
-
-be_visitor_sequence_ci::be_visitor_sequence_ci (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-be_visitor_sequence_ci::~be_visitor_sequence_ci (void)
-{
-}
-
-int
-be_visitor_sequence_ci::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (node->cli_inline_gen () || node->imported ())
- return 0;
-
- // instantiation
-
- if (this->instantiate_sequence (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "visit_sequence - "
- "codegen. for the primitive type sequence\n"),
- -1);
- }
-
- // end of instantiation
-
- // generate the ifdefined macro for the sequence type
- os->gen_ifdef_macro (node->flatname ());
-
- // all we do is generate the _var and _out implementations
- if (this->gen_var_impl (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "visit_sequence - "
- "codegen for _var failed\n"), -1);
- }
-
- if (this->gen_out_impl (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "visit_sequence - "
- "codegen for _out failed\n"), -1);
- }
-
- // generate the endif macro for the sequence type
- os->gen_endif ();
- node->cli_inline_gen (1);
-
- return 0;
-}
-
-int
-be_visitor_sequence_ci::instantiate_sequence (be_sequence *node)
-{
- be_type *bt;
-
- bt = be_type::narrow_from_decl (node->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "gen_instantiate_template_name - "
- "Bad element type\n"), -1);
- }
-
- // generate the appropriate sequence type
- switch (node->managed_type ())
- {
- case be_sequence::MNG_PSEUDO:
- case be_sequence::MNG_OBJREF:
- if (node->unbounded ())
- this->gen_unbounded_obj_sequence (node);
- else
- this->gen_bounded_obj_sequence (node);
- break;
- case be_sequence::MNG_STRING: // sequence of strings
- if (!node->unbounded ())
- this->gen_bounded_str_sequence (node);
- // else
- // inheriting from the right class is enough
- break;
- default: // not a managed type
- if (node->unbounded ())
- {
-#if 1
- // 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 ());
- }
- }
- if (predef != 0)
- {
- if (predef->pt() != AST_PredefinedType::PT_octet)
- this->gen_unbounded_sequence (node);
- }
- else
- this->gen_unbounded_sequence (node);
-#else
- // @@ This needs to be fixed. (Michael)
- be_predefined_type * bpt =
- be_predefined_type::narrow_from_decl (node->base_type());
- if (bpt)
- {
- if (bpt->pt() != AST_PredefinedType::PT_octet)
- this->gen_unbounded_sequence (node);
- }
- else
- this->gen_unbounded_sequence (node);
-#endif
- }
- else
- this->gen_bounded_sequence (node);
- break;
- }
-
- return 0;
-}
-
-int
-be_visitor_sequence_ci::gen_var_impl (be_sequence *node)
-{
- TAO_OutStream *os; // output stream
- char fname [NAMEBUFSIZE]; // to hold the full and
- char lname [NAMEBUFSIZE]; // local _var names
- be_type *bt; // base type
-
-
- ACE_OS::memset (fname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (fname, "%s_var", node->fullname ());
-
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (lname, "%s_var", node->local_name ()->get_string ());
-
- os = this->ctx_->stream ();
-
- // retrieve base type
- bt = be_type::narrow_from_decl (node->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- // generate the var implementation in the inline file
- os->indent (); // start with whatever was our current indent level
-
- *os << "// *************************************************************"
- << be_nl;
- *os << "// Inline operations for class " << fname << be_nl;
- *os << "// *************************************************************\n\n";
-
- // default constr
- *os << "ACE_INLINE" << be_nl
- << fname << "::" << lname
- << " (void) // default constructor" << be_nl
- << " " << ": ptr_ (0)" << be_nl
- << "{}\n\n";
-
- // constr from a _ptr
- os->indent ();
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::" << lname << " (" << node->name () << " *p)" << be_nl;
- *os << " : ptr_ (p)" << be_nl;
- *os << "{}\n\n";
-
- // copy constructor
- os->indent ();
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::" << lname << " (const " << fname <<
- " &p) // copy constructor" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "if (p.ptr_)" << be_nl;
- *os << " this->ptr_ = new " << node->name () << "(*p.ptr_);" << be_nl;
- *os << "else" << be_nl;
- *os << " this->ptr_ = 0;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // destructor
- os->indent ();
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::~" << lname << " (void) // destructor" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "delete this->ptr_;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // assignment operator from a pointer
- os->indent ();
- *os << "ACE_INLINE " << fname << " &" << be_nl;
- *os << fname << "::operator= (" << node->name () <<
- " *p)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "delete this->ptr_;" << be_nl;
- *os << "this->ptr_ = p;" << be_nl;
- *os << "return *this;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // assignment operator from _var
- os->indent ();
- *os << "ACE_INLINE " << fname << " &" << be_nl;
- *os << fname << "::operator= (const " << fname <<
- " &p) // deep copy" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "if (this != &p)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "delete this->ptr_;" << be_nl;
- *os << "this->ptr_ = new " << node->name () << " (*p.ptr_);\n";
- os->decr_indent ();
- *os << "}" << be_nl;
- *os << "return *this;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // two arrow operators
- os->indent ();
- *os << "ACE_INLINE const " << node->name () << " *" << be_nl;
- *os << fname << "::operator-> (void) const" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "return this->ptr_;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- os->indent ();
- *os << "ACE_INLINE " << node->name () << " *" << be_nl;
- *os << fname << "::operator-> (void)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "return this->ptr_;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // other extra methods - 3 cast operator ()
- os->indent ();
- *os << "ACE_INLINE " << be_nl;
- *os << fname << "::operator const " << node->name () <<
- " &() const // cast" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "return *this->ptr_;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- os->indent ();
- *os << "ACE_INLINE " << be_nl;
- *os << fname << "::operator " << node->name () << " &() // cast " << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "return *this->ptr_;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- os->indent ();
- *os << "ACE_INLINE " << be_nl;
- *os << fname << "::operator " << node->name () << " &() const// cast " << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "return *this->ptr_;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // operator []
- os->indent ();
- *os << "ACE_INLINE ";
-
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQELEM_RETTYPE_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "gen_var_impl - "
- "Bad visitor\n"), -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "gen_var_impl - "
- "[] ret type gen failed\n"),
- -1);
- }
- delete visitor;
-
- *os << be_nl;
- *os << fname << "::operator[] (CORBA::ULong index)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "return this->ptr_->operator[] (index);\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // in, inout, out, and _retn
- os->indent ();
- *os << "ACE_INLINE const " << node->name () << " &" << be_nl;
- *os << fname << "::in (void) const" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "return *this->ptr_;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- os->indent ();
- *os << "ACE_INLINE " << node->name () << " &" << be_nl;
- *os << fname << "::inout (void)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "return *this->ptr_;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- os->indent ();
- *os << "// mapping for variable size " << be_nl;
- *os << "ACE_INLINE " << node->name () << " *&" << be_nl;
- *os << fname << "::out (void)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "delete this->ptr_;" << be_nl;
- *os << "this->ptr_ = 0;" << be_nl;
- *os << "return this->ptr_;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- os->indent ();
- *os << "ACE_INLINE " << node->name () << " *" << be_nl;
- *os << fname << "::_retn (void)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << node->name () << " *tmp = this->ptr_;" << be_nl;
- *os << "this->ptr_ = 0;" << be_nl;
- *os << "return tmp;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // the additional ptr () member function
- os->indent ();
- *os << "ACE_INLINE " << node->name () << " *" << be_nl;
- *os << fname << "::ptr (void) const" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "return this->ptr_;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- return 0;
-}
-
-int
-be_visitor_sequence_ci::gen_out_impl (be_sequence *node)
-{
- TAO_OutStream *os; // output stream
- char fname [NAMEBUFSIZE]; // to hold the full and
- char lname [NAMEBUFSIZE]; // local _out names
- be_type *bt; // base type
-
-
- ACE_OS::memset (fname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (fname, "%s_out", node->fullname ());
-
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (lname, "%s_out", node->local_name ()->get_string ());
-
- os = this->ctx_->stream ();
-
- // retrieve base type
- bt = be_type::narrow_from_decl (node->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "gen_out_impl - "
- "Bad element type\n"), -1);
- }
-
- // generate the out implementation in the inline file
-
- os->indent (); // start with whatever was our current indent level
-
- *os << "// *************************************************************"
- << be_nl;
- *os << "// Inline operations for class " << fname << be_nl;
- *os << "// *************************************************************\n\n";
-
- // constr from a pointer
- os->indent ();
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::" << lname << " (" << node->name () << " *&p)" << be_nl;
- *os << " : ptr_ (p)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "this->ptr_ = 0;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // constructor from _var &
- os->indent ();
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::" << lname << " (" << node->name () <<
- "_var &p) // constructor from _var" << be_nl;
- *os << " : ptr_ (p.out ())" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "delete this->ptr_;" << be_nl;
- *os << "this->ptr_ = 0;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // copy constructor
- os->indent ();
- *os << "ACE_INLINE" << be_nl;
- *os << fname << "::" << lname << " (const " << fname <<
- " &p) // copy constructor" << be_nl;
- *os << " : ptr_ (ACE_const_cast (" << fname
- << "&,p).ptr_)" << be_nl;
- *os << "{}\n\n";
-
- // assignment operator from _out &
- os->indent ();
- *os << "ACE_INLINE " << fname << " &" << be_nl;
- *os << fname << "::operator= (const " << fname <<
- " &p)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "this->ptr_ = ACE_const_cast (" << fname
- << "&,p).ptr_;" << be_nl;
- *os << "return *this;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // assignment from _var is not allowed by a private declaration
-
- // assignment operator from pointer
- os->indent ();
- *os << "ACE_INLINE " << fname << " &" << be_nl;
- *os << fname << "::operator= (" << node->name () <<
- " *p)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "this->ptr_ = p;" << be_nl;
- *os << "return *this;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // other extra methods - cast operator ()
- os->indent ();
- *os << "ACE_INLINE " << be_nl;
- *os << fname << "::operator " << node->name () <<
- " *&() // cast" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "return this->ptr_;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // ptr function
- os->indent ();
- *os << "ACE_INLINE " << node->name () << " *&" << be_nl;
- *os << fname << "::ptr (void) // ptr" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "return this->ptr_;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // operator ->
- os->indent ();
- *os << "ACE_INLINE " << node->name () << " *" << be_nl;
- *os << fname << "::operator-> (void)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "return this->ptr_;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // sequence has an additional method
- os->indent ();
- *os << "ACE_INLINE ";
-
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQELEM_RETTYPE_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "gen_out_impl - "
- "Bad visitor\n"), -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ci::"
- "gen_out_impl - "
- "[] ret type gen failed\n"),
- -1);
- }
- delete visitor;
-
- *os << be_nl;
- *os << fname << "::operator[] (CORBA::ULong index)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- *os << "return this->ptr_->operator[] (index);\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- return 0;
-}
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 d74ffea45d1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp
+++ /dev/null
@@ -1,385 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// sequence_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Sequences in the client stubs file
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_sequence.h"
-
-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)
-{
-}
-
-// XXXASG - this method is same as that in the _ch visitor. So we need some
-// abstraction for this
-
-int
-be_visitor_sequence_cs::gen_base_sequence_class (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "gen_base_sequence_class - "
- "Bad element type\n"), -1);
- }
-
- os->gen_ifdef_AHETI();
-
- // this is the instantiation branch
- *os << node->instance_name ();
-
- os->gen_else_AHETI();
-
- // generate the appropriate sequence type
- switch (node->managed_type ())
- {
- case be_sequence::MNG_OBJREF:
- if (node->unbounded ())
- *os << "TAO_Unbounded_Object_Sequence<";
- else
- *os << "TAO_Bounded_Object_Sequence<";
- break;
- case be_sequence::MNG_PSEUDO:
- if (node->unbounded ())
- *os << "TAO_Unbounded_Pseudo_Sequence<";
- else
- *os << "TAO_Bounded_Pseudo_Sequence<";
- break;
- case be_sequence::MNG_STRING:
- if (node->unbounded ())
- *os << "TAO_Unbounded_String_Sequence";
- else
- *os << "TAO_Bounded_String_Sequence";
- break;
- default: // not a managed type
- if (node->unbounded ())
- *os << "TAO_Unbounded_Sequence<";
- else
- *os << "TAO_Bounded_Sequence<";
- break;
- }
-
- be_visitor_context *ctx;
- ACE_NEW_RETURN (ctx,
- be_visitor_context (*this->ctx_),
- 0);
- be_visitor_sequence_base_template_args visitor (ctx,node);
- ctx->state (TAO_CodeGen::TAO_SEQUENCE_BASE_CS);
- //be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (bt->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
- //delete visitor;
-
- // find out if the sequence is of a managed type and if it is bounded or not
- if (node->managed_type () == be_sequence::MNG_STRING)
- {
- if (!node->unbounded ())
- {
- *os << "<" << node->max_size () << ">";
- }
- }
- else
- {
- if (node->unbounded ())
- {
- *os << ">";
- }
- else
- {
- *os << ", " << node->max_size () << ">";
- }
- }
-
- os->gen_endif_AHETI();
-
- return 0;
-}
-
-int be_visitor_sequence_cs::visit_sequence (be_sequence *node)
-{
- // generate the constructors
- be_type *bt; // type node
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (node->cli_stub_gen () || node->imported ())
- return 0;
-
- // instantiation
-
- if (this->instantiate_sequence (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_ch::"
- "visit_sequence - "
- "codegen. for the primitive type sequence\n"), -1);
- }
-
- // end of instantiation
-
- // generate the ifdefined macro for the sequence type
- os->gen_ifdef_macro (node->flatname ());
-
- os->indent (); // start with the current indentation level
-
- // 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)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "Bad element type\n"), -1);
- }
-
- *os << "// *************************************************************"
- << be_nl
- << "// " << node->name () << be_nl
- << "// *************************************************************"
- << be_nl << be_nl;
-
- // default constructor
- *os << node->name () << "::" << node->local_name () << " (void)" << be_nl
- << "{}" << be_nl;
-
- // for unbounded sequences, we have a different set of constructors
- if (node->unbounded ())
- {
- *os << node->name () << "::" << node->local_name ()
- << " (CORBA::ULong max) // uses max size" << be_nl
- << " : ";
-
- // pass it to the base constructor
- if (this->gen_base_sequence_class (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "codegen for base sequence class\n"), -1);
- }
-
-
- *os << " (max)" << be_nl
- << "{}" << be_nl;
- }
-
- // constructor with the buffer
- *os << node->name () << "::" << node->local_name () << " (";
- if (node->unbounded ())
- {
- *os << "CORBA::ULong max, "; // unbounded seq takes this extra parameter
- }
- *os << "CORBA::ULong length, ";
- // generate the base type for the buffer
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "Bad visitor\n"), -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "base type visit failed\n"),
- -1);
- }
- delete visitor;
- *os << " *buffer, CORBA::Boolean release)" << be_nl
- << " : ";
- // pass it to the base constructor
- if (this->gen_base_sequence_class (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "codegen for base sequence class\n"), -1);
- }
- *os << " (";
- if (node->unbounded ())
- {
- *os << "max, ";
- }
- *os << "length, buffer, release)" << be_nl
- << "{}" << be_nl;
-
- // copy constructor
- *os << node->name () << "::" << node->local_name ()
- << " (const " << node->local_name ()
- << " &seq) // copy ctor" << be_nl
- << " : ";
- // pass it to the base constructor
- if (this->gen_base_sequence_class (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "codegen for base sequence class\n"), -1);
- }
- *os << " (seq)" << be_nl
- << "{}" << be_nl;
-
- // destructor
- *os << node->name () << "::~" << node->local_name ()
- << " (void) // dtor" << be_nl
- << "{}\n\n";
-
-#if 0
- if (!this->ctx_->tdef ())
- {
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DEFN);
- ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "visit_sequence - "
- "TypeCode definition failed\n"
- ), -1);
- }
- }
-#endif
-
- os->gen_endif ();
- node->cli_stub_gen (1);
-
- return 0;
-}
-
-int
-be_visitor_sequence_cs::instantiate_sequence (be_sequence *node)
-{
- be_type *bt;
-
- bt = be_type::narrow_from_decl (node->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_sequence_cs::"
- "gen_instantiate_template_name - "
- "Bad element type\n"), -1);
- }
-
- // generate the appropriate sequence type
- switch (node->managed_type ())
- {
- case be_sequence::MNG_PSEUDO:
- case be_sequence::MNG_OBJREF:
- if (node->unbounded ())
- this->gen_unbounded_obj_sequence (node);
- else
- this->gen_bounded_obj_sequence (node);
- break;
- case be_sequence::MNG_STRING: // sequence of strings
- if (!node->unbounded ())
- this->gen_bounded_str_sequence (node);
- // else
- // inheriting from the right class is enough
- break;
- default: // not a managed type
- if (node->unbounded ())
- {
-#if 1
- // 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 ());
- }
- }
- if (predef != 0)
- {
- if (predef->pt() != AST_PredefinedType::PT_octet)
- this->gen_unbounded_sequence (node);
- }
- else
- this->gen_unbounded_sequence (node);
-#else
- // @@ This needs to be fixed. (Michael)
- be_predefined_type * bpt =
- be_predefined_type::narrow_from_decl (node->base_type());
- if (bpt)
- {
- if (bpt->pt() != AST_PredefinedType::PT_octet)
- this->gen_unbounded_sequence (node);
- }
- else
- this->gen_unbounded_sequence (node);
-#endif
- }
- else
- this->gen_bounded_sequence (node);
- break;
- }
-
- 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 53305f2da63..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_structure.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Structure
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_structure.h"
-
-// include all the individual files
-#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_ci.cpp"
-#include "be_visitor_structure/cdr_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 34b3f3210d3..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/any_op_ch.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for structures
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_structure.h"
-
-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 ();
-
- // generate the Any <<= and >>= operator declarations
- os->indent ();
- *os << "void " << idl_global->export_macro ()
- << " operator<<= (CORBA::Any &, const " << node->name ()
- << " &); // copying version" << be_nl;
- *os << "void " << idl_global->export_macro ()
- << " operator<<= (CORBA::Any &, " << node->name ()
- << "*); // noncopying version" << be_nl;
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator>>= (const CORBA::Any &, "
- << node->name () << " *&);\n";
-
-
- // 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; // field's type
-
- // 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;
-}
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 8bc890ea686..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for structures
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_structure.h"
-
-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 ();
-
- // generate the Any <<= and >>= operator declarations
- // Any <<= and >>= operators
- os->indent ();
- *os << "void operator<<= (CORBA::Any &_tao_any, const "
- << node->name () << " &_tao_elem) // copying" << be_nl
- << "{" << be_idt_nl
- << node->name () << " *_any_val;" << be_nl
- << "ACE_NEW (_any_val, " << node->name () << " (_tao_elem));" << be_nl
- << "if (!_any_val) return;" << be_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "_tao_any.replace (" << node->tc_name ()
- << ", _any_val, 1, ACE_TRY_ENV);" << " // copy the value" << be_nl
- << "ACE_TRY_CHECK;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY" << be_nl
- << "{" << be_idt_nl
- << "delete _any_val;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_ENDTRY;" << be_uidt_nl
- << "}\n" << be_nl;
-
- *os << "void operator<<= (CORBA::Any &_tao_any, "
- << node->name () << " *_tao_elem) // non copying" << be_nl
- << "{" << be_idt_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "_tao_any.replace (" << node->tc_name () << ", "
- << "_tao_elem, 1, ACE_TRY_ENV); // consume it" << be_nl
- << "ACE_TRY_CHECK;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY {}" << be_nl
- << "ACE_ENDTRY;" << be_uidt_nl
- << "}\n" << be_nl;
-
- *os << "CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, "
- << node->name () << " *&_tao_elem)" << be_nl
- << "{" << be_idt_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "CORBA::TypeCode_var type = _tao_any.type ();" << be_nl
- << "if (!type->equal (" << node->tc_name ()
- << ", ACE_TRY_ENV)) return 0; // not equal" << be_nl
- << "ACE_TRY_CHECK;" << be_nl
- << "if (_tao_any.any_owns_data ())" << be_nl
- << "{" << be_idt_nl
- << "_tao_elem = (" << node->name () << " *)_tao_any.value ();"
- << be_nl
- << "return 1;" << be_nl
- << "}" << be_uidt_nl
- << "else" << be_nl // else any does not own the data
- << "{" << be_idt_nl
- << "ACE_NEW_RETURN (_tao_elem, " << node->name () << ", 0);"
- << be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());"
- << be_nl
- << "if (stream.decode (" << node->tc_name ()
- << ", _tao_elem, 0, ACE_TRY_ENV)" << be_nl
- << " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
- << "{" << be_idt_nl
- << "((CORBA::Any *)&_tao_any)->replace ("
- << node->tc_name () << ", _tao_elem, 1, ACE_TRY_ENV);" << be_nl
- << "ACE_TRY_CHECK;" << be_nl
- << "return 1;" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_nl
- << "{" << be_idt_nl
- << "delete _tao_elem;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY" << be_nl
- << "{" << be_idt_nl
- << "delete _tao_elem;" << be_nl
- << "return 0; " << be_uidt_nl
- << "}" << be_nl
- << "ACE_ENDTRY;" << be_nl
- << "return 0;" << be_uidt_nl
- << "}\n\n";
-
-
- // 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)
-{
- be_type *bt; // field's type
-
- // 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_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;
-}
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 a5313415f80..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ch.cpp
+++ /dev/null
@@ -1,76 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_structure.h"
-
-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 ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // generate the CDR << and >> operator declarations
- os->indent ();
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator<< (TAO_OutputCDR &, const " << node->name ()
- << " &);" << be_nl;
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator>> (TAO_InputCDR &, "
- << node->name () << " &);\n";
-
-
- // set the substate as generating code for the types defined in our scope
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
- // 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_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_ci.cpp b/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ci.cpp
deleted file mode 100644
index b3fc996b4cd..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ci.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for structures
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_structure.h"
-#include "be_visitor_field.h"
-
-ACE_RCSID(be_visitor_structure, cdr_op_ci, "$Id$")
-
-// ***************************************************************************
-// Structure visitor for generating CDR operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_structure_cdr_op_ci::be_visitor_structure_cdr_op_ci
-(be_visitor_context *ctx)
- : be_visitor_structure (ctx)
-{
-}
-
-be_visitor_structure_cdr_op_ci::~be_visitor_structure_cdr_op_ci (void)
-{
-}
-
-int
-be_visitor_structure_cdr_op_ci::visit_structure (be_structure *node)
-{
- // already generated and/or we are imported. Don't do anything.
- if (node->cli_inline_cdr_op_gen () || node->imported ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // First generate code for our children. The reason we do this first is
- // because the inlined code for our children must be available before we use
- // it in our parent
-
- // set the substate as generating code for the types defined in our scope
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
- // 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_cdr_op_ci"
- "::visit_structure - "
- "codegen for scope failed\n"), -1);
- }
-
- // set the sub state as generating code for the output operator
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT);
- *os << "ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, "
- << "const " << node->name () << " &_tao_aggregate)" << be_nl
- << "{" << be_idt_nl;
-
- {
- be_visitor_context* new_ctx =
- new be_visitor_context (*this->ctx_);
- be_visitor_cdr_op_field_decl field_decl (new_ctx);
- field_decl.visit_scope (node);
- }
- *os << "if (" << be_idt_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_cdr_op_ci::"
- "visit_structure - "
- "codegen for scope failed\n"), -1);
- }
- *os << be_uidt_nl << ")"
- << be_idt_nl
- << "return 1;" << be_uidt_nl
- << "else" << be_idt_nl
- << "return 0;" << be_uidt_nl << be_uidt_nl
- << "}\n\n";
-
- // set the substate as generating code for the input operator
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT);
- *os << "ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, "
- << node->name () << " &_tao_aggregate)" << be_nl
- << "{" << be_idt_nl;
-
- {
- be_visitor_context* new_ctx =
- new be_visitor_context (*this->ctx_);
- be_visitor_cdr_op_field_decl field_decl (new_ctx);
- field_decl.visit_scope (node);
- }
- *os << "if (" << be_idt_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_cdr_op_ci"
- "::visit_structure - "
- "codegen for scope failed\n"), -1);
- }
- *os << be_uidt_nl << ")"
- << be_idt_nl
- << "return 1;" << be_uidt_nl
- << "else" << be_idt_nl
- << "return 0;" << be_uidt_nl << be_uidt_nl
- << "}\n\n";
-
- node->cli_inline_cdr_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_structure_cdr_op_ci::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/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp
deleted file mode 100644
index 6c7c0174899..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for structures
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_structure.h"
-#include "be_visitor_field.h"
-
-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 ())
- return 0;
-
- // set the substate as generating code for the types defined in our scope
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
- // 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_cdr_op_cs::"
- "visit_structure - "
- "codegen for scope failed\n"), -1);
- }
-
-
- node->cli_stub_cdr_op_gen (1);
- 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 518345c6d28..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/structure.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// structure.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Structures. This is a generic visitor.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_structure.h"
-
-ACE_RCSID(be_visitor_structure, structure, "$Id$")
-
-
-// generic struct visitor
-be_visitor_structure::be_visitor_structure (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_structure::~be_visitor_structure (void)
-{
-}
-
-// visit the Structure node and its scope
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_STRUCT_CH:
- ctx.state (TAO_CodeGen::TAO_FIELD_CH);
- break;
- case TAO_CodeGen::TAO_STRUCT_CI:
- ctx.state (TAO_CodeGen::TAO_FIELD_CI);
- break;
- case TAO_CodeGen::TAO_STRUCT_CS:
- ctx.state (TAO_CodeGen::TAO_FIELD_CS);
- break;
- case TAO_CodeGen::TAO_STRUCT_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_FIELD_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_STRUCT_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_FIELD_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_STRUCT_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_FIELD_CDR_OP_CS);
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure::"
- "visit_field - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure::"
- "visit_field - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure::"
- "visit_field - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- 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 f9ce9cb68e2..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/structure_ch.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// structure_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Structure in the client header.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_structure.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
-
- if (!node->cli_hdr_gen () && !node->imported ()) // not already generated and
- // not imported
- {
- os = this->ctx_->stream ();
-
- os->indent (); // start from whatever indentation level we were at
- *os << "struct " << idl_global->export_macro () << " "
- << node->local_name () << be_nl
- << "{" << be_idt << "\n";
-
- // 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->decr_indent ();
- *os << "};\n\n";
-
- // generate var defn
- if (node->gen_var_defn () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_ch::"
- "visit_structure - "
- "codegen for _var failed\n"), -1);
- }
-
- // a class is generated for an out defn only for a variable length struct
- if (node->size_type () == be_decl::VARIABLE)
- {
- if (node->gen_out_defn () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_ch::"
- "visit_structure - "
- "codegen for _out failed\n"), -1);
- }
- }
- else
- {
- os->indent ();
- *os << "typedef " << node->local_name () << " &" << node->local_name
- () << "_out;\n\n";
- }
-
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- be_visitor *visitor;
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DECL);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (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 (I_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 8271008eb2b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/structure_ci.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// structure_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Structure in the inline file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_structure.h"
-
-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 ())
- {
- if (node->gen_var_impl () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_ci::"
- "visit_structure - "
- "codegen for _var failed\n"), -1);
- }
- if (node->size_type () == be_decl::VARIABLE &&
- node->gen_out_impl () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_ci::"
- "visit_structure - "
- "codegen for _out failed\n"), -1);
- }
- // 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 (I_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 830b5a7a0a3..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// structure_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Structures in the client stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_structure.h"
-
-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)
-{
-}
-
-// visit the Structure_Cs node and its scope
-int be_visitor_structure_cs::visit_structure (be_structure *node)
-{
- if (!node->cli_stub_gen () && !node->imported ())
- {
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- be_visitor *visitor;
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DEFN);
- ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure_cs::"
- "visit_structure - "
- "TypeCode definition failed\n"
- ), -1);
- }
-
-
- // 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 (I_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 5012a6f795b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typecode.cpp
+++ /dev/null
@@ -1,41 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_typecode.h"
-
-// include all the individual files
-#include "be_visitor_typecode/typecode_decl.cpp"
-#include "be_visitor_typecode/typecode_defn.cpp"
-
-ACE_RCSID(be, be_visitor_typecode, "$Id$")
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Node<be_visitor_typecode_defn::QNode*>;
-template class ACE_Unbounded_Queue<be_visitor_typecode_defn::QNode*>;
-template class ACE_Unbounded_Queue_Iterator<be_visitor_typecode_defn::QNode*>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate ACE_Node<be_visitor_typecode_defn::QNode*>
-#pragma instantiate ACE_Unbounded_Queue<be_visitor_typecode_defn::QNode*>
-#pragma instantiate ACE_Unbounded_Queue_Iterator<be_visitor_typecode_defn::QNode*>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
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 90db4fab104..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// typecode_decl.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for TypeCode declaration for a type
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_typecode.h"
-
-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)
-{
-}
-
-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 ();
-
- // Generate the typecode decl.
- const char *prefix = 0;
- const char *postfix = 0;
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DECL)
- {
- prefix = "AMI_";
- postfix = "_Handler";
- }
-
- if (node->is_nested ())
- {
- // we have a scoped name
- os->indent ();
- // 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 << "TAO_NAMESPACE_STORAGE_CLASS ";
- else
- *os << "static ";
- *os << "CORBA::TypeCode_ptr "
- << node->tc_name (prefix, postfix)->last_component () << ";\n\n";
- }
- else
- {
- // we are in the ROOT scope
- os->indent ();
- *os << "extern " << idl_global->export_macro () << " CORBA::TypeCode_ptr "
- << " " << node->tc_name (prefix, postfix)->last_component () << ";\n\n";
- }
- 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_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);
-}
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 79fd133600f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp
+++ /dev/null
@@ -1,3161 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// typecode_defn.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for TypeCode definitions for types.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_typecode.h"
-
-ACE_RCSID(be_visitor_typecode, typecode_defn, "$Id$")
-
-
-// ******************************************************
-// TypeCode Definitions
-// ******************************************************
-
-be_visitor_typecode_defn::be_visitor_typecode_defn (be_visitor_context *ctx)
- : be_visitor_scope (ctx),
- computed_tc_size_ (0),
- computed_encap_len_ (0),
- computed_scope_encap_len_ (0),
- tc_offset_ (0),
- index_ (-1)
-
-{
-}
-
-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 with the most bizarre behavior of
-// MSVC++ compiler
-int
-be_visitor_typecode_defn::gen_nested_namespace_begin (be_module *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- UTL_IdListActiveIterator *i;
-
- i = new UTL_IdListActiveIterator (node->name ());
- while (!(i->is_done ()))
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- {
- // leave the outermost root scope
- *os << "TAO_NAMESPACE_BEGIN (" << i->item ()->get_string ()
- << ")" << be_nl;
- }
- i->next ();
- }
- delete i;
- return 0;
-}
-
-// the following needs to be done to deal with the most bizarre behavior of
-// MSVC++ compiler
-int
-be_visitor_typecode_defn::gen_nested_namespace_end (be_module *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- UTL_IdListActiveIterator *i;
-
- i = new UTL_IdListActiveIterator (node->name ());
- while (!(i->is_done ()))
- {
- if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0)
- {
- // leave the outermost root scope
- *os << "TAO_NAMESPACE_END" << be_nl;
- }
- i->next ();
- }
- delete i;
- return 0;
-}
-
-// the visit methods will be called for the top-level node whose typecode is
-// being generated
-
-int
-be_visitor_typecode_defn::visit_type (be_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // reset the queue
- this->queue_reset (this->tc_queue_);
- this->tc_offset_ = 0;
-
- // check if optimized typecodes are desired OR if the node is involved in
- // some form of recursion
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- os->indent (); // start from current indentation level
-
- // Generate the typecode information here
- *os << "static const CORBA::Long _oc_";
-
- // Flat name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << node->compute_flatname ("AMI_", "_Handler");
- else
- *os << node->flatname ();
-
- *os << "[] =" << be_nl;
- *os << "{" << be_idt << "\n";
-
- // Add the sizeof the enum tk_* and the encap length that we do not put into
- // this array but which will exist in the CDR buffer.
-
- this->tc_offset_ = 4 + 4;
-
- // Note that we just need the parameters here and hence we generate the
- // encapsulation for the parameters.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- this->ctx_->sub_state (TAO_CodeGen::TAO_AMI_HANDLER_TC_DEFN_ENCAPSULATION);
- else
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
-
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "codegen for typecode encapsulation failed\n"),
- -1);
- }
- *os << be_uidt << "};" << be_nl;
-
- // Type code definition.
- *os << "static CORBA::TypeCode _tc_TAO_tc_";
-
- // Flat name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << node->compute_flatname ("AMI_", "_Handler");
- else
- *os << node->flatname ();
-
- *os << " (";
-
- switch (node->node_type ())
- {
- case AST_Decl::NT_array:
- *os << "CORBA::tk_array";
- break;
- case AST_Decl::NT_enum:
- *os << "CORBA::tk_enum";
- break;
- case AST_Decl::NT_except:
- *os << "CORBA::tk_except";
- break;
- case AST_Decl::NT_interface:
- *os << "CORBA::tk_objref";
- break;
- case AST_Decl::NT_sequence:
- *os << "CORBA::tk_sequence";
- break;
- case AST_Decl::NT_struct:
- *os << "CORBA::tk_struct";
- break;
- case AST_Decl::NT_typedef:
- *os << "CORBA::tk_alias";
- break;
- case AST_Decl::NT_union:
- *os << "CORBA::tk_union";
- break;
- default:
- return -1; // error
- }
-
- *os << ", sizeof (_oc_";
-
- // Flat name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << node->compute_flatname ("AMI_", "_Handler");
- else
- *os << node->flatname ();
-
- *os << "), (char *) &_oc_";
-
- // Flat name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << node->compute_flatname ("AMI_", "_Handler");
- else
- *os << node->flatname ();
-
- // Name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << ", 0, sizeof (" << node->compute_name ("AMI_", "_Handler") << "));" << be_nl;
- else
- *os << ", 0, sizeof (" << node->name () << "));" << be_nl;
-
- // 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)
- {
- *os << "TAO_NAMESPACE_TYPE (CORBA::TypeCode_ptr)" << be_nl;
- be_module *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::visit_type - "
- "Error parsing nested name\n"),
- -1);
- }
- *os << "TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_";
-
- // Local name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << "AMI_" << node->local_name () << "_Handler";
- else
- *os << node->local_name ();
-
- *os << ", &_tc_TAO_tc_";
-
- // Flat name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << node->compute_flatname ("AMI_", "_Handler");
- else
- *os << node->flatname ();
-
- *os << ")" << be_nl;
-
- if (this->gen_nested_namespace_end (module) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_typecode_defn::visit_type - "
- "Error parsing nested name\n"),
- -1);
- }
- }
- else
- {
- // outermost scope.
- *os << "CORBA::TypeCode_ptr ";
-
- // Tc name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << node->tc_name ("AMI_", "_Handler");
- else
- *os << node->tc_name ();
-
- *os << " = &_tc_TAO_tc_";
-
- // Flat name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << node->compute_flatname ("AMI_", "_Handler");
- else
- *os << node->flatname ();
-
- *os << ";\n\n";
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::visit_array (be_array *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_enum (be_enum *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- return this->visit_scope (node);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_enum_val (be_enum_val *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_exception (be_exception *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- return this->visit_scope (node);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_field (be_field *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_interface (be_interface *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_AMI_HANDLER_TC_DEFN_TYPECODE:
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
-
- case TAO_CodeGen::TAO_AMI_HANDLER_TC_DEFN_ENCAPSULATION:
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_interface_fwd (be_interface_fwd *)
-{
- // nothing to do
- return 0;
-}
-
-int
-be_visitor_typecode_defn::visit_predefined_type (be_predefined_type *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- // top level typecodes are defined in the CORBA library. If we show up
- // here, then it is an error
- break;
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_sequence (be_sequence *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_string (be_string *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- // top level typecode for string is not permitted. It has to be a
- // typedefed string
- break;
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_structure (be_structure *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- return this->visit_scope (node);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_typedef (be_typedef *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_union (be_union *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
-
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- return this->visit_scope (node);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-int
-be_visitor_typecode_defn::visit_union_branch (be_union_branch *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("visit - bad sub state ")
- ASYS_TEXT ("in visitor context\n")),
- -1);
-}
-
-// methods that actually produce the typecode and the encapsulations
-
-
-int
-be_visitor_typecode_defn::gen_typecode (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // we do not do typecode optimization for anonymous arrays
-
- *os << "CORBA::tk_array, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (array) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ASYS_TEXT ("gen_typecode - ")
- ASYS_TEXT ("gen_encapsulation failed for array\n")),
- -1);
- }
-
- *os << be_uidt << "\n";
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_type *bt; // base type
- unsigned long i;
-
- os->indent (); // start from the current indentation level
-
- // retrieve the base type
- bt = be_type::narrow_from_decl (node->base_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_array::gen_encapsulation - "
- "bad base type\n"),
- -1);
- }
-
- // compute the typecode size
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE);
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_encapsulation (array) - ")
- ASYS_TEXT ("Failed to get typecode size\n")),
- -1);
- }
-
- for (i = 0; i < (node->n_dims () - 1); i++)
- {
- unsigned long rem_encap_len;
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- *os << "CORBA::tk_array, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- rem_encap_len
- = (node->n_dims () - (i + 1)) * (4 + 4)
- + (node->n_dims () - (i + 2)) * (4 + 4)
- + this->computed_tc_size_;
- *os << rem_encap_len << ", // encapsulation length" << be_idt_nl;
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
-
- // now generate the typecode of the base type
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order\n";
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED);
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_array::gen_encapsulation - "
- "base type typecode gen failed\n"),
- -1);
- }
-
- os->indent ();
- // now reduce the indentation appropriately
- for (i = (node->n_dims () - 1); i > 0; i--)
- {
- *os << node->dims ()[i] << "," << be_uidt_nl;
- // size of the dimension which is a 4 byte quantity
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- *os << node->dims ()[0] << ",\n";
- // size of the dimension which is a 4 byte quantity
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
- if (qnode)
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
- {
- if (idl_global->opt_tc ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- *os << "CORBA::tk_enum, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (enum) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect computation of other
- // nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (enum) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
-
- *os << be_uidt << "\n";
-
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate repoID
- this->gen_repoID (node);
-
- // generate name
- os->indent ();
- this->gen_name (node);
-
- // generate the member count
- os->indent ();
- *os << node->member_count () << ", // member count\n";
- // size of the member length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // hand over to the scope to generate the typecode for elements
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_encapsulation (enum) - ")
- ASYS_TEXT ("cannot generate typecode for members\n")),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_enum_val *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // generate name
- this->gen_name (node);
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_exception *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
- if (qnode)
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- *os << "CORBA::tk_except, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (exception) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect computation of other
- // nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (exception) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
-
- *os << be_uidt << "\n";
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_exception *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate repoID
- this->gen_repoID (node);
-
- // generate name
- os->indent ();
- this->gen_name (node);
-
- // generate the member count
- os->indent ();
- *os << node->member_count () << ", // member count\n";
- // size of the member count
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // hand over to the scope to generate the typecode for elements
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_encapsulation (exception) - ")
- ASYS_TEXT ("cannot generate typecode for members\n")),
- -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_field *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_type *bt; // our type node
-
- os->indent (); // start from whatever indentation level we were at
-
- // generate name
- this->gen_name (node);
-
- // hand over code generation to our type node
- bt = be_type::narrow_from_decl (node->field_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_encapsulation (field) - ")
- ASYS_TEXT ("failed to generate typecode\n")),
- -1);
- }
- // revert the state to what it was before because we may be dealing with
- // subsequent fields for which we have to be in the "gen scope"
- // substate
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE);
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
- if (qnode)
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- *os << "CORBA::tk_objref, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (interface) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect computation of other
- // nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (interface) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
- *os << be_uidt << "\n";
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate repoID.
- this->gen_repoID (node);
-
- // generate name.
- os->indent ();
- this->gen_name (node);
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_interface_fwd *)
-{
- // nothing to do here
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_interface_fwd *)
-{
- // nothing to be done
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from the current indentation level
-
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_void:
- *os << "CORBA::tk_void,\n\n";
- break;
- case AST_PredefinedType::PT_short:
- *os << "CORBA::tk_short,\n\n";
- break;
- case AST_PredefinedType::PT_ushort:
- *os << "CORBA::tk_ushort,\n\n";
- break;
- case AST_PredefinedType::PT_long:
- *os << "CORBA::tk_long,\n\n";
- break;
- case AST_PredefinedType::PT_ulong:
- *os << "CORBA::tk_ulong,\n\n";
- break;
- case AST_PredefinedType::PT_longlong:
- *os << "CORBA::tk_longlong,\n\n";
- break;
- case AST_PredefinedType::PT_ulonglong:
- *os << "CORBA::tk_ulonglong,\n\n";
- break;
- case AST_PredefinedType::PT_float:
- *os << "CORBA::tk_float,\n\n";
- break;
- case AST_PredefinedType::PT_double:
- *os << "CORBA::tk_double,\n\n";
- break;
- case AST_PredefinedType::PT_longdouble:
- *os << "CORBA::tk_longdouble,\n\n";
- break;
- case AST_PredefinedType::PT_boolean:
- *os << "CORBA::tk_boolean,\n\n";
- break;
- case AST_PredefinedType::PT_char:
- *os << "CORBA::tk_char,\n\n";
- break;
- case AST_PredefinedType::PT_octet:
- *os << "CORBA::tk_octet,\n\n";
- break;
- case AST_PredefinedType::PT_any:
- *os << "CORBA::tk_any,\n\n";
- break;
- case AST_PredefinedType::PT_wchar:
- *os << "CORBA::tk_wchar,\n\n";
- break;
- case AST_PredefinedType::PT_pseudo:
- {
- if (!ACE_OS::strcmp (node->local_name ()->get_string (), "TypeCode"))
- *os << "CORBA::tk_TypeCode,\n\n";
- else
- if (!ACE_OS::strcmp (node->local_name ()->get_string (), "Object"))
- {
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
- if (qnode)
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- *os << "CORBA::tk_objref," << be_nl;
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (predefined) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect
- // computation of other nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_
- << ", // encapsulation length" << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (predefined objref) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
- *os << be_uidt << "\n";
- }
- }
- }
- break;
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_predefined_type *node)
-{
- // this one is valid only for "Object"
- if (!ACE_OS::strcmp (node->local_name ()->get_string (), "Object"))
- {
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate repoID
- this->gen_repoID (node);
-
- // generate name
- os->indent ();
- this->gen_name (node);
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // no typecode optimization for anonymous sequences
-
- *os << "CORBA::tk_sequence, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (sequence) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect computation of other
- // nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (sequence) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
- *os << be_uidt << "\n";
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_type *bt; // base type
-
- os->indent ();
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order\n";
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // emit typecode of element type
- bt = be_type::narrow_from_decl (node->base_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_encapsulation (sequence) - ")
- ASYS_TEXT ("failed to generate typecode\n")),
- -1);
- }
-
- // emit the sequence bounds (0 if unbounded)
- os->indent ();
- *os << node->max_size () << ",\n";
- // size of the bound length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_string *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- // no typecode optimizations for anonymous strings
-
- os->indent (); // start from the current indentation level
- // emit the enumeration
- *os << "CORBA::tk_string, " << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // emit the string bounds (0 if unbounded)
- *os << node->max_size () << ", // string length\n";
- // size of the bounds
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_string *)
-{
- // nothing to be done here
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
- if (qnode)
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- *os << "CORBA::tk_struct, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (struct) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect computation of other
- // nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (structure) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
- *os << be_uidt << "\n";
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate repoID
- this->gen_repoID (node);
-
- // generate name
- os->indent ();
- this->gen_name (node);
-
- // generate the member count
- os->indent ();
- *os << node->member_count () << ", // member count\n";
- // size of the member count
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // hand over to the scope to generate the typecode for elements
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE);
- if (node->accept (this) == -1)
- {
- ACE_ERROR ((LM_ERROR, "be_structure: cannot generate typecode for members\n"));
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_typedef *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
- if (qnode)
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- *os << "CORBA::tk_alias, // typecode kind for typedefs" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (typedef) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect computation of other
- // nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (typedef) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
-
- *os << be_uidt << "\n";
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_typedef *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_type *bt; // base type
-
- os->indent (); // start from whatever indentation level we were at
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate repoID
- this->gen_repoID (node);
-
- // generate name
- os->indent ();
- this->gen_name (node);
-
- // generate typecode for the base type
- bt = be_type::narrow_from_decl (node->base_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_encapsulation (typedef) - ")
- ASYS_TEXT ("failed to generate typecode\n")),
- -1);
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_typecode (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
-
- os->indent (); // start from whatever indentation level we were at
-
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
- if (qnode)
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- *os << "CORBA::tk_union, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // reset the compute queue to set the stage for computing our
- // encapsulation length
- this->queue_reset (this->compute_queue_);
-
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ASYS_TEXT ("gen_typecode (union) - ")
- ASYS_TEXT ("Failed to get encap length\n")),
- -1);
- }
- // reset the compute queue since we must not affect computation of other
- // nodes
- this->queue_reset (this->compute_queue_);
-
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_typecode (union) - ")
- ASYS_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
- *os << be_uidt << "\n";
- }
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_type *discrim;
-
- os->indent (); // start from whatever indentation level we were at
-
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate repoID
- this->gen_repoID (node);
-
- // generate name
- os->indent ();
- this->gen_name (node);
-
- // generate typecode for discriminant
- discrim = be_type::narrow_from_decl (node->disc_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED);
- if (discrim->accept (this) == -1)
- {
- ACE_ERROR ((LM_ERROR, "be_union: cannot generate typecode for discriminant\n"));
- return -1;
- }
-
- // generate the default used flag
- os->indent ();
- *os << node->default_index () << ", // default used index" << be_nl;
- // size of the default index used
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // generate the member count
- *os << node->member_count () << ", // member count\n";
- // size of the member count
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
-
- // hand over to the scope to generate the typecode for elements
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE);
- if (node->accept (this) == -1)
- {
- ACE_ERROR ((LM_ERROR, "be_union: cannot generate code for members\n"));
- return -1;
- }
-
- return 0;
-}
-
-int
-be_visitor_typecode_defn::gen_encapsulation (be_union_branch *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_type *bt; // our type node
-
- be_union *ub = this->ctx_->be_scope_as_union ();
-
- ACE_UINT32 buf[1];
- ACE_OS::memset (buf, 0, sizeof (buf));
-
- for (unsigned long i = 0;
- i < node->label_list_length ();
- ++i)
- {
- os->indent ();
-
- // emit the case label value
- if (node->label (i)->label_kind () == AST_UnionLabel::UL_label)
- {
- AST_Expression *expression = node->label (i)->label_val ();
- AST_Expression::AST_ExprValue *ev = expression->ev ();
- switch (ub->udisc_type ())
- {
- case AST_Expression::EV_char:
- os->print ("ACE_IDL_NCTOHL (0x%02.2x)", (unsigned char)ev->u.cval);
- // size of bool/char aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
- case AST_Expression::EV_bool:
- os->print ("ACE_IDL_NCTOHL (0x%02.2x)", (unsigned char)ev->u.bval);
- // size of bool/char aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
- case AST_Expression::EV_wchar:
- case AST_Expression::EV_short:
- os->print ("ACE_IDL_NSTOHL (0x%04.4x)", (unsigned short)ev->u.sval);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_ushort:
- os->print ("ACE_IDL_NSTOHL (0x%04.4x)", (unsigned short)ev->u.usval);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_long:
- os->print ("0x%08.8x", (unsigned long)ev->u.lval);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_ulong:
- os->print ("0x%08.8x", ev->u.ulval);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_any:
- // enum
- os->print ("0x%08.8x", (unsigned long)ev->u.eval);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_ulonglong:
- case AST_Expression::EV_longlong:
- // unimplemented yet
-
- default:
- ACE_ERROR_RETURN ((LM_DEBUG,
- "be_union_branch: (%N:%l) Label value "
- "type (%d) is invalid\n", ev->et), -1);
- ACE_NOTREACHED (break;)
- }
-
- *os << ", // union case label (evaluated value)" << be_nl;
- }
- else
- {
- // default case
- be_union::DefaultValue dv;
- if (ub->default_value (dv) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode::"
- "gen_encapsulation (union_branch) - "
- "computing default value failed\n"),
- -1);
- }
-
- switch (ub->udisc_type ())
- {
- case AST_Expression::EV_char:
- os->print ("ACE_IDL_NCTOHL (0x%02.2x)", (unsigned char)dv.u.char_val);
- // size of bool/char aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
- case AST_Expression::EV_bool:
- os->print ("ACE_IDL_NCTOHL (0x%02.2x)", (unsigned char)dv.u.bool_val);
- // size of bool/char aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
- case AST_Expression::EV_wchar:
- case AST_Expression::EV_short:
- os->print ("ACE_IDL_NSTOHL (0x%04.4x)", (unsigned short)dv.u.short_val);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_ushort:
- os->print ("ACE_IDL_NSTOHL (0x%04.4x)", (unsigned short)dv.u.ushort_val);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_long:
- os->print ("0x%08.8x", (unsigned long)dv.u.long_val);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_ulong:
- os->print ("0x%08.8x", (unsigned long)dv.u.ulong_val);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_any:
- // enum
- os->print ("0x%08.8x", (unsigned long)dv.u.enum_val);
- // size of short/wchar aligned to 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- break;
-
- case AST_Expression::EV_ulonglong:
- case AST_Expression::EV_longlong:
- // unimplemented yet
-
- default:
- ACE_ERROR_RETURN ((LM_DEBUG,
- "be_union_branch: (%N:%l) Label value "
- "type (%d) is invalid\n", ub->udisc_type ()),
- -1);
- ACE_NOTREACHED (break;)
- }
-
- *os << ", // union default label (evaluated value)" << be_nl;
- }
-
- // emit name
- this->gen_name (node);
-
- // hand over code generation to our type node
- bt = be_type::narrow_from_decl (node->field_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::gen_encapsulation (union_branch) - ")
- ASYS_TEXT ("failed to generate typecode\n")),
- -1);
- }
- } // end of for loop
-
- // revert the state
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE);
- return 0;
-}
-
-
-// = methods for computing typecode and encapsulation sizes
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_array *node)
-{
- // 4 bytes for enumeration, 4 bytes for storing encap length val, followed by the
- // actual encapsulation
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (array) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- return this->computed_tc_size_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_array *node)
-{
- // Suppose "N" is the number of dimensions, then for a N dimensional array,
- // we will have N encapsulations. The innermost encapsulation will hold the
- // typecode of the real base type.
- // Thus, we will have N byte order flags and dimensions, and N-1 tk_array
- // enumerations, encapsulation lengths, and dimensions.
-
- be_type *bt; // base type
-
- bt = be_type::narrow_from_decl (node->base_type ());
-
- ACE_CDR::Long encap_len =
- // N byte order flags and dimensions
- node->n_dims () * (4 + 4)
- +
- // N-1 of tk_array and that many encapsulation lengths
- (node->n_dims () - 1) * (4 + 4);
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (array) - ")
- ASYS_TEXT ("cannot compute tc size for base\n")),
- -1);
- }
-
- this->computed_encap_len_ = encap_len + this->computed_tc_size_;
- return this->computed_encap_len_;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_enum *node)
-{
- // while computing the encapsulation length we must keep in mind the typecode
- // that has gotten generated until this point. Hence, we must first check the
- // "tc_queue" to ensure if are already there somewhere in a previous
- // encapsulation in which case we must count only the bytes for the
- // indirection. If we are not already generated, we must then check if we
- // have already been counted in the current computation or not by checking
- // for our presence in the compute queue. In both cases, we only include the
- // 8 bytes in the computation
- if (this->queue_lookup (this->tc_queue_, node) ||
- this->queue_lookup (this->compute_queue_, node))
- {
- this->computed_tc_size_ = 4 + 4;
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->compute_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "compute_tc_size (enum) - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- // 4 bytes for enumeration, 4 bytes for storing encap length val, followed by the
- // actual encapsulation
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (enum) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- }
- return this->computed_tc_size_;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_enum *node)
-{
- ACE_CDR::Long encap_len;
- encap_len = 4; // holds the byte order flag
-
- encap_len +=
- this->repoID_encap_len (node); // repoID storage
-
- // do the same thing for the local name
- encap_len += this->name_encap_len (node);
-
- encap_len += 4; // to hold the member count
-
- // save the current value of scope len and start with a fresh one for our
- // scope length computation
- if (this->push (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (enum) - ")
- ASYS_TEXT ("push failed\n")),
- -1);
- }
- this->computed_scope_encap_len_ = 0;
-
- // compute encap length for members
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (enum) - ")
- ASYS_TEXT ("cannot compute scope tc size\n")),
- -1);
- }
-
- this->computed_encap_len_ = encap_len + this->computed_scope_encap_len_;
-
- // pop off the previous value of computed_scope_len_
- if (this->pop (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (enum) - ")
- ASYS_TEXT ("pop failed\n")),
- -1);
- }
-
- return this->computed_encap_len_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_enum_val *node)
-{
- this->computed_encap_len_ = this->name_encap_len (node);
- return this->computed_encap_len_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_exception *node)
-{
- // while computing the encapsulation length we must keep in mind the typecode
- // that has gotten generated until this point. Hence, we must first check the
- // "tc_queue" to ensure if are already there somewhere in a previous
- // encapsulation in which case we must count only the bytes for the
- // indirection. If we are not already generated, we must then check if we
- // have already been counted in the current computation or not by checking
- // for our presence in the compute queue. In both cases, we only include the
- // 8 bytes in the computation
- if (this->queue_lookup (this->tc_queue_, node) ||
- this->queue_lookup (this->compute_queue_, node))
- {
- this->computed_tc_size_ = 4 + 4;
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->compute_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "compute_tc_size (exception) - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (array) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- }
- return this->computed_tc_size_;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_exception *node)
-{
- ACE_CDR::Long encap_len;
- encap_len = 4; // holds the byte order flag
-
- encap_len += this->repoID_encap_len (node); // repoID
-
- // do the same thing for the local name
- encap_len += this->name_encap_len (node);
-
- encap_len += 4; // to hold the member count
-
- // save the current value of scope len and start with a fresh one for our
- // scope length computation
- if (this->push (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (exception) - ")
- ASYS_TEXT ("push failed\n")),
- -1);
- }
- this->computed_scope_encap_len_ = 0;
-
- // compute encap length for members
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (exception) - ")
- ASYS_TEXT ("cannot compute scope tc size\n")),
- -1);
- }
-
- this->computed_encap_len_ = encap_len + this->computed_scope_encap_len_;
-
- // pop off the previous value of computed_scope_len_
- if (this->pop (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (exception) - ")
- ASYS_TEXT ("pop failed\n")),
- -1);
- }
-
- return this->computed_encap_len_;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_field *node)
-{
- be_type *bt;
-
- // struct member is represented as the "name" followed by the typecode
-
- ACE_CDR::Long encap_len =
- this->name_encap_len (node); // for name
-
- // add to this, the size of our typecode
- bt = be_type::narrow_from_decl (node->field_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (array) - ")
- ASYS_TEXT ("cannot compute tc size\n")),
- -1);
- }
-
- // note that we must add typecode size of base type
- this->computed_encap_len_ = encap_len + this->computed_tc_size_;
-
- // revert the sub state
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN);
-
- return this->computed_encap_len_;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_interface *node)
-{
- // while computing the encapsulation length we must keep in mind the typecode
- // that has gotten generated until this point. Hence, we must first check the
- // "tc_queue" to ensure if are already there somewhere in a previous
- // encapsulation in which case we must count only the bytes for the
- // indirection. If we are not already generated, we must then check if we
- // have already been counted in the current computation or not by checking
- // for our presence in the compute queue. In both cases, we only include the
- // 8 bytes in the computation
- if (this->queue_lookup (this->tc_queue_, node) ||
- this->queue_lookup (this->compute_queue_, node))
- {
- this->computed_tc_size_ = 4 + 4;
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->compute_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "compute_tc_size (interface) - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (interface) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- }
- return this->computed_tc_size_;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_interface *node)
-{
- this->computed_encap_len_ = 4; // holds the byte order flag
-
- this->computed_encap_len_ +=
- this->repoID_encap_len (node); // for repoID
-
- // do the same thing for the local name
- this->computed_encap_len_ +=
- this->name_encap_len (node);
-
- return this->computed_encap_len_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_interface_fwd *)
-{
- return 0;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_interface_fwd *)
-{
- return 0;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_predefined_type *node)
-{
- if (!ACE_OS::strcmp (node->local_name ()->get_string (),
- "Object")) // not same
- {
- // while computing the encapsulation length we must keep in mind the typecode
- // that has gotten generated until this point. Hence, we must first check the
- // "tc_queue" to ensure if are already there somewhere in a previous
- // encapsulation in which case we must count only the bytes for the
- // indirection. If we are not already generated, we must then check if we
- // have already been counted in the current computation or not by checking
- // for our presence in the compute queue. In both cases, we only include the
- // 8 bytes in the computation
- if (this->queue_lookup (this->tc_queue_, node) ||
- this->queue_lookup (this->compute_queue_, node))
- {
- this->computed_tc_size_ = 4 + 4;
- }
- else
- {
-
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->compute_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "compute_tc_size (predefined type) - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (predefined objref) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- }
- }
- else
- this->computed_tc_size_ = 4;
-
- return this->computed_tc_size_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_predefined_type *node)
-{
- if (!ACE_OS::strcmp (node->local_name ()->get_string (),
- "Object")) // not same
- {
- this->computed_encap_len_ = 4; // holds the byte order flag
-
- this->computed_encap_len_ +=
- this->repoID_encap_len (node); // for repoID
-
- // do the same thing for the local name
- this->computed_encap_len_ +=
- this->name_encap_len (node);
- }
- else
- this->computed_encap_len_ = 0;
-
- return this->computed_encap_len_;
-}
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_sequence *node)
-{
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (sequence) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- return this->computed_tc_size_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_sequence *node)
-{
- be_type *bt; // base type
-
- ACE_CDR::Long encap_len = 4; // holds the byte order flag
-
- // add the encapsulation length of our base type
- bt = be_type::narrow_from_decl (node->base_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (sequence) - ")
- ASYS_TEXT ("cannot compute tc size\n")),
- -1);
- }
-
- this->computed_encap_len_ = encap_len + this->computed_tc_size_;
- this->computed_encap_len_ += 4; // to hold the max size
-
- return this->computed_encap_len_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_string *)
-{
- this->computed_tc_size_ = 4 + 4;
- return this->computed_tc_size_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_string *)
-{
- this->computed_encap_len_ = 0;
- return this->computed_encap_len_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_structure *node)
-{
- // while computing the encapsulation length we must keep in mind the typecode
- // that has gotten generated until this point. Hence, we must first check the
- // "tc_queue" to ensure if are already there somewhere in a previous
- // encapsulation in which case we must count only the bytes for the
- // indirection. If we are not already generated, we must then check if we
- // have already been counted in the current computation or not by checking
- // for our presence in the compute queue. In both cases, we only include the
- // 8 bytes in the computation
- if (this->queue_lookup (this->tc_queue_, node) ||
- this->queue_lookup (this->compute_queue_, node))
- {
- this->computed_tc_size_ = 4 + 4;
- }
- else
- {
-
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->compute_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "compute_tc_size (structure) - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (structure) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- }
- return this->computed_tc_size_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_structure *node)
-{
- ACE_CDR::Long encap_len = 4; // holds the byte order flag
-
- encap_len += this->repoID_encap_len (node); // repoID
-
- // do the same thing for the local name
- encap_len += this->name_encap_len (node);
-
- encap_len += 4; // to hold the member count
-
- // save the current value of scope len and start with a fresh one for our
- // scope length computation
- if (this->push (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (struct) - ")
- ASYS_TEXT ("push failed\n")),
- -1);
- }
- this->computed_scope_encap_len_ = 0;
-
- // compute encap length for members
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (structure) - ")
- ASYS_TEXT ("cannot compute scope tc size\n")),
- -1);
- }
-
- this->computed_encap_len_ = encap_len + this->computed_scope_encap_len_;
-
- // pop off the previous value of computed_scope_len_
- if (this->pop (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (struct) - ")
- ASYS_TEXT ("pop failed\n")),
- -1);
- }
-
- return this->computed_encap_len_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_typedef *node)
-{
- // while computing the encapsulation length we must keep in mind the typecode
- // that has gotten generated until this point. Hence, we must first check the
- // "tc_queue" to ensure if are already there somewhere in a previous
- // encapsulation in which case we must count only the bytes for the
- // indirection. If we are not already generated, we must then check if we
- // have already been counted in the current computation or not by checking
- // for our presence in the compute queue. In both cases, we only include the
- // 8 bytes in the computation
- if (this->queue_lookup (this->tc_queue_, node) ||
- this->queue_lookup (this->compute_queue_, node))
- {
- this->computed_tc_size_ = 4 + 4;
- }
- else
- {
-
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->compute_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "compute_tc_size (typedef) - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (array) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- }
- return this->computed_tc_size_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_typedef *node)
-{
- be_type *bt; // base type
- ACE_CDR::Long encap_len = 4; // holds the byte order flag
-
- encap_len +=
- this->repoID_encap_len (node); // repoID
-
- // do the same thing for the local name
- encap_len +=
- this->name_encap_len (node);
-
- // add the encapsulation length of our base type
- bt = be_type::narrow_from_decl (node->base_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (typedef) - ")
- ASYS_TEXT ("cannot compute tc size\n")),
- -1);
- }
-
- this->computed_encap_len_ = encap_len + this->computed_tc_size_;
- return this->computed_encap_len_;
-
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_tc_size (be_union *node)
-{
- // while computing the encapsulation length we must keep in mind the typecode
- // that has gotten generated until this point. Hence, we must first check the
- // "tc_queue" to ensure if are already there somewhere in a previous
- // encapsulation in which case we must count only the bytes for the
- // indirection. If we are not already generated, we must then check if we
- // have already been counted in the current computation or not by checking
- // for our presence in the compute queue. In both cases, we only include the
- // 8 bytes in the computation
- if (this->queue_lookup (this->tc_queue_, node) ||
- this->queue_lookup (this->compute_queue_, node))
- {
- this->computed_tc_size_ = 4 + 4;
- }
- else
- {
- if (idl_global->opt_tc () ||
- node->in_recursion ())
- {
- if (this->queue_insert (this->compute_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "compute_tc_size (union) - "
- "queue insert failed\n"),
- -1);
- }
- }
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_tc_size (union) - ")
- ASYS_TEXT ("cannot compute encap len\n")),
- -1);
- }
-
- this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_;
- }
- return this->computed_tc_size_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_union *node)
-{
- be_type *discrim;
-
- ACE_CDR::Long encap_len = 4; // holds the byte order flag
-
- encap_len += this->repoID_encap_len (node); // for repoID
-
- // do the same thing for the local name
- encap_len += this->name_encap_len (node); // for name
-
- // add encapsulation size of discriminant typecode
- discrim = be_type::narrow_from_decl (node->disc_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE);
- if (!discrim || discrim->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (union) - ")
- ASYS_TEXT ("cannot compute tc size\n")),
- -1);
- }
-
- encap_len += this->computed_tc_size_;
-
- encap_len += 4; // to hold the "default used" flag
- encap_len += 4; // to hold the member count
-
- // save the current value of scope len and start with a fresh one for our
- // scope length computation
- if (this->push (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (union) - ")
- ASYS_TEXT ("push failed\n")),
- -1);
- }
- this->computed_scope_encap_len_ = 0;
-
- // compute encap length for members
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (union) - ")
- ASYS_TEXT ("cannot compute scope tc size\n")),
- -1);
- }
-
- this->computed_encap_len_ = encap_len + this->computed_scope_encap_len_;
-
- // pop off the previous value of computed_scope_len_
- if (this->pop (this->computed_scope_encap_len_) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (union) - ")
- ASYS_TEXT ("pop failed\n")),
- -1);
- }
-
- return this->computed_encap_len_;
-}
-
-
-ACE_CDR::Long
-be_visitor_typecode_defn::compute_encap_length (be_union_branch *node)
-{
- be_type *bt;
-
- ACE_CDR::Long encap_len = 0;
-
- for (unsigned long i = 0;
- i < node->label_list_length ();
- ++i)
- {
- encap_len += 4; // case label;
- encap_len +=
- this->name_encap_len (node); // for name
-
- bt = be_type::narrow_from_decl (node->field_type ());
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE);
- if (!bt || bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_TEXT ("::compute_encap_len (union branch) - ")
- ASYS_TEXT ("cannot compute tc size\n")),
- -1);
- }
- encap_len += this->computed_tc_size_;
- }
-
- this->computed_encap_len_ = encap_len;
-
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN);
- return this->computed_encap_len_;
-}
-
-// helpers that accomplish a common task - that of generating the repository
-// IDs and names in a TypeCode description
-
-void
-be_visitor_typecode_defn::gen_repoID (be_decl *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
- int flag = 0;
-
- // check if we want to generate optimized typecodes. In such a case, there is
- // no need to generate the repoID (unless we are an object reference or an
- // exception in which case it is mandatory to have the repository ID)
- // generate repoID
-
- if (idl_global->opt_tc ())
- {
- switch (node->node_type ())
- {
- case AST_Decl::NT_interface:
- case AST_Decl::NT_interface_fwd:
- case AST_Decl::NT_except:
- flag = 0;
- break;
- case AST_Decl::NT_pre_defined:
- if (!ACE_OS::strcmp (node->local_name ()->get_string (),
- "Object"))
- flag = 0;
- else
- flag = 1;
- break;
- default:
- flag = 1;
- }
- }
-
- // XXXASG -- there is still some doubts in my mind about whether repoID
- // *must* be supplied or not as per spec 2.3a. So I am not going to allow
- // optimizations here.
- // flag = 0;
-
- if (flag)
- {
- // optimized case
- *os << "1, 0x0,";
- *os << " // repository ID = ";
-
- // repoID generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << node->compute_repoID ("AMI_", "_Handler");
- else
- *os << node->repoID ();
-
- // size of the repoID filed
- this->tc_offset_ += (2 * sizeof (ACE_CDR::ULong));
- }
- else
- {
- // Unoptimized case.
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << (ACE_OS::strlen (node->compute_repoID ("AMI_", "_Handler")) + 1) << ", ";
- else
- *os << (ACE_OS::strlen (node->repoID ()) + 1) << ", ";
-
- ACE_CDR::ULong *arr, i, arrlen;
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- (void) this->tc_name2long (node->compute_repoID ("AMI_", "_Handler"), arr, arrlen);
- else
- (void) this->tc_name2long (node->repoID (), arr, arrlen);
-
- for (i = 0; i < arrlen; i++)
- {
- os->print ("ACE_NTOHL (0x%x), ", arr[i]);
- }
-
- // Comment.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << " // repository ID = " << node->compute_repoID ("AMI_", "_Handler");
- else
- *os << " // repository ID = " << node->repoID ();
-
- // size of the repoID field
- this->tc_offset_ += (arrlen + 1) * sizeof (ACE_CDR::ULong);
- }
- *os << "\n";
- return;
-}
-
-void
-be_visitor_typecode_defn::gen_name (be_decl *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- // @@ AMI code generation should be done for this optimized
- // case. (Alex).
-
- // Generate name.
- if (idl_global->opt_tc ())
- {
- *os << "1, 0x0,";
- *os << " // name = " << node->local_name ();
- // size of the name field
- this->tc_offset_ += (2 * sizeof (ACE_CDR::ULong));
- }
- else
- {
- ACE_CDR::ULong *arr, i, arrlen;
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- {
- *os << (ACE_OS::strlen (node->compute_local_name ("AMI_", "_Handler")->get_string ()) + 1) << ", ";
- (void) this->tc_name2long (node->compute_local_name ("AMI_", "_Handler")->get_string (), arr, arrlen);
- }
- else
- {
- *os << (ACE_OS::strlen (node->local_name ()->get_string ()) + 1) << ", ";
- (void) this->tc_name2long (node->local_name ()->get_string (), arr, arrlen);
- }
-
- for (i = 0; i < arrlen; i++)
- {
- os->print ("ACE_NTOHL (0x%x), ", arr[i]);
- }
-
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << " // name = " << node->compute_local_name ("AMI_", "_Handler");
- else
- *os << " // name = " << node->local_name ();
-
- // size of the name field.
- this->tc_offset_ += (arrlen + 1) * sizeof (ACE_CDR::ULong);
- }
- *os << "\n";
- return;
-}
-
-// return the length in bytes to hold the repoID inside a typecode. This
-// comprises 4 bytes indicating the length of the string followed by the actual
-// string represented as longs.
-ACE_CDR::ULong
-be_visitor_typecode_defn::repoID_encap_len (be_decl *node)
-{
- int flag = 0;
-
- // check if we want to generate optimized typecodes. In such a case, there is
- // no need to generate the repoID (unless we are an object reference or an
- // exception in which case it is mandatory to have the repository ID)
- // generate repoID
-
- if (idl_global->opt_tc ())
- {
- switch (node->node_type ())
- {
- case AST_Decl::NT_interface:
- case AST_Decl::NT_interface_fwd:
- case AST_Decl::NT_except:
- flag = 0;
- break;
- case AST_Decl::NT_pre_defined:
- if (!ACE_OS::strcmp (node->local_name ()->get_string (),
- "Object"))
- flag = 0;
- else
- flag = 1;
- break;
- default:
- flag = 1;
- }
- }
-
- // XXXASG -- there is still some doubts in my mind about whether repoID
- // *must* be supplied or not as per spec 2.3a. So I am not going to allow
- // optimizations here.
- //flag = 0;
-
- if (flag)
- {
- return 4 + 4;
- }
- else
- {
- ACE_CDR::ULong slen = ACE_OS::strlen (node->repoID ()) + 1;
- // + 1 for NULL terminating char
-
- // the number of bytes to hold the string must be a multiple of 4 since this
- // will be represented as an array of longs
- return 4 + 4 * (slen/4 + (slen%4 ? 1:0));
- }
-}
-
-// return the length in bytes to hold the name inside a typecode. This
-// comprises 4 bytes indicating the length of the string followed by the actual
-// string represented as longs.
-ACE_CDR::ULong
-be_visitor_typecode_defn::name_encap_len (be_decl *node)
-{
- if (idl_global->opt_tc ())
- {
- return 4 + 4;
- }
- else
- {
- ACE_CDR::ULong slen =
- ACE_OS::strlen (node->local_name ()->get_string ()) + 1;
-
- // the number of bytes to hold the string must be a multiple of 4 since this
- // will be represented as an array of longs
- return 4 + 4 * (slen/4 + (slen%4 ? 1:0));
- }
-}
-
-// converts a string name into an array of 4 byte longs
-int
-be_visitor_typecode_defn::tc_name2long (const char *name,
- ACE_CDR::ULong *&larr,
- ACE_CDR::ULong &arrlen)
-{
- const int bytes_per_word = sizeof (ACE_CDR::ULong);
- static ACE_CDR::ULong buf [NAMEBUFSIZE];
- ACE_CDR::ULong i, slen;
-
- slen = ACE_OS::strlen (name) + 1; // 1 for NULL terminating
-
- // compute the number of bytes necessary to hold the name rounded to
- // the next multiple of 4 (i.e., size of long)
- arrlen = slen / bytes_per_word + (slen % bytes_per_word ? 1 : 0);
-
- ACE_OS::memset (buf, 0, sizeof (buf));
- larr = buf;
- ACE_OS::memcpy (buf, name, slen);
- for (i = 0; i < arrlen; i++)
- larr [i] = ACE_HTONL (larr [i]);
- return 0;
-}
-
-// 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;
-
- 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,
- ASYS_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ASYS_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->fullname (),
- node->fullname ()))
- {
- // 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;
- (void) queue.dequeue_head (qnode);
- delete qnode;
- }
- return;
-}
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 c9ca1e8818f..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_typedef.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Typedef
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_typedef.h"
-
-// include all the individual files
-#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_ci.cpp"
-#include "be_visitor_typedef/cdr_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 77853097361..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/any_op_ch.cpp
+++ /dev/null
@@ -1,278 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_typedef.h"
-
-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 = be_type::narrow_from_decl (node->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 ()) // 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_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 ()) // 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_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 ()) // 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_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 ()) // 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_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 ()) // 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_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 6d8a868df16..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/any_op_cs.cpp
+++ /dev/null
@@ -1,279 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_typedef.h"
-
-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 62fa413646e..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp
+++ /dev/null
@@ -1,277 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_typedef.h"
-
-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); // reset
- }
-
- 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 ()) // 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_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 ()) // 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_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 ()) // 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_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 ()) // 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_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 ()) // 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_op_ch::"
- "visit_union - "
- "base class visitor failed \n"
- ), -1);
- }
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ci.cpp
deleted file mode 100644
index 7cd0873a76c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ci.cpp
+++ /dev/null
@@ -1,279 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Cdr operators in the client stubs
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_typedef.h"
-
-ACE_RCSID(be_visitor_typedef, cdr_op_ci, "$Id$")
-
-
-// ***************************************************************************
-// Typedef visitor for generating CDR operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_typedef_cdr_op_ci::be_visitor_typedef_cdr_op_ci
-(be_visitor_context *ctx)
- : be_visitor_typedef (ctx)
-{
-}
-
-be_visitor_typedef_cdr_op_ci::~be_visitor_typedef_cdr_op_ci (void)
-{
-}
-
-int
-be_visitor_typedef_cdr_op_ci::visit_typedef (be_typedef *node)
-{
- if (node->cli_inline_cdr_op_gen () || node->imported ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // generate the CDR << and >> operator impls
-
- 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_ci::"
- "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_ci::"
- "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_ci::"
- "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_ci::"
- "visit_typedef - "
- "failed to accept visitor\n"
- ), -1);
- }
-
- this->ctx_->tdef (0); // reset
- }
-
- node->cli_inline_cdr_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_typedef_cdr_op_ci::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_ci::"
- "visit_array - "
- "base class visitor failed \n"
- ), -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_cdr_op_ci::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_cdr_op_ci::"
- "visit_enum - "
- "base class visitor failed \n"
- ), -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_cdr_op_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_cdr_op_ci::"
- "visit_sequence - "
- "base class visitor failed \n"
- ), -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_cdr_op_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_cdr_op_ci::"
- "visit_structure - "
- "base class visitor failed \n"
- ), -1);
- }
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_cdr_op_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_cdr_op_ci::"
- "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 91ab655906d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp
+++ /dev/null
@@ -1,279 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_typedef.h"
-
-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;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // generate the CDR << and >> operator impls
-
- 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_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_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_cdr_op_cs::"
- "visit_enum - "
- "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/typedef.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp
deleted file mode 100644
index 26c232861b3..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp
+++ /dev/null
@@ -1,479 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// typedef.cpp
-//
-// = DESCRIPTION
-// Generic visitor generating code for Typedefs
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_typedef.h"
-
-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)
-{
-}
-
-// visit the Typedef node and its scope
-int be_visitor_typedef::visit_typedef (be_typedef *)
-{
- return -1; // must be overridden
-}
-
-// =all common visit methods for typedef visitor
-
-// visit a array
-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); // set the node to be the node being visited. The scope is
- // still the same
-
-
- // 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_TYPEDEF_CH:
- ctx.state (TAO_CodeGen::TAO_ARRAY_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CS:
- ctx.state (TAO_CodeGen::TAO_ARRAY_CS);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CI:
- ctx.state (TAO_CodeGen::TAO_ARRAY_CI);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_ARRAY_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_ARRAY_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_ARRAY_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_ARRAY_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_ARRAY_CDR_OP_CS);
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_array - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_array - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_array - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-//visit an enum
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_TYPEDEF_CH:
- ctx.state (TAO_CodeGen::TAO_ENUM_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CS:
- ctx.state (TAO_CodeGen::TAO_ENUM_CS);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_ENUM_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_ENUM_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_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);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_enum - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_enum - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit an predefined type
-int
-be_visitor_typedef::visit_predefined_type (be_predefined_type *)
-{
- return 0;
-}
-
-// visit an sequence
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_TYPEDEF_CH:
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CI:
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CI);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CS:
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CS);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CS);
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_sequence - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_sequence - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_sequence - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit an structure
-int
-be_visitor_typedef::visit_string (be_string *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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_TYPEDEF_CH:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CI:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CI);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CS);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH:
- case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS:
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH:
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI:
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_string - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_string - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_string - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- 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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_TYPEDEF_CH:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CI:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CI);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CS);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CS);
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_structure - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_structure - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_structure - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit an union
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_TYPEDEF_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CI:
- ctx.state (TAO_CodeGen::TAO_UNION_CI);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_CS);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CS);
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_union - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_union - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typedef::"
- "visit_union - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- 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 cf754a4db2c..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp
+++ /dev/null
@@ -1,466 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// typedef_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Typedef in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_typedef.h"
-
-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; // 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, 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); // 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_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 ())
- {
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- be_visitor *visitor;
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DECL);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (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); // reset
- }
-
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_typedef *tdef = this->ctx_->tdef (); // typedef node
- be_decl *scope = this->ctx_->scope (); // scope in which it is used
- 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
- if (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_ch::"
- "visit_array - "
- "base class visitor failed \n"
- ), -1);
- }
- }
- else
- {
- // base type is simply an alias to an array node. Simply output the
- // required typedefs
-
- os->indent ();
- // 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, and _forany 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, "_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.
-
- // _alloc
- *os << "ACE_INLINE " << tdef->nested_type_name (scope, "_slice") << " *";
- *os << tdef->nested_type_name (scope, "_alloc") << " (void);" << be_nl;
- // _dup
- *os << "ACE_INLINE " << tdef->nested_type_name (scope, "_slice") << " *";
- *os << tdef->nested_type_name (scope, "_dup") << " (const ";
- *os << tdef->nested_type_name (scope, "_slice") << " *_tao_slice);" << be_nl;
- // _copy
- *os << "ACE_INLINE void " << tdef->nested_type_name (scope, "_copy") << " (";
- *os << tdef->nested_type_name (scope, "_slice") << " *_tao_to, const ";
- *os << tdef->nested_type_name (scope, "_slice") << " *_tao_from);" << be_nl;
- // _free
- *os << "ACE_INLINE void " << tdef->nested_type_name (scope, "_free") << " (";
- *os << tdef->nested_type_name (scope, "_slice") << " *_tao_slice);" << be_nl;
- }
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_typedef *tdef = this->ctx_->tdef (); // typedef node
- be_decl *scope = this->ctx_->scope (); // scope in which it is used
- 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_ch::"
- "visit_enum - "
- "base class visitor failed \n"
- ), -1);
- }
- }
-
- // now generate the typedefs
- os->indent ();
- // 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") << ";" << be_nl;
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_typedef *tdef = this->ctx_->tdef (); // typedef node
- be_decl *scope = this->ctx_->scope (); // scope in which it is used
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- // now generate the typedefs
- os->indent ();
-
- // 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_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_typedef *tdef = this->ctx_->tdef (); // typedef node
- be_decl *scope = this->ctx_->scope (); // scope in which it is used
- be_type *bt;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- // now generate the typedefs
- os->indent ();
- // typedef the type
- *os << "typedef " << bt->nested_type_name (scope)
- << " " << tdef->nested_type_name (scope) << ";" << be_nl;
- if ((node->pt () == AST_PredefinedType::PT_pseudo) ||
- (node->pt () == AST_PredefinedType::PT_any))
- {
- // 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") << ";" << be_nl;
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_typedef *tdef = this->ctx_->tdef (); // typedef node
- be_decl *scope = this->ctx_->scope (); // scope in which it is used
-
- // now generate the typedefs
- os->indent ();
- // typedef the type and the _slice type
- *os << "typedef char *"
- << " " << tdef->nested_type_name (scope) << ";" << be_nl;
- // typedef the _var, _out, and _forany 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") << ";" << be_nl;
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_typedef *tdef = this->ctx_->tdef (); // typedef node
- be_decl *scope = this->ctx_->scope (); // scope in which it is used
- 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_ch::"
- "visit_sequence - "
- "base class visitor failed \n"
- ), -1);
- }
- }
- else
- {
- // now generate the typedefs
- os->indent ();
- // typedef the type
- *os << "typedef " << bt->nested_type_name (scope)
- << " " << tdef->nested_type_name (scope) << ";" << be_nl;
- // typedef the _var, _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") << ";" << be_nl;
- }
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_typedef *tdef = this->ctx_->tdef (); // typedef node
- be_decl *scope = this->ctx_->scope (); // scope in which it is used
- 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_ch::"
- "visit_structure - "
- "base class visitor failed \n"
- ), -1);
- }
- }
-
- // now generate the typedefs
- os->indent ();
- // typedef the type
- *os << "typedef " << bt->nested_type_name (scope)
- << " " << tdef->nested_type_name (scope) << ";" << be_nl;
- // typedef the _var, _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") << ";" << be_nl;
- return 0;
-}
-
-int
-be_visitor_typedef_ch::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
- be_typedef *tdef = this->ctx_->tdef (); // typedef node
- be_decl *scope = this->ctx_->scope (); // scope in which it is used
- 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_ch::"
- "visit_union - "
- "base class visitor failed \n"
- ), -1);
- }
- }
-
- // now generate the typedefs
- os->indent ();
- // typedef the type and the _slice type
- *os << "typedef " << bt->nested_type_name (scope)
- << " " << tdef->nested_type_name (scope) << ";" << be_nl;
- // typedef the _var, _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") << ";" << 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 de9c0463431..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp
+++ /dev/null
@@ -1,275 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// typedef_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Typedefs in the client inline file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_typedef.h"
-
-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;
-
- if (this->ctx_->alias ()) // typedef of a typedef
- bt = this->ctx_->alias ();
- else
- bt = node;
-
- if (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_ci::"
- "visit_array - "
- "base class visitor failed \n"
- ), -1);
- }
- }
- else
- {
- // generate the inline code for alloc, dup, copy, and free methods
-
- // alloc method
- os->indent ();
- *os << "ACE_INLINE " << 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 << "}\n\n";
-
- // dup method
- os->indent ();
- *os << "ACE_INLINE " << tdef->name () << "_slice *" << be_nl;
- *os << tdef->name () << "_dup (const " << tdef->name ()
- << "_slice *_tao_src)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "return " << bt->name () << "_dup (_tao_src);" << be_uidt_nl;
- *os << "}\n\n";
-
- // copy method
- os->indent ();
- *os << "ACE_INLINE void" << be_nl;
- *os << tdef->name () << "_copy (" << tdef->name ()
- << "_slice *_tao_dest, const " << tdef->name ()
- << "_slice *_tao_src)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << bt->name () << "_copy (_tao_dest, _tao_src);" << be_uidt_nl;
- *os << "}\n\n";
-
- // free method
- os->indent ();
- *os << "ACE_INLINE void" << be_nl;
- *os << tdef->name () << "_free (" << tdef->name ()
- << "_slice *_tao_src)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << bt->name () << "_free (_tao_src);" << be_uidt_nl;
- *os << "}\n\n";
- }
- 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 ebecde2e307..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// typedef_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Typedef in the client stubs
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_typedef.h"
-
-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); // 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);
- }
-
- if (!node->imported ())
- {
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- be_visitor *visitor;
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DEFN);
- ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (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 17db8dd01ab..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// be_visitor_union.cpp
-//
-// = DESCRIPTION
-// Visitors for generation of code for Union
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union.h"
-
-// include all the individual files
-#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_ci.cpp"
-#include "be_visitor_union/cdr_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 f743a905db8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/any_op_ch.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for Union.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union.h"
-
-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 ();
-
- // generate the Any <<= and >>= operator declarations
- os->indent ();
- *os << "void " << idl_global->export_macro ()
- << " operator<<= (CORBA::Any &, const " << node->name ()
- << " &); // copying version" << be_nl;
- *os << "void " << idl_global->export_macro ()
- << " operator<<= (CORBA::Any &, " << node->name ()
- << "*); // noncopying version" << be_nl;
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator>>= (const CORBA::Any &, "
- << node->name () << " *&);\n";
-
-
- // 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_hdr_any_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_union_any_op_ch::visit_union_branch (be_union_branch *node)
-{
- be_type *bt; // field's type
-
- // 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_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;
-}
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 8287b104719..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// any_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Any operators for Union.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union.h"
-
-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 ();
-
- // generate the Any <<= and >>= operator declarations
- os->indent ();
- *os << "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
- << node->name () << " *_any_val;" << be_nl
- << "ACE_NEW (_any_val, " << node->name () << " (_tao_elem));"
- << be_nl
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl;
-
- if (this->gen_insertion (os, node) != 0)
- return -1;
-
- *os << "}" << be_nl
- << "ACE_CATCHANY" << be_nl
- << "{" << be_idt_nl
- << "delete _any_val;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_ENDTRY;" << be_uidt_nl
- << "}\n" << be_nl;
-
- *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
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl;
-
- if (this->gen_insertion_nocopy (os, node) != 0)
- return -1;
-
- *os << "}" << be_nl
- << "ACE_CATCHANY {}" << be_nl
- << "ACE_ENDTRY;" << be_uidt_nl
- << "}\n" << 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
- << "ACE_TRY_NEW_ENV" << be_nl
- << "{" << be_idt_nl
- << "CORBA::TypeCode_var type = _tao_any.type ();" << be_nl
- << "if (!type->equal (" << node->tc_name ()
- << ", ACE_TRY_ENV))" << be_idt_nl
- << "return 0;" << be_uidt_nl
- << "ACE_TRY_CHECK;" << be_nl
- << "if (_tao_any.any_owns_data ())" << be_nl
- << "{" << be_idt_nl
- << "_tao_elem = (" << node->name () << " *)_tao_any.value ();"
- << be_nl
- << "return 1;" << be_uidt_nl
- << "}" << be_nl
- << "else" << be_nl // else any does not own the data
- << "{" << be_idt_nl
- << "ACE_NEW_RETURN (_tao_elem, " << node->name () << ", 0);"
- << be_nl
- << "TAO_InputCDR stream (_tao_any._tao_get_cdr ());" << be_nl;
-
- if (this->gen_extraction (os, node) != 0)
- return -1;
-
- *os << be_nl
- << "return 1;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "}" << be_nl
- << "ACE_CATCHANY" << be_nl
- << "{" << be_idt_nl
- << "delete _tao_elem;" << be_uidt_nl
- << "}" << be_nl
- << "ACE_ENDTRY;" << be_nl
- << "return 0;" << be_uidt_nl
- << "}\n\n";
-
-
- // 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; // field's type
-
- // 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_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;
-}
-
-// ****************************************************************
-
-be_visitor_union_any_op_compiled_cs::
-be_visitor_union_any_op_compiled_cs (be_visitor_context *ctx)
- : be_visitor_union_any_op_cs (ctx)
-{
-}
-
-int
-be_visitor_union_any_op_compiled_cs::
-gen_insertion (TAO_OutStream *os,
- be_union *node)
-{
- *os << "TAO_OutputCDR stream;" << be_nl
- << "stream << *_any_val;" << be_nl
- << "_tao_any._tao_replace (" << be_idt << be_idt_nl
- << node->tc_name () << "," << be_nl
- << "stream.begin ()," << be_nl
- << "1," << be_nl
- << "_any_val," << be_nl
- << "ACE_TRY_ENV" << be_uidt_nl
- << ");" << be_uidt_nl
- << "ACE_TRY_CHECK;" << be_uidt_nl;
- return 0;
-}
-
-int
-be_visitor_union_any_op_compiled_cs::
-gen_insertion_nocopy (TAO_OutStream *os,
- be_union *node)
-{
- *os << "TAO_OutputCDR stream;" << be_nl
- << "stream << *_tao_elem;" << be_nl
- << "_tao_any._tao_replace (" << be_idt << be_idt_nl
- << node->tc_name () << "," << be_nl
- << "stream.begin ()," << be_nl
- << "1," << be_nl
- << "_tao_elem," << be_nl
- << "ACE_TRY_ENV" << be_uidt_nl
- << ");" << be_uidt_nl
- << "ACE_TRY_CHECK;" << be_uidt_nl;
- return 0;
-}
-
-int
-be_visitor_union_any_op_compiled_cs::
-gen_extraction (TAO_OutStream *os,
- be_union *node)
-{
- *os << "stream >> *_tao_elem;" << be_nl
- << "((CORBA::Any *)&_tao_any)->_tao_replace (" << be_idt << be_idt_nl
- << node->tc_name () << "," << be_nl
- << "1," << be_nl
- << "ACE_reinterpret_cast(void*,_tao_elem)," << be_nl
- << "ACE_TRY_ENV" << be_uidt_nl
- << ");" << be_uidt_nl
- << "ACE_TRY_CHECK;" << be_nl;
- return 0;
-}
-
-// ****************************************************************
-
-be_visitor_union_any_op_interpretive_cs::
-be_visitor_union_any_op_interpretive_cs (be_visitor_context *ctx)
- : be_visitor_union_any_op_cs (ctx)
-{
-}
-
-int
-be_visitor_union_any_op_interpretive_cs::
-gen_insertion (TAO_OutStream *os,
- be_union *node)
-{
- *os << "_tao_any.replace (" << node->tc_name ()
- << ", _any_val, 1, ACE_TRY_ENV);" << " // copy the value" << be_nl
- << "ACE_TRY_CHECK;" << be_uidt_nl;
- return 0;
-}
-
-int
-be_visitor_union_any_op_interpretive_cs::
-gen_insertion_nocopy (TAO_OutStream *os,
- be_union *node)
-{
- *os << "_tao_any.replace (" << node->tc_name () << ", "
- << "_tao_elem, 1, ACE_TRY_ENV); // consume it" << be_nl
- << "ACE_TRY_CHECK;" << be_uidt_nl;
- return 0;
-}
-
-int
-be_visitor_union_any_op_interpretive_cs::
-gen_extraction (TAO_OutStream *os,
- be_union *node)
-{
- *os << "if (stream.decode (" << node->tc_name ()
- << ", _tao_elem, 0, ACE_TRY_ENV)" << be_nl
- << " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
- << "{" << be_idt_nl
- << "((CORBA::Any *)&_tao_any)->replace ("
- << node->tc_name () << ", _tao_elem, 1, ACE_TRY_ENV);" << be_nl
- << "ACE_TRY_CHECK;" << be_uidt_nl
- << "}";
- 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 01173b46b6d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp
+++ /dev/null
@@ -1,75 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union.h"
-
-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 ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // generate the CDR << and >> operator declarations
- os->indent ();
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator<< (TAO_OutputCDR &, const " << node->name ()
- << " &); // " << be_nl;
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator>> (TAO_InputCDR &, "
- << node->name () << " &);\n";
-
-
- // set the substate as generating code for the types defined in our scope
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
- // 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_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_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp
deleted file mode 100644
index 969d4216d9b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for unions
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union.h"
-
-ACE_RCSID(be_visitor_union, cdr_op_ci, "$Id$")
-
-// ***************************************************************************
-// Union visitor for generating CDR operator declarations in the client
-// stubs file
-// ***************************************************************************
-
-be_visitor_union_cdr_op_ci::be_visitor_union_cdr_op_ci
-(be_visitor_context *ctx)
- : be_visitor_union (ctx)
-{
-}
-
-be_visitor_union_cdr_op_ci::~be_visitor_union_cdr_op_ci (void)
-{
-}
-
-int
-be_visitor_union_cdr_op_ci::visit_union (be_union *node)
-{
- // already generated and/or we are imported. Don't do anything.
- if (node->cli_inline_cdr_op_gen () || node->imported ())
- return 0;
-
- // set the substate as generating code for the types defined in our scope
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
- // 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_cdr_op_ci"
- "::visit_union - "
- "codegen for scope failed\n"), -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // set the sub state as generating code for the output operator
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT);
-
- *os << "ACE_INLINE 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
- << "if (!(strm << _tao_union._d ()))" << be_idt_nl
- << "return 0;" << be_uidt_nl
- << "CORBA::Boolean result = 0;" << be_nl
- << "switch (_tao_union._d ())" << be_nl
- << "{" << be_idt_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cdr_op_ci::"
- "visit_union - "
- "codegen for scope failed\n"), -1);
- }
- *os << be_uidt_nl << "}" << be_nl
- << "return result;" << be_uidt_nl
- << "}\n\n";
-
- // set the substate as generating code for the input operator
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT);
- *os << "ACE_INLINE 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->fullname ()
- << " " << "_tao_discriminant;" << be_nl
- << "if ( !(strm >> _tao_discriminant) )" << be_idt_nl
- << "return 0;" << be_uidt_nl
- << "CORBA::Boolean result = 0;" << be_nl
- << "switch (_tao_discriminant)" << be_nl
- << "{" << be_idt_nl;
-
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cdr_op_ci::"
- "visit_union - "
- "codegen for scope failed\n"), -1);
- }
-
- *os << be_uidt_nl << "}" << be_nl
- << "return result;" << be_uidt_nl
- << "}\n\n";
-
- node->cli_inline_cdr_op_gen (1);
- return 0;
-}
-
-int
-be_visitor_union_cdr_op_ci::pre_process (be_decl *bd)
-{
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_SCOPE)
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- be_union_branch* b =
- be_union_branch::narrow_from_decl (bd);
-
- 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_ci::post_process (be_decl *)
-{
- if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_SCOPE)
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_uidt_nl << "}" << be_nl
- << "break;" << be_uidt_nl;
-
- 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 f62a2206f04..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for CDR operators for unions
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union.h"
-
-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 ())
- return 0;
-
- // set the substate as generating code for the types defined in our scope
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
- // 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_cdr_op_cs"
- "::visit_union - "
- "codegen for scope failed\n"), -1);
- }
-
- 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 66c3002b440..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// discriminant_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for discriminant of the Union
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union.h"
-
-ACE_RCSID(be_visitor_union, discriminant_ch, "$Id$")
-
-
-// *************************************************************************
-// be_visitor_discriminant_ch - 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)
-{
- TAO_OutStream *os; // output stream
- be_union *bu =
- this->ctx_->be_node_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;
-
- 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
- {
- // 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 enum declaration
- ctx.state (TAO_CodeGen::TAO_ENUM_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_discriminant_ch::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_discriminant_ch::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- os->indent ();
- // the set method
- *os << "void _d (" << bt->nested_type_name (bu) << ");" << be_nl;
- // the get method
- *os << bt->nested_type_name (bu) << " _d (void) const;\n\n";
- return 0;
-}
-
-int
-be_visitor_union_discriminant_ch::visit_predefined_type (be_predefined_type
- *node)
-{
- TAO_OutStream *os; // output stream
- be_union *bu =
- this->ctx_->be_node_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;
-
- os = this->ctx_->stream ();
-
- os->indent ();
- // the set method
- *os << "void _d (" << bt->nested_type_name (bu) << ");" << be_nl;
- // the get method
- *os << bt->nested_type_name (bu) << " _d (void) const;\n\n";
- return 0;
-}
-
-int
-be_visitor_union_discriminant_ch::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_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 100c54c65c3..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// discriminant_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for discriminant of the union.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
- be_union *bu =
- this->ctx_->be_node_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;
-
- 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);
- }
- 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->indent ();
- *os << "// the implicit _default () method" << be_nl;
- *os << "ACE_INLINE void " << be_nl
- << bu->name () << "::_default ()" << be_nl
- << "{" << be_idt_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_bool:
- *os << dv.u.bool_val;
- break;
- case AST_Expression::EV_any:
- // The discriminant is an enum. Some compilers will
- // not accept a numeric value assigned to this
- // discriminant, so we must generate the string name.
- {
- 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);
- 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_enum - "
- "bad or unimplemented discriminant type\n"),
- -1);
- }
- *os << ";" << be_uidt_nl << "}\n\n";
- }
-
- os->indent ();
- // the set method
- *os << "// accessor to set the discriminant" << be_nl
- << "ACE_INLINE void" << be_nl
- << bu->name () << "::_d (" << bt->name ()
- << " discval)" << be_nl
- << "{" << be_idt_nl
- << "this->disc_ = discval;" << be_uidt_nl
- << "}" << be_nl;
-
- // the get method
- *os << "// accessor to get the discriminant" << be_nl
- << "ACE_INLINE " << bt->name () << be_nl
- << bu->name () << "::_d (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->disc_;" << be_uidt_nl
- << "}\n\n";
- return 0;
-}
-
-int
-be_visitor_union_discriminant_ci::visit_predefined_type (be_predefined_type
- *node)
-{
- TAO_OutStream *os; // output stream
- be_union *bu =
- this->ctx_->be_node_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;
-
- os = this->ctx_->stream ();
-
- os->indent ();
- // the set method
- *os << "// accessor to set the discriminant" << be_nl
- << "ACE_INLINE void" << be_nl
- << bu->name () << "::_d (" << bt->name ()
- << " discval)" << be_nl
- << "{" << be_idt_nl
- << "this->disc_ = discval;" << be_uidt_nl
- << "}" << be_nl;
-
- // the get method
- *os << "// accessor to get the discriminant" << be_nl
- << "ACE_INLINE " << bt->name () << be_nl
- << bu->name () << "::_d (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->disc_;" << be_uidt_nl
- << "}\n\n";
- return 0;
-}
-
-int
-be_visitor_union_discriminant_ci::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_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 79f75f66a28..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/discriminant_cs.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// discriminant_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for discriminant of the union
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union.h"
-
-ACE_RCSID(be_visitor_union, discriminant_cs, "$Id$")
-
-
-// *************************************************************************
-// be_visitor_discriminant_cs - 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;
-
- // 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 (bt->node_type () != AST_Decl::NT_typedef // not a typedef
- && bt->is_child (bu)) // bt is defined inside the union
- {
- // 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
-
- // generate the typecode for the enum
- ctx.state (TAO_CodeGen::TAO_ENUM_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_discriminant_cs::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_discriminant_cs::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- 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 2b04aff5d46..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/union.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// union.cpp
-//
-// = DESCRIPTION
-// Generic visitor generating code for Unions
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union.h"
-
-ACE_RCSID(be_visitor_union, union, "$Id$")
-
-
-// generic struct visitor
-be_visitor_union::be_visitor_union (be_visitor_context *ctx)
- : be_visitor_scope (ctx)
-{
-}
-
-be_visitor_union::~be_visitor_union (void)
-{
-}
-
-// visit the Union node and its scope
-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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_UNION_PUBLIC_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_PUBLIC_CH);
- break;
- case TAO_CodeGen::TAO_UNION_PRIVATE_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_PRIVATE_CH);
- break;
- case TAO_CodeGen::TAO_UNION_PUBLIC_CI:
- ctx.state (TAO_CodeGen::TAO_UNION_PUBLIC_CI);
- break;
- case TAO_CodeGen::TAO_UNION_PUBLIC_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_PUBLIC_CS);
- break;
- case TAO_CodeGen::TAO_UNION_PUBLIC_ASSIGN_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_PUBLIC_ASSIGN_CS);
- break;
- case TAO_CodeGen::TAO_UNION_PUBLIC_RESET_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_PUBLIC_RESET_CS);
- break;
- case TAO_CodeGen::TAO_UNION_PUBLIC_ACCESS_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_PUBLIC_ACCESS_CS);
- break;
- case TAO_CodeGen::TAO_UNION_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_UNION_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_UNION_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CS);
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union::"
- "visit_union_branch - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union::"
- "visit_union_branch - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union::"
- "visit_union_branch - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- 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 b3d8de89394..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp
+++ /dev/null
@@ -1,238 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// union_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Unions in the client header
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union.h"
-
-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)
-{
-}
-
-// visit the Union node and its scope
-int be_visitor_union_ch::visit_union (be_union *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt; // type 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); // set the node to be the node being visited. The scope is
- // still the same
-
-
- if (!node->cli_hdr_gen () && !node->imported ()) // not already generated and
- // not imported
- {
- os = this->ctx_->stream ();
-
- // generate the ifdefined macro for the union type
- os->gen_ifdef_macro (node->flatname ());
- os->indent (); // start with the current indentation level
- *os << "class " << idl_global->export_macro () << " "
- << node->local_name () << ": public TAO_Base_Union " << be_nl
- << "{" << be_nl
- << "public:" << be_idt_nl
-
- // generate default and copy constructors
- << node->local_name () << " (void); // default constructor" << be_nl
- << node->local_name () << " (const " << node->local_name ()
- << " &); // copy constructor" << be_nl
- // generate destructor
- << "~" << node->local_name () << " (void); // destructor" << be_nl
- // generate assignment operator
- << node->local_name () << " &operator= (const "
- << node->local_name () << " &); // copy constructor\n\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_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.
-
- ctx.state (TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CH); // set current code
- // gen state
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ch::"
- "visit_union - "
- "bad visitor\n"), -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ch::"
- " visit_union - "
- "codegen for discriminant failed\n"), -1);
- }
- delete visitor;
-
- // 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); // set current code
- // gen state
- 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))
- {
- // only if all cases are not covered AND there is no explicit
- // default, we get the _default () method
- os->indent ();
- *os << "void _default ();\n";
- }
-
- // now generate the private data members of the union
- os->decr_indent ();
- *os << "private:\n";
- os->incr_indent ();
- *os << bt->nested_type_name (node) << " disc_;" << be_nl; // emit the
- // ACE_NESTED_CLASS macro
-
- // the members are inside of a union
- *os << "union" << be_nl;
- *os << "{\n";
- os->incr_indent (0);
- this->ctx_->state (TAO_CodeGen::TAO_UNION_PRIVATE_CH); // set current
- // code gen state
- 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->decr_indent ();
- *os << "} u_; // end of union" << be_nl;
-
- // the reset method (TAO extension)
- *os << "// TAO extensions" << be_nl;
- *os << "void _reset (" << bt->nested_type_name (node)
- << ", CORBA::Boolean);" << be_nl;
- *os << "// Frees any allocated storage" << be_nl << be_nl;
- // the virtual overloaded _discriminant method
- *os << "virtual void *_discriminant (void);" << be_nl;
- *os << "// returns pointer to the discriminant" << be_nl << be_nl;
- // the overloaded virtual reset method
- *os << "virtual void _reset (void);" << be_nl;
- *os << "// calls the above reset with finalize=1" << be_nl << be_nl;
- // the _access method
- *os << "virtual void *_access (CORBA::Boolean flag);" << be_nl;
- *os << "// accesses the right data member. "
- << "Also will allocate on TRUE flag" << be_nl << be_uidt_nl;
- *os << "}; // " << node->name () << "\n\n";
-
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DECL);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ch::"
- "visit_union - "
- "TypeCode declaration failed\n"
- ), -1);
- }
-
-
- os->gen_endif ();
-
- // generate the ifdefined macro for the _var type
- os->gen_ifdef_macro (node->flatname (), "_var");
- // generate var defn
- if (node->gen_var_defn () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ch::"
- "visit_union - "
- "codegen for _var\n"), -1);
- }
- os->gen_endif ();
-
- // generate the ifdefined macro for the array type
- os->gen_ifdef_macro (node->flatname (), "_out");
- // a class is generated for an out defn only for a variable length struct
- if (node->size_type () == be_decl::VARIABLE)
- {
- if (node->gen_out_defn () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ch::"
- "visit_union - "
- "codegen for _out\n"), -1);
- }
- }
- else
- {
- os->indent ();
- *os << "typedef " << node->local_name () << " &" << node->local_name
- () << "_out;\n\n";
- }
- os->gen_endif ();
-
- node->cli_hdr_gen (I_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 8790e6a339b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// union_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Union in the client inline file
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union.h"
-
-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)
-{
-}
-
-// visit the Union node and its scope
-int be_visitor_union_ci::visit_union (be_union *node)
-{
- TAO_OutStream *os; // output stream
- be_type *bt; // type 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); // set the node to be the node being visited. The scope is
- // still the same
-
-
- if (!node->cli_inline_gen () && !node->imported ())
- {
- os = this->ctx_->stream ();
-
- *os << "// *************************************************************"
- << be_nl;
- *os << "// Inline operations for union " << node->name () << be_nl;
- *os << "// *************************************************************\n\n";
-
- // generate the default constructor and the destructor here
- os->indent ();
- *os << "// destructor" << be_nl
- << "ACE_INLINE" << be_nl
- << node->name () << "::~" << node->local_name () << " (void)" << be_nl
- << "{" << be_idt_nl
- << "// finalize" << be_nl
- << "this->_reset (this->disc_, 1);" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // the virtual overloaded _reset method
- *os << "// this reset method is used by the decoding engine" << be_nl;
- *os << "ACE_INLINE void" << be_nl
- << node->name () << "::_reset (void)" << be_nl
- << "{" << be_idt_nl
- << "this->_reset (this->disc_, 1);" << be_nl
- << "ACE_OS::memcpy (&this->u_, 0, sizeof (this->u_));" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- // the virtual overloaded _discriminant method
- *os << "// returns pointer to the discriminant" << be_nl;
- *os << "ACE_INLINE void *" << be_nl
- << node->name () << "::_discriminant (void)" << be_nl
- << "{" << be_idt_nl
- << "return &this->disc_;" << be_uidt_nl
- << "}\n\n";
-
- // the discriminant type may have to be defined here if it was an enum
- // declaration inside of the union statement.
-
- 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);
- }
-
- ctx.state (TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CI); // set current code
- // gen state
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ci::"
- "visit_union - "
- "bad visitor\n"), -1);
- }
- // generate code for the discriminant
- 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
- this->ctx_->state (TAO_CodeGen::TAO_UNION_PUBLIC_CI);
- 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);
- }
-
- // generate the ifdefined macro for the array type
- os->gen_ifdef_macro (node->flatname (), "_var");
- if (node->gen_var_impl () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ci::"
- "visit_union - "
- "codegen for _var failed\n"), -1);
- }
- os->gen_endif ();
-
- // generate the ifdefined macro for the array type then generate the _out
- // impl
- os->gen_ifdef_macro (node->flatname (), "_out");
- if (node->size_type () == be_decl::VARIABLE
- && node->gen_out_impl () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_ci::"
- "visit_union - "
- "codegen for _out failed\n"), -1);
- }
- os->gen_endif ();
-
- node->cli_inline_gen (I_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 d739655b4f2..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// union_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Unions in the client stubs
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
- be_type *bt; // for discriminant type
-
- if (!node->cli_stub_gen () && !node->imported ())
- {
- 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
-
- 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);
- }
-
- ctx.state (TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CS); // set current code
- // gen state
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cs::"
- "visit_union - "
- "bad visitor\n"), -1);
- }
- // generate code for the discriminant
- if (bt->accept (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); // set current code
- // gen state
- 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;
- *os << "// Operations for union " << node->name () << be_nl;
- *os << "// *************************************************************\n\n";
-
- // generate the copy constructor and the assignment operator here
- os->indent ();
- *os << "// default constructor" << be_nl
- << node->name () << "::" << node->local_name () << " (void)" << be_nl
- << " : TAO_Base_Union ()" << be_nl
- << "{" << be_idt_nl
- << "ACE_OS::memset (&this->disc_, 0, sizeof (this->disc_));" << be_nl
- << "ACE_OS::memset (&this->u_, 0, sizeof (this->u_));" << be_uidt_nl
- << "}" << be_nl << be_nl;
-
- this->ctx_->state (TAO_CodeGen::TAO_UNION_PUBLIC_ASSIGN_CS);
-
- *os << "// copy constructor" << be_nl;
- *os << node->name () << "::" << node->local_name ()
- << " (const " << node->name () << " &u)" << be_nl
- << " : TAO_Base_Union ()" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "this->disc_ = u.disc_;" << be_nl;
- // now switch based on the disc value
- *os << "switch (this->disc_)" << be_nl;
- *os << "{\n";
- os->incr_indent (0);
- 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);
- }
-
- os->decr_indent ();
- *os << "}\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- this->ctx_->state (TAO_CodeGen::TAO_UNION_PUBLIC_ASSIGN_CS);
-
- // assignment operator
- os->indent ();
- *os << "// assignment operator" << be_nl;
- *os << node->name () << " &" << be_nl; // return type
- *os << node->name () << "::operator= (const " <<
- node->name () << " &u)" << be_nl;
- *os << "{\n";
- os->incr_indent ();
- // first reset and set the discriminant
- *os << "this->_reset (u.disc_, 0);" << be_nl;
- *os << "this->disc_ = u.disc_;" << be_nl;
- // now switch based on the disc value
- *os << "switch (this->disc_)" << be_nl;
- *os << "{\n";
- os->incr_indent (0);
- 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);
- }
-
- os->decr_indent ();
- *os << "}" << be_nl;
- *os << "return *this;\n";
- os->decr_indent ();
- *os << "}\n\n";
-
- // the reset method
- this->ctx_->state (TAO_CodeGen::TAO_UNION_PUBLIC_RESET_CS);
- os->indent ();
- *os << "// reset method to reset old values of a union" << be_nl;
- *os << "void " << node->name () << "::_reset (" << bt->name ()
- << ", CORBA::Boolean finalize)" << 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);
- }
-
- *os << be_uidt_nl << "}" << be_uidt_nl
- << "}\n\n";
-
- // the access method
- os->indent ();
- *os << "// the virtual overloaded access method" << be_nl;
- *os << "void *" << node->name () << "::_access ("
- << " CORBA::Boolean alloc_flag)" << be_nl;
- *os << "{" << be_idt_nl;
- *os << "switch (this->disc_)" << be_nl;
- *os << "{" << be_idt_nl;
- this->ctx_->state (TAO_CodeGen::TAO_UNION_PUBLIC_ACCESS_CS);
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cs"
- "visit_union - "
- "codegen for access failed\n"), -1);
- }
-
- *os << be_uidt_nl << "}" << be_nl;
- *os << "return 0; // default" << be_uidt_nl
- << "}\n\n";
-
-
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_TYPECODE_DEFN);
- ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_cs::"
- "visit_union - "
- "TypeCode definition failed\n"
- ), -1);
- }
-
-
- node->cli_stub_gen (I_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 0898d4cc7ad..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch.cpp
+++ /dev/null
@@ -1,38 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union_branch.h"
-
-// include all the individual files
-#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_access_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_ci.cpp"
-#include "be_visitor_union_branch/cdr_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 74108181d13..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp
+++ /dev/null
@@ -1,295 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union_branch.h"
-
-ACE_RCSID(be_visitor_union_branch, cdr_op_ch, "$Id$")
-
-
-// **********************************************
-// visitor for union_branch in the client header file
-// **********************************************
-
-// constructor
-be_visitor_union_branch_cdr_op_ch::be_visitor_union_branch_cdr_op_ch (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-// destructor
-be_visitor_union_branch_cdr_op_ch::~be_visitor_union_branch_cdr_op_ch (void)
-{
-}
-
-// visit the union_branch node
-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); // save the 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
-
-// visit array type
-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 () // not a typedef
- && 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 struct declaration
- ctx.state (TAO_CodeGen::TAO_ARRAY_CDR_OP_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ch::"
- "visit_array - "
- "Bad visitor\n"
- ), -1);
- }
- 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);
- }
- delete visitor;
- }
-
- return 0;
-}
-
-// visit enum type
-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 () // 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 enum declaration
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ch::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- 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);
- }
- delete visitor;
- }
-
- return 0;
-}
-
-// visit sequence type
-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 () // 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 sequence declaration
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ch::"
- "visit_sequence - "
- "Bad visitor\n"
- ), -1);
- }
- 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);
- }
- delete visitor;
- }
-
- return 0;
-}
-
-// visit structure type
-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 () // 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
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ch::"
- "visit_struct - "
- "Bad visitor\n"
- ), -1);
- }
- 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);
- }
- delete visitor;
- }
-
- return 0;
-}
-
-// visit typedefed type
-int
-be_visitor_union_branch_cdr_op_ch::visit_typedef (be_typedef *node)
-{
- // save the node for use in code generation and
- // indicate that the union_branch of the union_branch 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_union_branch_cdr_op_ch::"
- "visit_typedef - "
- "Bad primitive type\n"
- ), -1);
- }
- this->ctx_->alias (0);
- return 0;
-}
-
-// visit union type
-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 () // 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 enum declaration
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ch::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- 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);
- }
- delete visitor;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ci.cpp
deleted file mode 100644
index 081214f15c7..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ci.cpp
+++ /dev/null
@@ -1,813 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// union_branch_cdr_op_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Union_Branch in the client stubs file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union_branch.h"
-
-ACE_RCSID(be_visitor_union_branch, cdr_op_ci, "$Id$")
-
-
-// **********************************************
-// visitor for union_branch in the client stubs file
-// **********************************************
-
-// constructor
-be_visitor_union_branch_cdr_op_ci::be_visitor_union_branch_cdr_op_ci (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-// destructor
-be_visitor_union_branch_cdr_op_ci::~be_visitor_union_branch_cdr_op_ci (void)
-{
-}
-
-// visit the union_branch node
-int
-be_visitor_union_branch_cdr_op_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_cdr_op_ci::"
- "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_cdr_op_ci::"
- "visit_union_branch - "
- "codegen for union_branch type failed\n"
- ), -1);
- }
- return 0;
-}
-
-// visit array
-int
-be_visitor_union_branch_cdr_op_ci::visit_array (be_array *node)
-{
- TAO_OutStream *os; // output stream
- 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_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->fullname (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname, "_%s", node->fullname ());
- }
- }
- else
- {
- // typedefed node
- ACE_OS::sprintf (fname, "%s", node->fullname ());
- }
-
- // 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 " << be_idt_nl
- << "_tao_union_helper (_tao_union_tmp);" << be_uidt_nl
- << "result = strm >> _tao_union_helper;" << be_nl
- << "if (result)" << be_idt_nl
- << "_tao_union." << f->local_name () << "("
- << "_tao_union_tmp);" << be_uidt;
- return 0;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << fname << "_forany " << be_idt_nl
- << "_tao_union_tmp (_tao_union."
- << f->local_name () << " ());" << 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_ci::"
- "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.
-
- // 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 declaration
- ctx.state (TAO_CodeGen::TAO_ARRAY_CDR_OP_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_array - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_array - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit enum type
-int
-be_visitor_union_branch_cdr_op_ci::visit_enum (be_enum *node)
-{
- TAO_OutStream *os; // output stream
- 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_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_nl
- << "result = strm >> _tao_union_tmp;" << be_nl
- << "if (result)" << be_idt_nl
- << "_tao_union." << f->local_name () << " ("
- << "_tao_union_tmp);" << be_uidt;
- return 0;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "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_enum - "
- "bad sub state\n"
- ), -1);
- }
-
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the typcode for enums
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit interface type
-int
-be_visitor_union_branch_cdr_op_ci::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_ci::"
- "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:
- *os << node->name () << "_var _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp;" << be_nl
- << "if (result)" << be_idt_nl
- << "_tao_union."
- << f->local_name () << " (_tao_union_tmp.in ());" << 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 cannit be declared inside a
- // structure
- break;
-
- default:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_interface - "
- "bad sub state\n"
- ), -1);
- }
- return 0;
-}
-
-// visit interface forward type
-int
-be_visitor_union_branch_cdr_op_ci::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_ci::"
- "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:
- *os << node->name () << "_var _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp;" << be_nl
- << "if (result)" << be_idt_nl
- << "_tao_union."
- << f->local_name () << " (_tao_union_tmp.in ());" << 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 cannit be declared inside a
- // structure
- break;
-
- default:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_interface_fwd - "
- "bad sub state\n"
- ), -1);
- }
- return 0;
-}
-
-// visit predefined type
-int
-be_visitor_union_branch_cdr_op_ci::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os; // output stream
- 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_predefined_type - "
- "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->pt () == AST_PredefinedType::PT_pseudo)
- {
- if (!ACE_OS::strcmp (node->local_name ()->get_string (), "TypeCode"))
- *os << "CORBA::TypeCode_var _tao_union_tmp;" << be_nl;
-
- else if (!ACE_OS::strcmp (node->local_name ()->get_string (), "Object"))
- *os << "CORBA::Object_var _tao_union_tmp;" << be_nl;
-
- //@@TODO - case for ValueBase.
-
- *os << "result = strm >> _tao_union_tmp.out ();" << be_nl
- << "if (result)" << be_idt_nl
- << "_tao_union." << f->local_name () << " (_tao_union_tmp.in ());"
- << be_uidt;
- }
- else if (node->pt () == AST_PredefinedType::PT_char)
- *os << "CORBA::Char _tao_union_tmp;" << be_nl
- << "CORBA::Any::to_char _tao_union_helper "
- << "(_tao_union_tmp);" << be_nl
- << "result = strm >> _tao_union_helper;" << be_nl
- << "if (result)" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << "(_tao_union_tmp);" << be_uidt;
- else if (node->pt () == AST_PredefinedType::PT_wchar)
- *os << "CORBA::WChar _tao_union_tmp;" << be_nl
- << "CORBA::Any::to_wchar _tao_union_helper "
- << "(_tao_union_tmp);" << be_nl
- << "result = strm >> _tao_union_helper;" << be_nl
- << "if (result)" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << "(_tao_union_tmp);" << be_uidt;
- else if (node->pt () == AST_PredefinedType::PT_octet)
- *os << "CORBA::Octet _tao_union_tmp;" << be_nl
- << "CORBA::Any::to_octet _tao_union_helper "
- << "(_tao_union_tmp);" << be_nl
- << "result = strm >> _tao_union_helper;" << be_nl
- << "if (result)" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << "(_tao_union_tmp);" << be_uidt;
- else if (node->pt () == AST_PredefinedType::PT_boolean)
- *os << "CORBA::Boolean _tao_union_tmp;" << be_nl
- << "CORBA::Any::to_boolean _tao_union_helper "
- << "(_tao_union_tmp);" << be_nl
- << "result = strm >> _tao_union_helper;" << be_nl
- << "if (result)" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << "(_tao_union_tmp);" << be_uidt;
- else
- *os << node->name () << " _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp;" << be_nl
- << "if (result)" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);" << be_uidt;
- break;
-
- case TAO_CodeGen::TAO_CDR_OUTPUT:
-
- *os << "result = ";
- if (node->pt () == AST_PredefinedType::PT_pseudo)
- *os << "strm << _tao_union." << f->local_name () << " ();";
- else if (node->pt () == AST_PredefinedType::PT_char)
- *os << "strm << CORBA::Any::from_char (_tao_union."
- << f->local_name () << " ());";
- else if (node->pt () == AST_PredefinedType::PT_wchar)
- *os << "strm << CORBA::Any::from_wchar (_tao_union."
- << f->local_name () << " ());";
- else if (node->pt () == AST_PredefinedType::PT_octet)
- *os << "strm << CORBA::Any::from_octet (_tao_union."
- << f->local_name () << " ());";
- else if (node->pt () == AST_PredefinedType::PT_boolean)
- *os << "strm << CORBA::Any::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_ci::"
- "visit_array - "
- "bad sub state\n"
- ), -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_ci::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os; // output stream
- 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
- << "if (result)" << be_idt_nl
- << "_tao_union."
- << f->local_name () << " (_tao_union_tmp);" << 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);
- }
-
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- // not a typedef AND
- // node is defined inside the structure
- {
- // Anonymous sequence
- // 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
-
- // generate the inline code for structs
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_sequence - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_sequence - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit string type
-int
-be_visitor_union_branch_cdr_op_ci::visit_string (be_string *)
-{
- TAO_OutStream *os; // output stream
- 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:
- *os << "CORBA::String_var _tao_union_tmp;" << be_nl
- << "result = strm >> _tao_union_tmp.out ();" << be_nl
- << "if (result)" << be_idt_nl
- << "_tao_union."
- << f->local_name () << " (_tao_union_tmp);" << 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;
-}
-
-// visit structure type
-int
-be_visitor_union_branch_cdr_op_ci::visit_structure (be_structure *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_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
- << "if (result)" << be_idt_nl
- << "_tao_union." << f->local_name ()
- << " (_tao_union_tmp);" << 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);
- }
-
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the inline code for structs
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_struct - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_struct - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit typedef type
-int
-be_visitor_union_branch_cdr_op_ci::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_ci::"
- "visit_typedef - "
- "Bad primitive type\n"
- ), -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-// visit union type
-int
-be_visitor_union_branch_cdr_op_ci::visit_union (be_union *node)
-{
- TAO_OutStream *os; // output stream
- 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 << "result = strm >> _tao_union."
- << f->local_name () << " ();";
- 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);
- }
-
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the inline code for union
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_union - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_ci::"
- "visit_union - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- 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 37bbb15f6a4..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp
+++ /dev/null
@@ -1,285 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union_branch.h"
-
-ACE_RCSID(be_visitor_union_branch, cdr_op_cs, "$Id$")
-
-
-// **********************************************
-// visitor for union_branch in the client stubs file
-// **********************************************
-
-// constructor
-be_visitor_union_branch_cdr_op_cs::be_visitor_union_branch_cdr_op_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-// destructor
-be_visitor_union_branch_cdr_op_cs::~be_visitor_union_branch_cdr_op_cs (void)
-{
-}
-
-// visit the union_branch node
-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); // save the 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;
-}
-
-// visit array
-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 () // not a typedef
- && 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 declaration
- ctx.state (TAO_CodeGen::TAO_ARRAY_CDR_OP_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_array - "
- "Bad visitor\n"
- ), -1);
- }
- 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);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit enum type
-int
-be_visitor_union_branch_cdr_op_cs::visit_enum (be_enum *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the typcode for enums
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-int
-be_visitor_union_branch_cdr_op_cs::visit_sequence (be_sequence *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef
- && node->is_child (this->ctx_->scope ()))
- // not a typedef AND
- // node is defined inside the structure
- {
- // Anonymous sequence
- // 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
-
- // generate the inline code for structs
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_sequence - "
- "Bad visitor\n"
- ), -1);
- }
- 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);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit structure type
-int
-be_visitor_union_branch_cdr_op_cs::visit_structure (be_structure *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the inline code for structs
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_struct - "
- "Bad visitor\n"
- ), -1);
- }
- 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);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit typedef type
-int
-be_visitor_union_branch_cdr_op_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_ci::"
- "visit_typedef - "
- "Bad primitive type\n"
- ), -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-// visit union type
-int
-be_visitor_union_branch_cdr_op_cs::visit_union (be_union *node)
-{
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the inline code for union
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
- "visit_union - "
- "Bad visitor\n"
- ), -1);
- }
- 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);
- }
- delete visitor;
- }
- 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 3c1d6e42452..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp
+++ /dev/null
@@ -1,424 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union_branch.h"
-
-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); // save the 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;
-}
-
-// =visit operations on all possible data types that a union_branch can be
-
-int
-be_visitor_union_branch_private_ch::visit_array (be_array *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_private_ch::"
- "visit_array - "
- "bad context information\n"
- ), -1);
- }
-
- 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
- {
- // case of anonymous array in union
- os->indent ();
- *os << "_" << bt->local_name () << "_slice *" << ub->local_name ()
- << "_;\n";
- }
- else
- {
- os->indent ();
- *os << bt->nested_type_name (bu, "_slice") << " *" << ub->local_name ()
- << "_;\n";
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_enum (be_enum *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_private_ch::"
- "visit_enum - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- *os << bt->nested_type_name (bu) << " " << ub->local_name () << "_;\n";
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_interface (be_interface *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_private_ch::"
- "visit_interface - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // C++ does not allow an object declaration inside a union. Hence we
- // must have a pointer. This changes some of the methods.
- // We use TAO_Object_Field_T<> so that _upcast() and _downcast() will work.
- *os << "TAO_Object_Field_T<"
- << bt->nested_type_name (bu, "") << ",";
- // Must use another statement, nested_type_name has side effects...
- *os << bt->nested_type_name (bu, "_var")
- << "> *" << ub->local_name () << "_;\n";
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_private_ch::"
- "visit_interface_fwd - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // C++ does not allow an object declaration inside a union. Hence we
- // must have a pointer. This changes some of the methods.
- // We use TAO_Object_Field_T<> so that _upcast() and _downcast() will work.
- *os << "TAO_Object_Field_T<"
- << bt->nested_type_name (bu, "") << ",";
- // Must use another statement, nested_type_name has side effects...
- *os << bt->nested_type_name (bu, "_var")
- << "> *" << ub->local_name () << "_;\n";
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_private_ch::"
- "visit_predefined_type - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- if (node->pt () == AST_PredefinedType::PT_pseudo)
- {
- // Cannot have an object inside of a union
- os->indent (); // start from current indentation
- // check if we are dealing with a CORBA::Object
- if (!ACE_OS::strcmp (node->local_name ()->get_string (), "Object"))
- {
- *os << "TAO_Object_Field_T<"
- << bt->name () << ","
- << bt->name () << "_var"
- << "> *" << ub->local_name () << "_;\n";
- }
- else
- *os << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name ()
- << "_;\n";
- }
- 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->indent (); // start from current indentation
- *os << bt->nested_type_name (bu) << " *" << ub->local_name () <<
- "_;\n";
- }
- else
- {
- os->indent (); // start from current indentation
- *os << bt->nested_type_name (bu) << " " << ub->local_name () <<
- "_;\n";
- }
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_private_ch::"
- "visit_sequence - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent ();
- // C++ doesn't allow object instances inside unions, so we need a
- // pointer
- *os << bt->nested_type_name (bu) << " *" << ub->local_name () << "_;\n";
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_string (be_string *)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // get the enclosing union backend
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_private_ch::"
- "visit_string - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent ();
- *os << "char *" << ub->local_name () << "_;\n";
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::visit_structure (be_structure *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_private_ch::"
- "visit_structure - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent ();
-
- // if we are variable sized, we need a pointer type
- if (node->size_type () == be_type::VARIABLE)
- {
- *os << bt->nested_type_name (bu) << " *" << ub->local_name () << "_;\n";
- }
- else
- {
- *os << bt->nested_type_name (bu) << " " << ub->local_name () << "_;\n";
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_private_ch::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_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)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_private_ch::"
- "visit_union - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent ();
- // C++ doesn't allow instances of classes
- *os << bt->nested_type_name (bu) << " *" << ub->local_name () << "_;\n";
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp
deleted file mode 100644
index 04e57571655..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp
+++ /dev/null
@@ -1,439 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// public_access_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Union Branch in the client inline file.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union_branch.h"
-
-ACE_RCSID(be_visitor_union_branch, public_access_cs, "$Id$")
-
-
-// *****************************************************
-// visitor for union_branch in the client
-// stubs file for the access method
-// *****************************************************
-
-// constructor
-be_visitor_union_branch_public_access_cs::
-be_visitor_union_branch_public_access_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-// destructor
-be_visitor_union_branch_public_access_cs::
-~be_visitor_union_branch_public_access_cs (void)
-{
-}
-
-// visit the union_branch node
-int
-be_visitor_union_branch_public_access_cs::
-visit_union_branch (be_union_branch *node)
-{
- TAO_OutStream *os;
- be_type *bt; // union_branch's type
-
- os = this->ctx_->stream ();
- // 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_union_branch_cs::"
- "visit_union_branch - "
- "Bad union_branch type\n"
- ), -1);
- }
-
- this->ctx_->node (node); // save the node
-
- 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;
-}
-
-// =visit operations on all possible data types that a union_branch can be
-
-int
-be_visitor_union_branch_public_access_cs::visit_array (be_array *node)
-{
- TAO_OutStream *os; // output stream
- 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_access_cs::"
- "visit_enum - "
- "bad context information\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 (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->fullname (),
- bt->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname, "_%s", bt->fullname ());
- }
- }
- else
- {
- // typedefed node
- ACE_OS::sprintf (fname, "%s", bt->fullname ());
- }
-
- os = this->ctx_->stream ();
- *os << "if (alloc_flag)" << be_idt_nl;
- *os << "this->u_." << ub->local_name () << "_ = " << fname
- << "_alloc ();" << be_uidt_nl;
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_access_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_access_cs::"
- "visit_enum - "
- "bad context information\n"
- ), -1);
- }
- TAO_OutStream *os = this->ctx_->stream ();
- *os << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_access_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_access_cs::"
- "visit_interface - "
- "bad context information\n"
- ), -1);
- }
- TAO_OutStream *os = this->ctx_->stream ();
- *os << "if (alloc_flag)" << be_idt_nl;
- *os << "ACE_NEW_RETURN (this->u_." << ub->local_name () << "_, "
- << "(TAO_Object_Field_T<"
- << bt->name () << ","
- << bt->name () << "_var>), 0);" << be_uidt_nl;
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_access_cs::visit_interface_fwd (be_interface_fwd *)
-{
- 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_access_cs::"
- "visit_interface - "
- "bad context information\n"
- ), -1);
- }
- TAO_OutStream *os = this->ctx_->stream ();
- *os << "return (CORBA::Object_ptr) &this->u_." << ub->local_name ()
- << "_->inout ();" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_access_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os; // output stream
- 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_access_cs::"
- "visit_interface - "
- "bad context information\n"
- ), -1);
- }
- os = this->ctx_->stream ();
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- *os << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl;
- break;
- case AST_PredefinedType::PT_any:
- *os << "if (alloc_flag)" << be_idt_nl;
- *os << "this->u_." << ub->local_name () << "_ = new " << bt->name ()
- << ";" << be_uidt_nl;
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- *os << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl;
- }
- return 0;
-}
-
-int
-be_visitor_union_branch_public_access_cs::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os; // output stream
- 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_access_cs::"
- "visit_sequence - "
- "bad context information\n"
- ), -1);
- }
- os = this->ctx_->stream ();
- *os << "if (alloc_flag)" << be_idt_nl;
- *os << "this->u_." << ub->local_name () << "_ = new " << bt->name ()
- << ";" << be_uidt_nl;
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_access_cs::visit_string (be_string *)
-{
- 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_access_cs::"
- "visit_string - "
- "bad context information\n"
- ), -1);
- }
- TAO_OutStream *os = this->ctx_->stream ();
- *os << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_access_cs::visit_structure (be_structure *node)
-{
- TAO_OutStream *os; // output stream
- 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_access_cs::"
- "visit_structure - "
- "bad context information\n"
- ), -1);
- }
- os = this->ctx_->stream ();
- if (bt->size_type () == be_type::VARIABLE)
- {
- *os << "if (alloc_flag)" << be_idt_nl;
- *os << "this->u_." << ub->local_name () << "_ = new " << bt->name ()
- << ";" << be_uidt_nl;
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
- }
- else
- {
- *os << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl;
- }
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_access_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_access_cs::"
- "visit_typedef - "
- "Bad primitive type\n"
- ), -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-int
-be_visitor_union_branch_public_access_cs::visit_union (be_union *node)
-{
- TAO_OutStream *os; // output stream
- 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_access_cs::"
- "visit_union - "
- "bad context information\n"
- ), -1);
- }
- os = this->ctx_->stream ();
- *os << "if (alloc_flag)" << be_idt_nl;
- *os << "this->u_." << ub->local_name () << "_ = new " << bt->name ()
- << ";" << be_uidt_nl;
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
-
- 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 d82862e40c1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp
+++ /dev/null
@@ -1,497 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union_branch.h"
-
-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 ();
-
- // 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
- os->indent ();
- 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 << "\n";
-
- // 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;\n";
- 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)
-{
- TAO_OutStream *os; // output stream
- 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);
- }
- os = this->ctx_->stream ();
-
- // 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 (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->fullname (),
- bt->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname, "_%s", bt->fullname ());
- }
- }
- else
- {
- // typedefed node
- ACE_OS::sprintf (fname, "%s", bt->fullname ());
- }
-
- os->indent (); // start from current indentation
- // set the discriminant to the appropriate label
- *os << "// make a deep copy" << be_nl;
- *os << "this->u_." << ub->local_name ()
- << "_ = " << fname
- << "_dup (u.u_."
- << ub->local_name () << "_);" << 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 ();
-
- os->indent (); // start from current indentation
- // set the discriminant to the appropriate label
- // valid label
- *os << "// set the value" << be_nl
- << "this->u_." << ub->local_name () << "_ = u.u_."
- << ub->local_name () << "_;" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_interface (be_interface *node)
-{
- TAO_OutStream *os; // output stream
- 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);
- }
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // set the discriminant to the appropriate label
- *os << "this->u_." << ub->local_name ()
- << "_ = new TAO_Object_Field_T<"
- << bt->name () << ","
- << bt->name () << "_var"
- << "> (" << bt->name () << "::_duplicate (u.u_."
- << ub->local_name () << "_->ptr ()));" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os; // output stream
- 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);
- }
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // set the discriminant to the appropriate label
- *os << "this->u_." << ub->local_name ()
- << "_ = new TAO_Object_Field_T<"
- << bt->name () << ","
- << bt->name () << "_var"
- << "> (" << bt->name () << "::_duplicate (u.u_."
- << ub->local_name () << "_->ptr ()));" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os; // output stream
- 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);
- }
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // set the discriminant to the appropriate label
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- *os << "this->u_." << ub->local_name () << "_ = ";
- if (!ACE_OS::strcmp (node->local_name ()->get_string (), "Object"))
- {
- *os << "new TAO_Object_Field_T<CORBA::Object,CORBA::Object_var> "
- << "(CORBA::Object::_duplicate (u.u_."
- << ub->local_name () << "_->ptr ()));" << be_uidt_nl;
- }
- else
- {
- *os << bt->name () << "::_duplicate (u.u_."
- << ub->local_name () << "_);" << be_uidt_nl;
- }
- break;
- case AST_PredefinedType::PT_any:
- *os << "this->u_." << ub->local_name () << "_ = new "
- << bt->name () << " (*u.u_."
- << ub->local_name () << "_);" << be_uidt_nl;
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- *os << "// set the value" << be_nl
- << "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)
-{
- TAO_OutStream *os; // output stream
- 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);
- }
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // set the discriminant to the appropriate label
- *os << "this->u_." << ub->local_name () << "_ = new "
- << bt->name () << " (*u.u_."
- << ub->local_name () << "_);" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_string (be_string *)
-{
- TAO_OutStream *os; // output stream
- 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);
- }
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // set the discriminant to the appropriate label
- *os << "this->u_." << ub->local_name () << "_ = "
- << "CORBA::string_dup (u.u_."
- << ub->local_name () << "_);" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_assign_cs::visit_structure (be_structure *node)
-{
- TAO_OutStream *os; // output stream
- 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);
- }
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // set the discriminant to the appropriate label
- if (bt->size_type () == be_type::VARIABLE)
- {
- *os << "this->u_." << ub->local_name () << "_ = new "
- << bt->name () << " (*u.u_."
- << ub->local_name () << "_);" << 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)
-{
- TAO_OutStream *os; // output stream
- 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);
- }
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // set the discriminant to the appropriate label
- *os << "this->u_." << ub->local_name () << "_ = new "
- << bt->name () << " (*u.u_."
- << ub->local_name () << "_);" << 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 f2be1ad27d7..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp
+++ /dev/null
@@ -1,708 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// public_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Union_branch in the public part.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union_branch.h"
-
-ACE_RCSID(be_visitor_union_branch, public_ch, "$Id$")
-
-
-// **********************************************
-// visitor for union_branch in the client header file
-// **********************************************
-
-// constructor
-be_visitor_union_branch_public_ch::be_visitor_union_branch_public_ch
-(be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-// destructor
-be_visitor_union_branch_public_ch::~be_visitor_union_branch_public_ch (void)
-{
-}
-
-// visit the union_branch node
-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); // save the 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
-
-// visit array type
-int
-be_visitor_union_branch_public_ch::visit_array (be_array *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch member
- be_decl *bu = this->ctx_->scope (); // get the enclosing union 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 (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_array - "
- "bad context information\n"
- ), -1);
- }
-
- 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
- {
- // this is the case of an anonymous array inside a union
-
- // 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 *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_array - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_array - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- // now use this array as a "type" for the subsequent declarator
- os->indent (); // start from current indentation
- // the set method
- *os << "void " << ub->local_name () << " ("
- << "_" << bt->local_name () << ");// set" << be_nl;
- // the get method
- *os << "_" << bt->local_name () << "_slice * " << ub->local_name ()
- << " (void) const; // get method\n\n";
- }
- else
- {
- // now use this array as a "type" for the subsequent declarator
- os->indent (); // start from current indentation
- // the set method
- *os << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu) << ");// set"
- << be_nl;
- // the get method
- *os << bt->nested_type_name (bu, "_slice *") << " " << ub->local_name ()
- << " (void) const; // get method\n\n";
- }
-
- return 0;
-}
-
-// visit enum type
-int
-be_visitor_union_branch_public_ch::visit_enum (be_enum *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch member
- be_decl *bu = this->ctx_->scope (); // get the enclosing union node
- 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_ch::"
- "visit_enum - "
- "bad context information\n"
- ), -1);
- }
-
- 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
- {
- // 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 enum declaration
- ctx.state (TAO_CodeGen::TAO_ENUM_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- // now use this enum as a "type" for the subsequent declarator
- os->indent (); // start from current indentation
- // the set method
- *os << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu) << ");// set"
- << be_nl;
- // the get method
- *os << bt->nested_type_name (bu) << " " << ub->local_name ()
- << " (void) const; // get method\n\n";
-
- return 0;
-}
-
-// visit interface type
-int
-be_visitor_union_branch_public_ch::visit_interface (be_interface *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_ch::"
- "visit_interface - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // set method
- *os << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu, "_ptr")
- << ");// set" << be_nl;
- // get method
- *os << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name ()
- << " (void) const; // get method\n\n";
- return 0;
-}
-
-// visit interface forward type
-int
-be_visitor_union_branch_public_ch::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_ch::"
- "visit_interface_fwd - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // set method
- *os << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu, "_ptr")
- << ");// set" << be_nl;
- // get method
- *os << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name ()
- << " (void) const; // get method\n\n";
- return 0;
-}
-
-#ifdef IDL_HAS_VALUETYPE
-
-// visit valuetype type
-int
-be_visitor_union_branch_public_ch::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_ch::"
- "visit_valuetype - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // set method
- *os << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu, "*")
- << ");// set" << be_nl;
- // get method
- *os << bt->nested_type_name (bu, "*") << " " << ub->local_name ()
- << " (void) const; // get method\n\n";
- return 0;
-}
-
-// visit valuetype forward type
-int
-be_visitor_union_branch_public_ch::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_ch::"
- "visit_valuetype_fwd - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // set method
- *os << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu, "*")
- << ");// set" << be_nl;
- // get method
- *os << bt->nested_type_name (bu, "*") << " " << ub->local_name ()
- << " (void) const; // get method\n\n";
- return 0;
-}
-
-#endif /* IDL_HAS_VALUETYPE */
-
-// visit predefined type
-int
-be_visitor_union_branch_public_ch::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_ch::"
- "visit_predefined_type - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- // set method
- *os << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu, "_ptr") << ");// set" << be_nl;
- // get method
- *os << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name ()
- << " (void) const; // get method\n\n";
- break;
- case AST_PredefinedType::PT_any:
- // set method
- *os << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu) << ");// set" << be_nl;
- // get method (read-only)
- *os << "const " << bt->nested_type_name (bu) << " "
- << ub->local_name () << " (void) const; // get method\n\n";
- // get method (read/write)
- *os << bt->nested_type_name (bu) << " "
- << ub->local_name () << " (void); // get method\n\n";
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- // set method
- *os << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu) << ");// set" << be_nl;
- // get method
- *os << bt->nested_type_name (bu) << " " << ub->local_name ()
- << " (void) const; // get method\n\n";
- }
- return 0;
-}
-
-// visit sequence type
-int
-be_visitor_union_branch_public_ch::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_ch::"
- "visit_sequence - "
- "bad context information\n"
- ), -1);
- }
-
- 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
- {
- // 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 sequence declaration
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_sequence - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_sequence - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- os->indent ();
- // set method
- *os << "void " << ub->local_name () << " (const "
- << bt->nested_type_name (bu) << " &);// set" << be_nl;
- // read-only
- *os << "const " << bt->nested_type_name (bu) << " &"
- << ub->local_name () << " (void) const; // get method (read only)"
- << be_nl;
- // read/write
- *os << bt->nested_type_name (bu) << " &" << ub->local_name ()
- << " (void); // get method (read/write only)\n\n";
-
- return 0;
-}
-
-// visit string type
-int
-be_visitor_union_branch_public_ch::visit_string (be_string *)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // get the enclosing union backend
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_string - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent ();
- // three methods to set the string value
- *os << "void " << ub->local_name () << " (char *); // set" << be_nl;
- *os << "void " << ub->local_name () << " (const char *); // set"
- << be_nl;
- *os << "void " << ub->local_name () << " (const CORBA::String_var&); // set"
- << be_nl;
- //get method
- *os << "const char *" << ub->local_name ()
- << " (void) const; // get method\n\n";
- return 0;
-}
-
-// visit structure type
-int
-be_visitor_union_branch_public_ch::visit_structure (be_structure *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_ch::"
- "visit_structure - "
- "bad context information\n"
- ), -1);
- }
-
- 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
- {
- // 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 sequence declaration
- ctx.state (TAO_CodeGen::TAO_STRUCT_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_structure - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_structure - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- os->indent ();
- // set method
- *os << "void " << ub->local_name () << " (const "
- << bt->nested_type_name (bu) << " &);// set" << be_nl
- // read-only
- << "const " << bt->nested_type_name (bu) << " &"
- << ub->local_name () << " (void) const; // get method (read only)"
- << be_nl
- // read/write
- << bt->nested_type_name (bu) << " &" << ub->local_name ()
- << " (void); // get method (read/write only)\n\n";
-
- return 0;
-}
-
-// visit typedefed type
-int
-be_visitor_union_branch_public_ch::visit_typedef (be_typedef *node)
-{
- TAO_OutStream *os; // output stream
-
- os = this->ctx_->stream ();
- os->indent (); // start from current indentation level
- this->ctx_->alias (node); // save the node for use in code generation and
- // indicate that the union_branch of the union_branch node
- // is a typedefed quantity
-
- // 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;
-}
-
-// visit union type
-int
-be_visitor_union_branch_public_ch::visit_union (be_union *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get union branch
- be_decl *bu = this->ctx_->scope (); // 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_ch::"
- "visit_union - "
- "bad context information\n"
- ), -1);
- }
-
- 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
- {
- // 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 union declaration
- ctx.state (TAO_CodeGen::TAO_UNION_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_union - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ch::"
- "visit_union - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- os->indent ();
- // set method
- *os << "void " << ub->local_name () << " (const "
- << bt->nested_type_name (bu) << " &);// set" << be_nl
- // read-only
- << "const " << bt->nested_type_name (bu) << " &"
- << ub->local_name () << " (void) const; // get method (read only)"
- << be_nl
- // read/write
- << bt->nested_type_name (bu) << " &" << ub->local_name ()
- << " (void); // get method (read/write only)\n\n";
-
- 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 76e4e27d077..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp
+++ /dev/null
@@ -1,1016 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union_branch.h"
-
-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); // save the 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)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "visit_enum - "
- "bad context information\n"
- ), -1);
- }
- 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
- {
- // 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 inline operations for this anonymous array type
- ctx.state (TAO_CodeGen::TAO_ARRAY_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_array - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_array - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- // 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 (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->fullname (),
- bt->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname, "_%s", bt->fullname ());
- }
- }
- else
- {
- // typedefed node
- ACE_OS::sprintf (fname, "%s", bt->fullname ());
- }
-
- // set method
- os->indent (); // start from current indentation
- *os << "// accessor to set the member" << be_nl
- << "ACE_INLINE void" << be_nl
- << bu->name () << "::" << ub->local_name () << " (" << fname
- << " val)// set" << be_nl
- << "{" << be_idt_nl;
- // set the discriminant to the appropriate label
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- *os << "// set the discriminant val" << be_nl;
-
- *os << "this->_reset (";
- ub->gen_label_value (os);
- *os << ", 0);" << be_nl
- << "this->disc_ = ";
- ub->gen_label_value (os);
- *os << ";" << be_nl;
-
- *os << "this->u_." << ub->local_name () << "_ = "
- << fname << "_dup (val);" << be_uidt_nl;
- }
- else
- {
- // default label
- // XXXASG - TODO
- }
- *os << "}" << be_nl;
-
- // get method
- *os << "// retrieve the member" << be_nl
- << "ACE_INLINE " << fname << "_slice *" << 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 << "}\n\n";
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_enum (be_enum *node)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "visit_enum - "
- "bad context information\n"
- ), -1);
- }
- os = this->ctx_->stream ();
-
- // set method
- os->indent (); // start from current indentation
- *os << "// accessor to set the member" << be_nl
- << "ACE_INLINE void" << be_nl
- << bu->name () << "::" << ub->local_name () << " (" << bt->name ()
- << " val)// set" << be_nl
- << "{\n";
- os->incr_indent ();
- // set the discriminant to the appropriate label
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- *os << "// set the discriminant val" << be_nl;
-
- *os << "this->_reset (";
- ub->gen_label_value (os);
- *os << ", 0);" << be_nl
- << "this->disc_ = ";
- ub->gen_label_value (os);
- *os << ";" << be_nl;
-
- *os << "// set the value" << be_nl
- << "this->u_." << ub->local_name () << "_ = val;\n";
- }
- else
- {
- // default label
- // XXXASG - TODO
- }
- os->decr_indent ();
- *os << "}" << be_nl;
-
- // get method
- *os << "// retrieve the member" << be_nl
- << "ACE_INLINE " << bt->name () << be_nl
- << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl
- << "{\n";
- os->incr_indent ();
- *os << "return this->u_." << ub->local_name () << "_;\n";
- os->decr_indent ();
- *os << "}\n\n";
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_interface (be_interface *node)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "visit_interface - "
- "bad context information\n"
- ), -1);
- }
- os = this->ctx_->stream ();
-
- // set method
- os->indent (); // start from current indentation
- *os << "// accessor to set the member" << be_nl
- << "ACE_INLINE void" << be_nl
- << bu->name () << "::" << ub->local_name () << " (" << bt->name ()
- << "_ptr val)// set" << be_nl
- << "{\n";
- os->incr_indent ();
- // set the discriminant to the appropriate label
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- *os << "// set the discriminant val" << be_nl;
- *os << "this->_reset (";
- ub->gen_label_value (os);
- *os << ", 0);" << be_nl
- << "this->disc_ = ";
- ub->gen_label_value (os);
- *os << ";" << be_nl;
-
- *os << "this->u_." << ub->local_name ()
- << "_ = new TAO_Object_Field_T<"
- << bt->nested_type_name (bu, "") << ",";
- // Must use another statement, nested_type_name has side effects...
- *os << bt->nested_type_name (bu, "_var")
- << "> (" << bt->name ()
- << "::_duplicate (val));" << be_uidt_nl;
- }
- else
- {
- // default label
- // XXXASG - TODO
- }
- *os << "}" << be_nl;
-
- // get method
- *os << "// retrieve the member" << be_nl
- << "ACE_INLINE " << bt->name () << "_ptr " << be_nl
- << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl
- << "{\n";
- os->incr_indent ();
- *os << "return this->u_." << ub->local_name () << "_->ptr ();\n";
- os->decr_indent ();
- *os << "}\n\n";
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "visit_interface - "
- "bad context information\n"
- ), -1);
- }
- os = this->ctx_->stream ();
-
- // set method
- os->indent (); // start from current indentation
- *os << "// accessor to set the member" << be_nl
- << "ACE_INLINE void" << be_nl
- << bu->name () << "::" << ub->local_name () << " (" << bt->name ()
- << "_ptr val)// set" << be_nl
- << "{\n";
- os->incr_indent ();
- // set the discriminant to the appropriate label
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- *os << "// set the discriminant val" << be_nl;
- *os << "this->_reset (";
- ub->gen_label_value (os);
- *os << ", 0);" << be_nl
- << "this->disc_ = ";
- ub->gen_label_value (os);
- *os << ";" << be_nl;
-
- *os << "this->u_." << ub->local_name ()
- << "_ = new TAO_Object_Field_T<"
- << bt->nested_type_name (bu, "") << ",";
- // Must use another statement, nested_type_name has side effects...
- *os << bt->nested_type_name (bu, "") << "_var"
- << "> (" << bt->name ()
- << "::_duplicate (val));" << be_uidt_nl;
- }
- else
- {
- // default label
- // XXXASG - TODO
- }
- *os << "}" << be_nl;
-
- // get method
- *os << "// retrieve the member" << be_nl
- << "ACE_INLINE " << bt->name () << "_ptr " << be_nl
- << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl
- << "{\n";
- os->incr_indent ();
- *os << "return this->u_." << ub->local_name () << "_->ptr ();\n";
- os->decr_indent ();
- *os << "}\n\n";
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "visit_interface - "
- "bad context information\n"
- ), -1);
- }
- os = this->ctx_->stream ();
-
- // set method
- os->indent (); // start from current indentation
- *os << "// accessor to set the member" << be_nl
- << "ACE_INLINE void" << be_nl
- << bu->name () << "::" << ub->local_name () << " (" << bt->name ();
- if (node->pt () == AST_PredefinedType::PT_pseudo)
- *os << "_ptr";
- *os << " val) // set" << be_nl
- << "{" << be_idt_nl;
- // set the discriminant to the appropriate label
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- *os << "// set the discriminant val" << be_nl;
- *os << "this->_reset (";
- ub->gen_label_value (os);
- *os << ", 0);" << be_nl
- << "this->disc_ = ";
- ub->gen_label_value (os);
- *os << ";" << be_nl;
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- if (!ACE_OS::strcmp (node->local_name ()->get_string (), "Object"))
- {
- *os << "this->u_." << ub->local_name () << "_ = new "
- << "TAO_Object_Field_T<CORBA::Object,"
- << "CORBA::Object_var> (CORBA::Object::_duplicate (val));"
- << be_uidt_nl;
- }
- else
- {
- *os << "this->u_." << ub->local_name () << "_ = "
- << bt->name () << "::_duplicate (val);" << be_uidt_nl;
- }
- break;
-
- case AST_PredefinedType::PT_any:
- *os << "this->u_." << ub->local_name () << "_ = new "
- << bt->name () << " (val);" << 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;
- }
- }
- else
- {
- // default label
- // XXXASG - TODO
- }
- *os << "}" << be_nl;
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- // get method
- *os << "// retrieve the member" << be_nl
- << "ACE_INLINE " << bt->name () << "_ptr" << be_nl;
- *os << bu->name () << "::" << ub->local_name ()
- << " (void) const" << be_nl
- << "{" << be_idt_nl;
- if (!ACE_OS::strcmp (bt->local_name ()->get_string (), "Object"))
- {
- *os << "return this->u_." << ub->local_name ()
- << "_->ptr ();" << be_uidt_nl;
- }
- else
- {
- *os << "return this->u_." << ub->local_name ()
- << "_;" << be_uidt_nl;
- }
- *os << "}\n\n";
- break;
- case AST_PredefinedType::PT_any:
- // get method with read-only access
- *os << "// retrieve the member" << be_nl
- << "ACE_INLINE const " << bt->name () << be_nl;
- *os << bu->name () << "::" << ub->local_name ()
- << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}" << be_nl;
-
- // get method with read/write access
- *os << "// retrieve the member" << be_nl
- << "ACE_INLINE " << bt->name () << be_nl;
- *os << bu->name () << "::" << ub->local_name ()
- << " (void)" << be_nl
- << "{" << be_idt_nl
- << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}\n\n";
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- // get method
- *os << "// retrieve the member" << be_nl
- << "ACE_INLINE " << bt->name () << be_nl;
- *os << bu->name () << "::" << ub->local_name ()
- << " (void) const" << be_nl
- << "{" << be_idt_nl
- << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}\n\n";
- }
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "visit_sequence - "
- "bad context information\n"
- ), -1);
- }
- 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
- {
- // 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 inline operations for this anonymous sequence type
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_sequence - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_sequence - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- // (1) set from a const
- *os << "// accessor to set the member" << be_nl
- << "ACE_INLINE void" << be_nl
- << bu->name () << "::" << ub->local_name ()
- << " (const " << bt->name () << " &val)" << be_nl
- << "{" << be_idt_nl;
-
- // set the discriminant to the appropriate label
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- *os << "// set the discriminant val" << be_nl;
- *os << "this->_reset (";
- ub->gen_label_value (os);
- *os << ", 0);" << be_nl
- << "this->disc_ = ";
- ub->gen_label_value (os);
- *os << ";" << be_nl;
-
- *os << "this->u_." << ub->local_name () << "_ = new "
- << bt->name () << " (val);" << be_uidt_nl;
- }
- else
- {
- // default label
- // XXXASG - TODO
- }
- *os << "}" << be_nl;
-
- // readonly get method
- *os << "// readonly get method " << be_nl
- << "ACE_INLINE 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;
-
- // read/write get method
- *os << "// read/write get method " << be_nl
- << "ACE_INLINE " << bt->name () << " &" << be_nl
- << bu->name () << "::" << ub->local_name () << " (void)" << be_nl
- << "{" << be_idt_nl
- << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}\n\n";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_string (be_string *)
-{
- 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_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*
- os->indent (); // start from current indentation
- *os << "// accessor to set the member" << be_nl
- << "ACE_INLINE void" << be_nl
- << bu->name () << "::" << ub->local_name () << " (char *val)"
- << be_nl
- << "{" << be_idt_nl;
- // set the discriminant to the appropriate label
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- *os << "// set the discriminant val" << be_nl;
- *os << "this->_reset (";
- ub->gen_label_value (os);
- *os << ", 0);" << be_nl
- << "this->disc_ = ";
- ub->gen_label_value (os);
- *os << ";" << be_nl;
-
- *os << "// set the value" << be_nl
- << "this->u_." << ub->local_name () << "_ = val;" << be_uidt_nl;
- }
- else
- {
- // default label
- // XXXASG - TODO
- }
- *os << "}" << be_nl;
-
- // (2) set method from const char *
- *os << "// accessor to set the member" << be_nl
- << "ACE_INLINE void" << be_nl
- << bu->name () << "::" << ub->local_name ()
- << " (const char *val)" << be_nl
- << "{\n";
- os->incr_indent ();
- // set the discriminant to the appropriate label
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- *os << "// set the discriminant val" << be_nl;
- *os << "this->_reset (";
- ub->gen_label_value (os);
- *os << ", 0);" << be_nl
- << "this->disc_ = ";
- ub->gen_label_value (os);
- *os << ";" << be_nl;
-
- *os << "// set the value" << be_nl
- << "this->u_." << ub->local_name () << "_ = "
- << "CORBA::string_dup (val);" << be_uidt_nl;
- }
- else
- {
- // default label
- // XXXASG - TODO
- }
-
- *os << "}" << be_nl;
-
- // (3) set from const String_var&
- *os << "// accessor to set the member" << be_nl
- << "ACE_INLINE void" << be_nl
- << bu->name () << "::" << ub->local_name ()
- << " (const CORBA::String_var &val)" << be_nl
- << "{" << be_idt_nl;
- // set the discriminant to the appropriate label
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- *os << "// set the discriminant val" << be_nl;
- *os << "this->_reset (";
- ub->gen_label_value (os);
- *os << ", 0);" << be_nl
- << "this->disc_ = ";
- ub->gen_label_value (os);
- *os << ";" << be_nl;
-
- *os << "// set the value" << be_nl
- << "CORBA::String_var " << ub->local_name ()
- << "_var = val;" << be_nl
- << "this->u_." << ub->local_name () << "_ = "
- << ub->local_name () << "_var._retn ();" << be_uidt_nl;
- }
- else
- {
- // default label
- // XXXASG - TODO
- }
- *os << "}" << be_nl;
-
- // get method
- *os << "ACE_INLINE const char *" << be_nl
- << bu->name () << "::" << ub->local_name ()
- << " (void) const // get method" << be_nl
- << "{" << be_idt_nl
- << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}\n\n";
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::visit_structure (be_structure *node)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "visit_structure - "
- "bad context information\n"
- ), -1);
- }
- 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
- {
- // 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 enum declaration
- ctx.state (TAO_CodeGen::TAO_STRUCT_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_structure - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_structure - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- // (1) set from a const
- *os << "// accessor to set the member" << be_nl
- << "ACE_INLINE void" << be_nl
- << bu->name () << "::" << ub->local_name ()
- << " (const " << bt->name () << " &val)" << be_nl
- << "{" << be_idt_nl;
-
- // set the discriminant to the appropriate label
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- *os << "// set the discriminant val" << be_nl;
- *os << "this->_reset (";
- ub->gen_label_value (os);
- *os << ", 0);" << be_nl
- << "this->disc_ = ";
- ub->gen_label_value (os);
- *os << ";" << be_nl;
-
- if (bt->size_type () == be_type::VARIABLE)
- {
- *os << "this->u_." << ub->local_name () << "_ = new "
- << bt->name () << " (val);" << be_uidt_nl;
- }
- else
- {
- *os << "this->u_." << ub->local_name () << "_ = val;" << be_uidt_nl;
- }
- }
- else
- {
- // default label
- // XXXASG - TODO
- }
- *os << "}" << be_nl;
-
- // readonly get method
- *os << "// readonly get method " << be_nl
- << "ACE_INLINE const " << bt->name () << " &" << be_nl
- << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl
- << "{" << be_idt_nl;
- if (bt->size_type () == be_type::VARIABLE)
- *os << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl;
- else
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
- *os << "}" << be_nl;
-
- // read/write get method
- *os << "// read/write get method " << be_nl
- << "ACE_INLINE " << bt->name () << " &" << be_nl
- << bu->name () << "::" << ub->local_name () << " (void)" << be_nl
- << "{" << be_idt_nl;
- if (bt->size_type () == be_type::VARIABLE)
- *os << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl;
- else
- *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl;
- *os << "}\n\n";
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_ci::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_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)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "visit_union - "
- "bad context information\n"
- ), -1);
- }
- 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
- {
- // 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 enum declaration
- ctx.state (TAO_CodeGen::TAO_UNION_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_union - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_ci::"
- "visit_union - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- // (1) set from a const
- *os << "// accessor to set the member" << be_nl
- << "ACE_INLINE void" << be_nl
- << bu->name () << "::" << ub->local_name ()
- << " (const " << bt->name () << " &val)" << be_nl
- << "{" << be_idt_nl;
- if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
- {
- *os << "// set the discriminant val" << be_nl;
- *os << "this->_reset (";
- ub->gen_label_value (os);
- *os << ", 0);" << be_nl
- << "this->disc_ = ";
- ub->gen_label_value (os);
- *os << ";" << be_nl;
-
- *os << "this->u_."
- << ub->local_name () << "_ = new " << bt->name ()
- << " (val);" << be_nl;
- }
- else
- {
- // default label
- // XXXASG - TODO
- }
- *os << "}" << be_nl;
-
- // readonly get method
- *os << "// readonly get method " << be_nl
- << "ACE_INLINE 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;
-
- // read/write get method
- *os << "// read/write get method " << be_nl
- << "ACE_INLINE " << bt->name () << " &" << be_nl
- << bu->name () << "::" << ub->local_name () << " (void)" << be_nl
- << "{" << be_idt_nl
- << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl
- << "}\n\n";
-
- 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 5d8424c9b92..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_cs.cpp
+++ /dev/null
@@ -1,261 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// public_cs.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Union Branch in the client stubs
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union_branch.h"
-
-ACE_RCSID(be_visitor_union_branch, public_cs, "$Id$")
-
-
-// **********************************************
-// visitor for union_branch in the client stubs file
-// **********************************************
-
-// constructor
-be_visitor_union_branch_public_cs::be_visitor_union_branch_public_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-// destructor
-be_visitor_union_branch_public_cs::~be_visitor_union_branch_public_cs (void)
-{
-}
-
-// visit the union_branch node
-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); // save the 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;
-}
-
-// visit array type
-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 () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // anonymous array case
-
- // 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 inline operations for this anonymous array type
- ctx.state (TAO_CodeGen::TAO_ARRAY_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_array - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_array - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- return 0;
-}
-
-// visit enum type
-int
-be_visitor_union_branch_public_cs::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); // set the node to be the node being visited. The scope is
- // still the same
-
- // generate the typcode for enums
- ctx.state (TAO_CodeGen::TAO_ENUM_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit sequence type
-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 () // not a typedef
- && node->is_child (this->ctx_->scope ()))
- {
- // anonymous array case
-
- // 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 inline operations for this anonymous sequence type
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_sequence - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_sequence - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- return 0;
-}
-
-// visit string type
-int
-be_visitor_union_branch_public_cs::visit_string (be_string *)
-{
- return 0;
-}
-
-// visit structure type
-int
-be_visitor_union_branch_public_cs::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); // set the node to be the node being visited. The scope is
- // still the same
-
- // generate the inline code for structs
- ctx.state (TAO_CodeGen::TAO_STRUCT_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_struct - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_struct - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit union type
-int
-be_visitor_union_branch_public_cs::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); // set the node to be the node being visited. The scope is
- // still the same
-
- // generate the inline code for union
- ctx.state (TAO_CodeGen::TAO_UNION_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_union - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_union_branch_public_cs::"
- "visit_union - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- 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 77c3b394789..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp
+++ /dev/null
@@ -1,434 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_union_branch.h"
-
-ACE_RCSID(be_visitor_union_branch, public_reset_cs, "$Id$")
-
-
-// *****************************************************
-// visitor for union_branch in the client
-// stubs file for the reset method
-// *****************************************************
-
-// constructor
-be_visitor_union_branch_public_reset_cs::
-be_visitor_union_branch_public_reset_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
-}
-
-// destructor
-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;
- be_type *bt; // union_branch's type
-
- os = this->ctx_->stream ();
- // 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_union_branch_cs::"
- "visit_union_branch - "
- "Bad union_branch type\n"
- ), -1);
- }
-
- this->ctx_->node (node); // save the node
-
- 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;
-}
-
-// =visit operations on all possible data types that a union_branch can be
-
-int
-be_visitor_union_branch_public_reset_cs::visit_array (be_array *node)
-{
- TAO_OutStream *os; // output stream
- 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_reset_cs::"
- "visit_enum - "
- "bad context information\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 (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->fullname (),
- bt->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname, "_%s", bt->fullname ());
- }
- }
- else
- {
- // typedefed node
- ACE_OS::sprintf (fname, "%s", bt->fullname ());
- }
-
- 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_nl;
- 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 (); // 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_reset_cs::"
- "visit_enum - "
- "bad context information\n"
- ), -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- *os << "break;" << be_uidt_nl;
-
- 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 (); // 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_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_nl;
-
- 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 (); // 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_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_nl;
-
- 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 (); // 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_reset_cs::"
- "visit_predefined_type - "
- "bad context information\n"
- ), -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- if (!ACE_OS::strcmp (node->local_name ()->get_string (), "Object"))
- {
- *os << "delete this->u_."
- << ub->local_name () << "_;" << be_nl;
- }
- else
- {
- *os << "CORBA::release (this->u_."
- << ub->local_name () << "_);" << be_nl;
- }
- *os << "this->u_." << ub->local_name ()
- << "_ = 0;" << be_nl
- << "break;" << be_uidt_nl;
- 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_nl;
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- *os << "break;" << be_uidt_nl;
- }
- 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 (); // 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_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_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_reset_cs::visit_string (be_string *)
-{
- 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_reset_cs::"
- "visit_string - "
- "bad context information\n"
- ), -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
- *os << "CORBA::string_free (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_structure (be_structure *node)
-{
- TAO_OutStream *os; // output stream
- 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_reset_cs::"
- "visit_structure - "
- "bad context information\n"
- ), -1);
- }
- os = this->ctx_->stream ();
- if (bt->size_type () == be_type::VARIABLE)
- {
- *os << "delete this->u_." << ub->local_name ()
- << "_;" << be_nl
- << "this->u_."
- << ub->local_name ()
- << "_ = 0;" << be_nl;
- }
-
- *os << "break;" << be_uidt_nl;
-
- return 0;
-}
-
-int
-be_visitor_union_branch_public_reset_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_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 (); // 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_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_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 200b28a3b64..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype.cpp
+++ /dev/null
@@ -1,50 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#ifdef IDL_HAS_VALUETYPE
-
-#include "be_visitor_valuetype.h"
-
-#include "be_visitor_valuetype/valuetype.cpp"
-#include "be_visitor_valuetype/valuetype_ch.cpp"
-#include "be_visitor_valuetype/valuetype_obv_ch.cpp"
-#include "be_visitor_valuetype/valuetype_obv_cs.cpp"
-#include "be_visitor_valuetype/valuetype_ci.cpp"
-#include "be_visitor_valuetype/valuetype_cs.cpp"
-//#include "be_visitor_valuetype/valuetype_ih.cpp"
-//#include "be_visitor_valuetype/valuetype_is.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_ci.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_cs.cpp"
-#include "be_visitor_valuetype/field_cdr_ci.cpp"
-#include "be_visitor_valuetype/obv_module.cpp"
-
-#endif /* IDL_HAS_VALUETYPE */
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 c5538060056..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp
+++ /dev/null
@@ -1,220 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_operation.h"
-
-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_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)
-{
-}
-
-int
-be_visitor_obv_operation_arglist::visit_operation (be_operation *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << " (";
- // *os << " (" << be_idt << be_idt << "\n";
-
- // 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);
- }
-
-
- // *os << be_uidt;
- // os->indent ();
- *os << ")";// << be_uidt;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_CH:
- // each method is pure virtual in the Valuetype class
- *os << " = 0;\n";
- break;
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IH:
- break;
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IS:
- break;
- default:
- *os << "\n";
- }
- if (!this->ctx_->attribute ()) // hack to get a nice newline
- *os << "\n";
- return 0;
-}
-
-int
-be_visitor_obv_operation_arglist::visit_argument (be_argument *node)
-{
- // TAO_OutStream *os = this->ctx_->stream ();
-
- // 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
- // %! use AST_Interface
- be_valuetype *intf;
- intf = this->ctx_->attribute ()
- ? be_valuetype::narrow_from_scope (this->ctx_->attribute ()->defined_in ())
- : be_valuetype::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); // set new scope
-
- // snipped from
- // be_visitor_args_arglist::visit_argument (be_argument *node)
- 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);
- }
-
- // os->indent (); // start with current indentation level
-
- // Different types have different mappings when used as in/out or
- // inout parameters. Let this visitor deal with the type
-
- // end of be_visitor_args_arglist::visit_argument ()
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_CH:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_ARGLIST_CH);
- break;
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_OTHERS:
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_SH:
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IH:
- case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_ARGLIST_OTHERS);
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arglist::"
- "visit_argument - "
- "Bad context\n"),
- -1);
- }
- }
-
- // grab a visitor
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arglist::"
- "visit_argument - "
- "Bad visitor\n"),
- -1);
- }
- if (bt->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_arglist::"
- "visit_argument - "
- "codegen for argument failed\n"),
- -1);
- }
- delete visitor;
- 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_OTHERS:
- 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 << ", "; // "\n";
- else
- *os << ""; // "\n";
- 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 eb01d5ff6c4..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ch.cpp
+++ /dev/null
@@ -1,74 +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
-//
-// ============================================================================
-
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_valuetype.h"
-
-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->cli_hdr_cdr_op_gen () || node->imported ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // generate the CDR << and >> operator declarations (prototypes)
-
- os->indent ();
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator<< (TAO_OutputCDR &, const " << node->name ()
- << " *); // " << be_nl;
- *os << "CORBA::Boolean " << idl_global->export_macro ()
- << " operator>> (TAO_InputCDR &, "
- << node->name () << " *&);\n";
-
- // set the substate as generating code for the types defined in our scope
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
- // 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_valuetype_cdr_op_ch::"
- "visit_valuetype - "
- "codegen for scope failed\n"), -1);
- }
-
-
- node->cli_hdr_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ci.cpp
deleted file mode 100644
index 5c0b7513f77..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ci.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// cdr_op_ci.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
-//
-// ============================================================================
-
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_valuetype.h"
-// #include "be_visitor_field.h"
-
-ACE_RCSID(be_visitor_valuetype, cdr_op_ci, "$Id$")
-
-be_visitor_valuetype_cdr_op_ci::be_visitor_valuetype_cdr_op_ci
-(be_visitor_context *ctx)
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_cdr_op_ci::~be_visitor_valuetype_cdr_op_ci (void)
-{
-}
-
-int
-be_visitor_valuetype_cdr_op_ci::visit_valuetype (be_valuetype *node)
-{
- // already generated and/or we are imported. Don't do anything.
- if (node->cli_inline_cdr_op_gen () || node->imported ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // First generate code for our children. The reason we do this first is
- // because the inlined code for our children must be available before we use
- // it in our parent
-
- // set the substate as generating code for the types defined in our scope
- //this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE);
- // 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_valuetype_cdr_op_ci"
- "::visit_valuetype - "
- "codegen for scope failed\n"), -1);
- }
-
- // set the sub state as generating code for the output operator
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT);
- os->indent ();
- *os << "ACE_INLINE CORBA::Boolean" << be_nl
- << "operator<< (TAO_OutputCDR &strm, const "
- << node->name ()
- << " *_tao_valuetype)" << be_nl
- << "{" << be_idt_nl;
- *os << "return CORBA_ValueBase::_tao_marshal (strm," << be_idt_nl
- << "ACE_const_cast (" << node->name () << "*, _tao_valuetype)," << be_nl
- << "(ptr_arith_t) &" << node->name() <<"::_downcast);"
- << be_uidt<< be_uidt_nl
- << "}\n\n";
-
- // set the substate as generating code for the input operator
- //this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT);
- *os << "ACE_INLINE CORBA::Boolean" << be_nl
- << "operator>> (TAO_InputCDR &strm, "
- << node->name ()
- << " *&_tao_valuetype)" << be_nl
- << "{" << be_idt_nl;
- *os << "return " << node->name() << "::_tao_unmarshal (strm, _tao_valuetype);"
-#ifdef obv_marshal_old_version
- *os << "CORBA::ValueBase *ptr;" << be_nl
- << "int retval = CORBA_ValueBase::_tao_unmarshal (strm,"
- << be_idt_nl << "ptr, (ptr_arith_t) &" << node->name() <<"::_downcast);"
- << be_uidt_nl
- << "if (retval) {" << be_idt_nl
- << "_tao_valuetype = " << node->name() << "::_downcast (ptr);"
- << be_nl << "if (_tao_valuetype) retval = 1;"
- << be_uidt_nl << "}" << be_idt_nl
- << "return retval;"
-#endif /* obv_marshal_old_version */
- << be_uidt_nl
- << "}\n\n";
-
- if (!node->is_abstract_valuetype ())
- { // functions that marshal state
- be_visitor_context* new_ctx =
- new be_visitor_context (*this->ctx_);
- be_visitor_valuetype_marshal_cs visitor (new_ctx);
- visitor.visit_valuetype (node);
- }
-
- node->cli_inline_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ci.cpp
deleted file mode 100644
index d8288c7af99..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ci.cpp
+++ /dev/null
@@ -1,947 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// field_cdr_ci.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_ci.cpp
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_field.h"
-
-ACE_RCSID(be_visitor_valuetype, field_cdr_op_ci, "$Id$")
-
-
-// **********************************************
-// visitor for field in the client stubs file
-// **********************************************
-
-// constructor
-be_visitor_valuetype_field_cdr_ci::be_visitor_valuetype_field_cdr_ci (be_visitor_context *ctx)
- : be_visitor_decl (ctx),
- pre_ (""), post_ ("")
-{
-}
-
-// destructor
-be_visitor_valuetype_field_cdr_ci::~be_visitor_valuetype_field_cdr_ci (void)
-{
-}
-
-// visit the field node
-int
-be_visitor_valuetype_field_cdr_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_valuetype_field_cdr_ci::"
- "visit_field - "
- "Bad field type\n"
- ), -1);
- }
-
- this->ctx_->node (node); // save the node
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ci::"
- "visit_field - "
- "codegen for field type failed\n"
- ), -1);
- }
- return 0;
-}
-
-// visit array
-int
-be_visitor_valuetype_field_cdr_ci::visit_array (be_array *node)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "visit_array - "
- "cannot retrieve field 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->fullname (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname, "_%s", node->fullname ());
- }
- }
- else
- {
- // typedefed node
- ACE_OS::sprintf (fname, "%s", node->fullname ());
- }
-
- // 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_" << pre_ << f->local_name () << post_ << ")";
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << "
- << "_tao_" << pre_ << f->local_name () << 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_ci::"
- "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. Generate the <<, >> operators
- // for the type defined by the anonymous array
-
- // 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 declaration
- ctx.state (TAO_CodeGen::TAO_ARRAY_CDR_OP_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ci::"
- "visit_array - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ci::"
- "visit_array - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit enum type
-int
-be_visitor_valuetype_field_cdr_ci::visit_enum (be_enum *node)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "visit_array - "
- "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 >> " << pre_ << f->local_name () << post_ << ")";
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << pre_ << f->local_name () << 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_ci::"
- "visit_enum - "
- "bad sub state\n"
- ), -1);
- }
-
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the typcode for enums
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ci::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ci::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit interface type
-int
-be_visitor_valuetype_field_cdr_ci::visit_interface (be_interface *)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "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 >> " << pre_ << f->local_name () << post_ << ".out ())";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << pre_ << f->local_name () << post_ << ".in ())";
- 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_ci::"
- "visit_interface - "
- "bad sub state\n"
- ), -1);
- }
- return 0;
-}
-
-// visit interface forward type
-int
-be_visitor_valuetype_field_cdr_ci::visit_interface_fwd (be_interface_fwd *)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "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 >> " << pre_ << f->local_name () << post_ << ").out ()";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << pre_ << f->local_name () << post_ << ").in ()";
- 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_ci::"
- "visit_interface_fwd - "
- "bad sub state\n"
- ), -1);
- }
- return 0;
-}
-
-// visit valuetype type
-int
-be_visitor_valuetype_field_cdr_ci::visit_valuetype (be_valuetype *)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "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 >> " << pre_ << f->local_name () << post_ << ".out ())";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << pre_ << f->local_name () << post_ << ".in ())";
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // nothing to be done because an valuetype cannit be declared inside a
- // structure
- break;
- default:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ci::"
- "visit_valuetype - "
- "bad sub state\n"
- ), -1);
- }
- return 0;
-}
-
-// visit valuetype forward type
-int
-be_visitor_valuetype_field_cdr_ci::visit_valuetype_fwd (be_valuetype_fwd *)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "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 >> " << pre_ << f->local_name () << post_ << ").out ()";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << pre_ << f->local_name () << post_ << ").in ()";
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // nothing to be done because an valuetype cannit be declared inside a
- // structure
- break;
- default:
- // error
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ci::"
- "visit_valuetype_fwd - "
- "bad sub state\n"
- ), -1);
- }
- return 0;
-}
-
-// visit predefined type
-int
-be_visitor_valuetype_field_cdr_ci::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "visit_predefined_type - "
- "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:
- // is a psuedo obj
- if (node->pt () == AST_PredefinedType::PT_pseudo)
- *os << "(strm >> " << pre_ << f->local_name () << post_
- << ".out ())";
- else if (node->pt () == AST_PredefinedType::PT_char)
- *os << "(strm >> CORBA::Any::to_char (" << pre_
- << f->local_name () << post_ << "))";
- else if (node->pt () == AST_PredefinedType::PT_wchar)
- *os << "(strm >> CORBA::Any::to_wchar (" << pre_
- << f->local_name () << post_ << "))";
- else if (node->pt () == AST_PredefinedType::PT_octet)
- *os << "(strm >> CORBA::Any::to_octet (" << pre_
- << f->local_name () << post_ << "))";
- else if (node->pt () == AST_PredefinedType::PT_boolean)
- *os << "(strm >> CORBA::Any::to_boolean (" << pre_
- << f->local_name () << post_ << "))";
- else
- *os << "(strm >> " << pre_ << f->local_name () << post_ << ")";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- // is a psuedo obj
- if (node->pt () == AST_PredefinedType::PT_pseudo)
- *os << "(strm << " << pre_ << f->local_name () << post_ << ".in ())";
- else if (node->pt () == AST_PredefinedType::PT_char)
- *os << "(strm << CORBA::Any::from_char (" << pre_
- << f->local_name () << post_ << "))";
- else if (node->pt () == AST_PredefinedType::PT_wchar)
- *os << "(strm << CORBA::Any::from_wchar (" << pre_
- << f->local_name () << post_ << "))";
- else if (node->pt () == AST_PredefinedType::PT_octet)
- *os << "(strm << CORBA::Any::from_octet (" << pre_
- << f->local_name () << post_ << "))";
- else if (node->pt () == AST_PredefinedType::PT_boolean)
- *os << "(strm << CORBA::Any::from_boolean (" << pre_
- << f->local_name () << post_ << "))";
- else
- *os << "(strm << " << pre_ << f->local_name () << 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_ci::"
- "visit_array - "
- "bad sub state\n"
- ), -1);
- }
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cdr_ci::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "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 >> " << pre_ << f->local_name () << post_ << ")";
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << pre_ << f->local_name () << 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_ci::"
- "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 structure
- {
- // Anonymous sequence
- // 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
-
- // generate the inline code for structs
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ci::"
- "visit_sequence - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ci::"
- "visit_sequence - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit string type
-int
-be_visitor_valuetype_field_cdr_ci::visit_string (be_string *)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "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 >> " << pre_ << f->local_name () << post_ << ".out ())";
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << pre_ << f->local_name () << 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_ci::"
- "visit_array - "
- "bad sub state\n"
- ), -1);
- }
-
- return 0;
-}
-
-// visit structure type
-int
-be_visitor_valuetype_field_cdr_ci::visit_structure (be_structure *node)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "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 >> " << pre_ << f->local_name () << post_ << ")";
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << pre_ << f->local_name () << 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_ci::"
- "visit_structure - "
- "bad sub state\n"
- ), -1);
- }
-
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the inline code for structs
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ci::"
- "visit_struct - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ci::"
- "visit_struct - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-// visit typedef type
-int
-be_visitor_valuetype_field_cdr_ci::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_ci::"
- "visit_typedef - "
- "Bad primitive type\n"
- ), -1);
- }
-
- this->ctx_->alias (0);
- return 0;
-}
-
-// visit union type
-int
-be_visitor_valuetype_field_cdr_ci::visit_union (be_union *node)
-{
- TAO_OutStream *os; // output stream
- 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_ci::"
- "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 >> " << pre_ << f->local_name () << post_ << ")";
- return 0;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << " << pre_ << f->local_name () << 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_ci::"
- "visit_union - "
- "bad sub state\n"
- ), -1);
- }
-
- if (node->node_type () != AST_Decl::NT_typedef // not a typedef
- && node->is_child (this->ctx_->scope ())) // node is defined inside the
- // structure
- {
- // 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
-
- // generate the inline code for union
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ci::"
- "visit_union - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cdr_ci::"
- "visit_union - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- 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); // save the 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;
-}
-
-// visit array
-int
-be_visitor_valuetype_field_cdr_decl::visit_array (be_array *node)
-{
- TAO_OutStream *os; // output stream
- 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 fullname 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->fullname (),
- node->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname, "_%s", node->fullname ());
- }
- }
- else
- {
- // typedefed node
- ACE_OS::sprintf (fname, "%s", node->fullname ());
- }
-
- // 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
- << "(ACE_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 - "
- "bad sub state\n"
- ), -1);
- }
- ACE_NOTREACHED (return 0);
-}
-
-// visit typedef type
-int
-be_visitor_valuetype_field_cdr_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 || (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 e88495def71..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp
+++ /dev/null
@@ -1,748 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be_visitor_valuetype, field_ch, "$Id$")
-
-
-// constructor
-be_visitor_valuetype_field_ch::be_visitor_valuetype_field_ch
- (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
- setenclosings ("",";");
-}
-
-// destructor
-be_visitor_valuetype_field_ch::~be_visitor_valuetype_field_ch (void)
-{
-}
-
-// visit the field node
-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
- 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)
-
-// visit array type
-int
-be_visitor_valuetype_field_ch::visit_array (be_array *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get state member
- be_decl *bu = this->ctx_->scope (); // get the enclosing union 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 (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_array - "
- "bad context information\n"
- ), -1);
- }
-
- 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
- {
- // this is the case of an anonymous array inside a union
-
- // 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 *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_array - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_array - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- // now use this array as a "type" for the subsequent declarator
- os->indent (); // start from current indentation
- // the set method
- *os << pre_op() << "void " << ub->local_name () << " ("
- << "_" << bt->local_name () << ")"
- << post_op() << " // set" << be_nl;
- // the get method
- *os << pre_op() << "const _" << bt->local_name ()
- << "_slice * " << ub->local_name ()
- << " (void)" << 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
- os->indent (); // start from current indentation
- // the set method
- *os << pre_op() << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu) << ")" << post_op() << " // set"
- << be_nl;
- // the get method
- *os << pre_op()
- << bt->nested_type_name (bu, "_slice *") << " " << ub->local_name ()
- << " (void)" << post_op() << be_nl;
- // the get (read/write) method
- *os << pre_op() << "const "
- << bt->nested_type_name (bu, "_slice *") << " " << ub->local_name ()
- << " (void) const" << post_op() << "\n\n";
- }
-
- return 0;
-}
-
-// visit enum type
-int
-be_visitor_valuetype_field_ch::visit_enum (be_enum *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get state member
- be_decl *bu = this->ctx_->scope (); // get the enclosing union node
- 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_ch::"
- "visit_enum - "
- "bad context information\n"
- ), -1);
- }
-
- 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
- {
- // 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 enum declaration
- ctx.state (TAO_CodeGen::TAO_ENUM_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_enum - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_enum - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- // now use this enum as a "type" for the subsequent declarator
- os->indent (); // start from current indentation
- // the set method
- *os << pre_op() << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu) << ")" << post_op() << " // set"
- << be_nl;
- // the get method
- *os << pre_op() << bt->nested_type_name (bu) << " " << ub->local_name ()
- << " (void) const" << post_op() << " // get method\n\n";
-
- return 0;
-}
-
-// visit interface type
-int
-be_visitor_valuetype_field_ch::visit_interface (be_interface *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get state member
- be_decl *bu = this->ctx_->scope (); // 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_valuetype_field_ch::"
- "visit_interface - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // set method
- *os << pre_op() << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu, "_ptr")
- << ")" << post_op() << " // set" << be_nl;
- // get method
- *os << pre_op()
- << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name ()
- << " (void) const" << post_op() << " // get method\n\n";
- return 0;
-}
-
-// visit interface forward type
-int
-be_visitor_valuetype_field_ch::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get state member
- be_decl *bu = this->ctx_->scope (); // 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_valuetype_field_ch::"
- "visit_interface_fwd - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // set method
- *os << pre_op() << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu, "_ptr")
- << ")" << post_op() << " // set" << be_nl;
- // get method
- *os << pre_op()
- << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name ()
- << " (void) const" << post_op() << " // get method\n\n";
- return 0;
-}
-
-// visit valuetype type
-int
-be_visitor_valuetype_field_ch::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get state member
- be_decl *bu = this->ctx_->scope (); // 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_valuetype_field_ch::"
- "visit_valuetype - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // set method
- *os << pre_op() << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu, "*")
- << ")" << post_op() << " // set" << be_nl;
- // get method
- *os << pre_op()
- << bt->nested_type_name (bu, "*") << " " << ub->local_name ()
- << " (void) const" << post_op() << " // get method\n\n";
- return 0;
-}
-
-// visit valuetype forward type
-int
-be_visitor_valuetype_field_ch::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get state member
- be_decl *bu = this->ctx_->scope (); // 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_valuetype_field_ch::"
- "visit_valuetype_fwd - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent (); // start from current indentation
- // set method
- *os << pre_op() << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu, "*")
- << ")" << post_op() << " // set" << be_nl;
- // get method
- *os << pre_op()
- << bt->nested_type_name (bu, "*") << " " << ub->local_name ()
- << " (void) const" << post_op() << " // get method\n\n";
- return 0;
-}
-
-// visit predefined type
-int
-be_visitor_valuetype_field_ch::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get state member
- be_decl *bu = this->ctx_->scope (); // 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_valuetype_field_ch::"
- "visit_predefined_type - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
- os->indent (); // start from current indentation
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- // set method
- *os << pre_op() << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu, "_ptr") << ")"
- << post_op() << " // set" << be_nl;
- // get method
- *os << pre_op()
- << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name ()
- << " (void) const" << post_op() << " // get method\n\n";
- break;
- case AST_PredefinedType::PT_any:
- // set method
- *os << pre_op() << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu) << ")"
- << post_op() << " // set" << be_nl;
- // get method (read-only)
- *os << pre_op() << "const " << bt->nested_type_name (bu) << " "
- << ub->local_name () << " (void) const"
- << post_op() << " // get method\n\n";
- // get method (read/write)
- *os << pre_op() << bt->nested_type_name (bu) << " "
- << ub->local_name () << " (void)"
- << post_op() << " // get method\n\n";
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- // set method
- *os << pre_op() << "void " << ub->local_name () << " ("
- << bt->nested_type_name (bu) << ")"
- << post_op() << " // set" << be_nl;
- // get method
- *os << pre_op() << bt->nested_type_name (bu) << " " << ub->local_name ()
- << " (void) const" << post_op() << " // get method\n\n";
- }
- return 0;
-}
-
-// visit sequence type
-int
-be_visitor_valuetype_field_ch::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get state member
- be_decl *bu = this->ctx_->scope (); // 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_valuetype_field_ch::"
- "visit_sequence - "
- "bad context information\n"
- ), -1);
- }
-
- 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
- {
- // 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 sequence declaration
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_sequence - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_sequence - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- os->indent ();
- // set method
- *os << pre_op() << "void " << ub->local_name () << " (const "
- << bt->nested_type_name (bu) << " &)"
- << post_op() << " // set" << be_nl;
- // read-only
- *os << pre_op() << "const " << bt->nested_type_name (bu) << " &"
- << ub->local_name () << " (void) const"
- << post_op() << " // get method (read only)" << be_nl;
- // read/write
- *os << pre_op() << bt->nested_type_name (bu) << " &" << ub->local_name ()
- << " (void)"
- << post_op() << " // get method (read/write only)\n\n";
-
- return 0;
-}
-
-// visit string type
-int
-be_visitor_valuetype_field_ch::visit_string (be_string *)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get state member
- be_decl *bu = this->ctx_->scope (); // get the enclosing union backend
-
- if (!ub || !bu)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_string - "
- "bad context information\n"
- ), -1);
- }
-
- os = this->ctx_->stream ();
-
- os->indent ();
- // three methods to set the string value
- *os << pre_op()
- << "void " << ub->local_name () << " (char *)"
- << post_op() << " // set" << be_nl;
- *os << pre_op()
- << "void " << ub->local_name () << " (const char *)"
- << post_op() << " // set" << be_nl;
- *os << pre_op()
- << "void " << ub->local_name () << " (const CORBA::String_var&)"
- << post_op() << " // set" << be_nl;
- //get method
- *os << pre_op() << "const char *" << ub->local_name ()
- << " (void) const" << post_op() << " // get method\n\n";
- return 0;
-}
-
-// visit structure type
-int
-be_visitor_valuetype_field_ch::visit_structure (be_structure *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get state member
- be_decl *bu = this->ctx_->scope (); // 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_valuetype_field_ch::"
- "visit_structure - "
- "bad context information\n"
- ), -1);
- }
-
- 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
- {
- // 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 sequence declaration
- ctx.state (TAO_CodeGen::TAO_STRUCT_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_structure - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_structure - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- os->indent ();
- // set method
- *os << pre_op() << "void " << ub->local_name () << " (const "
- << bt->nested_type_name (bu) << " &)"
- << post_op() << " // set" << be_nl
- // read-only
- << pre_op() << "const " << bt->nested_type_name (bu) << " &"
- << ub->local_name () << " (void) const"
- << post_op() << " // get method (read only)" << be_nl
- // read/write
- << pre_op() << bt->nested_type_name (bu) << " &" << ub->local_name ()
- << " (void)" << post_op() << " // get method (read/write only)\n\n";
-
- return 0;
-}
-
-// visit typedefed type
-int
-be_visitor_valuetype_field_ch::visit_typedef (be_typedef *node)
-{
- TAO_OutStream *os; // output stream
-
- os = this->ctx_->stream ();
- os->indent (); // start from current indentation level
- this->ctx_->alias (node); // save the node for use in code generation and
- // indicate that the union_branch of the union_branch node
- // is a typedefed quantity
-
- // 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;
-}
-
-// visit union type
-int
-be_visitor_valuetype_field_ch::visit_union (be_union *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub = this->ctx_->node (); // get state member
- be_decl *bu = this->ctx_->scope (); // 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_valuetype_field_ch::"
- "visit_union - "
- "bad context information\n"
- ), -1);
- }
-
- 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
- {
- // 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 sequence declaration
- ctx.state (TAO_CodeGen::TAO_STRUCT_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_union - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_ch::"
- "visit_union - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
- os->indent ();
- // set method
- *os << pre_op() << "void " << ub->local_name () << " (const "
- << bt->nested_type_name (bu) << " &)"
- << post_op() << " // set" << be_nl
- // read-only
- << pre_op() << "const " << bt->nested_type_name (bu) << " &"
- << ub->local_name () << " (void) const"
- << post_op() << " // get method (read only)"
- << be_nl
- // read/write
- << pre_op() << bt->nested_type_name (bu) << " &" << ub->local_name ()
- << " (void)" << post_op() << " // get method (read/write only)\n\n";
-
- 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 ()
-{
- return pre_op_;
-}
-
-const char*
-be_visitor_valuetype_field_ch::post_op ()
-{
- return post_op_;
-}
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 b052358eae7..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp
+++ /dev/null
@@ -1,1050 +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 or inline file).
-//
-// = AUTHOR
-// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de>
-// derived from be_visitor_union_branch/public_ci.cpp
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_valuetype.h"
-
-ACE_RCSID(be_visitor_valuetype, field_cs, "$Id$")
-
-
-// constructor
-be_visitor_valuetype_field_cs::
-be_visitor_valuetype_field_cs (be_visitor_context *ctx)
- : be_visitor_decl (ctx),
- in_obv_space_ (0)
-{
- setenclosings ("");
-}
-
-// destructor
-be_visitor_valuetype_field_cs::
-~be_visitor_valuetype_field_cs (void)
-{
-}
-
-// visit the field node
-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); // save the 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 union_branch can be
-
-int
-be_visitor_valuetype_field_cs::visit_array (be_array *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub =
- this->ctx_->node (); // get field 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);
- }
- 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
- {
- // 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 inline operations for this anonymous array type
- ctx.state (TAO_CodeGen::TAO_ARRAY_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_array - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_array - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- // 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 (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->fullname (),
- bt->local_name ()->get_string ());
- }
- else
- {
- ACE_OS::sprintf (fname, "_%s", bt->fullname ());
- }
- }
- else
- {
- // typedefed node
- ACE_OS::sprintf (fname, "%s", bt->fullname ());
- }
-
- // set method
- os->indent (); // start from current indentation
- *os << "// accessor to set the member" << be_nl
- << this->pre_op() << "void" << be_nl;
- this->op_name(bu,os); *os << "::" << ub->local_name () << " (" << fname
- << " val)// set" << 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;
-
- // get method
- *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;
-
- // get method
- *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 << "}\n\n";
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_enum (be_enum *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub =
- this->ctx_->node (); // get field 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);
- }
- os = this->ctx_->stream ();
-
- // set method
- os->indent (); // start from current indentation
- *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)// set" << be_nl
- << "{\n";
- os->incr_indent ();
- *os << "this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << " = val;\n";
- os->decr_indent ();
- *os << "}" << be_nl;
-
- // get method
- *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
- << "{\n";
- os->incr_indent ();
- *os << "return this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << ";\n";
- os->decr_indent ();
- *os << "}\n\n";
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_interface (be_interface *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub =
- this->ctx_->node (); // get field 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);
- }
- os = this->ctx_->stream ();
-
- // set method
- os->indent (); // start from current indentation
- *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)// set" << be_nl
- << "{\n";
- os->incr_indent ();
- *os << "this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << " = val->duplicate ();" << be_uidt_nl;
- *os << "}" << be_nl;
-
- // get method
- *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
- << "{\n";
- os->incr_indent ();
- *os << "return this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << ".ptr ();\n";
- os->decr_indent ();
- *os << "}\n\n";
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub =
- this->ctx_->node (); // get field 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);
- }
- os = this->ctx_->stream ();
-
- // set method
- os->indent (); // start from current indentation
- *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)// set" << be_nl
- << "{\n";
- os->incr_indent ();
- *os << "this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << " = val->duplicate ();" << be_uidt_nl;
- *os << "}" << be_nl;
-
- // get method
- *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
- << "{\n";
- os->incr_indent ();
- *os << "return this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << ".ptr ();\n";
- os->decr_indent ();
- *os << "}\n\n";
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_valuetype (be_valuetype *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub =
- this->ctx_->node (); // get field 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);
- }
- os = this->ctx_->stream ();
-
- // set method
- os->indent (); // start from current indentation
- *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)// set" << be_nl
- << "{\n";
- os->incr_indent ();
- *os << "if (val) val->_add_ref ();" << be_nl
- << "this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << " = val;" << be_uidt_nl;
- *os << "}" << be_nl;
-
- // get method
- *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
- << "{\n";
- os->incr_indent ();
- *os << "return this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << ".ptr ();\n";
- os->decr_indent ();
- *os << "}\n\n";
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub =
- this->ctx_->node (); // get field 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);
- }
- os = this->ctx_->stream ();
-
- // set method
- os->indent (); // start from current indentation
- *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)// set" << be_nl
- << "{\n";
- os->incr_indent ();
- *os << "if (val) val->_add_ref ();" << be_nl
- << "this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << " = val;" << be_uidt_nl;
- *os << "}" << be_nl;
-
- // get method
- *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
- << "{\n";
- os->incr_indent ();
- *os << "return this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << ".ptr ();\n";
- os->decr_indent ();
- *os << "}\n\n";
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os; // output stream
-
- be_decl *ub =
- this->ctx_->node (); // get field 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);
- }
- os = this->ctx_->stream ();
-
- // set method
- os->indent (); // start from current indentation
- *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 ();
- if (node->pt () == AST_PredefinedType::PT_pseudo)
- *os << "_ptr";
- *os << " val) // set" << be_nl
- << "{" << be_idt_nl;
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- *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()
- << " = new "
- << bt->name () << " (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;
- }
- *os << "}" << be_nl;
-
- switch (node->pt ())
- {
- case AST_PredefinedType::PT_pseudo:
- // get method
- *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->u"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << ";" << be_uidt_nl
- << "}\n\n";
- break;
- case AST_PredefinedType::PT_any:
- // get method with read-only access
- *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;
-
- // get method with read/write access
- *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
- << "}\n\n";
- break;
- case AST_PredefinedType::PT_void:
- break;
- default:
- // get method
- *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
- << "}\n\n";
- }
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub =
- this->ctx_->node (); // get field 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);
- }
- 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
- {
- // 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 inline operations for this anonymous sequence type
- ctx.state (TAO_CodeGen::TAO_SEQUENCE_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_sequence - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_sequence - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- // (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()
- << " = new "
- << bt->name () << " (val);" << be_uidt_nl;
-
- *os << "}" << be_nl;
-
- // readonly get method
- *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->" // %! *this (seq_var, not seq member)
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << ";" << be_uidt_nl
- << "}" << be_nl;
-
- // read/write get method
- *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
- << "}\n\n";
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_string (be_string *)
-{
- be_decl *ub =
- this->ctx_->node (); // get field 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
-
- // (1) set method from char*
- os->indent (); // start from current indentation
- *os << "// accessor to set the member" << be_nl
- << this->pre_op() << "void" << be_nl;
- this->op_name(bu,os);
- *os << "::" << ub->local_name () << " (char *val)"
- << be_nl
- << "{" << be_idt_nl;
-
- *os << "// set the value" << be_nl
- << "this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << " = val;" << be_uidt_nl
- << "}" << be_nl;
-
- // (2) set method from const char *
- *os << "// accessor to set the member" << be_nl
- << this->pre_op() << "void" << be_nl;
- this->op_name(bu,os);
- *os << "::" << ub->local_name ()
- << " (const char *val)" << be_nl
- << "{\n";
- os->incr_indent ();
-
- *os << "// set the value" << be_nl
- << "this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << " = "
- << "CORBA::string_dup (val);" << be_uidt_nl;
-
- *os << "}" << 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 ()
- << " (const CORBA::String_var &val)" << be_nl
- << "{" << be_idt_nl;
- *os << ";" << be_nl;
-
- *os << "// set the value" << be_nl
- << "CORBA::String_var " << ub->local_name ()
- << "_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;
-
- // get method
- *os << this->pre_op() << "const char *" << 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
- << "}\n\n";
- return 0;
-}
-
-int
-be_visitor_valuetype_field_cs::visit_structure (be_structure *node)
-{
- TAO_OutStream *os; // output stream
- be_decl *ub =
- this->ctx_->node (); // get field 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);
- }
- 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
- {
- // 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 enum declaration
- ctx.state (TAO_CodeGen::TAO_STRUCT_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_structure - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_structure - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- // (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;
-
- if (0) // %! (bt->size_type () == be_type::VARIABLE)
- { cerr <<"!t VARIABLE struct in field_cs\n";
- *os << "delete this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << ";" << be_nl;
- *os << "this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << " = new "
- << bt->name () << " (val);" << be_uidt_nl;
- }
- else
- {
- *os << "this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << " = val;" << be_uidt_nl;
- }
-
- *os << "}" << be_nl;
-
- // readonly get method
- *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;
- if (0) // %! (bt->size_type () == be_type::VARIABLE)
- *os << "return *this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << ";" << be_uidt_nl;
- else
- *os << "return this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << ";" << be_uidt_nl;
- *os << "}" << be_nl;
-
- // read/write get method
- *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;
- if (0) // %! (bt->size_type () == be_type::VARIABLE)
- *os << "return *this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << ";" << be_uidt_nl;
- else
- *os << "return this->"
- << bu->field_pd_prefix() << ub->local_name () << bu->field_pd_postfix()
- << ";" << be_uidt_nl;
- *os << "}\n\n";
-
- return 0;
-}
-
-int
-be_visitor_valuetype_field_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_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)
-{
- cerr << "!u be_visitor_valuetype_field_cs::visit_union unimp.\n";
- TAO_OutStream *os; // output stream
- be_decl *ub =
- this->ctx_->node (); // get field 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);
- }
- 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
- {
- // 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 enum declaration
- ctx.state (TAO_CodeGen::TAO_UNION_CI);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_union - "
- "Bad visitor\n"
- ), -1);
- }
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_field_cs::"
- "visit_union - "
- "codegen failed\n"
- ), -1);
- }
- delete visitor;
- }
-
- // (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()
- << "_var = new " << bt->name ()
- << " (val);" << be_nl;
-
- *os << "}" << be_nl;
-
- // readonly get method
- *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;
-
- // read/write get method
- *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
- << "}\n\n";
-
- return 0;
-}
-
-void
-be_visitor_valuetype_field_cs::setenclosings (const char *pre)
-{
- pre_op_ = pre;
-}
-
-const char*
-be_visitor_valuetype_field_cs::pre_op ()
-{
- return 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 8fd36705682..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp
+++ /dev/null
@@ -1,50 +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
-//
-// ============================================================================
-
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_valuetype.h"
-
-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 *)
-{
- return 0;
-}
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 1f7e5405a67..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp
+++ /dev/null
@@ -1,200 +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>
-//
-// ============================================================================
-
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_valuetype.h"
-
-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->indent ();
- *os << "ACE_INLINE CORBA::Boolean" << be_nl;
- this->class_name (node, os);
- *os << "::_tao_marshal_state (TAO_OutputCDR &strm)" << be_nl
- << "{" << be_idt_nl;
- be_valuetype *inh = node->statefull_inherit ();
- if (inh)
- {
- if (inh->opt_accessor ())
- {
- *os << "if (!";
- this->class_name (inh, os);
- *os << "::_tao_marshal_state (strm)) return 0;" << be_nl;
- }
- else // only can access base class via virtual function
- {
- *os << "if (!this->_tao_marshal__"
- << inh->flatname ()
- << " (strm)) return 0;" << be_nl;
- }
- }
-
- { // array _forany
- be_visitor_context* new_ctx =
- new be_visitor_context (*this->ctx_);
- be_visitor_valuetype_field_cdr_decl field_decl (new_ctx);
- field_decl.visit_scope (node);
- }
-
- *os << "if (" << 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_nl << ")"
- << be_idt_nl
- << "return 1;" << be_uidt_nl
- << "else" << be_idt_nl
- << "return 0;" << be_uidt_nl << be_uidt_nl
- << "}\n\n";
-
- // set the substate as generating code for the input operator
- this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT);
- os->indent ();
- *os << "ACE_INLINE CORBA::Boolean" << be_nl;
- this->class_name (node, os);
- *os << "::_tao_unmarshal_state (TAO_InputCDR &strm)" << be_nl
- << "{" << be_idt_nl;
- inh = node->statefull_inherit ();
- if (inh)
- {
- if (inh->opt_accessor ())
- {
- *os << "if (!";
- this->class_name (inh, os);
- *os << "::_tao_unmarshal_state (strm)) return 0;" << be_nl;
- }
- else // only can access base class via virtual function
- {
- *os << "if (!this->_tao_unmarshal__"
- << inh->flatname ()
- << " (strm)) return 0;" << be_nl;
- }
- }
-
- { // array _forany
- be_visitor_context* new_ctx =
- new be_visitor_context (*this->ctx_);
- be_visitor_valuetype_field_cdr_decl field_decl (new_ctx);
- field_decl.visit_scope (node);
- }
-
- *os << "if (" << 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_nl << ")"
- << be_idt_nl
- << "return 1;" << be_uidt_nl
- << "else" << be_idt_nl
- << "return 0;" << be_uidt_nl << be_uidt_nl
- << "}\n\n";
-
- return 0;
-}
-
-// retrieve the fully scoped skeleton name
-void
-be_visitor_valuetype_marshal_cs::class_name (be_valuetype *node,
- TAO_OutStream *os)
-{
- if (node->opt_accessor ())
- *os << node->name ();
- else
- *os << node->full_obv_skel_name ();
-}
-
-// ops for field marshal
-int
-be_visitor_valuetype_marshal_cs::gen_fields (be_valuetype *node,
- be_visitor_context &ctx)
-{
- int n_processed = 0;
-
- TAO_OutStream *os = ctx.stream ();
- // proceed if the number of members in our scope is greater than 0
- if (node->nmembers () > 0)
- {
- // initialize an iterator to iterate thru our scope
- UTL_ScopeActiveIterator *si;
- ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (node,
- UTL_Scope::IK_decls),
- -1);
- this->elem_number_ = 0;
- // continue until each field is visited
- for (;!si->is_done ();si->next())
- {
- AST_Decl *d = si->item ();
- if (!d)
- {
- delete si;
- 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_context* new_ctx =
- new be_visitor_context (ctx);
- be_visitor_valuetype_field_cdr_ci visitor (new_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);
- }
-
- }
- } // end of for loop
- delete si;
- }
- if (n_processed == 0)
- *os << "1";
- 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 70806d09556..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp
+++ /dev/null
@@ -1,145 +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>
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-ACE_RCSID(be_visitor_obv_module, obv_module, "$Id$")
-
-
-// ************************************************************
-// 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)
-{
-}
-
-
-
-// This states are processed:
-// TAO_MODULE_OBV_CH
-// TAO_MODULE_OBV_CI
-// TAO_MODULE_OBV_CH
-
-
-int
-be_visitor_obv_module::visit_module (be_module *node)
-{
- TAO_OutStream *os; // output stream
- os = this->ctx_->stream ();
-
- if (node->has_nested_valuetype ())
- {
- if (this->ctx_->state () == TAO_CodeGen::TAO_MODULE_OBV_CH)
- {
- os->indent ();
-
- *os << "TAO_NAMESPACE "; // << idl_global->export_macro ()
-
- 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_nl
- << be_idt;
- } // client header
-
- 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->decr_indent ();
- *os << "};\n\n";
- }
- }
- return 0;
-}
-
-
-int
-be_visitor_obv_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); // set the node to be the node being visited. The scope is
- // still the same
-
- 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:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CI);
- break;
- case TAO_CodeGen::TAO_MODULE_OBV_CS:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CS);
- break;
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- 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);
- }
-
- // let the node accept this visitor
- 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;
- 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 41451082e2d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp
+++ /dev/null
@@ -1,840 +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
-//
-// ============================================================================
-
-//#include "idl.h"
-//#include "idl_extern.h"
-//#include "be.h"
-
-#include "be_visitor_valuetype.h"
-
-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)
-{
-}
-
-// this method must be overridden by the derived valuetype visitors
-int
-be_visitor_valuetype::visit_valuetype (be_valuetype *)
-{
-//! ACE_ASSERT (0);
- return -1;
-}
-
-
-// visit the scope of the valuetype node
-// (in public/private field order)
-int
-be_visitor_valuetype::visit_valuetype_scope (be_valuetype *node)
-{
- // proceed if the number of members in our scope is greater than 0
- if (node->nmembers () > 0)
- {
- // initialize an iterator to iterate thru our scope
- UTL_ScopeActiveIterator *si;
- int n_processed = 0;
- ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (node,
- UTL_Scope::IK_decls),
- -1);
- this->elem_number_ = 0;
- // continue until each element is visited
- for (;!si->is_done ();si->next())
- {
- AST_Decl *d = si->item ();
- if (!d)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "bad node in this scope\n"), -1);
-
- }
- AST_Field *field = AST_Field::narrow_from_decl (d);
- if (field && field->visibility() == AST_Field::vis_PRIVATE)
- {
- continue; // ignore private fields in this run
- // AST_Attribute derives from AST_Field, so test for
- // vis_PRIVATE is ok (the attribute has it set to vis_NA)
- }
- ++ n_processed;
- if (n_processed == 1)
- this->begin_public ();
- 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_++;
-
- if (bd == 0 || bd->accept (this) == -1)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "codegen for scope failed\n"), -1);
-
- }
- } // end of for loop
- delete si;
- // next run with private fields only
- n_processed = 0;
- ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (node,
- UTL_Scope::IK_decls),
- -1);
- this->elem_number_ = 0;
- // continue until each element is visited
- for (;!si->is_done ();si->next())
- {
- AST_Decl *d = si->item ();
- if (!d)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "bad node in this scope\n"), -1);
-
- }
- AST_Field *field = AST_Field::narrow_from_decl (d);
- if (!field ||
- (field && field->visibility() != AST_Field::vis_PRIVATE))
- {
- continue; // only private fields in this run
- }
- ++ n_processed;
- if (n_processed == 1)
- this->begin_private ();
- 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_++;
-
- if (bd == 0 || bd->accept (this) == -1)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "codegen for scope failed\n"), -1);
-
- }
- } // end of for loop
- delete si;
- } // end of if
- return 0;
-}
-
-// this 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
-
-// visit an attribute
-int
-be_visitor_valuetype::visit_attribute (be_attribute *node)
-// was be_visitor_attribute::visit_attribute (be_attribute *node)
-{
- this->ctx_->node (node); // save the node
- this->ctx_->attribute (node); // save this attribute node
-
- be_operation *op;
-
- // first the "get" operation
- op = new be_operation (node->field_type (), AST_Operation::OP_noflags,
- node->name (), 0);
- op->set_name (node->name ());
- if (!op || this->visit_operation (op) == -1)
- {
- delete op;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for get_attribute failed\n"),
- -1);
- }
- delete op;
- if (node->readonly ())
- return 0; // nothing else to do
-
- // the set method.
- // the return type is "void"
- be_predefined_type *rt = new be_predefined_type (AST_PredefinedType::PT_void,
- new UTL_ScopedName
- (new Identifier
- ("void", 1, 0, I_FALSE), 0),
- 0);
- // argument type is the same as the attribute type
- be_argument *arg = new be_argument (AST_Argument::dir_IN,
- node->field_type (),
- node->name (),
- 0);
- arg->set_name (node->name ());
- // create the operation
- op = new be_operation (rt, AST_Operation::OP_noflags,
- node->name (), 0);
- op->set_name (node->name ());
- op->add_argument_to_scope (arg);
-
- if (!op || this->visit_operation (op) == -1)
- {
- delete op;
- delete arg;
- delete rt;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for set_attribute failed\n"),
- -1);
- }
- delete op;
- delete rt;
- delete arg;
- return 0;
-}
-
-
-// visit a constant
-int
-be_visitor_valuetype::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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_VALUETYPE_CH:
- ctx.state (TAO_CodeGen::TAO_CONSTANT_CH);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CS:
- ctx.state (TAO_CodeGen::TAO_CONSTANT_CS);
- 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_VALUETYPE_ANY_OP_CH:
- case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CS:
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CH:
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CI:
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CS:
- case TAO_CodeGen::TAO_VALUETYPE_CI:
- case TAO_CodeGen::TAO_VALUETYPE_SH:
- case TAO_CodeGen::TAO_VALUETYPE_IH:
- case TAO_CodeGen::TAO_VALUETYPE_IS:
- case TAO_CodeGen::TAO_VALUETYPE_SI:
- case TAO_CodeGen::TAO_VALUETYPE_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);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_constant - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_constant - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-//visit an enum
-int
-be_visitor_valuetype::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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_VALUETYPE_CH:
- ctx.state (TAO_CodeGen::TAO_ENUM_CH);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CS:
- ctx.state (TAO_CodeGen::TAO_ENUM_CS);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_ENUM_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_ENUM_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CS);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CI);
- 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_VALUETYPE_CI:
- case TAO_CodeGen::TAO_VALUETYPE_SH:
- case TAO_CodeGen::TAO_VALUETYPE_IH:
- case TAO_CodeGen::TAO_VALUETYPE_IS:
- case TAO_CodeGen::TAO_VALUETYPE_SI:
- case TAO_CodeGen::TAO_VALUETYPE_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);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_enum - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_enum - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-
-// visit an operation
-int
-be_visitor_valuetype::visit_operation (be_operation *)
-{
- // is overridden in derived visitors
- return 0;
-}
-
-// visit an exception (not used)
-int
-be_visitor_valuetype::visit_exception (be_exception *)
-{
- cerr << "! be_visitor_valuetype::visit_exception() --- not allowed\n";
- ACE_ASSERT (0);
- return 0;
-}
-
-// visit an structure
-int
-be_visitor_valuetype::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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_VALUETYPE_CH:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CH);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CI:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CI);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CS);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CS);
- 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_VALUETYPE_SH:
- case TAO_CodeGen::TAO_VALUETYPE_IH:
- case TAO_CodeGen::TAO_VALUETYPE_IS:
- case TAO_CodeGen::TAO_VALUETYPE_SI:
- case TAO_CodeGen::TAO_VALUETYPE_SS:
- return 0; // nothing to be done
- default:
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_structure - "
- "Bad context state\n"
- ), -1);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_structure - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_structure - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit a union
-int
-be_visitor_valuetype::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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_VALUETYPE_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_CH);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CI:
- ctx.state (TAO_CodeGen::TAO_UNION_CI);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_CS);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CS);
- 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_VALUETYPE_SH:
- case TAO_CodeGen::TAO_VALUETYPE_IH:
- case TAO_CodeGen::TAO_VALUETYPE_IS:
- case TAO_CodeGen::TAO_VALUETYPE_SI:
- case TAO_CodeGen::TAO_VALUETYPE_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);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_union - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_union - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- return 0;
-}
-
-// visit a typedef
-int
-be_visitor_valuetype::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); // set the node to be the node being visited. The scope is
- // still the same
-
- // 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_VALUETYPE_CH:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CH);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CI:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CI);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CS:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CS);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CH:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CS:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CH:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CI:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI);
- break;
- case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CS:
- ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS);
- 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_VALUETYPE_SH:
- case TAO_CodeGen::TAO_VALUETYPE_IH:
- case TAO_CodeGen::TAO_VALUETYPE_IS:
- case TAO_CodeGen::TAO_VALUETYPE_SI:
- case TAO_CodeGen::TAO_VALUETYPE_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);
- }
- }
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_typedef - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype::"
- "visit_typedef - "
- "failed to accept visitor\n"
- ), -1);
- }
- delete visitor;
- 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)
-{
- // proceed if the number of members in our scope is greater than 0
- if (node->nmembers () > 0)
- {
- // initialize an iterator to iterate thru our scope
- UTL_ScopeActiveIterator *si;
- int n_processed = 0;
- ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (node,
- UTL_Scope::IK_decls),
- -1);
- this->elem_number_ = 0;
- // continue until each field is visited
- for (;!si->is_done ();si->next())
- {
- AST_Decl *d = si->item ();
- if (!d)
- {
- delete si;
- 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)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "codegen for scope failed\n"), -1);
-
- }
- } // end of for loop
- delete si;
- }
- return 0;
-}
-
-// private data for field
-int
-be_visitor_valuetype::gen_field_pd (be_field *node)
-// derived from be_visitor_field_ch
-{
- TAO_OutStream *os; // output stream
- be_type *bt; // field's type
- be_valuetype *vt; // field declared in this scope
-
- os = this->ctx_->stream ();
- // first generate the type information
- bt = be_type::narrow_from_decl (node->field_type ());
- 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); // set the node to be the node being visited. The scope is
- // still the same
-
- ctx.state (TAO_CodeGen::TAO_FIELD_CH);
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_structure::"
- "visit_field - "
- "NUL visitor\n"
- ), -1);
- }
-
- // let the node accept this visitor
- 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);
- }
- delete visitor;
-
- // now output the field name.
- *os << " " << vt->field_pd_prefix ()
- << node->local_name ()
- << vt->field_pd_postfix() << ";\n";
- return 0;
-
-}
-
-
-// generate the _init definition
-int
-be_visitor_valuetype::gen_init_defn (be_valuetype *node)
-{
- if (node->is_abstract_valuetype ())
- return 0; // no instance of it can created
-
- TAO_OutStream *os; // output stream
-
- os = this->ctx_->stream ();
- os->indent (); // start with whatever indentation level we are at
-
- *os << "class " << idl_global->export_macro ()
- << " " << node->local_name ()
- << "_init : public ACE_CORBA_1 (ValueFactoryBase)" << be_nl;
-
- // generate the body
-
- *os << "{" << be_nl
- << "public:" << be_idt_nl
- << "virtual ~" << node->local_name () << "_init ();" << be_nl;
-
- /* %! << "static " << node->local_name () << "* "
- << "_downcast (CORBA::ValueFactoryBase* );" << be_nl */
-
- *os << "virtual const char* tao_repository_id ();\n" << be_nl;
- *os << "// create () goes here" << be_nl; // %!
-
- *os << be_uidt_nl << "};\n";
-
- return 0;
-}
-
-int
-be_visitor_valuetype::gen_init_impl (be_valuetype *node)
-{
- if (node->is_abstract_valuetype ())
- return 0; // no instance of it can created
-
- TAO_OutStream *os; // output stream
-
- os = this->ctx_->stream ();
- os->indent (); // start with whatever indentation level we are at
-
- 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->fullname ());
-
- ACE_OS::memset (lname, '\0', NAMEBUFSIZE);
- ACE_OS::sprintf (lname, "%s_init", node->local_name ()->get_string ());
-
- // destructor
- *os << fname << "::~" << lname << " ()" << be_nl
- << "{" << be_nl << "}\n\n";
-
- *os << "const char* " << be_nl
- << fname << "::tao_repository_id ()" << be_nl
- << "{" << be_idt_nl
- << "return " << node->name()
- << "::_tao_obv_static_repository_id ();"
- << be_uidt_nl << "}\n\n";
-
-
- return 0;
-}
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 e15b3aedea9..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp
+++ /dev/null
@@ -1,419 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_valuetype.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
-
- if (!node->cli_hdr_gen () && !node->imported ()) // not already generated and
- // not imported
- {
-
- os = this->ctx_->stream ();
- *os << "// valuetype class\n";
-
- // == STEP 1: generate the class name and class names we inherit ==
-
- os->indent (); // start with whatever indentation level we are at
- // forward declaration
- *os << "class " << node->local_name () << ";" << be_nl;
-
- // generate the ifdefined macro for the _var type
- os->gen_ifdef_macro (node->flatname (), "_var");
-
- // generate the _var declaration
- if (node->gen_var_defn () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ch::"
- "visit_valuetype - "
- "codegen for _var failed\n"), -1);
- }
- os->gen_endif ();
-
- // generate the ifdef macro for the _out class
- os->gen_ifdef_macro (node->flatname (), "_out");
-
- // generate the _out declaration - ORBOS/97-05-15 pg 16-20 spec
- if (node->gen_out_defn () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ch::"
- "visit_valuetype - "
- "codegen for _out failed\n"), -1);
- }
- // generate the endif macro
- os->gen_endif ();
-
- // generate the ifdef macro for the _init class
- os->gen_ifdef_macro (node->flatname (), "_init");
-
- // generate the _init declaration - ptc/98-09-03 20.17.10 p.20-93
- if (this->gen_init_defn (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ch::"
- "visit_valuetype - "
- "codegen for _init failed\n"), -1);
- }
- // generate the endif macro
- os->gen_endif ();
-
- // now the valuetype definition itself
- os->gen_ifdef_macro (node->flatname ());
-
- // now generate the class definition
- os->indent ();
- *os << "class " << idl_global->export_macro ()
- << " " << node->local_name ();
-
- // node valuetype inherits from other valuetypes (OMG 20.17.9)
- // (ordinary (not abstract) interfaces ignored)
-
- *os << " : ";
- int i; // loop index
- int n_inherits_valuetypes = 0;
- idl_bool valuebase_inherited = 0;
- if (node->n_inherits () > 0)
- {
- for (i = 0; i < node->n_inherits (); i++)
- {
- // %! move is_nested() and nested_type_name() to
- // AST_Interface, then type AST_Interface can be used
- be_interface *inherited =
- be_interface::narrow_from_decl (node->inherits ()[i]);
- if (!inherited->is_valuetype() &&
- !inherited->is_abstract_interface())
- continue;
-
- ++ n_inherits_valuetypes;
- if (inherited->is_valuetype())
- valuebase_inherited = 1;
- if (n_inherits_valuetypes > 1) // node is the case of multiple
- // inheritance, so put a comma
- {
- *os << ", ";
- }
- 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
- if (n_inherits_valuetypes > 0)
- *os << be_nl;
- }
- if (!valuebase_inherited)
- {
- // we do not inherit from any valuetype, hence we do so from the base
- // CORBA::ValueBase class
- // Generate code that uses the macro. This is required to deal with
- // the MSVC++ insanity
- if (n_inherits_valuetypes > 1) // node is the case of multiple
- // inheritance, so put a comma
- {
- *os << ", ";
- }
- *os << "public virtual ACE_CORBA_1 (ValueBase)" << be_nl;
- }
-
- // generate the body
-
- *os << "{" << be_nl
- << "public:" << be_nl
-
- // generate the _ptr_type and _var_type typedef
- // but we must protect against certain versions of g++
- << "#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8"
- << be_idt_nl
- << "typedef " << node->local_name () << "* _ptr_type;" << be_nl
- << "typedef " << node->local_name () << "_var _var_type;"
- << be_uidt_nl
- << "#endif /* __GNUC__ */\n" << be_idt_nl
-
- // generate the static _downcast operation
- // (see OMG 20.17.{4,5})
- << "static " << node->local_name () << "* "
- << "_downcast (CORBA::ValueBase* );" << be_nl
- << "// The address of static _downcast is implicit used as type id\n"
- << be_nl
-
- << "// (TAO extensions or internals)" << be_nl
- << "static CORBA::Boolean _tao_unmarshal (TAO_InputCDR &, "
- << node->local_name () << " *&);" << be_nl
- << "virtual const char* "
- << "_tao_obv_repository_id () const;"
- << be_nl
- << "static const char* "
- << "_tao_obv_static_repository_id ();\n";
-
- // 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);
- }
-
- // protected member:
-
- // generate the "protected" constructor so that users cannot instantiate
- // us
- *os << be_uidt_nl << "protected:" << be_idt_nl
- << node->local_name ()
- << " (); // default constructor" << be_nl
- << "virtual ~" << node->local_name () << " ();\n" << be_nl;
-
- *os << "// TAO internals" << be_nl
- << "virtual void *_tao_obv_narrow (ptr_arith_t);" << be_nl;
- // support for marshalling
- if (!node->is_abstract_valuetype ())
- {
- *os << "virtual CORBA::Boolean "
- << "_tao_marshal_v (TAO_OutputCDR &);" << be_nl;
- *os << "virtual CORBA::Boolean "
- << "_tao_unmarshal_v (TAO_InputCDR &);" << be_nl;
- // %! optimize _downcast away: extra parameter with type info
- // set (void *) in CDR Stream with the right derived pointer
- }
-
-
- // 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;
-
- // 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 &);" << be_nl
- << "CORBA::Boolean "
- << "_tao_unmarshal_state (TAO_InputCDR &);\n\n";
- *os << be_uidt_nl << "private:\n" << be_idt;
- this->gen_pd (node);
- }
- else // need a way to access the state of derived OBV_ classes
- {
- if (!node->is_abstract_valuetype ())
- {
- *os << be_uidt_nl << "protected:" << be_idt_nl;
- *os << "virtual CORBA::Boolean _tao_marshal__"
- << node->flatname () << " (TAO_OutputCDR &) = 0;"
- << be_nl;
- *os << "virtual CORBA::Boolean _tao_unmarshal__"
- << node->flatname () << " (TAO_InputCDR &) = 0;"
- << be_nl;
- }
- }
-
- *os << be_uidt_nl << "};\n";
- os->gen_endif ();
-
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- // (see interface code how to do this. not yet impl.)
-
- node->cli_hdr_gen (I_TRUE);
- } // if !cli_hdr_gen
- return 0;
-}
-
-
-int
-be_visitor_valuetype_ch::visit_operation (be_operation *node)
-// derived from be_visitor_operation_ch::visit_operation
-{
- TAO_OutStream *os; // output stream
- be_type *bt; // type node
-
- os = this->ctx_->stream ();
- this->ctx_->node (node); // save the node
-
- os->indent (); // start with the current indentation level
-
- // every operation is declared virtual in the client code
- *os << "virtual ";
-
- // STEP I: generate the return 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);
- }
-
- // grab the right visitor to generate the return type
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_CH);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_valuetype_ch::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (bt->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ch::"
- "visit_operation - "
- "codegen for return type failed\n"),
- -1);
- }
- delete visitor;
-
- // 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_OBV_OPERATION_ARGLIST_CH);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_valuetype_ch::"
- "visit_operation - "
- "Bad visitor to argument list\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
- delete visitor;
-
- 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 = new be_visitor_context (*this->ctx_);
- ctx->state (TAO_CodeGen::TAO_FIELD_OBV_CH);
- be_visitor_valuetype_field_ch *visitor =
- new be_visitor_valuetype_field_ch (ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_valuetype_obv_ch::"
- "visit_field - bad visitor\n"),
- -1);
- }
-
- if (vt->opt_accessor ())
- visitor->setenclosings ("",";");
- else
- visitor->setenclosings ("virtual "," = 0;");
-
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_obv_ch::"
- "visit_field - codegen failed\n"),
- -1);
- }
- delete visitor;
- return 0;
-}
-
-
-void
-be_visitor_valuetype_ch::begin_public ()
-{
- TAO_OutStream *os; // output stream
-
- os = this->ctx_->stream ();
- *os << be_uidt;
- os->indent ();
- *os << "public:\n" << be_idt;
-}
-
-void
-be_visitor_valuetype_ch::begin_private ()
-{
- TAO_OutStream *os; // output stream
-
- os = this->ctx_->stream ();
- *os << be_uidt;
- os->indent ();
- *os << "protected:\n" << be_idt;
-}
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 368a53e1e71..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp
+++ /dev/null
@@ -1,133 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_valuetype.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
-
- if (node->cli_inline_gen () || node->imported ())
- return 0;
-
- // need to access it in visit_field ()
- if (node->opt_accessor ())
- this->opt_accessor_ = 1;
-
- os = this->ctx_->stream ();
-
- os->indent (); // start from the current indentation level
-
- // generate the constructors and destructor
- *os << "ACE_INLINE" << be_nl;
- *os << node->name () << "::" << node->local_name () <<
- " () // default constructor" << be_nl;
- *os << "{}" << be_nl << be_nl;
-
- *os << "ACE_INLINE" << be_nl;
- *os << node->name () << "::~" << node->local_name () <<
- " () // destructor" << be_nl;
- *os << "{}\n" << 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
- << "}\n\n";
-
- // generate the ifdefined macro for the _var type
- os->gen_ifdef_macro (node->flatname (), "_var");
- if (node->gen_var_impl () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ci::"
- "visit_valuetype - "
- "codegen for _var failed\n"), -1);
- }
- os->gen_endif ();
-
- // generate the ifdefined macro for the _out type
- os->gen_ifdef_macro (node->flatname (), "_out");
- if (node->gen_out_impl () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ci::"
- "visit_valuetype - "
- "codegen for _out failed\n"), -1);
- }
- os->gen_endif ();
-
- // generate inline methods for elements of our scope
- 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);
- }
-
- return 0;
-}
-
-
-int
-be_visitor_valuetype_ci::visit_field (be_field *node)
-{
- if (opt_accessor_)
- {
- be_visitor_context *ctx = new be_visitor_context (*this->ctx_);
- be_visitor_valuetype_field_cs *visitor =
- new be_visitor_valuetype_field_cs (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);
- }
- delete visitor;
- }
- 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 40b655a80b1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp
+++ /dev/null
@@ -1,210 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_valuetype.h"
-
-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)
-{
- TAO_OutStream *os; // output stream
-
- if (node->cli_stub_gen () || node->imported ())
- return 0;
-
- os = this->ctx_->stream ();
-
- os->indent (); // start with whatever indentation level we are at
-
- // The _downcast method // %! use ACE_xxx_cast here ?
- *os << node->name() << "* " << node->name()
- << "::_downcast (CORBA::ValueBase* v)" << be_nl
- << "{" << be_idt_nl
- << "if (v == 0) return 0;" << be_nl
- << "return (" << node->local_name() << "* ) "
- << "v->_tao_obv_narrow ((ptr_arith_t) &_downcast);" << be_uidt_nl
- << "}\n" << be_nl
-
- // The _tao_obv_repository_id method
- << "const char* " << node->name()
- << "::_tao_obv_repository_id () const" << be_nl
- << "{" << be_idt_nl
- << "return this->_tao_obv_static_repository_id ();" << be_uidt_nl
- << "}\n" << be_nl
-
- // The _tao_obv_narrow method
- << "void* " << node->name()
- << "::_tao_obv_narrow (ptr_arith_t type_id)" << be_nl
- << "{" << be_idt_nl
- << "if (type_id == (ptr_arith_t) &_downcast)" << be_idt_nl
- << "return this;" << be_uidt_nl
- << "void *rval = 0;" << be_nl;
-
- // Find the possible base classes.
-
- int n_inherits_downcastable = 0;
- for (int i = 0; i < node->n_inherits (); i++)
- {
- AST_Interface *inherited =
- AST_Interface::narrow_from_decl (node->inherits ()[i]);
- if (inherited->is_valuetype())
- {
- ++n_inherits_downcastable;
- *os << "if (rval == 0)" << be_idt_nl
- << "rval = " << inherited->name()
- << "::_tao_obv_narrow (type_id);" << be_uidt_nl;
- }
- }
-
- *os << "return rval;" << be_uidt_nl
- << "}\n\n";
-
- // Nothing to marshal if abstract valuetype.
- if (!node->is_abstract_valuetype ())
- {
- // The virtual _tao_marshal_v method
- *os << "CORBA::Boolean " << node->name()
- << "::_tao_marshal_v (TAO_OutputCDR & strm)"
- << be_nl
- << "{" << be_idt_nl
- << "return ";
- if (node->opt_accessor ())
- {
- *os << node->name ()
- <<"::_tao_marshal_state (strm);" << be_uidt_nl;
- }
- else
- {
- *os << "this->_tao_marshal__" << node->flatname ()
- << " (strm);" << be_uidt_nl;
- }
- *os << "}\n" << be_nl;
-
- // The virtual _tao_unmarshal_v method
- *os << "CORBA::Boolean " << node->name()
- << "::_tao_unmarshal_v (TAO_InputCDR & strm)"
- << be_nl
- << "{" << be_idt_nl
- << "return ";
- if (node->opt_accessor ())
- {
- *os << node->name ()
- <<"::_tao_unmarshal_state (strm);" << be_uidt_nl;
- }
- else
- {
- *os << "this->_tao_unmarshal__" << node->flatname ()
- << " (strm);" << be_uidt_nl;
- }
- *os << "}\n" << be_nl;
- } // !node->is_abstract_valuetype ()
-
- // The static T::_tao_unmarshal method ----------------------------
-
- *os << "CORBA::Boolean " << node->name()
- << "::_tao_unmarshal (TAO_InputCDR &strm, "
- << node->name() <<" *&new_object)" << be_nl
- << "{" << be_idt_nl
- << "CORBA::Boolean retval = 1;" << be_nl
- << "CORBA::ValueBase *base; // %! should be a _var"
- << be_nl
- << "CORBA::ValueFactory_ptr factory; // %! should be a _var"
- << be_nl
-
- << "if (!CORBA::ValueBase::_tao_unmarshal_pre (strm, factory, base," << be_idt_nl
- << " " << node->name ()
- << "::_tao_obv_static_repository_id ()) )" << be_nl
- << "{" << be_idt_nl
- << "return 0;" << be_uidt_nl
- << "}" << be_uidt_nl
- << "if (factory != 0)" << be_idt_nl
- << "{" << be_idt_nl
-
- << "base = factory->create_for_unmarshal ();" << be_nl
- << "factory->_remove_ref ();" << be_nl
- << "if (base == 0) return 0; // %! except.?" << be_nl
- << "//%! ACE_DEBUG ((LM_DEBUG, \"" << node->name()
- << "::_tao_unmarshal %s\\n\", "
- << "base->_tao_obv_repository_id () ));" << be_nl
- << "retval = base->_tao_unmarshal_v (strm);" << be_nl
- << "//%! ACE_DEBUG ((LM_DEBUG, \"" << node->name()
- << "::_tao_unmarshal retval unmarshal_v is %d\\n\", "
- << "retval));" << be_nl
- << "if (!retval) return 0;"
-
- << be_uidt_nl << "}" << be_uidt_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->name () << "::_downcast (base);" << be_nl
- << "// %! unmarshal_post" << be_nl
- << "return 1;" << be_uidt_nl
- << "}\n" << be_nl;
-
- // The static T::_tao_unmarshal method ------------------------ end
-
- // generate the ifdefined macro for the _init type
- os->gen_ifdef_macro (node->flatname (), "_init");
- if (this->gen_init_impl (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_cs::"
- "visit_valuetype - "
- "codegen for _init failed\n"), -1);
- }
- os->gen_endif ();
-
- // 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);
- }
-
-
- // by using a visitor to declare and define the TypeCode, we have the
- // added advantage to conditionally not generate any code. This will be
- // based on the command line options. This is still TO-DO
- // (see interface code how to do this. not yet impl.)
-
- return 0;
-}
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 4cdee96d078..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp
+++ /dev/null
@@ -1,176 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_valuetype.h"
-
-ACE_RCSID(be_visitor_valuetype_obv_ch, 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 valuetype
- if (node->is_abstract_valuetype ())
- return 0;
-
- TAO_OutStream *os; // output stream
-
- os = this->ctx_->stream ();
-
- // OBV_ class maps only to a typedef if we are optimizing accessors
- if (node->opt_accessor ())
- {
- os->indent ();
- *os << "typedef " << node->fullname () << " ";
- 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->flatname (), "_OBV");
- os->indent ();
-
- *os << "// OBV_ class" << be_nl;
- *os << "class ";
- if (!node->is_nested()) // we are in root ?
- *os << "OBV_";
- *os << node->local_name () << " : public virtual "
- << node->fullname () << be_nl;
-
- // == STEP 2: generate the body ==
-
- *os << "{\n" << be_idt;
-
- // 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);
- }
- // map fields to private data
- if (!node->opt_accessor ()) // check again (redundant)
- {
- *os << be_uidt_nl << "protected:" << be_idt_nl;
- *os << "virtual CORBA::Boolean _tao_marshal__"
- << node->flatname () << " (TAO_OutputCDR &);" << be_nl;
- *os << "virtual CORBA::Boolean _tao_unmarshal__"
- << node->flatname () << " (TAO_InputCDR &);" << be_nl;
- *os << "CORBA::Boolean "
- << "_tao_marshal_state (TAO_OutputCDR &);" << be_nl
- << "CORBA::Boolean "
- << "_tao_unmarshal_state (TAO_InputCDR &);\n\n";
- *os << be_uidt_nl << "private:" << be_idt_nl;
- this->gen_pd (node);
- }
- *os << be_uidt;
- os->indent ();
- *os << "};\n";
- os->gen_endif ();
- } // if !opt_accessor ()
-
- return 0;
-}
-
-
-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 = new be_visitor_context (*this->ctx_);
- ctx->state (TAO_CodeGen::TAO_FIELD_OBV_CH);
- be_visitor_valuetype_field_ch *visitor =
- new be_visitor_valuetype_field_ch (ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_valuetype_obv_ch::"
- "visit_field - bad visitor\n"),
- -1);
- }
-
- visitor->setenclosings ("virtual ",";");
- if (node->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_obv_ch::"
- "visit_field - codegen failed\n"),
- -1);
- }
- delete visitor;
- }
- return 0;
-}
-
-void
-be_visitor_valuetype_obv_ch::begin_public ()
-{
- TAO_OutStream *os; // output stream
-
- os = this->ctx_->stream ();
- *os << be_uidt;
- os->indent ();
- *os << "public:\n" << be_idt;
-}
-
-void
-be_visitor_valuetype_obv_ch::begin_private ()
-{
- TAO_OutStream *os; // output stream
-
- os = this->ctx_->stream ();
- *os << be_uidt;
- os->indent ();
- *os << "protected:\n" << 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 ca026ba9dfd..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ci.cpp
+++ /dev/null
@@ -1,78 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_valuetype.h"
-
-ACE_RCSID(be_visitor_valuetype_obv_ci, 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)
-{
-return 0; // %! dead code
- // only visit non-abstract valuetype
- if (node->is_abstract_valuetype ())
- 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 !opt_accessor ()
- return 0;
-}
-
-
-int
-be_visitor_valuetype_obv_ci::visit_field (be_field *node)
-{
- // dead code
- 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 4bcf4ef00ba..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp
+++ /dev/null
@@ -1,111 +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
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_valuetype.h"
-
-ACE_RCSID(be_visitor_valuetype_obv_cs, 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_scope (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 valuetype
- if (node->is_abstract_valuetype ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // OBV_ class has no accessors or modifiers if we are optimizing
- // or the valuetype is abstract.
- if (!(node->opt_accessor () || node->is_abstract_valuetype () ))
- {
- os->indent ();
- *os << "CORBA::Boolean " << be_nl
- << node->full_obv_skel_name ()
- << "::_tao_marshal__" << node->flatname ()
- << " (TAO_OutputCDR &strm)"
- << "{" << be_idt_nl
- << "return " << node->full_obv_skel_name ()
- << "::_tao_marshal_state (strm);" << be_nl
- << be_uidt_nl << "}\n";
-
- *os << "CORBA::Boolean "
- << node->full_obv_skel_name ()
- << "::_tao_unmarshal__" << node->flatname ()
- << " (TAO_InputCDR &strm)"
- << "{" << be_idt_nl
- << "return " << node->full_obv_skel_name ()
- << "::_tao_unmarshal_state (strm);" << be_nl
- << be_uidt_nl << "}\n";
-
- 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);
- }
- }
- return 0;
-}
-
-int
-be_visitor_valuetype_obv_cs::visit_field (be_field *node)
-{
- be_visitor_context *ctx = new be_visitor_context (*this->ctx_);
- be_visitor_valuetype_field_cs *visitor =
- new be_visitor_valuetype_field_cs (ctx);
- visitor->in_obv_space_ = 1;
- // visitor->setenclosings ("ACE_INLINE ");
- 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);
- }
- delete visitor;
- return 0;
-}
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 79d1f442b5b..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd.cpp
+++ /dev/null
@@ -1,37 +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 "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#ifdef IDL_HAS_VALUETYPE
-
-#include "be_visitor_valuetype_fwd.h"
-
-// include all the individual files
-//#include "be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp"
-//#include "be_visitor_valuetype_fwd/valuetype_fwd_ci.cpp"
-//#include "be_visitor_valuetype_fwd/cdr_op_ci.cpp"
-
-ACE_RCSID(be, be_visitor_valuetype_fwd, "$Id$")
-
-#endif /* IDL_HAS_VALUETYPE */
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 a290ee99010..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ci.cpp
+++ /dev/null
@@ -1,74 +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)
-//
-// ================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_valuetype_fwd.h"
-
-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)
-{
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_fwd_cdr_op_ci::"
- "must be implemented\n"), -1);
-}
-
-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)
-{
- if (node->cli_inline_cdr_op_gen () || node->imported ())
- return 0;
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- // generate the CDR << and >> operator declarations
- os->indent ();
- *os << "ACE_INLINE CORBA::Boolean" << be_nl
- << "operator<< (" << be_idt << be_idt_nl
- << "TAO_OutputCDR &," << be_nl
- << "const " << node->name () << "_ptr" << be_uidt_nl
- << ");" << be_uidt_nl;
- *os << "ACE_INLINE CORBA::Boolean" << be_nl
- << "operator>> (" << be_idt << be_idt_nl
- << "TAO_InputCDR &," << be_nl
- << node->name () << "_ptr &" << be_uidt_nl
- << ");" << be_uidt << "\n";
-
- node->cli_inline_cdr_op_gen (1);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ch.cpp
deleted file mode 100644
index 5411463a7ec..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ch.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_fwd_ch.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interface_Fwd node in the client header.
-//
-// = AUTHOR
-// Torsten Kuepper
-// based on code from Aniruddha Gokhale (interface_fwd_ch.cpp)
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_valuetype_fwd.h"
-
-ACE_RCSID(be_visitor_valuetype_fwd, valuetype_fwd_ch, "$Id$")
-
-
-// ********************************************************************
-// Visitor implementation for the Interface_Fwd type
-// This one for the client header file
-// ********************************************************************
-
-be_visitor_valuetype_fwd_ch::be_visitor_valuetype_fwd_ch (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_fwd_ch::"
- "must be implemented\n"), -1);
-}
-
-be_visitor_valuetype_fwd_ch::~be_visitor_valuetype_fwd_ch (void)
-{
-}
-
-// visit the Interface_Fwd_Ch node and its scope
-int
-be_visitor_valuetype_fwd_ch::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (!node->cli_hdr_gen () && !node->imported ())
- {
- os->indent (); // start from the current
-
- // all we do in this is generate a forward declaration of the class
- *os << "class " << node->local_name () << ";" << be_nl;
-
- // generate the ifdefined macro for the _ptr type
- os->gen_ifdef_macro (node->flatname (), "_ptr");
-
- // generate the _ptr declaration
- *os << "typedef " << node->local_name () << " *" << node->local_name ()
- << "_ptr;\n";
-
- os->gen_endif ();
-
- // enclose under an ifdef macro
- os->gen_ifdef_macro (node->flatname (), "_var");
-
- // generate the _var declaration
- if (node->gen_var_defn () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_fwd_ch::"
- "visit_valuetype_fwd - "
- "codegen for _var failed\n"), -1);
- }
- // gen an endif
- os->gen_endif ();
-
- // enclose under an ifdef macro
- os->gen_ifdef_macro (node->flatname (), "_out");
-
- // generate the _out declaration - ORBOS/97-05-15 pg 16-20 spec
- if (node->gen_out_defn () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_fwd_ch::"
- "visit_valuetype_fwd - "
- "codegen for _out failed\n"), -1);
- }
- // generate the endif macro
- os->gen_endif ();
- node->cli_hdr_gen (I_TRUE);
- }
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ci.cpp
deleted file mode 100644
index aaadbbb38f6..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ci.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// valuetype_fwd_ci.cpp
-//
-// = DESCRIPTION
-// Visitor generating code for Interface_Fwd node in the client inline.
-//
-// = AUTHOR
-// Torsten Kuepper
-// based on code from Aniruddha Gokhale (interface_fwd_ci.cpp)
-//
-// ============================================================================
-
-#include "idl.h"
-#include "idl_extern.h"
-#include "be.h"
-
-#include "be_visitor_valuetype_fwd.h"
-
-ACE_RCSID(be_visitor_valuetype_fwd, valuetype_fwd_ci, "$Id$")
-
-
-// ********************************************************************
-// Visitor implementation for the Interface_Fwd type
-// This one for the client inline file
-// ********************************************************************
-
-be_visitor_valuetype_fwd_ci::be_visitor_valuetype_fwd_ci (be_visitor_context *ctx)
- : be_visitor_decl (ctx)
-{
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_fwd_ci::"
- "must be implemented\n"), -1);
-}
-
-be_visitor_valuetype_fwd_ci::~be_visitor_valuetype_fwd_ci (void)
-{
-}
-
-// visit the Interface_Fwd_ci node and its scope
-int
-be_visitor_valuetype_fwd_ci::visit_valuetype_fwd (be_valuetype_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream ();
-
- if (!node->cli_inline_gen () && !node->imported ())
- {
-
- // generate the ifdefined macro for the _var type
- os->gen_ifdef_macro (node->flatname (), "_var");
-
- if (node->gen_var_impl () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_fwd_ci::"
- "visit_valuetype_fwd - "
- "codegen for _var failed\n"), -1);
- }
-
- os->gen_endif ();
-
- // generate the ifdefined macro for the _out type
- os->gen_ifdef_macro (node->flatname (), "_out");
-
- if (node->gen_out_impl () == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_fwd_ci::"
- "visit_valuetype_fwd - "
- "codegen for _out failed\n"), -1);
- }
- os->gen_endif ();
-
- node->cli_stub_gen (I_TRUE);
- }
- return 0;
-}