summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-09-01 00:56:24 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-09-01 00:56:24 +0000
commit1ed6faccc5815077450c83904621b654b45f95d7 (patch)
treec7fa4be814753d6381fb90fc4c0abe6e7eaf0cca
parent7e6ba5dd62f367a0aa5e64dfe8712417f4f5f7e3 (diff)
downloadATCD-1ed6faccc5815077450c83904621b654b45f95d7.tar.gz
ChangeLogTag: Sun Aug 31 19:50:47 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--TAO/ChangeLog_ref15
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp59
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp66
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp13
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp17
5 files changed, 87 insertions, 83 deletions
diff --git a/TAO/ChangeLog_ref b/TAO/ChangeLog_ref
index 2f0f54fffbb..0f38019f27a 100644
--- a/TAO/ChangeLog_ref
+++ b/TAO/ChangeLog_ref
@@ -1,3 +1,18 @@
+Sun Aug 31 19:50:47 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/be/be_visitor_interface/any_op_cs.cpp:
+ * TAO_IDL/be/be_visitor_interface/interface_ci.cpp:
+ * TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp:
+ * TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp:
+
+ Moved generation of Any widening extraction to Object
+ and to ValueBase from inline file to source file. Did
+ the same for the no-op specializations for marshal_value()
+ and demarshal_value() necessary for local interfaces.
+ This will allow all inclusions of Any-related ORB files
+ to occur in the source file and thus avoid the propagation
+ that would occur if they were included in the header file.
+
Sun Aug 31 19:39:16 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
* tao/Bounds.pidl:
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp
index 3e455acdfbf..9c8793ac41e 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp
@@ -93,6 +93,65 @@ be_visitor_interface_any_op_cs::visit_interface (be_interface *node)
<< ");" << be_uidt << be_uidt << be_uidt_nl
<< "}";
+ if (! node->is_abstract ())
+ {
+ *os << be_nl << be_nl
+ << "ACE_TEMPLATE_SPECIALIZATION" << be_nl
+ << "CORBA::Boolean" << be_nl
+ << "TAO::Any_Impl_T<" << node->name () << ">::to_object ("
+ << be_idt << be_idt_nl
+ << "CORBA::Object_ptr &_tao_elem" << be_uidt_nl
+ << ") const" << be_uidt_nl
+ << "{" << be_idt_nl
+ << "_tao_elem = CORBA::Object::_duplicate (this->value_);" << be_nl
+ << "return 1;" << be_uidt_nl
+ << "}";
+ }
+
+ if (node->is_abstract () || node->has_mixed_parentage ())
+ {
+ *os << be_nl << be_nl
+ << "ACE_TEMPLATE_SPECIALIZATION" << be_nl
+ << "CORBA::Boolean" << be_nl
+ << "TAO::Any_Impl_T<" << node->name ()
+ << ">::to_abstract_base ("
+ << be_idt << be_idt_nl
+ << "CORBA::AbstractBase_ptr &_tao_elem" << be_uidt_nl
+ << ") const" << be_uidt_nl
+ << "{" << be_idt_nl
+ << "_tao_elem = CORBA::AbstractBase::_duplicate (this->value_);"
+ << be_nl
+ << "return 1;" << be_uidt_nl
+ << "}";
+ }
+
+ // Since we don't generate CDR stream operators for types that
+ // explicitly contain a local interface (at some level), we
+ // must override these Any template class methods to avoid
+ // calling the non-existent operators. The zero return value
+ // will eventually cause CORBA::MARSHAL to be raised if this
+ // type is inserted into an Any and then marshaled.
+ if (node->is_local ())
+ {
+ *os << be_nl << be_nl
+ << "ACE_TEMPLATE_SPECIALIZATION" << be_nl
+ << "CORBA::Boolean" << be_nl
+ << "TAO::Any_Impl_T<" << node->name ()
+ << ">::marshal_value (TAO_OutputCDR &)" << be_nl
+ << "{" << be_idt_nl
+ << "return 0;" << be_uidt_nl
+ << "}";
+
+ *os << be_nl << be_nl
+ << "ACE_TEMPLATE_SPECIALIZATION" << be_nl
+ << "CORBA::Boolean" << be_nl
+ << "TAO::Any_Impl_T<" << node->name ()
+ << ">::demarshal_value (TAO_InputCDR &)" << be_nl
+ << "{" << be_idt_nl
+ << "return 0;" << be_uidt_nl
+ << "}";
+ }
+
// All we have to do is to visit the scope and generate code.
if (!node->is_local ())
{
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
index e16b93fe7b5..cdb88b24344 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
@@ -100,72 +100,6 @@ be_visitor_interface_ci::visit_interface (be_interface *node)
node->gen_stub_ctor (os);
}
- if (be_global->any_support ())
- {
- if (! node->is_abstract ())
- {
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "ACE_INLINE" << be_nl
- << "CORBA::Boolean" << be_nl
- << "TAO::Any_Impl_T<" << node->name () << ">::to_object ("
- << be_idt << be_idt_nl
- << "CORBA::Object_ptr &_tao_elem" << be_uidt_nl
- << ") const" << be_uidt_nl
- << "{" << be_idt_nl
- << "_tao_elem = CORBA::Object::_duplicate (this->value_);" << be_nl
- << "return 1;" << be_uidt_nl
- << "}";
- }
-
- if (node->is_abstract () || node->has_mixed_parentage ())
- {
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "ACE_INLINE" << be_nl
- << "CORBA::Boolean" << be_nl
- << "TAO::Any_Impl_T<" << node->name ()
- << ">::to_abstract_base ("
- << be_idt << be_idt_nl
- << "CORBA::AbstractBase_ptr &_tao_elem" << be_uidt_nl
- << ") const" << be_uidt_nl
- << "{" << be_idt_nl
- << "_tao_elem = CORBA::AbstractBase::_duplicate (this->value_);"
- << be_nl
- << "return 1;" << be_uidt_nl
- << "}";
- }
-
- // Since we don't generate CDR stream operators for types that
- // explicitly contain a local interface (at some level), we
- // must override these Any template class methods to avoid
- // calling the non-existent operators. The zero return value
- // will eventually cause CORBA::MARSHAL to be raised if this
- // type is inserted into an Any and then marshaled.
- if (node->is_local ())
- {
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "ACE_INLINE" << be_nl
- << "CORBA::Boolean" << be_nl
- << "TAO::Any_Impl_T<" << node->name ()
- << ">::marshal_value (TAO_OutputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return 0;" << be_uidt_nl
- << "}";
-
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "ACE_INLINE" << be_nl
- << "CORBA::Boolean" << be_nl
- << "TAO::Any_Impl_T<" << node->name ()
- << ">::demarshal_value (TAO_InputCDR &)" << be_nl
- << "{" << be_idt_nl
- << "return 0;" << be_uidt_nl
- << "}";
- }
- }
-
if (!node->is_local () && !node->is_abstract ())
{
*os << be_nl << be_nl
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp
index 45c082c78a7..5903c81cfb5 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp
@@ -99,6 +99,19 @@ be_visitor_valuetype_any_op_cs::visit_valuetype (be_valuetype *node)
<< ");" << be_uidt << be_uidt << be_uidt_nl
<< "}" << be_nl << be_nl;
+ *os << "ACE_TEMPLATE_SPECIALIZATION" << be_nl
+ << "CORBA::Boolean" << be_nl
+ << "TAO::Any_Impl_T<" << node->name () << ">::to_value ("
+ << be_idt << be_idt_nl
+ << "CORBA::ValueBase *&_tao_elem" << be_uidt_nl
+ << ") const" << be_uidt_nl
+ << "{" << be_idt_nl
+ << "CORBA::add_ref (this->value_);" << be_nl
+ << "_tao_elem = this->value_;" << be_nl
+ << "return 1;" << be_uidt_nl
+ << "}"<< be_nl << be_nl;
+
+
node->cli_stub_any_op_gen (1);
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp
index 49ec442c334..3b86f08e4b1 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp
@@ -96,23 +96,6 @@ be_visitor_valuetype_ci::visit_valuetype (be_valuetype *node)
<< "return \"" << node->repoID () << "\";" << be_uidt_nl
<< "}";
- if (be_global->any_support ())
- {
- *os << be_nl << be_nl
- << "template<>" << be_nl
- << "ACE_INLINE" << be_nl
- << "CORBA::Boolean" << be_nl
- << "TAO::Any_Impl_T<" << node->name () << ">::to_value ("
- << be_idt << be_idt_nl
- << "CORBA::ValueBase *&_tao_elem" << be_uidt_nl
- << ") const" << be_uidt_nl
- << "{" << be_idt_nl
- << "CORBA::add_ref (this->value_);" << be_nl
- << "_tao_elem = this->value_;" << be_nl
- << "return 1;" << be_uidt_nl
- << "}";
- }
-
if (this->visit_scope (node) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,