summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp70
1 files changed, 40 insertions, 30 deletions
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 e5420ff73fe..1bb473a9fe3 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
@@ -131,8 +131,29 @@ be_visitor_interface_cs::visit_interface (be_interface *node)
<< "}";
}
- be_visitor_context ctx = (*this->ctx_);
+ // Generate the proxy broker factory function pointer definition.
+ *os << be_nl << be_nl
+ << "// Function pointer for collocation factory initialization."
+ << be_nl
+ << "TAO::Collocation_Proxy_Broker * " << be_nl
+ << "(*" << node->flat_client_enclosing_scope ()
+ << node->base_proxy_broker_name ()
+ << "_Factory_function_pointer) ("
+ << be_idt << be_idt_nl
+ << "CORBA::Object_ptr obj" << be_uidt_nl
+ << ") = 0;" << be_uidt;
+
+ // Generate code for the elements of the interface.
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_interface_cs::"
+ "visit_interface - "
+ "codegen for scope failed\n"),
+ -1);
+ }
+/*
// Interceptor classes. The interceptors helper classes must be
// defined before the interface operations because they are used in
// the implementation of these operations.
@@ -176,10 +197,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node)
-1);
}
}
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
+*/
if (node->is_local ())
{
*os << be_nl << be_nl
@@ -194,6 +212,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node)
*os << be_nl << be_nl
<< node->name () << "::" << node->local_name ()
<< " (int collocated)" << be_nl
+ << " : the" << node->base_proxy_broker_name () << "_ (0)" << be_nl
<< "{" << be_idt_nl
<< "this->" << node->flat_name ()
<< "_setup_collocation (collocated);" << be_uidt_nl
@@ -211,14 +230,15 @@ be_visitor_interface_cs::visit_interface (be_interface *node)
<< "::" << node->flat_client_enclosing_scope ()
<< node->base_proxy_broker_name ()
<< "_Factory_function_pointer (this);"
- << be_uidt << be_uidt_nl
- << "else" << be_idt_nl
+ << be_uidt << be_uidt;
+/*
+ *os << be_nl << "else" << be_idt_nl
<< "this->the" << node->base_proxy_broker_name ()
<< "_ =" << be_idt_nl
<< "::" << node->full_remote_proxy_broker_name ()
<< "::the" << node->remote_proxy_broker_name ()
<< " ();" << be_uidt << be_uidt;
-
+*/
// Now we setup the immediate parents.
int n_parents = node->n_inherits ();
int has_concrete_parent = 0;
@@ -417,7 +437,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node)
// The _duplicate method
*os << node->full_name () << "_ptr" << be_nl
<< node->full_name () << "::_duplicate ("
- << bt->nested_type_name (this->ctx_->scope ())
+ << bt->local_name ()
<< "_ptr obj)" << be_nl
<< "{" << be_idt_nl
<< "if (! CORBA::is_nil (obj))" << be_idt_nl
@@ -592,16 +612,6 @@ be_visitor_interface_cs::visit_interface (be_interface *node)
<< "}";
}
- // Generate code for the elements of the interface.
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface_cs::"
- "visit_interface - "
- "codegen for scope failed\n"),
- -1);
- }
-
if (! node->is_abstract ())
{
// Smart Proxy classes.
@@ -625,6 +635,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node)
if (be_global->tc_support ())
{
+ be_visitor_context ctx = *this->ctx_;
ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
be_visitor_typecode_defn tc_visitor (&ctx);
@@ -718,16 +729,15 @@ be_visitor_interface_cs::gen_concrete_unchecked_narrow (be_interface *node,
<< "{" << be_idt_nl
<< "if (CORBA::is_nil (obj))" << be_idt_nl
<< "{" << be_idt_nl
- << "return " << bt->nested_type_name (this->ctx_->scope ())
- << "::_nil ();" << be_uidt_nl
+ << "return " << bt->local_name () << "::_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 ())
+ *os << bt->local_name ()
<< "_ptr default_proxy = "
- << bt->nested_type_name (this->ctx_->scope ())
+ << bt->local_name ()
<<"::_nil ();" << be_nl << be_nl;
// Code for lzay evaluation..
@@ -741,7 +751,7 @@ be_visitor_interface_cs::gen_concrete_unchecked_narrow (be_interface *node,
<< " (" << 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 ())
+ << bt->local_name ()
<< "::_nil ()" << be_uidt_nl << ");" << be_uidt_nl << be_nl
<< "return default_proxy;" << be_uidt_nl
<< "}" << be_uidt_nl << be_nl;
@@ -755,7 +765,7 @@ be_visitor_interface_cs::gen_concrete_unchecked_narrow (be_interface *node,
<< "stub->_incr_refcnt ();" << be_uidt_nl
<< "}" << be_uidt_nl << be_nl;
- // If the policy didtates that the proxy be collocated, use the
+ // If the policy dictates that the proxy be collocated, use the
// function to create one.
*os << "if (" << be_idt << be_idt_nl
<< "!CORBA::is_nil (stub->servant_orb_var ().ptr ()) &&" << be_nl
@@ -773,7 +783,7 @@ be_visitor_interface_cs::gen_concrete_unchecked_narrow (be_interface *node,
<< "stub," << be_nl
<< "1," << be_nl
<< "obj->_servant ()" << be_uidt_nl << ")," << be_uidt_nl
- << bt->nested_type_name (this->ctx_->scope ())
+ << bt->local_name ()
<< "::_nil ()" << be_uidt_nl << ");"
<< be_uidt << be_uidt_nl
<< "}" << be_uidt_nl << be_nl;
@@ -790,7 +800,7 @@ be_visitor_interface_cs::gen_concrete_unchecked_narrow (be_interface *node,
<< "0," << be_nl
<< "obj->_servant ()" << be_uidt_nl
<< ")," << be_uidt_nl
- << bt->nested_type_name (this->ctx_->scope ())
+ << bt->local_name ()
<< "::_nil ()" << be_uidt_nl
<< ");" << be_uidt << be_uidt_nl
<< "}" << be_uidt_nl << be_nl;
@@ -848,9 +858,9 @@ be_visitor_interface_cs::gen_abstract_unchecked_narrow (be_interface *node,
<< "}" << be_uidt_nl << be_nl;
// Declare the default proxy.
- *os << bt->nested_type_name (this->ctx_->scope ())
+ *os << bt->local_name ()
<< "_ptr default_proxy = "
- << bt->nested_type_name (this->ctx_->scope ())
+ << bt->local_name ()
<<"::_nil ();" << be_nl << be_nl;
*os << "if (obj->_is_objref ())" << be_idt_nl
@@ -863,7 +873,7 @@ be_visitor_interface_cs::gen_abstract_unchecked_narrow (be_interface *node,
<< "0," << be_nl
<< "obj->_servant ()" << be_uidt_nl
<< ")," << be_uidt_nl
- << bt->nested_type_name (this->ctx_->scope ())
+ << bt->local_name ()
<< "::_nil ()" << be_uidt_nl
<< ");" << be_uidt << be_uidt_nl
<< "}" << be_uidt_nl;