diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-11-05 19:37:22 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-11-05 19:37:22 +0000 |
commit | a8f9f57074fc191319ea16212a72553f450c150e (patch) | |
tree | 6d16db428e02d2f7411c98494d60473357fb7f55 | |
parent | 58ce871c4c4a6c18fb41bf9740be495ec8ac7127 (diff) | |
download | ATCD-a8f9f57074fc191319ea16212a72553f450c150e.tar.gz |
ChangeLogTag: Fri Nov 5 13:33:36 2004 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 10 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp | 6 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp | 18 |
3 files changed, 32 insertions, 2 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index b5ef70dd638..3192248fbde 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,13 @@ +Fri Nov 5 13:33:36 2004 Jeff Parsons <j.parsons@vanderbilt.edu> + + * TAO_IDL/be/be_visitor_exception/exception_ch.cpp: + * TAO_IDL/be/be_visitor_exception/exception_cs.cpp: + + Added code generation for the override of the const + version of the _downcast() method for user exceptions. + Thanks to Simone Viani <sviani@etasistemi.it> for + reporting the missing generated method. + Fri Nov 5 10:51:08 2004 J.T. Conklin <jtc@acorntoolworks.com> * orbsvcs/orbsvcs/Makefile.am: 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 3b9f24c1263..fa4befa74ca 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp @@ -87,9 +87,11 @@ int be_visitor_exception_ch::visit_exception (be_exception *node) *os << "static " << node->local_name () - << " *_downcast (CORBA::Exception *);" << be_nl; + << " *_downcast (CORBA::Exception *);" << be_nl + << "static const " << node->local_name () + << " *_downcast (CORBA::Exception const *);" << be_nl << be_nl; - *os << "static CORBA::Exception *_alloc (void);\n" << be_nl; + *os << "static CORBA::Exception *_alloc (void);" << be_nl << be_nl; *os << "virtual CORBA::Exception *" << "_tao_duplicate (void) const;\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 83a07eaf1ef..a25c094f9fb 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp @@ -147,6 +147,7 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) << "}" << be_nl << be_nl; } + // Non-const downcast method. *os << node->name () << " *" << be_nl; *os << node->name () << "::_downcast (CORBA::Exception *_tao_excp)" << be_nl; *os << "{" << be_idt_nl; @@ -161,6 +162,23 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) *os << "return 0;" << be_uidt_nl; *os << "}" << be_uidt << be_uidt_nl; *os << "}" << be_nl << be_nl; + + // Const downcast method. + *os << "const " << node->name () << " *" << be_nl; + *os << node->name () << "::_downcast (CORBA::Exception const *_tao_excp)" + << be_nl; + *os << "{" << be_idt_nl; + *os << "if (!ACE_OS::strcmp (\"" << node->repoID () + << "\", _tao_excp->_rep_id ()))" << be_idt_nl; + *os << "{" << be_idt_nl; + *os << "return dynamic_cast<const " << node->local_name () + << " *> (_tao_excp);" << be_uidt_nl; + *os << "}" << be_uidt_nl; + *os << "else" << be_idt_nl; + *os << "{" << be_idt_nl; + *os << "return 0;" << be_uidt_nl; + *os << "}" << be_uidt << be_uidt_nl; + *os << "}" << be_nl << be_nl; // Generate the _alloc method. *os << "CORBA::Exception *" << node->name () |