summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormayur <mayur@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-01-18 21:33:06 +0000
committermayur <mayur@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-01-18 21:33:06 +0000
commitc4a174cdfdd80cd7b15f4fcc0f27dcec3eeef1ba (patch)
tree4f328f1e704c50403165a45d6dffe9407f774fdd
parentda8dbd37970a40d75438af1f2c4bdb918c6d6169 (diff)
downloadATCD-c4a174cdfdd80cd7b15f4fcc0f27dcec3eeef1ba.tar.gz
Fri Jan 18 13:19:00 2002 Mayur Deshpande <mayur@ics.uci.edu>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a12
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp85
-rw-r--r--TAO/tao/TAO_AMH_Response_Handler.cpp6
-rw-r--r--TAO/tao/TAO_AMH_Response_Handler.h2
5 files changed, 49 insertions, 58 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index c353022167e..4506ec5b348 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,15 @@
+Fri Jan 18 13:19:00 2002 Mayur Deshpande <mayur@ics.uci.edu>
+
+ * TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp:
+ * TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp:
+ * tao/TAO_AMH_Response_handler.h:
+ * tao/TAO_AMH_Response_handler.cpp:
+
+ Added code that now generates AMH-RH code for operation
+ in skeleton-source file. Changed 'tao_out' CDR stream in
+ TAO_AMH_Response_Handler so that the variable names of the
+ generated IDL code and that in the tao orb_core files match.
+
Fri Jan 18 13:47:26 2002 Jeff Parsons <parsons@cs.wustl.edu>
* TAO_IDL/be_include/be_visitor_valuetype.h:
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp
index d75ce480207..91946ff0f17 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp
@@ -117,7 +117,7 @@ be_visitor_amh_rh_operation_sh::visit_operation (be_operation *node)
delete visitor;
- *os << be_nl;
+ *os << ";" << be_nl;
return 0;
}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp
index 5bac20cfb3f..cf792b4bbf8 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp
@@ -96,9 +96,9 @@ be_visitor_amh_rh_operation_ss::visit_operation (be_operation *node)
// Step 3: Generate actual code for the method
*os << "{" << be_idt_nl
- << "init_reply ();" << be_nl;
+ << "init_reply ();" << be_nl << be_nl;
- //marshal_params (node);
+ marshal_params (node);
*os << "send_reply ();" << be_uidt_nl
<< "}" << be_nl;
@@ -111,58 +111,39 @@ be_visitor_amh_rh_operation_ss::visit_operation (be_operation *node)
int
be_visitor_amh_rh_operation_ss::marshal_params (be_operation *node)
{
- if (node->nmembers () > 0)
+ TAO_OutStream *os = this->ctx_->stream ();
+ be_visitor *visitor;
+ be_visitor_context ctx;
+
+ // Now make sure that we have some in and inout parameters. Otherwise, there
+ // is nothing to be marshaled out.
+ if (this->has_param_type (node, AST_Argument::dir_IN) ||
+ this->has_param_type (node, AST_Argument::dir_INOUT))
{
- // Initialize an iterator to iterate over our scope.
- UTL_ScopeActiveIterator *si;
- ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (node,
- UTL_Scope::IK_decls),
- -1);
-
- while (!si->is_done ())
+ os->indent ();
+
+ // marshal the in and inout arguments
+ *os << "if (!(\n" << be_idt;
+
+ // Marshal each in and inout argument.
+ ctx = *this->ctx_;
+ 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))
{
- AST_Decl *d = si->item ();
-
- if (d == 0)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "bad node in this scope\n"),
- -1);
-
- }
- be_decl *decl = be_decl::narrow_from_decl (d);
-
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_INVOKE_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_amh_sh::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (decl->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_sh::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
delete visitor;
- si->next ();
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_compiled_visitor_operation_ss::"
+ "gen_demarshal_params - "
+ "codegen for demarshal failed\n"),
+ -1);
}
- }
-
- return 1;
+
+ *os << be_uidt_nl << "))"
+ << "ACE_THROW (CORBA::MARSHAL());" << be_nl << be_nl;
+ };
+
+ return 0;
}
diff --git a/TAO/tao/TAO_AMH_Response_Handler.cpp b/TAO/tao/TAO_AMH_Response_Handler.cpp
index fafe21922d4..0da44411033 100644
--- a/TAO/tao/TAO_AMH_Response_Handler.cpp
+++ b/TAO/tao/TAO_AMH_Response_Handler.cpp
@@ -16,14 +16,12 @@ TAO_AMH_Response_Handler::TAO_AMH_Response_Handler ()
exception_type_ (TAO_GIOP_NO_EXCEPTION),
once_only_(0)
{
- tao_out_ = new TAO_OutputCDR();
}
TAO_AMH_Response_Handler::~TAO_AMH_Response_Handler (void)
{
// release the transport
TAO_Transport::release (transport_);
- delete tao_out_;
}
@@ -91,7 +89,7 @@ TAO_AMH_Response_Handler::init_reply (void)
}
ACE_DEBUG ((LM_DEBUG, ACE_TEXT("\tgenerating reply header ... \n")));
- this->mesg_base_->generate_reply_header (*(this->tao_out_),
+ this->mesg_base_->generate_reply_header (this->_tao_out_,
reply_params);
ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Done Initialising RH. \n")));
}
@@ -110,7 +108,7 @@ void TAO_AMH_Response_Handler::send_reply (void)
ACE_DEBUG ((LM_DEBUG, ACE_TEXT("TAO_RH sending message ... \n")));
// Send the message.
- int result = this->transport_->send_message (*this->tao_out_);
+ int result = this->transport_->send_message (this->_tao_out_);
if (result == -1)
{
diff --git a/TAO/tao/TAO_AMH_Response_Handler.h b/TAO/tao/TAO_AMH_Response_Handler.h
index 3dbb6291c50..8293a80d7f8 100644
--- a/TAO/tao/TAO_AMH_Response_Handler.h
+++ b/TAO/tao/TAO_AMH_Response_Handler.h
@@ -58,7 +58,7 @@ public:
// @@ Mayur please do no use public fields unless you have a very
// good reason for it... better to use an accessor...
- TAO_OutputCDR *tao_out_;
+ TAO_OutputCDR _tao_out_;
private: