diff options
Diffstat (limited to 'TAO/tao/Strategies/UIOP_Profile.cpp')
-rw-r--r-- | TAO/tao/Strategies/UIOP_Profile.cpp | 96 |
1 files changed, 13 insertions, 83 deletions
diff --git a/TAO/tao/Strategies/UIOP_Profile.cpp b/TAO/tao/Strategies/UIOP_Profile.cpp index 21ebcdf9639..549b302b26d 100644 --- a/TAO/tao/Strategies/UIOP_Profile.cpp +++ b/TAO/tao/Strategies/UIOP_Profile.cpp @@ -1,7 +1,6 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ - #include "UIOP_Profile.h" #if TAO_HAS_UIOP == 1 @@ -17,7 +16,6 @@ ACE_RCSID (Strategies, UIOP_Profile, "$Id$") - #if !defined (__ACE_INLINE__) # include "UIOP_Profile.i" #endif /* __ACE_INLINE__ */ @@ -36,11 +34,12 @@ TAO_UIOP_Profile::TAO_UIOP_Profile (const ACE_UNIX_Addr &addr, const TAO_ObjectKey &object_key, const TAO_GIOP_Message_Version &version, TAO_ORB_Core *orb_core) - : TAO_Profile (TAO_TAG_UIOP_PROFILE, orb_core, version), + : TAO_Profile (TAO_TAG_UIOP_PROFILE, + orb_core, + object_key, + version), endpoint_ (addr), - count_ (1), - object_key_ (object_key), - tagged_profile_ () + count_ (1) { } @@ -49,11 +48,12 @@ TAO_UIOP_Profile::TAO_UIOP_Profile (const char *, const ACE_UNIX_Addr &addr, const TAO_GIOP_Message_Version &version, TAO_ORB_Core *orb_core) - : TAO_Profile (TAO_TAG_UIOP_PROFILE, orb_core, version), + : TAO_Profile (TAO_TAG_UIOP_PROFILE, + orb_core, + object_key, + version), endpoint_ (addr), - count_ (1), - object_key_ (object_key), - tagged_profile_ () + count_ (1) { } @@ -61,11 +61,9 @@ TAO_UIOP_Profile::TAO_UIOP_Profile (TAO_ORB_Core *orb_core) : TAO_Profile (TAO_TAG_UIOP_PROFILE, orb_core, TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, - TAO_DEF_GIOP_MINOR)), + TAO_DEF_GIOP_MINOR)), endpoint_ (), - count_ (1), - object_key_ (), - tagged_profile_ () + count_ (1) { } @@ -400,55 +398,6 @@ TAO_UIOP_Profile::encode (TAO_OutputCDR &stream) const return 1; } -IOP::TaggedProfile & -TAO_UIOP_Profile::create_tagged_profile (void) -{ - // Check whether we have already created the TaggedProfile - if (this->tagged_profile_.profile_data.get_buffer () == 0) - { - // As we have not created we will now create the TaggedProfile - this->tagged_profile_.tag = TAO_TAG_UIOP_PROFILE; - - // Create the encapsulation.... - TAO_OutputCDR encap (ACE_CDR::DEFAULT_BUFSIZE, - TAO_ENCAP_BYTE_ORDER, - this->orb_core ()->output_cdr_buffer_allocator (), - this->orb_core ()->output_cdr_dblock_allocator (), - this->orb_core ()->output_cdr_msgblock_allocator (), - this->orb_core ()->orb_params ()->cdr_memcpy_tradeoff (), - TAO_DEF_GIOP_MAJOR, - TAO_DEF_GIOP_MINOR, - this->orb_core ()->to_iso8859 (), - this->orb_core ()->to_unicode ()); - - // Create the profile body - this->create_profile_body (encap); - - CORBA::ULong length = - ACE_static_cast(CORBA::ULong, encap.total_length ()); - -#if (TAO_NO_COPY_OCTET_SEQUENCES == 1) - // Place the message block in to the Sequence of Octets that we - // have - this->tagged_profile_.profile_data.replace (length, - encap.begin ()); -#else - this->tagged_profile_.profile_data.length (length); - CORBA::Octet *buffer = - this->tagged_profile_.profile_data.get_buffer (); - for (const ACE_Message_Block *i = encap.begin (); - i != encap.end (); - i = i->next ()) - { - ACE_OS::memcpy (buffer, i->rd_ptr (), i->length ()); - buffer += i->length (); - } -#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1*/ - } - - return this->tagged_profile_; -} - void TAO_UIOP_Profile::create_profile_body (TAO_OutputCDR &encap) const { @@ -499,27 +448,8 @@ TAO_UIOP_Profile::encode_endpoints (void) == 0) || (out_cdr << endpoints) == 0) return -1; - CORBA::ULong length = out_cdr.total_length (); - - IOP::TaggedComponent tagged_component; - tagged_component.tag = TAO_TAG_ENDPOINTS; - tagged_component.component_data.length (length); - CORBA::Octet *buf = - tagged_component.component_data.get_buffer (); - - for (const ACE_Message_Block *iterator = out_cdr.begin (); - iterator != 0; - iterator = iterator->cont ()) - { - CORBA::ULong i_length = iterator->length (); - ACE_OS::memcpy (buf, iterator->rd_ptr (), i_length); - - buf += i_length; - } - // Add component with encoded endpoint data to this profile's - // TaggedComponents. - tagged_components_.set_component (tagged_component); + this->set_tagged_components (out_cdr); return 0; } |