summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL
diff options
context:
space:
mode:
authorgokhale <asgokhale@users.noreply.github.com>1998-08-27 13:27:37 +0000
committergokhale <asgokhale@users.noreply.github.com>1998-08-27 13:27:37 +0000
commiteecc583f8ed6a71423990bc0d0d22931828c4835 (patch)
treecbe9dd254d7c6a1ceb0ff30fd874182acc6da8f7 /TAO/TAO_IDL
parent0d2475ffcc803ead837740f5c6bfdf095ec23dbc (diff)
downloadATCD-eecc583f8ed6a71423990bc0d0d22931828c4835.tar.gz
*** empty log message ***
Diffstat (limited to 'TAO/TAO_IDL')
-rw-r--r--TAO/TAO_IDL/Makefile306
-rw-r--r--TAO/TAO_IDL/be/be_array.cpp14
-rw-r--r--TAO/TAO_IDL/be/be_decl.cpp28
-rw-r--r--TAO/TAO_IDL/be/be_interface.cpp12
-rw-r--r--TAO/TAO_IDL/be/be_interface_fwd.cpp13
-rw-r--r--TAO/TAO_IDL/be/be_interpretive.cpp46
-rw-r--r--TAO/TAO_IDL/be/be_structure.cpp12
-rw-r--r--TAO/TAO_IDL/be/be_union.cpp12
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp63
-rw-r--r--TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp495
-rw-r--r--TAO/TAO_IDL/be/be_visitor_context.cpp16
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ch.cpp63
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum/cdr_op_cs.cpp77
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception.cpp8
-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_cs.cpp168
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp350
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp651
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface.cpp10
-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_cs.cpp104
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface.cpp36
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module.cpp3
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/cdr_op.cpp56
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/module.cpp40
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root.cpp3
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp56
-rw-r--r--TAO/TAO_IDL/be/be_visitor_root/root.cpp100
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp65
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp522
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_object_manager_ch.cpp44
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp10
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ch.cpp77
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp128
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/structure.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp292
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp294
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp32
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp77
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp137
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union/union.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp351
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp651
-rw-r--r--TAO/TAO_IDL/be_include/be_codegen.h36
-rw-r--r--TAO/TAO_IDL/be_include/be_decl.h6
-rw-r--r--TAO/TAO_IDL/be_include/be_factory.h2
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_array.h2
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_ch.h52
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_cs.h86
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_context.h9
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_enum.h2
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_ch.h47
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_cs.h47
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_exception.h2
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_exception/cdr_op_ch.h50
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_exception/cdr_op_cs.h52
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_field.h2
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ch.h66
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_cs.h78
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface.h2
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_ch.h50
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_cs.h50
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_module.h1
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_module/cdr_op.h49
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_root.h1
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_root/cdr_op.h49
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_sequence.h2
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_sequence/cdr_op_ch.h50
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_sequence/cdr_op_cs.h86
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_structure.h2
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_ch.h50
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_cs.h53
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_structure/structure_cs.h6
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_typedef.h2
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_ch.h69
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_cs.h69
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_union.h2
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_union/cdr_op_ch.h50
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_union/cdr_op_cs.h53
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_union_branch.h2
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_union_branch/cdr_op_ch.h66
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_union_branch/cdr_op_cs.h78
-rw-r--r--TAO/TAO_IDL/fe/fe_lookup.cpp166
-rw-r--r--TAO/TAO_IDL/fe/idl.ll19
-rw-r--r--TAO/TAO_IDL/fe/keywords.dat75
-rw-r--r--TAO/TAO_IDL/fe/lex.yy.cpp63
-rw-r--r--TAO/TAO_IDL/include/fe_private.h17
98 files changed, 7113 insertions, 246 deletions
diff --git a/TAO/TAO_IDL/Makefile b/TAO/TAO_IDL/Makefile
index 4f0909d31b5..8879973680d 100644
--- a/TAO/TAO_IDL/Makefile
+++ b/TAO/TAO_IDL/Makefile
@@ -22,6 +22,7 @@ FILES = tao_idl \
driver/drv_link \
driver/drv_preproc \
fe/fe_declarator \
+ fe/fe_lookup \
fe/fe_private \
fe/fe_init \
fe/fe_extern \
@@ -187,6 +188,16 @@ else # ! CROSS-COMPILE
rm -f tao_idl TAGS
endif # ! CROSS-COMPILE
+fe/fe_lookup.cpp: fe/keywords.dat
+ rm -f fe/fe_lookup.cpp
+ echo "// $Id$" > fe/fe_lookup.cpp
+ echo "#include \"idl.h\"" >> fe/fe_lookup.cpp
+ echo "#include \"idl_extern.h\"" >> fe/fe_lookup.cpp
+ echo "#include \"fe_private.h\"" >> fe/fe_lookup.cpp
+ $(ACE_ROOT)/bin/gperf -M -J -c -C -D -E -T -f 0 -a -o -t -p -K keyword_ \
+ -L C++ -Z TAO_IDL_CPP_Keyword_Table -N lookup fe/keywords.dat \
+ >> fe/fe_lookup.cpp
+
fe/lex.yy.cpp: fe/idl.ll
@echo "WARNING: Potentially outdated fe/lex.yy.cpp"
@echo " either touch(1) the file or explicitly"
@@ -229,9 +240,8 @@ y.tab: fe/idl.yy
tags:
rm -f TAGS
- etags -C tao_idl.cpp include/*.h be_include/*.h be_include/be_visitor_*/*.h \
- etags -a ast/*.cpp util/*.cpp narrow/*.cpp \
- driver/*.cpp fe/*.cpp be/*.cpp be/*/*.cpp
+ find . -name "*.h" -print | etags -a --c++ -
+ find . -name "*.cpp" -print | etags -a -
#----------------------------------------------------------------------------
@@ -245,7 +255,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -283,7 +292,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -321,7 +329,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -359,7 +366,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -456,7 +462,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -515,7 +520,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -553,7 +557,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -615,7 +618,44 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
+ $(ACE_ROOT)/ace/config-g++-common.h \
+ $(ACE_ROOT)/ace/streams.h \
+ $(ACE_ROOT)/ace/Basic_Types.h \
+ $(ACE_ROOT)/ace/Basic_Types.i \
+ $(ACE_ROOT)/ace/OS.i \
+ $(ACE_ROOT)/ace/Trace.h \
+ $(ACE_ROOT)/ace/Log_Msg.h \
+ $(ACE_ROOT)/ace/Log_Record.h \
+ $(ACE_ROOT)/ace/ACE.i \
+ $(ACE_ROOT)/ace/Log_Priority.h \
+ $(ACE_ROOT)/ace/Log_Record.i \
+ include/intlmacros.h include/idl_narrow.h include/idl_defines.h \
+ include/idl_fwd.h include/idl_bool.h include/utl_string.h \
+ include/utl_identifier.h include/ast.h include/utl_scoped_name.h \
+ include/ast_decl.h include/ast_expression.h include/utl_scope.h \
+ include/ast_type.h include/ast_concrete_type.h \
+ include/ast_predefined_type.h include/ast_module.h include/ast_root.h \
+ include/ast_interface.h include/ast_interface_fwd.h \
+ include/ast_structure.h include/ast_exception.h include/ast_enum.h \
+ include/ast_operation.h include/utl_list.h include/ast_field.h \
+ include/ast_argument.h include/ast_attribute.h include/ast_union.h \
+ include/ast_union_branch.h include/ast_union_label.h \
+ include/ast_constant.h include/ast_enum_val.h include/ast_array.h \
+ include/ast_sequence.h include/ast_string.h include/ast_typedef.h \
+ include/ast_native.h include/utl_strlist.h include/utl_exprlist.h \
+ include/ast_generator.h include/util.h include/utl_stack.h \
+ include/utl_idlist.h include/utl_exceptlist.h include/utl_namelist.h \
+ include/utl_labellist.h include/utl_decllist.h include/idl_global.h \
+ include/utl_error.h include/utl_indenter.h include/idl_extern.h \
+ include/fe_extern.h include/be_extern.h include/drv_extern.h \
+ include/ast_extern.h include/nr_extern.h include/global_extern.h \
+ include/fe_private.h include/fe_interface_header.h \
+ include/fe_declarator.h
+.obj/fe_lookup.o .obj/fe_lookup.so .shobj/fe_lookup.o .shobj/fe_lookup.so: fe/fe_lookup.cpp include/idl.h \
+ $(ACE_ROOT)/ace/ACE.h \
+ $(ACE_ROOT)/ace/OS.h \
+ $(ACE_ROOT)/ace/inc_user_config.h \
+ $(ACE_ROOT)/ace/config.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -654,7 +694,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -693,7 +732,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -732,7 +770,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -771,7 +808,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -810,7 +846,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -848,7 +883,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -888,7 +922,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -925,7 +958,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -962,7 +994,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -999,7 +1030,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1036,7 +1066,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1073,7 +1102,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1110,7 +1138,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1147,7 +1174,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1184,7 +1210,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1221,7 +1246,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1258,7 +1282,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1295,7 +1318,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1332,7 +1354,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1369,7 +1390,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1406,7 +1426,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1443,7 +1462,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1480,7 +1498,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1517,7 +1534,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1554,7 +1570,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1591,7 +1606,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1628,7 +1642,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1665,7 +1678,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1702,7 +1714,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1739,7 +1750,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1776,7 +1786,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1813,7 +1822,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1850,7 +1858,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1887,7 +1894,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1924,7 +1930,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1961,7 +1966,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -1998,7 +2002,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2035,7 +2038,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2072,7 +2074,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2109,7 +2110,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2146,7 +2146,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2183,7 +2182,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2220,7 +2218,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2257,7 +2254,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2294,7 +2290,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2331,7 +2326,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2368,7 +2362,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2405,7 +2398,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2442,7 +2434,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2479,7 +2470,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2516,7 +2506,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2553,7 +2542,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2590,7 +2578,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2687,7 +2674,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2784,7 +2770,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2881,7 +2866,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -2978,7 +2962,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -3075,7 +3058,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -3172,7 +3154,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -3269,7 +3250,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -3366,7 +3346,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -3463,7 +3442,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -3508,6 +3486,8 @@ tags:
be_include/be_visitor_interface/collocated_ss.h \
be_include/be_visitor_interface/any_op_ch.h \
be_include/be_visitor_interface/any_op_cs.h \
+ be_include/be_visitor_interface/cdr_op_ch.h \
+ be_include/be_visitor_interface/cdr_op_cs.h \
be_include/be_visitor_interface/tie_sh.h \
be_include/be_visitor_interface/tie_si.h be_include/be.h \
$(ACE_ROOT)/ace/Singleton.h \
@@ -3573,7 +3553,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -3670,7 +3649,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -3767,7 +3745,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -3864,7 +3841,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -3961,7 +3937,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -4058,7 +4033,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -4155,7 +4129,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -4255,13 +4228,14 @@ tags:
be_include/be_visitor_sequence/buffer_type.h \
be_include/be_visitor_sequence/elemtype.h \
be_include/be_visitor_sequence/any_op_ch.h \
- be_include/be_visitor_sequence/any_op_cs.h
+ be_include/be_visitor_sequence/any_op_cs.h \
+ be_include/be_visitor_sequence/cdr_op_ch.h \
+ be_include/be_visitor_sequence/cdr_op_cs.h
.obj/be_string.o .obj/be_string.so .shobj/be_string.o .shobj/be_string.so: be/be_string.cpp include/idl.h \
$(ACE_ROOT)/ace/ACE.h \
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -4358,7 +4332,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -4455,7 +4428,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -4552,7 +4524,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -4649,7 +4620,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -4746,7 +4716,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -4843,7 +4812,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -4940,7 +4908,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -5037,7 +5004,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -5134,7 +5100,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -5231,7 +5196,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -5328,7 +5292,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -5425,7 +5388,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -5522,7 +5484,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -5619,7 +5580,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -5716,7 +5676,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -5813,7 +5772,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -5910,7 +5868,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -6004,7 +5961,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -6121,7 +6077,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -6219,15 +6174,17 @@ tags:
be_include/be_visitor_array/array_cs.h \
be_include/be_visitor_array/any_op_ch.h \
be_include/be_visitor_array/any_op_cs.h \
- be/be_visitor_array/any_op_ch.cpp be/be_visitor_array/any_op_cs.cpp \
- be/be_visitor_array/array.cpp be/be_visitor_array/array_ch.cpp \
- be/be_visitor_array/array_ci.cpp be/be_visitor_array/array_cs.cpp
+ be_include/be_visitor_array/cdr_op_ch.h \
+ be_include/be_visitor_array/cdr_op_cs.h be/be_visitor_array/array.cpp \
+ be/be_visitor_array/array_ch.cpp be/be_visitor_array/array_ci.cpp \
+ be/be_visitor_array/array_cs.cpp be/be_visitor_array/any_op_ch.cpp \
+ be/be_visitor_array/any_op_cs.cpp be/be_visitor_array/cdr_op_ch.cpp \
+ be/be_visitor_array/cdr_op_cs.cpp
.obj/be_visitor_attribute.o .obj/be_visitor_attribute.so .shobj/be_visitor_attribute.o .shobj/be_visitor_attribute.so: be/be_visitor_attribute.cpp include/idl.h \
$(ACE_ROOT)/ace/ACE.h \
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -6327,7 +6284,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -6429,7 +6385,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -6526,7 +6481,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -6623,7 +6577,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -6720,14 +6673,16 @@ tags:
be_include/be_visitor_enum/enum_cs.h \
be_include/be_visitor_enum/any_op_ch.h \
be_include/be_visitor_enum/any_op_cs.h \
- be/be_visitor_enum/any_op_ch.cpp be/be_visitor_enum/any_op_cs.cpp \
- be/be_visitor_enum/enum_ch.cpp be/be_visitor_enum/enum_cs.cpp
+ be_include/be_visitor_enum/cdr_op_ch.h \
+ be_include/be_visitor_enum/cdr_op_cs.h be/be_visitor_enum/enum_ch.cpp \
+ be/be_visitor_enum/enum_cs.cpp be/be_visitor_enum/any_op_ch.cpp \
+ be/be_visitor_enum/any_op_cs.cpp be/be_visitor_enum/cdr_op_ch.cpp \
+ be/be_visitor_enum/cdr_op_cs.cpp
.obj/be_visitor_exception.o .obj/be_visitor_exception.so .shobj/be_visitor_exception.o .shobj/be_visitor_exception.so: be/be_visitor_exception.cpp include/idl.h \
$(ACE_ROOT)/ace/ACE.h \
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -6828,20 +6783,23 @@ tags:
be_include/be_visitor_exception/ctor_assign.h \
be_include/be_visitor_exception/any_op_ch.h \
be_include/be_visitor_exception/any_op_cs.h \
- be/be_visitor_exception/any_op_ch.cpp \
- be/be_visitor_exception/any_op_cs.cpp \
- be/be_visitor_exception/ctor_assign.cpp \
+ be_include/be_visitor_exception/cdr_op_ch.h \
+ be_include/be_visitor_exception/cdr_op_cs.h \
be/be_visitor_exception/exception.cpp \
be/be_visitor_exception/exception_ch.cpp \
be/be_visitor_exception/exception_ci.cpp \
be/be_visitor_exception/exception_cs.cpp \
- be/be_visitor_exception/exception_ctor.cpp
+ be/be_visitor_exception/exception_ctor.cpp \
+ be/be_visitor_exception/ctor_assign.cpp \
+ be/be_visitor_exception/any_op_ch.cpp \
+ be/be_visitor_exception/any_op_cs.cpp \
+ be/be_visitor_exception/cdr_op_ch.cpp \
+ be/be_visitor_exception/cdr_op_cs.cpp
.obj/be_visitor_field.o .obj/be_visitor_field.so .shobj/be_visitor_field.o .shobj/be_visitor_field.so: be/be_visitor_field.cpp include/idl.h \
$(ACE_ROOT)/ace/ACE.h \
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -6936,14 +6894,16 @@ tags:
be_include/be_visitor_decl.h be_include/be_visitor_field/field_ch.h \
be_include/be_visitor_field/field_ci.h \
be_include/be_visitor_field/field_cs.h \
+ be_include/be_visitor_field/cdr_op_ch.h \
+ be_include/be_visitor_field/cdr_op_cs.h \
be/be_visitor_field/field_ch.cpp be/be_visitor_field/field_ci.cpp \
- be/be_visitor_field/field_cs.cpp
+ be/be_visitor_field/field_cs.cpp be/be_visitor_field/cdr_op_ch.cpp \
+ be/be_visitor_field/cdr_op_cs.cpp
.obj/be_visitor_interface.o .obj/be_visitor_interface.so .shobj/be_visitor_interface.o .shobj/be_visitor_interface.so: be/be_visitor_interface.cpp include/idl.h \
$(ACE_ROOT)/ace/ACE.h \
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -7047,12 +7007,10 @@ tags:
be_include/be_visitor_interface/collocated_ss.h \
be_include/be_visitor_interface/any_op_ch.h \
be_include/be_visitor_interface/any_op_cs.h \
+ be_include/be_visitor_interface/cdr_op_ch.h \
+ be_include/be_visitor_interface/cdr_op_cs.h \
be_include/be_visitor_interface/tie_sh.h \
be_include/be_visitor_interface/tie_si.h \
- be/be_visitor_interface/any_op_ch.cpp \
- be/be_visitor_interface/any_op_cs.cpp \
- be/be_visitor_interface/collocated_sh.cpp \
- be/be_visitor_interface/collocated_ss.cpp \
be/be_visitor_interface/interface.cpp \
be/be_visitor_interface/interface_ch.cpp \
be/be_visitor_interface/interface_ci.cpp \
@@ -7060,13 +7018,18 @@ tags:
be/be_visitor_interface/interface_sh.cpp \
be/be_visitor_interface/interface_si.cpp \
be/be_visitor_interface/interface_ss.cpp \
- be/be_visitor_interface/tie_sh.cpp be/be_visitor_interface/tie_si.cpp
+ be/be_visitor_interface/collocated_sh.cpp \
+ be/be_visitor_interface/collocated_ss.cpp \
+ be/be_visitor_interface/tie_sh.cpp be/be_visitor_interface/tie_si.cpp \
+ be/be_visitor_interface/any_op_ch.cpp \
+ be/be_visitor_interface/any_op_cs.cpp \
+ be/be_visitor_interface/cdr_op_ch.cpp \
+ be/be_visitor_interface/cdr_op_cs.cpp
.obj/be_visitor_interface_fwd.o .obj/be_visitor_interface_fwd.so .shobj/be_visitor_interface_fwd.o .shobj/be_visitor_interface_fwd.so: be/be_visitor_interface_fwd.cpp \
include/idl.h $(ACE_ROOT)/ace/ACE.h \
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -7168,7 +7131,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -7264,15 +7226,15 @@ tags:
be_include/be_visitor_module/module.h \
be_include/be_visitor_module/module_ch.h \
be_include/be_visitor_module/module_sh.h \
- be_include/be_visitor_module/any_op.h be/be_visitor_module/any_op.cpp \
- be/be_visitor_module/module.cpp be/be_visitor_module/module_ch.cpp \
- be/be_visitor_module/module_sh.cpp
+ be_include/be_visitor_module/any_op.h \
+ be_include/be_visitor_module/cdr_op.h be/be_visitor_module/module.cpp \
+ be/be_visitor_module/module_ch.cpp be/be_visitor_module/module_sh.cpp \
+ be/be_visitor_module/any_op.cpp be/be_visitor_module/cdr_op.cpp
.obj/be_visitor_operation.o .obj/be_visitor_operation.so .shobj/be_visitor_operation.o .shobj/be_visitor_operation.so: be/be_visitor_operation.cpp include/idl.h \
$(ACE_ROOT)/ace/ACE.h \
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -7411,7 +7373,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -7511,17 +7472,17 @@ tags:
be_include/be_visitor_root/root_sh.h \
be_include/be_visitor_root/root_si.h \
be_include/be_visitor_root/root_ss.h \
- be_include/be_visitor_root/any_op.h be/be_visitor_root/any_op.cpp \
- be/be_visitor_root/root.cpp be/be_visitor_root/root_ch.cpp \
- be/be_visitor_root/root_ci.cpp be/be_visitor_root/root_cs.cpp \
- be/be_visitor_root/root_sh.cpp be/be_visitor_root/root_si.cpp \
- be/be_visitor_root/root_ss.cpp
+ be_include/be_visitor_root/any_op.h \
+ be_include/be_visitor_root/cdr_op.h be/be_visitor_root/root.cpp \
+ be/be_visitor_root/root_ch.cpp be/be_visitor_root/root_ci.cpp \
+ be/be_visitor_root/root_cs.cpp be/be_visitor_root/root_sh.cpp \
+ be/be_visitor_root/root_si.cpp be/be_visitor_root/root_ss.cpp \
+ be/be_visitor_root/any_op.cpp be/be_visitor_root/cdr_op.cpp
.obj/be_visitor_scope.o .obj/be_visitor_scope.so .shobj/be_visitor_scope.o .shobj/be_visitor_scope.so: be/be_visitor_scope.cpp include/idl.h \
$(ACE_ROOT)/ace/ACE.h \
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -7619,7 +7580,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -7720,8 +7680,12 @@ tags:
be_include/be_visitor_sequence/elemtype.h \
be_include/be_visitor_sequence/any_op_ch.h \
be_include/be_visitor_sequence/any_op_cs.h \
+ be_include/be_visitor_sequence/cdr_op_ch.h \
+ be_include/be_visitor_sequence/cdr_op_cs.h \
be/be_visitor_sequence/any_op_ch.cpp \
be/be_visitor_sequence/any_op_cs.cpp \
+ be/be_visitor_sequence/cdr_op_ch.cpp \
+ be/be_visitor_sequence/cdr_op_cs.cpp \
be/be_visitor_sequence/buffer_type.cpp \
be/be_visitor_sequence/elemtype.cpp \
be/be_visitor_sequence/sequence_base.cpp \
@@ -7739,7 +7703,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -7838,18 +7801,21 @@ tags:
be_include/be_visitor_structure/structure_cs.h \
be_include/be_visitor_structure/any_op_ch.h \
be_include/be_visitor_structure/any_op_cs.h \
- be/be_visitor_structure/any_op_ch.cpp \
- be/be_visitor_structure/any_op_cs.cpp \
+ be_include/be_visitor_structure/cdr_op_ch.h \
+ be_include/be_visitor_structure/cdr_op_cs.h \
be/be_visitor_structure/structure.cpp \
be/be_visitor_structure/structure_ch.cpp \
be/be_visitor_structure/structure_ci.cpp \
- be/be_visitor_structure/structure_cs.cpp
+ be/be_visitor_structure/structure_cs.cpp \
+ be/be_visitor_structure/any_op_ch.cpp \
+ be/be_visitor_structure/any_op_cs.cpp \
+ be/be_visitor_structure/cdr_op_ch.cpp \
+ be/be_visitor_structure/cdr_op_cs.cpp
.obj/be_visitor_typecode.o .obj/be_visitor_typecode.so .shobj/be_visitor_typecode.o .shobj/be_visitor_typecode.so: be/be_visitor_typecode.cpp include/idl.h \
$(ACE_ROOT)/ace/ACE.h \
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -7951,7 +7917,6 @@ tags:
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -8050,17 +8015,21 @@ tags:
be_include/be_visitor_typedef/typedef_cs.h \
be_include/be_visitor_typedef/any_op_ch.h \
be_include/be_visitor_typedef/any_op_cs.h \
- be/be_visitor_typedef/any_op_ch.cpp \
- be/be_visitor_typedef/any_op_cs.cpp be/be_visitor_typedef/typedef.cpp \
+ be_include/be_visitor_typedef/cdr_op_ch.h \
+ be_include/be_visitor_typedef/cdr_op_cs.h \
+ be/be_visitor_typedef/typedef.cpp \
be/be_visitor_typedef/typedef_ch.cpp \
be/be_visitor_typedef/typedef_ci.cpp \
- be/be_visitor_typedef/typedef_cs.cpp
+ be/be_visitor_typedef/typedef_cs.cpp \
+ be/be_visitor_typedef/any_op_ch.cpp \
+ be/be_visitor_typedef/any_op_cs.cpp \
+ be/be_visitor_typedef/cdr_op_ch.cpp \
+ be/be_visitor_typedef/cdr_op_cs.cpp
.obj/be_visitor_union.o .obj/be_visitor_union.so .shobj/be_visitor_union.o .shobj/be_visitor_union.so: be/be_visitor_union.cpp include/idl.h \
$(ACE_ROOT)/ace/ACE.h \
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -8162,18 +8131,20 @@ tags:
be_include/be_visitor_union/discriminant_cs.h \
be_include/be_visitor_union/any_op_ch.h \
be_include/be_visitor_union/any_op_cs.h \
- be/be_visitor_union/any_op_ch.cpp be/be_visitor_union/any_op_cs.cpp \
+ be_include/be_visitor_union/cdr_op_ch.h \
+ be_include/be_visitor_union/cdr_op_cs.h \
be/be_visitor_union/discriminant_ch.cpp \
be/be_visitor_union/discriminant_ci.cpp \
be/be_visitor_union/discriminant_cs.cpp be/be_visitor_union/union.cpp \
be/be_visitor_union/union_ch.cpp be/be_visitor_union/union_ci.cpp \
- be/be_visitor_union/union_cs.cpp
+ be/be_visitor_union/union_cs.cpp be/be_visitor_union/any_op_ch.cpp \
+ be/be_visitor_union/any_op_cs.cpp be/be_visitor_union/cdr_op_ch.cpp \
+ be/be_visitor_union/cdr_op_cs.cpp
.obj/be_visitor_union_branch.o .obj/be_visitor_union_branch.so .shobj/be_visitor_union_branch.o .shobj/be_visitor_union_branch.so: be/be_visitor_union_branch.cpp \
include/idl.h $(ACE_ROOT)/ace/ACE.h \
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -8273,19 +8244,22 @@ tags:
be_include/be_visitor_union_branch/public_reset_cs.h \
be_include/be_visitor_union_branch/public_access_cs.h \
be_include/be_visitor_union_branch/private_ch.h \
+ be_include/be_visitor_union_branch/cdr_op_ch.h \
+ be_include/be_visitor_union_branch/cdr_op_cs.h \
be/be_visitor_union_branch/private_ch.cpp \
be/be_visitor_union_branch/public_assign_cs.cpp \
be/be_visitor_union_branch/public_reset_cs.cpp \
be/be_visitor_union_branch/public_access_cs.cpp \
be/be_visitor_union_branch/public_ch.cpp \
be/be_visitor_union_branch/public_ci.cpp \
- be/be_visitor_union_branch/public_cs.cpp
+ be/be_visitor_union_branch/public_cs.cpp \
+ be/be_visitor_union_branch/cdr_op_ch.cpp \
+ be/be_visitor_union_branch/cdr_op_cs.cpp
.obj/be_interpretive.o .obj/be_interpretive.so .shobj/be_interpretive.o .shobj/be_interpretive.so: be/be_interpretive.cpp include/idl.h \
$(ACE_ROOT)/ace/ACE.h \
$(ACE_ROOT)/ace/OS.h \
$(ACE_ROOT)/ace/inc_user_config.h \
$(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/config-sunos5.5.h \
$(ACE_ROOT)/ace/config-g++-common.h \
$(ACE_ROOT)/ace/streams.h \
$(ACE_ROOT)/ace/Basic_Types.h \
@@ -8395,6 +8369,8 @@ tags:
be_include/be_visitor_array/array_cs.h \
be_include/be_visitor_array/any_op_ch.h \
be_include/be_visitor_array/any_op_cs.h \
+ be_include/be_visitor_array/cdr_op_ch.h \
+ be_include/be_visitor_array/cdr_op_cs.h \
be_include/be_visitor_attribute.h be_include/be_visitor_scope.h \
be_include/be_visitor_attribute/attribute.h \
be_include/be_visitor_constant.h \
@@ -8404,6 +8380,8 @@ tags:
be_include/be_visitor_enum/enum_cs.h \
be_include/be_visitor_enum/any_op_ch.h \
be_include/be_visitor_enum/any_op_cs.h \
+ be_include/be_visitor_enum/cdr_op_ch.h \
+ be_include/be_visitor_enum/cdr_op_cs.h \
be_include/be_visitor_exception.h \
be_include/be_visitor_exception/exception.h \
be_include/be_visitor_exception/exception_ch.h \
@@ -8413,9 +8391,13 @@ tags:
be_include/be_visitor_exception/ctor_assign.h \
be_include/be_visitor_exception/any_op_ch.h \
be_include/be_visitor_exception/any_op_cs.h \
+ be_include/be_visitor_exception/cdr_op_ch.h \
+ be_include/be_visitor_exception/cdr_op_cs.h \
be_include/be_visitor_field.h be_include/be_visitor_field/field_ch.h \
be_include/be_visitor_field/field_ci.h \
be_include/be_visitor_field/field_cs.h \
+ be_include/be_visitor_field/cdr_op_ch.h \
+ be_include/be_visitor_field/cdr_op_cs.h \
be_include/be_visitor_interface.h \
be_include/be_visitor_interface/interface.h \
be_include/be_visitor_interface/interface_ch.h \
@@ -8428,6 +8410,8 @@ tags:
be_include/be_visitor_interface/collocated_ss.h \
be_include/be_visitor_interface/any_op_ch.h \
be_include/be_visitor_interface/any_op_cs.h \
+ be_include/be_visitor_interface/cdr_op_ch.h \
+ be_include/be_visitor_interface/cdr_op_cs.h \
be_include/be_visitor_interface/tie_sh.h \
be_include/be_visitor_interface/tie_si.h \
be_include/be_visitor_interface_fwd.h \
@@ -8437,6 +8421,7 @@ tags:
be_include/be_visitor_module/module_ch.h \
be_include/be_visitor_module/module_sh.h \
be_include/be_visitor_module/any_op.h \
+ be_include/be_visitor_module/cdr_op.h \
be_include/be_visitor_operation.h \
be_include/be_visitor_operation/operation_ch.h \
be_include/be_visitor_operation/operation_cs.h \
@@ -8466,7 +8451,8 @@ tags:
be_include/be_visitor_root/root_sh.h \
be_include/be_visitor_root/root_si.h \
be_include/be_visitor_root/root_ss.h \
- be_include/be_visitor_root/any_op.h be_include/be_visitor_sequence.h \
+ be_include/be_visitor_root/any_op.h \
+ be_include/be_visitor_root/cdr_op.h be_include/be_visitor_sequence.h \
be_include/be_visitor_sequence/sequence_ch.h \
be_include/be_visitor_sequence/sequence_ci.h \
be_include/be_visitor_sequence/sequence_cs.h \
@@ -8475,6 +8461,8 @@ tags:
be_include/be_visitor_sequence/elemtype.h \
be_include/be_visitor_sequence/any_op_ch.h \
be_include/be_visitor_sequence/any_op_cs.h \
+ be_include/be_visitor_sequence/cdr_op_ch.h \
+ be_include/be_visitor_sequence/cdr_op_cs.h \
be_include/be_visitor_structure.h \
be_include/be_visitor_structure/structure.h \
be_include/be_visitor_structure/structure_ch.h \
@@ -8482,6 +8470,8 @@ tags:
be_include/be_visitor_structure/structure_cs.h \
be_include/be_visitor_structure/any_op_ch.h \
be_include/be_visitor_structure/any_op_cs.h \
+ be_include/be_visitor_structure/cdr_op_ch.h \
+ be_include/be_visitor_structure/cdr_op_cs.h \
be_include/be_visitor_typecode.h \
be_include/be_visitor_typecode/typecode_decl.h \
be_include/be_visitor_typecode/typecode_defn.h \
@@ -8492,6 +8482,8 @@ tags:
be_include/be_visitor_typedef/typedef_cs.h \
be_include/be_visitor_typedef/any_op_ch.h \
be_include/be_visitor_typedef/any_op_cs.h \
+ be_include/be_visitor_typedef/cdr_op_ch.h \
+ be_include/be_visitor_typedef/cdr_op_cs.h \
be_include/be_visitor_union.h be_include/be_visitor_union/union.h \
be_include/be_visitor_union/union_ch.h \
be_include/be_visitor_union/union_ci.h \
@@ -8501,6 +8493,8 @@ tags:
be_include/be_visitor_union/discriminant_cs.h \
be_include/be_visitor_union/any_op_ch.h \
be_include/be_visitor_union/any_op_cs.h \
+ be_include/be_visitor_union/cdr_op_ch.h \
+ be_include/be_visitor_union/cdr_op_cs.h \
be_include/be_visitor_union_branch.h \
be_include/be_visitor_union_branch/public_ch.h \
be_include/be_visitor_union_branch/public_ci.h \
@@ -8508,6 +8502,8 @@ tags:
be_include/be_visitor_union_branch/public_assign_cs.h \
be_include/be_visitor_union_branch/public_reset_cs.h \
be_include/be_visitor_union_branch/public_access_cs.h \
- be_include/be_visitor_union_branch/private_ch.h
+ be_include/be_visitor_union_branch/private_ch.h \
+ be_include/be_visitor_union_branch/cdr_op_ch.h \
+ be_include/be_visitor_union_branch/cdr_op_cs.h
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/TAO/TAO_IDL/be/be_array.cpp b/TAO/TAO_IDL/be/be_array.cpp
index 6e7a9a86782..068493cac91 100644
--- a/TAO/TAO_IDL/be/be_array.cpp
+++ b/TAO/TAO_IDL/be/be_array.cpp
@@ -532,9 +532,9 @@ be_array::gen_out_defn (void)
// constructor from a _var &
*ch << namebuf << " (" << this->local_name () << "_var &);" << nl;
// constructor from a _out &
- *ch << namebuf << " (" << namebuf << " &);" << nl;
+ *ch << namebuf << " (const " << namebuf << " &);" << nl;
// assignment operator from a _out &
- *ch << namebuf << " &operator= (" << namebuf << " &);" << nl;
+ *ch << namebuf << " &operator= (const " << namebuf << " &);" << nl;
// assignment from slice *
*ch << namebuf << " &operator= (" << this->local_name () << "_slice *);" <<
nl;
@@ -615,19 +615,21 @@ be_array::gen_out_impl (void)
// copy constructor
ci->indent ();
*ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << fname <<
+ *ci << fname << "::" << lname << " (const " << fname <<
" &p) // copy constructor" << nl;
- *ci << " : ptr_ (p.ptr_)" << 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= (" << fname <<
+ *ci << fname << "::operator= (const " << fname <<
" &p)" << nl;
*ci << "{\n";
ci->incr_indent ();
- *ci << "this->ptr_ = p.ptr_;" << nl;
+ *ci << "this->ptr_ = ACE_const_cast ("
+ << fname << "&,p).ptr_;" << nl;
*ci << "return *this;\n";
ci->decr_indent ();
*ci << "}\n\n";
diff --git a/TAO/TAO_IDL/be/be_decl.cpp b/TAO/TAO_IDL/be/be_decl.cpp
index f56a0779f79..df1f7505b65 100644
--- a/TAO/TAO_IDL/be/be_decl.cpp
+++ b/TAO/TAO_IDL/be/be_decl.cpp
@@ -35,6 +35,8 @@ be_decl::be_decl (void)
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),
flatname_ (0),
repoID_ (0),
@@ -57,6 +59,8 @@ be_decl::be_decl (AST_Decl::NodeType type,
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),
flatname_ (0),
repoID_ (0),
@@ -547,6 +551,18 @@ be_decl::cli_stub_any_op_gen (void)
}
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_gen (void)
{
return this->cli_inline_gen_;
@@ -596,6 +612,18 @@ be_decl::cli_stub_any_op_gen (idl_bool 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_gen (idl_bool val)
{
this->cli_inline_gen_ = val;
diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp
index 78cae840244..17032cda88e 100644
--- a/TAO/TAO_IDL/be/be_interface.cpp
+++ b/TAO/TAO_IDL/be/be_interface.cpp
@@ -565,9 +565,9 @@ be_interface::gen_out_defn (void)
// constructor from a _var &
*ch << namebuf << " (" << local_name () << "_var &);" << nl;
// constructor from a _out &
- *ch << namebuf << " (" << namebuf << " &);" << nl;
+ *ch << namebuf << " (const " << namebuf << " &);" << nl;
// assignment operator from a _out &
- *ch << namebuf << " &operator= (" << namebuf << " &);" << nl;
+ *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 &
@@ -648,19 +648,19 @@ be_interface::gen_out_impl (void)
// copy constructor
ci->indent ();
*ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << fname <<
+ *ci << fname << "::" << lname << " (const " << fname <<
" &p) // copy constructor" << nl;
- *ci << " : ptr_ (p.ptr_)" << 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= (" << fname <<
+ *ci << fname << "::operator= (const " << fname <<
" &p)" << nl;
*ci << "{\n";
ci->incr_indent ();
- *ci << "this->ptr_ = p.ptr_;" << nl;
+ *ci << "this->ptr_ = ACE_const_cast (" << fname << "&,p).ptr_;" << nl;
*ci << "return *this;\n";
ci->decr_indent ();
*ci << "}\n\n";
diff --git a/TAO/TAO_IDL/be/be_interface_fwd.cpp b/TAO/TAO_IDL/be/be_interface_fwd.cpp
index 9815b2bf22d..75bc5b02e0e 100644
--- a/TAO/TAO_IDL/be/be_interface_fwd.cpp
+++ b/TAO/TAO_IDL/be/be_interface_fwd.cpp
@@ -336,9 +336,9 @@ be_interface_fwd::gen_out_defn (void)
// constructor from a _var &
*ch << namebuf << " (" << local_name () << "_var &);" << nl;
// constructor from a _out &
- *ch << namebuf << " (" << namebuf << " &);" << nl;
+ *ch << namebuf << " (const " << namebuf << " &);" << nl;
// assignment operator from a _out &
- *ch << namebuf << " &operator= (" << namebuf << " &);" << nl;
+ *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 &
@@ -420,19 +420,20 @@ be_interface_fwd::gen_out_impl (void)
// copy constructor
ci->indent ();
*ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << fname <<
+ *ci << fname << "::" << lname << " (const " << fname <<
" &p) // copy constructor" << nl;
- *ci << " : ptr_ (p.ptr_)" << 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= (" << fname <<
+ *ci << fname << "::operator= (const " << fname <<
" &p)" << nl;
*ci << "{\n";
ci->incr_indent ();
- *ci << "this->ptr_ = p.ptr_;" << nl;
+ *ci << "this->ptr_ = ACE_const_cast (" << fname << "&,p).ptr_;" << nl;
*ci << "return *this;\n";
ci->decr_indent ();
*ci << "}\n\n";
diff --git a/TAO/TAO_IDL/be/be_interpretive.cpp b/TAO/TAO_IDL/be/be_interpretive.cpp
index 953bf9e93d6..2e2522db17e 100644
--- a/TAO/TAO_IDL/be/be_interpretive.cpp
+++ b/TAO/TAO_IDL/be/be_interpretive.cpp
@@ -82,6 +82,9 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx)
case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
return new be_visitor_root_any_op (new_ctx);
+ case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
+ case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
+ return new be_visitor_root_cdr_op (new_ctx);
case TAO_CodeGen::TAO_MODULE_CH:
return new be_visitor_module_ch (new_ctx);
@@ -95,6 +98,9 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *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_CS:
+ return new be_visitor_module_any_op (new_ctx);
case TAO_CodeGen::TAO_INTERFACE_CH:
@@ -121,6 +127,10 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx)
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_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);
@@ -137,6 +147,10 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx)
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_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);
@@ -151,6 +165,10 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx)
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_CS:
+ return new be_visitor_enum_cdr_op_cs (new_ctx);
case TAO_CodeGen::TAO_FIELD_CH:
return new be_visitor_field_ch (new_ctx);
@@ -158,6 +176,10 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx)
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_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);
@@ -189,6 +211,14 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx)
return new be_visitor_union_any_op_ch (new_ctx);
case TAO_CodeGen::TAO_UNION_ANY_OP_CS:
return new be_visitor_union_any_op_cs (new_ctx);
+ 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_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_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);
@@ -211,6 +241,10 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx)
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_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);
@@ -222,6 +256,10 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx)
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_CS:
+ return new be_visitor_typedef_cdr_op_cs (new_ctx);
case TAO_CodeGen::TAO_TYPECODE_DECL:
return new be_visitor_typecode_decl (new_ctx);
@@ -335,6 +373,10 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx)
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_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);
@@ -346,6 +388,10 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx)
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_CS:
+ return new be_visitor_array_cdr_op_cs (new_ctx);
case TAO_CodeGen::TAO_OPERATION_RESULT_SS:
case TAO_CodeGen::TAO_ARGUMENT_CH:
diff --git a/TAO/TAO_IDL/be/be_structure.cpp b/TAO/TAO_IDL/be/be_structure.cpp
index 5f735c43d15..4cd32b1def8 100644
--- a/TAO/TAO_IDL/be/be_structure.cpp
+++ b/TAO/TAO_IDL/be/be_structure.cpp
@@ -419,9 +419,9 @@ be_structure::gen_out_defn (void)
// constructor from a _var &
*ch << namebuf << " (" << local_name () << "_var &);" << nl;
// constructor from a _out &
- *ch << namebuf << " (" << namebuf << " &);" << nl;
+ *ch << namebuf << " (const " << namebuf << " &);" << nl;
// assignment operator from a _out &
- *ch << namebuf << " &operator= (" << namebuf << " &);" << nl;
+ *ch << namebuf << " &operator= (const " << namebuf << " &);" << nl;
// assignment operator from a pointer &, cast operator, ptr fn, operator
// -> and any other extra operators
// assignment
@@ -501,19 +501,19 @@ be_structure::gen_out_impl (void)
// copy constructor
ci->indent ();
*ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << fname <<
+ *ci << fname << "::" << lname << " (const " << fname <<
" &p) // copy constructor" << nl;
- *ci << " : ptr_ (p.ptr_)" << 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= (" << fname <<
+ *ci << fname << "::operator= (const " << fname <<
" &p)" << nl;
*ci << "{\n";
ci->incr_indent ();
- *ci << "this->ptr_ = p.ptr_;" << nl;
+ *ci << "this->ptr_ = ACE_const_cast (" << fname << "&,p).ptr_;" << nl;
*ci << "return *this;\n";
ci->decr_indent ();
*ci << "}\n\n";
diff --git a/TAO/TAO_IDL/be/be_union.cpp b/TAO/TAO_IDL/be/be_union.cpp
index 62680599fcf..aedbbce63f4 100644
--- a/TAO/TAO_IDL/be/be_union.cpp
+++ b/TAO/TAO_IDL/be/be_union.cpp
@@ -473,9 +473,9 @@ be_union::gen_out_defn (void)
// constructor from a _var &
*ch << namebuf << " (" << local_name () << "_var &);" << nl;
// constructor from a _out &
- *ch << namebuf << " (" << namebuf << " &);" << nl;
+ *ch << namebuf << " (const " << namebuf << " &);" << nl;
// assignment operator from a _out &
- *ch << namebuf << " &operator= (" << namebuf << " &);" << nl;
+ *ch << namebuf << " &operator= (const " << namebuf << " &);" << nl;
// assignment operator from a pointer &, cast operator, ptr fn, operator
// -> and any other extra operators
// assignment
@@ -555,19 +555,19 @@ be_union::gen_out_impl (void)
// copy constructor
ci->indent ();
*ci << "ACE_INLINE" << nl;
- *ci << fname << "::" << lname << " (" << fname <<
+ *ci << fname << "::" << lname << " (const " << fname <<
" &p) // copy constructor" << nl;
- *ci << " : ptr_ (p.ptr_)" << 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= (" << fname <<
+ *ci << fname << "::operator= (const " << fname <<
" &p)" << nl;
*ci << "{\n";
ci->incr_indent ();
- *ci << "this->ptr_ = p.ptr_;" << nl;
+ *ci << "this->ptr_ = ACE_const_cast (" << fname << "&,p).ptr_;" << nl;
*ci << "return *this;\n";
ci->decr_indent ();
*ci << "}\n\n";
diff --git a/TAO/TAO_IDL/be/be_visitor_array.cpp b/TAO/TAO_IDL/be/be_visitor_array.cpp
index d55355a5466..d3b5a590e05 100644
--- a/TAO/TAO_IDL/be/be_visitor_array.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_array.cpp
@@ -25,12 +25,14 @@
#include "be_visitor_array.h"
// include all the individual files
-#include "be_visitor_array/any_op_ch.cpp"
-#include "be_visitor_array/any_op_cs.cpp"
#include "be_visitor_array/array.cpp"
#include "be_visitor_array/array_ch.cpp"
#include "be_visitor_array/array_ci.cpp"
#include "be_visitor_array/array_cs.cpp"
+#include "be_visitor_array/any_op_ch.cpp"
+#include "be_visitor_array/any_op_cs.cpp"
+#include "be_visitor_array/cdr_op_ch.cpp"
+#include "be_visitor_array/cdr_op_cs.cpp"
ACE_RCSID(be, be_visitor_array, "$Id$")
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
new file mode 100644
index 00000000000..5808a807223
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp
@@ -0,0 +1,63 @@
+//
+// $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 = tao_cg->client_header ();
+
+ // generate the CDR << and >> operator declarations
+ *os << "CORBA::Boolean " << idl_global->export_macro ()
+ << " operator<< (TAO_OutputCDR &, const " << node->name ()
+ << "_slice *); // " << be_nl;
+ *os << "CORBA::Boolean " << idl_global->export_macro ()
+ << " operator>> (TAO_InputCDR &, "
+ << node->name () << "_slice *);\n";
+
+ node->cli_hdr_cdr_op_gen (1);
+ return 0;
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp
new file mode 100644
index 00000000000..266a869f6f4
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp
@@ -0,0 +1,495 @@
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_cs.cpp
+//
+// = DESCRIPTION
+// Visitor for code generation of Arrays for the Cdr operators in the client
+// stubs.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
+
+#include "be_visitor_array.h"
+
+ACE_RCSID(be_visitor_array, cdr_op_cs, "$Id$")
+
+
+// ***************************************************************************
+// Array visitor for generating CDR operator declarations in the client
+// stubs file
+// ***************************************************************************
+
+be_visitor_array_cdr_op_cs::be_visitor_array_cdr_op_cs
+(be_visitor_context *ctx)
+ : be_visitor_decl (ctx)
+{
+}
+
+be_visitor_array_cdr_op_cs::~be_visitor_array_cdr_op_cs (void)
+{
+}
+
+int
+be_visitor_array_cdr_op_cs::visit_array (be_array *node)
+{
+ if (this->ctx_->alias ())
+ {
+ // we are here because 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 = tao_cg->client_stubs ();
+ be_type *bt; // base type of the array
+
+ if (node->cli_stub_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_cs::"
+ "visit_array - "
+ "Bad base type\n"),
+ -1);
+ }
+
+ // 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 << "CORBA::Boolean operator<< (TAO_OutputCDR &strm, "
+ << "const " << node->name () << "_slice *_tao_array)" << be_nl
+ << "{" << be_idt_nl;
+
+ if (bt->accept (this) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_array_cdr_op_cs::"
+ "visit_array - "
+ "Base type codegen failed\n"),
+ -1);
+ }
+ *os << "}\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>> (TAO_InputCDR &strm, "
+ << node->name () << "_slice *_tao_array)" << be_nl
+ << "{" << be_idt_nl;
+ if (bt->accept (this) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_array_cdr_op_cs::"
+ "visit_array - "
+ "Base type codegen failed\n"),
+ -1);
+ }
+ *os << "}\n\n";
+
+ node->cli_stub_cdr_op_gen (1);
+ }
+ return 0;
+}
+
+// handle all the base types
+
+int
+be_visitor_array_cdr_op_cs::visit_enum (be_enum *node)
+{
+ return this->visit_node (node);
+}
+
+int
+be_visitor_array_cdr_op_cs::visit_interface (be_interface *node)
+{
+ return this->visit_node (node);
+}
+
+int
+be_visitor_array_cdr_op_cs::visit_interface_fwd (be_interface_fwd *node)
+{
+ return this->visit_node (node);
+}
+
+int
+be_visitor_array_cdr_op_cs::visit_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_cs::"
+ "visit_predefined_type - "
+ "Bad primitive type\n"
+ ), -1);
+ default:
+ // all other primitive types. Handle them as shown below
+ break;
+ };
+
+ // we get here if the "type" of individual elements of the array is a
+ // primitive type. In this case, we treat the array as a single dimensional
+ // array (even of 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_cs::"
+ "visit_predefined_type - "
+ "bad array node\n"),
+ -1);
+ }
+
+ // we generate optimized code based on an optimized interface available from
+ // the CDR class. These optimizations are applicable only to primitive
+ // types.
+ *os << " return strm.";
+
+ // based on our substate, we may be reading from a stream or writing into a
+ // stream
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << "read_";
+ break;
+ case TAO_CodeGen::TAO_CDR_OUTPUT:
+ *os << "write_";
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_array_cdr_op_cs::"
+ "visit_predefined_type - "
+ "bad sub state\n"),
+ -1);
+ }
+
+ // determine what kind of array are we reading/writing
+ switch (node->pt ())
+ {
+ case AST_PredefinedType::PT_long:
+ *os << "long_array";
+ break;
+ case AST_PredefinedType::PT_ulong:
+ *os << "ulong_array";
+ break;
+ case AST_PredefinedType::PT_short:
+ *os << "short_array";
+ break;
+ case AST_PredefinedType::PT_ushort:
+ *os << "ushort_array";
+ break;
+ case AST_PredefinedType::PT_octet:
+ *os << "octet_array";
+ break;
+ case AST_PredefinedType::PT_char:
+ *os << "char_array";
+ break;
+ case AST_PredefinedType::PT_wchar:
+ *os << "wchar_array";
+ break;
+ case AST_PredefinedType::PT_float:
+ *os << "float_array";
+ break;
+ case AST_PredefinedType::PT_double:
+ *os << "double_array";
+ break;
+ case AST_PredefinedType::PT_longlong:
+ *os << "longlong_array";
+ break;
+ case AST_PredefinedType::PT_ulonglong:
+ *os << "ulonglong_array";
+ break;
+ case AST_PredefinedType::PT_longdouble:
+ *os << "longdouble_array";
+ break;
+ case AST_PredefinedType::PT_boolean:
+ *os << "boolean_array";
+ break;
+ default:
+ // error
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_array_cdr_op_cs::"
+ "visit_predefined_type - "
+ "bad primitive type for optimized code gen\n"),
+ -1);
+ }
+
+ // handle special case to avoid compiler errors
+ switch (node->pt ())
+ {
+ case AST_PredefinedType::PT_char:
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << " ((char *)_tao_array, ";
+ break;
+ case TAO_CodeGen::TAO_CDR_OUTPUT:
+ *os << " ((const char *)_tao_array, ";
+ break;
+ }
+ break;
+ default:
+ *os << " (_tao_array, ";
+ break;
+ }
+ // 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_cs::"
+ "visit_predefined_type - "
+ "bad array dimension\n"),
+ -1);
+ }
+ if (i != 0)
+ // do not generate the multiplication operator teh first time in
+ *os << "*";
+ if (expr->ev ()->et == AST_Expression::EV_ulong)
+ {
+ // generate a loop for each dimension
+ *os << expr->ev ()->u.ulval;
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_array_cdr_op_cs::"
+ "visit_predefined_type - "
+ "bad array dimension value\n"),
+ -1);
+ }
+ }
+ *os << ");" << be_uidt_nl;
+
+ return 0;
+}
+
+int
+be_visitor_array_cdr_op_cs::visit_sequence (be_sequence *node)
+{
+ return this->visit_node (node);
+}
+
+int
+be_visitor_array_cdr_op_cs::visit_string (be_string *node)
+{
+ return this->visit_node (node);
+}
+
+int
+be_visitor_array_cdr_op_cs::visit_structure (be_structure *node)
+{
+ return this->visit_node (node);
+}
+
+int
+be_visitor_array_cdr_op_cs::visit_union (be_union *node)
+{
+ return this->visit_node (node);
+}
+
+int
+be_visitor_array_cdr_op_cs::visit_typedef (be_typedef *node)
+{
+ this->ctx_->alias (node); // 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_cs::"
+ "visit_typedef - "
+ "Bad primitive type\n"
+ ), -1);
+ }
+
+ this->ctx_->alias (0);
+ return 0;
+}
+
+// helper
+int
+be_visitor_array_cdr_op_cs::visit_node (be_type *bt)
+{
+ TAO_OutStream *os = this->ctx_->stream ();
+ unsigned long i;
+ be_array *node = this->ctx_->be_node_as_array ();
+
+ if (!node)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_array_cdr_op_cs::"
+ "visit_node - "
+ "bad array node\n"),
+ -1);
+ }
+
+ // initialize a boolean variable
+ *os << "CORBA::Boolean _tao_marshal_flag = 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_cs::"
+ "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_cs::"
+ "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 >> _tao_array ";
+ for (i = 0; i < node->n_dims (); i++)
+ {
+ *os << "[i" << i << "]";
+ }
+ switch (bt->node_type ())
+ {
+ 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_cs::"
+ "visit_node - "
+ "bad predefined type node\n"),
+ -1);
+ }
+ if (pt->pt () == AST_PredefinedType::PT_pseudo)
+ {
+ *os << ".out ()";
+ }
+ }
+ }
+ *os << ");";
+ break;
+ case TAO_CodeGen::TAO_CDR_OUTPUT:
+ *os << "_tao_marshal_flag = (strm << _tao_array ";
+ for (i = 0; i < node->n_dims (); i++)
+ {
+ *os << "[i" << 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_array_cdr_op_cs::"
+ "visit_node - "
+ "bad predefined type node\n"),
+ -1);
+ }
+ if (pt->pt () == AST_PredefinedType::PT_pseudo)
+ {
+ *os << ".in ()";
+ }
+ }
+ }
+ *os << ");";
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_array_cdr_op_cs::"
+ "visit_node - "
+ "bad sub state\n"),
+ -1);
+ }
+
+ for (i = 0; i < 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_context.cpp b/TAO/TAO_IDL/be/be_visitor_context.cpp
index 9d6d7e342ba..8102f332f78 100644
--- a/TAO/TAO_IDL/be/be_visitor_context.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_context.cpp
@@ -28,6 +28,7 @@ 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),
@@ -42,6 +43,7 @@ be_visitor_context::be_visitor_context (void)
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_),
@@ -58,6 +60,7 @@ 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_;
@@ -82,6 +85,7 @@ 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;
@@ -142,6 +146,18 @@ be_visitor_context::state (void)
}
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;
diff --git a/TAO/TAO_IDL/be/be_visitor_enum.cpp b/TAO/TAO_IDL/be/be_visitor_enum.cpp
index 53700899b80..3be324fbc36 100644
--- a/TAO/TAO_IDL/be/be_visitor_enum.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_enum.cpp
@@ -25,10 +25,12 @@
#include "be_visitor_enum.h"
// include all the individual files
-#include "be_visitor_enum/any_op_ch.cpp"
-#include "be_visitor_enum/any_op_cs.cpp"
#include "be_visitor_enum/enum_ch.cpp"
#include "be_visitor_enum/enum_cs.cpp"
+#include "be_visitor_enum/any_op_ch.cpp"
+#include "be_visitor_enum/any_op_cs.cpp"
+#include "be_visitor_enum/cdr_op_ch.cpp"
+#include "be_visitor_enum/cdr_op_cs.cpp"
ACE_RCSID(be, be_visitor_enum, "$Id$")
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
new file mode 100644
index 00000000000..0eec4fe9db9
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ch.cpp
@@ -0,0 +1,63 @@
+//
+// $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 = tao_cg->client_header ();
+
+ // 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_cs.cpp b/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_cs.cpp
new file mode 100644
index 00000000000..679bcf96ad8
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_cs.cpp
@@ -0,0 +1,77 @@
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_cs.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_cs, "$Id$")
+
+
+// ***************************************************************************
+// Enum visitor for generating CDR operator declarations in the client
+// stubs file
+// ***************************************************************************
+
+be_visitor_enum_cdr_op_cs::be_visitor_enum_cdr_op_cs
+(be_visitor_context *ctx)
+ : be_visitor_scope (ctx)
+{
+}
+
+be_visitor_enum_cdr_op_cs::~be_visitor_enum_cdr_op_cs (void)
+{
+}
+
+int
+be_visitor_enum_cdr_op_cs::visit_enum (be_enum *node)
+{
+ if (node->cli_stub_cdr_op_gen () || node->imported ())
+ return 0;
+
+ TAO_OutStream *os = tao_cg->client_stubs ();
+
+ // generate CDR << and >> operators
+ os->indent ();
+ *os << "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 << "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_stub_cdr_op_gen (1);
+ return 0;
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_exception.cpp b/TAO/TAO_IDL/be/be_visitor_exception.cpp
index 59b7d194e03..5121050e009 100644
--- a/TAO/TAO_IDL/be/be_visitor_exception.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_exception.cpp
@@ -25,14 +25,16 @@
#include "be_visitor_exception.h"
// include all the individual files
-#include "be_visitor_exception/any_op_ch.cpp"
-#include "be_visitor_exception/any_op_cs.cpp"
-#include "be_visitor_exception/ctor_assign.cpp"
#include "be_visitor_exception/exception.cpp"
#include "be_visitor_exception/exception_ch.cpp"
#include "be_visitor_exception/exception_ci.cpp"
#include "be_visitor_exception/exception_cs.cpp"
#include "be_visitor_exception/exception_ctor.cpp"
+#include "be_visitor_exception/ctor_assign.cpp"
+#include "be_visitor_exception/any_op_ch.cpp"
+#include "be_visitor_exception/any_op_cs.cpp"
+#include "be_visitor_exception/cdr_op_ch.cpp"
+#include "be_visitor_exception/cdr_op_cs.cpp"
ACE_RCSID(be, be_visitor_exception, "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp
new file mode 100644
index 00000000000..41a1b7d3846
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp
@@ -0,0 +1,77 @@
+//
+// $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 = tao_cg->client_header ();
+
+ // 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_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp
new file mode 100644
index 00000000000..5305506892f
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp
@@ -0,0 +1,168 @@
+//
+// $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"
+
+ACE_RCSID(be_visitor_exception, cdr_op_cs, "$Id$")
+
+// ***************************************************************************
+// Exception visitor for generating CDR operator declarations in the client
+// stubs file
+// ***************************************************************************
+
+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)
+{
+ // already generated and/or we are imported. Don't do anything.
+ if (node->cli_stub_cdr_op_gen () || node->imported ())
+ return 0;
+
+ TAO_OutStream *os = tao_cg->client_stubs ();
+
+ // set the sub state as generating code for the output operator
+ this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT);
+ *os << "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)
+ {
+ // 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_cs::"
+ "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 << "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)
+ {
+ // 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_cs::"
+ "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";
+
+ // 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;
+}
+
+int
+be_visitor_exception_cdr_op_cs::post_process (void)
+{
+ TAO_OutStream *os = tao_cg->client_stubs ();
+
+ 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/exception.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception.cpp
index 847357cf22c..ae18e57a303 100644
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_exception/exception.cpp
@@ -67,6 +67,12 @@ be_visitor_exception::visit_field (be_field *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_FIELD_CDR_OP_CS);
+ break;
default:
{
ACE_ERROR_RETURN ((LM_ERROR,
diff --git a/TAO/TAO_IDL/be/be_visitor_field.cpp b/TAO/TAO_IDL/be/be_visitor_field.cpp
index ebfb12b472f..00f70870bed 100644
--- a/TAO/TAO_IDL/be/be_visitor_field.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_field.cpp
@@ -27,6 +27,8 @@
#include "be_visitor_field/field_ch.cpp"
#include "be_visitor_field/field_ci.cpp"
#include "be_visitor_field/field_cs.cpp"
+#include "be_visitor_field/cdr_op_ch.cpp"
+#include "be_visitor_field/cdr_op_cs.cpp"
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
new file mode 100644
index 00000000000..4cf4a731462
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp
@@ -0,0 +1,350 @@
+//
+// $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)
+{
+ 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_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)
+{
+ 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_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)
+{
+ 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_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)
+{
+ 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_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)
+{
+ 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_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)
+{
+ 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_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_cs.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp
new file mode 100644
index 00000000000..aec0f8c3a4a
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp
@@ -0,0 +1,651 @@
+//
+// $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)
+{
+ 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_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)
+{
+ 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_cs::"
+ "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_cs::"
+ "visit_array - "
+ "bad sub state\n"
+ ), -1);
+ }
+
+ // if not a typedef and we are defined in the use scope, we must be defined
+
+ if (!this->ctx_->alias () // not a typedef
+ && node->is_child (this->ctx_->scope ()))
+ {
+ // this is the case for anonymous arrays.
+
+ // 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_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)
+{
+ 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_cs::"
+ "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_cs::"
+ "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_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_enum - "
+ "Bad visitor\n"
+ ), -1);
+ }
+ if (node->accept (visitor) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_field_cdr_op_cs::"
+ "visit_enum - "
+ "codegen failed\n"
+ ), -1);
+ }
+ delete visitor;
+ }
+ return 0;
+}
+
+// visit interface type
+int
+be_visitor_field_cdr_op_cs::visit_interface (be_interface *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_cs::"
+ "visit_interface - "
+ "cannot retrieve field node\n"
+ ), -1);
+ }
+
+ // check what is the code generations substate. Are we generating code for
+ // the in/out operators for our parent or for us?
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())";
+ break;
+ case TAO_CodeGen::TAO_CDR_OUTPUT:
+ *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_cs::"
+ "visit_interface - "
+ "bad sub state\n"
+ ), -1);
+ }
+ return 0;
+}
+
+// visit interface forward type
+int
+be_visitor_field_cdr_op_cs::visit_interface_fwd (be_interface_fwd *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_cs::"
+ "visit_interface_fwd - "
+ "cannot retrieve field node\n"
+ ), -1);
+ }
+
+ // check what is the code generations substate. Are we generating code for
+ // the in/out operators for our parent or for us?
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << "(strm >> _tao_aggregate." << f->local_name () << ").out ()";
+ break;
+ case TAO_CodeGen::TAO_CDR_OUTPUT:
+ *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_cs::"
+ "visit_interface_fwd - "
+ "bad sub state\n"
+ ), -1);
+ }
+ return 0;
+}
+
+// visit predefined type
+int
+be_visitor_field_cdr_op_cs::visit_predefined_type (be_predefined_type *node)
+{
+ TAO_OutStream *os; // 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_cs::"
+ "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
+ *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
+ *os << "(strm << _tao_aggregate." << f->local_name () << ")";
+ break;
+ case TAO_CodeGen::TAO_CDR_SCOPE:
+ // nothing to be done
+ break;
+ default:
+ // error
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_field_cdr_op_cs::"
+ "visit_array - "
+ "bad sub state\n"
+ ), -1);
+ }
+
+ return 0;
+}
+
+int
+be_visitor_field_cdr_op_cs::visit_sequence (be_sequence *node)
+{
+ 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_cs::"
+ "visit_sequence - "
+ "cannot retrieve field node\n"
+ ), -1);
+ }
+
+ // check what is the code generations substate. Are we generating code for
+ // the in/out operators for our parent or for us?
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << "(strm >> _tao_aggregate." << f->local_name () << ")";
+ return 0;
+ case TAO_CodeGen::TAO_CDR_OUTPUT:
+ *os << "(strm << _tao_aggregate." << f->local_name () << ")";
+ return 0;
+ case TAO_CodeGen::TAO_CDR_SCOPE:
+ // proceed further
+ break;
+ default:
+ // error
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_field_cdr_op_cs::"
+ "visit_sequence - "
+ "bad sub state\n"
+ ), -1);
+ }
+
+ 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_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 string type
+int
+be_visitor_field_cdr_op_cs::visit_string (be_string *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_cs::"
+ "visit_string - "
+ "cannot retrieve field node\n"
+ ), -1);
+ }
+
+ // check what is the code generations substate. Are we generating code for
+ // the in/out operators for our parent or for us?
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())";
+ break;
+ case TAO_CodeGen::TAO_CDR_OUTPUT:
+ *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())";
+ break;
+ case TAO_CodeGen::TAO_CDR_SCOPE:
+ // nothing to be done
+ break;
+ default:
+ // error
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_field_cdr_op_cs::"
+ "visit_array - "
+ "bad sub state\n"
+ ), -1);
+ }
+
+ return 0;
+}
+
+// visit structure type
+int
+be_visitor_field_cdr_op_cs::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_cs::"
+ "visit_structure - "
+ "cannot retrieve field node\n"
+ ), -1);
+ }
+
+ // check what is the code generations substate. Are we generating code for
+ // the in/out operators for our parent or for us?
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << "(strm >> _tao_aggregate." << f->local_name () << ")";
+ return 0;
+ case TAO_CodeGen::TAO_CDR_OUTPUT:
+ *os << "(strm << _tao_aggregate." << f->local_name () << ")";
+ return 0;
+ case TAO_CodeGen::TAO_CDR_SCOPE:
+ // proceed further
+ break;
+ default:
+ // error
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_field_cdr_op_cs::"
+ "visit_structure - "
+ "bad sub state\n"
+ ), -1);
+ }
+
+ 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_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)
+{
+ 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_cdr_op_cs::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_cs::"
+ "visit_union - "
+ "cannot retrieve field node\n"
+ ), -1);
+ }
+
+ // check what is the code generations substate. Are we generating code for
+ // the in/out operators for our parent or for us?
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << "(strm >> _tao_aggregate." << f->local_name () << ")";
+ return 0;
+ case TAO_CodeGen::TAO_CDR_OUTPUT:
+ *os << "(strm << _tao_aggregate." << f->local_name () << ")";
+ return 0;
+ case TAO_CodeGen::TAO_CDR_SCOPE:
+ // proceed further
+ break;
+ default:
+ // error
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_field_cdr_op_cs::"
+ "visit_union - "
+ "bad sub state\n"
+ ), -1);
+ }
+
+ 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_interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface.cpp
index f7ffd05d0d6..10d6df9fde0 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface.cpp
@@ -23,10 +23,6 @@
#include "be_visitor_interface.h"
// include all the individual files
-#include "be_visitor_interface/any_op_ch.cpp"
-#include "be_visitor_interface/any_op_cs.cpp"
-#include "be_visitor_interface/collocated_sh.cpp"
-#include "be_visitor_interface/collocated_ss.cpp"
#include "be_visitor_interface/interface.cpp"
#include "be_visitor_interface/interface_ch.cpp"
#include "be_visitor_interface/interface_ci.cpp"
@@ -34,8 +30,14 @@
#include "be_visitor_interface/interface_sh.cpp"
#include "be_visitor_interface/interface_si.cpp"
#include "be_visitor_interface/interface_ss.cpp"
+#include "be_visitor_interface/collocated_sh.cpp"
+#include "be_visitor_interface/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_cs.cpp"
ACE_RCSID(be, be_visitor_interface, "$Id$")
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
new file mode 100644
index 00000000000..73ed62d13b7
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp
@@ -0,0 +1,77 @@
+//
+// $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 = tao_cg->client_header ();
+
+ // generate the CDR << and >> operator declarations
+ os->indent ();
+ *os << "CORBA::Boolean " << idl_global->export_macro ()
+ << " operator<< (TAO_OutputCDR &, const " << node->name ()
+ << "_ptr ); // " << be_nl;
+ *os << "CORBA::Boolean " << idl_global->export_macro ()
+ << " 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_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp
new file mode 100644
index 00000000000..2447cd44d2a
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp
@@ -0,0 +1,104 @@
+//
+// $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$")
+
+// ***************************************************************************
+// Interface visitor for generating CDR operator declarations in the client
+// stubs file
+// ***************************************************************************
+
+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)
+{
+ // already generated and/or we are imported. Don't do anything.
+ if (node->cli_stub_cdr_op_gen () || node->imported ())
+ return 0;
+
+ TAO_OutStream *os = tao_cg->client_stubs ();
+
+ // set the sub state as generating code for the output operator
+ this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT);
+ *os << "CORBA::Boolean operator<< (TAO_OutputCDR &strm, "
+ << "const " << node->name () << "_ptr _tao_objref)" << be_nl
+ << "{" << be_idt_nl;
+ // hand over the encoding to the TAO's internal engine
+ *os << "CORBA::Environment env;" << be_nl;
+ *os << "if (TAO_MARSHAL_OBJREF::instance ()->" << be_nl
+ << " encode (0, &_tao_objref, 0, &strm, env) == " << be_nl
+ << " CORBA::TypeCode::TRAVERSE_CONTINUE)" << 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 << "CORBA::Boolean operator>> (TAO_InputCDR &strm, "
+ << node->name () << "_ptr &_tao_objref)" << be_nl
+ << "{" << be_idt_nl;
+ // hand over to the TAO's internal marshaling engine
+ *os << "CORBA::Environment env;" << be_nl;
+ *os << "CORBA::Object_ptr obj;" << be_nl;
+ *os << "if (TAO_MARSHAL_OBJREF::instance ()->" << be_nl
+ << " decode (0, &obj, 0, &strm, env) == " << be_nl
+ << " CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl
+ << "{" << be_idt_nl;
+ *os << "// narrow to the right type" << be_nl;
+ *os << "_tao_objref = " << node->name ()
+ << "::_narrow (obj, env);" << be_nl;
+ *os << "CORBA::release (obj);" << be_nl;
+ *os << "if (!CORBA::is_nil (_tao_objref))" << be_idt_nl
+ << "return 1;" << be_uidt_nl;
+ *os << "}" << be_uidt_nl;
+ *os << "return 0; // error" << be_uidt_nl;
+ *os << "}\n\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_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/interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp
index 12595042baa..925549276ca 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp
@@ -90,6 +90,8 @@ be_visitor_interface::visit_attribute (be_attribute *node)
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_CS:
case TAO_CodeGen::TAO_INTERFACE_CI:
case TAO_CodeGen::TAO_INTERFACE_SI:
return 0; // nothing to be done
@@ -150,6 +152,8 @@ be_visitor_interface::visit_constant (be_constant *node)
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_CS:
case TAO_CodeGen::TAO_INTERFACE_COLLOCATED_SH:
case TAO_CodeGen::TAO_INTERFACE_COLLOCATED_SS:
case TAO_CodeGen::TAO_INTERFACE_CI:
@@ -220,6 +224,12 @@ be_visitor_interface::visit_enum (be_enum *node)
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_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_SI:
@@ -293,6 +303,12 @@ be_visitor_interface::visit_exception (be_exception *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CS);
+ break;
case TAO_CodeGen::TAO_INTERFACE_SH:
case TAO_CodeGen::TAO_INTERFACE_SI:
case TAO_CodeGen::TAO_INTERFACE_SS:
@@ -380,6 +396,8 @@ be_visitor_interface::visit_operation (be_operation *node)
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_CS:
case TAO_CodeGen::TAO_INTERFACE_CI:
case TAO_CodeGen::TAO_INTERFACE_SI:
return 0; // nothing to be done
@@ -448,6 +466,12 @@ be_visitor_interface::visit_structure (be_structure *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CS);
+ break;
case TAO_CodeGen::TAO_INTERFACE_SH:
case TAO_CodeGen::TAO_INTERFACE_SI:
case TAO_CodeGen::TAO_INTERFACE_SS:
@@ -520,6 +544,12 @@ be_visitor_interface::visit_union (be_union *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CS);
+ break;
case TAO_CodeGen::TAO_INTERFACE_SH:
case TAO_CodeGen::TAO_INTERFACE_SI:
case TAO_CodeGen::TAO_INTERFACE_SS:
@@ -592,6 +622,12 @@ be_visitor_interface::visit_typedef (be_typedef *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS);
+ break;
case TAO_CodeGen::TAO_INTERFACE_SH:
case TAO_CodeGen::TAO_INTERFACE_SI:
case TAO_CodeGen::TAO_INTERFACE_SS:
diff --git a/TAO/TAO_IDL/be/be_visitor_module.cpp b/TAO/TAO_IDL/be/be_visitor_module.cpp
index bae68aa09bc..950ec36ccd4 100644
--- a/TAO/TAO_IDL/be/be_visitor_module.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_module.cpp
@@ -25,10 +25,11 @@
#include "be_visitor_module.h"
// include all the individual files
-#include "be_visitor_module/any_op.cpp"
#include "be_visitor_module/module.cpp"
#include "be_visitor_module/module_ch.cpp"
#include "be_visitor_module/module_sh.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/cdr_op.cpp b/TAO/TAO_IDL/be/be_visitor_module/cdr_op.cpp
new file mode 100644
index 00000000000..4059e2f0f05
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_module/cdr_op.cpp
@@ -0,0 +1,56 @@
+//
+// $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
index 19f207eac6e..763507149ff 100644
--- a/TAO/TAO_IDL/be/be_visitor_module/module.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_module/module.cpp
@@ -79,6 +79,8 @@ be_visitor_module::visit_constant (be_constant *node)
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_CS:
case TAO_CodeGen::TAO_MODULE_CI:
case TAO_CodeGen::TAO_MODULE_SH:
case TAO_CodeGen::TAO_MODULE_SI:
@@ -145,6 +147,12 @@ be_visitor_module::visit_enum (be_enum *node)
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_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_SI:
@@ -214,6 +222,12 @@ be_visitor_module::visit_exception (be_exception *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CS);
+ break;
case TAO_CodeGen::TAO_MODULE_SH:
case TAO_CodeGen::TAO_MODULE_SI:
case TAO_CodeGen::TAO_MODULE_SS:
@@ -291,6 +305,12 @@ be_visitor_module::visit_interface (be_interface *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS);
+ break;
default:
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -348,6 +368,8 @@ be_visitor_module::visit_interface_fwd (be_interface_fwd *node)
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_CS:
case TAO_CodeGen::TAO_MODULE_CS:
case TAO_CodeGen::TAO_MODULE_SH:
case TAO_CodeGen::TAO_MODULE_SI:
@@ -417,6 +439,12 @@ be_visitor_module::visit_structure (be_structure *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CS);
+ break;
case TAO_CodeGen::TAO_MODULE_SH:
case TAO_CodeGen::TAO_MODULE_SI:
case TAO_CodeGen::TAO_MODULE_SS:
@@ -485,6 +513,12 @@ be_visitor_module::visit_union (be_union *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CS);
+ break;
case TAO_CodeGen::TAO_MODULE_SH:
case TAO_CodeGen::TAO_MODULE_SI:
case TAO_CodeGen::TAO_MODULE_SS:
@@ -553,6 +587,12 @@ be_visitor_module::visit_typedef (be_typedef *node)
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_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:
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp
index 25d7d7b9369..93a873c110e 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp
@@ -69,14 +69,14 @@ be_visitor_operation_arglist::visit_operation (be_operation *node)
case TAO_CodeGen::TAO_OPERATION_ARGLIST_CH:
case TAO_CodeGen::TAO_OPERATION_ARGLIST_COLLOCATED_SH:
case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH:
- *os << " = " << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ *os << " = CORBA::Environment::default_environment ()"
<< be_uidt;
break;
default:
break;
}
*os << be_uidt_nl << " )";
+
switch (this->ctx_->state ())
{
case TAO_CodeGen::TAO_OPERATION_ARGLIST_CH:
diff --git a/TAO/TAO_IDL/be/be_visitor_root.cpp b/TAO/TAO_IDL/be/be_visitor_root.cpp
index 9532299b48b..ce312a283c1 100644
--- a/TAO/TAO_IDL/be/be_visitor_root.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_root.cpp
@@ -22,7 +22,6 @@
#include "be_visitor_root.h"
// include all the individual files
-#include "be_visitor_root/any_op.cpp"
#include "be_visitor_root/root.cpp"
#include "be_visitor_root/root_ch.cpp"
#include "be_visitor_root/root_ci.cpp"
@@ -30,6 +29,8 @@
#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/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/cdr_op.cpp b/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp
new file mode 100644
index 00000000000..efc4d512abc
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp
@@ -0,0 +1,56 @@
+//
+// $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)
+{
+ // 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);
+ }
+ return 0;
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_root/root.cpp b/TAO/TAO_IDL/be/be_visitor_root/root.cpp
index 37b0b9d8bc3..a9da53345e7 100644
--- a/TAO/TAO_IDL/be/be_visitor_root/root.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_root/root.cpp
@@ -64,7 +64,7 @@ int be_visitor_root::visit_root (be_root *node)
"codegen for scope failed\n"), -1);
}
- // The last thing we need to do is make one more pass thru the entire tree
+ // 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.
//
@@ -124,6 +124,58 @@ int be_visitor_root::visit_root (be_root *node)
}
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_CS:
+ ctx.state (TAO_CodeGen::TAO_ROOT_CDR_OP_CS);
+ break;
+ case TAO_CodeGen::TAO_ROOT_SH:
+ case TAO_CodeGen::TAO_ROOT_CI:
+ case TAO_CodeGen::TAO_ROOT_SI:
+ case TAO_CodeGen::TAO_ROOT_SS:
+ return 0; // nothing to be done
+ default:
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_root::"
+ "visit_constant - "
+ "Bad context state\n"
+ ), -1);
+ }
+ break;
+ }
+
+ 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 ())
{
@@ -161,6 +213,8 @@ be_visitor_root::visit_constant (be_constant *node)
break;
case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
+ case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
+ case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
case TAO_CodeGen::TAO_ROOT_CI:
case TAO_CodeGen::TAO_ROOT_SH:
case TAO_CodeGen::TAO_ROOT_SI:
@@ -227,6 +281,12 @@ be_visitor_root::visit_enum (be_enum *node)
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_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:
@@ -296,6 +356,12 @@ be_visitor_root::visit_exception (be_exception *node)
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_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:
@@ -373,6 +439,12 @@ be_visitor_root::visit_interface (be_interface *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS);
+ break;
default:
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -430,6 +502,8 @@ be_visitor_root::visit_interface_fwd (be_interface_fwd *node)
break;
case TAO_CodeGen::TAO_ROOT_ANY_OP_CH:
case TAO_CodeGen::TAO_ROOT_ANY_OP_CS:
+ case TAO_CodeGen::TAO_ROOT_CDR_OP_CH:
+ case TAO_CodeGen::TAO_ROOT_CDR_OP_CS:
case TAO_CodeGen::TAO_ROOT_CS:
case TAO_CodeGen::TAO_ROOT_SH:
case TAO_CodeGen::TAO_ROOT_SI:
@@ -508,6 +582,12 @@ be_visitor_root::visit_module (be_module *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_MODULE_CDR_OP_CS);
+ break;
default:
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -572,6 +652,12 @@ be_visitor_root::visit_structure (be_structure *node)
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_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:
@@ -640,6 +726,12 @@ be_visitor_root::visit_union (be_union *node)
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_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:
@@ -708,6 +800,12 @@ be_visitor_root::visit_typedef (be_typedef *node)
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_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:
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence.cpp b/TAO/TAO_IDL/be/be_visitor_sequence.cpp
index 95884aee138..4ca0e85f1ce 100644
--- a/TAO/TAO_IDL/be/be_visitor_sequence.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_sequence.cpp
@@ -24,6 +24,8 @@
// 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_cs.cpp"
#include "be_visitor_sequence/buffer_type.cpp"
#include "be_visitor_sequence/elemtype.cpp"
#include "be_visitor_sequence/sequence_base.cpp"
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
new file mode 100644
index 00000000000..11e3e211a36
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp
@@ -0,0 +1,65 @@
+//
+// $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 = tao_cg->client_header ();
+
+ // 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";
+
+
+ node->cli_hdr_cdr_op_gen (1);
+ return 0;
+}
+
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp
new file mode 100644
index 00000000000..3195263505d
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp
@@ -0,0 +1,522 @@
+//
+// $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
+ {
+ TAO_OutStream *os = tao_cg->client_stubs ();
+ be_type *bt; // base type of the sequence
+
+ if (node->cli_stub_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_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<< (TAO_OutputCDR &strm, "
+ << "const " << node->name () << " &_tao_sequence)" << be_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>> (TAO_InputCDR &strm, "
+ << node->name () << " &_tao_sequence)" << be_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
+
+ // index
+ unsigned long i;
+
+ // grab the sequence node
+ be_sequence *sequence = this->ctx_->be_node_as_sequence ();
+
+ if (!node)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_sequence_cdr_op_cs::"
+ "visit_predefined_type - "
+ "bad sequence 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_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;
+ }
+ break;
+ default:
+ *os << " (_tao_sequence.get_buffer (), ";
+ break;
+ }
+ AST_Expression *expr = sequence->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_predefined_type - "
+ "bad sequence dimension\n"),
+ -1);
+ }
+ 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_sequence_cdr_op_cs::"
+ "visit_predefined_type - "
+ "bad sequence dimension value\n"),
+ -1);
+ }
+ *os << ");" << be_uidt_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 ();
+ unsigned long i;
+ 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 < "
+ << expr->ev ()->u.ulval << " && _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 >> _tao_sequence[i]";
+ switch (bt->node_type ())
+ {
+ 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_sequence_cdr_op_cs::"
+ "visit_node - "
+ "bad predefined type node\n"),
+ -1);
+ }
+ if (pt->pt () == AST_PredefinedType::PT_pseudo)
+ {
+ *os << ".out ()";
+ }
+ }
+ }
+ *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 ()";
+ }
+ }
+ }
+ *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/gen_object_manager_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_object_manager_ch.cpp
index 7c27d842029..0efb9aece41 100644
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_object_manager_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_object_manager_ch.cpp
@@ -157,8 +157,50 @@ be_visitor_sequence_ch::gen_object_manager (be_sequence *node)
<< "{" << be_idt_nl
<< "return *this->ptr_;" << be_uidt_nl
<< "}" << be_nl
- << be_uidt_nl;
+ << be_nl;
+ // in method
+ *os << "const "; pt->accept (visitor); *os << " *in (void) const // in "
+ << be_nl
+ << "{" << be_idt_nl
+ << "return *this->ptr_;" << be_uidt_nl
+ << "}" << be_nl
+ << be_nl;
+
+ // inout method
+ pt->accept (visitor);
+ *os << " *&inout (void) // inout "
+ << be_nl
+ << "{" << be_idt_nl
+ << "return *this->ptr_;" << be_uidt_nl
+ << "}" << be_nl
+ << be_nl;
+
+ // out method
+ pt->accept (visitor);
+ *os << " *&out (void) // out "
+ << be_nl
+ << "{" << be_idt_nl
+ << "CORBA::release (*this->ptr_);" << be_nl
+ << "*this->ptr_ = "; pt->accept (visitor); *os << "::_nil ();"
+ << be_nl
+ << "return *this->ptr_;" << be_uidt_nl
+ << "}" << be_nl
+ << be_nl;
+
+ // retn method
+ pt->accept (visitor);
+ *os << " *_retn (void) // retn "
+ << be_nl
+ << "{" << be_idt_nl;
+ pt->accept (visitor);
+ *os << " *temp = *this->ptr_;" << be_nl
+ << "*this->ptr_ = "; pt->accept (visitor); *os << "::_nil ();"
+ << be_nl
+ << "return temp;" << be_uidt_nl
+ << "}" << be_nl
+ << be_uidt_nl;
+
// members
*os << "private:" << be_idt_nl;
pt->accept(visitor); *os <<" **ptr_;" << be_nl
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp
index 6d867a39bb9..63d24ff71ab 100644
--- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp
@@ -573,9 +573,9 @@ be_visitor_sequence_ch::gen_out_defn (be_sequence *node)
// constructor from a _var &
*os << namebuf << " (" << node->local_name () << "_var &);" << be_nl;
// constructor from a _out &
- *os << namebuf << " (" << namebuf << " &);" << be_nl;
+ *os << namebuf << " (const " << namebuf << " &);" << be_nl;
// assignment operator from a _out &
- *os << namebuf << " &operator= (" << namebuf << " &);" << be_nl;
+ *os << namebuf << " &operator= (const " << namebuf << " &);" << be_nl;
// assignment operator from a pointer &, cast operator, ptr fn, operator
// -> and any other extra operators
// assignment
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp
index 0e170613b10..d5a5fb2a9d1 100644
--- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp
@@ -373,19 +373,21 @@ be_visitor_sequence_ci::gen_out_impl (be_sequence *node)
// copy constructor
os->indent ();
*os << "ACE_INLINE" << be_nl;
- *os << fname << "::" << lname << " (" << fname <<
+ *os << fname << "::" << lname << " (const " << fname <<
" &p) // copy constructor" << be_nl;
- *os << " : ptr_ (p.ptr_)" << 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= (" << fname <<
+ *os << fname << "::operator= (const " << fname <<
" &p)" << be_nl;
*os << "{\n";
os->incr_indent ();
- *os << "this->ptr_ = p.ptr_;" << be_nl;
+ *os << "this->ptr_ = ACE_const_cast (" << fname
+ << "&,p).ptr_;" << be_nl;
*os << "return *this;\n";
os->decr_indent ();
*os << "}\n\n";
diff --git a/TAO/TAO_IDL/be/be_visitor_structure.cpp b/TAO/TAO_IDL/be/be_visitor_structure.cpp
index a76b89a6938..5c803e00fc0 100644
--- a/TAO/TAO_IDL/be/be_visitor_structure.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_structure.cpp
@@ -25,12 +25,14 @@
#include "be_visitor_structure.h"
// include all the individual files
-#include "be_visitor_structure/any_op_ch.cpp"
-#include "be_visitor_structure/any_op_cs.cpp"
#include "be_visitor_structure/structure.cpp"
#include "be_visitor_structure/structure_ch.cpp"
#include "be_visitor_structure/structure_ci.cpp"
#include "be_visitor_structure/structure_cs.cpp"
+#include "be_visitor_structure/any_op_ch.cpp"
+#include "be_visitor_structure/any_op_cs.cpp"
+#include "be_visitor_structure/cdr_op_ch.cpp"
+#include "be_visitor_structure/cdr_op_cs.cpp"
ACE_RCSID(be, be_visitor_structure, "$Id$")
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
new file mode 100644
index 00000000000..b81eff78ef1
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ch.cpp
@@ -0,0 +1,77 @@
+//
+// $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 = tao_cg->client_header ();
+
+ // 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_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp
new file mode 100644
index 00000000000..4cf9e122583
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp
@@ -0,0 +1,128 @@
+//
+// $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"
+
+ACE_RCSID(be_visitor_structure, cdr_op_cs, "$Id$")
+
+// ***************************************************************************
+// Structure visitor for generating CDR operator declarations in the client
+// stubs file
+// ***************************************************************************
+
+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)
+{
+ // already generated and/or we are imported. Don't do anything.
+ if (node->cli_stub_cdr_op_gen () || node->imported ())
+ return 0;
+
+ TAO_OutStream *os = tao_cg->client_stubs ();
+
+ // set the sub state as generating code for the output operator
+ this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT);
+ *os << "CORBA::Boolean operator<< (TAO_OutputCDR &strm, "
+ << "const " << node->name () << " &_tao_aggregate)" << be_nl
+ << "{" << be_idt_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_structure_cdr_op_cs::"
+ "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 << "CORBA::Boolean operator>> (TAO_InputCDR &strm, "
+ << node->name () << " &_tao_aggregate)" << be_nl
+ << "{" << be_idt_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_structure_cdr_op_cs"
+ "::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 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;
+}
+
+int
+be_visitor_structure_cdr_op_cs::post_process (void)
+{
+ TAO_OutStream *os = tao_cg->client_stubs ();
+
+ 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/structure.cpp b/TAO/TAO_IDL/be/be_visitor_structure/structure.cpp
index c68780ce0d8..04d05ab0810 100644
--- a/TAO/TAO_IDL/be/be_visitor_structure/structure.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_structure/structure.cpp
@@ -67,6 +67,12 @@ be_visitor_structure::visit_field (be_field *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_FIELD_CDR_OP_CS);
+ break;
default:
{
ACE_ERROR_RETURN ((LM_ERROR,
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef.cpp b/TAO/TAO_IDL/be/be_visitor_typedef.cpp
index 629fa92853d..b1c95a284c8 100644
--- a/TAO/TAO_IDL/be/be_visitor_typedef.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_typedef.cpp
@@ -25,12 +25,14 @@
#include "be_visitor_typedef.h"
// include all the individual files
-#include "be_visitor_typedef/any_op_ch.cpp"
-#include "be_visitor_typedef/any_op_cs.cpp"
#include "be_visitor_typedef/typedef.cpp"
#include "be_visitor_typedef/typedef_ch.cpp"
#include "be_visitor_typedef/typedef_ci.cpp"
#include "be_visitor_typedef/typedef_cs.cpp"
+#include "be_visitor_typedef/any_op_ch.cpp"
+#include "be_visitor_typedef/any_op_cs.cpp"
+#include "be_visitor_typedef/cdr_op_ch.cpp"
+#include "be_visitor_typedef/cdr_op_cs.cpp"
ACE_RCSID(be, be_visitor_typedef, "$Id$")
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
new file mode 100644
index 00000000000..d269c48d875
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp
@@ -0,0 +1,292 @@
+//
+// $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 = tao_cg->client_header ();
+
+ // 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)
+{
+ 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->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)
+{
+ 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_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)
+{
+ 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_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)
+{
+ 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_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)
+{
+ 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_op_ch::"
+ "visit_union - "
+ "base class visitor failed \n"
+ ), -1);
+ }
+ }
+
+ return 0;
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp
new file mode 100644
index 00000000000..26cbbb1f957
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp
@@ -0,0 +1,294 @@
+//
+// $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 = tao_cg->client_stubs ();
+
+ // 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)
+{
+ 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->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)
+{
+ 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_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)
+{
+ 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_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)
+{
+ 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_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)
+{
+ 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_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
index 3c37704a173..38cd754c02a 100644
--- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp
@@ -79,6 +79,12 @@ be_visitor_typedef::visit_array (be_array *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_ARRAY_CDR_OP_CS);
+ break;
case TAO_CodeGen::TAO_TYPEDEF_SH:
case TAO_CodeGen::TAO_TYPEDEF_SI:
case TAO_CodeGen::TAO_TYPEDEF_SS:
@@ -144,6 +150,12 @@ be_visitor_typedef::visit_enum (be_enum *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CS);
+ break;
case TAO_CodeGen::TAO_TYPEDEF_CI:
case TAO_CodeGen::TAO_TYPEDEF_SH:
case TAO_CodeGen::TAO_TYPEDEF_SI:
@@ -220,6 +232,12 @@ be_visitor_typedef::visit_sequence (be_sequence *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CS);
+ break;
case TAO_CodeGen::TAO_TYPEDEF_SH:
case TAO_CodeGen::TAO_TYPEDEF_SI:
case TAO_CodeGen::TAO_TYPEDEF_SS:
@@ -284,6 +302,8 @@ be_visitor_typedef::visit_string (be_string *node)
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_CS:
case TAO_CodeGen::TAO_TYPEDEF_SH:
case TAO_CodeGen::TAO_TYPEDEF_SI:
case TAO_CodeGen::TAO_TYPEDEF_SS:
@@ -352,6 +372,12 @@ be_visitor_typedef::visit_structure (be_structure *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CS);
+ break;
case TAO_CodeGen::TAO_TYPEDEF_SH:
case TAO_CodeGen::TAO_TYPEDEF_SI:
case TAO_CodeGen::TAO_TYPEDEF_SS:
@@ -420,6 +446,12 @@ be_visitor_typedef::visit_union (be_union *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CS);
+ break;
case TAO_CodeGen::TAO_TYPEDEF_SH:
case TAO_CodeGen::TAO_TYPEDEF_SI:
case TAO_CodeGen::TAO_TYPEDEF_SS:
diff --git a/TAO/TAO_IDL/be/be_visitor_union.cpp b/TAO/TAO_IDL/be/be_visitor_union.cpp
index a778facdb7e..0aa88dff8b8 100644
--- a/TAO/TAO_IDL/be/be_visitor_union.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_union.cpp
@@ -25,8 +25,6 @@
#include "be_visitor_union.h"
// include all the individual files
-#include "be_visitor_union/any_op_ch.cpp"
-#include "be_visitor_union/any_op_cs.cpp"
#include "be_visitor_union/discriminant_ch.cpp"
#include "be_visitor_union/discriminant_ci.cpp"
#include "be_visitor_union/discriminant_cs.cpp"
@@ -34,6 +32,10 @@
#include "be_visitor_union/union_ch.cpp"
#include "be_visitor_union/union_ci.cpp"
#include "be_visitor_union/union_cs.cpp"
+#include "be_visitor_union/any_op_ch.cpp"
+#include "be_visitor_union/any_op_cs.cpp"
+#include "be_visitor_union/cdr_op_ch.cpp"
+#include "be_visitor_union/cdr_op_cs.cpp"
ACE_RCSID(be, be_visitor_union, "$Id$")
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
new file mode 100644
index 00000000000..e1768bb6b58
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp
@@ -0,0 +1,77 @@
+//
+// $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 = tao_cg->client_header ();
+
+ // 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_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp
new file mode 100644
index 00000000000..297a063ff22
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp
@@ -0,0 +1,137 @@
+//
+// $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;
+
+ TAO_OutStream *os = tao_cg->client_stubs ();
+
+ // set the sub state as generating code for the output operator
+ this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT);
+ *os << "CORBA::Boolean operator<< (TAO_OutputCDR &strm, "
+ << "const " << node->name () << " &_tao_union)" << be_nl
+ << "{" << be_idt_nl
+ << "return 1;" << be_uidt_nl
+ << "}\n\n";
+#if 0 /* TO-DO */
+ << "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_union_cdr_op_cs::"
+ "visit_union - "
+ "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";
+#endif
+
+ // set the substate as generating code for the input operator
+ this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT);
+ *os << "CORBA::Boolean operator>> (TAO_InputCDR &strm, "
+ << node->name () << " &_tao_union)" << be_nl
+ << "{" << be_idt_nl
+ << "return 1;" << be_uidt_nl
+ << "}\n\n";
+
+#if 0 /* TO-DO */
+ << "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_union_cdr_op_cs"
+ "::visit_union - "
+ "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";
+#endif
+
+ // 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;
+}
+
+int
+be_visitor_union_cdr_op_cs::post_process (void)
+{
+ TAO_OutStream *os = tao_cg->client_stubs ();
+
+ 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_union/union.cpp b/TAO/TAO_IDL/be/be_visitor_union/union.cpp
index 27936c26918..205f5a16ad5 100644
--- a/TAO/TAO_IDL/be/be_visitor_union/union.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_union/union.cpp
@@ -79,6 +79,12 @@ be_visitor_union::visit_union_branch (be_union_branch *node)
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_CS:
+ ctx.state (TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CS);
+ break;
default:
{
ACE_ERROR_RETURN ((LM_ERROR,
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch.cpp
index 28bf8500195..5cb1335b6ce 100644
--- a/TAO/TAO_IDL/be/be_visitor_union_branch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_union_branch.cpp
@@ -31,6 +31,8 @@
#include "be_visitor_union_branch/public_ch.cpp"
#include "be_visitor_union_branch/public_ci.cpp"
#include "be_visitor_union_branch/public_cs.cpp"
+#include "be_visitor_union_branch/cdr_op_ch.cpp"
+#include "be_visitor_union_branch/cdr_op_cs.cpp"
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
new file mode 100644
index 00000000000..3135cb60192
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp
@@ -0,0 +1,351 @@
+
+//
+// $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)
+{
+ TAO_OutStream *os; // output stream
+ 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_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)
+{
+ 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_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)
+{
+ 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_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)
+{
+ 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_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)
+{
+ 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_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)
+{
+ 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_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_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp
new file mode 100644
index 00000000000..a8247027c1c
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp
@@ -0,0 +1,651 @@
+//
+// $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)
+{
+ TAO_OutStream *os; // output stream
+
+ 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_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)
+{
+ 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_cs::"
+ "visit_array - "
+ "cannot retrieve union_branch node\n"
+ ), -1);
+ }
+
+ // check what is the code generations substate. Are we generating code for
+ // the in/out operators for our parent or for us?
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << "(strm >> _tao_union." << f->local_name () << ")";
+ 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_cs::"
+ "visit_array - "
+ "bad sub state\n"
+ ), -1);
+ }
+
+ // if not a typedef and we are defined in the use scope, we must be defined
+
+ if (!this->ctx_->alias () // not a typedef
+ && node->is_child (this->ctx_->scope ()))
+ {
+ // this is the case for anonymous arrays.
+
+ // 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)
+{
+ 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_cs::"
+ "visit_array - "
+ "cannot retrieve union_branch node\n"
+ ), -1);
+ }
+
+ // check what is the code generations substate. Are we generating code for
+ // the in/out operators for our parent or for us?
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << "(strm >> _tao_union." << f->local_name () << ")";
+ 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_cs::"
+ "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_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;
+}
+
+// visit interface type
+int
+be_visitor_union_branch_cdr_op_cs::visit_interface (be_interface *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_cs::"
+ "visit_interface - "
+ "cannot retrieve union_branch node\n"
+ ), -1);
+ }
+
+ // check what is the code generations substate. Are we generating code for
+ // the in/out operators for our parent or for us?
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << "(strm >> _tao_union." << f->local_name () << ".out ())";
+ break;
+ case TAO_CodeGen::TAO_CDR_OUTPUT:
+ *os << "(strm << _tao_union." << 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_union_branch_cdr_op_cs::"
+ "visit_interface - "
+ "bad sub state\n"
+ ), -1);
+ }
+ return 0;
+}
+
+// visit interface forward type
+int
+be_visitor_union_branch_cdr_op_cs::visit_interface_fwd (be_interface_fwd *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_cs::"
+ "visit_interface_fwd - "
+ "cannot retrieve union_branch node\n"
+ ), -1);
+ }
+
+ // check what is the code generations substate. Are we generating code for
+ // the in/out operators for our parent or for us?
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << "(strm >> _tao_union." << f->local_name () << ").out ()";
+ break;
+ case TAO_CodeGen::TAO_CDR_OUTPUT:
+ *os << "(strm << _tao_union." << 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_union_branch_cdr_op_cs::"
+ "visit_interface_fwd - "
+ "bad sub state\n"
+ ), -1);
+ }
+ return 0;
+}
+
+// visit predefined type
+int
+be_visitor_union_branch_cdr_op_cs::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_cs::"
+ "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:
+ // is a psuedo obj
+ if (node->pt () == AST_PredefinedType::PT_pseudo)
+ *os << "(strm >> _tao_union." << f->local_name () << ".out ())";
+ else
+ *os << "(strm >> _tao_union." << f->local_name () << ")";
+ break;
+ case TAO_CodeGen::TAO_CDR_OUTPUT:
+ // is a psuedo obj
+ if (node->pt () == AST_PredefinedType::PT_pseudo)
+ *os << "(strm << _tao_union." << f->local_name () << ".in ())";
+ else
+ *os << "(strm << _tao_union." << f->local_name () << ")";
+ break;
+ case TAO_CodeGen::TAO_CDR_SCOPE:
+ // nothing to be done
+ break;
+ default:
+ // error
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_union_branch_cdr_op_cs::"
+ "visit_array - "
+ "bad sub state\n"
+ ), -1);
+ }
+
+ return 0;
+}
+
+int
+be_visitor_union_branch_cdr_op_cs::visit_sequence (be_sequence *node)
+{
+ 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_cs::"
+ "visit_sequence - "
+ "cannot retrieve union_branch node\n"
+ ), -1);
+ }
+
+ // check what is the code generations substate. Are we generating code for
+ // the in/out operators for our parent or for us?
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << "(strm >> _tao_union." << f->local_name () << ")";
+ 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_cs::"
+ "visit_sequence - "
+ "bad sub state\n"
+ ), -1);
+ }
+
+ if (node->node_type () != AST_Decl::NT_typedef
+ && node->is_child (this->ctx_->scope ()))
+ // not a typedef AND
+ // node is defined inside the 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 string type
+int
+be_visitor_union_branch_cdr_op_cs::visit_string (be_string *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_cs::"
+ "visit_string - "
+ "cannot retrieve union_branch node\n"
+ ), -1);
+ }
+
+ // check what is the code generations substate. Are we generating code for
+ // the in/out operators for our parent or for us?
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << "(strm >> _tao_union." << f->local_name () << ".out ())";
+ break;
+ case TAO_CodeGen::TAO_CDR_OUTPUT:
+ *os << "(strm << _tao_union." << 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_union_branch_cdr_op_cs::"
+ "visit_array - "
+ "bad sub state\n"
+ ), -1);
+ }
+
+ return 0;
+}
+
+// visit structure type
+int
+be_visitor_union_branch_cdr_op_cs::visit_structure (be_structure *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_cs::"
+ "visit_structure - "
+ "cannot retrieve union_branch node\n"
+ ), -1);
+ }
+
+ // check what is the code generations substate. Are we generating code for
+ // the in/out operators for our parent or for us?
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << "(strm >> _tao_union." << f->local_name () << ")";
+ 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_cs::"
+ "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_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)
+{
+ 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_cs::"
+ "visit_union - "
+ "cannot retrieve union_branch node\n"
+ ), -1);
+ }
+
+ // check what is the code generations substate. Are we generating code for
+ // the in/out operators for our parent or for us?
+ switch (this->ctx_->sub_state ())
+ {
+ case TAO_CodeGen::TAO_CDR_INPUT:
+ *os << "(strm >> _tao_union." << f->local_name () << ")";
+ 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_cs::"
+ "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_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_include/be_codegen.h b/TAO/TAO_IDL/be_include/be_codegen.h
index 7dcf29a19b4..89c6aa41683 100644
--- a/TAO/TAO_IDL/be_include/be_codegen.h
+++ b/TAO/TAO_IDL/be_include/be_codegen.h
@@ -123,6 +123,8 @@ public:
TAO_ARRAY_DEFN_SS,
TAO_ARRAY_ANY_OP_CH,
TAO_ARRAY_ANY_OP_CS,
+ TAO_ARRAY_CDR_OP_CH,
+ TAO_ARRAY_CDR_OP_CS,
// emitting code for rest of the array decl
TAO_ARRAY_OTHER_CH,
@@ -146,6 +148,8 @@ public:
TAO_ENUM_SS,
TAO_ENUM_ANY_OP_CH,
TAO_ENUM_ANY_OP_CS,
+ TAO_ENUM_CDR_OP_CH,
+ TAO_ENUM_CDR_OP_CS,
// emitting code for exceptions
TAO_EXCEPTION_CH,
@@ -159,11 +163,15 @@ public:
TAO_EXCEPTION_SS,
TAO_EXCEPTION_ANY_OP_CH,
TAO_EXCEPTION_ANY_OP_CS,
+ TAO_EXCEPTION_CDR_OP_CH,
+ TAO_EXCEPTION_CDR_OP_CS,
// emitting fields i.e., struct members
TAO_FIELD_CH,
TAO_FIELD_CI,
TAO_FIELD_CS,
+ TAO_FIELD_CDR_OP_CH,
+ TAO_FIELD_CDR_OP_CS,
// emitting code for the interface
TAO_INTERFACE_CH,
@@ -176,6 +184,8 @@ public:
TAO_INTERFACE_COLLOCATED_SS,
TAO_INTERFACE_ANY_OP_CH,
TAO_INTERFACE_ANY_OP_CS,
+ TAO_INTERFACE_CDR_OP_CH,
+ TAO_INTERFACE_CDR_OP_CS,
TAO_INTERFACE_TIE_SH,
TAO_INTERFACE_TIE_SI,
@@ -192,6 +202,8 @@ public:
TAO_MODULE_SS,
TAO_MODULE_ANY_OP_CH,
TAO_MODULE_ANY_OP_CS,
+ TAO_MODULE_CDR_OP_CH,
+ TAO_MODULE_CDR_OP_CS,
// emitting code for an operation.
TAO_OPERATION_CH, // in client header
@@ -260,6 +272,8 @@ public:
TAO_ROOT_SS,
TAO_ROOT_ANY_OP_CH,
TAO_ROOT_ANY_OP_CS,
+ TAO_ROOT_CDR_OP_CH,
+ TAO_ROOT_CDR_OP_CS,
// emitting sequences
TAO_SEQUENCE_CH,
@@ -267,6 +281,8 @@ public:
TAO_SEQUENCE_CS,
TAO_SEQUENCE_ANY_OP_CH,
TAO_SEQUENCE_ANY_OP_CS,
+ TAO_SEQUENCE_CDR_OP_CH,
+ TAO_SEQUENCE_CDR_OP_CS,
// emitting code for sequence base type
TAO_SEQUENCE_BASE_CH,
@@ -308,6 +324,8 @@ public:
TAO_STRUCT_CS,
TAO_STRUCT_ANY_OP_CH,
TAO_STRUCT_ANY_OP_CS,
+ TAO_STRUCT_CDR_OP_CH,
+ TAO_STRUCT_CDR_OP_CS,
// emitting code for typedefs
TAO_TYPEDEF_CH,
@@ -318,6 +336,8 @@ public:
TAO_TYPEDEF_SS,
TAO_TYPEDEF_ANY_OP_CH,
TAO_TYPEDEF_ANY_OP_CS,
+ TAO_TYPEDEF_CDR_OP_CH,
+ TAO_TYPEDEF_CDR_OP_CS,
// emitting code for unions
TAO_UNION_CH,
@@ -325,6 +345,8 @@ public:
TAO_UNION_CS,
TAO_UNION_ANY_OP_CH,
TAO_UNION_ANY_OP_CS,
+ TAO_UNION_CDR_OP_CH,
+ TAO_UNION_CDR_OP_CS,
// emitting code for the discriminant
TAO_UNION_DISCTYPEDEFN_CH,
@@ -353,6 +375,10 @@ public:
TAO_UNION_PRIVATE_SI,
TAO_UNION_PRIVATE_SS,
+ // emitting code for CDR operators for types defined inside unions
+ TAO_UNION_BRANCH_CDR_OP_CH,
+ TAO_UNION_BRANCH_CDR_OP_CS,
+
// emitting code for typecodes
TAO_TYPECODE_DECL,
TAO_TYPECODE_DEFN,
@@ -371,6 +397,16 @@ public:
TAO_USER_DEFINED
};
+ enum CG_SUB_STATE
+ {
+ // sub states
+ TAO_CDR_INPUT,
+ TAO_CDR_OUTPUT,
+ TAO_CDR_SCOPE,
+
+ TAO_SUB_STATE_UNKNOWN
+ };
+
TAO_CodeGen (void);
// Constructor
diff --git a/TAO/TAO_IDL/be_include/be_decl.h b/TAO/TAO_IDL/be_include/be_decl.h
index ce9e04e7662..dd534af3940 100644
--- a/TAO/TAO_IDL/be_include/be_decl.h
+++ b/TAO/TAO_IDL/be_include/be_decl.h
@@ -99,6 +99,8 @@ public:
idl_bool srv_inline_gen (void);
idl_bool cli_hdr_any_op_gen (void);
idl_bool cli_stub_any_op_gen (void);
+ idl_bool cli_hdr_cdr_op_gen (void);
+ idl_bool cli_stub_cdr_op_gen (void);
// set the flag indicating that code generation is done
void cli_hdr_gen (idl_bool);
@@ -109,6 +111,8 @@ public:
void srv_inline_gen (idl_bool);
void cli_hdr_any_op_gen (idl_bool);
void cli_stub_any_op_gen (idl_bool);
+ void cli_hdr_cdr_op_gen (idl_bool);
+ void cli_stub_cdr_op_gen (idl_bool);
idl_bool is_child (be_decl *node);
// am I a direct child of node?
@@ -154,6 +158,8 @@ protected:
idl_bool srv_inline_gen_;
idl_bool cli_hdr_any_op_gen_;
idl_bool cli_stub_any_op_gen_;
+ idl_bool cli_hdr_cdr_op_gen_;
+ idl_bool cli_stub_cdr_op_gen_;
char *fullname_;
// our full scoped name
diff --git a/TAO/TAO_IDL/be_include/be_factory.h b/TAO/TAO_IDL/be_include/be_factory.h
index 9ed9a18f0de..bbbcf47f3d9 100644
--- a/TAO/TAO_IDL/be_include/be_factory.h
+++ b/TAO/TAO_IDL/be_include/be_factory.h
@@ -69,4 +69,4 @@ private:
typedef ACE_Singleton<TAO_OutStream_Factory, ACE_SYNCH_RECURSIVE_MUTEX> TAO_OUTSTREAM_FACTORY;
// Singleton instance of the OutStream factory
-#endif // if !defined
+#endif /* if !defined _TAO_BE_FACTORY_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_array.h b/TAO/TAO_IDL/be_include/be_visitor_array.h
index 2f461c49cd4..506bde6b54b 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_array.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_array.h
@@ -30,5 +30,7 @@
#include "be_visitor_array/array_cs.h"
#include "be_visitor_array/any_op_ch.h"
#include "be_visitor_array/any_op_cs.h"
+#include "be_visitor_array/cdr_op_ch.h"
+#include "be_visitor_array/cdr_op_cs.h"
#endif /* TAO_BE_VISITOR_ARRAY_H */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_ch.h
new file mode 100644
index 00000000000..53766d3be77
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_ch.h
@@ -0,0 +1,52 @@
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_ch.h
+//
+// = DESCRIPTION
+// Visitors for generation of code for Arrays in client header. This one
+// generates the CDR operators.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_ARRAY_CDR_OP_CH_H_)
+#define _BE_VISITOR_ARRAY_CDR_OP_CH_H_
+
+// ************************************************************
+// class be_visitor_array_cdr_op_ch
+// ************************************************************
+
+class be_visitor_array_cdr_op_ch : public be_visitor_decl
+{
+ //
+ // = TITLE
+ // be_visitor_array_cdr_op_ch
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for array that generates the CDR operator
+ // declarations
+ //
+
+public:
+ be_visitor_array_cdr_op_ch (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_array_cdr_op_ch (void);
+ // destructor
+
+ virtual int visit_array (be_array *node);
+ // visit array
+
+};
+
+#endif /* _BE_VISITOR_ARRAY_CDR_OP_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_cs.h
new file mode 100644
index 00000000000..c02c51112f5
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_cs.h
@@ -0,0 +1,86 @@
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_cs.h
+//
+// = DESCRIPTION
+// Visitors for generation of code for Arrays in client stubs. This one
+// generates the CDR operators.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_ARRAY_CDR_OP_CS_H_)
+#define _BE_VISITOR_ARRAY_CDR_OP_CS_H_
+
+// ************************************************************
+// class be_visitor_array_cs
+// ************************************************************
+
+class be_visitor_array_cdr_op_cs : public be_visitor_decl
+{
+ //
+ // = TITLE
+ // be_visitor_array_cdr_op_cs
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for array that generates the CDR operator
+ // implementations
+ //
+
+public:
+ be_visitor_array_cdr_op_cs (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_array_cdr_op_cs (void);
+ // destructor
+
+ virtual int visit_array (be_array *node);
+ // visit array
+
+ // = Visitor methods on array types
+
+ virtual int visit_enum (be_enum *node);
+ // visit an enum
+
+ virtual int visit_interface (be_interface *node);
+ // visit an interface
+
+ virtual int visit_interface_fwd (be_interface_fwd *node);
+ // visit an interface forward node
+
+ virtual int visit_predefined_type (be_predefined_type *node);
+ // visit a predefined type node
+
+ virtual int visit_sequence (be_sequence *node);
+ // visit sequence
+
+ virtual int visit_string (be_string *node);
+ // visit string
+
+ virtual int visit_structure (be_structure *node);
+ // visit structure
+
+ virtual int visit_typedef (be_typedef *node);
+ // visit typedef
+
+ virtual int visit_union (be_union *node);
+ // visit union
+
+protected:
+
+ int visit_node (be_type *);
+ // helper that does the common job
+
+};
+
+#endif /* _BE_VISITOR_ARRAY_CDR_OP_CS_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_context.h b/TAO/TAO_IDL/be_include/be_visitor_context.h
index 9ae68dca747..02e07dda533 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_context.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_context.h
@@ -70,6 +70,12 @@ public:
TAO_CodeGen::CG_STATE state (void);
// return the code generation state
+ void sub_state (TAO_CodeGen::CG_SUB_STATE);
+ // code generation state
+
+ TAO_CodeGen::CG_SUB_STATE sub_state (void);
+ // return the code generation state
+
void alias (be_typedef *node);
// set the alias node (if any)
@@ -208,6 +214,9 @@ private:
TAO_CodeGen::CG_STATE state_;
// code generation state
+ TAO_CodeGen::CG_SUB_STATE sub_state_;
+ // code generation state
+
TAO_OutStream *os_;
// current output stream
diff --git a/TAO/TAO_IDL/be_include/be_visitor_enum.h b/TAO/TAO_IDL/be_include/be_visitor_enum.h
index 070cceda0b0..a195680786f 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_enum.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_enum.h
@@ -28,5 +28,7 @@
#include "be_visitor_enum/enum_cs.h"
#include "be_visitor_enum/any_op_ch.h"
#include "be_visitor_enum/any_op_cs.h"
+#include "be_visitor_enum/cdr_op_ch.h"
+#include "be_visitor_enum/cdr_op_cs.h"
#endif /* TAO_BE_VISITOR_ENUM_H */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_ch.h
new file mode 100644
index 00000000000..883b226c9f1
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_ch.h
@@ -0,0 +1,47 @@
+/* -*- C++ -*- */
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for Enums generating code for the CDR operators
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_ENUM_CDR_OP_CH_H_)
+#define _BE_VISITOR_ENUM_CDR_OP_CH_H_
+
+class be_visitor_enum_cdr_op_ch : public be_visitor_scope
+{
+ //
+ // = TITLE
+ // be_visitor_enum_cdr_op_ch
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for enum that generates the CDR operator
+ // declarations
+ //
+
+public:
+ be_visitor_enum_cdr_op_ch (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_enum_cdr_op_ch (void);
+ // destructor
+
+ virtual int visit_enum (be_enum *node);
+ // visit enum
+};
+
+#endif /* _BE_VISITOR_ENUM_CDR_OP_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_cs.h
new file mode 100644
index 00000000000..5e995f7a117
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_cs.h
@@ -0,0 +1,47 @@
+/* -*- C++ -*- */
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_cs.h
+//
+// = DESCRIPTION
+// Concrete visitor for Enums generating code for the CDR operators
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_ENUM_CDR_OP_CS_H_)
+#define _BE_VISITOR_ENUM_CDR_OP_CS_H_
+
+class be_visitor_enum_cdr_op_cs : public be_visitor_scope
+{
+ //
+ // = TITLE
+ // be_visitor_enum_cdr_op_cs
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for enum that generates the CDR operator
+ // implementations
+ //
+
+public:
+ be_visitor_enum_cdr_op_cs (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_enum_cdr_op_cs (void);
+ // destructor
+
+ virtual int visit_enum (be_enum *node);
+ // visit enum
+};
+
+#endif /* _BE_VISITOR_ENUM_CDR_OP_CS_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_exception.h b/TAO/TAO_IDL/be_include/be_visitor_exception.h
index 7d5069ddc63..30ae6f06733 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_exception.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_exception.h
@@ -32,5 +32,7 @@
#include "be_visitor_exception/ctor_assign.h"
#include "be_visitor_exception/any_op_ch.h"
#include "be_visitor_exception/any_op_cs.h"
+#include "be_visitor_exception/cdr_op_ch.h"
+#include "be_visitor_exception/cdr_op_cs.h"
#endif /* TAO_BE_VISITOR_EXCEPTION_H */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_exception/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_exception/cdr_op_ch.h
new file mode 100644
index 00000000000..e24b4299deb
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_exception/cdr_op_ch.h
@@ -0,0 +1,50 @@
+/* -*- c++ -*- */
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Exception class
+// This one provides code generation for the CDR operators for the exception
+// in the client header.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_EXCEPTION_CDR_OP_CH_H_)
+#define _BE_VISITOR_EXCEPTION_CDR_OP_CH_H_
+
+class be_visitor_exception_cdr_op_ch : public be_visitor_exception
+{
+ //
+ // = TITLE
+ // be_visitor_exception_cdr_op_ch
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for exception that generates the CDR operator
+ // declarations
+ //
+
+public:
+ be_visitor_exception_cdr_op_ch (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_exception_cdr_op_ch (void);
+ // destructor
+
+ virtual int visit_exception (be_exception *node);
+ // visit exception
+
+};
+
+#endif /* _BE_VISITOR_EXCEPTION_CDR_OP_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_exception/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_exception/cdr_op_cs.h
new file mode 100644
index 00000000000..2551da2f769
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_exception/cdr_op_cs.h
@@ -0,0 +1,52 @@
+/* -*- c++ -*- */
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Exception class
+// This one provides code generation for the CDR operators for the exception
+// in the client stub.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_EXCEPTION_CDR_OP_CS_H_)
+#define _BE_VISITOR_EXCEPTION_CDR_OP_CS_H_
+
+class be_visitor_exception_cdr_op_cs : public be_visitor_exception
+{
+ //
+ // = TITLE
+ // be_visitor_exception_cdr_op_cs
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for exception that generates the CDR operator
+ // implementations
+ //
+
+public:
+ be_visitor_exception_cdr_op_cs (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_exception_cdr_op_cs (void);
+ // destructor
+
+ virtual int visit_exception (be_exception *node);
+ // visit exception
+
+ virtual int post_process (void);
+ // any post processing that needs to be done after a scope element is handled
+};
+
+#endif /* _BE_VISITOR_EXCEPTION_CDR_OP_CS_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_field.h b/TAO/TAO_IDL/be_include/be_visitor_field.h
index e1af83716e5..2aac718e368 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_field.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_field.h
@@ -26,5 +26,7 @@
#include "be_visitor_field/field_ch.h"
#include "be_visitor_field/field_ci.h"
#include "be_visitor_field/field_cs.h"
+#include "be_visitor_field/cdr_op_ch.h"
+#include "be_visitor_field/cdr_op_cs.h"
#endif /* TAO_BE_VISITOR_FIELD_H */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ch.h
new file mode 100644
index 00000000000..e9fb3139e6a
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ch.h
@@ -0,0 +1,66 @@
+//
+// $Id$
+//
+/* -*- c++ -*- */
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the base "BE_Field" node
+// This generates code for structure members in the client header.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_FIELD_CDR_OP_CH_H_)
+#define _BE_VISITOR_FIELD_CDR_OP_CH_H_
+
+class be_visitor_field_cdr_op_ch : public be_visitor_decl
+{
+ //
+ // = TITLE
+ // be_visitor_cdr_op_ch
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for the be_field node for the client header.
+ //
+public:
+ be_visitor_field_cdr_op_ch (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_field_cdr_op_ch (void);
+ // destructor
+
+ virtual int visit_field (be_field *node);
+ // visit the field node
+
+ // =visit operations on all possible data types that a field can be
+
+ virtual int visit_array (be_array *node);
+ // visit array type
+
+ virtual int visit_enum (be_enum *node);
+ // visit enum type
+
+ virtual int visit_sequence (be_sequence *node);
+ // visit sequence type
+
+ virtual int visit_structure (be_structure *node);
+ // visit structure type
+
+ virtual int visit_typedef (be_typedef *node);
+ // visit typedefed type
+
+ virtual int visit_union (be_union *node);
+ // visit union type
+
+};
+
+#endif /* _BE_VISITOR_FIELD_CDR_OP_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_cs.h
new file mode 100644
index 00000000000..7b4ac51064d
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_cs.h
@@ -0,0 +1,78 @@
+//
+// $Id$
+//
+/* -*- c++ -*- */
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_cs.h
+//
+// = DESCRIPTION
+// Concrete visitor for the base "BE_Field" node
+// This generates code for structure members in the client header.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_FIELD_CDR_OP_CS_H_)
+#define _BE_VISITOR_FIELD_CDR_OP_CS_H_
+
+class be_visitor_field_cdr_op_cs : public be_visitor_decl
+{
+ //
+ // = TITLE
+ // be_visitor_field_cdr_op_cs
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for the be_field node for the client header.
+ //
+public:
+ be_visitor_field_cdr_op_cs (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_field_cdr_op_cs (void);
+ // destructor
+
+ virtual int visit_field (be_field *node);
+ // visit the field node
+
+ // =visit operations on all possible data types that a field can be
+
+ virtual int visit_array (be_array *node);
+ // visit array type
+
+ virtual int visit_enum (be_enum *node);
+ // visit enum type
+
+ virtual int visit_interface (be_interface *node);
+ // visit interface type
+
+ virtual int visit_interface_fwd (be_interface_fwd *node);
+ // visit interface forward type
+
+ virtual int visit_predefined_type (be_predefined_type *node);
+ // visit predefined type
+
+ virtual int visit_sequence (be_sequence *node);
+ // visit sequence type
+
+ virtual int visit_string (be_string *node);
+ // visit string type
+
+ virtual int visit_structure (be_structure *node);
+ // visit structure type
+
+ virtual int visit_typedef (be_typedef *node);
+ // visit typedefed type
+
+ virtual int visit_union (be_union *node);
+ // visit union type
+
+};
+
+#endif /* _BE_VISITOR_FIELD_CDR_OP_CS_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface.h b/TAO/TAO_IDL/be_include/be_visitor_interface.h
index 4aac0f9050a..622bda773c9 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_interface.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface.h
@@ -34,6 +34,8 @@
#include "be_visitor_interface/collocated_ss.h"
#include "be_visitor_interface/any_op_ch.h"
#include "be_visitor_interface/any_op_cs.h"
+#include "be_visitor_interface/cdr_op_ch.h"
+#include "be_visitor_interface/cdr_op_cs.h"
#include "be_visitor_interface/tie_sh.h"
#include "be_visitor_interface/tie_si.h"
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_ch.h
new file mode 100644
index 00000000000..e8b3777cfe0
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_ch.h
@@ -0,0 +1,50 @@
+/* -*- c++ -*- */
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Interface class
+// This one provides code generation for the CDR operators for the interface
+// in the client header.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_INTERFACE_CDR_OP_CH_H_)
+#define _BE_VISITOR_INTERFACE_CDR_OP_CH_H_
+
+class be_visitor_interface_cdr_op_ch : public be_visitor_interface
+{
+ //
+ // = TITLE
+ // be_visitor_interface_cdr_op_ch
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for interface that generates the CDR operator
+ // declarations
+ //
+
+public:
+ be_visitor_interface_cdr_op_ch (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_interface_cdr_op_ch (void);
+ // destructor
+
+ virtual int visit_interface (be_interface *node);
+ // visit interface
+
+};
+
+#endif /* _BE_VISITOR_INTERFACE_CDR_OP_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_cs.h
new file mode 100644
index 00000000000..e83f6546892
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_cs.h
@@ -0,0 +1,50 @@
+/* -*- c++ -*- */
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Interface class
+// This one provides code generation for the CDR operators for the interface
+// in the client stub.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_INTERFACE_CDR_OP_CS_H_)
+#define _BE_VISITOR_INTERFACE_CDR_OP_CS_H_
+
+class be_visitor_interface_cdr_op_cs : public be_visitor_interface
+{
+ //
+ // = TITLE
+ // be_visitor_interface_cdr_op_cs
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for interface that generates the CDR operator
+ // implementations
+ //
+
+public:
+ be_visitor_interface_cdr_op_cs (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_interface_cdr_op_cs (void);
+ // destructor
+
+ virtual int visit_interface (be_interface *node);
+ // visit interface
+
+};
+
+#endif /* _BE_VISITOR_INTERFACE_CDR_OP_CS_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_module.h b/TAO/TAO_IDL/be_include/be_visitor_module.h
index 9ccf934e2f5..e118aa98a0a 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_module.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_module.h
@@ -31,5 +31,6 @@
#include "be_visitor_module/module_ch.h"
#include "be_visitor_module/module_sh.h"
#include "be_visitor_module/any_op.h"
+#include "be_visitor_module/cdr_op.h"
#endif // TAO_BE_VISITOR_MODULE_H
diff --git a/TAO/TAO_IDL/be_include/be_visitor_module/cdr_op.h b/TAO/TAO_IDL/be_include/be_visitor_module/cdr_op.h
new file mode 100644
index 00000000000..71aef9e34a4
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_module/cdr_op.h
@@ -0,0 +1,49 @@
+/* -*- c++ -*- */
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Module class
+// This one provides visitors to generate the CDR operators for elements in
+// the Module's scope.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_MODULE_CDR_OP_H_)
+#define _BE_VISITOR_MODULE_CDR_OP_H_
+
+class be_visitor_module_cdr_op : public be_visitor_module
+{
+ //
+ // = TITLE
+ // be_visitor_module_cdr_op
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for module that generates the CDR operator
+ // declarations and implementations
+ //
+
+public:
+ be_visitor_module_cdr_op (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_module_cdr_op (void);
+ // destructor
+
+ virtual int visit_module (be_module *node);
+ // visit module
+};
+
+#endif /* _BE_VISITOR_MODULE_CDR_OP_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_root.h b/TAO/TAO_IDL/be_include/be_visitor_root.h
index b18ad225c15..0bc0434cfe8 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_root.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_root.h
@@ -33,5 +33,6 @@
#include "be_visitor_root/root_si.h"
#include "be_visitor_root/root_ss.h"
#include "be_visitor_root/any_op.h"
+#include "be_visitor_root/cdr_op.h"
#endif // TAO_BE_VISITOR_ROOT_H
diff --git a/TAO/TAO_IDL/be_include/be_visitor_root/cdr_op.h b/TAO/TAO_IDL/be_include/be_visitor_root/cdr_op.h
new file mode 100644
index 00000000000..2c6675c0206
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_root/cdr_op.h
@@ -0,0 +1,49 @@
+/* -*- c++ -*- */
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Root class
+// This one provides code generation for the CDR operators for elements of
+// the Root scope.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_ROOT_CDR_OP_H_)
+#define _BE_VISITOR_ROOT_CDR_OP_H_
+
+class be_visitor_root_cdr_op : public be_visitor_root
+{
+ //
+ // = TITLE
+ // be_visitor_root_cdr_op
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for root that generates the CDR operator
+ // declarations and implementations
+ //
+
+public:
+ be_visitor_root_cdr_op (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_root_cdr_op (void);
+ // destructor
+
+ virtual int visit_root (be_root *node);
+ // visit root
+};
+
+#endif /* _BE_VISITOR_ROOT_CDR_OP_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_sequence.h b/TAO/TAO_IDL/be_include/be_visitor_sequence.h
index 1cda7cdae2f..a2e1a502a14 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_sequence.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_sequence.h
@@ -18,5 +18,7 @@
// = any operators
#include "be_visitor_sequence/any_op_ch.h"
#include "be_visitor_sequence/any_op_cs.h"
+#include "be_visitor_sequence/cdr_op_ch.h"
+#include "be_visitor_sequence/cdr_op_cs.h"
#endif /* TAO_BE_VISITOR_SEQUENCE_H */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_sequence/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_sequence/cdr_op_ch.h
new file mode 100644
index 00000000000..8503f16471f
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_sequence/cdr_op_ch.h
@@ -0,0 +1,50 @@
+/* -*- c++ -*- */
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Sequence class
+// This one provides code generation for the CDR operators for the sequence
+// in the client header.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_SEQUENCE_CDR_OP_CH_H_)
+#define _BE_VISITOR_SEQUENCE_CDR_OP_CH_H_
+
+class be_visitor_sequence_cdr_op_ch : public be_visitor_decl
+{
+ //
+ // = TITLE
+ // be_visitor_sequence_cdr_op_ch
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for sequence that generates the CDR operator
+ // declarations
+ //
+
+public:
+ be_visitor_sequence_cdr_op_ch (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_sequence_cdr_op_ch (void);
+ // destructor
+
+ virtual int visit_sequence (be_sequence *node);
+ // visit sequence
+
+};
+
+#endif /* _BE_VISITOR_SEQUENCE_CDR_OP_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_sequence/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_sequence/cdr_op_cs.h
new file mode 100644
index 00000000000..4015f388910
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_sequence/cdr_op_cs.h
@@ -0,0 +1,86 @@
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_cs.h
+//
+// = DESCRIPTION
+// Visitors for generation of code for Sequences in client stubs. This one
+// generates the CDR operators.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_SEQUENCE_CDR_OP_CS_H_)
+#define _BE_VISITOR_SEQUENCE_CDR_OP_CS_H_
+
+// ************************************************************
+// class be_visitor_sequence_cs
+// ************************************************************
+
+class be_visitor_sequence_cdr_op_cs : public be_visitor_decl
+{
+ //
+ // = TITLE
+ // be_visitor_sequence_cdr_op_cs
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for sequence that generates the CDR operator
+ // implementations
+ //
+
+public:
+ be_visitor_sequence_cdr_op_cs (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_sequence_cdr_op_cs (void);
+ // destructor
+
+ virtual int visit_sequence (be_sequence *node);
+ // visit sequence
+
+ // = Visitor methods on sequence types
+
+ virtual int visit_array (be_array *node);
+ // visit sequence
+
+ virtual int visit_enum (be_enum *node);
+ // visit an enum
+
+ virtual int visit_interface (be_interface *node);
+ // visit an interface
+
+ virtual int visit_interface_fwd (be_interface_fwd *node);
+ // visit an interface forward node
+
+ virtual int visit_predefined_type (be_predefined_type *node);
+ // visit a predefined type node
+
+ virtual int visit_string (be_string *node);
+ // visit string
+
+ virtual int visit_structure (be_structure *node);
+ // visit structure
+
+ virtual int visit_typedef (be_typedef *node);
+ // visit typedef
+
+ virtual int visit_union (be_union *node);
+ // visit union
+
+protected:
+
+ int visit_node (be_type *);
+ // helper that does the common job
+
+};
+
+#endif /* _BE_VISITOR_SEQUENCE_CDR_OP_CS_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_structure.h b/TAO/TAO_IDL/be_include/be_visitor_structure.h
index 3dafbd10eb8..c4c69c57013 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_structure.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_structure.h
@@ -33,5 +33,7 @@
#include "be_visitor_structure/structure_cs.h"
#include "be_visitor_structure/any_op_ch.h"
#include "be_visitor_structure/any_op_cs.h"
+#include "be_visitor_structure/cdr_op_ch.h"
+#include "be_visitor_structure/cdr_op_cs.h"
#endif // TAO_BE_VISITOR_STRUCTURE_H
diff --git a/TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_ch.h
new file mode 100644
index 00000000000..029c6ef3a51
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_ch.h
@@ -0,0 +1,50 @@
+/* -*- c++ -*- */
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Structure class
+// This one provides code generation for the CDR operators for the structure
+// in the client header.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_STRUCTURE_CDR_OP_CH_H_)
+#define _BE_VISITOR_STRUCTURE_CDR_OP_CH_H_
+
+class be_visitor_structure_cdr_op_ch : public be_visitor_structure
+{
+ //
+ // = TITLE
+ // be_visitor_structure_cdr_op_ch
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for structure that generates the CDR operator
+ // declarations
+ //
+
+public:
+ be_visitor_structure_cdr_op_ch (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_structure_cdr_op_ch (void);
+ // destructor
+
+ virtual int visit_structure (be_structure *node);
+ // visit structure
+
+};
+
+#endif /* _BE_VISITOR_STRUCTURE_CDR_OP_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_cs.h
new file mode 100644
index 00000000000..7f64453bc86
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_cs.h
@@ -0,0 +1,53 @@
+/* -*- c++ -*- */
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Structure class
+// This one provides code generation for the CDR operators for the structure
+// in the client stub.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_STRUCTURE_CDR_OP_CS_H_)
+#define _BE_VISITOR_STRUCTURE_CDR_OP_CS_H_
+
+class be_visitor_structure_cdr_op_cs : public be_visitor_structure
+{
+ //
+ // = TITLE
+ // be_visitor_structure_cdr_op_cs
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for structure that generates the CDR operator
+ // implementations
+ //
+
+public:
+ be_visitor_structure_cdr_op_cs (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_structure_cdr_op_cs (void);
+ // destructor
+
+ virtual int visit_structure (be_structure *node);
+ // visit structure
+
+ virtual int post_process (void);
+ // any post processing that needs to be done after a scope element is handled
+
+};
+
+#endif /* _BE_VISITOR_STRUCTURE_CDR_OP_CS_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_structure/structure_cs.h b/TAO/TAO_IDL/be_include/be_visitor_structure/structure_cs.h
index 06c4c0c51d0..a2fb142c02e 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_structure/structure_cs.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_structure/structure_cs.h
@@ -35,13 +35,13 @@ class be_visitor_structure_cs : public be_visitor_structure
//
public:
be_visitor_structure_cs (be_visitor_context *ctx);
- // constructureor
+ // constructor
~be_visitor_structure_cs (void);
- // destructureor
+ // destructor
virtual int visit_structure (be_structure *node);
- // visit structure. We provide code for this method in the derived class
+ // visit structure.
};
diff --git a/TAO/TAO_IDL/be_include/be_visitor_typedef.h b/TAO/TAO_IDL/be_include/be_visitor_typedef.h
index 206410cb13f..26a89412edd 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_typedef.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_typedef.h
@@ -33,5 +33,7 @@
#include "be_visitor_typedef/typedef_cs.h"
#include "be_visitor_typedef/any_op_ch.h"
#include "be_visitor_typedef/any_op_cs.h"
+#include "be_visitor_typedef/cdr_op_ch.h"
+#include "be_visitor_typedef/cdr_op_cs.h"
#endif // TAO_BE_VISITOR_TYPEDEF_H
diff --git a/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_ch.h
new file mode 100644
index 00000000000..82f72053396
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_ch.h
@@ -0,0 +1,69 @@
+
+/* -*- c++ -*- */
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Typedef class
+// This provides the code generation for the CDR operators of the Typedef
+// class in the client header.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_TYPEDEF_CDR_OP_CH_H_)
+#define _BE_VISITOR_TYPEDEF_CDR_OP_CH_H_
+
+class be_visitor_typedef_cdr_op_ch : public be_visitor_typedef
+{
+ //
+ // = TITLE
+ // be_visitor_typedef_cdr_op_ch
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for typedef that generates the CDR operator
+ // declarations and implementations
+ //
+
+public:
+ be_visitor_typedef_cdr_op_ch (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_typedef_cdr_op_ch (void);
+ // destructor
+
+ virtual int visit_typedef (be_typedef *node);
+ // visit typedef
+
+ // =visit methods on all elements syntactically valid as types that can be
+ // typedefed.
+
+ virtual int visit_array (be_array *node);
+ // visit a array
+
+ virtual int visit_enum (be_enum *node);
+ // visit an enum
+
+ virtual int visit_sequence (be_sequence *node);
+ // visit a sequence
+
+ virtual int visit_structure (be_structure *node);
+ // visit a structure
+
+ virtual int visit_union (be_union *node);
+ // visit a union
+
+};
+
+#endif /* _BE_VISITOR_TYPEDEF_CDR_OP_CH_H_*/
diff --git a/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_cs.h
new file mode 100644
index 00000000000..2301ba617a5
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_cs.h
@@ -0,0 +1,69 @@
+
+/* -*- c++ -*- */
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_cs.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Typedef class
+// This provides the code generation for the CDR operators of the Typedef
+// class in the client stubs.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_TYPEDEF_CDR_OP_CS_H_)
+#define _BE_VISITOR_TYPEDEF_CDR_OP_CS_H_
+
+class be_visitor_typedef_cdr_op_cs : public be_visitor_typedef
+{
+ //
+ // = TITLE
+ // be_visitor_typedef_cdr_op_cs
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for typedef that generates the CDR operator
+ // declarations and implementations
+ //
+
+public:
+ be_visitor_typedef_cdr_op_cs (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_typedef_cdr_op_cs (void);
+ // destructor
+
+ virtual int visit_typedef (be_typedef *node);
+ // visit typedef
+
+ // =visit methods on all elements syntactically valid as types that can be
+ // typedefed.
+
+ virtual int visit_array (be_array *node);
+ // visit a array
+
+ virtual int visit_enum (be_enum *node);
+ // visit an enum
+
+ virtual int visit_sequence (be_sequence *node);
+ // visit a sequence
+
+ virtual int visit_structure (be_structure *node);
+ // visit a structure
+
+ virtual int visit_union (be_union *node);
+ // visit a union
+
+};
+
+#endif /* _BE_VISITOR_TYPEDEF_CDR_OP_CS_H_*/
diff --git a/TAO/TAO_IDL/be_include/be_visitor_union.h b/TAO/TAO_IDL/be_include/be_visitor_union.h
index 1111d4bd198..6677a26284d 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_union.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_union.h
@@ -36,5 +36,7 @@
#include "be_visitor_union/discriminant_cs.h"
#include "be_visitor_union/any_op_ch.h"
#include "be_visitor_union/any_op_cs.h"
+#include "be_visitor_union/cdr_op_ch.h"
+#include "be_visitor_union/cdr_op_cs.h"
#endif // TAO_BE_VISITOR_UNION_H
diff --git a/TAO/TAO_IDL/be_include/be_visitor_union/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_union/cdr_op_ch.h
new file mode 100644
index 00000000000..3f92aefd860
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_union/cdr_op_ch.h
@@ -0,0 +1,50 @@
+/* -*- c++ -*- */
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Union class
+// This one provides code generation for the CDR operators for the union
+// in the client header.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_UNION_CDR_OP_CH_H_)
+#define _BE_VISITOR_UNION_CDR_OP_CH_H_
+
+class be_visitor_union_cdr_op_ch : public be_visitor_union
+{
+ //
+ // = TITLE
+ // be_visitor_union_cdr_op_ch
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for union that generates the CDR operator
+ // declarations
+ //
+
+public:
+ be_visitor_union_cdr_op_ch (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_union_cdr_op_ch (void);
+ // destructor
+
+ virtual int visit_union (be_union *node);
+ // visit union
+
+};
+
+#endif /* _BE_VISITOR_UNION_CDR_OP_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_union/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_union/cdr_op_cs.h
new file mode 100644
index 00000000000..c45a758d024
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_union/cdr_op_cs.h
@@ -0,0 +1,53 @@
+/* -*- c++ -*- */
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the Union class
+// This one provides code generation for the CDR operators for the union
+// in the client stub.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_UNION_CDR_OP_CS_H_)
+#define _BE_VISITOR_UNION_CDR_OP_CS_H_
+
+class be_visitor_union_cdr_op_cs : public be_visitor_union
+{
+ //
+ // = TITLE
+ // be_visitor_union_cdr_op_cs
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for union that generates the CDR operator
+ // implementations
+ //
+
+public:
+ be_visitor_union_cdr_op_cs (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_union_cdr_op_cs (void);
+ // destructor
+
+ virtual int visit_union (be_union *node);
+ // visit union
+
+ virtual int post_process (void);
+ // any post processing that needs to be done after a scope element is handled
+
+};
+
+#endif /* _BE_VISITOR_UNION_CDR_OP_CS_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_union_branch.h b/TAO/TAO_IDL/be_include/be_visitor_union_branch.h
index e38b18205e1..970addf09a5 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_union_branch.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_union_branch.h
@@ -30,5 +30,7 @@
#include "be_visitor_union_branch/public_reset_cs.h"
#include "be_visitor_union_branch/public_access_cs.h"
#include "be_visitor_union_branch/private_ch.h"
+#include "be_visitor_union_branch/cdr_op_ch.h"
+#include "be_visitor_union_branch/cdr_op_cs.h"
#endif // TAO_BE_VISITOR_UNION_BRANCH_H
diff --git a/TAO/TAO_IDL/be_include/be_visitor_union_branch/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_union_branch/cdr_op_ch.h
new file mode 100644
index 00000000000..09ccb3bf744
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_union_branch/cdr_op_ch.h
@@ -0,0 +1,66 @@
+//
+// $Id$
+//
+/* -*- c++ -*- */
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_ch.h
+//
+// = DESCRIPTION
+// Concrete visitor for the base "BE_Union_Branch" node
+// This generates code for structure members in the client header.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_UNION_BRANCH_CDR_OP_CH_H_)
+#define _BE_VISITOR_UNION_BRANCH_CDR_OP_CH_H_
+
+class be_visitor_union_branch_cdr_op_ch : public be_visitor_decl
+{
+ //
+ // = TITLE
+ // be_visitor_cdr_op_ch
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for the be_union_branch node for the client header.
+ //
+public:
+ be_visitor_union_branch_cdr_op_ch (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_union_branch_cdr_op_ch (void);
+ // destructor
+
+ virtual int visit_union_branch (be_union_branch *node);
+ // visit the union_branch node
+
+ // =visit operations on all possible data types that a union_branch can be
+
+ virtual int visit_array (be_array *node);
+ // visit array type
+
+ virtual int visit_enum (be_enum *node);
+ // visit enum type
+
+ virtual int visit_sequence (be_sequence *node);
+ // visit sequence type
+
+ virtual int visit_structure (be_structure *node);
+ // visit structure type
+
+ virtual int visit_typedef (be_typedef *node);
+ // visit typedefed type
+
+ virtual int visit_union (be_union *node);
+ // visit union type
+
+};
+
+#endif /* _BE_VISITOR_UNION_BRANCH_CDR_OP_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_union_branch/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_union_branch/cdr_op_cs.h
new file mode 100644
index 00000000000..c679327e1e0
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_union_branch/cdr_op_cs.h
@@ -0,0 +1,78 @@
+//
+// $Id$
+//
+/* -*- c++ -*- */
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_cs.h
+//
+// = DESCRIPTION
+// Concrete visitor for the base "BE_Union_Branch" node
+// This generates code for structure members in the client header.
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+#if !defined (_BE_VISITOR_UNION_BRANCH_CDR_OP_CS_H_)
+#define _BE_VISITOR_UNION_BRANCH_CDR_OP_CS_H_
+
+class be_visitor_union_branch_cdr_op_cs : public be_visitor_decl
+{
+ //
+ // = TITLE
+ // be_visitor_union_branch_cdr_op_cs
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor for the be_union_branch node for the client header.
+ //
+public:
+ be_visitor_union_branch_cdr_op_cs (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_union_branch_cdr_op_cs (void);
+ // destructor
+
+ virtual int visit_union_branch (be_union_branch *node);
+ // visit the union_branch node
+
+ // =visit operations on all possible data types that a union_branch can be
+
+ virtual int visit_array (be_array *node);
+ // visit array type
+
+ virtual int visit_enum (be_enum *node);
+ // visit enum type
+
+ virtual int visit_interface (be_interface *node);
+ // visit interface type
+
+ virtual int visit_interface_fwd (be_interface_fwd *node);
+ // visit interface forward type
+
+ virtual int visit_predefined_type (be_predefined_type *node);
+ // visit predefined type
+
+ virtual int visit_sequence (be_sequence *node);
+ // visit sequence type
+
+ virtual int visit_string (be_string *node);
+ // visit string type
+
+ virtual int visit_structure (be_structure *node);
+ // visit structure type
+
+ virtual int visit_typedef (be_typedef *node);
+ // visit typedefed type
+
+ virtual int visit_union (be_union *node);
+ // visit union type
+
+};
+
+#endif /* _BE_VISITOR_UNION_BRANCH_CDR_OP_CS_H_ */
diff --git a/TAO/TAO_IDL/fe/fe_lookup.cpp b/TAO/TAO_IDL/fe/fe_lookup.cpp
new file mode 100644
index 00000000000..6c47aee8776
--- /dev/null
+++ b/TAO/TAO_IDL/fe/fe_lookup.cpp
@@ -0,0 +1,166 @@
+// $Id$
+#include "idl.h"
+#include "idl_extern.h"
+#include "fe_private.h"
+/* starting time is 18:04:44 */
+/* C++ code produced by gperf version 2.6 (GNU C++ version) */
+/* Command-line: /home/gokhale/research/projects/ACE_wrappers/bin/gperf -M -J -c -C -D -E -T -f 0 -a -o -t -p -K keyword_ -L C++ -Z TAO_IDL_CPP_Keyword_Table -N lookup fe/keywords.dat */
+unsigned int
+TAO_IDL_CPP_Keyword_Table::hash (const char *str, int len)
+{
+ static const unsigned char asso_values[] =
+ {
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
+ 125, 125, 125, 125, 125, 125, 125, 45, 70, 30,
+ 15, 5, 45, 60, 65, 0, 125, 15, 10, 60,
+ 75, 60, 20, 20, 0, 25, 0, 0, 40, 5,
+ 85, 25, 125, 125, 125, 125, 125, 125,
+ };
+ return len + asso_values[str[len - 1]] + asso_values[str[0]];
+}
+
+const struct TAO_IDL_CPP_Keyword_Entry *
+TAO_IDL_CPP_Keyword_Table::lookup (const char *str, int len)
+{
+ enum
+ {
+ TOTAL_KEYWORDS = 73,
+ MIN_WORD_LENGTH = 2,
+ MAX_WORD_LENGTH = 16,
+ MIN_HASH_VALUE = 3,
+ MAX_HASH_VALUE = 124,
+ HASH_VALUE_RANGE = 122,
+ DUPLICATES = 4
+ };
+
+ static const struct TAO_IDL_CPP_Keyword_Entry wordlist[] =
+ {
+ {"",}, {"",}, {"",},
+ {"int", "_cxx_int"},
+ {"register", "_cxx_register"},
+ {"true", "_cxx_true"},
+ {"throw", "_cxx_throw"},
+ {"inline", "_cxx_inline"},
+ {"wchar_t", "_cxx_wchar_t"},
+ {"explicit", "_cxx_explicit"},
+ {"typename", "_cxx_typename"},
+ {"template", "_cxx_template"},
+ {"else", "_cxx_else"},
+ {"while", "_cxx_while"},
+ {"reinterpret_cast", "_cxx_reinterpret_cast"},
+ {"typeid", "_cxx_typeid"},
+ {"default", "_cxx_default"},
+ {"unsigned", "_cxx_unsigned"},
+ {"delete", "_cxx_delete"},
+ {"double", "_cxx_double"},
+ {"dynamic_cast", "_cxx_dynamic_cast"},
+ {"try", "_cxx_try"},
+ {"this", "_cxx_this"},
+ {"short", "_cxx_short"},
+ {"struct", "_cxx_struct"},
+ {"private", "_cxx_private"},
+ {"char", "_cxx_char"},
+ {"const", "_cxx_const"},
+ {"static_cast", "_cxx_static_cast"},
+ {"case", "_cxx_case"},
+ {"const_cast", "_cxx_const_cast"},
+ {"continue", "_cxx_continue"},
+ {"protected", "_cxx_protected"},
+ {"compl", "_cxx_compl"},
+ {"signed", "_cxx_signed"},
+ {"if", "_cxx_if"},
+ {"for", "_cxx_for"},
+ {"float", "_cxx_float"},
+ {"typedef", "_cxx_typedef"},
+ {"volatile", "_cxx_volatile"},
+ {"false", "_cxx_false"},
+ {"public", "_cxx_public"},
+ {"virtual", "_cxx_virtual"},
+ {"void", "_cxx_void"},
+ {"class", "_cxx_class"},
+ {"static", "_cxx_static"},
+ {"or", "_cxx_or"},
+ {"and", "_cxx_and"},
+ {"using", "_cxx_using"},
+ {"friend", "_cxx_friend"},
+ {"operator", "_cxx_operator"},
+ {"enum", "_cxx_enum"},
+ {"and_eq", "_cxx_and_eq"},
+ {"mutable", "_cxx_mutable"},
+ {"long", "_cxx_long"},
+ {"bitor", "_cxx_bitor"},
+ {"sizeof", "_cxx_sizeof"},
+ {"do", "_cxx_do"},
+ {"not", "_cxx_not"},
+ {"union", "_cxx_union"},
+ {"return", "_cxx_return"},
+ {"new", "_cxx_new"},
+ {"bool", "_cxx_bool"},
+ {"or_eq", "_cxx_or_eq"},
+ {"extern", "_cxx_extern"},
+ {"xor", "_cxx_xor"},
+ {"namespace", "_cxx_namespace"},
+ {"break", "_cxx_break"},
+ {"bitand", "_cxx_bitand"},
+ {"switch", "_cxx_switch"},
+ {"catch", "_cxx_catch"},
+ {"not_eq", "_cxx_not_eq"},
+ {"asm", "_cxx_asm"},
+ {"auto", "_cxx_auto"},
+ {"xor_eq", "_cxx_xor_eq"},
+ {"goto", "_cxx_goto"},
+ };
+
+ static const short lookup[] =
+ {
+ -1, -1, -1, 3, -1, -1, -1, -1, 4, 5, 6, 7, 8, 128,
+ 12, 13, 14, -9, -3, -1, -1, 15, 16, 17, -1, -1, 135, 20,
+ 21, 22, 23, 24, 25, -1, 26, 27, 28, -18, -2, 29, 30, -1,
+ -1, 31, 32, 33, 34, 35, 36, -1, 37, -1, 38, 39, -1, 40,
+ 41, 42, -1, 43, 44, 45, 46, 47, -1, 48, 49, -1, 50, 51,
+ -1, 52, 53, -1, 54, 55, 56, 57, 58, -1, 59, 60, -1, 61,
+ 62, 63, 64, -1, 65, 66, 67, 68, -1, -1, -1, -1, 69, -1,
+ -1, -1, 70, 71, -1, -1, -1, -1, -1, -1, 72, 73, -1, 74,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 75,
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+ {
+ int index = lookup[key];
+
+ if (index >= 0 && index < MAX_HASH_VALUE)
+ {
+ const char *s = wordlist[index].keyword_;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[index];
+ }
+ else if (index < 0 && index >= -MAX_HASH_VALUE)
+ return 0;
+ else
+ {
+ int offset = key + index + (index > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
+ const struct TAO_IDL_CPP_Keyword_Entry *base = &wordlist[-lookup[offset]];
+ const struct TAO_IDL_CPP_Keyword_Entry *ptr = base + -lookup[offset + 1];
+
+ while (--ptr >= base)
+ if (*str == *ptr->keyword_ && !strncmp (str + 1, ptr->keyword_ + 1, len - 1))
+ return ptr;
+ }
+ }
+ }
+ return 0;
+}
+/* ending time is 18:04:44 */
diff --git a/TAO/TAO_IDL/fe/idl.ll b/TAO/TAO_IDL/fe/idl.ll
index 72c1b70d97e..cc28f63be77 100644
--- a/TAO/TAO_IDL/fe/idl.ll
+++ b/TAO/TAO_IDL/fe/idl.ll
@@ -147,9 +147,22 @@ oneway return IDL_ONEWAY;
}
[a-zA-Z][a-zA-Z0-9_]* {
- char *z = (char *) malloc(strlen(ace_yytext) + 1);
- strcpy(z, ace_yytext);
- yylval.strval = z;
+ /* make sure that this identifier is not a C++ keyword. If it is,
+ prepend it with a _cxx_. Lookup in the perfect hash table for
+ C++ keyword and grab the mapping*/
+
+ TAO_IDL_CPP_Keyword_Table cpp_key_tbl;
+ const TAO_IDL_CPP_Keyword_Entry *entry =
+ cpp_key_tbl.lookup (ace_yytext,
+ ACE_OS::strlen (ace_yytext));
+ if (entry)
+ {
+ yylval.strval = ACE_OS::strdup (entry->mapping_);
+ }
+ else
+ {
+ yylval.strval = ACE_OS::strdup (ace_yytext);
+ }
return IDENTIFIER;
}
diff --git a/TAO/TAO_IDL/fe/keywords.dat b/TAO/TAO_IDL/fe/keywords.dat
new file mode 100644
index 00000000000..5fafd81051e
--- /dev/null
+++ b/TAO/TAO_IDL/fe/keywords.dat
@@ -0,0 +1,75 @@
+struct TAO_IDL_CPP_Keyword_Entry { char *keyword_ ; char *mapping_; };
+%%
+and, "_cxx_and"
+and_eq, "_cxx_and_eq"
+asm, "_cxx_asm"
+auto, "_cxx_auto"
+bitand, "_cxx_bitand"
+bitor, "_cxx_bitor"
+bool, "_cxx_bool"
+break, "_cxx_break"
+case, "_cxx_case"
+catch, "_cxx_catch"
+char, "_cxx_char"
+class, "_cxx_class"
+compl, "_cxx_compl"
+const, "_cxx_const"
+const_cast, "_cxx_const_cast"
+continue, "_cxx_continue"
+default, "_cxx_default"
+delete, "_cxx_delete"
+do, "_cxx_do"
+double, "_cxx_double"
+dynamic_cast, "_cxx_dynamic_cast"
+else, "_cxx_else"
+enum, "_cxx_enum"
+explicit, "_cxx_explicit"
+extern, "_cxx_extern"
+false, "_cxx_false"
+float, "_cxx_float"
+for, "_cxx_for"
+friend, "_cxx_friend"
+goto, "_cxx_goto"
+if, "_cxx_if"
+inline, "_cxx_inline"
+int, "_cxx_int"
+long, "_cxx_long"
+mutable, "_cxx_mutable"
+namespace, "_cxx_namespace"
+new, "_cxx_new"
+not, "_cxx_not"
+not_eq, "_cxx_not_eq"
+operator, "_cxx_operator"
+or, "_cxx_or"
+or_eq, "_cxx_or_eq"
+private, "_cxx_private"
+protected, "_cxx_protected"
+public, "_cxx_public"
+register, "_cxx_register"
+reinterpret_cast, "_cxx_reinterpret_cast"
+return, "_cxx_return"
+short, "_cxx_short"
+signed, "_cxx_signed"
+sizeof, "_cxx_sizeof"
+static, "_cxx_static"
+static_cast, "_cxx_static_cast"
+struct, "_cxx_struct"
+switch, "_cxx_switch"
+template, "_cxx_template"
+this, "_cxx_this"
+throw, "_cxx_throw"
+true, "_cxx_true"
+try, "_cxx_try"
+typedef, "_cxx_typedef"
+typeid, "_cxx_typeid"
+typename, "_cxx_typename"
+union, "_cxx_union"
+unsigned, "_cxx_unsigned"
+using, "_cxx_using"
+virtual, "_cxx_virtual"
+void, "_cxx_void"
+volatile, "_cxx_volatile"
+wchar_t, "_cxx_wchar_t"
+while, "_cxx_while"
+xor, "_cxx_xor"
+xor_eq, "_cxx_xor_eq"
diff --git a/TAO/TAO_IDL/fe/lex.yy.cpp b/TAO/TAO_IDL/fe/lex.yy.cpp
index ec00280ed9b..884241cf923 100644
--- a/TAO/TAO_IDL/fe/lex.yy.cpp
+++ b/TAO/TAO_IDL/fe/lex.yy.cpp
@@ -1102,15 +1102,28 @@ case 40:
TAO_YY_RULE_SETUP
#line 149 "fe/idl.ll"
{
- char *z = (char *) malloc(strlen(ace_tao_yytext) + 1);
- strcpy(z, ace_tao_yytext);
- tao_yylval.strval = z;
+ /* make sure that this identifier is not a C++ keyword. If it is,
+ prepend it with a _cxx_. Lookup in the perfect hash table for
+ C++ keyword and grab the mapping*/
+
+ TAO_IDL_CPP_Keyword_Table cpp_key_tbl;
+ const TAO_IDL_CPP_Keyword_Entry *entry =
+ cpp_key_tbl.lookup (ace_tao_yytext,
+ ACE_OS::strlen (ace_tao_yytext));
+ if (entry)
+ {
+ tao_yylval.strval = ACE_OS::strdup (entry->mapping_);
+ }
+ else
+ {
+ tao_yylval.strval = ACE_OS::strdup (ace_tao_yytext);
+ }
return IDENTIFIER;
}
TAO_YY_BREAK
case 41:
TAO_YY_RULE_SETUP
-#line 156 "fe/idl.ll"
+#line 169 "fe/idl.ll"
{
tao_yylval.dval = idl_atof(ace_tao_yytext);
return IDL_FLOATING_PT_LITERAL;
@@ -1118,7 +1131,7 @@ TAO_YY_RULE_SETUP
TAO_YY_BREAK
case 42:
TAO_YY_RULE_SETUP
-#line 160 "fe/idl.ll"
+#line 173 "fe/idl.ll"
{
tao_yylval.dval = idl_atof(ace_tao_yytext);
return IDL_FLOATING_PT_LITERAL;
@@ -1126,7 +1139,7 @@ TAO_YY_RULE_SETUP
TAO_YY_BREAK
case 43:
TAO_YY_RULE_SETUP
-#line 165 "fe/idl.ll"
+#line 178 "fe/idl.ll"
{
tao_yylval.ival = idl_atoi(ace_tao_yytext, 10);
return IDL_INTEGER_LITERAL;
@@ -1134,7 +1147,7 @@ TAO_YY_RULE_SETUP
TAO_YY_BREAK
case 44:
TAO_YY_RULE_SETUP
-#line 169 "fe/idl.ll"
+#line 182 "fe/idl.ll"
{
tao_yylval.ival = idl_atoi(ace_tao_yytext, 16);
return IDL_INTEGER_LITERAL;
@@ -1142,7 +1155,7 @@ TAO_YY_RULE_SETUP
TAO_YY_BREAK
case 45:
TAO_YY_RULE_SETUP
-#line 173 "fe/idl.ll"
+#line 186 "fe/idl.ll"
{
tao_yylval.ival = idl_atoi(ace_tao_yytext, 8);
return IDL_INTEGER_LITERAL;
@@ -1150,7 +1163,7 @@ TAO_YY_RULE_SETUP
TAO_YY_BREAK
case 46:
TAO_YY_RULE_SETUP
-#line 178 "fe/idl.ll"
+#line 191 "fe/idl.ll"
{
/* Skip the quotes */
char *tmp = ace_tao_yytext;
@@ -1161,7 +1174,7 @@ TAO_YY_RULE_SETUP
TAO_YY_BREAK
case 47:
TAO_YY_RULE_SETUP
-#line 185 "fe/idl.ll"
+#line 198 "fe/idl.ll"
{
tao_yylval.cval = ace_tao_yytext [1];
return IDL_CHARACTER_LITERAL;
@@ -1169,7 +1182,7 @@ TAO_YY_RULE_SETUP
TAO_YY_BREAK
case 48:
TAO_YY_RULE_SETUP
-#line 189 "fe/idl.ll"
+#line 202 "fe/idl.ll"
{
// octal character constant
tao_yylval.cval = idl_escape_reader(ace_tao_yytext + 1);
@@ -1178,7 +1191,7 @@ TAO_YY_RULE_SETUP
TAO_YY_BREAK
case 49:
TAO_YY_RULE_SETUP
-#line 194 "fe/idl.ll"
+#line 207 "fe/idl.ll"
{
tao_yylval.cval = idl_escape_reader(ace_tao_yytext + 1);
return IDL_CHARACTER_LITERAL;
@@ -1186,7 +1199,7 @@ TAO_YY_RULE_SETUP
TAO_YY_BREAK
case 50:
TAO_YY_RULE_SETUP
-#line 198 "fe/idl.ll"
+#line 211 "fe/idl.ll"
{/* remember pragma */
idl_global->set_lineno(idl_global->lineno() + 1);
idl_store_pragma(ace_tao_yytext);
@@ -1194,35 +1207,35 @@ TAO_YY_RULE_SETUP
TAO_YY_BREAK
case 51:
TAO_YY_RULE_SETUP
-#line 202 "fe/idl.ll"
+#line 215 "fe/idl.ll"
{
idl_parse_line_and_file(ace_tao_yytext);
}
TAO_YY_BREAK
case 52:
TAO_YY_RULE_SETUP
-#line 205 "fe/idl.ll"
+#line 218 "fe/idl.ll"
{
idl_parse_line_and_file(ace_tao_yytext);
}
TAO_YY_BREAK
case 53:
TAO_YY_RULE_SETUP
-#line 208 "fe/idl.ll"
+#line 221 "fe/idl.ll"
{
idl_parse_line_and_file(ace_tao_yytext);
}
TAO_YY_BREAK
case 54:
TAO_YY_RULE_SETUP
-#line 211 "fe/idl.ll"
+#line 224 "fe/idl.ll"
{
idl_parse_line_and_file(ace_tao_yytext);
}
TAO_YY_BREAK
case 55:
TAO_YY_RULE_SETUP
-#line 214 "fe/idl.ll"
+#line 227 "fe/idl.ll"
{
/* ignore cpp ident */
idl_global->set_lineno(idl_global->lineno() + 1);
@@ -1230,7 +1243,7 @@ TAO_YY_RULE_SETUP
TAO_YY_BREAK
case 56:
TAO_YY_RULE_SETUP
-#line 218 "fe/idl.ll"
+#line 231 "fe/idl.ll"
{
/* ignore comments */
idl_global->set_lineno(idl_global->lineno() + 1);
@@ -1238,7 +1251,7 @@ TAO_YY_RULE_SETUP
TAO_YY_BREAK
case 57:
TAO_YY_RULE_SETUP
-#line 222 "fe/idl.ll"
+#line 235 "fe/idl.ll"
{
for(;;) {
char c = tao_yyinput();
@@ -1256,24 +1269,24 @@ TAO_YY_RULE_SETUP
TAO_YY_BREAK
case 58:
TAO_YY_RULE_SETUP
-#line 236 "fe/idl.ll"
+#line 249 "fe/idl.ll"
;
TAO_YY_BREAK
case 59:
TAO_YY_RULE_SETUP
-#line 237 "fe/idl.ll"
+#line 250 "fe/idl.ll"
{
idl_global->set_lineno(idl_global->lineno() + 1);
}
TAO_YY_BREAK
case 60:
TAO_YY_RULE_SETUP
-#line 240 "fe/idl.ll"
+#line 253 "fe/idl.ll"
return ace_tao_yytext [0];
TAO_YY_BREAK
case 61:
TAO_YY_RULE_SETUP
-#line 242 "fe/idl.ll"
+#line 255 "fe/idl.ll"
TAO_YY_ECHO;
TAO_YY_BREAK
case TAO_YY_STATE_EOF(INITIAL):
@@ -2163,7 +2176,7 @@ int main()
return 0;
}
#endif
-#line 242 "fe/idl.ll"
+#line 255 "fe/idl.ll"
/* subroutines */
diff --git a/TAO/TAO_IDL/include/fe_private.h b/TAO/TAO_IDL/include/fe_private.h
index 8edf1e6971d..1c496ce9843 100644
--- a/TAO/TAO_IDL/include/fe_private.h
+++ b/TAO/TAO_IDL/include/fe_private.h
@@ -87,4 +87,21 @@ trademarks or registered trademarks of Sun Microsystems, Inc.
* FE Operations
*/
+// define an entry for the C++ keyword and its mapping
+struct TAO_IDL_CPP_Keyword_Entry
+{
+ char *keyword_;
+ char *mapping_;
+};
+
+// define a table that provides the lookup for the C++ keyword. The lookup uses
+// a perfect hash function
+class TAO_IDL_CPP_Keyword_Table
+{
+private:
+ unsigned int hash (const char *str, int len);
+public:
+ const TAO_IDL_CPP_Keyword_Entry *lookup (const char *str, int len);
+};
+
#endif // _FE_FE_HH