Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use =default for skeleton copy constructor #2309

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node)

// Copy constructor and destructor.
*os << class_name.c_str () << " (const "
<< class_name.c_str () << "& rhs);" << be_nl
<< class_name.c_str () << "& rhs) = default;" << be_nl
mitza-oci marked this conversation as resolved.
Show resolved Hide resolved
<< "virtual ~" << class_name.c_str () << " () = default;" << be_nl_2;

// _is_a
Expand Down
38 changes: 1 addition & 37 deletions TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node)
<< local_name_prefix << node_local_name
<< " ()";

bool const init_bases = node->nmembers () == 0;
if (init_bases)
if (node->nmembers () == 0)
{
*os << be_idt_nl << ": TAO_ServantBase ()" << be_uidt_nl;
}
Expand All @@ -125,33 +124,6 @@ be_visitor_interface_ss::visit_interface (be_interface *node)
<< "_optable);" << be_uidt_nl
<< "}" << be_nl_2;

// find if we are at the top scope or inside some module
*os << full_skel_name << "::"
<< local_name_prefix << node_local_name << " ("
<< "const " << local_name_prefix
<< node_local_name << " &"
<< (init_bases ? "rhs" : "") << ")";

if (init_bases)
{
*os << be_idt_nl
<< ": TAO_Abstract_ServantBase (rhs)," << be_nl
<< " TAO_ServantBase (rhs)";
}

if (this->generate_copy_ctor (node, os) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("be_visitor_interface_ss::")
ACE_TEXT ("visit_interface - ")
ACE_TEXT (" copy ctor generation failed\n")),
-1);
}

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

// Generate code for elements in the scope (e.g., operations).
if (this->visit_scope (node) == -1)
{
Expand Down Expand Up @@ -456,14 +428,6 @@ be_visitor_interface_ss::generate_proxy_classes (be_interface *node)
return 0;
}

int
be_visitor_interface_ss::generate_copy_ctor (be_interface *node,
TAO_OutStream *os)
{
return node->traverse_inheritance_graph (be_interface::copy_ctor_helper,
mitza-oci marked this conversation as resolved.
Show resolved Hide resolved
os);
}

ACE_CString
be_visitor_interface_ss::generate_flat_name (be_interface *node)
{
Expand Down
3 changes: 1 addition & 2 deletions TAO/TAO_IDL/be_include/be_visitor_interface/interface_ss.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ class be_visitor_interface_ss : public be_visitor_interface

virtual int generate_amh_classes (be_interface *node);
virtual int generate_proxy_classes (be_interface *node);
virtual int generate_copy_ctor (be_interface *node,
TAO_OutStream *os);

virtual ACE_CString generate_flat_name (be_interface *node);
virtual ACE_CString generate_local_name (be_interface *node);
virtual ACE_CString generate_full_skel_name (be_interface *node);
Expand Down
Loading