summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
Diffstat (limited to 'TAO')
-rw-r--r--TAO/ChangeLog-99c69
-rw-r--r--TAO/TAO_IDL/Makefile1
-rw-r--r--TAO/TAO_IDL/ast/ast_module.cpp12
-rw-r--r--TAO/TAO_IDL/be/be_interface.cpp80
-rw-r--r--TAO/TAO_IDL/be/be_interface_strategy.cpp39
-rw-r--r--TAO/TAO_IDL/be/be_operation.cpp47
-rw-r--r--TAO/TAO_IDL/be/be_operation_strategy.cpp211
-rw-r--r--TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp143
-rw-r--r--TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp5
-rw-r--r--TAO/TAO_IDL/be/be_visitor_factory.cpp54
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_cs.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ci.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface.cpp58
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp11
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation.cpp9
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp262
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_ss.cpp8
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp87
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp93
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/argument.cpp37
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp84
-rw-r--r--TAO/TAO_IDL/be_include/be_codegen.h7
-rw-r--r--TAO/TAO_IDL/be_include/be_interface.h6
-rw-r--r--TAO/TAO_IDL/be_include/be_interface_strategy.h83
-rw-r--r--TAO/TAO_IDL/be_include/be_operation.h23
-rw-r--r--TAO/TAO_IDL/be_include/be_operation_strategy.h150
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_ami_pre_proc.h10
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_operation.h9
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_reply_stub_operation_ch.h52
-rw-r--r--TAO/TAO_IDL/include/ast_module.h3
-rw-r--r--TAO/TAO_IDL/include/utl_scope.h8
-rw-r--r--TAO/TAO_IDL/tao_idl.dsp23
-rw-r--r--TAO/TAO_IDL/tao_idl_static.dsp8
-rw-r--r--TAO/TAO_IDL/util/utl_scope.cpp38
45 files changed, 1102 insertions, 670 deletions
diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c
index be67d719721..cf92c9b06c2 100644
--- a/TAO/ChangeLog-99c
+++ b/TAO/ChangeLog-99c
@@ -1,3 +1,72 @@
+Sun Sep 26 04:20:00 1999 Michael Kircher <Michael.Kicher@mchp.siemens.de>
+
+ * TAO_IDL/Makefile
+ TAO_IDL/tao_idl.dsp
+ TAO_IDL/tao_idl_static.dsp:
+ Added two files, see below.
+
+ * TAO_IDL/be/be_interface.cpp,
+ TAO_IDL/be/be_visitor_factory.cpp,
+ TAO_IDL/be/be_visitor_operation.cpp,
+ TAO_IDL/be/be_visitor_attribute/attribute.cpp,
+ TAO_IDL/be/be_visitor_interface/ami_handler_stub_cs.cpp,
+ TAO_IDL/be/be_visitor_interface/any_op_ch.cpp,
+ TAO_IDL/be/be_visitor_interface/any_op_cs.cpp,
+ TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp,
+ TAO_IDL/be/be_visitor_interface/cdr_op_ci.cpp,
+ TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp,
+ TAO_IDL/be/be_visitor_interface/interface.cpp,
+ TAO_IDL/be/be_visitor_interface/interface_ch.cpp,
+ TAO_IDL/be/be_visitor_interface/interface_ci.cpp,
+ TAO_IDL/be/be_visitor_interface/interface_cs.cpp,
+ TAO_IDL/be/be_visitor_interface/interface_sh.cpp,
+ TAO_IDL/be/be_visitor_interface/interface_ss.cpp,
+ TAO_IDL/be/be_visitor_interface/tie_sh.cpp,
+ TAO_IDL/be/be_visitor_operation/ami_ch.cpp,
+ TAO_IDL/be/be_visitor_operation/ami_cs.cpp,
+ TAO_IDL/be/be_visitor_operation/ami_handler_operation_ss.cpp,
+ TAO_IDL/be/be_visitor_operation/argument.cpp,
+ TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp,
+ TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp,
+ TAO_IDL/be_include/be_codegen.h,
+ TAO_IDL/be_include/be_interface.h,
+ TAO_IDL/be_include/be_interface_strategy.h,
+ TAO_IDL/be_include/be_visitor_operation.h,
+ TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp,
+ TAO_IDL/be_include/be_visitor_operation/ami_handler_skeleton_cs.h:
+ Deactivated 90 % of the old AMI code generation because it
+ is not needed any more and replaced with the standard code
+ generation. I left the code in for reference, but it
+ will be removed finally within the next two weeks.
+
+ * TAO_IDL/be/be_interface_strategy.cpp:
+ Simplified the interface node strategy to make it
+ less powerful, the functionality is now in the
+ operation strategy.
+
+ * TAO_IDL/be/be_visitor_ami_pre_proc.cpp,
+ TAO_IDL/be/be_operation.cpp,
+ TAO_IDL/be_include/be_operation.h:
+ Fixed the AMI code generation and introduced
+ strategies on operations.
+
+ * TAO_IDL/be/be_operation_strategy.cpp,
+ TAO_IDL/be_include/be_operation_strategy.h:
+ Added these files to support strategized operations.
+
+ * TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp,
+ TAO_IDL/be_include/be_visitor_operation/ami_handler_reply_stub_operation_ch.h:
+ These two files replace the "ami_handler_operation_ch*" files,
+ we also call it now "reply stub" and not smart stub or skelton any
+ more.
+
+ * TAO_IDL/utl/utl_scope.cpp,
+ TAO_IDL/ast/ast_module.cpp,
+ TAO_IDL/include/utl_scope.h,
+ TAO_IDL/include/ast_module.h: Enhanced the functionality
+ to allow interfaces be inserted at a certain position in the
+ list of interfaces.
+
Sat Sep 25 17:12:49 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
* TAO version 1.0.5 released.
diff --git a/TAO/TAO_IDL/Makefile b/TAO/TAO_IDL/Makefile
index 52edc8d98e6..bdf8f0b9173 100644
--- a/TAO/TAO_IDL/Makefile
+++ b/TAO/TAO_IDL/Makefile
@@ -94,6 +94,7 @@ FILES = tao_idl \
be/be_module \
be/be_native \
be/be_operation \
+ be/be_operation_strategy \
be/be_predefined_type \
be/be_root \
be/be_sequence \
diff --git a/TAO/TAO_IDL/ast/ast_module.cpp b/TAO/TAO_IDL/ast/ast_module.cpp
index 59d86c3dc00..fc354ff84bf 100644
--- a/TAO/TAO_IDL/ast/ast_module.cpp
+++ b/TAO/TAO_IDL/ast/ast_module.cpp
@@ -676,9 +676,17 @@ AST_Module::has_nested_valuetype ()
}
int
-AST_Module::be_add_interface (AST_Interface *i)
+AST_Module::be_add_interface (AST_Interface *i, AST_Interface *ix)
{
- this->fe_add_interface (i);
+ /*
+ * Add it to scope
+ */
+ add_to_scope(i, ix);
+ /*
+ * Add it to set of locally referenced symbols
+ */
+ add_to_referenced(i, I_FALSE, ix);
+
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp
index 733c381e50f..60a16ff03eb 100644
--- a/TAO/TAO_IDL/be/be_interface.cpp
+++ b/TAO/TAO_IDL/be/be_interface.cpp
@@ -65,10 +65,10 @@ be_interface::~be_interface (void)
delete this->strategy_;
}
-be_interface_type_strategy *
-be_interface::set_strategy (be_interface_type_strategy *new_strategy)
+be_interface_strategy *
+be_interface::set_strategy (be_interface_strategy *new_strategy)
{
- be_interface_type_strategy *old = this->strategy_;
+ be_interface_strategy *old = this->strategy_;
if (new_strategy != 0)
this->strategy_ = new_strategy;
@@ -1111,19 +1111,6 @@ be_interface::gen_optable_entries (be_interface *derived)
<< derived->full_skel_name () << "::"
<< d->local_name () << "_skel},\n";
derived->skel_count_++;
-
- if (this->strategy_->strategy_type ()
- == be_interface_type_strategy::AMI_HANDLER)
- {
- os->indent ();
-
- // we are an operation node
- *os << "{\"" << d->original_local_name () << "_excep\", &"
- << derived->full_skel_name () << "::"
- << d->local_name () << "_excep_skel},\n";
-
- derived->skel_count_++;
- }
}
else if (d->node_type () == AST_Decl::NT_attr)
{
@@ -1140,20 +1127,6 @@ be_interface::gen_optable_entries (be_interface *derived)
derived->skel_count_++;
- if (this->strategy_->strategy_type ()
- == be_interface_type_strategy::AMI_HANDLER)
- {
- os->indent ();
-
- // Generate only the "get" entry if we are
- // readonly.
- *os << "{\"_get_" << d->original_local_name () << "_excep"
- << "\", &" << derived->full_skel_name ()
- << "::_get_" << d->local_name () << "_excep_skel},\n";
-
- derived->skel_count_++;
- }
-
attr = AST_Attribute::narrow_from_decl (d);
if (!attr)
return -1;
@@ -1166,16 +1139,6 @@ be_interface::gen_optable_entries (be_interface *derived)
<< "\", &" << derived->full_skel_name ()
<< "::_set_" << d->local_name () << "_skel},\n";
derived->skel_count_++;
-
- if (this->strategy_->strategy_type ()
- == be_interface_type_strategy::AMI_HANDLER)
- {
- os->indent (); // start from current indentation level
- *os << "{\"_set_" << d->original_local_name () << "_excep"
- << "\", &" << derived->full_skel_name ()
- << "::_set_" << d->local_name () << "_excep_skel},\n";
- derived->skel_count_++;
- }
}
}
si->next ();
@@ -1220,20 +1183,7 @@ be_interface::gen_optable_entries (be_interface *derived)
<< derived->full_skel_name () << "::"
<< d->local_name () << "_skel" << "\n";
derived->skel_count_++;
-
- if (this->strategy_->strategy_type ()
- == be_interface_type_strategy::AMI_HANDLER)
- {
- os->indent ();
-
- // We are an operation node. We use the original
- // operation name, not the one with _cxx_ in it.
- *os << d->original_local_name () << "_excep,\t&"
- << derived->full_skel_name () << "::"
- << d->local_name () << "_excep_skel" << "\n";
- derived->skel_count_++;
- }
- }
+ }
else if (d->node_type () == AST_Decl::NT_attr)
{
AST_Attribute *attr;
@@ -1247,18 +1197,6 @@ be_interface::gen_optable_entries (be_interface *derived)
<< d->local_name () << "_skel\n";
derived->skel_count_++;
- if (this->strategy_->strategy_type ()
- == be_interface_type_strategy::AMI_HANDLER)
- {
- os->indent ();
-
- // Generate only the "get" entry if we are readonly
- *os << "_get_" << d->original_local_name () << "_excep,\t&"
- << derived->full_skel_name () << "::_get_"
- << d->local_name () << "_excep_skel\n";
- derived->skel_count_++;
- }
-
attr = AST_Attribute::narrow_from_decl (d);
if (!attr)
return -1;
@@ -1271,16 +1209,6 @@ be_interface::gen_optable_entries (be_interface *derived)
<< derived->full_skel_name () << "::_set_"
<< d->local_name () << "_skel\n";
derived->skel_count_++;
-
- if (this->strategy_->strategy_type ()
- == be_interface_type_strategy::AMI_HANDLER)
- {
- os->indent (); // start from current indentation level
- *os << "_set_" << d->original_local_name () << "_excep,\t&"
- << derived->full_skel_name () << "::_set_"
- << d->local_name () << "_excep_skel\n";
- derived->skel_count_++;
- }
}
}
si->next ();
diff --git a/TAO/TAO_IDL/be/be_interface_strategy.cpp b/TAO/TAO_IDL/be/be_interface_strategy.cpp
index c381adac027..76969468e66 100644
--- a/TAO/TAO_IDL/be/be_interface_strategy.cpp
+++ b/TAO/TAO_IDL/be/be_interface_strategy.cpp
@@ -24,7 +24,7 @@
ACE_RCSID(be, be_interface_strategy, "$Id$")
-be_interface_type_strategy::be_interface_type_strategy (be_interface *node,
+be_interface_strategy::be_interface_strategy (be_interface *node,
Strategy_Kind strategy_type)
: local_name_(0),
full_name_(0),
@@ -40,7 +40,7 @@ be_interface_type_strategy::be_interface_type_strategy (be_interface *node,
{
}
-be_interface_type_strategy::~be_interface_type_strategy ()
+be_interface_strategy::~be_interface_strategy ()
{
if (this->local_name_ != 0)
delete [] this->local_name_;
@@ -63,7 +63,7 @@ be_interface_type_strategy::~be_interface_type_strategy ()
// Interface Type Strategy Base Class
const char *
-be_interface_type_strategy::relative_skel_name (const char *skel_name)
+be_interface_strategy::relative_skel_name (const char *skel_name)
// relative skeleton name
{
return be_interface::relative_name (this->full_skel_name (),
@@ -74,7 +74,7 @@ be_interface_type_strategy::relative_skel_name (const char *skel_name)
// compute stringified fully qualified collocated class name.
void
-be_interface_type_strategy::compute_coll_names (int type,
+be_interface_strategy::compute_coll_names (int type,
const char *prefix,
const char *suffix)
{
@@ -193,7 +193,7 @@ be_interface_type_strategy::compute_coll_names (int type,
void
-be_interface_type_strategy::compute_names (const char *name,
+be_interface_strategy::compute_names (const char *name,
const char *prefix,
const char *suffix,
char *&new_name)
@@ -249,7 +249,7 @@ be_interface_type_strategy::compute_names (const char *name,
TAO_OutStream *
-be_interface_type_strategy::get_out_stream ()
+be_interface_strategy::get_out_stream ()
{
// Codegen singleton.
TAO_CodeGen *cg = TAO_CODEGEN::instance ();
@@ -259,17 +259,19 @@ be_interface_type_strategy::get_out_stream ()
}
const char *
-be_interface_type_strategy::get_out_stream_fname ()
+be_interface_strategy::get_out_stream_fname ()
{
return idl_global->be_get_server_skeleton_fname ();
}
int
-be_interface_type_strategy::strategy_type ()
+be_interface_strategy::strategy_type ()
{
return strategy_type_;
}
+// @@ Michael: Deprecated due to new AMI design
+#if 0
// ****************************************************************
// Prefix Suffix Strategy
@@ -277,7 +279,7 @@ be_interface_prefix_suffix_strategy::be_interface_prefix_suffix_strategy (be_int
Strategy_Kind strategy_type,
const char *prefix,
const char *suffix)
-: be_interface_type_strategy (node, strategy_type),
+: be_interface_strategy (node, strategy_type),
prefix_(prefix),
suffix_(suffix)
{
@@ -377,14 +379,14 @@ be_interface_prefix_suffix_strategy::local_coll_name (int type)
return this->local_coll_name_;
}
+#endif 0
+
// ****************************************************************
// AMI Hander Strategy
be_interface_ami_handler_strategy::be_interface_ami_handler_strategy (be_interface *node)
- : be_interface_prefix_suffix_strategy (node,
- AMI_HANDLER,
- "AMI_",
- "Handler")
+ : be_interface_default_strategy (node,
+ AMI_HANDLER)
{
}
@@ -410,10 +412,8 @@ be_interface_ami_handler_strategy::next_state (TAO_CodeGen::CG_STATE current_sta
// AMI Exception Holder Strategy
be_interface_ami_exception_holder_strategy::be_interface_ami_exception_holder_strategy (be_interface *node)
- : be_interface_prefix_suffix_strategy (node,
- AMI_EXCEPTION_HOLDER,
- "AMI_",
- "ExceptionHolder")
+ : be_interface_default_strategy (node,
+ AMI_EXCEPTION_HOLDER)
{
}
@@ -434,8 +434,9 @@ be_interface_ami_exception_holder_strategy::next_state (TAO_CodeGen::CG_STATE cu
// ****************************************************************
// Default Strategy
-be_interface_default_strategy::be_interface_default_strategy (be_interface *node)
- : be_interface_type_strategy (node, DEFAULT)
+be_interface_default_strategy::be_interface_default_strategy (be_interface *node,
+ Strategy_Kind strategy_kind)
+ : be_interface_strategy (node, strategy_kind)
{
}
diff --git a/TAO/TAO_IDL/be/be_operation.cpp b/TAO/TAO_IDL/be/be_operation.cpp
index 89d1b325b6a..b9c385b75d6 100644
--- a/TAO/TAO_IDL/be/be_operation.cpp
+++ b/TAO/TAO_IDL/be/be_operation.cpp
@@ -30,7 +30,8 @@ ACE_RCSID(be, be_operation, "$Id$")
*/
be_operation::be_operation (void)
: argument_count_ (-1),
- has_native_ (0)
+ has_native_ (0),
+ strategy_ (new be_operation_default_strategy (this))
{
}
@@ -40,10 +41,20 @@ be_operation::be_operation (AST_Type *rt, AST_Operation::Flags fl,
AST_Decl (AST_Decl::NT_op, n, p),
UTL_Scope (AST_Decl::NT_op),
argument_count_ (-1),
- has_native_ (0)
+ has_native_ (0),
+ strategy_ (new be_operation_default_strategy (this))
{
}
+
+be_operation::~be_operation (void)
+{
+ // We know that it cannot be 0, but..
+ if (!this->strategy_)
+ delete this->strategy_;
+}
+
+
// compute total number of members
int
be_operation::compute_argument_attr (void)
@@ -172,6 +183,38 @@ be_operation::accept (be_visitor *visitor)
return visitor->visit_operation (this);
}
+be_operation_strategy *
+be_operation::set_strategy (be_operation_strategy *new_strategy)
+{
+ be_operation_strategy *old = this->strategy_;
+
+ if (new_strategy != 0)
+ this->strategy_ = new_strategy;
+
+ return old;
+}
+
+
+TAO_CodeGen::CG_STATE
+be_operation::next_state (TAO_CodeGen::CG_STATE current_state,
+ int is_extra_state)
+{
+ return this->strategy_->next_state (current_state, is_extra_state);
+}
+
+int
+be_operation::has_extra_code_generation (TAO_CodeGen::CG_STATE current_state)
+{
+ return this->strategy_->has_extra_code_generation (current_state);
+}
+
+be_operation*
+be_operation::hidden_operation ()
+{
+ return this->strategy_->hidden_operation ();
+}
+
+
// Narrowing
IMPL_NARROW_METHODS3 (be_operation, AST_Operation, be_scope, be_decl)
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
new file mode 100644
index 00000000000..d622c7b4d93
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_operation_strategy.cpp
@@ -0,0 +1,211 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// be_operation_strategy.cpp
+//
+// = DESCRIPTION
+// A strategy to cover the differences between various variants
+// of an operations, e.g. AMI sendc_, AMI raise_
+//
+// = AUTHOR
+// Michael Kircher
+//
+// ============================================================================
+
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
+
+ACE_RCSID(be, be_operation_strategy, "$Id$")
+
+
+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 ()
+{
+}
+
+int
+be_operation_strategy::strategy_type ()
+{
+ return strategy_type_;
+}
+
+int
+be_operation_strategy::has_extra_code_generation (TAO_CodeGen::CG_STATE current_state)
+{
+ ACE_UNUSED_ARG (current_state);
+ return 0;
+}
+
+be_operation *
+be_operation_strategy::hidden_operation ()
+{
+ return 0;
+}
+
+// ****************************************************************
+// 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 ()
+{
+}
+
+
+TAO_CodeGen::CG_STATE
+be_operation_default_strategy::next_state (TAO_CodeGen::CG_STATE current_state,
+ int is_extra_state)
+{
+ return current_state;
+}
+
+
+
+// ****************************************************************
+// AMI sendc_ operation strategy
+
+be_operation_ami_sendc_strategy::be_operation_ami_sendc_strategy (be_operation *node,
+ be_operation *hidden_operation)
+ : be_operation_strategy (node,
+ AMI_SENDC),
+ hidden_operation_ (hidden_operation)
+{
+}
+
+be_operation_ami_sendc_strategy::~be_operation_ami_sendc_strategy ()
+{
+}
+
+
+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 // !is_extra_state
+ {
+ 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::hidden_operation ()
+{
+ return hidden_operation_;
+}
+
+// ****************************************************************
+// 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 ()
+{
+}
+
+
+TAO_CodeGen::CG_STATE
+be_operation_ami_exception_holder_raise_strategy::next_state (TAO_CodeGen::CG_STATE current_state,
+ int is_extra_state)
+{
+ switch (current_state)
+ {
+ case TAO_CodeGen::TAO_OPERATION_CS:
+ return TAO_CodeGen::TAO_AMI_EXCEP_HOLDER_RAISE_OPERATION_CS;
+ default:
+ return current_state;
+ }
+}
+
+
+// ****************************************************************
+// 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 ()
+{
+}
+
+
+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 // !is_extra_state
+ {
+ 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;
+}
+
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 4b1ffd17eff..89d76d5198c 100644
--- a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp
@@ -66,7 +66,7 @@ be_visitor_ami_pre_proc::visit_interface (be_interface *node)
{
excep_holder->set_defined_in (node->defined_in ());
(be_module::narrow_from_scope (node->defined_in ()))
- ->be_add_interface (excep_holder);
+ ->be_add_interface (excep_holder, node);
}
else
{
@@ -78,12 +78,13 @@ be_visitor_ami_pre_proc::visit_interface (be_interface *node)
}
- be_interface *reply_handler = this->create_reply_handler (node);
+ be_interface *reply_handler = this->create_reply_handler (node,
+ excep_holder);
if (reply_handler)
{
reply_handler->set_defined_in (node->defined_in ());
(be_module::narrow_from_scope (node->defined_in ()))
- ->be_add_interface (reply_handler);
+ ->be_add_interface (reply_handler, node);
}
else
{
@@ -140,7 +141,15 @@ be_visitor_ami_pre_proc::visit_operation (be_operation *node)
// After having generated the operation we insert it into the
// exceptionholder valuetype.
- (be_interface::narrow_from_scope (node->defined_in ()))->be_add_operation (sendc_operation);
+ // @@ Michael: We use the hidden_operation () method
+ // (be_interface::narrow_from_scope (node->defined_in ()))->be_add_operation (sendc_operation);
+
+ // Set the proper strategy
+ be_operation_strategy *old_strategy =
+ node->set_strategy (new be_operation_ami_sendc_strategy (node,
+ sendc_operation));
+ if (old_strategy)
+ delete old_strategy;
}
return 0;
@@ -226,12 +235,12 @@ be_visitor_ami_pre_proc::create_exception_holder (be_interface *node)
AST_Interface_ptr *p_intf = new AST_Interface_ptr[1];
p_intf[0] = (AST_Interface *)inherit_vt;
- be_valuetype *excep_holder_vt = new be_valuetype (excep_holder_name, // name
+ be_valuetype *excep_holder = new be_valuetype (excep_holder_name, // name
p_intf, // list of inherited
1, // number of inherited
0, // pragmas
0); // set abstract
- excep_holder_vt->set_name (excep_holder_name);
+ excep_holder->set_name (excep_holder_name);
// Now our customized valuetype is created, we have to
// add now the operations and attributes to the scope.
@@ -284,33 +293,40 @@ be_visitor_ami_pre_proc::create_exception_holder (be_interface *node)
new_name->nconc (new UTL_ScopedName (new Identifier (new_local_name.rep (), 0,0,0),
0));
- be_operation *op_vt = new be_operation (rt,
- AST_Operation::OP_noflags,
- new_name,
- 0);
+ be_operation *operation = new be_operation (rt,
+ AST_Operation::OP_noflags,
+ new_name,
+ 0);
// Copy the exceptions.
if (((AST_Operation *)op)->exceptions ())
{
UTL_ExceptList *exceptions = (UTL_ExceptList *)((AST_Operation *)op)->exceptions ()->copy ();
- op_vt->be_add_exceptions (exceptions);
+ operation->be_add_exceptions (exceptions);
}
+ // Set the proper strategy
+ be_operation_strategy *old_strategy =
+ operation->set_strategy (new be_operation_ami_exception_holder_raise_strategy (operation));
+ if (old_strategy)
+ delete old_strategy;
+
// After having generated the operation we insert it into the
// exceptionholder valuetype.
- excep_holder_vt->be_add_operation (op_vt);
+ excep_holder->be_add_operation (operation);
}
si->next ();
} // end of while loop
delete si;
} // end of if
- return excep_holder_vt;
+ return excep_holder;
}
be_interface *
-be_visitor_ami_pre_proc::create_reply_handler (be_interface *node)
+be_visitor_ami_pre_proc::create_reply_handler (be_interface *node,
+ be_valuetype *excep_holder)
{
ACE_DEBUG ((LM_DEBUG, "be_visitor_ami_pre_proc::create_reply_handler\n"));
@@ -351,10 +367,11 @@ be_visitor_ami_pre_proc::create_reply_handler (be_interface *node)
AST_Interface_ptr *p_intf = new AST_Interface_ptr[1];
p_intf[0] = (AST_Interface *)inherit_intf;
- be_interface *reply_handler_intf = new be_interface (reply_handler_name, // name
+ be_interface *reply_handler = new be_interface (reply_handler_name, // name
p_intf, // list of inherited
1, // number of inherited
0); // pragmas
+ reply_handler->set_name (reply_handler_name);
// Now our customized valuetype is created, we have to
// add now the operations and attributes to the scope.
@@ -395,33 +412,36 @@ be_visitor_ami_pre_proc::create_reply_handler (be_interface *node)
be_operation *operation =
- this->create_reply_handler_operation (be_operation::narrow_from_decl (d));
+ this->create_reply_handler_operation (be_operation::narrow_from_decl (d),
+ reply_handler);
if (operation)
{
- operation->set_defined_in (reply_handler_intf);
+ operation->set_defined_in (reply_handler);
// We do not copy the exceptions because the exceptions
// are delivered by the excep methods.
// After having generated the operation we insert it into the
// reply handler interface.
- reply_handler_intf->be_add_operation (operation);
+ reply_handler->be_add_operation (operation);
}
be_operation *excep_operation =
- this->create_excep_operation (be_operation::narrow_from_decl (d));
+ this->create_excep_operation (be_operation::narrow_from_decl (d),
+ reply_handler,
+ excep_holder);
if (excep_operation)
{
- excep_operation->set_defined_in (reply_handler_intf);
+ excep_operation->set_defined_in (reply_handler);
// We do not copy the exceptions because the exceptions
// are delivered by the excep methods.
// After having generated the operation we insert it into the
// reply handler interface
- reply_handler_intf->be_add_operation (operation);
+ reply_handler->be_add_operation (excep_operation);
}
si->next ();
@@ -429,7 +449,7 @@ be_visitor_ami_pre_proc::create_reply_handler (be_interface *node)
delete si;
} // end of if
- return reply_handler_intf;
+ return reply_handler;
}
@@ -488,7 +508,7 @@ be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node)
field_type, // is also a valuetype
new UTL_ScopedName
(new Identifier
- ("reply_handler", 1, 0, I_FALSE),
+ ("ami_handler", 1, 0, I_FALSE),
0),
0);
@@ -537,14 +557,14 @@ be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node)
} // end of while loop
delete si;
} // end of if
-
-
+
return op;
}
be_operation *
-be_visitor_ami_pre_proc::create_reply_handler_operation (be_operation *node)
+be_visitor_ami_pre_proc::create_reply_handler_operation (be_operation *node,
+ be_interface *reply_handler)
{
ACE_DEBUG ((LM_DEBUG, "be_visitor_ami_pre_proc::create_reply_handler_operation\n"));
// Create the return type, which is "void"
@@ -554,11 +574,23 @@ be_visitor_ami_pre_proc::create_reply_handler_operation (be_operation *node)
0),
0);
+ ACE_CString original_op_name (node
+ ->name ()
+ ->last_component ()
+ ->get_string ());
+
+ UTL_ScopedName *op_name = (UTL_ScopedName *)reply_handler->name ()-> copy ();
+ op_name->nconc (new UTL_ScopedName (
+ new Identifier (
+ original_op_name.rep (), 1, 0, I_FALSE),
+ 0));
+
// Create the operation
be_operation * op = new be_operation (rt,
AST_Operation::OP_noflags,
- (UTL_IdList *)node->name ()->copy (),
+ op_name,
0);
+ op->set_name (op_name);
// If return type is non-void add it as first argument
@@ -566,7 +598,7 @@ be_visitor_ami_pre_proc::create_reply_handler_operation (be_operation *node)
{
// Create the argument
- be_argument *arg = new be_argument (AST_Argument::dir_OUT,
+ be_argument *arg = new be_argument (AST_Argument::dir_IN,
node->return_type (),
new UTL_ScopedName
(new Identifier
@@ -609,7 +641,7 @@ be_visitor_ami_pre_proc::create_reply_handler_operation (be_operation *node)
original_arg->direction () == AST_Argument::dir_OUT)
{
// Create the argument
- be_argument *arg = new be_argument (AST_Argument::dir_OUT,
+ be_argument *arg = new be_argument (AST_Argument::dir_IN,
original_arg->field_type (),
original_arg->name (),
0);
@@ -621,11 +653,19 @@ be_visitor_ami_pre_proc::create_reply_handler_operation (be_operation *node)
delete si;
} // end of if
- return 0;
+ // Set the proper strategy
+ be_operation_strategy *old_strategy =
+ op->set_strategy (new be_operation_ami_handler_reply_stub_strategy (op));
+ if (old_strategy)
+ delete old_strategy;
+
+ return op;
}
be_operation *
-be_visitor_ami_pre_proc::create_excep_operation (be_operation *node)
+be_visitor_ami_pre_proc::create_excep_operation (be_operation *node,
+ be_interface *reply_handler,
+ be_valuetype *excep_holder)
{
ACE_DEBUG ((LM_DEBUG, "be_visitor_ami_pre_proc::create_excep_operation\n"));
// Create the return type, which is "void"
@@ -636,35 +676,36 @@ be_visitor_ami_pre_proc::create_excep_operation (be_operation *node)
0);
// Create the argument
-
+#if 0
// Create the field type
// Get the name of the interface
// Get the scope name.
be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl ();
- ACE_CString interface_name (parent
- ->name ()
- ->last_component ()
- ->get_string ());
-
+
// Add the pre- and suffix
- ACE_CString excep_holder_name ("AMI_");
- excep_holder_name += interface_name;
- excep_holder_name += "ExceptionHolder";
- UTL_ScopedName *field_name = (UTL_ScopedName *)parent->name ()->copy ();
- field_name->last_component ()->replace_string (excep_holder_name.rep ());
+ ACE_CString excep_holder_local_name;
+ this->generate_name (excep_holder_name,
+ "AMI_",
+ parent
+ ->name ()
+ ->last_component ()
+ ->get_string (),
+ "ExceptionHolder");
+ UTL_ScopedName *field_name = (UTL_ScopedName *)reply_handler->name ()->copy ();
+ field_name->last_component ()->replace_string (excep_holder_local_name.rep ());
be_interface *field_type= new be_interface (field_name,
0,
0,
0);
field_type->set_name (field_name);
field_type->set_defined_in (node->defined_in ());
-
+#endif /* 0 */
// Create the argument
be_argument *arg = new be_argument (AST_Argument::dir_OUT,
- field_type, // is also a valuetype
- new UTL_ScopedName
- (new Identifier
- ("excep_holder", 1, 0, I_FALSE),
+ excep_holder, // is also a valuetype
+ new UTL_ScopedName (
+ new Identifier (
+ "excep_holder", 1, 0, I_FALSE),
0),
0);
@@ -676,14 +717,18 @@ be_visitor_ami_pre_proc::create_excep_operation (be_operation *node)
->get_string ());
ACE_CString new_op_name = original_op_name + ACE_CString ("_excep");
- UTL_ScopedName *op_name = (UTL_ScopedName *)node->name ()-> copy ();
- op_name->last_component ()->replace_string (new_op_name.rep ());
+ UTL_ScopedName *op_name = (UTL_ScopedName *)reply_handler->name ()-> copy ();
+ op_name->nconc (new UTL_ScopedName (
+ new Identifier (
+ new_op_name.rep (), 1, 0, I_FALSE),
+ 0));
// create the operation
be_operation * op = new be_operation (rt,
AST_Operation::OP_noflags,
op_name,
0);
+ op->set_name (op_name);
op->add_argument_to_scope (arg);
return op;
diff --git a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp b/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp
index 75d98ccef14..f607c5b2e96 100644
--- a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp
@@ -117,6 +117,7 @@ be_visitor_attribute::visit_attribute (be_attribute *node)
case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI:
ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SI);
break;
+#if 0
// AMI Reply Handler code generation
case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_CH:
ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_CH);
@@ -151,6 +152,7 @@ be_visitor_attribute::visit_attribute (be_attribute *node)
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_ATTRIBUTE_CS:
ctx.state (TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_OPERATION_CS);
break;
+#endif /* 0 */
default:
// error
ACE_ERROR_RETURN ((LM_ERROR,
@@ -400,6 +402,8 @@ be_visitor_attribute::visit_attribute (be_attribute *node)
case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI:
ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SI);
break;
+
+#if 0
// AMI Reply Handler code generation
case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_CH:
ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_CH);
@@ -434,6 +438,7 @@ be_visitor_attribute::visit_attribute (be_attribute *node)
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_ATTRIBUTE_CS:
ctx.state (TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_OPERATION_CS);
break;
+#endif /* 0 */
default:
// error
ACE_ERROR_RETURN ((LM_ERROR,
diff --git a/TAO/TAO_IDL/be/be_visitor_factory.cpp b/TAO/TAO_IDL/be/be_visitor_factory.cpp
index 20f3cd9c037..1a4ed339215 100644
--- a/TAO/TAO_IDL/be/be_visitor_factory.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_factory.cpp
@@ -428,17 +428,6 @@ TAO_Common_Visitor_Factory::make_visitor (be_visitor_context *ctx)
case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SS:
case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SH:
case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SS:
- case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_CH:
- case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_CS:
- case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_SH:
- case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_SS:
- case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_TIE_SH:
- case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_THRU_POA_COLLOCATED_SH:
- case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_THRU_POA_COLLOCATED_SS:
- case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_DIRECT_COLLOCATED_SH:
- case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_DIRECT_COLLOCATED_SS:
- case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_ATTRIBUTE_CH:
- case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_ATTRIBUTE_CS:
return new be_visitor_attribute (new_ctx);
case TAO_CodeGen::TAO_EXCEPTION_CH:
@@ -480,6 +469,20 @@ TAO_Common_Visitor_Factory::make_visitor (be_visitor_context *ctx)
case TAO_CodeGen::TAO_ARRAY_CDR_OP_CS:
return new be_visitor_array_cdr_op_cs (new_ctx);
+#if 0
+ case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_CH:
+ case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_CS:
+ case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_SH:
+ case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_SS:
+ case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_TIE_SH:
+ case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_THRU_POA_COLLOCATED_SH:
+ case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_THRU_POA_COLLOCATED_SS:
+ case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_DIRECT_COLLOCATED_SH:
+ case TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_DIRECT_COLLOCATED_SS:
+ case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_ATTRIBUTE_CH:
+ case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_ATTRIBUTE_CS:
+ return new be_visitor_attribute (new_ctx);
+
case TAO_CodeGen::TAO_AMI_ARGUMENT:
// @@ Alex: I am not sure about this case, yet (Alex).
// noop.
@@ -531,7 +534,7 @@ TAO_Common_Visitor_Factory::make_visitor (be_visitor_context *ctx)
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_OPERATION_CS:
return new be_visitor_operation_ami_exception_holder_operation_cs (new_ctx);
-
+#endif /* 0 */
default:
// an error
delete new_ctx;
@@ -633,7 +636,6 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx)
case TAO_CodeGen::TAO_OPERATION_ARG_PRE_INVOKE_CS:
case TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS:
- case TAO_CodeGen::TAO_AMI_OPERATION_ARG_INVOKE_CS:
case TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS:
case TAO_CodeGen::TAO_OPERATION_ARG_PRE_UPCALL_SS:
case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS:
@@ -643,8 +645,12 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx)
case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS:
case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS:
case TAO_CodeGen::TAO_OPERATION_ARG_POST_MARSHAL_SS:
+ return new be_visitor_operation_argument (new_ctx);
+#if 0
+ case TAO_CodeGen::TAO_AMI_OPERATION_ARG_INVOKE_CS:
case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DECL_CS:
return new be_visitor_operation_argument (new_ctx);
+#endif /* 0 */
case TAO_CodeGen::TAO_OPERATION_TIE_SH:
return new be_visitor_operation_tie_sh (new_ctx);
@@ -679,6 +685,7 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx)
case TAO_CodeGen::TAO_ARGUMENT_POST_MARSHAL_SS:
return new be_visitor_args_post_marshal_ss (new_ctx);
+#if 0
case TAO_CodeGen::TAO_AMI_OPERATION_CH:
return new be_visitor_operation_ami_ch (new_ctx);
@@ -713,7 +720,7 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx)
//case TAO_CodeGen::TAO_AMI_HANDLER_SKELETON_CS:
//return new be_interpretive_visitor_operation_ami_handler_skeleton_cs (new_ctx);
-
+#endif /* 0 */
default:
// cannot handle it; delegate it to the common visitor factory
delete new_ctx;
@@ -883,6 +890,23 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx)
// this is a NO-OP
return new be_visitor_decl (new_ctx);
+ // AMI next generation visitors.
+ case TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CH:
+ return new be_visitor_operation_ami_handler_reply_stub_operation_ch (new_ctx);
+
+ case TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CS:
+ return new be_compiled_visitor_operation_ami_handler_skeleton_cs (new_ctx);
+
+ case TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CH:
+ return new be_visitor_operation_ami_ch (new_ctx);
+
+ case TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CS:
+ return new be_compiled_visitor_operation_ami_cs (new_ctx);
+
+ case TAO_CodeGen::TAO_AMI_EXCEP_HOLDER_RAISE_OPERATION_CS:
+ return new be_visitor_operation_ami_exception_holder_operation_cs (new_ctx);
+
+#if 0
case TAO_CodeGen::TAO_AMI_OPERATION_CS:
return new be_compiled_visitor_operation_ami_cs (new_ctx);
@@ -939,6 +963,8 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx)
case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DEMARSHAL_CS:
return new be_compiled_visitor_operation_ami_handler_argument_marshal (new_ctx);
+#endif /* 0 */
+
default:
// cannot handle it; delegate it to the common visitor factory
delete new_ctx;
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_cs.cpp
index 881c15255a6..0f4fb7b4523 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_cs.cpp
@@ -43,7 +43,7 @@ be_visitor_interface_ami_handler_stub_cs::~be_visitor_interface_ami_handler_stub
int
be_visitor_interface_ami_handler_stub_cs::visit_interface (be_interface *node)
{
- be_interface_type_strategy *old_strategy =
+ be_interface_strategy *old_strategy =
node->set_strategy (new be_interface_ami_handler_strategy (node));
// output stream.
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp
index 23427a860af..5c08a9fe41c 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp
@@ -60,7 +60,7 @@ be_visitor_interface_any_op_ch::visit_interface (be_interface *node)
to_do = 2;
else
to_do = 1;
- be_interface_type_strategy *old_strategy = 0;
+ be_interface_strategy *old_strategy = 0;
for (i = 0; i < to_do; i++)
{
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp
index 75f5d7dd473..9631ad7ddff 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp
@@ -59,7 +59,7 @@ be_visitor_interface_any_op_cs::visit_interface (be_interface *node)
to_do = 2;
else
to_do = 1;
- be_interface_type_strategy *old_strategy = 0;
+ be_interface_strategy *old_strategy = 0;
for (i = 0; i < to_do; i++)
{
@@ -98,7 +98,7 @@ be_visitor_interface_any_op_cs::visit_interface (be_interface *node)
if (idl_global->ami_call_back () == I_TRUE)
{
// AMI Handler stuff
- be_interface_type_strategy *old_strategy =
+ be_interface_strategy *old_strategy =
node->set_strategy (new be_interface_ami_handler_strategy (node));
os->indent ();
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp
index 231b5be05c5..55d29928f43 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp
@@ -61,7 +61,7 @@ be_visitor_interface_cdr_op_ch::visit_interface (be_interface *node)
to_do = 3;
else
to_do = 1;
- be_interface_type_strategy *old_strategy = 0;
+ be_interface_strategy *old_strategy = 0;
for (i = 0; i < to_do; i++)
{
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ci.cpp
index 498705f0acf..df19909af97 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ci.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ci.cpp
@@ -63,7 +63,7 @@ be_visitor_interface_cdr_op_ci::visit_interface (be_interface *node)
to_do = 3;
else
to_do = 1;
- be_interface_type_strategy *old_strategy = 0;
+ be_interface_strategy *old_strategy = 0;
for (i = 0; i < to_do; i++)
{
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp
index d54433cc9e4..b197901ca21 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp
@@ -56,7 +56,7 @@ be_visitor_interface_cdr_op_cs::visit_interface (be_interface *node)
to_do = 2;
else
to_do = 1;
- be_interface_type_strategy *old_strategy = 0;
+ be_interface_strategy *old_strategy = 0;
for (i = 0; i < to_do; i++)
{
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp
index 3817559f83b..8de45390ef9 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp
@@ -100,6 +100,7 @@ be_visitor_interface::visit_attribute (be_attribute *node)
case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI);
break;
+#if 0
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_CH:
ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ATTRIBUTE_CH);
break;
@@ -134,6 +135,7 @@ be_visitor_interface::visit_attribute (be_attribute *node)
ctx.state (TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_ATTRIBUTE_CS);
break;
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_INTERFACE_CI:
+#endif /* 0 */
case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH:
case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS:
case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH:
@@ -213,6 +215,7 @@ be_visitor_interface::visit_constant (be_constant *node)
case TAO_CodeGen::TAO_INTERFACE_SS:
case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
+#if 0
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SH:
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SS:
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_CH:
@@ -224,6 +227,7 @@ be_visitor_interface::visit_constant (be_constant *node)
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_INTERFACE_CI:
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_INTERFACE_CS:
return 0; // nothing to be done
+#endif /* 0 */
default:
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -305,6 +309,7 @@ be_visitor_interface::visit_enum (be_enum *node)
case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS:
case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
+#if 0
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SH:
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SS:
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_CH:
@@ -316,6 +321,7 @@ be_visitor_interface::visit_enum (be_enum *node)
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_INTERFACE_CI:
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_INTERFACE_CS:
return 0; // nothing to be done
+#endif /* 0 */
default:
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -399,6 +405,7 @@ be_visitor_interface::visit_exception (be_exception *node)
case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS:
case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
+#if 0
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SH:
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SS:
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_CH:
@@ -410,6 +417,7 @@ be_visitor_interface::visit_exception (be_exception *node)
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_INTERFACE_CI:
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_INTERFACE_CS:
return 0; // nothing to be done
+#endif /* 0 */
default:
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -448,11 +456,6 @@ int
be_visitor_interface::visit_operation (be_operation *node)
{
- // Change the state depending on the kind of interface
- // we are defined in.
- be_interface *parent = be_interface::narrow_from_scope (node->defined_in ());
- this->ctx_->state (parent->next_state (this->ctx_->state ()));
-
// instantiate a visitor context with a copy of our context. This info
// will be modified ased on what type of node we are visiting
be_visitor_context ctx (*this->ctx_);
@@ -500,6 +503,7 @@ be_visitor_interface::visit_operation (be_operation *node)
case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS:
ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS);
break;
+#if 0
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SH:
ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_SH);
break;
@@ -528,6 +532,7 @@ be_visitor_interface::visit_operation (be_operation *node)
ctx.state (TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_OPERATION_CS);
break;
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_INTERFACE_CI:
+#endif /* 0 */
case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH:
case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS:
case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH:
@@ -546,6 +551,10 @@ be_visitor_interface::visit_operation (be_operation *node)
}
}
+ // 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)
@@ -568,9 +577,36 @@ be_visitor_interface::visit_operation (be_operation *node)
}
delete visitor;
visitor = 0;
- //
- // AMI Call back code generation.
- //
+
+ 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
+ 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);
+ }
+
+ // visit the node using this visitor
+ 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;
+ }
+
#if 0
// Only if AMI callbacks are enabled.
if (idl_global->ami_call_back () == I_TRUE)
@@ -772,6 +808,7 @@ be_visitor_interface::visit_structure (be_structure *node)
case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS:
case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
+#if 0
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SH:
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SS:
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_CH:
@@ -783,6 +820,7 @@ be_visitor_interface::visit_structure (be_structure *node)
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_INTERFACE_CI:
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_INTERFACE_CS:
return 0; // nothing to be done
+#endif /* 0 */
default:
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -866,6 +904,7 @@ be_visitor_interface::visit_union (be_union *node)
case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS:
case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
+#if 0
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SH:
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SS:
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_CH:
@@ -877,6 +916,7 @@ be_visitor_interface::visit_union (be_union *node)
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_INTERFACE_CI:
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_INTERFACE_CS:
return 0; // nothing to be done
+#endif /* 0 */
default:
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -960,6 +1000,7 @@ be_visitor_interface::visit_typedef (be_typedef *node)
case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS:
case TAO_CodeGen::TAO_INTERFACE_TIE_SH:
case TAO_CodeGen::TAO_INTERFACE_TIE_SI:
+#if 0
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SH:
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SS:
case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_CH:
@@ -971,6 +1012,7 @@ be_visitor_interface::visit_typedef (be_typedef *node)
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_INTERFACE_CI:
case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_INTERFACE_CS:
return 0; // nothing to be done
+#endif /* 0 */
default:
{
ACE_ERROR_RETURN ((LM_ERROR,
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp
index cc54f825663..ba895040f8a 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp
@@ -58,7 +58,7 @@ be_visitor_interface_ch::visit_interface (be_interface *node)
if (idl_global->ami_call_back () == I_TRUE)
{
- be_interface_type_strategy *old_strategy =
+ be_interface_strategy *old_strategy =
node->set_strategy (new be_interface_ami_handler_strategy (node));
// generate the ifdefined macro for the _ptr type
@@ -337,7 +337,7 @@ be_visitor_interface_ch::visit_interface (be_interface *node)
// Remove the exception holder strategy, delete it,
// and set the ami handler strategy
- be_interface_type_strategy *old_strategy =
+ be_interface_strategy *old_strategy =
node->set_strategy (new be_interface_ami_handler_strategy (node));
ctx = *this->ctx_;
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
index c5e34b16709..55ff1aa9a45 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp
@@ -100,6 +100,7 @@ be_visitor_interface_ci::visit_interface (be_interface *node)
"codegen for scope failed\n"), -1);
}
+#if 0
// If AMI is enabled, generate all the inline stuff for the
// AMI_<interface_name>_Handler interface.
@@ -138,7 +139,7 @@ be_visitor_interface_ci::visit_interface (be_interface *node)
visitor = 0;
- be_interface_type_strategy *old_strategy =
+ be_interface_strategy *old_strategy =
node->set_strategy (new be_interface_ami_handler_strategy (node));
// Set the context.
@@ -172,6 +173,7 @@ be_visitor_interface_ci::visit_interface (be_interface *node)
delete node->set_strategy (old_strategy);
}
+#endif /* 0 */
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
index e9c2d9cd100..161d85272b6 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
@@ -212,7 +212,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node)
if (idl_global->ami_call_back () == I_TRUE)
{
// Generate the exception holder
- be_interface_type_strategy *old_strategy =
+ be_interface_strategy *old_strategy =
node->set_strategy (new be_interface_ami_exception_holder_strategy (node));
// Set the context.
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
index d4e414ec226..1d48e2ff90d 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
@@ -208,9 +208,11 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
// generate the collocated class
if (idl_global->gen_thru_poa_collocation ())
{
+#if 0
if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SH)
ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_THRU_POA_COLLOCATED_SH);
else
+#endif /* 0 */
ctx.state (TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH);
visitor = tao_cg->make_visitor (&ctx);
if (!visitor || (node->accept (visitor) == -1))
@@ -229,9 +231,11 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
if (idl_global->gen_direct_collocation ())
{
ctx = *this->ctx_;
+#if 0
if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SH)
ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_DIRECT_COLLOCATED_SH);
else
+#endif /* 0 */
ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH);
visitor = tao_cg->make_visitor (&ctx);
if (!visitor || (node->accept (visitor) == -1))
@@ -252,10 +256,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
{
// generate the TIE class.
ctx = *this->ctx_;
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SH)
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_TIE_SH);
- else
- ctx.state (TAO_CodeGen::TAO_INTERFACE_TIE_SH);
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_TIE_SH);
visitor = tao_cg->make_visitor (&ctx);
if (!visitor || (node->accept (visitor) == -1))
{
@@ -276,7 +277,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
&& this->ctx_->state () == TAO_CodeGen::TAO_INTERFACE_SH)
{
// Set the AMI Strategy for code generation
- be_interface_type_strategy *old_strategy =
+ be_interface_strategy *old_strategy =
node->set_strategy (new be_interface_ami_handler_strategy (node));
// = Generate the Servant Skeleton code.
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
index 53647057d6b..6fe215225a0 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
@@ -435,9 +435,11 @@ be_visitor_interface_ss::visit_interface (be_interface *node)
if (idl_global->gen_thru_poa_collocation ())
{
be_visitor_context ctx (*this->ctx_);
+#if 0
if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SS)
ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_THRU_POA_COLLOCATED_SS);
else
+#endif /* 0 */
ctx.state (TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS);
be_visitor *visitor = tao_cg->make_visitor (&ctx);
if (!visitor)
@@ -463,9 +465,11 @@ be_visitor_interface_ss::visit_interface (be_interface *node)
if (idl_global->gen_direct_collocation ())
{
be_visitor_context ctx (*this->ctx_);
+#if 0
if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SS)
ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_THRU_POA_COLLOCATED_SS);
else
+#endif /* 0 */
ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS);
be_visitor *visitor = tao_cg->make_visitor (&ctx);
if (!visitor)
@@ -495,7 +499,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node)
if (idl_global->ami_call_back () == I_TRUE
&& this->ctx_->state () != TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_SS)
{
- be_interface_type_strategy *old_strategy =
+ be_interface_strategy *old_strategy =
node->set_strategy (new be_interface_ami_handler_strategy (node));
// = Generate the Servant Skeleton code.
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp
index f466e56c0d2..ef50aeb5109 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp
@@ -120,6 +120,7 @@ be_visitor_interface_tie_sh::visit_interface (be_interface *node)
<< be_uidt << be_uidt_nl
<< ");" << be_uidt << "\n";
+#if 0
if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_TIE_SH)
{
if (node->traverse_inheritance_graph (be_visitor_interface_tie_sh::ami_handler_method_helper, os) == -1)
@@ -132,6 +133,7 @@ be_visitor_interface_tie_sh::visit_interface (be_interface *node)
}
}
else
+#endif /* 0 */
{
if (node->traverse_inheritance_graph (be_visitor_interface_tie_sh::method_helper, os) == -1)
{
diff --git a/TAO/TAO_IDL/be/be_visitor_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation.cpp
index 4e4ea404937..dc7186b8976 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation.cpp
@@ -58,16 +58,21 @@
#include "be_visitor_operation/rettype_pre_invoke_cs.cpp"
#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_skeleton_cs.cpp"
+#include "be_visitor_operation/ami_exception_holder_operation_cs.cpp"
+
+#if 0
#include "be_visitor_operation/ami_arglist.cpp"
#include "be_visitor_operation/ami_handler_arglist.cpp"
#include "be_visitor_operation/ami_handler_operation_ch.cpp"
#include "be_visitor_operation/ami_handler_operation_cs.cpp"
#include "be_visitor_operation/ami_handler_operation_ss.cpp"
-#include "be_visitor_operation/ami_handler_skeleton_cs.cpp"
#include "be_visitor_operation/ami_handler_argument_marshal.cpp"
#include "be_visitor_operation/ami_handler_thru_poa_collocated_sh.cpp"
#include "be_visitor_operation/ami_handler_thru_poa_collocated_ss.cpp"
#include "be_visitor_operation/ami_exception_holder_operation_ch.cpp"
-#include "be_visitor_operation/ami_exception_holder_operation_cs.cpp"
+
+#endif 0
ACE_RCSID(be, be_visitor_operation, "$Id$")
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp
index 800a13a6277..5ac8df947b5 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp
@@ -83,7 +83,7 @@ be_visitor_operation_ami_ch::visit_operation (be_operation *node)
// mapping. For these we grab a visitor that generates the
// parameter listing.
be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_AMI_OPERATION_ARGLIST_CH);
+ ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_CH);
be_visitor *visitor = tao_cg->make_visitor (&ctx);
if (!visitor)
{
@@ -94,7 +94,7 @@ be_visitor_operation_ami_ch::visit_operation (be_operation *node)
-1);
}
- if (node->accept (visitor) == -1)
+ if (node->hidden_operation ()->accept (visitor) == -1)
{
delete visitor;
ACE_ERROR_RETURN ((LM_ERROR,
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 3d1919139b8..1a2e16a6c65 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp
@@ -86,8 +86,7 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node)
// Generate the scope::operation name.
*os << parent->full_name ()
- << "::"
- << "sendc_";
+ << "::sendc_";
// check if we are an attribute node in disguise
if (this->ctx_->attribute ())
@@ -104,9 +103,9 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node)
// Generate the argument list with the appropriate mapping (same as
// in the header file)
ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_OPERATION_ARGLIST_CS);
+ ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_OTHERS);
visitor = tao_cg->make_visitor (&ctx);
- if ((!visitor) || (node->accept (visitor) == -1))
+ if ((!visitor) || (node->hidden_operation ()->accept (visitor) == -1))
{
delete visitor;
ACE_ERROR_RETURN ((LM_ERROR,
@@ -122,15 +121,7 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node)
// last argument - is always CORBA::Environment
*os << "{" << be_idt_nl;
- // Create the return type node. Return type is void.
- be_predefined_type *bt = 0;
- ACE_NEW_RETURN (bt,
- be_predefined_type (AST_PredefinedType::PT_void,
- new UTL_ScopedName
- (new Identifier
- ("void", 1, 0, I_FALSE), 0),
- 0),
- -1);
+ be_type *bt = be_type::narrow_from_decl (node->hidden_operation ()->return_type ());
// generate any pre stub info if and only if none of our parameters is of the
// native type
@@ -185,6 +176,7 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node)
}
*os << be_uidt_nl << "\n";
+#if 0
// do any pre marshal and invoke processing with return type. This
// includes allocating memory, initialization.
ctx = *this->ctx_;
@@ -199,24 +191,7 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node)
"codegen for retval pre invoke failed\n"),
-1);
}
-
-#if 0
- // @@ I am not sure whether we need this.
- // Do any pre marshal and invoke stuff with arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_OPERATION_ARG_PRE_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for argument pre invoke failed\n"),
- -1);
- }
#endif /* 0 */
-
// Generate the code for marshaling in the parameters and transmitting
// them.
if (this->gen_marshal_and_invoke (node, bt) == -1)
@@ -371,129 +346,6 @@ int
be_interpretive_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *node,
be_type *bt)
{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- // Generate the TAO_Param_Data table
- os->indent ();
- *os << "static const TAO_Param_Data ";
- // 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->flat_name () <<
- "_paramdata [] = " << be_nl;
- *os << "{\n";
- os->incr_indent ();
-
- // entry for the return type
- *os << "{" << bt->tc_name () << ", PARAM_RETURN, 0}";
- if (node->nmembers () > 0)
- *os << ",\n";
-
- // generate entries for the param data table for arguments
- if (this->visit_scope (node) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_cs::"
- "gen_pre_stub_info - "
- "visit scope failed\n"),
- -1);
- }
- *os << "\n";
- os->decr_indent ();
- *os << "}; // " << node->flat_name () << "_paramdata\n\n";
-
- // Check if this operation raises any exceptions. In that case, we must
- // generate a list of exception typecodes. This is not valid for
- // attributes
- if (!this->ctx_->attribute ())
- {
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) "
- "be_interpretive_visitor_operation_ami_cs::"
- "gen_pre_stub_info - "
- "Exceptionlist generation error\n"),
- -1);
- }
- }
-
- // now generate the calldata table
- os->indent ();
- *os << "static const TAO_Call_Data ";
- // 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->flat_name ()
- << "_calldata = " << be_nl
- << "{"
- << "\"";
- // 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->local_name () << "\", ";
-
- // are we oneway or two operation?
- if (node->flags () == AST_Operation::OP_oneway)
- {
- *os << "0, "; // for false
- }
- else
- {
- *os << "1, "; // for true
- }
- // insert the size of the paramdata table i.e., number of arguments + 1
- // for return type
- *os << (node->argument_count () + 1) << ", ";
-
- // insert the address of the paramdata table
- // first 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->flat_name () << "_paramdata, ";
-
- // insert exception list (if any) - node for attributes
- if (this->ctx_->attribute ())
- *os << "0, 0};\n\n";
- else
- {
- if (node->exceptions ())
- {
- *os << node->exceptions ()->length ()
- << ", _tao_" << node->flat_name () << "_exceptiondata};\n\n";
- }
- else
- *os << "0, 0};\n\n";
- }
return 0;
}
@@ -502,102 +354,6 @@ be_interpretive_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation
*node,
be_type *bt)
{
- TAO_OutStream *os = this->ctx_->stream ();
- be_visitor *visitor;
- be_visitor_context ctx;
-
- os->indent ();
- *os << "void* _tao_arguments["
- << node->argument_count () + 1 << "];" << be_nl
- << "const void** _tao_arg = ACE_const_cast (const void**,_tao_arguments);" << be_nl
- << "*_tao_arg = ";
-
- // pass the appropriate return value to docall
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
- *os << "; _tao_arg++;\n";
-
- // pass each argument to do_static_call
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for return var in do_static_call failed\n"),
- -1);
- }
-
- // call do_static_call with appropriate number of arguments
- os->indent ();
- *os << "istub->do_static_call (" << be_idt_nl
- << "ACE_TRY_ENV, " << be_nl
- << "&";
- // 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) // set
- *os << "_set_";
- else
- *os << "_get_";
- }
- *os << node->flat_name () << "_calldata," << be_nl
- << "_tao_arguments" << be_uidt_nl
- << ");\n";
-
- os->indent ();
- // check if there is an exception
- if (this->gen_check_exception (bt) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_interpretive_visitor_operation_ami_cs::"
- "gen_marshal_and_invoke - "
- "codegen for checking exception failed\n"),
- -1);
-
- }
-
- // do any post processing for the arguments
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for args post do_static_call failed\n"),
- -1);
- }
-
- // do any post processing for the retval
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_POST_INVOKE_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_ami_cs::"
- "visit_operation - "
- "codegen for return type post do_static_call failed\n"),
- -1);
- }
return 0;
}
@@ -706,7 +462,7 @@ be_compiled_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation *node
*os << "_get_";
}
- *os << node->local_name () << "_skel," << be_nl;
+ *os << node->local_name () << "_reply_stub," << be_nl;
delete full_name;
}
@@ -714,7 +470,7 @@ be_compiled_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation *node
// Next argument is the ami handler passed in for this method.
- *os << "_tao_ami_handler" << be_uidt_nl
+ *os << "ami_handler" << be_uidt_nl
<< ");" << be_uidt_nl;
@@ -752,10 +508,10 @@ be_compiled_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation *node
// Marshal each in and inout argument.
ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_OPERATION_ARG_INVOKE_CS);
+ ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS);
ctx.sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
+ if (!visitor || (node->hidden_operation ()->accept (visitor) == -1))
{
delete visitor;
ACE_ERROR_RETURN ((LM_ERROR,
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_ss.cpp
index ddf71b68d14..4f0f7526cb5 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_ss.cpp
@@ -195,7 +195,7 @@ be_visitor_operation_ami_handler_operation_ss::visit_operation (be_operation *no
// declare variables for arguments
ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DECL_CS);
+ ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_DECL_CS);
visitor = tao_cg->make_visitor (&ctx);
if (!visitor || (node->accept (visitor) == -1))
{
@@ -233,6 +233,7 @@ be_visitor_operation_ami_handler_operation_ss::visit_operation (be_operation *no
*os << "get_";
}
+#if 0
*os << node->local_name () << " (" << be_idt << "\n";
if (!this->void_return_type (bt))
@@ -240,12 +241,15 @@ be_visitor_operation_ami_handler_operation_ss::visit_operation (be_operation *no
os->indent ();
*os << "_tao_retval,\n";
}
+#endif /* 0 */
ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS);
+ ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_CS);
+#if 0
if (this->has_param_type (node, AST_Argument::dir_INOUT)
|| this->has_param_type (node, AST_Argument::dir_OUT))
ctx.sub_state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_HAS_ARGUMENTS);
+#endif /* 0 */
visitor = tao_cg->make_visitor (&ctx);
if (!visitor || (node->accept (visitor) == -1))
{
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
new file mode 100644
index 00000000000..b0535771619
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp
@@ -0,0 +1,87 @@
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// ami_handler_reply_stub_operation_ch.cpp
+//
+// = DESCRIPTION
+// Visitor generating code for AMI Handler call back operation in
+// the client header.
+//
+// = AUTHOR
+// Aniruddha Gokhale and Alexander Babu Arulanthu
+// <alex@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "idl.h"
+#include "idl_extern.h"
+#include "be.h"
+
+#include "be_visitor_operation.h"
+
+ACE_RCSID(be_visitor_operation, ami_handler_reply_stub_operation_ch, "$Id$")
+
+
+// ************************************************************
+// 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; // output stream
+
+ os = this->ctx_->stream ();
+ this->ctx_->node (node); // save the node
+
+
+ // Generate the corresponding static skeleton method for this
+ // operation only if there was no "native" type.
+ if (!node->has_native ())
+ {
+
+ // Indent.
+ os->indent ();
+
+ // Next line.
+ *os << 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) // set
+ *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_nl
+ << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
+ << "TAO_default_environment ());"
+ << be_uidt << be_uidt_nl
+ << be_uidt << "\n\n";
+ }
+ return 0;
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp
index 6195caea159..a9e4e62da0a 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp
@@ -92,7 +92,7 @@ be_visitor_operation_ami_handler_skeleton_cs::visit_operation (be_operation *nod
}
// Genereate scope name.
- *os << parent->compute_name ("AMI_", "Handler");
+ *os << parent->full_name ();
// Generate the operation name.
*os << "::";
@@ -105,7 +105,7 @@ be_visitor_operation_ami_handler_skeleton_cs::visit_operation (be_operation *nod
else
*os << "_get_";
}
- *os << node->local_name () << "_skel (" << be_idt_nl;
+ *os << node->local_name () << "_reply_stub (" << be_idt_nl;
// Generate the argument list.
*os << "TAO_InputCDR &_tao_in, " << be_nl
@@ -147,10 +147,10 @@ be_visitor_operation_ami_handler_skeleton_cs::visit_operation (be_operation *nod
os->indent();
*os << "// Retrieve Reply Handler object." << be_nl;
- *os << parent->compute_name ("AMI_", "Handler") << "_var "
+ *os << parent->full_name () << "_var "
<< "_tao_reply_handler_object =" << be_idt_nl;
- *os << parent->compute_name ("AMI_", "Handler");
+ *os << parent->full_name ();
*os << "::_narrow(_tao_reply_handler, ACE_TRY_ENV);" << be_uidt_nl;
// @@ Michael: We do not activate this right now,
@@ -164,25 +164,9 @@ be_visitor_operation_ami_handler_skeleton_cs::visit_operation (be_operation *nod
<< "{\n";
#endif
- // declare a return type variable
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (bt->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) ami_handler_skeleton_cs::"
- "visit_operation - "
- "codegen for return var decl failed\n"),
- -1);
- }
- delete visitor;
- visitor = 0;
-
// declare variables for arguments
ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DECL_CS);
+ ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_DECL_SS);
visitor = tao_cg->make_visitor (&ctx);
if (!visitor || (node->accept (visitor) == -1))
{
@@ -462,54 +446,26 @@ be_compiled_visitor_operation_ami_handler_skeleton_cs::
os->indent ();
*os << "// Demarshall all the arguments." << be_nl;
- if (!this->void_return_type (bt)
- || this->has_param_type (node, AST_Argument::dir_INOUT)
- || this->has_param_type (node, AST_Argument::dir_OUT))
+ if (this->has_param_type (node, AST_Argument::dir_IN))
{
*os << "if (!(\n" << be_idt << be_idt << be_idt;
- if (!this->void_return_type (bt))
+ // demarshal each in and inout argument
+ ctx = *this->ctx_;
+ ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS);
+ ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
+ visitor = tao_cg->make_visitor (&ctx);
+ if (!visitor || (node->accept (visitor) == -1))
{
- // demarshal the return val
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DEMARSHAL_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_handler_skeleton_cs::"
- "gen_demarshal_params - "
- "codegen for return var failed\n"),
- -1);
- }
delete visitor;
-
- if (this->has_param_type (node, AST_Argument::dir_INOUT) ||
- this->has_param_type (node, AST_Argument::dir_OUT))
- *os << " &&\n";
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_compiled_visitor_operation_ami_handler_skeleton_cs::"
+ "gen_marshal_params - "
+ "codegen for args failed\n"),
+ -1);
}
+ delete visitor;
- if (this->has_param_type (node, AST_Argument::dir_INOUT) ||
- this->has_param_type (node, AST_Argument::dir_OUT))
- {
- // demarshal each in and inout argument
- ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DEMARSHAL_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT);
- visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_handler_skeleton_cs::"
- "gen_marshal_params - "
- "codegen for args failed\n"),
- -1);
- }
- delete visitor;
- }
*os << be_uidt << be_uidt_nl
<< " ))" << be_nl
<< "ACE_THROW (CORBA::MARSHAL ());" << be_uidt_nl << be_nl;
@@ -533,19 +489,8 @@ be_compiled_visitor_operation_ami_handler_skeleton_cs::
*os << node->local_name () << " (" << be_idt_nl;
- // if we have a non-void return type then pass it as the first argument
- if (!this->void_return_type (bt))
- {
- *os << "_tao_retval,\n";
-
- }
-
ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS);
-
- if (this->has_param_type (node, AST_Argument::dir_INOUT)
- || this->has_param_type (node, AST_Argument::dir_OUT))
- ctx.sub_state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_HAS_ARGUMENTS);
+ ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS);
// generate the argument list containing the inout and inout arguments
visitor = tao_cg->make_visitor (&ctx);
if (!visitor || (node->accept (visitor) == -1))
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp b/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp
index 3605fb53887..d1838596ca8 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp
@@ -61,6 +61,7 @@ be_visitor_operation_argument::post_process (be_decl *bd)
if (!this->last_node (bd))
*os << ",\n";
break;
+#if 0
case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_COLLOCATED_ARG_UPCALL_SS:
case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS:
if (!this->last_inout_or_out_node (bd))
@@ -78,6 +79,8 @@ be_visitor_operation_argument::post_process (be_decl *bd)
*os << ",\n";
}
break;
+#endif /* 0 */
+
default:
break;
}
@@ -119,6 +122,7 @@ be_visitor_operation_argument::visit_operation (be_operation *node)
os->indent ();
*os << "ACE_TRY_ENV";
break;
+#if 0
case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_COLLOCATED_ARG_UPCALL_SS:
case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS:
// applicable only to these cases where the actual upcall is made
@@ -131,6 +135,7 @@ be_visitor_operation_argument::visit_operation (be_operation *node)
os->indent ();
*os << "ACE_TRY_ENV";
break;
+#endif /* 0 */
default:
break;
}
@@ -195,21 +200,12 @@ be_visitor_operation_argument::visit_argument (be_argument *node)
case TAO_CodeGen::TAO_OPERATION_ARG_DECL_SS:
ctx.state (TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS);
break;
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DECL_CS:
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS);
- break;
case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS:
ctx.state (TAO_CodeGen::TAO_ARGUMENT_DEMARSHAL_SS);
break;
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DEMARSHAL_CS:
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_DEMARSHAL_CS);
- break;
case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS:
ctx.state (TAO_CodeGen::TAO_ARGUMENT_MARSHAL_SS);
break;
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_MARSHAL_CS:
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_MARSHAL_CS);
- break;
case TAO_CodeGen::TAO_OPERATION_ARG_PRE_UPCALL_SS:
ctx.state (TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS);
break;
@@ -219,18 +215,29 @@ be_visitor_operation_argument::visit_argument (be_argument *node)
case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS:
ctx.state (TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS);
break;
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_COLLOCATED_ARG_UPCALL_SS:
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_COLLOCATED_UPCALL_SS);
- break;
- case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS:
- ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS);
- break;
case TAO_CodeGen::TAO_OPERATION_ARG_POST_UPCALL_SS:
ctx.state (TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS);
break;
case TAO_CodeGen::TAO_OPERATION_ARG_POST_MARSHAL_SS:
ctx.state (TAO_CodeGen::TAO_ARGUMENT_POST_MARSHAL_SS);
break;
+#if 0
+ case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DECL_CS:
+ ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS);
+ break;
+ case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DEMARSHAL_CS:
+ ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_DEMARSHAL_CS);
+ break;
+ case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_MARSHAL_CS:
+ ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_MARSHAL_CS);
+ break;
+ case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_COLLOCATED_ARG_UPCALL_SS:
+ ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_COLLOCATED_UPCALL_SS);
+ break;
+ case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS:
+ ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS);
+ break;
+#endif /* 0 */
default:
{
ACE_ERROR_RETURN ((LM_ERROR,
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp
index bacee09530d..d6aa162da31 100644
--- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp
@@ -49,12 +49,6 @@ be_visitor_typecode_decl::visit_type (be_type *node)
const char *prefix = 0;
const char *postfix = 0;
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DECL)
- {
- prefix = "AMI_";
- postfix = "Handler";
- }
-
if (node->is_nested ())
{
// we have a scoped name
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp
index 05c0af6a028..b817656fae4 100644
--- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp
@@ -146,10 +146,7 @@ be_visitor_typecode_defn::visit_type (be_type *node)
// Note that we just need the parameters here and hence we generate the
// encapsulation for the parameters.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- this->ctx_->sub_state (TAO_CodeGen::TAO_AMI_HANDLER_TC_DEFN_ENCAPSULATION);
- else
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
+ this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
if (node->accept (this) == -1)
{
@@ -165,10 +162,7 @@ be_visitor_typecode_defn::visit_type (be_type *node)
*os << "static CORBA::TypeCode _tc_TAO_tc_";
// Flat name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << flat_name;
- else
- *os << node->flat_name ();
+ *os << node->flat_name ();
*os << " (";
@@ -205,24 +199,15 @@ be_visitor_typecode_defn::visit_type (be_type *node)
*os << ", sizeof (_oc_";
// Flat name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << flat_name;
- else
- *os << node->flat_name ();
+ *os << node->flat_name ();
*os << "), (char *) &_oc_";
// Flat name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << flat_name;
- else
- *os << node->flat_name ();
+ *os << node->flat_name ();
// Name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << ", 0, sizeof (" << node->compute_name ("AMI_", "Handler") << "));" << be_nl;
- else
- *os << ", 0, sizeof (" << node->name () << "));" << be_nl;
+ *os << ", 0, sizeof (" << node->name () << "));" << be_nl;
// Is our enclosing scope a module? We need this check because for
// platforms that support namespaces, the typecode must be declared
@@ -242,18 +227,12 @@ be_visitor_typecode_defn::visit_type (be_type *node)
*os << "TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_";
// Local name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << "AMI_" << node->local_name () << "Handler";
- else
- *os << node->local_name ();
+ *os << node->local_name ();
*os << ", &_tc_TAO_tc_";
// Flat name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << flat_name;
- else
- *os << node->flat_name ();
+ *os << node->flat_name ();
*os << ")" << be_nl;
@@ -271,18 +250,12 @@ be_visitor_typecode_defn::visit_type (be_type *node)
*os << "CORBA::TypeCode_ptr ";
// Tc name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << node->tc_name ("AMI_", "Handler");
- else
- *os << node->tc_name ();
+ *os << node->tc_name ();
*os << " = &_tc_TAO_tc_";
// Flat name generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << flat_name;
- else
- *os << node->flat_name ();
+ *os << node->flat_name ();
*os << ";\n\n";
}
@@ -434,14 +407,12 @@ be_visitor_typecode_defn::visit_interface (be_interface *node)
{
switch (this->ctx_->sub_state ())
{
- case TAO_CodeGen::TAO_AMI_HANDLER_TC_DEFN_TYPECODE:
case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
return this->visit_type (node);
case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
return this->gen_typecode (node);
- case TAO_CodeGen::TAO_AMI_HANDLER_TC_DEFN_ENCAPSULATION:
case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
return this->gen_encapsulation (node);
@@ -2898,10 +2869,7 @@ be_visitor_typecode_defn::gen_repoID (be_decl *node)
*os << " // repository ID = ";
// repoID generation.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << repoID;
- else
- *os << node->repoID ();
+ *os << node->repoID ();
// size of the repoID filed
this->tc_offset_ += (2 * sizeof (ACE_CDR::ULong));
@@ -2910,17 +2878,11 @@ be_visitor_typecode_defn::gen_repoID (be_decl *node)
{
// Unoptimized case.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << (ACE_OS::strlen (repoID) + 1) << ", ";
- else
- *os << (ACE_OS::strlen (node->repoID ()) + 1) << ", ";
+ *os << (ACE_OS::strlen (node->repoID ()) + 1) << ", ";
ACE_CDR::ULong *arr, i, arrlen;
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- (void) this->tc_name2long (repoID, arr, arrlen);
- else
- (void) this->tc_name2long (node->repoID (), arr, arrlen);
+ (void) this->tc_name2long (node->repoID (), arr, arrlen);
for (i = 0; i < arrlen; i++)
{
@@ -2928,10 +2890,7 @@ be_visitor_typecode_defn::gen_repoID (be_decl *node)
}
// Comment.
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << " // repository ID = " << repoID;
- else
- *os << " // repository ID = " << node->repoID ();
+ *os << " // repository ID = " << node->repoID ();
// size of the repoID field
this->tc_offset_ += (arrlen + 1) * sizeof (ACE_CDR::ULong);
@@ -2963,26 +2922,15 @@ be_visitor_typecode_defn::gen_name (be_decl *node)
{
ACE_CDR::ULong *arr, i, arrlen;
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- {
- *os << (ACE_OS::strlen (node->compute_local_name ("AMI_", "Handler")->get_string ()) + 1) << ", ";
- (void) this->tc_name2long (node->compute_local_name ("AMI_", "Handler")->get_string (), arr, arrlen);
- }
- else
- {
- *os << (ACE_OS::strlen (node->local_name ()->get_string ()) + 1) << ", ";
- (void) this->tc_name2long (node->local_name ()->get_string (), arr, arrlen);
- }
+ *os << (ACE_OS::strlen (node->local_name ()->get_string ()) + 1) << ", ";
+ (void) this->tc_name2long (node->local_name ()->get_string (), arr, arrlen);
for (i = 0; i < arrlen; i++)
{
os->print ("ACE_NTOHL (0x%x), ", arr[i]);
}
- if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN)
- *os << " // name = " << node->compute_local_name ("AMI_", "Handler");
- else
- *os << " // name = " << node->local_name ();
+ *os << " // name = " << node->local_name ();
// size of the name field.
this->tc_offset_ += (arrlen + 1) * sizeof (ACE_CDR::ULong);
diff --git a/TAO/TAO_IDL/be_include/be_codegen.h b/TAO/TAO_IDL/be_include/be_codegen.h
index e5bfe254a4d..20923d7b5e4 100644
--- a/TAO/TAO_IDL/be_include/be_codegen.h
+++ b/TAO/TAO_IDL/be_include/be_codegen.h
@@ -365,6 +365,13 @@ public:
TAO_AMI_EXCEPTION_HOLDER_OPERATION_CH,
TAO_AMI_EXCEPTION_HOLDER_OPERATION_CS,
+ // AMI next generation states
+ TAO_AMI_SENDC_OPERATION_CH,
+ TAO_AMI_SENDC_OPERATION_CS,
+ TAO_AMI_EXCEP_HOLDER_RAISE_OPERATION_CS,
+ TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CH,
+ TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CS,
+
// Emitting code for root.
TAO_ROOT_CH,
TAO_ROOT_CI,
diff --git a/TAO/TAO_IDL/be_include/be_interface.h b/TAO/TAO_IDL/be_include/be_interface.h
index 210dfa7a453..7d0cb87eecb 100644
--- a/TAO/TAO_IDL/be_include/be_interface.h
+++ b/TAO/TAO_IDL/be_include/be_interface.h
@@ -32,7 +32,7 @@
class TAO_OutStream;
// Forward declaration of the strategy
-class be_interface_type_strategy;
+class be_interface_strategy;
/*
* BE_Interface
@@ -69,7 +69,7 @@ public:
~be_interface (void);
// dtor
- be_interface_type_strategy *set_strategy (be_interface_type_strategy *new_strategy);
+ be_interface_strategy *set_strategy (be_interface_strategy *new_strategy);
// Set the strategy to generate the names
// Methods, which access the strategy
@@ -268,7 +268,7 @@ private:
// am I directly or indirectly involved in a multiple inheritance. If the
// value is -1 => not computed yet.
- be_interface_type_strategy *strategy_;
+ be_interface_strategy *strategy_;
// Member for holding the strategy for generating names
};
diff --git a/TAO/TAO_IDL/be_include/be_interface_strategy.h b/TAO/TAO_IDL/be_include/be_interface_strategy.h
index 1eb19ea72b1..8514b9365d7 100644
--- a/TAO/TAO_IDL/be_include/be_interface_strategy.h
+++ b/TAO/TAO_IDL/be_include/be_interface_strategy.h
@@ -7,16 +7,13 @@
// TAO IDL
//
// = FILENAME
-// be_interface.h
+// be_interface_strategy.h
//
// = DESCRIPTION
-// Extension of class AST_Interface that provides additional means for C++
-// mapping of an interface.
+// Strategy to cover differences between operations, e.g.
+// the sendc_ and raise_ operations in the AMI spec.
//
// = AUTHOR
-// Copyright 1994-1995 by Sun Microsystems, Inc.
-// and
-// Aniruddha Gokhale,
// Michael Kircher
//
// ============================================================================
@@ -31,7 +28,7 @@ class be_interface;
// This class serves as a strategy base class for the differences
// in generating e.g. ami reply handlers.
-class be_interface_type_strategy
+class be_interface_strategy
{
public:
enum Strategy_Kind {
@@ -40,10 +37,10 @@ public:
AMI_EXCEPTION_HOLDER
};
- be_interface_type_strategy (be_interface *node,
+ be_interface_strategy (be_interface *node,
Strategy_Kind strategy_type);
- virtual ~be_interface_type_strategy ();
+ virtual ~be_interface_strategy ();
virtual const char *local_name (void) = 0;
// return the local name
@@ -125,11 +122,13 @@ protected:
// Current cached collocated name.
Strategy_Kind strategy_type_;
- //
+ // The type of strategy
};
+// @@ Michael: Deprecated due to new AMI design
+#if 0
class be_interface_prefix_suffix_strategy
- : public be_interface_type_strategy
+ : public be_interface_strategy
{
public:
// begin overridden methods.
@@ -170,42 +169,16 @@ protected:
const char *suffix_;
// The suffix to the interface
};
-
-
-class be_interface_ami_handler_strategy
- : public be_interface_prefix_suffix_strategy
-{
-public:
- // begin overridden methods.
- be_interface_ami_handler_strategy (be_interface *node);
-
- virtual ~be_interface_ami_handler_strategy ();
-
- // overridden methods.
- TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state);
-};
-
-
-class be_interface_ami_exception_holder_strategy
- : public be_interface_prefix_suffix_strategy
-{
-public:
- // begin overridden methods.
- be_interface_ami_exception_holder_strategy (be_interface *node);
-
- virtual ~be_interface_ami_exception_holder_strategy ();
-
- // overridden methods.
- TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state);
-};
+#endif /* 0 */
class be_interface_default_strategy
- : public be_interface_type_strategy
+ : public be_interface_strategy
{
public:
// begin overridden methods.
- be_interface_default_strategy (be_interface *node);
+ be_interface_default_strategy (be_interface *node,
+ Strategy_Kind strategy_type = DEFAULT);
virtual ~be_interface_default_strategy ();
@@ -230,8 +203,34 @@ public:
virtual const char *local_coll_name (int);
// retrieve the fully qualified collocated class name.
- TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state);
+ virtual TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state);
// end of overridden methods
};
+
+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 ();
+
+ // overridden methods.
+ TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state);
+};
+
+
+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 ();
+
+ // overridden methods.
+ virtual TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state);
+};
+
#endif // if !defined
diff --git a/TAO/TAO_IDL/be_include/be_operation.h b/TAO/TAO_IDL/be_include/be_operation.h
index 561aa99a63d..275ecffac87 100644
--- a/TAO/TAO_IDL/be_include/be_operation.h
+++ b/TAO/TAO_IDL/be_include/be_operation.h
@@ -25,6 +25,7 @@
#include "be_scope.h"
#include "be_decl.h"
#include "ast_operation.h"
+#include "be_operation_strategy.h"
class AST_Type;
class UTL_StrList;
@@ -48,6 +49,9 @@ public:
UTL_StrList *p);
// constructor
+ ~be_operation ();
+ // destructor
+
int void_return_type ();
// Returns 1 if the operation has a void return type.
@@ -65,6 +69,20 @@ public:
// Visiting
virtual int accept (be_visitor *visitor);
+ be_operation_strategy *set_strategy (be_operation_strategy *new_strategy);
+
+ TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state,
+ int is_extra_state = 0);
+ // decide on the next state
+
+ int has_extra_code_generation (TAO_CodeGen::CG_STATE current_state);
+ // returns true if we have to genrate extra code.
+
+ be_operation *hidden_operation ();
+ // returns the operation node which contains extra data,
+ // e.g. special marshalling information, this was needed for the
+ // AMI implementationb
+
// Narrowing
DEF_NARROW_METHODS3 (be_operation, AST_Operation, be_scope, be_decl);
DEF_NARROW_FROM_DECL (be_operation);
@@ -83,6 +101,11 @@ protected:
int has_native_;
// Is any argument of type native.
+
+ be_operation_strategy *strategy_;
+ // Member for holding the strategy for covering
+ // differences between various operations, e.g. sendc_, raise_
+ // operations in the AMI spec.
};
#endif
diff --git a/TAO/TAO_IDL/be_include/be_operation_strategy.h b/TAO/TAO_IDL/be_include/be_operation_strategy.h
new file mode 100644
index 00000000000..b9cf7a7d8fb
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_operation_strategy.h
@@ -0,0 +1,150 @@
+/* -*- c++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// be_operation_strategy.h
+//
+// = DESCRIPTION
+// 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 strategeis
+
+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 ();
+
+ int strategy_type ();
+ // Return the type of the strategy.
+
+ virtual TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state,
+ int is_extra_state = 0) = 0;
+ // Change the sate if necessary
+
+ virtual int has_extra_code_generation (TAO_CodeGen::CG_STATE current_state);
+ // returns true if we have to genrate extra code.
+
+ virtual be_operation *hidden_operation ();
+ // returns the operation node which contains extra data,
+
+protected:
+
+ be_operation *node_;
+ // The node we strategize
+
+ Strategy_Kind strategy_type_;
+ // the type of strategy
+};
+
+
+
+// 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 ();
+
+ // overridden methods.
+ TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state,
+ int is_extra_state = 0);
+
+};
+
+
+// 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 ();
+
+ // 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);
+ // returns true if we have to genrate extra code.
+};
+
+
+// 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 *hidden_operation);
+
+ virtual ~be_operation_ami_sendc_strategy ();
+
+ // 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);
+ // returns true if we have to genrate extra code.
+
+ virtual be_operation *hidden_operation ();
+ // returns the operation node which contains extra data,
+
+private:
+ be_operation *hidden_operation_;
+};
+
+
+// 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);
+};
+
+#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 2ec70dce216..e5d6c41a79c 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
@@ -76,7 +76,8 @@ public:
// visit a root
private:
- be_interface *create_reply_handler (be_interface *node);
+ be_interface *create_reply_handler (be_interface *node,
+ be_valuetype *excep_holder);
// create the reply handler interface
be_valuetype *create_exception_holder (be_interface *node);
@@ -85,10 +86,13 @@ private:
be_operation *create_sendc_operation (be_operation *node);
// create a method with "sendc_" prepended
- be_operation *create_excep_operation (be_operation *node);
+ be_operation *create_excep_operation (be_operation *node,
+ be_interface *reply_handler,
+ be_valuetype *excep_holder);
// create a method with "_excep" appended
- be_operation *create_reply_handler_operation (be_operation *node);
+ be_operation *create_reply_handler_operation (be_operation *node,
+ be_interface *reply_handler);
// create an operation with only the OUT and INOUT arguments
int visit_scope (be_scope *node);
diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation.h b/TAO/TAO_IDL/be_include/be_visitor_operation.h
index 2ac01d6c6a2..e3b78903b92 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_operation.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_operation.h
@@ -57,16 +57,21 @@
#include "be_visitor_operation/rettype_pre_invoke_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_skeleton_cs.h"
+#include "be_visitor_operation/ami_exception_holder_operation_cs.h"
+
+#if 0
#include "be_visitor_operation/ami_arglist.h"
#include "be_visitor_operation/ami_handler_arglist.h"
#include "be_visitor_operation/ami_handler_operation_ch.h"
#include "be_visitor_operation/ami_handler_operation_cs.h"
#include "be_visitor_operation/ami_handler_operation_ss.h"
-#include "be_visitor_operation/ami_handler_skeleton_cs.h"
#include "be_visitor_operation/ami_handler_argument_marshal.h"
#include "be_visitor_operation/ami_handler_thru_poa_collocated_sh.h"
#include "be_visitor_operation/ami_handler_thru_poa_collocated_ss.h"
#include "be_visitor_operation/ami_exception_holder_operation_ch.h"
-#include "be_visitor_operation/ami_exception_holder_operation_cs.h"
+
+#endif /* 0 */
#endif // TAO_BE_VISITOR_OPERATION_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
new file mode 100644
index 00000000000..ce80109e16f
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_reply_stub_operation_ch.h
@@ -0,0 +1,52 @@
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// ami_handler_reply_stub_operation_ch.h
+//
+// = DESCRIPTION
+// 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 : public be_visitor_operation
+{
+ //
+ // = TITLE
+ // be_visitor_ami_handler_reply_stub_operation_ch
+ //
+ // = DESCRIPTION
+ // This is a concrete visitor to generate the server header for operation
+ //
+ //
+public:
+ be_visitor_operation_ami_handler_reply_stub_operation_ch (be_visitor_context *ctx);
+ // constructor
+
+ ~be_visitor_operation_ami_handler_reply_stub_operation_ch (void);
+ // destructor
+
+ virtual int visit_operation (be_operation *node);
+ // visit operation.
+
+};
+
+#endif /* _BE_VISITOR_OPERATION_ami_handler_reply_stub_operation_ch_H_ */
diff --git a/TAO/TAO_IDL/include/ast_module.h b/TAO/TAO_IDL/include/ast_module.h
index fbefe374c73..bf55c9f5cb0 100644
--- a/TAO/TAO_IDL/include/ast_module.h
+++ b/TAO/TAO_IDL/include/ast_module.h
@@ -102,7 +102,7 @@ public:
idl_bool has_nested_valuetype ();
// Allows adding an interface to a later point
- int be_add_interface (AST_Interface *i);
+ int be_add_interface (AST_Interface *i, AST_Interface *ix = 0);
private:
friend void fe_populate(AST_Module *m);
@@ -112,6 +112,7 @@ private:
virtual AST_PredefinedType *fe_add_predefined_type(AST_PredefinedType *t);
virtual AST_Module *fe_add_module(AST_Module *m);
+ // Add the current interface i before interface ix
virtual AST_Interface *fe_add_interface(AST_Interface *i);
virtual AST_InterfaceFwd *fe_add_interface_fwd(AST_InterfaceFwd *i);
virtual AST_Constant *fe_add_constant(AST_Constant *c);
diff --git a/TAO/TAO_IDL/include/utl_scope.h b/TAO/TAO_IDL/include/utl_scope.h
index 1d016d6e1ec..3e60aae0b48 100644
--- a/TAO/TAO_IDL/include/utl_scope.h
+++ b/TAO/TAO_IDL/include/utl_scope.h
@@ -190,14 +190,18 @@ protected:
// defined elsewhere were referenced in this scope
// Add to decls. Node represents a local declaration
- void add_to_scope(AST_Decl *e);
+ // The new decl e is inserted before ex if ex is not 0
+ void add_to_scope(AST_Decl *e,
+ AST_Decl *ex = 0);
// Add to local types. Node represents a local manifest type
void add_to_local_types(AST_Decl *e);
// Add to referenced nodes set.
+ // If pos is not -1 it will be inserted at the the given position
void add_to_referenced(AST_Decl *e,
- idl_bool recursive);
+ idl_bool recursive,
+ AST_Decl *ex = 0);
// Has this node been referenced here already?
idl_bool referenced(AST_Decl *e);
diff --git a/TAO/TAO_IDL/tao_idl.dsp b/TAO/TAO_IDL/tao_idl.dsp
index 60a59920e13..d85eaae6ee2 100644
--- a/TAO/TAO_IDL/tao_idl.dsp
+++ b/TAO/TAO_IDL/tao_idl.dsp
@@ -921,6 +921,21 @@ SOURCE=.\be\be_operation.cpp
# End Source File
# Begin Source File
+SOURCE=.\be\be_operation_strategy.cpp
+
+!IF "$(CFG)" == "TAO_IDL Compiler - Win32 Release"
+
+!ELSEIF "$(CFG)" == "TAO_IDL Compiler - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "TAO_IDL Compiler - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "TAO_IDL Compiler - Win32 Alpha Release"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\be\be_predefined_type.cpp
!IF "$(CFG)" == "TAO_IDL Compiler - Win32 Release"
@@ -2204,10 +2219,6 @@ SOURCE=.\be_include\be_interface_fwd.h
# End Source File
# Begin Source File
-SOURCE=.\be_include\be_interface_strategy.h
-# End Source File
-# Begin Source File
-
SOURCE=.\be_include\be_module.h
# End Source File
# Begin Source File
@@ -2220,6 +2231,10 @@ SOURCE=.\be_include\be_operation.h
# End Source File
# Begin Source File
+SOURCE=.\be_include\be_operation_strategy.h
+# End Source File
+# Begin Source File
+
SOURCE=.\be_include\be_predefined_type.h
# End Source File
# Begin Source File
diff --git a/TAO/TAO_IDL/tao_idl_static.dsp b/TAO/TAO_IDL/tao_idl_static.dsp
index 91d7b59a462..1d08e7be622 100644
--- a/TAO/TAO_IDL/tao_idl_static.dsp
+++ b/TAO/TAO_IDL/tao_idl_static.dsp
@@ -294,6 +294,10 @@ SOURCE=.\be\be_operation.cpp
# End Source File
# Begin Source File
+SOURCE=.\be\be_operation_strategy.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\be\be_predefined_type.cpp
# End Source File
# Begin Source File
@@ -790,6 +794,10 @@ SOURCE=.\be_include\be_operation.h
# End Source File
# Begin Source File
+SOURCE=.\be_include\be_operation_strategy.h
+# End Source File
+# Begin Source File
+
SOURCE=.\be_include\be_predefined_type.h
# End Source File
# Begin Source File
diff --git a/TAO/TAO_IDL/util/utl_scope.cpp b/TAO/TAO_IDL/util/utl_scope.cpp
index f49895970f7..08bcb301000 100644
--- a/TAO/TAO_IDL/util/utl_scope.cpp
+++ b/TAO/TAO_IDL/util/utl_scope.cpp
@@ -1161,7 +1161,7 @@ UTL_Scope::lookup_by_name (UTL_ScopedName *e,
// Add a node to set of nodes referenced in this scope
void
-UTL_Scope::add_to_referenced(AST_Decl *e, idl_bool recursive)
+UTL_Scope::add_to_referenced(AST_Decl *e, idl_bool recursive, AST_Decl *ex)
{
UTL_Scope *s;
AST_Decl **tmp;
@@ -1199,7 +1199,23 @@ UTL_Scope::add_to_referenced(AST_Decl *e, idl_bool recursive)
}
// Insert new reference
- pd_referenced[pd_referenced_used++] = e;
+ if (ex == 0)
+ pd_referenced[pd_referenced_used++] = e;
+ else if (referenced (ex))
+ {
+ for (i = ++pd_referenced_used; i > 1; i--)
+ {
+ pd_referenced[i] = pd_referenced[i-1];
+ if (pd_referenced[i-1] == ex)
+ {
+ pd_referenced[i-1] = e;
+ break;
+ }
+ }
+ }
+
+
+
// Now, if recursive is specified and "this" is not a common ancestor
// of the referencing scope and the scope of definition of "e" then
@@ -1213,7 +1229,7 @@ UTL_Scope::add_to_referenced(AST_Decl *e, idl_bool recursive)
// Add a node to set of nodes declared in this scope
void
-UTL_Scope::add_to_scope(AST_Decl *e)
+UTL_Scope::add_to_scope(AST_Decl *e, AST_Decl *ex)
{
if (e == NULL) return;
@@ -1282,8 +1298,22 @@ UTL_Scope::add_to_scope(AST_Decl *e)
this->pd_decls = tmp;
}
+
// Insert new decl
- pd_decls[pd_decls_used++] = e;
+ if (ex == 0)
+ pd_decls[pd_decls_used++] = e;
+ else
+ {
+ for (i = ++pd_decls_used; i > 1; i--)
+ {
+ pd_decls[i] = pd_decls[i-1];
+ if (pd_decls[i-1] == ex)
+ {
+ pd_decls[i-1] = e;
+ break;
+ }
+ }
+ }
}
// Add a node to set of nodes representing manifest types defined in this scope