00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file UIOP_Profile.h 00006 * 00007 * $Id: UIOP_Profile.h 82030 2008-06-18 10:07:41Z johnnyw $ 00008 * 00009 * Unix Domain Socket (UIOP) profile specific processing 00010 * 00011 * @author Ossama Othman <ossama@dre.vanderbilt.edu> 00012 * @author Fred Kuhns <fredk@cs.wustl.edu> 00013 */ 00014 //============================================================================= 00015 00016 00017 #ifndef TAO_UIOP_PROFILE_H 00018 #define TAO_UIOP_PROFILE_H 00019 00020 #include /**/ "ace/pre.h" 00021 00022 #include "tao/orbconf.h" 00023 00024 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00025 # pragma once 00026 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00027 00028 # if TAO_HAS_UIOP == 1 00029 00030 #include "tao/Strategies/strategies_export.h" 00031 #include "tao/Profile.h" 00032 #include "tao/Strategies/UIOP_Connection_Handler.h" 00033 #include "tao/Strategies/UIOP_Endpoint.h" 00034 00035 #include "ace/UNIX_Addr.h" 00036 00037 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00038 00039 /** 00040 * @class TAO_UIOP_Profile 00041 * 00042 * @brief This class defines the protocol specific attributes required 00043 * for locating ORBs over local IPC. 00044 * 00045 * This class defines the UIOP profile. 00046 */ 00047 class TAO_Strategies_Export TAO_UIOP_Profile : public TAO_Profile 00048 { 00049 public: 00050 /// The object key delimiter that UIOP uses or expects. 00051 static const char object_key_delimiter_; 00052 virtual char object_key_delimiter (void) const; 00053 00054 /// Return the char string prefix. 00055 static const char *prefix (void); 00056 00057 /// Profile constructor, same as above except the object_key has 00058 /// already been marshaled. (actually, no marshalling for this protocol) 00059 TAO_UIOP_Profile (const ACE_UNIX_Addr &addr, 00060 const TAO::ObjectKey &object_key, 00061 const TAO_GIOP_Message_Version &version, 00062 TAO_ORB_Core *orb_core); 00063 00064 /// Profile constructor 00065 TAO_UIOP_Profile (const char *rendezvous_point, 00066 const TAO::ObjectKey &object_key, 00067 const ACE_UNIX_Addr &addr, 00068 const TAO_GIOP_Message_Version &version, 00069 TAO_ORB_Core *orb_core); 00070 00071 /// Profile constructor, default. 00072 TAO_UIOP_Profile (TAO_ORB_Core *orb_core); 00073 00074 /// Destructor is to be called only through <_decr_refcnt>. 00075 ~TAO_UIOP_Profile (void); 00076 00077 /// Template methods. Please see Profile.h for documentation. 00078 virtual char *to_string (void); 00079 virtual int encode_endpoints (void); 00080 virtual TAO_Endpoint *endpoint (void); 00081 virtual CORBA::ULong endpoint_count (void) const; 00082 virtual CORBA::ULong hash (CORBA::ULong max); 00083 /** 00084 * Add @a endp to this profile's list of endpoints (it is inserted 00085 * next to the head of the list). This profiles takes ownership of 00086 * @a endp. 00087 */ 00088 void add_endpoint (TAO_UIOP_Endpoint *endp); 00089 00090 protected: 00091 00092 /// Protected template methods. Please see documentation in 00093 /// Profile.h for details. 00094 virtual int decode_profile (TAO_InputCDR& cdr); 00095 virtual void parse_string_i (const char *string); 00096 virtual void create_profile_body (TAO_OutputCDR &cdr) const; 00097 virtual int decode_endpoints (void); 00098 virtual CORBA::Boolean do_is_equivalent (const TAO_Profile *other_profile); 00099 00100 private: 00101 /** 00102 * Head of this profile's list of endpoints. This endpoint is not 00103 * dynamically allocated because a profile always contains at least 00104 * one endpoint. 00105 * 00106 * Currently, a profile contains more than one endpoint, i.e., 00107 * list contains more than just the head, only when RTCORBA is enabled. 00108 * However, in the near future, this will be used in nonRT 00109 * mode as well, e.g., to support a la TAG_ALTERNATE_IIOP_ADDRESS 00110 * feature. 00111 * Addressing info of the default endpoint, i.e., head of the list, 00112 * is transmitted using standard UIOP ProfileBody components. See 00113 * <encode_endpoints> method documentation above for how the rest of 00114 * the endpoint list is transmitted. 00115 */ 00116 TAO_UIOP_Endpoint endpoint_; 00117 00118 /// Number of endpoints in the list headed by <endpoint_>. 00119 CORBA::ULong count_; 00120 }; 00121 00122 TAO_END_VERSIONED_NAMESPACE_DECL 00123 00124 # endif /* TAO_HAS_UIOP == 1 */ 00125 00126 #include /**/ "ace/post.h" 00127 00128 #endif /* TAO_UIOP_PROFILE_H */