3 //=============================================================================
5 * @file SCIOP_Profile.h
7 * @author Jason Cohen, Lockheed Martin ATL <jcohen@atl.lmco.com>
8 * @author Keith O'Hara, Lockheed Martin ATL
10 //=============================================================================
13 #ifndef TAO_SCIOP_PROFILE_H
14 #define TAO_SCIOP_PROFILE_H
16 #include /**/ "ace/pre.h"
18 #include "tao/orbconf.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #if TAO_HAS_SCIOP == 1
26 #include "tao/Strategies/SCIOP_Endpoint.h"
27 #include "tao/Profile.h"
29 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
31 // TAO SCIOP_Profile concrete Profile definitions
33 * @class TAO_SCIOP_Profile
35 * @brief This class defines the protocol specific attributes required
36 * for locating ORBs over a TCP/IP network.
38 * This class defines the SCIOP profile as specified in the CORBA
41 class TAO_Strategies_Export TAO_SCIOP_Profile
: public TAO_Profile
44 /// The object key delimiter that SCIOP uses or expects.
45 static const char object_key_delimiter_
;
46 virtual char object_key_delimiter () const;
48 /// Return the char string prefix.
49 static const char *prefix ();
51 /// Profile constructor, same as above except the object_key has
52 /// already been marshaled.
53 TAO_SCIOP_Profile (const ACE_INET_Addr
&addr
,
54 const TAO::ObjectKey
&object_key
,
55 const TAO_GIOP_Message_Version
&version
,
56 TAO_ORB_Core
*orb_core
);
58 /// Profile constructor, this is the most efficient since it
59 /// doesn't require any address resolution processing.
60 TAO_SCIOP_Profile (const char *host
,
62 const TAO::ObjectKey
&object_key
,
63 const ACE_INET_Addr
&addr
,
64 const TAO_GIOP_Message_Version
&version
,
65 TAO_ORB_Core
*orb_core
);
67 /// Profile constructor, default.
68 TAO_SCIOP_Profile (TAO_ORB_Core
*orb_core
);
70 /// Destructor is to be called only through <_decr_refcnt>.
71 ~TAO_SCIOP_Profile ();
73 /// Template methods. Please see Profile.h for documentation.
74 virtual char * to_string () const;
75 virtual int encode_endpoints ();
76 virtual TAO_Endpoint
*endpoint ();
77 virtual CORBA::ULong
endpoint_count () const;
78 virtual CORBA::ULong
hash (CORBA::ULong max
);
80 * Add <endp> to this profile's list of endpoints (it is inserted
81 * next to the head of the list). This profiles takes ownership of
84 void add_endpoint (TAO_SCIOP_Endpoint
*endp
);
87 /// Template methods. Please see Profile.h for the documentation.
88 virtual int decode_profile (TAO_InputCDR
&cdr
);
89 virtual int decode_endpoints ();
90 virtual void parse_string_i (const char *string
);
91 virtual void create_profile_body (TAO_OutputCDR
&cdr
) const;
92 virtual CORBA::Boolean
do_is_equivalent (const TAO_Profile
*other_profile
);
96 * Head of this profile's list of endpoints. This endpoint is not
97 * dynamically allocated because a profile always contains at least
100 * Currently, a profile contains more than one endpoint, i.e.,
101 * list contains more than just the head, only for two cases
102 * (1) when RTCORBA is enabled and
103 * (2) the ORB is initialized with -ORBPreferredInterfaces option.
104 * However, in the near future, this will be used in for mode as
105 * well, e.g., to support TAG_ALTERNATE_IIOP_ADDRESS feature.
107 * This is probably as good a place to discuss how the list of
108 * endpoints is used for #2. If the ORB is configured to use
109 * preferred interfaces for invocation, TAO creates an endpoint per
110 * preferred interface. To be clear, every tuple
111 * <destination:target> will have an endpoint. What TAO essentially
112 * does is that creates it multiple endpoints so that the invocation
113 * code path can use existing iterating techniques to try one
114 * preferred interface after another (if the first did not work). If
115 * the ORB is configured with -ORBEnforcePreferredInterface set to
116 * false in addition to the ORBPreferredInterfaces option , TAO
117 * creates another endpoint with the preferred bit set to null, so
118 * that the invocation code can fall back to a SCTP stack returned
120 * Addressing info of the default endpoint, i.e., head of the list,
121 * is transmitted using standard SCIOP ProfileBody components. See
122 * <encode_endpoints> method documentation above for how the rest of
123 * the endpoint list is transmitted.
125 TAO_SCIOP_Endpoint endpoint_
;
127 /// Number of endpoints in the list headed by <endpoint_>.
131 TAO_END_VERSIONED_NAMESPACE_DECL
133 #endif /* TAO_HAS_SCIOP == 1 */
135 #include /**/ "ace/post.h"
137 #endif /* TAO_SCIOP_PROFILE_H */