SHMIOP_Profile.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file     SHMIOP_Profile.h
00006  *
00007  *  SHMIOP_Profile.h,v 1.22 2006/04/19 11:38:50 jwillemsen Exp
00008  *
00009  *   SHMIOP profile specific processing
00010  *
00011  *  @author  Nanbor Wang <nanbor@cs.wustl.edu>
00012  */
00013 //=============================================================================
00014 
00015 
00016 #ifndef TAO_SHMIOP_PROFILE_H
00017 #define TAO_SHMIOP_PROFILE_H
00018 
00019 #include /**/ "ace/pre.h"
00020 
00021 #include "tao/orbconf.h"
00022 
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif /* ACE_LACKS_PRAGMA_ONCE */
00026 
00027 #if defined (TAO_HAS_SHMIOP) && (TAO_HAS_SHMIOP != 0)
00028 
00029 #include "tao/Strategies/strategies_export.h"
00030 #include "tao/Profile.h"
00031 #include "tao/Strategies/SHMIOP_Endpoint.h"
00032 
00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00034 
00035 // TAO SHMIOP_Profile concrete Profile definitions
00036 /**
00037  * @class TAO_SHMIOP_Profile
00038  *
00039  * @brief This class defines the protocol specific attributes required
00040  * for locating local ORBs over local IPC mechanism to use the
00041  * shared memory transport.
00042  *
00043  * This class defines the SHMIOP profile.
00044  */
00045 class TAO_Strategies_Export TAO_SHMIOP_Profile : public TAO_Profile
00046 {
00047 public:
00048   /// The object key delimiter that SHMIOP 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_SHMIOP_Profile (const ACE_MEM_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_SHMIOP_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   /// Profile constructor, default.
00072   TAO_SHMIOP_Profile (TAO_ORB_Core *orb_core);
00073 
00074   /// Destructor is to be called only through <_decr_refcnt>.
00075   ~TAO_SHMIOP_Profile (void);
00076 
00077 
00078   /// Template methods, please see Profile.h for documentation.
00079   virtual char * to_string (ACE_ENV_SINGLE_ARG_DECL);
00080   virtual int encode_endpoints (void);
00081   virtual TAO_Endpoint *endpoint (void);
00082   virtual CORBA::ULong endpoint_count (void) const;
00083   virtual CORBA::ULong hash (CORBA::ULong max
00084                              ACE_ENV_ARG_DECL);
00085   /**
00086    * Add <endp> to this profile's list of endpoints (it is inserted
00087    * next to the head of the list).  This profiles takes ownership of
00088    * <endp>.
00089    */
00090   void add_endpoint (TAO_SHMIOP_Endpoint *endp);
00091 
00092 protected:
00093 
00094   /// Template methods. Please see tao/Profile.h for documentation.
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   /**
00105    * Head of this profile's list of endpoints.  This endpoint is not
00106    * dynamically allocated because a profile always contains at least
00107    * one endpoint.
00108    *
00109    * Currently, a profile contains more than one endpoint, i.e.,
00110    * list contains more than just the head, only when RTCORBA is enabled.
00111    * However, in the near future, this will be used in nonRT
00112    * mode as well, e.g., to support TAG_ALTERNATE_IIOP_ADDRESS-style
00113    * feature.
00114    * Addressing info of the default endpoint, i.e., head of the list,
00115    * is transmitted using standard SHMIOP ProfileBody components.  See
00116    * <encode_endpoints> method documentation above for how the rest of
00117    * the endpoint list is transmitted.
00118    */
00119   TAO_SHMIOP_Endpoint endpoint_;
00120 
00121   /// Number of endpoints in the list headed by <endpoint_>.
00122   CORBA::ULong count_;
00123 };
00124 
00125 TAO_END_VERSIONED_NAMESPACE_DECL
00126 
00127 #endif /* TAO_HAS_SHMIOP && TAO_HAS_SHMIOP != 0 */
00128 
00129 #include /**/ "ace/post.h"
00130 
00131 #endif  /* TAO_SHMIOP_PROFILE_H */

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