Skip to content

Commit

Permalink
=default for generated implementation copy ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
mitza-oci committed Dec 17, 2024
1 parent 5dcda05 commit 88df791
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 92 deletions.
39 changes: 0 additions & 39 deletions TAO/TAO_IDL/be/be_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2227,45 +2227,6 @@ be_interface::is_a_helper (be_interface * /*derived*/,
return 0;
}

int
be_interface::copy_ctor_helper (be_interface *derived,
be_interface *base,
TAO_OutStream *os)
{
// We can't call ourselves in a copy constructor, and
// abstract interfaces don't exist on the skeleton side.
if (derived == base || base->is_abstract () || derived->nmembers () > 0)
{
return 0;
}

*os << "," << be_idt_nl;

bool is_rh_base =
(ACE_OS::strcmp (base->flat_name (), "Messaging_ReplyHandler") == 0);

if (is_rh_base)
{
*os << "::POA_Messaging::ReplyHandler (rhs)";
}
else if (base->is_nested ())
{
be_decl *scope = nullptr;
scope = dynamic_cast<be_scope*> (base->defined_in ())->decl ();

*os << "POA_" << scope->name () << "::"
<< base->local_name () << " (rhs)";
}
else
{
*os << base->full_skel_name () << " (rhs)";
}

*os << be_uidt;

return 0;
}

int
be_interface::in_mult_inheritance_helper (be_interface *derived,
be_interface *base,
Expand Down
2 changes: 1 addition & 1 deletion TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ be_visitor_interface_ih::visit_interface (be_interface *node)
<< be_global->impl_class_prefix () << namebuf
<< be_global->impl_class_suffix () << " (const "
<< be_global->impl_class_prefix () << namebuf
<< be_global->impl_class_suffix () << "&);" <<be_nl <<be_nl;
<< be_global->impl_class_suffix () << "&) = default;" <<be_nl <<be_nl;
}

if (be_global->gen_assign_op ())
Expand Down
46 changes: 0 additions & 46 deletions TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,52 +62,6 @@ be_visitor_interface_is::visit_interface (be_interface *node)
*os << "{" <<be_nl;
*os << "}" << be_nl_2;

if (be_global->gen_copy_ctor () && !node->is_local ())
{
*os << "//Implementation Skeleton Copy Constructor" << be_nl;

*os << be_global->impl_class_prefix () << node->flat_name ()
<< be_global->impl_class_suffix () <<"::"
<< be_global->impl_class_prefix () << node->flat_name ()
<< be_global->impl_class_suffix () << " (const "
<< be_global->impl_class_prefix () << node->flat_name ()
<< be_global->impl_class_suffix () << "& rhs)" << be_idt_nl
<< ": TAO_Abstract_ServantBase (rhs)," << be_nl
<< " TAO_ServantBase (rhs)";

if (node->traverse_inheritance_graph (be_interface::copy_ctor_helper,
os)
== -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
"be_visitor_interface_is::visit_interface - "
" copy ctor generation failed\n"),
-1);
}

if (!node->is_local ())
{
*os << "," << be_nl;

if (node->is_nested ())
{
be_decl *scope = nullptr;
scope = dynamic_cast<be_scope*> (node->defined_in ())->decl ();

*os << " POA_" << scope->name () << "::"
<< node->local_name () << " (rhs)";
}
else
{
*os << " " << node->full_skel_name () << " (rhs)";
}
}

*os << be_uidt_nl
<< "{" << be_nl
<< "}" << be_nl << be_uidt_nl;
}

if (be_global->gen_assign_op ())
{
*os << "//Implementation Skeleton Copy Assignment" << be_nl;
Expand Down
6 changes: 0 additions & 6 deletions TAO/TAO_IDL/be_include/be_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,6 @@ class be_interface : public virtual AST_Interface,
be_interface *,
TAO_OutStream *os);

/// Helper method passed to the template method to invoke ctors of all the
/// base classes.
static int copy_ctor_helper (be_interface *,
be_interface *,
TAO_OutStream *os);

/// Helper method to determine if the interface node is involved in some kind
/// of multiple inheritance or not. Required on the skeleton side.
static int in_mult_inheritance_helper (be_interface *,
Expand Down

0 comments on commit 88df791

Please sign in to comment.