summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-08-19 23:46:46 +0000
committerkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-08-19 23:46:46 +0000
commitd9618fb6a9e3aa3f968057c95d551f9f9b7f0142 (patch)
treeef82e5efc319926bd38a71b12350319a83254c7b
parente401c3f912e67f38bca2b8c4fdb3581d7785019c (diff)
downloadATCD-d9618fb6a9e3aa3f968057c95d551f9f9b7f0142.tar.gz
solved some Portable Interceptor bugs
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/interceptors_arglist.cpp16
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp3
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/interceptors_result.cpp301
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/interceptors_sh.cpp1
5 files changed, 315 insertions, 10 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_arglist.cpp
index eaf410fc2e4..69911d26df6 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_arglist.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_arglist.cpp
@@ -69,7 +69,7 @@ be_visitor_operation_interceptors_arglist::visit_operation (be_operation *node)
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARG_INFO_CS:
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_PARAMLIST:
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARG_INFO_SS:
- case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT:
+ // case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT:
break;
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_CS:
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_SS:
@@ -104,7 +104,7 @@ be_visitor_operation_interceptors_arglist::visit_operation (be_operation *node)
*os << "CORBA::Environment &ACE_TRY_ENV";
*os << " = " << be_idt_nl
<< "TAO_default_environment ()"
- << be_uidt_nl << ");\n\n";
+ << be_uidt_nl ;//<< ");\n\n";
break;
}
default:
@@ -165,7 +165,7 @@ be_visitor_operation_interceptors_arglist::pre_process (be_decl *bd)
}
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_CH:
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_PARAMLIST:
- case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT:
+ // case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT:
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_SH:
break;
default:
@@ -244,9 +244,9 @@ be_visitor_operation_interceptors_arglist::visit_argument (be_argument *node)
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_PARAMLIST:
ctx.state (TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_PARAMLIST);
break;
- case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_RESULT);
- break;
+ // case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT:
+ //ctx.state (TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_RESULT);
+ // break;
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_SH:
ctx.state (TAO_CodeGen::TAO_ARGUMENT_ARGLIST_SH);
break;
@@ -319,8 +319,8 @@ be_visitor_operation_interceptors_arglist::post_process (be_decl *bd)
os->indent ();
switch (this->ctx_->state ())
{
- case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT:
- break;
+ // case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT:
+ // break;
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_CH:
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_SH:
case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_PARAMLIST:
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp
index d64d72c3679..251aec2f3d3 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp
@@ -120,7 +120,7 @@ be_visitor_operation_interceptors_ch::visit_operation (be_operation *node)
//generate the argument list with the appropriate mapping. For these
// we grab a visitor that generates the parameter listing
-
+
ctx = *this->ctx_;
ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_CH);
visitor = tao_cg->make_visitor (&ctx);
@@ -143,6 +143,7 @@ be_visitor_operation_interceptors_ch::visit_operation (be_operation *node)
-1);
}
delete visitor;
+ *os << ");\n\n";
os->indent ();
// Here I still need to generate the other methods + private args
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp
index 8b49a506235..e9353a82dc9 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp
@@ -364,11 +364,13 @@ be_visitor_operation_interceptors_cs::visit_operation (be_operation *node)
}
else
{
+ // bt = be_type::narrow_from_decl (node->arguments ()->return_type ());
// Generate the insertion of result into Any.
ctx = *this->ctx_;
ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT);
visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
+ // if (!visitor || (node->accept (visitor) == -1))
+ if (!visitor || (bt->accept (visitor) == -1))
{
delete visitor;
ACE_ERROR_RETURN ((LM_ERROR,
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_result.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_result.cpp
new file mode 100644
index 00000000000..6bd6f817f51
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_result.cpp
@@ -0,0 +1,301 @@
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// interceptors_result.cpp
+//
+// = DESCRIPTION
+// Visitor that generates the Dyanmic::ParameterList
+//
+// = AUTHOR
+// Kirthika Parameswaran <kirthika@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "idl.h"
+#include "be.h"
+#include "be_visitor_operation.h"
+
+ACE_RCSID(be_visitor_argument, interceptors_result, "$Id$")
+
+
+// ************************************************************
+// be_visitor_operation_interceptors_result for generating the result as
+// stored in the request info for interceptors
+// ************************************************************
+
+be_visitor_operation_interceptors_result::be_visitor_operation_interceptors_result (be_visitor_context *ctx)
+ : be_visitor_decl (ctx)
+{
+}
+
+be_visitor_operation_interceptors_result::~be_visitor_operation_interceptors_result (void)
+{
+}
+
+int be_visitor_operation_interceptors_result::visit_array (be_array *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ // if the current type is an alias, use that
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
+ os->indent ();
+ *os << bt->name () << "_forany _tao_forany_result"
+ << " (this->result_);" << be_nl
+ << "this->result_val_ <<= _tao_forany_result;"<< be_nl;
+ return 0;
+}
+
+int be_visitor_operation_interceptors_result::visit_enum (be_enum *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ // if the current type is an alias, use that
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
+ os->indent ();
+ *os << "this->result_val_ <<= this->result_;";
+
+ return 0;
+}
+
+int be_visitor_operation_interceptors_result::visit_interface (be_interface *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ // if the current type is an alias, use that
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
+ os->indent ();
+ *os << "this->result_val_ <<= this->result_;";
+
+ return 0;
+}
+int be_visitor_operation_interceptors_result::visit_interface_fwd (be_interface_fwd *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ // if the current type is an alias, use that
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
+ os->indent ();
+ *os << "this->result_val_ <<= this->result_;";
+
+ return 0;
+
+}
+#ifdef IDL_HAS_VALUETYPE
+
+int be_visitor_operation_interceptors_result::visit_valuetype (be_valuetype *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ // if the current type is an alias, use that
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
+ os->indent ();
+ *os << "this->result_val_ <<= this->result_;";
+
+ return 0;
+
+}
+
+int be_visitor_operation_interceptors_result::visit_valuetype_fwd (be_valuetype_fwd *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ // if the current type is an alias, use that
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
+ os->indent ();
+ *os << "this->result_val_ <<= this->result_;";
+
+ return 0;
+
+}
+
+#endif /* IDL_HAS_VALUETYPE */
+
+int
+be_visitor_operation_interceptors_result::visit_predefined_type (be_predefined_type *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ // if the current type is an alias, use that
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
+ os->indent ();
+ *os << "this->result_val_ <<= ";
+ switch (node->pt ())
+ {
+ case AST_PredefinedType::PT_boolean:
+ *os << "CORBA::Any::from_boolean (this->result_);" << be_nl;
+ break;
+ case AST_PredefinedType::PT_char:
+ *os << "CORBA::Any::from_char (this->result_);"<<be_nl;
+ break;
+ case AST_PredefinedType::PT_wchar:
+ *os << "CORBA::Any::from_wchar (this->result_);"<<be_nl;
+ break;
+ case AST_PredefinedType::PT_octet:
+ *os << "CORBA::Any::from_octet (this->result_);"<<be_nl;
+ break;
+ case AST_PredefinedType::PT_pseudo:
+ case AST_PredefinedType::PT_any:
+ case AST_PredefinedType::PT_long:
+ case AST_PredefinedType::PT_ulong:
+ case AST_PredefinedType::PT_longlong:
+ case AST_PredefinedType::PT_ulonglong:
+ case AST_PredefinedType::PT_short:
+ case AST_PredefinedType::PT_ushort:
+ case AST_PredefinedType::PT_float:
+ case AST_PredefinedType::PT_double:
+ case AST_PredefinedType::PT_longdouble:
+ *os << "this->result_;"<<be_nl;
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_operation_interceptors_result::"
+ "visit_predefined_type - "
+ "Bad predefined type\n"),
+ -1);
+
+ }
+ return 0;
+
+}
+
+int be_visitor_operation_interceptors_result::visit_sequence (be_sequence *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ // if the current type is an alias, use that
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
+ os->indent ();
+ *os << "this->result_val_ <<= this->result_;";
+
+ return 0;
+
+}
+
+int
+be_visitor_operation_interceptors_result::visit_string (be_string *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ os->indent ();
+ *os << "this->result_val_ <<= ";
+ // we need to make a distinction between bounded and unbounded strings
+ if (node->max_size ()->ev ()->u.ulval != 0)
+ {
+ // bounded strings
+ if (node->width () == (long) sizeof (char))
+ {
+ *os << "CORBA::Any::from_string ((char *)";
+ }
+ else
+ {
+ *os << "CORBA::Any::from_wstring ((CORBA::WChar *)";
+ }
+ *os <<"this->result_, "
+ << node->max_size ()->ev ()->u.ulval
+ << ");";
+ }
+ else
+ *os << "this->result_; ";
+return 0;
+}
+
+int be_visitor_operation_interceptors_result::visit_structure (be_structure *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ // if the current type is an alias, use that
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
+ os->indent ();
+ *os << "this->result_val_ <<= this->result_;";
+
+ return 0;
+
+}
+
+int be_visitor_operation_interceptors_result::visit_union (be_union *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ // if the current type is an alias, use that
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
+ os->indent ();
+ *os << "this->result_val_ <<= this->result_;";
+
+ return 0;
+
+}
+
+int be_visitor_operation_interceptors_result::visit_typedef (be_typedef *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ // if the current type is an alias, use that
+ be_type *bt;
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
+ os->indent ();
+ *os << "this->result_val_ <<= this->result_;";
+
+ return 0;
+
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_sh.cpp
index 750a8d37096..95ef1977742 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_sh.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_sh.cpp
@@ -143,6 +143,7 @@ be_visitor_operation_interceptors_sh::visit_operation (be_operation *node)
-1);
}
delete visitor;
+ *os << ");\n\n";
os->indent ();
// Here I still need to generate the other methods + private args