UIPMC_Profile.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file     UIPMC_Profile.h
00006  *
00007  *  $Id: UIPMC_Profile.h 79015 2007-07-24 15:03:04Z vridosh $
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.  @@ Vadym - deprecate this.
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 
00079   /// Destructor is to be called only through <_decr_refcnt>.
00080   ~TAO_UIPMC_Profile (void);
00081 
00082   /// Template methods. Please see tao/Profile.h for documentation.
00083 
00084   /// N.B. We have to override the TAO_Profile default decode because
00085   /// in UIPMC there is no object key marshalled and we do not implement
00086   /// a useable ::decode_endpoints
00087   virtual int decode (TAO_InputCDR& cdr);
00088   virtual void parse_string (const char *string);
00089   virtual char * to_string (void);
00090   virtual int encode_endpoints (void);
00091   virtual TAO_Endpoint *endpoint (void);
00092   virtual CORBA::ULong endpoint_count (void) const;
00093   virtual CORBA::ULong hash (CORBA::ULong max);
00094   virtual IOP::TaggedProfile &create_tagged_profile (void);
00095   virtual void request_target_specifier (
00096                       TAO_Target_Specification &target_spec,
00097                       TAO_Target_Specification::TAO_Target_Address r);
00098   virtual int supports_multicast (void) const;
00099   virtual void addressing_mode (CORBA::Short addr_mode);
00100   static int extract_group_component (const IOP::TaggedProfile &profile,
00101                                       PortableGroup::TagGroupTaggedComponent &group);
00102 
00103   /// Add the mandatory group component to this profile.
00104   void set_group_info (const char *domain_id,
00105                        PortableGroup::ObjectGroupId group_id,
00106                        PortableGroup::ObjectGroupRefVersion ref_version);
00107 
00108 
00109 protected:
00110   /// Template methods, please see documentation in tao/Profile.h
00111   virtual int decode_profile (TAO_InputCDR& cdr);
00112   virtual int decode_endpoints (void);
00113   virtual void parse_string_i (const char *);
00114   virtual void create_profile_body (TAO_OutputCDR &cdr) const;
00115   virtual CORBA::Boolean do_is_equivalent (const TAO_Profile *other_profile);
00116   virtual void update_cached_group_component (void);
00117 
00118 protected:
00119 
00120   /**
00121    * Head of this profile's list of endpoints.  This endpoint is not
00122    * dynamically allocated because a profile always contains at least
00123    * one endpoint.
00124    *
00125    * Currently, a profile contains more than one endpoint, i.e.,
00126    * list contains more than just the head, only when RTCORBA is enabled.
00127    * However, in the near future, this will be used in nonRT
00128    * mode as well, e.g., to support TAG_ALTERNATE_IIOP_ADDRESS
00129    * feature.
00130    * Addressing info of the default endpoint, i.e., head of the list,
00131    * is transmitted using standard UIPMC ProfileBody components.  See
00132    * <encode_endpoints> method documentation above for how the rest of
00133    * the endpoint list is transmitted.
00134    */
00135   TAO_UIPMC_Endpoint endpoint_;
00136 
00137 private:
00138 
00139   /// Cached version of our tagged profile.
00140   IOP::TaggedProfile tagged_profile_;
00141 
00142   /// Group Domain ID.
00143   ACE_CString group_domain_id_;
00144 
00145   /// Our group ID within the group domain.
00146   PortableGroup::ObjectGroupId group_id_;
00147 
00148   /// The group reference's version.
00149   PortableGroup::ObjectGroupRefVersion ref_version_;
00150 
00151   /// A sign whether ref_version is really present
00152   bool has_ref_version_;
00153 };
00154 
00155 TAO_END_VERSIONED_NAMESPACE_DECL
00156 
00157 #include /**/ "ace/post.h"
00158 #endif  /* TAO_UIPMC_PROFILE_H */

Generated on Sun Jan 27 16:22:31 2008 for TAO_PortableGroup by doxygen 1.3.6