summaryrefslogtreecommitdiff
path: root/TAO/tao
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2021-09-27 08:17:08 +0200
committerGitHub <noreply@github.com>2021-09-27 08:17:08 +0200
commitd017dac249b849bc0fda979684166b2ca61b5578 (patch)
tree3c2b6e198a4538b9acdf7f9a402d6f18a5637fac /TAO/tao
parenta59431844a4b19bec5cbdd0d292378b35fd98358 (diff)
parent53f510db8ce145bffcc165ed38d0bfd29ebf016c (diff)
downloadATCD-d017dac249b849bc0fda979684166b2ca61b5578.tar.gz
Merge pull request #1687 from jwillemsen/jwi-autoptr5
Use std::unique_ptr and default
Diffstat (limited to 'TAO/tao')
-rw-r--r--TAO/tao/IORManipulation/IORManipulation.cpp6
-rw-r--r--TAO/tao/Leader_Follower.cpp5
-rw-r--r--TAO/tao/Load_Protocol_Factory_T.h3
-rw-r--r--TAO/tao/ORB_Core.cpp5
-rw-r--r--TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp2
-rw-r--r--TAO/tao/Storable_FlatFileStream.cpp7
-rw-r--r--TAO/tao/Strategies/DIOP_Acceptor.cpp4
-rw-r--r--TAO/tao/default_resource.cpp5
8 files changed, 19 insertions, 18 deletions
diff --git a/TAO/tao/IORManipulation/IORManipulation.cpp b/TAO/tao/IORManipulation/IORManipulation.cpp
index 8eac641e59e..4f6772fd90d 100644
--- a/TAO/tao/IORManipulation/IORManipulation.cpp
+++ b/TAO/tao/IORManipulation/IORManipulation.cpp
@@ -55,8 +55,7 @@ TAO_IOR_Manipulation_impl::merge_iors (
for (i = 1; i < iors.length () ; i++)
{
// this gets a copy of the MProfile, hence the auto_ptr;
- ACE_auto_ptr_reset (tmp_pfiles,
- iors[i]->_stubobj ()->make_profiles ());
+ tmp_pfiles.reset (iors[i]->_stubobj ()->make_profiles ());
// check to see if any of the profiles in tmp_pfiles are already
// in Merged_Profiles. If so raise exception.
@@ -183,8 +182,7 @@ TAO_IOR_Manipulation_impl::remove_profiles (
// Now we can remove the profiles which we want to eliminate from
// the Object.
- ACE_auto_ptr_reset (tmp_pfiles,
- ior2->_stubobj ()->make_profiles ());
+ tmp_pfiles.reset (ior2->_stubobj ()->make_profiles ());
TAO_MProfile& mp = stub -> base_profiles();
if (mp.remove_profiles (tmp_pfiles.get ()) < 0)
diff --git a/TAO/tao/Leader_Follower.cpp b/TAO/tao/Leader_Follower.cpp
index 7baf6687771..8ba45c8dab6 100644
--- a/TAO/tao/Leader_Follower.cpp
+++ b/TAO/tao/Leader_Follower.cpp
@@ -1,6 +1,5 @@
#include "ace/OS_NS_sys_time.h"
#include "ace/Reactor.h"
-#include "ace/Auto_Ptr.h"
#include "tao/Leader_Follower.h"
#include "tao/LF_Follower_Auto_Ptr.h"
@@ -12,6 +11,8 @@
#include "tao/ORB_Core.h"
#include "tao/ORB_Time_Policy.h"
+#include <memory>
+
#if !defined (__ACE_INLINE__)
# include "tao/Leader_Follower.inl"
#endif /* ! __ACE_INLINE__ */
@@ -225,7 +226,7 @@ TAO_Leader_Follower::resume_events ()
// not need to obtain the lock, only called when holding the lock
while (!this->deferred_event_set_.is_empty ())
{
- ACE_Auto_Ptr<Deferred_Event> event (this->deferred_event_set_.pop_front ());
+ std::unique_ptr<Deferred_Event> event (this->deferred_event_set_.pop_front ());
// Send a notification to the reactor to cause the awakening of a new
// follower, if there is one already available.
ACE_Reactor *reactor = this->orb_core_->reactor ();
diff --git a/TAO/tao/Load_Protocol_Factory_T.h b/TAO/tao/Load_Protocol_Factory_T.h
index af0c7f18731..5928452f5d3 100644
--- a/TAO/tao/Load_Protocol_Factory_T.h
+++ b/TAO/tao/Load_Protocol_Factory_T.h
@@ -58,8 +58,7 @@ namespace TAO
T,
-1);
- ACE_auto_ptr_reset (safe_protocol_factory,
- protocol_factory);
+ safe_protocol_factory.reset (protocol_factory);
transfer_ownership = true;
}
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 4073819bfd0..a2519a100f3 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -66,6 +66,7 @@
#include "ace/OS_NS_string.h"
#include "ace/Message_Block.h"
#include <cstring>
+#include <memory>
#if TAO_HAS_INTERCEPTORS == 1
# include "tao/ClientRequestInterceptor_Adapter.h"
@@ -2761,7 +2762,7 @@ TAO_ORB_Core::resolve_ior_table_i ()
if (factory != nullptr)
{
- ACE_Auto_Ptr <TAO_Adapter> iortable_adapter (factory->create (this));
+ std::unique_ptr <TAO_Adapter> iortable_adapter (factory->create (this));
iortable_adapter->open ();
CORBA::Object_var tmp_root = iortable_adapter->root ();
@@ -2795,7 +2796,7 @@ TAO_ORB_Core::resolve_async_ior_table_i ()
if (factory != nullptr)
{
- ACE_Auto_Ptr <TAO_Adapter> iortable_adapter (factory->create (this));
+ std::unique_ptr <TAO_Adapter> iortable_adapter (factory->create (this));
iortable_adapter->open ();
CORBA::Object_var tmp_root = iortable_adapter->root ();
diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp
index b92e56025cc..efcd7935078 100644
--- a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp
+++ b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp
@@ -47,7 +47,7 @@ namespace TAO
poa->orb_core().server_factory ()->active_object_map_creation_parameters ()
), CORBA::NO_MEMORY ());
- ACE_auto_ptr_reset (this->active_object_map_, active_object_map);
+ this->active_object_map_.reset (active_object_map);
#if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1)
ACE_CString name_str ("Active_Object_Map_");
diff --git a/TAO/tao/Storable_FlatFileStream.cpp b/TAO/tao/Storable_FlatFileStream.cpp
index 2cb1951cc3a..08b98a564fe 100644
--- a/TAO/tao/Storable_FlatFileStream.cpp
+++ b/TAO/tao/Storable_FlatFileStream.cpp
@@ -12,7 +12,6 @@
#include "tao/Storable_FlatFileStream.h"
-#include "ace/Auto_Ptr.h"
#include "ace/OS_NS_unistd.h"
#include "ace/OS_NS_fcntl.h"
#include "ace/OS_NS_sys_stat.h"
@@ -25,6 +24,8 @@
#include <mntent.h>
#endif /* ACE_HAS_MNTENT */
+#include <memory>
+
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
namespace
@@ -436,8 +437,8 @@ TAO::Storable_FlatFileStream::operator >> (ACE_CString& str)
this->throw_on_read_error (badbit);
}
{
- int strSize = bufSize + 1; // Account for newline
- ACE_Auto_Basic_Array_Ptr<char> str_array (new char[strSize]);
+ int const strSize = bufSize + 1; // Account for newline
+ std::unique_ptr<char[]> str_array (new char[strSize]);
str_array[0] = '\0';
if (ACE_OS::fgets (str_array.get (),
strSize,
diff --git a/TAO/tao/Strategies/DIOP_Acceptor.cpp b/TAO/tao/Strategies/DIOP_Acceptor.cpp
index 7416b3b24f7..3801d1cf174 100644
--- a/TAO/tao/Strategies/DIOP_Acceptor.cpp
+++ b/TAO/tao/Strategies/DIOP_Acceptor.cpp
@@ -10,7 +10,6 @@
#include "tao/Codeset_Manager.h"
#include "tao/CDR.h"
-#include "ace/Auto_Ptr.h"
#include "ace/OS_NS_string.h"
#if !defined(__ACE_INLINE__)
@@ -19,6 +18,7 @@
#include "ace/os_include/os_netdb.h"
#include <cstring>
+#include <memory>
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -787,7 +787,7 @@ TAO_DIOP_Acceptor::probe_interfaces (TAO_ORB_Core *orb_core, int def_type)
// The instantiation for this template is in
// tao/DIOP_Connector.cpp.
- ACE_Auto_Basic_Array_Ptr<ACE_INET_Addr> safe_if_addrs (if_addrs);
+ std::unique_ptr<ACE_INET_Addr[]> safe_if_addrs (if_addrs);
#if defined (ACE_HAS_IPV6)
bool ipv4_only = def_type == AF_INET;
diff --git a/TAO/tao/default_resource.cpp b/TAO/tao/default_resource.cpp
index cee00e985c0..e51280730e5 100644
--- a/TAO/tao/default_resource.cpp
+++ b/TAO/tao/default_resource.cpp
@@ -27,6 +27,8 @@
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_strings.h"
+#include <memory>
+
#if !defined (__ACE_INLINE__)
#include "tao/default_resource.inl"
#endif /* __ACE_INLINE__ */
@@ -1192,7 +1194,7 @@ TAO_Default_Resource_Factory::codeset_manager()
}
- ACE_Auto_Ptr<TAO_Codeset_Manager> safemgr (mgr);
+ std::unique_ptr<TAO_Codeset_Manager> safemgr (mgr);
if (TAO_debug_level >= 1)
TAOLIB_DEBUG ((LM_DEBUG,
@@ -1203,7 +1205,6 @@ TAO_Default_Resource_Factory::codeset_manager()
this->wchar_codeset_parameters_.apply_to (mgr->wchar_codeset_descriptor());
return safemgr.release ();
-
}
TAO_Resource_Factory::Resource_Usage