TAO_RT_Transport_Descriptor Class Reference

Transport Descriptor for RTCORBA. More...

#include <RT_Transport_Descriptor.h>

Inheritance diagram for TAO_RT_Transport_Descriptor:

Inheritance graph
[legend]
Collaboration diagram for TAO_RT_Transport_Descriptor:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_RT_Transport_Descriptor (TAO_Endpoint *endpoint, CORBA::Boolean flag=false)
 Constructor.
 ~TAO_RT_Transport_Descriptor ()
 Destructor.
void insert (TAO_RT_Transport_Descriptor_Property *descriptor_property)
 Insert Properties.
virtual TAO_Transport_Descriptor_Interfaceduplicate (void)
 = TAO_Transport_Descriptor_Interface methods
virtual CORBA::Boolean is_equivalent (const TAO_Transport_Descriptor_Interface *other_prop)
 Try to determine if this object is same as the <other_prop>.
virtual u_long hash (void) const
 Generate hash value for our class.

Private Attributes

TAO_RT_Transport_Descriptor_Propertyproperty_list_
 Stack of properties.
int delete_properties_
 Flag to delete properties.

Detailed Description

Transport Descriptor for RTCORBA.

The TAO_RT_Transport_Descriptor contains Descriptor Properties. It uses the "Chain of Command" pattern in the implementation of the <_is_equivalent> method.

Definition at line 37 of file RT_Transport_Descriptor.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_RT_Transport_Descriptor::TAO_RT_Transport_Descriptor ( TAO_Endpoint endpoint,
CORBA::Boolean  flag = false 
)

Constructor.

Definition at line 8 of file RT_Transport_Descriptor.inl.

00010   : TAO_Transport_Descriptor_Interface (endpoint, flag)
00011   , property_list_ (0)
00012   , delete_properties_ (flag)
00013 {
00014 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_RT_Transport_Descriptor::~TAO_RT_Transport_Descriptor (  ) 

Destructor.

Definition at line 17 of file RT_Transport_Descriptor.cpp.

References TAO_RT_Transport_Descriptor_Property::next_, and property_list_.

00018 {
00019   if (this->delete_properties_ == 1)
00020     {
00021       TAO_RT_Transport_Descriptor_Property *current =
00022         this->property_list_;
00023 
00024       while (current)
00025         {
00026           TAO_RT_Transport_Descriptor_Property *next =
00027             current->next_;
00028 
00029           delete current;
00030 
00031           current = next;
00032         }
00033     }
00034 }


Member Function Documentation

TAO_Transport_Descriptor_Interface * TAO_RT_Transport_Descriptor::duplicate ( void   )  [virtual]

= TAO_Transport_Descriptor_Interface methods

This call allocates and copies the contents of this class and returns the pointer

Implements TAO_Transport_Descriptor_Interface.

Definition at line 37 of file RT_Transport_Descriptor.cpp.

References ACE_NEW_RETURN, TAO_RT_Transport_Descriptor_Property::duplicate(), TAO_Endpoint::duplicate(), TAO_Transport_Descriptor_Interface::endpoint(), TAO_Transport_Descriptor_Interface::endpoint_, TAO_RT_Transport_Descriptor_Property::next_, and property_list_.

00038 {
00039   // Get a copy of the underlying endpoint
00040   TAO_Endpoint *endpoint =
00041     this->endpoint_->duplicate ();
00042   if (endpoint == 0)
00043     return 0;
00044 
00045   TAO_RT_Transport_Descriptor *new_descriptor = 0;
00046 
00047   ACE_NEW_RETURN (new_descriptor,
00048                   TAO_RT_Transport_Descriptor (endpoint, 1),
00049                   0);
00050 
00051   // Copy the Properties.
00052   TAO_RT_Transport_Descriptor_Property *current_property =
00053     this->property_list_;
00054 
00055   TAO_RT_Transport_Descriptor_Property *current_new_property = 0;
00056   TAO_RT_Transport_Descriptor_Property *new_property = 0;
00057 
00058   while (current_property)
00059     {
00060       new_property =
00061         current_property->duplicate ();
00062 
00063       // Note that we cannot use <insert> because that will reverse the stack.
00064       if (new_descriptor->property_list_ == 0)
00065         new_descriptor->property_list_ = new_property;
00066       else if (current_new_property != 0)
00067         current_new_property->next_ = new_property;
00068 
00069       current_new_property = new_property;
00070       current_property = current_property->next_;
00071     }
00072 
00073   return new_descriptor;
00074 }

u_long TAO_RT_Transport_Descriptor::hash ( void   )  const [virtual]

Generate hash value for our class.

Implements TAO_Transport_Descriptor_Interface.

Definition at line 112 of file RT_Transport_Descriptor.cpp.

References TAO_Transport_Descriptor_Interface::endpoint_, and TAO_Endpoint::hash().

00113 {
00114   return this->endpoint_->hash ();
00115 }

ACE_INLINE void TAO_RT_Transport_Descriptor::insert ( TAO_RT_Transport_Descriptor_Property descriptor_property  ) 

Insert Properties.

Definition at line 17 of file RT_Transport_Descriptor.inl.

References TAO_RT_Transport_Descriptor_Property::next_, and property_list_.

Referenced by TAO_RT_Invocation_Endpoint_Selector::endpoint_from_profile().

00018 {
00019   descriptor_property->next_ = this->property_list_;
00020 
00021   this->property_list_ = descriptor_property;
00022 }

CORBA::Boolean TAO_RT_Transport_Descriptor::is_equivalent ( const TAO_Transport_Descriptor_Interface other_prop  )  [virtual]

Try to determine if this object is same as the <other_prop>.

Implements TAO_Transport_Descriptor_Interface.

Definition at line 77 of file RT_Transport_Descriptor.cpp.

References TAO_Transport_Descriptor_Interface::endpoint_, TAO_RT_Transport_Descriptor_Property::is_equivalent(), TAO_RT_Transport_Descriptor_Property::next_, and property_list_.

00078 {
00079   const TAO_RT_Transport_Descriptor *rhs =
00080     dynamic_cast<const TAO_RT_Transport_Descriptor*> (other_prop);
00081 
00082   if (rhs == 0)
00083     return false;
00084 
00085   // Check if endpoint is equivalent.
00086   if (this->endpoint_->is_equivalent (rhs->endpoint_) == 0)
00087     return false;
00088 
00089   // Check the property_list_.
00090   TAO_RT_Transport_Descriptor_Property *current =
00091     this->property_list_;
00092 
00093   TAO_RT_Transport_Descriptor_Property *rhs_current =
00094     rhs->property_list_;
00095 
00096   while (current || rhs_current)
00097     {
00098       if (rhs_current == 0 || current == 0)
00099         return false;
00100 
00101       if (current->is_equivalent (rhs_current) == 0)
00102         return false;
00103 
00104       current = current->next_;
00105       rhs_current = rhs_current->next_;
00106     }
00107 
00108   return true;
00109 }


Member Data Documentation

int TAO_RT_Transport_Descriptor::delete_properties_ [private]

Flag to delete properties.

Definition at line 69 of file RT_Transport_Descriptor.h.

TAO_RT_Transport_Descriptor_Property* TAO_RT_Transport_Descriptor::property_list_ [private]

Stack of properties.

Definition at line 66 of file RT_Transport_Descriptor.h.

Referenced by duplicate(), insert(), is_equivalent(), and ~TAO_RT_Transport_Descriptor().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:43:01 2010 for TAO_RTCORBA by  doxygen 1.4.7