00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file DIOP_Profile.h 00006 * 00007 * $Id: DIOP_Profile.h 76551 2007-01-24 13:42:44Z johnnyw $ 00008 * 00009 * DIOP profile specific processing 00010 * 00011 * 00012 * @author Michael Kircher 00013 */ 00014 //============================================================================= 00015 00016 00017 #ifndef TAO_DIOP_PROFILE_H 00018 #define TAO_DIOP_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 defined (TAO_HAS_DIOP) && (TAO_HAS_DIOP != 0) 00029 00030 #include "tao/Strategies/DIOP_Endpoint.h" 00031 #include "tao/Profile.h" 00032 00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 // TAO DIOP_Profile concrete Profile definitions 00036 /** 00037 * @class TAO_DIOP_Profile 00038 * 00039 * @brief This class defines the protocol specific attributes required 00040 * for locating ORBs over a TCP/IP network. 00041 * 00042 * This class defines the DIOP profile as specified in the CORBA 00043 * specification. 00044 */ 00045 class TAO_Strategies_Export TAO_DIOP_Profile : public TAO_Profile 00046 { 00047 public: 00048 /// The object key delimiter that DIOP uses or expects. 00049 static const char object_key_delimiter_; 00050 virtual char object_key_delimiter (void) const; 00051 00052 /// Return the char string prefix. 00053 static const char *prefix (void); 00054 00055 /// Profile constructor, same as above except the object_key has 00056 /// already been marshaled. 00057 TAO_DIOP_Profile (const ACE_INET_Addr &addr, 00058 const TAO::ObjectKey &object_key, 00059 const TAO_GIOP_Message_Version &version, 00060 TAO_ORB_Core *orb_core); 00061 00062 /// Profile constructor, this is the most efficient since it 00063 /// doesn't require any address resolution processing. 00064 TAO_DIOP_Profile (const char *host, 00065 CORBA::UShort port, 00066 const TAO::ObjectKey &object_key, 00067 const ACE_INET_Addr &addr, 00068 const TAO_GIOP_Message_Version &version, 00069 TAO_ORB_Core *orb_core); 00070 00071 00072 /// Profile constructor, default. 00073 TAO_DIOP_Profile (TAO_ORB_Core *orb_core); 00074 00075 /// Destructor is to be called only through <_decr_refcnt>. 00076 ~TAO_DIOP_Profile (void); 00077 00078 00079 /// Template methods. Please tao/Profile.h for documentation. 00080 virtual char * to_string (void); 00081 virtual int encode_endpoints (void); 00082 virtual TAO_Endpoint *endpoint (void); 00083 virtual CORBA::ULong endpoint_count (void) const; 00084 virtual CORBA::ULong hash (CORBA::ULong max); 00085 /** 00086 * Add <endp> to this profile's list of endpoints (it is inserted 00087 * next to the head of the list). This profiles takes ownership of 00088 * <endp>. 00089 */ 00090 void add_endpoint (TAO_DIOP_Endpoint *endp); 00091 00092 protected: 00093 00094 /// Template methods. Please see tao/Profile.h for documentation. 00095 virtual int decode_profile (TAO_InputCDR& cdr); 00096 virtual void parse_string_i (const char *string); 00097 virtual void create_profile_body (TAO_OutputCDR &cdr) const; 00098 virtual int decode_endpoints (void); 00099 virtual CORBA::Boolean do_is_equivalent (const TAO_Profile *other_profile); 00100 00101 protected: 00102 00103 /** 00104 * Head of this profile's list of endpoints. This endpoint is not 00105 * dynamically allocated because a profile always contains at least 00106 * one endpoint. 00107 * 00108 * Currently, a profile contains more than one endpoint, i.e., 00109 * list contains more than just the head, only when RTCORBA is enabled. 00110 * However, in the near future, this will be used in nonRT 00111 * mode as well, e.g., to support TAG_ALTERNATE_DIOP_ADDRESS 00112 * feature. 00113 * Addressing info of the default endpoint, i.e., head of the list, 00114 * is transmitted using standard DIOP ProfileBody components. See 00115 * <encode_endpoints> method documentation above for how the rest of 00116 * the endpoint list is transmitted. 00117 */ 00118 TAO_DIOP_Endpoint endpoint_; 00119 00120 /// Number of endpoints in the list headed by <endpoint_>. 00121 CORBA::ULong count_; 00122 }; 00123 00124 TAO_END_VERSIONED_NAMESPACE_DECL 00125 00126 #endif /* TAO_HAS_DIOP && TAO_HAS_DIOP != 0 */ 00127 00128 #include /**/ "ace/post.h" 00129 00130 #endif /* TAO_DIOP_PROFILE_H */