summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2018-05-15 15:04:20 +0200
committerJohnny Willemsen <jwillemsen@remedy.nl>2018-05-15 15:04:20 +0200
commit2201a11b5acbbe38c86f72e8e444b1932196d38e (patch)
tree0b181fd9a12e92a6ecfd33a80208fcfb73227c31
parent074ca6ccfcbd44a76620ef52a42d644a32737eb0 (diff)
downloadATCD-2201a11b5acbbe38c86f72e8e444b1932196d38e.tar.gz
Use std::unique_ptr with C++11
* TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp: * TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp: * TAO/tao/AnyTypeCode/Any_SystemException.cpp: * TAO/tao/AnyTypeCode/NVList.cpp: * TAO/tao/IORManipulation/IORManipulation.cpp:
-rw-r--r--TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp4
-rw-r--r--TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp4
-rw-r--r--TAO/tao/AnyTypeCode/Any_SystemException.cpp4
-rw-r--r--TAO/tao/AnyTypeCode/NVList.cpp4
-rw-r--r--TAO/tao/IORManipulation/IORManipulation.cpp9
5 files changed, 24 insertions, 1 deletions
diff --git a/TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp b/TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp
index 1aedfbc1951..25e3c395d76 100644
--- a/TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp
+++ b/TAO/tao/AnyTypeCode/Any_Basic_Impl.cpp
@@ -116,7 +116,11 @@ namespace TAO
TAO::Any_Basic_Impl *replacement =
TAO::Any_Basic_Impl::create_empty (any_tc);
+#if defined (ACE_HAS_CPP11)
+ std::unique_ptr<TAO::Any_Basic_Impl> replacement_safety (replacement);
+#else
auto_ptr<TAO::Any_Basic_Impl> replacement_safety (replacement);
+#endif /* ACE_HAS_CPP11 */
// We know this will work since the unencoded case is covered above.
TAO::Unknown_IDL_Type * const unk =
diff --git a/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp
index 0a38d944318..a45b3b2481b 100644
--- a/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp
+++ b/TAO/tao/AnyTypeCode/Any_Basic_Impl_T.cpp
@@ -78,7 +78,11 @@ TAO::Any_Basic_Impl_T<T>::extract (const CORBA::Any & any,
TAO::Any_Basic_Impl_T<T> * const replacement =
TAO::Any_Basic_Impl_T<T>::create_empty (any_tc);
+#if defined (ACE_HAS_CPP11)
+ std::unique_ptr<TAO::Any_Basic_Impl_T<T> > replacement_safety (replacement);
+#else
auto_ptr<TAO::Any_Basic_Impl_T<T> > replacement_safety (replacement);
+#endif /* ACE_HAS_CPP11 */
// We know this will work since the unencoded case is covered above.
TAO::Unknown_IDL_Type * const unk =
diff --git a/TAO/tao/AnyTypeCode/Any_SystemException.cpp b/TAO/tao/AnyTypeCode/Any_SystemException.cpp
index 1e553d02c08..2e06f71b942 100644
--- a/TAO/tao/AnyTypeCode/Any_SystemException.cpp
+++ b/TAO/tao/AnyTypeCode/Any_SystemException.cpp
@@ -116,7 +116,11 @@ TAO::Any_SystemException::extract (const CORBA::Any & any,
empty_value),
false);
+#if defined (ACE_HAS_CPP11)
+ std::unique_ptr<TAO::Any_SystemException > replacement_safety (replacement);
+#else
auto_ptr<TAO::Any_SystemException > replacement_safety (replacement);
+#endif /* ACE_HAS_CPP11 */
// We know this will work since the unencoded case is covered above.
TAO::Unknown_IDL_Type * const unk =
diff --git a/TAO/tao/AnyTypeCode/NVList.cpp b/TAO/tao/AnyTypeCode/NVList.cpp
index fba13992a3b..fde869f8cd3 100644
--- a/TAO/tao/AnyTypeCode/NVList.cpp
+++ b/TAO/tao/AnyTypeCode/NVList.cpp
@@ -435,7 +435,11 @@ CORBA::NVList::evaluate (void)
if (this->incoming_ != 0)
{
+#if defined (ACE_HAS_CPP11)
+ std::unique_ptr<TAO_InputCDR> incoming (this->incoming_);
+#else
auto_ptr<TAO_InputCDR> incoming (this->incoming_);
+#endif /* ACE_HAS_CPP11 */
this->incoming_ = 0;
this->_tao_decode (*(incoming.get ()), this->incoming_flag_);
diff --git a/TAO/tao/IORManipulation/IORManipulation.cpp b/TAO/tao/IORManipulation/IORManipulation.cpp
index 89b7adc02c4..4a26a9d94d3 100644
--- a/TAO/tao/IORManipulation/IORManipulation.cpp
+++ b/TAO/tao/IORManipulation/IORManipulation.cpp
@@ -46,7 +46,11 @@ TAO_IOR_Manipulation_impl::merge_iors (
// get the profile lists, start by initialize the composite reference
// by using the first Object. Then for each subsequent Object verify
// they are the same type and they do not have duplicate profiles.
+#if defined (ACE_HAS_CPP11)
+ std::unique_ptr<TAO_MProfile> tmp_pfiles (iors[0]->_stubobj ()->make_profiles ());
+#else
auto_ptr<TAO_MProfile> tmp_pfiles (iors[0]->_stubobj ()->make_profiles ());
+#endif /* ACE_HAS_CPP11 */
if (Merged_Profiles.add_profiles (tmp_pfiles.get ())< 0)
throw TAO_IOP::Invalid_IOR ();
CORBA::String_var id =
@@ -55,7 +59,6 @@ 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 ());
@@ -147,7 +150,11 @@ TAO_IOR_Manipulation_impl::remove_profiles (
// initialize with estimated pfile count.
TAO_MProfile Diff_Profiles (count);
+#if defined (ACE_HAS_CPP11)
+ std::unique_ptr<TAO_MProfile> tmp_pfiles (group->_stubobj ()->make_profiles ());
+#else
auto_ptr<TAO_MProfile> tmp_pfiles (group->_stubobj ()->make_profiles ());
+#endif /* ACE_HAS_CPP11 */
if (Diff_Profiles.add_profiles (tmp_pfiles.get ()) < 0)
throw TAO_IOP::Invalid_IOR ();