From bb7edf7dba764709fd28aabc6706e16eab9cc86f Mon Sep 17 00:00:00 2001 From: parsons Date: Thu, 3 Mar 2005 16:43:56 +0000 Subject: ChangeLogTag: Thu Mar 3 10:31:10 2005 Jeff Parsons --- TAO/CIAO/CIDLC/ExecImplGenerator.cpp | 3 +- TAO/CIAO/CIDLC/ExecImplHeaderGenerator.cpp | 23 ++++++++------ TAO/CIAO/CIDLC/ServantSourceGenerator.cpp | 48 ++++++++++++++++++++---------- TAO/CIAO/ChangeLog | 29 ++++++++++++++++++ 4 files changed, 78 insertions(+), 25 deletions(-) diff --git a/TAO/CIAO/CIDLC/ExecImplGenerator.cpp b/TAO/CIAO/CIDLC/ExecImplGenerator.cpp index 45762e37269..e68bc5a6206 100644 --- a/TAO/CIAO/CIDLC/ExecImplGenerator.cpp +++ b/TAO/CIAO/CIDLC/ExecImplGenerator.cpp @@ -134,6 +134,7 @@ ExecImplGenerator::compute_export_macro (const fs::path& file_path) // Modify a copy of the filename string. export_macro_ = file_name_; + // Convert filename string to upper case. transform (export_macro_.begin (), export_macro_.end (), @@ -143,7 +144,7 @@ ExecImplGenerator::compute_export_macro (const fs::path& file_path) // Replace the suffix. export_macro_ = regex::perl_s (export_macro_, - "/(\\.(IDL|CIDL))?$/_EXEC_Export/"); + "/(\\.(IDL|CIDL|CDL))?$/_EXEC_Export/"); // Replace any remaining '.' in the string with '_'. export_macro_ = regex::perl_s (export_macro_, diff --git a/TAO/CIAO/CIDLC/ExecImplHeaderGenerator.cpp b/TAO/CIAO/CIDLC/ExecImplHeaderGenerator.cpp index 1f2ec8b399e..4a0be5b4282 100644 --- a/TAO/CIAO/CIDLC/ExecImplHeaderGenerator.cpp +++ b/TAO/CIAO/CIDLC/ExecImplHeaderGenerator.cpp @@ -1204,9 +1204,9 @@ ExecImplHeaderEmitter::pre (TranslationUnit&) upcase); string guard = - "CIAO_" - + regex::perl_s (uc_file_name, - "/(\\.(IDL|CIDL))?$/" + uc_file_suffix + "/"); + "CIAO_" + + regex::perl_s (uc_file_name, + "/(\\.(IDL|CIDL|CDL))?$/" + uc_file_suffix + "/"); // Replace any remaining '.' with '_'. guard = regex::perl_s (guard, "/\\./_/"); @@ -1218,18 +1218,23 @@ ExecImplHeaderEmitter::pre (TranslationUnit&) string file_suffix = cl_.get_value ("svnt-hdr-file-suffix", "_svnt.h"); - file_name = regex::perl_s (file_name, - "/(\\.(idl|cidl|cdl))?$/" - + file_suffix - + "/"); + string svnt_file_name = regex::perl_s (file_name, + "/(\\.(idl|cidl|cdl))?$/" + + file_suffix + + "/"); - os << "#include \"" << file_name << "\"" << endl << endl; + os << "#include \"" << svnt_file_name << "\"" << endl << endl; os << "#if !defined (ACE_LACKS_PRAGMA_ONCE)" << endl << "# pragma once" << endl << "#endif /* ACE_LACKS_PRAGMA_ONCE */" << endl << endl; + + string default_export_include = + regex::perl_s (file_name, + "/(\\.(idl|cidl|cdl))?$/_exec_export.h/"); - string export_include = cl_.get_value ("exec-export-include", ""); + string export_include = cl_.get_value ("exec-export-include", + default_export_include); if (!export_include.empty ()) { diff --git a/TAO/CIAO/CIDLC/ServantSourceGenerator.cpp b/TAO/CIAO/CIDLC/ServantSourceGenerator.cpp index b4c9773a73f..dc46541e2c1 100644 --- a/TAO/CIAO/CIDLC/ServantSourceGenerator.cpp +++ b/TAO/CIAO/CIDLC/ServantSourceGenerator.cpp @@ -789,14 +789,15 @@ namespace << STRS[ENV_SNGL_SRC] << ")" << endl << STRS[EXCP_SNGL] << endl << "{" - << u.scoped_name () << "Connections *tmp_retv;" + << u.scoped_name () << "Connections *tmp_retv = 0;" << "ACE_NEW_THROW_EX (" << endl << "tmp_retv," << endl - << u.scoped_name () << "Connections (this->ciao_uses_" + << u.scoped_name () << "Connections (" << endl + << "this->ciao_uses_" << u.name () << "_.current_size ())," << endl << "CORBA::NO_MEMORY ());" << endl << endl << u.scoped_name () << "Connections_var retv" - << " = tmp_retv ;" << endl + << " = tmp_retv;" << endl << "retv->length (this->ciao_uses_" << u.name () << "_.current_size ());" << endl; @@ -835,7 +836,7 @@ namespace os << "return retv._retn ();" << endl << "}"; - os << "::Components::Cookie *" << endl + os << STRS[COMP_CK] << " *" << endl << scope_.name () << "_Context::connect_" << u.name () << " (" << endl; @@ -870,13 +871,14 @@ namespace os << "conn._retn ();" << endl; - os << "Components::Cookie_var retv;" + os << STRS[COMP_CK] << " * ck = 0;" << "ACE_NEW_THROW_EX (" << endl - << "retv.out ()," << endl + << "ck," << endl << "CIAO::Map_Key_Cookie (key)," << endl << "CORBA::NO_MEMORY ());" << endl; + - os << "return retv._retn ();" << endl + os << "return ck;" << endl << "}"; Traversal::MultiUserData::belongs (u, belongs_); @@ -884,7 +886,7 @@ namespace os << "_ptr" << endl << scope_.name () << "_Context::disconnect_" << u.name () << " (" << endl - << "::Components::Cookie * ck" << endl + << STRS[COMP_CK] << " * ck" << endl << STRS[ENV_SRC] << ")" << endl << STRS[EXCP_START] << endl << STRS[EXCP_SYS] << "," << endl @@ -1007,9 +1009,12 @@ namespace << "this->ciao_publishes_" << p.name () << "_map_.bind (sub.in (), key);" << "sub._retn ();" << endl - << STRS[COMP_CK] << "_var retv = " - << "new ::CIAO::Map_Key_Cookie (key);" - << "return retv._retn ();" << endl + << STRS[COMP_CK] << " * retv = 0;" + << "ACE_NEW_THROW_EX (" << endl + << "retv," << endl + << "::CIAO::Map_Key_Cookie (key)," << endl + << "CORBA::NO_MEMORY ());" << endl + << "return retv;" << endl << "}"; Traversal::PublisherData::belongs (p, belongs_); @@ -1535,7 +1540,7 @@ namespace virtual void traverse (SemanticGraph::MultiUser& u) { - os << "::Components::Cookie *" << endl + os << STRS[COMP_CK] << " *" << endl << scope_.name () << "_Servant::connect_" << u.name () << " (" << endl; @@ -1559,7 +1564,7 @@ namespace os << "_ptr" << endl << scope_.name () << "_Servant::disconnect_" << u.name () << " (" << endl - << "::Components::Cookie * ck" << endl + << STRS[COMP_CK] << " * ck" << endl << STRS[ENV_SRC] << ")" << endl << STRS[EXCP_START] << endl << STRS[EXCP_SYS] << "," << endl @@ -2282,6 +2287,18 @@ namespace Traversal::EventType event_type; consumer_belongs.node_traverser (event_type); + Traversal::Inherits inherits; + inherits.node_traverser (event_type); + event_type.edge_traverser (inherits); + + Traversal::Supports supports; + supports.node_traverser (event_type); + event_type.edge_traverser (supports); + + // (JP) The above two need front end support, + // and we need to check for private members + // as well. + Traversal::Defines defines; event_type.edge_traverser (defines); @@ -2440,8 +2457,9 @@ namespace << " : ACE_NESTED_CLASS (CIAO, Servant_Impl_Base (c))," << endl << " comp_svnt_base (exe, c)" << endl << "{" - << "this->context_ = " - << "new " << t.name () << "_Context (h, c, this);" << endl; + << "ACE_NEW (" << endl + << "this->context_," << endl + << t.name () << "_Context (h, c, this));" << endl; // Generate the macro to register a value factory for each // eventtype consumed. diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index 64a75541f4e..f8ed65cc6cc 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,3 +1,32 @@ +Thu Mar 3 10:31:10 2005 Jeff Parsons + + * CIDLC/ExecImplGenerator.cpp: + * CIDLC/ExecImplHeaderGenerator.cpp: + + - Added support for .cdl file extension similar to + support already in the servant generators. + + - Fixed bug in export include generation. + + Thanks to Matt Emerson , + Ming Xiong , James Hill + and Stoyan Paunov + for reporting these + problems. + + * CIDLC/ServantSourceGenerator.cpp: + + - Replaced remaining instances of generation of 'new' with + 'ACE_NEW' and changed code generation to reduce line + lengths. + + - Changed code generation of Cookie_var for multiplex + receptacles to pass a Cookie* to ACE_NEW, then + assign to the _var, instead of passing in _var.out(), + which causes the allocation to fail on some platforms. + Thanks to Don Busch for reporting + the problem. + Mon Mar 03 09:37:23 2005 Gan Deng * DAnCE/examples/Hello/descriptors/Hello.cdp -- cgit v1.2.1