Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Cache_Entries.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   Cache_Entries.h
00006  *
00007  *  $Id: Cache_Entries.h,v 1.1.1.2 2003/02/21 18:36:44 chad Exp $
00008  *
00009  *
00010  *  @author Bala Natarajan  <bala@cs.wustl.edu>
00011  */
00012 //=============================================================================
00013 
00014 
00015 #ifndef TAO_CACHE_ENTRIES_H
00016 #define TAO_CACHE_ENTRIES_H
00017 
00018 #include "ace/pre.h"
00019 
00020 #include "tao/Transport_Descriptor_Interface.h"
00021 
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif /* ACE_LACKS_PRAGMA_ONCE */
00025 
00026 #include "ace/Recyclable.h"
00027 
00028 class TAO_Transport;
00029 
00030 #ifdef index
00031 # undef index
00032 #endif  /* index */
00033 
00034 /**
00035  * @class TAO_Cache_IntId
00036  *
00037  * @brief Helper class for TAO_Transport_Cache_Manager
00038  *
00039  * Helper class that wraps the <value> part of the Map or
00040  * table holding the Transport state.: unifies data items, so
00041  * they can be stored together as a <value> for a <key> in a
00042  * table holding the state of the Transport Cache.
00043  */
00044 class TAO_Export TAO_Cache_IntId
00045 {
00046 public:
00047 
00048   /// Constructor.
00049   TAO_Cache_IntId (void);
00050 
00051   /// Constructor.
00052   TAO_Cache_IntId (TAO_Transport *transport);
00053 
00054   /// Copy constructor.
00055   TAO_Cache_IntId (const TAO_Cache_IntId & rhs);
00056 
00057   /// Destructor.
00058   ~TAO_Cache_IntId (void);
00059 
00060   /// Assignment operator (does copy memory).
00061   TAO_Cache_IntId& operator= (const TAO_Cache_IntId &rhs);
00062 
00063   /// Equality comparison operator (must match both id_ and kind_).
00064   int operator== (const TAO_Cache_IntId &rhs) const;
00065 
00066   /// Inequality comparison operator.
00067   int operator!= (const TAO_Cache_IntId &rhs) const;
00068 
00069   /// Return the underlying transport
00070   TAO_Transport *transport (void);
00071 
00072   /// Return the underlying transport
00073   const TAO_Transport *transport (void) const;
00074 
00075   /// Set <recycle_state>.
00076   void recycle_state (ACE_Recyclable_State new_state);
00077 
00078   /// Get <recycle_state>.
00079   ACE_Recyclable_State recycle_state (void);
00080 
00081   /// Relinquish ownership of the TAO_Transport object associated with
00082   /// this TAO_Cache_IntId.
00083   /**
00084    * @note This method should go away once the
00085    *       Transport_Cache_Map_Manager is improved so that it returns
00086    *       TAO_Transport objects when performing a find() operation.
00087    *       This method really only exists to get around inadequacies
00088    *       in the Transport_Cache_Map_Manager interface.
00089    */
00090   TAO_Transport *relinquish_transport (void);
00091 
00092 private:
00093 
00094   /// The transport that needs to be cached.
00095   TAO_Transport *transport_;
00096 
00097   /// The state of the handle
00098   ACE_Recyclable_State recycle_state_;
00099 
00100 };
00101 
00102 
00103 /**
00104  * @class TAO_Cache_ExtId
00105  *
00106  * @brief Helper class for TAO_Transport_Cache_Manager: unifies
00107  * several  data items, so they can be stored together as a
00108  * <value> for a <key> in a hash table holding the state of the
00109  * Transport Cache.
00110  */
00111 class TAO_Export TAO_Cache_ExtId
00112 {
00113 public:
00114 
00115   /// Constructor.
00116   TAO_Cache_ExtId (void);
00117 
00118   /// Constructor.
00119   TAO_Cache_ExtId (TAO_Transport_Descriptor_Interface *prop);
00120 
00121   /// Copy constructor.
00122   TAO_Cache_ExtId (const TAO_Cache_ExtId & rhs);
00123 
00124   /// Destructor.
00125   ~TAO_Cache_ExtId (void);
00126 
00127   // = Assignment and comparison operators.
00128   /// Assignment operator (does copy memory).
00129   TAO_Cache_ExtId& operator= (const TAO_Cache_ExtId &rhs);
00130 
00131   /// Equality comparison operator (must match both id_ and kind_).
00132   int operator== (const TAO_Cache_ExtId &rhs) const;
00133 
00134   /// Inequality comparison operator.
00135   int operator!= (const TAO_Cache_ExtId &rhs) const;
00136 
00137   /// <hash> function is required in order for this class to be usable by
00138   /// ACE_Hash_Map_Manager_Ex.
00139   u_long hash (void) const;
00140 
00141   /// Make a deep copy of the underlying pointer
00142   void duplicate (void);
00143 
00144   //@{
00145   /// Return the index value
00146   CORBA::ULong index (void);
00147   CORBA::ULong index (void) const;
00148   //@}
00149 
00150   /// Set the index value. This calls should not be used by any users
00151   /// but for the TAO_Transport_Cache_Manager class.
00152   void index (CORBA::ULong index);
00153 
00154   /// Increment the index value
00155   void incr_index (void);
00156 
00157   // = Accessors
00158   /// Get the underlying the property pointer
00159   TAO_Transport_Descriptor_Interface *property (void) const;
00160 
00161 private:
00162 
00163   /// A property object that we represent.
00164   TAO_Transport_Descriptor_Interface *transport_property_;
00165 
00166   /// Do we need to delete transport_property?
00167   CORBA::Boolean is_delete_;
00168 
00169   /**
00170    * This is a supplementary index. Would be set to zero by
00171    * default. Would be altered by the Transport_Cache of TAO. Please
00172    * see the documentation of TAO_Transport_Cache_Manager for
00173    * details.
00174    */
00175   CORBA::ULong index_;
00176 
00177 };
00178 
00179 
00180 #if defined (__ACE_INLINE__)
00181 # include "tao/Cache_Entries.inl"
00182 #endif /* __ACE_INLINE__ */
00183 
00184 #include "ace/post.h"
00185 
00186 #endif /* TAO_CACHE_ENTRIES_H */

Generated on Mon Jun 16 13:48:02 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002