Public Member Functions | Private Attributes

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_Interface
duplicate (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_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.

TAO_RT_Transport_Descriptor::~TAO_RT_Transport_Descriptor (  ) 

Destructor.

Definition at line 17 of file RT_Transport_Descriptor.cpp.

{
  if (this->delete_properties_ == 1)
    {
      TAO_RT_Transport_Descriptor_Property *current =
        this->property_list_;

      while (current)
        {
          TAO_RT_Transport_Descriptor_Property *next =
            current->next_;

          delete current;

          current = next;
        }
    }
}


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.

{
  // Get a copy of the underlying endpoint
  TAO_Endpoint *endpoint =
    this->endpoint_->duplicate ();
  if (endpoint == 0)
    return 0;

  TAO_RT_Transport_Descriptor *new_descriptor = 0;

  ACE_NEW_RETURN (new_descriptor,
                  TAO_RT_Transport_Descriptor (endpoint, 1),
                  0);

  // Copy the Properties.
  TAO_RT_Transport_Descriptor_Property *current_property =
    this->property_list_;

  TAO_RT_Transport_Descriptor_Property *current_new_property = 0;
  TAO_RT_Transport_Descriptor_Property *new_property = 0;

  while (current_property)
    {
      new_property =
        current_property->duplicate ();

      // Note that we cannot use <insert> because that will reverse the stack.
      if (new_descriptor->property_list_ == 0)
        new_descriptor->property_list_ = new_property;
      else if (current_new_property != 0)
        current_new_property->next_ = new_property;

      current_new_property = new_property;
      current_property = current_property->next_;
    }

  return new_descriptor;
}

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.

{
  return this->endpoint_->hash ();
}

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.

{
  descriptor_property->next_ = this->property_list_;

  this->property_list_ = descriptor_property;
}

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.

{
  const TAO_RT_Transport_Descriptor *rhs =
    dynamic_cast<const TAO_RT_Transport_Descriptor*> (other_prop);

  if (rhs == 0)
    return false;

  // Check if endpoint is equivalent.
  if (this->endpoint_->is_equivalent (rhs->endpoint_) == 0)
    return false;

  // Check the property_list_.
  TAO_RT_Transport_Descriptor_Property *current =
    this->property_list_;

  TAO_RT_Transport_Descriptor_Property *rhs_current =
    rhs->property_list_;

  while (current || rhs_current)
    {
      if (rhs_current == 0 || current == 0)
        return false;

      if (current->is_equivalent (rhs_current) == 0)
        return false;

      current = current->next_;
      rhs_current = rhs_current->next_;
    }

  return true;
}


Member Data Documentation

Flag to delete properties.

Definition at line 69 of file RT_Transport_Descriptor.h.

Stack of properties.

Definition at line 66 of file RT_Transport_Descriptor.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines