diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-06-21 14:32:50 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-06-21 14:32:50 +0000 |
commit | 2a80da85096a4f4f577283d4d05872e6b5ed9528 (patch) | |
tree | 026321b15cbc9373edbabf9381d116ca0d1a2a85 /TAO/TAO_IDL | |
parent | d245cad517f996222ea6ffac3d61de8929aa2778 (diff) | |
download | ATCD-2a80da85096a4f4f577283d4d05872e6b5ed9528.tar.gz |
ChangeLogTag: Mon Jun 21 14:28:44 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO/TAO_IDL')
-rw-r--r-- | TAO/TAO_IDL/ast/ast_interface.cpp | 15 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp | 43 | ||||
-rw-r--r-- | TAO/TAO_IDL/fe/fe_interface_header.cpp | 2 | ||||
-rw-r--r-- | TAO/TAO_IDL/include/ast_interface.h | 7 |
4 files changed, 42 insertions, 25 deletions
diff --git a/TAO/TAO_IDL/ast/ast_interface.cpp b/TAO/TAO_IDL/ast/ast_interface.cpp index c31e3144a70..3337d5d22c7 100644 --- a/TAO/TAO_IDL/ast/ast_interface.cpp +++ b/TAO/TAO_IDL/ast/ast_interface.cpp @@ -124,7 +124,8 @@ AST_Interface::AST_Interface (UTL_ScopedName *n, pd_n_inherits_flat (nih_flat), home_equiv_ (false), fwd_decl_ (0), - has_mixed_parentage_ (-1) + has_mixed_parentage_ (-1), + ami_handler_ (0) { this->size_type (AST_Type::VARIABLE); // always the case this->has_constructor (true); // always the case @@ -1087,6 +1088,18 @@ AST_Interface::special_lookup (UTL_ScopedName *e, return 0; } +AST_Interface * +AST_Interface::ami_handler (void) const +{ + return this->ami_handler_; +} + +void +AST_Interface::ami_handler (AST_Interface *handler) +{ + this->ami_handler_ = handler; +} + void AST_Interface::destroy (void) { 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 46feb7779e7..fad56908ef1 100644 --- a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp @@ -302,6 +302,9 @@ be_visitor_ami_pre_proc::create_reply_handler (be_interface *node) reply_handler->set_name (reply_handler_name); reply_handler->set_defined_in (s); + + /// Store here for convenient retrieval later. + node->ami_handler (reply_handler); // Set repo id to 0, so it will be recomputed on the next access, // and set the prefix to the node's prefix. All this is @@ -411,9 +414,9 @@ be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node) // Create the new name // Prepend "sendc_" to the name of the operation ACE_CString original_op_name ( - node->name ()->last_component ()->get_string () - ); - ACE_CString new_op_name = ACE_CString ("sendc_") + original_op_name; + node->name ()->last_component ()->get_string ()); + ACE_CString new_op_name = + ACE_CString ("sendc_") + original_op_name; UTL_ScopedName *op_name = static_cast<UTL_ScopedName *> (node->name ()->copy ()); @@ -439,37 +442,31 @@ be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node) // Look up the field type. UTL_Scope *s = node->defined_in (); - be_decl *parent = be_scope::narrow_from_scope (s)->decl (); + be_interface *parent = be_interface::narrow_from_scope (s); // Add the pre- and suffix ACE_CString handler_local_name; - this->generate_name (handler_local_name, - "AMI_", - parent->name ()->last_component ()->get_string (), - "Handler"); - - UTL_ScopedName *field_name = - static_cast<UTL_ScopedName *> (parent->name ()->copy ()); - field_name->last_component ()->replace_string ( - handler_local_name.c_str () - ); + this->generate_name ( + handler_local_name, + "AMI_", + parent->name ()->last_component ()->get_string (), + "Handler"); - AST_Decl *d = s->lookup_by_name (field_name, true); - field_name->destroy (); - delete field_name; - field_name = 0; + AST_Interface *handler = parent->ami_handler (); - if (0 == d) + if (0 == handler) { ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_ami_pre_proc::" - "create_sendc_operation - " - "lookup of reply handler failed\n"), + ACE_TEXT ("be_visitor_ami_pre_proc::") + ACE_TEXT ("create_sendc_operation - ") + ACE_TEXT ("null reply ") + ACE_TEXT ("handler found\n")), 0); } - be_interface *field_type = be_interface::narrow_from_decl (d); + be_interface *field_type = + be_interface::narrow_from_decl (handler); ACE_NEW_RETURN (id, Identifier ("ami_handler"), diff --git a/TAO/TAO_IDL/fe/fe_interface_header.cpp b/TAO/TAO_IDL/fe/fe_interface_header.cpp index a89b3277c7f..73978c4b195 100644 --- a/TAO/TAO_IDL/fe/fe_interface_header.cpp +++ b/TAO/TAO_IDL/fe/fe_interface_header.cpp @@ -302,7 +302,7 @@ FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces, { // If the lookup now succeeds, without the full_def_only // constraint, it's an error. - d = s->lookup_by_name (item, true); + d = s->lookup_by_name (item, false); if (0 != d) { diff --git a/TAO/TAO_IDL/include/ast_interface.h b/TAO/TAO_IDL/include/ast_interface.h index 56086b3b088..d2259ee156f 100644 --- a/TAO/TAO_IDL/include/ast_interface.h +++ b/TAO/TAO_IDL/include/ast_interface.h @@ -149,6 +149,10 @@ public: virtual AST_Decl *special_lookup (UTL_ScopedName *e, bool full_def_only); + + /// Accessors for the member. + AST_Interface *ami_handler (void) const; + void ami_handler (AST_Interface *handler); // Cleanup function. virtual void destroy (void); @@ -208,6 +212,9 @@ protected: /// Do we have both abstract and concrete parents? int has_mixed_parentage_; + + /// Store here foro quick retrieval without an AST lookup. + AST_Interface *ami_handler_; protected: // Scope Management Protocol. |