From 87fd5c5bc3dfbefa7eeb30eea2c1db7dba4a2298 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 5 Oct 2023 11:06:54 +0200 Subject: [PATCH 1/9] Make make_reference a constexpr function * ridlbe/c++11/templates/cli/hdr/ami/interface_amic_post.erb: * ridlbe/c++11/templates/cli/hdr/interface_post.erb: * ridlbe/c++11/templates/cli/hdr/valuetype_init.erb: * tao/x11/PolicyC.h: * tao/x11/object.h: * tao/x11/object_traits_t.h: * tao/x11/orb.h: * tao/x11/portable_server/poa_policies_impl.h: * tao/x11/portable_server/portableserver_impl.h: --- .../c++11/templates/cli/hdr/ami/interface_amic_post.erb | 2 +- ridlbe/c++11/templates/cli/hdr/interface_post.erb | 2 +- ridlbe/c++11/templates/cli/hdr/valuetype_init.erb | 2 +- tao/x11/PolicyC.h | 2 +- tao/x11/object.h | 2 +- tao/x11/object_traits_t.h | 8 ++++---- tao/x11/orb.h | 2 +- tao/x11/portable_server/poa_policies_impl.h | 2 +- tao/x11/portable_server/portableserver_impl.h | 8 ++++---- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ridlbe/c++11/templates/cli/hdr/ami/interface_amic_post.erb b/ridlbe/c++11/templates/cli/hdr/ami/interface_amic_post.erb index 19e6475e..66c4e844 100644 --- a/ridlbe/c++11/templates/cli/hdr/ami/interface_amic_post.erb +++ b/ridlbe/c++11/templates/cli/hdr/ami/interface_amic_post.erb @@ -7,7 +7,7 @@ protected: using _shared_ptr_type = std::shared_ptr<<%= cxxname %>>; template - friend TAOX11_CORBA::object_reference<_Tp1> TAOX11_CORBA::make_reference(Args&& ...args); + friend constexpr TAOX11_CORBA::object_reference<_Tp1> TAOX11_CORBA::make_reference(Args&& ...args); explicit <%= amic_cxxname %> (<%= proxy_cxxname %>_ptr p, bool inherited = false); <%= amic_cxxname %> () = default; diff --git a/ridlbe/c++11/templates/cli/hdr/interface_post.erb b/ridlbe/c++11/templates/cli/hdr/interface_post.erb index 82176722..20322c74 100644 --- a/ridlbe/c++11/templates/cli/hdr/interface_post.erb +++ b/ridlbe/c++11/templates/cli/hdr/interface_post.erb @@ -44,7 +44,7 @@ protected: using _shared_ptr_type = std::shared_ptr<<%= cxxname %>>; template - friend TAOX11_CORBA::object_reference<_Tp1> TAOX11_CORBA::make_reference(Args&& ...args); + friend constexpr TAOX11_CORBA::object_reference<_Tp1> TAOX11_CORBA::make_reference(Args&& ...args); explicit <%= cxxname %> (<%= proxy_cxxname %>_ptr p, bool inherited = false); /// Default constructor diff --git a/ridlbe/c++11/templates/cli/hdr/valuetype_init.erb b/ridlbe/c++11/templates/cli/hdr/valuetype_init.erb index d7358204..ac8c7227 100644 --- a/ridlbe/c++11/templates/cli/hdr/valuetype_init.erb +++ b/ridlbe/c++11/templates/cli/hdr/valuetype_init.erb @@ -9,7 +9,7 @@ public: template friend struct TAOX11_CORBA::object_traits; % if is_concrete? template - friend TAOX11_CORBA::object_reference<_Tp1> TAOX11_CORBA::make_reference(Args&& ...args); + friend constexpr TAOX11_CORBA::object_reference<_Tp1> TAOX11_CORBA::make_reference(Args&& ...args); TAOX11_IDL::traits::ref_type create_for_unmarshal () override; diff --git a/tao/x11/PolicyC.h b/tao/x11/PolicyC.h index 626a47a0..18ef06e2 100644 --- a/tao/x11/PolicyC.h +++ b/tao/x11/PolicyC.h @@ -234,7 +234,7 @@ namespace TAOX11_NAMESPACE protected: template - friend object_reference<_Tp1> make_reference(Args&& ...args); + friend constexpr object_reference<_Tp1> make_reference(Args&& ...args); Policy (); explicit Policy (TAOX11_NAMESPACE::Object_proxy_ptr op); diff --git a/tao/x11/object.h b/tao/x11/object.h index fc683714..cece26be 100644 --- a/tao/x11/object.h +++ b/tao/x11/object.h @@ -147,7 +147,7 @@ namespace TAOX11_NAMESPACE template friend struct object_traits; template - friend object_reference<_Tp1> make_reference(Args&& ...args); + friend constexpr object_reference<_Tp1> make_reference(Args&& ...args); explicit Object (Object_proxy_ptr op = nullptr); Object(const Object&) = delete; diff --git a/tao/x11/object_traits_t.h b/tao/x11/object_traits_t.h index d1e81c3d..4c4a87f3 100644 --- a/tao/x11/object_traits_t.h +++ b/tao/x11/object_traits_t.h @@ -34,7 +34,7 @@ namespace TAOX11_NAMESPACE template ::value>::type, typename ...Args> - object_reference make_reference(Args&& ...args); + constexpr object_reference make_reference(Args&& ...args); template class weak_object_reference; @@ -56,7 +56,7 @@ namespace TAOX11_NAMESPACE typename = typename std::enable_if::value>::type, typename ...Args> - static inline object_reference make_reference(Args&& ...args) + static inline constexpr object_reference make_reference(Args&& ...args) { return TAOX11_CORBA::make_reference(std::forward (args)...); } @@ -131,7 +131,7 @@ namespace TAOX11_NAMESPACE template friend class abstractbase_reference; template friend class weak_abstractbase_reference; template - friend object_reference<_Tp1> make_reference(Args&& ...args); + friend constexpr object_reference<_Tp1> make_reference(Args&& ...args); friend class Object; template - inline object_reference make_reference(Args&& ...args) + inline constexpr object_reference make_reference(Args&& ...args) { return object_reference (new T (std::forward (args)...)); } diff --git a/tao/x11/orb.h b/tao/x11/orb.h index b5882e30..4ce84195 100644 --- a/tao/x11/orb.h +++ b/tao/x11/orb.h @@ -357,7 +357,7 @@ namespace TAOX11_NAMESPACE friend ORB_Registry; template - friend object_reference<_Tp1> make_reference(Args&& ...args); + friend constexpr object_reference<_Tp1> make_reference(Args&& ...args); explicit ORB (ORB_Proxy_ptr op); diff --git a/tao/x11/portable_server/poa_policies_impl.h b/tao/x11/portable_server/poa_policies_impl.h index b3c1a284..f67e2753 100644 --- a/tao/x11/portable_server/poa_policies_impl.h +++ b/tao/x11/portable_server/poa_policies_impl.h @@ -28,7 +28,7 @@ namespace TAOX11_NAMESPACE { \ protected: \ template \ - friend CORBA::object_reference<_Tp1> CORBA::make_reference(Args&& ...args); \ + friend constexpr CORBA::object_reference<_Tp1> CORBA::make_reference(Args&& ...args); \ \ explicit name ## _impl (TAO_PORTABLE_SERVER::name ## _ptr _pol); \ ~name ## _impl () = default; \ diff --git a/tao/x11/portable_server/portableserver_impl.h b/tao/x11/portable_server/portableserver_impl.h index 2f524bb8..fedc5213 100644 --- a/tao/x11/portable_server/portableserver_impl.h +++ b/tao/x11/portable_server/portableserver_impl.h @@ -164,7 +164,7 @@ namespace TAOX11_NAMESPACE { private: template - friend CORBA::object_reference<_Tp1> CORBA::make_reference(Args&& ...args); + friend constexpr CORBA::object_reference<_Tp1> CORBA::make_reference(Args&& ...args); explicit POA_impl (POA_proxy_ptr op); @@ -213,7 +213,7 @@ namespace TAOX11_NAMESPACE { private: template - friend CORBA::object_reference<_Tp1> CORBA::make_reference(Args&& ...args); + friend constexpr CORBA::object_reference<_Tp1> CORBA::make_reference(Args&& ...args); explicit POAManager_impl (POAManager_proxy_ptr op); @@ -254,7 +254,7 @@ namespace TAOX11_NAMESPACE { private: template - friend CORBA::object_reference<_Tp1> CORBA::make_reference(Args&& ...args); + friend constexpr CORBA::object_reference<_Tp1> CORBA::make_reference(Args&& ...args); explicit POAManagerFactory_impl (POAManagerFactory_proxy_ptr op); @@ -293,7 +293,7 @@ namespace TAOX11_NAMESPACE { private: template - friend CORBA::object_reference<_Tp1> CORBA::make_reference(Args&& ...args); + friend constexpr CORBA::object_reference<_Tp1> CORBA::make_reference(Args&& ...args); explicit POA_Current_impl (POA_Current_proxy_ptr op); From 0a8600e0a11ea98a35f9bba18c851c283f4b6b4d Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 5 Oct 2023 12:25:00 +0200 Subject: [PATCH 2/9] More constexpr make_reference changes * ridlbe/c++11/templates/cli/hdr/valuebox_def.erb: * ridlbe/c++11/templates/cli/hdr/valuebox_traits.erb: * ridlbe/c++11/templates/cli/hdr/valuetype_obv.erb: * ridlbe/c++11/templates/cli/hdr/valuetype_traits.erb: * ridlbe/c++11/templates/impl/hdr/interface_pre.erb: * tao/x11/valuetype/valuetype_traits_t.h: --- ridlbe/c++11/templates/cli/hdr/valuebox_def.erb | 2 +- ridlbe/c++11/templates/cli/hdr/valuebox_traits.erb | 2 +- ridlbe/c++11/templates/cli/hdr/valuetype_obv.erb | 2 +- ridlbe/c++11/templates/cli/hdr/valuetype_traits.erb | 2 +- ridlbe/c++11/templates/impl/hdr/interface_pre.erb | 2 +- tao/x11/valuetype/valuetype_traits_t.h | 12 +++++------- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/ridlbe/c++11/templates/cli/hdr/valuebox_def.erb b/ridlbe/c++11/templates/cli/hdr/valuebox_def.erb index c3023b9e..7fff5374 100644 --- a/ridlbe/c++11/templates/cli/hdr/valuebox_def.erb +++ b/ridlbe/c++11/templates/cli/hdr/valuebox_def.erb @@ -27,7 +27,7 @@ public: protected: template - friend TAOX11_CORBA::valuetype_reference<_Tp1> TAOX11_CORBA::make_reference(Args&& ...args); + friend constexpr TAOX11_CORBA::valuetype_reference<_Tp1> TAOX11_CORBA::make_reference(Args&& ...args); static const std::string __<%= cxxname.downcase %>_repository_id; diff --git a/ridlbe/c++11/templates/cli/hdr/valuebox_traits.erb b/ridlbe/c++11/templates/cli/hdr/valuebox_traits.erb index 0d51a375..d7671a41 100644 --- a/ridlbe/c++11/templates/cli/hdr/valuebox_traits.erb +++ b/ridlbe/c++11/templates/cli/hdr/valuebox_traits.erb @@ -18,7 +18,7 @@ namespace TAOX11_NAMESPACE static ref_type narrow (valuetype_reference); template - inline static ref_type make_reference(Args&& ...args) + inline static constexpr ref_type make_reference(Args&& ...args) { return TAOX11_CORBA::make_reference<<%= scoped_cxxtype %>> (std::forward (args)...); } diff --git a/ridlbe/c++11/templates/cli/hdr/valuetype_obv.erb b/ridlbe/c++11/templates/cli/hdr/valuetype_obv.erb index b14dd819..70c5bd56 100644 --- a/ridlbe/c++11/templates/cli/hdr/valuetype_obv.erb +++ b/ridlbe/c++11/templates/cli/hdr/valuetype_obv.erb @@ -44,7 +44,7 @@ namespace obv public: % if is_concrete? template - friend TAOX11_CORBA::valuetype_reference<_Tp1> TAOX11_CORBA::make_reference(Args&& ...args); + friend constexpr TAOX11_CORBA::valuetype_reference<_Tp1> TAOX11_CORBA::make_reference(Args&& ...args); TAOX11_IDL::traits::ref_type _copy_value () const override; diff --git a/ridlbe/c++11/templates/cli/hdr/valuetype_traits.erb b/ridlbe/c++11/templates/cli/hdr/valuetype_traits.erb index c85ceb58..1c4b91b9 100644 --- a/ridlbe/c++11/templates/cli/hdr/valuetype_traits.erb +++ b/ridlbe/c++11/templates/cli/hdr/valuetype_traits.erb @@ -59,7 +59,7 @@ namespace TAOX11_NAMESPACE typename = typename std::enable_if, TInst>::value>::type, typename ...Args> - inline static ref_type make_reference(Args&& ...args) + inline static constexpr ref_type make_reference(Args&& ...args) { return TAOX11_CORBA::make_reference (std::forward (args)...); } diff --git a/ridlbe/c++11/templates/impl/hdr/interface_pre.erb b/ridlbe/c++11/templates/impl/hdr/interface_pre.erb index 20a12df9..0fe909e2 100644 --- a/ridlbe/c++11/templates/impl/hdr/interface_pre.erb +++ b/ridlbe/c++11/templates/impl/hdr/interface_pre.erb @@ -15,7 +15,7 @@ namespace _impl template friend class CORBA::servant_reference; template - friend CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...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: diff --git a/tao/x11/valuetype/valuetype_traits_t.h b/tao/x11/valuetype/valuetype_traits_t.h index 7491c11b..42cf9679 100644 --- a/tao/x11/valuetype/valuetype_traits_t.h +++ b/tao/x11/valuetype/valuetype_traits_t.h @@ -46,7 +46,7 @@ namespace TAOX11_NAMESPACE std::enable_if::value, void, CORBA::ValueBase>::type, T>::value>::type, typename ...Args> - valuetype_reference make_reference(Args&& ...args); + constexpr valuetype_reference make_reference(Args&& ...args); template class weak_valuetype_reference; @@ -65,7 +65,7 @@ namespace TAOX11_NAMESPACE } template - inline static valuetype_reference make_reference(Args&& ...args) + inline static constexpr valuetype_reference make_reference(Args&& ...args) { return TAOX11_CORBA::make_reference (std::forward (args)...); } @@ -160,7 +160,7 @@ namespace TAOX11_NAMESPACE template friend class abstractbase_reference; template friend class weak_abstractbase_reference; template - friend valuetype_reference<_Tp1> make_reference(Args&& ...args); + friend constexpr valuetype_reference<_Tp1> make_reference(Args&& ...args); friend class ValueBase; template - inline valuetype_reference make_reference(Args&& ...args) + template + inline constexpr valuetype_reference make_reference(Args&& ...args) { return valuetype_reference (new T (std::forward (args)...)); } From b4346edf4aee847e0f6e56801cda5e40e48f0b9e Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 5 Oct 2023 13:26:42 +0200 Subject: [PATCH 3/9] More constexpr changes * tao/x11/portable_server/servant_traits_t.h: * tao/x11/portable_server/servantbase.h: --- tao/x11/portable_server/servant_traits_t.h | 6 +++--- tao/x11/portable_server/servantbase.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tao/x11/portable_server/servant_traits_t.h b/tao/x11/portable_server/servant_traits_t.h index 0aba4ee9..a7311640 100644 --- a/tao/x11/portable_server/servant_traits_t.h +++ b/tao/x11/portable_server/servant_traits_t.h @@ -35,7 +35,7 @@ namespace TAOX11_NAMESPACE template ::value>::type, typename ...Args> - servant_reference make_reference(Args&& ...args); + constexpr servant_reference make_reference(Args&& ...args); template class weak_servant_reference; @@ -133,7 +133,7 @@ namespace TAOX11_NAMESPACE template friend class valuetype_reference; template friend class weak_valuetype_reference; template - friend servant_reference<_Tp1> make_reference(Args&& ...args); + friend constexpr servant_reference<_Tp1> make_reference(Args&& ...args); friend class PortableServer::Servant; template @@ -232,7 +232,7 @@ namespace TAOX11_NAMESPACE }; template - inline servant_reference make_reference(Args&& ...args) + inline constexpr servant_reference make_reference(Args&& ...args) { return servant_reference (new T (std::forward (args)...)); } diff --git a/tao/x11/portable_server/servantbase.h b/tao/x11/portable_server/servantbase.h index 7b4c5032..ff8667c7 100644 --- a/tao/x11/portable_server/servantbase.h +++ b/tao/x11/portable_server/servantbase.h @@ -66,7 +66,7 @@ namespace TAOX11_NAMESPACE { protected: using _shared_ptr_type =_ref_type::shared_ptr_type; template - friend CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args); + friend constexpr CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args); virtual ~Servant () = default; From 2dbb6c5b04f6c15be02bb6adc8bf41700a6d21ce Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 5 Oct 2023 14:00:18 +0200 Subject: [PATCH 4/9] Updated for constr change * tests/custom_format/custom_format_impl.h: --- tests/custom_format/custom_format_impl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/custom_format/custom_format_impl.h b/tests/custom_format/custom_format_impl.h index 690298f5..96cd20ef 100644 --- a/tests/custom_format/custom_format_impl.h +++ b/tests/custom_format/custom_format_impl.h @@ -39,12 +39,12 @@ namespace Test //@@{__RIDL_REGEN_MARKER__} - END : Test::Foo_impl[Constructors] /// Destructor - virtual ~Foo_impl (); + ~Foo_impl () override; template friend class CORBA::servant_reference; template - friend CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args); + friend constexpr CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args); //@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Foo_impl[User Protected] // your protected definitions From 46cb98523bfa8ba041066897c6c6594bb8507d8f Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 5 Oct 2023 14:01:06 +0200 Subject: [PATCH 5/9] Layout change * ridlbe/c++11/templates/impl/hdr/attribute.erb: --- ridlbe/c++11/templates/impl/hdr/attribute.erb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ridlbe/c++11/templates/impl/hdr/attribute.erb b/ridlbe/c++11/templates/impl/hdr/attribute.erb index 49dc1f17..91a4b474 100644 --- a/ridlbe/c++11/templates/impl/hdr/attribute.erb +++ b/ridlbe/c++11/templates/impl/hdr/attribute.erb @@ -4,6 +4,5 @@ <%= cxxname %> () override; % unless is_readonly? -void -<%= cxxname %> (<%= implementation_in_type %> _v) override; +void <%= cxxname %> (<%= implementation_in_type %> _v) override; % end From eb54f9beb14ac9332b933d3e5eef86ca7780c833 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 5 Oct 2023 14:03:53 +0200 Subject: [PATCH 6/9] Redundant empty lines * tests/ami_test/ami/server.cpp: * tests/ami_test/ami_collocation/collocation_tester.cpp: * tests/ami_test/annotations/server.cpp: * tests/ami_test/attr_raises/server.cpp: --- tests/ami_test/ami/server.cpp | 1 - tests/ami_test/ami_collocation/collocation_tester.cpp | 3 --- tests/ami_test/annotations/server.cpp | 1 - tests/ami_test/attr_raises/server.cpp | 1 - 4 files changed, 6 deletions(-) diff --git a/tests/ami_test/ami/server.cpp b/tests/ami_test/ami/server.cpp index 98f8efdd..6c3c4dd5 100644 --- a/tests/ami_test/ami/server.cpp +++ b/tests/ami_test/ami/server.cpp @@ -69,7 +69,6 @@ main(int argc, ACE_TCHAR *argv[]) CORBA::servant_traits::ref_type hello_impl = CORBA::make_reference (_orb); - TAOX11_TEST_INFO << "created A::AMI_Test servant" << std::endl; PortableServer::ObjectId id = root_poa->activate_object (hello_impl); diff --git a/tests/ami_test/ami_collocation/collocation_tester.cpp b/tests/ami_test/ami_collocation/collocation_tester.cpp index 340deb54..807da572 100644 --- a/tests/ami_test/ami_collocation/collocation_tester.cpp +++ b/tests/ami_test/ami_collocation/collocation_tester.cpp @@ -109,11 +109,9 @@ Collocation_Test::init (int argc, char *argv[]) return 1; } - CORBA::servant_traits::ref_type hello_impl = CORBA::make_reference (); - TAOX11_TEST_INFO << "created A::AMI_Test servant" << std::endl; PortableServer::ObjectId id = this->root_poa_->activate_object (hello_impl); @@ -129,7 +127,6 @@ Collocation_Test::init (int argc, char *argv[]) return 1; } - CORBA::amic_traits::replyhandler_servant_ref_type test_handler_impl = CORBA::make_reference (); diff --git a/tests/ami_test/annotations/server.cpp b/tests/ami_test/annotations/server.cpp index 9fb16ea9..9adbda36 100644 --- a/tests/ami_test/annotations/server.cpp +++ b/tests/ami_test/annotations/server.cpp @@ -68,7 +68,6 @@ main(int argc, ACE_TCHAR *argv[]) CORBA::servant_traits::ref_type hello_impl = CORBA::make_reference (_orb); - TAOX11_TEST_INFO << "created Hello servant" << std::endl; PortableServer::ObjectId id = root_poa->activate_object (hello_impl); diff --git a/tests/ami_test/attr_raises/server.cpp b/tests/ami_test/attr_raises/server.cpp index 9fb16ea9..9adbda36 100644 --- a/tests/ami_test/attr_raises/server.cpp +++ b/tests/ami_test/attr_raises/server.cpp @@ -68,7 +68,6 @@ main(int argc, ACE_TCHAR *argv[]) CORBA::servant_traits::ref_type hello_impl = CORBA::make_reference (_orb); - TAOX11_TEST_INFO << "created Hello servant" << std::endl; PortableServer::ObjectId id = root_poa->activate_object (hello_impl); From 930c1fb1f90641ba13b80ad824a8350e78c50009 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 5 Oct 2023 15:03:17 +0200 Subject: [PATCH 7/9] More constexpr changes * tests/hello_regen/test_impl.cpp: * tests/hello_regen/test_impl.h: * tests/obv/simple/client_i.h: * tests/write_traits/write_traits_impl.h: --- tests/hello_regen/test_impl.cpp | 4 ---- tests/hello_regen/test_impl.h | 7 +++---- tests/obv/simple/client_i.h | 3 +-- tests/write_traits/write_traits_impl.h | 4 ++-- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/hello_regen/test_impl.cpp b/tests/hello_regen/test_impl.cpp index ccd777b6..6a5988d9 100644 --- a/tests/hello_regen/test_impl.cpp +++ b/tests/hello_regen/test_impl.cpp @@ -19,7 +19,6 @@ namespace Test // generated from ImplSourceWriter#enter_interface // generated from c++11/templates/impl/src/interface_pre - namespace _impl { //@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Foo[Constructors] @@ -38,7 +37,6 @@ namespace Test } // generated from c++11/templates/impl/src/interface_post - //@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Foo[User Public] // your public implementations //@@{__RIDL_REGEN_MARKER__} - END : Test::Foo[User Public] @@ -57,7 +55,6 @@ namespace Test // generated from ImplSourceWriter#enter_interface // generated from c++11/templates/impl/src/interface_pre - namespace _impl { //@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Hello[Constructors] @@ -137,7 +134,6 @@ namespace Test } // generated from c++11/templates/impl/src/interface_post - //@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Hello[User Public] // your public implementations //@@{__RIDL_REGEN_MARKER__} - END : Test::Hello[User Public] diff --git a/tests/hello_regen/test_impl.h b/tests/hello_regen/test_impl.h index c88e3e97..dfbbe87f 100644 --- a/tests/hello_regen/test_impl.h +++ b/tests/hello_regen/test_impl.h @@ -43,7 +43,7 @@ namespace Test template friend class CORBA::servant_reference; template - friend CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args); + friend constexpr CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args); //@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Foo[User Protected] // your protected definitions @@ -89,7 +89,7 @@ namespace Test template friend class CORBA::servant_reference; template - friend CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args); + friend constexpr CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args); //@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Hello[User Protected] // your protected definitions @@ -100,8 +100,7 @@ namespace Test int32_t int_prop () override; - void - int_prop (int32_t _v) override; + void int_prop (int32_t _v) override; // generated from c++11/templates/impl/hdr/operation /// @copydoc test.idl::Test::Hello::get_string diff --git a/tests/obv/simple/client_i.h b/tests/obv/simple/client_i.h index 5d96587f..942bbcc1 100644 --- a/tests/obv/simple/client_i.h +++ b/tests/obv/simple/client_i.h @@ -27,7 +27,7 @@ class Client_i final void shutdown () override; template - friend CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args); + friend constexpr CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args); protected: using base_type = CORBA::servant_traits::base_type; @@ -43,7 +43,6 @@ class Client_i final Client_i (Client_i&&) = delete; Client_i& operator= (const Client_i&) = delete; Client_i& operator= (Client_i&&) = delete; - }; #endif diff --git a/tests/write_traits/write_traits_impl.h b/tests/write_traits/write_traits_impl.h index a1bccc5f..e39a8777 100644 --- a/tests/write_traits/write_traits_impl.h +++ b/tests/write_traits/write_traits_impl.h @@ -39,12 +39,12 @@ namespace Test //@@{__RIDL_REGEN_MARKER__} - END : Test::Foo_impl[Constructors] /// Destructor - virtual ~Foo_impl (); + ~Foo_impl () override; template friend class CORBA::servant_reference; template - friend CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args); + friend constexpr CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args); //@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Foo_impl[User Protected] // your protected definitions From 9be512a451178de17eb7b2e69789784ff6116b60 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 5 Oct 2023 16:36:53 +0200 Subject: [PATCH 8/9] Use public constructors, at that moment we don't need to add friends * 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: --- .../c++11/templates/impl/hdr/interface_pre.erb | 11 +++-------- tests/custom_format/custom_format_impl.h | 8 +------- tests/hello_regen/test_impl.h | 18 ++++-------------- tests/obv/simple/client_i.h | 4 ---- tests/write_traits/write_traits_impl.h | 8 +------- 5 files changed, 9 insertions(+), 40 deletions(-) diff --git a/ridlbe/c++11/templates/impl/hdr/interface_pre.erb b/ridlbe/c++11/templates/impl/hdr/interface_pre.erb index 0fe909e2..c9d75207 100644 --- a/ridlbe/c++11/templates/impl/hdr/interface_pre.erb +++ b/ridlbe/c++11/templates/impl/hdr/interface_pre.erb @@ -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 friend class CORBA::servant_reference; - - template - 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? @@ -39,4 +32,6 @@ namespace _impl //@} % end % end +% nest(2) { write_regen_section("#{scoped_cxxname}"+'[User Protected]', default_content: '// your protected definitions') } + % inc_nest diff --git a/tests/custom_format/custom_format_impl.h b/tests/custom_format/custom_format_impl.h index 96cd20ef..840f0ce1 100644 --- a/tests/custom_format/custom_format_impl.h +++ b/tests/custom_format/custom_format_impl.h @@ -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::ref_type orb); @@ -41,15 +41,9 @@ namespace Test /// Destructor ~Foo_impl () override; - template friend class CORBA::servant_reference; - - template - 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 diff --git a/tests/hello_regen/test_impl.h b/tests/hello_regen/test_impl.h index dfbbe87f..a31404be 100644 --- a/tests/hello_regen/test_impl.h +++ b/tests/hello_regen/test_impl.h @@ -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 (); @@ -40,15 +40,10 @@ namespace Test /// Destructor ~Foo () override; - template friend class CORBA::servant_reference; - - template - 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] @@ -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::ref_type orb); @@ -86,15 +81,10 @@ namespace Test /// Destructor ~Hello () override; - template friend class CORBA::servant_reference; - - template - 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 diff --git a/tests/obv/simple/client_i.h b/tests/obv/simple/client_i.h index 942bbcc1..c8e04597 100644 --- a/tests/obv/simple/client_i.h +++ b/tests/obv/simple/client_i.h @@ -26,10 +26,6 @@ class Client_i final void shutdown () override; - template - friend constexpr CORBA::servant_reference<_Tp1> CORBA::make_reference(Args&& ...args); - -protected: using base_type = CORBA::servant_traits::base_type; Client_i (CORBA::ORB::_ref_type orb) diff --git a/tests/write_traits/write_traits_impl.h b/tests/write_traits/write_traits_impl.h index e39a8777..cf98e597 100644 --- a/tests/write_traits/write_traits_impl.h +++ b/tests/write_traits/write_traits_impl.h @@ -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::ref_type orb); @@ -41,15 +41,9 @@ namespace Test /// Destructor ~Foo_impl () override; - template friend class CORBA::servant_reference; - - template - 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 From 5d24ac3a55c7d7481c8cf7819028c32e3a7ac88e Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 5 Oct 2023 17:30:19 +0200 Subject: [PATCH 9/9] Indentation chagnes * ridlbe/c++11/templates/cli/hdr/ami/attribute.erb: * ridlbe/c++11/templates/cli/hdr/ami/attribute_amic.erb: * ridlbe/c++11/templates/cli/hdr/ami/operation.erb: * ridlbe/c++11/templates/cli/hdr/ami/operation_amic.erb: * ridlbe/c++11/templates/cli/prx/ami/attribute.erb: * ridlbe/c++11/templates/cli/prx/ami/operation.erb: * ridlbe/c++11/templates/cli/src/ami/attribute_amic.erb: * ridlbe/c++11/templates/cli/src/ami/operation_amic.erb: * ridlbe/c++11/templates/srv/prx/ami/interface_post.erb: --- .../c++11/templates/cli/hdr/ami/attribute.erb | 12 +++---- .../templates/cli/hdr/ami/attribute_amic.erb | 12 +++---- .../c++11/templates/cli/hdr/ami/operation.erb | 3 +- .../templates/cli/hdr/ami/operation_amic.erb | 7 ++-- .../c++11/templates/cli/prx/ami/attribute.erb | 12 +++---- .../c++11/templates/cli/prx/ami/operation.erb | 6 ++-- .../templates/cli/src/ami/attribute_amic.erb | 12 +++---- .../templates/cli/src/ami/operation_amic.erb | 7 ++-- .../templates/srv/prx/ami/interface_post.erb | 36 +++++++++---------- 9 files changed, 48 insertions(+), 59 deletions(-) diff --git a/ridlbe/c++11/templates/cli/hdr/ami/attribute.erb b/ridlbe/c++11/templates/cli/hdr/ami/attribute.erb index ff5d8353..c5a80828 100644 --- a/ridlbe/c++11/templates/cli/hdr/ami/attribute.erb +++ b/ridlbe/c++11/templates/cli/hdr/ami/attribute.erb @@ -2,17 +2,13 @@ // generated from <%= ridl_template_path %> /// @copydoc <%= doc_scoped_name %> //@{ -void -get_<%= name %> (<%= scoped_cxx_in_type %> ami_return_val); +void get_<%= name %> (<%= scoped_cxx_in_type %> ami_return_val); -void -get_<%= name %>_excep (IDL::traits::ref_type excep_holder); +void get_<%= name %>_excep (IDL::traits::ref_type excep_holder); % unless is_readonly? -void -set_<%= name %> (); +void set_<%= name %> (); -void -set_<%= name %>_excep (IDL::traits::ref_type excep_holder); +void set_<%= name %>_excep (IDL::traits::ref_type excep_holder); % end //@} diff --git a/ridlbe/c++11/templates/cli/hdr/ami/attribute_amic.erb b/ridlbe/c++11/templates/cli/hdr/ami/attribute_amic.erb index 2fc5370a..e9fe9779 100644 --- a/ridlbe/c++11/templates/cli/hdr/ami/attribute_amic.erb +++ b/ridlbe/c++11/templates/cli/hdr/ami/attribute_amic.erb @@ -1,12 +1,10 @@ // generated from <%= ridl_template_path %> -void -<%= sendc_prefix_get %><%= name %> ( - <%= interface.handler_scoped_cxx_in_type %> ami_handler); +void <%= sendc_prefix_get %><%= name %> ( + <%= interface.handler_scoped_cxx_in_type %> ami_handler); % unless is_readonly? -void -<%= sendc_prefix_set %><%= name %> ( - <%= interface.handler_scoped_cxx_in_type %> ami_handler, - <%= cxx_in_type %> _x11_<%= cxxname %>); +void <%= sendc_prefix_set %><%= name %> ( + <%= interface.handler_scoped_cxx_in_type %> ami_handler, + <%= cxx_in_type %> _x11_<%= cxxname %>); % end diff --git a/ridlbe/c++11/templates/cli/hdr/ami/operation.erb b/ridlbe/c++11/templates/cli/hdr/ami/operation.erb index a8c018db..36b97aa2 100644 --- a/ridlbe/c++11/templates/cli/hdr/ami/operation.erb +++ b/ridlbe/c++11/templates/cli/hdr/ami/operation.erb @@ -11,5 +11,4 @@ void <%= _arg.direction == :out ? _arg.scoped_cxx_in_type : _arg.scoped_cxx_inout_type%> <%= _arg.cxxname %><%= _args.empty? ? ');' : ',' %> % end -void -<%= name %>_excep (IDL::traits::ref_type excep_holder); +void <%= name %>_excep (IDL::traits::ref_type excep_holder); diff --git a/ridlbe/c++11/templates/cli/hdr/ami/operation_amic.erb b/ridlbe/c++11/templates/cli/hdr/ami/operation_amic.erb index 240f3518..aab98b67 100644 --- a/ridlbe/c++11/templates/cli/hdr/ami/operation_amic.erb +++ b/ridlbe/c++11/templates/cli/hdr/ami/operation_amic.erb @@ -1,9 +1,8 @@ // generated from <%= ridl_template_path %> % _args = in_arguments.dup -void -<%= sendc_prefix %><%= name %> ( - <%= interface.handler_scoped_cxx_in_type %> ami_handler<%= _args.empty? ? ');' : ',' %> +void <%= sendc_prefix %><%= name %> ( + <%= interface.handler_scoped_cxx_in_type %> ami_handler<%= _args.empty? ? ');' : ',' %> % while !_args.empty? % _arg = _args.shift - <%= _arg.stub_arg_type %> <%= _arg.cxxname %><%= _args.empty? ? ');' : ',' %> + <%= _arg.stub_arg_type %> <%= _arg.cxxname %><%= _args.empty? ? ');' : ',' %> % end diff --git a/ridlbe/c++11/templates/cli/prx/ami/attribute.erb b/ridlbe/c++11/templates/cli/prx/ami/attribute.erb index 3be0f589..f4551001 100644 --- a/ridlbe/c++11/templates/cli/prx/ami/attribute.erb +++ b/ridlbe/c++11/templates/cli/prx/ami/attribute.erb @@ -1,14 +1,14 @@ // generated from <%= ridl_template_path %> static void get_<%= name %>_reply_stub ( - TAO_InputCDR &_tao_reply_cdr, - TAO_MESSAGING::ReplyHandler_ptr _tao_reply_handler, - TAO_CORBA::ULong reply_status); + TAO_InputCDR &_tao_reply_cdr, + TAO_MESSAGING::ReplyHandler_ptr _tao_reply_handler, + TAO_CORBA::ULong reply_status); % unless is_readonly? static void set_<%= name %>_reply_stub ( - TAO_InputCDR &_tao_reply_cdr, - TAO_MESSAGING::ReplyHandler_ptr _reply_handler, - TAO_CORBA::ULong reply_status); + TAO_InputCDR &_tao_reply_cdr, + TAO_MESSAGING::ReplyHandler_ptr _reply_handler, + TAO_CORBA::ULong reply_status); % end diff --git a/ridlbe/c++11/templates/cli/prx/ami/operation.erb b/ridlbe/c++11/templates/cli/prx/ami/operation.erb index bdb82d22..44668d68 100644 --- a/ridlbe/c++11/templates/cli/prx/ami/operation.erb +++ b/ridlbe/c++11/templates/cli/prx/ami/operation.erb @@ -1,5 +1,5 @@ // generated from <%= ridl_template_path %> static void <%= name %>_reply_stub ( - TAO_InputCDR &_tao_reply_cdr, - TAO_MESSAGING::ReplyHandler_ptr _tao_reply_handler, - TAO_CORBA::ULong reply_status); + TAO_InputCDR &_tao_reply_cdr, + TAO_MESSAGING::ReplyHandler_ptr _tao_reply_handler, + TAO_CORBA::ULong reply_status); diff --git a/ridlbe/c++11/templates/cli/src/ami/attribute_amic.erb b/ridlbe/c++11/templates/cli/src/ami/attribute_amic.erb index c3c12af9..fa7a0743 100644 --- a/ridlbe/c++11/templates/cli/src/ami/attribute_amic.erb +++ b/ridlbe/c++11/templates/cli/src/ami/attribute_amic.erb @@ -1,9 +1,8 @@ % unless interface.is_local? // generated from <%= ridl_template_path %> -void -<%= interface.amic_scoped_cxxname %>::<%= sendc_prefix_get %><%= name %>( - <%= interface.handler_scoped_cxx_in_type %> ami_handler) +void <%= interface.amic_scoped_cxxname %>::<%= sendc_prefix_get %><%= name %>( + <%= interface.handler_scoped_cxx_in_type %> ami_handler) { % if interface.is_abstract? if (!this->_is_object ()) @@ -58,10 +57,9 @@ void } % unless is_readonly? -void -<%= interface.amic_scoped_cxxname %>::<%= sendc_prefix_set %><%= name %>( - <%= interface.handler_scoped_cxx_in_type %> ami_handler, - <%= cxx_in_type %> _x11_<%= cxxname %>) +void <%= interface.amic_scoped_cxxname %>::<%= sendc_prefix_set %><%= name %>( + <%= interface.handler_scoped_cxx_in_type %> ami_handler, + <%= cxx_in_type %> _x11_<%= cxxname %>) { % if interface.is_abstract? if (!this->_is_object ()) diff --git a/ridlbe/c++11/templates/cli/src/ami/operation_amic.erb b/ridlbe/c++11/templates/cli/src/ami/operation_amic.erb index 46af365b..6b69b6dc 100644 --- a/ridlbe/c++11/templates/cli/src/ami/operation_amic.erb +++ b/ridlbe/c++11/templates/cli/src/ami/operation_amic.erb @@ -2,12 +2,11 @@ // generated from <%= ridl_template_path %> % _args = in_arguments.dup -void -<%= interface.amic_scoped_cxxname %>::<%= sendc_prefix %><%= name %> ( - <%= interface.handler_scoped_cxx_in_type %> ami_handler<%= _args.empty? ? ')' : ',' %> +void <%= interface.amic_scoped_cxxname %>::<%= sendc_prefix %><%= name %> ( + <%= interface.handler_scoped_cxx_in_type %> ami_handler<%= _args.empty? ? ')' : ',' %> % while !_args.empty? % _arg = _args.shift - <%= _arg.stub_arg_type %> <%= _arg.cxxname %><%= _args.empty? ? ')' : ',' %> + <%= _arg.stub_arg_type %> <%= _arg.cxxname %><%= _args.empty? ? ')' : ',' %> % end { % if interface.is_abstract? diff --git a/ridlbe/c++11/templates/srv/prx/ami/interface_post.erb b/ridlbe/c++11/templates/srv/prx/ami/interface_post.erb index 4d4d36be..6a3373fc 100644 --- a/ridlbe/c++11/templates/srv/prx/ami/interface_post.erb +++ b/ridlbe/c++11/templates/srv/prx/ami/interface_post.erb @@ -3,34 +3,34 @@ %all_operations.each do |_op| % unless _op.is_inherited? static void <%= _op.name %>_skel ( - TAO_ServerRequest & server_request, - TAO_TAO::Portable_Server::Servant_Upcall * servant_upcall, - skel_type& servant); + TAO_ServerRequest & server_request, + TAO_TAO::Portable_Server::Servant_Upcall * servant_upcall, + skel_type& servant); static void <%= _op.name %>_excep_skel ( - TAO_ServerRequest & server_request, - TAO_TAO::Portable_Server::Servant_Upcall * servant_upcall, - skel_type& servant); + TAO_ServerRequest & server_request, + TAO_TAO::Portable_Server::Servant_Upcall * servant_upcall, + skel_type& servant); % end %end %all_attributes.each do |_att| % unless _att.is_inherited? static void get_<%= _att.name %>_skel ( - TAO_ServerRequest & server_request, - TAO_TAO::Portable_Server::Servant_Upcall * servant_upcall, - skel_type& servant); + TAO_ServerRequest & server_request, + TAO_TAO::Portable_Server::Servant_Upcall * servant_upcall, + skel_type& servant); static void get_<%= _att.name %>_excep_skel ( - TAO_ServerRequest & server_request, - TAO_TAO::Portable_Server::Servant_Upcall * servant_upcall, - skel_type& servant); + TAO_ServerRequest & server_request, + TAO_TAO::Portable_Server::Servant_Upcall * servant_upcall, + skel_type& servant); % unless _att.is_readonly? static void set_<%= _att.name %>_skel ( - TAO_ServerRequest & server_request, - TAO_TAO::Portable_Server::Servant_Upcall * servant_upcall, - skel_type& servant); + TAO_ServerRequest & server_request, + TAO_TAO::Portable_Server::Servant_Upcall * servant_upcall, + skel_type& servant); static void set_<%= _att.name %>_excep_skel ( - TAO_ServerRequest & server_request, - TAO_TAO::Portable_Server::Servant_Upcall * servant_upcall, - skel_type& servant); + TAO_ServerRequest & server_request, + TAO_TAO::Portable_Server::Servant_Upcall * servant_upcall, + skel_type& servant); % end % end %end