1 #include "tao/RTCORBA/RT_Transport_Descriptor.h"
2 #include "ace/OS_Memory.h"
4 #if ! defined (__ACE_INLINE__)
5 #include "tao/RTCORBA/RT_Transport_Descriptor.inl"
6 #endif /* __ACE_INLINE__ */
8 #include "tao/RTCORBA/RT_Transport_Descriptor_Property.h"
9 #include "tao/Endpoint.h"
11 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
13 TAO_RT_Transport_Descriptor::~TAO_RT_Transport_Descriptor ()
15 if (this->delete_properties_
== 1)
17 TAO_RT_Transport_Descriptor_Property
*current
=
22 TAO_RT_Transport_Descriptor_Property
*next
=
32 TAO_Transport_Descriptor_Interface
*
33 TAO_RT_Transport_Descriptor::duplicate ()
35 // Get a copy of the underlying endpoint
36 TAO_Endpoint
*endpoint
=
37 this->endpoint_
->duplicate ();
41 TAO_RT_Transport_Descriptor
*new_descriptor
= 0;
43 ACE_NEW_RETURN (new_descriptor
,
44 TAO_RT_Transport_Descriptor (endpoint
, 1),
47 // Copy the Properties.
48 TAO_RT_Transport_Descriptor_Property
*current_property
=
51 TAO_RT_Transport_Descriptor_Property
*current_new_property
= 0;
52 TAO_RT_Transport_Descriptor_Property
*new_property
= 0;
54 while (current_property
)
57 current_property
->duplicate ();
59 // Note that we cannot use <insert> because that will reverse the stack.
60 if (new_descriptor
->property_list_
== 0)
61 new_descriptor
->property_list_
= new_property
;
62 else if (current_new_property
!= 0)
63 current_new_property
->next_
= new_property
;
65 current_new_property
= new_property
;
66 current_property
= current_property
->next_
;
69 return new_descriptor
;
73 TAO_RT_Transport_Descriptor::is_equivalent (const TAO_Transport_Descriptor_Interface
*other_prop
)
75 const TAO_RT_Transport_Descriptor
*rhs
=
76 dynamic_cast<const TAO_RT_Transport_Descriptor
*> (other_prop
);
81 // Check if endpoint is equivalent.
82 if (this->endpoint_
->is_equivalent (rhs
->endpoint_
) == 0)
85 // Check the property_list_.
86 TAO_RT_Transport_Descriptor_Property
*current
=
89 TAO_RT_Transport_Descriptor_Property
*rhs_current
=
92 while (current
|| rhs_current
)
94 if (rhs_current
== 0 || current
== 0)
97 if (current
->is_equivalent (rhs_current
) == 0)
100 current
= current
->next_
;
101 rhs_current
= rhs_current
->next_
;
108 TAO_RT_Transport_Descriptor::hash () const
110 return this->endpoint_
->hash ();
113 TAO_END_VERSIONED_NAMESPACE_DECL