diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2008-05-19 18:35:20 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2008-05-19 18:35:20 +0000 |
commit | 69f537ea83347804fd0b4ea78cef67c6acdcd1eb (patch) | |
tree | c7daa73caa15c2a3058021a8cb71f0a26b9ff6c3 /TAO/tao/ORB.cpp | |
parent | 572ffe8cd2ffd78e9fd047c8ee3117edf8420952 (diff) | |
download | ATCD-69f537ea83347804fd0b4ea78cef67c6acdcd1eb.tar.gz |
Mon May 19 18:34:21 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO/tao/ORB.cpp')
-rw-r--r-- | TAO/tao/ORB.cpp | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index e48320f275e..be22684cb67 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -1461,25 +1461,24 @@ CORBA::ORB::object_to_string (CORBA::Object_ptr obj) TAO_MProfile &mp = obj->_stubobj ()->base_profiles (); - if (mp.profile_count () == 0) + // Try the profiles until one returns a string + for (CORBA::ULong index = 0; index < mp.profile_count(); ++index) { - if (TAO_debug_level > 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) Cannot stringify given ") - ACE_TEXT ("object. No profiles.\n"))); - - - throw ::CORBA::MARSHAL ( - CORBA::SystemException::_tao_minor_code ( - 0, - EINVAL), - CORBA::COMPLETED_NO); + char * result = mp.get_profile (index)->to_string(); + if (result) + return result; } - // For now we just use the first profile. - TAO_Profile *profile = mp.get_profile (0); + if (TAO_debug_level > 0) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) Cannot stringify given ") + ACE_TEXT ("object. No or only unknown profiles.\n"))); - return profile->to_string (); + throw ::CORBA::MARSHAL ( + CORBA::SystemException::_tao_minor_code ( + 0, + EINVAL), + CORBA::COMPLETED_NO); } } @@ -1606,7 +1605,7 @@ CORBA::ORB::ior_string_to_object (const char *str) // Create deencapsulation stream ... then unmarshal objref from that // stream. - int byte_order = *(mb.rd_ptr ()); + int const byte_order = *(mb.rd_ptr ()); mb.rd_ptr (1); mb.wr_ptr (len); TAO_InputCDR stream (&mb, @@ -1636,10 +1635,7 @@ CORBA::ORB::url_ior_string_to_object (const char* str) TAO_Connector_Registry *conn_reg = this->orb_core_->connector_registry (); - int const retv = conn_reg->make_mprofile (str, mprofile); - // Return nil. - - if (retv != 0) + if (conn_reg->make_mprofile (str, mprofile) != 0) { throw ::CORBA::INV_OBJREF ( CORBA::SystemException::_tao_minor_code ( |