DIOP_Profile.h

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

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