00001 // -*- C++ -*- 00002 //============================================================================= 00003 /** 00004 * @file IIOPEndpointValue_i.h 00005 * 00006 * $Id: IIOPEndpointValue_i.h 81982 2008-06-16 17:52:07Z sowayaa $ 00007 * 00008 * Implementation of the IIOP-Specific endpoint policy value 00009 * 00010 * @author Phil Mesnier <mesnier_p@ociweb.com> 00011 */ 00012 //============================================================================= 00013 00014 #ifndef _TAO_IIOP_ENDPOINT_VALUE_I_H_ 00015 #define _TAO_IIOP_ENDPOINT_VALUE_I_H_ 00016 00017 #include /**/ "ace/pre.h" 00018 00019 #include "tao/EndpointPolicy/EndpointPolicy_Export.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 # pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 #include "tao/orbconf.h" 00026 00027 #if defined (TAO_HAS_IIOP) && (TAO_HAS_IIOP != 0) 00028 00029 #include "tao/EndpointPolicy/IIOPEndpointValueC.h" 00030 #include "tao/EndpointPolicy/Endpoint_Value_Impl.h" 00031 #include "tao/LocalObject.h" 00032 #include "ace/INET_Addr.h" 00033 00034 // This is to remove "inherits via dominance" warnings from MSVC. 00035 // MSVC is being a little too paranoid. 00036 #if defined(_MSC_VER) 00037 #pragma warning(push) 00038 #pragma warning(disable:4250) 00039 #endif /* _MSC_VER */ 00040 00041 00042 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00043 00044 /** 00045 * @class IIOPEndpointValue_i 00046 * 00047 * @brief Implementation of the IIOP-Specific endpoint policy value 00048 * 00049 * This class is used by applications to create an instance of an 00050 * endpoint value for constructing an EndpointPolicy. While the 00051 * endpoint policy argument is of type 00052 * EndpointPolicy::EndpointValueBase, always use instances of this 00053 * type so that the endpoint policy framework is able to call the 00054 * equivalency test method. 00055 */ 00056 00057 class TAO_EndpointPolicy_Export IIOPEndpointValue_i : 00058 public virtual EndpointPolicy::IIOPEndpointValue, 00059 public virtual TAO_Endpoint_Value_Impl, 00060 public virtual ::CORBA::LocalObject 00061 { 00062 public: 00063 00064 /// Default Constructor. It is acceptable to create an empty value 00065 /// and modify the state via the attributes. 00066 IIOPEndpointValue_i (); 00067 00068 /// Value initializing constructor, this is typically for creation 00069 /// of one-off values. 00070 IIOPEndpointValue_i (const char *host, CORBA::UShort port); 00071 00072 virtual ~IIOPEndpointValue_i (void); 00073 00074 /// The is_equivalent test is used by the endpoint policy framework 00075 /// for testing if a target endpoint is the same as the endpoint 00076 /// defined by this value. 00077 CORBA::Boolean is_equivalent (const TAO_Endpoint * endpoint) const; 00078 00079 /// The validate_acceptor method is used during EndpointPolicy 00080 /// creation to ensure there is an acceptor which provides this 00081 /// endpoint. Currently the test is limited to only validating that 00082 /// the acceptor's tag is consistent, as the interfaces do not yet 00083 /// exist for examining the eventual TAO_Endpoint values the 00084 /// acceptor would produce. 00085 CORBA::Boolean validate_acceptor (TAO_Acceptor *, 00086 bool is_multi_prot) const; 00087 00088 /// Host attribute get/set operators. 00089 char * host (void); 00090 void host (const char * h); 00091 00092 /// Port attribute get/set operators. 00093 CORBA::UShort port (void); 00094 void port (CORBA::UShort p); 00095 00096 // Protocol tag get operator, inherited from EndpointValueBase 00097 CORBA::ULong protocol_tag (void); 00098 00099 private: 00100 CORBA::Boolean is_equivalent_i (CORBA::UShort port, const char *host) const; 00101 00102 CORBA::String_var host_; 00103 CORBA::UShort port_; 00104 00105 ACE_INET_Addr addr_; 00106 }; 00107 00108 TAO_END_VERSIONED_NAMESPACE_DECL 00109 00110 #if defined(_MSC_VER) 00111 #pragma warning(pop) 00112 #endif /* _MSC_VER */ 00113 00114 #endif /* TAO_HAS_IIOP && TAO_HAS_IIOP != 0 */ 00115 00116 #include /**/ "ace/post.h" 00117 00118 #endif /* _TAO_IIOP_ENDPOINT_VALUE_I_H_ */