summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-03-31 06:49:54 +0000
committerkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-03-31 06:49:54 +0000
commit8bf495042d19a2bd8dd1a3c59b30198565e3cecc (patch)
treee2dcdd7cdaadbd0c4b6c034d3186be6a52a1d8ce
parent2fc7ed1610eeeb5f5e9f26ef87071346fd99e2c2 (diff)
downloadATCD-8bf495042d19a2bd8dd1a3c59b30198565e3cecc.tar.gz
Thu Mar 30 00:20:00 2000 Kirthika Parameswaran <kirthika@cs.wustl.edu>
-rw-r--r--TAO/TAO_IDL/be/be_type.cpp61
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cppbin5421 -> 6262 bytes
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp68
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp2
4 files changed, 100 insertions, 31 deletions
diff --git a/TAO/TAO_IDL/be/be_type.cpp b/TAO/TAO_IDL/be/be_type.cpp
index a5a7a5a0dca..e48af9ccaf5 100644
--- a/TAO/TAO_IDL/be/be_type.cpp
+++ b/TAO/TAO_IDL/be/be_type.cpp
@@ -174,8 +174,61 @@ be_type::tc_name (const char *prefix, const char *suffix)
// in the next call. (return std::string anyone?)
//
// return the type name using the ACE_NESTED_CLASS macro
+
+const char *
+be_type::nested_type_name (be_decl *use_scope,
+ const char *suffix,
+ const char *prefix)
+{
+ return nested_name (this->local_name()->get_string(),
+ this->full_name(),
+ use_scope,
+ suffix,
+ prefix);
+}
+
+// This works for the "special" names generated for smart proxy
+// classes. The form of these names is
+// scope'TAO_'+flat_name+'_Smart_Proxy_Base'.
+//
+// We can use the flat_name() method for the local_name parm but have
+// to construct the full name ourselves.
+const char *
+be_type::nested_sp_type_name (be_decl *use_scope,
+ const char *suffix,
+ const char *prefix)
+{
+ be_decl *fu_scope; // our defining scope
+ char fu_name [NAMEBUFSIZE],fl_name[NAMEBUFSIZE];
+
+ ACE_OS::memset (fu_name, '\0', NAMEBUFSIZE);
+ ACE_OS::memset (fl_name, '\0', NAMEBUFSIZE);
+
+ fu_scope = ((this->defined_in ())?
+ (be_scope::narrow_from_scope (this->defined_in ())->decl ()):
+ 0);
+
+ ACE_OS::strcat (fu_name, fu_scope->full_name ());
+ ACE_OS::strcat (fu_name, "::TAO_");
+ ACE_OS::strcat (fu_name, this->flat_name());
+
+ ACE_OS::strcat (fl_name, "TAO_");
+ ACE_OS::strcat (fl_name, this->flat_name());
+
+ return nested_name(fl_name,
+ fu_name,
+ use_scope,
+ suffix,
+ prefix);
+}
+
+// This is the real thing used by the two other methods above
const char *
-be_type::nested_type_name (be_decl *use_scope, const char *suffix, const char *prefix)
+be_type::nested_name (const char* local_name,
+ const char* full_name,
+ be_decl *use_scope,
+ const char *suffix,
+ const char *prefix)
{
// some compilers do not like generating a fully scoped name for a type that
// was defined in the same enclosing scope in which it was defined. For such,
@@ -238,7 +291,7 @@ be_type::nested_type_name (be_decl *use_scope, const char *suffix, const char *p
ACE_OS::strcat (this->nested_type_name_, prefix);
ACE_OS::strcat (this->nested_type_name_,
- this->local_name ()->get_string ());
+ local_name);
if (suffix)
ACE_OS::strcat (this->nested_type_name_, suffix);
@@ -336,7 +389,7 @@ be_type::nested_type_name (be_decl *use_scope, const char *suffix, const char *p
// append our local name
if (prefix)
ACE_OS::strcat (this->nested_type_name_, prefix);
- ACE_OS::strcat (this->nested_type_name_, this->local_name ()->get_string ());
+ ACE_OS::strcat (this->nested_type_name_, local_name);
if (suffix)
ACE_OS::strcat (this->nested_type_name_, suffix);
ACE_OS::strcat (this->nested_type_name_, ")");
@@ -347,7 +400,7 @@ be_type::nested_type_name (be_decl *use_scope, const char *suffix, const char *p
// otherwise just emit our full_name
if (prefix)
ACE_OS::strcat (this->nested_type_name_, prefix);
- ACE_OS::strcat (this->nested_type_name_, this->full_name ());
+ ACE_OS::strcat (this->nested_type_name_, full_name);
if (suffix)
ACE_OS::strcat (this->nested_type_name_, suffix);
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 1db4f17c7af..68d2068c8f9 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
Binary files differ
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 6a0078aa52e..c3f6c164778 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
@@ -231,12 +231,9 @@ int be_visitor_interface_smart_proxy_cs::visit_interface (be_interface *node)
*os << "TAO_" << node->flat_name () << "_Smart_Proxy_Base::";
*os << "TAO_"
- << node->flat_name () << "_Smart_Proxy_Base ("
- << "::" << node->full_name ()
- << "_ptr proxy)" << be_nl
- << ": base_proxy_ (proxy)" << be_nl
+ << node->flat_name () << "_Smart_Proxy_Base (void)" << be_uidt_nl
<< "{" << be_nl
- << "}\n\n";
+ << "}" << be_nl << be_nl;
os->indent ();
*os << scope->full_name ();
@@ -275,29 +272,48 @@ int be_visitor_interface_smart_proxy_cs::visit_interface (be_interface *node)
"codegen for scope failed\n"),
-1);
}
+
- os->indent ();
- *os << "#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) || \\"
- << be_idt_nl<<"defined (ACE_HAS_GNU_REPO)"<<be_uidt_nl
- << "template class ACE_Singleton<";
- *os << scope->full_name ();
+ os->indent ();
+
+ *os << node->full_name() << "_ptr" << be_nl;
+ *os << scope->full_name ();
+
+ // Only if there exists any nesting "::" is needed!
+ if (node->is_nested ())
+ *os << "::";
+
+ *os << "TAO_" << node->flat_name () << "_Smart_Proxy_Base::"
+ << "get_proxy (void)" << be_idt_nl
+ << be_uidt_nl;
+
+ *os << "{" << be_idt_nl
+ << "return ACE_dynamic_cast ( "<< node->local_name()
+ << "_ptr, base_proxy_.in ());"
+ << be_uidt_nl << "}" << be_nl << be_nl;
+
+ os->indent ();
+ *os << "#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) || \\"
+ << be_idt_nl<<"defined (ACE_HAS_GNU_REPO)"<<be_uidt_nl
+ << "template class ACE_Singleton<";
+ *os << scope->full_name ();
- // Only if there exists any nesting "::" is needed!
- if (node->is_nested ())
- *os << "::";
- *os <<"TAO_" <<node->flat_name ()
- << "_Proxy_Factory_Adapter, ACE_SYNCH_RECURSIVE_MUTEX >;"<<be_nl
- << "#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)"
- << be_nl
- << "#pragma instantiate ACE_Singleton<";
- *os << scope->full_name ();
-
- // Only if there exists any nesting "::" is needed!
- if (node->is_nested ())
- *os << "::";
- *os << "TAO_"<<node->flat_name ()
- << "_Proxy_Factory_Adapter, ACE_SYNCH_RECURSIVE_MUTEX>"<<be_nl
- << "#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */"<<be_nl<<be_nl;
+ // Only if there exists any nesting "::" is needed!
+ if (node->is_nested ())
+ *os << "::";
+ *os <<"TAO_" <<node->flat_name ()
+ << "_Proxy_Factory_Adapter, ACE_SYNCH_RECURSIVE_MUTEX >;"<<be_nl
+ << "#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)"
+ << be_nl
+ << "#pragma instantiate ACE_Singleton<";
+ *os << scope->full_name ();
+
+ // Only if there exists any nesting "::" is needed!
+ if (node->is_nested ())
+ *os << "::";
+ *os << "TAO_"<<node->flat_name ()
+ << "_Proxy_Factory_Adapter, ACE_SYNCH_RECURSIVE_MUTEX>"<<be_nl
+ << "#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */"<<be_nl<<be_nl;
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp
index 77709617ba3..a2032fb9cf2 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp
@@ -151,7 +151,7 @@ int be_visitor_operation_smart_proxy_cs::visit_operation (be_operation *node)
*os << "return ";
}
- *os << "this->base_proxy_";
+ *os << "this->get_proxy ()";
if (this->gen_invoke (ctx, node) == -1)
return -1;