diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2000-04-25 22:22:22 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2000-04-25 22:22:22 +0000 |
commit | 465795116f44a6e26c83209715ad3951356b7f81 (patch) | |
tree | a6d1ef47bc8463b29f3b721bb118818b9f5b0c88 /TAO/tao | |
parent | 602d362d1a80be71dd5f02d6581ab944079dae7a (diff) | |
download | ATCD-465795116f44a6e26c83209715ad3951356b7f81.tar.gz |
ChangeLogTag:Tue Apr 25 15:05:48 2000 Ossama Othman <ossama@uci.edu>
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/Connector_Registry.cpp | 5 | ||||
-rw-r--r-- | TAO/tao/IIOP_Profile.cpp | 78 | ||||
-rw-r--r-- | TAO/tao/IIOP_Profile.h | 38 | ||||
-rw-r--r-- | TAO/tao/IIOP_Profile.i | 11 | ||||
-rw-r--r-- | TAO/tao/Object.cpp | 61 | ||||
-rw-r--r-- | TAO/tao/Profile.h | 5 | ||||
-rw-r--r-- | TAO/tao/SHMIOP_Profile.cpp | 74 | ||||
-rw-r--r-- | TAO/tao/SHMIOP_Profile.h | 35 | ||||
-rw-r--r-- | TAO/tao/SHMIOP_Profile.i | 13 | ||||
-rw-r--r-- | TAO/tao/UIOP_Profile.cpp | 38 | ||||
-rw-r--r-- | TAO/tao/UIOP_Profile.h | 34 | ||||
-rw-r--r-- | TAO/tao/UIOP_Profile.i | 7 |
12 files changed, 167 insertions, 232 deletions
diff --git a/TAO/tao/Connector_Registry.cpp b/TAO/tao/Connector_Registry.cpp index 8d310d40479..1a89726d964 100644 --- a/TAO/tao/Connector_Registry.cpp +++ b/TAO/tao/Connector_Registry.cpp @@ -382,7 +382,10 @@ char TAO_Connector_Registry::object_key_delimiter (const char *ior) { if (!ior) - return 0; // Failure: Null IOR string pointer + { + errno = EINVAL; + return 0; // Failure: Null IOR string pointer + } TAO_ConnectorSetIterator first_connector = this->begin (); TAO_ConnectorSetIterator last_connector = this->end (); diff --git a/TAO/tao/IIOP_Profile.cpp b/TAO/tao/IIOP_Profile.cpp index 4de666651ab..2d5eee57d4a 100644 --- a/TAO/tao/IIOP_Profile.cpp +++ b/TAO/tao/IIOP_Profile.cpp @@ -63,20 +63,6 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const char* host, this->host_ = host; } -TAO_IIOP_Profile::TAO_IIOP_Profile (const TAO_IIOP_Profile &pfile) - : TAO_Profile (pfile.tag ()), - host_ (pfile.host_), - port_ (pfile.port_), - version_ (pfile.version_), - object_key_ (pfile.object_key_), - object_addr_ (pfile.object_addr_), - hint_ (pfile.hint_), - orb_core_ (pfile.orb_core_) -{ - // @@ Do we need this copy constructor? Won't the default copy - // constructor work just as well? -Ossama -} - TAO_IIOP_Profile::TAO_IIOP_Profile (const char *string, TAO_ORB_Core *orb_core, CORBA::Environment &ACE_TRY_ENV) @@ -89,7 +75,7 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const char *string, hint_ (0), orb_core_ (orb_core) { - parse_string (string, ACE_TRY_ENV); + this->parse_string (string, ACE_TRY_ENV); ACE_CHECK; } @@ -108,26 +94,29 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (TAO_ORB_Core *orb_core) int TAO_IIOP_Profile::set (const ACE_INET_Addr &addr) { - this->port_ = addr.get_port_number(); + char tmp_host[MAXHOSTNAMELEN + 1]; - if (this->orb_core_->orb_params ()->use_dotted_decimal_addresses ()) + if (this->orb_core_->orb_params ()->use_dotted_decimal_addresses () + || addr.get_host_name (tmp_host, sizeof (tmp_host)) != 0) { - const char *temp = addr.get_host_addr (); - if (temp == 0) - return -1; + const char *tmp = addr.get_host_addr (); + if (tmp == 0) + { + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("\n\nTAO (%P|%t) ") + ACE_TEXT ("IIOP_Profile::set ") + ACE_TEXT ("- %p\n\n"), + ACE_TEXT ("cannot determine hostname"))); + return -1; + } else - this->host_ = temp; + this->host_ = tmp; } else - { - char temphost[MAXHOSTNAMELEN + 1]; - - if (addr.get_host_name (temphost, - sizeof temphost) != 0) - return -1; + this->host_ = CORBA::string_dup (tmp_host); - this->host_ = CORBA::string_dup (temphost); - } + this->port_ = addr.get_port_number(); return 0; } @@ -357,14 +346,11 @@ CORBA::ULong TAO_IIOP_Profile::hash (CORBA::ULong max, CORBA::Environment &) { - CORBA::ULong hashval; - - // Just grab a bunch of convenient bytes and hash them; could do - // more (hostname, full key, exponential hashing) but no real need - // to do so except if performance requires a more costly hash. - - hashval = this->object_key_.length () * this->port_; - hashval += this->version_.minor; + CORBA::ULong hashval = + ACE::hash_pjw (this->host_.in ()) + + this->port_ + + this->version_.minor + + this->tag (); if (this->object_key_.length () >= 4) { @@ -408,28 +394,12 @@ TAO_IIOP_Profile::reset_hint (void) this->hint_->cleanup_hint ((void **) &this->hint_); } -TAO_IIOP_Profile & -TAO_IIOP_Profile::operator= (const TAO_IIOP_Profile &src) -{ - this->version_ = src.version_; - - this->object_key_ = src.object_key_; - - this->object_addr_.set (src.object_addr_); - - this->port_ = src.port_; - - this->host_ = src.host_; - - return *this; -} - char * TAO_IIOP_Profile::to_string (CORBA::Environment &) { CORBA::String_var key; TAO_POA::encode_sequence_to_string (key.inout(), - this->object_key ()); + this->object_key_); u_int buflen = (ACE_OS::strlen (::prefix_) + 3 /* "loc" */ + diff --git a/TAO/tao/IIOP_Profile.h b/TAO/tao/IIOP_Profile.h index a8a78e79c75..d1502b8070d 100644 --- a/TAO/tao/IIOP_Profile.h +++ b/TAO/tao/IIOP_Profile.h @@ -72,15 +72,10 @@ public: TAO_IIOP_Profile (const char *string, TAO_ORB_Core *orb_core, - CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment ()); // Create object using a string ior. - TAO_IIOP_Profile (const TAO_IIOP_Profile &pfile); - // Profile copy constructor - - TAO_IIOP_Profile &operator= (const TAO_IIOP_Profile &src); - // Copy operator. - TAO_IIOP_Profile (TAO_ORB_Core *orb_core); // Profile constructor, default. @@ -88,10 +83,12 @@ public: // Destructor is to be called only through <_decr_refcnt>. int parse_string (const char *string, - CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment ()); // Initialize this object using the given input string. - char * to_string (CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); + char * to_string (CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment ()); // Return a string representation for this profile. // client must deallocate memory. @@ -101,14 +98,12 @@ public: virtual int encode (TAO_OutputCDR &stream) const; // Encode this profile in a stream, i.e. marshal it. - const TAO_ObjectKey &object_key (void) const; - // @@ deprecated, return a reference to the Object Key. - - TAO_ObjectKey &object_key (TAO_ObjectKey& objkey); - // @@ deprecated. set the Object Key. + virtual const TAO_ObjectKey &object_key (void) const; + // @@ deprecated. return a reference to the Object Key. TAO_ObjectKey *_key (void) const; - // Return a pointer to the Object Key. + // Return a pointer to the Object Key. The caller owns the memory + // allocated for the returned key. CORBA::Boolean is_equivalent (const TAO_Profile *other_profile); // Return true if this profile is equivalent to other_profile. Two @@ -116,7 +111,8 @@ public: // version are the same. CORBA::ULong hash (CORBA::ULong max, - CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment ()); // Return a hash value for this object. int addr_to_string (char *buffer, size_t length); @@ -125,15 +121,15 @@ public: const ACE_INET_Addr &object_addr (void) const; // return a reference to the object_addr. - const char *host (void); + const char *host (void) const; // Return a pointer to the host string. This object maintains // ownership of this string. const char *host (const char *h); - // Copy the string h into host and return the resulting pointer. + // Copy the string h into <host_> and return the resulting pointer. // This object maintains ownership of this string. - CORBA::UShort port (void); + CORBA::UShort port (void) const; // Return the port number. CORBA::UShort port (CORBA::UShort p); @@ -153,6 +149,10 @@ private: int set (const ACE_INET_Addr &addr); // helper method to set the INET_Addr. + ACE_UNIMPLEMENTED_FUNC (TAO_IIOP_Profile (const TAO_IIOP_Profile &)) + ACE_UNIMPLEMENTED_FUNC (TAO_IIOP_Profile & operator= (const TAO_IIOP_Profile &)) + // Profiles should not be copied. + private: CORBA::String_var host_; diff --git a/TAO/tao/IIOP_Profile.i b/TAO/tao/IIOP_Profile.i index bc461ad8c0d..d3f233336a7 100644 --- a/TAO/tao/IIOP_Profile.i +++ b/TAO/tao/IIOP_Profile.i @@ -7,13 +7,6 @@ TAO_IIOP_Profile::object_key (void) const return this->object_key_; } -ACE_INLINE TAO_ObjectKey & -TAO_IIOP_Profile::object_key (TAO_ObjectKey& objkey) -{ - this->object_key_ = objkey; - return this->object_key_; -} - ACE_INLINE TAO_ObjectKey * TAO_IIOP_Profile::_key (void) const { @@ -33,13 +26,13 @@ TAO_IIOP_Profile::object_addr (void) const } ACE_INLINE const char * -TAO_IIOP_Profile::host (void) +TAO_IIOP_Profile::host (void) const { return this->host_.in (); } ACE_INLINE CORBA::UShort -TAO_IIOP_Profile::port (void) +TAO_IIOP_Profile::port (void) const { return this->port_; } diff --git a/TAO/tao/Object.cpp b/TAO/tao/Object.cpp index f11540b3336..07bd7de2fda 100644 --- a/TAO/tao/Object.cpp +++ b/TAO/tao/Object.cpp @@ -110,7 +110,12 @@ CORBA_Object::_is_a (const CORBA::Char *type_id, TAO_Stub *istub = this->_stubobj (); if (istub == 0) - ACE_THROW_RETURN (CORBA::INTERNAL (), _tao_retval); + ACE_THROW_RETURN (CORBA::INTERNAL ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + EINVAL), + CORBA::COMPLETED_NO), + _tao_retval); TAO_GIOP_Twoway_Invocation _tao_call ( @@ -224,12 +229,22 @@ CORBA_Object::_is_equivalent (CORBA_Object_ptr other_obj, // TAO's extensions TAO_ObjectKey * -CORBA::Object::_key (CORBA::Environment &) +CORBA::Object::_key (CORBA::Environment &ACE_TRY_ENV) { if (this->_stubobj () && this->_stubobj ()->profile_in_use ()) return this->_stubobj ()->profile_in_use ()->_key (); - ACE_ERROR_RETURN((LM_ERROR, ACE_TEXT ("(%P|%t) Null stub obj!!!\n")), 0); + if (TAO_debug_level > 2) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("TAO (%P|%t) Null object key return from ") + ACE_TEXT ("profile in use\n"))); + + ACE_THROW_RETURN (CORBA::INTERNAL ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + EINVAL), + CORBA::COMPLETED_NO), + 0); } const TAO_ObjectKey & @@ -288,7 +303,12 @@ CORBA_Object::_non_existent (CORBA::Environment &ACE_TRY_ENV) // propagating the exception. TAO_Stub *istub = this->_stubobj (); if (istub == 0) - ACE_THROW_RETURN (CORBA::INTERNAL (), _tao_retval); + ACE_THROW_RETURN (CORBA::INTERNAL ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + EINVAL), + CORBA::COMPLETED_NO), + _tao_retval); TAO_GIOP_Twoway_Invocation _tao_call ( @@ -358,7 +378,7 @@ CORBA_Object::_create_request (CORBA::Context_ptr ctx, // Neither can we create a request object from locality constraint // object references. if (ctx || this->protocol_proxy_ == 0) - ACE_THROW (CORBA::NO_IMPLEMENT ()); + ACE_THROW (CORBA::NO_IMPLEMENT ()); ACE_NEW_THROW_EX (request, CORBA::Request (this, @@ -368,7 +388,11 @@ CORBA_Object::_create_request (CORBA::Context_ptr ctx, result, req_flags, ACE_TRY_ENV), - CORBA::NO_MEMORY ()); + CORBA::NO_MEMORY ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + ENOMEM), + CORBA::COMPLETED_MAYBE)); } void @@ -397,7 +421,11 @@ CORBA_Object::_create_request (CORBA::Context_ptr ctx, result, req_flags, ACE_TRY_ENV), - CORBA::NO_MEMORY ()); + CORBA::NO_MEMORY ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + ENOMEM), + CORBA::COMPLETED_MAYBE)); } CORBA::Request_ptr @@ -413,7 +441,11 @@ CORBA_Object::_request (const CORBA::Char *operation, this->protocol_proxy_->orb_core ()->orb (), operation, ACE_TRY_ENV), - CORBA::NO_MEMORY ()); + CORBA::NO_MEMORY ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + ENOMEM), + CORBA::COMPLETED_MAYBE)); ACE_CHECK_RETURN (CORBA::Request::_nil ()); return req; @@ -431,7 +463,12 @@ CORBA_Object::_get_interface (CORBA::Environment &ACE_TRY_ENV) TAO_Stub *istub = this->_stubobj (); if (istub == 0) - ACE_THROW_RETURN (CORBA::INTERNAL (), _tao_retval); + ACE_THROW_RETURN (CORBA::INTERNAL ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + EINVAL), + CORBA::COMPLETED_NO), + _tao_retval); TAO_GIOP_Twoway_Invocation _tao_call ( @@ -539,7 +576,11 @@ CORBA_Object::_set_policy_overrides ( CORBA_Object (stub, this->servant_, this->is_collocated_), - CORBA::NO_MEMORY ()); + CORBA::NO_MEMORY ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + ENOMEM), + CORBA::COMPLETED_MAYBE)); ACE_CHECK_RETURN (CORBA::Object::_nil ()); return obj; diff --git a/TAO/tao/Profile.h b/TAO/tao/Profile.h index 6440c6bac74..17314a326e9 100644 --- a/TAO/tao/Profile.h +++ b/TAO/tao/Profile.h @@ -71,7 +71,7 @@ public: virtual int parse_string (const char *string, CORBA::Environment &ACE_TRY_ENV) = 0; // Initialize this object using the given input string. - // Supports URL stylr of object references + // Supports URL style of object references virtual char* to_string (CORBA::Environment &ACE_TRY_ENV) = 0; // Return a string representation for this profile. client must @@ -86,9 +86,6 @@ public: virtual const TAO_ObjectKey &object_key (void) const = 0; // @@ deprecated. return a reference to the Object Key. - TAO_ObjectKey &object_key (TAO_ObjectKey& objkey); - // @@ deprecated. set the Object Key. - virtual TAO_ObjectKey *_key (void) const = 0; // Obtain the object key, return 0 if the profile cannot be parsed. // The memory is owned by the caller! diff --git a/TAO/tao/SHMIOP_Profile.cpp b/TAO/tao/SHMIOP_Profile.cpp index ffbe9fb41cc..a25530eab77 100644 --- a/TAO/tao/SHMIOP_Profile.cpp +++ b/TAO/tao/SHMIOP_Profile.cpp @@ -64,18 +64,6 @@ TAO_SHMIOP_Profile::TAO_SHMIOP_Profile (const char* host, this->host_ = host; } -TAO_SHMIOP_Profile::TAO_SHMIOP_Profile (const TAO_SHMIOP_Profile &pfile) - : TAO_Profile (pfile.tag ()), - host_ (pfile.host_), - port_ (pfile.port_), - version_ (pfile.version_), - object_key_ (pfile.object_key_), - object_addr_ (pfile.object_addr_), - hint_ (pfile.hint_), - orb_core_ (pfile.orb_core_) -{ -} - TAO_SHMIOP_Profile::TAO_SHMIOP_Profile (const char *string, TAO_ORB_Core *orb_core, CORBA::Environment &ACE_TRY_ENV) @@ -107,26 +95,29 @@ TAO_SHMIOP_Profile::TAO_SHMIOP_Profile (TAO_ORB_Core *orb_core) int TAO_SHMIOP_Profile::set (const ACE_INET_Addr &addr) { - this->port_ = addr.get_port_number(); + char tmp_host[MAXHOSTNAMELEN + 1]; - if (this->orb_core_->orb_params ()->use_dotted_decimal_addresses ()) + if (this->orb_core_->orb_params ()->use_dotted_decimal_addresses () + || addr.get_host_name (tmp_host, sizeof (tmp_host)) != 0) { - const char *temp = addr.get_host_addr (); - if (temp == 0) - return -1; + const char *tmp = addr.get_host_addr (); + if (tmp == 0) + { + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("\n\nTAO (%P|%t) ") + ACE_TEXT ("SHMIOP_Profile::set ") + ACE_TEXT ("- %p\n\n"), + ACE_TEXT ("cannot determine hostname"))); + return -1; + } else - this->host_ = temp; + this->host_ = tmp; } else - { - char temphost[MAXHOSTNAMELEN + 1]; - - if (addr.get_host_name (temphost, - sizeof temphost) != 0) - return -1; + this->host_ = CORBA::string_dup (tmp_host); - this->host_ = CORBA::string_dup (temphost); - } + this->port_ = addr.get_port_number(); return 0; } @@ -351,14 +342,11 @@ CORBA::ULong TAO_SHMIOP_Profile::hash (CORBA::ULong max, CORBA::Environment &) { - CORBA::ULong hashval; - - // Just grab a bunch of convenient bytes and hash them; could do - // more (hostname, full key, exponential hashing) but no real need - // to do so except if performance requires a more costly hash. - - hashval = this->object_key_.length () * this->port_; - hashval += this->version_.minor; + CORBA::ULong hashval = + ACE::hash_pjw (this->host_.in ()) + + this->port_ + + this->version_.minor + + this->tag (); if (this->object_key_.length () >= 4) { @@ -402,28 +390,12 @@ TAO_SHMIOP_Profile::reset_hint (void) this->hint_->cleanup_hint ((void **) &this->hint_); } -TAO_SHMIOP_Profile & -TAO_SHMIOP_Profile::operator= (const TAO_SHMIOP_Profile &src) -{ - this->version_ = src.version_; - - this->object_key_ = src.object_key_; - - this->object_addr_.set (src.object_addr_); - - this->port_ = src.port_; - - this->host_ = src.host_; - - return *this; -} - char * TAO_SHMIOP_Profile::to_string (CORBA::Environment &) { CORBA::String_var key; TAO_POA::encode_sequence_to_string (key.inout(), - this->object_key ()); + this->object_key_); u_int buflen = (ACE_OS::strlen (::prefix_) + 3 /* "loc" */ + diff --git a/TAO/tao/SHMIOP_Profile.h b/TAO/tao/SHMIOP_Profile.h index f026e2e5599..9237c47da91 100644 --- a/TAO/tao/SHMIOP_Profile.h +++ b/TAO/tao/SHMIOP_Profile.h @@ -77,12 +77,6 @@ public: CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); // Create object using a string ior. - TAO_SHMIOP_Profile (const TAO_SHMIOP_Profile &pfile); - // Profile copy constructor - - TAO_SHMIOP_Profile &operator= (const TAO_SHMIOP_Profile &src); - // Copy operator. - TAO_SHMIOP_Profile (TAO_ORB_Core *orb_core); // Profile constructor, default. @@ -90,10 +84,12 @@ public: // Destructor is to be called only through <_decr_refcnt>. int parse_string (const char *string, - CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment ()); // Initialize this object using the given input string. - char * to_string (CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); + char * to_string (CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment ()); // Return a string representation for this profile. // client must deallocate memory. @@ -103,14 +99,12 @@ public: virtual int encode (TAO_OutputCDR &stream) const; // Encode this profile in a stream, i.e. marshal it. - const TAO_ObjectKey &object_key (void) const; - // @@ deprecated, return a reference to the Object Key. - - TAO_ObjectKey &object_key (TAO_ObjectKey& objkey); - // @@ deprecated. set the Object Key. + virtual const TAO_ObjectKey &object_key (void) const; + // @@ deprecated. return a reference to the Object Key. TAO_ObjectKey *_key (void) const; - // Return a pointer to the Object Key. + // Return a pointer to the Object Key. The caller owns the memory + // allocated for the returned key. CORBA::Boolean is_equivalent (const TAO_Profile *other_profile); // Return true if this profile is equivalent to other_profile. Two @@ -118,7 +112,8 @@ public: // version are the same. CORBA::ULong hash (CORBA::ULong max, - CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment ()); // Return a hash value for this object. int addr_to_string (char *buffer, size_t length); @@ -127,15 +122,15 @@ public: const ACE_INET_Addr &object_addr (void) const; // return a reference to the object_addr. - const char *host (void); + const char *host (void) const; // Return a pointer to the host string. This object maintains // ownership of this string. const char *host (const char *h); - // Copy the string h into host and return the resulting pointer. + // Copy the string h into <host_> and return the resulting pointer. // This object maintains ownership of this string. - CORBA::UShort port (void); + CORBA::UShort port (void) const; // Return the port number. CORBA::UShort port (CORBA::UShort p); @@ -155,6 +150,10 @@ private: int set (const ACE_INET_Addr &addr); // helper method to set the INET_Addr. + ACE_UNIMPLEMENTED_FUNC (TAO_SHMIOP_Profile (const TAO_SHMIOP_Profile &)) + ACE_UNIMPLEMENTED_FUNC (TAO_SHMIOP_Profile & operator= (const TAO_SHMIOP_Profile &)) + // Profiles should not be copied. + private: CORBA::String_var host_; diff --git a/TAO/tao/SHMIOP_Profile.i b/TAO/tao/SHMIOP_Profile.i index 51431472f09..8bac34bc175 100644 --- a/TAO/tao/SHMIOP_Profile.i +++ b/TAO/tao/SHMIOP_Profile.i @@ -7,13 +7,6 @@ TAO_SHMIOP_Profile::object_key (void) const return this->object_key_; } -ACE_INLINE TAO_ObjectKey & -TAO_SHMIOP_Profile::object_key (TAO_ObjectKey& objkey) -{ - this->object_key_ = objkey; - return this->object_key_; -} - ACE_INLINE TAO_ObjectKey * TAO_SHMIOP_Profile::_key (void) const { @@ -33,13 +26,13 @@ TAO_SHMIOP_Profile::object_addr (void) const } ACE_INLINE const char * -TAO_SHMIOP_Profile::host (void) +TAO_SHMIOP_Profile::host (void) const { return this->host_.in (); } ACE_INLINE CORBA::UShort -TAO_SHMIOP_Profile::port (void) +TAO_SHMIOP_Profile::port (void) const { return this->port_; } @@ -57,7 +50,7 @@ TAO_SHMIOP_Profile::version (void) const } ACE_INLINE TAO_SHMIOP_Client_Connection_Handler *& -TAO_SHMIOP_Profile::hint(void) +TAO_SHMIOP_Profile::hint (void) { return this->hint_; } diff --git a/TAO/tao/UIOP_Profile.cpp b/TAO/tao/UIOP_Profile.cpp index 38047b4830e..b83b8663937 100644 --- a/TAO/tao/UIOP_Profile.cpp +++ b/TAO/tao/UIOP_Profile.cpp @@ -57,16 +57,6 @@ TAO_UIOP_Profile::TAO_UIOP_Profile (const char *, { } -TAO_UIOP_Profile::TAO_UIOP_Profile (const TAO_UIOP_Profile &pfile) - : TAO_Profile (pfile.tag ()), - version_ (pfile.version_), - object_key_ (pfile.object_key_), - object_addr_ (pfile.object_addr_), - hint_ (pfile.hint_), - orb_core_ (pfile.orb_core_) -{ -} - TAO_UIOP_Profile::TAO_UIOP_Profile (const char *string, TAO_ORB_Core *orb_core, CORBA::Environment &ACE_TRY_ENV) @@ -201,16 +191,10 @@ CORBA::ULong TAO_UIOP_Profile::hash (CORBA::ULong max, CORBA::Environment &) { - CORBA::ULong hashval = 0; - - // Just grab a bunch of convenient bytes and hash them; could do - // more (rendezvous_point, full key, exponential hashing) - // but no real need to do so except if performance requires a more - // costly hash. - - hashval = this->object_key_.length () * - ACE_OS::atoi (this->rendezvous_point ()); // @@ Is this valid? - hashval += this->version_.minor; + CORBA::ULong hashval = + ACE::hash_pjw (this->rendezvous_point ()) + + this->version_.minor + + this->tag (); if (this->object_key_.length () >= 4) { @@ -239,24 +223,12 @@ TAO_UIOP_Profile::reset_hint (void) this->hint_->cleanup_hint ((void **) &this->hint_); } -TAO_UIOP_Profile & -TAO_UIOP_Profile::operator= (const TAO_UIOP_Profile &src) -{ - this->version_ = src.version_; - - this->object_key_ = src.object_key_; - - this->object_addr_.set (src.object_addr_); - - return *this; -} - char * TAO_UIOP_Profile::to_string (CORBA::Environment &) { CORBA::String_var key; TAO_POA::encode_sequence_to_string (key.inout(), - this->object_key ()); + this->object_key_); u_int buflen = (ACE_OS::strlen (::prefix_) + 3 /* "loc" */ + diff --git a/TAO/tao/UIOP_Profile.h b/TAO/tao/UIOP_Profile.h index 29e57637599..dce95a60d34 100644 --- a/TAO/tao/UIOP_Profile.h +++ b/TAO/tao/UIOP_Profile.h @@ -71,26 +71,23 @@ public: TAO_UIOP_Profile (const char *string, TAO_ORB_Core *orb_core, - CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment ()); // Create object using a string ior. - TAO_UIOP_Profile (const TAO_UIOP_Profile &pfile); - // Profile copy constructor - TAO_UIOP_Profile (TAO_ORB_Core *orb_core); // Profile constructor, default. - TAO_UIOP_Profile & operator= (const TAO_UIOP_Profile &src); - // Assignment operator - ~TAO_UIOP_Profile (void); // Destructor is to be called only through <_decr_refcnt>. int parse_string (const char *string, - CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment ()); // Initialize this object using the given input string. - char * to_string (CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); + char * to_string (CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment ()); // Return a string representation for this profile. // client must deallocate memory. @@ -100,14 +97,12 @@ public: virtual int encode (TAO_OutputCDR &stream) const; // Encode this profile in a stream, i.e. marshal it. - const TAO_ObjectKey &object_key (void) const; - // @@ deprecated, return a reference to the Object Key. - - TAO_ObjectKey &object_key (TAO_ObjectKey& objkey); - // @@ deprecated. set the Object Key. + virtual const TAO_ObjectKey &object_key (void) const; + // @@ deprecated. return a reference to the Object Key. TAO_ObjectKey *_key (void) const; - // Return a pointer to the Object Key. + // Return a pointer to the Object Key. The caller owns the memory + // allocated for the returned key. CORBA::Boolean is_equivalent (const TAO_Profile *other_profile); // Return true if this profile is equivalent to other_profile. Two @@ -115,7 +110,8 @@ public: // and version are the same. CORBA::ULong hash (CORBA::ULong max, - CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); + CORBA::Environment &ACE_TRY_ENV = + TAO_default_environment ()); // Return a hash value for this object. int addr_to_string (char *buffer, size_t length); @@ -140,6 +136,12 @@ public: private: + ACE_UNIMPLEMENTED_FUNC (TAO_UIOP_Profile (const TAO_UIOP_Profile &)) + ACE_UNIMPLEMENTED_FUNC (TAO_UIOP_Profile & operator= (const TAO_UIOP_Profile &)) + // Profiles should not be copied. + +private: + TAO_GIOP_Version version_; // UIOP version number. diff --git a/TAO/tao/UIOP_Profile.i b/TAO/tao/UIOP_Profile.i index 04e3cb9859c..45f520ecaf6 100644 --- a/TAO/tao/UIOP_Profile.i +++ b/TAO/tao/UIOP_Profile.i @@ -9,13 +9,6 @@ TAO_UIOP_Profile::object_key (void) const return this->object_key_; } -ACE_INLINE TAO_ObjectKey & -TAO_UIOP_Profile::object_key (TAO_ObjectKey& objkey) -{ - this->object_key_ = objkey; - return this->object_key_; -} - ACE_INLINE TAO_ObjectKey * TAO_UIOP_Profile::_key (void) const { |