UIPMC_Profile.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file     UIPMC_Profile.h
00006  *
00007  *  UIPMC_Profile.h,v 1.19 2006/03/14 06:14:34 jtc Exp
00008  *
00009  *  UIPMC profile specific processing
00010  *
00011  *  @author Frank Hunleth <fhunleth@cs.wustl.edu>
00012  */
00013 //=============================================================================
00014 
00015 #ifndef TAO_UIPMC_PROFILE_H
00016 #define TAO_UIPMC_PROFILE_H
00017 
00018 #include /**/ "ace/pre.h"
00019 
00020 #include "orbsvcs/PortableGroup/portablegroup_export.h"
00021 
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif /* ACE_LACKS_PRAGMA_ONCE */
00025 
00026 #include "orbsvcs/PortableGroup/UIPMC_Endpoint.h"
00027 
00028 #include "orbsvcs/PortableGroupC.h"
00029 
00030 #include "tao/Object_KeyC.h"
00031 #include "tao/target_specification.h"
00032 #include "tao/Profile.h"
00033 
00034 #include "ace/SString.h"
00035 
00036 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00037 
00038 // TAO UIPMC_Profile concrete Profile definitions
00039 /**
00040  * @class TAO_UIPMC_Profile
00041  *
00042  * @brief This class defines the protocol specific attributes required
00043  * for locating ORBs over a TCP/IP network.
00044  *
00045  * This class defines the UIPMC profile as specified in the CORBA
00046  * specification.
00047  *
00048  * @NOTE: This class inherits the ObjectKey from TAO_Profile which may
00049  *  not be needed at all! But lets punt on this for the timebeing.
00050  */
00051 class TAO_PortableGroup_Export TAO_UIPMC_Profile : public TAO_Profile
00052 {
00053 public:
00054   /// The object key delimiter that UIPMC uses or expects.
00055   static const char object_key_delimiter_;
00056   virtual char object_key_delimiter (void) const;
00057 
00058   /// Return the char string prefix.
00059   static const char *prefix (void);
00060 
00061   /// Profile constructor, default. Used when the profile contents
00062   /// are not yet known or when it is being decoded from an IOR.
00063   TAO_UIPMC_Profile (TAO_ORB_Core *orb_core);
00064 
00065   /// Profile constructor, same as above except the object_key has
00066   /// already been marshaled.
00067   TAO_UIPMC_Profile (const ACE_INET_Addr &addr,
00068                      TAO_ORB_Core *orb_core);
00069 
00070   ///  Profile constructor.
00071   TAO_UIPMC_Profile (const CORBA::Octet class_d_address[4],
00072                      CORBA::UShort port,
00073                      TAO_ORB_Core *orb_core);
00074 
00075   /// Create object using a string ior.
00076   TAO_UIPMC_Profile (const char *string,
00077                      TAO_ORB_Core *orb_core
00078                      ACE_ENV_ARG_DECL_WITH_DEFAULTS);
00079 
00080   /// Destructor is to be called only through <_decr_refcnt>.
00081   ~TAO_UIPMC_Profile (void);
00082 
00083   /// Template methods. Please see tao/Profile.h for documentation.
00084   
00085   /// N.B. We have to override the TAO_Profile default decode because
00086   /// in UIPMC there is no object key marshalled and we do not implement
00087   /// a useable ::decode_endpoints
00088   virtual int decode (TAO_InputCDR& cdr);
00089   virtual void parse_string (const char *string
00090                              ACE_ENV_ARG_DECL);
00091   virtual char * to_string (ACE_ENV_SINGLE_ARG_DECL);
00092   virtual int encode_endpoints (void);
00093   virtual TAO_Endpoint *endpoint (void);
00094   virtual CORBA::ULong endpoint_count (void) const;
00095   virtual CORBA::ULong hash (CORBA::ULong max
00096                              ACE_ENV_ARG_DECL_WITH_DEFAULTS);
00097   virtual IOP::TaggedProfile &create_tagged_profile (void);
00098   virtual void request_target_specifier (
00099                       TAO_Target_Specification &target_spec,
00100                       TAO_Target_Specification::TAO_Target_Address r
00101                       ACE_ENV_ARG_DECL);
00102   virtual int supports_multicast (void) const;
00103   virtual void addressing_mode (CORBA::Short addr_mode
00104                                 ACE_ENV_ARG_DECL);
00105   static int extract_group_component (const IOP::TaggedProfile &profile,
00106                                       PortableGroup::TagGroupTaggedComponent &group);
00107 
00108   /// Add the mandatory group component to this profile.
00109   void set_group_info (const char *domain_id,
00110                        PortableGroup::ObjectGroupId group_id,
00111                        PortableGroup::ObjectGroupRefVersion ref_version);
00112 
00113 
00114 protected:
00115   /// Template methods, please see documentation in tao/Profile.h
00116   virtual int decode_profile (TAO_InputCDR& cdr);
00117   virtual int decode_endpoints (void);
00118   virtual void parse_string_i (const char *
00119                                ACE_ENV_ARG_DECL);
00120   virtual void create_profile_body (TAO_OutputCDR &cdr) const;
00121   virtual CORBA::Boolean do_is_equivalent (const TAO_Profile *other_profile);
00122   virtual void update_cached_group_component (void);
00123 
00124 protected:
00125 
00126   /**
00127    * Head of this profile's list of endpoints.  This endpoint is not
00128    * dynamically allocated because a profile always contains at least
00129    * one endpoint.
00130    *
00131    * Currently, a profile contains more than one endpoint, i.e.,
00132    * list contains more than just the head, only when RTCORBA is enabled.
00133    * However, in the near future, this will be used in nonRT
00134    * mode as well, e.g., to support TAG_ALTERNATE_IIOP_ADDRESS
00135    * feature.
00136    * Addressing info of the default endpoint, i.e., head of the list,
00137    * is transmitted using standard UIPMC ProfileBody components.  See
00138    * <encode_endpoints> method documentation above for how the rest of
00139    * the endpoint list is transmitted.
00140    */
00141   TAO_UIPMC_Endpoint endpoint_;
00142 
00143   /// Number of endpoints in the list headed by <endpoint_>.
00144   CORBA::ULong count_;
00145 
00146 private:
00147 
00148   /// Cached version of our tagged profile.
00149   IOP::TaggedProfile tagged_profile_;
00150 
00151   /// Group Domain ID.
00152   ACE_CString group_domain_id_;
00153 
00154   /// Our group ID within the group domain.
00155   PortableGroup::ObjectGroupId group_id_;
00156 
00157   /// The group reference's version.
00158   PortableGroup::ObjectGroupRefVersion ref_version_;
00159 
00160 };
00161 
00162 TAO_END_VERSIONED_NAMESPACE_DECL
00163 
00164 #include /**/ "ace/post.h"
00165 #endif  /* TAO_UIPMC_PROFILE_H */

Generated on Thu Nov 9 14:03:35 2006 for TAO_PortableGroup by doxygen 1.3.6