Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_Tagged_Profile Class Reference

This class is used to manipulate and access the target address field of a GIOP 1.2 request. More...

#include <Tagged_Profile.h>

Collaboration diagram for TAO_Tagged_Profile:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_Tagged_Profile (TAO_ORB_Core *orb_core)
 Ctor. More...

CORBA::Boolean unmarshall_target_address (TAO_InputCDR &cdr)
 Unmarshall the GIOP 1.2 target address field. More...

CORBA::Boolean unmarshall_object_key (TAO_InputCDR &cdr)
 Unmarshals the received object key for GIOP 1.0/1.1. More...

TAO_ObjectKeyobject_key (void)
 Return the object key. More...

void object_key (TAO_ObjectKey &object_key)
 Save the object key. More...

const TAO_ObjectKeyobject_key (void) const
 Return a const object key. More...

const IOP::TaggedProfiletagged_profile (void) const
 get the tagged_profile. More...

CORBA::ULong profile_index (void) const
 Get the profile index, that needs to be used in the sequnce of TaggedProfiles contained IOP::IOR that is receivedfrom the client. More...

const ACE_CStringtype_id (void) const
 Accessor to the type_id contained in the IOP::IOR received from the client. More...

CORBA::Short discriminator (void) const

Private Methods

CORBA::Boolean extract_object_key (IOP::TaggedProfile &profile)
 Extract the object key from the TaggedProfile and store it in <object_key_>. More...

CORBA::Boolean unmarshall_object_key_i (TAO_InputCDR &cdr)
 Unmarshals the received object key. More...

CORBA::Boolean unmarshall_iop_profile_i (TAO_InputCDR &cdr)
 Unmarshall the IOP::TaggedProfile. More...

CORBA::Boolean unmarshall_ref_addr_i (TAO_InputCDR &cdr)
 Unmarshalls the GIOP::IORAddressingInfo. More...


Private Attributes

TAO_ORB_Coreorb_core_
 Our ORB Core. More...

CORBA::Short discriminator_
 Keep track of which kind of target profile that was extracted. More...

CORBA::Boolean object_key_extracted_
 Flag to denote whether the object key has been extracted yet. More...

TAO_ObjectKey object_key_
 The object key. More...

IOP::TaggedProfile profile_
 The Tagged profile. This class would have the Tagged Profile. More...

CORBA::ULong profile_index_
 The profile index incase we receive a GIOP::IORAddressingInfo information. More...

ACE_CString type_id_
 The type_id in the IOP::IOR in case we receive the GIOP::IORAddressingInfo information. More...


Detailed Description

This class is used to manipulate and access the target address field of a GIOP 1.2 request.

Definition at line 34 of file Tagged_Profile.h.


Constructor & Destructor Documentation

ACE_INLINE TAO_Tagged_Profile::TAO_Tagged_Profile TAO_ORB_Core   orb_core
 

Ctor.

Definition at line 5 of file Tagged_Profile.i.

00006   : orb_core_ (orb_core),
00007     discriminator_ (0),
00008     object_key_ (),
00009     profile_ (),
00010     profile_index_ (0),
00011     type_id_ ()
00012 {
00013 
00014 }


Member Function Documentation

ACE_INLINE CORBA::Short TAO_Tagged_Profile::discriminator void    const
 

Definition at line 60 of file Tagged_Profile.i.

References discriminator_.

00061 {
00062   return this->discriminator_;
00063 }

CORBA::Boolean TAO_Tagged_Profile::extract_object_key IOP::TaggedProfile   profile [private]
 

Extract the object key from the TaggedProfile and store it in <object_key_>.

Definition at line 19 of file Tagged_Profile.cpp.

References TAO_Thread_Lane_Resources::acceptor_registry, ACE_ERROR, ACE_TEXT, TAO_Acceptor_Registry::get_acceptor, TAO_ORB_Core::lane_resources, LM_ERROR, TAO_Acceptor::object_key, orb_core_, and IOP::TaggedProfile::tag.

Referenced by object_key.

00020 {
00021   // Get our Acceptor registry
00022   TAO_Acceptor_Registry &acceptor_registry =
00023     this->orb_core_->lane_resources ().acceptor_registry ();
00024 
00025   // Get the right acceptor for the tag in the TaggedProfile
00026   TAO_Acceptor *acceptor =
00027     acceptor_registry.get_acceptor (profile.tag);
00028 
00029   if (acceptor)
00030     {
00031       // Get the object key
00032       int retval =
00033         acceptor->object_key (profile,
00034                               this->object_key_);
00035       if (retval == -1)
00036         return 0;
00037     }
00038   else
00039     {
00040       if (TAO_debug_level)
00041         ACE_ERROR ((LM_ERROR,
00042                     ACE_TEXT ("(%P|%t)TAO_Tagged_Profile \n")));
00043 
00044       return 0;
00045     }
00046 
00047   return 1;
00048 }

ACE_INLINE const TAO_ObjectKey & TAO_Tagged_Profile::object_key void    const
 

Return a const object key.

Definition at line 36 of file Tagged_Profile.i.

00037 {
00038   return ACE_const_cast(TAO_Tagged_Profile *, this)->object_key ();
00039 }

ACE_INLINE void TAO_Tagged_Profile::object_key TAO_ObjectKey   object_key
 

Save the object key.

Definition at line 27 of file Tagged_Profile.i.

References TAO_Unbounded_Sequence< CORBA::Octet >::get_buffer, TAO_Unbounded_Base_Sequence::length, object_key_, object_key_extracted_, and TAO_Unbounded_Sequence< CORBA::Octet >::replace.

00028 {
00029   this->object_key_.replace (object_key.length (),
00030                              object_key.length (),
00031                              object_key.get_buffer ());
00032   this->object_key_extracted_ = 1;
00033 }

ACE_INLINE TAO_ObjectKey & TAO_Tagged_Profile::object_key void   
 

Return the object key.

Definition at line 18 of file Tagged_Profile.i.

References extract_object_key, object_key_, and object_key_extracted_.

Referenced by TAO_ServerRequest::object_key, TAO_GIOP_Locate_Request_Header::object_key, and TAO_ServerRequest::TAO_ServerRequest.

00019 {
00020   if (this->object_key_extracted_ == 0)
00021     this->object_key_extracted_ = this->extract_object_key (this->profile_);
00022 
00023   return this->object_key_;
00024 }

ACE_INLINE CORBA::ULong TAO_Tagged_Profile::profile_index void    const
 

Get the profile index, that needs to be used in the sequnce of TaggedProfiles contained IOP::IOR that is receivedfrom the client.

Definition at line 48 of file Tagged_Profile.i.

References profile_index_.

00049 {
00050   return this->profile_index_;
00051 }

ACE_INLINE const IOP::TaggedProfile & TAO_Tagged_Profile::tagged_profile void    const
 

get the tagged_profile.

Definition at line 42 of file Tagged_Profile.i.

References profile_.

00043 {
00044   return this->profile_;
00045 }

ACE_INLINE const ACE_CString & TAO_Tagged_Profile::type_id void    const
 

Accessor to the type_id contained in the IOP::IOR received from the client.

Definition at line 54 of file Tagged_Profile.i.

References type_id_.

00055 {
00056   return this->type_id_;
00057 }

CORBA::Boolean TAO_Tagged_Profile::unmarshall_iop_profile_i TAO_InputCDR   cdr [private]
 

Unmarshall the IOP::TaggedProfile.

Definition at line 116 of file Tagged_Profile.cpp.

References ACE_InputCDR::good_bit, and profile_.

Referenced by unmarshall_target_address.

00118 {
00119   CORBA::Boolean hdr_status =
00120     (CORBA::Boolean) input.good_bit ();
00121 
00122   // Extract into the IOP::Tagged profile.
00123   hdr_status &= input >> this->profile_;
00124 
00125   return hdr_status;
00126 }

CORBA::Boolean TAO_Tagged_Profile::unmarshall_object_key TAO_InputCDR   cdr
 

Unmarshals the received object key for GIOP 1.0/1.1.

Definition at line 81 of file Tagged_Profile.cpp.

References discriminator_, TAO_Target_Specification::Key_Addr, and unmarshall_object_key_i.

Referenced by TAO_GIOP_Message_Generator_Parser_10::parse_locate_header, and TAO_GIOP_Message_Generator_Parser_10::parse_request_header.

00083 {
00084   this->discriminator_ = TAO_Target_Specification::Key_Addr;
00085 
00086   return this->unmarshall_object_key_i (input);
00087 }

CORBA::Boolean TAO_Tagged_Profile::unmarshall_object_key_i TAO_InputCDR   cdr [private]
 

Unmarshals the received object key.

Definition at line 91 of file Tagged_Profile.cpp.

References ACE_InputCDR::good_bit, object_key_, object_key_extracted_, ACE_InputCDR::rd_ptr, ACE_InputCDR::read_long, TAO_Unbounded_Sequence< CORBA::Octet >::replace, and ACE_InputCDR::skip_bytes.

Referenced by unmarshall_object_key, and unmarshall_target_address.

00093 {
00094   CORBA::Boolean hdr_status =
00095     (CORBA::Boolean) input.good_bit ();
00096 
00097   CORBA::Long key_length = 0;
00098   hdr_status = hdr_status && input.read_long (key_length);
00099 
00100   if (hdr_status)
00101     {
00102       this->object_key_.replace (key_length,
00103                                  key_length,
00104                                  (CORBA::Octet*)input.rd_ptr (),
00105                                  0);
00106       input.skip_bytes (key_length);
00107 
00108       this->object_key_extracted_ = 1;
00109     }
00110 
00111   return hdr_status;
00112 }

CORBA::Boolean TAO_Tagged_Profile::unmarshall_ref_addr_i TAO_InputCDR   cdr [private]
 

Unmarshalls the GIOP::IORAddressingInfo.

Definition at line 129 of file Tagged_Profile.cpp.

References ACE_InputCDR::good_bit, profile_, profile_index_, ACE_InputCDR::rd_ptr, ACE_InputCDR::read_long, ACE_InputCDR::read_ulong, ACE_InputCDR::skip_bytes, and type_id_.

Referenced by unmarshall_target_address.

00131 {
00132   CORBA::Boolean hdr_status =
00133     (CORBA::Boolean) input.good_bit ();
00134 
00135   /*
00136    * The GIOP::IORAddressingInfo is defined as follows
00137    *   struct IORAddressingInfo
00138    *     {
00139    *       unsigned long selected_profile_index;
00140    *       IOP::IOR ior;
00141    *     };
00142    *
00143    * and the IOP::IOR is defined to be
00144    *   struct IOR
00145    *      {
00146    *        string type_id;
00147    *        sequence<TaggedProfile>   profiles;
00148    *      };
00149    */
00150 
00151   // First read the profile index
00152   CORBA::ULong prof_index =  0;
00153 
00154   hdr_status =
00155     hdr_status && input.read_ulong (prof_index);
00156 
00157   // Set the value in TAO_Tagged_Profile
00158   if (hdr_status)
00159     this->profile_index_ = prof_index;
00160 
00161   // Get the length of the type_id
00162   CORBA::Long id_length = 0;
00163   hdr_status = hdr_status && input.read_long (id_length);
00164 
00165   if (hdr_status)
00166     {
00167       // Set the type_id
00168       this->type_id_.set (input.rd_ptr (),
00169                           0);
00170 
00171       input.skip_bytes (id_length);
00172     }
00173 
00174   // Unmarshall the sequnce of TaggedProfiles
00175   IOP::IOR::_tao_seq_TaggedProfile ior_profiles;
00176 
00177   hdr_status &= input >> ior_profiles;
00178 
00179   // Get the right TaggedProfile from the <ior_profiles>
00180   if (hdr_status)
00181     {
00182       this->profile_ = ior_profiles [prof_index];
00183     }
00184 
00185   return hdr_status;
00186 }

CORBA::Boolean TAO_Tagged_Profile::unmarshall_target_address TAO_InputCDR   cdr
 

Unmarshall the GIOP 1.2 target address field.

Definition at line 51 of file Tagged_Profile.cpp.

References discriminator_, TAO_Target_Specification::Key_Addr, TAO_Target_Specification::Profile_Addr, ACE_InputCDR::read_short, TAO_Target_Specification::Reference_Addr, unmarshall_iop_profile_i, unmarshall_object_key_i, and unmarshall_ref_addr_i.

Referenced by TAO_GIOP_Message_Generator_Parser_12::parse_locate_header, and TAO_GIOP_Message_Generator_Parser_12::parse_request_header.

00052 {
00053   CORBA::Boolean hdr_status = cdr.read_short (this->discriminator_);
00054 
00055   if (hdr_status)
00056     {
00057       switch (this->discriminator_)
00058         {
00059         case TAO_Target_Specification::Key_Addr:
00060           hdr_status = this->unmarshall_object_key_i (cdr);
00061           break;
00062 
00063         case TAO_Target_Specification::Profile_Addr:
00064           hdr_status = this->unmarshall_iop_profile_i (cdr);
00065           break;
00066 
00067         case TAO_Target_Specification::Reference_Addr:
00068           hdr_status = this->unmarshall_ref_addr_i (cdr);
00069           break;
00070 
00071         default:
00072           hdr_status = 0;
00073           break;
00074         }
00075     }
00076 
00077   return hdr_status;
00078 }


Member Data Documentation

CORBA::Short TAO_Tagged_Profile::discriminator_ [private]
 

Keep track of which kind of target profile that was extracted.

Definition at line 89 of file Tagged_Profile.h.

Referenced by discriminator, unmarshall_object_key, and unmarshall_target_address.

TAO_ObjectKey TAO_Tagged_Profile::object_key_ [private]
 

The object key.

Definition at line 95 of file Tagged_Profile.h.

Referenced by object_key, and unmarshall_object_key_i.

CORBA::Boolean TAO_Tagged_Profile::object_key_extracted_ [private]
 

Flag to denote whether the object key has been extracted yet.

Definition at line 92 of file Tagged_Profile.h.

Referenced by object_key, and unmarshall_object_key_i.

TAO_ORB_Core* TAO_Tagged_Profile::orb_core_ [private]
 

Our ORB Core.

Definition at line 86 of file Tagged_Profile.h.

Referenced by extract_object_key.

IOP::TaggedProfile TAO_Tagged_Profile::profile_ [private]
 

The Tagged profile. This class would have the Tagged Profile.

Definition at line 98 of file Tagged_Profile.h.

Referenced by tagged_profile, unmarshall_iop_profile_i, and unmarshall_ref_addr_i.

CORBA::ULong TAO_Tagged_Profile::profile_index_ [private]
 

The profile index incase we receive a GIOP::IORAddressingInfo information.

Definition at line 124 of file Tagged_Profile.h.

Referenced by profile_index, and unmarshall_ref_addr_i.

ACE_CString TAO_Tagged_Profile::type_id_ [private]
 

The type_id in the IOP::IOR in case we receive the GIOP::IORAddressingInfo information.

Definition at line 128 of file Tagged_Profile.h.

Referenced by type_id, and unmarshall_ref_addr_i.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:41:59 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002