summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2018-05-15 14:38:57 +0200
committerJohnny Willemsen <jwillemsen@remedy.nl>2018-05-15 14:38:57 +0200
commitc32cb0f99e00b506c78644fcaa0098f3b72c912d (patch)
treebae8b12fda52020d504e836f96031c68d503ce53
parentdf6d9751d3bf1a45c22c6282fe404ba2857f6ff4 (diff)
downloadATCD-c32cb0f99e00b506c78644fcaa0098f3b72c912d.tar.gz
Further changes for using std::unique_ptr
* TAO/tao/PortableServer/Active_Object_Map.cpp:
-rw-r--r--TAO/tao/PortableServer/Active_Object_Map.cpp39
1 files changed, 35 insertions, 4 deletions
diff --git a/TAO/tao/PortableServer/Active_Object_Map.cpp b/TAO/tao/PortableServer/Active_Object_Map.cpp
index c74e06403e8..b02fad7229b 100644
--- a/TAO/tao/PortableServer/Active_Object_Map.cpp
+++ b/TAO/tao/PortableServer/Active_Object_Map.cpp
@@ -116,8 +116,11 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (
}
// Give ownership to the auto pointer.
- auto_ptr<TAO_Id_Uniqueness_Strategy>
- new_id_uniqueness_strategy (id_uniqueness_strategy);
+#if defined (ACE_HAS_CPP11)
+ std::unique_ptr<TAO_Id_Uniqueness_Strategy> new_id_uniqueness_strategy (id_uniqueness_strategy);
+#else
+ auto_ptr<TAO_Id_Uniqueness_Strategy> new_id_uniqueness_strategy (id_uniqueness_strategy);
+#endif /* ACE_HAS_CPP11 */
TAO_Lifespan_Strategy *lifespan_strategy = 0;
@@ -141,7 +144,11 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (
}
// Give ownership to the auto pointer.
+#if defined (ACE_HAS_CPP11)
+ std::unique_ptr<TAO_Lifespan_Strategy> new_lifespan_strategy (lifespan_strategy);
+#else
auto_ptr<TAO_Lifespan_Strategy> new_lifespan_strategy (lifespan_strategy);
+#endif /* ACE_HAS_CPP11 */
TAO_Id_Assignment_Strategy *id_assignment_strategy = 0;
@@ -176,8 +183,11 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (
}
// Give ownership to the auto pointer.
- auto_ptr<TAO_Id_Assignment_Strategy>
- new_id_assignment_strategy (id_assignment_strategy);
+#if defined (ACE_HAS_CPP11)
+ std::unique_ptr<TAO_Id_Assignment_Strategy> new_id_assignment_strategy (id_assignment_strategy);
+#else
+ auto_ptr<TAO_Id_Assignment_Strategy> new_id_assignment_strategy (id_assignment_strategy);
+#endif /* ACE_HAS_CPP11 */
TAO_Id_Hint_Strategy *id_hint_strategy = 0;
if ((user_id_policy
@@ -199,7 +209,11 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (
}
// Give ownership to the auto pointer.
+#if defined (ACE_HAS_CPP11)
+ std::unique_ptr<TAO_Id_Hint_Strategy> new_id_hint_strategy (id_hint_strategy);
+#else
auto_ptr<TAO_Id_Hint_Strategy> new_id_hint_strategy (id_hint_strategy);
+#endif /* ACE_HAS_CPP11 */
servant_map *sm = 0;
if (unique_id_policy)
@@ -233,7 +247,11 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (
}
// Give ownership to the auto pointer.
+#if defined (ACE_HAS_CPP11)
+ std::unique_ptr<servant_map> new_servant_map (sm);
+#else
auto_ptr<servant_map> new_servant_map (sm);
+#endif /* ACE_HAS_CPP11 */
user_id_map *uim = 0;
if (user_id_policy
@@ -303,7 +321,11 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (
}
// Give ownership to the auto pointer.
+#if defined (ACE_HAS_CPP11)
+ std::unique_ptr<user_id_map> new_user_id_map (uim);
+#else
auto_ptr<user_id_map> new_user_id_map (uim);
+#endif /* ACE_HAS_CPP11 */
id_uniqueness_strategy->set_active_object_map (this);
lifespan_strategy->set_active_object_map (this);
@@ -311,12 +333,21 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (
// Finally everything is fine. Make sure to take ownership away
// from the auto pointer.
+#if defined (ACE_HAS_CPP11)
+ 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);
+ this->id_hint_strategy_ = std::move(new_id_hint_strategy);
+ this->servant_map_ = std::move(new_servant_map);
+ this->user_id_map_ = std::move(new_user_id_map);
+#else
this->id_uniqueness_strategy_ = new_id_uniqueness_strategy;
this->lifespan_strategy_ = new_lifespan_strategy;
this->id_assignment_strategy_ = new_id_assignment_strategy;
this->id_hint_strategy_ = new_id_hint_strategy;
this->servant_map_ = new_servant_map;
this->user_id_map_ = new_user_id_map;
+#endif /* ACE_HAS_CPP11 */
#if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1)
ACE_NEW (this->monitor_,