diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index fdd9bd839002e..9f2b8ae0876ca 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -36,9 +36,9 @@ jobs: CXX: ${{ matrix.CXX }} steps: - name: checkout ACE/TAO - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: checkout MPC - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: DOCGroup/MPC path: ${{ env.MPC_ROOT }} diff --git a/.github/workflows/face.yml b/.github/workflows/face.yml index 5c029196cecf9..f4c14fdec7662 100644 --- a/.github/workflows/face.yml +++ b/.github/workflows/face.yml @@ -35,9 +35,9 @@ jobs: CXX: ${{ matrix.CXX }} steps: - name: checkout ACE/TAO - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: checkout MPC - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: DOCGroup/MPC path: ${{ env.MPC_ROOT }} diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 94e9934846d41..67680c480dc51 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -23,7 +23,7 @@ jobs: steps: - name: checkout ACE/TAO - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run fuzz run: | perl ${env:ACE_ROOT}/bin/fuzz.pl diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 79f1b7c6ddc12..63ca1ef7865c2 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -168,9 +168,9 @@ jobs: CXX: ${{ matrix.CXX }} steps: - name: Checkout ACE_TAO - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout MPC - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: DOCGroup/MPC path: ${{ env.MPC_ROOT }} diff --git a/.github/workflows/macosx.yml b/.github/workflows/macosx.yml index 365dec69a0780..91e90be6eb331 100644 --- a/.github/workflows/macosx.yml +++ b/.github/workflows/macosx.yml @@ -30,9 +30,9 @@ jobs: MPC_ROOT: ${{ github.workspace }}/MPC steps: - name: checkout ACE/TAO - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: checkout MPC - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: DOCGroup/MPC path: ${{ env.MPC_ROOT }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f0a664761c055..8245444c68e46 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -118,9 +118,9 @@ jobs: VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed steps: - name: checkout ACE/TAO - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: checkout MPC - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: DOCGroup/MPC path: ${{ env.MPC_ROOT }} @@ -187,9 +187,9 @@ jobs: MPC_ROOT: ${{ github.workspace }}/MPC steps: - name: checkout ACE/TAO - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: checkout MPC - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: DOCGroup/MPC path: ${{ env.MPC_ROOT }} diff --git a/ACE/ACEXML/common/HttpCharStream.cpp b/ACE/ACEXML/common/HttpCharStream.cpp index 4fc0a1178a30f..18ea22948fe83 100644 --- a/ACE/ACEXML/common/HttpCharStream.cpp +++ b/ACE/ACEXML/common/HttpCharStream.cpp @@ -1,6 +1,5 @@ #include "ace/ACE.h" #include "ace/ace_wchar.h" -#include "ace/Auto_Ptr.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_string.h" #include "ace/Truncate.h" @@ -272,7 +271,7 @@ int ACEXML_HttpCharStream::send_request () { char* path = ACE::strnew (ACE_TEXT_ALWAYS_CHAR (this->url_addr_->get_path_name())); - ACE_Auto_Basic_Array_Ptr path_ptr (path); + std::unique_ptr path_ptr (path); size_t commandsize = ACE_OS::strlen (path) + ACE_OS::strlen (this->url_addr_->get_host_name ()) + 20 // Extra @@ -283,7 +282,7 @@ ACEXML_HttpCharStream::send_request () ACE_NEW_RETURN (command, char[commandsize], -1); // Ensure that the memory is deallocated. - ACE_Auto_Basic_Array_Ptr cmd_ptr (command); + std::unique_ptr cmd_ptr (command); int bytes = ACE_OS::sprintf (command, "GET %s HTTP/1.0\r\n", path); bytes += ACE_OS::sprintf (&command[bytes], "Host: %s\r\n", diff --git a/ACE/ACEXML/common/URL_Addr.cpp b/ACE/ACEXML/common/URL_Addr.cpp index ccd234d33d668..f136478a733ef 100644 --- a/ACE/ACEXML/common/URL_Addr.cpp +++ b/ACE/ACEXML/common/URL_Addr.cpp @@ -5,11 +5,11 @@ #endif /* __ACEXML_INLINE__ */ #include "ace/Log_Msg.h" -#include "ace/Auto_Ptr.h" #include "ace/OS_Memory.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_stdlib.h" #include "ace/OS_NS_string.h" +#include ACEXML_URL_Addr::ACEXML_URL_Addr () : path_name_ (0), @@ -94,7 +94,7 @@ ACEXML_URL_Addr::string_to_addr (const ACEXML_Char* s, ACE_NEW_RETURN (host_name, ACEXML_Char[host_len + 1], -1); ACE_OS::strncpy (host_name, s + http_len, host_len); host_name[host_len] = '\0'; - ACE_Auto_Basic_Array_Ptr cleanup_host_name (host_name); + std::unique_ptr cleanup_host_name (host_name); // Get the port number (if any) unsigned short port = ACE_DEFAULT_HTTP_PORT; diff --git a/ACE/ACEXML/common/XML_Codecs.cpp b/ACE/ACEXML/common/XML_Codecs.cpp index 3e3860776e5e6..657154f31bc2c 100644 --- a/ACE/ACEXML/common/XML_Codecs.cpp +++ b/ACE/ACEXML/common/XML_Codecs.cpp @@ -1,9 +1,9 @@ // -*- C++ -*- -#include "ace/Auto_Ptr.h" #include "ace/OS_Memory.h" #include "ace/OS_NS_string.h" #include "ACEXML/common/XML_Codecs.h" +#include ACEXML_Char* ACEXML_Base64::encode (const ACEXML_Char* input, @@ -17,7 +17,7 @@ ACEXML_Base64::encode (const ACEXML_Char* input, ACE_NEW_RETURN (buf, ACE_Byte[len], 0); - ACE_Auto_Basic_Array_Ptr cleanup_buf (buf); + std::unique_ptr cleanup_buf (buf); for (size_t i = 0; i < len; ++i) buf[i] = (ACE_Byte)input[i]; @@ -59,7 +59,7 @@ ACEXML_Base64::decode (const ACEXML_Char* input, ACE_Byte[len], 0); - ACE_Auto_Basic_Array_Ptr cleanup (buf); + std::unique_ptr cleanup (buf); for (size_t i = 0; i < len; ++i) buf[i] = (ACE_Byte)input[i]; diff --git a/ACE/ACEXML/examples/SAXPrint/main.cpp b/ACE/ACEXML/examples/SAXPrint/main.cpp index e704d40c9bd76..aaae69da8acbd 100644 --- a/ACE/ACEXML/examples/SAXPrint/main.cpp +++ b/ACE/ACEXML/examples/SAXPrint/main.cpp @@ -6,7 +6,6 @@ #include "Print_Handler.h" #include "SAXPrint_Handler.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" #include "ace/Log_Msg.h" #include "ace/OS_main.h" diff --git a/ACE/ACEXML/parser/parser/Parser.cpp b/ACE/ACEXML/parser/parser/Parser.cpp index 48196f2672316..bafeedef8d6a0 100644 --- a/ACE/ACEXML/parser/parser/Parser.cpp +++ b/ACE/ACEXML/parser/parser/Parser.cpp @@ -12,6 +12,7 @@ #include "ACEXML/parser/parser/ParserInternals.h" #include "ace/OS_NS_string.h" #include "ace/OS_NS_strings.h" +#include static const ACEXML_Char default_attribute_type[] = ACE_TEXT ("CDATA"); static const ACEXML_Char empty_string[] = { 0 }; @@ -318,7 +319,7 @@ ACEXML_Parser::parse_external_dtd () if (this->validate_) { ACEXML_Char* uri = this->normalize_systemid (systemId); - ACE_Auto_Basic_Array_Ptr cleanup_uri (uri); + std::unique_ptr cleanup_uri (uri); ACEXML_InputSource* ip = 0; if (this->entity_resolver_) { @@ -2091,7 +2092,7 @@ ACEXML_Parser::parse_entity_reference () else { ACEXML_Char* uri = this->normalize_systemid (systemId); - ACE_Auto_Basic_Array_Ptr cleanup_uri (uri); + std::unique_ptr cleanup_uri (uri); ACEXML_InputSource* ip = 0; if (this->entity_resolver_) { @@ -2184,7 +2185,7 @@ ACEXML_Parser::parse_PE_reference () else if (this->external_entity_ && this->validate_) { ACEXML_Char* uri = this->normalize_systemid (systemId); - ACE_Auto_Basic_Array_Ptr cleanup_uri (uri); + std::unique_ptr cleanup_uri (uri); ACEXML_InputSource* ip = 0; if (this->entity_resolver_) { diff --git a/ACE/ACEXML/parser/parser/Parser.h b/ACE/ACEXML/parser/parser/Parser.h index 4fd5ae981c3e0..ad3213186a19e 100644 --- a/ACE/ACEXML/parser/parser/Parser.h +++ b/ACE/ACEXML/parser/parser/Parser.h @@ -29,7 +29,6 @@ #include "ace/Hash_Map_Manager.h" #include "ace/Unbounded_Set.h" #include "ace/Containers_T.h" -#include "ace/Auto_Ptr.h" #include "ACEXML/parser/parser/Entity_Manager.h" #include "ACEXML/parser/parser/ParserInternals.h" #include "ACEXML/parser/parser/ParserContext.h" diff --git a/ACE/Kokyu/Default_Dispatcher_Impl.cpp b/ACE/Kokyu/Default_Dispatcher_Impl.cpp index b82e96ecb3101..5b007663fd0db 100644 --- a/ACE/Kokyu/Default_Dispatcher_Impl.cpp +++ b/ACE/Kokyu/Default_Dispatcher_Impl.cpp @@ -36,7 +36,7 @@ Default_Dispatcher_Impl::init_i (const Dispatcher_Attributes& attrs) //ACE_DEBUG ((LM_DEBUG, "after new on task array\n" )); tasks_.reset(tasks_array); - //ACE_DEBUG ((LM_DEBUG, "task array auto_ptr set\n" )); + //ACE_DEBUG ((LM_DEBUG, "task array unique_ptr set\n" )); ConfigInfoSet& config_set = const_cast (attrs.config_info_set_); @@ -52,8 +52,8 @@ Default_Dispatcher_Impl::init_i (const Dispatcher_Attributes& attrs) Dispatcher_Task (*config, ACE_Thread_Manager::instance()), -1); - std::unique_ptr tmp_task_auto_ptr (task); - tasks_[i++] = std::move(tmp_task_auto_ptr); + std::unique_ptr tmp_task_unique_ptr (task); + tasks_[i++] = std::move(tmp_task_unique_ptr); } this->thr_creation_flags_ = attrs.thread_creation_flags (); diff --git a/ACE/Kokyu/Default_Dispatcher_Impl.h b/ACE/Kokyu/Default_Dispatcher_Impl.h index 2eb559f454c6d..ec17f76c713e4 100644 --- a/ACE/Kokyu/Default_Dispatcher_Impl.h +++ b/ACE/Kokyu/Default_Dispatcher_Impl.h @@ -49,7 +49,7 @@ namespace Kokyu private: typedef std::unique_ptr Dispatcher_Task_Auto_Ptr; - ACE_Auto_Array_Ptr tasks_; + std::unique_ptr tasks_; int ntasks_; ConfigInfoSet curr_config_info_; int activated_; diff --git a/ACE/Kokyu/Kokyu_defs.h b/ACE/Kokyu/Kokyu_defs.h index 9f8099dd08cd9..1eaedcb803f00 100644 --- a/ACE/Kokyu/Kokyu_defs.h +++ b/ACE/Kokyu/Kokyu_defs.h @@ -10,7 +10,6 @@ #include /**/ "ace/pre.h" #include "ace/Containers_T.h" #include "ace/Time_Value.h" -#include "ace/Auto_Ptr.h" #include "ace/Message_Block.h" #include "ace/Sched_Params.h" #include "ace/Malloc_Allocator.h" diff --git a/ACE/Kokyu/tests/DSRT_MIF/MIF.cpp b/ACE/Kokyu/tests/DSRT_MIF/MIF.cpp index 6bd96d9615021..c4da2b46de56c 100644 --- a/ACE/Kokyu/tests/DSRT_MIF/MIF.cpp +++ b/ACE/Kokyu/tests/DSRT_MIF/MIF.cpp @@ -1,5 +1,4 @@ #include "ace/ACE.h" -#include "ace/Auto_Ptr.h" #include "ace/Task.h" #include "ace/Sched_Params.h" #include "ace/Atomic_Op.h" diff --git a/ACE/NEWS b/ACE/NEWS index 9af0a7693f010..d5cbee617598f 100644 --- a/ACE/NEWS +++ b/ACE/NEWS @@ -1,6 +1,12 @@ USER VISIBLE CHANGES BETWEEN ACE-7.1.1 and ACE-7.1.2 ==================================================== +. C++17 removed std::auto_ptr, updated ACE/TAO to not + use std::auto_ptr anymore and also not provide our + own auto_ptr. With C++17 ACE doesn't provide ACE_Auto_Ptr, + ACE_Auto_Basic_Ptr, ACE_Auto_Basic_Array_Ptr, ACE_Auto_Array_Ptr, + and ACE_auto_ptr_reset anymore, just use std::unique_ptr + USER VISIBLE CHANGES BETWEEN ACE-7.1.0 and ACE-7.1.1 ==================================================== diff --git a/ACE/ace/ACE.cpp b/ACE/ace/ACE.cpp index 88e75e8a9e486..7971232741118 100644 --- a/ACE/ace/ACE.cpp +++ b/ACE/ace/ACE.cpp @@ -2,7 +2,6 @@ #include "ace/Basic_Types.h" #include "ace/Handle_Set.h" -#include "ace/Auto_Ptr.h" #include "ace/SString.h" #include "ace/Version.h" #include "ace/Message_Block.h" diff --git a/ACE/ace/Auto_Functor.h b/ACE/ace/Auto_Functor.h index e64bcdf6bb315..278db800b1e23 100644 --- a/ACE/ace/Auto_Functor.h +++ b/ACE/ace/Auto_Functor.h @@ -59,7 +59,7 @@ class Auto_Functor typedef Functor functor_type; /// Constructor - explicit Auto_Functor (X * p = 0, + explicit Auto_Functor (X * p = nullptr, Functor functor = Functor()); // noexcept Auto_Functor (Auto_Functor & rhs); // noexcept @@ -82,7 +82,7 @@ class Auto_Functor X * release(); // noexcept - void reset (X * p = 0); // noexcept + void reset (X * p = nullptr); // noexcept void reset (X * p, Functor f); // noexcept @@ -98,7 +98,6 @@ class Auto_Functor private: X * p_; - Functor f_; }; } // namespace ACE_Utils diff --git a/ACE/ace/Auto_Ptr.cpp b/ACE/ace/Auto_Ptr.cpp index 09028186a67c1..88fab8cbc58e4 100644 --- a/ACE/ace/Auto_Ptr.cpp +++ b/ACE/ace/Auto_Ptr.cpp @@ -3,6 +3,8 @@ #include "ace/Auto_Ptr.h" +#if !defined (ACE_HAS_CPP17) + #if defined (ACE_HAS_ALLOC_HOOKS) # include "ace/Malloc_Base.h" #endif /* ACE_HAS_ALLOC_HOOKS */ @@ -18,4 +20,6 @@ ACE_ALLOC_HOOK_DEFINE_Tt(ACE_Auto_Basic_Array_Ptr) ACE_END_VERSIONED_NAMESPACE_DECL +#endif /* ACE_HAS_CPP17 */ + #endif /* ACE_AUTO_PTR_CPP */ diff --git a/ACE/ace/Auto_Ptr.h b/ACE/ace/Auto_Ptr.h index 7fa3de4a2ce18..4c4d97d2e013a 100644 --- a/ACE/ace/Auto_Ptr.h +++ b/ACE/ace/Auto_Ptr.h @@ -21,6 +21,10 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +// C++17 removed std::auto_ptr<>, so also disable the ACE versions when +// using C++17. +#if !defined (ACE_HAS_CPP17) + #if defined (_MSC_VER) // Suppress warning e.g. "return type for // 'ACE_Auto_Array_Pointer::operator ->' is 'type *' (i.e., not a UDT @@ -44,7 +48,7 @@ class ACE_Auto_Basic_Ptr public: typedef X element_type; - explicit ACE_Auto_Basic_Ptr (X * p = 0) : p_ (p) {} + explicit ACE_Auto_Basic_Ptr (X * p = nullptr) : p_ (p) {} ACE_Auto_Basic_Ptr (ACE_Auto_Basic_Ptr & ap); ACE_Auto_Basic_Ptr &operator= (ACE_Auto_Basic_Ptr & rhs); @@ -54,7 +58,7 @@ class ACE_Auto_Basic_Ptr X &operator *() const; X *get () const; X *release (); - void reset (X * p = 0); + void reset (X * p = nullptr); /// Dump the state of an object. void dump () const; @@ -180,8 +184,7 @@ class ACE_Auto_Array_Ptr : public ACE_Auto_Basic_Array_Ptr */ template inline void -ACE_auto_ptr_reset (AUTO_PTR_TYPE & ap, - PTR_TYPE * p) +ACE_auto_ptr_reset (AUTO_PTR_TYPE & ap, PTR_TYPE * p) { ap.reset (p); } @@ -199,5 +202,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL # pragma warning(pop) #endif /* _MSC_VER */ +#endif /* ACE_HAS_CPP17 */ + #include /**/ "ace/post.h" #endif /* ACE_AUTO_PTR_H */ diff --git a/ACE/ace/Auto_Ptr.inl b/ACE/ace/Auto_Ptr.inl index e349e3202f70c..6657f5e20013d 100644 --- a/ACE/ace/Auto_Ptr.inl +++ b/ACE/ace/Auto_Ptr.inl @@ -1,6 +1,8 @@ // -*- C++ -*- #include "ace/Global_Macros.h" +#if !defined (ACE_HAS_CPP17) + #if defined (ACE_HAS_ALLOC_HOOKS) # include "ace/Malloc_Base.h" #endif /* ACE_HAS_ALLOC_HOOKS */ @@ -42,7 +44,7 @@ ACE_Auto_Basic_Ptr::release () { ACE_TRACE ("ACE_Auto_Basic_Ptr::release"); X *old = this->p_; - this->p_ = 0; + this->p_ = nullptr; return old; } @@ -175,3 +177,5 @@ ACE_Auto_Array_Ptr::operator->() const } ACE_END_VERSIONED_NAMESPACE_DECL + +#endif /* ACE_HAS_CPP17 */ diff --git a/ACE/ace/CDR_Stream.cpp b/ACE/ace/CDR_Stream.cpp index f30f3aa1fb599..b3f3dcf3db2ec 100644 --- a/ACE/ace/CDR_Stream.cpp +++ b/ACE/ace/CDR_Stream.cpp @@ -1,7 +1,7 @@ #include "ace/CDR_Stream.h" #include "ace/SString.h" -#include "ace/Auto_Ptr.h" #include "ace/Truncate.h" +#include #if !defined (__ACE_INLINE__) # include "ace/CDR_Stream.inl" @@ -1530,7 +1530,7 @@ ACE_InputCDR::read_string (ACE_CDR::Char *&x) 0); #endif /* ACE_HAS_ALLOC_HOOKS */ - ACE_Auto_Basic_Array_Ptr safe_data (x); + std::unique_ptr safe_data (x); if (this->read_char_array (x, len)) { @@ -1563,10 +1563,10 @@ ACE_InputCDR::read_string (ACE_CDR::Char *&x) ACE_CDR::Boolean ACE_InputCDR::read_string (ACE_CString &x) { - ACE_CDR::Char * data = 0; + ACE_CDR::Char * data = nullptr; if (this->read_string (data)) { - ACE_Auto_Basic_Array_Ptr safe_data (data); + std::unique_ptr safe_data (data); x = data; return true; } @@ -1604,7 +1604,7 @@ ACE_InputCDR::read_wstring (ACE_CDR::WChar*& x) // the memory is allocated. if (len > 0 && len <= this->length ()) { - ACE_Auto_Basic_Array_Ptr safe_data; + std::unique_ptr safe_data; if (static_cast (this->major_version_) == 1 && static_cast (this->minor_version_) == 2) diff --git a/ACE/ace/DLL_Manager.cpp b/ACE/ace/DLL_Manager.cpp index ec1a2a0e1b2a5..a6f0574334bf8 100644 --- a/ACE/ace/DLL_Manager.cpp +++ b/ACE/ace/DLL_Manager.cpp @@ -1,6 +1,5 @@ #include "ace/DLL_Manager.h" -#include "ace/Auto_Ptr.h" #include "ace/Log_Category.h" #include "ace/ACE.h" #include "ace/Framework_Component.h" @@ -12,6 +11,7 @@ #include "ace/Guard_T.h" #include "ace/OS_NS_dlfcn.h" #include "ace/OS_NS_string.h" +#include ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -243,7 +243,7 @@ ACE_DLL_Handle::symbol (const ACE_TCHAR *sym_name, bool ignore_errors, ACE_TStri ACE_TRACE ("ACE_DLL_Handle::symbol"); ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, 0)); - ACE_Auto_Array_Ptr auto_name (ACE::ldname (sym_name)); + std::unique_ptr auto_name (ACE::ldname (sym_name)); // handle_ can be invalid especially when ACE_DLL_Handle resigned ownership // BTW. Handle lifecycle management is a little crazy in ACE if (this->handle_ != ACE_SHLIB_INVALID_HANDLE) diff --git a/ACE/ace/Log_Msg.h b/ACE/ace/Log_Msg.h index 2608b6c0eb244..ebbac05573a03 100644 --- a/ACE/ace/Log_Msg.h +++ b/ACE/ace/Log_Msg.h @@ -657,7 +657,7 @@ class ACE_Export ACE_Log_Msg /// passed "true" for the delete_ostream argument to msg_ostream). /// If we are reference counting, this points to a shared count that will /// be deleted when it reaches zero. Since we want optional but shared - /// ownership neither std::auto_ptr nor ACE_Strong_Bound_Ptr have the right + /// ownership neither std::unique_ptr nor ACE_Strong_Bound_Ptr have the right /// semantics. *Bound_Ptr also doesn't take advantage of Atomic_Op. typedef ACE_Atomic_Op Atomic_ULong; Atomic_ULong *ostream_refcount_; diff --git a/ACE/ace/OS_NS_sys_stat.h b/ACE/ace/OS_NS_sys_stat.h index 3891f716b2644..fa044aa1dcc4b 100644 --- a/ACE/ace/OS_NS_sys_stat.h +++ b/ACE/ace/OS_NS_sys_stat.h @@ -33,11 +33,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL # if defined (_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64 && defined (ACE_WIN32) -# if defined (__BORLANDC__) -typedef struct stati64 ACE_stat; -# define ACE_STAT_FUNC_NAME ::_stati64 -# define ACE_WSTAT_FUNC_NAME ::_wstati64 -# elif defined (_MSC_VER) +# if defined (_MSC_VER) typedef struct _stat64 ACE_stat; # define ACE_STAT_FUNC_NAME ::_stat64 # define ACE_WSTAT_FUNC_NAME ::_wstat64 @@ -45,6 +41,10 @@ typedef struct _stat64 ACE_stat; typedef struct _stati64 ACE_stat; # define ACE_STAT_FUNC_NAME ::_stati64 # define ACE_WSTAT_FUNC_NAME ::_wstati64 +# elif defined (__BORLANDC__) +typedef struct stati64 ACE_stat; +# define ACE_STAT_FUNC_NAME ::_stati64 +# define ACE_WSTAT_FUNC_NAME ::_wstati64 # else typedef struct stat ACE_stat; # define ACE_STAT_FUNC_NAME ::stat diff --git a/ACE/ace/Pagefile_Memory_Pool.cpp b/ACE/ace/Pagefile_Memory_Pool.cpp index f5523223c685c..b536f8d1a3fc9 100644 --- a/ACE/ace/Pagefile_Memory_Pool.cpp +++ b/ACE/ace/Pagefile_Memory_Pool.cpp @@ -6,7 +6,6 @@ #endif /* __ACE_INLINE__ */ #include "ace/Log_Category.h" -#include "ace/Auto_Ptr.h" #include "ace/RW_Thread_Mutex.h" #include "ace/OS_NS_sys_mman.h" #include "ace/OS_NS_string.h" diff --git a/ACE/ace/Proactor.cpp b/ACE/ace/Proactor.cpp index f3230148e5ca8..061bcb930aaaa 100644 --- a/ACE/ace/Proactor.cpp +++ b/ACE/ace/Proactor.cpp @@ -4,7 +4,6 @@ // This only works on Win32 platforms and on Unix platforms with aio // calls. -#include "ace/Auto_Ptr.h" #include "ace/Proactor_Impl.h" #include "ace/Object_Manager.h" #include "ace/Task_T.h" diff --git a/ACE/ace/Refcounted_Auto_Ptr.h b/ACE/ace/Refcounted_Auto_Ptr.h index e63af3a048125..e2cb12072b260 100644 --- a/ACE/ace/Refcounted_Auto_Ptr.h +++ b/ACE/ace/Refcounted_Auto_Ptr.h @@ -13,8 +13,8 @@ #include /**/ "ace/pre.h" -#include "ace/Auto_Ptr.h" #include "ace/Atomic_Op.h" +#include #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -29,7 +29,7 @@ template class ACE_Refcounted_Auto_Ptr; /** * @class ACE_Refcounted_Auto_Ptr * - * @brief This class implements support for a reference counted auto_ptr. + * @brief This class implements support for a reference counted unique_ptr. * Assigning or copying instances of an ACE_Refcounted_Auto_Ptr * will automatically increment the reference count. When the last * instance that references a ACE_Refcounted_Auto_Ptr instance is @@ -51,7 +51,7 @@ class ACE_Refcounted_Auto_Ptr public: /// Constructor that initializes an ACE_Refcounted_Auto_Ptr to /// the specified pointer value. - explicit ACE_Refcounted_Auto_Ptr (X *p = 0); + explicit ACE_Refcounted_Auto_Ptr (X *p = nullptr); /// Copy constructor binds the new ACE_Refcounted_Auto_Ptr to the /// representation object referenced by @a r. @@ -98,7 +98,7 @@ class ACE_Refcounted_Auto_Ptr /// Releases the current pointer value and then sets a new /// pointer value specified by @a p. - void reset (X *p = 0); + void reset (X *p = nullptr); /// Get the pointer value. X *get () const; @@ -168,14 +168,14 @@ class ACE_Refcounted_Auto_Ptr_Rep static void detach (ACE_Refcounted_Auto_Ptr_Rep *&rep); /// Pointer to the result. - ACE_Auto_Basic_Ptr ptr_; + std::unique_ptr ptr_; /// Reference count. mutable ACE_Atomic_Op ref_count_; private: // = Constructor and destructor private. - ACE_Refcounted_Auto_Ptr_Rep (X *p = 0); + ACE_Refcounted_Auto_Ptr_Rep (X *p = nullptr); ~ACE_Refcounted_Auto_Ptr_Rep (); }; diff --git a/ACE/ace/SOCK_SEQPACK_Acceptor.cpp b/ACE/ace/SOCK_SEQPACK_Acceptor.cpp index 1a1272145a9fc..98e368550f539 100644 --- a/ACE/ace/SOCK_SEQPACK_Acceptor.cpp +++ b/ACE/ace/SOCK_SEQPACK_Acceptor.cpp @@ -1,6 +1,5 @@ #include "ace/SOCK_SEQPACK_Acceptor.h" -#include "ace/Auto_Ptr.h" #include "ace/Log_Category.h" #include "ace/OS_Memory.h" #include "ace/OS_NS_string.h" diff --git a/ACE/ace/SOCK_SEQPACK_Association.cpp b/ACE/ace/SOCK_SEQPACK_Association.cpp index 700c046f45542..73841eea7a47c 100644 --- a/ACE/ace/SOCK_SEQPACK_Association.cpp +++ b/ACE/ace/SOCK_SEQPACK_Association.cpp @@ -1,9 +1,9 @@ #include "ace/SOCK_SEQPACK_Association.h" -#include "ace/Auto_Ptr.h" #include "ace/Log_Category.h" #include "ace/OS_Memory.h" #include "ace/OS_NS_string.h" +#include #if !defined (__ACE_INLINE__) #include "ace/SOCK_SEQPACK_Association.inl" @@ -143,10 +143,10 @@ ACE_SOCK_SEQPACK_Association::get_local_addrs (ACE_INET_Addr *addrs, size_t &siz */ - // The array of sockaddr_in will be stored in an ACE_Auto_Array_Ptr, + // The array of sockaddr_in will be stored in an std::unique_ptr, // which causes dynamically-allocated memory to be released as soon - // as the ACE_Auto_Array_Ptr goes out of scope. - ACE_Auto_Array_Ptr addr_structs; + // as the std::unique_ptr goes out of scope. + std::unique_ptr addr_structs; // Allocate memory for this array. Return -1 if the memory cannot // be allocated. (This activity requires a temporary variable---a @@ -286,10 +286,10 @@ ACE_SOCK_SEQPACK_Association::get_remote_addrs (ACE_INET_Addr *addrs, size_t &si */ - // The array of sockaddr_in will be stored in an ACE_Auto_Array_Ptr, + // The array of sockaddr_in will be stored in an std::unique_ptr, // which causes dynamically-allocated memory to be released as soon - // as the ACE_Auto_Array_Ptr goes out of scope. - ACE_Auto_Array_Ptr addr_structs; + // as the std::unique_ptr goes out of scope. + std::unique_ptr addr_structs; // Allocate memory for this array. Return -1 if the memory cannot // be allocated. (This activity requires a temporary variable---a diff --git a/ACE/ace/SString.h b/ACE/ace/SString.h index 70031e5293b91..1473c2dee2632 100644 --- a/ACE/ace/SString.h +++ b/ACE/ace/SString.h @@ -269,8 +269,8 @@ typedef ACE_CString ACE_TString; * Keeps a pointer to a string and deallocates it (using * ) on its destructor. * If you need to delete using "delete[]" the - * ACE_Auto_Array_Ptr is your choice. - * The class plays the same role as auto_ptr<> + * std::unique_ptr is your choice. + * The class plays the same role as unique_ptr<> */ class ACE_Export ACE_Auto_String_Free { diff --git a/ACE/ace/Service_Gestalt.cpp b/ACE/ace/Service_Gestalt.cpp index bc82751959c3a..049c997fc2e49 100644 --- a/ACE/ace/Service_Gestalt.cpp +++ b/ACE/ace/Service_Gestalt.cpp @@ -5,7 +5,6 @@ #include "ace/Service_Manager.h" #include "ace/Service_Types.h" #include "ace/Containers.h" -#include "ace/Auto_Ptr.h" #include "ace/Reactor.h" #include "ace/Thread_Manager.h" #include "ace/DLL.h" diff --git a/ACE/ace/Sock_Connect.cpp b/ACE/ace/Sock_Connect.cpp index 6d7fd6b1282e7..ae3ce1ace0f32 100644 --- a/ACE/ace/Sock_Connect.cpp +++ b/ACE/ace/Sock_Connect.cpp @@ -2,7 +2,6 @@ #include "ace/INET_Addr.h" #include "ace/Log_Category.h" #include "ace/Handle_Set.h" -#include "ace/Auto_Ptr.h" #include "ace/SString.h" #include "ace/OS_Memory.h" #include "ace/OS_NS_stdio.h" @@ -681,7 +680,7 @@ ACE::get_ip_interfaces (size_t &count, ACE_INET_Addr *&addrs) -1); ACE_OS::memset (ifs, 0, num_ifs * sizeof (struct IFREQ)); - ACE_Auto_Array_Ptr p_ifs (ifs); + std::unique_ptr p_ifs (ifs); if (p_ifs.get() == 0) { diff --git a/ACE/ace/Svc_Conf_Lexer.cpp b/ACE/ace/Svc_Conf_Lexer.cpp index 8406c152ef721..3c408d5e0249d 100644 --- a/ACE/ace/Svc_Conf_Lexer.cpp +++ b/ACE/ace/Svc_Conf_Lexer.cpp @@ -18,7 +18,7 @@ #include "ace/os_include/os_ctype.h" #if !defined (__GNUG__) -# include "ace/Auto_Ptr.h" +# include #endif ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -34,7 +34,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL # define ACE_TEMPORARY_STRING(X,SIZE) \ char* X = 0; \ char X ## buf[ACE_YY_BUF_SIZE]; \ - ACE_Auto_Ptr X ## bufp (0); \ + std::unique_ptr X ## bufp (nullptr); \ if (SIZE > ACE_YY_BUF_SIZE) { \ X ## bufp.reset (new char[SIZE]); \ X = X ## bufp.get (); \ diff --git a/ACE/ace/TLI.cpp b/ACE/ace/TLI.cpp index d0fbd289f3cbe..2c16a70857a4b 100644 --- a/ACE/ace/TLI.cpp +++ b/ACE/ace/TLI.cpp @@ -6,7 +6,6 @@ #include "ace/OS_TLI.h" #include "ace/OS_NS_string.h" #include "ace/OS_NS_sys_socket.h" -#include "ace/Auto_Ptr.h" #include #if defined (ACE_HAS_TLI) @@ -100,7 +99,7 @@ ACE_TLI::set_option (int level, int option, void *optval, int optlen) # if (_XOPEN_SOURCE - 0 >= 500) std::unique_ptr req_opt_buf_p (reinterpret_cast (req.opt.buf)); # else - ACE_Auto_Array_Ptr req_opt_buf_p (req.opt.buf); + std::unique_ptr req_opt_buf_p (req.opt.buf); # endif /* XPG5 vs XPG4 */ struct t_opthdr *opthdr = reinterpret_cast (req.opt.buf); @@ -108,7 +107,7 @@ ACE_TLI::set_option (int level, int option, void *optval, int optlen) # if (_XOPEN_SOURCE - 0 >= 500) std::unique_ptr ret_opt_buf_p (reinterpret_cast (ret.opt.buf)); # else - ACE_Auto_Array_Ptr ret_opt_buf_p (ret.opt.buf); + std::unique_ptr ret_opt_buf_p (ret.opt.buf); # endif /* XPG5 vs XPG4 */ req.flags = T_NEGOTIATE; @@ -139,7 +138,7 @@ ACE_TLI::get_option (int level, int option, void *optval, int &optlen) # if (_XOPEN_SOURCE - 0 >= 500) std::unique_ptr req_opt_buf_p (reinterpret_cast (req.opt.buf)); # else - ACE_Auto_Array_Ptr req_opt_buf_p (req.opt.buf); + std::unique_ptr req_opt_buf_p (req.opt.buf); # endif /* XPG5 vs XPG4 */ struct t_opthdr *opthdr = reinterpret_cast (req.opt.buf); @@ -147,7 +146,7 @@ ACE_TLI::get_option (int level, int option, void *optval, int &optlen) # if (_XOPEN_SOURCE - 0 >= 500) std::unique_ptr ret_opt_buf_p (reinterpret_cast (ret.opt.buf)); # else - ACE_Auto_Array_Ptr ret_opt_buf_p (ret.opt.buf); + std::unique_ptr ret_opt_buf_p (ret.opt.buf); # endif /* XPG5 vs XPG4 */ req.flags = T_CURRENT; diff --git a/ACE/ace/UUID.cpp b/ACE/ace/UUID.cpp index b481c53e3013a..9f57dbe0f8c4f 100644 --- a/ACE/ace/UUID.cpp +++ b/ACE/ace/UUID.cpp @@ -12,7 +12,7 @@ #include "ace/OS_NS_netdb.h" #include "ace/OS_NS_unistd.h" #include "ace/ACE.h" -#include "ace/Auto_Ptr.h" +#include ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -64,7 +64,7 @@ namespace ACE_Utils // Get a buffer exactly the correct size. Use the nil UUID as a // gauge. Don't forget the trailing nul. - ACE_Auto_Array_Ptr auto_clean; + std::unique_ptr auto_clean; size_t UUID_STRING_LENGTH = 36 + thr_id_.length () + pid_.length (); char *buf = 0; diff --git a/ACE/ace/config-win32-msvc-142.h b/ACE/ace/config-win32-msvc-142.h index daed397225952..157b4acb48099 100644 --- a/ACE/ace/config-win32-msvc-142.h +++ b/ACE/ace/config-win32-msvc-142.h @@ -29,9 +29,5 @@ # define ACE_HAS_CPP20 #endif /* _MSVC_LANG >= 202002L */ -#ifdef ACE_HAS_CPP17 -# define ACE_LACKS_AUTO_PTR -#endif - #include /**/ "ace/post.h" #endif /* ACE_CONFIG_WIN32_MSVC_142_H */ diff --git a/ACE/ace/os_include/os_fcntl.h b/ACE/ace/os_include/os_fcntl.h index 542a72e9f674e..f8b3de5687148 100644 --- a/ACE/ace/os_include/os_fcntl.h +++ b/ACE/ace/os_include/os_fcntl.h @@ -36,17 +36,37 @@ extern "C" #endif /* __cplusplus */ #if defined (__BORLANDC__) +# if !defined (_O_CREAT) # define _O_CREAT O_CREAT -# define _O_EXCL O_EXCL +# endif +# if !defined (_O_EXCL) +# define _O_EXCL O_EXCL +# endif +# if !defined (_O_TRUNC) # define _O_TRUNC O_TRUNC +# endif +# if !defined (_O_TEMPORARY) // 0x0800 is used for O_APPEND. 0x08 looks free. # define _O_TEMPORARY 0x08 /* see fcntl.h */ -# define _O_RDWR O_RDWR +# endif +# if !defined (_O_RDWR) +# define _O_RDWR O_RDWR +# endif +# if !defined (_O_WRONLY) # define _O_WRONLY O_WRONLY +# endif +# if !defined (_O_RDONLY) # define _O_RDONLY O_RDONLY +# endif +# if !defined (_O_APPEND) # define _O_APPEND O_APPEND +# endif +# if !defined (_O_BINARY) # define _O_BINARY O_BINARY -# define _O_TEXT O_TEXT +# endif +# if !defined (_O_TEXT) +# define _O_TEXT O_TEXT +# endif #endif /* __BORLANDC__ */ // defined Win32 specific macros for UNIX platforms diff --git a/ACE/ace/os_include/sys/os_types.h b/ACE/ace/os_include/sys/os_types.h index b179c7051ad73..8a568f53b2f1f 100644 --- a/ACE/ace/os_include/sys/os_types.h +++ b/ACE/ace/os_include/sys/os_types.h @@ -119,7 +119,7 @@ typedef DWORD nlink_t; #if defined (ACE_LACKS_PID_T) typedef int pid_t; -#endif /* ACE_WIN32 */ +#endif /* ACE_LACKS_PID_T */ # if !defined (ACE_INVALID_PID) # define ACE_INVALID_PID ((pid_t) -1) diff --git a/ACE/apps/JAWS/clients/Caching/Locator_Request_Reply.cpp b/ACE/apps/JAWS/clients/Caching/Locator_Request_Reply.cpp index 263688be3cf49..bca4ff1dd549c 100644 --- a/ACE/apps/JAWS/clients/Caching/Locator_Request_Reply.cpp +++ b/ACE/apps/JAWS/clients/Caching/Locator_Request_Reply.cpp @@ -7,10 +7,10 @@ #include "Locator_Request_Reply.inl" #endif -#include "ace/Auto_Ptr.h" #include "URL_Properties.h" #include "URL_Array_Helper.h" #include "URL_Locator.h" +#include int ACE_URL_Locator_Request::url_query (const int how, @@ -265,13 +265,13 @@ ACE_URL_Locator_Request::dump () const if (this->id_.length () > 0) ACE_DEBUG ((LM_DEBUG, "Offer ID: %s\n", - ACE_Auto_Basic_Array_Ptr (this->id_.char_rep ()).get ())); + std::unique_ptr (this->id_.char_rep ()).get ())); else ACE_DEBUG ((LM_DEBUG, "Offer ID: \"\"\n")); if (this->url_.length () > 0) ACE_DEBUG ((LM_DEBUG, "URL: %s\n", - ACE_Auto_Basic_Array_Ptr (this->url_.char_rep ()).get ())); + std::unique_ptr (this->url_.char_rep ()).get ())); else ACE_DEBUG ((LM_DEBUG, "URL: \"\"\n")); diff --git a/ACE/apps/JAWS/clients/Caching/URL_Properties.cpp b/ACE/apps/JAWS/clients/Caching/URL_Properties.cpp index c571f2a5f4f95..8c1ab1a7444a2 100644 --- a/ACE/apps/JAWS/clients/Caching/URL_Properties.cpp +++ b/ACE/apps/JAWS/clients/Caching/URL_Properties.cpp @@ -7,8 +7,8 @@ #include "URL_Properties.inl" #endif /* __ACE_INLINE__ */ -#include "ace/Auto_Ptr.h" #include "URL_Array_Helper.h" +#include size_t ACE_WString_Helper::encode (void *buf, const ACE_WString &wstr) @@ -63,13 +63,13 @@ ACE_URL_Property::dump () const if (this->name_.length () > 0) ACE_DEBUG ((LM_DEBUG, "\n name_: \"%s\"\n", - ACE_Auto_Basic_Array_Ptr (this->name_.char_rep ()).get ())); + std::unique_ptr (this->name_.char_rep ()).get ())); else ACE_DEBUG ((LM_DEBUG, "\n name_: \"\"\n")); if (this->value_.length () > 0) ACE_DEBUG ((LM_DEBUG, " value_: \"%s\"\n", - ACE_Auto_Basic_Array_Ptr (this->value_.char_rep ()).get ())); + std::unique_ptr (this->value_.char_rep ()).get ())); else ACE_DEBUG ((LM_DEBUG, " value_: \"\"\n")); @@ -122,7 +122,7 @@ ACE_URL_Offer::dump () const if (this->url_.length () > 0) ACE_DEBUG ((LM_DEBUG, "\n url_: \"%s\"\n", - ACE_Auto_Basic_Array_Ptr (this->url_.char_rep ()).get ())); + std::unique_ptr (this->url_.char_rep ()).get ())); else ACE_DEBUG ((LM_DEBUG, "\n url_: \"\"\n")); diff --git a/ACE/apps/JAWS/server/HTTP_Server.cpp b/ACE/apps/JAWS/server/HTTP_Server.cpp index 9894cab64bfdc..4fdd569027032 100644 --- a/ACE/apps/JAWS/server/HTTP_Server.cpp +++ b/ACE/apps/JAWS/server/HTTP_Server.cpp @@ -8,10 +8,10 @@ #include "ace/LOCK_SOCK_Acceptor.h" #include "ace/Proactor.h" #include "ace/Signal.h" -#include "ace/Auto_Ptr.h" #include "JAWS_IO.h" #include "HTTP_Server.h" +#include // class is overkill class JAWS @@ -154,7 +154,7 @@ HTTP_Server::init (int argc, ACE_TCHAR *argv[]) //NOTE: At this point f better not be a NULL pointer, //so please do not change the ACE_NEW_RETURN macros unless //you know what you are doing - ACE_Auto_Ptr factory (f); + std::unique_ptr factory (f); // Choose what concurrency strategy to run. switch (this->strategy_) diff --git a/ACE/apps/JAWS/server/JAWS_IO.cpp b/ACE/apps/JAWS/server/JAWS_IO.cpp index a71289ebdde85..9699073850bd0 100644 --- a/ACE/apps/JAWS/server/JAWS_IO.cpp +++ b/ACE/apps/JAWS/server/JAWS_IO.cpp @@ -11,8 +11,8 @@ #include "ace/OS_NS_fcntl.h" #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_sys_stat.h" -#include "ace/Auto_Ptr.h" #include "ace/Basic_Types.h" +#include JAWS_IO::JAWS_IO () : handler_ (0) @@ -508,7 +508,7 @@ JAWS_Synch_IO_No_Cache::transmit_file (const char *filename, } char* f = new char[size]; - ACE_Auto_Basic_Array_Ptr file (f); + std::unique_ptr file (f); ACE_OS::read_n (handle, f, size); diff --git a/ACE/apps/gperf/src/Key_List.cpp b/ACE/apps/gperf/src/Key_List.cpp index cdb6ee90851f1..28e82b6447eac 100644 --- a/ACE/apps/gperf/src/Key_List.cpp +++ b/ACE/apps/gperf/src/Key_List.cpp @@ -24,10 +24,10 @@ #include "Key_List.h" #include "Hash_Table.h" #include "ace/Read_Buffer.h" -#include "ace/Auto_Ptr.h" #include "ace/OS_Memory.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_string.h" +#include /// Default type for generated code. const char *const Key_List::default_array_type = "char *"; @@ -556,7 +556,7 @@ Key_List::output_switch (int use_keyword_table) output_keyword_table (); } - ACE_Auto_Basic_Array_Ptr safe_comp_buffer; + std::unique_ptr safe_comp_buffer; char * comp_buffer; List_Node *curr = head; diff --git a/ACE/bin/main2TMAIN.pl b/ACE/bin/main2TMAIN.pl index cf5d26627cb22..f4378668e0f49 100755 --- a/ACE/bin/main2TMAIN.pl +++ b/ACE/bin/main2TMAIN.pl @@ -6,7 +6,7 @@ # You may want to run the "find" command with this script, which maybe # something like this: # -# find . -type f \( -name "*.C" -o -name "*.cc" -o -name "*.c" -o -name "*.cpp" \) -print | xargs $ACE_ROOT/bin/auto_ptr.perl +# find . -type f \( -name "*.C" -o -name "*.cc" -o -name "*.c" -o -name "*.cpp" \) -print | xargs $ACE_ROOT/bin/main2TMAIN.pl # The first three lines above let this script run without specifying the # full path to perl, as long as it is in the user's PATH. diff --git a/ACE/docs/exceptions.html b/ACE/docs/exceptions.html index efb723799028f..3ea5b3b4b42e6 100644 --- a/ACE/docs/exceptions.html +++ b/ACE/docs/exceptions.html @@ -488,7 +488,7 @@

Examples

  • Instead of depending on ACE_CATCHALL, use - auto_ptr style mechanism to prevent memory leaks + std::unique_ptr style mechanism to prevent memory leaks from exceptions.

  • @@ -520,7 +520,7 @@

    General Guidelines for Exception Handling

  • Make sure an exception doesn't cause resource leak (memory, - socket, ...) (hint: Use auto_ptr to avoid memory leak, + socket, ...) (hint: Use std::unique_ptr to avoid memory leak, and ACE_Guard for locks.)

  • diff --git a/ACE/examples/APG/Active_Objects/AO.cpp b/ACE/examples/APG/Active_Objects/AO.cpp index 9600e99560ec3..c2b0dd57a660f 100644 --- a/ACE/examples/APG/Active_Objects/AO.cpp +++ b/ACE/examples/APG/Active_Objects/AO.cpp @@ -6,7 +6,8 @@ #include "ace/Method_Request.h" #include "ace/Task.h" #include "ace/Future.h" -#include "ace/Auto_Ptr.h" +#include + // Listing 1 code/ch15 class HA_ControllerAgent { diff --git a/ACE/examples/APG/Active_Objects/AO2.cpp b/ACE/examples/APG/Active_Objects/AO2.cpp index 9543f6480d05a..d552b2c2d4838 100644 --- a/ACE/examples/APG/Active_Objects/AO2.cpp +++ b/ACE/examples/APG/Active_Objects/AO2.cpp @@ -6,7 +6,7 @@ #include "ace/Method_Request.h" #include "ace/Task.h" #include "ace/Future.h" -#include "ace/Auto_Ptr.h" +#include class HA_ControllerAgent { diff --git a/ACE/examples/APG/Naming/Name_Binding.h b/ACE/examples/APG/Naming/Name_Binding.h index 069ef1eae2a03..01e45500e4e88 100644 --- a/ACE/examples/APG/Naming/Name_Binding.h +++ b/ACE/examples/APG/Naming/Name_Binding.h @@ -4,8 +4,8 @@ #include "ace/OS_NS_stdlib.h" #include "ace/OS_NS_string.h" -#include "ace/Auto_Ptr.h" #include "ace/Name_Space.h" +#include // Listing 1 code/ch21 class Name_Binding diff --git a/ACE/examples/APG/Reactor/HAStatus.cpp b/ACE/examples/APG/Reactor/HAStatus.cpp index 7ea76a5c9a61d..c25165317eea5 100644 --- a/ACE/examples/APG/Reactor/HAStatus.cpp +++ b/ACE/examples/APG/Reactor/HAStatus.cpp @@ -2,11 +2,11 @@ #include "ace/os_include/os_netdb.h" // Listing 1 code/ch07 -#include "ace/Auto_Ptr.h" #include "ace/Log_Msg.h" #include "ace/INET_Addr.h" #include "ace/SOCK_Acceptor.h" #include "ace/Reactor.h" +#include class ClientAcceptor : public ACE_Event_Handler { diff --git a/ACE/examples/C++NPv2/Reactor_Logging_Server_Adapter.cpp b/ACE/examples/C++NPv2/Reactor_Logging_Server_Adapter.cpp index df15596844266..37e6fd6232537 100644 --- a/ACE/examples/C++NPv2/Reactor_Logging_Server_Adapter.cpp +++ b/ACE/examples/C++NPv2/Reactor_Logging_Server_Adapter.cpp @@ -6,12 +6,12 @@ #define _REACTOR_LOGGING_SERVER_ADAPTER_C #include "ace/ACE.h" -#include "ace/Auto_Ptr.h" #include "ace/INET_Addr.h" #include "ace/Truncate.h" #include "Reactor_Logging_Server_Adapter.h" #include "ace/OS_NS_string.h" #include "ace/OS_NS_stdio.h" +#include template int Reactor_Logging_Server_Adapter::init (int argc, @@ -19,7 +19,7 @@ Reactor_Logging_Server_Adapter::init (int argc, int i; char **array = 0; ACE_NEW_RETURN (array, char*[argc], -1); - ACE_Auto_Array_Ptr char_argv (array); + std::unique_ptr char_argv (array); for (i = 0; i < argc; ++i) char_argv[i] = ACE::strnew (ACE_TEXT_ALWAYS_CHAR (argv[i])); diff --git a/ACE/examples/C++NPv2/TP_Logging_Server.h b/ACE/examples/C++NPv2/TP_Logging_Server.h index fe2c20f825ed0..d1a43b9b8626b 100644 --- a/ACE/examples/C++NPv2/TP_Logging_Server.h +++ b/ACE/examples/C++NPv2/TP_Logging_Server.h @@ -5,7 +5,6 @@ #ifndef _TP_LOGGING_SERVER_H #define _TP_LOGGING_SERVER_H -#include "ace/Auto_Ptr.h" #include "ace/Singleton.h" #include "ace/Synch.h" #include "ace/Task.h" @@ -13,6 +12,7 @@ #include "Logging_Event_Handler.h" #include "Reactor_Logging_Server_T.h" #include "TPLS_export.h" +#include class TP_Logging_Task : public ACE_Task { // Instantiated with an MT synchronization trait. @@ -102,7 +102,7 @@ class TP_Logging_Server : public ACE_Service_Object { int i; char **array = 0; ACE_NEW_RETURN (array, char*[argc], -1); - ACE_Auto_Array_Ptr char_argv (array); + std::unique_ptr char_argv (array); for (i = 0; i < argc; ++i) char_argv[i] = ACE::strnew (ACE_TEXT_ALWAYS_CHAR (argv[i])); diff --git a/ACE/examples/IPC_SAP/UPIPE_SAP/ex2.cpp b/ACE/examples/IPC_SAP/UPIPE_SAP/ex2.cpp index f4eb783f9f8f0..9ab4125b16bfc 100644 --- a/ACE/examples/IPC_SAP/UPIPE_SAP/ex2.cpp +++ b/ACE/examples/IPC_SAP/UPIPE_SAP/ex2.cpp @@ -14,9 +14,8 @@ #include "ace/OS_main.h" #include "ace/UPIPE_Connector.h" #include "ace/UPIPE_Acceptor.h" -#include "ace/Auto_Ptr.h" #include "ace/OS_NS_time.h" - +#include #if defined (ACE_HAS_THREADS) @@ -31,7 +30,7 @@ supplier (void *) ACE_UPIPE_Addr c_addr (ACE_TEXT("pattern")); - ACE_Auto_Basic_Array_Ptr mybuf (new char[size]); + std::unique_ptr mybuf (new char[size]); for (int i = 0; i < size; i++) mybuf[i] = 'a'; diff --git a/ACE/examples/IPC_SAP/UPIPE_SAP/ex3.cpp b/ACE/examples/IPC_SAP/UPIPE_SAP/ex3.cpp index 4e725621728a8..83d1ba39725be 100644 --- a/ACE/examples/IPC_SAP/UPIPE_SAP/ex3.cpp +++ b/ACE/examples/IPC_SAP/UPIPE_SAP/ex3.cpp @@ -11,13 +11,11 @@ */ //============================================================================= - #include "ace/OS_main.h" #include "ace/UPIPE_Connector.h" #include "ace/UPIPE_Acceptor.h" -#include "ace/Auto_Ptr.h" #include "ace/OS_NS_time.h" - +#include #if defined (ACE_HAS_THREADS) @@ -41,7 +39,7 @@ supplier (void *) "(%t) %p\n", "ACE_UPIPE_Acceptor.connect failed")); - ACE_Auto_Basic_Array_Ptr mybuf (new char[size]); + std::unique_ptr mybuf (new char[size]); for (int i = 0; i < size; i++) mybuf[i] = 'a'; @@ -90,7 +88,7 @@ consumer (void *) "ACE_UPIPE_Acceptor.accept failed")); // Ensure deletion upon exit. - ACE_Auto_Basic_Array_Ptr mybuf (new char[size]); + std::unique_ptr mybuf (new char[size]); time_t currsec; ACE_OS::time (&currsec); diff --git a/ACE/examples/Reactor/TP_Reactor/client.cpp b/ACE/examples/Reactor/TP_Reactor/client.cpp index ef6bc7d1a394b..9012a9f140c05 100644 --- a/ACE/examples/Reactor/TP_Reactor/client.cpp +++ b/ACE/examples/Reactor/TP_Reactor/client.cpp @@ -4,7 +4,6 @@ * Date: 26-Jan-2006 */ -#include #include #include #include @@ -12,7 +11,7 @@ #include #include #include - +#include #include "common.h" /** @@ -51,7 +50,7 @@ int ACE_TMAIN(int argc, ACE_TCHAR **argv) { ACE_TEXT ("data buffer.\n")), -1); // put someData in a kind of auto_ptr so it gets deleted automatically - ACE_Auto_Array_Ptr pSomeData(someData); + std::unique_ptr pSomeData(someData); // parse the argument if available if ((argc == 3) && (((count = ACE_OS::strtol(argv[2], 0, 10)) < 1) || diff --git a/ACE/examples/Reactor/WFMO_Reactor/Handle_Close.cpp b/ACE/examples/Reactor/WFMO_Reactor/Handle_Close.cpp index 9a2a4840559a3..0b783827f96d7 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Handle_Close.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Handle_Close.cpp @@ -16,10 +16,9 @@ #include "ace/Reactor.h" #include "ace/WFMO_Reactor.h" #include "ace/Select_Reactor.h" -#include "ace/Auto_Ptr.h" #include "ace/Pipe.h" #include "ace/OS_main.h" - +#include // Use the WFMO_Reactor static int opt_wfmo_reactor = 0; @@ -279,7 +278,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) Different_Handler different_handler (pipe2); // Manage memory automagically. - auto_ptr reactor (create_reactor ()); + std::unique_ptr reactor (create_reactor ()); // Register handlers ACE_Reactor_Mask handler_mask = diff --git a/ACE/examples/Reactor/WFMO_Reactor/Window_Messages.cpp b/ACE/examples/Reactor/WFMO_Reactor/Window_Messages.cpp index 6ee6a0de8cb7a..383bb3def373c 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Window_Messages.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Window_Messages.cpp @@ -17,8 +17,8 @@ #include "ace/Msg_WFMO_Reactor.h" #include "ace/Reactor.h" -#include "ace/Auto_Ptr.h" #include "ace/Auto_Event.h" +#include class Event_Handler : public ACE_Event_Handler { @@ -58,7 +58,7 @@ ACE_TMAIN (int, ACE_TCHAR*[]) { // Manage memory automagically. ACE_Reactor_Impl *impl = new ACE_Msg_WFMO_Reactor; - auto_ptr reactor (new ACE_Reactor (impl, 1)); + std::unique_ptr reactor (new ACE_Reactor (impl, 1)); ACE_Reactor::instance (reactor.get ()); Event_Handler event_handler; diff --git a/ACE/examples/Smart_Pointers/gadget_test.cpp b/ACE/examples/Smart_Pointers/gadget_test.cpp index fc92fad153a49..32890ae311290 100644 --- a/ACE/examples/Smart_Pointers/gadget_test.cpp +++ b/ACE/examples/Smart_Pointers/gadget_test.cpp @@ -7,13 +7,13 @@ */ //============================================================================= -#include "ace/Auto_Ptr.h" #include "ace/Refcounted_Auto_Ptr.h" #include "ace/Unbounded_Queue.h" #include "Gadget.h" #include "Gadget_Factory.h" #include "Gadget_Part.h" #include "Gadget_Part_Factory.h" +#include int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { diff --git a/ACE/examples/Threads/future1.cpp b/ACE/examples/Threads/future1.cpp index 20d6c54332a53..2565fe5ce207b 100644 --- a/ACE/examples/Threads/future1.cpp +++ b/ACE/examples/Threads/future1.cpp @@ -20,9 +20,8 @@ #include "ace/Future.h" #include "ace/Method_Request.h" #include "ace/Activation_Queue.h" -#include "ace/Auto_Ptr.h" #include "ace/Atomic_Op.h" - +#include #if defined (ACE_HAS_THREADS) @@ -215,7 +214,7 @@ Scheduler::svc () { for (;;) { - // Dequeue the next method object (we use an auto pointer in + // Dequeue the next method object (we use an unique pointer in // case an exception is thrown in the ). std::unique_ptr mo (this->activation_queue_.dequeue ()); diff --git a/ACE/examples/Threads/future2.cpp b/ACE/examples/Threads/future2.cpp index e8e19fe5cd0f2..d883c747420f0 100644 --- a/ACE/examples/Threads/future2.cpp +++ b/ACE/examples/Threads/future2.cpp @@ -20,8 +20,8 @@ #include "ace/Future.h" #include "ace/Method_Request.h" #include "ace/Activation_Queue.h" -#include "ace/Auto_Ptr.h" #include "ace/Atomic_Op.h" +#include #if defined (ACE_HAS_THREADS) @@ -212,7 +212,7 @@ Scheduler::svc () // Main event loop for this active object. for (;;) { - // Dequeue the next method object (we use an auto pointer in + // Dequeue the next method object (we use an unique pointer in // case an exception is thrown in the ). std::unique_ptr mo (this->activation_queue_.dequeue ()); diff --git a/ACE/examples/Timer_Queue/Driver.cpp b/ACE/examples/Timer_Queue/Driver.cpp index 345a1fc68f14d..4663ffaa95fcd 100644 --- a/ACE/examples/Timer_Queue/Driver.cpp +++ b/ACE/examples/Timer_Queue/Driver.cpp @@ -17,12 +17,10 @@ #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_string.h" #include "ace/OS_NS_unistd.h" -#include "ace/Auto_Ptr.h" #include "Driver.h" - +#include // constructor - template Command::Command (RECEIVER &recvr, ACTION action) diff --git a/ACE/examples/Web_Crawler/HTTP_URL.cpp b/ACE/examples/Web_Crawler/HTTP_URL.cpp index 3a0206d04f813..026ff4db1873c 100644 --- a/ACE/examples/Web_Crawler/HTTP_URL.cpp +++ b/ACE/examples/Web_Crawler/HTTP_URL.cpp @@ -1,10 +1,9 @@ #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_string.h" -#include "ace/Auto_Ptr.h" #include "URL_Visitor.h" #include "Options.h" #include "HTTP_URL.h" - +#include const ACE_URL_Addr & HTTP_URL::url_addr () const @@ -36,7 +35,7 @@ HTTP_URL::send_request () -1); // Ensure that the memory is deallocated. - ACE_Auto_Basic_Array_Ptr cmd_ptr (command); + std::unique_ptr cmd_ptr (command); ACE_OS::sprintf (cmd_ptr.get (), "GET /%s HTTP/1.1\r\n", diff --git a/ACE/examples/Web_Crawler/Mem_Map_Stream.cpp b/ACE/examples/Web_Crawler/Mem_Map_Stream.cpp index 47a0f54e1f258..b1503a831ba08 100644 --- a/ACE/examples/Web_Crawler/Mem_Map_Stream.cpp +++ b/ACE/examples/Web_Crawler/Mem_Map_Stream.cpp @@ -1,5 +1,5 @@ #include "ace/FILE_Addr.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Truncate.h" #include "Options.h" #include "Mem_Map_Stream.h" diff --git a/ACE/include/makeinclude/platform_linux_icc.GNU b/ACE/include/makeinclude/platform_linux_icc.GNU index ee8f728b21e85..b45bb70977e48 100644 --- a/ACE/include/makeinclude/platform_linux_icc.GNU +++ b/ACE/include/makeinclude/platform_linux_icc.GNU @@ -58,8 +58,6 @@ endif ifeq ($(c++11),1) CCFLAGS += -std=c++11 - # This is needed due to the use of the deprecated auto_ptr class - CCFLAGS += -Wno-deprecated endif CFLAGS += -w1 diff --git a/ACE/netsvcs/lib/Client_Logging_Handler.cpp b/ACE/netsvcs/lib/Client_Logging_Handler.cpp index ceef4fccbb8ec..9ee40d609e40b 100644 --- a/ACE/netsvcs/lib/Client_Logging_Handler.cpp +++ b/ACE/netsvcs/lib/Client_Logging_Handler.cpp @@ -9,7 +9,7 @@ #include "ace/OS_NS_sys_socket.h" #include "ace/OS_NS_unistd.h" #include "ace/CDR_Stream.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/SString.h" #include "ace/INET_Addr.h" #include "Client_Logging_Handler.h" diff --git a/ACE/netsvcs/lib/Name_Handler.cpp b/ACE/netsvcs/lib/Name_Handler.cpp index 05a91eb309ead..c0418fe8e2553 100644 --- a/ACE/netsvcs/lib/Name_Handler.cpp +++ b/ACE/netsvcs/lib/Name_Handler.cpp @@ -1,7 +1,7 @@ #include "ace/Containers.h" #include "ace/Get_Opt.h" #include "ace/Singleton.h" -#include "ace/Auto_Ptr.h" +#include #include "Name_Handler.h" #include "ace/Signal.h" #include "ace/OS_NS_string.h" @@ -404,7 +404,7 @@ ACE_Name_Handler::resolve () char *atype; if (this->naming_context ()->resolve (a_name, avalue, atype) == 0) { - ACE_Auto_Basic_Array_Ptr avalue_urep (avalue.rep ()); + std::unique_ptr avalue_urep (avalue.rep ()); ACE_Name_Request nrq (ACE_Name_Request::RESOLVE, 0, 0, @@ -440,7 +440,7 @@ ACE_Name_Request ACE_Name_Handler::name_request (ACE_NS_WString *one_name) { ACE_TRACE ("ACE_Name_Handler::name_request"); - ACE_Auto_Basic_Array_Ptr one_name_urep (one_name->rep ()); + std::unique_ptr one_name_urep (one_name->rep ()); return ACE_Name_Request (ACE_Name_Request::LIST_NAMES, one_name_urep.get (), one_name->length () * sizeof (ACE_WCHAR_T), @@ -452,7 +452,7 @@ ACE_Name_Request ACE_Name_Handler::value_request (ACE_NS_WString *one_value) { ACE_TRACE ("ACE_Name_Handler::value_request"); - ACE_Auto_Basic_Array_Ptr one_value_urep (one_value->rep ()); + std::unique_ptr one_value_urep (one_value->rep ()); return ACE_Name_Request (ACE_Name_Request::LIST_VALUES, 0, 0, one_value_urep.get (), @@ -467,7 +467,7 @@ ACE_Name_Handler::type_request (ACE_NS_WString *one_type) return ACE_Name_Request (ACE_Name_Request::LIST_TYPES, 0, 0, 0, 0, - ACE_Auto_Basic_Array_Ptr (one_type->char_rep ()).get (), + std::unique_ptr (one_type->char_rep ()).get (), one_type->length ()); } @@ -577,10 +577,8 @@ ACE_Name_Handler::lists_entries () set_iterator.next (one_entry) !=0; set_iterator.advance()) { - ACE_Auto_Basic_Array_Ptr - name_urep (one_entry->name_.rep ()); - ACE_Auto_Basic_Array_Ptr - value_urep (one_entry->value_.rep ()); + std::unique_ptr name_urep (one_entry->name_.rep ()); + std::unique_ptr value_urep (one_entry->value_.rep ()); ACE_Name_Request mynrq (this->name_request_.msg_type (), name_urep.get (), one_entry->name_.length () * sizeof (ACE_WCHAR_T), diff --git a/ACE/netsvcs/lib/Server_Logging_Handler_T.cpp b/ACE/netsvcs/lib/Server_Logging_Handler_T.cpp index 73c6f7dc5e998..b52d99b4ddc4e 100644 --- a/ACE/netsvcs/lib/Server_Logging_Handler_T.cpp +++ b/ACE/netsvcs/lib/Server_Logging_Handler_T.cpp @@ -2,7 +2,7 @@ #define ACE_SERVER_LOGGING_HANDLERT_C #include "ace/config-all.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Get_Opt.h" #include "ace/Log_Record.h" #include "ace/CDR_Stream.h" diff --git a/ACE/protocols/ace/HTBP/HTBP_Channel.cpp b/ACE/protocols/ace/HTBP/HTBP_Channel.cpp index b7c6ca1caab84..d3df409fc998d 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Channel.cpp +++ b/ACE/protocols/ace/HTBP/HTBP_Channel.cpp @@ -16,7 +16,7 @@ #include "HTBP_Session.h" #include "HTBP_Filter_Factory.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Message_Block.h" #include "ace/Reactor.h" #include "ace/os_include/netinet/os_tcp.h" @@ -415,7 +415,7 @@ ACE::HTBP::Channel::recvv (iovec iov[], { int ndx = 0; iovec *iov2 = new iovec[iovcnt]; - ACE_Auto_Array_Ptr guard (iov2); + std::unique_ptr guard (iov2); for (int i = 0; i < iovcnt; i++) { size_t n = ACE_MIN ((size_t) iov[i].iov_len , diff --git a/ACE/protocols/ace/HTBP/HTBP_Session.cpp b/ACE/protocols/ace/HTBP/HTBP_Session.cpp index d488e446a9a73..e0802247f04ab 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Session.cpp +++ b/ACE/protocols/ace/HTBP/HTBP_Session.cpp @@ -5,7 +5,7 @@ #include "ace/SOCK_Connector.h" #include "ace/Event_Handler.h" #include "ace/os_include/netinet/os_tcp.h" -#include "ace/Auto_Ptr.h" +#include #include "HTBP_Filter.h" #include "HTBP_ID_Requestor.h" @@ -69,7 +69,7 @@ ACE::HTBP::Session::Session () { ACE::HTBP::ID_Requestor req; ACE_TCHAR * htid = req.get_HTID(); - ACE_Auto_Array_Ptr guard (htid); + std::unique_ptr guard (htid); session_id_.local_ = ACE_TEXT_ALWAYS_CHAR(htid); session_id_.id_ = ACE::HTBP::Session::next_session_id(); ACE_NEW (inbound_, ACE::HTBP::Channel (this)); @@ -248,7 +248,7 @@ ACE::HTBP::Session::flush_outbound_queue () ACE_NEW_RETURN (iov, iovec[this->outbound_queue_.message_count()], -1); - ACE_Auto_Array_Ptr guard (iov); + std::unique_ptr guard (iov); this->outbound_queue_.peek_dequeue_head (msg); for (size_t i = 0; i < this->outbound_queue_.message_count(); i++) { diff --git a/ACE/protocols/ace/INet/BidirStreamBuffer.h b/ACE/protocols/ace/INet/BidirStreamBuffer.h index 1b5f0e4a76bf2..424ee6aa0983b 100644 --- a/ACE/protocols/ace/INet/BidirStreamBuffer.h +++ b/ACE/protocols/ace/INet/BidirStreamBuffer.h @@ -15,7 +15,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Auto_Ptr.h" +#include #include "ace/INet/StreamInterceptor.h" #include #include @@ -87,8 +87,8 @@ namespace ACE int flush_buffer (); std::streamsize bufsize_; - ACE_Auto_Array_Ptr read_buffer_; - ACE_Auto_Array_Ptr write_buffer_; + std::unique_ptr read_buffer_; + std::unique_ptr write_buffer_; openmode mode_; STREAM_HANDLER *stream_; interceptor_type* interceptor_; diff --git a/ACE/protocols/ace/INet/BufferedStreamBuffer.h b/ACE/protocols/ace/INet/BufferedStreamBuffer.h index 56bae21bb221e..4c0bc48429b86 100644 --- a/ACE/protocols/ace/INet/BufferedStreamBuffer.h +++ b/ACE/protocols/ace/INet/BufferedStreamBuffer.h @@ -15,11 +15,11 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Auto_Ptr.h" #include "ace/INet/StreamInterceptor.h" #include #include #include +#include ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -80,7 +80,7 @@ namespace ACE int flush_buffer (); std::streamsize bufsize_; - ACE_Auto_Array_Ptr buffer_; + std::unique_ptr buffer_; typename std::basic_ios::openmode mode_; interceptor_type* interceptor_; diff --git a/ACE/protocols/ace/INet/FTP_ClientRequestHandler.cpp b/ACE/protocols/ace/INet/FTP_ClientRequestHandler.cpp index dda846531078d..554a71c4ca0d1 100644 --- a/ACE/protocols/ace/INet/FTP_ClientRequestHandler.cpp +++ b/ACE/protocols/ace/INet/FTP_ClientRequestHandler.cpp @@ -6,7 +6,7 @@ #include "ace/INet/INet_Log.h" #include "ace/INet/String_IOStream.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_NS_ctype.h" #include "ace/Connector.h" #include "ace/Acceptor.h" @@ -48,7 +48,7 @@ namespace ACE ACE_NEW_RETURN (session_holder, SessionHolder (), 0); - ACE_Auto_Ptr session_safe_ref (session_holder); + std::unique_ptr session_safe_ref (session_holder); (*session_holder)->set_host (ikey.host (), ikey.port ()); diff --git a/ACE/protocols/ace/INet/HTTPS_Context.h b/ACE/protocols/ace/INet/HTTPS_Context.h index f0e533c09c6ba..2b37ac70df975 100644 --- a/ACE/protocols/ace/INet/HTTPS_Context.h +++ b/ACE/protocols/ace/INet/HTTPS_Context.h @@ -10,7 +10,7 @@ #include /**/ "ace/pre.h" #include "ace/SString.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Singleton.h" #include "ace/SSL/SSL_Context.h" #include "ace/INet/SSL_CallbackManager.h" @@ -83,7 +83,7 @@ namespace ACE Context (const Context&); ACE_SSL_Context* ssl_ctx_; - ACE_Auto_Ptr alloc_safe; + std::unique_ptr alloc_safe; static int ssl_mode_; static bool ssl_strict_; diff --git a/ACE/protocols/ace/INet/HTTPS_SessionFactory.cpp b/ACE/protocols/ace/INet/HTTPS_SessionFactory.cpp index ef54eb8262b16..8428341e61b76 100644 --- a/ACE/protocols/ace/INet/HTTPS_SessionFactory.cpp +++ b/ACE/protocols/ace/INet/HTTPS_SessionFactory.cpp @@ -51,7 +51,7 @@ namespace ACE ACE_NEW_RETURN (session_holder, SessionHolder_Impl (), 0); - ACE_Auto_Ptr session_safe_ref (session_holder); + std::unique_ptr session_safe_ref (session_holder); (*session_holder)->set_host (ikey.host (), ikey.port ()); if (ikey.is_proxy_connection ()) diff --git a/ACE/protocols/ace/INet/HTTP_BasicAuthentication.cpp b/ACE/protocols/ace/INet/HTTP_BasicAuthentication.cpp index 1454898d3eb8f..60bb1655a2e09 100644 --- a/ACE/protocols/ace/INet/HTTP_BasicAuthentication.cpp +++ b/ACE/protocols/ace/INet/HTTP_BasicAuthentication.cpp @@ -1,6 +1,6 @@ #include "ace/INet/HTTP_BasicAuthentication.h" #include "ace/Codecs.h" -#include "ace/Auto_Ptr.h" +#include #if !defined (__ACE_INLINE__) #include "ace/INet/HTTP_BasicAuthentication.inl" @@ -34,7 +34,7 @@ namespace ACE if (scheme == SCHEME) { size_t out_len = 0; - ACE_Auto_Array_Ptr safe_buf (ACE_Base64::decode ((const ACE_Byte*)info.c_str (), + std::unique_ptr safe_buf (ACE_Base64::decode ((const ACE_Byte*)info.c_str (), &out_len)); ACE_CString credentials ((char*)safe_buf.get (), out_len); ACE_CString::size_type pos = credentials.find (':'); @@ -57,7 +57,7 @@ namespace ACE credentials += ':'; credentials += this->passwd_; size_t out_len = 0; - ACE_Auto_Array_Ptr safe_buf ( + std::unique_ptr safe_buf ( ACE_Base64::encode ((const ACE_Byte*)credentials.c_str (), credentials.length (), &out_len, diff --git a/ACE/protocols/ace/INet/HTTP_ClientRequestHandler.cpp b/ACE/protocols/ace/INet/HTTP_ClientRequestHandler.cpp index 5f510650abbcb..dd916369dddbe 100644 --- a/ACE/protocols/ace/INet/HTTP_ClientRequestHandler.cpp +++ b/ACE/protocols/ace/INet/HTTP_ClientRequestHandler.cpp @@ -5,7 +5,7 @@ #endif #include "ace/INet/INet_Log.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Functor_String.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -96,7 +96,7 @@ namespace ACE ACE_NEW_RETURN (session_holder, SessionHolder_Impl (), 0); - ACE_Auto_Ptr session_safe_ref (session_holder); + std::unique_ptr session_safe_ref (session_holder); (*session_holder)->set_host (ikey.host (), ikey.port ()); if (ikey.is_proxy_connection ()) diff --git a/ACE/protocols/ace/RMCast/Bits.h b/ACE/protocols/ace/RMCast/Bits.h index 3d4f646da8dfb..3b8eb88a07ee4 100644 --- a/ACE/protocols/ace/RMCast/Bits.h +++ b/ACE/protocols/ace/RMCast/Bits.h @@ -3,7 +3,7 @@ #ifndef ACE_RMCAST_BITS_H #define ACE_RMCAST_BITS_H -#include "ace/Auto_Ptr.h" +#include #include "ace/Thread_Mutex.h" #include "ace/Condition_T.h" #include "ace/Synch_Traits.h" diff --git a/ACE/protocols/ace/RMCast/Link.cpp b/ACE/protocols/ace/RMCast/Link.cpp index fb5bc709de3c3..b15cae36a874a 100644 --- a/ACE/protocols/ace/RMCast/Link.cpp +++ b/ACE/protocols/ace/RMCast/Link.cpp @@ -184,7 +184,7 @@ namespace ACE_RMCast { size_t max_packet_size (params_.max_packet_size ()); - ACE_Auto_Array_Ptr holder (new char[max_packet_size + ACE_CDR::MAX_ALIGNMENT]); + std::unique_ptr holder (new char[max_packet_size + ACE_CDR::MAX_ALIGNMENT]); char* data = ACE_ptr_align_binary (holder.get (), ACE_CDR::MAX_ALIGNMENT); diff --git a/ACE/protocols/ace/RMCast/Protocol.h b/ACE/protocols/ace/RMCast/Protocol.h index 9bbd6ee49e7e1..2f53fcea03735 100644 --- a/ACE/protocols/ace/RMCast/Protocol.h +++ b/ACE/protocols/ace/RMCast/Protocol.h @@ -3,7 +3,7 @@ #ifndef ACE_RMCAST_PROTOCOL_H #define ACE_RMCAST_PROTOCOL_H -#include "ace/Auto_Ptr.h" +#include #include "ace/Bound_Ptr.h" #include "ace/Vector_T.h" diff --git a/ACE/protocols/ace/RMCast/Socket.cpp b/ACE/protocols/ace/RMCast/Socket.cpp index 8158ff4c74752..e9587d4b477e6 100644 --- a/ACE/protocols/ace/RMCast/Socket.cpp +++ b/ACE/protocols/ace/RMCast/Socket.cpp @@ -70,12 +70,12 @@ namespace ACE_RMCast ACE_Pipe signal_pipe_; - ACE_Auto_Ptr fragment_; - ACE_Auto_Ptr reassemble_; - ACE_Auto_Ptr acknowledge_; - ACE_Auto_Ptr retransmit_; - ACE_Auto_Ptr flow_; - ACE_Auto_Ptr link_; + std::unique_ptr fragment_; + std::unique_ptr reassemble_; + std::unique_ptr acknowledge_; + std::unique_ptr retransmit_; + std::unique_ptr flow_; + std::unique_ptr link_; }; diff --git a/ACE/protocols/ace/RMCast/Socket.h b/ACE/protocols/ace/RMCast/Socket.h index f3df325b367d3..bb5f73d7fa302 100644 --- a/ACE/protocols/ace/RMCast/Socket.h +++ b/ACE/protocols/ace/RMCast/Socket.h @@ -5,7 +5,7 @@ #include "ace/config-lite.h" // ACE_HANDLE -#include "ace/Auto_Ptr.h" +#include #include "ace/INET_Addr.h" #include "ace/Time_Value.h" @@ -89,7 +89,7 @@ namespace ACE_RMCast get_handle (); private: - ACE_Auto_Ptr impl_; + std::unique_ptr impl_; }; } diff --git a/ACE/protocols/examples/INet/FTP_Simple_exec.cpp b/ACE/protocols/examples/INet/FTP_Simple_exec.cpp index b2db0f45abfb2..a43308cc6f1aa 100644 --- a/ACE/protocols/examples/INet/FTP_Simple_exec.cpp +++ b/ACE/protocols/examples/INet/FTP_Simple_exec.cpp @@ -1,5 +1,5 @@ #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_NS_errno.h" #include "ace/INet/FTP_URL.h" #include "ace/INet/FTP_ClientRequestHandler.h" @@ -133,7 +133,7 @@ class My_FTP_RequestHandler int ACE_TMAIN (int argc, ACE_TCHAR *argv []) { - ACE_Auto_Ptr fout; + std::unique_ptr fout; std::ostream* sout = &std::cout; if (!parse_args (argc, argv)) diff --git a/ACE/protocols/examples/INet/HTTP_Simple_exec.cpp b/ACE/protocols/examples/INet/HTTP_Simple_exec.cpp index 35abddb6b89a1..12fb301c96384 100644 --- a/ACE/protocols/examples/INet/HTTP_Simple_exec.cpp +++ b/ACE/protocols/examples/INet/HTTP_Simple_exec.cpp @@ -1,5 +1,5 @@ #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_NS_errno.h" #include "ace/INet/HTTP_URL.h" #include "ace/INet/HTTP_ClientRequestHandler.h" @@ -154,7 +154,7 @@ class My_HTTP_RequestHandler int ACE_TMAIN (int argc, ACE_TCHAR *argv []) { - ACE_Auto_Ptr fout; + std::unique_ptr fout; std::ostream* sout = &std::cout; if (!parse_args (argc, argv)) @@ -212,7 +212,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv []) std::cout << "Parsing url [" << url.c_str () << "]" << std::endl; - ACE_Auto_Ptr url_safe (ACE::INet::URL_Base::create_from_string (url)); + std::unique_ptr url_safe (ACE::INet::URL_Base::create_from_string (url)); if (url_safe.get () == 0 || url != url_safe->to_string ()) { diff --git a/ACE/tests/Bug_1890_Regression_Test.cpp b/ACE/tests/Bug_1890_Regression_Test.cpp index 7445b5b819cbd..0ca496a7c5a32 100644 --- a/ACE/tests/Bug_1890_Regression_Test.cpp +++ b/ACE/tests/Bug_1890_Regression_Test.cpp @@ -14,7 +14,7 @@ #include "ace/Event_Handler.h" #include "ace/Reactor.h" #include "ace/Select_Reactor.h" -#include "ace/Auto_Ptr.h" +#include int const nhandlers = 3; diff --git a/ACE/tests/Bug_2540_Regression_Test.cpp b/ACE/tests/Bug_2540_Regression_Test.cpp index 9812966170307..abce77036251a 100644 --- a/ACE/tests/Bug_2540_Regression_Test.cpp +++ b/ACE/tests/Bug_2540_Regression_Test.cpp @@ -14,7 +14,7 @@ #include "ace/Event_Handler.h" #include "ace/Reactor.h" #include "ace/Select_Reactor.h" -#include "ace/Auto_Ptr.h" +#include int const nhandlers = 3; diff --git a/ACE/tests/Bug_2820_Regression_Test.cpp b/ACE/tests/Bug_2820_Regression_Test.cpp index 1dde2f92aed22..ca504860ec0d1 100644 --- a/ACE/tests/Bug_2820_Regression_Test.cpp +++ b/ACE/tests/Bug_2820_Regression_Test.cpp @@ -14,7 +14,7 @@ */ #include "test_config.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Reactor.h" #include "ace/Select_Reactor.h" diff --git a/ACE/tests/Bug_3539_Regression_Test.cpp b/ACE/tests/Bug_3539_Regression_Test.cpp index 428b33b928228..c4a5ba453cddb 100644 --- a/ACE/tests/Bug_3539_Regression_Test.cpp +++ b/ACE/tests/Bug_3539_Regression_Test.cpp @@ -13,7 +13,7 @@ #include "test_config.h" #include "TSS_Test_Errno.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/TSS_T.h" #include "ace/Thread_Manager.h" #include "ace/Atomic_Op_T.h" @@ -85,7 +85,7 @@ run_main (int, ACE_TCHAR *[]) { ObjectWithTSS *o = 0; ACE_NEW_RETURN (o, ObjectWithTSS, 1); - ACE_Auto_Ptr owner (o); + std::unique_ptr owner (o); if (ACE_Thread_Manager::instance ()->spawn_n (threads, diff --git a/ACE/tests/CDR_File_Test.cpp b/ACE/tests/CDR_File_Test.cpp index 40ccca78f0090..15e9a4d0c6ed9 100644 --- a/ACE/tests/CDR_File_Test.cpp +++ b/ACE/tests/CDR_File_Test.cpp @@ -16,7 +16,7 @@ #include "ace/OS_NS_string.h" #include "ace/CDR_Stream.h" #include "ace/FILE_Connector.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Get_Opt.h" #include "ace/ACE.h" #include "ace/Truncate.h" @@ -225,7 +225,7 @@ run_test (int write_file, #endif /* ACE_INITIALIZE_MEMORY_BEFORE_USE */ // Make sure is released automagically. - ACE_Auto_Basic_Array_Ptr b (buffer); + std::unique_ptr b (buffer); // Move the file pointer back to the beginning of the file. if (file.seek (0, diff --git a/ACE/tests/CDR_Test.cpp b/ACE/tests/CDR_Test.cpp index c9fcf68dcf2ae..ccbf14f55a821 100644 --- a/ACE/tests/CDR_Test.cpp +++ b/ACE/tests/CDR_Test.cpp @@ -12,7 +12,7 @@ #include "test_config.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/CDR_Stream.h" #include "ace/CDR_Size.h" #include "ace/SString.h" @@ -242,9 +242,9 @@ short_stream () is >> str1; ACE_InputCDR::to_wstring twstr (wstr1, 0); is >> twstr; - // @todo Lose the ACE_Auto_Array_Ptr. We should be using a + // @todo Lose the std::unique_ptr. We should be using a // std::string, or the like. - ACE_Auto_Array_Ptr safe_wstr (wstr1); + std::unique_ptr safe_wstr (wstr1); is >> std_str1; #if !defined(ACE_LACKS_STD_WSTRING) is >> std_wstr1; @@ -498,7 +498,7 @@ CDR_Test_Types::test_get (ACE_InputCDR &cdr) const ACE_TEXT ("read_string2[%d] failed\n"), i), 1); - ACE_Auto_Basic_Array_Ptr auto_xstr (xstr); + std::unique_ptr auto_xstr (xstr); if (ACE_OS::strcmp (auto_xstr.get (), this->str) != 0) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("string[%d] differs\n"), @@ -512,7 +512,7 @@ CDR_Test_Types::test_get (ACE_InputCDR &cdr) const i), 1); // zero length - ACE_Auto_Basic_Array_Ptr auto_xwstr (wstr1); + std::unique_ptr auto_xwstr (wstr1); if (ACE_OS::wslen(auto_xwstr.get () )) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("wstring[%d] differs\n"), diff --git a/ACE/tests/Codecs_Test.cpp b/ACE/tests/Codecs_Test.cpp index 24b65cb9c9ff9..675c6ef1188a3 100644 --- a/ACE/tests/Codecs_Test.cpp +++ b/ACE/tests/Codecs_Test.cpp @@ -12,7 +12,7 @@ #include "test_config.h" #include "ace/Codecs.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/ACE.h" @@ -46,7 +46,7 @@ encode_decode_stream (const ACE_Byte* stream, size_t length) encodeBuf)); - ACE_Auto_Basic_Array_Ptr cleanup_encodeBuf (encodeBuf); + std::unique_ptr cleanup_encodeBuf (encodeBuf); size_t decode_len = 0; ACE_Byte* decodeBuf = ACE_Base64::decode (encodeBuf, &decode_len); @@ -58,7 +58,7 @@ encode_decode_stream (const ACE_Byte* stream, size_t length) return -1; } - ACE_Auto_Basic_Array_Ptr cleanup_decodeBuf (decodeBuf); + std::unique_ptr cleanup_decodeBuf (decodeBuf); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Decoded Base64 encoded stream = %C\n"), diff --git a/ACE/tests/Compiler_Features_09_Test.cpp b/ACE/tests/Compiler_Features_09_Test.cpp index 28e0be3cdc101..c94d5a8f4a720 100644 --- a/ACE/tests/Compiler_Features_09_Test.cpp +++ b/ACE/tests/Compiler_Features_09_Test.cpp @@ -2,7 +2,7 @@ * @file * * This program checks if the compiler / platform supports the - * std::auto_ptr<> correctly. The motivation for this test was a discussion + * std::unique_ptr<> correctly. The motivation for this test was a discussion * on the development mailing list, and the documentation was captured * in: * @@ -63,12 +63,12 @@ run_main (int, ACE_TCHAR *[]) // failure int status = 0; - // ... this works with the ACE version of auto_ptr (well, the + // ... this works with the ACE version of unique_ptr (well, the // namespace is broken, but you get the idea) ... std::unique_ptr x(new Base); std::unique_ptr y(new Derived); - // ... with a compliant implementation of std::auto_ptr<> you should be + // ... with a compliant implementation of std::unique_ptr<> you should be // able to write: // x = y; x.reset(y.release()); diff --git a/ACE/tests/Conn_Test.cpp b/ACE/tests/Conn_Test.cpp index b44f9547a9c91..f3a1ded085910 100644 --- a/ACE/tests/Conn_Test.cpp +++ b/ACE/tests/Conn_Test.cpp @@ -23,7 +23,7 @@ #include "ace/Acceptor.h" #include "ace/Handle_Set.h" #include "ace/Connector.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Get_Opt.h" #include "ace/Process_Mutex.h" #include "ace/Signal.h" @@ -517,7 +517,7 @@ spawn_processes (ACCEPTOR *acceptor, ACE_NEW_RETURN (children_ptr, pid_t[n_servers], -1); - ACE_Auto_Basic_Array_Ptr children (children_ptr); + std::unique_ptr children (children_ptr); int i; // Spawn off a number of server processes all of which will listen diff --git a/ACE/tests/DLL_Test.cpp b/ACE/tests/DLL_Test.cpp index 6539deccb62fd..72bed911a430c 100644 --- a/ACE/tests/DLL_Test.cpp +++ b/ACE/tests/DLL_Test.cpp @@ -11,7 +11,7 @@ #include "test_config.h" #include "ace/DLL.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/ACE.h" #include "ace/DLL_Manager.h" #include "ace/SString.h" diff --git a/ACE/tests/Future_Set_Test.cpp b/ACE/tests/Future_Set_Test.cpp index bf57e1f05b5e0..83dd24ddf20fe 100644 --- a/ACE/tests/Future_Set_Test.cpp +++ b/ACE/tests/Future_Set_Test.cpp @@ -24,7 +24,7 @@ #include "ace/Future_Set.h" #include "ace/Method_Request.h" #include "ace/Activation_Queue.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Atomic_Op.h" #include "ace/Null_Mutex.h" @@ -278,7 +278,7 @@ Prime_Scheduler::svc () { for (;;) { - // Dequeue the next method request (we use an auto pointer in + // Dequeue the next method request (we use an unique pointer in // case an exception is thrown in the ). std::unique_ptr mo (this->activation_queue_.dequeue ()); diff --git a/ACE/tests/Future_Test.cpp b/ACE/tests/Future_Test.cpp index 2340b684fe4e6..77ea6f027e277 100644 --- a/ACE/tests/Future_Test.cpp +++ b/ACE/tests/Future_Test.cpp @@ -25,7 +25,7 @@ #include "ace/Future.h" #include "ace/Method_Request.h" #include "ace/Activation_Queue.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Atomic_Op.h" #if defined (ACE_HAS_THREADS) @@ -287,7 +287,7 @@ Prime_Scheduler::svc () { for (;;) { - // Dequeue the next method request (we use an auto pointer in + // Dequeue the next method request (we use an unique pointer in // case an exception is thrown in the ). std::unique_ptr mo (this->activation_queue_.dequeue ()); diff --git a/ACE/tests/Log_Msg_Test.cpp b/ACE/tests/Log_Msg_Test.cpp index 045152faec2d5..579dddd1e8c6d 100644 --- a/ACE/tests/Log_Msg_Test.cpp +++ b/ACE/tests/Log_Msg_Test.cpp @@ -18,7 +18,7 @@ #include "ace/streams.h" #include "ace/FILE_Connector.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Log_Msg_Callback.h" #include "ace/Log_Record.h" #include "ace/OS_NS_fcntl.h" @@ -532,7 +532,7 @@ test_ostream () char[info.size_ + 1], -1); // Make sure is released automagically. - ACE_Auto_Basic_Array_Ptr b (buffer); + std::unique_ptr b (buffer); // Read the file into the buffer. ssize_t size = file.recv (buffer, diff --git a/ACE/tests/Logging_Strategy_Test.cpp b/ACE/tests/Logging_Strategy_Test.cpp index c3d61cadabb30..9132100a912bf 100644 --- a/ACE/tests/Logging_Strategy_Test.cpp +++ b/ACE/tests/Logging_Strategy_Test.cpp @@ -30,7 +30,7 @@ #include "ace/OS_NS_string.h" #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_sys_stat.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Service_Config.h" #include "ace/Reactor.h" #include "ace/Thread_Manager.h" @@ -454,7 +454,7 @@ int run_main (int argc, ACE_TCHAR *argv []) // statically ACE_Logging_Strategy logging_strategy; unsigned char ls_argc = argc - 1; - ACE_Auto_Basic_Ptr ls_argv (new ACE_TCHAR *[ls_argc]); + std::unique_ptr ls_argv (new ACE_TCHAR *[ls_argc]); for (unsigned char c = 0; c < ls_argc; c++) (ls_argv.get ())[c] = argv[c+1]; diff --git a/ACE/tests/Malloc_Test.cpp b/ACE/tests/Malloc_Test.cpp index c93ea9b304e8b..2240e1648fe44 100644 --- a/ACE/tests/Malloc_Test.cpp +++ b/ACE/tests/Malloc_Test.cpp @@ -17,7 +17,7 @@ #include "ace/Malloc_T.h" #include "ace/MMAP_Memory_Pool.h" #include "ace/Process.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Process_Mutex.h" #include "ace/PI_Malloc.h" #include "ace/RW_Thread_Mutex.h" diff --git a/ACE/tests/Message_Queue_Test_Ex.cpp b/ACE/tests/Message_Queue_Test_Ex.cpp index cd182fb722a09..97d4bd99aa4cf 100644 --- a/ACE/tests/Message_Queue_Test_Ex.cpp +++ b/ACE/tests/Message_Queue_Test_Ex.cpp @@ -20,7 +20,7 @@ #include "test_config.h" #include "ace/Thread_Manager.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Message_Queue.h" #include "ace/Synch_Traits.h" #include "ace/Null_Mutex.h" @@ -619,7 +619,7 @@ int queue_priority_test (ACE_Message_Queue_Ex& q) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Prio test queue not empty\n")), 1); // Set up a few objects with names for how they should come out of the queue. - ACE_Auto_Basic_Ptr b1, b2, b3, b4; + std::unique_ptr b1, b2, b3, b4; b1.reset (new User_Class ("first")); b2.reset (new User_Class ("second")); b3.reset (new User_Class ("third")); diff --git a/ACE/tests/Network_Adapters_Test.cpp b/ACE/tests/Network_Adapters_Test.cpp index 248387827043e..54c3c0087634d 100644 --- a/ACE/tests/Network_Adapters_Test.cpp +++ b/ACE/tests/Network_Adapters_Test.cpp @@ -27,7 +27,7 @@ #include "ace/OS_NS_string.h" #include "ace/OS_NS_signal.h" #include "ace/Timer_Heap.h" -#include "ace/Auto_Ptr.h" +#include #include "Network_Adapters_Test.h" diff --git a/ACE/tests/Notify_Performance_Test.cpp b/ACE/tests/Notify_Performance_Test.cpp index 5bfb42076325b..d47751394b04d 100644 --- a/ACE/tests/Notify_Performance_Test.cpp +++ b/ACE/tests/Notify_Performance_Test.cpp @@ -21,7 +21,7 @@ #include "ace/WFMO_Reactor.h" #include "ace/Select_Reactor.h" #include "ace/Dev_Poll_Reactor.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Atomic_Op.h" #if defined (ACE_HAS_THREADS) diff --git a/ACE/tests/Priority_Reactor_Test.cpp b/ACE/tests/Priority_Reactor_Test.cpp index c37451a61893d..259de386a6994 100644 --- a/ACE/tests/Priority_Reactor_Test.cpp +++ b/ACE/tests/Priority_Reactor_Test.cpp @@ -23,7 +23,7 @@ #include "ace/Acceptor.h" #include "ace/Handle_Set.h" #include "ace/Connector.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Priority_Reactor.h" #include "Priority_Reactor_Test.h" diff --git a/ACE/tests/Proactor_Timer_Test.cpp b/ACE/tests/Proactor_Timer_Test.cpp index 8fdc0af8a892b..dad2adb5388b3 100644 --- a/ACE/tests/Proactor_Timer_Test.cpp +++ b/ACE/tests/Proactor_Timer_Test.cpp @@ -26,7 +26,7 @@ #include "ace/High_Res_Timer.h" #include "ace/Asynch_IO.h" #include "ace/Timer_Heap.h" -#include "ace/Auto_Ptr.h" +#include static int done = 0; static size_t counter = 0; diff --git a/ACE/tests/Reactor_Fairness_Test.cpp b/ACE/tests/Reactor_Fairness_Test.cpp index 3a01da60f2325..f84ceafd4495c 100644 --- a/ACE/tests/Reactor_Fairness_Test.cpp +++ b/ACE/tests/Reactor_Fairness_Test.cpp @@ -22,7 +22,7 @@ #include "ace/WFMO_Reactor.h" #include "ace/Select_Reactor.h" #include "ace/TP_Reactor.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Numeric_Limits.h" #include "ace/Signal.h" #include "ace/Atomic_Op.h" @@ -182,7 +182,7 @@ sender (void *arg) ACE_NEW_RETURN (temp_socks, ACE_SOCK_Stream [opt_nconnections], 0); - ACE_Auto_Basic_Array_Ptr socks (temp_socks); + std::unique_ptr socks (temp_socks); // Connection all connections before sending data. ACE_SOCK_Connector c; diff --git a/ACE/tests/Reactor_Notify_Test.cpp b/ACE/tests/Reactor_Notify_Test.cpp index 89afd26e4fc96..e317a659199ab 100644 --- a/ACE/tests/Reactor_Notify_Test.cpp +++ b/ACE/tests/Reactor_Notify_Test.cpp @@ -19,7 +19,7 @@ #include "ace/Synch_Traits.h" #include "ace/Task.h" #include "ace/Pipe.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Reactor.h" #include "ace/Select_Reactor.h" #include "ace/Thread_Semaphore.h" diff --git a/ACE/tests/Reactor_Performance_Test.cpp b/ACE/tests/Reactor_Performance_Test.cpp index 0578aea999725..6329aaa3642f7 100644 --- a/ACE/tests/Reactor_Performance_Test.cpp +++ b/ACE/tests/Reactor_Performance_Test.cpp @@ -15,7 +15,7 @@ #include "Reactor_Performance_Test.h" #include "ace/Acceptor.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Connector.h" #include "ace/Get_Opt.h" #include "ace/Profile_Timer.h" @@ -183,20 +183,20 @@ client (void *arg) ACE_NEW_RETURN (temp_writers, Write_Handler *[opt_nconnections], 0); - ACE_Auto_Basic_Array_Ptr writers (temp_writers); + std::unique_ptr writers (temp_writers); ACE_TCHAR *temp_failed = 0; ACE_NEW_RETURN (temp_failed, ACE_TCHAR[opt_nconnections], 0); - ACE_Auto_Basic_Array_Ptr failed_svc_handlers (temp_failed); + std::unique_ptr failed_svc_handlers (temp_failed); // Automagic memory cleanup. ACE_INET_Addr *temp_addresses; ACE_NEW_RETURN (temp_addresses, ACE_INET_Addr [opt_nconnections], 0); - ACE_Auto_Array_Ptr addresses (temp_addresses); + std::unique_ptr addresses (temp_addresses); // Initialize array. for (i = 0; i < opt_nconnections; i++) diff --git a/ACE/tests/Reactor_Remove_Resume_Test.cpp b/ACE/tests/Reactor_Remove_Resume_Test.cpp index 6fa52a697ec6b..d0b4fd40bacca 100644 --- a/ACE/tests/Reactor_Remove_Resume_Test.cpp +++ b/ACE/tests/Reactor_Remove_Resume_Test.cpp @@ -17,7 +17,7 @@ #include "ace/Reactor.h" #include "ace/TP_Reactor.h" #include "ace/Pipe.h" -#include "ace/Auto_Ptr.h" +#include #include #include diff --git a/ACE/tests/Reactor_Remove_Resume_Test_Dev_Poll.cpp b/ACE/tests/Reactor_Remove_Resume_Test_Dev_Poll.cpp index 61a46779914d2..7b593fe33eb5a 100644 --- a/ACE/tests/Reactor_Remove_Resume_Test_Dev_Poll.cpp +++ b/ACE/tests/Reactor_Remove_Resume_Test_Dev_Poll.cpp @@ -21,7 +21,7 @@ #include "ace/ACE.h" #include "ace/Dev_Poll_Reactor.h" #include "ace/Pipe.h" -#include "ace/Auto_Ptr.h" +#include #include #include diff --git a/ACE/tests/Reactor_Timer_Test.cpp b/ACE/tests/Reactor_Timer_Test.cpp index 06158decf5c76..04318c2e0dd63 100644 --- a/ACE/tests/Reactor_Timer_Test.cpp +++ b/ACE/tests/Reactor_Timer_Test.cpp @@ -1,4 +1,3 @@ - //============================================================================= /** * @file Reactor_Timer_Test.cpp @@ -20,7 +19,7 @@ #include "ace/Recursive_Thread_Mutex.h" #include "ace/Log_Msg.h" #include "ace/Timer_Heap.h" -#include "ace/Auto_Ptr.h" +#include static int done = 0; static int the_count = 0; diff --git a/ACE/tests/Refcounted_Auto_Ptr_Test.cpp b/ACE/tests/Refcounted_Auto_Ptr_Test.cpp index 5c79a13ef1bcc..bc06ea01139cc 100644 --- a/ACE/tests/Refcounted_Auto_Ptr_Test.cpp +++ b/ACE/tests/Refcounted_Auto_Ptr_Test.cpp @@ -229,7 +229,7 @@ Scheduler::svc () { for (;;) { - // Dequeue the next method request (we use an auto pointer in + // Dequeue the next method request (we use an unique pointer in // case an exception is thrown in the ). ACE_Method_Request *mo_p = this->activation_queue_.dequeue (); if (0 == mo_p) diff --git a/ACE/tests/SString_Test.cpp b/ACE/tests/SString_Test.cpp index 75d47ad8b847b..793bf6a5df6fe 100644 --- a/ACE/tests/SString_Test.cpp +++ b/ACE/tests/SString_Test.cpp @@ -1,4 +1,3 @@ - //============================================================================= /** * @file SString_Test.cpp @@ -11,13 +10,11 @@ */ //============================================================================= - #include "test_config.h" #include "ace/OS_NS_string.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/SString.h" - static int testConcatenation() { #ifdef ACE_HAS_WCHAR ACE_WString s1; @@ -281,7 +278,7 @@ run_main (int, ACE_TCHAR *[]) if (s0.length() != 0){ACE_ERROR((LM_ERROR,"Set #2:\n"));return 1;} // Rep. Error if they are not equal - ACE_Auto_Basic_Array_Ptr s (s1.rep ()); + std::unique_ptr s (s1.rep ()); if (ACE_OS::strlen (s.get ()) != s1.length ()) { ACE_ERROR((LM_ERROR,"Auto_ptr s:\n")); diff --git a/ACE/tests/Task_Ex_Test.cpp b/ACE/tests/Task_Ex_Test.cpp index c362de4c6fb25..9681e1fc267df 100644 --- a/ACE/tests/Task_Ex_Test.cpp +++ b/ACE/tests/Task_Ex_Test.cpp @@ -13,7 +13,7 @@ #include "Task_Ex_Test.h" #include "ace/Task_Ex_T.h" #include "ace/Log_Msg.h" -#include "ace/Auto_Ptr.h" +#include #if defined (ACE_HAS_THREADS) diff --git a/ACE/tests/UUID_Test.cpp b/ACE/tests/UUID_Test.cpp index 972464ed2ceed..f505e1a6ae319 100644 --- a/ACE/tests/UUID_Test.cpp +++ b/ACE/tests/UUID_Test.cpp @@ -1,4 +1,3 @@ - //============================================================================= /** * @file UUID_Test.cpp @@ -9,10 +8,9 @@ */ //============================================================================= - #include "test_config.h" #include "ace/UUID.h" -#include "ace/Auto_Ptr.h" +#include class Tester { diff --git a/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerServer.cpp b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerServer.cpp index 7ee82018714a0..4bef4422ce4c3 100644 --- a/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerServer.cpp +++ b/TAO/DevGuideExamples/Multithreading/GracefulShutdown/MessengerServer.cpp @@ -152,7 +152,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) // Create a MessengerServer object. MessengerServer * server = new MessengerServer (orb.in()); - ACE_Auto_Ptr safe_ptr (server); + std::unique_ptr safe_ptr (server); // Parse arguments to determine how we should shutdown. if (server->parse_args (argc, argv) != 0) diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp index a78e2c8c8a10a..e8218aed417ed 100644 --- a/TAO/TAO_IDL/be/be_codegen.cpp +++ b/TAO/TAO_IDL/be/be_codegen.cpp @@ -2746,7 +2746,7 @@ TAO_CodeGen::gen_stub_src_includes () if (be_global->gen_amh_classes ()) { this->gen_standard_include (this->client_stubs_, - "ace/Auto_Ptr.h"); + "memory"); } } diff --git a/TAO/TAO_IDL/be/be_map.cpp b/TAO/TAO_IDL/be/be_map.cpp index db7f531cea78e..f51439c7ea22c 100644 --- a/TAO/TAO_IDL/be/be_map.cpp +++ b/TAO/TAO_IDL/be/be_map.cpp @@ -170,11 +170,6 @@ be_map::gen_name () int be_map::create_name (be_typedef *node) { - UTL_ScopedName *n = nullptr; - - // Scope in which we are defined. - be_decl *scope = nullptr; - // If there is a typedef node, we use its name as our name. if (node) { @@ -187,14 +182,12 @@ be_map::create_name (be_typedef *node) char *namebuf = this->gen_name (); // Now see if we have a fully scoped name and if so, generate one. - UTL_Scope *us = this->defined_in (); - - scope = dynamic_cast (us)->decl (); + be_decl *const scope = dynamic_cast (defined_in ())->decl (); if (scope != nullptr) { // Make a copy of the enclosing scope's name. - n = static_cast (scope->name ()->copy ()); + UTL_ScopedName *const n = static_cast (scope->name ()->copy ()); Identifier *id = nullptr; ACE_NEW_RETURN (id, diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp index 6333aae01d4e1..87642de80f33d 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp @@ -67,38 +67,31 @@ be_visitor_amh_interface_ss::this_method (be_interface *node) << full_skel_name << "::_this ()" << be_nl << "{" << be_idt_nl - << "TAO_Stub *stub = this->_create_stub ();" << be_nl_2; + << "TAO_Stub_Auto_Ptr stub (this->_create_stub ());" << be_nl; - *os << "TAO_Stub_Auto_Ptr safe_stub (stub);" << be_nl - << "::CORBA::Object_ptr tmp {};" << be_nl - << be_nl - << "::CORBA::Boolean _tao_opt_colloc =" << be_idt_nl + *os << "::CORBA::Boolean _tao_opt_colloc = " << "stub->servant_orb_var ()->orb_core ()->" - << "optimize_collocation_objects ();" << be_uidt_nl << be_nl - << "ACE_NEW_RETURN (" << be_idt << be_idt_nl - << "tmp," << be_nl - << "::CORBA::Object (stub, _tao_opt_colloc, this)," << be_nl - << "nullptr" << be_uidt_nl - << ");" << be_uidt_nl << be_nl; + << "optimize_collocation_objects ();" << be_nl + << "::CORBA::Object_var obj = " + << "new (std::nothrow) ::CORBA::Object (stub.get (), _tao_opt_colloc, this);" << be_nl + << "if (obj.ptr ())" << be_idt_nl + << "{" << be_idt_nl; - *os << "::CORBA::Object_var obj = tmp;" << be_nl - << "(void) safe_stub.release ();" << be_nl_2; - - *os << "typedef ::" << node->name () << " STUB_SCOPED_NAME;" << be_nl - << "return" << be_idt_nl; + *os << "(void) stub.release ();" << be_nl; if (!node->is_abstract ()) { - *os << "TAO::Narrow_Utils::unchecked_narrow ("; + *os << "return TAO::Narrow_Utils<::" << node->name () << ">::unchecked_narrow ("; } else { - *os << "TAO::AbstractBase_Narrow_Utils::unchecked_narrow ("; + *os << "return TAO::AbstractBase_Narrow_Utils<::" << node->name () << ">::unchecked_narrow ("; } *os << "obj.in ());" << be_nl; - *os << be_uidt << be_uidt_nl - << "}"; + *os << be_uidt_nl + << "}" + << be_uidt_nl << "return {};" << be_uidt_nl << "}"; } void diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface.h b/TAO/TAO_IDL/be/be_visitor_interface/interface.h index dc4b3ce034589..8c8fb61bfa344 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface.h +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface.h @@ -9,7 +9,7 @@ */ //============================================================================= -#include "ace/Auto_Ptr.h" +#include #include "utl_identifier.h" #include "utl_exceptlist.h" diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp index 33c5ee3bdabed..d87a9d64457e7 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp @@ -360,37 +360,28 @@ be_visitor_interface_ss::this_method (be_interface *node) << node->full_skel_name () << "::_this ()" << be_nl << "{" << be_idt_nl - << "TAO_Stub *stub = this->_create_stub ();" - << be_nl_2 - << "TAO_Stub_Auto_Ptr safe_stub (stub);" << be_nl; - - /* Coverity whines about an unused return value from _nil() when - initializing tmp. Just use zero instead. */ - *os << "::CORBA::Object_ptr tmp {};" - << be_nl_2; + << "TAO_Stub_Auto_Ptr stub (this->_create_stub ());" + << be_nl; - *os << "::CORBA::Boolean const _tao_opt_colloc =" - << be_idt_nl + *os << "::CORBA::Boolean const _tao_opt_colloc = " << "stub->servant_orb_var ()->orb_core ()->" - << "optimize_collocation_objects ();" << be_uidt_nl << be_nl; + << "optimize_collocation_objects ();" << be_nl; - *os << "ACE_NEW_RETURN (" << be_idt << be_idt_nl - << "tmp," << be_nl - << "::CORBA::Object (stub, "; - - *os << "_tao_opt_colloc"; - - *os << ", this)," << be_nl - << "nullptr);" << be_uidt << be_uidt_nl << be_nl; + /* Coverity whines about an unused return value from _nil() when + initializing tmp. Just use zero instead. */ + *os << "::CORBA::Object_var obj = " + << "new (std::nothrow) ::CORBA::Object (stub.get (), _tao_opt_colloc, this);" << be_nl + << "if (obj.ptr ())" << be_idt_nl + << "{" << be_idt_nl; - *os << "::CORBA::Object_var obj = tmp;" << be_nl - << "(void) safe_stub.release ();" << be_nl_2 + *os << "(void) stub.release ();" << be_nl << "return " - << "TAO::Narrow_Utils< ::" << node->name () << ">::unchecked_narrow (" + << "TAO::Narrow_Utils<::" << node->name () << ">::unchecked_narrow (" << "obj.in ());"; *os << be_uidt_nl - << "}"; + << "}" + << be_uidt_nl << "return {};" << be_uidt_nl << "}"; } void diff --git a/TAO/docs/events_tutorial.html b/TAO/docs/events_tutorial.html index 932407266c649..28aef50aee7f7 100644 --- a/TAO/docs/events_tutorial.html +++ b/TAO/docs/events_tutorial.html @@ -1511,12 +1511,11 @@

    Caring for your Event Channel

    CosNaming::NamingContext_var naming_context = CosNaming::NamingContext::_narrow (naming_obj.in ()); - // Notice the use of auto_ptr<> to automagically manage the - // destruction of the servant. When the auto_ptr goes out + // Notice the use of unique_ptr<> to automagically manage the + // destruction of the servant. When the unique_ptr goes out // of scope, its destructor is called, which in turn destroys // the servant. - - auto_ptr scheduler_impl; + std::unique_ptr scheduler_impl; RtecScheduler::Scheduler_var scheduler; @@ -1534,7 +1533,7 @@

    Caring for your Event Channel

    if (global_scheduler == 0) { scheduler_impl = - auto_ptr(new ACE_Config_Scheduler); + std::unique_ptr(new ACE_Config_Scheduler); if (scheduler_impl.get () == 0) return 1; scheduler = scheduler_impl->_this (); diff --git a/TAO/docs/tutorials/Quoter/Simple/ImprovedServer/index.html b/TAO/docs/tutorials/Quoter/Simple/ImprovedServer/index.html index 6123dbc525277..80773ed2133bc 100644 --- a/TAO/docs/tutorials/Quoter/Simple/ImprovedServer/index.html +++ b/TAO/docs/tutorials/Quoter/Simple/ImprovedServer/index.html @@ -122,7 +122,7 @@

    Activating objects in the child POA

    PortableServer::ServantBase_var servant = new Quoter_Stock_i (symbol, full_name, price); -

    The ServantBase_var acts like an auto pointer and +

    The ServantBase_var acts like an unique pointer and will take care of deallocation in case there is an exception. This time we cannot use _this() to activate the servant though, because we want to create our own ids: diff --git a/TAO/examples/Borland/ChatClientWnd.cpp b/TAO/examples/Borland/ChatClientWnd.cpp index 777ceac534cd0..bb100e5009728 100644 --- a/TAO/examples/Borland/ChatClientWnd.cpp +++ b/TAO/examples/Borland/ChatClientWnd.cpp @@ -65,7 +65,7 @@ __fastcall TChatClientWindow::TChatClientWindow (TComponent* Owner) //--------------------------------------------------------------------------- void __fastcall TChatClientWindow::ReadIOR (String filename) { - auto_ptr ior (new TStringList); + std::unique_ptr ior (new TStringList); ior->LoadFromFile (filename); ior_ = ior->Text; } diff --git a/TAO/examples/Borland/ChatClientWnd.h b/TAO/examples/Borland/ChatClientWnd.h index 6887953ead9cc..296e70d4b506f 100644 --- a/TAO/examples/Borland/ChatClientWnd.h +++ b/TAO/examples/Borland/ChatClientWnd.h @@ -4,12 +4,12 @@ //--------------------------------------------------------------------------- #include "ReceiverImpl.h" #include "BroadcasterC.h" -#include "ace/Auto_Ptr.h" #include "ORBThread.h" #include #include #include #include +#include //--------------------------------------------------------------------------- // Message used to notify window of incoming data @@ -38,7 +38,7 @@ class TChatClientWindow : public TForm String nickname_; // We run the orb's main loop in a separate thread. - auto_ptr orb_thread_; + std::unique_ptr orb_thread_; // Our orb. Order is important! The orb must have a longer lifetime than // any of the servants or stub vars/ptrs. Therefore we declare the orb var diff --git a/TAO/examples/Load_Balancing/Load_Balancer_i.cpp b/TAO/examples/Load_Balancing/Load_Balancer_i.cpp index 66c1861d93662..0aad497d12f77 100644 --- a/TAO/examples/Load_Balancing/Load_Balancer_i.cpp +++ b/TAO/examples/Load_Balancing/Load_Balancer_i.cpp @@ -8,7 +8,7 @@ #include "Load_Balancer_i.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_NS_time.h" Object_Group_Factory_i::Object_Group_Factory_i () @@ -72,7 +72,7 @@ Object_Group_Factory_i::make_group (int random, CORBA::NO_MEMORY ()); // Temporarily put the servant into the auto_ptr. - ACE_Auto_Basic_Ptr temp (group_servant); + std::unique_ptr temp (group_servant); // Register with the poa, begin using ref. counting. group = group_servant->_this (); diff --git a/TAO/examples/Load_Balancing_persistent/Load_Balancer_i.cpp b/TAO/examples/Load_Balancing_persistent/Load_Balancer_i.cpp index 787623fdf5175..bf502bed7b0f8 100644 --- a/TAO/examples/Load_Balancing_persistent/Load_Balancer_i.cpp +++ b/TAO/examples/Load_Balancing_persistent/Load_Balancer_i.cpp @@ -1,5 +1,5 @@ #include "Load_Balancer_i.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Hash_Map_Manager_T.h" const char *rr_name_bind = "RR_Group"; diff --git a/TAO/examples/Simple/grid/Grid_i.cpp b/TAO/examples/Simple/grid/Grid_i.cpp index 6906f8585d737..30b90d65d1d6a 100644 --- a/TAO/examples/Simple/grid/Grid_i.cpp +++ b/TAO/examples/Simple/grid/Grid_i.cpp @@ -93,7 +93,7 @@ Grid_i::width (CORBA::Short x) ACE_OS::memcpy (array.get () + x * ctr, this->array_.get () + this->width_ * ctr, Grid_i::ushort_min (this->width_, x) * sizeof (CORBA::Long)); } - this->array_ = array; + this->array_ = std::move(array); array.release (); this->width_ = x; } @@ -110,7 +110,7 @@ Grid_i::height (CORBA::Short y) ACE_OS::memcpy (array.get () + this->width_ * ctr, this->array_.get () + this->width_ * ctr, this->width_ * sizeof (CORBA::Long)); } - this->array_ = array; + this->array_ = std::move(array); array.release (); this->height_ = y; } @@ -121,7 +121,7 @@ void Grid_i::destroy () { // Delete the array. - ACE_Auto_Array_Ptr tmp (this->array_.release ()); + std::unique_ptr tmp (this->array_.release ()); this->width_ = 0; this->height_ = 0; diff --git a/TAO/examples/Simple/grid/Grid_i.h b/TAO/examples/Simple/grid/Grid_i.h index fcce738f501fd..54773e31b21ca 100644 --- a/TAO/examples/Simple/grid/Grid_i.h +++ b/TAO/examples/Simple/grid/Grid_i.h @@ -14,7 +14,7 @@ #include "GridS.h" #include "ace/Vector_T.h" -#include "ace/Auto_Ptr.h" +#include /** * @class Grid_i: @@ -71,7 +71,7 @@ class Grid_i: public POA_Grid CORBA::Short height_; /// Pointer to the matrix. This is organized as an "array of arrays." - typedef ACE_Auto_Array_Ptr GridArray; + typedef std::unique_ptr GridArray; GridArray array_; /// Some Windows compilers don't have min in std namespaces diff --git a/TAO/orbsvcs/Event_Service/Event_Service.cpp b/TAO/orbsvcs/Event_Service/Event_Service.cpp index 78814972504b8..455ec6d9bf58c 100644 --- a/TAO/orbsvcs/Event_Service/Event_Service.cpp +++ b/TAO/orbsvcs/Event_Service/Event_Service.cpp @@ -2,7 +2,7 @@ #include "Event_Service.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Argv_Type_Converter.h" #include "ace/OS_main.h" #include "ace/OS_NS_unistd.h" diff --git a/TAO/orbsvcs/IFR_Service/IFR_Service.cpp b/TAO/orbsvcs/IFR_Service/IFR_Service.cpp index cfc41f9e38740..52cee031222c1 100644 --- a/TAO/orbsvcs/IFR_Service/IFR_Service.cpp +++ b/TAO/orbsvcs/IFR_Service/IFR_Service.cpp @@ -7,7 +7,7 @@ #include "orbsvcs/IOR_Multicast.h" #include "tao/IORTable/IORTable.h" #include "tao/ORB_Core.h" -#include "ace/Auto_Ptr.h" +#include IFR_Service::IFR_Service () { diff --git a/TAO/orbsvcs/ImplRepo_Service/Activator_Loader.h b/TAO/orbsvcs/ImplRepo_Service/Activator_Loader.h index deb6a53607a9c..b12b8d345061f 100644 --- a/TAO/orbsvcs/ImplRepo_Service/Activator_Loader.h +++ b/TAO/orbsvcs/ImplRepo_Service/Activator_Loader.h @@ -7,7 +7,7 @@ #include "tao/Object_Loader.h" -#include "ace/Auto_Ptr.h" +#include #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -34,7 +34,7 @@ class Activator_Export ImR_Activator_Loader : public TAO_Object_Loader private: ImR_Activator_i service_; Activator_Options opts_; - ACE_Auto_Ptr runner_; + std::unique_ptr runner_; private: ImR_Activator_Loader (const ImR_Activator_Loader &) = delete; diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h index da3bc7db9407d..c64bfc6cc978b 100644 --- a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h +++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.h @@ -12,7 +12,7 @@ #include "ImR_ResponseHandler.h" #include "Locator_Options.h" #include "UpdateableServerInfo.h" -#include "ace/Auto_Ptr.h" +#include #include "AsyncAccessManager.h" #include "tao/IORTable/IORTable.h" diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Loader.h b/TAO/orbsvcs/ImplRepo_Service/Locator_Loader.h index 76f39081061f9..535de5a84a0c8 100644 --- a/TAO/orbsvcs/ImplRepo_Service/Locator_Loader.h +++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Loader.h @@ -6,7 +6,7 @@ #include "tao/Object_Loader.h" -#include "ace/Auto_Ptr.h" +#include #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -33,7 +33,7 @@ class Locator_Export ImR_Locator_Loader : public TAO_Object_Loader private: ImR_Locator_i service_; Options opts_; - ACE_Auto_Ptr runner_; + std::unique_ptr runner_; private: ImR_Locator_Loader (const ImR_Locator_Loader &) = delete; ImR_Locator_Loader &operator = (const ImR_Locator_Loader &) = delete; diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h index f32a1f7d1ac35..0785ea4ccf730 100644 --- a/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h +++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Repository.h @@ -25,7 +25,7 @@ #include "ace/Hash_Map_Manager.h" #include "ace/Configuration.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Reactor.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) diff --git a/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.h b/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.h index f24b40bdb0618..0e2d8725bbcfb 100644 --- a/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.h +++ b/TAO/orbsvcs/ImplRepo_Service/tao_imr_i.h @@ -15,7 +15,7 @@ #include "tao/ImR_Client/ImplRepoC.h" #include "tao/corba.h" #include "ace/SString.h" -#include "ace/Auto_Ptr.h" +#include // Forward Declaration class TAO_IMR_Op; @@ -61,7 +61,7 @@ class TAO_IMR_i ImplementationRepository::Administration_var imr_; /// What we need to do. - ACE_Auto_Ptr op_; + std::unique_ptr op_; }; diff --git a/TAO/orbsvcs/Scheduling_Service/Scheduling_Service.cpp b/TAO/orbsvcs/Scheduling_Service/Scheduling_Service.cpp index b268cab6d8d94..e19c59b7b05c4 100644 --- a/TAO/orbsvcs/Scheduling_Service/Scheduling_Service.cpp +++ b/TAO/orbsvcs/Scheduling_Service/Scheduling_Service.cpp @@ -1,7 +1,7 @@ #include "Scheduling_Service.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Argv_Type_Converter.h" #include "orbsvcs/CosNamingC.h" #include "ace/OS_main.h" diff --git a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEvent_Utilities.cpp b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEvent_Utilities.cpp index b95e8c9fcce56..9eaf274f649fe 100644 --- a/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEvent_Utilities.cpp +++ b/TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEvent_Utilities.cpp @@ -3,7 +3,7 @@ #include "orbsvcs/Event/EC_Event_Channel.h" #include "orbsvcs/Event_Service_Constants.h" #include "EventChannel_i.h" -#include "ace/Auto_Ptr.h" +#include #include CosEC_ServantBase::CosEC_ServantBase () diff --git a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ORB_Initializer.cpp b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ORB_Initializer.cpp index 4786b8435e3fd..a9fd605960de2 100644 --- a/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ORB_Initializer.cpp +++ b/TAO/orbsvcs/examples/FaultTolerance/RolyPoly/ORB_Initializer.cpp @@ -1,6 +1,6 @@ // file : RolyPoly/ORB_Initializer.cpp // author : Boris Kolpackov -#include "ace/Auto_Ptr.h" +#include #include "tao/corba.h" #include "tao/PI/ORBInitInfo.h" #include "tao/ORB_Core.h" diff --git a/TAO/orbsvcs/examples/ImR/Advanced/TestServer.h b/TAO/orbsvcs/examples/ImR/Advanced/TestServer.h index b3e200d3786a0..dcfb52906632d 100644 --- a/TAO/orbsvcs/examples/ImR/Advanced/TestServer.h +++ b/TAO/orbsvcs/examples/ImR/Advanced/TestServer.h @@ -1,6 +1,6 @@ #include "Messenger_i.h" -#include "ace/Auto_Ptr.h" +#include #include "tao/IORTable/IORTable.h" diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.h b/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.h index 6591ba81d09b6..36fc88d390243 100644 --- a/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.h +++ b/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.h @@ -7,7 +7,7 @@ #include "tao/Object_Loader.h" -#include "ace/Auto_Ptr.h" +#include // Trivial test corba object class DynServer_Export DynServer @@ -44,7 +44,7 @@ class DynServer_Export DynServer_Loader : public TAO_Object_Loader CORBA::ORB_var orb_; PortableServer::POA_var root_poa_; DynServer service_; - ACE_Auto_Ptr runner_; + std::unique_ptr runner_; private: DynServer_Loader (const DynServer_Loader &) = delete; diff --git a/TAO/orbsvcs/examples/RtEC/Kokyu/Service.cpp b/TAO/orbsvcs/examples/RtEC/Kokyu/Service.cpp index 5032ec9520ab3..29e36ed45c047 100644 --- a/TAO/orbsvcs/examples/RtEC/Kokyu/Service.cpp +++ b/TAO/orbsvcs/examples/RtEC/Kokyu/Service.cpp @@ -14,7 +14,7 @@ #include "ace/Get_Opt.h" #include "ace/Sched_Params.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/SString.h" #include "ace/OS_NS_strings.h" #include "ace/Thread.h" diff --git a/TAO/orbsvcs/examples/RtEC/Schedule/Service.cpp b/TAO/orbsvcs/examples/RtEC/Schedule/Service.cpp index 3afa9f99684ca..0889cdd0cd943 100644 --- a/TAO/orbsvcs/examples/RtEC/Schedule/Service.cpp +++ b/TAO/orbsvcs/examples/RtEC/Schedule/Service.cpp @@ -11,7 +11,7 @@ #include "ace/Get_Opt.h" #include "ace/Sched_Params.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_NS_unistd.h" diff --git a/TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.cpp b/TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.cpp index 1a7cc09f55cf0..0ac4dc0ae7d85 100644 --- a/TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.cpp +++ b/TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.cpp @@ -171,7 +171,7 @@ TAO_AV_SCTP_SEQ_Base_Acceptor::acceptor_open (TAO_AV_SCTP_SEQ_Acceptor *acceptor this->reactor_ = reactor; this->entry_ = entry; - ACE_Auto_Array_Ptr local_ip_addr + std::unique_ptr local_ip_addr (new ACE_UINT32[entry->num_local_sec_addrs ()]); ACE_INET_Addr ip_addr; char** addrs = entry->get_local_sec_addr (); @@ -491,7 +491,7 @@ TAO_AV_SCTP_SEQ_Connector::connect (TAO_FlowSpec_Entry *entry, -1); } - ACE_Auto_Array_Ptr local_ip_addr + std::unique_ptr local_ip_addr (new ACE_UINT32[entry->num_peer_sec_addrs ()]); ACE_INET_Addr ip_addr; char** addrs = entry->get_peer_sec_addr (); diff --git a/TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.h b/TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.h index bde2dbdf45109..1d5b173173a47 100644 --- a/TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.h +++ b/TAO/orbsvcs/orbsvcs/AV/SCTP_SEQ.h @@ -16,7 +16,7 @@ #if defined (ACE_HAS_SCTP) -#include "ace/Auto_Ptr.h" +#include #include "ace/Service_Config.h" #include "orbsvcs/AV/Protocol_Factory.h" #include "ace/SOCK_SEQPACK_Association.h" @@ -32,7 +32,6 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL typedef ACE_Unbounded_Set Interface_Seq; typedef ACE_Unbounded_Set_Iterator Interface_Seq_Itor; -//typedef auto_ptr Interface_Seq_Ptr; typedef ACE_Hash_Map_Manager Secondary_Addr_Map; typedef ACE_Hash_Map_Entry Secondary_Addr_Map_Entry; typedef ACE_Hash_Map_Iterator Secondary_Addr_Map_Iterator; diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.cpp index 8b11a9dd74672..54e0f43e36e48 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/EC_ObserverStrategy.cpp @@ -5,7 +5,7 @@ #include "orbsvcs/Event/EC_ConsumerAdmin.h" #include "orbsvcs/Event/EC_SupplierAdmin.h" #include "orbsvcs/Event_Service_Constants.h" -#include "ace/Auto_Ptr.h" +#include #if ! defined (__ACE_INLINE__) #include "orbsvcs/Event/EC_ObserverStrategy.inl" @@ -113,7 +113,7 @@ TAO_EC_Basic_ObserverStrategy::create_observer_list ( ACE_NEW_RETURN (tmp, RtecEventChannelAdmin::Observer_var[size], 0); - ACE_Auto_Basic_Array_Ptr copy (tmp); + std::unique_ptr copy (tmp); Observer_Map_Iterator end = this->observers_.end (); int j = 0; @@ -156,7 +156,7 @@ TAO_EC_Basic_ObserverStrategy::supplier_qos_update ( RtecEventChannelAdmin::Observer_var *tmp = nullptr; int size = this->create_observer_list (tmp); - ACE_Auto_Basic_Array_Ptr copy (tmp); + std::unique_ptr copy (tmp); for (int i = 0; i != size; ++i) { @@ -198,7 +198,7 @@ TAO_EC_Basic_ObserverStrategy::consumer_qos_update ( RtecEventChannelAdmin::Observer_var *tmp = nullptr; int size = this->create_observer_list (tmp); - ACE_Auto_Basic_Array_Ptr copy (tmp); + std::unique_ptr copy (tmp); for (int i = 0; i != size; ++i) { diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.cpp index 2875d17ab8342..1bab62abd5eae 100644 --- a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.cpp +++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_IOGR_Property.cpp @@ -8,7 +8,7 @@ #include "tao/Tagged_Components.h" #include "tao/CDR.h" -#include "ace/Auto_Ptr.h" +#include #include "tao/debug.h" #if !defined (__ACE_INLINE__) diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Replication_Strategy.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Replication_Strategy.cpp index 7ebb7de55a937..9240d37704dc6 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Replication_Strategy.cpp +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/AMI_Replication_Strategy.cpp @@ -1,7 +1,7 @@ #include "orbsvcs/FtRtEvent/EventChannel/AMI_Replication_Strategy.h" #include "orbsvcs/FtRtEvent/EventChannel/AMI_Primary_Replication_Strategy.h" -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Service.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Service.cpp index 124d4dfaad536..9fbeaefc6474e 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Service.cpp +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Replication_Service.cpp @@ -7,7 +7,7 @@ #include "tao/ORBInitializer_Registry.h" #include "tao/CDR.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_NS_strings.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.cpp b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.cpp index 92fd68061397c..2bbe6d7a9f7bb 100644 --- a/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.cpp +++ b/TAO/orbsvcs/orbsvcs/HTIOP/HTIOP_Acceptor.cpp @@ -13,7 +13,7 @@ #include "tao/CDR.h" #include "tao/Codeset_Manager.h" -#include "ace/Auto_Ptr.h" +#include #if !defined(__ACE_INLINE__) #include "orbsvcs/HTIOP/HTIOP_Acceptor.inl" @@ -453,7 +453,7 @@ TAO::HTIOP::Acceptor::open_default (TAO_ORB_Core *orb_core, ACE::HTBP::ID_Requestor req(ht_env_); ACE_TCHAR *htid = req.get_HTID (); - ACE_Auto_Array_Ptr guard (htid); + std::unique_ptr guard (htid); this->addrs_[0] = ACE_TEXT_ALWAYS_CHAR (htid); return 0; } @@ -674,7 +674,7 @@ TAO::HTIOP::Acceptor::probe_interfaces (TAO_ORB_Core *orb_core) // The instantiation for this template is in // HTIOP/HTIOP_Connector.cpp. - ACE_Auto_Basic_Array_Ptr safe_if_addrs (inet_addrs); + std::unique_ptr safe_if_addrs (inet_addrs); // If the loopback interface is the only interface then include it // in the list of interfaces to query for a hostname, otherwise diff --git a/TAO/orbsvcs/orbsvcs/IFRService/AliasDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/AliasDef_i.cpp index 283253def365e..78bde977a732f 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/AliasDef_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/AliasDef_i.cpp @@ -1,7 +1,6 @@ #include "orbsvcs/IFRService/AliasDef_i.h" #include "orbsvcs/IFRService/Repository_i.h" #include "orbsvcs/IFRService/IFR_Service_Utils.h" -#include "ace/Auto_Ptr.h" #include "ace/SString.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ArrayDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ArrayDef_i.cpp index c31a73f0ba7ee..dc03a350af81c 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/ArrayDef_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/ArrayDef_i.cpp @@ -1,7 +1,6 @@ #include "orbsvcs/IFRService/ArrayDef_i.h" #include "orbsvcs/IFRService/Repository_i.h" #include "orbsvcs/IFRService/IFR_Service_Utils.h" -#include "ace/Auto_Ptr.h" #include "ace/SString.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/IFRService/AttributeDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/AttributeDef_i.cpp index dbddc089e7d0c..73aff0615dc61 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/AttributeDef_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/AttributeDef_i.cpp @@ -3,7 +3,6 @@ #include "orbsvcs/IFRService/IDLType_i.h" #include "orbsvcs/IFRService/ExceptionDef_i.h" #include "orbsvcs/IFRService/IFR_Service_Utils.h" -#include "ace/Auto_Ptr.h" #include "ace/SString.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ConstantDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ConstantDef_i.cpp index 168af593a0884..12dec15136bfd 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/ConstantDef_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/ConstantDef_i.cpp @@ -2,11 +2,9 @@ #include "orbsvcs/IFRService/Repository_i.h" #include "orbsvcs/IFRService/IFR_Service_Utils.h" #include "orbsvcs/IFRService/IDLType_i.h" - #include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" - -#include "ace/Auto_Ptr.h" #include "ace/SString.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -167,7 +165,7 @@ TAO_ConstantDef_i::value_i () ); char *data = static_cast (ref); - ACE_Auto_Basic_Array_Ptr safety (data); + std::unique_ptr safety (data); ACE_Message_Block mb (data, length); @@ -232,7 +230,7 @@ TAO_ConstantDef_i::value_i (const CORBA::Any &value) TAO_InputCDR in (out); mb = in.steal_contents (); } - ACE_Auto_Ptr safe (mb); + std::unique_ptr safe (mb); CORBA::TCKind kind = val_tc->kind (); diff --git a/TAO/orbsvcs/orbsvcs/IFRService/Contained_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/Contained_i.cpp index dc711338a09b9..ca45f7da9e004 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/Contained_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/Contained_i.cpp @@ -1,16 +1,13 @@ #include "orbsvcs/IFRService/concrete_classes.h" #include "orbsvcs/IFRService/Repository_i.h" #include "orbsvcs/IFRService/IFR_Service_Utils.h" -#include "ace/Auto_Ptr.h" #include "ace/SString.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL const char *TAO_Contained_i::tmp_name_holder_ = 0; -TAO_Contained_i::TAO_Contained_i ( - TAO_Repository_i *repo - ) +TAO_Contained_i::TAO_Contained_i (TAO_Repository_i *repo) : TAO_IRObject_i (repo) { } diff --git a/TAO/orbsvcs/orbsvcs/IFRService/Container_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/Container_i.cpp index 94b7fb9193112..52c331b70f7f2 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/Container_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/Container_i.cpp @@ -4,13 +4,10 @@ #include "orbsvcs/IFRService/ExtValueDef_i.h" #include "orbsvcs/IFRService/IFR_Service_Utils.h" #include "orbsvcs/IFRService/IFR_Service_Utils_T.h" - #include "tao/IFR_Client/IFR_ComponentsC.h" - #include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" - -#include "ace/Auto_Ptr.h" #include "ace/SString.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -835,7 +832,7 @@ TAO_Container_i::create_constant_i (const char *id, TAO_InputCDR in (out); mb = in.steal_contents (); } - ACE_Auto_Ptr safe (mb); + std::unique_ptr safe (mb); CORBA::TypeCode_var val_tc = value.type (); diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ExceptionDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ExceptionDef_i.cpp index 83aca20e401e1..f80d5f6b1ebb0 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/ExceptionDef_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/ExceptionDef_i.cpp @@ -2,7 +2,7 @@ #include "orbsvcs/IFRService/Repository_i.h" #include "orbsvcs/IFRService/IDLType_i.h" #include "orbsvcs/IFRService/IFR_Service_Utils.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/SString.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp index 9497487226bce..b9e581a0154dc 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils.cpp @@ -15,7 +15,7 @@ #include "tao/Stub.h" #include "tao/Profile.h" #include "tao/AnyTypeCode/ValueModifierC.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_NS_fcntl.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/IFRService/OperationDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/OperationDef_i.cpp index e4981989d82fb..6deebb1ef5ccf 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/OperationDef_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/OperationDef_i.cpp @@ -6,7 +6,7 @@ #include "orbsvcs/IFRService/ExceptionDef_i.h" #include "orbsvcs/IFRService/IFR_Service_Utils.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/SString.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/IFRService/Repository_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/Repository_i.cpp index d194744b79a3f..7fa021b0bf5e5 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/Repository_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/Repository_i.cpp @@ -9,7 +9,7 @@ #include "tao/ORB.h" #include "tao/Object_KeyC.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Lock_Adapter_T.h" #include "ace/SString.h" diff --git a/TAO/orbsvcs/orbsvcs/IFRService/SequenceDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/SequenceDef_i.cpp index d537a2c5d900f..e8d29896ffc5e 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/SequenceDef_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/SequenceDef_i.cpp @@ -2,7 +2,7 @@ #include "orbsvcs/IFRService/Repository_i.h" #include "orbsvcs/IFRService/IFR_Service_Utils.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/SString.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/IFRService/StructDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/StructDef_i.cpp index b085d10321ad3..a72b36a9e0ac3 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/StructDef_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/StructDef_i.cpp @@ -3,7 +3,7 @@ #include "orbsvcs/IFRService/Repository_i.h" #include "orbsvcs/IFRService/IFR_Service_Utils.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/SString.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/IFRService/UnionDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/UnionDef_i.cpp index 99eac21a96a52..ac54342e48eab 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/UnionDef_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/UnionDef_i.cpp @@ -6,7 +6,7 @@ #include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h" #include "tao/CDR.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/SString.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/IFRService/ValueBoxDef_i.cpp b/TAO/orbsvcs/orbsvcs/IFRService/ValueBoxDef_i.cpp index 496a915607be9..e87a2ab64f6cc 100644 --- a/TAO/orbsvcs/orbsvcs/IFRService/ValueBoxDef_i.cpp +++ b/TAO/orbsvcs/orbsvcs/IFRService/ValueBoxDef_i.cpp @@ -2,7 +2,7 @@ #include "orbsvcs/IFRService/Repository_i.h" #include "orbsvcs/IFRService/IFR_Service_Utils.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/SString.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.cpp b/TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.cpp index d2e0a1955cc9e..460a843502adf 100644 --- a/TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.cpp +++ b/TAO/orbsvcs/orbsvcs/Log/EventLogFactory_i.cpp @@ -1,7 +1,7 @@ #include "orbsvcs/Log/EventLogFactory_i.h" #include "orbsvcs/Log/LogNotification.h" #include "orbsvcs/Log/EventLogNotification.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_NS_stdio.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.cpp b/TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.cpp index 60e527cd359df..d56d5ed296e97 100644 --- a/TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.cpp +++ b/TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.cpp @@ -1,7 +1,7 @@ #include "orbsvcs/Log/Hash_LogStore.h" #include "orbsvcs/Log/Hash_LogRecordStore.h" #include "orbsvcs/Log/LogMgr_i.h" -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.cpp b/TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.cpp index 3b68903033205..7bf6493b41613 100644 --- a/TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.cpp +++ b/TAO/orbsvcs/orbsvcs/Log/RTEventLogFactory_i.cpp @@ -15,8 +15,6 @@ #include "orbsvcs/Event/EC_Event_Channel.h" #include "ace/OS_NS_stdio.h" -#include "ace/Auto_Ptr.h" - TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_RTEventLogFactory_i::TAO_RTEventLogFactory_i () : diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp index 8d86516f2a98e..ee934acd06772 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Manager.cpp @@ -781,7 +781,7 @@ TAO_FT_Naming_Manager::next_member (PortableGroup::ObjectGroup_ptr object_group) ::FT_Naming::LoadBalancingStrategyValue load_bal_strategy = this->global_strategy_; if (!this->use_global_) { - ACE_Auto_Ptr props + std::unique_ptr props (this->get_properties (object_group)); PortableGroup::Value value; CORBA::Boolean found = diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.cpp index b1fbdc028a05b..86541810b6d4a 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context.cpp @@ -8,7 +8,7 @@ #include "orbsvcs/Naming/Persistent_Context_Index.h" #include "ace/OS_NS_stdio.h" -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.cpp index a7e0034a1f9fa..18f2df1973bd1 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Storable_Naming_Context.cpp @@ -11,7 +11,7 @@ #include "orbsvcs/Naming/Persistent_Context_Index.h" #include "ace/OS_NS_stdio.h" -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.cpp index 16ebeaa7b85a6..57313401dfd76 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Hash_Naming_Context.cpp @@ -9,7 +9,7 @@ #include "orbsvcs/Naming/Hash_Naming_Context.h" #include "orbsvcs/Naming/nsconf.h" -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp index c6634e80d49b3..773602b3ec1c4 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp @@ -32,7 +32,7 @@ #include "tao/AnyTypeCode/Any.h" #include "ace/Arg_Shifter.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Get_Opt.h" #include "ace/OS_NS_unistd.h" diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp index d042436d0883c..a02061be48245 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp @@ -5,7 +5,7 @@ #include "tao/debug.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_NS_unistd.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -167,7 +167,7 @@ TAO_Persistent_Context_Index::recreate_all () (CONTEXT_INDEX::ITERATOR) (*index_), -1); - ACE_Auto_Basic_Ptr it (index_iter); + std::unique_ptr it (index_iter); // Because of broken old g++!!! typedef ACE_Hash_Map_With_Allocatorint_id_.hash_map_, entry->int_id_.counter_); - // Put into the auto pointer temporarily, in case next + // Put into the unique pointer temporarily, in case next // allocation fails. - ACE_Auto_Basic_Ptr temp (context_impl); + std::unique_ptr temp (context_impl); TAO_Naming_Context *context = 0; ACE_NEW_RETURN (context, @@ -204,7 +204,7 @@ TAO_Persistent_Context_Index::recreate_all () // Let know about it's . context_impl->interface (context); - // Release auto pointer and start using reference counting to + // Release unique pointer and start using reference counting to // control our servant. temp.release (); PortableServer::ServantBase_var s = context; diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp index 3dc96efb69f9c..233c1872f047f 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context.cpp @@ -3,7 +3,7 @@ #include "orbsvcs/Naming/Bindings_Iterator_T.h" #include "ace/OS_NS_stdio.h" -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -301,9 +301,9 @@ TAO_Persistent_Naming_Context::make_new_context (PortableServer::POA_ptr poa, if (context_impl == 0) throw CORBA::NO_MEMORY (); - // Put into the auto pointer temporarily, in case next + // Put into the unique pointer temporarily, in case next // allocation fails. - ACE_Auto_Basic_Ptr temp (context_impl); + std::unique_ptr temp (context_impl); if (context_impl->init (context_size) == -1) throw CORBA::NO_MEMORY (); @@ -328,7 +328,7 @@ TAO_Persistent_Naming_Context::make_new_context (PortableServer::POA_ptr poa, // Let know about it's . context_impl->interface (context); - // Release auto pointer, and start using reference counting to + // Release unique pointer, and start using reference counting to // control our servant. temp.release (); PortableServer::ServantBase_var s = context; @@ -396,9 +396,9 @@ TAO_Persistent_Naming_Context::list (CORBA::ULong how_many, (*persistent_context_->map ()), CORBA::NO_MEMORY ()); - // Store temp (hash_iter); + std::unique_ptr temp (hash_iter); // Silliness below is required because of broken old g++!!! E.g., // without it, we could have just said HASH_MAP::ITERATOR everywhere we use ITER_DEF. @@ -453,7 +453,7 @@ TAO_Persistent_Naming_Context::list (CORBA::ULong how_many, ITER_SERVANT (this, hash_iter, this->poa_.in ()), CORBA::NO_MEMORY ()); - // Release from auto pointer, and start using the + // Release from unique pointer, and start using the // reference counting to control our servant. temp.release (); PortableServer::ServantBase_var iter = bind_iter; diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp index abb5b1edd81a4..5aa873c3fc17d 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.cpp @@ -8,7 +8,7 @@ #include "tao/Storable_Base.h" #include "tao/Storable_Factory.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_sys_time.h" @@ -16,7 +16,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL const char * TAO_Storable_Naming_Context::root_name_; ACE_UINT32 TAO_Storable_Naming_Context::gcounter_; -ACE_Auto_Ptr TAO_Storable_Naming_Context::gfl_; +std::unique_ptr TAO_Storable_Naming_Context::gfl_; int TAO_Storable_Naming_Context::redundant_; TAO_Storable_IntId::TAO_Storable_IntId () @@ -414,7 +414,7 @@ TAO_Storable_Naming_Context::~TAO_Storable_Naming_Context () ACE_CString file_name = this->context_name_; // Now delete the file - ACE_Auto_Ptr + std::unique_ptr fl ( this->factory_->create_stream(file_name.c_str(), "r") ); @@ -493,9 +493,9 @@ TAO_Storable_Naming_Context::make_new_context ( if (context_impl == 0) throw CORBA::NO_MEMORY (); - // Put into the auto pointer temporarily, in case next + // Put into the unique pointer temporarily, in case next // allocation fails. - ACE_Auto_Basic_Ptr temp (context_impl); + std::unique_ptr temp (context_impl); TAO_Naming_Context *context = 0; ACE_NEW_THROW_EX (context, @@ -505,7 +505,7 @@ TAO_Storable_Naming_Context::make_new_context ( // Let know about it's . context_impl->interface (context); - // Release auto pointer, and start using reference counting to + // Release unique pointer, and start using reference counting to // control our servant. temp.release (); PortableServer::ServantBase_var s = context; @@ -948,9 +948,9 @@ TAO_Storable_Naming_Context::list (CORBA::ULong how_many, HASH_MAP::ITERATOR (storable_context_->map ()), CORBA::NO_MEMORY ()); - // Store temp (hash_iter); + std::unique_ptr temp (hash_iter); // Silliness below is required because of broken old g++!!! E.g., // without it, we could have just said HASH_MAP::ITERATOR everywhere we use ITER_DEF. @@ -1008,7 +1008,7 @@ TAO_Storable_Naming_Context::list (CORBA::ULong how_many, ITER_SERVANT (this, hash_iter, this->poa_.in ()), CORBA::NO_MEMORY ()); - // Release from auto pointer, and start using + // Release from unique pointer, and start using // reference counting to control our servant. temp.release (); PortableServer::ServantBase_var iter = bind_iter; @@ -1074,7 +1074,7 @@ TAO_Storable_Naming_Context::recreate_all ( // Now does this already exist on disk? ACE_CString file_name = poa_id; - ACE_Auto_Ptr fl ( + std::unique_ptr fl ( pers_factory->create_stream (file_name.c_str (), "r")); if (fl->exists ()) { diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.h b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.h index ef6222589ed46..624bf724f5f70 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.h +++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context.h @@ -15,7 +15,7 @@ #include "orbsvcs/Naming/Hash_Naming_Context.h" #include "tao/Storable_File_Guard.h" #include "ace/Hash_Map_Manager.h" -#include "ace/Auto_Ptr.h" +#include #include "orbsvcs/Naming/Storable.h" @@ -418,7 +418,7 @@ class TAO_Naming_Serv_Export TAO_Storable_Naming_Context : public TAO_Hash_Namin static const char * root_name_; /// The pointer to the global file used to allocate new contexts - static ACE_Auto_Ptr gfl_; + static std::unique_ptr gfl_; /** * @class File_Open_Lock_and_Check diff --git a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp index b98b23b428ca0..6c3966fabb9f4 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Activator.cpp @@ -14,7 +14,7 @@ #include "orbsvcs/Naming/Storable_Naming_Context_Factory.h" #include "orbsvcs/Naming/Storable.h" #include "tao/Storable_Factory.h" -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -57,7 +57,7 @@ TAO_Storable_Naming_Context_Activator::incarnate ( { // Does this already exist on disk? ACE_CString file_name = poa_id.in (); - ACE_Auto_Ptr fl ( + std::unique_ptr fl ( persistence_factory_->create_stream (file_name.c_str (), "rw")); @@ -74,9 +74,9 @@ TAO_Storable_Naming_Context_Activator::incarnate ( poa_id.in (), persistence_factory_); - // Put into the auto pointer temporarily, in case next + // Put into the unique pointer temporarily, in case next // allocation fails. - ACE_Auto_Basic_Ptr temp (context_impl); + std::unique_ptr temp (context_impl); TAO_Naming_Context *context = 0; ACE_NEW_THROW_EX (context, @@ -86,7 +86,7 @@ TAO_Storable_Naming_Context_Activator::incarnate ( // Let know about it's . context_impl->interface (context); - // Release auto pointer, and start using reference counting to + // Release unique pointer, and start using reference counting to // control our servant. temp.release (); diff --git a/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp index 4f725cbb11e78..57670a6dd4268 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp @@ -6,7 +6,7 @@ */ //============================================================================= -#include "ace/Auto_Ptr.h" +#include #include "orbsvcs/Naming/Transient_Naming_Context.h" #include "orbsvcs/Naming/Bindings_Iterator_T.h" #include "ace/OS_NS_stdio.h" @@ -147,9 +147,9 @@ TAO_Transient_Naming_Context::make_new_context (PortableServer::POA_ptr poa, context_size), CORBA::NO_MEMORY ()); - // Put into the auto pointer temporarily, in case next + // Put into the unique pointer temporarily, in case next // allocation fails. - ACE_Auto_Basic_Ptr temp (context_impl); + std::unique_ptr temp (context_impl); TAO_Naming_Context *context = 0; ACE_NEW_THROW_EX (context, @@ -159,7 +159,7 @@ TAO_Transient_Naming_Context::make_new_context (PortableServer::POA_ptr poa, // Let know about it's . context_impl->interface (context); - // Release auto pointer, and start using reference counting to + // Release unique pointer, and start using reference counting to // control our servant. temp.release (); PortableServer::ServantBase_var s = context; @@ -226,9 +226,9 @@ TAO_Transient_Naming_Context::list (CORBA::ULong how_many, HASH_MAP::ITERATOR (transient_context_->map ()), CORBA::NO_MEMORY ()); - // Store temp (hash_iter); + std::unique_ptr temp (hash_iter); // Silliness below is required because of broken old g++!!! E.g., // without it, we could have just said HASH_MAP::ITERATOR everywhere we use ITER_DEF. @@ -278,7 +278,7 @@ TAO_Transient_Naming_Context::list (CORBA::ULong how_many, ITER_SERVANT (this, hash_iter, this->poa_.in ()), CORBA::NO_MEMORY ()); - // Release from auto pointer, and start using + // Release from unique pointer, and start using // reference counting to control our servant. temp.release (); PortableServer::ServantBase_var iter = bind_iter; diff --git a/TAO/orbsvcs/orbsvcs/Notify/Admin.h b/TAO/orbsvcs/orbsvcs/Notify/Admin.h index accd1590bc8e1..f997c07456d27 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Admin.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Admin.h @@ -112,7 +112,7 @@ class TAO_Notify_Serv_Export TAO_Notify_Admin : public TAO_Notify::Topology_Pare void remove (TAO_Notify_Proxy *proxy); /// The Proxy Container. - ACE_Auto_Ptr< TAO_Notify_Proxy_Container > proxy_container_; + std::unique_ptr< TAO_Notify_Proxy_Container > proxy_container_; }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.h b/TAO/orbsvcs/orbsvcs/Notify/Consumer.h index bacb92f417fda..d7a3bf3ed37ae 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Consumer.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.h @@ -203,7 +203,7 @@ typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_Consumer > Ptr; private: /// Events pending to be delivered. - ACE_Auto_Ptr pending_events_; + std::unique_ptr pending_events_; CORBA::Object_var rtt_obj_; }; diff --git a/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.cpp b/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.cpp index 881d397d4ca1e..e5456eefef111 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.cpp @@ -14,7 +14,7 @@ #include "orbsvcs/ESF/ESF_Proxy_Collection.h" -#include "ace/Auto_Ptr.h" +#include //#define DEBUG_LEVEL 9 #ifndef DEBUG_LEVEL diff --git a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h index 1509d8e294904..839f9f83a438f 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h +++ b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h @@ -83,10 +83,10 @@ class TAO_Notify_Serv_Export TAO_CosNotify_Service : public TAO_Notify_Service TAO_Notify_Builder& builder(); /// Service component for object factory operations. - ACE_Auto_Ptr< TAO_Notify_Factory > factory_; + std::unique_ptr< TAO_Notify_Factory > factory_; /// Service component for building NS participants. - ACE_Auto_Ptr< TAO_Notify_Builder > builder_; + std::unique_ptr< TAO_Notify_Builder > builder_; }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp b/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp index 417c6ae8d8735..f3def874d991f 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp @@ -1,9 +1,9 @@ #include "orbsvcs/Log_Macros.h" #include "orbsvcs/Notify/ETCL_Filter.h" -#include "ace/Auto_Ptr.h" #include "tao/debug.h" #include "orbsvcs/Notify/Notify_Constraint_Visitors.h" #include "orbsvcs/Notify/Topology_Saver.h" +#include #ifndef DEBUG_LEVEL # define DEBUG_LEVEL TAO_debug_level diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventChannel.cpp b/TAO/orbsvcs/orbsvcs/Notify/EventChannel.cpp index 4301182362cb8..faa5bef662446 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/EventChannel.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/EventChannel.cpp @@ -41,11 +41,11 @@ typedef TAO_Notify_Seq_Worker_T TAO_Notify_ConsumerAdm typedef TAO_Notify_Seq_Worker_T TAO_Notify_SupplierAdmin_Seq_Worker; TAO_Notify_EventChannel::TAO_Notify_EventChannel () - : ecf_ (0) - , ca_container_ (0) - , sa_container_ (0) + : ecf_ (nullptr) + , ca_container_ (nullptr) + , sa_container_ (nullptr) , default_filter_factory_ (CosNotifyFilter::FilterFactory::_nil ()) - , default_filter_factory_servant_ (0) + , default_filter_factory_servant_ (nullptr) { } diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventChannel.h b/TAO/orbsvcs/orbsvcs/Notify/EventChannel.h index 498032c2783d3..8b5379723eafb 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/EventChannel.h +++ b/TAO/orbsvcs/orbsvcs/Notify/EventChannel.h @@ -172,10 +172,10 @@ class TAO_Notify_Serv_Export TAO_Notify_EventChannel TAO_Notify_SupplierAdmin_Container& sa_container(); /// ConsumerAdmin Container. - ACE_Auto_Ptr< TAO_Notify_ConsumerAdmin_Container > ca_container_; + std::unique_ptr ca_container_; /// SupplierAdmin Container. - ACE_Auto_Ptr< TAO_Notify_SupplierAdmin_Container > sa_container_; + std::unique_ptr sa_container_; /// The default filter factory. CosNotifyFilter::FilterFactory_var default_filter_factory_; diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp b/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp index ad4ff082cd830..4a7fc942e3f17 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp @@ -95,7 +95,7 @@ TAO_Notify_EventChannelFactory::init (PortableServer::POA_ptr poa) TAO_Notify_POA_Helper (), CORBA::NO_MEMORY ()); - ACE_Auto_Ptr auto_object_poa (object_poa); + std::unique_ptr auto_object_poa (object_poa); ACE_CString poa_name = object_poa->get_unique_id (); #if defined (CORBA_E_MICRO) diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.h b/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.h index 9541518d2b1b1..525065c36a8a9 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.h +++ b/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.h @@ -25,7 +25,7 @@ #include "orbsvcs/CosNotifyChannelAdminS.h" #include "orbsvcs/NotifyExtS.h" -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -155,7 +155,7 @@ class TAO_Notify_Serv_Export TAO_Notify_EventChannelFactory TAO_Notify_EventChannel_Container& ec_container(); /// Container for Event Channels. - ACE_Auto_Ptr< TAO_Notify_EventChannel_Container > ec_container_; + std::unique_ptr< TAO_Notify_EventChannel_Container > ec_container_; TAO_SYNCH_MUTEX topology_save_lock_; @@ -172,7 +172,7 @@ class TAO_Notify_Serv_Export TAO_Notify_EventChannelFactory /// Release this object. virtual void release (); - ACE_Auto_Ptr validate_client_task_; + std::unique_ptr validate_client_task_; PortableServer::POA_var poa_; }; diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.h b/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.h index 517733dbc0940..7666c5bcb7f3f 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.h @@ -9,7 +9,6 @@ #define TAO_Notify_EVENT_MANAGER_H #include /**/ "ace/pre.h" -#include "ace/Auto_Ptr.h" #include "orbsvcs/Notify/Refcountable.h" @@ -20,8 +19,8 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/orbconf.h" - #include "ace/CORBA_macros.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -116,10 +115,10 @@ class TAO_Notify_Serv_Export TAO_Notify_Event_Manager : public TAO_Notify_Refcou TAO_Notify_Event_Manager& operator= (TAO_Notify_Event_Manager&&) = delete; /// Consumer Map - ACE_Auto_Ptr< TAO_Notify_Consumer_Map > consumer_map_; + std::unique_ptr consumer_map_; /// Supplier Map - ACE_Auto_Ptr< TAO_Notify_Supplier_Map > supplier_map_; + std::unique_ptr supplier_map_; }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/NotificationServiceMonitor_i.cpp b/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/NotificationServiceMonitor_i.cpp index d8806831e2e9d..02adf80b875a1 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/NotificationServiceMonitor_i.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/MonitorControl/NotificationServiceMonitor_i.cpp @@ -3,7 +3,6 @@ #include "orbsvcs/Notify/MonitorControl/NotificationServiceMonitor_i.h" #include "tao/Monitor/Monitor_Impl.h" -#include "ace/Auto_Ptr.h" #include "ace/Monitor_Point_Registry.h" #include "ace/Monitor_Base.h" @@ -90,7 +89,7 @@ NotificationServiceMonitor_i::get_statistics (const Monitor::NameList& names) Monitor::DataList ( length), 0); - ACE_Auto_Basic_Ptr safe_data (data); + std::unique_ptr safe_data (data); data->length (length); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Object.cpp b/TAO/orbsvcs/orbsvcs/Notify/Object.cpp index 3fe20a72ab338..9879e2919f5e0 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Object.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Object.cpp @@ -152,7 +152,7 @@ TAO_Notify_Object::destroy_proxy_poa () if ( this->own_proxy_poa_ == true ) { this->own_proxy_poa_ = false; - ACE_Auto_Ptr< TAO_Notify_POA_Helper > app( proxy_poa_ ); + std::unique_ptr< TAO_Notify_POA_Helper > app( proxy_poa_ ); this->proxy_poa_->destroy (); } this->proxy_poa_ = 0; @@ -172,13 +172,13 @@ TAO_Notify_Object::destroy_object_poa () { try { - if ( this->object_poa_ == this->proxy_poa_ ) this->proxy_poa_ = 0; - if ( this->object_poa_ == this->poa_ ) this->poa_ = 0; + if (this->object_poa_ == this->proxy_poa_) this->proxy_poa_ = 0; + if (this->object_poa_ == this->poa_) this->poa_ = 0; - if ( this->own_object_poa_ == true ) + if (this->own_object_poa_ == true) { this->own_object_poa_ = false; - ACE_Auto_Ptr< TAO_Notify_POA_Helper > aop( object_poa_ ); + std::unique_ptr aop (object_poa_); this->object_poa_->destroy (); } this->object_poa_ = 0; diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.cpp index 533dcced5023d..a12135b6c700a 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.cpp @@ -67,7 +67,7 @@ void TAO_Notify_ProxyConsumer::connect (TAO_Notify_Supplier *supplier) { // Adopt the supplier - ACE_Auto_Ptr< TAO_Notify_Supplier > auto_supplier (supplier); + std::unique_ptr auto_supplier (supplier); TAO_Notify_Atomic_Property_Long& supplier_count = this->admin_properties().suppliers (); const TAO_Notify_Property_Long& max_suppliers = this->admin_properties().max_suppliers (); @@ -88,7 +88,7 @@ TAO_Notify_ProxyConsumer::connect (TAO_Notify_Supplier *supplier) } // Adopt the supplier - this->supplier_ = auto_supplier; + this->supplier_ = std::move(auto_supplier); this->supplier_admin_->subscribed_types (this->subscribed_types_); // get the parents subscribed types. } diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.h index 2230a958c20f4..76119b3cc9b0e 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.h +++ b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.h @@ -21,8 +21,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "orbsvcs/CosEventChannelAdminC.h" - -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -88,7 +87,7 @@ class TAO_Notify_Serv_Export TAO_Notify_ProxyConsumer TAO_Notify_SupplierAdmin::Ptr supplier_admin_; /// The Supplier that we're connect to. - ACE_Auto_Ptr supplier_; + std::unique_ptr supplier_; /// Access our Peer. virtual TAO_Notify_Peer* peer (); diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_Builder.cpp b/TAO/orbsvcs/orbsvcs/Notify/RT_Builder.cpp index b9efd07001eed..8adfaa057a20d 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/RT_Builder.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/RT_Builder.cpp @@ -1,12 +1,11 @@ #include "orbsvcs/Notify/RT_Builder.h" - -#include "ace/Auto_Ptr.h" -#include "ace/Dynamic_Service.h" #include "orbsvcs/Notify/ETCL_FilterFactory.h" #include "orbsvcs/Notify/RT_POA_Helper.h" #include "orbsvcs/Notify/Properties.h" #include "orbsvcs/NotifyExtC.h" #include "orbsvcs/Notify/Object.h" +#include "ace/Dynamic_Service.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -29,7 +28,7 @@ TAO_Notify_RT_Builder::apply_thread_pool_concurrency (TAO_Notify_Object& object TAO_Notify_RT_POA_Helper (), CORBA::NO_MEMORY ()); - ACE_Auto_Ptr auto_proxy_poa (proxy_poa); + std::unique_ptr auto_proxy_poa (proxy_poa); PortableServer::POA_var default_poa = TAO_Notify_PROPERTIES::instance ()->default_poa (); @@ -50,7 +49,7 @@ TAO_Notify_RT_Builder::apply_lane_concurrency (TAO_Notify_Object& object TAO_Notify_RT_POA_Helper (), CORBA::NO_MEMORY ()); - ACE_Auto_Ptr auto_proxy_poa (proxy_poa); + std::unique_ptr auto_proxy_poa (proxy_poa); PortableServer::POA_var default_poa = TAO_Notify_PROPERTIES::instance ()->default_poa (); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.cpp index 420f6bce8693f..5d25409af3c75 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.cpp @@ -1,7 +1,6 @@ #include "orbsvcs/Log_Macros.h" #include "orbsvcs/Notify/Structured/StructuredProxyPushConsumer.h" #include "ace/Bound_Ptr.h" -#include "ace/Auto_Ptr.h" #include "tao/debug.h" #include "orbsvcs/Notify/Structured/StructuredPushSupplier.h" #include "orbsvcs/Notify/Structured/StructuredEvent.h" diff --git a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h index 42684e8445cab..51a67fc702854 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h +++ b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h @@ -21,7 +21,7 @@ #include "ace/Message_Queue.h" #include "ace/Reactor.h" #include "ace/Null_Condition.h" -#include "ace/Auto_Ptr.h" +#include #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -82,7 +82,7 @@ class TAO_Notify_Serv_Export TAO_Notify_ThreadPool_Task virtual void release (); /// The buffering strategy to use. - ACE_Auto_Ptr< TAO_Notify_Buffering_Strategy > buffering_strategy_; + std::unique_ptr buffering_strategy_; /// Shutdown bool shutdown_; diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/Fragments_Cleanup_Strategy.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/Fragments_Cleanup_Strategy.cpp index 20b70b75e1784..2201c0d9a067a 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/Fragments_Cleanup_Strategy.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/Fragments_Cleanup_Strategy.cpp @@ -1,8 +1,7 @@ #include "orbsvcs/Log_Macros.h" #include "orbsvcs/PortableGroup/Fragments_Cleanup_Strategy.h" #include "orbsvcs/PortableGroup/UIPMC_Transport_Recv_Packet.h" - -#include "ace/Auto_Ptr.h" +#include #if !defined (__ACE_INLINE__) # include "orbsvcs/PortableGroup/Fragments_Cleanup_Strategy.inl" @@ -102,7 +101,7 @@ namespace TAO_PG (*cur_iter).key ())); } - ACE_Auto_Ptr guard ((*cur_iter).item ()); + std::unique_ptr guard ((*cur_iter).item ()); packets.unbind (cur_iter); } } @@ -119,7 +118,7 @@ namespace TAO_PG DESCRIPTOR_SET sorted_set; ACE_NEW (sorted_set, HASH_MAP_ENTRY*[current_size]); - ACE_Auto_Array_Ptr owner (sorted_set); + std::unique_ptr owner (sorted_set); HASH_MAP_ITER iter = packets.begin (); @@ -152,7 +151,7 @@ namespace TAO_PG sorted_set[i]->key ())); } - ACE_Auto_Ptr guard (sorted_set[i]->item ()); + std::unique_ptr guard (sorted_set[i]->item ()); packets.unbind (sorted_set[i]); } } @@ -182,7 +181,7 @@ namespace TAO_PG (*cur_iter).item ()->data_length (), (*cur_iter).key ())); - ACE_Auto_Ptr guard ((*cur_iter).item ()); + std::unique_ptr guard ((*cur_iter).item ()); packets.unbind (cur_iter); } else @@ -197,7 +196,7 @@ namespace TAO_PG DESCRIPTOR_SET sorted_set; ACE_NEW (sorted_set, HASH_MAP_ENTRY*[current_size]); - ACE_Auto_Array_Ptr owner (sorted_set); + std::unique_ptr owner (sorted_set); iter = packets.begin (); @@ -223,7 +222,7 @@ namespace TAO_PG sorted_set[i]->key ())); size -= sorted_set[i]->item ()->data_length (); - ACE_Auto_Ptr guard (sorted_set[i]->item ()); + std::unique_ptr guard (sorted_set[i]->item ()); packets.unbind (sorted_set[i]); } } diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/GOA.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/GOA.cpp index a409ee0873c1c..6b792efaef25d 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/GOA.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/GOA.cpp @@ -9,8 +9,6 @@ #include "tao/Profile.h" #include "tao/CDR.h" -#include "ace/Auto_Ptr.h" - TAO_BEGIN_VERSIONED_NAMESPACE_DECL PortableServer::ObjectId * diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.cpp index 4f46abd4cfc3b..4e46b4c5b79bc 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_FactoryRegistry.cpp @@ -6,7 +6,6 @@ #include "ace/Vector_T.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_unistd.h" -#include "ace/Auto_Ptr.h" #include "tao/debug.h" #include "tao/ORB_Constants.h" #include "tao/PortableServer/POAManagerC.h" diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_List_Store.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_List_Store.cpp index 51b466aca48f6..2e7b888468947 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_List_Store.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Group_List_Store.cpp @@ -14,10 +14,8 @@ #include "tao/Storable_Base.h" #include "tao/Storable_Factory.h" #include "tao/Storable_File_Guard.h" - -#include "ace/Auto_Ptr.h" - #include +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -144,8 +142,7 @@ TAO::PG_Group_List_Store::PG_Group_List_Store ( // version already exists. bool stream_exists = false; { - ACE_Auto_Ptr stream ( - this->create_stream ("r")); + std::unique_ptr stream (this->create_stream ("r")); if (stream->exists ()) stream_exists = true; @@ -260,7 +257,7 @@ bool TAO::PG_Group_List_Store::list_obsolete () { // TODO: Update if obsolete flag is set based on CORBA call. - ACE_Auto_Ptr stream (this->create_stream ("r")); + std::unique_ptr stream (this->create_stream ("r")); if (!stream->exists ()) throw CORBA::INTERNAL (); if (stream->open () != 0) diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroupManager.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroupManager.cpp index b1ffb6120b623..e3d36678dcf04 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroupManager.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_ObjectGroupManager.cpp @@ -7,7 +7,7 @@ #include "tao/debug.h" #include "tao/ORB_Constants.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Reverse_Lock_T.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.cpp index 21953ce862120..279b35b260dad 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Storable.cpp @@ -17,7 +17,7 @@ namespace char *tmp = 0; ACE_NEW_THROW_EX (tmp, char [size], CORBA::NO_MEMORY ()); - ACE_Auto_Basic_Array_Ptr buf (tmp); + std::unique_ptr buf (tmp); stream.read (size, buf.get ()); TAO_InputCDR cdr (buf.get (), size); @@ -246,7 +246,7 @@ TAO::PG_Object_Group_Storable::PG_Object_Group_Storable ( // version already exists. bool stream_exists = false; { - ACE_Auto_Ptr stream (this->create_stream ("r")); + std::unique_ptr stream (this->create_stream ("r")); if (stream->exists ()) stream_exists = true; @@ -284,7 +284,7 @@ TAO::PG_Object_Group_Storable::PG_Object_Group_Storable ( // version already exists. bool stream_exists = false; { - ACE_Auto_Ptr stream (this->create_stream ("r")); + std::unique_ptr stream (this->create_stream ("r")); if (stream->exists ()) stream_exists = true; @@ -304,7 +304,7 @@ TAO::PG_Object_Group_Storable::~PG_Object_Group_Storable () { if (destroyed_) { - ACE_Auto_Ptr stream (this->create_stream ("r")); + std::unique_ptr stream (this->create_stream ("r")); if (stream->exists ()) { diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Transport.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Transport.cpp index 942408b46c3eb..90ad07a0553b1 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Transport.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Transport.cpp @@ -81,7 +81,7 @@ TAO_UIPMC_Mcast_Transport::cleanup_packets (bool expired_only) (*cur_iter).item ()->data_length ())); } - ACE_Auto_Ptr guard ((*cur_iter).item ()); + std::unique_ptr guard ((*cur_iter).item ()); this->incomplete_.unbind (cur_iter); } } @@ -514,7 +514,7 @@ TAO_UIPMC_Mcast_Transport::handle_input ( } // Grab the next completed MIOP message to process from the FIFO Queue. - ACE_Auto_Ptr complete_owner (this->recv_all (rh)); + std::unique_ptr complete_owner (this->recv_all (rh)); if (TAO_PG::UIPMC_Recv_Packet *complete = complete_owner.get ()) { if (TAO_debug_level >= 9) @@ -534,7 +534,7 @@ TAO_UIPMC_Mcast_Transport::handle_input ( TAO::VMCID, ENOMEM), CORBA::COMPLETED_NO)); - ACE_Auto_Array_Ptr owner_buffer (buffer); + std::unique_ptr owner_buffer (buffer); ACE_Data_Block db (complete->data_length () + ACE_CDR::MAX_ALIGNMENT, ACE_Message_Block::MB_DATA, buffer, diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp index 50a2d07f3fdc9..84531a8052974 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp @@ -17,7 +17,7 @@ #include "tao/Blocked_Connect_Strategy.h" #include "tao/Wait_Strategy.h" #include "tao/Profile_Transport_Resolver.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/os_include/os_netdb.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.cpp index a4fefe0482742..b77ef08e51063 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_ORBInitializer.cpp @@ -15,7 +15,7 @@ #include "tao/PI/ORBInitInfo.h" #include "tao/debug.h" -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp index fc548a13ac99d..2da4db4fccc76 100644 --- a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp @@ -1591,7 +1591,7 @@ create_i (const char *entry_point, // Store the new entry in the scheduling entry pointer array. entry_ptr_array_ [handle - 1] = new_sched_entry; - // Release the auto pointers, so their destruction does not + // Release the unique pointers, so their destruction does not // remove the new rt_info that is now in the map and tree, // or the scheduling entry attached to the rt_info. new_rt_info_ptr.release (); diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/driver.cpp b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/driver.cpp index b9b51ce70536b..13aa7bbbe5ef9 100644 --- a/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/driver.cpp +++ b/TAO/orbsvcs/performance-tests/RTEvent/Colocated_Roundtrip/driver.cpp @@ -22,7 +22,6 @@ #include "tao/Strategies/advanced_resource.h" #include "tao/Messaging/Messaging.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" #include "ace/High_Res_Timer.h" #include "ace/Sample_History.h" #include "ace/Basic_Stats.h" diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/client.cpp b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/client.cpp index 93af9abe2dd04..0ffab5ea551c4 100644 --- a/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/client.cpp +++ b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/client.cpp @@ -18,7 +18,6 @@ #include "tao/RTCORBA/Continuous_Priority_Mapping.h" #include "tao/RTPortableServer/RTPortableServer.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" #include "ace/High_Res_Timer.h" #include "ace/Sample_History.h" #include "ace/Basic_Stats.h" diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/server.cpp b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/server.cpp index 7c7e0fbe6cc40..d55712a7a1876 100644 --- a/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/server.cpp +++ b/TAO/orbsvcs/performance-tests/RTEvent/Federated_Roundtrip/server.cpp @@ -10,7 +10,6 @@ #include "tao/Strategies/advanced_resource.h" #include "tao/Messaging/Messaging.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" const ACE_TCHAR *ior_output_file = ACE_TEXT ("test.ior"); int iterations = 10000; diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/client.cpp b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/client.cpp index 1644dbca3b509..0487adc7225aa 100644 --- a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/client.cpp +++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/client.cpp @@ -9,7 +9,6 @@ #include "tao/Strategies/advanced_resource.h" #include "tao/RTPortableServer/RTPortableServer.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" #include "ace/High_Res_Timer.h" #include "ace/Sample_History.h" #include "ace/Basic_Stats.h" diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/server.cpp b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/server.cpp index 946e204ead760..34167fd298e00 100644 --- a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/server.cpp +++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Baseline/server.cpp @@ -10,7 +10,6 @@ #include "tao/Strategies/advanced_resource.h" #include "tao/Messaging/Messaging.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" const ACE_TCHAR *ior_output_file = ACE_TEXT ("test.ior"); int use_rt_corba = 0; diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/client.cpp b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/client.cpp index c493bbfe72f16..80d2a4d3e09d9 100644 --- a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/client.cpp +++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/client.cpp @@ -16,7 +16,6 @@ #include "tao/Strategies/advanced_resource.h" #include "tao/Messaging/Messaging.h" #include "ace/Auto_Functor.h" -#include "ace/Auto_Ptr.h" #include "ace/High_Res_Timer.h" #include "ace/Basic_Stats.h" #include "ace/Stats.h" diff --git a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/server.cpp b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/server.cpp index 5eda28852ecc9..56f5180838d25 100644 --- a/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/server.cpp +++ b/TAO/orbsvcs/performance-tests/RTEvent/RTCORBA_Callback/server.cpp @@ -13,7 +13,6 @@ #include "tao/Strategies/advanced_resource.h" #include "tao/Messaging/Messaging.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" const ACE_TCHAR *ior_output_file = ACE_TEXT ("test.ior"); int use_rt_corba = 0; diff --git a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/server.cpp b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/server.cpp index 17fb3f4f5d07e..394f388124257 100644 --- a/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/server.cpp +++ b/TAO/orbsvcs/performance-tests/RTEvent/Roundtrip/server.cpp @@ -15,7 +15,6 @@ #include "tao/Strategies/advanced_resource.h" #include "tao/Messaging/Messaging.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" const ACE_TCHAR *ior_output_file = ACE_TEXT ("test.ior"); int use_rt_corba = 0; diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Control.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Control.cpp index f47b21d8dac51..160652c5637b3 100644 --- a/TAO/orbsvcs/performance-tests/RTEvent/lib/Control.cpp +++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Control.cpp @@ -14,7 +14,6 @@ #include "ace/High_Res_Timer.h" #include "ace/Sample_History.h" #include "ace/Basic_Stats.h" -#include "ace/Auto_Ptr.h" #include Control::Control (size_t peers_expected, @@ -57,9 +56,7 @@ Control::join (Federated_Test::Peer_ptr peer) /// Automatically shutdown the peers typedef ACE_Utils::Auto_Functor > Peer_Shutdown; - ACE_Auto_Basic_Array_Ptr peer_shutdown ( - new Peer_Shutdown[this->peers_count_] - ); + std::unique_ptr peer_shutdown (new Peer_Shutdown[this->peers_count_]); size_t i; for (i = 0; i != this->peers_count_; ++i) @@ -86,15 +83,13 @@ Control::join (Federated_Test::Peer_ptr peer) for (i = 0; i != this->peers_count_; ++i) { /// ... automatically release the object references ... - ACE_Auto_Basic_Array_Ptr loopbacks ( - new Federated_Test::Loopback_var[2*this->peers_count_] - ); + std::unique_ptr loopbacks ( + new Federated_Test::Loopback_var[2*this->peers_count_]); /// ... and automatically disconnect the loopbacks ... typedef Auto_Disconnect Loopback_Disconnect; - ACE_Auto_Basic_Array_Ptr > disconnects ( - new std::unique_ptr[2*this->peers_count_] - ); + std::unique_ptr[] > disconnects ( + new std::unique_ptr[2*this->peers_count_]); ACE_DEBUG ((LM_DEBUG, "Control (%P|%t) Running test for peer %d\n", diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.cpp index e3823cddb70ec..a15f7031cc418 100644 --- a/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.cpp +++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.cpp @@ -91,7 +91,7 @@ Low_Priority_Setup::stop_all_threads () ACE_DEBUG ((LM_DEBUG, "\n")); this->thr_mgr_.wait (); - /// Resetting the auto_ptr<> destroys all the objects. The + /// Resetting the unique_ptr<> destroys all the objects. The /// destructors automatically stop and wait for all the threads. /// Depending on your personal bias this is either "super neat" or /// "a horrible kludge", IMHO is just good use of the language :-) diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.h b/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.h index 2f8206ada5b21..2baa541bf6fdd 100644 --- a/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.h +++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/Low_Priority_Setup.h @@ -10,7 +10,6 @@ #include "Auto_Disconnect.h" #include "Send_Task.h" #include "Send_Task_Stopper.h" -#include "ace/Auto_Ptr.h" #include "ace/High_Res_Timer.h" #include @@ -56,12 +55,12 @@ class Low_Priority_Setup /// Collect the stats from all the clients void collect_basic_stats (ACE_Basic_Stats &stats); - typedef ACE_Auto_Basic_Array_Ptr Client_Array; + typedef std::unique_ptr Client_Array; typedef Auto_Disconnect Client_Auto_Disconnect; - typedef ACE_Auto_Basic_Array_Ptr Client_Auto_Disconnect_Array; - typedef ACE_Auto_Basic_Array_Ptr Send_Task_Array; + typedef std::unique_ptr Client_Auto_Disconnect_Array; + typedef std::unique_ptr Send_Task_Array; typedef std::unique_ptr Auto_Send_Task_Stopper; - typedef ACE_Auto_Basic_Array_Ptr Send_Task_Stopper_Array; + typedef std::unique_ptr Send_Task_Stopper_Array; private: int consumer_count_; diff --git a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Initializer.cpp b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Initializer.cpp index b5eaf940bfcec..bb1ac2a9419fd 100644 --- a/TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Initializer.cpp +++ b/TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Initializer.cpp @@ -12,7 +12,6 @@ #include "orbsvcs/Event/EC_RTCORBA_Factory.h" #include "ace/Dynamic_Service.h" -#include "ace/Auto_Ptr.h" TAO_EC_Event_Channel * RTEC_Initializer::create (PortableServer::POA_ptr consumer_poa, diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/client2.cpp b/TAO/orbsvcs/tests/Bug_2285_Regression/client2.cpp index caa1748ee6403..6033c8bcb1dd7 100644 --- a/TAO/orbsvcs/tests/Bug_2285_Regression/client2.cpp +++ b/TAO/orbsvcs/tests/Bug_2285_Regression/client2.cpp @@ -5,7 +5,7 @@ #include "tao/PI/PI.h" #include "orbsvcs/FaultTolerance/FT_ClientService_Activate.h" #include "orbsvcs/FaultTolerance/FT_IOGR_Property.h" -#include "ace/Auto_Ptr.h" +#include //const ACE_TCHAR *ior = ACE_TEXT("file://test.ior"); @@ -114,7 +114,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ACE_NEW_RETURN (servers, Test::Hello_var [number_of_servers], -1); - ACE_Auto_Array_Ptr owner (servers); + std::unique_ptr owner (servers); for (CORBA::ULong i = 0; i < number_of_servers; ++ i) { diff --git a/TAO/orbsvcs/tests/CosEvent/Timeout/TimeoutTestMain.cpp b/TAO/orbsvcs/tests/CosEvent/Timeout/TimeoutTestMain.cpp index 98172797c7bb1..56fb393dd5101 100644 --- a/TAO/orbsvcs/tests/CosEvent/Timeout/TimeoutTestMain.cpp +++ b/TAO/orbsvcs/tests/CosEvent/Timeout/TimeoutTestMain.cpp @@ -4,7 +4,7 @@ #include "orbsvcs/CosEventChannelAdminC.h" #include "orbsvcs/CosNamingC.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Task.h" #include "ace/Log_Msg.h" #include "ace/OS_NS_strings.h" @@ -125,7 +125,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) servant.activate (); } - ACE_Auto_Ptr pST; + std::unique_ptr pST; if (supplier) { // The supplier will use its own ORB. diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Consumer.cpp b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Consumer.cpp index 8ec3b162ffed4..9ce7e5ae6bfc4 100644 --- a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Consumer.cpp +++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Consumer.cpp @@ -11,7 +11,7 @@ #include "tao/CDR.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Sched_Params.h" #include "ace/OS_NS_errno.h" #include "ace/OS_NS_unistd.h" diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.cpp b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.cpp index 0202dcaee91fa..775d1e0d34b1c 100644 --- a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.cpp +++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.cpp @@ -1,5 +1,5 @@ #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Sched_Params.h" #include "ace/ACE.h" #include "ace/OS_NS_unistd.h" diff --git a/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.cpp b/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.cpp index cfba8db9ba9e7..f95e0969f70e8 100644 --- a/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.cpp +++ b/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.cpp @@ -10,7 +10,7 @@ #include "tao/ORB_Core.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Sched_Params.h" #include "ace/Read_Buffer.h" #include "ace/OS_NS_sys_time.h" diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp index afefd875ca2b2..91d8a20440e02 100644 --- a/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp +++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp @@ -8,7 +8,7 @@ #include "tao/debug.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Sched_Params.h" #include "ace/OS_NS_unistd.h" diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer_Driver.cpp b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer_Driver.cpp index 403a38f8f7526..5e63b9380b628 100644 --- a/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer_Driver.cpp +++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer_Driver.cpp @@ -9,7 +9,7 @@ #include "tao/debug.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Sched_Params.h" #include "ace/OS_NS_errno.h" #include "ace/OS_NS_unistd.h" diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.cpp b/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.cpp index 869c4277d903e..f369a6fe10a3e 100644 --- a/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.cpp +++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.cpp @@ -8,7 +8,7 @@ #include "tao/debug.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Sched_Params.h" #include "ace/High_Res_Timer.h" #include "ace/ACE.h" diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier_Driver.cpp b/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier_Driver.cpp index 4dc0053f3b64b..8cb6fa28a5bea 100644 --- a/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier_Driver.cpp +++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier_Driver.cpp @@ -9,7 +9,7 @@ #include "tao/debug.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Sched_Params.h" #include "ace/OS_NS_errno.h" #include "ace/OS_NS_unistd.h" diff --git a/TAO/orbsvcs/tests/ImplRepo/MT_stress/server_i.h b/TAO/orbsvcs/tests/ImplRepo/MT_stress/server_i.h index 52f0b223f14da..4fd2dc305d66b 100644 --- a/TAO/orbsvcs/tests/ImplRepo/MT_stress/server_i.h +++ b/TAO/orbsvcs/tests/ImplRepo/MT_stress/server_i.h @@ -5,7 +5,7 @@ #include "testS.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/SString.h" class Server_i diff --git a/TAO/orbsvcs/tests/ImplRepo/scale/server_i.h b/TAO/orbsvcs/tests/ImplRepo/scale/server_i.h index e7c6e2f879331..29bf90e87cf71 100644 --- a/TAO/orbsvcs/tests/ImplRepo/scale/server_i.h +++ b/TAO/orbsvcs/tests/ImplRepo/scale/server_i.h @@ -4,7 +4,7 @@ #include "testS.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/SString.h" class Server_i diff --git a/TAO/orbsvcs/tests/Trading/export_test.cpp b/TAO/orbsvcs/tests/Trading/export_test.cpp index f786547ff6ac9..69fe66fd66fd6 100644 --- a/TAO/orbsvcs/tests/Trading/export_test.cpp +++ b/TAO/orbsvcs/tests/Trading/export_test.cpp @@ -2,7 +2,7 @@ #include "Offer_Exporter.h" #include "Offer_Importer.h" #include "Service_Type_Exporter.h" -#include "ace/Auto_Ptr.h" +#include #include "orbsvcs/Trader/Trader.h" #include "orbsvcs/Trader/Service_Type_Repository.h" #include "ace/Get_Opt.h" diff --git a/TAO/performance-tests/Cubit/TAO/IDL_Cubit/Cubit_i.cpp b/TAO/performance-tests/Cubit/TAO/IDL_Cubit/Cubit_i.cpp index 84176f01398f1..ef8a4e803fd47 100644 --- a/TAO/performance-tests/Cubit/TAO/IDL_Cubit/Cubit_i.cpp +++ b/TAO/performance-tests/Cubit/TAO/IDL_Cubit/Cubit_i.cpp @@ -17,7 +17,7 @@ #include "tao/debug.h" #include "tao/Timeprobe.h" -#include "ace/Auto_Ptr.h" +#include #if defined (ACE_ENABLE_TIMEPROBES) diff --git a/TAO/tao/Acceptor_Registry.cpp b/TAO/tao/Acceptor_Registry.cpp index 20c35ef484f74..75af19e49b358 100644 --- a/TAO/tao/Acceptor_Registry.cpp +++ b/TAO/tao/Acceptor_Registry.cpp @@ -14,7 +14,7 @@ # include "tao/IIOP_Acceptor.h" #endif /* ACE_WIN32 && ACE_HAS_IPV6 */ -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_NS_string.h" #include "ace/OS_NS_ctype.h" #include @@ -682,7 +682,7 @@ TAO_Acceptor_Registry::open_i (TAO_ORB_Core *orb_core, } char *last_addr = nullptr; - ACE_Auto_Basic_Array_Ptr addr_str (addrs.rep ()); + std::unique_ptr addr_str (addrs.rep ()); const char *astr = ACE_OS::strtok_r (addr_str.get (), ",", &last_addr); diff --git a/TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp index e5f4e1faba823..a37b95f48c571 100644 --- a/TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp +++ b/TAO/tao/AnyTypeCode/Any_Array_Impl_T.cpp @@ -10,7 +10,7 @@ #include "tao/CDR.h" #include "tao/SystemException.h" -#include "ace/Auto_Ptr.h" +#include #if !defined (__ACE_INLINE__) # include "tao/AnyTypeCode/Any_Array_Impl_T.inl" diff --git a/TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp b/TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp index aac5767ffc292..eea744dadba35 100644 --- a/TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp +++ b/TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp @@ -6,7 +6,7 @@ #include "tao/CDR.h" #include "tao/SystemException.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_NS_string.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp index 80af1e45323bc..266af6d552491 100644 --- a/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp +++ b/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp @@ -9,7 +9,7 @@ #include "tao/SystemException.h" #include "tao/CDR.h" -#include "ace/Auto_Ptr.h" +#include #if !defined (__ACE_INLINE__) # include "tao/AnyTypeCode/Any_Basic_Impl_T.inl" diff --git a/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp index 4cf81560d31a4..768402db2e643 100644 --- a/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp +++ b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp @@ -10,7 +10,7 @@ #include "tao/CDR.h" #include "tao/AnyTypeCode/TypeCode.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_Memory.h" #if !defined (__ACE_INLINE__) diff --git a/TAO/tao/AnyTypeCode/Any_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Impl_T.cpp index abf5d0c2ff891..5d01a591de3c6 100644 --- a/TAO/tao/AnyTypeCode/Any_Impl_T.cpp +++ b/TAO/tao/AnyTypeCode/Any_Impl_T.cpp @@ -10,7 +10,7 @@ #include "tao/SystemException.h" #include "tao/debug.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_Memory.h" #if !defined (__ACE_INLINE__) diff --git a/TAO/tao/AnyTypeCode/Any_SystemException.cpp b/TAO/tao/AnyTypeCode/Any_SystemException.cpp index 1e905894b6473..188777f78d928 100644 --- a/TAO/tao/AnyTypeCode/Any_SystemException.cpp +++ b/TAO/tao/AnyTypeCode/Any_SystemException.cpp @@ -10,7 +10,7 @@ #include "tao/CORBA_String.h" #include "tao/SystemException.h" -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/AnyTypeCode/NVList.cpp b/TAO/tao/AnyTypeCode/NVList.cpp index 557b80f158295..b11f54c3d9aa7 100644 --- a/TAO/tao/AnyTypeCode/NVList.cpp +++ b/TAO/tao/AnyTypeCode/NVList.cpp @@ -11,7 +11,7 @@ #include "tao/debug.h" #include "tao/SystemException.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Log_Msg.h" #include "ace/CORBA_macros.h" diff --git a/TAO/tao/CSD_ThreadPool/CSD_TP_Collocated_Synch_Request.inl b/TAO/tao/CSD_ThreadPool/CSD_TP_Collocated_Synch_Request.inl index 89f5e6db71560..cbfb4be02de8b 100644 --- a/TAO/tao/CSD_ThreadPool/CSD_TP_Collocated_Synch_Request.inl +++ b/TAO/tao/CSD_ThreadPool/CSD_TP_Collocated_Synch_Request.inl @@ -1,5 +1,5 @@ // -*- C++ -*- -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -40,7 +40,7 @@ TAO::CSD::TP_Collocated_Synch_Request::wait() CORBA::Exception* ex = this->exception_; this->exception_ = 0; - ACE_Auto_Basic_Ptr ex_holder(ex); + std::unique_ptr ex_holder(ex); ex->_raise (); } } diff --git a/TAO/tao/Collocated_Invocation.cpp b/TAO/tao/Collocated_Invocation.cpp index e4b01c4a88207..bcbfd4b99a716 100644 --- a/TAO/tao/Collocated_Invocation.cpp +++ b/TAO/tao/Collocated_Invocation.cpp @@ -66,9 +66,7 @@ namespace TAO orb_core->_incr_refcnt (); TAO_ORB_Core_Auto_Ptr my_orb_core (orb_core); - dispatcher->dispatch (orb_core, - request, - this->forwarded_to_.out ()); + dispatcher->dispatch (orb_core, request, this->forwarded_to_.out ()); if (request.is_forwarded ()) { diff --git a/TAO/tao/Connector_Registry.cpp b/TAO/tao/Connector_Registry.cpp index 6de1485a595e9..004a3a801c1ca 100644 --- a/TAO/tao/Connector_Registry.cpp +++ b/TAO/tao/Connector_Registry.cpp @@ -7,7 +7,7 @@ #include "tao/ORB_Constants.h" #include "tao/CDR.h" #include "tao/SystemException.h" -#include "ace/Auto_Ptr.h" +#include #if !defined(__ACE_INLINE__) #include "tao/Connector_Registry.inl" diff --git a/TAO/tao/DynamicAny/DynAnyFactory.cpp b/TAO/tao/DynamicAny/DynAnyFactory.cpp index eb03d1253a729..5b2669179ee7f 100644 --- a/TAO/tao/DynamicAny/DynAnyFactory.cpp +++ b/TAO/tao/DynamicAny/DynAnyFactory.cpp @@ -19,7 +19,7 @@ #include "tao/DynamicAny/DynUnion_i.h" #include "tao/DynamicAny/DynAnyUtils_T.h" -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/DynamicAny/DynAnyUtils_T.cpp b/TAO/tao/DynamicAny/DynAnyUtils_T.cpp index 7e96685a9627a..5c22e0f962e32 100644 --- a/TAO/tao/DynamicAny/DynAnyUtils_T.cpp +++ b/TAO/tao/DynamicAny/DynAnyUtils_T.cpp @@ -26,7 +26,7 @@ #include "tao/DynamicAny/DynAnyFactory.h" -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -118,7 +118,7 @@ namespace TAO DA_IMPL (allow_truncation), CORBA::NO_MEMORY ()); - ACE_Auto_Basic_Ptr dp (p); + std::unique_ptr dp (p); try { p->init (any_tc); @@ -129,7 +129,6 @@ namespace TAO // of a previously found TAO_DynValue_i). The new BLANK one created // above on which we called init() will be deleted automatically by // the ACE_Auto_Basic_Ptr. - return original; } @@ -148,7 +147,7 @@ namespace TAO DA_IMPL (allow_truncation), CORBA::NO_MEMORY ()); - ACE_Auto_Basic_Ptr dp (p); + std::unique_ptr dp (p); try { p->init (tc, any_tc); @@ -159,7 +158,6 @@ namespace TAO // of a previously found TAO_DynValue_i). The new BLANK one created // above on which we called init() will be deleted automatically by // the ACE_Auto_Basic_Ptr. - return original; } diff --git a/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp b/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp index 18627baba14ad..3e1e90e2eee2b 100644 --- a/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp +++ b/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp @@ -15,7 +15,7 @@ #include "tao/debug.h" #include "tao/LF_Follower.h" #include "tao/Leader_Follower.h" -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -312,7 +312,7 @@ TAO_DTP_Thread_Pool::create_threads_i (size_t count) // Make sure the dynamically created stack size array is properly // deleted. - ACE_Auto_Basic_Array_Ptr auto_stack_size_array (stack_size_array); + std::unique_ptr auto_stack_size_array (stack_size_array); TAO_ORB_Core &orb_core = manager_.orb_core (); diff --git a/TAO/tao/IIOP_Acceptor.cpp b/TAO/tao/IIOP_Acceptor.cpp index 0362bb59c838f..43c336826098a 100644 --- a/TAO/tao/IIOP_Acceptor.cpp +++ b/TAO/tao/IIOP_Acceptor.cpp @@ -899,7 +899,7 @@ TAO_IIOP_Acceptor::probe_interfaces (TAO_ORB_Core *orb_core, int def_type) // The instantiation for this template is in // tao/IIOP_Connector.cpp. - ACE_Auto_Basic_Array_Ptr safe_if_addrs (if_addrs); + std::unique_ptr safe_if_addrs (if_addrs); #if defined (ACE_HAS_IPV6) bool ipv4_only = def_type == AF_INET; diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index aab4244dcd254..068759189d6c9 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -40,7 +40,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL /** * @class TAO_Event_Handler_Array_var * - * @brief Auto pointer like class for an array of Event Handlers. + * @brief Unique pointer like class for an array of Event Handlers. * * Used to manage lifecycle of handlers. This class calls * ACE_Event_Handler::remove_reference() on each handler in its destructor diff --git a/TAO/tao/IORManipulation/IORManipulation.cpp b/TAO/tao/IORManipulation/IORManipulation.cpp index e9122d13c5e58..d46abceb6a041 100644 --- a/TAO/tao/IORManipulation/IORManipulation.cpp +++ b/TAO/tao/IORManipulation/IORManipulation.cpp @@ -6,7 +6,7 @@ #include "tao/Stub.h" #include "tao/ORB_Core.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_NS_string.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Load_Protocol_Factory_T.h b/TAO/tao/Load_Protocol_Factory_T.h index 5928452f5d3d8..42475f085389f 100644 --- a/TAO/tao/Load_Protocol_Factory_T.h +++ b/TAO/tao/Load_Protocol_Factory_T.h @@ -18,7 +18,7 @@ #include "tao/Protocol_Factory.h" #include "tao/Resource_Factory.h" #include "tao/debug.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Dynamic_Service.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/LocateRequest_Invocation.cpp b/TAO/tao/LocateRequest_Invocation.cpp index 55fba32925560..cd3f4c0f5f9f9 100644 --- a/TAO/tao/LocateRequest_Invocation.cpp +++ b/TAO/tao/LocateRequest_Invocation.cpp @@ -21,7 +21,7 @@ namespace TAO /** * @class First_Request_Guard * - * @brief Auto pointer like class for first_request flag in transport. + * @brief Unique pointer like class for first_request flag in transport. * * Since codeset service context is only sent in the first request it might * happen that after LocateRequest (which doesn't include service context) diff --git a/TAO/tao/Messaging/ExceptionHolder_i.cpp b/TAO/tao/Messaging/ExceptionHolder_i.cpp index 12378b020b496..4fb71b15a0d3b 100644 --- a/TAO/tao/Messaging/ExceptionHolder_i.cpp +++ b/TAO/tao/Messaging/ExceptionHolder_i.cpp @@ -5,7 +5,7 @@ #include "tao/Exception_Data.h" #include "tao/CDR.h" -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -89,7 +89,7 @@ namespace TAO exception->completed (CORBA::CompletionStatus (completion)); // Raise the exception. - ACE_Auto_Basic_Ptr e_ptr(exception); + std::unique_ptr e_ptr(exception); exception->_raise (); return; @@ -115,7 +115,7 @@ namespace TAO } // Raise the exception. - ACE_Auto_Basic_Ptr e_ptr (exception); + std::unique_ptr e_ptr (exception); exception->_raise (); return; diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index a938793e1ee02..b607500dec2b3 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -52,7 +52,7 @@ #include "ace/Arg_Shifter.h" #include "ace/Argv_Type_Converter.h" #include "ace/Static_Object_Lock.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/CORBA_macros.h" #include "ace/Logging_Strategy.h" @@ -2089,8 +2089,7 @@ TAO_ORB_Core::create_object (TAO_Stub *stub) if (this->is_collocation_enabled (other_core, mprofile)) { other_core->_incr_refcnt(); - TAO_ORB_Core_Auto_Ptr tmp_auto_ptr (other_core); - collocated_orb_core = tmp_auto_ptr; + collocated_orb_core.reset(other_core); break; } } @@ -2154,12 +2153,10 @@ TAO_ORB_Core::initialize_object_i (TAO_Stub *stub, const TAO_MProfile &mprofile) { TAO_ORB_Core * const other_core = (*i).second.core (); - if (this->is_collocation_enabled (other_core, - mprofile)) + if (this->is_collocation_enabled (other_core, mprofile)) { other_core->_incr_refcnt (); - TAO_ORB_Core_Auto_Ptr tmp_auto_ptr (other_core); - collocated_orb_core = tmp_auto_ptr; + collocated_orb_core.reset(other_core); break; } } @@ -2757,7 +2754,7 @@ TAO_ORB_Core::resolve_ior_table_i () this->adapter_registry_.insert (iortable_adapter.get ()); - // It is now (exception) safe to release ownership from the auto pointers + // It is now (exception) safe to release ownership from the unique pointers this->ior_table_= tmp_root._retn (); iortable_adapter.release (); } @@ -2791,7 +2788,7 @@ TAO_ORB_Core::resolve_async_ior_table_i () this->adapter_registry_.insert (iortable_adapter.get ()); - // It is now (exception) safe to release ownership from the auto pointers + // It is now (exception) safe to release ownership from the unique pointers this->async_ior_table_= tmp_root._retn (); iortable_adapter.release (); } diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index 84f2af9e92595..f0b82382f7a80 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -157,7 +157,7 @@ namespace PortableInterceptor */ class TAO_Export TAO_ORB_Core { - friend class TAO_ORB_Core_Auto_Ptr; + friend class TAO_ORB_Core_Decr_Refcnt; friend TAO_Export CORBA::ORB_ptr CORBA::ORB_init (int &, ACE_TCHAR *argv[], const char *); @@ -1362,8 +1362,7 @@ class TAO_Export TAO_ORB_Core_Static_Resources : public ACE_Service_Object //private: /// Constructor. TAO_ORB_Core_Static_Resources (); - TAO_ORB_Core_Static_Resources& operator= - (const TAO_ORB_Core_Static_Resources&); + TAO_ORB_Core_Static_Resources& operator= (const TAO_ORB_Core_Static_Resources&); private: /// Mostly unused variable whose sole purpose is to enforce diff --git a/TAO/tao/ORB_Core_Auto_Ptr.cpp b/TAO/tao/ORB_Core_Auto_Ptr.cpp index e3904b7661e19..fff93b50909fd 100644 --- a/TAO/tao/ORB_Core_Auto_Ptr.cpp +++ b/TAO/tao/ORB_Core_Auto_Ptr.cpp @@ -2,29 +2,11 @@ #include "tao/ORB_Core_Auto_Ptr.h" #include "tao/ORB_Core.h" -#if !defined (__ACE_INLINE__) -# include "tao/ORB_Core_Auto_Ptr.inl" -#endif /* !__ACE_INLINE */ - TAO_BEGIN_VERSIONED_NAMESPACE_DECL -TAO_ORB_Core_Auto_Ptr::~TAO_ORB_Core_Auto_Ptr () +void TAO_ORB_Core_Decr_Refcnt::operator()(TAO_ORB_Core* core) const { - if (this->get () != nullptr) - { - this->get ()->_decr_refcnt (); - } -} - -void -TAO_ORB_Core_Auto_Ptr::reset (TAO_ORB_Core *p) -{ - if (this->get () != p && this->get () != nullptr) - { - this->get ()->_decr_refcnt (); - } - - this->p_ = p; + if (core) core->_decr_refcnt(); } TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/ORB_Core_Auto_Ptr.h b/TAO/tao/ORB_Core_Auto_Ptr.h index 0b7a3f6f6a330..dad591b2a0967 100644 --- a/TAO/tao/ORB_Core_Auto_Ptr.h +++ b/TAO/tao/ORB_Core_Auto_Ptr.h @@ -21,53 +21,27 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include /**/ "tao/Versioned_Namespace.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL class TAO_ORB_Core; /** - * @class TAO_ORB_Core_Auto_Ptr - * - * @brief Define a TAO_ORB_Core auto_ptr class. - * - * This class is used as an aid to make ORB initialization exception - * safe. It ensures that the ORB core is deallocated through its - * reference counting mechanism if an exception is thrown. + * Custom deleter to decrement the refcount when called */ -class TAO_Export TAO_ORB_Core_Auto_Ptr +struct TAO_Export TAO_ORB_Core_Decr_Refcnt { -public: - /** - * @name Initialization and termination methods - */ - //@{ - explicit TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core *p = 0); - TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core_Auto_Ptr &ap); - TAO_ORB_Core_Auto_Ptr &operator= (TAO_ORB_Core_Auto_Ptr &rhs); - ~TAO_ORB_Core_Auto_Ptr (); - //@} - - /** - * @name Accessor methods. - */ - //@{ - TAO_ORB_Core &operator *() const; - TAO_ORB_Core *get () const; - TAO_ORB_Core *release (); - void reset (TAO_ORB_Core *p = 0); - TAO_ORB_Core *operator-> () const; - //@} - -protected: - TAO_ORB_Core *p_; + void operator()(TAO_ORB_Core* core) const; }; -TAO_END_VERSIONED_NAMESPACE_DECL +/** + * TAO_ORB_Core_Auto_Ptr will decrement the refcount when going our of scope + * using std::unique_ptr and a custom deleter + */ +using TAO_ORB_Core_Auto_Ptr = std::unique_ptr; -#if defined (__ACE_INLINE__) -# include "tao/ORB_Core_Auto_Ptr.inl" -#endif /* __ACE_INLINE__ */ +TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" diff --git a/TAO/tao/ORB_Core_Auto_Ptr.inl b/TAO/tao/ORB_Core_Auto_Ptr.inl deleted file mode 100644 index 5381056e570fa..0000000000000 --- a/TAO/tao/ORB_Core_Auto_Ptr.inl +++ /dev/null @@ -1,56 +0,0 @@ -// -*- C++ -*- - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE -TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core *p) - : p_ (p) -{ -} - -ACE_INLINE TAO_ORB_Core * -TAO_ORB_Core_Auto_Ptr::get () const -{ - return this->p_; -} - -ACE_INLINE TAO_ORB_Core * -TAO_ORB_Core_Auto_Ptr::release () -{ - TAO_ORB_Core *old = this->p_; - this->p_ = 0; - return old; -} - -ACE_INLINE TAO_ORB_Core * -TAO_ORB_Core_Auto_Ptr::operator-> () const -{ - return this->get (); -} - -ACE_INLINE -TAO_ORB_Core_Auto_Ptr::TAO_ORB_Core_Auto_Ptr (TAO_ORB_Core_Auto_Ptr &rhs) - : p_ (rhs.release ()) -{ -} - -ACE_INLINE TAO_ORB_Core_Auto_Ptr & -TAO_ORB_Core_Auto_Ptr::operator= (TAO_ORB_Core_Auto_Ptr &rhs) -{ - if (this != &rhs) - { - this->reset (rhs.release ()); - } - return *this; -} - -// Accessor methods to the underlying ORB_Core Object - -ACE_INLINE TAO_ORB_Core & -TAO_ORB_Core_Auto_Ptr::operator *() const -{ - // @@ Potential problem if this->p_ is zero! - return *this->get (); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Active_Object_Map.cpp b/TAO/tao/PortableServer/Active_Object_Map.cpp index 1ddf7e457cd5a..29242635a7555 100644 --- a/TAO/tao/PortableServer/Active_Object_Map.cpp +++ b/TAO/tao/PortableServer/Active_Object_Map.cpp @@ -7,7 +7,7 @@ #include "tao/SystemException.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/CORBA_macros.h" #include "tao/debug.h" #include "PortableServer_Functions.h" @@ -115,7 +115,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( #endif } - // Give ownership to the auto pointer. + // Give ownership to the unique pointer. std::unique_ptr new_id_uniqueness_strategy (id_uniqueness_strategy); TAO_Lifespan_Strategy *lifespan_strategy = 0; @@ -139,7 +139,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( CORBA::NO_MEMORY ()); } - // Give ownership to the auto pointer. + // Give ownership to the unique pointer. std::unique_ptr new_lifespan_strategy (lifespan_strategy); TAO_Id_Assignment_Strategy *id_assignment_strategy = 0; @@ -174,7 +174,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( #endif } - // Give ownership to the auto pointer. + // Give ownership to the unique pointer. std::unique_ptr new_id_assignment_strategy (id_assignment_strategy); TAO_Id_Hint_Strategy *id_hint_strategy = 0; @@ -196,7 +196,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( CORBA::NO_MEMORY ()); } - // Give ownership to the auto pointer. + // Give ownership to the unique pointer. std::unique_ptr new_id_hint_strategy (id_hint_strategy); servant_map *sm = 0; @@ -230,7 +230,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( } } - // Give ownership to the auto pointer. + // Give ownership to the unique pointer. std::unique_ptr new_servant_map (sm); user_id_map *uim = 0; @@ -300,7 +300,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( } } - // Give ownership to the auto pointer. + // Give ownership to the unique pointer. std::unique_ptr new_user_id_map (uim); id_uniqueness_strategy->set_active_object_map (this); @@ -308,7 +308,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( id_assignment_strategy->set_active_object_map (this); // Finally everything is fine. Make sure to take ownership away - // from the auto pointer. + // from the unique pointer. 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); diff --git a/TAO/tao/PortableServer/Active_Object_Map.h b/TAO/tao/PortableServer/Active_Object_Map.h index d9c99565c45ba..7c9bdca71da86 100644 --- a/TAO/tao/PortableServer/Active_Object_Map.h +++ b/TAO/tao/PortableServer/Active_Object_Map.h @@ -23,7 +23,7 @@ #include "tao/PortableServer/Servant_Base.h" #include "tao/Server_Strategy_Factory.h" #include "ace/Map_T.h" -#include "ace/Auto_Ptr.h" +#include #if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1) #include "ace/Monitor_Size.h" diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp index 77a78f08282a9..5669bbd2065cd 100644 --- a/TAO/tao/PortableServer/Object_Adapter.cpp +++ b/TAO/tao/PortableServer/Object_Adapter.cpp @@ -13,7 +13,7 @@ #include "tao/PortableServer/Servant_Base.h" // -- ACE Include -- -#include "ace/Auto_Ptr.h" +#include #include "ace/Log_Msg.h" #include "ace/OS_NS_string.h" @@ -165,7 +165,7 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ ACE_NEW (hint_strategy, No_Hint_Strategy); - // Give ownership to the auto pointer. + // Give ownership to the unique pointer. std::unique_ptr new_hint_strategy (hint_strategy); new_hint_strategy->object_adapter (this); @@ -192,7 +192,7 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ persistent_poa_name_hash_map (creation_parameters.poa_map_size_)); break; } - // Give ownership to the auto pointer. + // Give ownership to the unique pointer. std::unique_ptr new_persistent_poa_name_map (ppnm); transient_poa_map *tpm = 0; @@ -222,7 +222,7 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ transient_poa_active_map (creation_parameters.poa_map_size_)); break; } - // Give ownership to the auto pointer. + // Give ownership to the unique pointer. std::unique_ptr new_transient_poa_map (tpm); this->hint_strategy_ = new_hint_strategy.release (); diff --git a/TAO/tao/PortableServer/Root_POA.cpp b/TAO/tao/PortableServer/Root_POA.cpp index f894825dd50ba..212fdb8e32b03 100644 --- a/TAO/tao/PortableServer/Root_POA.cpp +++ b/TAO/tao/PortableServer/Root_POA.cpp @@ -46,14 +46,12 @@ #include "tao/TSS_Resources.h" #include "tao/IORInterceptor_Adapter.h" #include "tao/debug.h" - -// auto_ptr class -#include "ace/Auto_Ptr.h" #include "ace/Dynamic_Service.h" #include "ace/OS_NS_netdb.h" #include "ace/OS_NS_string.h" #include "ace/OS_NS_unistd.h" #include "ace/Log_Msg.h" +#include #if !defined (__ACE_INLINE__) # include "tao/PortableServer/Root_POA.inl" @@ -2024,7 +2022,7 @@ TAO_Root_POA::key_to_stub_i (const TAO::ObjectKey &key, 0); } - // Give ownership to the auto pointer. + // Give ownership to the unique pointer. std::unique_ptr new_filter (filter); TAO_Stub *data = diff --git a/TAO/tao/RTCORBA/Thread_Pool.cpp b/TAO/tao/RTCORBA/Thread_Pool.cpp index a525540132074..72b409d0167e5 100644 --- a/TAO/tao/RTCORBA/Thread_Pool.cpp +++ b/TAO/tao/RTCORBA/Thread_Pool.cpp @@ -16,7 +16,7 @@ #include "tao/RTCORBA/Priority_Mapping_Manager.h" #include "tao/LF_Follower.h" #include "tao/Leader_Follower.h" -#include "ace/Auto_Ptr.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -451,7 +451,7 @@ TAO_Thread_Lane::create_threads_i (TAO_Thread_Pool_Threads &thread_pool, // Make sure the dynamically created stack size array is properly // deleted. - ACE_Auto_Basic_Array_Ptr auto_stack_size_array (stack_size_array); + std::unique_ptr auto_stack_size_array (stack_size_array); TAO_ORB_Core &orb_core = this->pool ().manager ().orb_core (); diff --git a/TAO/tao/RTPortableServer/RT_POA.cpp b/TAO/tao/RTPortableServer/RT_POA.cpp index 87830403e45d6..a15c7982a567c 100644 --- a/TAO/tao/RTPortableServer/RT_POA.cpp +++ b/TAO/tao/RTPortableServer/RT_POA.cpp @@ -22,7 +22,7 @@ #include "tao/PortableServer/Default_Acceptor_Filter.h" #include "tao/RTPortableServer/RT_Policy_Validator.h" -#include "ace/Auto_Ptr.h" +#include #if !defined (__ACE_INLINE__) # include "tao/RTPortableServer/RT_POA.inl" diff --git a/TAO/tao/Resource_Factory.h b/TAO/tao/Resource_Factory.h index afc7bf8d1ebc8..7e06b646e7df8 100644 --- a/TAO/tao/Resource_Factory.h +++ b/TAO/tao/Resource_Factory.h @@ -23,7 +23,7 @@ #include /**/ "tao/Versioned_Namespace.h" #include "tao/Basic_Types.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Service_Object.h" #include "ace/Unbounded_Set.h" #include "ace/SString.h" diff --git a/TAO/tao/Strategies/COIOP_Acceptor.cpp b/TAO/tao/Strategies/COIOP_Acceptor.cpp index a37e0b9f936dc..3e3be97e9c5cd 100644 --- a/TAO/tao/Strategies/COIOP_Acceptor.cpp +++ b/TAO/tao/Strategies/COIOP_Acceptor.cpp @@ -10,7 +10,7 @@ #include "tao/Codeset_Manager.h" #include "tao/CDR.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_NS_string.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Strategies/SCIOP_Acceptor.cpp b/TAO/tao/Strategies/SCIOP_Acceptor.cpp index b5ae1ccca8ad3..d4d4c68e908a0 100644 --- a/TAO/tao/Strategies/SCIOP_Acceptor.cpp +++ b/TAO/tao/Strategies/SCIOP_Acceptor.cpp @@ -238,7 +238,7 @@ TAO_SCIOP_Acceptor::open (TAO_ORB_Core *orb_core, ACE_Multihomed_INET_Addr addr; const char *port_separator_loc = std::strchr (address, ':'); - ACE_Auto_Basic_Array_Ptr tmp_host_auto; + std::unique_ptr tmp_host_auto; if (port_separator_loc == address) { @@ -329,7 +329,7 @@ TAO_SCIOP_Acceptor::open (TAO_ORB_Core *orb_core, { // Obtain a char* for the primary hostname. ACE_CString & primary_hostname_obj = hostnames[0]; - ACE_Auto_Basic_Array_Ptr primary_hostname_auto(primary_hostname_obj.rep()); + std::unique_ptr primary_hostname_auto(primary_hostname_obj.rep()); const char* primary_hostname = primary_hostname_auto.get(); // Convert the primary hostname to ACE_UINT32 @@ -342,7 +342,7 @@ TAO_SCIOP_Acceptor::open (TAO_ORB_Core *orb_core, // Allocate an array of secondary ip addresses. ACE_UINT32 *secondary_ip_addrs = 0; - ACE_Auto_Basic_Array_Ptr secondary_ip_addrs_auto; + std::unique_ptr secondary_ip_addrs_auto; size_t num_secondary_ip_addrs = hostnames.size() - 1; if (num_secondary_ip_addrs > 0) { ACE_NEW_RETURN(secondary_ip_addrs, @@ -357,7 +357,7 @@ TAO_SCIOP_Acceptor::open (TAO_ORB_Core *orb_core, while (i < num_secondary_ip_addrs) { // Obtain a char* for a single secondary hostname. ACE_CString & hostname_obj = hostnames[i + 1]; - ACE_Auto_Basic_Array_Ptr hostname_auto(hostname_obj.rep()); + std::unique_ptr hostname_auto(hostname_obj.rep()); const char* hostname = hostname_auto.get(); // Obtain the ip address for this secondary hostname. @@ -424,7 +424,7 @@ TAO_SCIOP_Acceptor::open (TAO_ORB_Core *orb_core, { // Obtain a char* for the hostname. ACE_CString & hostname_obj = hostnames[i]; - ACE_Auto_Basic_Array_Ptr hostname_auto(hostname_obj.rep()); + std::unique_ptr hostname_auto(hostname_obj.rep()); const char* hostname = hostname_auto.get(); if (this->hostname (orb_core, @@ -728,7 +728,7 @@ TAO_SCIOP_Acceptor::probe_interfaces (TAO_ORB_Core *orb_core) // The instantiation for this template is in // tao/SCIOP_Connector.cpp. - ACE_Auto_Basic_Array_Ptr safe_if_addrs (if_addrs); + std::unique_ptr safe_if_addrs (if_addrs); // If the loopback interface is the only interface then include it // in the list of interfaces to query for a hostname, otherwise @@ -806,7 +806,7 @@ TAO_SCIOP_Acceptor::parse_multiple_hostnames (const char *hostnames, ACE_NEW_RETURN (hostnames_copy, char[hostnames_string_length], -1); - ACE_Auto_Basic_Array_Ptr hostnames_copy_auto(hostnames_copy); + std::unique_ptr hostnames_copy_auto(hostnames_copy); ACE_OS::strncpy(hostnames_copy, hostnames, hostnames_string_length); // Count the number of hostnames separated by "+" diff --git a/TAO/tao/Strategies/advanced_resource.cpp b/TAO/tao/Strategies/advanced_resource.cpp index ba09fe8cc9378..ce24613ba06b9 100644 --- a/TAO/tao/Strategies/advanced_resource.cpp +++ b/TAO/tao/Strategies/advanced_resource.cpp @@ -33,7 +33,7 @@ #include "ace/Local_Memory_Pool.h" #include "ace/Null_Mutex.h" #include "ace/OS_NS_strings.h" -#include "ace/Auto_Ptr.h" +#include #if !defined (TAO_DEFAULT_REACTOR_TYPE) #define TAO_DEFAULT_REACTOR_TYPE TAO_REACTOR_TP diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp index 4517c74742820..c66e874e6138b 100644 --- a/TAO/tao/Stub.cpp +++ b/TAO/tao/Stub.cpp @@ -22,7 +22,7 @@ # include "tao/Stub.inl" #endif /* ! __ACE_INLINE__ */ -#include "ace/Auto_Ptr.h" +#include #include "ace/CORBA_macros.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Stub.h b/TAO/tao/Stub.h index 153a3d8207d0c..a44c33af78e80 100644 --- a/TAO/tao/Stub.h +++ b/TAO/tao/Stub.h @@ -313,7 +313,6 @@ class TAO_Export TAO_Stub * * This must be the first field of the class, otherwise the * TAO_ORB_Core is destroyed too early! - * */ TAO_ORB_Core_Auto_Ptr orb_core_; @@ -405,32 +404,20 @@ class TAO_Export TAO_Stub std::atomic forwarded_on_exception_; }; -// Define a TAO_Stub auto_ptr class. /** - * @class TAO_Stub_Auto_Ptr - * - * @brief Implements the draft C++ standard auto_ptr abstraction. - * This class allows one to work Stub Objects *Only*! + * Custom deleter to decrement the refcount when called */ -class TAO_Export TAO_Stub_Auto_Ptr +struct TAO_Export TAO_Stub_Decr_Refcnt { -public: - explicit TAO_Stub_Auto_Ptr (TAO_Stub *p = nullptr); - TAO_Stub_Auto_Ptr (TAO_Stub_Auto_Ptr &ap); - TAO_Stub_Auto_Ptr &operator= (TAO_Stub_Auto_Ptr &rhs); - ~TAO_Stub_Auto_Ptr (); - - // = Accessor methods. - TAO_Stub &operator *() const; - TAO_Stub *get () const; - TAO_Stub *release (); - void reset (TAO_Stub *p = 0); - TAO_Stub *operator-> () const; - -protected: - TAO_Stub *p_; + void operator()(TAO_Stub* stub) const { if (stub) stub->_decr_refcnt(); } }; +/** + * TAO_Stub_Auto_Ptr will decrement the refcount when going our of scope + * using std::unique_ptr and a custom deleter + */ +using TAO_Stub_Auto_Ptr = std::unique_ptr; + TAO_END_VERSIONED_NAMESPACE_DECL #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Stub.inl b/TAO/tao/Stub.inl index 30c4653160bed..02dc6e925830f 100644 --- a/TAO/tao/Stub.inl +++ b/TAO/tao/Stub.inl @@ -418,81 +418,4 @@ TAO_Stub::at_starting_profile () const return profile_in_use_ == base_profiles_.get_profile(0); } -// --------------------------------------------------------------- - -// Creator methods for TAO_Stub_Auto_Ptr (TAO_Stub Auto Pointer) -ACE_INLINE -TAO_Stub_Auto_Ptr::TAO_Stub_Auto_Ptr (TAO_Stub *p) - : p_ (p) -{ - ACE_TRACE ("TAO_Stub_Auto_Ptr::TAO_Stub_Auto_Ptr"); -} - -ACE_INLINE TAO_Stub * -TAO_Stub_Auto_Ptr::get () const -{ - ACE_TRACE ("TAO_Stub_Auto_Ptr::get"); - return this->p_; -} - -ACE_INLINE TAO_Stub * -TAO_Stub_Auto_Ptr::release () -{ - ACE_TRACE ("TAO_Stub_Auto_Ptr::release"); - TAO_Stub *old = this->p_; - this->p_ = nullptr; - return old; -} - -ACE_INLINE void -TAO_Stub_Auto_Ptr::reset (TAO_Stub *p) -{ - ACE_TRACE ("TAO_Stub_Auto_Ptr::reset"); - if (this->get () != p && this->get () != nullptr) - this->get ()->_decr_refcnt (); - this->p_ = p; -} - -ACE_INLINE TAO_Stub * -TAO_Stub_Auto_Ptr::operator-> () const -{ - ACE_TRACE ("TAO_Stub_Auto_Ptr::operator->"); - return this->get (); -} - -ACE_INLINE -TAO_Stub_Auto_Ptr::TAO_Stub_Auto_Ptr (TAO_Stub_Auto_Ptr &rhs) - : p_ (rhs.release ()) -{ - ACE_TRACE ("TAO_Stub_Auto_Ptr::TAO_Stub_Auto_Ptr"); -} - -ACE_INLINE TAO_Stub_Auto_Ptr & -TAO_Stub_Auto_Ptr::operator= (TAO_Stub_Auto_Ptr &rhs) -{ - ACE_TRACE ("TAO_Stub_Auto_Ptr::operator="); - if (this != &rhs) - { - this->reset (rhs.release ()); - } - return *this; -} - -ACE_INLINE -TAO_Stub_Auto_Ptr::~TAO_Stub_Auto_Ptr () -{ - ACE_TRACE ("TAO_Stub_Auto_Ptr::~TAO_Stub_Auto_Ptr"); - if (this->get() != nullptr) - this->get ()->_decr_refcnt (); -} - -// Accessor methods to the underlying Stub Object -ACE_INLINE TAO_Stub & -TAO_Stub_Auto_Ptr::operator *() const -{ - ACE_TRACE ("TAO_Stub_Auto_Ptr::operator *()"); - // @@ Potential problem if this->p_ is zero! - return *this->get (); -} - TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Synch_Invocation.cpp b/TAO/tao/Synch_Invocation.cpp index 1d838b888889d..9fe06b5a013fd 100644 --- a/TAO/tao/Synch_Invocation.cpp +++ b/TAO/tao/Synch_Invocation.cpp @@ -20,7 +20,7 @@ # include "tao/PortableInterceptorC.h" #endif /*TAO_HAS_INTERCEPTORS */ -#include "ace/Auto_Ptr.h" +#include #include "ace/OS_NS_string.h" #include "tao/ORB_Time_Policy.h" diff --git a/TAO/tao/ZIOP/ZIOP_Service_Context_Handler.cpp b/TAO/tao/ZIOP/ZIOP_Service_Context_Handler.cpp index 03295ed6c2f10..5caee7f27e078 100644 --- a/TAO/tao/ZIOP/ZIOP_Service_Context_Handler.cpp +++ b/TAO/tao/ZIOP/ZIOP_Service_Context_Handler.cpp @@ -58,7 +58,7 @@ TAO_ZIOP_Service_Context_Handler::process_service_context ( { TAO::CompressionEnablingPolicy *enabled= 0; ACE_NEW_RETURN (enabled, TAO::CompressionEnablingPolicy (), 0); - ACE_Auto_Basic_Ptr guard (enabled); + std::unique_ptr guard (enabled); if (enabled->_tao_decode (policy_cdr)) { req->clientCompressionEnablingPolicy (guard.release ()); @@ -70,7 +70,7 @@ TAO_ZIOP_Service_Context_Handler::process_service_context ( { TAO::CompressorIdLevelListPolicy *id_list= 0; ACE_NEW_RETURN (id_list, TAO::CompressorIdLevelListPolicy (), 0); - ACE_Auto_Basic_Ptr guard (id_list); + std::unique_ptr guard (id_list); if (id_list->_tao_decode (policy_cdr)) { req->clientCompressorIdLevelListPolicy (guard.release ()); diff --git a/TAO/tests/Bug_2084_Regression/EventNode.cpp b/TAO/tests/Bug_2084_Regression/EventNode.cpp index a5f2ad5b655ab..72bdd5623a407 100644 --- a/TAO/tests/Bug_2084_Regression/EventNode.cpp +++ b/TAO/tests/Bug_2084_Regression/EventNode.cpp @@ -32,7 +32,7 @@ void EventNode::registerHello (::Test::Hello_ptr h) TAO::ORB_Table::instance (); TAO_ORB_Core_Auto_Ptr tmp (orb_table->find ("server_orb")); - if (tmp.get () == 0) + if (tmp.get () == nullptr) { // We are running on a single ORB and this is an error. ACE_ERROR ((LM_ERROR, diff --git a/TAO/tests/Bug_2084_Regression/Hello.cpp b/TAO/tests/Bug_2084_Regression/Hello.cpp index 4a7e3042fb95d..af049b27ecc03 100644 --- a/TAO/tests/Bug_2084_Regression/Hello.cpp +++ b/TAO/tests/Bug_2084_Regression/Hello.cpp @@ -34,7 +34,7 @@ Hello::get_string (::Test::ThreadId caller_threadid) TAO::ORB_Table::instance (); TAO_ORB_Core_Auto_Ptr tmp (orb_table->find ("server_orb")); - if (tmp.get () == 0) + if (tmp.get () == nullptr) { // We are running on a single ORB and this is an error. ACE_ERROR ((LM_ERROR, diff --git a/TAO/tests/Bug_3524_Regression/test_i.cpp b/TAO/tests/Bug_3524_Regression/test_i.cpp index 30fd7e9185f3e..efff623384fea 100644 --- a/TAO/tests/Bug_3524_Regression/test_i.cpp +++ b/TAO/tests/Bug_3524_Regression/test_i.cpp @@ -1,6 +1,6 @@ // -*- C++ -*- #include "test_i.h" -#include "ace/Auto_Ptr.h" +#include A_i::A_i (CORBA::ORB_ptr orb, CORBA::ValueFactoryBase *vtp_factory) @@ -149,7 +149,7 @@ A_i::arr_method (::Test::A::FailOn where, ::Test::arr_bd_str_slice *res = ::Test::arr_bd_str_alloc (); - ACE_Auto_Ptr< ::Test::arr_bd_str_slice> safe (res); + std::unique_ptr< ::Test::arr_bd_str_slice> safe (res); switch (where) { @@ -184,7 +184,7 @@ A_i::arr_method_s (::Test::A::FailOn where, ::Test::arr_bds_str_slice *res = ::Test::arr_bds_str_alloc (); - ACE_Auto_Ptr< ::Test::arr_bds_str_slice > safe (res); + std::unique_ptr< ::Test::arr_bds_str_slice > safe (res); switch (where) { diff --git a/TAO/tests/COIOP/Hello.cpp b/TAO/tests/COIOP/Hello.cpp index baa9705bec308..4eb6a02aa41d0 100644 --- a/TAO/tests/COIOP/Hello.cpp +++ b/TAO/tests/COIOP/Hello.cpp @@ -40,7 +40,7 @@ Hello::get_string () TAO::ORB_Table::instance (); TAO_ORB_Core_Auto_Ptr tmp (orb_table->find ("server_orb")); - if (tmp.get () == 0) + if (tmp.get () == nullptr) { // We are running on a single ORB and this is an error. ACE_ERROR ((LM_ERROR, diff --git a/TAO/tests/Collocated_Best/Collocated_Best_Direct/Hello.cpp b/TAO/tests/Collocated_Best/Collocated_Best_Direct/Hello.cpp index 5e21009c3e4f9..33e94c85f01b5 100644 --- a/TAO/tests/Collocated_Best/Collocated_Best_Direct/Hello.cpp +++ b/TAO/tests/Collocated_Best/Collocated_Best_Direct/Hello.cpp @@ -41,7 +41,7 @@ Hello::get_string () TAO::ORB_Table::instance (); TAO_ORB_Core_Auto_Ptr tmp (orb_table->find ("server_orb")); - if (tmp.get () == 0) + if (tmp.get () == nullptr) { // We are running on a single ORB and this is an error. ACE_ERROR ((LM_ERROR, diff --git a/TAO/tests/Collocated_Best/Collocated_Best_NoColl/Hello.cpp b/TAO/tests/Collocated_Best/Collocated_Best_NoColl/Hello.cpp index c6cfa8478f05a..d516f1a298452 100644 --- a/TAO/tests/Collocated_Best/Collocated_Best_NoColl/Hello.cpp +++ b/TAO/tests/Collocated_Best/Collocated_Best_NoColl/Hello.cpp @@ -39,7 +39,7 @@ Hello::get_string () TAO::ORB_Table::instance (); TAO_ORB_Core_Auto_Ptr tmp (orb_table->find ("server_orb")); - if (tmp.get () == 0) + if (tmp.get () == nullptr) { // We are running on a single ORB and this is an error. ACE_ERROR ((LM_ERROR, diff --git a/TAO/tests/Collocated_Best/Collocated_Best_ThuP/Hello.cpp b/TAO/tests/Collocated_Best/Collocated_Best_ThuP/Hello.cpp index 57283fe299599..7c37d42b72eeb 100644 --- a/TAO/tests/Collocated_Best/Collocated_Best_ThuP/Hello.cpp +++ b/TAO/tests/Collocated_Best/Collocated_Best_ThuP/Hello.cpp @@ -39,7 +39,7 @@ Hello::get_string () TAO::ORB_Table::instance (); TAO_ORB_Core_Auto_Ptr tmp (orb_table->find ("server_orb")); - if (tmp.get () == 0) + if (tmp.get () == nullptr) { // We are running on a single ORB and this is an error. ACE_ERROR ((LM_ERROR, diff --git a/TAO/tests/Collocated_NoColl/Hello.cpp b/TAO/tests/Collocated_NoColl/Hello.cpp index c6cfa8478f05a..d516f1a298452 100644 --- a/TAO/tests/Collocated_NoColl/Hello.cpp +++ b/TAO/tests/Collocated_NoColl/Hello.cpp @@ -39,7 +39,7 @@ Hello::get_string () TAO::ORB_Table::instance (); TAO_ORB_Core_Auto_Ptr tmp (orb_table->find ("server_orb")); - if (tmp.get () == 0) + if (tmp.get () == nullptr) { // We are running on a single ORB and this is an error. ACE_ERROR ((LM_ERROR, diff --git a/TAO/tests/Collocation_Exception_Test/Hello.cpp b/TAO/tests/Collocation_Exception_Test/Hello.cpp index c9db9959f605c..d4816a90d7405 100644 --- a/TAO/tests/Collocation_Exception_Test/Hello.cpp +++ b/TAO/tests/Collocation_Exception_Test/Hello.cpp @@ -62,7 +62,7 @@ Hello::get_string () TAO::ORB_Table::instance (); TAO_ORB_Core_Auto_Ptr tmp (orb_table->find ("server_orb")); - if (tmp.get () == 0) + if (tmp.get () == nullptr) { // We are running on a single ORB and this is an error. ACE_ERROR ((LM_ERROR, diff --git a/TAO/tests/Collocation_Oneway_Tests/Hello.cpp b/TAO/tests/Collocation_Oneway_Tests/Hello.cpp index c40645c4deecd..e417c60447398 100644 --- a/TAO/tests/Collocation_Oneway_Tests/Hello.cpp +++ b/TAO/tests/Collocation_Oneway_Tests/Hello.cpp @@ -46,7 +46,7 @@ Hello::get_string () TAO::ORB_Table::instance (); TAO_ORB_Core_Auto_Ptr tmp (orb_table->find ("server_orb")); - if (tmp.get () == 0) + if (tmp.get () == nullptr) { // We are running on a single ORB and this is an error. ACE_ERROR ((LM_ERROR, diff --git a/TAO/tests/Collocation_Tests/Hello.cpp b/TAO/tests/Collocation_Tests/Hello.cpp index 93b8163225874..0953b9e67228b 100644 --- a/TAO/tests/Collocation_Tests/Hello.cpp +++ b/TAO/tests/Collocation_Tests/Hello.cpp @@ -38,7 +38,7 @@ Hello::get_string () TAO::ORB_Table::instance (); TAO_ORB_Core_Auto_Ptr tmp (orb_table->find ("server_orb")); - if (tmp.get () == 0) + if (tmp.get () == nullptr) { // We are running on a single ORB and this is an error. ACE_ERROR ((LM_ERROR, diff --git a/TAO/tests/DII_Collocation_Tests/oneway/Hello.cpp b/TAO/tests/DII_Collocation_Tests/oneway/Hello.cpp index 4d4d797c70f0b..3fba674730e78 100644 --- a/TAO/tests/DII_Collocation_Tests/oneway/Hello.cpp +++ b/TAO/tests/DII_Collocation_Tests/oneway/Hello.cpp @@ -292,7 +292,7 @@ Hello::get_string () TAO::ORB_Table::instance (); TAO_ORB_Core_Auto_Ptr tmp (orb_table->find ("server_orb")); - if (tmp.get () == 0) + if (tmp.get () == nullptr) { // We are running on a single ORB and this is an error. ACE_ERROR ((LM_ERROR, diff --git a/TAO/tests/DII_Collocation_Tests/twoway/Hello.cpp b/TAO/tests/DII_Collocation_Tests/twoway/Hello.cpp index 9f8445cd6b707..2d9afbb205a5a 100644 --- a/TAO/tests/DII_Collocation_Tests/twoway/Hello.cpp +++ b/TAO/tests/DII_Collocation_Tests/twoway/Hello.cpp @@ -309,7 +309,7 @@ Hello::get_string () TAO::ORB_Table::instance (); TAO_ORB_Core_Auto_Ptr tmp (orb_table->find ("server_orb")); - if (tmp.get () == 0) + if (tmp.get () == nullptr) { // We are running on a single ORB and this is an error. ACE_ERROR ((LM_ERROR, diff --git a/TAO/tests/IOR_Endpoint_Hostnames/list_interfaces.cpp b/TAO/tests/IOR_Endpoint_Hostnames/list_interfaces.cpp index f906c35dec6dc..d8678f70aca5c 100644 --- a/TAO/tests/IOR_Endpoint_Hostnames/list_interfaces.cpp +++ b/TAO/tests/IOR_Endpoint_Hostnames/list_interfaces.cpp @@ -7,7 +7,7 @@ #include "tao/corba.h" #include "ace/ACE.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/INET_Addr.h" #include "ace/Log_Msg.h" #include "ace/OS_NS_stdio.h" @@ -89,7 +89,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) } #endif /* ACE_HAS_IPV6 */ - ACE_Auto_Basic_Array_Ptr safe_if_addrs (if_addrs); + std::unique_ptr safe_if_addrs (if_addrs); #if defined (ACE_HAS_IPV6) bool ipv4_only = def_type == AF_INET; diff --git a/TAO/tests/ORB_Local_Config/Two_DLL_ORB/ORB_DLL.cpp b/TAO/tests/ORB_Local_Config/Two_DLL_ORB/ORB_DLL.cpp index b8aea2d755265..fd1da26caebb9 100644 --- a/TAO/tests/ORB_Local_Config/Two_DLL_ORB/ORB_DLL.cpp +++ b/TAO/tests/ORB_Local_Config/Two_DLL_ORB/ORB_DLL.cpp @@ -20,8 +20,8 @@ Abstract_Worker::~Abstract_Worker () // Service_Config_ORB_DLL::Service_Config_ORB_DLL () : is_server_ (-1) - , worker_ (0) - , argv_ (0) + , worker_ (nullptr) + , argv_ (nullptr) { } diff --git a/TAO/tests/ORB_Local_Config/Two_DLL_ORB/ORB_DLL.h b/TAO/tests/ORB_Local_Config/Two_DLL_ORB/ORB_DLL.h index 1977726f11816..d7d3877060273 100644 --- a/TAO/tests/ORB_Local_Config/Two_DLL_ORB/ORB_DLL.h +++ b/TAO/tests/ORB_Local_Config/Two_DLL_ORB/ORB_DLL.h @@ -19,7 +19,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Auto_Ptr.h" +#include #include "ace/Task.h" #include "ace/ARGV.h" #include "ace/String_Base.h" @@ -94,8 +94,8 @@ class Service_Config_ORB_DLL_Export Service_Config_ORB_DLL private: signed char is_server_; - ACE_Auto_Ptr worker_; - ACE_Auto_Ptr argv_; + std::unique_ptr worker_; + std::unique_ptr argv_; }; ACE_FACTORY_DECLARE (Service_Config_ORB_DLL, Service_Config_ORB_DLL) diff --git a/TAO/tests/Oneway_Send_Timeouts/Client.cpp b/TAO/tests/Oneway_Send_Timeouts/Client.cpp index 47e8bdf21fee7..c238630423db7 100644 --- a/TAO/tests/Oneway_Send_Timeouts/Client.cpp +++ b/TAO/tests/Oneway_Send_Timeouts/Client.cpp @@ -1,7 +1,7 @@ #include "tao/Messaging/Messaging.h" #include "tao/AnyTypeCode/Any.h" -#include "ace/Auto_Ptr.h" +#include #include "ace/Get_Opt.h" #include "ace/Time_Value.h" #include "ace/OS_NS_unistd.h" @@ -241,7 +241,7 @@ Client::test_oneway_timeout (bool flood) { bool status = true; - ACE_Auto_Array_Ptr tmp (new char [6000000]); + std::unique_ptr tmp (new char [6000000]); char* msg = tmp.get(); ACE_OS::memset (msg,'A',5999999); @@ -513,7 +513,7 @@ Client::flood_connection (ACE_Time_Value& tv) policy_list[0]->destroy (); policy_list.length(0); - ACE_Auto_Array_Ptr tmp (new char [2000000]); + std::unique_ptr tmp (new char [2000000]); char* msg = tmp.get(); ACE_OS::memset (msg,'A',1999999); diff --git a/TAO/tests/Storable/Savable.cpp b/TAO/tests/Storable/Savable.cpp index ee4667f0fb833..26b870ba68bba 100644 --- a/TAO/tests/Storable/Savable.cpp +++ b/TAO/tests/Storable/Savable.cpp @@ -3,7 +3,7 @@ #include "tao/Storable_Factory.h" #include "tao/Storable_File_Guard.h" -#include "ace/Auto_Ptr.h" +#include const int Savable::bytes_size_max = 128; @@ -102,7 +102,7 @@ Savable::Savable (TAO::Storable_Factory & storable_factory) } } - ACE_Auto_Ptr stream (storable_factory_.create_stream("test.dat", "r")); + std::unique_ptr stream (storable_factory_.create_stream("test.dat", "r")); if (stream->exists ()) { Savable_File_Guard fg(*this, SFG::CREATE_WITH_FILE);