From 31740fc585aa2c0fcdad4bfbde110fabd31796f2 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 12 Apr 2018 14:06:48 +0200 Subject: Don't use auto_ptr for the fragmentation strategy, that was the only one that used this in the ORB interface. With C++17 auto_ptr has been removed completely * TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp: * TAO/tao/CodecFactory/CDR_Encaps_Codec.cpp: * TAO/tao/GIOP_Fragmentation_Strategy.cpp: * TAO/tao/GIOP_Message_Base.cpp: * TAO/tao/GIOP_Message_Base.h: * TAO/tao/IIOP_Acceptor.cpp: * TAO/tao/ORB_Core.cpp: * TAO/tao/ORB_Core.h: * TAO/tao/Resource_Factory.h: * TAO/tao/default_resource.cpp: * TAO/tao/default_resource.h: --- TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp | 3 +-- TAO/tao/CodecFactory/CDR_Encaps_Codec.cpp | 1 - TAO/tao/GIOP_Fragmentation_Strategy.cpp | 1 - TAO/tao/GIOP_Message_Base.cpp | 12 ++++-------- TAO/tao/GIOP_Message_Base.h | 4 +--- TAO/tao/IIOP_Acceptor.cpp | 1 - TAO/tao/ORB_Core.cpp | 2 +- TAO/tao/ORB_Core.h | 3 +-- TAO/tao/Resource_Factory.h | 2 +- TAO/tao/default_resource.cpp | 12 ++++-------- TAO/tao/default_resource.h | 2 +- 11 files changed, 14 insertions(+), 29 deletions(-) (limited to 'TAO') diff --git a/TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp index 8c7c723a562..25d34dcf4e0 100644 --- a/TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp +++ b/TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp @@ -22,8 +22,7 @@ template TAO::Any_Array_Impl_T::Any_Array_Impl_T ( _tao_destructor destructor, CORBA::TypeCode_ptr tc, - T_slice * const val - ) + T_slice * const val) : Any_Impl (destructor, tc), value_ (val) diff --git a/TAO/tao/CodecFactory/CDR_Encaps_Codec.cpp b/TAO/tao/CodecFactory/CDR_Encaps_Codec.cpp index a3ac4538d23..d81d2c728bb 100644 --- a/TAO/tao/CodecFactory/CDR_Encaps_Codec.cpp +++ b/TAO/tao/CodecFactory/CDR_Encaps_Codec.cpp @@ -13,7 +13,6 @@ #include "tao/ORB_Constants.h" #include "tao/Codeset_Translator_Base.h" -#include "ace/Auto_Ptr.h" #include "ace/OS_NS_string.h" #include "ace/CORBA_macros.h" diff --git a/TAO/tao/GIOP_Fragmentation_Strategy.cpp b/TAO/tao/GIOP_Fragmentation_Strategy.cpp index 169aecfcba5..77e62f54c1f 100644 --- a/TAO/tao/GIOP_Fragmentation_Strategy.cpp +++ b/TAO/tao/GIOP_Fragmentation_Strategy.cpp @@ -1,7 +1,6 @@ #include "tao/GIOP_Fragmentation_Strategy.h" - TAO_GIOP_Fragmentation_Strategy::~TAO_GIOP_Fragmentation_Strategy (void) { } diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp index 2970391a641..75cc21133e9 100644 --- a/TAO/tao/GIOP_Message_Base.cpp +++ b/TAO/tao/GIOP_Message_Base.cpp @@ -25,12 +25,7 @@ TAO_GIOP_Message_Base::TAO_GIOP_Message_Base (TAO_ORB_Core *orb_core, TAO_Transport *transport, size_t input_cdr_size) : orb_core_ (orb_core) -#if defined (__SUNPRO_CC) && (__SUNPRO_CC == 0x5110 || __SUNPRO_CC == 0x5120) - // initializing from auto_ptr_ref is broken on SunCC 5.11 and 5.12 - , fragmentation_strategy_ (orb_core->fragmentation_strategy (transport).release ()) -#else , fragmentation_strategy_ (orb_core->fragmentation_strategy (transport)) -#endif , out_stream_ (0, input_cdr_size, TAO_ENCAP_BYTE_ORDER, @@ -38,7 +33,7 @@ TAO_GIOP_Message_Base::TAO_GIOP_Message_Base (TAO_ORB_Core *orb_core, orb_core->output_cdr_dblock_allocator (), orb_core->output_cdr_msgblock_allocator (), orb_core->orb_params ()->cdr_memcpy_tradeoff (), - fragmentation_strategy_.get (), + fragmentation_strategy_, TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR) { @@ -61,6 +56,7 @@ TAO_GIOP_Message_Base::~TAO_GIOP_Message_Base (void) #if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1) this->out_stream_.unregister_monitor (); #endif /* TAO_HAS_MONITOR_POINTS==1 */ + delete fragmentation_strategy_; } void @@ -637,7 +633,7 @@ TAO_GIOP_Message_Base::process_request_message (TAO_Transport *transport, TAO_ENCAP_BYTE_ORDER, this->orb_core_->input_cdr_msgblock_allocator (), this->orb_core_->orb_params ()->cdr_memcpy_tradeoff (), - this->fragmentation_strategy_.get (), + this->fragmentation_strategy_, qd->giop_version ().major_version (), qd->giop_version ().minor_version ()); @@ -2021,7 +2017,7 @@ TAO_GIOP_Message_Base::discard_fragmented_message (const TAO_Queued_Data *cancel TAO_GIOP_Fragmentation_Strategy * TAO_GIOP_Message_Base::fragmentation_strategy (void) { - return this->fragmentation_strategy_.get (); + return this->fragmentation_strategy_; } void diff --git a/TAO/tao/GIOP_Message_Base.h b/TAO/tao/GIOP_Message_Base.h index 8bddc6d8200..f726e620176 100644 --- a/TAO/tao/GIOP_Message_Base.h +++ b/TAO/tao/GIOP_Message_Base.h @@ -29,8 +29,6 @@ #include "tao/CDR.h" #include "tao/Incoming_Message_Stack.h" -#include "ace/Auto_Ptr.h" - TAO_BEGIN_VERSIONED_NAMESPACE_DECL class TAO_Pluggable_Reply_Params; @@ -267,7 +265,7 @@ protected: //@{ /// Strategy that sends data currently marshaled into this /// TAO_OutputCDR stream if necessary. - auto_ptr fragmentation_strategy_; + TAO_GIOP_Fragmentation_Strategy* fragmentation_strategy_; /// Buffer where the request is placed. TAO_OutputCDR out_stream_; diff --git a/TAO/tao/IIOP_Acceptor.cpp b/TAO/tao/IIOP_Acceptor.cpp index af467be5978..32eebdc1b99 100644 --- a/TAO/tao/IIOP_Acceptor.cpp +++ b/TAO/tao/IIOP_Acceptor.cpp @@ -19,7 +19,6 @@ #include "tao/IIOP_Acceptor.inl" #endif /* __ACE_INLINE__ */ -#include "ace/Auto_Ptr.h" #include "ace/OS_NS_string.h" #include "ace/os_include/os_netdb.h" diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index b96728d06ad..99397801b3f 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -3075,7 +3075,7 @@ TAO_ORB_Core::connector_registry (void) return conn; } -auto_ptr +TAO_GIOP_Fragmentation_Strategy* TAO_ORB_Core::fragmentation_strategy (TAO_Transport * transport) { return diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index 6832bac73a7..c30e9f1749d 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -37,7 +37,6 @@ #include "tao/Service_Context_Handler_Registry.h" #include "ace/Array_Map.h" -#include "ace/Auto_Ptr.h" #include "ace/Thread_Manager.h" #include "ace/Lock_Adapter_T.h" #include "ace/TSS_T.h" @@ -900,7 +899,7 @@ public: ACE_Service_Gestalt* configuration () const; /// Get outgoing fragmentation strategy. - auto_ptr + TAO_GIOP_Fragmentation_Strategy* fragmentation_strategy (TAO_Transport * transport); #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1) diff --git a/TAO/tao/Resource_Factory.h b/TAO/tao/Resource_Factory.h index 8aa7157ca9c..e2f35c788f5 100644 --- a/TAO/tao/Resource_Factory.h +++ b/TAO/tao/Resource_Factory.h @@ -236,7 +236,7 @@ public: virtual TAO_LF_Strategy *create_lf_strategy (void) = 0; /// Outgoing fragment creation strategy. - virtual auto_ptr + virtual TAO_GIOP_Fragmentation_Strategy* create_fragmentation_strategy (TAO_Transport * transport, CORBA::ULong max_message_size) const = 0; diff --git a/TAO/tao/default_resource.cpp b/TAO/tao/default_resource.cpp index 9bcd535662d..8ea0122bbb4 100644 --- a/TAO/tao/default_resource.cpp +++ b/TAO/tao/default_resource.cpp @@ -1110,14 +1110,12 @@ TAO_Default_Resource_Factory::create_lf_strategy (void) return strategy; } -auto_ptr +TAO_GIOP_Fragmentation_Strategy* TAO_Default_Resource_Factory::create_fragmentation_strategy ( TAO_Transport * transport, CORBA::ULong max_message_size) const { - auto_ptr strategy (0); - - TAO_GIOP_Fragmentation_Strategy * tmp = 0; + TAO_GIOP_Fragmentation_Strategy* strategy = 0; // Minimum GIOP message size is 24 (a multiple of 8): // 12 GIOP Message Header @@ -1136,14 +1134,14 @@ TAO_Default_Resource_Factory::create_fragmentation_strategy ( || (TAO_DEF_GIOP_MAJOR == 1 && TAO_DEF_GIOP_MINOR < 2)) { // No maximum was set by the user. - ACE_NEW_RETURN (tmp, + ACE_NEW_RETURN (strategy, TAO_Null_Fragmentation_Strategy, strategy); } else { - ACE_NEW_RETURN (tmp, + ACE_NEW_RETURN (strategy, TAO_On_Demand_Fragmentation_Strategy ( transport, max_message_size), @@ -1151,8 +1149,6 @@ TAO_Default_Resource_Factory::create_fragmentation_strategy ( } } - ACE_auto_ptr_reset (strategy, tmp); - return strategy; } diff --git a/TAO/tao/default_resource.h b/TAO/tao/default_resource.h index 6d1bcf05f31..e1ff41ce021 100644 --- a/TAO/tao/default_resource.h +++ b/TAO/tao/default_resource.h @@ -181,7 +181,7 @@ public: virtual TAO_Connection_Purging_Strategy *create_purging_strategy (void); TAO_Resource_Factory::Resource_Usage resource_usage_strategy (void) const; virtual TAO_LF_Strategy *create_lf_strategy (void); - virtual auto_ptr + virtual TAO_GIOP_Fragmentation_Strategy* create_fragmentation_strategy (TAO_Transport * transport, CORBA::ULong max_message_size) const; virtual void disable_factory (void); -- cgit v1.2.1