diff options
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.cpp | 44 |
1 files changed, 26 insertions, 18 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 bf07949afb8..1ddc3d0e2a6 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp @@ -62,6 +62,14 @@ be_visitor_interface_cs::visit_interface (be_interface *node) // first generate the code for the static methods + *os << "void " + << node->name () << "::_tao_any_destructor (void *x)" << be_nl + << "{" << be_idt_nl + << node->name () << " *tmp = ACE_static_cast (" + << node->name () << "*,x);" << be_nl + << "CORBA::release (tmp);" << be_uidt_nl + << "}\n" << be_nl; + // The _narrow method *os << node->full_name () << "_ptr " << node->full_name () << "::_narrow (" << be_idt << be_idt_nl @@ -70,14 +78,14 @@ be_visitor_interface_cs::visit_interface (be_interface *node) << ")" << be_uidt_nl << "{" << be_idt_nl << "if (CORBA::is_nil (obj))" << be_idt_nl - << "return " << bt->nested_type_name (this->ctx_->scope ()) + << "return " << bt->nested_type_name (this->ctx_->scope ()) << "::_nil ();" << be_uidt_nl << "CORBA::Boolean is_a = obj->_is_a (\"" << node->repoID () << "\", ACE_TRY_ENV);" << be_nl - << "ACE_CHECK_RETURN (" << bt->nested_type_name (this->ctx_->scope ()) + << "ACE_CHECK_RETURN (" << bt->nested_type_name (this->ctx_->scope ()) << "::_nil ());" << be_nl << "if (is_a == 0)" << be_idt_nl - << "return " << bt->nested_type_name (this->ctx_->scope ()) + << "return " << bt->nested_type_name (this->ctx_->scope ()) << "::_nil ();" << be_uidt_nl; *os << "return " << bt->nested_type_name (this->ctx_->scope ()) @@ -99,15 +107,15 @@ be_visitor_interface_cs::visit_interface (be_interface *node) if (!idl_global->gen_locality_constraint ()) { *os << "if (CORBA::is_nil (obj))" << be_idt_nl - << "return " << bt->nested_type_name (this->ctx_->scope ()) + << "return " << bt->nested_type_name (this->ctx_->scope ()) << "::_nil ();" << be_uidt_nl; *os << "TAO_Stub* stub = obj->_stubobj ();" << be_nl << "stub->_incr_refcnt ();" << be_nl // Declare the default proxy. - << bt->nested_type_name (this->ctx_->scope ()) - << "_ptr default_proxy = " - << bt->nested_type_name (this->ctx_->scope ()) + << bt->nested_type_name (this->ctx_->scope ()) + << "_ptr default_proxy = " + << bt->nested_type_name (this->ctx_->scope ()) <<"::_nil ();" << be_nl; // If the policy didtates that the proxy be collocated, use the @@ -120,14 +128,14 @@ be_visitor_interface_cs::visit_interface (be_interface *node) << "_Stub_Factory_function_pointer (obj);" << be_uidt_nl<<"}"<<be_uidt_nl; - // The default proxy will either be returned else be transformed to + // The default proxy will either be returned else be transformed to // a smart one! *os << "if (CORBA::is_nil (default_proxy))" << be_idt_nl - << "ACE_NEW_RETURN (default_proxy, " - << bt->nested_type_name (this->ctx_->scope ()) - << " (stub), " << bt->nested_type_name (this->ctx_->scope ()) + << "ACE_NEW_RETURN (default_proxy, " + << bt->nested_type_name (this->ctx_->scope ()) + << " (stub), " << bt->nested_type_name (this->ctx_->scope ()) << "::_nil ());"<< be_uidt_nl - << "return TAO_" << node->flat_name () + << "return TAO_" << node->flat_name () << "_PROXY_FACTORY_ADAPTER::instance ()->create_proxy (default_proxy);" << be_uidt_nl; } @@ -141,7 +149,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node) << node->repoID () << "\")) == 0" << be_uidt_nl << ")" << be_uidt_nl << "ACE_THROW_RETURN (CORBA::MARSHAL (), " - << bt->nested_type_name (this->ctx_->scope ()) + << bt->nested_type_name (this->ctx_->scope ()) << "::_nil ());" << be_uidt_nl; // Locality constraint objects alway use "direct" collocated @@ -150,7 +158,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node) << "ACE_NEW_RETURN (" << be_idt << be_idt_nl << "retval," << be_nl << node->full_coll_name (be_interface::DIRECT) << " (" - << "ACE_reinterpret_cast (POA_" + << "ACE_reinterpret_cast (POA_" << bt->nested_type_name (this->ctx_->scope ()) << "_ptr, servant), 0)," << be_nl << "0" << be_uidt_nl << ");" << be_uidt_nl @@ -162,7 +170,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->nested_type_name (this->ctx_->scope ()) << "_ptr obj)" << be_nl << "{" << be_idt_nl << "if (!CORBA::is_nil (obj))" << be_idt_nl @@ -215,7 +223,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node) // Smart Proxy classes be_visitor_context ctx (*this->ctx_); be_visitor *visitor = 0; - + ctx.state (TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS); visitor = tao_cg->make_visitor (&ctx); if (!visitor || (node->accept (visitor) == -1)) @@ -229,7 +237,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node) } delete visitor; visitor = 0; - + // by using a visitor to declare and define the TypeCode, we have the // added advantage to conditionally not generate any code. This will be // based on the command line options. This is still TO-DO @@ -245,6 +253,6 @@ be_visitor_interface_cs::visit_interface (be_interface *node) -1); } - + return 0; } |