From 953c66c5902e0ca903957ce6fa5ac541c218021c Mon Sep 17 00:00:00 2001 From: parsons Date: Thu, 16 Jan 2003 16:53:23 +0000 Subject: ChangeLogTag: Thu Jan 16 10:52:07 2003 Jeff Parsons --- TAO/ChangeLog | 17 ++++ .../be/be_visitor_interface/smart_proxy_ch.cpp | 13 ++- .../be/be_visitor_interface/smart_proxy_cs.cpp | 102 +++++++++++++-------- 3 files changed, 86 insertions(+), 46 deletions(-) diff --git a/TAO/ChangeLog b/TAO/ChangeLog index a61728c9000..0e71c6eb99f 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,20 @@ +Thu Jan 16 10:52:07 2003 Jeff Parsons + + * TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp: + * TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp: + + In the generated TAO_*_Proxy_Factory_Adapter class, + changed signatures of register_proxy_factory() and + unregister_proxy_factory() to return void. Error + reporting through return type is not necessary, since + native exceptions or an environment variable are + already used, and there is no code in either of these + methods that sets the return value to anything other + than 0. Although the methods are public, the class + itself has a protected constructor, and the methods + are intended for TAO internal use only. + This closes [BUGID:844]. + Wed Jan 15 18:02:49 2003 Bala * TAO version 1.3 released. diff --git a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp index 0f641c0448b..93f474bbf34 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp @@ -89,12 +89,12 @@ int be_visitor_interface_smart_proxy_ch::visit_interface (be_interface *node) << "public:" << be_idt_nl << be_nl << "friend class TAO_Singletonflat_name () << "_Proxy_Factory_Adapter, TAO_SYNCH_RECURSIVE_MUTEX>;" << be_nl << be_nl - << "int register_proxy_factory (" << be_idt << be_idt_nl + << "void register_proxy_factory (" << be_idt << be_idt_nl << "TAO_" << node->flat_name () << "_Default_Proxy_Factory *df,"<< be_nl << "int one_shot_factory = 1" << be_nl << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl << ");" << be_uidt_nl << be_nl - << "int unregister_proxy_factory (" << be_idt << be_idt_nl + << "void unregister_proxy_factory (" << be_idt << be_idt_nl << "ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl << ");" << be_uidt_nl << be_nl << node->local_name () @@ -116,12 +116,11 @@ int be_visitor_interface_smart_proxy_ch::visit_interface (be_interface *node) << "_Default_Proxy_Factory *proxy_factory_;" << be_nl << "int one_shot_factory_;" << be_nl << "int disable_factory_;"<indent (); + << "TAO_SYNCH_RECURSIVE_MUTEX lock_;" << be_uidt_nl + << "};"; - *os << "typedef TAO_Singletonflat_name () + *os << be_nl << be_nl + << "typedef TAO_Singletonflat_name () << "_Proxy_Factory_Adapter, TAO_SYNCH_RECURSIVE_MUTEX> TAO_" << node->flat_name ()<< "_PROXY_FACTORY_ADAPTER;"<defined_in ())->decl (); - *os << scope->full_name (); + *os << be_nl << be_nl + << scope->full_name (); // Only if there exists any nesting "::" is needed! if (node->is_nested ()) - *os << "::"; + { + *os << "::"; + } *os <<"TAO_"<< node->flat_name () << "_Default_Proxy_Factory::"; *os << "TAO_" @@ -108,15 +111,17 @@ int be_visitor_interface_smart_proxy_cs::visit_interface (be_interface *node) // Only if there exists any nesting "::" is needed! if (node->is_nested ()) - *os << "::"; + { + *os << "::"; + } *os << "TAO_" << node->flat_name () << "_Proxy_Factory_Adapter::"; *os << "TAO_" - << node->flat_name () << "_Proxy_Factory_Adapter (void)" <flat_name () << "_Proxy_Factory_Adapter (void)" << be_idt_nl + << ": proxy_factory_ (0)," << be_idt_nl + << "one_shot_factory_ (0)," << be_nl + << "disable_factory_ (0)" << be_uidt << be_uidt_nl + << "{" << be_nl << "}\n\n"; os->indent (); @@ -124,45 +129,57 @@ int be_visitor_interface_smart_proxy_cs::visit_interface (be_interface *node) // Only if there exists any nesting "::" is needed! if (node->is_nested ()) - *os << "::"; + { + *os << "::"; + } *os << "TAO_" << node->flat_name () << "_Proxy_Factory_Adapter::"; *os << "~TAO_" - << node->flat_name () << "_Proxy_Factory_Adapter (void)" <flat_name () << "_Proxy_Factory_Adapter (void)" << be_nl << "{" << be_idt_nl - << "// Making sure the factory which the adapter has is destroyed with it."<proxy_factory_ != 0)" <proxy_factory_;" << be_uidt<proxy_factory_ != 0)" << be_idt_nl + << "{" << be_idt_nl + << "delete this->proxy_factory_;" << be_uidt_nl + << "}" << be_uidt << be_uidt_nl << "}\n\n"; os->indent (); - *os << "int" << be_nl; + *os << "void" << be_nl; *os << scope->full_name (); // Only if there exists any nesting "::" is needed! if (node->is_nested ()) - *os << "::"; + { + *os << "::"; + } + *os << "TAO_" << node->flat_name () - << "_Proxy_Factory_Adapter::register_proxy_factory (" << be_idt_nl + << "_Proxy_Factory_Adapter::register_proxy_factory (" << be_idt << be_idt_nl << "TAO_" << node->flat_name () - << "_Default_Proxy_Factory *df," << be_idt_nl - << " int one_shot_factory" << be_nl - << " ACE_ENV_ARG_DECL" << be_idt_nl - << ")" << be_uidt << be_uidt << be_uidt_nl + << "_Default_Proxy_Factory *df," << be_nl + << "int one_shot_factory" << be_nl + << "ACE_ENV_ARG_DECL" << be_uidt_nl + << ")" << be_uidt << be_uidt_nl << "{" << be_idt_nl - << "ACE_MT (ACE_GUARD_RETURN (" - << "TAO_SYNCH_RECURSIVE_MUTEX, ace_mon," << be_idt_nl - << "this->lock_, 0));" < and replace with the new one."<lock_" << be_uidt_nl + << ")" << be_uidt << be_uidt_nl + << ");" < and replace with the new one." << be_nl << "this->unregister_proxy_factory (ACE_ENV_SINGLE_ARG_PARAMETER);" << be_nl - << "ACE_CHECK_RETURN (-1);" << be_nl - << "this->proxy_factory_ = df;"<< be_nl - << "this->one_shot_factory_ = one_shot_factory;" << be_uidt << be_uidt_nl - << "return 0;" << be_uidt << be_uidt_nl + << "ACE_CHECK;" << be_nl + << "this->proxy_factory_ = df;" << be_nl + << "this->one_shot_factory_ = one_shot_factory;" << be_uidt_nl << "}\n\n"; os->indent (); - *os << "int" << be_nl; + *os << "void" << be_nl; *os << scope->full_name (); // Only if there exists any nesting "::" is needed! @@ -170,23 +187,30 @@ int be_visitor_interface_smart_proxy_cs::visit_interface (be_interface *node) *os << "::"; *os << "TAO_"<< node->flat_name () - << "_Proxy_Factory_Adapter::unregister_proxy_factory (" << be_idt_nl - << "ACE_ENV_SINGLE_ARG_DECL_NOT_USED" << be_idt_nl + << "_Proxy_Factory_Adapter::unregister_proxy_factory (" + << be_idt << be_idt_nl + << "ACE_ENV_SINGLE_ARG_DECL_NOT_USED" << be_uidt_nl + << ")" << be_uidt_nl + << "{" << be_idt_nl + << "ACE_MT (" << be_idt << be_idt_nl + << "ACE_GUARD (" << be_idt << be_idt_nl + << "TAO_SYNCH_RECURSIVE_MUTEX," << be_nl + << "ace_mon," << be_nl + << "this->lock_" << be_uidt_nl << ")" << be_uidt << be_uidt_nl + << ");" <one_shot_factory_ == 1)" << be_idt_nl << "{" << be_idt_nl - << "ACE_MT (ACE_GUARD_RETURN (" - << "TAO_SYNCH_RECURSIVE_MUTEX, ace_mon," << be_idt_nl - << "this->lock_, 0));" <one_shot_factory_ == 1)"<disable_factory_ = 1;"<disable_factory_ = 1;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "if (" - << "this->one_shot_factory_ == 0 && this->proxy_factory_ != 0)" << be_idt_nl + << "this->one_shot_factory_ == 0 && this->proxy_factory_ != 0)" + << be_idt_nl << "{" << be_idt_nl << "delete " << "this->proxy_factory_;" << be_nl << "this->proxy_factory_ = 0;" << be_uidt_nl - << "}" << be_uidt<indent (); -- cgit v1.2.1