From e0bbcab4c20c70cbc52a600139c80bb9e93157d7 Mon Sep 17 00:00:00 2001 From: kolpackov Date: Mon, 18 Mar 2002 15:50:27 +0000 Subject: ChangeLogTag Mon Mar 18 15:34:26 2002 Boris Kolpackov --- TAO/ChangeLogs/ChangeLog-02a | 11 ++++- TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp | 54 +++++++++++++++++++++++ TAO/TAO_IDL/be/be_visitor_operation/operation.cpp | 16 +++++-- 3 files changed, 76 insertions(+), 5 deletions(-) diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index b62457ee0df..9a11d85c6b4 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,8 +1,17 @@ +Mon Mar 18 15:34:26 2002 Boris Kolpackov + + * TAO_IDL/be_include/be_visitor_field/cdr_op_ci.h: + * TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp: + * TAO_IDL/be/be_visitor_operation/operation.cpp: + Valuetype-related minor bug fixes. + + + Sat Mar 16 09:07:20 2002 Balachandran Natarajan * TAOACE.dsw: Added Messaging DLL as a dependency to the Event_Service and add TAO DLL as a dependency to the Messaging - DLL. + DLL. Sat Mar 16 11:35:12 2002 Johnny Willemsen diff --git a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp index 6761af03dca..6bba94f290c 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp @@ -774,6 +774,60 @@ be_visitor_field_cdr_op_ci::visit_union (be_union *node) return 0; } +// Visit structure type. +int +be_visitor_field_cdr_op_ci::visit_valuetype (be_valuetype *node) +{ + TAO_OutStream *os = this->ctx_->stream (); + + // retrieve the field node. + be_field *f = this->ctx_->be_node_as_field (); + + if (f == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_field_cdr_op_ci::" + "visit_valuetype - " + "cannot retrieve field node\n"), + -1); + } + + // Check what is the code generations substate. Are we generating code for + // the in/out operators for our parent or for us? + switch (this->ctx_->sub_state ()) + { + case TAO_CodeGen::TAO_CDR_INPUT: + *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())"; + return 0; + case TAO_CodeGen::TAO_CDR_OUTPUT: + *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())"; + return 0; + case TAO_CodeGen::TAO_CDR_SCOPE: + // Proceed further. + break; + default: + // Error. + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_field_cdr_op_ci::" + "visit_structure - " + "bad sub state\n"), + -1); + } + + if (node->node_type () != AST_Decl::NT_typedef // Not a typedef. + && node->is_child (this->ctx_->scope ())) // Node is defined inside + // the structure. + { + // Valuetype cannot be declared inside any structured type + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_field_cdr_op_ci::" + "visit_valuetype - logic error. Please report.\n"), + -1); + } + + return 0; +} + // **************************************************************** be_visitor_cdr_op_field_decl::be_visitor_cdr_op_field_decl ( diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp index adb5ebac7dd..4f9ddb4de1d 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp @@ -115,8 +115,16 @@ be_visitor_operation::gen_throw_spec (be_operation *node) throw_spec_close = "))"; } - *os << be_idt_nl << throw_spec_open - << be_idt_nl << "CORBA::SystemException"; + *os << be_idt_nl << throw_spec_open; + + be_decl *scope = this->ctx_->scope (); + be_interface *iface = be_interface::narrow_from_decl (scope); + + // Check if this is IF and it's not VT. + if (!(iface != 0 && iface->is_valuetype ())) + { + *os << be_idt_nl << "CORBA::SystemException"; + } if (node->exceptions ()) { @@ -134,7 +142,7 @@ be_visitor_operation::gen_throw_spec (be_operation *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_operation" "gen_throw_spec - " - "bad exception node\n"), + "bad exception node\n"), -1); } @@ -209,7 +217,7 @@ be_visitor_operation::gen_environment_var () static const char *ace_try_env_decl = "ACE_DECLARE_NEW_CORBA_ENV;"; static const char *null_env_decl = ""; - // Check if we are generating stubs/skeletons for + // Check if we are generating stubs/skeletons for // true C++ exception support. if (be_global->exception_support ()) { -- cgit v1.2.1