summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-04-28 01:52:21 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-04-28 01:52:21 +0000
commit89910693b870fa5ea7106969a89a2a23bc008ffd (patch)
tree7a475d423d5c79a2eaf70b50668786c99c23aa61 /TAO/TAO_IDL
parentd953d42c093add0ffcbdd42422809a0cecd82c3d (diff)
downloadATCD-89910693b870fa5ea7106969a89a2a23bc008ffd.tar.gz
ChangeLogTag: Wed Apr 28 01:51:18 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO/TAO_IDL')
-rw-r--r--TAO/TAO_IDL/be/be_attribute.cpp78
-rw-r--r--TAO/TAO_IDL/be/be_home.cpp73
-rw-r--r--TAO/TAO_IDL/be/be_interface.cpp798
-rw-r--r--TAO/TAO_IDL/be/be_interface_strategy.cpp1121
-rw-r--r--TAO/TAO_IDL/be/be_operation.cpp64
-rw-r--r--TAO/TAO_IDL/be/be_operation_strategy.cpp372
-rw-r--r--TAO/TAO_IDL/be/be_valuetype.cpp28
-rw-r--r--TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp76
-rw-r--r--TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp416
-rw-r--r--TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp144
-rw-r--r--TAO/TAO_IDL/be/be_visitor_component/component.cpp77
-rw-r--r--TAO/TAO_IDL/be/be_visitor_context.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_factory.cpp41
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface.cpp3
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/ami_interface_ch.cpp55
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface.cpp82
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/module.cpp66
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation.cpp3
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp102
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp69
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_exception_holder_operation_cs.cpp39
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp71
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp69
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation.cpp31
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp30
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp37
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp7
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp35
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype.cpp3
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_ch.cpp63
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_cs.cpp58
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp169
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp1
-rw-r--r--TAO/TAO_IDL/be_include/be_array.h1
-rw-r--r--TAO/TAO_IDL/be_include/be_attribute.h37
-rw-r--r--TAO/TAO_IDL/be_include/be_codegen.h7
-rw-r--r--TAO/TAO_IDL/be_include/be_interface.h128
-rw-r--r--TAO/TAO_IDL/be_include/be_interface_strategy.h411
-rw-r--r--TAO/TAO_IDL/be_include/be_operation.h56
-rw-r--r--TAO/TAO_IDL/be_include/be_operation_strategy.h215
-rw-r--r--TAO/TAO_IDL/be_include/be_valuetype.h4
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_ami_pre_proc.h17
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface.h4
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/ami_interface_ch.h39
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_operation.h6
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_operation/ami_ch.h45
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_operation/ami_exception_holder_operation_cs.h42
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_reply_stub_operation_ch.h44
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_valuetype.h3
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_valuetype/ami_exception_holder_ch.h43
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_valuetype/ami_exception_holder_cs.h40
52 files changed, 1138 insertions, 4293 deletions
diff --git a/TAO/TAO_IDL/be/be_attribute.cpp b/TAO/TAO_IDL/be/be_attribute.cpp
index 3d7e228be9e..4d5c0c633d2 100644
--- a/TAO/TAO_IDL/be/be_attribute.cpp
+++ b/TAO/TAO_IDL/be/be_attribute.cpp
@@ -38,19 +38,8 @@ be_attribute::be_attribute (bool ro,
local,
abstract),
be_decl (AST_Decl::NT_attr,
- n),
- original_attribute_ (0)
+ n)
{
- be_operation_default_strategy *bods = 0;
-
- ACE_NEW (bods,
- be_operation_default_strategy (0));
- this->get_strategy_ = bods;
-
- ACE_NEW (bods,
- be_operation_default_strategy (0));
- this->set_strategy_ = bods;
-
if (!this->imported () && !this->is_local ())
{
// For the return types of the two operations
@@ -74,76 +63,11 @@ be_attribute::accept (be_visitor *visitor)
return visitor->visit_attribute (this);
}
-
-be_operation_strategy *
-be_attribute::set_set_strategy (be_operation_strategy *new_strategy)
-{
- be_operation_strategy *old = this->set_strategy_;
-
- if (new_strategy != 0)
- {
- this->set_strategy_ = new_strategy;
- }
-
- return old;
-}
-
-be_operation_strategy *
-be_attribute::set_get_strategy (be_operation_strategy *new_strategy)
-{
- be_operation_strategy *old = this->get_strategy_;
-
- if (new_strategy != 0)
- {
- this->get_strategy_ = new_strategy;
- }
-
- return old;
-}
-
-be_operation_strategy *
-be_attribute::get_set_strategy ()
-{
- return this->set_strategy_;
-}
-
-be_operation_strategy *
-be_attribute::get_get_strategy ()
-{
- return this->get_strategy_;
-}
-
void
be_attribute::destroy (void)
{
- if (0 != this->get_strategy_)
- {
- this->get_strategy_->destroy ();
- delete this->get_strategy_;
- this->get_strategy_ = 0;
- }
-
- if (0 != this->set_strategy_)
- {
- this->set_strategy_->destroy ();
- delete this->set_strategy_;
- this->set_strategy_ = 0;
- }
-
this->be_decl::destroy ();
this->AST_Attribute::destroy ();
}
-void
-be_attribute::original_attribute (be_attribute *original_attribute)
-{
- this->original_attribute_ = original_attribute;
-}
-
-be_attribute *
-be_attribute::original_attribute (void)
-{
- return this->original_attribute_;
-}
-
IMPL_NARROW_FROM_DECL (be_attribute)
diff --git a/TAO/TAO_IDL/be/be_home.cpp b/TAO/TAO_IDL/be/be_home.cpp
index 9ead4b728d4..598b3f7f2bf 100644
--- a/TAO/TAO_IDL/be/be_home.cpp
+++ b/TAO/TAO_IDL/be/be_home.cpp
@@ -15,7 +15,6 @@
#include "be_home.h"
#include "be_component.h"
-#include "be_interface_strategy.h"
#include "be_visitor.h"
#include "global_extern.h"
#include "utl_err.h"
@@ -88,16 +87,66 @@ be_home::~be_home (void)
void
be_home::destroy (void)
{
- // Skip be_interface, since our decls were added to
- // the equivalent interface and will get destroyed
- // there.
- if (this->strategy_ != 0)
- {
- this->strategy_->destroy ();
- delete this->strategy_;
- this->strategy_ = 0;
- }
-
+ delete [] this->full_skel_name_;
+ this->full_skel_name_ = 0;
+
+ delete [] this->full_coll_name_;
+ this->full_coll_name_ = 0;
+
+ delete [] this->local_coll_name_;
+ this->local_coll_name_ = 0;
+
+ delete [] this->relative_skel_name_;
+ this->relative_skel_name_ = 0;
+
+ delete [] this->base_proxy_impl_name_;
+ this->base_proxy_impl_name_ = 0;
+
+ delete [] this->remote_proxy_impl_name_;
+ this->remote_proxy_impl_name_ = 0;
+
+ delete [] this->direct_proxy_impl_name_;
+ this->direct_proxy_impl_name_ = 0;
+
+ delete [] this->full_base_proxy_impl_name_;
+ this->full_base_proxy_impl_name_ = 0;
+
+ delete [] this->full_remote_proxy_impl_name_;
+ this->full_remote_proxy_impl_name_ = 0;
+
+ delete [] this->full_direct_proxy_impl_name_;
+ this->full_direct_proxy_impl_name_ = 0;
+
+ delete [] this->base_proxy_broker_;
+ this->base_proxy_broker_ = 0;
+
+ delete [] this->remote_proxy_broker_;
+ this->remote_proxy_broker_ = 0;
+
+ delete [] this->strategized_proxy_broker_;
+ this->strategized_proxy_broker_ = 0;
+
+ delete [] this->full_base_proxy_broker_name_;
+ this->full_base_proxy_broker_name_ = 0;
+
+ delete [] this->full_remote_proxy_broker_name_;
+ this->full_remote_proxy_broker_name_ = 0;
+
+ delete [] this->full_strategized_proxy_broker_name_;
+ this->full_strategized_proxy_broker_name_ = 0;
+
+ delete [] this->client_scope_;
+ this->client_scope_ = 0;
+
+ delete [] this->flat_client_scope_;
+ this->flat_client_scope_ = 0;
+
+ delete [] this->server_scope_;
+ this->server_scope_ = 0;
+
+ delete [] this->flat_server_scope_;
+ this->flat_server_scope_ = 0;
+
this->be_scope::destroy ();
this->be_type::destroy ();
@@ -113,7 +162,5 @@ be_home::accept (be_visitor *visitor)
: visitor->visit_home (this));
}
-
-
IMPL_NARROW_FROM_DECL (be_home)
IMPL_NARROW_FROM_SCOPE (be_home)
diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp
index e08bf147121..6a9783e9d99 100644
--- a/TAO/TAO_IDL/be/be_interface.cpp
+++ b/TAO/TAO_IDL/be/be_interface.cpp
@@ -16,7 +16,6 @@
//=============================================================================
#include "be_interface.h"
-#include "be_interface_strategy.h"
#include "be_component.h"
#include "be_connector.h"
#include "be_attribute.h"
@@ -47,6 +46,21 @@
#include "ace/OS_NS_unistd.h"
#include "ace/OS_NS_fcntl.h"
+const char *be_interface::suffix_table_[] =
+{
+ "_Proxy_Impl",
+ "_Proxy_Broker"
+};
+
+const char *be_interface::tag_table_[] =
+{
+ "_ThruPOA",
+ "_Direct",
+ "_Remote",
+ "_Strategized",
+ "_TAO_"
+};
+
be_interface::be_interface (UTL_ScopedName *n,
AST_Type **ih,
long nih,
@@ -73,17 +87,35 @@ be_interface::be_interface (UTL_ScopedName *n,
n),
be_type (AST_Decl::NT_interface,
n),
- var_out_seq_decls_gen_ (0),
+ var_out_seq_decls_gen_ (false),
skel_count_ (0),
in_mult_inheritance_ (-1),
- strategy_ (0),
original_interface_ (0),
has_mixed_parentage_ (-1),
- session_component_child_ (-1)
+ session_component_child_ (-1),
+ is_ami_rh_ (false),
+ full_skel_name_ (0),
+ full_coll_name_ (0),
+ local_coll_name_ (0),
+ relative_skel_name_ (0),
+ base_proxy_impl_name_ (0),
+ remote_proxy_impl_name_ (0),
+ direct_proxy_impl_name_ (0),
+ full_base_proxy_impl_name_ (0),
+ full_remote_proxy_impl_name_ (0),
+ full_direct_proxy_impl_name_ (0),
+ base_proxy_broker_ (0),
+ remote_proxy_broker_ (0),
+ strategized_proxy_broker_ (0),
+ full_base_proxy_broker_name_ (0),
+ full_remote_proxy_broker_name_ (0),
+ full_strategized_proxy_broker_name_ (0),
+ client_scope_ (0),
+ flat_client_scope_ (0),
+ server_scope_ (0),
+ flat_server_scope_ (0),
+ cached_type_ (-1)
{
- ACE_NEW (this->strategy_,
- be_interface_default_strategy (this));
-
AST_Decl::NodeType nt = this->node_type ();
if (this->imported ()
@@ -126,160 +158,280 @@ be_interface::~be_interface (void)
{
}
-be_interface_strategy *
-be_interface::set_strategy (be_interface_strategy *new_strategy)
-{
- be_interface_strategy *old = this->strategy_;
-
- if (new_strategy != 0)
- {
- this->strategy_ = new_strategy;
- }
-
- return old;
-}
-
const char *
-be_interface::local_name (void) const
+be_interface::local_name (void)
{
// Return the local name.
- return this->strategy_->local_name ();
+// return this->strategy_->local_name ();
+ return this->AST_Decl::local_name ()->get_string ();
}
const char *
-be_interface::full_name (void)
+be_interface::full_skel_name (void)
{
- return this->strategy_->full_name ();
-}
+ if (this->full_skel_name_ == 0)
+ {
+ this->compute_full_skel_name ("POA_");
+ }
-const char *
-be_interface::flat_name (void)
-{
- // Return the flattened full scoped name.
- return this->strategy_->flat_name ();
+ return this->full_skel_name_;
}
const char *
-be_interface::repoID (void) const
+be_interface::full_coll_name (int type)
{
- // Retrieve the repository ID.
- return this->strategy_->repoID ();
-}
+ this->compute_coll_names (type,
+ 0, // prefix
+ 0); // suffix
-const char *
-be_interface::full_skel_name (void) const
-{
- // Retrieve the fully scoped skel class name.
- return this->strategy_->full_skel_name ();
+ return this->full_coll_name_;
}
const char *
-be_interface::full_coll_name (int type) const
+be_interface::local_coll_name (int type)
{
- // Retrieve the fully qualified collocated class name
- return this->strategy_->full_coll_name (type);
-}
+ this->compute_coll_names (type,
+ 0, // prefix
+ 0); // suffix
-const char *
-be_interface::local_coll_name (int type) const
-{
- // Retrieve the fully qualified collocated class name.
- return this->strategy_->local_coll_name (type);
+ return this->local_coll_name_;
}
const char *
be_interface::relative_skel_name (const char *skel_name)
{
- // Relative skeleton name.
- return this->strategy_->relative_skel_name (skel_name);
+ return be_interface::relative_name (this->full_skel_name (),
+ skel_name);
}
void
-be_interface::compute_full_skel_name (const char *prefix,
- char *&skelname)
+be_interface::compute_full_skel_name (const char *prefix)
{
- if (skelname != 0)
+ if (this->full_skel_name_ != 0)
{
return;
}
- else
+
+ size_t namelen = ACE_OS::strlen (prefix);
+ long first = true;
+ long second = false;
+ char *item_name = 0;
+
+ // In the first loop compute the total length.
+ for (UTL_IdListActiveIterator i (this->name ());
+ !i.is_done ();
+ i.next ())
{
- size_t namelen = ACE_OS::strlen (prefix);
- long first = true;
- long second = false;
- char *item_name = 0;
+ if (!first)
+ {
+ namelen += 2; // for "::"
+ }
+ else if (second)
+ {
+ first = second = false;
+ }
+
+ // Print the identifier.
+ item_name = i.item ()->get_string ();
+ namelen += ACE_OS::strlen (item_name);
- // In the first loop compute the total length.
- for (UTL_IdListActiveIterator i (this->name ());
- !i.is_done ();
- i.next ())
+ // Additional 4 for the POA_ characters.
+ if (first)
{
- if (!first)
+ if (ACE_OS::strcmp (item_name, "") != 0)
{
- namelen += 2; // for "::"
+ // Does not start with a "".
+ first = false;
}
- else if (second)
+ else
{
- first = second = false;
+ second = true;
}
+ }
+ }
- // Print the identifier.
- item_name = i.item ()->get_string ();
- namelen += ACE_OS::strlen (item_name);
+ ACE_NEW (this->full_skel_name_,
+ char [namelen + 1]);
+ this->full_skel_name_[0] = '\0';
+ first = true;
+ second = false;
+ ACE_OS::strcat (this->full_skel_name_, prefix);
- // Additional 4 for the POA_ characters.
- if (first)
- {
- if (ACE_OS::strcmp (item_name, "") != 0)
- {
- // Does not start with a "".
- first = false;
- }
- else
- {
- second = true;
- }
- }
+ for (UTL_IdListActiveIterator j (this->name ());
+ !j.is_done ();
+ j.next ())
+ {
+ if (!first)
+ {
+ ACE_OS::strcat (this->full_skel_name_, "::");
+ }
+ else if (second)
+ {
+ first = second = false;
}
- ACE_NEW (skelname,
- char [namelen+1]);
- skelname[0] = '\0';
- first = true;
- second = false;
- ACE_OS::strcat (skelname, prefix);
+ // Print the identifier.
+ item_name = j.item ()->get_string ();
+ ACE_OS::strcat (this->full_skel_name_, item_name);
- for (UTL_IdListActiveIterator j (this->name ());
- !j.is_done ();
- j.next ())
+ if (first)
{
- if (!first)
+ if (ACE_OS::strcmp (item_name, "") != 0)
{
- ACE_OS::strcat (skelname, "::");
+ // Does not start with a "".
+ first = false;
}
- else if (second)
+ else
{
- first = second = false;
+ second = true;
}
+ }
+ }
+}
+
+// Compute stringified fully qualified collocated class name.
+void
+be_interface::compute_coll_names (int type,
+ const char *prefix,
+ const char *suffix)
+{
+ if (type == this->cached_type_ && this->full_coll_name_ != 0)
+ {
+ return;
+ }
+ else
+ {
+ this->cached_type_ = type;
+ delete [] this->full_coll_name_;
+ delete [] this->local_coll_name_;
+
+ // Reset to zero in case allocations below fail, and cause
+ // premature return to caller.
+ this->full_coll_name_ = 0;
+ this->local_coll_name_ = 0;
+ }
+
+ static const char *collocated_names[] = {"_tao_thru_poa_collocated_",
+ "_tao_direct_collocated_"};
+ static const char *poa = "POA_";
+
+ // Reserve enough room for the "POA_" prefix, the "_tao_collocated_"
+ // prefix and the local name and the (optional) "::"
+ const char *collocated = collocated_names[type];
+
+ size_t name_len = ACE_OS::strlen (collocated)
+ + ACE_OS::strlen (poa)
+ + 1;
+
+ if (prefix)
+ {
+ name_len += ACE_OS::strlen (prefix);
+ }
+
+ if (suffix)
+ {
+ name_len += ACE_OS::strlen (suffix);
+ }
- // Print the identifier.
- item_name = j.item ()->get_string ();
- ACE_OS::strcat (skelname, item_name);
+ for (UTL_IdListActiveIterator i (this->name ());
+ !i.is_done ();
+ i.next ())
+ {
+ // Reserve 2 characters for "::".
+ name_len += ACE_OS::strlen (i.item ()->get_string ()) + 2;
+ }
+
+ ACE_NEW (this->full_coll_name_,
+ char[name_len + 1]);
+
+ // Null terminate the string.
+ this->full_coll_name_[0] = 0;
+
+ // Only the first component get the "POA_" preffix.
+ int poa_added = 0;
+
+ // Iterate again.
+ // Must advance the iterator explicitly inside the loop.
+ for (UTL_IdListActiveIterator j (this->name ());
+ !j.is_done ();)
+ {
+ const char *item = j.item ()->get_string ();
+
+ // Increase right away, so we can test for the final component
+ // in the loop.
+ j.next ();
- if (first)
+ // We add the POA_ preffix only if the first component is not
+ // the global scope...
+ if (ACE_OS::strcmp (item, "") != 0)
+ {
+ if (!j.is_done ())
{
- if (ACE_OS::strcmp (item_name, "") != 0)
+ // We only add the POA_ preffix if there are more than
+ // two components in the name, in other words, if the
+ // class is inside some scope.
+ if (!poa_added)
{
- // Does not start with a "".
- first = false;
+ ACE_OS::strcat (this->full_coll_name_, poa);
+ poa_added = 1;
}
- else
+ ACE_OS::strcat (this->full_coll_name_, item);
+ ACE_OS::strcat (this->full_coll_name_, "::");
+ }
+ else
+ {
+ ACE_OS::strcat (this->full_coll_name_, collocated);
+
+ if (prefix)
+ {
+ ACE_OS::strcat (this->full_coll_name_, prefix);
+ }
+
+ ACE_OS::strcat (this->full_coll_name_, item);
+
+ if (suffix)
{
- second = true;
+ ACE_OS::strcat (this->full_coll_name_, suffix);
}
}
}
}
+
+ // Compute the local name for the collocated class.
+ char *local_name =
+ this->AST_Interface::local_name ()->get_string ();
+ size_t local_len = ACE_OS::strlen (collocated)
+ + ACE_OS::strlen (local_name)
+ + 1;
+ if (prefix)
+ {
+ local_len += ACE_OS::strlen (prefix);
+ }
+
+ if (suffix)
+ {
+ local_len += ACE_OS::strlen (suffix);
+ }
+
+ ACE_NEW (this->local_coll_name_,
+ char[local_len]);
+
+ ACE_OS::strcpy (this->local_coll_name_,
+ collocated);
+
+ if (prefix)
+ {
+ ACE_OS::strcat (this->local_coll_name_,
+ prefix);
+ }
+
+ ACE_OS::strcat (this->local_coll_name_,
+ this->AST_Interface::local_name ()->get_string ());
+
+ if (suffix)
+ {
+ ACE_OS::strcat (this->local_coll_name_, suffix);
+ }
}
const char*
@@ -610,7 +762,7 @@ be_interface::gen_stub_ctor (TAO_OutStream *os)
void
be_interface:: gen_var_out_seq_decls (void)
{
- if (this->var_out_seq_decls_gen_ == 1)
+ if (this->var_out_seq_decls_gen_)
{
return;
}
@@ -624,6 +776,16 @@ be_interface:: gen_var_out_seq_decls (void)
// Generate the ifdefined macro for this interface.
os->gen_ifdef_macro (this->flat_name (),
"var_out");
+
+ /// Forward declare the handler interface before declaring
+ /// the original interface.
+ if (be_global->ami_call_back () && !this->is_ami_rh ())
+ {
+ *os << be_nl << be_nl
+ << "class AMI_" << lname << "Handler;" << be_nl
+ << "typedef AMI_" << lname << "Handler *AMI_"
+ << lname << "Handler_ptr;";
+ }
*os << be_nl << be_nl
<< "class " << lname << ";" << be_nl
@@ -643,7 +805,7 @@ be_interface:: gen_var_out_seq_decls (void)
os->gen_endif ();
- this->var_out_seq_decls_gen_ = 1;
+ this->var_out_seq_decls_gen_ = true;
}
// ****************************************************************
@@ -774,7 +936,7 @@ be_interface::gen_operation_table (const char *flat_name,
{
this->skel_count_ = 0;
// Init the outstream appropriately.
- TAO_OutStream *os = this->strategy_->get_out_stream ();
+ TAO_OutStream *os = tao_cg->server_skeletons ();
// Start from current indentation level.
os->indent ();
@@ -1012,6 +1174,7 @@ be_interface::gen_operation_table (const char *flat_name,
*os << "_repository_id,&"
<< skeleton_class_name
<< "::_repository_id_skel, 0" << be_nl;
+
++this->skel_count_;
}
@@ -1078,7 +1241,7 @@ be_interface::gen_gperf_input_header (TAO_OutStream *os)
<< "\n";
}
-// we separate the generation of operation table entries from the
+// We separate the generation of operation table entries from the
// "gen_operation_table" method. This enables us to invoke generation of
// entries for interfaces from which we inherit without any additional
// code. The parameter "derived" is the one for which the entire operation
@@ -1097,11 +1260,19 @@ be_interface::gen_optable_entries (be_interface *derived_interface,
!si.is_done ();
si.next ())
{
- // get the next AST decl node
+ // Get the next AST decl node
AST_Decl *d = si.item ();
if (d->node_type () == AST_Decl::NT_op)
{
+ be_operation *op =
+ be_operation::narrow_from_decl (d);
+
+ if (op->is_sendc_ami ())
+ {
+ continue;
+ }
+
// We are an operation node.
*os << "{\"" << d->original_local_name () << "\", &"
<< full_skeleton_name << "::"
@@ -1195,6 +1366,14 @@ be_interface::gen_optable_entries (be_interface *derived_interface,
if (d->node_type () == AST_Decl::NT_op)
{
+ be_operation *op =
+ be_operation::narrow_from_decl (d);
+
+ if (op->is_sendc_ami ())
+ {
+ continue;
+ }
+
// Generate operation name.
// We are an operation node. We use the original
@@ -1538,7 +1717,7 @@ 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.
- TAO_OutStream *os = this->strategy_->get_out_stream ();
+ TAO_OutStream *os = tao_cg->server_skeletons ();
*os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
<< "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
@@ -1602,24 +1781,21 @@ be_interface::gen_gperf_things (const char *flat_name)
default:
ACE_ERROR_RETURN ((
- LM_ERROR,
- "tao_idl:ERROR:%N:%l:Unknown Operation Lookup Strategy\n"
- ),
- -1
- );
+ LM_ERROR,
+ "tao_idl:ERROR:%N:%l:Unknown Operation Lookup Strategy\n"),
+ -1);
}
return 0;
}
-
// 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 (const char *flat_name)
{
// Outstream.
- TAO_OutStream *os = this->strategy_->get_out_stream ();
+ TAO_OutStream *os = tao_cg->server_skeletons ();
*os << "class " << "TAO_" << flat_name << "_Perfect_Hash_OpTable"
<< be_idt_nl
@@ -1641,7 +1817,7 @@ void
be_interface::gen_binary_search_class_definition (const char *flat_name)
{
// Outstream.
- TAO_OutStream *os = this->strategy_->get_out_stream ();
+ TAO_OutStream *os = tao_cg->server_skeletons ();
*os << "class " << "TAO_" << flat_name << "_Binary_Search_OpTable"
<< be_idt_nl
@@ -1659,7 +1835,7 @@ void
be_interface::gen_linear_search_class_definition (const char *flat_name)
{
// Outstream.
- TAO_OutStream *ss = this->strategy_->get_out_stream ();
+ TAO_OutStream *ss = tao_cg->server_skeletons ();
*ss << "class " << "TAO_" << flat_name << "_Linear_Search_OpTable"
<< be_idt_nl
@@ -1700,6 +1876,7 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name)
"fclose"),
-1);
}
+
// And reset file to 0 because otherwise there is a problem during destruction of stream.
tao_cg->gperf_input_stream ()->file () = 0;
@@ -1728,7 +1905,7 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name)
#ifndef ACE_OPENVMS
// Flush the output stream. Gperf also uses it as output. Ensure
// current contents are written before gperf writes.
- ACE_OS::fflush (this->strategy_->get_out_stream ()->file ());
+ ACE_OS::fflush (tao_cg->server_skeletons ()->file ());
#endif /* !ACE_OPENVMS */
// Stdout is server skeleton. Do *not* close the file, just open
@@ -1753,7 +1930,7 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name)
"fop=dfw");
//FUZZ: enable check_for_lack_ACE_OS
#else
- ACE_HANDLE output = ACE_OS::open (this->strategy_->get_out_stream_fname (),
+ ACE_HANDLE output = ACE_OS::open (be_global->be_get_server_skeleton_fname (),
O_WRONLY | O_APPEND);
#endif
@@ -1882,7 +2059,7 @@ be_interface::gen_gperf_lookup_methods (const char *flat_name)
// Adjust the file offset to the EOF for the server skeleton
// file.
- ACE_OS::fseek (this->strategy_->get_out_stream ()->file (),
+ ACE_OS::fseek (tao_cg->server_skeletons ()->file (),
0,
SEEK_END);
}
@@ -1939,7 +2116,7 @@ void
be_interface::gen_perfect_hash_instance (const char *flat_name)
{
// Outstream.
- TAO_OutStream *os = this->strategy_->get_out_stream ();
+ TAO_OutStream *os = tao_cg->server_skeletons ();
*os << be_nl
<< "static TAO_" << flat_name << "_Perfect_Hash_OpTable"
@@ -1952,7 +2129,7 @@ void
be_interface::gen_binary_search_instance (const char *flat_name)
{
// Outstream.
- TAO_OutStream *os = this->strategy_->get_out_stream ();
+ TAO_OutStream *os = tao_cg->server_skeletons ();
*os << be_nl
<< "static TAO_" << flat_name << "_Binary_Search_OpTable"
@@ -1966,7 +2143,7 @@ void
be_interface::gen_linear_search_instance (const char *flat_name)
{
// Outstream.
- TAO_OutStream *os = this->strategy_->get_out_stream ();
+ TAO_OutStream *os = tao_cg->server_skeletons ();
*os << be_nl
<< "static TAO_" << flat_name << "_Linear_Search_OpTable"
@@ -2496,14 +2673,66 @@ be_interface::op_attr_decl_helper (be_interface * /*derived */,
void
be_interface::destroy (void)
{
- // We know that it cannot be 0, but..
- if (this->strategy_ != 0)
- {
- this->strategy_->destroy ();
- delete this->strategy_;
- this->strategy_ = 0;
- }
-
+ delete [] this->full_skel_name_;
+ this->full_skel_name_ = 0;
+
+ delete [] this->full_coll_name_;
+ this->full_coll_name_ = 0;
+
+ delete [] this->local_coll_name_;
+ this->local_coll_name_ = 0;
+
+ delete [] this->relative_skel_name_;
+ this->relative_skel_name_ = 0;
+
+ delete [] this->base_proxy_impl_name_;
+ this->base_proxy_impl_name_ = 0;
+
+ delete [] this->remote_proxy_impl_name_;
+ this->remote_proxy_impl_name_ = 0;
+
+ delete [] this->direct_proxy_impl_name_;
+ this->direct_proxy_impl_name_ = 0;
+
+ delete [] this->full_base_proxy_impl_name_;
+ this->full_base_proxy_impl_name_ = 0;
+
+ delete [] this->full_remote_proxy_impl_name_;
+ this->full_remote_proxy_impl_name_ = 0;
+
+ delete [] this->full_direct_proxy_impl_name_;
+ this->full_direct_proxy_impl_name_ = 0;
+
+ delete [] this->base_proxy_broker_;
+ this->base_proxy_broker_ = 0;
+
+ delete [] this->remote_proxy_broker_;
+ this->remote_proxy_broker_ = 0;
+
+ delete [] this->strategized_proxy_broker_;
+ this->strategized_proxy_broker_ = 0;
+
+ delete [] this->full_base_proxy_broker_name_;
+ this->full_base_proxy_broker_name_ = 0;
+
+ delete [] this->full_remote_proxy_broker_name_;
+ this->full_remote_proxy_broker_name_ = 0;
+
+ delete [] this->full_strategized_proxy_broker_name_;
+ this->full_strategized_proxy_broker_name_ = 0;
+
+ delete [] this->client_scope_;
+ this->client_scope_ = 0;
+
+ delete [] this->flat_client_scope_;
+ this->flat_client_scope_ = 0;
+
+ delete [] this->server_scope_;
+ this->server_scope_ = 0;
+
+ delete [] this->flat_server_scope_;
+ this->flat_server_scope_ = 0;
+
// Call the destroy methods of our base classes.
this->AST_Interface::destroy ();
this->be_scope::destroy ();
@@ -2516,20 +2745,6 @@ be_interface::accept (be_visitor *visitor)
return visitor->visit_interface (this);
}
-
-TAO_CodeGen::CG_STATE
-be_interface::next_state (TAO_CodeGen::CG_STATE current_state,
- int is_extra_state)
-{
- return this->strategy_->next_state (current_state, is_extra_state);
-}
-
-int
-be_interface::has_extra_code_generation (TAO_CodeGen::CG_STATE current_state)
-{
- return this->strategy_->has_extra_code_generation (current_state);
-}
-
void
be_interface::original_interface (be_interface *original_interface)
{
@@ -2542,12 +2757,6 @@ be_interface::original_interface (void)
return this->original_interface_;
}
-be_interface *
-be_interface::replacement (void)
-{
- return this->strategy_->replacement ();
-}
-
int
be_interface::has_mixed_parentage (void)
{
@@ -3049,97 +3258,350 @@ be_interface::gen_nesting_close (TAO_OutStream &os)
}
}
+bool
+be_interface::is_ami_rh (void) const
+{
+ return this->is_ami_rh_;
+}
+
+void
+be_interface::is_ami_rh (bool val)
+{
+ this->is_ami_rh_ = val;
+}
+
const char *
be_interface::base_proxy_impl_name (void)
{
- return this->strategy_->base_proxy_impl_name ();
+ if (this->base_proxy_impl_name_ == 0)
+ {
+ this->base_proxy_impl_name_ =
+ this->create_with_prefix_suffix (
+ this->tag_table_[GC_PREFIX],
+ this->local_name (),
+ this->suffix_table_[PROXY_IMPL]);
+ }
+
+ return this->base_proxy_impl_name_;
}
const char *
be_interface::full_base_proxy_impl_name (void)
{
- return this->strategy_->full_base_proxy_impl_name ();
+ if (this->full_base_proxy_impl_name_ == 0)
+ {
+ const char *scope = this->client_enclosing_scope ();
+ const char *base_name =
+ this->base_proxy_impl_name ();
+ size_t length =
+ ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
+
+ ACE_NEW_RETURN (this->full_base_proxy_impl_name_,
+ char[length + 1],
+ 0);
+
+ ACE_OS::strcpy (this->full_base_proxy_impl_name_,
+ scope);
+ ACE_OS::strcat (this->full_base_proxy_impl_name_,
+ base_name);
+ }
+
+ return this->full_base_proxy_impl_name_;
}
const char *
be_interface::remote_proxy_impl_name (void)
{
- return this->strategy_->remote_proxy_impl_name ();
+ if (this->remote_proxy_impl_name_ = 0)
+ {
+ this->remote_proxy_impl_name_ =
+ this->create_with_prefix_suffix (
+ this->tag_table_[GC_PREFIX],
+ this->local_name (),
+ this->suffix_table_[PROXY_IMPL],
+ this->tag_table_[REMOTE]);
+ }
+
+ return this->remote_proxy_impl_name_;
}
const char *
be_interface::full_remote_proxy_impl_name (void)
{
- return this->strategy_->full_remote_proxy_impl_name ();
+ if (this->full_remote_proxy_impl_name_ == 0)
+ {
+ const char *scope = this->client_enclosing_scope ();
+ const char *base_name = this->remote_proxy_impl_name ();
+ size_t length =
+ ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
+
+ ACE_NEW_RETURN (this->full_remote_proxy_impl_name_,
+ char[length + 1],
+ 0);
+
+ ACE_OS::strcpy (this->full_remote_proxy_impl_name_,
+ scope);
+ ACE_OS::strcat (this->full_remote_proxy_impl_name_,
+ base_name);
+ }
+
+ return this->full_remote_proxy_impl_name_;
}
const char *
be_interface::direct_proxy_impl_name (void)
{
- return this->strategy_->direct_proxy_impl_name ();
+ if (this->direct_proxy_impl_name_ == 0)
+ {
+ this->direct_proxy_impl_name_ =
+ this->create_with_prefix_suffix (
+ this->tag_table_[GC_PREFIX],
+ this->local_name (),
+ this->suffix_table_[PROXY_IMPL],
+ this->tag_table_[DIRECT]);
+ }
+
+ return this->direct_proxy_impl_name_;
}
const char *
be_interface::full_direct_proxy_impl_name (void)
{
- return this->strategy_->full_direct_proxy_impl_name ();
+ if (this->full_direct_proxy_impl_name_ == 0)
+ {
+ const char *scope = this->server_enclosing_scope ();
+ const char *base_name = this->direct_proxy_impl_name ();
+
+ size_t length =
+ ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
+
+ ACE_NEW_RETURN (this->full_direct_proxy_impl_name_,
+ char[length + 1],
+ 0);
+
+ ACE_OS::strcpy (this->full_direct_proxy_impl_name_,
+ scope);
+ ACE_OS::strcat (this->full_direct_proxy_impl_name_,
+ base_name);
+ }
+
+ return this->full_direct_proxy_impl_name_;
}
const char *
be_interface::base_proxy_broker_name (void)
{
- return this->strategy_->base_proxy_broker_name ();
+ if (this->base_proxy_broker_ == 0)
+ {
+ this->base_proxy_broker_ =
+ this->create_with_prefix_suffix (
+ this->tag_table_[GC_PREFIX],
+ this->local_name (),
+ this->suffix_table_[PROXY_BROKER]);
+ }
+
+ return this->base_proxy_broker_;
}
const char *
be_interface::full_base_proxy_broker_name (void)
{
- return this->strategy_->full_base_proxy_broker_name ();
+ if (this->full_base_proxy_broker_name_ == 0)
+ {
+ const char *scope = this->client_enclosing_scope ();
+ const char *base_name = this->base_proxy_broker_name ();
+ size_t length =
+ ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
+
+ ACE_NEW_RETURN (this->full_base_proxy_broker_name_,
+ char[length + 1],
+ 0);
+
+ ACE_OS::strcpy (this->full_base_proxy_broker_name_,
+ scope);
+ ACE_OS::strcat (this->full_base_proxy_broker_name_,
+ base_name);
+ }
+
+ return this->full_base_proxy_broker_name_;
}
const char *
be_interface::remote_proxy_broker_name (void)
{
- return this->strategy_->remote_proxy_broker_name ();
+ if (this->remote_proxy_broker_ == 0)
+ {
+ this->remote_proxy_broker_ =
+ this->create_with_prefix_suffix (
+ this->tag_table_[GC_PREFIX],
+ this->local_name (),
+ this->suffix_table_[PROXY_BROKER],
+ this->tag_table_[REMOTE]);
+ }
+
+ return this->remote_proxy_broker_;
}
const char *
be_interface::full_remote_proxy_broker_name (void)
{
- return this->strategy_->full_remote_proxy_broker_name ();
+ if (this->full_remote_proxy_broker_name_ == 0)
+ {
+ const char *scope = this->client_enclosing_scope ();
+ const char *base_name = this->remote_proxy_broker_name ();
+ size_t length =
+ ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
+
+ ACE_NEW_RETURN (this->full_remote_proxy_broker_name_,
+ char[length + 1],
+ 0);
+
+ ACE_OS::strcpy (this->full_remote_proxy_broker_name_,
+ scope);
+ ACE_OS::strcat (this->full_remote_proxy_broker_name_,
+ base_name);
+ }
+
+ return this->full_remote_proxy_broker_name_;
}
const char *
be_interface::strategized_proxy_broker_name (void)
{
- return this->strategy_->strategized_proxy_broker_name ();
+ if (this->strategized_proxy_broker_ == 0)
+ {
+ this->strategized_proxy_broker_ =
+ this->create_with_prefix_suffix (
+ this->tag_table_[GC_PREFIX],
+ this->local_name (),
+ this->suffix_table_[PROXY_BROKER],
+ this->tag_table_[STRATEGIZED]);
+ }
+
+ return this->strategized_proxy_broker_;
}
const char *
be_interface::full_strategized_proxy_broker_name (void)
{
- return this->strategy_->full_strategized_proxy_broker_name ();
+ if (this->full_strategized_proxy_broker_name_ == 0)
+ {
+ const char *scope = this->server_enclosing_scope ();
+ const char *base_name =
+ this->strategized_proxy_broker_name ();
+ size_t length =
+ ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
+
+ ACE_NEW_RETURN (this->full_strategized_proxy_broker_name_,
+ char[length + 1],
+ 0);
+
+ ACE_OS::strcpy (this->full_strategized_proxy_broker_name_,
+ scope);
+ ACE_OS::strcat (this->full_strategized_proxy_broker_name_,
+ base_name);
+ }
+
+ return this->full_strategized_proxy_broker_name_;
}
const char *
be_interface::client_enclosing_scope (void)
{
- return this->strategy_->client_scope ();
+ if (this->client_scope_ == 0)
+ {
+ const char *full_name = this->full_name ();
+ const char *name = this->local_name ();
+
+ size_t offset = ACE_OS::strlen (name);
+ size_t length = ACE_OS::strlen (full_name) - offset;
+ ACE_NEW_RETURN (this->client_scope_,
+ char[length + 1],
+ 0);
+
+ ACE_OS::strncpy (this->client_scope_, full_name, length);
+ this->client_scope_[length] = '\0';
+ }
+
+ return this->client_scope_;
}
const char *
be_interface::flat_client_enclosing_scope (void)
{
- return this->strategy_->flat_client_scope ();
+ if (this->flat_client_scope_ == 0)
+ {
+ const char *full_name = this->flat_name ();
+ const char *name =
+ this->original_local_name ()->get_string ();
+
+ size_t offset = ACE_OS::strlen (name);
+ size_t length = ACE_OS::strlen (full_name) - offset;
+
+ ACE_NEW_RETURN (this->flat_client_scope_,
+ char[length + 1],
+ 0);
+
+ ACE_OS::strncpy (this->flat_client_scope_,
+ full_name,
+ length);
+ this->flat_client_scope_[length] = '\0';
+ }
+
+ return this->flat_client_scope_;
}
const char *
be_interface::server_enclosing_scope (void)
{
- return this->strategy_->server_scope ();
+ if (this->server_scope_ == 0)
+ {
+ const char *full_name =
+ this->full_coll_name (be_interface::DIRECT);
+
+ const char *name =
+ this->local_coll_name (be_interface::DIRECT);
+
+ size_t offset = ACE_OS::strlen (name);
+ size_t length = ACE_OS::strlen (full_name) - offset;
+ ACE_NEW_RETURN (this->server_scope_,
+ char[length + 1],
+ 0);
+
+ ACE_OS::strncpy (this->server_scope_, full_name, length);
+ this->server_scope_[length] = '\0';
+ }
+
+ return this->server_scope_;
+}
+
+char *
+be_interface::create_with_prefix_suffix (const char *prefix,
+ const char *str,
+ const char *suffix,
+ const char *separator)
+{
+ char *cat_string = 0;
+ size_t length =
+ ACE_OS::strlen (str) +
+ ACE_OS::strlen (prefix) +
+ ACE_OS::strlen (suffix) +
+ ACE_OS::strlen (separator) +
+ 1; // The '/0'
+
+ ACE_NEW_RETURN (cat_string,
+ char[length],
+ 0);
+
+ ACE_OS::strcpy (cat_string, prefix);
+ ACE_OS::strcat (cat_string, str);
+ ACE_OS::strcat (cat_string, separator);
+ ACE_OS::strcat (cat_string, suffix);
+
+ return cat_string;
}
IMPL_NARROW_FROM_DECL (be_interface)
diff --git a/TAO/TAO_IDL/be/be_interface_strategy.cpp b/TAO/TAO_IDL/be/be_interface_strategy.cpp
deleted file mode 100644
index 82a1d1d639e..00000000000
--- a/TAO/TAO_IDL/be/be_interface_strategy.cpp
+++ /dev/null
@@ -1,1121 +0,0 @@
-
-//=============================================================================
-/**
- * @file be_interface_strategy.cpp
- *
- * $Id$
- *
- * A strategy to cover the differences between various variants
- * of an interface
- *
- *
- * @author Michael Kircher
- */
-//=============================================================================
-
-#include "be_interface_strategy.h"
-#include "be_interface.h"
-#include "be_extern.h"
-#include "utl_identifier.h"
-
-be_interface_strategy::be_interface_strategy (be_interface *node,
- Strategy_Kind strategy_type)
- : local_name_(0),
- full_name_(0),
- flat_name_(0),
- repoID_(0),
- full_skel_name_(0),
- full_coll_name_(0),
- local_coll_name_(0),
- relative_skel_name_(0),
- node_ (node),
- cached_type_ (-1),
- strategy_type_ (strategy_type)
-{
-}
-
-be_interface_strategy::~be_interface_strategy (void)
-{
-}
-
-// Interface Type Strategy Base Class
-
-// Relative skeleton name.
-const char *
-be_interface_strategy::relative_skel_name (const char *skel_name)
-{
- return be_interface::relative_name (this->full_skel_name (),
- skel_name);
-}
-
-
-
-// Compute stringified fully qualified collocated class name.
-void
-be_interface_strategy::compute_coll_names (int type,
- const char *prefix,
- const char *suffix)
-{
- if (type == this->cached_type_ && this->full_coll_name_ != 0)
- {
- return;
- }
- else
- {
- this->cached_type_ = type;
- delete [] this->full_coll_name_;
- delete [] this->local_coll_name_;
-
- // Reset to zero in case allocations below fail, and cause
- // premature return to caller.
- this->full_coll_name_ = 0;
- this->local_coll_name_ = 0;
- }
-
- static const char *collocated_names[] = {"_tao_thru_poa_collocated_",
- "_tao_direct_collocated_"};
- static const char *poa = "POA_";
-
- // Reserve enough room for the "POA_" prefix, the "_tao_collocated_"
- // prefix and the local name and the (optional) "::"
- const char *collocated = collocated_names[type];
-
- size_t name_len = ACE_OS::strlen (collocated)
- + ACE_OS::strlen (poa)
- + 1;
-
- if (prefix)
- {
- name_len += ACE_OS::strlen (prefix);
- }
-
- if (suffix)
- {
- name_len += ACE_OS::strlen (suffix);
- }
-
- for (UTL_IdListActiveIterator i (this->node_->name ());
- !i.is_done ();
- i.next ())
- {
- // Reserve 2 characters for "::".
- name_len += ACE_OS::strlen (i.item ()->get_string ()) + 2;
- }
-
- ACE_NEW (this->full_coll_name_,
- char[name_len + 1]);
-
- // Null terminate the string.
- this->full_coll_name_[0] = 0;
-
- // Only the first component get the "POA_" preffix.
- int poa_added = 0;
-
- // Iterate again.
- // Must advance the iterator explicitly inside the loop.
- for (UTL_IdListActiveIterator j (this->node_->name ());
- !j.is_done ();)
- {
- const char *item = j.item ()->get_string ();
-
- // Increase right away, so we can test for the final component
- // in the loop.
- j.next ();
-
- // We add the POA_ preffix only if the first component is not
- // the global scope...
- if (ACE_OS::strcmp (item, "") != 0)
- {
- if (!j.is_done ())
- {
- // We only add the POA_ preffix if there are more than
- // two components in the name, in other words, if the
- // class is inside some scope.
- if (!poa_added)
- {
- ACE_OS::strcat (this->full_coll_name_, poa);
- poa_added = 1;
- }
- ACE_OS::strcat (this->full_coll_name_, item);
- ACE_OS::strcat (this->full_coll_name_, "::");
- }
- else
- {
- ACE_OS::strcat (this->full_coll_name_, collocated);
-
- if (prefix)
- {
- ACE_OS::strcat (this->full_coll_name_, prefix);
- }
-
- ACE_OS::strcat (this->full_coll_name_, item);
-
- if (suffix)
- {
- ACE_OS::strcat (this->full_coll_name_, suffix);
- }
- }
- }
- }
-
- // Compute the local name for the collocated class.
- char *local_name = this->node_->AST_Interface::local_name ()->get_string ();
- size_t local_len = ACE_OS::strlen (collocated)
- + ACE_OS::strlen (local_name)
- + 1;
- if (prefix)
- {
- local_len += ACE_OS::strlen (prefix);
- }
-
- if (suffix)
- {
- local_len += ACE_OS::strlen (suffix);
- }
-
- ACE_NEW (this->local_coll_name_,
- char[local_len]);
-
- ACE_OS::strcpy (this->local_coll_name_,
- collocated);
-
- if (prefix)
- {
- ACE_OS::strcat (this->local_coll_name_,
- prefix);
- }
-
- ACE_OS::strcat (this->local_coll_name_,
- node_->AST_Interface::local_name ()->get_string ());
-
- if (suffix)
- {
- ACE_OS::strcat (this->local_coll_name_, suffix);
- }
-}
-
-
-void
-be_interface_strategy::compute_names (const char *name,
- const char *prefix,
- const char *suffix,
- char *&new_name)
-{
- if (!prefix || !suffix)
- {
- return;
- }
-
- size_t name_length = ACE_OS::strlen (name) +
- ACE_OS::strlen (prefix) +
- ACE_OS::strlen (suffix);
-
- ACE_NEW (new_name,
- char[name_length + 1]);
-
- // Copy it in.
- ACE_OS::strcpy (new_name, name);
-
- const char *interface_name = 0;
- size_t i = ACE_OS::strlen (name);
-
- for (;i >= 1; i--)
- {
- if (name[i-1] == ':' && name[i] == ':')
- {
- interface_name = &name[i+1];
- break;
- }
- else if (i >= 3)
- {
- if (name[i-3] == 'P' &&
- name[i-2] == 'O' &&
- name[i-1] == 'A' &&
- name[i] == '_')
- {
- interface_name = &name[i+1];
- break;
- }
- }
- }
-
- if (interface_name == 0)
- {
- interface_name = name;
- }
-
- ACE_OS::strcpy (&new_name[name_length
- - ACE_OS::strlen (prefix)
- - ACE_OS::strlen (interface_name)
- - ACE_OS::strlen (suffix)],
- prefix);
-
- ACE_OS::strcpy (&new_name[name_length
- - ACE_OS::strlen (interface_name)
- - ACE_OS::strlen (suffix)],
- interface_name);
-
- ACE_OS::strcpy (&new_name[name_length
- - ACE_OS::strlen(suffix)],
- suffix);
-}
-
-
-TAO_OutStream *
-be_interface_strategy::get_out_stream (void)
-{
- // Outstream.
- return tao_cg->server_skeletons ();
-}
-
-const char *
-be_interface_strategy::get_out_stream_fname (void)
-{
- return be_global->be_get_server_skeleton_fname ();
-}
-
-int
-be_interface_strategy::strategy_type (void)
-{
- return strategy_type_;
-}
-
-TAO_CodeGen::CG_STATE
-be_interface_strategy::next_state (TAO_CodeGen::CG_STATE current_state,
- int /* is_extra_state */)
-{
- return current_state;
-}
-
-int
-be_interface_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE /* current_state */
- )
-{
- return 0;
-}
-
-be_interface *
-be_interface_strategy::replacement (void)
-{
- return 0;
-}
-
-void
-be_interface_strategy::destroy (void)
-{
- if (this->local_name_ != 0)
- {
- delete [] this->local_name_;
- this->local_name_ = 0;
- }
-
- if (this->full_name_ != 0)
- {
- delete [] this->full_name_;
- this->full_name_ = 0;
- }
-
- if (this->flat_name_ != 0)
- {
- delete [] this->flat_name_;
- this->flat_name_ = 0;
- }
-
- if (this->repoID_ != 0)
- {
- delete [] this->repoID_;
- this->repoID_ = 0;
- }
-
- if (this->full_skel_name_ != 0)
- {
- delete [] this->full_skel_name_;
- this->full_skel_name_ = 0;
- }
-
- if (this->full_coll_name_ != 0)
- {
- delete [] this->full_coll_name_;
- this->full_coll_name_ = 0;
- }
-
- if (this->local_coll_name_ != 0)
- {
- delete [] this->local_coll_name_;
- this->local_coll_name_ = 0;
- }
-
- if (this->relative_skel_name_ != 0)
- {
- delete [] this->relative_skel_name_;
- this->relative_skel_name_ = 0;
- }
-}
-
-// ****************************************************************
-// Default Strategy
-
-const char *be_interface_default_strategy::suffix_table_[] =
-{
- "_Proxy_Impl",
- "_Proxy_Broker"
-};
-
-const char *be_interface_default_strategy::tag_table_[] =
-{
- "_Remote",
- "_ThruPOA",
- "_Direct",
- "_Strategized",
- "_TAO_"
-};
-
-
-be_interface_default_strategy::be_interface_default_strategy (
- be_interface *node,
- Strategy_Kind strategy_kind
- )
- : be_interface_strategy (node,
- strategy_kind),
- base_proxy_impl_name_ (0),
- remote_proxy_impl_name_ (0),
- direct_proxy_impl_name_ (0),
- full_base_proxy_impl_name_ (0),
- full_remote_proxy_impl_name_ (0),
- full_direct_proxy_impl_name_ (0),
- base_proxy_broker_ (0),
- remote_proxy_broker_ (0),
- strategized_proxy_broker_ (0),
- full_base_proxy_broker_name_ (0),
- full_remote_proxy_broker_name_ (0),
- full_strategized_proxy_broker_name_(0),
- client_scope_ (0),
- flat_client_scope_ (0),
- server_scope_ (0),
- flat_server_scope_ (0)
-{
-}
-
-be_interface_default_strategy::~be_interface_default_strategy (void)
-{
-}
-
-const char *
-be_interface_default_strategy::full_name (void)
-{
- if (this->full_name_ == 0)
- {
- size_t len = ACE_OS::strlen (node_->be_decl::full_name ());
-
- ACE_NEW_RETURN (this->full_name_,
- char[len + 1],
- 0);
-
- ACE_OS::strcpy (this->full_name_,
- node_->be_decl::full_name ());
- }
-
- return this->full_name_;
-}
-
-const char *
-be_interface_default_strategy::local_name (void)
-{
- if (!this->local_name_)
- {
- size_t len =
- ACE_OS::strlen (node_->AST_Interface::local_name ()->get_string ());
-
- ACE_NEW_RETURN (this->local_name_,
- char[len + 1],
- 0);
-
- ACE_OS::strcpy (this->local_name_,
- node_->AST_Interface::local_name ()->get_string ());
- }
-
- return this->local_name_;
-}
-
-const char *
-be_interface_default_strategy::flat_name (void)
-{
- if (!this->flat_name_)
- {
- size_t len = ACE_OS::strlen (node_->be_decl::flat_name ());
-
- ACE_NEW_RETURN (this->flat_name_,
- char[len + 1],
- 0);
-
- ACE_OS::strcpy (this->flat_name_,
- node_->be_decl::flat_name ());
- }
-
- return this->flat_name_;
-}
-
-const char *
-be_interface_default_strategy::repoID (void)
-{
- if (this->repoID_ == 0)
- {
- size_t len = ACE_OS::strlen (node_->be_decl::repoID ());
-
- ACE_NEW_RETURN (this->repoID_,
- char[len + 1],
- 0);
-
- ACE_OS::strcpy (this->repoID_,
- node_->be_decl::repoID ());
- }
-
- return this->repoID_;
-}
-
-const char *
-be_interface_default_strategy::full_skel_name (void)
-{
- if (this->full_skel_name_ == 0)
- {
- // the following method is inherited from the base class
- node_->compute_full_skel_name ("POA_",
- this->full_skel_name_);
- }
-
- return this->full_skel_name_;
-}
-
-
-const char *
-be_interface_default_strategy::full_coll_name (int type)
-{
- this->compute_coll_names (type,
- 0, // prefix
- 0); // suffix
-
- return this->full_coll_name_;
-}
-
-const char *
-be_interface_default_strategy::local_coll_name (int type)
-{
- this->compute_coll_names (type,
- 0, // prefix
- 0); // suffix
-
- return this->local_coll_name_;
-}
-
-char *
-be_interface_default_strategy::create_with_prefix_suffix (
- const char *prefix,
- const char *str,
- const char *suffix,
- const char *separator
- )
-{
- char *cat_string = 0;
- size_t length =
- ACE_OS::strlen (str) +
- ACE_OS::strlen (prefix) +
- ACE_OS::strlen (suffix) +
- ACE_OS::strlen (separator) +
- 1; // The '/0'
-
- ACE_NEW_RETURN (cat_string,
- char[length],
- 0);
-
- ACE_OS::strcpy (cat_string, prefix);
- ACE_OS::strcat (cat_string, str);
- ACE_OS::strcat (cat_string, separator);
- ACE_OS::strcat (cat_string, suffix);
-
- return cat_string;
-}
-
-const char *
-be_interface_default_strategy::base_proxy_impl_name (void)
-{
- if (this->base_proxy_impl_name_ != 0)
- {
- return this->base_proxy_impl_name_;
- }
-
- this->base_proxy_impl_name_ =
- this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
- this->node_->local_name (),
- this->suffix_table_[PROXY_IMPL]);
-
- return this->base_proxy_impl_name_;
-}
-
-
-const char *
-be_interface_default_strategy::client_scope (void)
-{
- if (this->client_scope_ != 0)
- {
- return this->client_scope_;
- }
-
- const char *full_name = this->full_name ();
- const char *name = this->local_name ();
-
- size_t offset = ACE_OS::strlen (name);
- size_t length = ACE_OS::strlen (full_name) - offset;
- ACE_NEW_RETURN (this->client_scope_,
- char[length + 1],
- 0);
-
- ACE_OS::strncpy (this->client_scope_, full_name, length);
- this->client_scope_[length] = '\0';
-
- return this->client_scope_;
-}
-const char *
-be_interface_default_strategy::flat_client_scope (void)
-{
- if (this->flat_client_scope_ != 0)
- {
- return this->flat_client_scope_;
- }
-
- const char *full_name = this->flat_name ();
- const char *name =
- this->node_->original_local_name ()->get_string ();
-
- size_t offset = ACE_OS::strlen (name);
- size_t length = ACE_OS::strlen (full_name) - offset;
- ACE_NEW_RETURN (this->flat_client_scope_,
- char[length + 1],
- 0);
-
- ACE_OS::strncpy (this->flat_client_scope_, full_name, length);
- this->flat_client_scope_[length] = '\0';
-
- return this->flat_client_scope_;
-}
-
-
-const char *
-be_interface_default_strategy::server_scope (void)
-{
- if (this->server_scope_ != 0)
- {
- return this->server_scope_;
- }
-
- const char *full_name =
- this->node_->full_coll_name (be_interface::DIRECT);
-
- const char *name = this->node_->local_coll_name (be_interface::DIRECT);
-
- size_t offset = ACE_OS::strlen (name);
- size_t length = ACE_OS::strlen (full_name) - offset;
- ACE_NEW_RETURN (this->server_scope_,
- char[length + 1],
- 0);
-
- ACE_OS::strncpy (this->server_scope_, full_name, length);
- this->server_scope_[length] = '\0';
-
- return this->server_scope_;
-}
-
-const char *
-be_interface_default_strategy::flat_server_scope (void)
-{
- if (this->flat_server_scope_ != 0)
- {
- return this->flat_server_scope_;
- }
-
- const char *full_name = this->flat_name ();
- const char *name = this->local_name ();
-
- size_t offset = ACE_OS::strlen (name);
- size_t length = ACE_OS::strlen (full_name) - offset;
- ACE_NEW_RETURN (this->flat_server_scope_,
- char[length + 1],
- 0);
-
- ACE_OS::strncpy (this->flat_server_scope_, full_name, length);
- this->flat_server_scope_[length] = '\0';
-
- return this->flat_server_scope_;
-}
-
-
-
-const char *
-be_interface_default_strategy::full_base_proxy_impl_name (void)
-{
- if (this->full_base_proxy_impl_name_ != 0)
- {
- return this->full_base_proxy_impl_name_;
- }
-
- const char *scope = this->client_scope ();
- const char *base_name = this->base_proxy_impl_name ();
- size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
- ACE_NEW_RETURN (this->full_base_proxy_impl_name_,
- char[length + 1],
- 0);
-
- ACE_OS::strcpy (this->full_base_proxy_impl_name_, scope);
- ACE_OS::strcat (this->full_base_proxy_impl_name_, base_name);
-
- return this->full_base_proxy_impl_name_;
-}
-
-
-
-const char *
-be_interface_default_strategy::remote_proxy_impl_name (void)
-{
- if (this->remote_proxy_impl_name_ != 0)
- {
- return this->remote_proxy_impl_name_;
- }
-
-
- this->remote_proxy_impl_name_ =
- this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
- this->node_->local_name (),
- this->suffix_table_[PROXY_IMPL],
- this->tag_table_[REMOTE]);
-
- return this->remote_proxy_impl_name_;
-}
-
-const char *
-be_interface_default_strategy::full_remote_proxy_impl_name (void)
-{
- if (this->full_remote_proxy_impl_name_ != 0)
- {
- return this->full_remote_proxy_impl_name_;
- }
-
- const char *scope = this->client_scope ();
- const char *base_name = this->remote_proxy_impl_name ();
- size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
- ACE_NEW_RETURN (this->full_remote_proxy_impl_name_,
- char[length + 1],
- 0);
-
- ACE_OS::strcpy (this->full_remote_proxy_impl_name_, scope);
- ACE_OS::strcat (this->full_remote_proxy_impl_name_, base_name);
-
- return this->full_remote_proxy_impl_name_;
-}
-
-const char *
-be_interface_default_strategy::direct_proxy_impl_name (void)
-{
- if (this->direct_proxy_impl_name_ != 0)
- {
- return this->direct_proxy_impl_name_;
- }
-
- this->direct_proxy_impl_name_ =
- this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
- this->node_->local_name (),
- this->suffix_table_[PROXY_IMPL],
- this->tag_table_[DIRECT]);
-
- return this->direct_proxy_impl_name_;
-}
-
-
-const char *
-be_interface_default_strategy::full_direct_proxy_impl_name (void)
-{
- if (this->full_direct_proxy_impl_name_ != 0)
- {
- return this->full_direct_proxy_impl_name_;
- }
-
- const char *scope = this->server_scope ();
- const char *base_name = this->direct_proxy_impl_name ();
-
- size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
- ACE_NEW_RETURN (this->full_direct_proxy_impl_name_,
- char[length + 1],
- 0);
-
- ACE_OS::strcpy (this->full_direct_proxy_impl_name_, scope);
- ACE_OS::strcat (this->full_direct_proxy_impl_name_, base_name);
-
- return this->full_direct_proxy_impl_name_;
-}
-
-
-const char *
-be_interface_default_strategy::base_proxy_broker_name (void)
-{
- if (this->base_proxy_broker_ != 0)
- {
- return this->base_proxy_broker_;
- }
-
- this->base_proxy_broker_ =
- this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
- this->node_->local_name (),
- this->suffix_table_[PROXY_BROKER]);
-
- return this->base_proxy_broker_;
-}
-
-
-const char *
-be_interface_default_strategy::full_base_proxy_broker_name (void)
-{
- if (this->full_base_proxy_broker_name_ != 0)
- {
- return this->full_base_proxy_broker_name_;
- }
-
- const char *scope = this->client_scope ();
- const char *base_name = this->base_proxy_broker_name ();
- size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
- ACE_NEW_RETURN (this->full_base_proxy_broker_name_,
- char[length + 1],
- 0);
-
- ACE_OS::strcpy (this->full_base_proxy_broker_name_, scope);
- ACE_OS::strcat (this->full_base_proxy_broker_name_, base_name);
-
- return this->full_base_proxy_broker_name_;
-}
-
-const char *
-be_interface_default_strategy::remote_proxy_broker_name (void)
-{
- if (this->remote_proxy_broker_ != 0)
- {
- return this->remote_proxy_broker_;
- }
-
- this->remote_proxy_broker_ =
- this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
- this->node_->local_name (),
- this->suffix_table_[PROXY_BROKER],
- this->tag_table_[REMOTE]);
-
- return this->remote_proxy_broker_;
-}
-
-
-const char *
-be_interface_default_strategy::full_remote_proxy_broker_name (void)
-{
- if (this->full_remote_proxy_broker_name_ != 0)
- {
- return this->full_remote_proxy_broker_name_;
- }
-
- const char *scope = this->client_scope ();
- const char *base_name = this->remote_proxy_broker_name ();
- size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
- ACE_NEW_RETURN (this->full_remote_proxy_broker_name_,
- char[length + 1],
- 0);
-
- ACE_OS::strcpy (this->full_remote_proxy_broker_name_, scope);
- ACE_OS::strcat (this->full_remote_proxy_broker_name_, base_name);
-
- return this->full_remote_proxy_broker_name_;
-}
-
-
-const char *
-be_interface_default_strategy::strategized_proxy_broker_name (void)
-{
- if (this->strategized_proxy_broker_ != 0)
- {
- return this->strategized_proxy_broker_;
- }
-
- this->strategized_proxy_broker_ =
- this->create_with_prefix_suffix (this->tag_table_[GC_PREFIX],
- this->node_->local_name (),
- this->suffix_table_[PROXY_BROKER],
- this->tag_table_[STRATEGIZED]);
-
- return this->strategized_proxy_broker_;
-}
-
-const char *
-be_interface_default_strategy::full_strategized_proxy_broker_name (void)
-{
- if (this->full_strategized_proxy_broker_name_ != 0)
- {
- return this->full_strategized_proxy_broker_name_;
- }
-
- const char *scope = this->server_scope ();
- const char *base_name = this->strategized_proxy_broker_name ();
- size_t length = ACE_OS::strlen (scope) + ACE_OS::strlen (base_name);
- ACE_NEW_RETURN (this->full_strategized_proxy_broker_name_,
- char[length + 1],
- 0);
-
- ACE_OS::strcpy (this->full_strategized_proxy_broker_name_, scope);
- ACE_OS::strcat (this->full_strategized_proxy_broker_name_, base_name);
-
- return this->full_strategized_proxy_broker_name_;
-}
-
-void
-be_interface_default_strategy::destroy (void)
-{
- if (this->base_proxy_impl_name_ != 0)
- {
- delete [] this->base_proxy_impl_name_;
- this->base_proxy_impl_name_ = 0;
- }
-
- if (this->remote_proxy_impl_name_ != 0)
- {
- delete [] this->remote_proxy_impl_name_;
- this->remote_proxy_impl_name_ = 0;
- }
-
- if (this->direct_proxy_impl_name_ != 0)
- {
- delete [] this->direct_proxy_impl_name_;
- this->direct_proxy_impl_name_ = 0;
- }
-
- if (this->full_base_proxy_impl_name_ != 0)
- {
- delete [] this->full_base_proxy_impl_name_;
- this->full_base_proxy_impl_name_ = 0;
- }
-
- if (this->full_remote_proxy_impl_name_ != 0)
- {
- delete [] this->full_remote_proxy_impl_name_;
- this->full_remote_proxy_impl_name_ = 0;
- }
-
- if (this->full_direct_proxy_impl_name_ != 0)
- {
- delete [] this->full_direct_proxy_impl_name_;
- this->full_direct_proxy_impl_name_ = 0;
- }
-
- if (this->base_proxy_broker_ != 0)
- {
- delete [] this->base_proxy_broker_;
- this->base_proxy_broker_ = 0;
- }
-
- if (this->remote_proxy_broker_ != 0)
- {
- delete [] this->remote_proxy_broker_;
- this->remote_proxy_broker_ = 0;
- }
-
- if (this->strategized_proxy_broker_ != 0)
- {
- delete [] this->strategized_proxy_broker_;
- this->strategized_proxy_broker_ = 0;
- }
-
- if (this->full_base_proxy_broker_name_ != 0)
- {
- delete [] this->full_base_proxy_broker_name_;
- this->full_base_proxy_broker_name_ = 0;
- }
-
- if (this->full_remote_proxy_broker_name_ != 0)
- {
- delete [] this->full_remote_proxy_broker_name_;
- this->full_remote_proxy_broker_name_ = 0;
- }
-
- if (this->full_strategized_proxy_broker_name_ != 0)
- {
- delete [] this->full_strategized_proxy_broker_name_;
- this->full_strategized_proxy_broker_name_ = 0;
- }
-
- if (this->client_scope_ != 0)
- {
- delete [] this->client_scope_;
- this->client_scope_ = 0;
- }
-
- if (this->flat_client_scope_ != 0)
- {
- delete [] this->flat_client_scope_;
- this->flat_client_scope_ = 0;
- }
-
- if (this->server_scope_ != 0)
- {
- delete [] this->server_scope_;
- this->server_scope_ = 0;
- }
-
- if (this->flat_server_scope_ != 0)
- {
- delete [] this->flat_server_scope_;
- this->flat_server_scope_ = 0;
- }
-
- this->be_interface_strategy::destroy ();
-}
-
-// ****************************************************************
-// AMI Handler Strategy
-
-be_interface_ami_handler_strategy::be_interface_ami_handler_strategy (
- be_interface *node
- )
- : be_interface_default_strategy (node,
- AMI_HANDLER)
-{
-}
-
-be_interface_ami_handler_strategy::~be_interface_ami_handler_strategy (void)
-{
-}
-
-
-TAO_CodeGen::CG_STATE
-be_interface_ami_handler_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int /*is_extra_state */
- )
-{
- return current_state;
-}
-
-
-// ****************************************************************
-// AMI Exception Holder Strategy
-
-be_interface_ami_exception_holder_strategy::
-be_interface_ami_exception_holder_strategy (be_interface *node)
- : be_interface_default_strategy (node,
- AMI_EXCEPTION_HOLDER)
-{
-}
-
-be_interface_ami_exception_holder_strategy
-::~be_interface_ami_exception_holder_strategy (void)
-{
-}
-
-
-TAO_CodeGen::CG_STATE
-be_interface_ami_exception_holder_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int is_extra_state
- )
-{
- if (is_extra_state)
- {
- switch (current_state)
- {
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CH:
- return TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CH;
- case TAO_CodeGen::TAO_VALUETYPE_OBV_CS:
- return TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CS;
- default:
- return current_state;
- }
- }
- else
- {
- return current_state;
- }
-}
-
-
-int
-be_interface_ami_exception_holder_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE current_state
- )
-{
- if (current_state == TAO_CodeGen::TAO_VALUETYPE_OBV_CH
- || current_state == TAO_CodeGen::TAO_VALUETYPE_OBV_CS)
- {
- return 1;
- }
- else
- {
- return 0;
- }
-}
-
-
-// ****************************************************************
-// AMI Strategy
-
-be_interface_ami_strategy::be_interface_ami_strategy (be_interface *node,
- be_interface *handler)
- : be_interface_default_strategy (node,
- AMI_INTERFACE),
- handler_ (handler)
-{
-}
-
-be_interface_ami_strategy::~be_interface_ami_strategy (void)
-{
-}
-
-
-TAO_CodeGen::CG_STATE
-be_interface_ami_strategy::next_state (TAO_CodeGen::CG_STATE current_state,
- int is_extra_state)
-{
- if (is_extra_state)
- {
- switch (current_state)
- {
- case TAO_CodeGen::TAO_AMI_INTERFACE_CH:
- return TAO_CodeGen::TAO_INTERFACE_CH;
- default:
- return current_state;
- }
- }
- else
- {
- switch (current_state)
- {
- case TAO_CodeGen::TAO_INTERFACE_CH:
- return TAO_CodeGen::TAO_AMI_INTERFACE_CH;
- default:
- return current_state;
- }
- }
-}
-
-
-int
-be_interface_ami_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE current_state
- )
-{
- if (current_state == TAO_CodeGen::TAO_AMI_INTERFACE_CH)
- {
- return 1;
- }
- else
- {
- return 0;
- }
-}
-
-be_interface *
-be_interface_ami_strategy::replacement (void)
-{
- return handler_;
-}
-
diff --git a/TAO/TAO_IDL/be/be_operation.cpp b/TAO/TAO_IDL/be/be_operation.cpp
index 7caa058666a..14fe829e7ec 100644
--- a/TAO/TAO_IDL/be/be_operation.cpp
+++ b/TAO/TAO_IDL/be/be_operation.cpp
@@ -15,7 +15,6 @@
//=============================================================================
#include "be_operation.h"
-#include "be_operation_strategy.h"
#include "be_predefined_type.h"
#include "be_argument.h"
#include "be_visitor.h"
@@ -45,11 +44,10 @@ be_operation::be_operation (AST_Type *rt,
be_scope (AST_Decl::NT_op),
be_decl (AST_Decl::NT_op,
n),
- original_operation_ (0)
+ is_sendc_ami_ (false),
+ is_excep_ami_ (false),
+ is_attr_op_ (false)
{
- ACE_NEW (this->strategy_,
- be_operation_default_strategy (this));
-
if (this->imported ())
{
return;
@@ -66,7 +64,6 @@ be_operation::be_operation (AST_Type *rt,
}
}
-
be_operation::~be_operation (void)
{
}
@@ -74,13 +71,6 @@ be_operation::~be_operation (void)
void
be_operation::destroy (void)
{
- if (0 != this->strategy_)
- {
- this->strategy_->destroy ();
- delete this->strategy_;
- this->strategy_ = 0;
- }
-
// Call the destroy methods of our base classes.
this->be_scope::destroy ();
this->be_decl::destroy ();
@@ -115,54 +105,40 @@ be_operation::be_insert_exception (AST_Exception *ex)
return 0;
}
-be_operation_strategy *
-be_operation::set_strategy (be_operation_strategy *new_strategy)
+bool
+be_operation::is_sendc_ami (void) const
{
- be_operation_strategy *old = this->strategy_;
-
- if (new_strategy != 0)
- {
- this->strategy_ = new_strategy;
- }
-
- return old;
+ return this->is_sendc_ami_;
}
-TAO_CodeGen::CG_STATE
-be_operation::next_state (TAO_CodeGen::CG_STATE current_state,
- int is_extra_state)
+void
+be_operation::is_sendc_ami (bool val)
{
- return this->strategy_->next_state (current_state, is_extra_state);
+ this->is_sendc_ami_ = val;
}
-int
-be_operation::has_extra_code_generation (TAO_CodeGen::CG_STATE current_state)
+bool
+be_operation::is_excep_ami (void) const
{
- return this->strategy_->has_extra_code_generation (current_state);
+ return this->is_excep_ami_;
}
-be_operation*
-be_operation::marshaling (void)
+void
+be_operation::is_excep_ami (bool val)
{
- return this->strategy_->marshaling ();
+ this->is_excep_ami_ = val;
}
-be_operation*
-be_operation::arguments (void)
+bool
+be_operation::is_attr_op (void) const
{
- return this->strategy_->arguments ();
+ return this->is_attr_op_;
}
void
-be_operation::original_operation (be_operation *original_operation)
-{
- this->original_operation_ = original_operation;
-}
-
-be_operation *
-be_operation::original_operation (void)
+be_operation::is_attr_op (bool val)
{
- return this->original_operation_;
+ this->is_attr_op_ = val;
}
IMPL_NARROW_FROM_DECL (be_operation)
diff --git a/TAO/TAO_IDL/be/be_operation_strategy.cpp b/TAO/TAO_IDL/be/be_operation_strategy.cpp
deleted file mode 100644
index 2136d86e0e0..00000000000
--- a/TAO/TAO_IDL/be/be_operation_strategy.cpp
+++ /dev/null
@@ -1,372 +0,0 @@
-
-//=============================================================================
-/**
- * @file be_operation_strategy.cpp
- *
- * $Id$
- *
- * A strategy to cover the differences between various variants
- * of an operations, e.g. AMI sendc_, AMI raise_
- *
- *
- * @author Michael Kircher
- */
-//=============================================================================
-
-#include "be_operation_strategy.h"
-#include "be_operation.h"
-
-be_operation_strategy::be_operation_strategy (be_operation *node,
- Strategy_Kind strategy_type)
- : node_ (node),
- strategy_type_ (strategy_type)
-{
-}
-
-be_operation_strategy::~be_operation_strategy (void)
-{
-}
-
-int
-be_operation_strategy::strategy_type (void)
-{
- return strategy_type_;
-}
-
-int
-be_operation_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE /* current_state */
- )
-{
- return 0;
-}
-
-be_operation *
-be_operation_strategy::marshaling (void)
-{
- return 0;
-}
-
-be_operation *
-be_operation_strategy::arguments (void)
-{
- return 0;
-}
-
-be_operation_strategy *
-be_operation_strategy::copy (void)
-{
- return 0;
-}
-
-void
-be_operation_strategy::destroy (void)
-{
-}
-
-// ****************************************************************
-// AMI sendc_ operation strategy
-
-be_operation_default_strategy::be_operation_default_strategy (
- be_operation *node
- )
- : be_operation_strategy (node,
- DEFAULT)
-{
-}
-
-be_operation_default_strategy::~be_operation_default_strategy (void)
-{
-}
-
-TAO_CodeGen::CG_STATE
-be_operation_default_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int /* is_extra_state */
- )
-{
- return current_state;
-}
-
-be_operation_strategy *
-be_operation_default_strategy::copy (void)
-{
- be_operation_default_strategy *retval = 0;
- ACE_NEW_RETURN (retval,
- be_operation_default_strategy (this->node_),
- 0);
- retval->strategy_type_ = this->strategy_type_;
- return retval;
-}
-
-// ****************************************************************
-// AMI sendc_ operation strategy
-
-be_operation_ami_sendc_strategy::be_operation_ami_sendc_strategy (
- be_operation *node,
- be_operation *marshaling,
- be_operation *arguments
- )
- : be_operation_strategy (node,
- AMI_SENDC),
- marshaling_ (marshaling),
- arguments_ (arguments),
- owns_operations_ (true)
-{
-}
-
-be_operation_ami_sendc_strategy::~be_operation_ami_sendc_strategy (void)
-{
-}
-
-TAO_CodeGen::CG_STATE
-be_operation_ami_sendc_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int is_extra_state
- )
-{
- if (is_extra_state)
- {
- switch (current_state)
- {
- case TAO_CodeGen::TAO_OPERATION_CH:
- return TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CH;
- case TAO_CodeGen::TAO_OPERATION_CS:
- return TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CS;
- default:
- return current_state;
- }
- }
- else
- {
- return current_state;
- }
-}
-
-int
-be_operation_ami_sendc_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE current_state
- )
-{
- if (current_state == TAO_CodeGen::TAO_OPERATION_CH
- || current_state == TAO_CodeGen::TAO_OPERATION_CS)
- {
- return 1;
- }
- else
- {
- return 0;
- }
-}
-
-be_operation*
-be_operation_ami_sendc_strategy::marshaling (void)
-{
- return marshaling_;
-}
-
-
-be_operation*
-be_operation_ami_sendc_strategy::arguments (void)
-{
- return arguments_;
-}
-
-be_operation_strategy *
-be_operation_ami_sendc_strategy::copy (void)
-{
- be_operation_ami_sendc_strategy *retval = 0;
- ACE_NEW_RETURN (retval,
- be_operation_ami_sendc_strategy (this->node_,
- this->marshaling_,
- this->arguments_),
- 0);
- retval->strategy_type_ = this->strategy_type_;
- retval->owns_operations_ = false;
- return retval;
-}
-
-void
-be_operation_ami_sendc_strategy::destroy (void)
-{
- if (this->owns_operations_)
- {
- this->marshaling_->destroy ();
- delete this->marshaling_;
- this->marshaling_ = 0;
-
- this->arguments_->destroy ();
- delete this->arguments_;
- this->arguments_ = 0;
- }
-
- this->be_operation_strategy::destroy ();
-}
-
-// ****************************************************************
-// AMI ExceptionHolder raise_ operation strategy
-
-be_operation_ami_exception_holder_raise_strategy
-::be_operation_ami_exception_holder_raise_strategy (be_operation *node)
- : be_operation_strategy (node,
- AMI_EXCEPTION_HOLDER_RAISE)
-{
-}
-
-be_operation_ami_exception_holder_raise_strategy
-::~be_operation_ami_exception_holder_raise_strategy (void)
-{
-}
-
-
-TAO_CodeGen::CG_STATE
-be_operation_ami_exception_holder_raise_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int is_extra_state
- )
-{
- if (!is_extra_state)
- {
- switch (current_state)
- {
- case TAO_CodeGen::TAO_OPERATION_CS:
- return TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_RAISE_OPERATION_CS;
- default:
- return current_state;
- }
- }
- else
- {
- return current_state;
- }
-}
-
-be_operation_strategy *
-be_operation_ami_exception_holder_raise_strategy::copy (void)
-{
- be_operation_ami_exception_holder_raise_strategy *retval = 0;
- ACE_NEW_RETURN (retval,
- be_operation_ami_exception_holder_raise_strategy (
- this->node_
- ),
- 0);
- retval->strategy_type_ = this->strategy_type_;
- return retval;
-}
-
-// ****************************************************************
-// AMI Reply Handler reply stub operation strategy
-
-be_operation_ami_handler_reply_stub_strategy
-::be_operation_ami_handler_reply_stub_strategy (be_operation *node)
- : be_operation_strategy (node,
- AMI_EXCEPTION_HOLDER_RAISE)
-{
-}
-
-be_operation_ami_handler_reply_stub_strategy
-::~be_operation_ami_handler_reply_stub_strategy (void)
-{
-}
-
-TAO_CodeGen::CG_STATE
-be_operation_ami_handler_reply_stub_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int is_extra_state
- )
-{
- if (is_extra_state)
- {
- switch (current_state)
- {
- case TAO_CodeGen::TAO_OPERATION_CH:
- return TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CH;
-
- case TAO_CodeGen::TAO_OPERATION_CS:
- return TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CS;
-
- default:
- return current_state;
- }
- }
- else
- {
- return current_state;
- }
-}
-
-int
-be_operation_ami_handler_reply_stub_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE current_state
- )
-{
- if (current_state == TAO_CodeGen::TAO_OPERATION_CH
- || current_state == TAO_CodeGen::TAO_OPERATION_CS)
- {
- return 1;
- }
- else
- {
- return 0;
- }
-}
-
-be_operation_strategy *
-be_operation_ami_handler_reply_stub_strategy::copy (void)
-{
- be_operation_ami_handler_reply_stub_strategy *retval = 0;
- ACE_NEW_RETURN (retval,
- be_operation_ami_handler_reply_stub_strategy (this->node_),
- 0);
- retval->strategy_type_ = this->strategy_type_;
- return retval;
-}
-
-// ****************************************************************
-// AMH Strategy
-
-be_operation_amh_strategy::be_operation_amh_strategy (be_operation *node)
- : be_operation_strategy (node, AMI_EXCEPTION_HOLDER_RAISE)
-{
-}
-
-be_operation_amh_strategy::~be_operation_amh_strategy (void)
-{
-}
-
-TAO_CodeGen::CG_STATE
-be_operation_amh_strategy::next_state (
- TAO_CodeGen::CG_STATE current_state,
- int /* is_extra_state */
- )
-{
- // We don't know yet if we need extra state for AMH but
- // we''ll leave the placeholder code here anyway ...
- return current_state;
-}
-
-be_operation*
-be_operation_amh_strategy::arguments (void)
-{
- return arguments_;
-}
-
-int
-be_operation_amh_strategy::has_extra_code_generation (
- TAO_CodeGen::CG_STATE
- )
-{
- return 0;
-}
-
-be_operation_strategy *
-be_operation_amh_strategy::copy (void)
-{
- be_operation_amh_strategy *retval = 0;
- ACE_NEW_RETURN (retval,
- be_operation_amh_strategy (this->node_),
- 0);
- retval->arguments_ = this->arguments_;
- retval->strategy_type_ = this->strategy_type_;
- return retval;
-}
diff --git a/TAO/TAO_IDL/be/be_valuetype.cpp b/TAO/TAO_IDL/be/be_valuetype.cpp
index ff80bc34256..86e6876e7da 100644
--- a/TAO/TAO_IDL/be/be_valuetype.cpp
+++ b/TAO/TAO_IDL/be/be_valuetype.cpp
@@ -74,9 +74,8 @@ be_valuetype::be_valuetype (UTL_ScopedName *n,
abstract,
truncatable,
custom),
- full_obv_skel_name_ (0),
supports_abstract_ (false),
- var_out_seq_decls_gen_ (0)
+ var_out_seq_decls_gen_ (false)
{
// Check that redefine() copies all members.
@@ -100,7 +99,7 @@ be_valuetype::be_valuetype (UTL_ScopedName *n,
if (intf == 0)
{
- // The item is a temploate param holder.
+ // The item is a template param holder.
continue;
}
@@ -151,20 +150,19 @@ be_valuetype::opt_accessor (void)
void
be_valuetype::compute_fullobvskelname (void)
{
- this->compute_full_skel_name ("OBV_",
- this->full_obv_skel_name_);
+ this->compute_full_skel_name ("OBV_");
}
// Retrieve the fully scoped skeleton name.
const char*
be_valuetype::full_obv_skel_name (void)
{
- if (0 == this->full_obv_skel_name_)
+ if (0 == this->full_skel_name_)
{
compute_fullobvskelname ();
}
- return this->full_obv_skel_name_;
+ return this->full_skel_name_;
}
const char *
@@ -324,7 +322,6 @@ be_valuetype::have_operation (void)
bool
be_valuetype::have_supported_op (be_interface * node)
{
-
bool have_supported_op = 0;
if (node->nmembers () == 0)
@@ -529,9 +526,9 @@ be_valuetype::gen_ostream_operator (TAO_OutStream *os,
// interface _var and _out template classes, as well as by the
// template sequence classes for object references.
void
-be_valuetype:: gen_var_out_seq_decls (void)
+be_valuetype::gen_var_out_seq_decls (void)
{
- if (this->var_out_seq_decls_gen_ == 1)
+ if (this->var_out_seq_decls_gen_)
{
return;
}
@@ -562,7 +559,7 @@ be_valuetype:: gen_var_out_seq_decls (void)
os->gen_endif ();
- this->var_out_seq_decls_gen_ = 1;
+ this->var_out_seq_decls_gen_ = true;
}
// For building the pre and postfix of private data fields.
@@ -583,7 +580,9 @@ be_valuetype::statefull_inherit (void)
{
if (this->pd_inherits_concrete != 0)
{
- return be_valuetype::narrow_from_decl (this->pd_inherits_concrete);
+ return
+ be_valuetype::narrow_from_decl (
+ this->pd_inherits_concrete);
}
else
{
@@ -601,9 +600,6 @@ be_valuetype::accept (be_visitor *visitor)
void
be_valuetype::destroy (void)
{
- delete [] this->full_obv_skel_name_;
- this->full_obv_skel_name_ = 0;
-
this->be_interface::destroy ();
this->AST_ValueType::destroy ();
}
@@ -847,7 +843,5 @@ be_valuetype::gen_skel_helper (be_interface *concrete,
return 0;
}
-
-
IMPL_NARROW_FROM_DECL (be_valuetype)
IMPL_NARROW_FROM_SCOPE (be_valuetype)
diff --git a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp
index df008b1f061..7d87d9d2353 100644
--- a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp
@@ -314,27 +314,6 @@ be_visitor_amh_pre_proc::create_response_handler_attribute (
this->visit_operation (get_operation);
- be_operation_default_strategy *default_strategy = 0;
- ACE_NEW_RETURN (default_strategy,
- be_operation_default_strategy (get_operation),
- -1);
-
- be_operation_strategy *get_operation_strategy =
- get_operation->set_strategy (default_strategy);
-
- if (0 != get_operation_strategy)
- {
- be_operation_strategy *gos =
- node->set_get_strategy (get_operation_strategy);
-
- if (0 != gos)
- {
- gos->destroy ();
- delete gos;
- gos = 0;
- }
- }
-
int status =
this->create_response_handler_operation (get_operation,
response_handler,
@@ -359,28 +338,6 @@ be_visitor_amh_pre_proc::create_response_handler_attribute (
this->visit_operation (set_operation);
- // Retrieve the strategy set by the visit operation.
- ACE_NEW_RETURN (default_strategy,
- be_operation_default_strategy (set_operation),
- -1);
-
- be_operation_strategy *set_operation_strategy =
- set_operation->set_strategy (default_strategy);
-
- // Assign it to the attribute as set_operation strategy.
- if (0 != set_operation_strategy)
- {
- be_operation_strategy *sos =
- node->set_set_strategy (set_operation_strategy);
-
- if (0 != sos)
- {
- sos->destroy ();
- delete sos;
- sos = 0;
- }
- }
-
status =
this->create_response_handler_operation (set_operation,
response_handler,
@@ -571,21 +528,6 @@ be_visitor_amh_pre_proc::visit_operation (be_operation *node)
return 0;
}
- // Set the proper strategy
- be_operation_amh_strategy *strategy = 0;
- ACE_NEW_RETURN (strategy,
- be_operation_amh_strategy (node),
- -1);
-
- be_operation_strategy *old_strategy = node->set_strategy (strategy);
-
- if (old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
-
return 0;
}
@@ -764,24 +706,6 @@ be_visitor_amh_pre_proc::create_raise_operation (
}
}
- // Set the proper strategy.
- be_operation_ami_exception_holder_raise_strategy *ehrs = 0;
- ACE_NEW_RETURN (
- ehrs,
- be_operation_ami_exception_holder_raise_strategy (operation),
- -1
- );
-
- be_operation_strategy *old_strategy =
- operation->set_strategy (ehrs);
-
- if (old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
-
// After having generated the operation we insert it into the
// exceptionholder valuetype.
if (0 == excep_holder->be_add_operation (operation))
diff --git a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp
index d51c79d1a09..b9cbf627ed8 100644
--- a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp
@@ -21,10 +21,8 @@
#include "be_root.h"
#include "be_module.h"
#include "be_interface.h"
-#include "be_interface_strategy.h"
#include "be_valuetype.h"
#include "be_operation.h"
-#include "be_operation_strategy.h"
#include "be_attribute.h"
#include "be_predefined_type.h"
#include "be_argument.h"
@@ -43,12 +41,10 @@
be_visitor_ami_pre_proc::be_visitor_ami_pre_proc (be_visitor_context *ctx)
: be_visitor_scope (ctx)
{
-
}
be_visitor_ami_pre_proc::~be_visitor_ami_pre_proc (void)
{
-
}
int
@@ -188,21 +184,6 @@ be_visitor_ami_pre_proc::visit_interface (be_interface *node)
-1);
}
- // Set the proper strategy.
- be_interface_ami_strategy *bias = 0;
- ACE_NEW_RETURN (bias,
- be_interface_ami_strategy (node,
- reply_handler),
- -1);
- be_interface_strategy *old_strategy = node->set_strategy (bias);
-
- if (old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
-
if (this->visit_scope (node) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -223,46 +204,18 @@ be_visitor_ami_pre_proc::visit_operation (be_operation *node)
// We do nothing for oneways!
return 0;
}
+
+ be_interface *parent =
+ be_interface::narrow_from_scope (node->defined_in ());
// If we're here, we're sure that the arg traits specialization
// for this will be needed.
be_global->messaging_exceptionholder ()->seen_in_operation (true);
- be_operation *sendc_marshaling =
- this->create_sendc_operation (node,
- 0); // for arguments = FALSE
-
- be_operation *sendc_arguments =
- this->create_sendc_operation (node,
- 1); // for arguments = TRUE
-
- if (0 != sendc_marshaling && 0 != sendc_arguments)
- {
- sendc_marshaling->set_defined_in (node->defined_in ());
-
- sendc_arguments->set_defined_in (node->defined_in ());
-
- // We do not copy the exceptions because the exceptions
- // are delivered by the excep methods.
-
- // Set the proper strategy, and store the specialized
- // marshaling and arguments operations in it.
- be_operation_ami_sendc_strategy * boass = 0;
- ACE_NEW_RETURN (boass,
- be_operation_ami_sendc_strategy (node,
- sendc_marshaling,
- sendc_arguments),
- -1);
-
- be_operation_strategy *old_strategy = node->set_strategy (boass);
-
- if (old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
- }
+ be_operation *sendc_op =
+ this->create_sendc_operation (node); // for arguments = TRUE
+
+ parent->be_add_operation (sendc_op);
return 0;
}
@@ -270,71 +223,31 @@ be_visitor_ami_pre_proc::visit_operation (be_operation *node)
int
be_visitor_ami_pre_proc::visit_attribute (be_attribute *node)
{
- // Temporarily generate the set operation.
- be_operation *set_operation =
- this->generate_set_operation (node);
-
- this->visit_operation (set_operation);
-
- // Retrieve the strategy set by the visit operation.
- be_operation_default_strategy *bods = 0;
- ACE_NEW_RETURN (bods,
- be_operation_default_strategy (set_operation),
- -1);
-
- be_operation_strategy *set_operation_strategy =
- set_operation->set_strategy (bods);
-
- set_operation->destroy ();
- delete set_operation;
- set_operation = 0;
-
- // Assign it to the attribute as set_operation strategy.
- if (0 != set_operation_strategy)
+ if (! node->readonly ())
{
- be_operation_strategy *bos =
- node->set_set_strategy (set_operation_strategy);
+ /// Temporarily generate the set operation.
+ be_operation *set_operation =
+ this->generate_set_operation (node);
+ set_operation->set_defined_in (node->defined_in ());
- if (0 != bos)
- {
- bos->destroy ();
- delete bos;
- bos = 0;
- }
- }
+ this->visit_operation (set_operation);
- // Temporarily generate the get operation.
+ set_operation->destroy ();
+ delete set_operation;
+ set_operation = 0;
+ }
+
+ /// Temporarily generate the get operation.
be_operation *get_operation =
this->generate_get_operation (node);
+ get_operation->set_defined_in (node->defined_in ());
this->visit_operation (get_operation);
-
- // Retrieve the strategy set by the visit operation.
- ACE_NEW_RETURN (bods,
- be_operation_default_strategy (get_operation),
- -1);
-
- be_operation_strategy *get_operation_strategy =
- get_operation->set_strategy (bods);
-
+
get_operation->destroy ();
delete get_operation;
get_operation = 0;
-
- // Assign it to the attribute as get_operation strategy.
- if (0 != get_operation_strategy)
- {
- be_operation_strategy *bos =
- node->set_get_strategy (get_operation_strategy);
-
- if (0 != bos)
- {
- bos->destroy ();
- delete bos;
- bos = 0;
- }
- }
-
+
return 0;
}
@@ -356,9 +269,9 @@ be_visitor_ami_pre_proc::create_reply_handler (be_interface *node)
UTL_ScopedName *reply_handler_name =
static_cast<UTL_ScopedName *> (node->name ()->copy ());
+
reply_handler_name->last_component ()->replace_string (
- reply_handler_local_name.c_str ()
- );
+ reply_handler_local_name.c_str ());
long n_parents = 0;
AST_Type **p_intf =
@@ -432,7 +345,7 @@ be_visitor_ami_pre_proc::create_reply_handler (be_interface *node)
{
be_operation *get_operation =
this->generate_get_operation (attribute);
-
+
this->create_reply_handler_operation (get_operation,
reply_handler);
@@ -476,136 +389,12 @@ be_visitor_ami_pre_proc::create_reply_handler (be_interface *node)
} // end of while loop
} // end of if
+ reply_handler->is_ami_rh (true);
return reply_handler;
}
-int
-be_visitor_ami_pre_proc::create_raise_operation (
- be_decl *node,
- Operation_Kind operation_kind
- )
-{
- be_operation *orig_op = 0;
-
- if (operation_kind == NORMAL)
- {
- orig_op = be_operation::narrow_from_decl (node);
-
- if (orig_op)
- {
- if (orig_op->flags () == AST_Operation::OP_oneway)
- {
- // We do nothing for oneways!
- return 0;
- }
- }
- }
-
- Identifier *id = 0;
- UTL_ScopedName *sn = 0;
-
- ACE_NEW_RETURN (id,
- Identifier ("void"),
- -1);
-
- ACE_NEW_RETURN (sn,
- UTL_ScopedName (id,
- 0),
- -1);
-
- // Create the return type, which is "void"
- be_predefined_type *rt = 0;
- ACE_NEW_RETURN (rt,
- be_predefined_type (AST_PredefinedType::PT_void,
- sn),
- -1);
-
- be_valuetype *excep_holder = be_global->messaging_exceptionholder ();
-
- // Name the operation properly
- UTL_ScopedName *op_name =
- static_cast<UTL_ScopedName *> (excep_holder->name ()->copy ());
-
- ACE_CString new_local_name ("raise_");
-
- if (operation_kind == SET_OPERATION)
- {
- new_local_name += "set_";
- }
- else if (operation_kind == GET_OPERATION)
- {
- new_local_name += "get_";
- }
-
- new_local_name += node->name ()->last_component ()->get_string ();
-
- ACE_NEW_RETURN (id,
- Identifier (new_local_name.c_str ()),
- -1);
-
- ACE_NEW_RETURN (sn,
- UTL_ScopedName (id,
- 0),
- -1);
-
- op_name->nconc (sn);
-
- be_operation *operation = 0;
- ACE_NEW_RETURN (operation,
- be_operation (rt,
- AST_Operation::OP_noflags,
- op_name,
- false,
- false),
- -1);
-
- operation->set_name (op_name);
- operation->set_defined_in (excep_holder);
-
-#if defined (TAO_HAS_DEPRECATED_EXCEPTION_HOLDER)
- if (operation_kind == NORMAL)
- {
- if (orig_op)
- {
- // Copy the exceptions.
- UTL_ExceptList *exceptions = orig_op->exceptions ();
-
- if (0 != exceptions)
- {
- operation->be_add_exceptions (exceptions->copy ());
- }
- }
- }
-#endif
-
- // Set the proper strategy.
- be_operation_ami_exception_holder_raise_strategy *boaehrs = 0;
- ACE_NEW_RETURN (boaehrs,
- be_operation_ami_exception_holder_raise_strategy (operation),
- -1);
-
- be_operation_strategy *old_strategy = operation->set_strategy (boaehrs);
-
- if (old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
-
- // After having generated the operation we insert it into the
- // exceptionholder valuetype.
- if (0 == excep_holder->be_add_operation (operation))
- {
- return -1;
- }
-
- return 0;
-}
-
be_operation *
-be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node,
- int for_arguments)
+be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node)
{
if (node->flags () == AST_Operation::OP_oneway)
{
@@ -627,6 +416,8 @@ be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node,
static_cast<UTL_ScopedName *> (node->name ()->copy ());
op_name->last_component ()->replace_string (new_op_name.c_str ());
+ idl_global->scopes ().push (node->defined_in ());
+
// Create the operation
be_operation *op = 0;
ACE_NEW_RETURN (op,
@@ -636,76 +427,75 @@ be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node,
false,
false),
0);
+
+ idl_global->scopes ().pop ();
op->set_name (op_name);
// Create the first argument, which is a Reply Handler
- if (for_arguments)
+ // Look up the field type.
+ UTL_Scope *s = node->defined_in ();
+ be_decl *parent = be_scope::narrow_from_scope (s)->decl ();
+
+ // Add the pre- and suffix
+ ACE_CString handler_local_name;
+ this->generate_name (handler_local_name,
+ "AMI_",
+ parent->name ()->last_component ()->get_string (),
+ "Handler");
+
+ UTL_ScopedName *field_name =
+ static_cast<UTL_ScopedName *> (parent->name ()->copy ());
+ field_name->last_component ()->replace_string (
+ handler_local_name.c_str ()
+ );
+
+ AST_Decl *d = s->lookup_by_name (field_name, true);
+ field_name->destroy ();
+ delete field_name;
+ field_name = 0;
+
+ if (0 == d)
{
- // Look up the field type.
- UTL_Scope *s = node->defined_in ();
- be_decl *parent = be_scope::narrow_from_scope (s)->decl ();
-
- // Add the pre- and suffix
- ACE_CString handler_local_name;
- this->generate_name (handler_local_name,
- "AMI_",
- parent->name ()->last_component ()->get_string (),
- "Handler");
-
- UTL_ScopedName *field_name =
- static_cast<UTL_ScopedName *> (parent->name ()->copy ());
- field_name->last_component ()->replace_string (
- handler_local_name.c_str ()
- );
-
- AST_Decl *d = s->lookup_by_name (field_name, true);
- field_name->destroy ();
- delete field_name;
- field_name = 0;
-
- if (0 == d)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_ami_pre_proc::"
- "create_sendc_operation - "
- "lookup of reply handler failed\n"),
- 0);
- }
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_ami_pre_proc::"
+ "create_sendc_operation - "
+ "lookup of reply handler failed\n"),
+ 0);
+ }
- be_interface *field_type = be_interface::narrow_from_decl (d);
+ be_interface *field_type = be_interface::narrow_from_decl (d);
- // Create the argument.
- ACE_NEW_RETURN (id,
- Identifier ("ami_handler"),
- 0);
+ // Create the argument.
+ ACE_NEW_RETURN (id,
+ Identifier ("ami_handler"),
+ 0);
- UTL_ScopedName *tmp = 0;
+ UTL_ScopedName *tmp = 0;
- ACE_NEW_RETURN (tmp,
- UTL_ScopedName (id,
- 0),
- 0);
+ ACE_NEW_RETURN (tmp,
+ UTL_ScopedName (id,
+ 0),
+ 0);
- sn = (UTL_ScopedName *)op->name ()->copy ();
- sn->nconc (tmp);
+ sn = (UTL_ScopedName *)op->name ()->copy ();
+ sn->nconc (tmp);
- be_argument *arg = 0;
- ACE_NEW_RETURN (arg,
- be_argument (AST_Argument::dir_IN,
- field_type, // is also a valuetype
- sn),
- 0);
+ be_argument *arg = 0;
+ ACE_NEW_RETURN (arg,
+ be_argument (AST_Argument::dir_IN,
+ field_type, // is also a valuetype
+ sn),
+ 0);
- arg->set_defined_in (op);
- arg->set_name (sn);
- op->be_add_argument (arg);
+ arg->set_defined_in (op);
+ arg->set_name (sn);
+ op->be_add_argument (arg);
- if (field_type->imported ())
- {
- field_type->seen_in_operation (false);
- }
+ if (field_type->imported ())
+ {
+ field_type->seen_in_operation (false);
}
// Iterate over the arguments and put all the in and inout
@@ -753,14 +543,15 @@ be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node,
} // end of while loop
} // end of if
+ op->is_sendc_ami (true);
+ op->is_attr_op (node->is_attr_op ());
return op;
}
int
be_visitor_ami_pre_proc::create_reply_handler_operation (
- be_operation *node,
- be_interface *reply_handler
- )
+ be_operation *node,
+ be_interface *reply_handler)
{
if (!node)
{
@@ -882,21 +673,6 @@ be_visitor_ami_pre_proc::create_reply_handler_operation (
} // end of while loop
} // end of if
- // Set the proper strategy.
- be_operation_ami_handler_reply_stub_strategy *boahrss = 0;
- ACE_NEW_RETURN (boahrss,
- be_operation_ami_handler_reply_stub_strategy (operation),
- -1);
-
- be_operation_strategy *old_strategy = operation->set_strategy (boahrss);
-
- if (old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
-
operation->set_defined_in (reply_handler);
// Copy the exceptions.
@@ -917,6 +693,7 @@ be_visitor_ami_pre_proc::create_reply_handler_operation (
return -1;
}
+ operation->is_attr_op (node->is_attr_op ());
return 0;
}
@@ -924,11 +701,6 @@ int
be_visitor_ami_pre_proc::create_excep_operation (be_operation *node,
be_interface *reply_handler)
{
- if (!node)
- {
- return -1;
- }
-
if (node->flags () == AST_Operation::OP_oneway)
{
// We do nothing for oneways!
@@ -1013,13 +785,9 @@ be_visitor_ami_pre_proc::create_excep_operation (be_operation *node,
operation->be_add_exceptions (exceptions->copy ());
}
- // After having generated the operation we insert it into the
- // reply handler interface.
- if (0 == reply_handler->be_add_operation (operation))
- {
- return -1;
- }
+ reply_handler->be_add_operation (operation);
+ operation->is_excep_ami (true);
return 0;
}
@@ -1155,6 +923,7 @@ be_visitor_ami_pre_proc::generate_get_operation (be_attribute *node)
operation->be_add_exceptions (exceptions->copy ());
}
+ operation->is_attr_op (true);
return operation;
}
@@ -1203,6 +972,7 @@ be_visitor_ami_pre_proc::generate_set_operation (be_attribute *node)
operation->be_add_exceptions (exceptions->copy ());
}
+ operation->is_attr_op (true);
return operation;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp b/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp
index 7cf6a0d045b..ede91f2f396 100644
--- a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp
@@ -73,18 +73,6 @@ be_visitor_attribute::visit_attribute (be_attribute *node)
get_op.be_add_exceptions (get_exceptions->copy ());
}
- // Get the strategy from the attribute and hand it over
- // to the operation.
- be_operation_strategy *old_strategy =
- get_op.set_strategy (node->get_get_strategy ()->copy ());
-
- if (0 != old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
-
be_visitor_context ctx (*this->ctx_);
int status = 1;
@@ -93,11 +81,19 @@ be_visitor_attribute::visit_attribute (be_attribute *node)
// These two cases are the only ones that could involve a strategy.
case TAO_CodeGen::TAO_ROOT_CH:
case TAO_CodeGen::TAO_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
- break;
+ {
+ ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
+ be_visitor_operation_ch visitor (&ctx);
+ status = get_op.accept (&visitor);
+ break;
+ }
case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CS);
- break;
+ {
+ ctx.state (TAO_CodeGen::TAO_OPERATION_CS);
+ be_visitor_operation_cs visitor (&ctx);
+ status = get_op.accept (&visitor);
+ break;
+ }
case TAO_CodeGen::TAO_ROOT_SH:
{
be_visitor_operation_sh visitor (&ctx);
@@ -202,50 +198,6 @@ be_visitor_attribute::visit_attribute (be_attribute *node)
"codegen for get_attribute failed\n"),
-1);
}
- else if (status == 1)
- {
- // Change the state depending on the kind of node strategy.
- ctx.state (get_op.next_state (ctx.state ()));
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor || (get_op.accept (visitor) == -1))
- {
- delete visitor;
- visitor = 0;
- get_op.destroy ();
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for get_attribute failed\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
-
- if (get_op.has_extra_code_generation (ctx.state ()))
- {
- // Change the state depending on the kind of node strategy.
- ctx.state (get_op.next_state (ctx.state (), 1));
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor || (get_op.accept (visitor) == -1))
- {
- delete visitor;
- visitor = 0;
- get_op.destroy ();
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for get_attribute failed\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
- }
- }
get_op.destroy ();
@@ -290,18 +242,6 @@ be_visitor_attribute::visit_attribute (be_attribute *node)
set_op.be_add_exceptions (set_exceptions->copy ());
}
- // Get the strategy from the attribute and hand it over
- // to the operation, thereby deleting the old one.
- old_strategy =
- set_op.set_strategy (node->get_set_strategy ()->copy ());
-
- if (0 != old_strategy)
- {
- old_strategy->destroy ();
- delete old_strategy;
- old_strategy = 0;
- }
-
ctx = *this->ctx_;
status = 1;
@@ -310,11 +250,19 @@ be_visitor_attribute::visit_attribute (be_attribute *node)
// These two cases are the only ones that could involved a strategy.
case TAO_CodeGen::TAO_ROOT_CH:
case TAO_CodeGen::TAO_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
- break;
+ {
+ ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
+ be_visitor_operation_ch visitor (&ctx);
+ status = set_op.accept (&visitor);
+ break;
+ }
case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CS);
- break;
+ {
+ ctx.state (TAO_CodeGen::TAO_OPERATION_CS);
+ be_visitor_operation_cs visitor (&ctx);
+ status = set_op.accept (&visitor);
+ break;
+ }
case TAO_CodeGen::TAO_ROOT_SH:
{
be_visitor_operation_sh visitor (&ctx);
@@ -433,50 +381,6 @@ be_visitor_attribute::visit_attribute (be_attribute *node)
-1);
}
- // Change the state depending on the kind of node strategy
- ctx.state (set_op.next_state (ctx.state ()));
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor || (set_op.accept (visitor) == -1))
- {
- delete visitor;
- visitor = 0;
- set_op.destroy ();
- rt.destroy ();
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for set_attribute failed\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
-
- if (set_op.has_extra_code_generation (ctx.state ()))
- {
- // Change the state depending on the kind of node strategy
- ctx.state (set_op.next_state (ctx.state (), 1));
-
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor || (set_op.accept (visitor) == -1))
- {
- delete visitor;
- visitor = 0;
- set_op.destroy ();
- rt.destroy ();
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_attribute::"
- "visit_attribute - "
- "codegen for set_attribute failed\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
- }
-
set_op.destroy ();
rt.destroy ();
return 0;
diff --git a/TAO/TAO_IDL/be/be_visitor_component/component.cpp b/TAO/TAO_IDL/be/be_visitor_component/component.cpp
index 9ee6bade01e..9c2340cf65f 100644
--- a/TAO/TAO_IDL/be/be_visitor_component/component.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_component/component.cpp
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
// ******************************************************
// Generic Component visitor
// ******************************************************
@@ -76,11 +75,19 @@ be_visitor_component::visit_operation (be_operation *node)
// These first two cases may have the context state changed
// by a strategy, so we use the visitor factory below.
case TAO_CodeGen::TAO_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
- break;
+ {
+ ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
+ be_visitor_operation_ch visitor (&ctx);
+ status = node->accept (&visitor);
+ break;
+ }
case TAO_CodeGen::TAO_ROOT_CS:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CS);
- break;
+ {
+ ctx.state (TAO_CodeGen::TAO_OPERATION_CS);
+ be_visitor_operation_cs visitor (&ctx);
+ status = node->accept (&visitor);
+ break;
+ }
case TAO_CodeGen::TAO_ROOT_SH:
{
be_visitor_operation_sh visitor (&ctx);
@@ -142,66 +149,6 @@ be_visitor_component::visit_operation (be_operation *node)
-1);
}
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state ()));
-
- // Grab the appropriate visitor.
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component::"
- "visit_operation - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component::"
- "visit_operation - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
-
- // Do additional code generation is necessary.
- // Note, this call is delegated to the strategy connected to
- // the node.
- if (node->has_extra_code_generation (ctx.state ()))
- {
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state (), 1));
-
- // Grab the appropriate visitor.
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component::"
- "visit_operation - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_component::"
- "visit_operation - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
- }
-
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_context.cpp b/TAO/TAO_IDL/be/be_visitor_context.cpp
index 9a3cac5baaf..c505f5223c0 100644
--- a/TAO/TAO_IDL/be/be_visitor_context.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_context.cpp
@@ -239,8 +239,6 @@ be_visitor_context::export_macro (void) const
case TAO_CodeGen::TAO_ARRAY_CH:
case TAO_CodeGen::TAO_INTERFACE_CH:
case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH:
- case TAO_CodeGen::TAO_AMI_INTERFACE_CH:
- case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CH:
case TAO_CodeGen::TAO_ROOT_CH:
return be_global->stub_export_macro ();
case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH:
diff --git a/TAO/TAO_IDL/be/be_visitor_factory.cpp b/TAO/TAO_IDL/be/be_visitor_factory.cpp
index bb71e8967e5..051c30766e1 100644
--- a/TAO/TAO_IDL/be/be_visitor_factory.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_factory.cpp
@@ -15,7 +15,6 @@
*/
//=============================================================================
-
#include "ast_argument.h"
#include "be_visitor_factory.h"
@@ -25,21 +24,15 @@
#include "be_visitor_scope.h"
#include "be_visitor_interface/interface.h"
#include "be_visitor_interface/interface_ch.h"
-#include "be_visitor_interface/ami_interface_ch.h"
#include "be_visitor_valuetype/valuetype.h"
#include "be_visitor_valuetype/valuetype_ch.h"
#include "be_visitor_valuetype/valuetype_obv_ch.h"
#include "be_visitor_valuetype/valuetype_obv_cs.h"
-#include "be_visitor_valuetype/ami_exception_holder_ch.h"
-#include "be_visitor_valuetype/ami_exception_holder_cs.h"
#include "be_visitor_operation/operation.h"
#include "be_visitor_operation/operation_ch.h"
#include "be_visitor_operation/operation_cs.h"
-#include "be_visitor_operation/ami_ch.h"
#include "be_visitor_operation/ami_cs.h"
-#include "be_visitor_operation/ami_handler_reply_stub_operation_ch.h"
#include "be_visitor_operation/ami_handler_reply_stub_operation_cs.h"
-#include "be_visitor_operation/ami_exception_holder_operation_cs.h"
TAO_Visitor_Factory::TAO_Visitor_Factory (void)
{
@@ -81,18 +74,6 @@ TAO_Visitor_Factory::make_visitor (be_visitor_context *ctx)
be_visitor_operation_cs (ctx),
0);
break;
- case TAO_CodeGen::TAO_AMI_INTERFACE_CH:
- ACE_NEW_RETURN (retval,
- be_visitor_ami_interface_ch (ctx),
- 0);
- break;
- case TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CH:
- ACE_NEW_RETURN (
- retval,
- be_visitor_operation_ami_handler_reply_stub_operation_ch (ctx),
- 0
- );
- break;
case TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CS:
ACE_NEW_RETURN (
retval,
@@ -100,33 +81,11 @@ TAO_Visitor_Factory::make_visitor (be_visitor_context *ctx)
0
);
break;
- case TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CH:
- ACE_NEW_RETURN (retval,
- be_visitor_operation_ami_ch (ctx),
- 0);
- break;
case TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CS:
ACE_NEW_RETURN (retval,
be_visitor_operation_ami_cs (ctx),
0);
break;
- case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_RAISE_OPERATION_CS:
- ACE_NEW_RETURN (
- retval,
- be_visitor_operation_ami_exception_holder_operation_cs (ctx),
- 0
- );
- break;
- case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CH:
- ACE_NEW_RETURN (retval,
- be_visitor_valuetype_ami_exception_holder_ch (ctx),
- 0);
- break;
- case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CS:
- ACE_NEW_RETURN (retval,
- be_visitor_valuetype_ami_exception_holder_cs (ctx),
- 0);
- break;
default:
// An error.
return 0;
diff --git a/TAO/TAO_IDL/be/be_visitor_interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface.cpp
index fda75ab827c..a6ae7d6e19c 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface.cpp
@@ -84,9 +84,6 @@
#include "be_visitor_interface/direct_proxy_impl_sh.cpp"
#include "be_visitor_interface/direct_proxy_impl_ss.cpp"
-// AMI
-#include "be_visitor_interface/ami_interface_ch.cpp"
-
// AMI4CCM
#include "be_visitor_interface/ami4ccm_rh_ex_idl.cpp"
#include "be_visitor_interface/ami4ccm_sendc_ex_idl.cpp"
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_interface_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_interface_ch.cpp
deleted file mode 100644
index cbc16f06a53..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_interface/ami_interface_ch.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-
-//=============================================================================
-/**
- * @file ami_interface_ch.cpp
- *
- * $Id$
- *
- * Visitor generating code for AMI Interfaces in the client header
- *
- *
- * @author Aniruddha Gokhale
- * @author Michael Kircher
- */
-//=============================================================================
-
-// ******************************************************
-// Interface visitor for client header
-// ******************************************************
-
-be_visitor_ami_interface_ch::be_visitor_ami_interface_ch (
- be_visitor_context *ctx
- )
- : be_visitor_interface (ctx)
-{
-}
-
-be_visitor_ami_interface_ch::~be_visitor_ami_interface_ch (void)
-{
-}
-
-int
-be_visitor_ami_interface_ch::visit_interface (be_interface *node)
-{
- // No need to check for code already having been generated. This
- // is a separate pass through the AST specific to AMI, and will
- // happen only once.
- if (node->imported () || node->is_local ())
- {
- return 0;
- }
-
- // Grab the stream.
- TAO_OutStream *os = this->ctx_->stream ();
-
- // Forward declaration.
- *os << be_nl << be_nl
- << "class " << node->replacement ()->local_name () << ";" << be_nl;
-
- // Generate the _ptr declaration.
- *os << "typedef " << node->replacement ()->local_name ()
- << " *" << node->replacement ()->local_name ()
- << "_ptr;";
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp
index 792a45fec05..99b73167f7f 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp
@@ -202,7 +202,7 @@ be_visitor_interface::visit_constant (be_constant *node)
break;
}
default:
- return 0; // nothing to be done
+ return 0; // nothing to be done
}
if (status == -1)
@@ -398,10 +398,26 @@ be_visitor_interface::visit_operation (be_operation *node)
// These first two cases may have the context state changed
// by a strategy, so we use the visitor factory below.
case TAO_CodeGen::TAO_INTERFACE_CH:
- ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
- break;
+ {
+ ctx.state (TAO_CodeGen::TAO_OPERATION_CH);
+ be_visitor_operation_ch visitor (&ctx);
+ status = node->accept (&visitor);
+ break;
+ }
case TAO_CodeGen::TAO_ROOT_CS:
ctx.state (TAO_CodeGen::TAO_OPERATION_CS);
+
+ if (node->is_sendc_ami ())
+ {
+ be_visitor_operation_ami_cs visitor (&ctx);
+ status = node->accept (&visitor);
+ }
+ else
+ {
+ be_visitor_operation_cs visitor (&ctx);
+ status = node->accept (&visitor);
+ }
+
break;
case TAO_CodeGen::TAO_ROOT_SH:
{
@@ -506,66 +522,6 @@ be_visitor_interface::visit_operation (be_operation *node)
-1);
}
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state ()));
-
- // Grab the appropriate visitor.
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_operation - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_operation - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
-
- // Do additional code generation is necessary.
- // Note, this call is delegated to the strategy connected to
- // the node.
- if (node->has_extra_code_generation (ctx.state ()))
- {
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state (), 1));
-
- // Grab the appropriate visitor.
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_operation - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_interface::"
- "visit_operation - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
- }
-
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_module/module.cpp b/TAO/TAO_IDL/be/be_visitor_module/module.cpp
index 53ef27a924d..75073b5e36b 100644
--- a/TAO/TAO_IDL/be/be_visitor_module/module.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_module/module.cpp
@@ -277,8 +277,12 @@ be_visitor_module::visit_interface (be_interface *node)
switch (this->ctx_->state ())
{
case TAO_CodeGen::TAO_ROOT_CH:
- ctx.state (TAO_CodeGen::TAO_INTERFACE_CH);
- break;
+ {
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_CH);
+ be_visitor_interface_ch visitor (&ctx);
+ status = node->accept (&visitor);
+ break;
+ }
case TAO_CodeGen::TAO_ROOT_CI:
{
be_visitor_interface_ci visitor (&ctx);
@@ -397,64 +401,6 @@ be_visitor_module::visit_interface (be_interface *node)
-1);
}
- // Change the state depending on the kind of node strategy
- ctx.state (node->next_state (ctx.state ()));
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_interface - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_interface - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
-
- // Do additional code generation is necessary.
- // Note, this call is delegated to the strategy connected to
- // the node.
- if (node->has_extra_code_generation (ctx.state ()))
- {
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state (), 1));
-
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_interface - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_module::"
- "visit_interface - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
- }
-
ctx.state (TAO_CodeGen::TAO_ROOT_CH);
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation.cpp
index e10a53caaee..9805a0c47b1 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation.cpp
@@ -73,11 +73,8 @@
#include "be_visitor_operation/upcall_command_ss.cpp"
// AMI
-#include "be_visitor_operation/ami_ch.cpp"
#include "be_visitor_operation/ami_cs.cpp"
-#include "be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp"
#include "be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp"
-#include "be_visitor_operation/ami_exception_holder_operation_cs.cpp"
// Smart proxy
#include "be_visitor_operation/smart_proxy_ch.cpp"
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp
deleted file mode 100644
index 9a880d92228..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-
-//=============================================================================
-/**
- * @file ami_ch.cpp
- *
- * $Id$
- *
- * Visitor generating AMI stub code for Operation node in the
- * client header.
- *
- *
- * @author Alexander Babu Arulanthu <alex@cs.wustl.edu>
- */
-//=============================================================================
-
-
-// ******************************************************
-// Visitor for generating AMI stub for "operation" in client header.
-// ******************************************************
-
-be_visitor_operation_ami_ch::be_visitor_operation_ami_ch (
- be_visitor_context *ctx
- )
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ami_ch::~be_visitor_operation_ami_ch (void)
-{
-}
-
-int
-be_visitor_operation_ami_ch::visit_operation (be_operation *node)
-{
- // No sendc method for oneway operations.
- if (node->flags () == AST_Operation::OP_oneway)
- {
- return 0;
- }
-
- // Output stream.
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- // Every operation is declared virtual in the client code.
- *os << be_nl << be_nl
- << "virtual ";
-
- // STEP I: Return type is void.
- *os << "void ";
-
- // STEP 2: Generate the operation name.
-
- // First the sendc prefix.
- *os << "sendc_";
-
- // Check if we are an attribute node in disguise.
- if (this->ctx_->attribute ())
- {
- // Now check if we are a "get" or "set" operation.
- if (node->nmembers () == 1)
- {
- *os << "set_";
- }
- else
- {
- *os << "get_";
- }
- }
-
- *os << node->local_name ();
-
- // STEP 3: Generate the argument list with the appropriate
- // mapping. For these we grab a visitor that generates the
- // parameter listing.
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_CH);
- be_visitor_operation_arglist visitor (&ctx);
- be_operation *arguments = node->arguments ();
-
- // If a local node's parent has a sendc_* operation, we must
- // regenerate it as pure virtual, so we temporarily set the
- // strategy-related node to local, if necessary, and restore
- // it after the visitor returns.
- bool orig_local = arguments->is_local ();
- arguments->set_local (node->is_local ());
-
- if (node->arguments ()->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- arguments->set_local (orig_local);
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp
index 2006857ec92..0628bfd1ffc 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp
@@ -81,23 +81,7 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node)
// Generate the scope::operation name.
*os << parent->full_name ()
- << "::sendc_";
-
- // Check if we are an attribute node in disguise.
- if (this->ctx_->attribute ())
- {
- // Now check if we are a "get" or "set" operation.
- if (node->nmembers () == 1)
- {
- *os << "set_";
- }
- else
- {
- *os << "get_";
- }
- }
-
- *os << node->local_name ()->get_string ();
+ << "::" << node->local_name ()->get_string ();
// Generate the argument list with the appropriate mapping (same as
// in the header file)
@@ -105,7 +89,7 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node)
be_visitor_operation_arglist oa_visitor (&ctx);
// Get the AMI version from the strategy class.
- be_operation *ami_op = node->arguments ();
+ be_operation *ami_op = node;//node->arguments ();
if (ami_op->accept (&oa_visitor) == -1)
{
@@ -147,7 +131,8 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node)
<< be_uidt_nl
<< "}" << be_uidt_nl << be_nl;
- if (be_global->gen_direct_collocation() || be_global->gen_thru_poa_collocation ())
+ if (be_global->gen_direct_collocation()
+ || be_global->gen_thru_poa_collocation ())
{
*os << "if (this->the_TAO_" << parent->local_name ()
<< "_Proxy_Broker_ == 0)" << be_idt_nl
@@ -208,27 +193,15 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node)
be_interface *intf = be_interface::narrow_from_decl (parent);
- const char *lname = node->local_name ()->get_string ();
- ACE_CDR::ULong opname_len =
- static_cast<ACE_CDR::ULong> (ACE_OS::strlen (lname));
- ACE_CString opname;
-
- if (this->ctx_->attribute ())
- {
- // If we are a attribute node, add 5 for '_get_' or '_set_'.
- opname_len += 5;
-
- // Now check if we are a "get" or "set" operation.
- if (node->nmembers () == 1)
- {
- opname = "_set_";
- }
- else
- {
- opname = "_get_";
- }
- }
-
+// const char *lname = node->local_name ()->get_string ();
+ ACE_CString base (node->local_name ()->get_string ());
+
+ /// The sendc_* operation makes the invocation with the
+ /// original operation name.
+ ACE_CString lname_str (base.substr (ACE_OS::strlen ("sendc_")));
+ const char *lname = lname_str.c_str ();
+
+ ACE_CString opname (node->is_attr_op () ? "_" : "");
opname += lname;
*os << be_nl << be_nl
@@ -236,8 +209,8 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node)
<< "this," << be_nl
<< "_the_tao_operation_signature," << be_nl
<< nargs << "," << be_nl
- << "\"" << opname.fast_rep () << "\"," << be_nl
- << opname_len << "," << be_nl;
+ << "\"" << opname.c_str () << "\"," << be_nl
+ << opname.length () << "," << be_nl;
if (be_global->gen_direct_collocation() || be_global->gen_thru_poa_collocation ())
{
@@ -265,8 +238,7 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node)
}
*os << "AMI_" << parent->local_name () << "Handler::"
- << opname.fast_rep () + (this->ctx_->attribute () != 0)
- << "_reply_stub" << be_uidt_nl
+ << lname << "_reply_stub" << be_uidt_nl
<< ");" << be_uidt;
*os << be_uidt_nl
@@ -316,14 +288,11 @@ be_visitor_operation_ami_cs::visit_argument (be_argument *node)
}
int
-be_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *node,
- be_type *bt)
+be_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *,
+ be_type *)
{
- // Nothing to be done here, we do not through any exceptions,
+ // Nothing to be done here, we do not throw any exceptions
// besides system exceptions, so we do not need an user exception table.
- ACE_UNUSED_ARG (node);
- ACE_UNUSED_ARG (bt);
-
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_exception_holder_operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_exception_holder_operation_cs.cpp
deleted file mode 100644
index 6235741fd1d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_exception_holder_operation_cs.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-
-//=============================================================================
-/**
- * @file ami_exception_holder_operation_cs.cpp
- *
- * $Id$
- *
- * Visitor generating code for Operation in the stubs file.
- *
- *
- * @author Michael Kircher <Michael.Kircher@mchp.siemens.de>
- */
-//=============================================================================
-
-
-// ************************************************************
-// Operation visitor for client stubs
-// ************************************************************
-
-be_visitor_operation_ami_exception_holder_operation_cs::
-be_visitor_operation_ami_exception_holder_operation_cs (
- be_visitor_context *ctx
- )
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ami_exception_holder_operation_cs::
-~be_visitor_operation_ami_exception_holder_operation_cs (void)
-{
-}
-
-int
-be_visitor_operation_ami_exception_holder_operation_cs::visit_operation (
- be_operation *
- )
-{
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp
deleted file mode 100644
index 2fb1a24027d..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-
-//=============================================================================
-/**
- * @file ami_handler_reply_stub_operation_ch.cpp
- *
- * $Id$
- *
- * Visitor generating code for AMI Handler call back operation in
- * the client header.
- *
- *
- * @author Aniruddha Gokhale and Alexander Babu Arulanthu <alex@cs.wustl.edu>
- */
-//=============================================================================
-
-
-// ************************************************************
-// Operation visitor for server header
-// ************************************************************
-
-be_visitor_operation_ami_handler_reply_stub_operation_ch::
-be_visitor_operation_ami_handler_reply_stub_operation_ch (be_visitor_context *ctx)
- : be_visitor_operation (ctx)
-{
-}
-
-be_visitor_operation_ami_handler_reply_stub_operation_ch::
-~be_visitor_operation_ami_handler_reply_stub_operation_ch (void)
-{
-}
-
-int
-be_visitor_operation_ami_handler_reply_stub_operation_ch::visit_operation (
- be_operation *node
- )
-{
- TAO_OutStream *os = this->ctx_->stream ();
- this->ctx_->node (node);
-
- // Generate the corresponding static skeleton method for this
- // operation only if there was no "native" type.
- if (!node->has_native ())
- {
- // Next line.
- *os << be_nl << be_nl
- << "static void ";
-
- // Check if we are an attribute node in disguise
- if (this->ctx_->attribute ())
- {
- // Now check if we are a "get" or "set" operation.
- if (node->nmembers () == 1)
- {
- *os << "_set_";
- }
- else
- {
- *os << "_get_";
- }
- }
-
- *os << node->local_name ()
- << "_reply_stub (" << be_idt << be_idt_nl;
-
- *os << "TAO_InputCDR &_tao_reply_cdr," << be_nl
- << "::Messaging::ReplyHandler_ptr _tao_reply_handler," << be_nl
- << "::CORBA::ULong reply_status);" << be_uidt << be_uidt;
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp
index ea6304febe3..d1a7baab823 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
// ************************************************************
// Operation visitor for client stubs.
// ************************************************************
@@ -49,8 +48,7 @@ be_visitor_operation_ami_handler_reply_stub_operation_cs::post_process (
int
be_visitor_operation_ami_handler_reply_stub_operation_cs::visit_operation (
- be_operation *node
- )
+ be_operation *node)
{
be_type *bt = 0;
be_visitor_context ctx;
@@ -77,7 +75,8 @@ be_visitor_operation_ami_handler_reply_stub_operation_cs::visit_operation (
os->indent ();
// Generate the return type. Return type is simply void.
- *os << be_nl << "void" << be_nl;
+ *os << be_nl << be_nl
+ << "void" << be_nl;
// Get the scope name.
be_decl *parent =
@@ -101,24 +100,8 @@ be_visitor_operation_ami_handler_reply_stub_operation_cs::visit_operation (
// Generate the operation name.
*os << "::";
- // Check if we are an attribute node in disguise
- if (this->ctx_->attribute ())
- {
- // Now check if we are a "get" or "set" operation
- if (node->nmembers () == 1)
- {
- *os << "_set_";
- }
- else
- {
- *os << "_get_";
- }
- }
-
- *os << node->local_name () << "_reply_stub (" << be_idt_nl;
-
- // Generate the argument list.
- *os << "TAO_InputCDR &_tao_in, " << be_nl
+ *os << node->local_name () << "_reply_stub (" << be_idt_nl
+ << "TAO_InputCDR &_tao_in, " << be_nl
<< "::Messaging::ReplyHandler_ptr _tao_reply_handler," << be_nl
<< "::CORBA::ULong reply_status"
<< ")" << be_uidt << be_uidt_nl
@@ -168,18 +151,6 @@ be_visitor_operation_ami_handler_reply_stub_operation_cs::visit_operation (
<< "{" << be_idt_nl
<< "const ACE_Message_Block* cdr = _tao_in.start ();" << be_nl ;
- be_interface *original =
- (be_interface::narrow_from_decl (parent))->original_interface ();
-
- if (!original)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%1) ami_handler_reply_stub_operation_cs::"
- "visit_operation - "
- "original interface is not set\n"),
- -1);
- }
-
const char *exception_data_arg = "0";
const char *exception_count_arg = "0";
@@ -276,7 +247,7 @@ be_visitor_operation_ami_handler_reply_stub_operation_cs::visit_operation (
<< "// We have to think about this case." << be_nl
<< "break;" << be_uidt << be_uidt_nl
<< "}" << be_uidt << be_uidt_nl;
- *os << "}" << be_nl << be_nl;
+ *os << "}";
return 0;
}
@@ -296,17 +267,16 @@ be_visitor_operation_ami_handler_reply_stub_operation_cs::visit_argument (
if (!bt)
{
ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_handler_reply_stub_operation_cs::"
- "visit_argument - "
- "Bad argument type\n"
- ),
- -1
- );
+ LM_ERROR,
+ "(%N:%l) be_visitor_operation_ami_handler_reply_stub_operation_cs::"
+ "visit_argument - "
+ "Bad argument type\n"),
+ -1);
}
os->indent ();
*os << "{" << bt->tc_name () << ", ";
+
switch (node->direction ())
{
case AST_Argument::dir_IN:
@@ -341,14 +311,12 @@ be_visitor_operation_ami_handler_reply_stub_operation_cs::gen_pre_stub_info (
if (node->accept (&visitor) == -1)
{
ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) "
- "be_visitor_operation_ami_handler_reply_stub_operation_cs::"
- "gen_pre_stub_info - "
- "Exceptionlist generation error\n"
- ),
- -1
- );
+ LM_ERROR,
+ "(%N:%l) "
+ "be_visitor_operation_ami_handler_reply_stub_operation_cs::"
+ "gen_pre_stub_info - "
+ "Exceptionlist generation error\n"),
+ -1);
}
}
@@ -414,7 +382,6 @@ be_visitor_operation_ami_handler_reply_stub_operation_cs::gen_marshal_and_invoke
*os << node->local_name () << " (" << be_idt << be_idt_nl;
-
ctx = *this->ctx_;
ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS);
be_visitor_operation_argument oau_visitor (&ctx);
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp
index ea26c71f91d..ab1ed0d8c0e 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp
@@ -238,11 +238,6 @@ be_visitor_operation::gen_stub_operation_body (
-1);
}
- // Use the name without the possible '_cxx_' here.
- ACE_CDR::ULong tmp_len =
- static_cast<ACE_CDR::ULong> (
- ACE_OS::strlen (node->original_local_name ()->get_string ()));
-
*os << be_nl << be_nl
<< "TAO::" << (node->is_abstract () ? "AbstractBase_" : "" )
<< "Invocation_Adapter _tao_call (" << be_idt << be_idt_nl
@@ -251,27 +246,33 @@ be_visitor_operation::gen_stub_operation_body (
<< node->argument_count () + 1 << "," << be_nl
<< "\"";
- // Check if we are an attribute node in disguise.
+ /// This logic handles the implied IDL for attributes.
+ /// The AMI ReplyHandler version of generated get/set ops
+ /// for attributes doesn't have the leading underscore.
+ bool escape = (node->is_attr_op () && !intf->is_ami_rh ());
+ ACE_CString opname (escape ? "_" : "");
+
+ /// This logic handles regular IDL for attributes. The AMI
+ /// backend preprocessing visitor doesn't set the context
+ /// member for attributes, but sets flags in the interface
+ /// and operation nodes instead.
if (this->ctx_->attribute ())
{
- // If we are a attribute node, add th elength of the operation
- // name.
- tmp_len += 5;
-
// Now check if we are a "get" or "set" operation.
if (node->nmembers () == 1)
{
- *os << "_set_";
+ opname += "_set_";
}
else
{
- *os << "_get_";
+ opname += "_get_";
}
}
- // original_local_name() strips off the leading '_cxx_' if any.
- *os << node->original_local_name () << "\"," << be_nl
- << tmp_len << "," << be_nl;
+ opname += node->original_local_name ()->get_string ();
+
+ *os << opname.c_str () << "\"," << be_nl
+ << opname.length () << "," << be_nl;
if (be_global->gen_direct_collocation() || be_global->gen_thru_poa_collocation ())
{
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp
index 83b3bfeb711..34300cf28a2 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp
@@ -33,10 +33,11 @@ be_visitor_operation_ch::visit_operation (be_operation *node)
this->ctx_->node (node);
*os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
+ << "// " << __FILE__ << ":" << __LINE__;
// Every operation is declared virtual in the client code.
- *os << "virtual ";
+ *os << be_nl << be_nl
+ << "virtual ";
// STEP I: generate the return type.
be_type *bt = be_type::narrow_from_decl (node->return_type ());
@@ -44,9 +45,9 @@ be_visitor_operation_ch::visit_operation (be_operation *node)
if (!bt)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ch::"
- "visit_operation - "
- "Bad return type\n"),
+ ACE_TEXT ("be_visitor_operation_ch::")
+ ACE_TEXT ("visit_operation - ")
+ ACE_TEXT ("Bad return type\n")),
-1);
}
@@ -81,6 +82,25 @@ be_visitor_operation_ch::visit_operation (be_operation *node)
"codegen for argument list failed\n"),
-1);
}
+
+ be_interface *intf =
+ be_interface::narrow_from_scope (node->defined_in ());
+
+ /// If we are in a reply handler, are not an execp_* operation,
+ /// and have no native args, then generate the AMI static
+ /// reply stub declaration.
+ if (intf->is_ami_rh ()
+ && !node->is_excep_ami ()
+ && !node->has_native ())
+ {
+ *os << be_nl << be_nl
+ << "static void " << be_nl
+ << node->local_name () << "_reply_stub (" << be_idt_nl
+ << "TAO_InputCDR &_tao_reply_cdr," << be_nl
+ << "::Messaging::ReplyHandler_ptr _tao_reply_handler,"
+ << be_nl
+ << "::CORBA::ULong reply_status);" << be_uidt;
+ }
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
index 04a2e70529a..2265c2db1c4 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
// ************************************************************
// Operation visitor for client stubs
// ************************************************************
@@ -105,13 +104,44 @@ be_visitor_operation_cs::visit_operation (be_operation *node)
if (node->accept (&al_visitor) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
+ "be_visitor_operation_cs::"
"visit_operation - "
"codegen for argument list failed\n"),
-1);
}
- return this->gen_stub_operation_body (node, bt);
+ if (this->gen_stub_operation_body (node, bt) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_operation_cs::"
+ "visit_operation - "
+ "codegen for stub body failed\n"),
+ -1);
+ }
+
+ /// If we are in a reply handler, are not an execp_* operation,
+ /// and have no native args, then generate the AMI static
+ /// reply stub declaration.
+ if (intf->is_ami_rh ()
+ && !node->is_excep_ami ()
+ && !node->has_native ())
+ {
+ be_visitor_operation_ami_handler_reply_stub_operation_cs v (
+ this->ctx_);
+
+ int status = v.visit_operation (node);
+
+ if (status == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_operation_cs::"
+ "visit_operation - "
+ "codegen for AMI reply stub failed\n"),
+ -1);
+ }
+ }
+
+ return 0;
}
int
@@ -148,5 +178,6 @@ be_visitor_operation_cs::visit_argument (be_argument *node)
}
*os << "0}";
+
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp
index c0a97d593a1..faf04367558 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
// ************************************************************
// Operation visitor for server header
// ************************************************************
@@ -29,6 +28,12 @@ be_visitor_operation_sh::~be_visitor_operation_sh (void)
int
be_visitor_operation_sh::visit_operation (be_operation *node)
{
+ /// No server-side code generation for these implied IDL nodes.
+ if (node->is_sendc_ami ())
+ {
+ return 0;
+ }
+
TAO_OutStream *os = this->ctx_->stream ();
this->ctx_->node (node);
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp
index b4f1de55984..c10a90b1d33 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp
@@ -28,6 +28,12 @@ be_visitor_operation_ss::~be_visitor_operation_ss (void)
int
be_visitor_operation_ss::visit_operation (be_operation * node)
{
+ /// No server-side code generation for these implied IDL nodes.
+ if (node->is_sendc_ami ())
+ {
+ return 0;
+ }
+
TAO_OutStream *os = this->ctx_->stream ();
be_type *bt = 0;
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp
index 0a70d7a112f..c605c0c83b5 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp
@@ -13,24 +13,22 @@
*/
//=============================================================================
-
-be_visitor_operation_upcall_command_ss
-::be_visitor_operation_upcall_command_ss (
- be_visitor_context *ctx)
+be_visitor_operation_upcall_command_ss::be_visitor_operation_upcall_command_ss (
+ be_visitor_context *ctx)
: be_visitor_operation (ctx)
{
}
-be_visitor_operation_upcall_command_ss
-::~be_visitor_operation_upcall_command_ss (void)
+be_visitor_operation_upcall_command_ss::~be_visitor_operation_upcall_command_ss (
+ void)
{
}
// The following needs to be done to deal until the MSVC compiler's broken
// handling of namespaces is fixed (hopefully forthcoming in version 7).
int
-be_visitor_operation_upcall_command_ss
-::gen_nested_namespace_begin (be_module *node)
+be_visitor_operation_upcall_command_ss::gen_nested_namespace_begin (
+ be_module *node)
{
TAO_OutStream *os = this->ctx_->stream ();
char *item_name = 0;
@@ -63,8 +61,8 @@ be_visitor_operation_upcall_command_ss
// The following needs to be done to deal until the MSVC compiler's broken
// handling of namespaces is fixed (hopefully forthcoming in version 7).
int
-be_visitor_operation_upcall_command_ss
-::gen_nested_namespace_end (be_module *node)
+be_visitor_operation_upcall_command_ss::gen_nested_namespace_end (
+ be_module *node)
{
TAO_OutStream *os = this->ctx_->stream ();
@@ -81,10 +79,16 @@ be_visitor_operation_upcall_command_ss
}
int
-be_visitor_operation_upcall_command_ss::visit (be_operation * node,
- char const * full_skel_name,
- char const * upcall_command_name)
+be_visitor_operation_upcall_command_ss::visit (
+ be_operation * node,
+ char const * full_skel_name,
+ char const * upcall_command_name)
{
+ if (node->is_sendc_ami ())
+ {
+ return 0;
+ }
+
be_interface * const intf = this->ctx_->attribute ()
? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ())
: be_interface::narrow_from_scope (node->defined_in ());
@@ -263,7 +267,8 @@ be_visitor_operation_upcall_command_ss::visit (be_operation * node,
}
int
-be_visitor_operation_upcall_command_ss::gen_upcall (be_operation * node)
+be_visitor_operation_upcall_command_ss::gen_upcall (
+ be_operation *node)
{
TAO_OutStream & os = *this->ctx_->stream ();
@@ -277,6 +282,7 @@ be_visitor_operation_upcall_command_ss::gen_upcall (be_operation * node)
bool excep_method = ((ACE_OS::strstr (op_name, excep_suffix) +
excep_suffix_len) ==
(op_name + ACE_OS::strlen (op_name)));
+
for (; !si.is_done (); si.next (), ++index)
{
AST_Argument * const arg =
@@ -399,6 +405,7 @@ be_visitor_operation_upcall_command_ss::gen_upcall (be_operation * node)
exceplist.visit_operation (node);
unsigned int exceptions_count = 0;
+
for (UTL_ExceptlistActiveIterator ei (node->exceptions ());
!ei.is_done (); ei.next ())
{
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype.cpp
index cadb05fb39e..2bdb4261171 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuetype.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuetype.cpp
@@ -13,7 +13,6 @@
*/
//=============================================================================
-
#include "be_argument.h"
#include "be_array.h"
#include "be_attribute.h"
@@ -87,8 +86,6 @@
#include "be_visitor_valuetype/field_cdr_ch.cpp"
#include "be_visitor_valuetype/field_cdr_cs.cpp"
#include "be_visitor_valuetype/obv_module.cpp"
-#include "be_visitor_valuetype/ami_exception_holder_ch.cpp"
-#include "be_visitor_valuetype/ami_exception_holder_cs.cpp"
#include "be_visitor_valuetype/valuetype_init.cpp"
#include "be_visitor_valuetype/valuetype_init_ch.cpp"
#include "be_visitor_valuetype/valuetype_init_ci.cpp"
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_ch.cpp
deleted file mode 100644
index 9927d3078cd..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_ch.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-
-//=============================================================================
-/**
- * @file ami_exception_holder_ch.cpp
- *
- * $Id$
- *
- * Visitor generating exception holders for the AMI callback model.
- *
- *
- * @author Michael Kircher <Michael.Kircher@mchp.siemens.de>
- */
-//=============================================================================
-
-
-// ******************************************************
-// Interface visitor for client header.
-// ******************************************************
-
-be_visitor_valuetype_ami_exception_holder_ch::
-be_visitor_valuetype_ami_exception_holder_ch (be_visitor_context *ctx)
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_ami_exception_holder_ch::
-~be_visitor_valuetype_ami_exception_holder_ch (void)
-{
-}
-
-int
-be_visitor_valuetype_ami_exception_holder_ch::visit_operation (
- be_operation *node
- )
-{
- be_visitor_context ctx (*this->ctx_);
-
- // Using the implementation class visitor is strange, but we
- // do it here because it's the only one that generates the
- // environment variable in the operation signature without
- // the trailing _WITH_DEFAULTS, which is what we want.
- // For performance reasons, we would rather there be a
- // compile error if the user does not pass an environment
- // variable, than create a default one, which causes extra
- // TSS activity.
- be_visitor_operation_ih visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_"
- "ami_exception_holder_ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_uidt;
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_cs.cpp
deleted file mode 100644
index 0bb35388746..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_cs.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-
-//=============================================================================
-/**
- * @file ami_exception_holder_cs.cpp
- *
- * $Id$
- *
- * Visitor generating code for excpetion holders.
- *
- *
- * @author Michael Kircher
- */
-//=============================================================================
-
-
-// ************************************************************
-// Interface visitor for client stubs
-// ************************************************************
-
-be_visitor_valuetype_ami_exception_holder_cs::
-be_visitor_valuetype_ami_exception_holder_cs (be_visitor_context *ctx)
- : be_visitor_valuetype (ctx)
-{
-}
-
-be_visitor_valuetype_ami_exception_holder_cs::
-~be_visitor_valuetype_ami_exception_holder_cs (void)
-{
-}
-
-int
-be_visitor_valuetype_ami_exception_holder_cs::visit_valuetype (
- be_valuetype *node
- )
-{
- ACE_UNUSED_ARG (node);
- return 0;
-}
-
-
-int
-be_visitor_valuetype_ami_exception_holder_cs::visit_operation (be_operation *node)
-{
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_RAISE_OPERATION_CS);
- be_visitor_operation_ami_exception_holder_operation_cs visitor (&ctx);
-
- if (node->accept (&visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_valuetype_ami_exception_holder_ch::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
- return 0;
-}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp
index c3570ea8559..5007b65aefe 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp
@@ -14,7 +14,6 @@
*/
//=============================================================================
-
// ************************************************************
// OBV module visitor for server header.
// ************************************************************
@@ -89,19 +88,26 @@ be_visitor_obv_module::visit_valuetype (be_valuetype *node)
switch (this->ctx_->state ())
{
case TAO_CodeGen::TAO_MODULE_OBV_CH:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CH);
- break;
+ {
+ ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CH);
+ be_visitor_valuetype_obv_ch visitor (&ctx);
+ status = node->accept (&visitor);
+ break;
+ }
case TAO_CodeGen::TAO_MODULE_OBV_CI:
{
- // This context state is not involved in any strategies.
ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CI);
be_visitor_valuetype_obv_ci visitor (&ctx);
status = node->accept (&visitor);
break;
}
case TAO_CodeGen::TAO_MODULE_OBV_CS:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CS);
- break;
+ {
+ ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CS);
+ be_visitor_valuetype_obv_cs visitor (&ctx);
+ status = node->accept (&visitor);
+ break;
+ }
default:
return 0;
}
@@ -119,160 +125,11 @@ be_visitor_obv_module::visit_valuetype (be_valuetype *node)
-1);
}
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state ()));
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
-
- // Do addtional "extra" code generation if necessary.
- if (node->has_extra_code_generation (ctx.state ()))
- {
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state (), 1));
-
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
- }
-
return 0;
}
int
be_visitor_obv_module::visit_eventtype (be_eventtype *node)
{
- be_visitor_context ctx (*this->ctx_);
- ctx.node (node);
- int status = 1;
-
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_MODULE_OBV_CH:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CH);
- break;
- case TAO_CodeGen::TAO_MODULE_OBV_CI:
- {
- // This context state is not involved in any strategies.
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CI);
- be_visitor_valuetype_obv_ci visitor (&ctx);
- status = node->accept (&visitor);
- break;
- }
- case TAO_CodeGen::TAO_MODULE_OBV_CS:
- ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CS);
- break;
- default:
- return 0;
- }
-
- if (status == 0)
- {
- return 0;
- }
- else if (status == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "failed to accept visitor\n"),
- -1);
- }
-
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state ()));
-
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
-
- // Do addtional "extra" code generation if necessary.
- if (node->has_extra_code_generation (ctx.state ()))
- {
- // Change the state depending on the kind of node strategy.
- ctx.state (node->next_state (ctx.state (), 1));
-
- visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "NUL visitor\n"),
- -1);
- }
-
- if (node->accept (visitor) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_obv_module::"
- "visit_valuetype - "
- "failed to accept visitor\n"),
- -1);
- }
-
- delete visitor;
- visitor = 0;
- }
-
- return 0;
+ return this->visit_valuetype (node);
}
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp
index 6a5bba2c805..63180ccaaf4 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
be_visitor_valuetype::be_visitor_valuetype (be_visitor_context *ctx)
: be_visitor_scope (ctx)
{
diff --git a/TAO/TAO_IDL/be_include/be_array.h b/TAO/TAO_IDL/be_include/be_array.h
index 4850ebe3a7f..e359bac54bc 100644
--- a/TAO/TAO_IDL/be_include/be_array.h
+++ b/TAO/TAO_IDL/be_include/be_array.h
@@ -14,7 +14,6 @@
*/
//=============================================================================
-
#ifndef BE_ARRAY_H
#define BE_ARRAY_H
diff --git a/TAO/TAO_IDL/be_include/be_attribute.h b/TAO/TAO_IDL/be_include/be_attribute.h
index 9fbbe54956d..90f9770193c 100644
--- a/TAO/TAO_IDL/be_include/be_attribute.h
+++ b/TAO/TAO_IDL/be_include/be_attribute.h
@@ -19,7 +19,6 @@
#include "ast_attribute.h"
#include "be_decl.h"
-#include "be_operation_strategy.h"
class AST_Type;
class be_visitor;
@@ -40,30 +39,6 @@ public:
// Visiting.
virtual int accept (be_visitor *visitor);
- /**
- * Set the get operation strategy.
- * Note, that it is not actually used, the operation
- * made out of the attribute is going to copy it.
- */
- be_operation_strategy *set_get_strategy (
- be_operation_strategy *new_strategy
- );
-
- /**
- * Set the set operation strategy.
- * Note, that it is not actually used, the operation
- * made out of the attribute is going to copy it.
- */
- be_operation_strategy *set_set_strategy (
- be_operation_strategy *new_strategy
- );
-
- /// Retrieve the underlying get_operation strategy.
- be_operation_strategy *get_get_strategy (void);
-
- /// Retrieve the underlying set_operation strategy.
- be_operation_strategy *get_set_strategy (void);
-
/// Cleanup.
virtual void destroy (void);
@@ -78,18 +53,6 @@ public:
// Narrowing
DEF_NARROW_FROM_DECL (be_attribute);
-
-private:
- be_operation_strategy *get_strategy_;
-
- /**
- * Member for holding the strategy for covering
- * differences between various operations, e.g. sendc_, raise_
- * operations in the AMI spec.
- */
- be_operation_strategy *set_strategy_;
-
- be_attribute *original_attribute_;
};
#endif
diff --git a/TAO/TAO_IDL/be_include/be_codegen.h b/TAO/TAO_IDL/be_include/be_codegen.h
index bde5952dc6d..3c690876f69 100644
--- a/TAO/TAO_IDL/be_include/be_codegen.h
+++ b/TAO/TAO_IDL/be_include/be_codegen.h
@@ -13,7 +13,6 @@
*/
//=============================================================================
-
#ifndef TAO_BE_CODEGEN_H
#define TAO_BE_CODEGEN_H
@@ -117,14 +116,8 @@ public:
TAO_OBV_OPERATION_ARGLIST_IS, // ... for implementation header
// AMI next generation states
- TAO_AMI_INTERFACE_CH,
- TAO_AMI_SENDC_OPERATION_CH,
TAO_AMI_SENDC_OPERATION_CS,
- TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CH,
TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CS,
- TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CH,
- TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CS,
- TAO_AMI_EXCEPTION_HOLDER_RAISE_OPERATION_CS,
// Emitting code for root.
TAO_ROOT_CH,
diff --git a/TAO/TAO_IDL/be_include/be_interface.h b/TAO/TAO_IDL/be_include/be_interface.h
index fd3b9feb67d..4cfb83865ed 100644
--- a/TAO/TAO_IDL/be_include/be_interface.h
+++ b/TAO/TAO_IDL/be_include/be_interface.h
@@ -27,7 +27,7 @@
class TAO_OutStream;
class TAO_IDL_Inheritance_Hierarchy_Worker;
class be_visitor;
-class be_interface_strategy;
+//class be_interface_strategy;
class UTL_ExceptList;
@@ -41,12 +41,6 @@ class be_interface : public virtual AST_Interface,
// = DESCRIPTION
//
public:
- enum
- {
- THRU_POA = 0,
- DIRECT = 1
- };
-
// Used to pass functions to the template method.
typedef int (*tao_code_emitter) (be_interface *,
be_interface *,
@@ -63,31 +57,19 @@ public:
/// Destructor.
~be_interface (void);
- /// Set the strategy to generate the names.
- be_interface_strategy *set_strategy (be_interface_strategy *new_strategy);
-
// Methods, which access the strategy.
/// Return the local name.
- const char *local_name (void) const;
-
- /// Return the stringified full name.
- virtual const char *full_name (void);
-
- /// Return the flattened full scoped name.
- virtual const char *flat_name (void);
-
- /// Retrieve the repository ID.
- virtual const char *repoID (void) const;
+ const char *local_name (void);
/// Retrieve the fully scoped skel class name.
- const char *full_skel_name (void) const;
+ const char *full_skel_name (void);
/// Retrieve the fully qualified collocated class name.
- const char *full_coll_name (int) const;
+ const char *full_coll_name (int);
/// Retrieve the fully qualified collocated class name.
- const char *local_coll_name (int) const;
+ const char *local_coll_name (int);
/// retrieve the name of the base proxy implementation.
virtual const char *base_proxy_impl_name (void);
@@ -144,8 +126,12 @@ public:
const char *relative_skel_name (const char *skel_name);
/// Build up the skeleton name.
- void compute_full_skel_name (const char *prefix,
- char *&skel_name);
+ void compute_full_skel_name (const char *prefix);
+
+ /// Compute the collocation names.
+ void compute_coll_names (int type,
+ const char *prefix,
+ const char *suffix);
static const char *relative_name (const char *localname,
const char *othername);
@@ -316,15 +302,6 @@ public:
/// and make a list of the abstract parents, if any.
void analyze_parentage (void);
- /// Find the next state, used to hide differences between variants of
- /// interfaces.
- TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state,
- int is_extra_state = 0);
-
- /// Returns 1 if additional code needs to be generated, the behavior
- /// is driven by the strategy connected with this interface.
- int has_extra_code_generation (TAO_CodeGen::CG_STATE current_state);
-
/// Sets the original interface from which this one was created,
/// applies only to implied IDL.
void original_interface (be_interface *original_interface);
@@ -333,10 +310,6 @@ public:
/// applies only to implied IDL
be_interface *original_interface (void);
- /// Returns an interface, which can be used instead.
- /// Needs to get set by the strategy.
- be_interface *replacement ();
-
/// Do we have both abstract and concrete parents?
int has_mixed_parentage (void);
@@ -364,6 +337,65 @@ public:
void gen_nesting_open (TAO_OutStream &os);
void gen_nesting_close (TAO_OutStream &os);
+ bool is_ami_rh (void) const;
+ void is_ami_rh (bool val);
+
+protected:
+ /**
+ * CDreate a new string made by the concatenation
+ * of "str" and "suffix" and using the
+ * "separator" to concatenate the two.
+ */
+ char *create_with_prefix_suffix (const char *prefix,
+ const char *str,
+ const char *suffix,
+ const char *separator = "");
+
+protected:
+ enum Suffix_Code
+ {
+ PROXY_IMPL = 0,
+ PROXY_BROKER = 1
+ };
+
+ enum Tag_Code
+ {
+ THRU_POA = 0,
+ DIRECT = 1,
+ REMOTE = 2,
+ STRATEGIZED = 3,
+ GC_PREFIX = 4 // Prefix used for the generated class
+ // This prefix is used to avoid name conflicts
+ // with the user classes.
+ };
+
+ static const char *suffix_table_[];
+ static const char *tag_table_[];
+
+ // Proxy Implementation names.
+ char *base_proxy_impl_name_;
+ char *remote_proxy_impl_name_;
+ char *direct_proxy_impl_name_;
+
+ char *full_base_proxy_impl_name_;
+ char *full_remote_proxy_impl_name_;
+ char *full_direct_proxy_impl_name_;
+
+ // Proxy Broker Names.
+ char *base_proxy_broker_;
+ char *remote_proxy_broker_;
+ char *strategized_proxy_broker_;
+
+ char *full_base_proxy_broker_name_;
+ char *full_remote_proxy_broker_name_;
+ char *full_strategized_proxy_broker_name_;
+
+ char *client_scope_;
+ char *flat_client_scope_;
+
+ char *server_scope_;
+ char *flat_server_scope_;
+
private:
/// Output the header (type declaration and %%) to the gperf's input
/// file.
@@ -410,10 +442,10 @@ private:
*/
void enqueue_base_component_r (AST_Component *node);
void enqueue_base_home_r (AST_Home *node);
-
+
protected:
/// Have these been done already?
- int var_out_seq_decls_gen_;
+ bool var_out_seq_decls_gen_;
protected:
/// Number of static skeletons in the operation table.
@@ -424,7 +456,7 @@ protected:
int in_mult_inheritance_;
/// Member for holding the strategy for generating names.
- be_interface_strategy *strategy_;
+// be_interface_strategy *strategy_;
/// The original interface from which this one was created,
/// applies only to implied IDL
@@ -435,6 +467,20 @@ protected:
/// Are we a direct child of Components::SessionComponent?
int session_component_child_;
+
+ /// Are we an AMI reply handler?
+ bool is_ami_rh_;
+
+ char *full_skel_name_;
+
+ char *full_coll_name_;
+
+ char *local_coll_name_;
+
+ char *relative_skel_name_;
+
+ /// Current cached collocated name.
+ int cached_type_;
};
/**
diff --git a/TAO/TAO_IDL/be_include/be_interface_strategy.h b/TAO/TAO_IDL/be_include/be_interface_strategy.h
deleted file mode 100644
index df49a408580..00000000000
--- a/TAO/TAO_IDL/be_include/be_interface_strategy.h
+++ /dev/null
@@ -1,411 +0,0 @@
-/* -*- c++ -*- */
-
-//=============================================================================
-/**
- * @file be_interface_strategy.h
- *
- * $Id$
- *
- * Strategy to cover differences between operations, e.g.
- * the sendc_ and raise_ operations in the AMI spec.
- *
- *
- * @author Michael Kircher
- */
-//=============================================================================
-
-
-#ifndef TAO_BE_INTERFACE_STRATEGY_H
-#define TAO_BE_INTERFACE_STRATEGY_H
-
-#include "be_codegen.h"
-
-class be_interface;
-
-// This class serves as a strategy base class for the differences
-// in generating e.g. ami reply handlers.
-class be_interface_strategy
-{
-public:
- enum Strategy_Kind {
- DEFAULT = 0,
- AMI_INTERFACE,
- AMI_HANDLER,
- AMI_EXCEPTION_HOLDER
- // AMH_INTERFACE
- };
-
- be_interface_strategy (be_interface *node,
- Strategy_Kind strategy_type);
-
- virtual ~be_interface_strategy (void);
-
- /// return the local name
- virtual const char *local_name (void) = 0;
-
- /// return the stringified full name
- virtual const char *full_name (void) = 0;
-
- /// return the flattened full scoped name.
- virtual const char *flat_name (void) = 0;
-
- /// retrieve the repository ID.
- virtual const char *repoID (void) = 0;
-
- /// retrieve the fully scoped skel class name.
- virtual const char *full_skel_name (void) = 0;
-
- /// retrieve the fully qualified collocated class name
- virtual const char *full_coll_name (int) = 0;
-
- /// retrieve the fully qualified collocated class name.
- virtual const char *local_coll_name (int) = 0;
-
- /// retrieve the name of the base proxy implementation.
- virtual const char *base_proxy_impl_name (void) = 0;
-
- /// retrieve the fully qualified name of the base proxy
- /// implementation.
- virtual const char *full_base_proxy_impl_name (void) = 0;
-
- /// retrieve the name of the remote proxy implementation.
- virtual const char *remote_proxy_impl_name (void) = 0;
-
- /// retrieve the fully qualified name of the remote
- /// proxy implementation.
- virtual const char *full_remote_proxy_impl_name (void) = 0;
-
- /// retrieve the name of the Directx proxy implementation.
- virtual const char *direct_proxy_impl_name (void) =0;
-
- /// retrieve the fully qualified name of the Directx proxy
- /// implementation.
- virtual const char *full_direct_proxy_impl_name (void) =0;
-
- /// retrieve the name of the base proxy broker.
- virtual const char *base_proxy_broker_name (void) = 0;
-
- /// retrieve the fully qualified name of the base proxy broker.
- virtual const char *full_base_proxy_broker_name (void) = 0;
-
- /// retrieve the name of the remote proxy broker implementation.
- virtual const char *remote_proxy_broker_name (void) = 0;
-
- /// retrieve the fully qualified name of the remote proxy broker
- /// implementation.
- virtual const char *full_remote_proxy_broker_name (void) = 0;
-
- /// retrieve the name of the strategized proxy broker implementation.
- virtual const char *strategized_proxy_broker_name (void) = 0;
-
- /// retrieve the fully qualified name of the strategized proxy broker
- /// implementation.
- virtual const char *full_strategized_proxy_broker_name (void) = 0;
-
- /// Return the scope that encloses the client related
- /// interface.
- virtual const char *client_scope (void) = 0;
-
- /// Return the "flat" version of the scope
- ///that encloses the interface.
- virtual const char *flat_client_scope (void) = 0;
-
- /// Return the scope that encloses the server related
- /// interface.
- virtual const char *server_scope (void) = 0;
-
- /// Return the "flat" version of the scope
- ///that encloses the interface.
- virtual const char *flat_server_scope (void) = 0;
-
- /// relative skeleton name
- const char *relative_skel_name (const char *skel_name);
-
- const char* relative_name (const char *localname,
- const char *othername);
-
- /// compute the names using the local prefix and suffix
- void compute_names (const char* name,
- const char* prefix,
- const char* suffix,
- char *&new_name);
-
- /// compute the collocation names
- void compute_coll_names (int type,
- const char *prefix,
- const char *suffix);
-
- /**
- * return the out stream depending on the strategy
- * @@ Michael: Right now every strategy behaves
- * the same way, but it might be in the future that we
- * have to differentiate.
- */
- virtual TAO_OutStream *get_out_stream (void);
-
- /**
- * return the file name of the output stream.
- * @@ Michael: Right now every strategy behaves the
- * same way.
- */
- virtual const char *get_out_stream_fname (void);
-
- /// Return the type of the strategy.
- int strategy_type (void);
-
- /// Change the sate if necessary
- virtual TAO_CodeGen::CG_STATE next_state (
- TAO_CodeGen::CG_STATE current_state,
- int is_extra_state = 0);
-
- virtual int has_extra_code_generation (
- TAO_CodeGen::CG_STATE current_state);
-
- /// Returns the node, which is used instead of the original node,
- /// e.g. the reply handler to the actual node.
- virtual be_interface *replacement (void);
-
- /// Cleanup.
- virtual void destroy (void);
-
-protected:
- char *local_name_;
-
- char *full_name_;
-
- char *flat_name_;
-
- char *repoID_;
-
- char *full_skel_name_;
-
- char *full_coll_name_;
-
- char *local_coll_name_;
-
- char *relative_skel_name_;
-
- /// The node we strategize
- be_interface *node_;
-
- /// Current cached collocated name.
- int cached_type_;
-
- /// The type of strategy
- Strategy_Kind strategy_type_;
-};
-
-class be_interface_default_strategy
- : public be_interface_strategy
-{
-public:
- // begin overridden methods.
- be_interface_default_strategy (be_interface *node,
- Strategy_Kind strategy_type = DEFAULT);
-
- virtual ~be_interface_default_strategy (void);
-
- /// return the local name
- const char * local_name (void);
-
- /// return the stringified full name
- virtual const char *full_name (void);
-
- /// return the flattened full scoped name.
- virtual const char *flat_name (void);
-
- /// retrieve the repository ID.
- virtual const char *repoID (void);
-
- /// retrieve the fully scoped skel class name.
- virtual const char *full_skel_name (void);
-
- /// retrieve the fully qualified collocated class name
- virtual const char *full_coll_name (int);
-
- /// retrieve the fully qualified collocated class name.
- virtual const char *local_coll_name (int);
-
- /// retrieve the name of the base proxy implementation.
- virtual const char *base_proxy_impl_name (void);
-
- /// retrieve the fully qualified name of the base proxy
- /// implementation.
- virtual const char *full_base_proxy_impl_name (void);
-
- /// retrieve the name of the remote proxy implementation.
- virtual const char *remote_proxy_impl_name (void);
-
- /// retrieve the fully qualified name of the remote
- /// proxy implementation.
- virtual const char *full_remote_proxy_impl_name (void);
-
- /// retrieve the name of the Directx proxy implementation.
- virtual const char *direct_proxy_impl_name (void);
-
- /// retrieve the fully qualified name of the Directx proxy
- /// implementation.
- virtual const char *full_direct_proxy_impl_name (void);
-
- /// retrieve the name of the base proxy broker.
- virtual const char *base_proxy_broker_name (void);
-
- /// retrieve the fully qualified name of the base proxy broker.
- virtual const char *full_base_proxy_broker_name (void);
-
- /// retrieve the name of the remote proxy broker implementation.
- virtual const char *remote_proxy_broker_name (void);
-
- /// retrieve the fully qualified name of the remote proxy broker
- /// implementation.
- virtual const char *full_remote_proxy_broker_name (void);
-
- /// retrieve the name of the strategized proxy broker implementation.
- virtual const char *strategized_proxy_broker_name (void);
-
- /// retrieve the fully qualified name of the strategized proxy broker
- /// implementation.
- virtual const char *full_strategized_proxy_broker_name (void);
-
- /// Return the scope that encloses the client related
- /// interface.
- virtual const char *client_scope (void);
-
- /// Return the "flat" version of the scope
- ///that encloses the interface.
- virtual const char *flat_client_scope (void);
-
- /// Return the scope that encloses the server related
- /// interface.
- virtual const char *server_scope (void);
-
- /// Return the "flat" version of the scope
- ///that encloses the interface.
- virtual const char *flat_server_scope (void);
-
- /// Cleanup.
- virtual void destroy (void);
-
- // end of overridden methods
-
-protected:
-
- /**
- * create a new string made by the concatenation
- * of "str" and "suffix" and using the
- * "separator" to concatenate the two.
- */
- char *create_with_prefix_suffix (const char *prefix,
- const char *str,
- const char *suffix,
- const char *separator = "");
-
-protected:
-
- enum Suffix_Code
- {
- PROXY_IMPL = 0,
- PROXY_BROKER = 1
- };
-
- enum Tag_Code
- {
- REMOTE = 0,
- THRU_POA = 1,
- DIRECT = 2,
- STRATEGIZED = 3,
- GC_PREFIX = 4 // Prefix used for the generated class
- // This prefix is used to avoid name conflicts
- // with the user classes.
- };
-
- static const char *suffix_table_[];
- static const char *tag_table_[];
-
- // Proxy Implementation names.
- char *base_proxy_impl_name_;
- char *remote_proxy_impl_name_;
- char *direct_proxy_impl_name_;
-
- char *full_base_proxy_impl_name_;
- char *full_remote_proxy_impl_name_;
- char *full_direct_proxy_impl_name_;
-
- // Proxy Broker Names.
- char *base_proxy_broker_;
- char *remote_proxy_broker_;
- char *strategized_proxy_broker_;
-
- char *full_base_proxy_broker_name_;
- char *full_remote_proxy_broker_name_;
- char *full_strategized_proxy_broker_name_;
-
- char *client_scope_;
- char *flat_client_scope_;
-
- char *server_scope_;
- char *flat_server_scope_;
-};
-
-
-class be_interface_ami_handler_strategy
- : public be_interface_default_strategy
-{
-public:
- be_interface_ami_handler_strategy (be_interface *node);
-
- virtual ~be_interface_ami_handler_strategy (void);
-
- // overridden methods.
- virtual TAO_CodeGen::CG_STATE next_state (
- TAO_CodeGen::CG_STATE current_state,
- int is_extra_state = 0
- );
-};
-
-
-class be_interface_ami_exception_holder_strategy
- : public be_interface_default_strategy
-{
-public:
- be_interface_ami_exception_holder_strategy (be_interface *node);
-
- virtual ~be_interface_ami_exception_holder_strategy (void);
-
- // overridden methods.
- virtual TAO_CodeGen::CG_STATE next_state (
- TAO_CodeGen::CG_STATE current_state,
- int is_extra_state = 0
- );
-
- virtual int has_extra_code_generation (
- TAO_CodeGen::CG_STATE current_state
- );
-};
-
-class be_interface_ami_strategy
- : public be_interface_default_strategy
-{
-public:
- be_interface_ami_strategy (be_interface *node,
- be_interface *handler);
-
- virtual ~be_interface_ami_strategy ();
-
- // overridden methods.
- virtual TAO_CodeGen::CG_STATE next_state (
- TAO_CodeGen::CG_STATE current_state,
- int is_extra_state = 0
- );
-
- virtual int has_extra_code_generation (
- TAO_CodeGen::CG_STATE current_state
- );
-
- virtual be_interface *replacement (void);
-
-private:
- be_interface *handler_;
-};
-
-#endif // if !defined
diff --git a/TAO/TAO_IDL/be_include/be_operation.h b/TAO/TAO_IDL/be_include/be_operation.h
index 22131a50b5a..964b0ccc8e6 100644
--- a/TAO/TAO_IDL/be_include/be_operation.h
+++ b/TAO/TAO_IDL/be_include/be_operation.h
@@ -25,7 +25,7 @@
class AST_Type;
class be_visitor;
class be_argument;
-class be_operation_strategy;
+//class be_operation_strategy;
class be_operation : public virtual AST_Operation,
public virtual be_scope,
@@ -46,57 +46,29 @@ public:
// Visiting.
virtual int accept (be_visitor *visitor);
- // Add an argument to the scope.
+ /// Add an argument to the scope.
virtual AST_Argument *be_add_argument (AST_Argument *arg);
- // Insert an exception at the head of the list.
+ /// Insert an exception at the head of the list.
int be_insert_exception (AST_Exception *ex);
+
+ bool is_sendc_ami (void) const;
+ void is_sendc_ami (bool val);
+
+ bool is_excep_ami (void) const;
+ void is_excep_ami (bool val);
- be_operation_strategy *set_strategy (be_operation_strategy *new_strategy);
-
- /// Decide on the next state.
- TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state,
- int is_extra_state = 0);
-
- /// Returns true if we have to generate extra code.
- int has_extra_code_generation (TAO_CodeGen::CG_STATE current_state);
-
- /**
- * returns the operation containing special marshaling information,
- * this makes sense if not all arguments get marshaled, e.g. AMI
- * sendc_ operations.
- */
- be_operation *marshaling (void);
-
- /**
- * Returns a customized arguments list, e.g. AMI sendc_ operations
- * only use the in and inout arguments but not the out arguments,
- * also the first argument is the reply handler.
- */
- be_operation *arguments (void);
-
- /// Sets the original operation from which this one was created,
- /// applies only to implied IDL.
- void original_operation (be_operation *original_operation);
-
- /// Returns the original operation from which this one was created,
- /// applies only to implied IDL
- be_operation *original_operation (void);
+ bool is_attr_op (void) const;
+ void is_attr_op (bool val);
// Narrowing
-
DEF_NARROW_FROM_DECL (be_operation);
DEF_NARROW_FROM_SCOPE (be_operation);
protected:
- /**
- * Member for holding the strategy for covering
- * differences between various operations, e.g. sendc_, raise_
- * operations in the AMI spec.
- */
- be_operation_strategy *strategy_;
-
- be_operation *original_operation_;
+ bool is_sendc_ami_;
+ bool is_excep_ami_;
+ bool is_attr_op_;
};
#endif
diff --git a/TAO/TAO_IDL/be_include/be_operation_strategy.h b/TAO/TAO_IDL/be_include/be_operation_strategy.h
deleted file mode 100644
index fd789120e45..00000000000
--- a/TAO/TAO_IDL/be_include/be_operation_strategy.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/* -*- c++ -*- */
-
-//=============================================================================
-/**
- * @file be_operation_strategy.h
- *
- * $Id$
- *
- * Strategy to cover differences between operations, e.g.
- * the sendc_ and raise_ operations in the AMI spec.
- *
- *
- * @author Michael Kircher
- */
-//=============================================================================
-
-
-#ifndef TAO_BE_OPERATION_STRATEGY_H
-#define TAO_BE_OPERATION_STRATEGY_H
-
-#include "be_codegen.h"
-
-class be_operation;
-
-// Base class for operation level strategies.
-class be_operation_strategy
-{
-public:
- enum Strategy_Kind
- {
- DEFAULT = 0,
- AMI_SENDC,
- AMI_HANDLER_REPLY_STUB,
- AMI_EXCEPTION_HOLDER_RAISE
- };
-
- be_operation_strategy (be_operation *node,
- Strategy_Kind strategy_type);
-
- virtual ~be_operation_strategy (void);
-
- /// Return the type of the strategy.
- int strategy_type (void);
-
- /// Change the state if necessary.
- virtual TAO_CodeGen::CG_STATE next_state (
- TAO_CodeGen::CG_STATE current_state,
- int is_extra_state = 0
- ) = 0;
-
- /// Returns true if we have to generate extra code.
- virtual int has_extra_code_generation (TAO_CodeGen::CG_STATE current_state);
-
- /**
- * Returns the operation containing special marshaling information,
- * this makes sense if not all arguments get marshaled, e.g. AMI
- * sendc_ operations.
- */
- virtual be_operation *marshaling (void);
-
- /**
- * Returns a customized arguments list, e.g. AMI sendc_ operations
- * only use the in and inout arguments but not the out arguments,
- * also the first argument is the reply handler.
- */
- virtual be_operation *arguments (void);
-
- /// Overrides return a deep copy.
- virtual be_operation_strategy *copy (void);
-
- /// Cleanup.
- virtual void destroy (void);
-
-protected:
- /// The node we strategize.
- be_operation *node_;
-
- /// The type of strategy.
- Strategy_Kind strategy_type_;
-};
-
-
-
-// Default (do nothing) strategy for operations.
-class be_operation_default_strategy
- : public be_operation_strategy
-{
-public:
- be_operation_default_strategy (be_operation *node);
-
- virtual ~be_operation_default_strategy (void);
-
- // Overridden methods.
- TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state,
- int is_extra_state = 0);
-
- /// Returns a deep copy.
- virtual be_operation_strategy *copy (void);
-};
-
-
-// Strategy to mark normal reply handler operations
-// in order to have them generate the reply stub
-// alias client skeleton for AMI.
-class be_operation_ami_handler_reply_stub_strategy
- : public be_operation_strategy
-{
-public:
- be_operation_ami_handler_reply_stub_strategy (be_operation *node);
-
- virtual ~be_operation_ami_handler_reply_stub_strategy (void);
-
- // Overridden methods.
- TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state,
- int is_extra_state = 0);
-
- /// Returns true if we have to generate extra code.
- virtual int has_extra_code_generation (TAO_CodeGen::CG_STATE current_state);
-
- /// Returns a deep copy.
- virtual be_operation_strategy *copy (void);
-};
-
-
-// Strategy to mark normal sendc_ operations
-// in AMI mode.
-class be_operation_ami_sendc_strategy : public be_operation_strategy
-{
-public:
- be_operation_ami_sendc_strategy (be_operation *node,
- be_operation *marshaling,
- be_operation *arguments);
-
- virtual ~be_operation_ami_sendc_strategy (void);
-
- // Overridden methods.
- TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state,
- int is_extra_state = 0);
-
- /// Returns true if we have to generate extra code.
- virtual int has_extra_code_generation (TAO_CodeGen::CG_STATE current_state);
-
- /**
- * Returns the operation containing special marshaling information,
- * this makes sense if not all arguments get marshaled, e.g. AMI
- * sendc_ operations
- */
- virtual be_operation *marshaling (void);
-
- /**
- * Returns a customized arguments list, e.g. AMI sendc_ operations
- * only use the in and inout arguments but not the out arguments,
- * also the first argument is the reply handler.
- */
- virtual be_operation *arguments (void);
-
- /// Returns a deep copy.
- virtual be_operation_strategy *copy (void);
-
- /// Cleanup.
- virtual void destroy (void);
-
-private:
- be_operation *marshaling_;
- be_operation *arguments_;
- bool owns_operations_;
-};
-
-
-// Strategy for raise operations in the AMI exception
-// holder valuetype.
-class be_operation_ami_exception_holder_raise_strategy
- : public be_operation_strategy
-{
-public:
- be_operation_ami_exception_holder_raise_strategy (be_operation *node);
-
- virtual ~be_operation_ami_exception_holder_raise_strategy ();
-
- // Overridden methods.
- virtual TAO_CodeGen::CG_STATE next_state (
- TAO_CodeGen::CG_STATE current_state,
- int is_extra_state = 0
- );
-
- /// Returns a deep copy.
- virtual be_operation_strategy *copy (void);
-};
-
-
-// AMH strategy.
-class be_operation_amh_strategy
- : public be_operation_strategy
-{
-public:
- be_operation_amh_strategy (be_operation *node);
-
- virtual ~be_operation_amh_strategy (void);
-
- // Overridden methods.
- TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state,
- int is_extra_state = 0);
-
- virtual int has_extra_code_generation (TAO_CodeGen::CG_STATE current_state);
-
- virtual be_operation *arguments (void);
-
- /// Returns a deep copy.
- virtual be_operation_strategy *copy (void);
-
-private:
- be_operation *arguments_;
-};
-
-#endif // TAO_BE_OPERATION_STRATEGY_H
diff --git a/TAO/TAO_IDL/be_include/be_valuetype.h b/TAO/TAO_IDL/be_include/be_valuetype.h
index 20dbe690da0..4df52aad3e8 100644
--- a/TAO/TAO_IDL/be_include/be_valuetype.h
+++ b/TAO/TAO_IDL/be_include/be_valuetype.h
@@ -174,13 +174,11 @@ public:
bool has_member (void);
private:
- char *full_obv_skel_name_;
-
/// Do we support at least one abstract interface?
bool supports_abstract_;
/// Have these been done already?
- int var_out_seq_decls_gen_;
+ bool var_out_seq_decls_gen_;
};
#endif // if !defined
diff --git a/TAO/TAO_IDL/be_include/be_visitor_ami_pre_proc.h b/TAO/TAO_IDL/be_include/be_visitor_ami_pre_proc.h
index 0ce33847cd7..9485504c86f 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_ami_pre_proc.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_ami_pre_proc.h
@@ -46,30 +46,17 @@ public:
virtual ~be_visitor_ami_pre_proc (void);
- /// visit a root
virtual int visit_root (be_root *node);
- /// visit module
virtual int visit_module (be_module *node);
- /// visit interface
virtual int visit_interface (be_interface *node);
- /// visit an operation
virtual int visit_operation (be_operation *node);
- /// visit an attribute
virtual int visit_attribute (be_attribute *node);
private:
- /**
- * Creates a raise operation from node and inserts it in
- * excep_holder, while obeying if it is a normal operation
- * or a set or get attribute.
- */
- int create_raise_operation (be_decl *node,
- Operation_Kind operation_kind);
-
/// create the reply handler interface
be_interface *create_reply_handler (be_interface *node);
@@ -79,8 +66,7 @@ private:
* object reference to the reply handler as the first argument,
* but this should not be marhaled, therefor we need the switch
*/
- be_operation *create_sendc_operation (be_operation *node,
- int for_arguments);
+ be_operation *create_sendc_operation (be_operation *node);
/// create a method with "_excep" appended
int create_excep_operation (be_operation *node,
@@ -114,5 +100,4 @@ private:
int generate_ami4ccm_idl (void);
};
-
#endif // TAO_BE_VISITOR_AMI_PRE_PROC_H
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface.h b/TAO/TAO_IDL/be_include/be_visitor_interface.h
index 5513b86931a..5760187a5fb 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_interface.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface.h
@@ -13,7 +13,6 @@
*/
//=============================================================================
-
#ifndef TAO_BE_VISITOR_INTERFACE_H
#define TAO_BE_VISITOR_INTERFACE_H
@@ -50,9 +49,6 @@
#include "be_visitor_interface/direct_proxy_impl_sh.h"
#include "be_visitor_interface/direct_proxy_impl_ss.h"
-// AMI
-#include "be_visitor_interface/ami_interface_ch.h"
-
// AMI4CCM
#include "be_visitor_interface/ami4ccm_rh_ex_idl.h"
#include "be_visitor_interface/ami4ccm_sendc_ex_idl.h"
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/ami_interface_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/ami_interface_ch.h
deleted file mode 100644
index 6cc8be5bc24..00000000000
--- a/TAO/TAO_IDL/be_include/be_visitor_interface/ami_interface_ch.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- c++ -*- */
-//=============================================================================
-/**
- * @file ami_interface_ch.h
- *
- * $Id$
- *
- * Concrete visitor for the AMI Interface node.
- * This one provides code generation for interfaces in the client header.
- *
- *
- * @author Aniruddha Gokhale
- */
-//=============================================================================
-
-#ifndef _BE_INTERFACE_AMI_INTERFACE_CH_H_
-#define _BE_INTERFACE_AMI_INTERFACE_CH_H_
-
-// we need derived interface visitors for the client and server header files. For
-// the others, they use the default interface visitor
-
-/**
- * @class be_visitor_ami_interface_ch
- *
- * @brief be_visitor_interface_ch
- *
- * This is a concrete visitor to generate the client header for interface
- */
-class be_visitor_ami_interface_ch : public be_visitor_interface
-{
-public:
- be_visitor_ami_interface_ch (be_visitor_context *ctx);
-
- ~be_visitor_ami_interface_ch (void);
-
- virtual int visit_interface (be_interface *node);
-};
-
-#endif /* _BE_INTERFACE_AMI_INTERFACE_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation.h b/TAO/TAO_IDL/be_include/be_visitor_operation.h
index f28dfe61cf9..ca13e8a5f0a 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_operation.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_operation.h
@@ -13,7 +13,6 @@
*/
//=============================================================================
-
#ifndef TAO_BE_VISITOR_OPERATION_H
#define TAO_BE_VISITOR_OPERATION_H
@@ -43,8 +42,6 @@
#include "be_visitor_operation/argument.h"
#include "be_visitor_operation/argument_invoke.h"
#include "be_visitor_operation/argument_marshal.h"
-#include "be_visitor_operation/ami_ch.h"
-#include "be_visitor_operation/ami_cs.h"
#include "be_visitor_operation/smart_proxy_ch.h"
#include "be_visitor_operation/smart_proxy_cs.h"
#include "be_visitor_operation/upcall_command_ss.h"
@@ -52,9 +49,8 @@
#include "be_visitor_operation/direct_proxy_impl_ss.h"
// AMI
-#include "be_visitor_operation/ami_handler_reply_stub_operation_ch.h"
+#include "be_visitor_operation/ami_cs.h"
#include "be_visitor_operation/ami_handler_reply_stub_operation_cs.h"
-#include "be_visitor_operation/ami_exception_holder_operation_cs.h"
// AMH
#include "be_visitor_operation/amh_sh.h"
diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/ami_ch.h b/TAO/TAO_IDL/be_include/be_visitor_operation/ami_ch.h
deleted file mode 100644
index 77800e5279b..00000000000
--- a/TAO/TAO_IDL/be_include/be_visitor_operation/ami_ch.h
+++ /dev/null
@@ -1,45 +0,0 @@
-
-//=============================================================================
-/**
- * @file ami_ch.h
- *
- * $Id$
- *
- * Visitor for generating AMI stub code for IDL operations in
- * client header.
- *
- *
- * @author Alexander Babu Arulanthu <alex@cs.wustl.edu>
- */
-//=============================================================================
-
-
-#ifndef _BE_VISITOR_OPERATION_AMI_CH_H_
-#define _BE_VISITOR_OPERATION_AMI_CH_H_
-
-// ************************************************************
-// Operation visitor to generate AMI stubs for client header
-// ************************************************************
-
-/**
- * @class be_visitor_operation_ami_ch
- *
- * @brief be_visitor_operation_ami_ch.
- *
- * This is a concrete visitor to generate the AMI stubs in the
- * client header for operation.
- */
-class be_visitor_operation_ami_ch : public be_visitor_operation
-{
-public:
- /// constructor
- be_visitor_operation_ami_ch (be_visitor_context *ctx);
-
- /// destructor
- ~be_visitor_operation_ami_ch (void);
-
- /// visit operation.
- virtual int visit_operation (be_operation *node);
-};
-
-#endif /* _BE_VISITOR_OPERATION_AMI_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/ami_exception_holder_operation_cs.h b/TAO/TAO_IDL/be_include/be_visitor_operation/ami_exception_holder_operation_cs.h
deleted file mode 100644
index 04fec4105f3..00000000000
--- a/TAO/TAO_IDL/be_include/be_visitor_operation/ami_exception_holder_operation_cs.h
+++ /dev/null
@@ -1,42 +0,0 @@
-
-//=============================================================================
-/**
- * @file ami_exception_holder_operation_cs.h
- *
- * $Id$
- *
- * Visitor for generating code for IDL operations in client stubs
- *
- *
- * @author Michael Kircher <Michael.Kircher@mchp.siemens.de<
- */
-//=============================================================================
-
-
-#ifndef _BE_VISITOR_OPERATION_OPERATION_AMI_EXCEPTION_HOLDER_OPERATION_CS_H_
-#define _BE_VISITOR_OPERATION_OPERATION_AMI_EXCEPTION_HOLDER_OPERATION_CS_H_
-
-
-/**
- * @class be_visitor_operation_ami_exception_holder_operation_cs
- *
- * @brief be_visitor_operation_ami_exception_holder_operation_cs
- *
- * This is a concrete visitor to generate the client stubs for operation
- */
-class be_visitor_operation_ami_exception_holder_operation_cs : public be_visitor_operation
-{
-public:
- /// constructor
- be_visitor_operation_ami_exception_holder_operation_cs (be_visitor_context *ctx);
-
- /// destructor
- ~be_visitor_operation_ami_exception_holder_operation_cs (void);
-
- /// visit operation.
- virtual int visit_operation (be_operation *node);
-};
-
-
-
-#endif /* _BE_VISITOR_OPERATION_OPERATION_AMI_EXCEPTION_HOLDER_OPERATION_CS_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_reply_stub_operation_ch.h b/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_reply_stub_operation_ch.h
deleted file mode 100644
index fd4cea6664b..00000000000
--- a/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_reply_stub_operation_ch.h
+++ /dev/null
@@ -1,44 +0,0 @@
-
-//=============================================================================
-/**
- * @file ami_handler_reply_stub_operation_ch.h
- *
- * $Id$
- *
- * Visitor for generating code for AMI Handler call back operations
- * in client header.
- *
- *
- * @author Aniruddha Gokhale and Alexander Babu Arulanthu <alex@cs.wustl.edu>
- */
-//=============================================================================
-
-
-#ifndef _BE_VISITOR_OPERATION_ami_handler_reply_stub_operation_ch_H_
-#define _BE_VISITOR_OPERATION_ami_handler_reply_stub_operation_ch_H_
-
-// ************************************************************
-// Operation visitor for server header
-// ************************************************************
-
-/**
- * @class be_visitor_operation_ami_handler_reply_stub_operation_ch
- *
- * @brief be_visitor_ami_handler_reply_stub_operation_ch
- *
- * This is a concrete visitor to generate the server header for operation
- */
-class be_visitor_operation_ami_handler_reply_stub_operation_ch : public be_visitor_operation
-{
-public:
- /// constructor
- be_visitor_operation_ami_handler_reply_stub_operation_ch (be_visitor_context *ctx);
-
- /// destructor
- ~be_visitor_operation_ami_handler_reply_stub_operation_ch (void);
-
- /// visit operation.
- virtual int visit_operation (be_operation *node);
-};
-
-#endif /* _BE_VISITOR_OPERATION_ami_handler_reply_stub_operation_ch_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype.h
index b9fbda17149..d2b8edfb80e 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_valuetype.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype.h
@@ -12,7 +12,6 @@
*/
//=============================================================================
-
#ifndef TAO_BE_VISITOR_VALUETYPE_H
#define TAO_BE_VISITOR_VALUETYPE_H
@@ -42,8 +41,6 @@
#include "be_visitor_valuetype/field_cdr_ch.h"
#include "be_visitor_valuetype/field_cdr_cs.h"
#include "be_visitor_valuetype/obv_module.h"
-#include "be_visitor_valuetype/ami_exception_holder_ch.h"
-#include "be_visitor_valuetype/ami_exception_holder_cs.h"
#include "be_visitor_valuetype/valuetype_init.h"
#include "be_visitor_valuetype/valuetype_init_ch.h"
#include "be_visitor_valuetype/valuetype_init_ci.h"
diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/ami_exception_holder_ch.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/ami_exception_holder_ch.h
deleted file mode 100644
index d554385c923..00000000000
--- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/ami_exception_holder_ch.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- c++ -*- */
-//=============================================================================
-/**
- * @file ami_exception_holder_ch.h
- *
- * $Id$
- *
- * Concrete visitor for the Interface node.
- * This one provides code generation for AMI exception holders
- * in client headers.
- *
- *
- * @author Michael Kircher <Michael.Kircher@mchp.siemens.de>
- */
-//=============================================================================
-
-
-#ifndef _BE_VISITOR_VALUETYPE_AMI_EXCEPTION_HOLDER_CH_H_
-#define _BE_VISITOR_VALUETYPE_AMI_EXCEPTION_HOLDER_CH_H_
-
-
-/**
- * @class be_visitor_valuetype_ami_exception_holder_ch
- *
- * @brief be_visitor_valuetype_ami_exception_holder_ch
- *
- * This is a concrete visitor to generate the client header for
- * interface.
- */
-class be_visitor_valuetype_ami_exception_holder_ch : public be_visitor_valuetype
-{
-public:
- /// constructor
- be_visitor_valuetype_ami_exception_holder_ch (be_visitor_context *ctx);
-
- /// destructor
- ~be_visitor_valuetype_ami_exception_holder_ch (void);
-
- virtual int visit_operation (be_operation *node);
-
-};
-
-#endif /* _BE_VISITOR_VALUETYPE_AMI_EXCEPTIUON_HOLER_CH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/ami_exception_holder_cs.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/ami_exception_holder_cs.h
deleted file mode 100644
index 37fc1f35823..00000000000
--- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/ami_exception_holder_cs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- c++ -*- */
-//=============================================================================
-/**
- * @file ami_exception_holder_cs.h
- *
- * $Id$
- *
- * Visitor to generate code for exception holders.
- *
- *
- * @author Michael Kircher <Michael.Kircher@mchp.siemens.de>
- */
-//=============================================================================
-
-
-#ifndef _BE_VISITOR_VALUETYPE_AMI_EXCEPTION_HOLDER_CS_H_
-#define _BE_VISITOR_VALUETYPE_AMI_EXCEPTION_HOLDER_CS_H_
-
-/**
- * @class be_visitor_valuetype_ami_exception_holder_cs
- *
- * @brief be_visitor_valuetype_ami_exception_holder_cs
- *
- * This is a concrete visitor to generate the client stubs for interface
- */
-class be_visitor_valuetype_ami_exception_holder_cs : public be_visitor_valuetype
-{
-public:
- /// constructor
- be_visitor_valuetype_ami_exception_holder_cs (be_visitor_context *ctx);
-
- /// destructor
- ~be_visitor_valuetype_ami_exception_holder_cs (void);
-
- virtual int visit_valuetype (be_valuetype *node);
-
- virtual int visit_operation (be_operation *node);
-};
-
-#endif /* _BE_VISITOR_VALUETYPE_AMI_EXCEPTION_HOLDER_CS_H_ */