UIOP_Profile.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file     UIOP_Profile.h
00006  *
00007  *  UIOP_Profile.h,v 1.22 2006/03/10 07:19:19 jtc Exp
00008  *
00009  *   Unix Domain Socket (UIOP) profile specific processing
00010  *
00011  *  @author Ossama Othman <ossama@dre.vanderbilt.edu>
00012  *  @author Fred Kuhns <fredk@cs.wustl.edu>
00013  */
00014 //=============================================================================
00015 
00016 
00017 #ifndef TAO_UIOP_PROFILE_H
00018 #define TAO_UIOP_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 TAO_HAS_UIOP == 1
00029 
00030 #include "tao/Strategies/strategies_export.h"
00031 #include "tao/Profile.h"
00032 #include "tao/Strategies/UIOP_Connection_Handler.h"
00033 #include "tao/Strategies/UIOP_Endpoint.h"
00034 
00035 #include "ace/UNIX_Addr.h"
00036 
00037 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00038 
00039 /**
00040  * @class TAO_UIOP_Profile
00041  *
00042  * @brief This class defines the protocol specific attributes required
00043  * for locating ORBs over local IPC.
00044  *
00045  * This class defines the UIOP profile.
00046  */
00047 class TAO_Strategies_Export TAO_UIOP_Profile : public TAO_Profile
00048 {
00049 public:
00050   /// The object key delimiter that UIOP uses or expects.
00051   static const char object_key_delimiter_;
00052   virtual char object_key_delimiter (void) const;
00053 
00054   /// Return the char string prefix.
00055   static const char *prefix (void);
00056 
00057   /// Profile constructor, same as above except the object_key has
00058   /// already been marshaled.  (actually, no marshalling for this protocol)
00059   TAO_UIOP_Profile (const ACE_UNIX_Addr &addr,
00060                     const TAO::ObjectKey &object_key,
00061                     const TAO_GIOP_Message_Version &version,
00062                     TAO_ORB_Core *orb_core);
00063 
00064   /// Profile constructor
00065   TAO_UIOP_Profile (const char *rendezvous_point,
00066                     const TAO::ObjectKey &object_key,
00067                     const ACE_UNIX_Addr &addr,
00068                     const TAO_GIOP_Message_Version &version,
00069                     TAO_ORB_Core *orb_core);
00070 
00071   /// Profile constructor, default.
00072   TAO_UIOP_Profile (TAO_ORB_Core *orb_core);
00073 
00074   /// Destructor is to be called only through <_decr_refcnt>.
00075   ~TAO_UIOP_Profile (void);
00076 
00077   /// Template methods. Please see Profile.h for documentation.
00078   virtual char *to_string (ACE_ENV_SINGLE_ARG_DECL);
00079   virtual int encode_endpoints (void);
00080   virtual TAO_Endpoint *endpoint (void);
00081   virtual CORBA::ULong endpoint_count (void) const;
00082   virtual CORBA::ULong hash (CORBA::ULong max
00083                              ACE_ENV_ARG_DECL);
00084   /**
00085    * Add <endp> to this profile's list of endpoints (it is inserted
00086    * next to the head of the list).  This profiles takes ownership of
00087    * <endp>.
00088    */
00089   void add_endpoint (TAO_UIOP_Endpoint *endp);
00090 
00091 protected:
00092 
00093   /// Protected template methods. Please see documentation in
00094   /// Profile.h for details.
00095   virtual int decode_profile (TAO_InputCDR& cdr);
00096   virtual void parse_string_i (const char *string
00097                                ACE_ENV_ARG_DECL);
00098   virtual void create_profile_body (TAO_OutputCDR &cdr) const;
00099   virtual int decode_endpoints (void);
00100   virtual CORBA::Boolean do_is_equivalent (const TAO_Profile *other_profile);
00101 
00102 private:
00103   /**
00104    * Head of this profile's list of endpoints.  This endpoint is not
00105    * dynamically allocated because a profile always contains at least
00106    * one endpoint.
00107    *
00108    * Currently, a profile contains more than one endpoint, i.e.,
00109    * list contains more than just the head, only when RTCORBA is enabled.
00110    * However, in the near future, this will be used in nonRT
00111    * mode as well, e.g., to support a la TAG_ALTERNATE_IIOP_ADDRESS
00112    * feature.
00113    * Addressing info of the default endpoint, i.e., head of the list,
00114    * is transmitted using standard UIOP ProfileBody components.  See
00115    * <encode_endpoints> method documentation above for how the rest of
00116    * the endpoint list is transmitted.
00117    */
00118   TAO_UIOP_Endpoint endpoint_;
00119 
00120   /// Number of endpoints in the list headed by <endpoint_>.
00121   CORBA::ULong count_;
00122 };
00123 
00124 TAO_END_VERSIONED_NAMESPACE_DECL
00125 
00126 # endif  /* TAO_HAS_UIOP == 1 */
00127 
00128 #include /**/ "ace/post.h"
00129 
00130 #endif  /* TAO_UIOP_PROFILE_H */

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