00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file Transport_Descriptor_Interface.h 00006 * 00007 * $Id: Transport_Descriptor_Interface.h 74385 2006-08-31 11:22:59Z johnnyw $ 00008 * 00009 * @author Bala Natarajan <bala@cs.wustl.edu> 00010 */ 00011 // =================================================================== 00012 00013 #ifndef TAO_CONNECTION_DESCRIPTOR_INTERFACE_H 00014 #define TAO_CONNECTION_DESCRIPTOR_INTERFACE_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include /**/ "tao/TAO_Export.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #include "tao/Basic_Types.h" 00025 00026 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00027 00028 class TAO_Endpoint; 00029 00030 /** 00031 * @class TAO_Transport_Descriptor_Interface 00032 * 00033 * @brief An abstract base class for Transport Property 00034 * 00035 * This class provides an abstract interface and holds minimal info 00036 * on which the Transport Caching scheme is based on. Concrete 00037 * connection properties can be got by inheriting from this class and 00038 * implementing the virtual functions. 00039 * Note 1: Additional properties for connection like Qos, 00040 * Priority that the RT folks would need, can be added by 00041 * inheriting from this class and providing the following 00042 * methods. 00043 * 1. duplicate () 00044 * 2. is_equivalent () 00045 * 3. hash () 00046 */ 00047 class TAO_Export TAO_Transport_Descriptor_Interface 00048 { 00049 public: 00050 /// Destructor 00051 virtual ~TAO_Transport_Descriptor_Interface (void); 00052 00053 /// This call allocates and copies the contents of this class and 00054 /// returns the pointer 00055 virtual TAO_Transport_Descriptor_Interface *duplicate (void) = 0; 00056 00057 /// Try to determine if this object is same as the @a other_prop. 00058 virtual CORBA::Boolean is_equivalent ( 00059 const TAO_Transport_Descriptor_Interface *other_prop) = 0; 00060 00061 /// Generate hash value for our class 00062 virtual u_long hash (void) const = 0; 00063 00064 /// Return the underlying endpoint object 00065 TAO_Endpoint *endpoint (void); 00066 00067 /// Reset the endpoint pointer to point to another, if that one is 00068 /// part of the chain based by the current endpoint. Although this 00069 /// method is public it should only be used by the protocol specific 00070 /// connector, right before caching, and only when a parallel 00071 /// connect was attempted with more than one possible endpoints. 00072 CORBA::Boolean reset_endpoint (TAO_Endpoint *ep); 00073 00074 /// Set the BiDir flag 00075 void set_bidir_flag (CORBA::Boolean flag); 00076 00077 protected: 00078 /// Default Constructor 00079 TAO_Transport_Descriptor_Interface (void); 00080 00081 /// Constructor 00082 TAO_Transport_Descriptor_Interface (TAO_Endpoint *endpoint, 00083 CORBA::Boolean take_ownership = false); 00084 00085 /// The base property of the connection ie. the peer's endpoint 00086 TAO_Endpoint *endpoint_; 00087 00088 /// Should the endpoint be used in either direction? 00089 CORBA::Boolean bidir_flag_; 00090 00091 /// Is the endpoint allocated on the heap? If so, we will have to 00092 /// delete it when we destruct ourselves. 00093 CORBA::Boolean release_; 00094 }; 00095 00096 TAO_END_VERSIONED_NAMESPACE_DECL 00097 00098 #if defined (__ACE_INLINE__) 00099 # include "tao/Transport_Descriptor_Interface.inl" 00100 #endif /* __ACE_INLINE__ */ 00101 00102 #include /**/ "ace/post.h" 00103 00104 #endif /*TAO_CONNECTION_DESCRIPTOR_INTERFACE_H*/