1 #include "tao/Strategies/COIOP_Endpoint.h"
3 #if defined (TAO_HAS_COIOP) && (TAO_HAS_COIOP != 0)
5 #include "tao/Strategies/COIOP_Connection_Handler.h"
7 #include "tao/ORB_Constants.h"
9 #include "ace/OS_NS_stdio.h"
10 #include "ace/OS_NS_string.h"
12 #if !defined (__ACE_INLINE__)
13 # include "tao/Strategies/COIOP_Endpoint.inl"
14 #endif /* __ACE_INLINE__ */
16 #include "ace/os_include/os_netdb.h"
18 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
20 TAO_COIOP_Endpoint::TAO_COIOP_Endpoint (const ACE_Utils::UUID
& uuid
)
21 : TAO_Endpoint (TAO_TAG_COIOP_PROFILE
)
27 TAO_COIOP_Endpoint::TAO_COIOP_Endpoint ()
28 : TAO_Endpoint (TAO_TAG_COIOP_PROFILE
),
35 TAO_COIOP_Endpoint::addr_to_string (char *buffer
, size_t length
)
37 const ACE_CString
*str
= uuid_
.to_string ();
38 size_t const actual_len
=
41 if (length
< actual_len
)
44 ACE_OS::sprintf (buffer
, "%s",
51 TAO_COIOP_Endpoint::next ()
57 TAO_COIOP_Endpoint::duplicate ()
59 TAO_COIOP_Endpoint
*endpoint
= 0;
61 ACE_NEW_RETURN (endpoint
,
62 TAO_COIOP_Endpoint (this->uuid_
),
69 TAO_COIOP_Endpoint::is_equivalent (const TAO_Endpoint
*other_endpoint
)
71 TAO_Endpoint
*endpt
= const_cast<TAO_Endpoint
*> (other_endpoint
);
73 TAO_COIOP_Endpoint
*endpoint
= dynamic_cast<TAO_COIOP_Endpoint
*> (endpt
);
77 return (this->uuid_
== endpoint
->uuid_
);
81 TAO_COIOP_Endpoint::hash ()
83 if (this->hash_val_
!= 0)
84 return this->hash_val_
;
87 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX
,
89 this->addr_lookup_lock_
,
92 if (this->hash_val_
!= 0)
93 return this->hash_val_
;
95 const ACE_CString
*stringval
= this->uuid_
.to_string ();
100 return this->hash_val_
;
103 TAO_END_VERSIONED_NAMESPACE_DECL
105 #endif /* TAO_HAS_COIOP && TAO_HAS_COIOP != 0 */