diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2018-05-15 12:28:55 +0200 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2018-05-15 12:28:55 +0200 |
commit | e915b48fcd7eee34bf661673b532bfa0b6e9cccb (patch) | |
tree | 439eadef351dc6b982a9755794b43eee6786b33b | |
parent | 880d4ee94da593dedaa766e0ded0cb09eb15394b (diff) | |
download | ATCD-e915b48fcd7eee34bf661673b532bfa0b6e9cccb.tar.gz |
Make use of std::unique_ptr when we have C++11
* TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp:
* TAO/tao/Load_Protocol_Factory_T.h:
-rw-r--r-- | TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp | 17 | ||||
-rw-r--r-- | TAO/tao/Load_Protocol_Factory_T.h | 4 |
2 files changed, 14 insertions, 7 deletions
diff --git a/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp b/TAO/tao/DynamicInterface/AMH_DSI_Response_Handler.cpp index 830f379f67c..4e373dc8f01 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 this->exception_->_raise (); } diff --git a/TAO/tao/Load_Protocol_Factory_T.h b/TAO/tao/Load_Protocol_Factory_T.h index 45b246d3188..713ad8e6efd 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 TAO_Protocol_Item *item = 0; |