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