diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2018-05-15 16:24:30 +0200 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2018-05-15 16:24:30 +0200 |
commit | 330d868ab419f28e24dfe1b9d29500eafac66b7e (patch) | |
tree | f71580fd55c7e6a43e89d0ae168414d1d02ccbaf | |
parent | c4a7434d85ec752a5939bfafc35384534fc4705d (diff) | |
download | ATCD-330d868ab419f28e24dfe1b9d29500eafac66b7e.tar.gz |
Use std::unique_ptr when usign C++11
* TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp:
* TAO/tao/PortableServer/Object_Adapter.cpp:
* TAO/tao/PortableServer/Root_POA.cpp:
* TAO/tao/PortableServer/ServantRetentionStrategyRetain.h:
-rw-r--r-- | TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/PortableServer/Object_Adapter.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/PortableServer/Root_POA.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/PortableServer/ServantRetentionStrategyRetain.h | 4 |
4 files changed, 20 insertions, 0 deletions
diff --git a/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp b/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp index 78c4ef2b411..a51873958c1 100644 --- a/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp +++ b/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp @@ -519,7 +519,11 @@ CORBA::ULong TAO_DTP_Thread_Pool_Manager::create_threadpool_helper (TAO_DTP_Thread_Pool *thread_pool) { // Make sure of safe deletion in case of errors. +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO_DTP_Thread_Pool> safe_thread_pool (thread_pool); +#else auto_ptr<TAO_DTP_Thread_Pool> safe_thread_pool (thread_pool); +#endif /* ACE_HAS_CPP11 */ // Open the pool. thread_pool->open (); diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp index ddee615e4b5..2b5e7a3e9cb 100644 --- a/TAO/tao/PortableServer/Object_Adapter.cpp +++ b/TAO/tao/PortableServer/Object_Adapter.cpp @@ -166,7 +166,11 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ No_Hint_Strategy); // Give ownership to the auto pointer. +#if defined (ACE_HAS_CPP11) + std::unique_ptr<Hint_Strategy> new_hint_strategy (hint_strategy); +#else auto_ptr<Hint_Strategy> new_hint_strategy (hint_strategy); +#endif /* ACE_HAS_CPP11 */ new_hint_strategy->object_adapter (this); @@ -223,7 +227,11 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ break; } // Give ownership to the auto pointer. +#if defined (ACE_HAS_CPP11) + std::unique_ptr<transient_poa_map> new_transient_poa_map (tpm); +#else auto_ptr<transient_poa_map> new_transient_poa_map (tpm); +#endif /* ACE_HAS_CPP11 */ this->hint_strategy_ = new_hint_strategy.release (); diff --git a/TAO/tao/PortableServer/Root_POA.cpp b/TAO/tao/PortableServer/Root_POA.cpp index a8d0dc1ba64..972d5057fbc 100644 --- a/TAO/tao/PortableServer/Root_POA.cpp +++ b/TAO/tao/PortableServer/Root_POA.cpp @@ -2027,7 +2027,11 @@ TAO_Root_POA::key_to_stub_i (const TAO::ObjectKey &key, } // Give ownership to the auto pointer. +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO_Acceptor_Filter> new_filter (filter); +#else auto_ptr<TAO_Acceptor_Filter> new_filter (filter); +#endif /* ACE_HAS_CPP11 */ TAO_Stub *data = this->create_stub_object ( diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h index 726625941f8..500629cf1c0 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h +++ b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h @@ -139,7 +139,11 @@ namespace TAO TAO_Active_Object_Map * get_active_object_map() const; private: +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO_Active_Object_Map> active_object_map_; +#else auto_ptr<TAO_Active_Object_Map> active_object_map_; +#endif /* ACE_HAS_CPP11 */ CORBA::ULong waiting_servant_deactivation_; }; } |