TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE > Class Template Reference

Helper class for TAO_Transport_Cache_Manager: unifies several data items, so they can be stored together as a value for a key in a hash table holding the state of the Transport Cache. More...

#include <Cache_Entries_T.h>

List of all members.

Public Types

typedef TRANSPORT_DESCRIPTOR_TYPE transport_descriptor_type

Public Member Functions

 Cache_ExtId_T (void)
 Constructor.
 Cache_ExtId_T (transport_descriptor_type *prop)
 Constructor.
 Cache_ExtId_T (const Cache_ExtId_T &rhs)
 Copy constructor.
 ~Cache_ExtId_T (void)
 Destructor.
Cache_ExtId_Toperator= (const Cache_ExtId_T &rhs)
 Assignment operator (does copy memory).
bool operator== (const Cache_ExtId_T &rhs) const
 Equality comparison operator (must match both id_ and kind_).
bool operator!= (const Cache_ExtId_T &rhs) const
 Inequality comparison operator.
u_long hash (void) const
void duplicate (void)
 Make a deep copy of the underlying pointer.
CORBA::ULong index (void) const
 Return the index value.
void index (CORBA::ULong index)
void incr_index (void)
 Increment the index value.
transport_descriptor_type * property (void) const
 Get the underlying the property pointer.

Private Attributes

transport_descriptor_type * transport_property_
 A property object that we represent.
CORBA::Boolean is_delete_
 Do we need to delete transport_property?
CORBA::ULong index_

Detailed Description

template<typename TRANSPORT_DESCRIPTOR_TYPE>
class TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >

Helper class for TAO_Transport_Cache_Manager: unifies several data items, so they can be stored together as a value for a key in a hash table holding the state of the Transport Cache.

Definition at line 144 of file Cache_Entries_T.h.


Member Typedef Documentation

template<typename TRANSPORT_DESCRIPTOR_TYPE>
typedef TRANSPORT_DESCRIPTOR_TYPE TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::transport_descriptor_type

Definition at line 147 of file Cache_Entries_T.h.


Constructor & Destructor Documentation

template<typename TRANSPORT_DESCRIPTOR_TYPE >
TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::Cache_ExtId_T ( void   )  [inline]

Constructor.

Definition at line 104 of file Cache_Entries_T.inl.

00105     : transport_property_ (0),
00106       is_delete_ (false),
00107       index_ (0)
00108   {
00109   }

template<typename TRANSPORT_DESCRIPTOR_TYPE >
TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::Cache_ExtId_T ( typename Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::transport_descriptor_type *  prop  )  [inline, explicit]

Constructor.

Definition at line 112 of file Cache_Entries_T.inl.

00114     : transport_property_ (prop),
00115       is_delete_ (false),
00116       index_ (0)
00117   {
00118 
00119   }

template<typename TRANSPORT_DESCRIPTOR_TYPE >
TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::Cache_ExtId_T ( const Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE > &  rhs  )  [inline]

Copy constructor.

Definition at line 153 of file Cache_Entries_T.inl.

00154     : transport_property_ (0),
00155       is_delete_ (false),
00156       index_ (0)
00157   {
00158     *this = rhs;
00159   }

template<typename TRANSPORT_DESCRIPTOR_TYPE >
TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::~Cache_ExtId_T ( void   )  [inline]

Destructor.

Definition at line 122 of file Cache_Entries_T.inl.

00123   {
00124     if (this->is_delete_)
00125       delete this->transport_property_;
00126   }


Member Function Documentation

template<typename TRANSPORT_DESCRIPTOR_TYPE >
void TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::duplicate ( void   )  [inline]

Make a deep copy of the underlying pointer.

Definition at line 185 of file Cache_Entries_T.inl.

00186   {
00187     transport_descriptor_type *prop = 0;
00188 
00189     // Make a deep copy
00190     prop = this->transport_property_->duplicate ();
00191 
00192     if (prop == 0)
00193       return;
00194 
00195     // Release memory if there was some allocated in the first place
00196     if (this->is_delete_)
00197       delete this->transport_property_;
00198 
00199     this->is_delete_ = true;
00200     this->transport_property_ = prop;
00201   }

template<typename TRANSPORT_DESCRIPTOR_TYPE >
u_long TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::hash ( void   )  const [inline]

hash function is required in order for this class to be usable by ACE_Hash_Map_Manager_Ex.

Definition at line 179 of file Cache_Entries_T.inl.

00180   {
00181     return (this->transport_property_->hash () + this->index_);
00182   }

template<typename TRANSPORT_DESCRIPTOR_TYPE >
void TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::incr_index ( void   )  [inline]

Increment the index value.

Definition at line 218 of file Cache_Entries_T.inl.

00219   {
00220     ++this->index_;
00221   }

template<typename TRANSPORT_DESCRIPTOR_TYPE >
void TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::index ( CORBA::ULong  index  )  [inline]

Set the index value. This calls should not be used by any users but for the TAO_Transport_Cache_Manager class.

Definition at line 212 of file Cache_Entries_T.inl.

00213   {
00214     this->index_ = index;
00215   }

template<typename TRANSPORT_DESCRIPTOR_TYPE >
CORBA::ULong TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::index ( void   )  const [inline]

Return the index value.

Definition at line 205 of file Cache_Entries_T.inl.

00206   {
00207     return this->index_;
00208   }

template<typename TRANSPORT_DESCRIPTOR_TYPE >
bool TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::operator!= ( const Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE > &  rhs  )  const [inline]

Inequality comparison operator.

Definition at line 169 of file Cache_Entries_T.inl.

00170   {
00171     if (this->transport_property_->is_equivalent (rhs.transport_property_) &&
00172         this->index_ == rhs.index_)
00173       return false;
00174 
00175     return true;
00176   }

template<typename TRANSPORT_DESCRIPTOR_TYPE >
Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE > & TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::operator= ( const Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE > &  rhs  )  [inline]

Assignment operator (does copy memory).

Definition at line 130 of file Cache_Entries_T.inl.

00131   {
00132     if (this != &rhs)
00133       {
00134         // Do a deep copy
00135         this->transport_property_ =
00136           rhs.transport_property_->duplicate ();
00137 
00138         if (this->transport_property_ == 0)
00139           {
00140             this->is_delete_ = false;
00141             this->index_ = 0;
00142           }
00143         else
00144           {
00145             this->is_delete_ = true;
00146             this->index_ = rhs.index_;
00147           }
00148       }
00149     return *this;
00150   }

template<typename TRANSPORT_DESCRIPTOR_TYPE >
bool TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::operator== ( const Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE > &  rhs  )  const [inline]

Equality comparison operator (must match both id_ and kind_).

Definition at line 162 of file Cache_Entries_T.inl.

00163   {
00164     return (this->transport_property_->is_equivalent (rhs.transport_property_) &&
00165             this->index_ == rhs.index_);
00166   }

template<typename TRANSPORT_DESCRIPTOR_TYPE >
Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::transport_descriptor_type * TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::property ( void   )  const [inline]

Get the underlying the property pointer.

Definition at line 225 of file Cache_Entries_T.inl.

00226   {
00227     return this->transport_property_;
00228   }


Member Data Documentation

template<typename TRANSPORT_DESCRIPTOR_TYPE>
CORBA::ULong TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::index_ [private]

This is a supplementary index. Would be set to zero by default. Would be altered by the Transport_Cache of TAO. Please see the documentation of TAO_Transport_Cache_Manager for details.

Definition at line 205 of file Cache_Entries_T.h.

template<typename TRANSPORT_DESCRIPTOR_TYPE>
CORBA::Boolean TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::is_delete_ [private]

Do we need to delete transport_property?

Definition at line 197 of file Cache_Entries_T.h.

template<typename TRANSPORT_DESCRIPTOR_TYPE>
transport_descriptor_type* TAO::Cache_ExtId_T< TRANSPORT_DESCRIPTOR_TYPE >::transport_property_ [private]

A property object that we represent.

Definition at line 194 of file Cache_Entries_T.h.


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

Generated on Sun Nov 22 23:28:00 2009 for TAO by  doxygen 1.6.1