summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp102
1 files changed, 63 insertions, 39 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp
index 0f9bf904793..0c22d6df611 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp
@@ -54,11 +54,14 @@ int be_visitor_interface_smart_proxy_cs::visit_interface (be_interface *node)
// are in the same scope as the proxy.
be_decl* scope = be_scope::narrow_from_scope (node->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)" <<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
+ << node->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)" <<be_nl
+ << node->flat_name () << "_Proxy_Factory_Adapter (void)" << be_nl
<< "{" << be_idt_nl
- << "// Making sure the factory which the adapter has is destroyed with it."<<be_nl
- << "if (this->proxy_factory_ != 0)" <<be_idt_nl
- << "delete this->proxy_factory_;" << be_uidt<<be_uidt_nl
+ << "// Making sure the factory which the adapter"
+ << " has is destroyed with it."
+ << be_nl
+ << "if (this->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));" <<be_uidt_nl
- << "// Remove any existing <proxy_factory_> and replace with the new one."<<be_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
+ << ");" <<be_uidt_nl << be_nl
+ << "// Remove any existing <proxy_factory_> 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
+ << ");" <<be_uidt_nl << be_nl
+ << "if (this->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));" <<be_uidt_nl
- << "if (this->one_shot_factory_ == 1)"<<be_idt_nl
- << "this->disable_factory_ = 1;"<<be_uidt_nl <<be_nl
+ << "this->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<<be_uidt_nl
- << "return 0;" << be_uidt << be_uidt_nl
+ << "}" << be_uidt << be_uidt_nl
<< "}\n\n";
os->indent ();