diff options
author | gmaxey <gmaxey@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-06-21 20:31:32 +0000 |
---|---|---|
committer | gmaxey <gmaxey@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-06-21 20:31:32 +0000 |
commit | 40e01c9ee3de87d4dbfe43d712bfd3ca03e88157 (patch) | |
tree | 40aaff56f3bb55025945f3042670b5d3afe6c1e1 /TAO/TAO_IDL | |
parent | 4a759eae1a8d64d26166966a90882fcc138561b2 (diff) | |
download | ATCD-40e01c9ee3de87d4dbfe43d712bfd3ca03e88157.tar.gz |
Tue Jun 21 13:35:00 2005 Gary Maxey <gary.maxey@hp.com>
Diffstat (limited to 'TAO/TAO_IDL')
76 files changed, 1228 insertions, 1440 deletions
diff --git a/TAO/TAO_IDL/be/be_sequence.cpp b/TAO/TAO_IDL/be/be_sequence.cpp index b8a7b661dbd..268c0316121 100644 --- a/TAO/TAO_IDL/be/be_sequence.cpp +++ b/TAO/TAO_IDL/be/be_sequence.cpp @@ -321,6 +321,7 @@ be_sequence::managed_type (void) case AST_Decl::NT_component_fwd: this->mt_ = be_sequence::MNG_OBJREF; break; + case AST_Decl::NT_valuebox: case AST_Decl::NT_valuetype: case AST_Decl::NT_valuetype_fwd: case AST_Decl::NT_eventtype: diff --git a/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp b/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp index f9540e34918..7fd90e920d4 100644 --- a/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp +++ b/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp @@ -15,6 +15,7 @@ #include "be_root.h" #include "be_module.h" #include "be_interface.h" +#include "be_valuebox.h" #include "be_valuetype.h" #include "be_interface_fwd.h" #include "be_valuetype_fwd.h" @@ -183,6 +184,55 @@ be_visitor_arg_traits::visit_interface_fwd (be_interface_fwd *node) } int +be_visitor_arg_traits::visit_valuebox (be_valuebox *node) +{ + if (this->generated (node)) + { + return 0; + } + + if (node->seen_in_operation ()) + { + TAO_OutStream & os = *this->ctx_->stream (); + + std::string guard_suffix = + std::string (this->S_) + std::string ("arg_traits"); + + // This should be generated even for imported nodes. The ifdef + // guard prevents multiple declarations. + os.gen_ifdef_macro (node->flat_name (), guard_suffix.c_str ()); + + os << be_nl << be_nl + << "template<>" << be_nl + << "class " + << this->S_ << "Arg_Traits<" + << node->name () << ">" << be_idt_nl + << ": public" << be_idt << be_idt_nl + << "Object_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl + << node->name () << " *," << be_nl + << node->name () << "_var," << be_nl + << node->name () << "_out"; + + // The SArgument classes don't need the traits parameter (yet?) + if (ACE_OS::strlen (this->S_) == 0) + { + os << "," << be_nl + << "TAO::Value_Traits<" << node->name () << ">"; + } + + os << be_uidt_nl + << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl + << "{" << be_nl + << "};"; + + os.gen_endif (); + } + + this->generated (node, I_TRUE); + return 0; +} + +int be_visitor_arg_traits::visit_valuetype (be_valuetype *node) { if (this->generated (node)) diff --git a/TAO/TAO_IDL/be/be_visitor_argument.cpp b/TAO/TAO_IDL/be/be_visitor_argument.cpp index ecdaa032a57..1024f14f6bd 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument.cpp @@ -35,6 +35,7 @@ #include "be_structure.h" #include "be_union.h" #include "be_sequence.h" +#include "be_valuebox.h" #include "be_valuetype.h" #include "be_valuetype_fwd.h" #include "be_eventtype.h" diff --git a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp index e96f7a34285..a41595c1b4a 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp @@ -387,22 +387,7 @@ int be_visitor_args_arglist::visit_typedef (be_typedef *node) int be_visitor_args_arglist::visit_valuetype (be_valuetype *node) { - TAO_OutStream *os = this->ctx_->stream (); - - switch (this->direction ()) - { - case AST_Argument::dir_IN: - *os << this->type_name (node) << " *"; - break; - case AST_Argument::dir_INOUT: - *os << this->type_name (node) << " *&"; - break; - case AST_Argument::dir_OUT: - *os << this->type_name (node, "_out"); - break; - } - - return 0; + return this->emit_common (node); } int be_visitor_args_arglist::visit_valuetype_fwd (be_valuetype_fwd *node) @@ -443,5 +428,28 @@ be_visitor_args_arglist::visit_home ( return this->visit_interface (node); } +int be_visitor_args_arglist::visit_valuebox (be_valuebox *node) +{ + return this->emit_common (node); +} + +int be_visitor_args_arglist::emit_common (be_type *node) +{ + TAO_OutStream *os = this->ctx_->stream (); + + switch (this->direction ()) + { + case AST_Argument::dir_IN: + *os << this->type_name (node) << " *"; + break; + case AST_Argument::dir_INOUT: + *os << this->type_name (node) << " *&"; + break; + case AST_Argument::dir_OUT: + *os << this->type_name (node, "_out"); + break; + } + return 0; +} diff --git a/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp index f07049e9f9b..b9ab1795ccd 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp @@ -224,175 +224,28 @@ int be_visitor_args_invoke_cs::visit_enum (be_enum *) int be_visitor_args_invoke_cs::visit_interface (be_interface *) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - - if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - break; - } - } - else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - *os << arg->local_name () << ".ptr ()"; - break; - } - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_invoke_cs::" - "visit_interface - " - "Bad substate\n"), - -1); - } - - return 0; + return this->emit_common (); } int be_visitor_args_invoke_cs::visit_interface_fwd (be_interface_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - - if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - break; - } - } - else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - *os << arg->local_name () << ".ptr ()"; - break; - } - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_invoke_cs::" - "visit_interface - " - "Bad substate\n"), - -1); - } + return this->emit_common (); +} - return 0; +int be_visitor_args_invoke_cs::visit_valuebox (be_valuebox *) +{ + return this->emit_common (); } int be_visitor_args_invoke_cs::visit_valuetype (be_valuetype *) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - - if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - break; - } - } - else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - *os << arg->local_name () << ".ptr ()"; - break; - } - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_invoke_cs::" - "visit_valuetype - " - "Bad substate\n"), - -1); - } - - return 0; + return this->emit_common (); } int be_visitor_args_invoke_cs::visit_valuetype_fwd (be_valuetype_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - - if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - break; - } - } - else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - *os << arg->local_name () << ".ptr ()"; - break; - } - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_invoke_cs::" - "visit_valuetype - " - "Bad substate\n"), - -1); - } - - return 0; + return this->emit_common (); } int be_visitor_args_invoke_cs::visit_predefined_type (be_predefined_type *node) @@ -672,20 +525,88 @@ int be_visitor_args_invoke_cs::visit_string (be_string *node) int be_visitor_args_invoke_cs::visit_structure (be_structure *node) { + return this->emit_common2 (node); +} + +int be_visitor_args_invoke_cs::visit_union (be_union *node) +{ + return this->emit_common2 (node); +} + +int be_visitor_args_invoke_cs::visit_typedef (be_typedef *node) +{ + this->ctx_->alias (node); + + if (node->primitive_base_type ()->accept (this) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_args_invoke_cs::" + "visit_typedef - " + "accept on primitive type failed\n"), + -1); + } + + this->ctx_->alias (0); + return 0; +} + +int +be_visitor_args_invoke_cs::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_args_invoke_cs::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_args_invoke_cs::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_args_invoke_cs::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_args_invoke_cs::visit_home ( + be_home *node + ) +{ + return this->visit_interface (node); +} + + +int be_visitor_args_invoke_cs::emit_common (void) +{ TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - break; - } + switch (this->direction ()) + { + case AST_Argument::dir_IN: + case AST_Argument::dir_INOUT: + *os << arg->local_name (); + break; + case AST_Argument::dir_OUT: + break; + } } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { @@ -697,10 +618,7 @@ int be_visitor_args_invoke_cs::visit_structure (be_structure *node) *os << arg->local_name (); break; case AST_Argument::dir_OUT: - if (node->size_type () == AST_Type::VARIABLE) - *os << "*" << arg->local_name () << ".ptr ()"; - else - *os << arg->local_name (); + *os << arg->local_name () << ".ptr ()"; break; } } @@ -708,7 +626,7 @@ int be_visitor_args_invoke_cs::visit_structure (be_structure *node) { ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_args_invoke_cs::" - "visit_interface - " + "emit_common - " "Bad substate\n"), -1); } @@ -716,7 +634,7 @@ int be_visitor_args_invoke_cs::visit_structure (be_structure *node) return 0; } -int be_visitor_args_invoke_cs::visit_union (be_union *node) +int be_visitor_args_invoke_cs::emit_common2 (be_type *node) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = this->ctx_->be_node_as_argument (); @@ -754,72 +672,10 @@ int be_visitor_args_invoke_cs::visit_union (be_union *node) { ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_args_invoke_cs::" - "visit_interface - " + "emit_common2 - " "Bad substate\n"), -1); } return 0; } - -int be_visitor_args_invoke_cs::visit_typedef (be_typedef *node) -{ - this->ctx_->alias (node); - - if (node->primitive_base_type ()->accept (this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_invoke_cs::" - "visit_typedef - " - "accept on primitive type failed\n"), - -1); - } - - this->ctx_->alias (0); - return 0; -} - -int -be_visitor_args_invoke_cs::visit_component ( - be_component *node - ) -{ - return this->visit_interface (node); -} - -int -be_visitor_args_invoke_cs::visit_component_fwd ( - be_component_fwd *node - ) -{ - return this->visit_interface_fwd (node); -} - -int -be_visitor_args_invoke_cs::visit_eventtype ( - be_eventtype *node - ) -{ - return this->visit_valuetype (node); -} - -int -be_visitor_args_invoke_cs::visit_eventtype_fwd ( - be_eventtype_fwd *node - ) -{ - return this->visit_valuetype_fwd (node); -} - -int -be_visitor_args_invoke_cs::visit_home ( - be_home *node - ) -{ - return this->visit_interface (node); -} - - - - - diff --git a/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp index 5cdb342a1b6..75593f2fd6d 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp @@ -225,166 +225,27 @@ int be_visitor_args_marshal_ss::visit_enum (be_enum *) int be_visitor_args_marshal_ss::visit_interface (be_interface *) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - - if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name () << ".out ()"; - break; - case AST_Argument::dir_OUT: - break; - } - } - else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - *os << arg->local_name () << ".in ()"; - break; - } - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_marshal_ss::" - "visit_interface - " - "Bad substate\n"), - -1); - } - - return 0; + return this->emit_common (); } int be_visitor_args_marshal_ss::visit_interface_fwd (be_interface_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - - if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name () << ".out ()"; - break; - case AST_Argument::dir_OUT: - break; - } - } - else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - *os << arg->local_name () << ".in ()"; - break; - } - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_marshal_ss::" - "visit_interface_fwd - " - "Bad substate\n"), - -1); - } + return this->emit_common (); +} - return 0; +int be_visitor_args_marshal_ss::visit_valuebox (be_valuebox *) +{ + return this->emit_common (); } int be_visitor_args_marshal_ss::visit_valuetype (be_valuetype *) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - - if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name () << ".out ()"; - break; - case AST_Argument::dir_OUT: - break; - } - } - else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - *os << arg->local_name () << ".in ()"; - break; - } - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_marshal_ss::" - "visit_valuetype - " - "Bad substate\n"), - -1); - } - - return 0; + return this->emit_common (); } int be_visitor_args_marshal_ss::visit_valuetype_fwd (be_valuetype_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - - if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name () << ".out ()"; - break; - case AST_Argument::dir_OUT: - break; - } - } - else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - *os << arg->local_name () << ".in ()"; - break; - } - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_marshal_ss::" - "visit_valuetype_fwd - " - "Bad substate\n"), - -1); - } - - return 0; + return this->emit_common (); } int be_visitor_args_marshal_ss::visit_predefined_type ( @@ -680,6 +541,74 @@ int be_visitor_args_marshal_ss::visit_string (be_string *node) int be_visitor_args_marshal_ss::visit_structure (be_structure *node) { + return this->emit_common2 (node); +} + +int be_visitor_args_marshal_ss::visit_union (be_union *node) +{ + return this->emit_common2 (node); +} + +int be_visitor_args_marshal_ss::visit_typedef (be_typedef *node) +{ + this->ctx_->alias (node); + + if (node->primitive_base_type ()->accept (this) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_args_marshal_ss::" + "visit_typedef - " + "accept on primitive type failed\n"), + -1); + } + + this->ctx_->alias (0); + return 0; +} + +int +be_visitor_args_marshal_ss::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_args_marshal_ss::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_args_marshal_ss::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_args_marshal_ss::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_args_marshal_ss::visit_home ( + be_home *node + ) +{ + return this->visit_interface (node); +} + + +be_visitor_args_marshal_ss::emit_common () +{ TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = this->ctx_->be_node_as_argument (); @@ -689,7 +618,7 @@ int be_visitor_args_marshal_ss::visit_structure (be_structure *node) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - *os << arg->local_name (); + *os << arg->local_name () << ".out ()"; break; case AST_Argument::dir_OUT: break; @@ -702,21 +631,15 @@ int be_visitor_args_marshal_ss::visit_structure (be_structure *node) case AST_Argument::dir_IN: break; case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; case AST_Argument::dir_OUT: - if (node->size_type () == AST_Type::VARIABLE) - *os << arg->local_name () << ".in ()"; - else - *os << arg->local_name (); + *os << arg->local_name () << ".in ()"; break; } } else { ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_marshal_ss::" - "visit_structure - " + "be_visitor_args_marshal_ss::emit_common - " "Bad substate\n"), -1); } @@ -724,7 +647,9 @@ int be_visitor_args_marshal_ss::visit_structure (be_structure *node) return 0; } -int be_visitor_args_marshal_ss::visit_union (be_union *node) + +int +be_visitor_args_marshal_ss::emit_common2 (be_type *node) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = this->ctx_->be_node_as_argument (); @@ -761,68 +686,10 @@ int be_visitor_args_marshal_ss::visit_union (be_union *node) else { ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_marshal_ss::" - "visit_union - " + "be_visitor_args_marshal_ss::emit_common2 - " "Bad substate\n"), -1); } return 0; } - -int be_visitor_args_marshal_ss::visit_typedef (be_typedef *node) -{ - this->ctx_->alias (node); - - if (node->primitive_base_type ()->accept (this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_marshal_ss::" - "visit_typedef - " - "accept on primitive type failed\n"), - -1); - } - - this->ctx_->alias (0); - return 0; -} - -int -be_visitor_args_marshal_ss::visit_component ( - be_component *node - ) -{ - return this->visit_interface (node); -} - -int -be_visitor_args_marshal_ss::visit_component_fwd ( - be_component_fwd *node - ) -{ - return this->visit_interface_fwd (node); -} - -int -be_visitor_args_marshal_ss::visit_eventtype ( - be_eventtype *node - ) -{ - return this->visit_valuetype (node); -} - -int -be_visitor_args_marshal_ss::visit_eventtype_fwd ( - be_eventtype_fwd *node - ) -{ - return this->visit_valuetype_fwd (node); -} - -int -be_visitor_args_marshal_ss::visit_home ( - be_home *node - ) -{ - return this->visit_interface (node); -} diff --git a/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp index 2692167cb45..e5b9a0f45f5 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp @@ -135,194 +135,27 @@ int be_visitor_args_upcall_ss::visit_enum (be_enum *) int be_visitor_args_upcall_ss::visit_interface (be_interface *) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - - switch (this->direction ()) - { - case AST_Argument::dir_IN: - if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - { - *os << arg->local_name (); - } - else - { - *os << arg->local_name () << ".in ()"; - } - - break; - case AST_Argument::dir_INOUT: - if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - { - *os << arg->local_name (); - } - else - { - *os << arg->local_name () << ".inout ()"; - } - - break; - case AST_Argument::dir_OUT: - if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - { - *os << arg->local_name (); - } - else - { - *os << arg->local_name () << ".out ()"; - } - - break; - } - - return 0; + return this->emit_common (); } int be_visitor_args_upcall_ss::visit_interface_fwd (be_interface_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - - switch (this->direction ()) - { - case AST_Argument::dir_IN: - if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - { - *os << arg->local_name (); - } - else - { - *os << arg->local_name () << ".in ()"; - } - - break; - case AST_Argument::dir_INOUT: - if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - { - *os << arg->local_name (); - } - else - { - *os << arg->local_name () << ".inout ()"; - } - - break; - case AST_Argument::dir_OUT: - if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - { - *os << arg->local_name (); - } - else - { - *os << arg->local_name () << ".out ()"; - } - - break; - } + return this->emit_common (); +} - return 0; +int be_visitor_args_upcall_ss::visit_valuebox (be_valuebox *) +{ + return this->emit_common (); } int be_visitor_args_upcall_ss::visit_valuetype (be_valuetype *) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - - switch (this->direction ()) - { - case AST_Argument::dir_IN: - if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - { - *os << arg->local_name (); - } - else - { - *os << arg->local_name () << ".in ()"; - } - - break; - case AST_Argument::dir_INOUT: - if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - { - *os << arg->local_name (); - } - else - { - *os << arg->local_name () << ".inout ()"; - } - - break; - case AST_Argument::dir_OUT: - if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - { - *os << arg->local_name (); - } - else - { - *os << arg->local_name () << ".out ()"; - } - - break; - } - - return 0; + return this->emit_common (); } int be_visitor_args_upcall_ss::visit_valuetype_fwd (be_valuetype_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - - switch (this->direction ()) - { - case AST_Argument::dir_IN: - if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - { - *os << arg->local_name (); - } - else - { - *os << arg->local_name () << ".in ()"; - } - - break; - case AST_Argument::dir_INOUT: - if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - { - *os << arg->local_name (); - } - else - { - *os << arg->local_name () << ".inout ()"; - } - - break; - case AST_Argument::dir_OUT: - if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - { - *os << arg->local_name (); - } - else - { - *os << arg->local_name () << ".out ()"; - } - - break; - } - - return 0; + return this->emit_common (); } int be_visitor_args_upcall_ss::visit_predefined_type (be_predefined_type *node) @@ -444,6 +277,70 @@ int be_visitor_args_upcall_ss::visit_sequence (be_sequence *) int be_visitor_args_upcall_ss::visit_string (be_string *) { + return this->emit_common (); +} + +int be_visitor_args_upcall_ss::visit_structure (be_structure *node) +{ + return this->emit_common2 (node); +} + +int be_visitor_args_upcall_ss::visit_union (be_union *node) +{ + return this->emit_common2 (node); +} + +int be_visitor_args_upcall_ss::visit_typedef (be_typedef *node) +{ + this->ctx_->alias (node); + + if (node->primitive_base_type ()->accept (this) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_args_upcall_ss::" + "visit_typedef - " + "accept on primitive type failed\n"), + -1); + } + + this->ctx_->alias (0); + return 0; +} + +int +be_visitor_args_upcall_ss::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_args_upcall_ss::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_args_upcall_ss::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_args_upcall_ss::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int be_visitor_args_upcall_ss::emit_common (void) +{ TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = this->ctx_->be_node_as_argument (); @@ -451,7 +348,7 @@ int be_visitor_args_upcall_ss::visit_string (be_string *) { case AST_Argument::dir_IN: if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) { *os << arg->local_name (); } @@ -463,19 +360,19 @@ int be_visitor_args_upcall_ss::visit_string (be_string *) break; case AST_Argument::dir_INOUT: if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) { *os << arg->local_name (); } else - { - *os << arg->local_name () << ".inout ()"; + { + *os << arg->local_name () << ".inout ()"; } break; case AST_Argument::dir_OUT: if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) { *os << arg->local_name (); } @@ -490,7 +387,7 @@ int be_visitor_args_upcall_ss::visit_string (be_string *) return 0; } -int be_visitor_args_upcall_ss::visit_structure (be_structure *node) +int be_visitor_args_upcall_ss::emit_common2 (be_type *node) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = this->ctx_->be_node_as_argument (); @@ -525,90 +422,3 @@ int be_visitor_args_upcall_ss::visit_structure (be_structure *node) return 0; } - -int be_visitor_args_upcall_ss::visit_union (be_union *node) -{ - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - - break; - case AST_Argument::dir_OUT: - if (node->size_type () == AST_Type::VARIABLE) - { - if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - { - *os << arg->local_name (); - } - else - { - *os << arg->local_name () << ".out ()"; - } - } - else - { - *os << arg->local_name (); - } - - break; - } - - return 0; -} - -int be_visitor_args_upcall_ss::visit_typedef (be_typedef *node) -{ - this->ctx_->alias (node); - - if (node->primitive_base_type ()->accept (this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_upcall_ss::" - "visit_typedef - " - "accept on primitive type failed\n"), - -1); - } - - this->ctx_->alias (0); - return 0; -} - -int -be_visitor_args_upcall_ss::visit_component ( - be_component *node - ) -{ - return this->visit_interface (node); -} - -int -be_visitor_args_upcall_ss::visit_component_fwd ( - be_component_fwd *node - ) -{ - return this->visit_interface_fwd (node); -} - -int -be_visitor_args_upcall_ss::visit_eventtype ( - be_eventtype *node - ) -{ - return this->visit_valuetype (node); -} - -int -be_visitor_args_upcall_ss::visit_eventtype_fwd ( - be_eventtype_fwd *node - ) -{ - return this->visit_valuetype_fwd (node); -} - - diff --git a/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp index 1cad7f972f6..639d624c5a6 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp @@ -146,131 +146,28 @@ int be_visitor_args_vardecl_ss::visit_enum (be_enum *node) int be_visitor_args_vardecl_ss::visit_interface (be_interface *node) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - be_type *bt; - - if (this->ctx_->alias ()) - { - bt = this->ctx_->alias (); - } - else - { - bt = node; - } - - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << bt->name () << "_var " << arg->local_name () << ";"; - - break; - case AST_Argument::dir_OUT: - *os << bt->name () << "_var " - << arg->local_name () << ";"; - - break; - } - - return 0; + return this->emit_common (node); } int be_visitor_args_vardecl_ss::visit_interface_fwd (be_interface_fwd *node) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - be_type *bt; - - if (this->ctx_->alias ()) - { - bt = this->ctx_->alias (); - } - else - { - bt = node; - } - - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << bt->name () << "_var " << arg->local_name () << ";"; + return this->emit_common (node); +} - break; - case AST_Argument::dir_OUT: - *os << bt->name () << "_var " - << arg->local_name () << ";"; - break; - } - - return 0; +int be_visitor_args_vardecl_ss::visit_valuebox (be_valuebox *node) +{ + return this->emit_common (node); } - int be_visitor_args_vardecl_ss::visit_valuetype (be_valuetype *node) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - be_type *bt; - - if (this->ctx_->alias ()) - { - bt = this->ctx_->alias (); - } - else - { - bt = node; - } - - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << bt->name () << "_var " << arg->local_name () << ";"; - - break; - case AST_Argument::dir_OUT: - *os << bt->name () << "_var " - << arg->local_name () << ";"; - - break; - } - - return 0; + return this->emit_common (node); } int be_visitor_args_vardecl_ss::visit_valuetype_fwd (be_valuetype_fwd *node) { - TAO_OutStream *os = this->ctx_->stream (); - be_argument *arg = this->ctx_->be_node_as_argument (); - be_type *bt; - - if (this->ctx_->alias ()) - { - bt = this->ctx_->alias (); - } - else - { - bt = node; - } - - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << bt->name () << "_var " << arg->local_name () << ";"; - - break; - case AST_Argument::dir_OUT: - *os << bt->name () << "_var " - << arg->local_name () << ";"; - - break; - } - - return 0; + return this->emit_common (node); } int be_visitor_args_vardecl_ss::visit_predefined_type (be_predefined_type *node) @@ -427,6 +324,67 @@ int be_visitor_args_vardecl_ss::visit_string (be_string *node) int be_visitor_args_vardecl_ss::visit_structure (be_structure *node) { + return this->emit_common2 (node); +} + +int be_visitor_args_vardecl_ss::visit_union (be_union *node) +{ + return this->emit_common2 (node); +} + +int be_visitor_args_vardecl_ss::visit_typedef (be_typedef *node) +{ + this->ctx_->alias (node); + + if (node->primitive_base_type ()->accept (this) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_args_vardecl_ss::" + "visit_typedef - " + "accept on primitive type failed\n"), + -1); + } + + this->ctx_->alias (0); + return 0; +} + +int +be_visitor_args_vardecl_ss::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_args_vardecl_ss::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_args_vardecl_ss::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_args_vardecl_ss::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + + +int +be_visitor_args_vardecl_ss::emit_common (be_type *node) +{ TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = this->ctx_->be_node_as_argument (); be_type *bt; @@ -444,19 +402,12 @@ int be_visitor_args_vardecl_ss::visit_structure (be_structure *node) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - *os << bt->name () << " " << arg->local_name () << ";"; + *os << bt->name () << "_var " << arg->local_name () << ";"; break; case AST_Argument::dir_OUT: - if (node->size_type () == be_type::VARIABLE) - { - *os << bt->name () << "_var " - << arg->local_name () << ";"; - } - else - { - *os << bt->name () << " " << arg->local_name () << ";"; - } + *os << bt->name () << "_var " + << arg->local_name () << ";"; break; } @@ -464,7 +415,10 @@ int be_visitor_args_vardecl_ss::visit_structure (be_structure *node) return 0; } -int be_visitor_args_vardecl_ss::visit_union (be_union *node) + + +int +be_visitor_args_vardecl_ss::emit_common2 (be_type *node) { TAO_OutStream *os = this->ctx_->stream (); be_argument *arg = this->ctx_->be_node_as_argument (); @@ -491,7 +445,6 @@ int be_visitor_args_vardecl_ss::visit_union (be_union *node) { *os << bt->name () << "_var " << arg->local_name () << ";"; - } else { @@ -503,54 +456,3 @@ int be_visitor_args_vardecl_ss::visit_union (be_union *node) return 0; } - -int be_visitor_args_vardecl_ss::visit_typedef (be_typedef *node) -{ - this->ctx_->alias (node); - - if (node->primitive_base_type ()->accept (this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_vardecl_ss::" - "visit_typedef - " - "accept on primitive type failed\n"), - -1); - } - - this->ctx_->alias (0); - return 0; -} - -int -be_visitor_args_vardecl_ss::visit_component ( - be_component *node - ) -{ - return this->visit_interface (node); -} - -int -be_visitor_args_vardecl_ss::visit_component_fwd ( - be_component_fwd *node - ) -{ - return this->visit_interface_fwd (node); -} - -int -be_visitor_args_vardecl_ss::visit_eventtype ( - be_eventtype *node - ) -{ - return this->visit_valuetype (node); -} - -int -be_visitor_args_vardecl_ss::visit_eventtype_fwd ( - be_eventtype_fwd *node - ) -{ - return this->visit_valuetype_fwd (node); -} - - diff --git a/TAO/TAO_IDL/be/be_visitor_array.cpp b/TAO/TAO_IDL/be/be_visitor_array.cpp index 96da89c36f1..ced70b4b433 100644 --- a/TAO/TAO_IDL/be/be_visitor_array.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array.cpp @@ -26,6 +26,7 @@ #include "be_string.h" #include "be_interface.h" #include "be_interface_fwd.h" +#include "be_valuebox.h" #include "be_valuetype.h" #include "be_valuetype_fwd.h" #include "be_structure.h" diff --git a/TAO/TAO_IDL/be/be_visitor_array/array.cpp b/TAO/TAO_IDL/be/be_visitor_array/array.cpp index 3e796a34112..5334f051af4 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array.cpp @@ -51,109 +51,31 @@ be_visitor_array::visit_enum (be_enum *node) int be_visitor_array::visit_interface (be_interface *node) { - TAO_OutStream *os = this->ctx_->stream (); - be_type *bt; - - if (this->ctx_->alias ()) - { - bt = this->ctx_->alias (); - } - else - { - bt = node; - } - - if (this->ctx_->state () == TAO_CodeGen::TAO_ARRAY_CH) - { - *os << bt->nested_type_name (this->ctx_->scope (), "_var"); - } - else - { - *os << bt->name () << "_var"; - } - - return 0; + return this->emit_common (node); } int be_visitor_array::visit_interface_fwd (be_interface_fwd *node) { - TAO_OutStream *os = this->ctx_->stream (); - be_type *bt; - - if (this->ctx_->alias ()) - { - bt = this->ctx_->alias (); - } - else - { - bt = node; - } - - if (this->ctx_->state () == TAO_CodeGen::TAO_ARRAY_CH) - { - *os << bt->nested_type_name (this->ctx_->scope (), "_var"); - } - else - { - *os << bt->name () << "_var"; - } + return this->emit_common (node); +} - return 0; +int +be_visitor_array::visit_valuebox (be_valuebox *node) +{ + return this->emit_common (node); } int be_visitor_array::visit_valuetype (be_valuetype *node) { - TAO_OutStream *os = this->ctx_->stream (); - be_type *bt; - - if (this->ctx_->alias ()) - { - bt = this->ctx_->alias (); - } - else - { - bt = node; - } - - if (this->ctx_->state () == TAO_CodeGen::TAO_ARRAY_CH) - { - *os << bt->nested_type_name (this->ctx_->scope (), "_var"); - } - else - { - *os << bt->name () << "_var"; - } - - return 0; + return this->emit_common (node); } int be_visitor_array::visit_valuetype_fwd (be_valuetype_fwd *node) { - TAO_OutStream *os = this->ctx_->stream (); - be_type *bt; - - if (this->ctx_->alias ()) - { - bt = this->ctx_->alias (); - } - else - { - bt = node; - } - - if (this->ctx_->state () == TAO_CodeGen::TAO_ARRAY_CH) - { - *os << bt->nested_type_name (this->ctx_->scope (), "_var"); - } - else - { - *os << bt->name () << "_var"; - } - - return 0; + return this->emit_common (node); } int @@ -283,3 +205,30 @@ be_visitor_array::visit_node (be_type *node) return 0; } + +int +be_visitor_array::emit_common (be_type *node) +{ + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; + + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } + else + { + bt = node; + } + + if (this->ctx_->state () == TAO_CodeGen::TAO_ARRAY_CH) + { + *os << bt->nested_type_name (this->ctx_->scope (), "_var"); + } + else + { + *os << bt->name () << "_var"; + } + + return 0; +} diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp index 1e4cf991e0c..cc336d252ca 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp @@ -238,6 +238,12 @@ be_visitor_array_cdr_op_cs::visit_interface_fwd (be_interface_fwd *node) } int +be_visitor_array_cdr_op_cs::visit_valuebox (be_valuebox *node) +{ + return this->visit_node (node); +} + +int be_visitor_array_cdr_op_cs::visit_valuetype (be_valuetype *node) { return this->visit_node (node); @@ -644,6 +650,7 @@ be_visitor_array_cdr_op_cs::visit_node (be_type *bt) case AST_Decl::NT_wstring: case AST_Decl::NT_valuetype: case AST_Decl::NT_valuetype_fwd: + case AST_Decl::NT_valuebox: *os << ".out ()"; break; case AST_Decl::NT_pre_defined: @@ -729,6 +736,7 @@ be_visitor_array_cdr_op_cs::visit_node (be_type *bt) case AST_Decl::NT_wstring: case AST_Decl::NT_valuetype: case AST_Decl::NT_valuetype_fwd: + case AST_Decl::NT_valuebox: *os << ".in ()"; break; case AST_Decl::NT_pre_defined: diff --git a/TAO/TAO_IDL/be/be_visitor_exception.cpp b/TAO/TAO_IDL/be/be_visitor_exception.cpp index c02bbbcf791..b1abf086343 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception.cpp @@ -24,6 +24,7 @@ #include "be_enum.h" #include "be_interface.h" #include "be_interface_fwd.h" +#include "be_valuebox.h" #include "be_valuetype.h" #include "be_valuetype_fwd.h" #include "be_array.h" diff --git a/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp b/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp index db0ec84fed0..0ba66636700 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp @@ -193,72 +193,22 @@ int be_visitor_exception_ctor_assign::visit_interface_fwd ( } int -be_visitor_exception_ctor_assign::visit_valuetype (be_valuetype *node) +be_visitor_exception_ctor_assign::visit_valuebox (be_valuebox *node) { - TAO_OutStream *os = this->ctx_->stream (); - be_decl *bd = this->ctx_->node (); - - *os << be_nl; - - if (this->ctx_->exception ()) // Special constructor. - { - *os << "CORBA::add_ref (" << be_idt << be_idt_nl - << "const_cast<" << be_idt << be_idt_nl - << node->name () << " *> (" << be_nl - << "_tao_" << bd->local_name () << be_uidt_nl - << ")" << be_uidt << be_uidt_nl - << ");" << be_uidt_nl; - *os << "this->" << bd->local_name () << " = _tao_" - << bd->local_name () << ";"; - } - else - { - *os << "CORBA::add_ref (" << be_idt << be_idt_nl - << "const_cast<" << be_idt << be_idt_nl - << node->name () << " *> (" << be_nl - << "_tao_excp." << bd->local_name () << ".in ()" << be_uidt_nl - << ")" << be_uidt << be_uidt_nl - << ");" << be_uidt_nl; - *os << "this->" << bd->local_name () << " = _tao_excp." - << bd->local_name () << ".in ();"; - } + return this->emit_valuetype_common (node); +} - return 0; +int +be_visitor_exception_ctor_assign::visit_valuetype (be_valuetype *node) +{ + return this->emit_valuetype_common (node); } int be_visitor_exception_ctor_assign::visit_valuetype_fwd ( be_valuetype_fwd *node ) { - TAO_OutStream *os = this->ctx_->stream (); - be_decl *bd = this->ctx_->node (); - - *os << be_nl; - - if (this->ctx_->exception ()) // Special constructor. - { - *os << "CORBA::add_ref (" << be_idt << be_idt_nl - << "const_cast<" << be_idt << be_idt_nl - << node->name () << " *> (" << be_nl - << "_tao_" << bd->local_name () << be_uidt_nl - << ")" << be_uidt << be_uidt_nl - << ");" << be_uidt_nl; - *os << "this->" << bd->local_name () << " = _tao_" - << bd->local_name () << ";"; - } - else - { - *os << "CORBA::add_ref (" << be_idt << be_idt_nl - << "const_cast<" << be_idt << be_idt_nl - << node->name () << " *> (" << be_nl - << "_tao_excp." << bd->local_name () << ".in ()" << be_uidt_nl - << ")" << be_uidt << be_uidt_nl - << ");" << be_uidt_nl; - *os << "this->" << bd->local_name () << " = _tao_excp." - << bd->local_name () << ".in ();"; - } - - return 0; + return this->emit_valuetype_common (node); } int be_visitor_exception_ctor_assign::visit_predefined_type ( @@ -438,3 +388,37 @@ int be_visitor_exception_ctor_assign::visit_typedef (be_typedef *node) this->ctx_->alias (0); return 0; } + +int +be_visitor_exception_ctor_assign::emit_valuetype_common (be_type *node) +{ + TAO_OutStream *os = this->ctx_->stream (); + be_decl *bd = this->ctx_->node (); + + *os << be_nl; + + if (this->ctx_->exception ()) // Special constructor. + { + *os << "CORBA::add_ref (" << be_idt << be_idt_nl + << "const_cast<" << be_idt << be_idt_nl + << node->name () << " *> (" << be_nl + << "_tao_" << bd->local_name () << be_uidt_nl + << ")" << be_uidt << be_uidt_nl + << ");" << be_uidt_nl; + *os << "this->" << bd->local_name () << " = _tao_" + << bd->local_name () << ";"; + } + else + { + *os << "CORBA::add_ref (" << be_idt << be_idt_nl + << "const_cast<" << be_idt << be_idt_nl + << node->name () << " *> (" << be_nl + << "_tao_excp." << bd->local_name () << ".in ()" << be_uidt_nl + << ")" << be_uidt << be_uidt_nl + << ");" << be_uidt_nl; + *os << "this->" << bd->local_name () << " = _tao_excp." + << bd->local_name () << ".in ();"; + } + + return 0; +} diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp index c4281f40ac7..a1f3a3d894c 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp @@ -241,56 +241,19 @@ int be_visitor_exception_ctor::visit_interface_fwd (be_interface_fwd *node) return 0; } -int be_visitor_exception_ctor::visit_valuetype (be_valuetype *node) +int be_visitor_exception_ctor::visit_valuebox (be_valuebox *node) { - TAO_OutStream *os = this->ctx_->stream (); - be_type *bt; - - if (this->ctx_->alias ()) - { - bt = this->ctx_->alias (); - } - else - { - bt = node; - } - - if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH) - { - *os << "const " << bt->nested_type_name (this->ctx_->scope (), " *"); - } - else - { - *os << "const " << bt->name () << " *"; - } + return this->emit_common (node); +} - return 0; +int be_visitor_exception_ctor::visit_valuetype (be_valuetype *node) +{ + return this->emit_common (node); } int be_visitor_exception_ctor::visit_valuetype_fwd (be_valuetype_fwd *node) { - TAO_OutStream *os = this->ctx_->stream (); - be_type *bt; - - if (this->ctx_->alias ()) - { - bt = this->ctx_->alias (); - } - else - { - bt = node; - } - - if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH) - { - *os << "const " << bt->nested_type_name (this->ctx_->scope (), " *"); - } - else - { - *os << "const " << bt->name () << " *"; - } - - return 0; + return this->emit_common (node); } int be_visitor_exception_ctor::visit_predefined_type (be_predefined_type *node) @@ -468,3 +431,29 @@ int be_visitor_exception_ctor::visit_typedef (be_typedef *node) this->ctx_->alias (0); return 0; } + +int be_visitor_exception_ctor::emit_common (be_type *node) +{ + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; + + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } + else + { + bt = node; + } + + if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH) + { + *os << "const " << bt->nested_type_name (this->ctx_->scope (), " *"); + } + else + { + *os << "const " << bt->name () << " *"; + } + + return 0; +} diff --git a/TAO/TAO_IDL/be/be_visitor_field.cpp b/TAO/TAO_IDL/be/be_visitor_field.cpp index 39722316427..1d3606b754e 100644 --- a/TAO/TAO_IDL/be/be_visitor_field.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field.cpp @@ -24,6 +24,7 @@ #include "be_enum.h" #include "be_interface.h" #include "be_interface_fwd.h" +#include "be_valuebox.h" #include "be_valuetype.h" #include "be_valuetype_fwd.h" #include "be_component.h" 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 index 66bf273b6b2..9488c0de507 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp @@ -392,47 +392,15 @@ be_visitor_field_cdr_op_cs::visit_component_fwd (be_component_fwd *node) return this->visit_interface_fwd (node); } +be_visitor_field_cdr_op_cs::visit_valuebox (be_valuebox *) +{ + return this->emit_valuetype_common (); +} + int be_visitor_field_cdr_op_cs::visit_valuetype (be_valuetype *) { - TAO_OutStream *os = this->ctx_->stream (); - be_field *f = this->ctx_->be_node_as_field (); - - if (!f) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_field_cdr_op_cs::" - "visit_valuetype - " - "cannot retrieve field node\n"), - -1); - } - - // Check what is the code generations substate. Are we generating code for - // the in/out operators for our parent or for us? - switch (this->ctx_->sub_state ()) - { - case TAO_CodeGen::TAO_CDR_INPUT: - *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())"; - - break; - case TAO_CodeGen::TAO_CDR_OUTPUT: - *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())"; - - break; - case TAO_CodeGen::TAO_CDR_SCOPE: - // Nothing to be done because a valuetype cannot be declared inside a - // structure. - break; - default: - // Error. - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_field_cdr_op_cs::" - "visit_valuetype - " - "bad sub state\n"), - -1); - } - - return 0; + return this->emit_valuetype_common (); } int @@ -444,16 +412,27 @@ be_visitor_field_cdr_op_cs::visit_eventtype (be_eventtype *node) int be_visitor_field_cdr_op_cs::visit_valuetype_fwd (be_valuetype_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); + return this->emit_valuetype_common (); +} - // Retrieve the field node. +int +be_visitor_field_cdr_op_cs::visit_eventtype_fwd (be_eventtype_fwd *node) +{ + return this->visit_valuetype_fwd (node); +} + + +int +be_visitor_field_cdr_op_cs::emit_valuetype_common (void) +{ + TAO_OutStream *os = this->ctx_->stream (); be_field *f = this->ctx_->be_node_as_field (); - if (f == 0) + if (!f) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_cs::" - "visit_valuetype_fwd - " + "emit_common - " "cannot retrieve field node\n"), -1); } @@ -478,7 +457,7 @@ be_visitor_field_cdr_op_cs::visit_valuetype_fwd (be_valuetype_fwd *) // Error. ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_cs::" - "visit_valuetype_fwd - " + "emit_common - " "bad sub state\n"), -1); } @@ -486,11 +465,6 @@ be_visitor_field_cdr_op_cs::visit_valuetype_fwd (be_valuetype_fwd *) return 0; } -int -be_visitor_field_cdr_op_cs::visit_eventtype_fwd (be_eventtype_fwd *node) -{ - return this->visit_valuetype_fwd (node); -} // Visit predefined type. int diff --git a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp index 8c3669fb306..5a923830956 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp @@ -204,111 +204,37 @@ be_visitor_field_ch::visit_enum (be_enum *node) int be_visitor_field_ch::visit_interface (be_interface *node) { - TAO_OutStream *os = this->ctx_->stream (); - be_type *bt; - - if (this->ctx_->alias ()) - { - bt = this->ctx_->alias (); - } - else - { - bt = node; - } - - // This was a typedefed array. - // ACE_NESTED_CLASS macro generated by nested_type_name - // is necessary if the struct, union, or valuetype containing this - // field was not defined inside a module. In such a case, VC++ - // complains that the non-module scope is not yet fully defined. - UTL_Scope *holds_container = this->ctx_->scope ()->defined_in (); - AST_Decl *hc_decl = ScopeAsDecl (holds_container); - - if (hc_decl->node_type () != AST_Decl::NT_module) - { - *os << bt->nested_type_name (this->ctx_->scope (), "_var"); - } - else - { - *os << bt->name () << "_var"; - } - - return 0; + return this->emit_common (node); } int be_visitor_field_ch::visit_interface_fwd (be_interface_fwd *node) { - TAO_OutStream *os = this->ctx_->stream (); - be_type *bt; - - if (this->ctx_->alias ()) - { - bt = this->ctx_->alias (); - } - else - { - bt = node; - } - - // This was a typedefed array. - // ACE_NESTED_CLASS macro generated by nested_type_name - // is necessary if the struct, union, or valuetype containing this - // field was not defined inside a module. In such a case, VC++ - // complains that the non-module scope is not yet fully defined. - UTL_Scope *holds_container = this->ctx_->scope ()->defined_in (); - AST_Decl *hc_decl = ScopeAsDecl (holds_container); - - if (hc_decl->node_type () != AST_Decl::NT_module) - { - *os << bt->nested_type_name (this->ctx_->scope (), "_var"); - } - else - { - *os << bt->name () << "_var"; - } + return this->emit_common (node); +} - return 0; +int +be_visitor_field_ch::visit_valuebox (be_valuebox *node) +{ + return this->emit_common (node); } int be_visitor_field_ch::visit_valuetype (be_valuetype *node) { - TAO_OutStream *os = this->ctx_->stream (); - be_type *bt; - - if (this->ctx_->alias ()) - { - bt = this->ctx_->alias (); - } - else - { - bt = node; - } - - // This was a typedefed array. - // ACE_NESTED_CLASS macro generated by nested_type_name - // is necessary if the struct, union, or valuetype containing this - // field was not defined inside a module. In such a case, VC++ - // complains that the non-module scope is not yet fully defined. - UTL_Scope *holds_container = this->ctx_->scope ()->defined_in (); - AST_Decl *hc_decl = ScopeAsDecl (holds_container); - - if (hc_decl->node_type () != AST_Decl::NT_module) - { - *os << bt->nested_type_name (this->ctx_->scope (), "_var"); - } - else - { - *os << bt->name () << "_var"; - } - - return 0; + return this->emit_common (node); } int be_visitor_field_ch::visit_valuetype_fwd (be_valuetype_fwd *node) { + return this->emit_common (node); +} + + +int +be_visitor_field_ch::emit_common (be_type *node) +{ TAO_OutStream *os = this->ctx_->stream (); be_type *bt; @@ -321,7 +247,6 @@ be_visitor_field_ch::visit_valuetype_fwd (be_valuetype_fwd *node) bt = node; } - // This was a typedefed array. // ACE_NESTED_CLASS macro generated by nested_type_name // is necessary if the struct, union, or valuetype containing this // field was not defined inside a module. In such a case, VC++ diff --git a/TAO/TAO_IDL/be/be_visitor_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation.cpp index 0d949febac8..6b5b8e35f33 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation.cpp @@ -34,6 +34,7 @@ #include "be_type.h" #include "be_typedef.h" #include "be_union.h" +#include "be_valuebox.h" #include "be_valuetype.h" #include "be_valuetype_fwd.h" #include "be_component.h" diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp index 1ab6279b956..c4d0dd314e0 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp @@ -377,4 +377,23 @@ be_visitor_operation_rettype::visit_home (be_home *node) return this->visit_interface (node); } +int +be_visitor_operation_rettype::visit_valuebox (be_valuebox *node) +{ + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; + + if (this->ctx_->alias ()) + { + // A typedefed return type. + bt = this->ctx_->alias (); + } + else + { + bt = node; + } + *os << "::" << bt->name () << " *"; + + return 0; +} diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_return_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_return_cs.cpp index 28eb42544aa..fa7e91171b3 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_return_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype_return_cs.cpp @@ -80,6 +80,16 @@ be_visitor_operation_rettype_return_cs::visit_interface_fwd (be_interface_fwd *) } int +be_visitor_operation_rettype_return_cs::visit_valuebox (be_valuebox *) +{ + TAO_OutStream *os = this->ctx_->stream (); + + *os << "_tao_retval._retn ()"; + + return 0; +} + +int be_visitor_operation_rettype_return_cs::visit_valuetype (be_valuetype *) { TAO_OutStream *os = this->ctx_->stream (); diff --git a/TAO/TAO_IDL/be/be_visitor_sequence.cpp b/TAO/TAO_IDL/be/be_visitor_sequence.cpp index 281793b4e76..ef93fee6254 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence.cpp @@ -33,6 +33,7 @@ #include "be_union_fwd.h" #include "be_type.h" #include "be_typedef.h" +#include "be_valuebox.h" #include "be_valuetype.h" #include "be_valuetype_fwd.h" #include "be_eventtype.h" diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp index 4c02f8a5598..f1273d74604 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp @@ -141,6 +141,23 @@ be_visitor_sequence_buffer_type::visit_component_fwd (be_component_fwd *node) } int +be_visitor_sequence_buffer_type::visit_valuebox (be_valuebox *node) +{ + TAO_OutStream *os = this->ctx_->stream (); + + if (this->ctx_->state () == TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH) + { + *os << node->nested_type_name (this->ctx_->scope (), " *"); + } + else + { + *os << node->name () << " *"; + } + + return 0; +} + +int be_visitor_sequence_buffer_type::visit_valuetype (be_valuetype *node) { TAO_OutStream *os = this->ctx_->stream (); 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 index 93df5e8a155..87844c3c482 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp @@ -303,6 +303,12 @@ be_visitor_sequence_cdr_op_cs::visit_home (be_home *node) } int +be_visitor_sequence_cdr_op_cs::visit_valuebox (be_valuebox *node) +{ + return this->visit_node (node); +} + +int be_visitor_sequence_cdr_op_cs::visit_valuetype (be_valuetype *node) { return this->visit_node (node); @@ -730,6 +736,7 @@ be_visitor_sequence_cdr_op_cs::visit_node (be_type *bt) case AST_Decl::NT_interface_fwd: case AST_Decl::NT_valuetype: case AST_Decl::NT_valuetype_fwd: + case AST_Decl::NT_valuebox: *os << "_tao_marshal_flag = (strm >> _tao_sequence[i].out ());"; break; @@ -848,6 +855,7 @@ be_visitor_sequence_cdr_op_cs::visit_node (be_type *bt) case AST_Decl::NT_wstring: case AST_Decl::NT_valuetype: case AST_Decl::NT_valuetype_fwd: + case AST_Decl::NT_valuebox: *os << "_tao_marshal_flag = (strm << _tao_sequence[i].in ());"; break; diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_base.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_base.cpp index e4222bf17b5..868f54e6778 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_base.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_base.cpp @@ -102,6 +102,12 @@ be_visitor_sequence_base::visit_interface_fwd (be_interface_fwd *node) } int +be_visitor_sequence_base::visit_valuebox (be_valuebox *node) +{ + return this->visit_node (node); +} + +int be_visitor_sequence_base::visit_valuetype (be_valuetype *node) { return this->visit_node (node); diff --git a/TAO/TAO_IDL/be/be_visitor_tmplinst.cpp b/TAO/TAO_IDL/be/be_visitor_tmplinst.cpp index 3de043eef68..d03fa66ad8d 100644 --- a/TAO/TAO_IDL/be/be_visitor_tmplinst.cpp +++ b/TAO/TAO_IDL/be/be_visitor_tmplinst.cpp @@ -25,6 +25,7 @@ #include "be_component.h" #include "be_component_fwd.h" #include "be_home.h" +#include "be_valuebox.h" #include "be_valuetype.h" #include "be_array.h" #include "be_attribute.h" diff --git a/TAO/TAO_IDL/be/be_visitor_tmplinst/arg_tmplinst.cpp b/TAO/TAO_IDL/be/be_visitor_tmplinst/arg_tmplinst.cpp index be8b8d3aacd..d68c7d6f6f6 100644 --- a/TAO/TAO_IDL/be/be_visitor_tmplinst/arg_tmplinst.cpp +++ b/TAO/TAO_IDL/be/be_visitor_tmplinst/arg_tmplinst.cpp @@ -121,6 +121,47 @@ be_visitor_arg_tmplinst::visit_home (be_home *node) } int +be_visitor_arg_tmplinst::visit_valuebox (be_valuebox *node) +{ + if (this->this_mode_and_dir_generated (node)) + { + return 0; + } + + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl << be_nl + << this->prefix_ << this->linebreak_ << be_idt << be_idt_nl + << "TAO::"; + + this->gen_direction (os); + + *os << "_Object_" << this->S_ << "Argument_T<" << this->linebreak_ + << be_idt << be_idt_nl + << node->name () << " *"; + + switch (this->dir_) + { + case _tao_OUT: + *os << "," << this->linebreak_ << be_nl + << node->name () << "_out"; + break; + case _tao_RET: + *os << "," << this->linebreak_ << be_nl + << node->name () << "_var"; + break; + default: + break; + } + + *os << this->linebreak_ << be_uidt_nl + << ">" << this->suffix_ << be_uidt << be_uidt << be_uidt; + + this->this_mode_and_dir_generated (node, I_TRUE); + return 0; +} + +int be_visitor_arg_tmplinst::visit_valuetype (be_valuetype *node) { if (this->this_mode_and_dir_generated (node)) diff --git a/TAO/TAO_IDL/be/be_visitor_tmplinst/tmplinst_cs.cpp b/TAO/TAO_IDL/be/be_visitor_tmplinst/tmplinst_cs.cpp index 025f45c6b6e..6cb6477f295 100644 --- a/TAO/TAO_IDL/be/be_visitor_tmplinst/tmplinst_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_tmplinst/tmplinst_cs.cpp @@ -163,6 +163,89 @@ be_visitor_tmplinst_cs::visit_interface (be_interface *node) } int +be_visitor_tmplinst_cs::visit_valuebox (be_valuebox *node) +{ + if (this->this_mode_generated (node)) + { + return 0; + } + + TAO_OutStream *os = this->ctx_->stream (); + + // For arg/return type helper template classes. + if (node->seen_in_operation ()) + { + os->gen_ifdef_macro (node->flat_name (), "arg_traits_tmplinst"); + + *os << be_nl << be_nl + << this->prefix_ << this->linebreak_ << be_idt << be_idt_nl + << " TAO::Arg_Traits<" << this->linebreak_ << be_idt << be_idt_nl + << "::" << node->name () << this->linebreak_ << be_uidt_nl + << ">" << this->suffix_ << be_uidt << be_uidt << be_uidt; + + *os << be_nl << be_nl + << this->prefix_ << this->linebreak_ << be_idt << be_idt_nl + << "TAO::Object_Arg_Traits_T<" << this->linebreak_ + << be_idt << be_idt_nl + << "::" << node->name () << " *," << this->linebreak_ << be_nl + << "::" << node->name () << "_var," << this->linebreak_ << be_nl + << "::" << node->name () << "_out," << this->linebreak_ << be_nl + << "TAO::Objref_Traits<" << node->name () << "> " + << this->linebreak_ << be_uidt_nl + << ">" << this->suffix_ << be_uidt << be_uidt << be_uidt; + + os->gen_endif (); + } + + if (node->imported () || !node->is_defined ()) + { + this->this_mode_generated (node, I_TRUE); + return 0; + } + + // For _var and _out template classes. + *os << be_nl << be_nl + << this->prefix_ << this->linebreak_ << be_idt << be_idt_nl + << "TAO::Value_Traits<" << this->linebreak_ << be_idt << be_idt_nl + << node->name () << this->linebreak_ << be_uidt_nl + << ">" << this->suffix_ << be_uidt << be_uidt << be_uidt; + + *os << be_nl << be_nl + << this->prefix_ << this->linebreak_ << be_idt << be_idt_nl + << "TAO_Value_Var_T<" << this->linebreak_ << be_idt << be_idt_nl + << node->name () << this->linebreak_ << be_nl + << be_uidt_nl + << ">" << this->suffix_ << be_uidt << be_uidt_nl << be_uidt_nl + << this->prefix_ << this->linebreak_ << be_idt << be_idt_nl + << "TAO_Value_Out_T<" << this->linebreak_ << be_idt << be_idt_nl + << node->name () << this->linebreak_ << be_nl + << be_uidt_nl + << ">" << this->suffix_ << be_uidt << be_uidt << be_uidt; + + // For Any impl template class. + if (be_global->any_support ()) + { + TAO_OutStream *tmp = os; + + if (be_global->gen_anyop_files ()) + { + os = tao_cg->anyop_source (); + } + + *os << be_nl << be_nl + << this->prefix_ << this->linebreak_ << be_idt << be_idt_nl + << "TAO::Any_Impl_T<" << this->linebreak_ << be_idt << be_idt_nl + << node->name () << this->linebreak_ << be_uidt_nl + << ">" << this->suffix_ << be_uidt << be_uidt << be_uidt; + + os = tmp; + } + + this->this_mode_generated (node, I_TRUE); + return 0; +} + +int be_visitor_tmplinst_cs::visit_valuetype (be_valuetype *node) { if (this->this_mode_generated (node)) diff --git a/TAO/TAO_IDL/be/be_visitor_tmplinst/tmplinst_ss.cpp b/TAO/TAO_IDL/be/be_visitor_tmplinst/tmplinst_ss.cpp index 13f8698eea8..0c9eadb8ac9 100644 --- a/TAO/TAO_IDL/be/be_visitor_tmplinst/tmplinst_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_tmplinst/tmplinst_ss.cpp @@ -101,6 +101,47 @@ be_visitor_tmplinst_ss::visit_interface (be_interface *node) return 0; } +int +be_visitor_tmplinst_ss::visit_valuebox (be_valuebox *node) +{ + if (this->this_mode_generated (node)) + { + return 0; + } + + TAO_OutStream *os = this->ctx_->stream (); + + // For arg/return type helper template classes. + if (node->seen_in_operation ()) + { + os->gen_ifdef_macro (node->flat_name (), "sarg_traits_tmplinst"); + + *os << be_nl << be_nl + << this->prefix_ << " TAO::Arg_Traits< ::" << node->name () + << ">" << this->suffix_; + + *os << be_nl << be_nl + << this->prefix_ << this->linebreak_ << be_idt << be_idt_nl + << "TAO::Object_SArg_Traits_T<" << this->linebreak_ + << be_idt << be_idt_nl + << "::" << node->name () << " *," << this->linebreak_ << be_nl + << "::" << node->name () << "_var," << this->linebreak_ << be_nl + << "::" << node->name () << "_out," << this->linebreak_ << be_uidt_nl + << ">" << this->suffix_ << be_uidt << be_uidt << be_uidt << be_uidt; + + os->gen_endif (); + } + + if (node->imported () || !node->is_defined ()) + { + this->this_mode_generated (node, I_TRUE); + return 0; + } + + this->this_mode_generated (node, I_TRUE); + return 0; +} + int be_visitor_tmplinst_ss::visit_valuetype (be_valuetype *node) { diff --git a/TAO/TAO_IDL/be/be_visitor_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode.cpp index f4bf6396eb0..e8802efb7a0 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode.cpp @@ -35,6 +35,7 @@ #include "be_typedef.h" #include "be_union.h" #include "be_union_branch.h" +#include "be_valuebox.h" #include "be_valuetype.h" #include "be_eventtype.h" #include "be_helper.h" diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp index d3f9f1f322c..bc505b8b116 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp @@ -24,6 +24,25 @@ TAO::be_visitor_alias_typecode::visit_typedef (be_typedef * node) { be_type * const base = be_type::narrow_from_decl (node->base_type ()); + + return this->common (node, base, "tk_alias"); + +} + + +int +TAO::be_visitor_alias_typecode::visit_valuebox (be_valuebox * node) +{ + be_type * const base = be_type::narrow_from_decl (node->boxed_type ()); + + return this->common (node, base, "tk_value_box"); +} + +int +TAO::be_visitor_alias_typecode::common (be_type * node, + be_type * base, + const char * tctype) +{ TAO_OutStream & os = *this->ctx_->stream (); os << be_nl << be_nl @@ -40,7 +59,7 @@ TAO::be_visitor_alias_typecode::visit_typedef (be_typedef * node) { ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("(%N:%l) be_visitor_alias_typecode") - ACE_TEXT ("::visit_typedef) - ") + ACE_TEXT ("::common) - ") ACE_TEXT ("failed to generate base typecode\n")), -1); } @@ -52,15 +71,15 @@ TAO::be_visitor_alias_typecode::visit_typedef (be_typedef * node) << " TAO::Null_RefCount_Policy>" << be_idt_nl << "_tao_tc_" << node->flat_name () << " (" << be_idt_nl - << "CORBA::tk_alias," << be_nl + << "CORBA::" << tctype << "," << be_nl << "\"" << node->repoID () << "\"," << be_nl << "\"" << node->original_local_name () << "\"," << be_nl << "&"; if (this->gen_base_typecode_name (base) != 0) ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("(%N:%l) be_visitor_typecode_defn::") - ACE_TEXT ("visit_sequence - problem generating base ") + ACE_TEXT ("(%N:%l) be_visitor_alias_typecode::") + ACE_TEXT ("common - problem generating base ") ACE_TEXT ("TypeCode name.\n")), -1); diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp index d900dfbbfad..0379aa94344 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp @@ -135,6 +135,12 @@ be_visitor_typecode_decl::visit_union (be_union *node) } int +be_visitor_typecode_decl::visit_valuebox (be_valuebox *node) +{ + return this->visit_type (node); +} + +int be_visitor_typecode_decl::visit_valuetype (be_valuetype *node) { return this->visit_type (node); diff --git a/TAO/TAO_IDL/be/be_visitor_typedef.cpp b/TAO/TAO_IDL/be/be_visitor_typedef.cpp index 2254d18f8fa..1e3ebf45077 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef.cpp @@ -30,6 +30,7 @@ #include "be_type.h" #include "be_typedef.h" #include "be_union.h" +#include "be_valuebox.h" #include "be_valuetype.h" #include "be_extern.h" #include "be_helper.h" diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp index 422aa7496be..0bffbb06837 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp @@ -577,6 +577,42 @@ be_visitor_typedef_ch::visit_union (be_union *node) } int +be_visitor_typedef_ch::visit_valuebox (be_valuebox *node) +{ + TAO_OutStream *os = this->ctx_->stream (); + be_typedef *tdef = this->ctx_->tdef (); + be_decl *scope = this->ctx_->scope (); + be_type *bt; + + // Typedef of a typedef? + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } + else + { + bt = node; + } + + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + // Typedef the object. + *os << "typedef " << bt->nested_type_name (scope) << " " + << tdef->nested_type_name (scope) << ";" << be_nl; + + // Typedef the _var. + *os << "typedef " << bt->nested_type_name (scope, "_var") + << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl; + + // typedef the _out + *os << "typedef " << bt->nested_type_name (scope, "_out") + << " " << tdef->nested_type_name (scope, "_out") << ";" << be_nl; + + return 0; +} + +int be_visitor_typedef_ch::visit_valuetype (be_valuetype *node) { TAO_OutStream *os = this->ctx_->stream (); diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch.cpp index 44d731ea921..80aedbb4775 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch.cpp @@ -28,6 +28,7 @@ #include "be_typedef.h" #include "be_union.h" #include "be_union_branch.h" +#include "be_valuebox.h" #include "be_valuetype.h" #include "be_valuetype_fwd.h" #include "be_helper.h" 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 index bd709da4be1..1caf1471076 100644 --- 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 @@ -402,63 +402,26 @@ be_visitor_union_branch_cdr_op_cs::visit_interface_fwd (be_interface_fwd *node) } int -be_visitor_union_branch_cdr_op_cs::visit_valuetype (be_valuetype *node) +be_visitor_union_branch_cdr_op_cs::visit_valuebox (be_valuebox *node) { - TAO_OutStream *os = this->ctx_->stream (); - - // Retrieve the union_branch node. - be_union_branch *f = this->ctx_->be_node_as_union_branch (); - - if (!f) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_union_branch_cdr_op_cs::" - "visit_valuetype - " - "cannot retrieve union_branch node\n"), - -1); - } - - // Check what is the code generations substate. Are we generating code for - // the in/out operators for our parent or for us? - switch (this->ctx_->sub_state ()) - { - case TAO_CodeGen::TAO_CDR_INPUT: - *os << node->name () << "_var _tao_union_tmp;" << be_nl - << "result = strm >> _tao_union_tmp.inout ();" << be_nl << be_nl - << "if (result)" << be_idt_nl - << "{" << be_idt_nl - << "_tao_union." - << f->local_name () << " (_tao_union_tmp.in ());" << be_nl - << "_tao_union._d (_tao_discriminant);" << be_uidt_nl - << "}" << be_uidt; - - break; - - case TAO_CodeGen::TAO_CDR_OUTPUT: - *os << "result = strm << _tao_union." - << f->local_name () << " ();"; - break; - - case TAO_CodeGen::TAO_CDR_SCOPE: - // Nothing to be done because an interface cannot be declared inside a - // union. - break; - - default: - // Error. - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_union_branch_cdr_op_cs::" - "visit_valuetype - " - "bad sub state\n"), - -1); - } + return this->emit_valuetype_common (node); +} - return 0; +int +be_visitor_union_branch_cdr_op_cs::visit_valuetype (be_valuetype *node) +{ + return this->emit_valuetype_common (node); } int be_visitor_union_branch_cdr_op_cs::visit_valuetype_fwd (be_valuetype_fwd *node) { + return this->emit_valuetype_common (node); +} + +int +be_visitor_union_branch_cdr_op_cs::emit_valuetype_common (be_type *node) +{ TAO_OutStream *os = this->ctx_->stream (); // Retrieve the union_branch node. @@ -468,7 +431,7 @@ be_visitor_union_branch_cdr_op_cs::visit_valuetype_fwd (be_valuetype_fwd *node) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_cdr_op_cs::" - "visit_valuetype_fwd - " + "emit_valuetype_common - " "cannot retrieve union_branch node\n"), -1); } @@ -490,20 +453,20 @@ be_visitor_union_branch_cdr_op_cs::visit_valuetype_fwd (be_valuetype_fwd *node) break; case TAO_CodeGen::TAO_CDR_OUTPUT: - *os << "result = strm << _tao_union." + *os << "result = strm << _tao_union." << f->local_name () << " ();"; break; case TAO_CodeGen::TAO_CDR_SCOPE: - // Nothing to be done because an interface cannot be forward declared - // inside a union. + // Nothing to be done because an interface cannot be declared inside a + // union. break; default: // Error. ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_cdr_op_cs::" - "visit_valuetype_fwd - " + "emit_valuetype_common - " "bad sub state\n"), -1); } diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp index f6e11c113bb..05711795185 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp @@ -237,6 +237,45 @@ be_visitor_union_branch_private_ch::visit_interface_fwd (be_interface_fwd *node) } int +be_visitor_union_branch_private_ch::visit_valuebox (be_valuebox *node) +{ + be_decl *ub = this->ctx_->node (); + be_decl *bu = this->ctx_->scope (); + be_type *bt; + + // Check if we are visiting this node via a visit to a typedef node + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } + else + { + bt = node; + } + + if (!ub || !bu) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_union_branch_private_ch::" + "visit_valuebox - " + "bad context information\n"), + -1); + } + + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl; + + *os << bt->nested_type_name (bu, "_var") + << " *" << ub->local_name () << "_;"; + + return 0; +} + +int be_visitor_union_branch_private_ch::visit_valuetype (be_valuetype *node) { be_decl *ub = this->ctx_->node (); diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp index 1b5a9f15141..3d3b1cbac4d 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp @@ -398,71 +398,15 @@ be_visitor_union_branch_public_assign_cs::visit_interface_fwd ( } int -be_visitor_union_branch_public_assign_cs::visit_valuetype (be_valuetype *node) +be_visitor_union_branch_public_assign_cs::visit_valuebox (be_valuebox *node) { - be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch - be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend - be_type *bt; - - // Check if we are visiting this node via a visit to a typedef node. - if (this->ctx_->alias ()) - { - bt = this->ctx_->alias (); - } - else - { - bt = node; - } - - if (!ub || !bu) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_union_branch_public_assign_cs::" - "visit_valuetype - " - "bad context information\n" - ), -1); - } - - TAO_OutStream *os = this->ctx_->stream (); - - *os << "if (u.u_." << ub->local_name () << "_ == 0)" << be_idt_nl - << "{" << be_idt_nl - << "this->u_." << ub->local_name () << "_ = 0;" << be_uidt_nl - << "}" << be_uidt_nl - << "else" << be_idt_nl - << "{" << be_idt_nl; - - // So the template will work with the macro. - *os << "typedef " - << bt->name () << "_var OBJECT_FIELD;" << be_nl; - *os << "CORBA::add_ref (u.u_." << ub->local_name () - << "_->ptr ());" << be_nl; - - if (this->ctx_->sub_state () == TAO_CodeGen::TAO_UNION_COPY_CONSTRUCTOR) - { - // We are generating the copy constructor. - *os << "ACE_NEW (" << be_idt << be_idt_nl - << "this->u_." << ub->local_name () << "_," << be_nl - << "OBJECT_FIELD (u.u_." << ub->local_name () << "_->ptr ())" - << be_uidt_nl - << ");" << be_uidt << be_uidt_nl; - } - else - { - // We are generating the assignment operator. - *os << "ACE_NEW_RETURN (" << be_idt << be_idt_nl - << "this->u_." << ub->local_name () << "_," << be_nl - << "OBJECT_FIELD (u.u_." << ub->local_name () << "_->ptr ())," - << be_nl - << "*this" << be_uidt_nl - << ");" << be_uidt << be_uidt_nl; - } - - *os << "}" << be_uidt << be_uidt_nl; + return this->emit_valuetype_common (node); +} - return 0; +int +be_visitor_union_branch_public_assign_cs::visit_valuetype (be_valuetype *node) +{ + return this->emit_valuetype_common (node); } int @@ -470,6 +414,12 @@ be_visitor_union_branch_public_assign_cs::visit_valuetype_fwd ( be_valuetype_fwd *node ) { + return this->emit_valuetype_common (node); +} + +int +be_visitor_union_branch_public_assign_cs::emit_valuetype_common (be_type *node) +{ be_union_branch *ub = this->ctx_->be_node_as_union_branch (); // get union branch be_union *bu = @@ -490,7 +440,7 @@ be_visitor_union_branch_public_assign_cs::visit_valuetype_fwd ( { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_assign_cs::" - "visit_valuetype_fwd - " + "emit_valuetype_common - " "bad context information\n" ), -1); } @@ -507,6 +457,8 @@ be_visitor_union_branch_public_assign_cs::visit_valuetype_fwd ( // So the template will work with the macro. *os << "typedef " << bt->name () << "_var OBJECT_FIELD;" << be_nl; + *os << "CORBA::add_ref (u.u_." << ub->local_name () + << "_->ptr ());" << be_nl; if (this->ctx_->sub_state () == TAO_CodeGen::TAO_UNION_COPY_CONSTRUCTOR) { diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp index 90397ea1bf9..3b231d439c8 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp @@ -299,6 +299,49 @@ be_visitor_union_branch_public_ch::visit_interface_fwd (be_interface_fwd *node) } int +be_visitor_union_branch_public_ch::visit_valuebox (be_valuebox *node) +{ + be_decl *ub = this->ctx_->node (); + be_decl *bu = this->ctx_->scope (); + be_type *bt; + + // Check if we are visiting this via a visit to a typedef node. + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } + else + { + bt = node; + } + + if (!ub || !bu) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_union_branch_public_ch::" + "visit_valuebox - " + "bad context information\n"), + -1); + } + + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + // Set method. + *os << be_nl << be_nl + << "void " << ub->local_name () << " (" + << bt->nested_type_name (bu, "*") + << ");" << be_nl; + // Get method. + *os << bt->nested_type_name (bu, "*") << " " << ub->local_name () + << " (void) const;"; + + return 0; +} + +int be_visitor_union_branch_public_ch::visit_valuetype (be_valuetype *node) { be_decl *ub = this->ctx_->node (); diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp index 1dc1f3a6e38..968da978ce8 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp @@ -485,92 +485,26 @@ be_visitor_union_branch_public_ci::visit_interface_fwd (be_interface_fwd *node) } int -be_visitor_union_branch_public_ci::visit_valuetype (be_valuetype *node) +be_visitor_union_branch_public_ci::visit_valuebox (be_valuebox *node) { - be_union_branch *ub = this->ctx_->be_node_as_union_branch (); - be_union *bu = this->ctx_->be_scope_as_union (); - be_type *bt; - - // Check if we are visiting this node via a visit to a typedef node. - if (this->ctx_->alias ()) - { - bt = this->ctx_->alias (); - } - else - { - bt = node; - } - - if (!ub || !bu) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_union_branch_public_ci::" - "visit_valuetype - " - "bad context information\n"), - -1); - } - - TAO_OutStream *os = this->ctx_->stream (); - - // Set method. - *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - - *os << "// Accessor to set the member." << be_nl - << "ACE_INLINE" << be_nl - << "void" << be_nl - << bu->name () << "::" << ub->local_name () << " (" << bt->name () - << " *val)" << be_nl - << "{" << be_idt_nl - << "// Set the discriminant value." << be_nl - << "this->_reset ("; - - if (ub->label ()->label_kind () == AST_UnionLabel::UL_label) - { - ub->gen_label_value (os); - - *os << ", 0);" << be_nl - << "this->disc_ = "; - - ub->gen_label_value (os); - } - // Default label. - else - { - ub->gen_default_label_value (os, bu); - - *os << ", 0);" << be_nl - << "this->disc_ = "; - - ub->gen_default_label_value (os, bu); - } - - *os << ";" << be_nl - << "CORBA::add_ref (val);" << be_nl - << "typedef " - << bt->nested_type_name (bu, "_var") - << " OBJECT_FIELD;" << be_nl - << "ACE_NEW (" << be_idt << be_idt_nl - << "this->u_." << ub->local_name () << "_," << be_nl - << "OBJECT_FIELD (val)" << be_uidt_nl - << ");" << be_uidt << be_uidt_nl - << "}" << be_nl << be_nl; - - // Get method. - *os << "// Retrieve the member." << be_nl - << "ACE_INLINE" << be_nl - << bt->name () << "* " << be_nl - << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl - << "{" << be_idt_nl - << "return this->u_." << ub->local_name () << "_->ptr ();" << be_uidt_nl - << "}"; + return this->emit_valuetype_common (node); +} - return 0; +int +be_visitor_union_branch_public_ci::visit_valuetype (be_valuetype *node) +{ + return this->emit_valuetype_common (node); } int be_visitor_union_branch_public_ci::visit_valuetype_fwd (be_valuetype_fwd *node) { + return this->emit_valuetype_common (node); +} + +int +be_visitor_union_branch_public_ci::emit_valuetype_common (be_type *node) +{ be_union_branch *ub = this->ctx_->be_node_as_union_branch (); be_union *bu = this->ctx_->be_scope_as_union (); be_type *bt; @@ -589,7 +523,7 @@ be_visitor_union_branch_public_ci::visit_valuetype_fwd (be_valuetype_fwd *node) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_ci::" - "visit_valuetype_fwd - " + "emit_valuetype_common - " "bad context information\n"), -1); } @@ -643,7 +577,7 @@ be_visitor_union_branch_public_ci::visit_valuetype_fwd (be_valuetype_fwd *node) // Get method. *os << "// Retrieve the member." << be_nl << "ACE_INLINE" << be_nl - << bt->name () << "_ptr " << be_nl + << bt->name () << "* " << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl << "return this->u_." << ub->local_name () << "_->ptr ();" << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp index 059e1c17110..c8103180e89 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp @@ -241,6 +241,34 @@ be_visitor_union_branch_public_reset_cs::visit_interface_fwd (be_interface_fwd * } int +be_visitor_union_branch_public_reset_cs::visit_valuebox (be_valuebox *) +{ + be_union_branch *ub = + this->ctx_->be_node_as_union_branch (); + be_union *bu = + this->ctx_->be_scope_as_union (); + + if (!ub || !bu) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_union_branch_public_reset_cs::" + "visit_valuebox - " + "bad context information\n"), + -1); + } + + TAO_OutStream *os = this->ctx_->stream (); + + *os << "delete this->u_." + << ub->local_name () << "_;" << be_nl + << "this->u_." << ub->local_name () + << "_ = 0;" << be_nl + << "break;" << be_uidt_nl; + + return 0; +} + +int be_visitor_union_branch_public_reset_cs::visit_valuetype (be_valuetype *) { be_union_branch *ub = diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype.cpp index cb3dd343aec..c17934df575 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype.cpp @@ -41,6 +41,7 @@ #include "be_typedef.h" #include "be_union.h" #include "be_union_fwd.h" +#include "be_valuebox.h" #include "be_valuetype.h" #include "be_valuetype_fwd.h" #include "be_helper.h" diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp index 7a18a5cd7e3..e4e89802204 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_cs.cpp @@ -332,7 +332,13 @@ be_visitor_valuetype_field_cdr_cs::visit_interface_fwd (be_interface_fwd *node) } int -be_visitor_valuetype_field_cdr_cs::visit_valuetype (be_valuetype *) +be_visitor_valuetype_field_cdr_cs::visit_valuebox (be_valuebox * node) +{ + return this->valuetype_common (node); +} + +int +be_visitor_valuetype_field_cdr_cs::valuetype_common (be_type *) { TAO_OutStream *os = this->ctx_->stream (); @@ -377,6 +383,12 @@ be_visitor_valuetype_field_cdr_cs::visit_valuetype (be_valuetype *) } int +be_visitor_valuetype_field_cdr_cs::visit_valuetype (be_valuetype * node) +{ + return this->valuetype_common (node); +} + +int be_visitor_valuetype_field_cdr_cs::visit_valuetype_fwd (be_valuetype_fwd *) { TAO_OutStream *os = this->ctx_->stream (); diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp index 1644b35c959..ed9f295a3db 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp @@ -297,6 +297,49 @@ be_visitor_valuetype_field_ch::visit_interface_fwd (be_interface_fwd *node) } int +be_visitor_valuetype_field_ch::visit_valuebox (be_valuebox *node) +{ + be_decl *ub = this->ctx_->node (); + be_decl *bu = this->ctx_->scope (); + be_type *bt; + + // Check if we are visiting this via a visit to a typedef node. + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } + else + { + bt = node; + } + + if (!ub || !bu) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_valuetype_field_ch::" + "visit_valuebox - " + "bad context information\n"), + -1); + } + + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + // Set method. + *os << pre_op () << "void " << ub->local_name () << " (" + << bt->name () << " *" + << ")" << post_op () << be_nl; + // Get method. + *os << pre_op () + << bt->name () << " *" << ub->local_name () + << " (void) const" << post_op (); + + return 0; +} + +int be_visitor_valuetype_field_ch::visit_valuetype (be_valuetype *node) { be_decl *ub = this->ctx_->node (); diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp index c608bcf6a4b..32e15c03e76 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp @@ -400,7 +400,13 @@ be_visitor_valuetype_field_cs::visit_interface_fwd (be_interface_fwd *node) } int -be_visitor_valuetype_field_cs::visit_valuetype (be_valuetype *node) +be_visitor_valuetype_field_cs::visit_valuebox (be_valuebox *node) +{ + return this->valuetype_common (node); +} + +int +be_visitor_valuetype_field_cs::valuetype_common (be_type *node) { be_decl *ub = this->ctx_->node (); be_valuetype *bu = be_valuetype::narrow_from_decl (this->ctx_->scope ()); @@ -468,6 +474,12 @@ be_visitor_valuetype_field_cs::visit_valuetype (be_valuetype *node) } int +be_visitor_valuetype_field_cs::visit_valuetype (be_valuetype *node) +{ + return this->valuetype_common (node); +} + +int be_visitor_valuetype_field_cs::visit_eventtype (be_eventtype *node) { return this->visit_valuetype (node); diff --git a/TAO/TAO_IDL/be_include/be_visitor_arg_traits.h b/TAO/TAO_IDL/be_include/be_visitor_arg_traits.h index a88ddd5d900..ed2320152ac 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_arg_traits.h +++ b/TAO/TAO_IDL/be_include/be_visitor_arg_traits.h @@ -73,6 +73,8 @@ public: virtual int visit_home (be_home *node); + virtual int visit_valuebox (be_valuebox *node); + private: idl_bool generated (be_decl *node) const; diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/arglist.h b/TAO/TAO_IDL/be_include/be_visitor_argument/arglist.h index eea8d3da9b2..6aa736fd7b7 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/arglist.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/arglist.h @@ -103,6 +103,12 @@ public: virtual int visit_home (be_home *node); // visit home + + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox + + private: + int emit_common (be_type *node); }; #endif /* _BE_VISITOR_ARGUMENT_ARGLIST_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/invoke_cs.h b/TAO/TAO_IDL/be_include/be_visitor_argument/invoke_cs.h index 85e7bb968c7..88a7c7f4c0c 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/invoke_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/invoke_cs.h @@ -59,6 +59,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox + virtual int visit_valuetype (be_valuetype *node); // visit valuetype @@ -96,6 +99,11 @@ public: virtual int visit_home (be_home *node); // visit home + + private: + int emit_common (void); + int emit_common2 (be_type *node); + }; #endif /* _BE_VISITOR_ARGUMENT_INVOKE_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/marshal_ss.h b/TAO/TAO_IDL/be_include/be_visitor_argument/marshal_ss.h index 20de8d09bae..80d2b051a08 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/marshal_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/marshal_ss.h @@ -59,6 +59,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox + virtual int visit_valuetype (be_valuetype *node); // visit valuetype @@ -97,6 +100,10 @@ public: virtual int visit_home (be_home *node); // visit home + + private: + int emit_common (void); + int emit_common2 (be_type *node); }; #endif /* _BE_VISITOR_ARGUMENT_MARSHAL_SS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/upcall_ss.h b/TAO/TAO_IDL/be_include/be_visitor_argument/upcall_ss.h index f539efe24e6..be2c2bf1515 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/upcall_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/upcall_ss.h @@ -59,6 +59,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox + virtual int visit_valuetype (be_valuetype *node); // visit valuetype @@ -94,6 +97,10 @@ public: virtual int visit_eventtype_fwd (be_eventtype_fwd *node); // visit a forward declared eventtype node + + private: + int emit_common (void); + int emit_common2 (be_type *node); }; #endif /* _BE_VISITOR_ARGUMENT_UPCALL_SS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/vardecl_ss.h b/TAO/TAO_IDL/be_include/be_visitor_argument/vardecl_ss.h index 502edf093b6..afb6f9e2f78 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/vardecl_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/vardecl_ss.h @@ -59,6 +59,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox + virtual int visit_valuetype (be_valuetype *node); // visit valuetype @@ -94,6 +97,11 @@ public: virtual int visit_eventtype_fwd (be_eventtype_fwd *node); // visit a forward declared eventtype node + + private: + int emit_common (be_type *node); + int emit_common2 (be_type *node); + }; #endif /* _BE_VISITOR_ARGUMENT_VARDECL_SS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_array/array.h b/TAO/TAO_IDL/be_include/be_visitor_array/array.h index a6d9fd9832b..f106b205128 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_array/array.h +++ b/TAO/TAO_IDL/be_include/be_visitor_array/array.h @@ -56,6 +56,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit an interface forward node + virtual int visit_valuebox (be_valuebox *node); + // visit a valuebox + virtual int visit_valuetype (be_valuetype *node); // visit a valuetype @@ -84,6 +87,10 @@ protected: int visit_node (be_type *); // helper that does the common job + + int emit_common (be_type *node); + // helper that does the common job + }; #endif /* _BE_VISITOR_ARRAY_ARRAY_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 index ece1aa1b0d5..85d597071ec 100644 --- 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 @@ -62,6 +62,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit an interface forward node + virtual int visit_valuebox (be_valuebox *node); + // visit a valuebox + virtual int visit_valuetype (be_valuetype *node); // visit a valuetype diff --git a/TAO/TAO_IDL/be_include/be_visitor_exception/ctor.h b/TAO/TAO_IDL/be_include/be_visitor_exception/ctor.h index ce696bb600a..bdb52021a4e 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_exception/ctor.h +++ b/TAO/TAO_IDL/be_include/be_visitor_exception/ctor.h @@ -60,6 +60,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox + virtual int visit_valuetype (be_valuetype *node); // visit valuetype @@ -84,6 +87,9 @@ public: virtual int visit_typedef (be_typedef *node); // visit the typedef type +private: + int emit_common (be_type *node); + }; #endif /* _BE_VISITOR_EXCEPTION_CTOR_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_exception/ctor_assign.h b/TAO/TAO_IDL/be_include/be_visitor_exception/ctor_assign.h index e5f215fc179..ab1e501afe8 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_exception/ctor_assign.h +++ b/TAO/TAO_IDL/be_include/be_visitor_exception/ctor_assign.h @@ -58,6 +58,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox + virtual int visit_valuetype (be_valuetype *node); // visit valuetype @@ -82,6 +85,10 @@ public: virtual int visit_typedef (be_typedef *node); // visit the typedef type +private: + int emit_valuetype_common (be_type *node); + + }; #endif /* _BE_VISITOR_EXCEPTION_CTOR_ASSIGN_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 index 049f9afd71a..37b2f217116 100644 --- 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 @@ -49,6 +49,7 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); virtual int visit_component (be_component *node); virtual int visit_component_fwd (be_component_fwd *node); + virtual int visit_valuebox (be_valuebox *node); virtual int visit_valuetype (be_valuetype *node); virtual int visit_valuetype_fwd (be_valuetype_fwd *node); virtual int visit_eventtype (be_eventtype *node); @@ -59,6 +60,9 @@ public: virtual int visit_structure (be_structure *node); virtual int visit_typedef (be_typedef *node); virtual int visit_union (be_union *node); + + private: + int emit_valuetype_common (void); }; class be_visitor_cdr_op_field_decl : public be_visitor_scope diff --git a/TAO/TAO_IDL/be_include/be_visitor_field/field_ch.h b/TAO/TAO_IDL/be_include/be_visitor_field/field_ch.h index d3da6023441..5786bd19c6c 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_field/field_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_field/field_ch.h @@ -55,6 +55,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward type + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox type + virtual int visit_valuetype (be_valuetype *node); // visit valuetype type @@ -90,6 +93,9 @@ public: virtual int visit_eventtype_fwd (be_eventtype_fwd *node); // visit a forward declared eventtype node + + private: + int emit_common (be_type *node); }; #endif /* _BE_VISITOR_FIELD_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype.h b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype.h index ee4b2792e64..056b90f6498 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype.h @@ -96,6 +96,9 @@ public: int visit_home (be_home *node); // visit a component home node + + int visit_valuebox (be_valuebox *node); + // visit a valuebox node }; #endif /* _BE_VISITOR_OPERATION_RETTYPE_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_return_cs.h b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_return_cs.h index 9e46bb99474..eec65ea8f52 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_return_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_return_cs.h @@ -55,6 +55,9 @@ public: int visit_interface_fwd (be_interface_fwd *node); // visit an interface node + int visit_valuebox (be_valuebox *node); + // visit a valuebox node + int visit_valuetype (be_valuetype *node); // visit valuetype diff --git a/TAO/TAO_IDL/be_include/be_visitor_sequence/buffer_type.h b/TAO/TAO_IDL/be_include/be_visitor_sequence/buffer_type.h index bd8c6a15501..54c7bc051e1 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_sequence/buffer_type.h +++ b/TAO/TAO_IDL/be_include/be_visitor_sequence/buffer_type.h @@ -47,6 +47,7 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); virtual int visit_component (be_component *node); virtual int visit_component_fwd (be_component_fwd *node); + virtual int visit_valuebox (be_valuebox *node); virtual int visit_valuetype (be_valuetype *node); virtual int visit_valuetype_fwd (be_valuetype_fwd *node); virtual int visit_eventtype (be_eventtype *node); 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 index 1dfa22ff362..eecfd9d0a74 100644 --- 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 @@ -70,6 +70,9 @@ public: virtual int visit_home (be_home *node); // visit a home + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox + virtual int visit_valuetype (be_valuetype *node); // visit a valuetype diff --git a/TAO/TAO_IDL/be_include/be_visitor_sequence/sequence_base.h b/TAO/TAO_IDL/be_include/be_visitor_sequence/sequence_base.h index aa27936a665..5f8305d0492 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_sequence/sequence_base.h +++ b/TAO/TAO_IDL/be_include/be_visitor_sequence/sequence_base.h @@ -51,6 +51,7 @@ public: virtual int visit_predefined_type (be_predefined_type *node); virtual int visit_interface (be_interface *node); virtual int visit_interface_fwd (be_interface_fwd *node); + virtual int visit_valuebox (be_valuebox *node); virtual int visit_valuetype (be_valuetype *node); virtual int visit_valuetype_fwd (be_valuetype_fwd *node); virtual int visit_structure (be_structure *node); diff --git a/TAO/TAO_IDL/be_include/be_visitor_tmplinst/arg_tmplinst.h b/TAO/TAO_IDL/be_include/be_visitor_tmplinst/arg_tmplinst.h index 0d73080775c..e83942673e9 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_tmplinst/arg_tmplinst.h +++ b/TAO/TAO_IDL/be_include/be_visitor_tmplinst/arg_tmplinst.h @@ -39,6 +39,8 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); + virtual int visit_valuebox (be_valuebox *node); + virtual int visit_valuetype (be_valuetype *node); virtual int visit_component (be_component *node); diff --git a/TAO/TAO_IDL/be_include/be_visitor_tmplinst/tmplinst_cs.h b/TAO/TAO_IDL/be_include/be_visitor_tmplinst/tmplinst_cs.h index 6418735b603..220dc86bb20 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_tmplinst/tmplinst_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_tmplinst/tmplinst_cs.h @@ -38,6 +38,8 @@ public: virtual int visit_interface (be_interface *node); + virtual int visit_valuebox (be_valuebox *node); + virtual int visit_valuetype (be_valuetype *node); virtual int visit_operation (be_operation *node); diff --git a/TAO/TAO_IDL/be_include/be_visitor_tmplinst/tmplinst_ss.h b/TAO/TAO_IDL/be_include/be_visitor_tmplinst/tmplinst_ss.h index dd0c0e28cb9..2954005783d 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_tmplinst/tmplinst_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_tmplinst/tmplinst_ss.h @@ -36,6 +36,8 @@ public: virtual int visit_interface (be_interface *node); + virtual int visit_valuebox (be_valuebox *node); + virtual int visit_valuetype (be_valuetype *node); virtual int visit_operation (be_operation *node); diff --git a/TAO/TAO_IDL/be_include/be_visitor_typecode/alias_typecode.h b/TAO/TAO_IDL/be_include/be_visitor_typecode/alias_typecode.h index 51ea1390de4..6dffd3cb904 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typecode/alias_typecode.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typecode/alias_typecode.h @@ -43,6 +43,14 @@ namespace TAO */ virtual int visit_typedef (be_typedef * node); + /// Visit a valuebox. + virtual int visit_valuebox (be_valuebox * node); + + private: + int common (be_type * node, + be_type * base, + const char * tctype); + }; } diff --git a/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_decl.h b/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_decl.h index 122d59eea0d..e1d0504dc10 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_decl.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_decl.h @@ -75,6 +75,9 @@ public: virtual int visit_union (be_union *node); // visit a union + virtual int visit_valuebox (be_valuebox *node); + // visit a valuetype + virtual int visit_valuetype (be_valuetype *node); // visit a valuetype diff --git a/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_ch.h b/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_ch.h index 9be60bea4a8..e220629cac6 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_ch.h @@ -74,6 +74,9 @@ public: virtual int visit_union (be_union *node); // visit a union + virtual int visit_valuebox (be_valuebox *node); + // visit a valuebox + virtual int visit_valuetype (be_valuetype *node); // visit a valuetype }; 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 index 13ed612df4f..65b415d8637 100644 --- 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 @@ -47,6 +47,7 @@ public: virtual int visit_enum (be_enum *node); virtual int visit_interface (be_interface *node); virtual int visit_interface_fwd (be_interface_fwd *node); + virtual int visit_valuebox (be_valuebox *node); virtual int visit_valuetype (be_valuetype *node); virtual int visit_valuetype_fwd (be_valuetype_fwd *node); virtual int visit_predefined_type (be_predefined_type *node); @@ -58,6 +59,9 @@ public: virtual int explicit_default (void); // extra code generation for an explicit default case + + private: + int emit_valuetype_common (be_type *node); }; #endif /* _BE_VISITOR_UNION_BRANCH_CDR_OP_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_union_branch/private_ch.h b/TAO/TAO_IDL/be_include/be_visitor_union_branch/private_ch.h index 4d83cabea7d..ed8ad92aba1 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_union_branch/private_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_union_branch/private_ch.h @@ -59,6 +59,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward type + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox type + virtual int visit_valuetype (be_valuetype *node); // visit interface type diff --git a/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_assign_cs.h b/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_assign_cs.h index 731ecad3b2d..26316a18401 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_assign_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_assign_cs.h @@ -58,6 +58,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward type + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox type + virtual int visit_valuetype (be_valuetype *node); // visit interface type @@ -82,6 +85,9 @@ public: virtual int visit_union (be_union *node); // visit union type +private: + int emit_valuetype_common (be_type *node); + }; #endif /* _BE_VISITOR_UNION_BRANCH_PUBLIC_ASSIGN_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ch.h b/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ch.h index 93506c700ec..393d36ae388 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ch.h @@ -59,6 +59,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward type + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox type + virtual int visit_valuetype (be_valuetype *node); // visit valuetype type diff --git a/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ci.h b/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ci.h index d492157bd99..47203786b7e 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ci.h +++ b/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ci.h @@ -58,6 +58,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward type + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox type + virtual int visit_valuetype (be_valuetype *node); // visit value type @@ -82,6 +85,9 @@ public: virtual int visit_union (be_union *node); // visit union type +private: + int emit_valuetype_common (be_type *node); + }; #endif /* _BE_VISITOR_UNION_BRANCI_PUBLIC_CI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_reset_cs.h b/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_reset_cs.h index 695604da6c2..9ef1c92d3f0 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_reset_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_reset_cs.h @@ -58,6 +58,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward type + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox type + virtual int visit_valuetype (be_valuetype *node); // visit interface type diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/field_cdr_cs.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/field_cdr_cs.h index 8ed42da9295..628aeefb8ee 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/field_cdr_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype/field_cdr_cs.h @@ -57,6 +57,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward type + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox type + virtual int visit_valuetype (be_valuetype *node); virtual int visit_valuetype_fwd (be_valuetype_fwd *node); @@ -92,6 +95,10 @@ public: // visit union type const char *pre_, *post_; + +private: + int valuetype_common (be_type *); + }; class be_visitor_valuetype_field_cdr_decl : public be_visitor_scope diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/field_ch.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/field_ch.h index 7da1a89323c..05ac5ba7e0c 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/field_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype/field_ch.h @@ -59,6 +59,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward type + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox type + virtual int visit_valuetype (be_valuetype *node); virtual int visit_eventtype (be_eventtype *node); diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/field_cs.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/field_cs.h index ad1a8d91e62..1699deef3d9 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/field_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype/field_cs.h @@ -59,6 +59,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward type + virtual int visit_valuebox (be_valuebox *node); + // visit valuebox type + virtual int visit_valuetype (be_valuetype *node); virtual int visit_eventtype (be_eventtype *node); @@ -93,6 +96,8 @@ public: idl_bool in_obv_space_; private: const char *pre_op_; + + int valuetype_common (be_type *node); }; #endif /* _BE_VISITOR_VALUETYPE_FIELD_CS_H_ */ |