DIOP_Endpoint.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file     DIOP_Endpoint.h
00006  *
00007  *  DIOP_Endpoint.h,v 1.9 2006/04/19 11:38:50 jwillemsen Exp
00008  *
00009  *   DIOP implementation of PP Framework Endpoint interface.
00010  *
00011  *  @author  Michael Kircher
00012  */
00013 //=============================================================================
00014 
00015 
00016 #ifndef TAO_DIOP_ENDPOINT_H
00017 #define TAO_DIOP_ENDPOINT_H
00018 #include /**/ "ace/pre.h"
00019 
00020 #include "tao/orbconf.h"
00021 
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif /* ACE_LACKS_PRAGMA_ONCE */
00025 
00026 #if defined (TAO_HAS_DIOP) && (TAO_HAS_DIOP != 0)
00027 
00028 #include "tao/Strategies/strategies_export.h"
00029 #include "tao/Endpoint.h"
00030 #include "tao/CORBA_String.h"
00031 #include "ace/INET_Addr.h"
00032 
00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00034 
00035 class TAO_DIOP_Connection_Handler;
00036 
00037 /**
00038  * @class TAO_DIOP_Endpoint
00039  *
00040  * @brief TAO_DIOP_Endpoint
00041  *
00042  * DIOP-specific implementation of PP Framework Endpoint interface.
00043  */
00044 class TAO_Strategies_Export TAO_DIOP_Endpoint : public TAO_Endpoint
00045 {
00046 public:
00047 
00048   friend class TAO_DIOP_Profile;
00049   friend class TAO_SSLIOP_Profile;
00050 
00051   // = Initialization and termination methods.
00052 
00053   /// Default constructor.
00054   TAO_DIOP_Endpoint (void);
00055 
00056   /// Constructor.  This is the most efficient constructor since it
00057   /// does not require any address resolution processing.
00058   TAO_DIOP_Endpoint (const char *host,
00059                      CORBA::UShort port,
00060                      const ACE_INET_Addr &addr,
00061                      CORBA::Short priority = TAO_INVALID_PRIORITY);
00062 
00063   /// Constructor.
00064   TAO_DIOP_Endpoint (const ACE_INET_Addr &addr,
00065                      int use_dotted_decimal_addresses);
00066 
00067   /// Constructor.  This constructor is used when decoding endpoints.
00068   TAO_DIOP_Endpoint (const char *host,
00069                      CORBA::UShort port,
00070                      CORBA::Short priority);
00071 
00072   /// Destructor.
00073   ~TAO_DIOP_Endpoint (void);
00074 
00075   /**
00076    * @name TAO_Endpoint Methods
00077    *
00078    * Please check the documentation in Endpoint.h for details.
00079    */
00080   //@{
00081   virtual TAO_Endpoint *next (void);
00082   virtual int addr_to_string (char *buffer, size_t length);
00083   virtual TAO_Endpoint *duplicate (void);
00084 
00085   /// Return true if this endpoint is equivalent to <other_endpoint>.  Two
00086   /// endpoints are equivalent iff their port and host are the same.
00087   CORBA::Boolean is_equivalent (const TAO_Endpoint *other_endpoint);
00088 
00089   /// Return a hash value for this object.
00090   CORBA::ULong hash (void);
00091   //@}
00092 
00093   // Allocates memory and returns a copy of <this>
00094 
00095   // = DIOP_Endpoint-specific methods.
00096 
00097   /// Return a reference to the <object_addr>.
00098   const ACE_INET_Addr &object_addr (void) const;
00099 
00100   /// Return a pointer to the host string.  This object maintains
00101   /// ownership of this string.
00102   const char *host (void) const;
00103 
00104   /// Copy the string <h> into <host_> and return the resulting pointer.
00105   /// This object maintains ownership of this string.
00106   const char *host (const char *h);
00107 
00108   /// Return the port number.
00109   CORBA::UShort port (void) const;
00110 
00111   /// Set the port number.
00112   CORBA::UShort port (CORBA::UShort p);
00113 
00114   //TAO_DIOP_Connection_Handler *&hint (void);
00115   // Access to our <hint_>.
00116 
00117 private:
00118 
00119   /// Helper method for setting INET_Addr.
00120   int set (const ACE_INET_Addr &addr,
00121            int use_dotted_decimal_addresses);
00122 
00123   /// String representing the host name.
00124   CORBA::String_var host_;
00125 
00126   /// TCP port number.
00127   CORBA::UShort port_;
00128 
00129   /// Cached instance of <ACE_INET_Addr> for use in making
00130   /// invocations, etc.
00131   ACE_INET_Addr object_addr_;
00132 
00133   /// Flag to indicate if the address has been resolved and set.
00134   int object_addr_set_;
00135 
00136   /// DIOP Endpoints can be stringed into a list.  Return the next
00137   /// endpoint in the list, if any.
00138   TAO_DIOP_Endpoint *next_;
00139 };
00140 
00141 TAO_END_VERSIONED_NAMESPACE_DECL
00142 
00143 #if defined (__ACE_INLINE__)
00144 # include "tao/Strategies/DIOP_Endpoint.i"
00145 #endif /* __ACE_INLINE__ */
00146 
00147 #endif /* TAO_HAS_DIOP && TAO_HAS_DIOP != 0 */
00148 
00149 #include /**/ "ace/post.h"
00150 #endif  /* TAO_DIOP_PROFILE_H */

Generated on Thu Nov 9 13:39:28 2006 for TAO_Strategies by doxygen 1.3.6