summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2003-03-25 22:04:43 +0000
committerbala <balanatarajan@users.noreply.github.com>2003-03-25 22:04:43 +0000
commit17d1b4dd33551f0501e9ff1ac8753b73211baa3b (patch)
treecf43a9a03f19f1dfbc1132b8013a172effff0f58
parent91f731079c614b90cc8f28b4dc3ed2ad84f54205 (diff)
downloadATCD-17d1b4dd33551f0501e9ff1ac8753b73211baa3b.tar.gz
*** empty log message ***
-rw-r--r--TAO/TAO_IDL/be/be_interface.cpp7
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp8
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp14
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp48
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp11
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp32
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp37
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp13
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/thru_poa_proxy_impl_ss.cpp7
9 files changed, 143 insertions, 34 deletions
diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp
index 5fa13c7536f..5b21ecfdc4c 100644
--- a/TAO/TAO_IDL/be/be_interface.cpp
+++ b/TAO/TAO_IDL/be/be_interface.cpp
@@ -491,10 +491,11 @@ be_interface::gen_stub_ctor (TAO_OutStream *os)
<< be_idt << be_idt_nl
<< "TAO_Stub *objref," << be_nl
<< "CORBA::Boolean _tao_collocated," << be_nl
- << "TAO_Abstract_ServantBase *servant" << be_uidt_nl
+ << "TAO_Abstract_ServantBase *servant," << be_nl
+ << "TAO_ORB_Core *oc" << be_uidt_nl
<< ")"
<< be_nl;
- *os << ": ACE_NESTED_CLASS (CORBA, Object) (objref, _tao_collocated, servant)";
+ *os << ": ACE_NESTED_CLASS (CORBA, Object) (objref, _tao_collocated, servant, oc)";
if (this->has_mixed_parentage_)
{
@@ -524,7 +525,7 @@ be_interface::gen_stub_ctor (TAO_OutStream *os)
}
*os << be_nl << "{" << be_idt_nl
- << "this->" << this->flat_name ()
+ << "this->" << this->flat_name ()
<< "_setup_collocation (_tao_collocated);";
*os << be_uidt_nl
diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp
index 43506413a5d..eb8e6af3826 100644
--- a/TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp
@@ -249,11 +249,17 @@ be_visitor_component_ch::visit_component (be_component *node)
<< "virtual void " << node->flat_name ()
<< "_setup_collocation (int collocated);";
+ *os << node->local_name ()
+ << " (IOP::IOR *ior," << be_idt_nl
+ << be_idt << "TAO_ORB_Core *orb_core = 0);" << be_uidt_nl
+ << be_uidt_nl;
+
*os << be_nl << be_nl
<< node->local_name ()
<< " (" << be_idt << be_idt_nl << "TAO_Stub *objref, " << be_nl
<< "CORBA::Boolean _tao_collocated = 0," << be_nl
- << "TAO_Abstract_ServantBase *servant = 0" << be_uidt_nl
+ << "TAO_Abstract_ServantBase *servant = 0," << be_nl
+ << "TAO_ORB_Core *oc = 0)" << be_uidt_nl
<< ");" << be_uidt;
// Friends declarations.
diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp
index 6dd43654f82..37a0cb0271d 100644
--- a/TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp
@@ -53,6 +53,20 @@ be_visitor_component_ci::visit_component (be_component *node)
// Generate the constructor from stub and servant.
node->gen_stub_ctor (os);
+ *os << be_nl << be_nl
+ << "ACE_INLINE" << be_nl;
+ *os << node->name () << "::"
+ << node->local_name () << " ("
+ << be_idt << be_idt_nl
+ << "IOP::IOR *ior," << be_nl
+ << "TAO_ORB_Core *oc" << be_uidt_nl
+ << ")"
+ << be_nl;
+ *os << ": ACE_NESTED_CLASS (CORBA, Object) (ior, oc)";
+
+ *os << be_nl << "{" << be_idt_nl
+ << "}" ;
+
os->gen_endif ();
node->cli_inline_gen (I_TRUE);
return 0;
diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp
index 7c8d52c4a9f..c838c786ab7 100644
--- a/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp
@@ -450,11 +450,6 @@ be_visitor_component_cs::gen_unchecked_narrow (be_component *node,
<< "{" << be_idt_nl
<< "return " << bt->nested_type_name (this->ctx_->scope ())
<< "::_nil ();" << be_uidt_nl
- << "}" << be_uidt_nl << be_nl
- << "TAO_Stub* stub = obj->_stubobj ();" << be_nl << be_nl
- << "if (stub != 0)" << be_idt_nl
- << "{" << be_idt_nl
- << "stub->_incr_refcnt ();" << be_uidt_nl
<< "}" << be_uidt_nl << be_nl;
// Declare the default proxy.
@@ -463,6 +458,31 @@ be_visitor_component_cs::gen_unchecked_narrow (be_component *node,
<< bt->nested_type_name (this->ctx_->scope ())
<<"::_nil ();" << be_nl << be_nl;
+ // Code for lzay evaluation..
+ *os << "// Code for lazily evaluated IOR's" << be_nl;
+
+ *os << "if (!obj->is_evaluated ())" << be_idt_nl
+ << "{" << be_idt_nl
+ << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
+ << "default_proxy," << be_nl
+ << "::" << bt->name ()
+ << " (" << be_idt << be_idt_nl
+ << "obj->steal_ior ()," << be_nl
+ << "obj->orb_core ()" << be_uidt_nl << ")," << be_uidt_nl
+ << bt->nested_type_name (this->ctx_->scope ())
+ << "::_nil ()" << be_uidt_nl << ");"
+ << "return default_proxy;" << be_nl
+ << be_uidt << be_uidt_nl
+ << "}" << be_uidt_nl << be_nl;
+
+ *os << "TAO_Stub* stub = obj->_stubobj ();" << be_nl << be_nl
+ << "if (stub != 0)" << be_idt_nl
+ << "{" << be_idt_nl
+ << "stub->_incr_refcnt ();" << be_uidt_nl
+ << "}" << be_uidt_nl << be_nl;
+
+
+
// If the policy didtates that the proxy be collocated, use the
// function to create one.
*os << "if (" << be_idt << be_idt_nl
@@ -483,8 +503,8 @@ be_visitor_component_cs::gen_unchecked_narrow (be_component *node,
<< "obj->_servant ()" << be_uidt_nl << ")," << be_uidt_nl
<< bt->nested_type_name (this->ctx_->scope ())
<< "::_nil ()" << be_uidt_nl << ");"
- << be_uidt << be_uidt_nl
- << "}" << be_uidt_nl << be_nl;
+ << be_uidt << be_uidt_nl;
+
// The default proxy will either be returned else be transformed to
@@ -515,4 +535,18 @@ be_visitor_component_cs::gen_unchecked_narrow (be_component *node,
}
*os << "}" << be_nl << be_nl;
+
+ // Lazily evaluated IOR
+ *os << "return" << be_idt_nl
+ << "ACE_reinterpret_cast (" << be_idt << be_idt_nl
+ << node->local_name () << "_ptr," << be_nl
+ << "obj->_tao_QueryInterface (" << be_idt << be_idt_nl
+ << "ACE_reinterpret_cast (" << be_idt << be_idt_nl
+ << "ptr_arith_t," << be_nl
+ << "&" << node->local_name () << "::_tao_class_id" << be_uidt_nl
+ << ")" << be_uidt << be_uidt_nl
+ << ")" << be_uidt << be_uidt_nl
+ << ");" << be_uidt << be_uidt << be_uidt << be_uidt_nl;
+
+ *os << "}" << be_nl << be_nl;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp
index e7efafda2f3..436ae255657 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp
@@ -240,7 +240,7 @@ be_visitor_interface_ch::visit_interface (be_interface *node)
if (node->is_abstract ())
{
- *os << "static " << node->local_name ()
+ *os << "static " << node->local_name ()
<< "_ptr _downcast (CORBA::AbstractBase_ptr abs);"
<< be_nl << be_nl;
}
@@ -350,13 +350,20 @@ be_visitor_interface_ch::visit_interface (be_interface *node)
<< node->local_name () << " &);" << be_nl;
}
+
// Local interfaces don't support stub objects.
if (! node->is_local ())
{
*os << node->local_name ()
+ << " (IOP::IOR *ior," << be_idt_nl
+ << be_idt << "TAO_ORB_Core *orb_core = 0);" << be_uidt_nl
+ << be_uidt_nl;
+
+ *os << node->local_name ()
<< " (" << be_idt << be_idt_nl << "TAO_Stub *objref, " << be_nl
<< "CORBA::Boolean _tao_collocated = 0," << be_nl
- << "TAO_Abstract_ServantBase *servant = 0" << be_uidt_nl
+ << "TAO_Abstract_ServantBase *servant = 0," << be_nl
+ << "TAO_ORB_Core *orb_core = 0" << be_uidt_nl
<< ");" << be_uidt_nl;
}
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 73163edc6ad..77503ddf1f2 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
@@ -18,11 +18,10 @@
//
// ============================================================================
-ACE_RCSID (be_visitor_interface,
- interface_ci,
+ACE_RCSID (be_visitor_interface,
+ interface_ci,
"$Id$")
-
// **************************************************
// Interface visitor for client inline
// **************************************************
@@ -73,13 +72,13 @@ be_visitor_interface_ci::visit_interface (be_interface *node)
{
*os << be_nl << be_nl
<< "ACE_INLINE" << be_nl
- << node->name () << "::" << node->local_name ()
+ << node->name () << "::" << node->local_name ()
<< " (void)" << be_idt_nl
<< ": CORBA::AbstractBase ()" << be_uidt_nl
<< "{}" << be_nl << be_nl;
*os << "ACE_INLINE" << be_nl
- << node->name () << "::" << node->local_name ()
+ << node->name () << "::" << node->local_name ()
<< " (const " << node->local_name () << " &rhs)" << be_idt_nl
<< ": CORBA::AbstractBase (rhs)" << be_uidt_nl
<< "{}" << be_nl << be_nl;
@@ -120,7 +119,7 @@ be_visitor_interface_ci::visit_interface (be_interface *node)
*os << be_nl << be_nl
<< "template<>" << be_nl
<< "CORBA::Boolean" << be_nl
- << "TAO::Any_Impl_T<" << node->name ()
+ << "TAO::Any_Impl_T<" << node->name ()
<< ">::to_abstract_base ("
<< be_idt << be_idt_nl
<< "CORBA::AbstractBase_ptr &_tao_elem" << be_uidt_nl
@@ -133,7 +132,7 @@ be_visitor_interface_ci::visit_interface (be_interface *node)
}
// Since we don't generate CDR stream operators for types that
- // explicitly contain a local interface (at some level), we
+ // 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
@@ -152,7 +151,7 @@ be_visitor_interface_ci::visit_interface (be_interface *node)
*os << be_nl << be_nl
<< "template<>" << be_nl
<< "CORBA::Boolean" << be_nl
- << "TAO::Any_Impl_T<" << node->name ()
+ << "TAO::Any_Impl_T<" << node->name ()
<< ">::demarshal_value (TAO_InputCDR &)" << be_nl
<< "{" << be_idt_nl
<< "return 0;" << be_uidt_nl
@@ -160,6 +159,23 @@ be_visitor_interface_ci::visit_interface (be_interface *node)
}
}
+ if (!node->is_local ())
+ {
+ *os << be_nl << be_nl
+ << "ACE_INLINE" << be_nl;
+ *os << node->name () << "::"
+ << node->local_name () << " ("
+ << be_idt << be_idt_nl
+ << "IOP::IOR *ior," << be_nl
+ << "TAO_ORB_Core *oc" << be_uidt_nl
+ << ")"
+ << be_nl;
+ *os << ": ACE_NESTED_CLASS (CORBA, Object) (ior, oc)";
+
+ *os << be_nl << "{" << be_idt_nl
+ << "}" ;
+ }
+
os->gen_endif ();
node->cli_inline_gen (I_TRUE);
return 0;
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
index f1111577b77..be7caf3c715 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
@@ -1,5 +1,6 @@
//
// $Id$
+
//
// ============================================================================
@@ -22,6 +23,7 @@ ACE_RCSID (be_visitor_interface,
interface_cs,
"$Id$")
+
// ************************************************************
// Interface visitor for client stubs
// ************************************************************
@@ -775,8 +777,35 @@ be_visitor_interface_cs::gen_concrete_unchecked_narrow (be_interface *node,
<< "::_nil ();" << be_uidt_nl
<< "}" << be_uidt_nl << be_nl;
+
+
+
+
if (! node->is_local ())
{
+ // Declare the default proxy.
+ *os << bt->nested_type_name (this->ctx_->scope ())
+ << "_ptr default_proxy = "
+ << bt->nested_type_name (this->ctx_->scope ())
+ <<"::_nil ();" << be_nl << be_nl;
+
+ // Code for lzay evaluation..
+ *os << "// Code for lazily evaluated IOR's" << be_nl;
+
+ *os << "if (!obj->is_evaluated ())" << be_idt_nl
+ << "{" << be_idt_nl
+ << "ACE_NEW_RETURN (" << be_idt << be_idt_nl
+ << "default_proxy," << be_nl
+ << "::" << bt->name ()
+ << " (" << be_idt << be_idt_nl
+ << "obj->steal_ior ()," << be_nl
+ << "obj->orb_core ()" << be_uidt_nl << ")," << be_uidt_nl
+ << bt->nested_type_name (this->ctx_->scope ())
+ << "::_nil ()" << be_uidt_nl << ");" << be_nl
+ << "return default_proxy;" << be_nl
+ << be_uidt << be_uidt_nl
+ << "}" << be_uidt_nl << be_nl;
+
// Remote _unchecked_narrow implementation.
*os << "if (! obj->_is_local ())" << be_idt_nl
<< "{" << be_idt_nl
@@ -786,12 +815,6 @@ be_visitor_interface_cs::gen_concrete_unchecked_narrow (be_interface *node,
<< "stub->_incr_refcnt ();" << be_uidt_nl
<< "}" << be_uidt_nl << be_nl;
- // Declare the default proxy.
- *os << bt->nested_type_name (this->ctx_->scope ())
- << "_ptr default_proxy = "
- << bt->nested_type_name (this->ctx_->scope ())
- <<"::_nil ();" << be_nl << be_nl;
-
// If the policy didtates that the proxy be collocated, use the
// function to create one.
*os << "if (" << be_idt << be_idt_nl
@@ -851,7 +874,7 @@ be_visitor_interface_cs::gen_concrete_unchecked_narrow (be_interface *node,
*os << be_idt;
}
- // Local _unchecked_narrow.
+ // Local & lazily evaluated _unchecked_narrow.
*os << "return" << be_idt_nl
<< "ACE_reinterpret_cast (" << be_idt << be_idt_nl
<< node->local_name () << "_ptr," << be_nl
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
index de19dd9e8d3..b5826f85749 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
@@ -18,8 +18,8 @@
//
// ============================================================================
-ACE_RCSID (be_visitor_operation,
- operation_cs,
+ACE_RCSID (be_visitor_operation,
+ operation_cs,
"$Id$")
// ************************************************************
@@ -169,6 +169,15 @@ be_visitor_operation_cs::visit_operation (be_operation *node)
}
}
+ // If the object is lazily evaluated the proxy brker might well
+ // be null. Initialize it now
+ *os << "if (!this->is_evaluated ())" << be_idt_nl
+ << "{" << be_idt_nl
+ << "ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);" << be_nl
+ << "this->" << intf->flat_name ()
+ << "_setup_collocation (this->_is_collocated ());" << be_uidt_nl
+ << "}" << be_uidt_nl << be_nl;
+
// Generate code that retrieves the proper proxy implementation
// using the proxy broker available, and perform the call
// using the proxy implementation provided by the broker.
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_proxy_impl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_proxy_impl_ss.cpp
index 605aae6fe53..45caf0730d9 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_proxy_impl_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_proxy_impl_ss.cpp
@@ -126,7 +126,7 @@ be_visitor_operation_thru_poa_proxy_impl_ss::visit_operation (
}
}
- *os << be_nl
+ *os << be_nl
<< "TAO_Object_Adapter::Servant_Upcall servant_upcall ("
<< be_idt << be_idt_nl
<< "_collocated_tao_target_->_stubobj ()"
@@ -135,10 +135,9 @@ be_visitor_operation_thru_poa_proxy_impl_ss::visit_operation (
<< ");" << be_uidt_nl
<< "CORBA::Object_var forward_to;" << be_nl
<< "servant_upcall.prepare_for_upcall (" << be_idt << be_idt_nl
- << "_collocated_tao_target_->_stubobj ()->"
- << "profile_in_use ()->object_key ()," << be_nl
+ << "_collocated_tao_target_->_stubobj ()->profile_in_use ()->object_key ()," << be_nl
<< "\"";
-
+
// Check if we are an attribute node in disguise.
if (this->ctx_->attribute ())
{