summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp172
1 files changed, 70 insertions, 102 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp
index 978553d13d0..5cc1015150a 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp
@@ -740,63 +740,47 @@ be_visitor_operation_interceptors_ss::
}
}
- *os << "::exceptions (CORBA::Environment &ACE_TRY_ENV)"<< be_idt_nl
+ *os << "::exceptions (CORBA::Environment &ACE_TRY_ENV)" << be_idt_nl
<< "ACE_THROW_SPEC ((CORBA::SystemException))" << be_uidt_nl
- << "{" << be_idt_nl;
+ << "{" << be_idt_nl
+ << "// Generate the exception list on demand." << be_nl
+ << "Dynamic::ExceptionList *exception_list =" << be_idt_nl
+ << "TAO_RequestInfo_Util::make_exception_list (ACE_TRY_ENV);"
+ << be_uidt_nl
+ << "ACE_CHECK_RETURN (0);" << be_nl
+ << be_nl;
- if (be_global->tc_support ())
+ if (!node->exceptions ())
{
- *os << "// Generate the exception list on demand." << be_nl
- << "Dynamic::ExceptionList *exception_list =" << be_idt_nl
- << "TAO_RequestInfo_Util::make_exception_list (ACE_TRY_ENV);"
- << be_uidt_nl
- << "ACE_CHECK_RETURN (0);" << be_nl
- << be_nl;
-
- if (!node->exceptions ())
- {
- *os << "return exception_list;";
- }
- else
- {
- *os << "Dynamic::ExceptionList_var safe_exception_list = "
- << "exception_list;" << be_nl;
-
- // We change our scope to be able to generate the exceptionlist.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_EXCEPTLIST);
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for exceptlist failed\n"),
- -1);
- }
-
- delete visitor;
-
- *os << be_nl
- << "return safe_exception_list._retn ();";
- }
+ *os << "return exception_list;" << be_uidt_nl;
}
else
{
- if (be_global->use_raw_throw ())
- {
- *os << "throw (CORBA::NO_IMPLEMENT ());" << be_nl
- << "return 0;";
- }
- else
+ *os << "Dynamic::ExceptionList_var safe_exception_list = "
+ << "exception_list;" << be_nl;
+
+ // We change our scope to be able to generate the exceptionlist.
+ ctx = *this->ctx_;
+ ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_EXCEPTLIST);
+ visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor || (node->accept (visitor) == -1))
{
- *os << "ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);";
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_operation_cs::"
+ "visit_operation - "
+ "codegen for exceptlist failed\n"),
+ -1);
}
+
+ delete visitor;
+
+ *os << be_nl
+ << "return safe_exception_list._retn ();" << be_uidt_nl;
}
- *os << be_uidt_nl << "}\n\n" << be_nl;
+ *os << "}\n\n";
os->decr_indent ();
@@ -839,71 +823,55 @@ be_visitor_operation_interceptors_ss::
*os << "::result (CORBA::Environment &ACE_TRY_ENV)"<< be_idt_nl
<< "ACE_THROW_SPEC ((CORBA::SystemException))" << be_uidt_nl
- << "{" << be_idt_nl;
+ << "{" << be_idt_nl
+ << "// Generate the result on demand." << be_nl;
- if (be_global->any_support ())
+ bt = be_type::narrow_from_decl (node->return_type ());
+
+ if (this->void_return_type (bt))
+ {
+ // Return an Any with tk_void TypeCode.
+ *os << "CORBA::Boolean tk_void_any = 1;" << be_nl
+ << "CORBA::Any *result_any =" << be_idt_nl
+ << "TAO_RequestInfo_Util::make_any (tk_void_any, ACE_TRY_ENV);"
+ << be_uidt_nl
+ << "ACE_CHECK_RETURN (0);" << be_nl
+ << be_nl
+ << "return result_any;" << be_uidt_nl;
+ }
+ else
{
- *os << "// Generate the result on demand." << be_nl;
+ *os << "CORBA::Boolean tk_void_any = 0;" << be_nl
+ << "CORBA::Any *result_any =" << be_idt_nl
+ << "TAO_RequestInfo_Util::make_any (tk_void_any, ACE_TRY_ENV);"
+ << be_uidt_nl
+ << "ACE_CHECK_RETURN (0);" << be_nl
+ << be_nl
+ << "CORBA::Any_var safe_result_any = "
+ << "result_any;" << be_nl << be_nl;
- bt = be_type::narrow_from_decl (node->return_type ());
+ // Generate the insertion of result into Any.
+ ctx = *this->ctx_;
+ ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT);
+ visitor = tao_cg->make_visitor (&ctx);
- if (this->void_return_type (bt))
+ if (!visitor || (bt->accept (visitor) == -1))
{
- // Return an Any with tk_void TypeCode.
- *os << "CORBA::Boolean tk_void_any = 1;" << be_nl
- << "CORBA::Any *result_any =" << be_idt_nl
- << "TAO_RequestInfo_Util::make_any (tk_void_any, ACE_TRY_ENV);"
- << be_uidt_nl
- << "ACE_CHECK_RETURN (0);" << be_nl
- << be_nl
- << "return result_any;";
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_operation_cs::"
+ "visit_operation - "
+ "codegen for result failed\n"),
+ -1);
}
- else
- {
- *os << "CORBA::Boolean tk_void_any = 0;" << be_nl
- << "CORBA::Any *result_any =" << be_idt_nl
- << "TAO_RequestInfo_Util::make_any (tk_void_any, ACE_TRY_ENV);"
- << be_uidt_nl
- << "ACE_CHECK_RETURN (0);" << be_nl
- << be_nl
- << "CORBA::Any_var safe_result_any = "
- << "result_any;" << be_nl << be_nl;
-
- // Generate the insertion of result into Any.
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT);
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
- "visit_operation - "
- "codegen for result failed\n"),
- -1);
- }
- delete visitor;
+ delete visitor;
- *os << be_nl
- << "return safe_result_any._retn ();";
- }
- }
- else
- {
- if (be_global->use_raw_throw ())
- {
- *os << "throw (CORBA::NO_IMPLEMENT ());" << be_nl
- << "return 0;";
- }
- else
- {
- *os << "ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);";
- }
+ *os << be_nl
+ << "return safe_result_any._retn ();" << be_uidt_nl;
}
- *os << be_uidt_nl << "}\n\n";
+ *os << "}\n\n";
// -----------------------------------------------------------------
// PortableInterceptor::ServerRequestInfo::target_most_derived_interface()