3 //=============================================================================
5 * @file Tagged_Profile.h
7 * @author Bala Natarajan <bala@cs.wustl.edu>
9 //=============================================================================
11 #ifndef TAO_TAGGED_PROFILE_H
12 #define TAO_TAGGED_PROFILE_H
14 #include /**/ "ace/pre.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/Object_KeyC.h"
23 #include /**/ "tao/Versioned_Namespace.h"
24 #include "ace/SString.h"
26 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
32 class FW_Server_Request_Wrapper
;
37 * @class TAO_Tagged_Profile
39 * @brief This class is used to manipulate and access the target
40 * address field of a GIOP 1.2 request.
42 class TAO_Export TAO_Tagged_Profile
45 /// Declare FW_Server_Request_Wrapper a friend
46 /// This friendship makes the FW_Server_Request_Wrapper be able to
47 /// clone the TAO_Tagged_Profile data member in TAO_ServerRequest.
48 friend class TAO::CSD::FW_Server_Request_Wrapper
;
51 TAO_Tagged_Profile (TAO_ORB_Core
*orb_core
);
53 /// Unmarshal the GIOP 1.2 target address field.
54 CORBA::Boolean
unmarshall_target_address (TAO_InputCDR
&cdr
);
56 /// Unmarshals the received object key for GIOP 1.0/1.1
57 CORBA::Boolean
unmarshall_object_key (TAO_InputCDR
&cdr
);
59 /// Return the object key
60 TAO::ObjectKey
&object_key ();
62 /// Save the object key
63 void object_key (TAO::ObjectKey
&object_key
);
65 /// Return a const object key
66 const TAO::ObjectKey
&object_key () const;
68 /// Get the tagged_profile
69 const IOP::TaggedProfile
&tagged_profile () const;
71 /// Get the profile index, that needs to be used in the
72 /// sequnce of TaggedProfiles contained IOP::IOR that is
73 /// received from the client.
74 CORBA::ULong
profile_index () const;
76 /// Accessor to the type_id contained in the IOP::IOR received from
78 const char* type_id () const;
80 CORBA::Short
discriminator () const;
83 /// Extract the object key from the TaggedProfile and store it in
85 CORBA::Boolean
extract_object_key (IOP::TaggedProfile
&profile
);
87 /// Unmarshals the received object key
88 CORBA::Boolean
unmarshall_object_key_i (TAO_InputCDR
&cdr
);
90 /// Unmarshall the IOP::TaggedProfile
91 CORBA::Boolean
unmarshall_iop_profile_i (TAO_InputCDR
&cdr
);
93 /// Unmarshalls the GIOP::IORAddressingInfo
94 CORBA::Boolean
unmarshall_ref_addr_i (TAO_InputCDR
&cdr
);
98 TAO_ORB_Core
*orb_core_
;
100 /// Keep track of which kind of target profile that was extracted.
101 CORBA::Short discriminator_
;
103 /// Flag to denote whether the object key has been extracted yet.
104 CORBA::Boolean object_key_extracted_
;
107 TAO::ObjectKey object_key_
;
109 /// The Tagged profile. This class would have the Tagged Profile
110 IOP::TaggedProfile profile_
;
113 * The GIOP::IORAddressingInfo is defined as follows
114 * struct IORAddressingInfo
116 * unsigned long selected_profile_index;
120 * and the IOP::IOR is defined to be
124 * sequence<TaggedProfile> profiles;
126 * The mapping for the type_id of type string is TAO::String_Manager
127 * which does lot of bad things like allocation on construction and
128 * a deallocation on destruction. This is bad along the critical
129 * path. So we will store this nested structure ripped open with the
130 * profile_index and the type_id with the TaggedProfile that is
134 /// The profile index incase we receive a GIOP::IORAddressingInfo
136 CORBA::ULong profile_index_
;
138 /// The type_id in the IOP::IOR in case we receive the
139 /// GIOP::IORAddressingInfo information.
140 const char* type_id_
;
143 TAO_END_VERSIONED_NAMESPACE_DECL
145 #if defined (__ACE_INLINE__)
146 # include "tao/Tagged_Profile.inl"
147 #endif /* __ACE_INLINE__ */
149 #include /**/ "ace/post.h"
151 #endif /*TAO_TAGGED_PROFILE_H*/