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

TAO_Marshal_ObjRef Class Reference

TAO_Marshal_ObjRef. More...

#include <Marshal.h>

Inheritance diagram for TAO_Marshal_ObjRef:

Inheritance graph
[legend]
Collaboration diagram for TAO_Marshal_ObjRef:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_Marshal_ObjRef (void)
virtual CORBA::TypeCode::traverse_status skip (CORBA::TypeCode_ptr tc, TAO_InputCDR *context ACE_ENV_ARG_DECL)
 skip operation. More...

virtual CORBA::TypeCode::traverse_status append (CORBA::TypeCode_ptr tc, TAO_InputCDR *src, TAO_OutputCDR *dest ACE_ENV_ARG_DECL)
 append operation. More...


Detailed Description

TAO_Marshal_ObjRef.

marshal an object reference

Definition at line 205 of file Marshal.h.


Constructor & Destructor Documentation

ACE_INLINE TAO_Marshal_ObjRef::TAO_Marshal_ObjRef void   
 

Definition at line 29 of file Marshal.i.

00030 {
00031 }


Member Function Documentation

CORBA::TypeCode::traverse_status TAO_Marshal_ObjRef::append CORBA::TypeCode_ptr    tc,
TAO_InputCDR   src,
TAO_OutputCDR *dest    ACE_ENV_ARG_DECL
[virtual]
 

append operation.

Implements TAO_Marshal_Object.

Definition at line 264 of file append.cpp.

References ACE_DEBUG, ACE_ENV_ARG_DECL, ACE_NEW_RETURN, ACE_TEXT, ACE_THROW_RETURN, LM_DEBUG, ACE_InputCDR::read_octet_array, ACE_InputCDR::read_ulong, and TAO_DEFAULT_MINOR_CODE.

Referenced by TAO_Marshal_Object::perform_append.

00268 {
00269   CORBA::Boolean continue_append = 1;
00270 
00271   // First, append the type hint. This will be the type_id encoded in an
00272   // object reference.
00273   dest->append_string (*src);
00274 
00275   // Read the profiles, discarding all until an IIOP profile comes by.
00276   // Once we see an IIOP profile, ignore any further ones.
00277   //
00278   // XXX this will need to change someday to let different protocol
00279   // code be accessed, not just IIOP.  Protocol modules will be
00280   // dynamically loaded from shared libraries via ORB_init (), and we
00281   // just need to be able to access such preloaded libraries here as
00282   // we unmarshal objrefs.
00283 
00284   CORBA::ULong profiles = 0;
00285 
00286   // get the count of profiles that follow. This will tell us the
00287   // length of the sequence
00288   continue_append = (CORBA::Boolean) (src->read_ulong (profiles)
00289                                       ? dest->write_ulong (profiles)
00290                                       : 0);
00291 
00292   // No profiles means a NIL objref.
00293   while (profiles-- != 0 && continue_append)
00294     {
00295       CORBA::ULong tag = 0;
00296 
00297       // get the profile ID tag
00298       if ((continue_append = (CORBA::Boolean) (src->read_ulong (tag)
00299                                                ? dest->write_ulong (tag)
00300                                                : 0))  == 0)
00301         continue;
00302 
00303       CORBA::ULong length = 0;
00304       if ((continue_append = (CORBA::Boolean) (src->read_ulong (length)
00305                               ? dest->write_ulong (length)
00306                               : 0)) == 0)
00307         continue;
00308 
00309       // @@ This can be optimized! Pre-allocating on the destination
00310       //    and then copying directly into that.
00311       CORBA::Octet* body = 0;
00312       ACE_NEW_RETURN (body,
00313                       CORBA::Octet[length],
00314                       CORBA::TypeCode::TRAVERSE_STOP);
00315       continue_append =
00316         (CORBA::Boolean) (src->read_octet_array (body, length)
00317                           ? dest->write_octet_array (body, length)
00318                           : 0);
00319       delete [] body;
00320     }
00321 
00322   if (continue_append == 1)
00323     return CORBA::TypeCode::TRAVERSE_CONTINUE;
00324 
00325   if (TAO_debug_level > 0)
00326     ACE_DEBUG ((
00327         LM_DEBUG,
00328         ACE_TEXT ("TAO_Marshal_ObjRef::append detected error\n")
00329       ));
00330 
00331   ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
00332                                     CORBA::COMPLETED_MAYBE),
00333                     CORBA::TypeCode::TRAVERSE_STOP);
00334 }

virtual CORBA::TypeCode::traverse_status TAO_Marshal_ObjRef::skip CORBA::TypeCode_ptr    tc,
TAO_InputCDR *context    ACE_ENV_ARG_DECL
[virtual]
 

skip operation.

Implements TAO_Marshal_Object.


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