diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-09-02 16:30:01 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-09-02 16:30:01 +0000 |
commit | 814a4f2ca6869c03f0591b8f126a3912789f0b88 (patch) | |
tree | 867e2d70b216b2916c53fe270981bc1c0678c772 /ace/Remote_Name_Space.cpp | |
parent | 26d3482086b8d0dd1479b0a87a3274c578f41be6 (diff) | |
download | ATCD-814a4f2ca6869c03f0591b8f126a3912789f0b88.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace/Remote_Name_Space.cpp')
-rw-r--r-- | ace/Remote_Name_Space.cpp | 137 |
1 files changed, 77 insertions, 60 deletions
diff --git a/ace/Remote_Name_Space.cpp b/ace/Remote_Name_Space.cpp index 4da37aa61f5..cbd886b0d13 100644 --- a/ace/Remote_Name_Space.cpp +++ b/ace/Remote_Name_Space.cpp @@ -42,14 +42,14 @@ ACE_Remote_Name_Space::bind (const ACE_WString &name, const char *type) { ACE_TRACE ("ACE_Remote_Name_Space::bind"); - ACE_Name_Request request (ACE_Name_Request::BIND, name.fast_rep (), + ACE_Name_Request request (ACE_Name_Request::BIND, + name.fast_rep (), name.length () * sizeof (ACE_USHORT16), value.fast_rep (), value.length () * sizeof (ACE_USHORT16), type, ACE_OS::strlen (type)); - int result = this->ns_proxy_.request_reply (request); - return result == ACE_Name_Reply::ACE_SUCCESS ? 0 : result; + return this->ns_proxy_.request_reply (request); } int @@ -58,14 +58,14 @@ ACE_Remote_Name_Space::rebind (const ACE_WString &name, const char *type) { ACE_TRACE ("ACE_Remote_Name_Space::rebind"); - ACE_Name_Request request (ACE_Name_Request::REBIND, name.fast_rep (), + ACE_Name_Request request (ACE_Name_Request::REBIND, + name.fast_rep (), name.length () * sizeof (ACE_USHORT16), value.fast_rep (), value.length () * sizeof (ACE_USHORT16), type, ACE_OS::strlen (type)); - int result = this->ns_proxy_.request_reply (request); - return result == ACE_Name_Reply::ACE_SUCCESS ? 0 : result; + return this->ns_proxy_.request_reply (request); } int @@ -74,7 +74,8 @@ ACE_Remote_Name_Space::resolve (const ACE_WString &name, char *&type) { ACE_TRACE ("ACE_Remote_Name_Space::resolve"); - ACE_Name_Request request (ACE_Name_Request::RESOLVE, name.fast_rep (), + ACE_Name_Request request (ACE_Name_Request::RESOLVE, + name.fast_rep (), name.length () * sizeof (ACE_USHORT16), 0, 0, 0, 0); @@ -88,9 +89,10 @@ ACE_Remote_Name_Space::resolve (const ACE_WString &name, ACE_WString temp (reply.value (), reply.value_len () / sizeof (ACE_USHORT16)); value = temp; - ACE_NEW_RETURN (type, char[reply.type_len ()+1], -1); + ACE_NEW_RETURN (type, + char[reply.type_len () + 1], + -1); ACE_OS::strcpy (type, reply.type ()); - return 0; } @@ -98,12 +100,11 @@ int ACE_Remote_Name_Space::unbind (const ACE_WString &name) { ACE_TRACE ("ACE_Remote_Name_Space::unbind"); - ACE_Name_Request request (ACE_Name_Request::UNBIND, name.fast_rep (), + ACE_Name_Request request (ACE_Name_Request::UNBIND, + name.fast_rep (), name.length () * sizeof (ACE_USHORT16), 0, 0, 0, 0); - - int result = this->ns_proxy_.request_reply (request); - return result == ACE_Name_Reply::ACE_SUCCESS ? 0 : result; + return this->ns_proxy_.request_reply (request); } int @@ -111,10 +112,10 @@ ACE_Remote_Name_Space::list_names (ACE_WSTRING_SET &set, const ACE_WString &pattern) { ACE_TRACE ("ACE_Remote_Name_Space::list_names"); - ACE_Name_Request request (ACE_Name_Request::LIST_NAMES, pattern.fast_rep (), + ACE_Name_Request request (ACE_Name_Request::LIST_NAMES, + pattern.fast_rep (), pattern.length () * sizeof (ACE_USHORT16), 0, 0, 0, 0); - if (this->ns_proxy_.send_request (request) == -1) return -1; @@ -123,13 +124,14 @@ ACE_Remote_Name_Space::list_names (ACE_WSTRING_SET &set, while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) { if (this->ns_proxy_.recv_reply (reply) == -1) - { - ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Remote_Name_Space::list_names"))); - return -1; - } + ACE_ERROR_RETURN ((LM_ERROR, + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_Remote_Name_Space::list_names")), + -1); if (reply.msg_type () != ACE_Name_Request::MAX_ENUM) { - ACE_WString name (reply.name (), reply.name_len () / sizeof (ACE_USHORT16)); + ACE_WString name (reply.name (), + reply.name_len () / sizeof (ACE_USHORT16)); set.insert (name); } } @@ -141,10 +143,10 @@ ACE_Remote_Name_Space::list_values (ACE_WSTRING_SET &set, const ACE_WString &pattern) { ACE_TRACE ("ACE_Remote_Name_Space::list_values"); - ACE_Name_Request request (ACE_Name_Request::LIST_VALUES, pattern.fast_rep (), + ACE_Name_Request request (ACE_Name_Request::LIST_VALUES, + pattern.fast_rep (), pattern.length () * sizeof (ACE_USHORT16), 0, 0, 0, 0); - if (this->ns_proxy_.send_request (request) == -1) return -1; @@ -153,16 +155,18 @@ ACE_Remote_Name_Space::list_values (ACE_WSTRING_SET &set, while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) { if (this->ns_proxy_.recv_reply (reply) == -1) - { - ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Remote_Name_Space::list_values"))); - return -1; - } + ACE_ERROR_RETURN ((LM_ERROR, + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_Remote_Name_Space::list_values")), + -1); if (reply.msg_type () != ACE_Name_Request::MAX_ENUM) { - ACE_WString value (reply.value (), reply.value_len () / sizeof (ACE_USHORT16)); + ACE_WString value (reply.value (), + reply.value_len () / sizeof (ACE_USHORT16)); set.insert (value); } } + return 0; } @@ -171,7 +175,8 @@ ACE_Remote_Name_Space::list_types (ACE_WSTRING_SET &set, const ACE_WString &pattern) { ACE_TRACE ("ACE_Remote_Name_Space::list_types"); - ACE_Name_Request request (ACE_Name_Request::LIST_TYPES, pattern.fast_rep (), + ACE_Name_Request request (ACE_Name_Request::LIST_TYPES, + pattern.fast_rep (), pattern.length () * sizeof (ACE_USHORT16), 0, 0, 0, 0); @@ -183,16 +188,17 @@ ACE_Remote_Name_Space::list_types (ACE_WSTRING_SET &set, while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) { if (this->ns_proxy_.recv_reply (reply) == -1) - { - ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Remote_Name_Space::list_values"))); - return -1; - } + ACE_ERROR_RETURN ((LM_ERROR, + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_Remote_Name_Space::list_values")), + -1); if (reply.msg_type () != ACE_Name_Request::MAX_ENUM) { ACE_WString type (reply.type ()); set.insert (type); } } + return 0; } @@ -201,7 +207,8 @@ ACE_Remote_Name_Space::list_name_entries (ACE_BINDING_SET &set, const ACE_WString &pattern) { ACE_TRACE ("ACE_Remote_Name_Space::list_names"); - ACE_Name_Request request (ACE_Name_Request::LIST_NAME_ENTRIES, pattern.fast_rep (), + ACE_Name_Request request (ACE_Name_Request::LIST_NAME_ENTRIES, + pattern.fast_rep (), pattern.length () * sizeof (ACE_USHORT16), 0, 0, 0, 0); @@ -213,16 +220,19 @@ ACE_Remote_Name_Space::list_name_entries (ACE_BINDING_SET &set, while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) { if (this->ns_proxy_.recv_reply (reply) == -1) - { - ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Remote_Name_Space::list_names"))); - return -1; - } + ACE_ERROR_RETURN ((LM_ERROR, + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_Remote_Name_Space::list_names")), + -1); if (reply.msg_type () != ACE_Name_Request::MAX_ENUM) { - ACE_WString name (reply.name (), reply.name_len () / sizeof (ACE_USHORT16)); - ACE_WString value (reply.value (), reply.value_len () / sizeof (ACE_USHORT16)); - ACE_Name_Binding entry (name, value, reply.type ()); - + ACE_WString name (reply.name (), + reply.name_len () / sizeof (ACE_USHORT16)); + ACE_WString value (reply.value (), + reply.value_len () / sizeof (ACE_USHORT16)); + ACE_Name_Binding entry (name, + value, + reply.type ()); if (set.insert (entry) == -1) return -1; } @@ -235,7 +245,8 @@ ACE_Remote_Name_Space::list_value_entries (ACE_BINDING_SET &set, const ACE_WString &pattern) { ACE_TRACE ("ACE_Remote_Name_Space::list_values"); - ACE_Name_Request request (ACE_Name_Request::LIST_VALUE_ENTRIES, pattern.fast_rep (), + ACE_Name_Request request (ACE_Name_Request::LIST_VALUE_ENTRIES, + pattern.fast_rep (), pattern.length () * sizeof (ACE_USHORT16), 0, 0, 0, 0); @@ -247,16 +258,19 @@ ACE_Remote_Name_Space::list_value_entries (ACE_BINDING_SET &set, while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) { if (this->ns_proxy_.recv_reply (reply) == -1) - { - ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Remote_Name_Space::list_values"))); - return -1; - } + ACE_ERROR_RETURN ((LM_ERROR, + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_Remote_Name_Space::list_values")), + -1); if (reply.msg_type () != ACE_Name_Request::MAX_ENUM) { - ACE_WString name (reply.name (), reply.name_len () / sizeof (ACE_USHORT16)); - ACE_WString value (reply.value (), reply.value_len () / sizeof (ACE_USHORT16)); - ACE_Name_Binding entry (name, value, reply.type()); - + ACE_WString name (reply.name (), + reply.name_len () / sizeof (ACE_USHORT16)); + ACE_WString value (reply.value (), + reply.value_len () / sizeof (ACE_USHORT16)); + ACE_Name_Binding entry (name, + value, + reply.type()); if (set.insert (entry) == -1) return -1; } @@ -269,7 +283,8 @@ ACE_Remote_Name_Space::list_type_entries (ACE_BINDING_SET &set, const ACE_WString &pattern) { ACE_TRACE ("ACE_Remote_Name_Space::list_types"); - ACE_Name_Request request (ACE_Name_Request::LIST_TYPE_ENTRIES, pattern.fast_rep (), + ACE_Name_Request request (ACE_Name_Request::LIST_TYPE_ENTRIES, + pattern.fast_rep (), pattern.length () * sizeof (ACE_USHORT16), 0, 0, 0, 0); @@ -281,16 +296,19 @@ ACE_Remote_Name_Space::list_type_entries (ACE_BINDING_SET &set, while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) { if (this->ns_proxy_.recv_reply (reply) == -1) - { - ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Remote_Name_Space::list_values"))); - return -1; - } + ACE_ERROR_RETURN ((LM_ERROR, + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_Remote_Name_Space::list_values")), + -1); if (reply.msg_type () != ACE_Name_Request::MAX_ENUM) { - ACE_WString name (reply.name (), reply.name_len () / sizeof (ACE_USHORT16)); - ACE_WString value (reply.value (), reply.value_len () / sizeof (ACE_USHORT16)); - ACE_Name_Binding entry (name, value, reply.type()); - + ACE_WString name (reply.name (), + reply.name_len () / sizeof (ACE_USHORT16)); + ACE_WString value (reply.value (), + reply.value_len () / sizeof (ACE_USHORT16)); + ACE_Name_Binding entry (name, + value, + reply.type ()); if (set.insert (entry) == -1) return -1; } @@ -298,7 +316,6 @@ ACE_Remote_Name_Space::list_type_entries (ACE_BINDING_SET &set, return 0; } - ACE_Remote_Name_Space::~ACE_Remote_Name_Space (void) { ACE_TRACE ("ACE_Remote_Name_Space::~ACE_Remote_Name_Space"); |