diff options
author | gokhale <asgokhale@users.noreply.github.com> | 1998-03-15 12:23:49 +0000 |
---|---|---|
committer | gokhale <asgokhale@users.noreply.github.com> | 1998-03-15 12:23:49 +0000 |
commit | 464f7843e664342a64b7393276451d49d37818a0 (patch) | |
tree | 7c76dbbe5211c9b1bf1ded4073c2d16b83b48ea5 | |
parent | aeb7a309a33b326036d57f3fff19e90a6d769164 (diff) | |
download | ATCD-464f7843e664342a64b7393276451d49d37818a0.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/ChangeLog-98c | 12 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_interpretive.cpp | 3 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_args.cpp | 56 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_operation.cpp | 21 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_codegen.h | 5 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_visitor_args.h | 56 | ||||
-rw-r--r-- | TAO/docs/releasenotes/index.html | 16 |
7 files changed, 142 insertions, 27 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index 354380275c2..53323208dca 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,15 @@ +Sun Mar 15 06:18:58 1998 Aniruddha Gokhale <gokhale@mambo.cs.wustl.edu> + + * TAO_IDL/be_include/{be_codegen, be_visitor_args}.h: Added a new + state called "POST_MARSHAL_SS" i.e., to do post processing after + the marshaling of return, inout, and out parameters is done in a + server skeleton. Added new visitor class to the argument visitors. + + * TAO_IDL/be/{be_visitor_args, be_visitor_operation, + be_interpretive}.cpp: Code for post processing after marshaling in + the server skeletons. This was required to support object + references. + Sat Mar 14 19:28:50 1998 Aniruddha Gokhale <gokhale@mambo.cs.wustl.edu> * TAO_IDL/be/be_visitor_field.cpp: Added a case for handling diff --git a/TAO/TAO_IDL/be/be_interpretive.cpp b/TAO/TAO_IDL/be/be_interpretive.cpp index d9021886a26..ab1c23a553d 100644 --- a/TAO/TAO_IDL/be/be_interpretive.cpp +++ b/TAO/TAO_IDL/be/be_interpretive.cpp @@ -228,6 +228,7 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_OPERATION_ARG_DECL_SS: 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); case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_CH: @@ -250,6 +251,8 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_ARGUMENT_DEMARSHAL_SS: case TAO_CodeGen::TAO_ARGUMENT_MARSHAL_SS: return new be_visitor_args_marshal_ss (new_ctx); + case TAO_CodeGen::TAO_ARGUMENT_POST_MARSHAL_SS: + return new be_visitor_args_post_marshal_ss (new_ctx); case TAO_CodeGen::TAO_ATTRIBUTE_CH: case TAO_CodeGen::TAO_ATTRIBUTE_CS: diff --git a/TAO/TAO_IDL/be/be_visitor_args.cpp b/TAO/TAO_IDL/be/be_visitor_args.cpp index c5d9b6e82d0..ec01a51770c 100644 --- a/TAO/TAO_IDL/be/be_visitor_args.cpp +++ b/TAO/TAO_IDL/be/be_visitor_args.cpp @@ -1221,6 +1221,7 @@ int be_visitor_args_vardecl_ss::visit_interface (be_interface *node) break; case AST_Argument::dir_OUT: os->indent (); + *os << "CORBA::Object_ptr _tao_base_" << arg->local_name () << ";\n"; *os << bt->name () << "_ptr _tao_ptr_" << arg->local_name () << ";" << be_nl; *os << bt->name () << "_out " << arg->local_name () << " (_tao_ptr_" << arg->local_name () << ");\n"; @@ -1251,6 +1252,7 @@ int be_visitor_args_vardecl_ss::visit_interface_fwd (be_interface_fwd *node) break; case AST_Argument::dir_OUT: os->indent (); + *os << "CORBA::Object_ptr _tao_base_" << arg->local_name () << ";\n"; *os << bt->name () << "_ptr _tao_ptr_" << arg->local_name () << ";" << be_nl; *os << bt->name () << "_out " << arg->local_name () << " (_tao_ptr_" << arg->local_name () << ");\n"; @@ -1541,15 +1543,9 @@ int be_visitor_args_marshal_ss::visit_interface (be_interface *) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - os->indent (); - if (this->ctx_->state () == TAO_CodeGen::TAO_ARGUMENT_DEMARSHAL_SS) - *os << "&_tao_base_" << arg->local_name (); - else - *os << "&" << arg->local_name (); - break; case AST_Argument::dir_OUT: os->indent (); - *os << "&_tao_ptr_" << arg->local_name (); + *os << "&_tao_base_" << arg->local_name (); break; } return 0; @@ -1564,15 +1560,9 @@ int be_visitor_args_marshal_ss::visit_interface_fwd (be_interface_fwd *) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - os->indent (); - if (this->ctx_->state () == TAO_CodeGen::TAO_ARGUMENT_DEMARSHAL_SS) - *os << "&_tao_base_" << arg->local_name (); - else - *os << "&" << arg->local_name (); - break; case AST_Argument::dir_OUT: os->indent (); - *os << "&_tao_ptr_" << arg->local_name (); + *os << "&_tao_base_" << arg->local_name (); break; } return 0; @@ -2070,14 +2060,23 @@ int be_visitor_args_post_upcall_ss::visit_enum (be_enum *node) int be_visitor_args_post_upcall_ss::visit_interface (be_interface *node) { TAO_OutStream *os = this->ctx_->stream (); // get output stream - + be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument + // node switch (this->direction ()) { case AST_Argument::dir_IN: break; case AST_Argument::dir_INOUT: // inout + os->indent (); + *os << "CORBA::release (_tao_base_" << arg->local_name () << ");" + << be_nl; + *os << "_tao_base_" << arg->local_name () << " = " << arg->local_name () + << ";\n"; break; case AST_Argument::dir_OUT: + os->indent (); + *os << "_tao_base_" << arg->local_name () << " = _tao_ptr_" + << arg->local_name () << ";\n"; break; } return 0; @@ -2086,14 +2085,23 @@ int be_visitor_args_post_upcall_ss::visit_interface (be_interface *node) int be_visitor_args_post_upcall_ss::visit_interface_fwd (be_interface_fwd *node) { TAO_OutStream *os = this->ctx_->stream (); // get output stream - + be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument + // node switch (this->direction ()) { case AST_Argument::dir_IN: break; case AST_Argument::dir_INOUT: // inout + os->indent (); + *os << "CORBA::release (_tao_base_" << arg->local_name () << ");" + << be_nl; + *os << "_tao_base_" << arg->local_name () << " = " << arg->local_name () + << ";\n"; break; case AST_Argument::dir_OUT: + os->indent (); + *os << "_tao_base_" << arg->local_name () << " = _tao_ptr_" + << arg->local_name () << ";\n"; break; } return 0; @@ -2214,9 +2222,8 @@ int be_visitor_args_post_upcall_ss::visit_typedef (be_typedef *node) return node->primitive_base_type ()->accept (this); } -#if 0 // ************************************************************************ -// visitor for doing any post-processing after the upcall is made +// visitor for doing any post-processing after the marshaling is done // ************************************************************************ be_visitor_args_post_marshal_ss::be_visitor_args_post_marshal_ss (be_visitor_context *ctx) @@ -2294,14 +2301,16 @@ int be_visitor_args_post_marshal_ss::visit_enum (be_enum *node) int be_visitor_args_post_marshal_ss::visit_interface (be_interface *node) { TAO_OutStream *os = this->ctx_->stream (); // get output stream + be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument + // node switch (this->direction ()) { case AST_Argument::dir_IN: - break; case AST_Argument::dir_INOUT: // inout - break; case AST_Argument::dir_OUT: + os->indent (); + *os << "CORBA::release (_tao_base_" << arg->local_name () << ");\n"; break; } return 0; @@ -2310,14 +2319,16 @@ int be_visitor_args_post_marshal_ss::visit_interface (be_interface *node) int be_visitor_args_post_marshal_ss::visit_interface_fwd (be_interface_fwd *node) { TAO_OutStream *os = this->ctx_->stream (); // get output stream + be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument + // node switch (this->direction ()) { case AST_Argument::dir_IN: - break; case AST_Argument::dir_INOUT: // inout - break; case AST_Argument::dir_OUT: + os->indent (); + *os << "CORBA::release (_tao_base_" << arg->local_name () << ");\n"; break; } return 0; @@ -2437,4 +2448,3 @@ int be_visitor_args_post_marshal_ss::visit_typedef (be_typedef *node) this->ctx_->alias (node); return node->primitive_base_type ()->accept (this); } -#endif diff --git a/TAO/TAO_IDL/be/be_visitor_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation.cpp index a80b9a9f40e..c988a6cccf0 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation.cpp @@ -968,6 +968,20 @@ be_visitor_operation_ss::visit_operation (be_operation *node) *os << be_uidt_nl; *os << ");" << be_nl; + // STEP 3F: do any post processing for the arguments + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_POST_UPCALL_SS); + visitor = tao_cg->make_visitor (&ctx); + if (!visitor || (node->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ss::" + "visit_operation - " + "codegen for args in post upcall failed\n"), + -1); + } + // STEP 3C: setup parameters for marshaling and marshal them into the // outgoing stream *os << "_tao_server_request.marshal (" << be_idt_nl @@ -1037,7 +1051,7 @@ be_visitor_operation_ss::visit_operation (be_operation *node) // STEP 3F: do any post processing for the arguments ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_POST_UPCALL_SS); + ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_POST_MARSHAL_SS); visitor = tao_cg->make_visitor (&ctx); if (!visitor || (node->accept (visitor) == -1)) { @@ -1045,7 +1059,7 @@ be_visitor_operation_ss::visit_operation (be_operation *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_operation_ss::" "visit_operation - " - "codegen for args in post upcall failed\n"), + "codegen for args in post marshal failed\n"), -1); } @@ -3016,6 +3030,9 @@ be_visitor_operation_argument::visit_argument (be_argument *node) 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; default: { ACE_ERROR_RETURN ((LM_ERROR, diff --git a/TAO/TAO_IDL/be_include/be_codegen.h b/TAO/TAO_IDL/be_include/be_codegen.h index f4fcddd3959..8f7d1d7d675 100644 --- a/TAO/TAO_IDL/be_include/be_codegen.h +++ b/TAO/TAO_IDL/be_include/be_codegen.h @@ -68,7 +68,9 @@ public: TAO_ARGUMENT_VARDECL_SS, // declaration of argument // variable in skeleton (server) TAO_ARGUMENT_MARSHAL_SS, // passing argument node to the - TAO_ARGUMENT_DEMARSHAL_SS, // demarshal and marshal operations + TAO_ARGUMENT_DEMARSHAL_SS, // demarshal and marshal + // operations + TAO_ARGUMENT_POST_MARSHAL_SS, TAO_ARGUMENT_PRE_UPCALL_SS, // preprocessing of argument // variable before upcall TAO_ARGUMENT_UPCALL_SS, // passing argument variable to upcall @@ -212,6 +214,7 @@ public: TAO_OPERATION_ARG_DEMARSHAL_SS, // and argument variables to the TAO_OPERATION_RETVAL_MARSHAL_SS, // marshal and demarshal operations TAO_OPERATION_ARG_MARSHAL_SS, + TAO_OPERATION_ARG_POST_MARSHAL_SS, TAO_OPERATION_RETVAL_ASSIGN_SS, // assigning to return type // variable TAO_OPERATION_ARG_PRE_UPCALL_SS, // pre upcall processing diff --git a/TAO/TAO_IDL/be_include/be_visitor_args.h b/TAO/TAO_IDL/be_include/be_visitor_args.h index 6e31c4ca9e6..12d4ef95307 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_args.h +++ b/TAO/TAO_IDL/be_include/be_visitor_args.h @@ -515,4 +515,60 @@ public: }; +// ************************************************************ +// class be_visitor_args_post_marshal_ss +// ************************************************************ +class be_visitor_args_post_marshal_ss : public be_visitor_args +{ + // + // = TITLE + // be_visitor_args_post_marshal_ss + // + // = DESCRIPTION + // Visitor for post processing after marshal + // +public: + be_visitor_args_post_marshal_ss (be_visitor_context *ctx); + // constructor + + virtual ~be_visitor_args_post_marshal_ss (void); + // destructor + + virtual int visit_argument (be_argument *node); + // visit the argument node + + // =visit all the nodes that can be the types for the argument + + virtual int visit_array (be_array *node); + // visit array type + + virtual int visit_enum (be_enum *node); + // visit the enum node + + virtual int visit_interface (be_interface *node); + // visit interface + + virtual int visit_interface_fwd (be_interface_fwd *node); + // visit interface forward + + virtual int visit_predefined_type (be_predefined_type *node); + // visit predefined type + + virtual int visit_sequence (be_sequence *node); + // visit sequence type + + virtual int visit_string (be_string *node); + // visit string type + + virtual int visit_structure (be_structure *node); + // visit structure type + + virtual int visit_union (be_union *node); + // visit union type + + virtual int visit_typedef (be_typedef *node); + // visit the typedef type + +}; + #endif // _BE_VISITOR_ARGS_H diff --git a/TAO/docs/releasenotes/index.html b/TAO/docs/releasenotes/index.html index bb2ae463a3a..7d3c6901d75 100644 --- a/TAO/docs/releasenotes/index.html +++ b/TAO/docs/releasenotes/index.html @@ -51,8 +51,22 @@ release</A> of <A HREF="http://www.cs.wustl.edu/~schmidt/TAO.html">TAO</A>: <A NAME="idl"></A>IDL Compiler</H3> Point of contact: <A HREF="mailto:gokhale@cs.wustl.edu">Aniruddha Gokhale</A> -<P>Current status: (As of January 7th, 1998.) +<P>Current status: (As of March 15th, 1998.) <UL> + <LI> + Completely redesigned the IDL compiler using the Visitor + patterns. Many incomplete issues have been resolved. These + include support for "sequence of typecodes", passing object + references as in, inout, and out parameters. Code generation for + sequences is also properly handled i.e., for a named sequence + such as "typedef sequence <char> CharSeq;", we now generate a + new class (and hence a type) called "class CharSeq". Arrays are + still being worked out and will be done soon. + + An important difference in the generated code is that the + skeletons now use a table driven approach very similar to the + stubs. + </LI> <LI> Support for the "native" keyword added.</LI> |