Index: TAO_IDL/be/be_interface.cpp =================================================================== --- TAO_IDL/be/be_interface.cpp (revision 96926) +++ TAO_IDL/be/be_interface.cpp (working copy) @@ -1477,6 +1477,13 @@ || lookup_strategy == BE_GlobalData::TAO_PERFECT_HASH) { // We call GPERF for all these three strategies. + bool amh = false; + ACE_CString tmp (full_skeleton_name); + + if (tmp.strstr ("AMH_") != ACE_String_Base_Const::npos) + { + amh = true; + } // Init the outstream. // @@ We probably do no need to do this, the "right" // argument is passed down!! @@ -1489,6 +1496,10 @@ // get the next AST decl node AST_Decl *d = si.item (); + ACE_CString name (d->full_name ()); + ACE_String_Base_Const::size_type const last = name.rfind(':') - 1; + name = name.substring (0, last); + if (d->node_type () == AST_Decl::NT_op) { be_operation *op = @@ -1503,16 +1514,9 @@ // We are an operation node. We use the original // operation name, not the one with _cxx_ in it. - // We need to the name of the base class!! But since - // we don't know whether this is an AMH class, we - // need to check this, using the full_skeleton_name - // TODO: find a more elegant solution for this - ACE_CString tmp (full_skeleton_name); - if (tmp.strstr ("AMH_") != ACE_String_Base_Const::npos) + // We need to the name of the base class!! + if (amh) { - ACE_CString name (d->full_name ()); - ACE_String_Base_Const::size_type const last = name.rfind(':') - 1; - name = name.substring (0, last); if (name.rfind (':') != ACE_String_Base_Const::npos) { ACE_CString nspace = name.substring (0, name.rfind (':') - 1); @@ -1585,91 +1589,127 @@ // we need to split the full name in order to push _set_ // or _get_ in between the namespace and attribute name. - //determine the correct namespace - ACE_CString nspace (d->full_name ()); - ACE_String_Base_Const::size_type const pos = nspace.rfind(':'); - nspace = nspace.substring(0, pos + 1); - - if (!d->is_abstract ()) + if (amh) { - *os << "_get_" << d->original_local_name () << ",&POA_" - << nspace.c_str () << "_get_" - << d->original_local_name () << "_skel,"; - - if (be_global->gen_direct_collocation ()) + if (name.rfind (':') != ACE_String_Base_Const::npos) { - *os << " &" - << this->full_direct_proxy_impl_name () - << "::_get_" << d->local_name (); + ACE_CString nspace = name.substring (0, name.rfind (':') - 1); + ACE_CString nclass = name.substring (name.rfind (':') + 1); + *os << "_get_" << d->original_local_name () << ",&POA_" + << nspace.c_str () << "::AMH_" + << nclass.c_str () << "::_get_" + << d->original_local_name () + << "_skel,"; } else { - *os << " 0"; + *os << "_get_" << d->original_local_name () << ",&POA_AMH_" + << name.c_str () << "::_get_" + << d->original_local_name () + << "_skel,"; } } else { - *os << "_get_" << d->original_local_name () << ",&" - << full_skeleton_name << "::_get_" - << d->original_local_name () << "_skel,"; + if (!d->is_abstract ()) + { + *os << "_get_" << d->original_local_name () << ",&POA_" + << name.c_str () << "::_get_" + << d->original_local_name () << "_skel,"; + } + else + { + *os << "_get_" << d->original_local_name () << ",&" + << full_skeleton_name << "::_get_" + << d->original_local_name () << "_skel,"; + } + } - if (be_global->gen_direct_collocation ()) + if (be_global->gen_direct_collocation ()) + { + if (!d->is_abstract ()) { *os << " &" - << derived_interface->full_direct_proxy_impl_name () + << this->full_direct_proxy_impl_name () << "::_get_" << d->local_name (); } else { - *os << " 0"; + *os << " &" + << derived_interface->full_direct_proxy_impl_name () + << "::_get_" << d->local_name (); } + } - + else + { + *os << " 0"; + } + *os << "\n"; - ++this->skel_count_; if (!attr->readonly ()) { - if (!d->is_abstract ()) + // The set method + if (amh) { - // The set method - *os << "_set_" << d->original_local_name () << ",&POA_" - << nspace.c_str () << "_set_" - << d->original_local_name () << "_skel,"; - - if (be_global->gen_direct_collocation ()) + if (name.rfind (':') != ACE_String_Base_Const::npos) { - *os << " &" - << this->full_direct_proxy_impl_name () - << "::_set_" << d->local_name (); + ACE_CString nspace = name.substring (0, name.rfind (':') - 1); + ACE_CString nclass = name.substring (name.rfind (':') + 1); + *os << "_set_" << d->original_local_name () << ",&POA_" + << nspace.c_str () << "::AMH_" + << nclass.c_str () << "::_set_" + << d->original_local_name () + << "_skel,"; } else { - *os << " 0"; + *os << "_set_" << d->original_local_name () << ",&POA_AMH_" + << name.c_str () << "::_set_" + << d->original_local_name () + << "_skel,"; } } else { - // The set method in case abstract - *os << "_set_" << d->original_local_name () << ",&" - << full_skeleton_name << "::_set_" - << d->original_local_name () << "_skel,"; + if (!d->is_abstract ()) + { + *os << "_set_" << d->original_local_name () << ",&POA_" + << name.c_str () << "::_set_" + << d->original_local_name () << "_skel,"; + } + else + { + // The set method in case abstract + *os << "_set_" << d->original_local_name () << ",&" + << full_skeleton_name << "::_set_" + << d->original_local_name () << "_skel,"; + } + } - if (be_global->gen_direct_collocation ()) + if (be_global->gen_direct_collocation ()) + { + if (!d->is_abstract ()) { *os << " &" - << derived_interface->full_direct_proxy_impl_name () + << this->full_direct_proxy_impl_name () << "::_set_" << d->local_name (); } else { - *os << " 0"; + *os << " &" + << derived_interface->full_direct_proxy_impl_name () + << "::_set_" << d->local_name (); } } + else + { + *os << " 0"; + } *os << "\n"; - ++this->skel_count_; } }