diff options
26 files changed, 202 insertions, 43 deletions
diff --git a/ACE/ace/OS_NS_Thread.cpp b/ACE/ace/OS_NS_Thread.cpp index 18ac132a7df..38f92de4943 100644 --- a/ACE/ace/OS_NS_Thread.cpp +++ b/ACE/ace/OS_NS_Thread.cpp @@ -13,7 +13,6 @@ #include "ace/OS_NS_errno.h" #include "ace/OS_NS_ctype.h" #include "ace/Log_Category.h" // for ACE_ASSERT -// This is necessary to work around nasty problems with MVS C++. #include "ace/Auto_Ptr.h" #include "ace/Thread_Mutex.h" #include "ace/Condition_Thread_Mutex.h" @@ -3557,7 +3556,11 @@ ACE_OS::thr_create (ACE_THR_FUNC func, else thread_args = thread_adapter; +#if defined (ACE_HAS_CPP11) + std::unique_ptr <ACE_Base_Thread_Adapter> auto_thread_args; +#else auto_ptr <ACE_Base_Thread_Adapter> auto_thread_args; +#endif /* ACE_HAS_CPP11 */ if (thread_adapter == 0) ACE_auto_ptr_reset (auto_thread_args, diff --git a/ACE/ace/Proactor.cpp b/ACE/ace/Proactor.cpp index cd8e9133c80..38caad17b05 100644 --- a/ACE/ace/Proactor.cpp +++ b/ACE/ace/Proactor.cpp @@ -243,7 +243,11 @@ ACE_Proactor_Handle_Timeout_Upcall::timeout (ACE_Proactor_Timer_Queue &, ACE_TEXT ("create_asynch_timer failed")), -1); +#if defined (ACE_HAS_CPP11) + std::unique_ptr<ACE_Asynch_Result_Impl> safe_asynch_timer (asynch_timer); +#else auto_ptr<ACE_Asynch_Result_Impl> safe_asynch_timer (asynch_timer); +#endif /* ACE_HAS_CPP11 */ // Post a completion. if (-1 == safe_asynch_timer->post_completion diff --git a/ACE/ace/Thread_Manager.cpp b/ACE/ace/Thread_Manager.cpp index d958983686e..172e4a43af8 100644 --- a/ACE/ace/Thread_Manager.cpp +++ b/ACE/ace/Thread_Manager.cpp @@ -588,7 +588,11 @@ ACE_Thread_Manager::spawn_i (ACE_THR_FUNC func, // Create a new thread running <func>. *Must* be called with the // <lock_> held... // Get a "new" Thread Descriptor from the freelist. +#if defined (ACE_HAS_CPP11) + std::unique_ptr<ACE_Thread_Descriptor> new_thr_desc (this->thread_desc_freelist_.remove ()); +#else auto_ptr<ACE_Thread_Descriptor> new_thr_desc (this->thread_desc_freelist_.remove ()); +#endif /* ACE_HAS_CPP11 */ // Reset thread descriptor status new_thr_desc->reset (this); diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp index 8654e2210ae..777aaef1614 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp @@ -484,7 +484,11 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, TAO::Storable_Factory* pf = 0; ACE_CString directory (ACE_TEXT_ALWAYS_CHAR (persistence_location)); ACE_NEW_RETURN (pf, TAO::Storable_FlatFileFactory (directory), -1); +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO::Storable_Factory> persFactory(pf); +#else auto_ptr<TAO::Storable_Factory> persFactory(pf); +#endif /* ACE_HAS_CPP11 */ // Use an auto_ptr to ensure that we clean up the factory in the case // of a failure in creating and registering the Activator. @@ -492,7 +496,11 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, this->storable_naming_context_factory (context_size); // Make sure we got a factory if (cf == 0) return -1; +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO_Storable_Naming_Context_Factory> contextFactory (cf); +#else auto_ptr<TAO_Storable_Naming_Context_Factory> contextFactory (cf); +#endif /* ACE_HAS_CPP11 */ // This instance will either get deleted after recreate all or, // in the case of a servant activator's use, on destruction of the 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_Dual_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp index eb3b9fdfc4b..42cc10a0066 100644 --- a/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp +++ b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp @@ -158,7 +158,11 @@ TAO::Any_Dual_Impl_T<T>::replace (TAO_InputCDR &cdr, ACE_NEW_RETURN (empty_value, T, false); +#if defined (ACE_HAS_CPP11) + std::unique_ptr<T> empty_value_safety (empty_value); +#else auto_ptr<T> empty_value_safety (empty_value); +#endif /* ACE_HAS_CPP11 */ TAO::Any_Dual_Impl_T<T> *replacement = 0; ACE_NEW_RETURN (replacement, TAO::Any_Dual_Impl_T<T> (destructor, @@ -166,7 +170,11 @@ TAO::Any_Dual_Impl_T<T>::replace (TAO_InputCDR &cdr, empty_value), false); +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO::Any_Dual_Impl_T<T> > replacement_safety (replacement); +#else auto_ptr<TAO::Any_Dual_Impl_T<T> > replacement_safety (replacement); +#endif /* ACE_HAS_CPP11 */ CORBA::Boolean const good_decode = replacement->demarshal_value (cdr); diff --git a/TAO/tao/AnyTypeCode/Any_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Impl_T.cpp index c1872c61e3f..f389796bff3 100644 --- a/TAO/tao/AnyTypeCode/Any_Impl_T.cpp +++ b/TAO/tao/AnyTypeCode/Any_Impl_T.cpp @@ -91,7 +91,11 @@ TAO::Any_Impl_T<T>::extract (const CORBA::Any & any, 0), false); +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO::Any_Impl_T<T> > replacement_safety (replacement); +#else auto_ptr<TAO::Any_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_Special_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Special_Impl_T.cpp index e0055e0cb2f..a5cdeb3239d 100644 --- a/TAO/tao/AnyTypeCode/Any_Special_Impl_T.cpp +++ b/TAO/tao/AnyTypeCode/Any_Special_Impl_T.cpp @@ -129,8 +129,11 @@ TAO::Any_Special_Impl_T<T, from_T, to_T>::extract (const CORBA::Any & any, bound), false); - auto_ptr<TAO::Any_Special_Impl_T<T, from_T, to_T> > replacement_safety ( - replacement); +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO::Any_Special_Impl_T<T, from_T, to_T> > replacement_safety (replacement); +#else + auto_ptr<TAO::Any_Special_Impl_T<T, from_T, to_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/Connector_Registry.cpp b/TAO/tao/Connector_Registry.cpp index 8d3d2eece02..99c57a9add1 100644 --- a/TAO/tao/Connector_Registry.cpp +++ b/TAO/tao/Connector_Registry.cpp @@ -64,8 +64,11 @@ TAO_Connector_Registry::open (TAO_ORB_Core *orb_core) factory != end; ++factory) { - auto_ptr <TAO_Connector> connector ( - (*factory)->factory ()->make_connector ()); +#if defined (ACE_HAS_CPP11) + std::unique_ptr <TAO_Connector> connector ((*factory)->factory ()->make_connector ()); +#else + auto_ptr <TAO_Connector> connector ((*factory)->factory ()->make_connector ()); +#endif /* ACE_HAS_CPP11 */ if (connector.get ()) { @@ -79,8 +82,7 @@ TAO_Connector_Registry::open (TAO_ORB_Core *orb_core) -1); } - this->connectors_[this->size_++] = - connector.release (); + this->connectors_[this->size_++] = connector.release (); } else return -1; diff --git a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp index 830f379f67c..2b421eb3c91 100644 --- a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp +++ b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp @@ -267,8 +267,8 @@ TAO_AMH_DSI_Exception_Holder::_tao_unmarshal ( TAO_AMH_DSI_Exception_Holder *&new_object) { ::CORBA::ValueBase *base = 0; - ::CORBA::Boolean is_indirected = 0; - ::CORBA::Boolean is_null_object = 0; + ::CORBA::Boolean is_indirected = false; + ::CORBA::Boolean is_null_object = false; ::CORBA::Boolean const retval = ::CORBA::ValueBase::_tao_unmarshal_pre ( strm, @@ -281,14 +281,13 @@ TAO_AMH_DSI_Exception_Holder::_tao_unmarshal ( ::CORBA::ValueBase_var owner (base); if (!retval) - return 0; + return false; if (is_null_object) - return 1; + return true; if (!is_indirected && base != 0 && ! base->_tao_unmarshal_v (strm)) - return 0; - + return false; // Now base must be null or point to the unmarshaled object. // Align the pointer to the right subobject. @@ -297,13 +296,17 @@ TAO_AMH_DSI_Exception_Holder::_tao_unmarshal ( new_object->_add_ref (); owner._retn (); - return 1; + return true; } void TAO_AMH_DSI_Exception_Holder::raise_invoke () { +#if defined (ACE_HAS_CPP11) + std::unique_ptr< ::CORBA::Exception> safety (this->exception_); +#else auto_ptr< ::CORBA::Exception> safety (this->exception_); +#endif /* ACE_HAS_CPP11 */ this->exception_->_raise (); } 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/IORManipulation/IORManipulation.cpp b/TAO/tao/IORManipulation/IORManipulation.cpp index 89b7adc02c4..ef0fba027af 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 (); @@ -261,7 +268,7 @@ TAO_IOR_Manipulation_impl::is_primary_set ( } CORBA::Boolean -TAO_IOR_Manipulation_impl:: remove_primary_tag ( +TAO_IOR_Manipulation_impl::remove_primary_tag ( TAO_IOP::TAO_IOR_Property_ptr prop, CORBA::Object_ptr group) { @@ -276,8 +283,13 @@ TAO_IOR_Manipulation_impl::is_in_ior ( CORBA::ULong count = 0; TAO_Profile *pfile1 = 0; TAO_Profile *pfile2 = 0; +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO_MProfile> tmp_pfiles1 (ior1->_stubobj ()->make_profiles ()); + std::unique_ptr<TAO_MProfile> tmp_pfiles2 (ior2->_stubobj ()->make_profiles ()); +#else auto_ptr<TAO_MProfile> tmp_pfiles1 (ior1->_stubobj ()->make_profiles ()); auto_ptr<TAO_MProfile> tmp_pfiles2 (ior2->_stubobj ()->make_profiles ()); +#endif /* ACE_HAS_CPP11 */ tmp_pfiles1->rewind (); while ((pfile1 = tmp_pfiles1->get_next ()) != 0) diff --git a/TAO/tao/Load_Protocol_Factory_T.h b/TAO/tao/Load_Protocol_Factory_T.h index 45b246d3188..29a2519aa05 100644 --- a/TAO/tao/Load_Protocol_Factory_T.h +++ b/TAO/tao/Load_Protocol_Factory_T.h @@ -33,7 +33,11 @@ namespace TAO const char *name) { TAO_Protocol_Factory *protocol_factory = 0; +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO_Protocol_Factory> safe_protocol_factory; +#else auto_ptr<TAO_Protocol_Factory> safe_protocol_factory; +#endif /* ACE_HAS_CPP11 */ TAO_Protocol_Item *item = 0; diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index 99397801b3f..408bbff08f6 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -1966,8 +1966,11 @@ TAO_ORB_Core::root_poa (void) if (CORBA::is_nil (this->root_poa_.in ())) { +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO_Adapter> poa_adapter (factory->create (this)); +#else auto_ptr<TAO_Adapter> poa_adapter (factory->create (this)); - +#endif /* ACE_HAS_CPP11 */ poa_adapter->open (); // @@ Not exception safe diff --git a/TAO/tao/PortableServer/Active_Object_Map.cpp b/TAO/tao/PortableServer/Active_Object_Map.cpp index 706cd08e023..b556fa72579 100644 --- a/TAO/tao/PortableServer/Active_Object_Map.cpp +++ b/TAO/tao/PortableServer/Active_Object_Map.cpp @@ -91,13 +91,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( int persistent_id_policy, const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters & creation_parameters) - : user_id_map_ (0) - , servant_map_ (0) - , id_uniqueness_strategy_ (0) - , lifespan_strategy_ (0) - , id_assignment_strategy_ (0) - , id_hint_strategy_ (0) - , using_active_maps_ (false) + : using_active_maps_ (false) { TAO_Active_Object_Map::set_system_id_size (creation_parameters); @@ -122,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; @@ -147,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; @@ -182,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 @@ -205,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) @@ -224,7 +232,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( "linear option for " "-ORBUniqueidPolicyReverseDemuxStrategy " "not supported with minimum POA maps. " - "Ingoring option to use default...\n")); + "Ignoring option to use default...\n")); /* FALL THROUGH */ #endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ @@ -239,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 @@ -258,7 +270,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( TAOLIB_ERROR ((LM_ERROR, "linear option for -ORBUseridPolicyDemuxStrategy " "not supported with minimum POA maps. " - "Ingoring option to use default...\n")); + "Ignoring option to use default...\n")); /* FALL THROUGH */ #endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ @@ -292,7 +304,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map ( TAOLIB_ERROR ((LM_ERROR, "linear and dynamic options for -ORBSystemidPolicyDemuxStrategy " "are not supported with minimum POA maps. " - "Ingoring option to use default...\n")); + "Ignoring option to use default...\n")); /* FALL THROUGH */ #endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ @@ -309,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); @@ -317,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_, diff --git a/TAO/tao/PortableServer/Active_Object_Map.h b/TAO/tao/PortableServer/Active_Object_Map.h index 58c21c9cd83..a37e2fcaee5 100644 --- a/TAO/tao/PortableServer/Active_Object_Map.h +++ b/TAO/tao/PortableServer/Active_Object_Map.h @@ -237,22 +237,46 @@ public: #endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ /// Id map. +#if defined (ACE_HAS_CPP11) + std::unique_ptr<user_id_map> user_id_map_; +#else auto_ptr<user_id_map> user_id_map_; +#endif /* ACE_HAS_CPP11 */ /// Servant map. +#if defined (ACE_HAS_CPP11) + std::unique_ptr<servant_map> servant_map_; +#else auto_ptr<servant_map> servant_map_; +#endif /* ACE_HAS_CPP11 */ /// Id uniqueness strategy. +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO_Id_Uniqueness_Strategy> id_uniqueness_strategy_; +#else auto_ptr<TAO_Id_Uniqueness_Strategy> id_uniqueness_strategy_; +#endif /* ACE_HAS_CPP11 */ /// Lifespan strategy. +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO_Lifespan_Strategy> lifespan_strategy_; +#else auto_ptr<TAO_Lifespan_Strategy> lifespan_strategy_; +#endif /* ACE_HAS_CPP11 */ /// Id assignment strategy. +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO_Id_Assignment_Strategy> id_assignment_strategy_; +#else auto_ptr<TAO_Id_Assignment_Strategy> id_assignment_strategy_; +#endif /* ACE_HAS_CPP11 */ /// Id hint strategy. +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO_Id_Hint_Strategy> id_hint_strategy_; +#else auto_ptr<TAO_Id_Hint_Strategy> id_hint_strategy_; +#endif /* ACE_HAS_CPP11 */ /// Flag to see if we are using active maps in this active object /// map. diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp index 74af2512196..00819b064ec 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); @@ -183,7 +187,7 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ TAOLIB_ERROR ((LM_ERROR, "linear option for -ORBPersistentidPolicyDemuxStrategy " "not supported with minimum POA maps. " - "Ingoring option to use default...\n")); + "Ignoring option to use default...\n")); /* FALL THROUGH */ #endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ case TAO_DYNAMIC_HASH: @@ -193,7 +197,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<persistent_poa_name_map> new_persistent_poa_name_map (ppnm); +#else auto_ptr<persistent_poa_name_map> new_persistent_poa_name_map (ppnm); +#endif /* ACE_HAS_CPP11 */ transient_poa_map *tpm = 0; switch (creation_parameters.poa_lookup_strategy_for_transient_id_policy_) @@ -213,7 +221,7 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ TAOLIB_ERROR ((LM_ERROR, "linear and dynamic options for -ORBTransientidPolicyDemuxStrategy " "are not supported with minimum POA maps. " - "Ingoring option to use default...\n")); + "Ignoring option to use default...\n")); /* FALL THROUGH */ #endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ case TAO_ACTIVE_DEMUX: @@ -223,14 +231,15 @@ 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 (); - this->persistent_poa_name_map_ = - new_persistent_poa_name_map.release (); - this->transient_poa_map_ = - new_transient_poa_map.release (); + this->hint_strategy_ = new_hint_strategy.release (); + this->persistent_poa_name_map_ = new_persistent_poa_name_map.release (); + this->transient_poa_map_ = new_transient_poa_map.release (); } void 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_; }; } diff --git a/TAO/tao/RTCORBA/Thread_Pool.cpp b/TAO/tao/RTCORBA/Thread_Pool.cpp index e101bb672f5..622de35c11e 100644 --- a/TAO/tao/RTCORBA/Thread_Pool.cpp +++ b/TAO/tao/RTCORBA/Thread_Pool.cpp @@ -890,7 +890,11 @@ RTCORBA::ThreadpoolId TAO_Thread_Pool_Manager::create_threadpool_helper (TAO_Thread_Pool *thread_pool) { // Make sure of safe deletion in case of errors. +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO_Thread_Pool> safe_thread_pool (thread_pool); +#else auto_ptr<TAO_Thread_Pool> safe_thread_pool (thread_pool); +#endif /* ACE_HAS_CPP11 */ // Open the pool. thread_pool->open (); diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp index 7f2351595aa..5f5a645e70e 100644 --- a/TAO/tao/Stub.cpp +++ b/TAO/tao/Stub.cpp @@ -456,8 +456,11 @@ TAO_Stub::set_policy_overrides (const CORBA::PolicyList & policies, CORBA::SetOverrideType set_add) { // Notice the use of an explicit constructor.... - auto_ptr<TAO_Policy_Set> policy_manager ( - new TAO_Policy_Set (TAO_POLICY_OBJECT_SCOPE)); +#if defined (ACE_HAS_CPP11) + std::unique_ptr<TAO_Policy_Set> policy_manager (new TAO_Policy_Set (TAO_POLICY_OBJECT_SCOPE)); +#else + auto_ptr<TAO_Policy_Set> policy_manager (new TAO_Policy_Set (TAO_POLICY_OBJECT_SCOPE)); +#endif /* ACE_HAS_CPP11 */ if (set_add == CORBA::SET_OVERRIDE) { diff --git a/TAO/tao/Synch_Invocation.cpp b/TAO/tao/Synch_Invocation.cpp index 5cc60f9ad17..4b7563ec7a6 100644 --- a/TAO/tao/Synch_Invocation.cpp +++ b/TAO/tao/Synch_Invocation.cpp @@ -585,7 +585,11 @@ namespace TAO // We must manage the memory allocated // by the call above to alloc(). +#if defined (ACE_HAS_CPP11) + std::unique_ptr<CORBA::Exception> safety (exception); +#else auto_ptr<CORBA::Exception> safety (exception); +#endif /* ACE_HAS_CPP11 */ exception->_raise (); @@ -732,7 +736,11 @@ namespace TAO // Without this, the call to create_system_exception() above // causes a memory leak. On platforms without native exceptions, // the CORBA::Environment class manages the memory. +#if defined (ACE_HAS_CPP11) + std::unique_ptr<CORBA::SystemException> safety (ex); +#else auto_ptr<CORBA::SystemException> safety (ex); +#endif /* ACE_HAS_CPP11 */ ex->minor (minor); ex->completed (CORBA::CompletionStatus (completion)); diff --git a/TAO/tao/Valuetype/ValueBase.inl b/TAO/tao/Valuetype/ValueBase.inl index 3015b22d45c..e76c57a61f1 100644 --- a/TAO/tao/Valuetype/ValueBase.inl +++ b/TAO/tao/Valuetype/ValueBase.inl @@ -16,7 +16,7 @@ TAO_OBV_GIOP_Flags::is_value_tag (CORBA::Long tag) } ACE_INLINE CORBA::Boolean -TAO_OBV_GIOP_Flags:: has_codebase_url (CORBA::Long tag) +TAO_OBV_GIOP_Flags::has_codebase_url (CORBA::Long tag) { return (CORBA::Boolean) (tag & Codebase_url); } @@ -40,7 +40,7 @@ TAO_OBV_GIOP_Flags::has_list_type_info (CORBA::Long tag) } ACE_INLINE CORBA::Boolean -TAO_OBV_GIOP_Flags:: is_chunked (CORBA::Long tag) +TAO_OBV_GIOP_Flags::is_chunked (CORBA::Long tag) { return (CORBA::Boolean) (tag & 8); } |