summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-08-08 20:18:39 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-08-08 20:18:39 +0000
commit4ea5b814a90b65d5d6db262a4ecaca8b60625b48 (patch)
tree9cd35684243e9c75e1a2055a49ce1e0127c8b1ee
parent7bca99435d299a406e351957befd5e9511eb8390 (diff)
downloadATCD-4ea5b814a90b65d5d6db262a4ecaca8b60625b48.tar.gz
ChangeLogTag: Tue Aug 8 15:10:45 2000 Jeff Parsons <parsons@cs.wustl.edu>
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp3
-rw-r--r--TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp63
2 files changed, 46 insertions, 20 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp
index 934286cb05b..5e7f0bf9132 100644
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp
@@ -116,7 +116,8 @@ int be_visitor_exception_ch::visit_exception (be_exception *node)
*os << be_nl
<< "// = TAO extension" << be_nl
- << "static CORBA::Exception *_alloc (void);\n" << be_uidt_nl
+ << "static CORBA::Exception *_alloc (void);" << be_nl
+ << "virtual CORBA::TypeCode_ptr _type (void) const;" << be_uidt_nl
<< "}; // exception " << node->name ()
<< "\n" << be_nl;
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp
index 996b04e6588..9ceffba0582 100644
--- a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp
@@ -64,8 +64,8 @@ int be_visitor_exception_cs::visit_exception (be_exception *node)
*os << "// default constructor" << be_nl;
*os << node->name () << "::" << node->local_name () << " (void)" << be_nl;
if (!node->is_local ())
- *os << " : CORBA_UserException ("
- << "::" << node->tc_name () << ")\n";
+ *os << " : CORBA_UserException (\""
+ << node->repoID () << "\")\n";
*os << "{" << be_nl;
*os << "}\n\n";
@@ -93,23 +93,30 @@ int be_visitor_exception_cs::visit_exception (be_exception *node)
*os << node->name () << "::" << node->local_name () << " (const ::"
<< node->name () << " &_tao_excp)" << be_nl;
*os << " : CORBA_UserException ("
- << "_tao_excp._type ())" << be_nl;
+ << "_tao_excp._id ())" << be_nl;
*os << "{\n";
- os->incr_indent ();
- // assign each individual member
+
be_visitor_context ctx (*this->ctx_);
ctx.state (TAO_CodeGen::TAO_EXCEPTION_CTOR_ASSIGN_CS);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
+ be_visitor *visitor = 0;
+
+ if (node->nmembers () > 0)
{
+ os->incr_indent ();
+ // assign each individual member
+ visitor = tao_cg->make_visitor (&ctx);
+ if (!visitor || (node->accept (visitor) == -1))
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_exception_cs::"
+ "visit_exception -"
+ "codegen for scope failed\n"), -1);
+ }
delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_exception_cs::"
- "visit_exception -"
- "codegen for scope failed\n"), -1);
+ os->decr_indent ();
}
- delete visitor;
- os->decr_indent ();
+
*os << "}\n\n";
// assignment operator
@@ -166,8 +173,9 @@ int be_visitor_exception_cs::visit_exception (be_exception *node)
if (!node->is_local ())
{
*os << "TAO_OutputCDR &cdr," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV) const"
- << be_uidt << be_uidt_nl
+ << "CORBA::Environment &ACE_TRY_ENV"
+ << be_uidt_nl
+ << ") const" << be_uidt_nl
<< "{" << be_idt_nl
<< "if (cdr << *this)" << be_nl
<< " return;" << be_nl;
@@ -197,8 +205,9 @@ int be_visitor_exception_cs::visit_exception (be_exception *node)
if (!node->is_local ())
{
*os << "TAO_InputCDR &cdr," << be_nl
- << "CORBA::Environment &ACE_TRY_ENV)"
- << be_uidt << be_uidt_nl
+ << "CORBA::Environment &ACE_TRY_ENV"
+ << be_uidt_nl
+ << ")" << be_uidt_nl
<< "{" << be_idt_nl
<< "if (cdr >> *this)" << be_nl
<< " return;" << be_nl;
@@ -253,8 +262,8 @@ int be_visitor_exception_cs::visit_exception (be_exception *node)
if (!node->is_local ())
*os << " : CORBA_UserException "
- << " (CORBA::TypeCode::_duplicate (" << node->tc_name ()
- << "))" << be_nl;
+ << " (CORBA::string_dup (\"" << node->repoID ()
+ << "\"))" << be_nl;
*os << "{\n";
os->incr_indent ();
// assign each individual member. We need yet another state
@@ -296,6 +305,22 @@ int be_visitor_exception_cs::visit_exception (be_exception *node)
}
}
+ *os << "\n// TAO extension - the virtual _type method" << be_nl;
+ *os << "CORBA::TypeCode_ptr " << node->name ()
+ << "::_type (void) const" << be_nl;
+ *os << "{" << be_idt_nl;
+
+ if (!node->is_local () && idl_global->tc_support ())
+ {
+ *os << "return ::" << node->tc_name () << ";" << be_uidt_nl;
+ }
+ else
+ {
+ *os << "return CORBA::TypeCode::_nil ();" << be_uidt_nl;
+ }
+
+ *os << "}" << be_nl;
+
node->cli_stub_gen (I_TRUE);
}