summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2003-03-21 22:53:32 +0000
committerbala <balanatarajan@users.noreply.github.com>2003-03-21 22:53:32 +0000
commit41d3b2be8a903913ed3018282992e72f81066b7f (patch)
tree3cf1f36419f6b7ae9cf8bc12594483f2da302b11
parentd0cc3aa6a6daec11b026422676b2785ddfa759de (diff)
downloadATCD-41d3b2be8a903913ed3018282992e72f81066b7f.tar.gz
ChangeLogTag: Sat Feb 22 09:50:31 2003 Ossama Othman <ossama@uci.edu>
-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.cpp37
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp10
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp22
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp33
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp13
-rw-r--r--TAO/tao/ChangeLog30
9 files changed, 144 insertions, 30 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 a8c03a62c5c..9aa4c3d37c2 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 697953840fc..2f722478934 100644
--- a/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp
@@ -441,7 +441,6 @@ be_visitor_component_cs::gen_unchecked_narrow (be_component *node,
be_type *bt,
TAO_OutStream *os)
{
- // This part of the code is not formatted right. ..
*os << node->full_name () << "_ptr " << be_nl
<< node->full_name () << "::_unchecked_narrow ("
<< be_idt << be_idt_nl
@@ -453,13 +452,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
- << "if (obj->is_evaluated ())" << be_idt_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.
@@ -468,6 +460,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
@@ -488,8 +505,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
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 508694c1998..6ac4e773866 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;
}
@@ -347,13 +347,19 @@ be_visitor_interface_ch::visit_interface (be_interface *node)
<< node->local_name () << " &);" << be_nl;
}
+ *os << node->local_name ()
+ << " (IOP::IOR *ior," << be_idt_nl
+ << be_idt << "TAO_ORB_Core *orb_core = 0);" << be_uidt_nl
+ << be_uidt_nl;
+
// Local interfaces don't support stub objects.
if (! node->is_local ())
{
*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 ee37390f8e8..4628c3c2efb 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
@@ -18,8 +18,8 @@
//
// ============================================================================
-ACE_RCSID (be_visitor_interface,
- interface_ci,
+ACE_RCSID (be_visitor_interface,
+ interface_ci,
"$Id$")
@@ -73,13 +73,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;
@@ -101,6 +101,20 @@ be_visitor_interface_ci::visit_interface (be_interface *node)
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_interface/interface_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
index f864979a317..6cac3b27f78 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
@@ -749,11 +749,34 @@ be_visitor_interface_cs::gen_concrete_unchecked_narrow (be_interface *node,
<< "::_nil ();" << 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;
+
+
+ // 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;
+
if (! node->is_local ())
{
// Remote _unchecked_narrow implementation.
- *os << "if (! obj->_is_local () &&" << be_idt_nl
- << "obj->is_evaluated ())" << be_idt_nl
+ *os << "if (! obj->_is_local ())" << be_idt_nl
<< "{" << be_idt_nl
<< "TAO_Stub* stub = obj->_stubobj ();" << be_nl << be_nl
<< "if (stub != 0)" << be_idt_nl
@@ -761,12 +784,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
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 40656926263..71916b6b226 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$")
// ************************************************************
@@ -171,6 +171,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/ChangeLog b/TAO/tao/ChangeLog
index 30c35a01a37..ce4b91e2eff 100644
--- a/TAO/tao/ChangeLog
+++ b/TAO/tao/ChangeLog
@@ -1,3 +1,33 @@
+Fri Mar 21 16:37:12 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
+
+ * TAO_IDL/be/be_interface.cpp: Added a new argument to the
+ constructor of stub objects. This change is made to make sure
+ that stub objects have constructors similar to the
+ CORBA::Object.
+
+ * TAO_IDL/be/be_visitor_interface/interface_ch.cpp: Added a new
+ constructor as required by the latest changes to the
+ CORBA::Object.
+
+ * TAO_IDL/be/be_visitor_interface/interface_ci.cpp: Definition of
+ the above constructor.
+
+ * TAO_IDL/be/be_visitor_interface/interface_cs.cpp: In
+ _unchecked_narrow () we create a interface pointer object if the
+ IOR is lazily evaluated by giving it the IOP::IOR and the
+ ORB_Core.
+
+ * TAO_IDL/be/be_visitor_operation/operation_cs.cpp: In the
+ code generation for operation, initialize the object completely
+ ie. evaluate the IOR completely and setup collocation if they
+ have not been setup before (which is possible if the IOR's are
+ evaluated lazily) proceeding with the operation.
+
+ * TAO_IDL/be/be_visitor_component/component_ch.cpp:
+ * TAO_IDL/be/be_visitor_component/component_ci.cpp:
+ * TAO_IDL/be/be_visitor_component/component_cs.cpp: Retrofit the
+ above changes for components too.
+
Wed Mar 19 16:05:11 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
* TAO_IDL/be/be_visitor_component/component_cs.cpp:Added a check