3 //==========================================================================
5 * @file SHMIOP_Endpoint.h
7 * SHMIOP implementation of PP Framework Endpoint interface.
9 * @author Marina Spivak <marina@cs.wustl.edu>
11 //==========================================================================
13 #ifndef TAO_SHMIOP_ENDPOINT_H
14 #define TAO_SHMIOP_ENDPOINT_H
15 #include /**/ "ace/pre.h"
17 #include "tao/orbconf.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #if defined (TAO_HAS_SHMIOP) && (TAO_HAS_SHMIOP != 0)
25 #include "tao/CORBA_String.h"
26 #include "tao/Endpoint.h"
27 #include "tao/Strategies/strategies_export.h"
29 #include "ace/INET_Addr.h"
30 #include "ace/MEM_Addr.h"
32 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
35 * @class TAO_SHMIOP_Endpoint
37 * @brief TAO_SHMIOP_Endpoint
39 * SHMIOP-specific implementation of PP Framework Endpoint interface.
41 class TAO_Strategies_Export TAO_SHMIOP_Endpoint
: public TAO_Endpoint
44 friend class TAO_SHMIOP_Profile
;
46 /// Default constructor.
47 TAO_SHMIOP_Endpoint ();
49 /// Constructor. This is the most efficient constructor since it
50 /// does not require any address resolution processing.
51 TAO_SHMIOP_Endpoint (const char *host
,
53 const ACE_INET_Addr
&addr
,
54 CORBA::Short priority
= TAO_INVALID_PRIORITY
);
57 TAO_SHMIOP_Endpoint (const ACE_MEM_Addr
&addr
,
58 int use_dotted_decimal_addresses
);
60 /// Constructor. -- More of a extension of the previous one. One of
61 /// them need to go. We will decide about that as time goes by.
62 TAO_SHMIOP_Endpoint (const ACE_INET_Addr
&addr
,
63 int use_dotted_decimal_addresses
);
65 /// Constructor. This constructor is used when decoding endpoints.
66 TAO_SHMIOP_Endpoint (const char *host
,
68 CORBA::Short priority
);
71 ~TAO_SHMIOP_Endpoint ();
74 * @name TAO_Endpoint Methods
76 * Please check the documentation in Endpoint.h for details.
79 /// Return a copy of @c this
80 virtual TAO_Endpoint
*next ();
81 virtual int addr_to_string (char *buffer
, size_t length
);
82 virtual TAO_Endpoint
*duplicate ();
84 /// Return true if this endpoint is equivalent to @a other_endpoint. Two
85 /// endpoints are equivalent if their port and host are the same.
86 CORBA::Boolean
is_equivalent (const TAO_Endpoint
*other_endpoint
);
88 /// Return a hash value for this object.
92 // = SHMIOP_Endpoint-specific methods.
94 /// Return a reference to the <object_addr>.
95 const ACE_INET_Addr
&object_addr () const;
97 /// Return a pointer to the host string. This object maintains
98 /// ownership of this string.
99 const char *host () const;
101 /// Copy the string @a h into <host_> and return the resulting pointer.
102 /// This object maintains ownership of this string.
103 const char *host (const char *h
);
105 /// Return the port number.
106 CORBA::UShort
port () const;
108 /// Set the port number.
109 CORBA::UShort
port (CORBA::UShort p
);
112 /// Helper method for setting INET_Addr.
113 int set (const ACE_INET_Addr
&addr
,
114 int use_dotted_decimal_addresses
);
116 /// String representing the host name.
117 CORBA::String_var host_
;
122 /// Cached instance of <ACE_INET_Addr> for use in making
123 /// invocations, etc.
124 ACE_INET_Addr object_addr_
;
126 /// Flag to indicate if the address has been resolved and set.
127 int object_addr_set_
;
129 /// SHMIOP Endpoints can be strung into a list. Return the next
130 /// endpoint in the list, if any.
131 TAO_SHMIOP_Endpoint
*next_
;
134 TAO_END_VERSIONED_NAMESPACE_DECL
136 #if defined (__ACE_INLINE__)
137 # include "tao/Strategies/SHMIOP_Endpoint.inl"
138 #endif /* __ACE_INLINE__ */
140 #endif /* TAO_HAS_SHMIOP && TAO_HAS_SHMIOP != 0 */
142 #include /**/ "ace/post.h"
143 #endif /* TAO_IIOP_PROFILE_H */