summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-01-18 17:49:21 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-01-18 17:49:21 +0000
commit1d570fa18f49a13a70344d4a4c20d9aa243b74aa (patch)
treeee8f0602c68d0a9068ba3b0afdd57756139f08a2
parentd0832e84df1aad7f5c2b526f95f62289de3e1025 (diff)
downloadATCD-1d570fa18f49a13a70344d4a4c20d9aa243b74aa.tar.gz
ChangeLogTag:Fri Jan 18 09:32:57 2002 Carlos O'Ryan <coryan@uci.edu>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a33
-rw-r--r--TAO/TAO_IDL/be/be_interface.cpp122
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp26
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp16
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp25
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp26
-rw-r--r--TAO/TAO_IDL/be_include/be_interface.h22
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/amh_ss.h1
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/interface_ss.h1
10 files changed, 164 insertions, 112 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index d303f4e53ee..4da10e4ee43 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,36 @@
+Fri Jan 18 09:32:57 2002 Carlos O'Ryan <coryan@uci.edu>
+
+ * TAO_IDL/be_include/be_interface.h:
+ * TAO_IDL/be/be_interface.cpp:
+ Improved comments in generated code.
+ New gen_operation_table() helper method, it can generate an
+ operation table with a different class name (and class flat
+ name). This is useful for the AMH code generation.
+ Changed the related methods to take a flat_name argument.
+
+ * TAO_IDL/be/be_visitor_interface/amh_sh.cpp:
+ Do not create a temporary "AMH_*" node, the visitors deal with
+ the original interface node directly.
+ Fixed generation of the _this() method to use the new
+ TAO_ENV_ARG_* macros.
+
+ * TAO_IDL/be_include/be_visitor_interface/interface_ss.h:
+ * TAO_IDL/be/be_visitor_interface/interface_ss.cpp:
+ * TAO_IDL/be_include/be_visitor_interface/amh_ss.h:
+ * TAO_IDL/be/be_visitor_interface/amh_ss.cpp:
+ Make the "flat_name" customizable in the be_visitor_interface_ss
+ vistor. This is used to generate an AMH-specific flat name and
+ take advantage of the new gen_operation_table() helper method in
+ be_interface.
+
+ * TAO_IDL/be/be_visitor_operation/amh_sh.cpp:
+ Since there is no AMH_* node anymore then we need to add the
+ AMH_ prefix explicitly.
+
+ * TAO_IDL/be/be_visitor_operation/amh_ss.cpp:
+ Removed traditional visitors, but I still need to add the new
+ ones.
+
Fri Jan 18 09:23:42 2002 Frank Hunleth <fhunleth@cs.wustl.edu>
* orbsvcs/orbsvcs/PortableGroup.dsp:
diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp
index 6a0a865396c..a681b0e7552 100644
--- a/TAO/TAO_IDL/be/be_interface.cpp
+++ b/TAO/TAO_IDL/be/be_interface.cpp
@@ -931,9 +931,11 @@ be_interface::gen_out_impl (char *interface_local_name,
ci->indent ();
*ci << "// *************************************************************"
- << be_nl;
- *ci << "// Operations for class " << fname << be_nl;
- *ci << "// *************************************************************"
+ << be_nl
+ << "// fname" << be_nl
+ << "// TAO_IDL - Generated from "
+ << __FILE__ << ":" << __LINE__ << be_nl
+ << "// *************************************************************"
<< be_nl << be_nl;
// Constructor from a _ptr.
@@ -1021,9 +1023,9 @@ be_interface::gen_out_impl (char *interface_local_name,
return 0;
}
-// Helper.
int
-be_interface::gen_operation_table (void)
+be_interface::gen_operation_table (const char *flat_name,
+ const char *skeleton_class_name)
{
TAO_OutStream *os; // output stream.
TAO_NL nl; // end line.
@@ -1041,7 +1043,7 @@ be_interface::gen_operation_table (void)
os->indent ();
// Start the table generation.
- *os << "static const TAO_operation_db_entry " << this->flat_name () <<
+ *os << "static const TAO_operation_db_entry " << flat_name <<
"_operations [] = {\n";
os->incr_indent (0);
@@ -1055,33 +1057,33 @@ be_interface::gen_operation_table (void)
// Generate the skeleton for the is_a method.
os->indent ();
- *os << "{\"_is_a\", &" << this->full_skel_name () << "::_is_a_skel},\n";
+ *os << "{\"_is_a\", &" << skeleton_class_name
+ << "::_is_a_skel},\n";
this->skel_count_++;
os->indent ();
- *os << "{\"_non_existent\", &" << this->full_skel_name () << "::_non_existent_skel}\n";
+ *os << "{\"_non_existent\", &" << skeleton_class_name
+ << "::_non_existent_skel}\n";
this->skel_count_++;
os->decr_indent ();
*os << "};" << nl << nl;
- // XXXASG - this code should be based on using different strategies for
- // demux - for next release
- *os << "static const CORBA::Long _tao_" << this->flat_name ()
+ *os << "static const CORBA::Long _tao_" << flat_name
<< "_optable_size = sizeof (ACE_Hash_Map_Entry<const char *,"
<< " TAO_Skeleton>) * (" << (3*this->skel_count_)
<< ");" << be_nl;
- *os << "static char _tao_" << this->flat_name () << "_optable_pool "
- << "[_tao_" << this->flat_name () << "_optable_size];" << be_nl;
- *os << "static ACE_Static_Allocator_Base _tao_" << this->flat_name ()
- << "_allocator (_tao_" << this->flat_name () << "_optable_pool, "
- << "_tao_" << this->flat_name () << "_optable_size);" << be_nl;
+ *os << "static char _tao_" << flat_name << "_optable_pool "
+ << "[_tao_" << flat_name << "_optable_size];" << be_nl;
+ *os << "static ACE_Static_Allocator_Base _tao_" << flat_name
+ << "_allocator (_tao_" << flat_name << "_optable_pool, "
+ << "_tao_" << flat_name << "_optable_size);" << be_nl;
*os << "static TAO_Dynamic_Hash_OpTable tao_"
- << this->flat_name () << "_optable " << "(" << be_idt << be_idt_nl
- << this->flat_name () << "_operations," << be_nl
+ << flat_name << "_optable " << "(" << be_idt << be_idt_nl
+ << flat_name << "_operations," << be_nl
<< this->skel_count_ << "," << be_nl
<< 2*this->skel_count_ << "," << be_nl
- << "&_tao_" << this->flat_name () << "_allocator" << be_uidt_nl
+ << "&_tao_" << flat_name << "_allocator" << be_uidt_nl
<< ");" << be_uidt_nl;
break;
@@ -1100,14 +1102,14 @@ be_interface::gen_operation_table (void)
char *temp_file = 0;
ACE_NEW_RETURN (temp_file,
char [ACE_OS::strlen (idl_global->temp_dir ()) +
- ACE_OS::strlen (this->flat_name ()) +
+ ACE_OS::strlen (flat_name) +
ACE_OS::strlen (".gperf") + 1],
-1);
ACE_OS::sprintf (temp_file,
"%s%s.gperf",
idl_global->temp_dir (),
- this->flat_name ());
+ flat_name);
// Save this file name with the codegen singleton.
tao_cg->gperf_input_filename (temp_file);
@@ -1166,26 +1168,26 @@ be_interface::gen_operation_table (void)
// Generate the skeleton for the is_a method.
os->indent ();
*os << "_is_a" << ", &"
- << this->full_skel_name ()
+ << skeleton_class_name
<< "::_is_a_skel\n";
this->skel_count_++;
os->indent ();
*os << "_non_existent, &"
- << this->full_skel_name ()
+ << skeleton_class_name
<< "::_non_existent_skel\n";
this->skel_count_++;
os->indent ();
*os << "_interface, &"
- << this->full_skel_name ()
+ << skeleton_class_name
<< "::_interface_skel\n";
this->skel_count_++;
// Input to the gperf is ready. Run gperf and get things
// done. This method also unlinks the temp file that we used
// for the gperf.
- this->gen_gperf_things ();
+ this->gen_gperf_things (flat_name);
}
break;
@@ -1202,6 +1204,18 @@ be_interface::gen_operation_table (void)
return 0;
}
+// Helper.
+int
+be_interface::gen_operation_table (void)
+{
+ const char *flat_name =
+ this->flat_name ();
+ const char *skeleton_class_name =
+ this->full_skel_name ();
+
+ return this->gen_operation_table (flat_name, skeleton_class_name);
+}
+
// Output the header (type declaration and %%) to the gperf's input
@@ -1592,7 +1606,7 @@ be_interface::gen_optable_helper (be_interface *derived,
// depending on which strategy we are using. Returns 0 on sucess, -1
// on error.
int
-be_interface::gen_gperf_things (void)
+be_interface::gen_gperf_things (const char *flat_name)
{
// GPERF can give Binary search, Linear search and Perfect Hash
// methods. Generate the class defintion according to that.
@@ -1606,51 +1620,51 @@ be_interface::gen_gperf_things (void)
case BE_GlobalData::TAO_PERFECT_HASH:
// Output a class definition deriving from
// TAO_Perfect_Hash_OpTable.
- gen_perfect_hash_class_definition ();
+ gen_perfect_hash_class_definition (flat_name);
// Call GPERF and get the methods defined.
- if (gen_gperf_lookup_methods () == -1)
+ if (gen_gperf_lookup_methods (flat_name) == -1)
{
return -1;
}
// Create an instance of the correct class corresponding the
// operation lookup strategy we are following.
- gen_perfect_hash_instance ();
+ this->gen_perfect_hash_instance (flat_name);
break;
case BE_GlobalData::TAO_BINARY_SEARCH:
// Output a class definition deriving from
// TAO_Binary_Search_OpTable.
- this->gen_binary_search_class_definition ();
+ this->gen_binary_search_class_definition (flat_name);
// Call GPERF and get the methods defined.
- if (gen_gperf_lookup_methods () == -1)
+ if (gen_gperf_lookup_methods (flat_name) == -1)
{
return -1;
}
// Create an instance of the correct class corresponding the
// operation lookup strategy we are following.
- gen_binary_search_instance ();
+ this->gen_binary_search_instance (flat_name);
break;
case BE_GlobalData::TAO_LINEAR_SEARCH:
// Output a class definition deriving from
// TAO_Linear_Search_OpTable.
- gen_linear_search_class_definition ();
+ this->gen_linear_search_class_definition (flat_name);
// Call GPERF and get the methods defined.
- if (gen_gperf_lookup_methods () == -1)
+ if (this->gen_gperf_lookup_methods (flat_name) == -1)
{
return -1;
}
// Create an instance of the correct class corresponding the
// operation lookup strategy we are following.
- gen_linear_search_instance ();
+ this->gen_linear_search_instance (flat_name);
break;
@@ -1670,12 +1684,12 @@ be_interface::gen_gperf_things (void)
// Outputs the class definition for the perfect hashing. This class
// will inherit from the TAO_Perfect_Hash_OpTable.
void
-be_interface::gen_perfect_hash_class_definition (void)
+be_interface::gen_perfect_hash_class_definition (const char *flat_name)
{
// Outstream.
TAO_OutStream *os = this->strategy_->get_out_stream ();
- *os << "class " << "TAO_" << this->flat_name () << "_Perfect_Hash_OpTable"
+ *os << "class " << "TAO_" << flat_name << "_Perfect_Hash_OpTable"
<< " : public TAO_Perfect_Hash_OpTable"
<< be_nl
<< "{"
@@ -1695,12 +1709,12 @@ be_interface::gen_perfect_hash_class_definition (void)
// Outputs the class definition for the binary searching. This class
// will inherit from the TAO_Binary_Seach_OpTable.
void
-be_interface::gen_binary_search_class_definition (void)
+be_interface::gen_binary_search_class_definition (const char *flat_name)
{
// Outstream.
TAO_OutStream *os = this->strategy_->get_out_stream ();
- *os << "class " << "TAO_" << this->flat_name () << "_Binary_Search_OpTable"
+ *os << "class " << "TAO_" << flat_name << "_Binary_Search_OpTable"
<< " : public TAO_Binary_Search_OpTable"
<< be_nl
<< "{"
@@ -1716,12 +1730,12 @@ be_interface::gen_binary_search_class_definition (void)
// Outputs the class definition for the linear search. This class
// will inherit from the TAO_Linear_Search_OpTable.
void
-be_interface::gen_linear_search_class_definition (void)
+be_interface::gen_linear_search_class_definition (const char *flat_name)
{
// Outstream.
TAO_OutStream *ss = this->strategy_->get_out_stream ();
- *ss << "class " << "TAO_" << this->flat_name () << "_Linear_Search_OpTable"
+ *ss << "class " << "TAO_" << flat_name << "_Linear_Search_OpTable"
<< " : public TAO_Linear_Search_OpTable"
<< be_nl
<< "{"
@@ -1740,7 +1754,7 @@ be_interface::gen_linear_search_class_definition (void)
// GPERF reads from our temp file and write to the Server Skeleton
// file.
int
-be_interface::gen_gperf_lookup_methods (void)
+be_interface::gen_gperf_lookup_methods (const char *flat_name)
{
// Using ACE_Process.
ACE_Process process;
@@ -1822,7 +1836,7 @@ be_interface::gen_gperf_lookup_methods (void)
" "
"-N lookup",
idl_global->gperf_path (),
- this->flat_name ());
+ flat_name);
break;
// Binary search methods from GPERF. Everythis and the -B flag.
@@ -1845,7 +1859,7 @@ be_interface::gen_gperf_lookup_methods (void)
" "
"-N lookup",
idl_global->gperf_path (),
- this->flat_name ());
+ flat_name);
break;
// Linear search methods from GPERF. Everything and the -z flag.
@@ -1868,7 +1882,7 @@ be_interface::gen_gperf_lookup_methods (void)
" "
"-N lookup",
idl_global->gperf_path (),
- this->flat_name ());
+ flat_name);
break;
default:
@@ -1915,41 +1929,41 @@ be_interface::gen_gperf_lookup_methods (void)
// Create an instance of this perfect hash table.
void
-be_interface::gen_perfect_hash_instance ()
+be_interface::gen_perfect_hash_instance (const char *flat_name)
{
// Outstream.
TAO_OutStream *os = this->strategy_->get_out_stream ();
- *os << "static TAO_" << this->flat_name () << "_Perfect_Hash_OpTable"
+ *os << "static TAO_" << flat_name << "_Perfect_Hash_OpTable"
<< " "
- << "tao_" << this->flat_name () << "_optable"
+ << "tao_" << flat_name << "_optable"
<< ";\n" << be_nl;
}
// Create an instance of the binary search optable.
void
-be_interface::gen_binary_search_instance ()
+be_interface::gen_binary_search_instance (const char *flat_name)
{
// Outstream.
TAO_OutStream *os = this->strategy_->get_out_stream ();
- *os << "static TAO_" << this->flat_name () << "_Binary_Search_OpTable"
+ *os << "static TAO_" << flat_name << "_Binary_Search_OpTable"
<< " "
- << "tao_" << this->flat_name () << "_optable"
+ << "tao_" << flat_name << "_optable"
<< ";\n" << be_nl;
}
// Create an instance of this perfect hash table.
void
-be_interface::gen_linear_search_instance ()
+be_interface::gen_linear_search_instance (const char *flat_name)
{
// Outstream.
TAO_OutStream *os = this->strategy_->get_out_stream ();
- *os << "static TAO_" << this->flat_name () << "_Linear_Search_OpTable"
+ *os << "static TAO_" << flat_name << "_Linear_Search_OpTable"
<< " "
- << "tao_" << this->flat_name () << "_optable"
+ << "tao_" << flat_name << "_optable"
<< ";\n" << be_nl;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp
index f040d1aa93f..a1b464dbf02 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp
@@ -149,21 +149,7 @@ be_visitor_amh_interface_sh::visit_interface (be_interface *node)
*os << "virtual const char* _interface_repository_id "
<< "(void) const;\n\n";
- // Generate code for elements in the scope (e.g., operations).
- // We have to generate AMH-operations here. Here is how we go
- // about it:
- // We create a new node 'on the fly' and for each corresponding
- // operation in the original node, we add a new AMH-operation
- // into the node and then call visit_scope on the new node.
-
- // Step 1: Create the new AMH-node
- be_interface *amh_node = this->create_amh_class (class_name);
-
- // Step 2: Add the memebers of original node to new AMH-node
- this->add_original_members (node, amh_node);
-
- // Step 3: Generate the AMH-operations
- if (this->visit_scope (amh_node) == -1)
+ if (this->visit_scope (node) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
"be_visitor_interface_sh::"
@@ -178,14 +164,12 @@ be_visitor_amh_interface_sh::visit_interface (be_interface *node)
if (node->traverse_inheritance_graph (be_interface::gen_skel_helper, os) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_sh::"
+ "be_visitor_amh_interface_sh::"
"visit_interface - "
"inheritance graph traversal failed\n"),
-1);
}
- delete amh_node;
-
*os << be_uidt_nl << "};\n\n";
return 0;
@@ -389,8 +373,6 @@ be_visitor_amh_interface_sh::this_method (be_interface *node)
// the type of the class, but the original class that "implied" the
// AMH one.
*os << non_amh_name.c_str () << " *_this (" << be_idt << be_idt_nl
- << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "TAO_default_environment ()"
- << be_uidt << be_uidt_nl
- << ");\n" << be_uidt_nl;
+ << "TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl
+ << be_uidt_nl << ");\n" << be_uidt_nl;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp
index 88fd355b9e2..e7ecef3f881 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp
@@ -138,6 +138,22 @@ be_visitor_amh_interface_ss::generate_proxy_classes (be_interface *)
}
ACE_CString
+be_visitor_amh_interface_ss::generate_flat_name (be_interface *node)
+{
+ // @@ The following code is *NOT* exception-safe.
+ char *buf = 0;
+ node->compute_flat_name ("AMH_", "", buf);
+
+ // @@ This whole thing would be more efficient if we could pass the
+ // ACE_CString to compute_full_name, after all it uses that
+ // internally.
+ ACE_CString result (buf);
+ delete[] buf;
+
+ return result;
+}
+
+ACE_CString
be_visitor_amh_interface_ss::generate_local_name (be_interface *node)
{
ACE_CString local_name = "AMH_";
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
index f6b912a1cd7..26ea4f8ddb6 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
@@ -65,11 +65,17 @@ be_visitor_interface_ss::visit_interface (be_interface *node)
TAO_OutStream *os = this->ctx_->stream ();
- // generate the skeleton class name
-
os->indent (); // start with whatever indentation level we are at
- if (node->gen_operation_table () == -1)
+ ACE_CString full_skel_name_holder =
+ this->generate_full_skel_name (node);
+ const char *full_skel_name = full_skel_name_holder.c_str ();
+
+ ACE_CString flat_name_holder =
+ this->generate_flat_name (node);
+ const char *flat_name = flat_name_holder.c_str ();
+
+ if (node->gen_operation_table (flat_name, full_skel_name) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
"be_visitor_interface_ss::"
@@ -97,17 +103,13 @@ be_visitor_interface_ss::visit_interface (be_interface *node)
this->generate_local_name (node);
const char *node_local_name = node_local_name_holder.c_str ();
- ACE_CString full_skel_name_holder =
- this->generate_full_skel_name (node);
- const char *full_skel_name = full_skel_name_holder.c_str ();
-
*os << full_skel_name << "::"
<< local_name_prefix << node_local_name
<< " (void)\n";
// Generate optable
*os << "{" << be_idt_nl
- << "this->optable_ = &tao_" << node->flat_name ()
+ << "this->optable_ = &tao_" << flat_name
<< "_optable;" << be_uidt_nl
<< "}\n\n";
@@ -515,6 +517,12 @@ be_visitor_interface_ss::generate_proxy_classes (be_interface *node)
}
ACE_CString
+be_visitor_interface_ss::generate_flat_name (be_interface *node)
+{
+ return ACE_CString (node->flat_name ());
+}
+
+ACE_CString
be_visitor_interface_ss::generate_local_name (be_interface *node)
{
return ACE_CString (node->local_name ());
@@ -525,3 +533,4 @@ be_visitor_interface_ss::generate_full_skel_name (be_interface *node)
{
return ACE_CString (node->full_skel_name ());
}
+
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp
index d9025ebd312..e6d25fc6779 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp
@@ -72,7 +72,7 @@ be_visitor_amh_operation_sh::visit_operation (be_operation *node)
<< "void *_tao_servant_upcall" << be_nl
<< "TAO_ENV_ARG_DECL" << be_uidt_nl
<< ");" << be_uidt << "\n\n";
-
+
// We need the interface node in which this operation was defined. However,
// if this operation node was an attribute node in disguise, we get this
@@ -119,7 +119,7 @@ be_visitor_amh_operation_sh::visit_operation (be_operation *node)
char *buf;
// @@ TODO this must be kept consistent with the code in
// be_visitor_interface/amh_sh.cpp
- intf->compute_full_name ("", "ResponseHandler_ptr", buf);
+ intf->compute_full_name ("AMH_", "ResponseHandler_ptr", buf);
*os << buf << " _tao_rh";
delete[] buf;
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp
index be1bb97d1a5..066dc8580bf 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp
@@ -58,9 +58,10 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node)
char *buf;
intf->compute_full_name ("AMH_", "", buf);
- ACE_CString amh_skel_name (buf);
+ ACE_CString amh_skel_name ("POA_");
+ amh_skel_name += buf;
delete[] buf;
-
+
os->indent ();
*os << "void" << be_nl
<< amh_skel_name.c_str () << "::";
@@ -133,7 +134,7 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node)
ACE_CString response_handler_implementation_name ("POA_");
response_handler_implementation_name += buf;
delete[] buf;
-
+
*os << be_nl << response_handler_name.c_str ()
<< "_var _tao_rh =" << be_idt_nl
<< "new " << response_handler_implementation_name.c_str ()
@@ -141,23 +142,12 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node)
// Make the upcall.
*os << be_nl << "_tao_impl->"
- << node->local_name () << " (_tao_rh.in (),"
+ << node->local_name () << " (_tao_rh.in ()"
<< be_idt << be_idt_nl;
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ss::"
- "visit_operation - "
- "codegen for making upcall failed\n"),
- -1);
- }
- delete visitor;
- *os << be_uidt_nl << ");\n" << be_uidt;
+ // @@ Insert the IN and INOUT arguments here..
+
+ *os << "TAO_ENV_ARG_PARAMETER" << be_uidt_nl << ");\n" << be_uidt_nl;
*os << be_uidt << "}\n\n";
diff --git a/TAO/TAO_IDL/be_include/be_interface.h b/TAO/TAO_IDL/be_include/be_interface.h
index 4eca6d20f8c..deb143de560 100644
--- a/TAO/TAO_IDL/be_include/be_interface.h
+++ b/TAO/TAO_IDL/be_include/be_interface.h
@@ -298,6 +298,12 @@ public:
int gen_operation_table (void);
// Generate the operation table including entries for inherited interfaces.
+ int gen_operation_table (const char *flat_name,
+ const char *skeleton_class_name);
+ // Like the previous version, but receive the class "flat name" and
+ // skeleton names as arguments. Useful in the generation of closely
+ // related classes, such as the AMH skeleton.
+
int gen_optable_entries (be_interface *);
// generate the operation table entries.
@@ -327,34 +333,34 @@ private:
// Output the header (type declaration and %%) to the gperf's input
// file.
- int gen_gperf_things (void);
+ int gen_gperf_things (const char *flat_name);
// Run GPERF and get the correct lookup and other operations
// depending on which strategy we are using. Returns 0 on sucess, -1
// on error.
- void gen_perfect_hash_class_definition (void);
+ void gen_perfect_hash_class_definition (const char *flat_name);
// Outputs the class definition for the perfect hashing. This class
// will inherit from the TAO_Perfect_Hash_OpTable.
- void gen_binary_search_class_definition (void);
+ void gen_binary_search_class_definition (const char *flat_name);
// Outputs the class definition for the binary search . This class
// will inherit from the TAO_Binary_Search_OpTable.
- void gen_linear_search_class_definition (void);
+ void gen_linear_search_class_definition (const char *flat_name);
// Outputs the class defintion for the linear search. This class
// will inherit from the TAO_Linear_Search.
- int gen_gperf_lookup_methods (void);
+ int gen_gperf_lookup_methods (const char *flat_name);
// This calls the GPERF program and gets the correct operation
// lookup methods for the current OpLookup strategy.
- void gen_perfect_hash_instance (void);
+ void gen_perfect_hash_instance (const char *flat_name);
// Create an instance of this perfect hash table.
- void gen_binary_search_instance (void);
+ void gen_binary_search_instance (const char *flat_name);
// Create an instance of the binary search optable.
- void gen_linear_search_instance (void);
+ void gen_linear_search_instance (const char *flat_name);
// Create an instance of the linear search optable.
int skel_count_;
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/amh_ss.h b/TAO/TAO_IDL/be_include/be_visitor_interface/amh_ss.h
index f2512925e01..ad43ff03dc7 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_interface/amh_ss.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface/amh_ss.h
@@ -31,6 +31,7 @@ protected:
virtual int generate_amh_classes (be_interface *node);
virtual int generate_proxy_classes (be_interface *node);
+ virtual ACE_CString generate_flat_name (be_interface *node);
virtual ACE_CString generate_local_name (be_interface *node);
virtual ACE_CString generate_full_skel_name (be_interface *node);
};
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/interface_ss.h b/TAO/TAO_IDL/be_include/be_visitor_interface/interface_ss.h
index dce0a03d208..731427349c6 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_interface/interface_ss.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface/interface_ss.h
@@ -48,6 +48,7 @@ protected:
virtual int generate_amh_classes (be_interface *node);
virtual int generate_proxy_classes (be_interface *node);
+ virtual ACE_CString generate_flat_name (be_interface *node);
virtual ACE_CString generate_local_name (be_interface *node);
virtual ACE_CString generate_full_skel_name (be_interface *node);
};