summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Mitz <mitza@objectcomputing.com>2022-06-17 14:26:36 -0600
committerGitHub <noreply@github.com>2022-06-17 14:26:36 -0600
commit02f596826364c186961e2d3129e6a14a687382f2 (patch)
treeac21af4d943928354140d361d543a0a4940f7506
parent037729a87eee3d987f3f45d8fc77c138b83b343d (diff)
parent70857a74b9bd658a68b902a0a79abf83a7dea1bb (diff)
downloadATCD-02f596826364c186961e2d3129e6a14a687382f2.tar.gz
Merge pull request #1860 from mitza-oci/valuetype-vn-tao2
[TAO 2] TAO_IDL updates for valuetypes and versioned namespaces
-rw-r--r--TAO/TAO_IDL/be/be_codegen.cpp11
-rw-r--r--TAO/TAO_IDL/be/be_util.cpp5
-rw-r--r--TAO/TAO_IDL/be/be_valuetype.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp158
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp22
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp133
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp41
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp31
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_valuetype/marshal_cs.h2
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_cs.h2
-rw-r--r--TAO/tests/IDL_Test/Versioned_Namespace/TestVersionedNamespace.idl17
-rw-r--r--TAO/tests/IDL_Test/Versioned_Namespace/UserVersionedNamespace.h2
-rw-r--r--TAO/tests/IDL_Test/Versioned_Namespace/Versioned_Namespace.mpc7
13 files changed, 282 insertions, 155 deletions
diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp
index efd8d1f0cc2..594805394df 100644
--- a/TAO/TAO_IDL/be/be_codegen.cpp
+++ b/TAO/TAO_IDL/be/be_codegen.cpp
@@ -332,7 +332,16 @@ TAO_CodeGen::start_client_header (const char *fname)
// Begin versioned namespace support after initial headers have been
// included, but before the inline file and post include
// directives.
- *this->client_header_ << be_global->versioning_begin ();
+ //
+ // Just for the client header, which is included first,
+ // the versioned namespace is opened, closed, and opened again.
+ // This is needed because tao_idl will generate code as if there is no
+ // versioned namespace wrapping the mapped types. The 'using namespace'
+ // that appears in the END macro allows these types to be referenced from
+ // the global namespace.
+ *this->client_header_ << be_global->versioning_begin ()
+ << be_global->versioning_end ()
+ << be_global->versioning_begin ();
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_util.cpp b/TAO/TAO_IDL/be/be_util.cpp
index 5b7d379ad4a..ebd2a5a0ce5 100644
--- a/TAO/TAO_IDL/be/be_util.cpp
+++ b/TAO/TAO_IDL/be/be_util.cpp
@@ -519,10 +519,6 @@ be_util::usage (void)
ACE_TEXT (" -Wb,obv_opt_accessor\t\t\t\toptimizes access to base class ")
ACE_TEXT ("data in valuetypes\n")
));
-#if (defined (ACE_HAS_VERSIONED_NAMESPACE) \
- && ACE_HAS_VERSIONED_NAMESPACE == 1) \
- || (defined (TAO_HAS_VERSIONED_NAMESPACE) \
- && TAO_HAS_VERSIONED_NAMESPACE == 1)
ACE_DEBUG ((
LM_DEBUG,
ACE_TEXT (" -Wb,versioning_begin\t\t\tSet text that opens a ")
@@ -538,7 +534,6 @@ be_util::usage (void)
ACE_TEXT (" -Wb,versioning_include\t\t\tSet text that will be used as include for ")
ACE_TEXT ("a \"versioned\" namespace\n")
));
-#endif /* ACE_HAS_VERSIONED_NAMESPACE || TAO_HAS_VERSIONED_NAMESPACE */
ACE_DEBUG ((
LM_DEBUG,
ACE_TEXT (" -Wb,no_fixed_err\t\t\tDon't generate an error when the fixed")
diff --git a/TAO/TAO_IDL/be/be_valuetype.cpp b/TAO/TAO_IDL/be/be_valuetype.cpp
index db81c651f1a..ba78666b78d 100644
--- a/TAO/TAO_IDL/be/be_valuetype.cpp
+++ b/TAO/TAO_IDL/be/be_valuetype.cpp
@@ -507,6 +507,9 @@ be_valuetype::gen_helper_stubs (char *, char *)
TAO_INSERT_COMMENT (os);
+ *os << be_nl
+ << be_global->core_versioning_begin ();
+
*os << "void" << be_nl
<< "CORBA::add_ref (" << this->full_name () << " * vt)" << be_nl
<< "{" << be_idt_nl
@@ -525,6 +528,9 @@ be_valuetype::gen_helper_stubs (char *, char *)
<< "}" << be_uidt << be_uidt_nl
<< "}";
+ *os << be_nl
+ << be_global->core_versioning_end () << be_nl;
+
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp
index d84d7e3feff..5dd52bc5db7 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp
@@ -24,38 +24,17 @@ be_visitor_valuetype_marshal_cs::~be_visitor_valuetype_marshal_cs (void)
}
int
-be_visitor_valuetype_marshal_cs::visit_valuetype (be_valuetype *node)
+be_visitor_valuetype_marshal_cs::marshal_state (be_valuetype *node)
{
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
-
- TAO_INSERT_COMMENT (os);
-
- *os << "::CORBA::Boolean" << be_nl;
+ TAO_OutStream *const os = this->ctx_->stream ();
- this->class_name (node, os);
-
- *os << "::_tao_marshal_state (TAO_OutputCDR &";
-
- be_valuetype *inh = node->statefull_inherit ();
-
- // If the valuetype has no fields, and no stateful inherit,
- // the stream arg is unused.
- if (inh != 0 || node->data_members_count () > 0)
+ if (!be_global->cdr_support ())
{
- *os << "strm";
- }
-
- *os << ", TAO_ChunkInfo&";
- // If the valuetype has no fields, and no stateful inherit,
- // the chunking helper arg is unused.
- if (inh != 0 || node->data_members_count () > 0)
- {
- *os << "ci";
+ *os << "return false;" << be_uidt_nl << be_nl;
+ return 0;
}
- *os << ") const" << be_nl
- << "{" << be_idt_nl;
+ be_valuetype *const inh = node->statefull_inherit ();
if (inh)
{
@@ -104,9 +83,8 @@ be_visitor_valuetype_marshal_cs::visit_valuetype (be_valuetype *node)
*os << "return false;" << be_uidt_nl << be_nl;
*os << "CORBA::Boolean const ret = " << be_idt << be_idt_nl;
- // All we have to do is to visit the scope and generate code.
- this->gen_fields (node,
- *this->ctx_);
+ // All we have to do is to visit the scope and generate code.
+ this->gen_fields (node, *this->ctx_);
*os << ";" << be_uidt << be_uidt_nl;
@@ -123,34 +101,21 @@ be_visitor_valuetype_marshal_cs::visit_valuetype (be_valuetype *node)
}
*os << "return true;" << be_uidt_nl;
- *os << "}" << be_nl_2;
-
- // Set the substate as generating code for the input operator.
- this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_INPUT);
-
- *os << "::CORBA::Boolean" << be_nl;
-
- this->class_name (node, os);
-
- *os << "::_tao_unmarshal_state (TAO_InputCDR &";
+ return 0;
+}
- // If the valuetype has no fields, and no stateful inherit,
- // the stream arg is unused.
- if (inh != 0 || node->data_members_count () > 0)
- {
- *os << "strm";
- }
+int
+be_visitor_valuetype_marshal_cs::unmarshal_state (be_valuetype *node)
+{
+ TAO_OutStream *const os = this->ctx_->stream ();
- *os << ", TAO_ChunkInfo&";
- // If the valuetype has no fields, and no stateful inherit,
- // the chunking helper arg is unused.
- if (inh != 0 || node->data_members_count () > 0)
+ if (!be_global->cdr_support ())
{
- *os << "ci";
+ *os << "return false;" << be_uidt_nl << be_nl;
+ return 0;
}
- *os << ")" << be_nl
- << "{" << be_idt_nl;
+ be_valuetype *const inh = node->statefull_inherit ();
if (inh)
{
@@ -179,6 +144,7 @@ be_visitor_valuetype_marshal_cs::visit_valuetype (be_valuetype *node)
}
}
+ be_visitor_context new_ctx = *this->ctx_;
be_visitor_valuetype_field_cdr_decl field_in_cdr (&new_ctx);
if (field_in_cdr.visit_scope (node) == -1)
@@ -197,9 +163,8 @@ be_visitor_valuetype_marshal_cs::visit_valuetype (be_valuetype *node)
*os << "return false;" << be_uidt_nl << be_nl;
*os << "CORBA::Boolean const ret = " << be_idt << be_idt_nl;
- // All we have to do is to visit the scope and generate code.
- this->gen_fields (node,
- *this->ctx_);
+ // All we have to do is to visit the scope and generate code.
+ this->gen_fields (node, *this->ctx_);
*os << ";" << be_uidt << be_uidt_nl;
@@ -212,8 +177,89 @@ be_visitor_valuetype_marshal_cs::visit_valuetype (be_valuetype *node)
}
else
*os << "return true;";
+ return 0;
+}
+
+int
+be_visitor_valuetype_marshal_cs::visit_valuetype (be_valuetype *node)
+{
+ TAO_OutStream *os = this->ctx_->stream ();
+ this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
+
+ TAO_INSERT_COMMENT (os);
+
+ *os << "::CORBA::Boolean" << be_nl;
+
+ this->class_name (node, os);
+
+ *os << "::_tao_marshal_state (TAO_OutputCDR &";
+
+ be_valuetype *inh = node->statefull_inherit ();
+
+ // If the valuetype has no fields, and no stateful inherit,
+ // the stream arg is unused.
+ bool const named_args = be_global->cdr_support () && (inh != nullptr || node->data_members_count () > 0);
+
+ if (named_args)
+ {
+ *os << "strm";
+ }
+
+ *os << ", TAO_ChunkInfo &";
+
+ if (named_args)
+ {
+ *os << "ci";
+ }
+
+ *os << ") const" << be_nl
+ << "{" << be_idt_nl;
+
+ int const marshal_error = this->marshal_state (node);
+ if (marshal_error)
+ {
+ return marshal_error;
+ }
+
+ *os << "}" << be_nl_2;
+
+ // Set the substate as generating code for the input operator.
+ this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_INPUT);
+
+ *os << "::CORBA::Boolean" << be_nl;
+
+ this->class_name (node, os);
+
+ *os << "::_tao_unmarshal_state (TAO_InputCDR &";
+
+ if (named_args)
+ {
+ *os << "strm";
+ }
+
+ *os << ", TAO_ChunkInfo &";
+
+ if (named_args)
+ {
+ *os << "ci";
+ }
+
+ *os << ")" << be_nl
+ << "{" << be_idt_nl;
+
+ int const unmarshal_error = this->unmarshal_state (node);
+ if (unmarshal_error)
+ {
+ return unmarshal_error;
+ }
+
*os << be_uidt_nl << "}" << be_nl_2;
+ if (!be_global->cdr_support ())
+ {
+ return 0;
+ }
+
*os << "void" << be_nl;
this->class_name (node, os);
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp
index 7bc893e7d6b..557b127b17f 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp
@@ -300,14 +300,18 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node)
if (node->opt_accessor ())
{
*os << be_uidt_nl << "protected:" << be_idt_nl;
- *os << "::CORBA::Boolean "
- << "_tao_marshal_state (TAO_OutputCDR &) const;" << be_nl
- << "::CORBA::Boolean "
- << "_tao_unmarshal_state (TAO_InputCDR &);" << be_nl
- << "virtual void "
- << "truncation_hook (void);"
- << be_uidt_nl << be_nl;
- *os << "private:" << be_idt_nl;
+
+ if (be_global->cdr_support ())
+ {
+ *os << "::CORBA::Boolean "
+ << "_tao_marshal_state (TAO_OutputCDR &) const;" << be_nl
+ << "::CORBA::Boolean "
+ << "_tao_unmarshal_state (TAO_InputCDR &);" << be_nl
+ << "virtual void truncation_hook ();" << be_nl;
+ }
+
+ *os << be_uidt_nl << be_nl
+ << "private:" << be_idt_nl;
this->gen_pd (node);
}
@@ -327,7 +331,7 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node)
<< "_tao_unmarshal__" << node->flat_name ()
<< " (TAO_InputCDR &, TAO_ChunkInfo &);";
}
- else
+ else if (be_global->cdr_support ())
{
*os << "virtual ::CORBA::Boolean" << be_nl
<< "_tao_marshal__" << node->flat_name ()
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp
index dbbcd0278e4..c59150ba96f 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp
@@ -53,6 +53,9 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node)
if (node->is_defined ())
{
+ *os << be_nl
+ << be_global->core_versioning_begin ();
+
*os << be_nl_2
<< "void" << be_nl
<< "TAO::Value_Traits<" << node->name () << ">::add_ref ("
@@ -82,6 +85,9 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node)
<< "{" << be_idt_nl
<< "::CORBA::remove_ref (p);" << be_uidt_nl
<< "}";
+
+ *os << be_nl
+ << be_global->core_versioning_end () << be_nl;
}
// The _downcast method.
@@ -170,58 +176,8 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node)
// Nothing to marshal if abstract valuetype.
if (!node->is_abstract () && !is_an_amh_exception_holder)
{
- // The virtual _tao_marshal_v method.
- *os << "::CORBA::Boolean" << be_nl
- << node->name ()
- << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl
- << "{" << be_idt_nl
- << "TAO_ChunkInfo ci (this->is_truncatable_ || this->chunking_);"
- << be_nl
- << "return ";
-
- if (node->opt_accessor ())
- {
- be_decl *scope =
- dynamic_cast<be_scope*> (node->defined_in ())->decl ();
-
- *os << scope->name () << "::"
- << node->local_name ()
- << "::_tao_marshal_state (strm, ci);" << be_uidt_nl;
- }
- else
- {
- *os << "this->_tao_marshal__" << node->flat_name ()
- << " (strm, ci);" << be_uidt_nl;
- }
-
- *os << "}" << be_nl_2;
- // The virtual _tao_unmarshal_v method.
- *os << "::CORBA::Boolean" << be_nl
- << node->name ()
- << "::_tao_unmarshal_v (TAO_InputCDR & strm)"
- << be_nl
- << "{" << be_idt_nl
- << "TAO_ChunkInfo ci (this->is_truncatable_ || this->chunking_, 1);"
- << be_nl
- << "return ";
-
- if (node->opt_accessor ())
- {
- be_decl *scope =
- dynamic_cast<be_scope*> (node->defined_in ())->decl ();
-
- *os << scope->name () << "::"
- << node->local_name ()
- <<"::_tao_unmarshal_state (strm,ci);" << be_uidt_nl;
- }
- else
- {
- *os << "this->_tao_unmarshal__" << node->flat_name ()
- << " (strm,ci);" << be_uidt_nl;
- }
-
- *os << "}" << be_nl_2;
+ this->marshal_unmarshal_v (node);
*os << "::CORBA::Boolean" << be_nl
<< node->name ()
@@ -391,6 +347,81 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node)
return 0;
}
+void be_visitor_valuetype_cs::marshal_unmarshal_v (be_valuetype *node)
+{
+ TAO_OutStream *const os = this->ctx_->stream ();
+
+ if (!be_global->cdr_support ())
+ {
+ *os << "::CORBA::Boolean" << be_nl
+ << node->name ()
+ << "::_tao_marshal_v (TAO_OutputCDR &) const" << be_nl
+ << "{" << be_idt_nl
+ << "return false;" << be_uidt_nl
+ << "}" << be_nl_2
+ << "::CORBA::Boolean" << be_nl
+ << node->name ()
+ << "::_tao_unmarshal_v (TAO_InputCDR &)" << be_nl
+ << "{" << be_idt_nl
+ << "return false;" << be_uidt_nl
+ << "}" << be_nl_2;
+ return;
+ }
+
+ // The virtual _tao_marshal_v method.
+ *os << "::CORBA::Boolean" << be_nl
+ << node->name ()
+ << "::_tao_marshal_v (TAO_OutputCDR & strm) const" << be_nl
+ << "{" << be_idt_nl
+ << "TAO_ChunkInfo ci (this->is_truncatable_ || this->chunking_);"
+ << be_nl
+ << "return ";
+
+ if (node->opt_accessor ())
+ {
+ be_decl *scope =
+ dynamic_cast<be_scope*> (node->defined_in ())->decl ();
+
+ *os << scope->name () << "::"
+ << node->local_name ()
+ << "::_tao_marshal_state (strm, ci);" << be_uidt_nl;
+ }
+ else
+ {
+ *os << "this->_tao_marshal__" << node->flat_name ()
+ << " (strm, ci);" << be_uidt_nl;
+ }
+
+ *os << "}" << be_nl_2;
+
+ // The virtual _tao_unmarshal_v method.
+ *os << "::CORBA::Boolean" << be_nl
+ << node->name ()
+ << "::_tao_unmarshal_v (TAO_InputCDR & strm)"
+ << be_nl
+ << "{" << be_idt_nl
+ << "TAO_ChunkInfo ci (this->is_truncatable_ || this->chunking_, 1);"
+ << be_nl
+ << "return ";
+
+ if (node->opt_accessor ())
+ {
+ be_decl *scope =
+ dynamic_cast<be_scope*> (node->defined_in ())->decl ();
+
+ *os << scope->name () << "::"
+ << node->local_name ()
+ <<"::_tao_unmarshal_state (strm,ci);" << be_uidt_nl;
+ }
+ else
+ {
+ *os << "this->_tao_unmarshal__" << node->flat_name ()
+ << " (strm,ci);" << be_uidt_nl;
+ }
+
+ *os << "}" << be_nl_2;
+}
+
int
be_visitor_valuetype_cs::visit_eventtype (be_eventtype *node)
{
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp
index 1adb806c457..d5ee46dfc80 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp
@@ -209,25 +209,28 @@ be_visitor_valuetype_obv_ch::visit_valuetype (be_valuetype *node)
// Map fields to private data.
if (!node->opt_accessor ())
{
- *os << be_nl << be_uidt_nl << "protected:" << be_idt_nl;
-
- *os << "virtual ::CORBA::Boolean" << be_nl
- << "_tao_marshal__" << node->flat_name ()
- << " (TAO_OutputCDR &, TAO_ChunkInfo &) const;" << be_nl_2;
-
- *os << "virtual ::CORBA::Boolean" << be_nl
- << "_tao_unmarshal__" << node->flat_name ()
- << " (TAO_InputCDR &, TAO_ChunkInfo &);" << be_nl_2;
-
- *os << "::CORBA::Boolean "
- << "_tao_marshal_state (TAO_OutputCDR &, TAO_ChunkInfo &) const;"
- << be_nl
- << "::CORBA::Boolean "
- << "_tao_unmarshal_state (TAO_InputCDR &, TAO_ChunkInfo &);"
- << be_nl
- << "virtual void "
- << "truncation_hook (void);"
- << be_uidt_nl << be_nl;
+ if (be_global->cdr_support ())
+ {
+ *os << be_nl << be_uidt_nl << "protected:" << be_idt_nl;
+
+ *os << "virtual ::CORBA::Boolean" << be_nl
+ << "_tao_marshal__" << node->flat_name()
+ << " (TAO_OutputCDR &, TAO_ChunkInfo &) const;" << be_nl_2;
+
+ *os << "virtual ::CORBA::Boolean" << be_nl
+ << "_tao_unmarshal__" << node->flat_name()
+ << " (TAO_InputCDR &, TAO_ChunkInfo &);" << be_nl_2;
+
+ *os << "::CORBA::Boolean "
+ << "_tao_marshal_state (TAO_OutputCDR &, TAO_ChunkInfo &) const;"
+ << be_nl
+ << "::CORBA::Boolean "
+ << "_tao_unmarshal_state (TAO_InputCDR &, TAO_ChunkInfo &);"
+ << be_nl
+ << "virtual void "
+ << "truncation_hook ();"
+ << be_uidt_nl << be_nl;
+ }
*os << "private:" << be_idt;
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp
index 818bdb607d0..3a7b3e077a0 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp
@@ -127,21 +127,24 @@ be_visitor_valuetype_obv_cs::visit_valuetype (be_valuetype *node)
// or the valuetype is abstract.
if (!node->opt_accessor ())
{
- *os << be_nl_2 << "::CORBA::Boolean" << be_nl
- << node->full_obv_skel_name ()
- << "::_tao_marshal__" << node->flat_name ()
- << " (TAO_OutputCDR &strm, TAO_ChunkInfo& ci) const" << be_nl
- << "{" << be_idt_nl
- << "return _tao_marshal_state (strm, ci);" << be_uidt_nl
- << "}" << be_nl_2;
+ if (be_global->cdr_support ())
+ {
+ *os << be_nl_2 << "::CORBA::Boolean" << be_nl
+ << node->full_obv_skel_name()
+ << "::_tao_marshal__" << node->flat_name()
+ << " (TAO_OutputCDR &strm, TAO_ChunkInfo& ci) const" << be_nl
+ << "{" << be_idt_nl
+ << "return _tao_marshal_state (strm, ci);" << be_uidt_nl
+ << "}" << be_nl_2;
- *os << "::CORBA::Boolean" << be_nl
- << node->full_obv_skel_name ()
- << "::_tao_unmarshal__" << node->flat_name ()
- << " (TAO_InputCDR &strm, TAO_ChunkInfo& ci)" << be_nl
- << "{" << be_idt_nl
- << "return _tao_unmarshal_state (strm, ci);" << be_uidt_nl
- << "}";
+ *os << "::CORBA::Boolean" << be_nl
+ << node->full_obv_skel_name()
+ << "::_tao_unmarshal__" << node->flat_name()
+ << " (TAO_InputCDR &strm, TAO_ChunkInfo& ci)" << be_nl
+ << "{" << be_idt_nl
+ << "return _tao_unmarshal_state (strm, ci);" << be_uidt_nl
+ << "}";
+ }
if (this->visit_scope (node) == -1)
{
diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/marshal_cs.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/marshal_cs.h
index c6024fa7087..1fe7bfc264d 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/marshal_cs.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype/marshal_cs.h
@@ -25,6 +25,8 @@
*/
class be_visitor_valuetype_marshal_cs : public be_visitor_scope
{
+ int marshal_state (be_valuetype *node);
+ int unmarshal_state (be_valuetype *node);
public:
/// constructor
diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_cs.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_cs.h
index df723ab6b93..4c0e03ef179 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_cs.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_cs.h
@@ -37,6 +37,8 @@ public:
private:
/// Recursive to generate for inherited members.
void gen_ostream_operator_r (be_valuetype *node, unsigned long &index);
+
+ void marshal_unmarshal_v (be_valuetype *node);
};
#endif /* _BE_VALUETYPE_VALUETYPE_CS_H_ */
diff --git a/TAO/tests/IDL_Test/Versioned_Namespace/TestVersionedNamespace.idl b/TAO/tests/IDL_Test/Versioned_Namespace/TestVersionedNamespace.idl
new file mode 100644
index 00000000000..3e5fa3e9592
--- /dev/null
+++ b/TAO/tests/IDL_Test/Versioned_Namespace/TestVersionedNamespace.idl
@@ -0,0 +1,17 @@
+module M1 {
+
+ struct S1 {
+ octet o;
+ };
+
+ local interface LI {
+ void op(in S1 s);
+ };
+
+ valuetype V {
+ public string valString;
+ public S1 valStruct;
+ public LI valLocalIface;
+ };
+
+};
diff --git a/TAO/tests/IDL_Test/Versioned_Namespace/UserVersionedNamespace.h b/TAO/tests/IDL_Test/Versioned_Namespace/UserVersionedNamespace.h
new file mode 100644
index 00000000000..fe962aad30f
--- /dev/null
+++ b/TAO/tests/IDL_Test/Versioned_Namespace/UserVersionedNamespace.h
@@ -0,0 +1,2 @@
+#define BEGIN_USER_VERSIONED_NAMESPACE namespace User {
+#define END_USER_VERSIONED_NAMESPACE } using namespace User;
diff --git a/TAO/tests/IDL_Test/Versioned_Namespace/Versioned_Namespace.mpc b/TAO/tests/IDL_Test/Versioned_Namespace/Versioned_Namespace.mpc
new file mode 100644
index 00000000000..4432c15dc4b
--- /dev/null
+++ b/TAO/tests/IDL_Test/Versioned_Namespace/Versioned_Namespace.mpc
@@ -0,0 +1,7 @@
+// -*- MPC -*-
+project(IDL_Test_Versioned_Namespace): taoidldefaults, valuetype {
+ idlflags += -Scdr -Sa
+ idlflags += -Wb,versioning_begin=BEGIN_USER_VERSIONED_NAMESPACE \
+ -Wb,versioning_end=END_USER_VERSIONED_NAMESPACE \
+ -Wb,versioning_include=UserVersionedNamespace.h
+}