Tagged_Profile.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   Tagged_Profile.h
00006  *
00007  *  Tagged_Profile.h,v 1.11 2006/04/19 08:57:37 jwillemsen Exp
00008  *
00009  *  @author Bala Natarajan <bala@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_TAGGED_PROFILE_H
00014 #define TAO_TAGGED_PROFILE_H
00015 
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "tao/IOPC.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "tao/Object_KeyC.h"
00025 #include "tao/Versioned_Namespace.h"
00026 #include "ace/SString.h"
00027 
00028 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00029 
00030 namespace TAO
00031 {
00032   namespace CSD
00033   {
00034     class FW_Server_Request_Wrapper;
00035   }
00036 }
00037 
00038 /**
00039  * @class TAO_Tagged_Profile
00040  *
00041  * @brief This class is used to manipulate and access the target
00042  *        address field of a GIOP 1.2 request.
00043  *
00044  */
00045 class TAO_Export TAO_Tagged_Profile
00046 {
00047 public:
00048 
00049   /// Declare FW_Server_Request_Wrapper a friend
00050   /// This friendship makes the FW_Server_Request_Wrapper be able to
00051   /// clone the TAO_Tagged_Profile data member in TAO_ServerRequest.
00052   friend class TAO::CSD::FW_Server_Request_Wrapper;
00053 
00054   /// Ctor
00055   TAO_Tagged_Profile (TAO_ORB_Core *orb_core);
00056 
00057   /// Unmarshall the GIOP 1.2 target address field.
00058   CORBA::Boolean unmarshall_target_address (TAO_InputCDR &cdr);
00059 
00060   /// Unmarshals the received object key for GIOP 1.0/1.1
00061   CORBA::Boolean unmarshall_object_key (TAO_InputCDR &cdr);
00062 
00063   /// Return the object key
00064   TAO::ObjectKey &object_key (void);
00065 
00066   /// Save the object key
00067   void object_key (TAO::ObjectKey &object_key);
00068 
00069   /// Return a const object key
00070   const TAO::ObjectKey &object_key (void) const;
00071 
00072   /// get the tagged_profile
00073   const IOP::TaggedProfile &tagged_profile (void) const;
00074 
00075   /// Get the profile index, that needs to be used in the
00076   /// sequnce of TaggedProfiles contained  IOP::IOR that is
00077   /// receivedfrom the client.
00078   CORBA::ULong profile_index (void) const;
00079 
00080   /// Accessor to the type_id contained in the IOP::IOR received from
00081   /// the client.
00082   const ACE_CString &type_id (void) const;
00083 
00084   CORBA::Short discriminator (void) const;
00085 
00086 private:
00087   /// Extract the object key from the TaggedProfile and store it in
00088   /// <object_key_>
00089   CORBA::Boolean extract_object_key (IOP::TaggedProfile &profile);
00090 
00091   /// Unmarshals the received object key
00092   CORBA::Boolean unmarshall_object_key_i (TAO_InputCDR &cdr);
00093 
00094   /// Unmarshall the IOP::TaggedProfile
00095   CORBA::Boolean unmarshall_iop_profile_i (TAO_InputCDR &cdr);
00096 
00097   /// Unmarshalls the GIOP::IORAddressingInfo
00098   CORBA::Boolean unmarshall_ref_addr_i (TAO_InputCDR &cdr);
00099 
00100 private:
00101   /// Our ORB Core
00102   TAO_ORB_Core *orb_core_;
00103 
00104   /// Keep track of which kind of target profile that was extracted.
00105   CORBA::Short discriminator_;
00106 
00107   /// Flag to denote whether the object key has been extracted yet.
00108   CORBA::Boolean object_key_extracted_;
00109 
00110   /// The object key
00111   TAO::ObjectKey object_key_;
00112 
00113   /// The Tagged profile. This class would have the Tagged Profile
00114   IOP::TaggedProfile profile_;
00115 
00116   /*
00117    * The GIOP::IORAddressingInfo is defined as follows
00118    *   struct IORAddressingInfo
00119    *     {
00120    *       unsigned long selected_profile_index;
00121    *       IOP::IOR ior;
00122    *     };
00123    *
00124    * and the IOP::IOR is defined to be
00125    *   struct IOR
00126    *      {
00127    *        string type_id;
00128    *        sequence<TaggedProfile>   profiles;
00129    *      };
00130    * The mapping for the type_id of type string is TAO::String_Manager
00131    * which does lot of bad things like allocation on construction and
00132    * a deallocation on destruction. This is bad along the critical
00133    * path. So we will store this nested structure ripped open with the
00134    * profile_index and the type_id with the TaggedProfile that is
00135    * pointed to.
00136    */
00137 
00138   /// The profile index incase we receive a GIOP::IORAddressingInfo
00139   /// information
00140   CORBA::ULong profile_index_;
00141 
00142   /// The type_id in the IOP::IOR in case we receive the
00143   /// GIOP::IORAddressingInfo information.
00144   ACE_CString type_id_;
00145 };
00146 
00147 TAO_END_VERSIONED_NAMESPACE_DECL
00148 
00149 #if defined (__ACE_INLINE__)
00150 # include "tao/Tagged_Profile.i"
00151 #endif /* __ACE_INLINE__ */
00152 
00153 #include /**/ "ace/post.h"
00154 
00155 #endif /*TAO_TAGGED_PROFILE_H*/

Generated on Thu Nov 9 11:54:23 2006 for TAO by doxygen 1.3.6