diff options
author | ClausKlein <claus.klein@arcormail.de> | 2021-06-01 18:08:54 +0200 |
---|---|---|
committer | ClausKlein <claus.klein@arcormail.de> | 2021-06-01 18:08:54 +0200 |
commit | e4d9890748bc415246bd42696b19b5dc136496ae (patch) | |
tree | 53764f32350629886ef8929d1fc4b7d630ecbe4c /TAO | |
parent | 1e88ae8645e3c1cb4b42882760419dc1f8ea34df (diff) | |
download | ATCD-e4d9890748bc415246bd42696b19b5dc136496ae.tar.gz |
use std::unique_ptr instead of std::auto_ptr
prevent include of ace/Auto_Ptr.h for TAO at least
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.cpp | 5 | ||||
-rw-r--r-- | TAO/tests/Bug_3251_Regression/DllOrb.h | 4 | ||||
-rw-r--r-- | TAO/tests/Bug_3542_Regression/DllOrb.h | 4 | ||||
-rw-r--r-- | TAO/tests/Compression/RLECompressorTest.cpp | 5 | ||||
-rw-r--r-- | TAO/tests/Oneway_Send_Timeouts/Server.h | 4 | ||||
-rw-r--r-- | TAO/tests/Oneway_Send_Timeouts/Server_Task.h | 7 | ||||
-rw-r--r-- | TAO/tests/Oneway_Send_Timeouts/main.cpp | 13 |
7 files changed, 22 insertions, 20 deletions
diff --git a/TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.cpp b/TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.cpp index 43b7c26e659..b3139b404ba 100644 --- a/TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.cpp +++ b/TAO/orbsvcs/Fault_Detector/FT_FaultDetectorFactory_i.cpp @@ -13,10 +13,11 @@ #include "Fault_Detector_i.h" #include "ace/Get_Opt.h" #include "ace/OS_NS_unistd.h" -#include "ace/Auto_Ptr.h" #include "orbsvcs/CosNamingC.h" #include "orbsvcs/PortableGroup/PG_Property_Set.h" +#include <memory> + // Use this macro at the beginning of CORBA methods // to aid in debugging. #define METHOD_ENTRY(name) \ @@ -601,7 +602,7 @@ CORBA::Object_ptr TAO::FT_FaultDetectorFactory_i::create_object ( )); throw PortableGroup::ObjectNotCreated(); } - auto_ptr<TAO::Fault_Detector_i> detector(pFD); + std::unique_ptr<TAO::Fault_Detector_i> detector(pFD); ACE_NEW_NORETURN ( factory_creation_id, PortableGroup::GenericFactory::FactoryCreationId); diff --git a/TAO/tests/Bug_3251_Regression/DllOrb.h b/TAO/tests/Bug_3251_Regression/DllOrb.h index 24dae5c923e..084f78a12ea 100644 --- a/TAO/tests/Bug_3251_Regression/DllOrb.h +++ b/TAO/tests/Bug_3251_Regression/DllOrb.h @@ -1,7 +1,6 @@ #ifndef bug_3251_DllORB_h #define bug_3251_DllORB_h -#include "ace/Auto_Ptr.h" #include "ace/Barrier.h" #include "ace/Task.h" #include "tao/ORB.h" @@ -9,6 +8,7 @@ #include "tao/PortableServer/PortableServer.h" #include "bug_3251_export.h" +#include <memory> class bug_3251_Export DllOrb: public ACE_Task_Base { @@ -25,7 +25,7 @@ public: virtual int svc (); private: - auto_ptr < ACE_Thread_Barrier > ma_barrier_; + std::unique_ptr < ACE_Thread_Barrier > ma_barrier_; CORBA::ORB_var mv_orb_; PortableServer::POA_var mv_rootPOA_; PortableServer::POAManager_var mv_poaManager_; diff --git a/TAO/tests/Bug_3542_Regression/DllOrb.h b/TAO/tests/Bug_3542_Regression/DllOrb.h index 5e320d6f9e9..d953ee0b039 100644 --- a/TAO/tests/Bug_3542_Regression/DllOrb.h +++ b/TAO/tests/Bug_3542_Regression/DllOrb.h @@ -1,7 +1,6 @@ #ifndef bug_3542_DllORB_h #define bug_3542_DllORB_h -#include "ace/Auto_Ptr.h" #include "ace/Barrier.h" #include "ace/Task.h" #include "tao/ORB.h" @@ -9,6 +8,7 @@ #include "tao/PortableServer/PortableServer.h" #include "bug_3542_export.h" +#include <memory> class bug_3542_Export DllOrb: public ACE_Task_Base { @@ -25,7 +25,7 @@ public: virtual int svc (); private: - auto_ptr < ACE_Thread_Barrier > ma_barrier_; + std::unique_ptr < ACE_Thread_Barrier > ma_barrier_; CORBA::ORB_var mv_orb_; PortableServer::POA_var mv_rootPOA_; PortableServer::POAManager_var mv_poaManager_; diff --git a/TAO/tests/Compression/RLECompressorTest.cpp b/TAO/tests/Compression/RLECompressorTest.cpp index 930106809cb..b25d6623c49 100644 --- a/TAO/tests/Compression/RLECompressorTest.cpp +++ b/TAO/tests/Compression/RLECompressorTest.cpp @@ -9,10 +9,9 @@ #include <memory> -// Older versions of GCC do not support std::unique_ptr! -struct ACE_Byte_Array_ptr : std::auto_ptr<ACE_Byte> { +struct ACE_Byte_Array_ptr : std::unique_ptr<ACE_Byte> { explicit ACE_Byte_Array_ptr(ACE_Byte *_Ptr = 0) - : std::auto_ptr<ACE_Byte>(_Ptr) {} + : std::unique_ptr<ACE_Byte>(_Ptr) {} ~ACE_Byte_Array_ptr(void) { delete [] (this->release()); } diff --git a/TAO/tests/Oneway_Send_Timeouts/Server.h b/TAO/tests/Oneway_Send_Timeouts/Server.h index 09d98a408d7..968378e09db 100644 --- a/TAO/tests/Oneway_Send_Timeouts/Server.h +++ b/TAO/tests/Oneway_Send_Timeouts/Server.h @@ -9,7 +9,7 @@ #include "tao/PortableServer/POAC.h" #include "tao/PortableServer/POAManagerC.h" -#include <string> +#include <memory> class Server { @@ -29,7 +29,7 @@ class Server CORBA::ORB_var management_orb_; bool shutdown_; TAO_SYNCH_MUTEX mutex_; - std::auto_ptr<Test_i> test_i_; + std::unique_ptr<Test_i> test_i_; }; #endif //_SERVER_ diff --git a/TAO/tests/Oneway_Send_Timeouts/Server_Task.h b/TAO/tests/Oneway_Send_Timeouts/Server_Task.h index 08862f30111..3eb0b9c1f9d 100644 --- a/TAO/tests/Oneway_Send_Timeouts/Server_Task.h +++ b/TAO/tests/Oneway_Send_Timeouts/Server_Task.h @@ -5,7 +5,8 @@ #include "ace/Task.h" #include "ace/ARGV.h" -#include "ace/Auto_Ptr.h" + +#include <string> class Server_Task : public ACE_Task_Base { @@ -28,7 +29,7 @@ class Server_Task : public ACE_Task_Base ACE_ARGV my_args (args_.c_str()); // Initialize Server ORB in new thread - ACE_auto_ptr_reset (server_, new Server (my_args.argc(), my_args.argv())); + server_ = std::make_unique<Server>(my_args.argc(), my_args.argv()); ACE_ASSERT (server_.get() != 0); initializer = true; } @@ -63,7 +64,7 @@ class Server_Task : public ACE_Task_Base private: std::string args_; - std::auto_ptr<Server> server_; + std::unique_ptr<Server> server_; TAO_SYNCH_MUTEX mutex_; }; diff --git a/TAO/tests/Oneway_Send_Timeouts/main.cpp b/TAO/tests/Oneway_Send_Timeouts/main.cpp index c1153ecbbf8..fc91a97eaab 100644 --- a/TAO/tests/Oneway_Send_Timeouts/main.cpp +++ b/TAO/tests/Oneway_Send_Timeouts/main.cpp @@ -5,7 +5,8 @@ #include "ace/OS_NS_string.h" #include "ace/OS_NS_strings.h" #include "ace/High_Res_Timer.h" -#include "ace/Auto_Ptr.h" + +#include <memory> class MyMain { @@ -20,8 +21,8 @@ private: bool init_server (const ACE_TCHAR* args); bool init_client (const ACE_TCHAR* args); - std::auto_ptr<Server_Task> server_task_; - std::auto_ptr<Client_Task> client_task_; + std::unique_ptr<Server_Task> server_task_; + std::unique_ptr<Client_Task> client_task_; bool s_init_; bool shutdown_; @@ -39,7 +40,7 @@ MyMain::init_server (const ACE_TCHAR* args) // main thread and extra thread for backdoor operations int thread_pool = 2; - ACE_auto_ptr_reset (server_task_, new Server_Task (my_args)); + server_ = std::make_unique<Server>(my_args); ACE_ASSERT (server_task_.get() != 0); server_task_->activate (THR_NEW_LWP | THR_JOINABLE |THR_INHERIT_SCHED @@ -62,7 +63,7 @@ MyMain::init_server (const ACE_TCHAR* args) if (!server_task_->ready()) { server_task_->force_shutdown (); server_task_->wait (); - ACE_auto_ptr_reset (server_task_, (Server_Task*)0); + server_task_.reset(); return false; } @@ -75,7 +76,7 @@ MyMain::init_client (const ACE_TCHAR* args) std::string my_args (ACE_TEXT_ALWAYS_CHAR(args)); int thread_pool = 1; - ACE_auto_ptr_reset (client_task_, new Client_Task (my_args)); + client_task_ = std::make_unique<Client_Task>(my_args); ACE_ASSERT (client_task_.get() != 0); client_task_->activate (THR_NEW_LWP | THR_JOINABLE |THR_INHERIT_SCHED |