From 419b95663619dcdc3efba31719c382482206875f Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Wed, 9 Dec 2020 16:45:48 +0100 Subject: Removed checks for ACE_HAS_CPP11 and use std::atomic in more places in the TAO core --- TAO/orbsvcs/ImplRepo_Service/LiveCheck.h | 10 +------ .../ImplRepo_Service/Shared_Backing_Store.cpp | 4 --- TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp | 8 ------ TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp | 4 --- TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp | 4 --- TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp | 4 --- TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp | 8 ------ TAO/tao/AnyTypeCode/Any_Impl.h | 14 +-------- TAO/tao/AnyTypeCode/Any_Impl_T.cpp | 4 --- TAO/tao/AnyTypeCode/Any_Special_Impl_T.cpp | 4 --- TAO/tao/AnyTypeCode/Any_SystemException.cpp | 4 --- TAO/tao/AnyTypeCode/NVList.cpp | 4 --- TAO/tao/AnyTypeCode/NVList.h | 14 +-------- TAO/tao/AnyTypeCode/True_RefCount_Policy.h | 10 +------ TAO/tao/CDR.h | 2 -- TAO/tao/CDR.inl | 8 ------ TAO/tao/Codeset/UTF16_BOM_Translator.cpp | 4 --- TAO/tao/Codeset/UTF8_Latin1_Translator.cpp | 4 --- TAO/tao/Connector_Registry.cpp | 4 --- .../DynamicInterface/AMH_DSI_Response_Handler.cpp | 4 --- TAO/tao/DynamicInterface/Context.h | 14 +-------- TAO/tao/DynamicInterface/ExceptionList.h | 10 +------ TAO/tao/DynamicInterface/Request.h | 10 +------ TAO/tao/DynamicInterface/Server_Request.h | 10 +------ TAO/tao/Dynamic_TP/DTP_Task.cpp | 4 +-- TAO/tao/Dynamic_TP/DTP_Task.h | 3 +- TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp | 4 --- TAO/tao/IORManipulation/IORManipulation.cpp | 13 --------- TAO/tao/Intrusive_Ref_Count_Base_T.h | 11 +------- TAO/tao/Load_Protocol_Factory_T.h | 4 --- TAO/tao/ORB.h | 10 +------ TAO/tao/ORB.inl | 4 --- TAO/tao/ORB_Core.cpp | 4 --- TAO/tao/ORB_Core.h | 10 +------ TAO/tao/ORB_Core.inl | 4 --- TAO/tao/Object.cpp | 4 --- TAO/tao/Object.h | 6 +--- TAO/tao/Object_KeyC.h | 2 -- TAO/tao/PortableServer/Active_Object_Map.cpp | 33 ---------------------- TAO/tao/PortableServer/Active_Object_Map.h | 24 ---------------- TAO/tao/PortableServer/Object_Adapter.cpp | 12 -------- TAO/tao/PortableServer/Root_POA.cpp | 4 --- .../ServantRetentionStrategyNonRetain.h | 4 +-- .../ServantRetentionStrategyRetain.h | 4 --- TAO/tao/PortableServer/Servant_Base.cpp | 4 --- TAO/tao/PortableServer/Servant_Base.h | 8 ------ TAO/tao/Principal.h | 10 +------ TAO/tao/Profile.h | 12 ++------ TAO/tao/RTCORBA/Thread_Pool.cpp | 4 --- TAO/tao/RTScheduling/Current.cpp | 2 +- TAO/tao/RTScheduling/Current.h | 2 +- TAO/tao/RTScheduling/Request_Interceptor.cpp | 2 +- TAO/tao/RTScheduling/Request_Interceptor.h | 2 +- TAO/tao/Reply_Dispatcher.cpp | 4 +-- TAO/tao/Reply_Dispatcher.h | 2 +- TAO/tao/Stub.cpp | 4 --- TAO/tao/Stub.h | 12 ++------ TAO/tao/Stub.inl | 2 +- TAO/tao/Synch_Invocation.cpp | 8 ------ TAO/tao/Valuetype/AbstractBase.h | 14 +-------- TAO/tao/Valuetype/ValueBase.cpp | 4 --- TAO/tao/Valuetype/ValueBase.h | 10 +------ TAO/tao/Valuetype/ValueFactory.h | 10 +------ 63 files changed, 34 insertions(+), 412 deletions(-) diff --git a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h index 6437f7c289c..4d0602ddfca 100644 --- a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h +++ b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h @@ -22,11 +22,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/Intrusive_Ref_Count_Handle_T.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include class LiveCheck; class LiveEntry; @@ -96,11 +92,7 @@ class Locator_Export LiveListener ACE_CString server_; private: -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ }; typedef TAO_Intrusive_Ref_Count_Handle LiveListener_ptr; diff --git a/TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp b/TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp index 4d1a0915e3c..8f06171529d 100644 --- a/TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/Shared_Backing_Store.cpp @@ -161,11 +161,7 @@ namespace { #endif } -#if defined (ACE_HAS_CPP11) std::unique_ptr file_lock_; -#else - auto_ptr file_lock_; -#endif FILE* file_; int flags_; bool locked_; diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp index 2d9b6fa4280..448c6100d03 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp @@ -483,11 +483,7 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, TAO::Storable_Factory* pf = 0; ACE_CString directory (ACE_TEXT_ALWAYS_CHAR (persistence_location)); ACE_NEW_RETURN (pf, TAO::Storable_FlatFileFactory (directory), -1); -#if defined (ACE_HAS_CPP11) std::unique_ptr persFactory(pf); -#else - auto_ptr persFactory(pf); -#endif /* ACE_HAS_CPP11 */ // Use an auto_ptr to ensure that we clean up the factory in the case // of a failure in creating and registering the Activator. @@ -495,11 +491,7 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, this->storable_naming_context_factory (context_size); // Make sure we got a factory if (cf == 0) return -1; -#if defined (ACE_HAS_CPP11) std::unique_ptr contextFactory (cf); -#else - auto_ptr contextFactory (cf); -#endif /* ACE_HAS_CPP11 */ // This instance will either get deleted after recreate all or, // in the case of a servant activator's use, on destruction of the diff --git a/TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp index 48dfb7e9f17..9222c88dbce 100644 --- a/TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp +++ b/TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp @@ -93,11 +93,7 @@ TAO::Any_Array_Impl_T::extract (const CORBA::Any & any, T_forany::tao_alloc ()), false); -#if defined (ACE_HAS_CPP11) std::unique_ptr > replacement_safety (replacement); -#else - auto_ptr > replacement_safety (replacement); -#endif /* ACE_HAS_CPP11 */ // We know this will work since the unencoded case is covered above. TAO::Unknown_IDL_Type * const unk = diff --git a/TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp b/TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp index ace666a3009..e464b4ad266 100644 --- a/TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp +++ b/TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp @@ -116,11 +116,7 @@ namespace TAO TAO::Any_Basic_Impl *replacement = TAO::Any_Basic_Impl::create_empty (any_tc); -#if defined (ACE_HAS_CPP11) std::unique_ptr replacement_safety (replacement); -#else - auto_ptr replacement_safety (replacement); -#endif /* ACE_HAS_CPP11 */ // We know this will work since the unencoded case is covered above. TAO::Unknown_IDL_Type * const unk = diff --git a/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp index a45b3b2481b..7e82b968f9f 100644 --- a/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp +++ b/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp @@ -78,11 +78,7 @@ TAO::Any_Basic_Impl_T::extract (const CORBA::Any & any, TAO::Any_Basic_Impl_T * const replacement = TAO::Any_Basic_Impl_T::create_empty (any_tc); -#if defined (ACE_HAS_CPP11) std::unique_ptr > replacement_safety (replacement); -#else - auto_ptr > replacement_safety (replacement); -#endif /* ACE_HAS_CPP11 */ // We know this will work since the unencoded case is covered above. TAO::Unknown_IDL_Type * const unk = diff --git a/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp index 42cc10a0066..41bb34ba6aa 100644 --- a/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp +++ b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp @@ -158,11 +158,7 @@ TAO::Any_Dual_Impl_T::replace (TAO_InputCDR &cdr, ACE_NEW_RETURN (empty_value, T, false); -#if defined (ACE_HAS_CPP11) std::unique_ptr empty_value_safety (empty_value); -#else - auto_ptr empty_value_safety (empty_value); -#endif /* ACE_HAS_CPP11 */ TAO::Any_Dual_Impl_T *replacement = 0; ACE_NEW_RETURN (replacement, TAO::Any_Dual_Impl_T (destructor, @@ -170,11 +166,7 @@ TAO::Any_Dual_Impl_T::replace (TAO_InputCDR &cdr, empty_value), false); -#if defined (ACE_HAS_CPP11) std::unique_ptr > replacement_safety (replacement); -#else - auto_ptr > replacement_safety (replacement); -#endif /* ACE_HAS_CPP11 */ CORBA::Boolean const good_decode = replacement->demarshal_value (cdr); diff --git a/TAO/tao/AnyTypeCode/Any_Impl.h b/TAO/tao/AnyTypeCode/Any_Impl.h index 2446ec37368..7c623574351 100644 --- a/TAO/tao/AnyTypeCode/Any_Impl.h +++ b/TAO/tao/AnyTypeCode/Any_Impl.h @@ -22,15 +22,7 @@ #include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" #include "tao/Basic_Types.h" - -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Synch_Traits.h" -# include "ace/Null_Mutex.h" -# include "ace/Thread_Mutex.h" -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -104,11 +96,7 @@ namespace TAO private: /// Reference counter. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ }; } diff --git a/TAO/tao/AnyTypeCode/Any_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Impl_T.cpp index f389796bff3..c0ba6c2d82b 100644 --- a/TAO/tao/AnyTypeCode/Any_Impl_T.cpp +++ b/TAO/tao/AnyTypeCode/Any_Impl_T.cpp @@ -91,11 +91,7 @@ TAO::Any_Impl_T::extract (const CORBA::Any & any, 0), false); -#if defined (ACE_HAS_CPP11) std::unique_ptr > replacement_safety (replacement); -#else - auto_ptr > replacement_safety (replacement); -#endif /* ACE_HAS_CPP11 */ // We know this will work since the unencoded case is covered above. TAO::Unknown_IDL_Type * const unk = diff --git a/TAO/tao/AnyTypeCode/Any_Special_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Special_Impl_T.cpp index a5cdeb3239d..b728b74f42c 100644 --- a/TAO/tao/AnyTypeCode/Any_Special_Impl_T.cpp +++ b/TAO/tao/AnyTypeCode/Any_Special_Impl_T.cpp @@ -129,11 +129,7 @@ TAO::Any_Special_Impl_T::extract (const CORBA::Any & any, bound), false); -#if defined (ACE_HAS_CPP11) std::unique_ptr > replacement_safety (replacement); -#else - auto_ptr > replacement_safety (replacement); -#endif /* ACE_HAS_CPP11 */ // We know this will work since the unencoded case is covered above. TAO::Unknown_IDL_Type * const unk = diff --git a/TAO/tao/AnyTypeCode/Any_SystemException.cpp b/TAO/tao/AnyTypeCode/Any_SystemException.cpp index 2e06f71b942..bd54f44cba7 100644 --- a/TAO/tao/AnyTypeCode/Any_SystemException.cpp +++ b/TAO/tao/AnyTypeCode/Any_SystemException.cpp @@ -116,11 +116,7 @@ TAO::Any_SystemException::extract (const CORBA::Any & any, empty_value), false); -#if defined (ACE_HAS_CPP11) std::unique_ptr replacement_safety (replacement); -#else - auto_ptr replacement_safety (replacement); -#endif /* ACE_HAS_CPP11 */ // We know this will work since the unencoded case is covered above. TAO::Unknown_IDL_Type * const unk = diff --git a/TAO/tao/AnyTypeCode/NVList.cpp b/TAO/tao/AnyTypeCode/NVList.cpp index 927ae22006c..e0ed4c9fc71 100644 --- a/TAO/tao/AnyTypeCode/NVList.cpp +++ b/TAO/tao/AnyTypeCode/NVList.cpp @@ -432,11 +432,7 @@ CORBA::NVList::evaluate (void) if (this->incoming_ != 0) { -#if defined (ACE_HAS_CPP11) std::unique_ptr incoming (this->incoming_); -#else - auto_ptr incoming (this->incoming_); -#endif /* ACE_HAS_CPP11 */ this->incoming_ = 0; this->_tao_decode (*(incoming.get ()), this->incoming_flag_); diff --git a/TAO/tao/AnyTypeCode/NVList.h b/TAO/tao/AnyTypeCode/NVList.h index 001a1d7691d..3c26d874059 100644 --- a/TAO/tao/AnyTypeCode/NVList.h +++ b/TAO/tao/AnyTypeCode/NVList.h @@ -26,11 +26,7 @@ #include "ace/Unbounded_Queue.h" #include "ace/Thread_Mutex.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -120,11 +116,7 @@ namespace CORBA private: /// Reference counter. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ /// holds the value Any any_; @@ -266,11 +258,7 @@ namespace CORBA ULong max_; /// Reference counter. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ /// Protects the incoming pointer. TAO_SYNCH_MUTEX lock_; diff --git a/TAO/tao/AnyTypeCode/True_RefCount_Policy.h b/TAO/tao/AnyTypeCode/True_RefCount_Policy.h index e1198f14cbe..adc980cb8bc 100644 --- a/TAO/tao/AnyTypeCode/True_RefCount_Policy.h +++ b/TAO/tao/AnyTypeCode/True_RefCount_Policy.h @@ -25,11 +25,7 @@ #include "tao/orbconf.h" #include "ace/Thread_Mutex.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -104,11 +100,7 @@ namespace TAO private: /// Reference counter. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ }; } // End namespace TAO diff --git a/TAO/tao/CDR.h b/TAO/tao/CDR.h index 3efeca9a5ca..8c9c34bdcb4 100644 --- a/TAO/tao/CDR.h +++ b/TAO/tao/CDR.h @@ -409,9 +409,7 @@ public: TAO_InputCDR (ACE_InputCDR::Transfer_Contents rhs, TAO_ORB_Core* orb_core = 0); -#if defined (ACE_HAS_CPP11) TAO_InputCDR& operator= (const TAO_InputCDR&) = default; -#endif /* ACE_HAS_CPP11 */ /// Destructor virtual ~TAO_InputCDR (void); diff --git a/TAO/tao/CDR.inl b/TAO/tao/CDR.inl index c4fb156fcc5..08d0efeae3e 100644 --- a/TAO/tao/CDR.inl +++ b/TAO/tao/CDR.inl @@ -454,14 +454,10 @@ ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &os, ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &os, const std::string &x) { -#if defined (ACE_HAS_CPP11) return os.fragment_stream (ACE_CDR::OCTET_ALIGN, sizeof (char)) && static_cast (os) << x; -#else - return os << x.c_str (); -#endif } ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &os, @@ -479,16 +475,12 @@ ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &os, ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &os, const std::wstring &x) { -#if defined (ACE_HAS_CPP11) return os.fragment_stream ((sizeof (CORBA::WChar) == 2 ? ACE_CDR::SHORT_ALIGN : ACE_CDR::LONG_ALIGN), sizeof (CORBA::WChar)) && static_cast (os) << x; -#else - return os << x.c_str (); -#endif } ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &os, diff --git a/TAO/tao/Codeset/UTF16_BOM_Translator.cpp b/TAO/tao/Codeset/UTF16_BOM_Translator.cpp index 0d0169cdd11..db3df08c895 100644 --- a/TAO/tao/Codeset/UTF16_BOM_Translator.cpp +++ b/TAO/tao/Codeset/UTF16_BOM_Translator.cpp @@ -170,7 +170,6 @@ ACE_CDR::Boolean TAO_UTF16_BOM_Translator::read_wstring (ACE_InputCDR &cdr, std::wstring &x) { -#if defined (ACE_HAS_CPP11) ACE_CDR::ULong len; if (!this->read_4 (cdr, &len)) return false; @@ -227,9 +226,6 @@ TAO_UTF16_BOM_Translator::read_wstring (ACE_InputCDR &cdr, } x.clear (); return false; -#else - return this->ACE_WChar_Codeset_Translator::read_wstring (cdr, x); -#endif } #endif diff --git a/TAO/tao/Codeset/UTF8_Latin1_Translator.cpp b/TAO/tao/Codeset/UTF8_Latin1_Translator.cpp index 6da6df8f67a..44f03eb740c 100644 --- a/TAO/tao/Codeset/UTF8_Latin1_Translator.cpp +++ b/TAO/tao/Codeset/UTF8_Latin1_Translator.cpp @@ -121,7 +121,6 @@ ACE_CDR::Boolean TAO_UTF8_Latin1_Translator::read_string (ACE_InputCDR &cdr, std::string &x) { -#if defined (ACE_HAS_CPP11) ACE_CDR::ULong len; if (!cdr.read_ulong (len)) return false; @@ -161,9 +160,6 @@ TAO_UTF8_Latin1_Translator::read_string (ACE_InputCDR &cdr, x.clear (); return false; -#else - return this->ACE_Char_Codeset_Translator::read_string (cdr, x); -#endif } ACE_CDR::Boolean diff --git a/TAO/tao/Connector_Registry.cpp b/TAO/tao/Connector_Registry.cpp index d093150da0f..6de1485a595 100644 --- a/TAO/tao/Connector_Registry.cpp +++ b/TAO/tao/Connector_Registry.cpp @@ -64,11 +64,7 @@ TAO_Connector_Registry::open (TAO_ORB_Core *orb_core) factory != end; ++factory) { -#if defined (ACE_HAS_CPP11) std::unique_ptr connector ((*factory)->factory ()->make_connector ()); -#else - auto_ptr connector ((*factory)->factory ()->make_connector ()); -#endif /* ACE_HAS_CPP11 */ if (connector.get ()) { diff --git a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp index bd5ebe7efa6..52bf4e2517a 100644 --- a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp +++ b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp @@ -302,11 +302,7 @@ TAO_AMH_DSI_Exception_Holder::_tao_unmarshal ( void TAO_AMH_DSI_Exception_Holder::raise_invoke () { -#if defined (ACE_HAS_CPP11) std::unique_ptr< ::CORBA::Exception> safety (this->exception_); -#else - auto_ptr< ::CORBA::Exception> safety (this->exception_); -#endif /* ACE_HAS_CPP11 */ this->exception_->_raise (); } diff --git a/TAO/tao/DynamicInterface/Context.h b/TAO/tao/DynamicInterface/Context.h index 4076983b754..dd9eb9cfc5a 100644 --- a/TAO/tao/DynamicInterface/Context.h +++ b/TAO/tao/DynamicInterface/Context.h @@ -31,11 +31,7 @@ #include "tao/default_environment.h" #include "ace/Unbounded_Queue.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -113,11 +109,7 @@ namespace CORBA private: /// Reference counter. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ }; /** @@ -182,11 +174,7 @@ namespace CORBA ContextList &operator= (const ContextList &); /// Reference counter. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ /// Internal list of typecodes. ACE_Unbounded_Queue ctx_list_; diff --git a/TAO/tao/DynamicInterface/ExceptionList.h b/TAO/tao/DynamicInterface/ExceptionList.h index db7200985ed..a59a7b059eb 100644 --- a/TAO/tao/DynamicInterface/ExceptionList.h +++ b/TAO/tao/DynamicInterface/ExceptionList.h @@ -30,11 +30,7 @@ #include "tao/Pseudo_VarOut_T.h" #include "ace/Unbounded_Queue.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -106,11 +102,7 @@ namespace CORBA ExceptionList &operator= (const ExceptionList &); /// Reference counter. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ /// Internal list of typecodes. ACE_Unbounded_Queue tc_list_; diff --git a/TAO/tao/DynamicInterface/Request.h b/TAO/tao/DynamicInterface/Request.h index 6613188666b..19054aa74c2 100644 --- a/TAO/tao/DynamicInterface/Request.h +++ b/TAO/tao/DynamicInterface/Request.h @@ -40,11 +40,7 @@ #endif /* TAO_HAS_AMI */ #include "ace/SString.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -248,11 +244,7 @@ namespace CORBA CORBA::Context_ptr ctx_; /// Reference counting. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ /// Protect the response_received_. TAO_SYNCH_MUTEX lock_; diff --git a/TAO/tao/DynamicInterface/Server_Request.h b/TAO/tao/DynamicInterface/Server_Request.h index 555e1c4f8f7..8532a92c237 100644 --- a/TAO/tao/DynamicInterface/Server_Request.h +++ b/TAO/tao/DynamicInterface/Server_Request.h @@ -29,11 +29,7 @@ #include "tao/TAO_Server_Request.h" #include "tao/CDR.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -150,11 +146,7 @@ namespace CORBA CORBA::Any_ptr exception_; /// Reference counting. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ /// Request from the ORB. TAO_ServerRequest &orb_server_request_; diff --git a/TAO/tao/Dynamic_TP/DTP_Task.cpp b/TAO/tao/Dynamic_TP/DTP_Task.cpp index 5dac916eede..80a3bbd2dd2 100644 --- a/TAO/tao/Dynamic_TP/DTP_Task.cpp +++ b/TAO/tao/Dynamic_TP/DTP_Task.cpp @@ -345,7 +345,7 @@ TAO_DTP_Task::svc (void) ACE_TEXT ("TAO (%P|%t) - DTP_Task::svc() ") ACE_TEXT ("Decrementing busy_threads_. ") ACE_TEXT ("Busy thread count:%d\n"), - this->busy_threads_.value())); + this->busy_threads_.load())); } ACE_Time_Value tmp_sec = this->thread_idle_time_.to_absolute_time(); @@ -385,7 +385,7 @@ TAO_DTP_Task::svc (void) ACE_TEXT ("TAO (%P|%t) - DTP_Task::svc() ") ACE_TEXT ("Incrementing busy_threads_. ") ACE_TEXT ("Busy thread count:%d\n"), - this->busy_threads_.value ())); + this->busy_threads_.load ())); } } } diff --git a/TAO/tao/Dynamic_TP/DTP_Task.h b/TAO/tao/Dynamic_TP/DTP_Task.h index 73dfeff8651..c39e3b57772 100644 --- a/TAO/tao/Dynamic_TP/DTP_Task.h +++ b/TAO/tao/Dynamic_TP/DTP_Task.h @@ -31,6 +31,7 @@ #include "ace/Synch.h" #include "ace/Containers_T.h" #include "ace/Vector_T.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -177,7 +178,7 @@ private: size_t num_queue_requests_; /// The number of currently active worker threads. - ACE_Atomic_Op busy_threads_; + std::atomic busy_threads_; /// The queue of pending servant requests (a.k.a. the "request queue"). TAO::CSD::TP_Queue queue_; diff --git a/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp b/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp index a51873958c1..bfc7bcc1a0d 100644 --- a/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp +++ b/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp @@ -519,11 +519,7 @@ CORBA::ULong TAO_DTP_Thread_Pool_Manager::create_threadpool_helper (TAO_DTP_Thread_Pool *thread_pool) { // Make sure of safe deletion in case of errors. -#if defined (ACE_HAS_CPP11) std::unique_ptr safe_thread_pool (thread_pool); -#else - auto_ptr safe_thread_pool (thread_pool); -#endif /* ACE_HAS_CPP11 */ // Open the pool. thread_pool->open (); diff --git a/TAO/tao/IORManipulation/IORManipulation.cpp b/TAO/tao/IORManipulation/IORManipulation.cpp index 37b5284328f..8eac641e59e 100644 --- a/TAO/tao/IORManipulation/IORManipulation.cpp +++ b/TAO/tao/IORManipulation/IORManipulation.cpp @@ -46,11 +46,7 @@ TAO_IOR_Manipulation_impl::merge_iors ( // get the profile lists, start by initialize the composite reference // by using the first Object. Then for each subsequent Object verify // they are the same type and they do not have duplicate profiles. -#if defined (ACE_HAS_CPP11) std::unique_ptr tmp_pfiles (iors[0]->_stubobj ()->make_profiles ()); -#else - auto_ptr tmp_pfiles (iors[0]->_stubobj ()->make_profiles ()); -#endif /* ACE_HAS_CPP11 */ if (Merged_Profiles.add_profiles (tmp_pfiles.get ())< 0) throw TAO_IOP::Invalid_IOR (); CORBA::String_var id = @@ -145,11 +141,7 @@ TAO_IOR_Manipulation_impl::remove_profiles ( // initialize with estimated pfile count. TAO_MProfile Diff_Profiles (count); -#if defined (ACE_HAS_CPP11) std::unique_ptr tmp_pfiles (group->_stubobj ()->make_profiles ()); -#else - auto_ptr tmp_pfiles (group->_stubobj ()->make_profiles ()); -#endif /* ACE_HAS_CPP11 */ if (Diff_Profiles.add_profiles (tmp_pfiles.get ()) < 0) throw TAO_IOP::Invalid_IOR (); @@ -277,13 +269,8 @@ TAO_IOR_Manipulation_impl::is_in_ior ( CORBA::ULong count = 0; TAO_Profile *pfile1 = 0; TAO_Profile *pfile2 = 0; -#if defined (ACE_HAS_CPP11) std::unique_ptr tmp_pfiles1 (ior1->_stubobj ()->make_profiles ()); std::unique_ptr tmp_pfiles2 (ior2->_stubobj ()->make_profiles ()); -#else - auto_ptr tmp_pfiles1 (ior1->_stubobj ()->make_profiles ()); - auto_ptr tmp_pfiles2 (ior2->_stubobj ()->make_profiles ()); -#endif /* ACE_HAS_CPP11 */ tmp_pfiles1->rewind (); while ((pfile1 = tmp_pfiles1->get_next ()) != 0) diff --git a/TAO/tao/Intrusive_Ref_Count_Base_T.h b/TAO/tao/Intrusive_Ref_Count_Base_T.h index c4c6f181b75..03e70d2731c 100644 --- a/TAO/tao/Intrusive_Ref_Count_Base_T.h +++ b/TAO/tao/Intrusive_Ref_Count_Base_T.h @@ -20,12 +20,7 @@ #include /**/ "tao/Versioned_Namespace.h" #include "tao/Basic_Types.h" - -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -52,11 +47,7 @@ protected: TAO_Intrusive_Ref_Count_Base (void); private: -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ // Prevent copying/assignment. TAO_Intrusive_Ref_Count_Base (const TAO_Intrusive_Ref_Count_Base&); diff --git a/TAO/tao/Load_Protocol_Factory_T.h b/TAO/tao/Load_Protocol_Factory_T.h index 29a2519aa05..af0c7f18731 100644 --- a/TAO/tao/Load_Protocol_Factory_T.h +++ b/TAO/tao/Load_Protocol_Factory_T.h @@ -33,11 +33,7 @@ namespace TAO const char *name) { TAO_Protocol_Factory *protocol_factory = 0; -#if defined (ACE_HAS_CPP11) std::unique_ptr safe_protocol_factory; -#else - auto_ptr safe_protocol_factory; -#endif /* ACE_HAS_CPP11 */ TAO_Protocol_Item *item = 0; diff --git a/TAO/tao/ORB.h b/TAO/tao/ORB.h index 96650f39713..0d5ffd0c666 100644 --- a/TAO/tao/ORB.h +++ b/TAO/tao/ORB.h @@ -35,11 +35,7 @@ #include "ace/Thread_Mutex.h" #include "ace/Guard_T.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -576,11 +572,7 @@ namespace CORBA private: /// Maintains a reference count of number of instantiations of the /// ORB. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ /// The ORB_Core that created us.... TAO_ORB_Core * orb_core_; diff --git a/TAO/tao/ORB.inl b/TAO/tao/ORB.inl index b46a2f83819..1043a54de32 100644 --- a/TAO/tao/ORB.inl +++ b/TAO/tao/ORB.inl @@ -26,11 +26,7 @@ CORBA::ORB::_incr_refcount (void) ACE_INLINE unsigned long CORBA::ORB::_refcount (void) const { -#if defined (ACE_HAS_CPP11) return this->refcount_; -#else - return this->refcount_.value (); -#endif /* ACE_HAS_CPP11 */ } ACE_INLINE unsigned long diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index ac09508d440..cb2d45bff86 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -1966,11 +1966,7 @@ TAO_ORB_Core::root_poa () if (CORBA::is_nil (this->root_poa_.in ())) { -#if defined (ACE_HAS_CPP11) std::unique_ptr poa_adapter (factory->create (this)); -#else - auto_ptr poa_adapter (factory->create (this)); -#endif /* ACE_HAS_CPP11 */ poa_adapter->open (); // @@ Not exception safe diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index 4437dc95601..dfe2c0c4535 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -41,11 +41,7 @@ #include "ace/Lock_Adapter_T.h" #include "ace/TSS_T.h" #include "ace/Service_Config.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Data_Block; @@ -1211,11 +1207,7 @@ protected: #endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */ /// Number of outstanding references to this object. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ /// Registry containing all registered policy factories. TAO::PolicyFactory_Registry_Adapter *policy_factory_registry_; diff --git a/TAO/tao/ORB_Core.inl b/TAO/tao/ORB_Core.inl index f68d3beef3d..f6ebac0549d 100644 --- a/TAO/tao/ORB_Core.inl +++ b/TAO/tao/ORB_Core.inl @@ -19,11 +19,7 @@ TAO_ORB_Core::_incr_refcnt (void) ACE_INLINE unsigned long TAO_ORB_Core::_refcnt (void) const { -#if defined (ACE_HAS_CPP11) return this->refcount_; -#else - return this->refcount_.value (); -#endif /* ACE_HAS_CPP11 */ } ACE_INLINE unsigned long diff --git a/TAO/tao/Object.cpp b/TAO/tao/Object.cpp index d89c8df39e3..f1be9002e7d 100644 --- a/TAO/tao/Object.cpp +++ b/TAO/tao/Object.cpp @@ -110,11 +110,7 @@ CORBA::Object::_remove_ref () CORBA::ULong CORBA::Object::_refcount_value() const { -#if defined (ACE_HAS_CPP11) return this->refcount_; -#else - return this->refcount_.value (); -#endif /* ACE_HAS_CPP11 */ } void diff --git a/TAO/tao/Object.h b/TAO/tao/Object.h index 92c2e499c85..a0a68eb29e8 100644 --- a/TAO/tao/Object.h +++ b/TAO/tao/Object.h @@ -30,11 +30,7 @@ #include "tao/Object_Argument_T.h" #include "tao/Arg_Traits_T.h" #include "tao/Any_Insert_Policy_T.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include #if defined (HPUX) && defined (IOR) /* HP-UX 11.11 defines IOR in /usr/include/pa/inline.h diff --git a/TAO/tao/Object_KeyC.h b/TAO/tao/Object_KeyC.h index 9854f40b8d0..b9a0a0dc261 100644 --- a/TAO/tao/Object_KeyC.h +++ b/TAO/tao/Object_KeyC.h @@ -92,12 +92,10 @@ namespace TAO CORBA::Octet* buffer, CORBA::Boolean release = false ); -#if defined (ACE_HAS_CPP11) ObjectKey (const ObjectKey &) = default; ObjectKey (ObjectKey &&) = default; ObjectKey& operator= (const ObjectKey &) = default; ObjectKey& operator= (ObjectKey &&) = default; -#endif /* ACE_HAS_CPP11 */ ~ObjectKey (void); typedef ObjectKey_var _var_type; diff --git a/TAO/tao/PortableServer/Active_Object_Map.cpp b/TAO/tao/PortableServer/Active_Object_Map.cpp index b556fa72579..bd30f17ad50 100644 --- a/TAO/tao/PortableServer/Active_Object_Map.cpp +++ b/TAO/tao/PortableServer/Active_Object_Map.cpp @@ -116,11 +116,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( } // Give ownership to the auto pointer. -#if defined (ACE_HAS_CPP11) std::unique_ptr new_id_uniqueness_strategy (id_uniqueness_strategy); -#else - auto_ptr new_id_uniqueness_strategy (id_uniqueness_strategy); -#endif /* ACE_HAS_CPP11 */ TAO_Lifespan_Strategy *lifespan_strategy = 0; @@ -144,11 +140,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( } // Give ownership to the auto pointer. -#if defined (ACE_HAS_CPP11) std::unique_ptr new_lifespan_strategy (lifespan_strategy); -#else - auto_ptr new_lifespan_strategy (lifespan_strategy); -#endif /* ACE_HAS_CPP11 */ TAO_Id_Assignment_Strategy *id_assignment_strategy = 0; @@ -183,11 +175,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( } // Give ownership to the auto pointer. -#if defined (ACE_HAS_CPP11) std::unique_ptr new_id_assignment_strategy (id_assignment_strategy); -#else - auto_ptr new_id_assignment_strategy (id_assignment_strategy); -#endif /* ACE_HAS_CPP11 */ TAO_Id_Hint_Strategy *id_hint_strategy = 0; if ((user_id_policy @@ -209,11 +197,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( } // Give ownership to the auto pointer. -#if defined (ACE_HAS_CPP11) std::unique_ptr new_id_hint_strategy (id_hint_strategy); -#else - auto_ptr new_id_hint_strategy (id_hint_strategy); -#endif /* ACE_HAS_CPP11 */ servant_map *sm = 0; if (unique_id_policy) @@ -247,11 +231,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( } // Give ownership to the auto pointer. -#if defined (ACE_HAS_CPP11) std::unique_ptr new_servant_map (sm); -#else - auto_ptr new_servant_map (sm); -#endif /* ACE_HAS_CPP11 */ user_id_map *uim = 0; if (user_id_policy @@ -321,11 +301,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( } // Give ownership to the auto pointer. -#if defined (ACE_HAS_CPP11) std::unique_ptr new_user_id_map (uim); -#else - auto_ptr new_user_id_map (uim); -#endif /* ACE_HAS_CPP11 */ id_uniqueness_strategy->set_active_object_map (this); lifespan_strategy->set_active_object_map (this); @@ -333,21 +309,12 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( // Finally everything is fine. Make sure to take ownership away // from the auto pointer. -#if defined (ACE_HAS_CPP11) this->id_uniqueness_strategy_ = std::move(new_id_uniqueness_strategy); this->lifespan_strategy_ = std::move(new_lifespan_strategy); this->id_assignment_strategy_ = std::move(new_id_assignment_strategy); this->id_hint_strategy_ = std::move(new_id_hint_strategy); this->servant_map_ = std::move(new_servant_map); this->user_id_map_ = std::move(new_user_id_map); -#else - this->id_uniqueness_strategy_ = new_id_uniqueness_strategy; - this->lifespan_strategy_ = new_lifespan_strategy; - this->id_assignment_strategy_ = new_id_assignment_strategy; - this->id_hint_strategy_ = new_id_hint_strategy; - this->servant_map_ = new_servant_map; - this->user_id_map_ = new_user_id_map; -#endif /* ACE_HAS_CPP11 */ #if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1) ACE_NEW (this->monitor_, diff --git a/TAO/tao/PortableServer/Active_Object_Map.h b/TAO/tao/PortableServer/Active_Object_Map.h index a37e2fcaee5..8faf8c6456f 100644 --- a/TAO/tao/PortableServer/Active_Object_Map.h +++ b/TAO/tao/PortableServer/Active_Object_Map.h @@ -237,46 +237,22 @@ public: #endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ /// Id map. -#if defined (ACE_HAS_CPP11) std::unique_ptr user_id_map_; -#else - auto_ptr user_id_map_; -#endif /* ACE_HAS_CPP11 */ /// Servant map. -#if defined (ACE_HAS_CPP11) std::unique_ptr servant_map_; -#else - auto_ptr servant_map_; -#endif /* ACE_HAS_CPP11 */ /// Id uniqueness strategy. -#if defined (ACE_HAS_CPP11) std::unique_ptr id_uniqueness_strategy_; -#else - auto_ptr id_uniqueness_strategy_; -#endif /* ACE_HAS_CPP11 */ /// Lifespan strategy. -#if defined (ACE_HAS_CPP11) std::unique_ptr lifespan_strategy_; -#else - auto_ptr lifespan_strategy_; -#endif /* ACE_HAS_CPP11 */ /// Id assignment strategy. -#if defined (ACE_HAS_CPP11) std::unique_ptr id_assignment_strategy_; -#else - auto_ptr id_assignment_strategy_; -#endif /* ACE_HAS_CPP11 */ /// Id hint strategy. -#if defined (ACE_HAS_CPP11) std::unique_ptr id_hint_strategy_; -#else - auto_ptr id_hint_strategy_; -#endif /* ACE_HAS_CPP11 */ /// Flag to see if we are using active maps in this active object /// map. diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp index 781a60c24b4..d0d40a9b40a 100644 --- a/TAO/tao/PortableServer/Object_Adapter.cpp +++ b/TAO/tao/PortableServer/Object_Adapter.cpp @@ -166,11 +166,7 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ No_Hint_Strategy); // Give ownership to the auto pointer. -#if defined (ACE_HAS_CPP11) std::unique_ptr new_hint_strategy (hint_strategy); -#else - auto_ptr new_hint_strategy (hint_strategy); -#endif /* ACE_HAS_CPP11 */ new_hint_strategy->object_adapter (this); @@ -197,11 +193,7 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ break; } // Give ownership to the auto pointer. -#if defined (ACE_HAS_CPP11) std::unique_ptr new_persistent_poa_name_map (ppnm); -#else - auto_ptr new_persistent_poa_name_map (ppnm); -#endif /* ACE_HAS_CPP11 */ transient_poa_map *tpm = 0; switch (creation_parameters.poa_lookup_strategy_for_transient_id_policy_) @@ -231,11 +223,7 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ break; } // Give ownership to the auto pointer. -#if defined (ACE_HAS_CPP11) std::unique_ptr new_transient_poa_map (tpm); -#else - auto_ptr new_transient_poa_map (tpm); -#endif /* ACE_HAS_CPP11 */ this->hint_strategy_ = new_hint_strategy.release (); this->persistent_poa_name_map_ = new_persistent_poa_name_map.release (); diff --git a/TAO/tao/PortableServer/Root_POA.cpp b/TAO/tao/PortableServer/Root_POA.cpp index 972d5057fbc..776d322e3d1 100644 --- a/TAO/tao/PortableServer/Root_POA.cpp +++ b/TAO/tao/PortableServer/Root_POA.cpp @@ -2027,11 +2027,7 @@ TAO_Root_POA::key_to_stub_i (const TAO::ObjectKey &key, } // Give ownership to the auto pointer. -#if defined (ACE_HAS_CPP11) std::unique_ptr new_filter (filter); -#else - auto_ptr new_filter (filter); -#endif /* ACE_HAS_CPP11 */ TAO_Stub *data = this->create_stub_object ( diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h index 837e0868b5a..b9af32be2f4 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h +++ b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h @@ -19,7 +19,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/PortableServer/Servant_Location.h" -#include "ace/Atomic_Op.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -123,7 +123,7 @@ namespace TAO protected: TAO_Root_POA *poa_; - ACE_Atomic_Op sys_id_count_; + std::atomic sys_id_count_; }; } } diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h index 500629cf1c0..d31d18a3e90 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h +++ b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h @@ -139,11 +139,7 @@ namespace TAO TAO_Active_Object_Map * get_active_object_map() const; private: -#if defined (ACE_HAS_CPP11) std::unique_ptr active_object_map_; -#else - auto_ptr active_object_map_; -#endif /* ACE_HAS_CPP11 */ CORBA::ULong waiting_servant_deactivation_; }; } diff --git a/TAO/tao/PortableServer/Servant_Base.cpp b/TAO/tao/PortableServer/Servant_Base.cpp index 9bd8738a623..13300d3f75c 100644 --- a/TAO/tao/PortableServer/Servant_Base.cpp +++ b/TAO/tao/PortableServer/Servant_Base.cpp @@ -664,11 +664,7 @@ TAO_ServantBase::_remove_ref (void) CORBA::ULong TAO_ServantBase::_refcount_value (void) const { -#if defined (ACE_HAS_CPP11) return this->ref_count_; -#else - return this->ref_count_.value (); -#endif /* ACE_HAS_CPP11 */ } void diff --git a/TAO/tao/PortableServer/Servant_Base.h b/TAO/tao/PortableServer/Servant_Base.h index 1cc77f3bed1..96f69d40bbc 100644 --- a/TAO/tao/PortableServer/Servant_Base.h +++ b/TAO/tao/PortableServer/Servant_Base.h @@ -22,11 +22,7 @@ #include "tao/PortableServer/PS_ForwardC.h" #include "tao/PortableServer/Servant_var.h" #include "tao/Abstract_Servant_Base.h" -#if defined (ACE_HAS_CPP11) #include -#else -#include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -208,11 +204,7 @@ protected: protected: /// Reference counter. -#if defined (ACE_HAS_CPP11) std::atomic ref_count_; -#else - ACE_Atomic_Op ref_count_; -#endif /* ACE_HAS_CPP11 */ /// The operation table for this servant. It is initialized by the /// most derived class. diff --git a/TAO/tao/Principal.h b/TAO/tao/Principal.h index e961e8b419a..756aac6a9a6 100644 --- a/TAO/tao/Principal.h +++ b/TAO/tao/Principal.h @@ -25,11 +25,7 @@ #include "tao/OctetSeqC.h" #include "tao/Pseudo_VarOut_T.h" #include "ace/Thread_Mutex.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -94,11 +90,7 @@ namespace CORBA private: /// Reference counter. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ }; } // End CORBA namespace diff --git a/TAO/tao/Profile.h b/TAO/tao/Profile.h index c1d2f4ed21a..9e0665331c9 100644 --- a/TAO/tao/Profile.h +++ b/TAO/tao/Profile.h @@ -22,11 +22,7 @@ #include "tao/GIOP_Message_Version.h" #include "tao/Refcounted_ObjectKey.h" #include "tao/Service_Callbacks.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Lock; @@ -379,11 +375,7 @@ private: TAO_MProfile* forward_to_; /// Number of outstanding references to this object. -#if defined (ACE_HAS_CPP11) - std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ + std::atomic refcount_; /// A lock that protects creation of the tagged profile TAO_SYNCH_MUTEX tagged_profile_lock_; diff --git a/TAO/tao/RTCORBA/Thread_Pool.cpp b/TAO/tao/RTCORBA/Thread_Pool.cpp index 622de35c11e..4648487aab2 100644 --- a/TAO/tao/RTCORBA/Thread_Pool.cpp +++ b/TAO/tao/RTCORBA/Thread_Pool.cpp @@ -890,11 +890,7 @@ RTCORBA::ThreadpoolId TAO_Thread_Pool_Manager::create_threadpool_helper (TAO_Thread_Pool *thread_pool) { // Make sure of safe deletion in case of errors. -#if defined (ACE_HAS_CPP11) std::unique_ptr safe_thread_pool (thread_pool); -#else - auto_ptr safe_thread_pool (thread_pool); -#endif /* ACE_HAS_CPP11 */ // Open the pool. thread_pool->open (); diff --git a/TAO/tao/RTScheduling/Current.cpp b/TAO/tao/RTScheduling/Current.cpp index 53ea0dd8886..c8735b4bb16 100644 --- a/TAO/tao/RTScheduling/Current.cpp +++ b/TAO/tao/RTScheduling/Current.cpp @@ -11,7 +11,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL -ACE_Atomic_Op TAO_RTScheduler_Current::guid_counter; +std::atomic TAO_RTScheduler_Current::guid_counter; u_long TAO_DTId_Hash::operator () (const IdType &id) const diff --git a/TAO/tao/RTScheduling/Current.h b/TAO/tao/RTScheduling/Current.h index f941512b9de..4edf9c5ceb9 100644 --- a/TAO/tao/RTScheduling/Current.h +++ b/TAO/tao/RTScheduling/Current.h @@ -78,7 +78,7 @@ class TAO_RTScheduler_Export TAO_RTScheduler_Current public ::CORBA::LocalObject { public: - static ACE_Atomic_Op guid_counter; + static std::atomic guid_counter; TAO_RTScheduler_Current (void); virtual ~TAO_RTScheduler_Current (void); diff --git a/TAO/tao/RTScheduling/Request_Interceptor.cpp b/TAO/tao/RTScheduling/Request_Interceptor.cpp index 985e219d14a..e27c5b49172 100644 --- a/TAO/tao/RTScheduling/Request_Interceptor.cpp +++ b/TAO/tao/RTScheduling/Request_Interceptor.cpp @@ -53,7 +53,7 @@ Client_Interceptor::send_request (PortableInterceptor::ClientRequestInfo_ptr ri) TAOLIB_DEBUG ((LM_DEBUG, "The Guid is %d %d\n", id, - TAO_RTScheduler_Current::guid_counter.value_i ())); + TAO_RTScheduler_Current::guid_counter.load ())); // Create new DT. RTScheduling::DistributableThread_var dt = diff --git a/TAO/tao/RTScheduling/Request_Interceptor.h b/TAO/tao/RTScheduling/Request_Interceptor.h index 48bfe663054..879d73a7876 100644 --- a/TAO/tao/RTScheduling/Request_Interceptor.h +++ b/TAO/tao/RTScheduling/Request_Interceptor.h @@ -13,7 +13,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL -extern ACE_Atomic_Op server_guid_counter; +extern std::atomic server_guid_counter; class TAO_RTScheduler_Export Client_Interceptor: public PortableInterceptor::ClientRequestInterceptor, diff --git a/TAO/tao/Reply_Dispatcher.cpp b/TAO/tao/Reply_Dispatcher.cpp index 230b4c623e1..93c08198894 100644 --- a/TAO/tao/Reply_Dispatcher.cpp +++ b/TAO/tao/Reply_Dispatcher.cpp @@ -36,8 +36,8 @@ TAO_Reply_Dispatcher::intrusive_remove_ref (TAO_Reply_Dispatcher* rd) { if (rd != nullptr) { - long const tmp = --rd->refcount_; - if (tmp <= 0) + uint32_t const tmp = --rd->refcount_; + if (tmp == 0) { if (rd->allocator_) { diff --git a/TAO/tao/Reply_Dispatcher.h b/TAO/tao/Reply_Dispatcher.h index 949bf0dfccd..80bb55eebe8 100644 --- a/TAO/tao/Reply_Dispatcher.h +++ b/TAO/tao/Reply_Dispatcher.h @@ -103,7 +103,7 @@ protected: private: /// Support for intrusive reference counting - ACE_Atomic_Op refcount_; + std::atomic refcount_; /// Allocator that was used to allocate this reply dispatcher. In case of /// zero we come from the heap. diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp index 1be51e3c49c..c132daaeef9 100644 --- a/TAO/tao/Stub.cpp +++ b/TAO/tao/Stub.cpp @@ -456,11 +456,7 @@ TAO_Stub::set_policy_overrides (const CORBA::PolicyList & policies, CORBA::SetOverrideType set_add) { // Notice the use of an explicit constructor.... -#if defined (ACE_HAS_CPP11) std::unique_ptr policy_manager (new TAO_Policy_Set (TAO_POLICY_OBJECT_SCOPE)); -#else - auto_ptr policy_manager (new TAO_Policy_Set (TAO_POLICY_OBJECT_SCOPE)); -#endif /* ACE_HAS_CPP11 */ if (set_add == CORBA::SET_OVERRIDE) { diff --git a/TAO/tao/Stub.h b/TAO/tao/Stub.h index a2b56708493..62049cb1af9 100644 --- a/TAO/tao/Stub.h +++ b/TAO/tao/Stub.h @@ -22,11 +22,7 @@ #include "tao/MProfile.h" #include "tao/ORB_Core_Auto_Ptr.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include #if defined (HPUX) && defined (IOR) /* HP-UX 11.11 defines IOR in /usr/include/pa/inline.h @@ -384,11 +380,7 @@ protected: CORBA::Boolean profile_success_; /// Reference counter. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ /// The policy overrides in this object, if nil then use the default /// policies. @@ -418,7 +410,7 @@ protected: /// True if forwarding request upon some specific exceptions /// (e.g. OBJECT_NOT_EXIST) already happened. - ACE_Atomic_Op forwarded_on_exception_; + std::atomic forwarded_on_exception_; }; // Define a TAO_Stub auto_ptr class. diff --git a/TAO/tao/Stub.inl b/TAO/tao/Stub.inl index 7c638ccf206..146414ac160 100644 --- a/TAO/tao/Stub.inl +++ b/TAO/tao/Stub.inl @@ -393,7 +393,7 @@ void TAO_Stub::forwarded_on_exception (bool forwarded) ACE_INLINE bool TAO_Stub::forwarded_on_exception () const { - return forwarded_on_exception_.value (); + return forwarded_on_exception_; } ACE_INLINE diff --git a/TAO/tao/Synch_Invocation.cpp b/TAO/tao/Synch_Invocation.cpp index 69e7f948fac..ee073e085d3 100644 --- a/TAO/tao/Synch_Invocation.cpp +++ b/TAO/tao/Synch_Invocation.cpp @@ -580,11 +580,7 @@ namespace TAO // We must manage the memory allocated // by the call above to alloc(). -#if defined (ACE_HAS_CPP11) std::unique_ptr safety (exception); -#else - auto_ptr safety (exception); -#endif /* ACE_HAS_CPP11 */ exception->_raise (); @@ -731,11 +727,7 @@ namespace TAO // Without this, the call to create_system_exception() above // causes a memory leak. On platforms without native exceptions, // the CORBA::Environment class manages the memory. -#if defined (ACE_HAS_CPP11) std::unique_ptr safety (ex); -#else - auto_ptr safety (ex); -#endif /* ACE_HAS_CPP11 */ ex->minor (minor); ex->completed (CORBA::CompletionStatus (completion)); diff --git a/TAO/tao/Valuetype/AbstractBase.h b/TAO/tao/Valuetype/AbstractBase.h index d23b249e062..a67601acfed 100644 --- a/TAO/tao/Valuetype/AbstractBase.h +++ b/TAO/tao/Valuetype/AbstractBase.h @@ -25,11 +25,7 @@ #include "tao/Objref_VarOut_T.h" #include "tao/Object.h" /* For CORBA::Object_var */ #include "tao/Pseudo_VarOut_T.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -55,7 +51,6 @@ namespace CORBA class TAO_Valuetype_Export AbstractBase { public: - /// Constructor. /** * This constructor is only meant to be called by the @@ -127,7 +122,6 @@ namespace CORBA void _decr_refcount (void); protected: - AbstractBase (void); AbstractBase (const AbstractBase &); @@ -138,7 +132,6 @@ namespace CORBA CORBA::Boolean is_objref_; private: - AbstractBase & operator= (const AbstractBase &); virtual CORBA::ValueBase *_tao_to_value (void); @@ -146,13 +139,8 @@ namespace CORBA CORBA::Object_ptr create_object (TAO_Stub *stub); private: - /// Number of outstanding references to this object. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ CORBA::Boolean is_collocated_; TAO_Abstract_ServantBase *servant_; diff --git a/TAO/tao/Valuetype/ValueBase.cpp b/TAO/tao/Valuetype/ValueBase.cpp index dd0a46c847e..0f4f33161b6 100644 --- a/TAO/tao/Valuetype/ValueBase.cpp +++ b/TAO/tao/Valuetype/ValueBase.cpp @@ -1428,11 +1428,7 @@ CORBA::DefaultValueRefCountBase::_tao_remove_ref (void) CORBA::ULong CORBA::DefaultValueRefCountBase::_tao_refcount_value (void) const { -#if defined (ACE_HAS_CPP11) return this->refcount_; -#else - return this->refcount_.value (); -#endif /* ACE_HAS_CPP11 */ } // =========================================================== diff --git a/TAO/tao/Valuetype/ValueBase.h b/TAO/tao/Valuetype/ValueBase.h index 25a68b6e00a..3ac615cba5a 100644 --- a/TAO/tao/Valuetype/ValueBase.h +++ b/TAO/tao/Valuetype/ValueBase.h @@ -30,11 +30,7 @@ #include "ace/Basic_Types.h" #include "ace/Synch_Traits.h" #include "ace/Thread_Mutex.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include #include "ace/Null_Mutex.h" #include "ace/Vector_T.h" @@ -347,11 +343,7 @@ namespace CORBA private: // data /// Reference counter. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ }; // DefaultValueRefCountBase // which lock has the lowest memory overhead ? diff --git a/TAO/tao/Valuetype/ValueFactory.h b/TAO/tao/Valuetype/ValueFactory.h index 6003f803086..19379d168a4 100644 --- a/TAO/tao/Valuetype/ValueFactory.h +++ b/TAO/tao/Valuetype/ValueFactory.h @@ -26,11 +26,7 @@ #include "ace/Synch_Traits.h" #include "ace/Thread_Mutex.h" #include "ace/Null_Mutex.h" -#if defined (ACE_HAS_CPP11) -# include -#else -# include "ace/Atomic_Op.h" -#endif /* ACE_HAS_CPP11 */ +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -72,11 +68,7 @@ namespace CORBA private: /// Reference counter. -#if defined (ACE_HAS_CPP11) std::atomic refcount_; -#else - ACE_Atomic_Op refcount_; -#endif /* ACE_HAS_CPP11 */ }; } // End CORBA namespace -- cgit v1.2.1