Skip to content

Commit

Permalink
Use public constructors, at that moment we don't need to add friends
Browse files Browse the repository at this point in the history
    * ridlbe/c++11/templates/impl/hdr/interface_pre.erb:
    * tests/custom_format/custom_format_impl.h:
    * tests/hello_regen/test_impl.h:
    * tests/obv/simple/client_i.h:
    * tests/write_traits/write_traits_impl.h:
  • Loading branch information
jwillemsen committed Oct 5, 2023
1 parent 930c1fb commit 9be512a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 40 deletions.
11 changes: 3 additions & 8 deletions ridlbe/c++11/templates/impl/hdr/interface_pre.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,12 @@ namespace _impl
: public CORBA::servant_traits<<%= scoped_cxxtype %>>::base_type
% nest { write_regen_section("#{scoped_cxxname}"+'[Base List]', default_content: '// your base classes') }
{
protected:
public:
% nest(2) { write_regen_section("#{scoped_cxxname}"+'[Constructors]', default_content: ['/// Constructor(s)', "#{skel_cxxname} ();"]) }

/// Destructor
~<%= skel_cxxname %> () override;

template <typename T> friend class CORBA::servant_reference;

template <typename _Tp1, typename, typename ...Args>
friend constexpr CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args);

% nest(2) { write_regen_section("#{scoped_cxxname}"+'[User Protected]', default_content: '// your protected definitions') }
public:
% if has_abstract_base?
% unless abstractbase_operations.empty?

Expand All @@ -39,4 +32,6 @@ namespace _impl
//@}
% end
% end
% nest(2) { write_regen_section("#{scoped_cxxname}"+'[User Protected]', default_content: '// your protected definitions') }

% inc_nest
8 changes: 1 addition & 7 deletions tests/custom_format/custom_format_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Test
// your base classes
//@@{__RIDL_REGEN_MARKER__} - END : Test::Foo_impl[Base List]
{
protected:
public:
//@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Foo_impl[Constructors]
/// Constructor(s)'
Foo_impl (IDL::traits<CORBA::ORB>::ref_type orb);
Expand All @@ -41,15 +41,9 @@ namespace Test
/// Destructor
~Foo_impl () override;

template <typename T> friend class CORBA::servant_reference;

template <typename _Tp1, typename, typename ...Args>
friend constexpr CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args);

//@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Foo_impl[User Protected]
// your protected definitions
//@@{__RIDL_REGEN_MARKER__} - END : Test::Foo_impl[User Protected]
public:

// generated from c++11/templates/impl/hdr/operation.erb
/// @copydoc Test::Foo::write_on_servant
Expand Down
18 changes: 4 additions & 14 deletions tests/hello_regen/test_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Test
// your base classes
//@@{__RIDL_REGEN_MARKER__} - END : Test::Foo[Base List]
{
protected:
public:
//@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Foo[Constructors]
/// Constructor(s)
Foo ();
Expand All @@ -40,15 +40,10 @@ namespace Test
/// Destructor
~Foo () override;

template <typename T> friend class CORBA::servant_reference;

template <typename _Tp1, typename, typename ...Args>
friend constexpr CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args);

//@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Foo[User Protected]
// your protected definitions
//@@{__RIDL_REGEN_MARKER__} - END : Test::Foo[User Protected]
public:


// generated from c++11/templates/impl/hdr/interface_post
//@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Foo[User Public]
Expand Down Expand Up @@ -77,7 +72,7 @@ namespace Test
// your base classes
//@@{__RIDL_REGEN_MARKER__} - END : Test::Hello[Base List]
{
protected:
public:
//@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Hello[Constructors]
/// Constructor(s)
Hello (IDL::traits<CORBA::ORB>::ref_type orb);
Expand All @@ -86,15 +81,10 @@ namespace Test
/// Destructor
~Hello () override;

template <typename T> friend class CORBA::servant_reference;

template <typename _Tp1, typename, typename ...Args>
friend constexpr CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args);

//@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Hello[User Protected]
// your protected definitions
//@@{__RIDL_REGEN_MARKER__} - END : Test::Hello[User Protected]
public:


// generated from c++11/templates/impl/hdr/attribute
int32_t
Expand Down
4 changes: 0 additions & 4 deletions tests/obv/simple/client_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ class Client_i final

void shutdown () override;

template <typename _Tp1, typename, typename ...Args>
friend constexpr CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args);

protected:
using base_type = CORBA::servant_traits<Test::Client>::base_type;

Client_i (CORBA::ORB::_ref_type orb)
Expand Down
8 changes: 1 addition & 7 deletions tests/write_traits/write_traits_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Test
// your base classes
//@@{__RIDL_REGEN_MARKER__} - END : Test::Foo_impl[Base List]
{
protected:
public:
//@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Foo_impl[Constructors]
/// Constructor(s)'
Foo_impl (IDL::traits<CORBA::ORB>::ref_type orb);
Expand All @@ -41,15 +41,9 @@ namespace Test
/// Destructor
~Foo_impl () override;

template <typename T> friend class CORBA::servant_reference;

template <typename _Tp1, typename, typename ...Args>
friend constexpr CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args);

//@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Foo_impl[User Protected]
// your protected definitions
//@@{__RIDL_REGEN_MARKER__} - END : Test::Foo_impl[User Protected]
public:

// generated from c++11/templates/impl/hdr/operation.erb
/// @copydoc Test::Foo::write_on_servant
Expand Down

0 comments on commit 9be512a

Please sign in to comment.