summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-08-20 23:24:55 +0000
committerkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-08-20 23:24:55 +0000
commitff576174d1dad18b83ff066ff831eddbb296befc (patch)
treec76babdad2d08f22b44e0ec5bb8dd22821e488a0
parenta11b10a8f1c9fbac5fb58c0683540e6c2b1ca9cd (diff)
downloadATCD-ff576174d1dad18b83ff066ff831eddbb296befc.tar.gz
rectified exception support
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp62
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp44
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/interceptors_sh.cpp54
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp35
4 files changed, 150 insertions, 45 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp
index 251aec2f3d3..c1f91ab5ce3 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp
@@ -49,6 +49,14 @@ be_visitor_operation_interceptors_ch::visit_operation (be_operation *node)
be_visitor *visitor = tao_cg->make_visitor (&ctx);
os = this->ctx_->stream ();
this->ctx_->node (node); // save the node
+
+ /* if ((node->next_state (TAO_CodeGen::TAO_OPERATION_CH,
+ node->has_extra_code_generation (TAO_CodeGen::TAO_OPERATION_CH))
+ == TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CH)
+ ||(node->next_state (TAO_CodeGen::TAO_OPERATION_CH,
+ node->has_extra_code_generation (TAO_CodeGen::TAO_OPERATION_CH))
+ == TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CH))
+ return 0;*/
// Generate the ClientRequest_Info object per operation to be used by the interecptors
os->indent (); // start with the current indentation level
@@ -147,23 +155,45 @@ be_visitor_operation_interceptors_ch::visit_operation (be_operation *node)
os->indent ();
// Here I still need to generate the other methods + private args
- *os << " virtual Dynamic::ParameterList * arguments ("<<be_idt_nl
- << "CORBA::Environment &ACE_TRY_ENV =" <<be_idt_nl
- << " TAO_default_environment ())" << be_uidt_nl
- << " ACE_THROW_SPEC ((CORBA::SystemException));"
- << be_uidt_nl << be_nl;
- os->indent ();
- *os << "virtual Dynamic::ExceptionList * exceptions "<<be_idt_nl
- <<"(CORBA::Environment &ACE_TRY_ENV = " <<be_idt_nl
- << "TAO_default_environment ())"<< be_uidt_nl
- <<"ACE_THROW_SPEC ((CORBA::SystemException));"
- << be_uidt_nl << be_nl;
+ *os << " virtual Dynamic::ParameterList * arguments (";
+ if (!idl_global->exception_support ())
+ {
+ *os << be_idt_nl <<"CORBA::Environment &ACE_TRY_ENV ="
+ <<be_idt_nl << " TAO_default_environment ())"
+ << be_uidt<< be_uidt_nl;
+
+ }
+ else
+ *os << "void)" <<be_nl;
+
+ *os << " ACE_THROW_SPEC ((CORBA::SystemException));"
+ << be_uidt_nl << be_nl;
os->indent ();
- *os << "virtual CORBA::Any * result ( "<< be_idt_nl
- <<"CORBA::Environment &ACE_TRY_ENV ="<< be_idt_nl
- << "TAO_default_environment ())"<< be_uidt_nl
- << "ACE_THROW_SPEC ((CORBA::SystemException));"
- << be_uidt_nl << be_nl;
+ *os << "virtual Dynamic::ExceptionList * exceptions ( ";
+ if (!idl_global->exception_support ())
+ {
+ *os << be_idt_nl <<"CORBA::Environment &ACE_TRY_ENV ="
+ <<be_idt_nl << " TAO_default_environment ())"
+ << be_uidt<< be_uidt_nl;
+ }
+ else
+ *os << "void)" <<be_nl;
+
+ *os << " ACE_THROW_SPEC ((CORBA::SystemException));"
+ << be_uidt_nl << be_nl;
+ os->indent ();
+ *os << "virtual CORBA::Any * result (";
+ if (!idl_global->exception_support ())
+ {
+ *os << be_idt_nl <<"CORBA::Environment &ACE_TRY_ENV ="
+ <<be_idt_nl << " TAO_default_environment ())"
+ << be_uidt<< be_uidt_nl;
+ }
+ else
+ *os << "void)" <<be_nl;
+
+ *os << " ACE_THROW_SPEC ((CORBA::SystemException));"
+ << be_uidt_nl << be_nl;
os->indent ();
*os << be_uidt_nl << "private:" <<be_nl;
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp
index e9353a82dc9..99a9d6c67ed 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp
@@ -51,6 +51,17 @@ be_visitor_operation_interceptors_cs::visit_operation (be_operation *node)
os = this->ctx_->stream ();
this->ctx_->node (node); // save the node
+ /* if ((node->next_state (TAO_CodeGen::TAO_OPERATION_CS,
+ node->has_extra_code_generation (TAO_CodeGen::TAO_OPERATION_CS))
+ == TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CS)
+ ||(node->next_state (TAO_CodeGen::TAO_OPERATION_CS,
+ node->has_extra_code_generation (TAO_CodeGen::TAO_OPERATION_CS))
+ == TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CS)
+ ||(node->next_state (TAO_CodeGen::TAO_OPERATION_CS,
+ node->has_extra_code_generation (TAO_CodeGen::TAO_OPERATION_CS))
+ == TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_RAISE_OPERATION_CS))
+ return 0;*/
+
os->indent (); // start with the current indentation level
// Generate the ClientRequest_Info object definition per operation
@@ -209,7 +220,14 @@ be_visitor_operation_interceptors_cs::visit_operation (be_operation *node)
}
*os<< "::"
- << "arguments (CORBA::Environment &)"<< be_nl
+ << "arguments (";
+ // generate the CORBA::Environment parameter for the alternative mapping
+ if (!idl_global->exception_support ())
+ *os<<"CORBA::Environment &";
+ else
+ *os << "void";
+ *os<<")"<< be_idt_nl;
+ *os<<"ACE_THROW_SPEC ((CORBA::SystemException))"<<be_uidt_nl
<< "{" << be_idt_nl
<< " // Generate the arg list on demand" << be_nl;
@@ -283,9 +301,16 @@ be_visitor_operation_interceptors_cs::visit_operation (be_operation *node)
}
*os<< "::"
- << "exceptions (CORBA::Environment &)"<< be_nl
- << "{" << be_idt_nl
- <<"// Generate the exception list on demand " << be_nl;
+ << "exceptions (";
+ // generate the CORBA::Environment parameter for the alternative mapping
+ if (!idl_global->exception_support ())
+ *os<<"CORBA::Environment &";
+ else
+ *os << "void";
+ *os<<")"<< be_idt_nl;
+ *os<<"ACE_THROW_SPEC ((CORBA::SystemException))"<<be_uidt_nl
+ << "{" << be_idt_nl
+ <<"// Generate the exception list on demand " << be_nl;
if (!node->exceptions ())
{
*os << "return 0;\n}\n\n" << be_nl;
@@ -353,8 +378,15 @@ be_visitor_operation_interceptors_cs::visit_operation (be_operation *node)
}
*os<< "::"
- << "result (CORBA::Environment &)"<< be_nl
- << "{\n // Generate the result on demand :" << be_nl;
+ << "result (";
+ // generate the CORBA::Environment parameter for the alternative mapping
+ if (!idl_global->exception_support ())
+ *os<<"CORBA::Environment &";
+ else
+ *os << "void";
+ *os<<")"<< be_idt_nl;
+ *os<<"ACE_THROW_SPEC ((CORBA::SystemException))"<<be_uidt_nl
+ << "{\n // Generate the result on demand :" << be_nl;
bt = be_type::narrow_from_decl (node->return_type ());
if (this->void_return_type (bt))
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_sh.cpp
index 95ef1977742..e50ef7f0390 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_sh.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_sh.cpp
@@ -147,23 +147,45 @@ be_visitor_operation_interceptors_sh::visit_operation (be_operation *node)
os->indent ();
// Here I still need to generate the other methods + private args
- *os << " virtual Dynamic::ParameterList * arguments ("<<be_idt_nl
- << "CORBA::Environment &ACE_TRY_ENV =" <<be_idt_nl
- << " TAO_default_environment ())" << be_uidt_nl
- << " ACE_THROW_SPEC ((CORBA::SystemException));"
- << be_uidt_nl << be_nl;
- os->indent ();
- *os << "virtual Dynamic::ExceptionList * exceptions "<<be_idt_nl
- <<"(CORBA::Environment &ACE_TRY_ENV = " <<be_idt_nl
- << "TAO_default_environment ())"<< be_uidt_nl
- <<"ACE_THROW_SPEC ((CORBA::SystemException));"
- << be_uidt_nl << be_nl;
+ *os << " virtual Dynamic::ParameterList * arguments (";
+ if (!idl_global->exception_support ())
+ {
+ *os << be_idt_nl <<"CORBA::Environment &ACE_TRY_ENV ="
+ <<be_idt_nl << " TAO_default_environment ())"
+ << be_uidt<< be_uidt_nl;
+ }
+ else
+ *os << "void)" <<be_nl;
+
+ *os << " ACE_THROW_SPEC ((CORBA::SystemException));"
+ << be_uidt_nl << be_nl;
os->indent ();
- *os << "virtual CORBA::Any * result ( "<< be_idt_nl
- <<"CORBA::Environment &ACE_TRY_ENV ="<< be_idt_nl
- << "TAO_default_environment ())"<< be_uidt_nl
- << "ACE_THROW_SPEC ((CORBA::SystemException));"
- << be_uidt_nl << be_nl;
+ *os << "virtual Dynamic::ExceptionList * exceptions ( ";
+ if (!idl_global->exception_support ())
+ {
+ *os << be_idt_nl <<"CORBA::Environment &ACE_TRY_ENV ="
+ <<be_idt_nl << " TAO_default_environment ())"
+ << be_uidt<< be_uidt_nl;
+ }
+ else
+ *os << "void)" <<be_nl;
+
+ *os << " ACE_THROW_SPEC ((CORBA::SystemException));"
+ << be_uidt_nl << be_nl;
+ os->indent ();
+ *os << "virtual CORBA::Any * result (";
+ if (!idl_global->exception_support ())
+ {
+ *os << be_idt_nl <<"CORBA::Environment &ACE_TRY_ENV ="
+ <<be_idt_nl << " TAO_default_environment ())"
+ << be_uidt<< be_uidt_nl;
+ }
+ else
+ *os << "void)" <<be_nl;
+
+ *os << " ACE_THROW_SPEC ((CORBA::SystemException));"
+ << be_uidt_nl << be_nl;
+
os->indent ();
*os << be_uidt_nl << "private:" <<be_nl;
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 fc323318374..bc6d15386fd 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp
@@ -207,9 +207,16 @@ be_visitor_operation_interceptors_ss::visit_operation (be_operation *node)
}
*os<< "::"
- << "arguments (CORBA::Environment &)"<< be_nl
- << "{" <<be_idt_nl
- <<" // Generate the arg list on demand" << be_nl;
+ << "arguments (";
+ // generate the CORBA::Environment parameter for the alternative mapping
+ if (!idl_global->exception_support ())
+ *os<<"CORBA::Environment &";
+ else
+ *os << "void";
+ *os<<")"<< be_idt_nl;
+ *os<<"ACE_THROW_SPEC ((CORBA::SystemException))"<<be_uidt_nl
+ << "{" <<be_idt_nl
+ <<" // Generate the arg list on demand" << be_nl;
if (node->argument_count () == 0)
{
@@ -281,8 +288,15 @@ be_visitor_operation_interceptors_ss::visit_operation (be_operation *node)
}
*os<< "::"
- << "exceptions (CORBA::Environment &)"<< be_nl
- << "{\n // Generate the exception list on demand" << be_nl;
+ << "exceptions (";
+ // generate the CORBA::Environment parameter for the alternative mapping
+ if (!idl_global->exception_support ())
+ *os<<"CORBA::Environment &";
+ else
+ *os << "void";
+ *os<<")"<< be_idt_nl;
+ *os<<"ACE_THROW_SPEC ((CORBA::SystemException))"<<be_uidt_nl
+ << "{\n // Generate the exception list on demand" << be_nl;
if (!node->exceptions ())
{
*os << "return 0;\n}\n\n" << be_nl;
@@ -350,8 +364,15 @@ be_visitor_operation_interceptors_ss::visit_operation (be_operation *node)
}
*os<< "::"
- << "result (CORBA::Environment &)"<< be_nl
- << "{\n // Generate the result on demand" << be_nl;
+ << "result (";
+ // generate the CORBA::Environment parameter for the alternative mapping
+ if (!idl_global->exception_support ())
+ *os<<"CORBA::Environment &";
+ else
+ *os << "void";
+ *os<<")"<< be_idt_nl;
+ *os<<"ACE_THROW_SPEC ((CORBA::SystemException))"<<be_uidt_nl
+ << "{\n // Generate the result on demand" << be_nl;
bt = be_type::narrow_from_decl (node->return_type ());
if (this->void_return_type (bt))
{