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

append.cpp

Go to the documentation of this file.
00001 #include "tao_pch.h"
00002 // $Id: append.cpp,v 1.1.1.4.2.1 2003/03/14 16:05:16 chad Exp $
00003 
00004 // ============================================================================
00005 //
00006 // = LIBRARY
00007 //     TAO
00008 //
00009 // = FILENAME
00010 //     append.cpp
00011 //
00012 // = DESCRIPTION
00013 //     Appends a CDR stream to another CDR stream. Due to the
00014 //     stringent alignment requirements, it is not possible to simply
00015 //     append or memcpy. Instead we go thru the same CDR encoding rules
00016 //
00017 // = AUTHOR
00018 //     Copyright 1994-1995 by Sun Microsystems Inc.
00019 //     and Aniruddha Gokhale
00020 //
00021 // ============================================================================
00022 
00023 #include "tao/Marshal.h"
00024 #include "tao/CDR.h"
00025 #include "tao/Environment.h"
00026 #include "tao/Any.h"
00027 #include "tao/ValueBase.h"
00028 #include "tao/debug.h"
00029 
00030 ACE_RCSID(tao, append, "$Id: append.cpp,v 1.1.1.4.2.1 2003/03/14 16:05:16 chad Exp $")
00031 
00032 // Encode instances of arbitrary data types based only on typecode.
00033 // "data" points to the data type; if it's not a primitve data type,
00034 // the TypeCode interpreter is used to recursively encode its
00035 // components.  "context" is the marshaling stream on which to encode
00036 // the data value.
00037 
00038 CORBA::TypeCode::traverse_status
00039 TAO_Marshal_Primitive::append (CORBA::TypeCode_ptr tc,
00040                                TAO_InputCDR *src,
00041                                TAO_OutputCDR *dest
00042                                ACE_ENV_ARG_DECL)
00043 {
00044   CORBA::Boolean continue_append = 1;
00045   CORBA::TypeCode::traverse_status retval =
00046     CORBA::TypeCode::TRAVERSE_CONTINUE; // status of encode operation
00047 
00048   switch (tc->kind_)
00049     {
00050     case CORBA::tk_null:
00051     case CORBA::tk_void:
00052       break;
00053     case CORBA::tk_short:
00054     case CORBA::tk_ushort:
00055       continue_append = dest->append_short (*src);
00056       break;
00057     case CORBA::tk_long:
00058     case CORBA::tk_ulong:
00059     case CORBA::tk_float:
00060     case CORBA::tk_enum:
00061       continue_append = dest->append_long (*src);
00062       break;
00063     case CORBA::tk_double:
00064     case CORBA::tk_longlong:
00065     case CORBA::tk_ulonglong:
00066       continue_append = dest->append_double (*src);
00067       break;
00068     case CORBA::tk_boolean:
00069       continue_append = dest->append_boolean (*src);
00070       break;
00071     case CORBA::tk_char:
00072     case CORBA::tk_octet:
00073       continue_append = dest->append_octet (*src);
00074       break;
00075     case CORBA::tk_longdouble:
00076       continue_append = dest->append_longdouble (*src);
00077       break;
00078     case CORBA::tk_wchar:
00079       continue_append = dest->append_wchar (*src);
00080       break;
00081     default:
00082       retval = CORBA::TypeCode::TRAVERSE_STOP;
00083       // we are not a primitive type
00084     }
00085 
00086   if (retval == CORBA::TypeCode::TRAVERSE_CONTINUE
00087       && continue_append == 1)
00088     return CORBA::TypeCode::TRAVERSE_CONTINUE;
00089 
00090   if (TAO_debug_level > 0)
00091     ACE_DEBUG ((
00092         LM_DEBUG,
00093         ACE_TEXT ("TAO_Marshal_Primitive::append detected error\n")
00094       ));
00095 
00096   ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
00097                                     CORBA::COMPLETED_MAYBE),
00098                     CORBA::TypeCode::TRAVERSE_STOP);
00099 }
00100 
00101 CORBA::TypeCode::traverse_status
00102 TAO_Marshal_Any::append (CORBA::TypeCode_ptr,
00103                          TAO_InputCDR *src,
00104                          TAO_OutputCDR *dest
00105                          ACE_ENV_ARG_DECL)
00106 {
00107   // Typecode of the element that makes the Any.
00108   CORBA::TypeCode_var elem_tc;
00109 
00110   if (!(*src >> elem_tc.inout ()))
00111     ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
00112                                       CORBA::COMPLETED_MAYBE),
00113                       CORBA::TypeCode::TRAVERSE_STOP);
00114 
00115   if (!(*dest << elem_tc.in ()))
00116     ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
00117                                       CORBA::COMPLETED_MAYBE),
00118                       CORBA::TypeCode::TRAVERSE_STOP);
00119 
00120   // append the data
00121   CORBA::TypeCode::traverse_status retval =
00122     TAO_Marshal_Object::perform_append (elem_tc.in (),
00123                                         src,
00124                                         dest
00125                                          ACE_ENV_ARG_PARAMETER);
00126   ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00127 
00128   if (retval != CORBA::TypeCode::TRAVERSE_CONTINUE)
00129     {
00130       if (TAO_debug_level > 0)
00131         ACE_DEBUG ((LM_DEBUG,
00132                     ACE_TEXT ("TAO_Marshal_Any::append detected error\n")));
00133 
00134       ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
00135                                         CORBA::COMPLETED_MAYBE),
00136                         CORBA::TypeCode::TRAVERSE_STOP);
00137     }
00138 
00139   return retval;
00140 }
00141 
00142 CORBA::TypeCode::traverse_status
00143 TAO_Marshal_TypeCode::append (CORBA::TypeCode_ptr,
00144                               TAO_InputCDR *src,
00145                               TAO_OutputCDR *dest
00146                               ACE_ENV_ARG_DECL)
00147 {
00148   CORBA::Boolean continue_append = 1;
00149   CORBA::TypeCode::traverse_status retval =
00150     CORBA::TypeCode::TRAVERSE_CONTINUE;
00151   CORBA::ULong kind;
00152 
00153   // Decode the "kind" field of the typecode from the src for further
00154   // use. However, also write it back into the destination
00155   continue_append = (CORBA::Boolean) (src->read_ulong (kind)
00156                                       ? dest->write_ulong (kind)
00157                                       : 0);
00158 
00159   if (continue_append == 1)
00160     {
00161       // Typecodes with empty parameter lists all have preallocated
00162       // constants.  We use those to reduce memory consumption and
00163       // heap access ... also, to speed things up!
00164       if ((kind < CORBA::TC_KIND_COUNT)
00165           || (kind == ~0u))
00166         {
00167           // Either a non-constant typecode or an indirected typecode.
00168           switch (kind)
00169             {
00170               // Need special handling for all kinds of typecodes that
00171               // have nonempty parameter lists ...
00172             default:
00173               // nothing to de done
00174               break;
00175             case CORBA::tk_string:
00176             case CORBA::tk_wstring:
00177               {
00178                 // read and write the bounds
00179                 retval =
00180                   TAO_Marshal_Object::perform_append (CORBA::_tc_long,
00181                                                       src,
00182                                                       dest
00183                                                        ACE_ENV_ARG_PARAMETER);
00184                 ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00185               }
00186             break;
00187 
00188             // Indirected typecodes, illegal at "top level"
00189             case ~0u:
00190               {
00191                 // read and write the negative offset
00192                 retval =
00193                   TAO_Marshal_Object::perform_append (CORBA::_tc_long,
00194                                                       src,
00195                                                       dest
00196                                                        ACE_ENV_ARG_PARAMETER);
00197                 ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00198               }
00199             break;
00200 
00201             // The rest have "complex" parameter lists that are
00202             // encoded as bulk octets ...
00203             case CORBA::tk_objref:
00204             case CORBA::tk_struct:
00205             case CORBA::tk_union:
00206             case CORBA::tk_enum:
00207             case CORBA::tk_sequence:
00208             case CORBA::tk_array:
00209             case CORBA::tk_alias:
00210             case CORBA::tk_except:
00211             case CORBA::tk_value:
00212               {
00213                 // write the encapsulation i.e., octet sequence
00214                 retval =
00215                   TAO_Marshal_Object::perform_append (TC_opaque,
00216                                                       src,
00217                                                       dest
00218                                                        ACE_ENV_ARG_PARAMETER);
00219                 ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00220               }
00221             } // end of switch
00222         }
00223       else // bad kind_ value to be decoded
00224         {
00225           if (TAO_debug_level > 0)
00226             ACE_DEBUG ((LM_DEBUG,
00227                         ACE_TEXT ("TAO_Marshal_TypeCode: ")
00228                         ACE_TEXT ("Bad kind_ value in CDR stream\n")));
00229 
00230           ACE_THROW_RETURN (CORBA::BAD_TYPECODE (),
00231                             CORBA::TypeCode::TRAVERSE_STOP);
00232         }
00233     }
00234 
00235   if ((continue_append == 1) &&
00236       (retval == CORBA::TypeCode::TRAVERSE_CONTINUE))
00237     return CORBA::TypeCode::TRAVERSE_CONTINUE;
00238 
00239   if (TAO_debug_level > 0)
00240     ACE_DEBUG ((
00241         LM_DEBUG,
00242         ACE_TEXT ("TAO_Marshal_TypeCode::append detected error\n")
00243       ));
00244 
00245   ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
00246                                     CORBA::COMPLETED_MAYBE),
00247                     CORBA::TypeCode::TRAVERSE_STOP);
00248 }
00249 
00250 CORBA::TypeCode::traverse_status
00251 TAO_Marshal_Principal::append (CORBA::TypeCode_ptr,
00252                                TAO_InputCDR *src,
00253                                TAO_OutputCDR *dest
00254                                ACE_ENV_ARG_DECL)
00255 {
00256   // write the octet sequence representing the Principal
00257   return TAO_Marshal_Object::perform_append (TC_opaque,
00258                                              src,
00259                                              dest
00260                                               ACE_ENV_ARG_PARAMETER);
00261 }
00262 
00263 CORBA::TypeCode::traverse_status
00264 TAO_Marshal_ObjRef::append (CORBA::TypeCode_ptr,
00265                             TAO_InputCDR *src,
00266                             TAO_OutputCDR *dest
00267                             ACE_ENV_ARG_DECL)
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 }
00335 
00336 CORBA::TypeCode::traverse_status
00337 TAO_Marshal_Struct::append (CORBA::TypeCode_ptr  tc,
00338                             TAO_InputCDR *src,
00339                             TAO_OutputCDR *dest
00340                             ACE_ENV_ARG_DECL)
00341 {
00342   CORBA::TypeCode::traverse_status retval =
00343     CORBA::TypeCode::TRAVERSE_CONTINUE;
00344   CORBA::TypeCode_var param;
00345 
00346   // Number of fields in the struct.
00347   int member_count = tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER);
00348   ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00349 
00350   for (int i = 0;
00351        i < member_count && retval == CORBA::TypeCode::TRAVERSE_CONTINUE;
00352        i++)
00353     {
00354       // get member type
00355       param = tc->member_type (i ACE_ENV_ARG_PARAMETER);
00356       ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00357 
00358       retval =
00359         TAO_Marshal_Object::perform_append (param.in (),
00360                                             src,
00361                                             dest
00362                                              ACE_ENV_ARG_PARAMETER);
00363       ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00364     }
00365 
00366   if (retval == CORBA::TypeCode::TRAVERSE_CONTINUE)
00367     return CORBA::TypeCode::TRAVERSE_CONTINUE;
00368 
00369   if (TAO_debug_level > 0)
00370     ACE_DEBUG ((LM_DEBUG,
00371                 ACE_TEXT ("TAO_Marshal_Struct::append detected error\n")));
00372 
00373   ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
00374                                     CORBA::COMPLETED_MAYBE),
00375                     CORBA::TypeCode::TRAVERSE_STOP);
00376 }
00377 
00378 CORBA::TypeCode::traverse_status
00379 TAO_Marshal_Union::append (CORBA::TypeCode_ptr tc,
00380                            TAO_InputCDR *src,
00381                            TAO_OutputCDR *dest
00382                            ACE_ENV_ARG_DECL)
00383 {
00384   CORBA::TypeCode_var discrim_tc =
00385     tc->discriminator_type (ACE_ENV_SINGLE_ARG_PARAMETER);
00386   ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00387 
00388   CORBA::ULong kind =
00389     discrim_tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
00390   ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00391 
00392   // Save the discriminator value in a temporary variable...
00393   CORBA::Short short_v;
00394   CORBA::UShort ushort_v;
00395   CORBA::Long long_v;
00396   CORBA::ULong ulong_v;
00397   CORBA::ULong enum_v;
00398   CORBA::Char char_v;
00399   CORBA::WChar wchar_v;
00400   CORBA::Boolean boolean_v;
00401 
00402   switch (kind)
00403     {
00404     case CORBA::tk_short:
00405       {
00406         if (!src->read_short (short_v)
00407             || !dest->write_short (short_v))
00408           return CORBA::TypeCode::TRAVERSE_STOP;
00409       }
00410       break;
00411 
00412     case CORBA::tk_ushort:
00413       {
00414         if (!src->read_ushort (ushort_v)
00415             || !dest->write_ushort (ushort_v))
00416           return CORBA::TypeCode::TRAVERSE_STOP;
00417       }
00418       break;
00419 
00420     case CORBA::tk_long:
00421       {
00422         if (!src->read_long (long_v)
00423             || !dest->write_long (long_v))
00424           return CORBA::TypeCode::TRAVERSE_STOP;
00425       }
00426       break;
00427 
00428     case CORBA::tk_ulong:
00429       {
00430         if (!src->read_ulong (ulong_v)
00431             || !dest->write_ulong (ulong_v))
00432           return CORBA::TypeCode::TRAVERSE_STOP;
00433       }
00434       break;
00435 
00436     case CORBA::tk_enum:
00437       {
00438         if (!src->read_ulong (enum_v)
00439             || !dest->write_ulong (enum_v))
00440           return CORBA::TypeCode::TRAVERSE_STOP;
00441       }
00442       break;
00443 
00444     case CORBA::tk_char:
00445       {
00446         if (!src->read_char (char_v)
00447             || !dest->write_char (char_v))
00448           return CORBA::TypeCode::TRAVERSE_STOP;
00449       }
00450       break;
00451 
00452     case CORBA::tk_wchar:
00453       {
00454         if (!src->read_wchar (wchar_v)
00455             || !dest->write_wchar (wchar_v))
00456           return CORBA::TypeCode::TRAVERSE_STOP;
00457       }
00458       break;
00459 
00460     case CORBA::tk_boolean:
00461       {
00462         if (!src->read_boolean (boolean_v)
00463             || !dest->write_boolean (boolean_v))
00464           return CORBA::TypeCode::TRAVERSE_STOP;
00465       }
00466       break;
00467 
00468     default:
00469       return CORBA::TypeCode::TRAVERSE_STOP;
00470     }
00471 
00472   CORBA::ULong member_count =
00473     tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER);
00474   ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00475 
00476   const CORBA::ULong null_member = ~ACE_static_cast (CORBA::ULong, 0U);
00477 
00478   CORBA::ULong current_member = null_member;
00479   CORBA::ULong default_member = null_member;
00480 
00481   for (CORBA::ULong i = 0;
00482        i != member_count && current_member == null_member;
00483        ++i)
00484     {
00485       CORBA::Any_var any = tc->member_label (i
00486                                               ACE_ENV_ARG_PARAMETER);
00487       ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00488 
00489       CORBA::Octet o;
00490       if ((any >>= CORBA::Any::to_octet (o)) && o == 0)
00491         {
00492           CORBA::ULong default_index =
00493             tc->default_index (ACE_ENV_SINGLE_ARG_PARAMETER);
00494           ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00495 
00496           if (i != default_index)
00497             ACE_THROW_RETURN (CORBA::BAD_TYPECODE (),
00498                               CORBA::TypeCode::TRAVERSE_STOP);
00499           // Found the default branch, save its position and continue
00500           // trying to find the current value...
00501           default_member = i;
00502           continue;
00503         }
00504 
00505       switch (kind)
00506         {
00507         case CORBA::tk_short:
00508           {
00509             CORBA::Short d;
00510             if ((any >>= d) && d == short_v)
00511               current_member = i;
00512           }
00513           break;
00514 
00515         case CORBA::tk_ushort:
00516           {
00517             CORBA::UShort d;
00518             if ((any >>= d) && d == ushort_v)
00519               current_member = i;
00520           }
00521           break;
00522 
00523         case CORBA::tk_long:
00524           {
00525             CORBA::Long d;
00526             if ((any >>= d) && d == long_v)
00527               current_member = i;
00528           }
00529           break;
00530 
00531         case CORBA::tk_ulong:
00532           {
00533             CORBA::ULong d;
00534             if ((any >>= d) && d == ulong_v)
00535               current_member = i;
00536           }
00537           break;
00538 
00539         case CORBA::tk_enum:
00540           {
00541             CORBA::ULong d;
00542 
00543             // Create an special Any to handle this case.
00544             CORBA::Any tmp;
00545             tmp._tao_replace (CORBA::_tc_ulong,
00546                               any->_tao_byte_order (),
00547                               any->_tao_get_cdr ());
00548             if ((tmp >>= d) && d == enum_v)
00549               current_member = i;
00550           }
00551           break;
00552 
00553         case CORBA::tk_char:
00554           {
00555             CORBA::Char d;
00556             if ((any >>= CORBA::Any::to_char (d)) && d == char_v)
00557               current_member = i;
00558           }
00559           break;
00560 
00561         case CORBA::tk_wchar:
00562           {
00563             CORBA::WChar d;
00564             if ((any >>= CORBA::Any::to_wchar (d)) && d == wchar_v)
00565               current_member = i;
00566           }
00567           break;
00568 
00569         case CORBA::tk_boolean:
00570           {
00571             CORBA::Boolean d;
00572             if ((any >>= CORBA::Any::to_boolean (d)) && d == boolean_v)
00573               current_member = i;
00574           }
00575           break;
00576 
00577         default:
00578           return CORBA::TypeCode::TRAVERSE_STOP;
00579         }
00580     }
00581 
00582   if (current_member == null_member)
00583     {
00584       // Cannot find the current member, check if there is a
00585       // default...
00586       if (default_member != null_member)
00587         {
00588           // Good, use the default to append...
00589           CORBA::TypeCode_var member_tc =
00590             tc->member_type (default_member ACE_ENV_ARG_PARAMETER);
00591           ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00592           return TAO_Marshal_Object::perform_append (member_tc.in (),
00593                                                      src,
00594                                                      dest
00595                                                       ACE_ENV_ARG_PARAMETER);
00596         }
00597 
00598       // If we're here, we have an implicit default case, and we
00599       // should just return without appending anything, since no
00600       // union member was marshaled in the first place.
00601       return CORBA::TypeCode::TRAVERSE_CONTINUE;
00602     }
00603 
00604   // If we found the member successfully then just use that one...
00605   CORBA::TypeCode_var member_tc =
00606     tc->member_type (current_member ACE_ENV_ARG_PARAMETER);
00607   ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00608   return TAO_Marshal_Object::perform_append (member_tc.in (),
00609                                              src,
00610                                              dest
00611                                               ACE_ENV_ARG_PARAMETER);
00612 }
00613 
00614 CORBA::TypeCode::traverse_status
00615 TAO_Marshal_String::append (CORBA::TypeCode_ptr,
00616                             TAO_InputCDR *src,
00617                             TAO_OutputCDR *dest
00618                             ACE_ENV_ARG_DECL)
00619 {
00620   CORBA::Boolean continue_append = 1;
00621 
00622   // On decode, omit the check against specified string bounds, and
00623   // cope with illegal "zero length" strings (all lengths on the wire
00624   // must include a NUL).
00625   //
00626   // This is on the principle of being gracious in what we accept; we
00627   // don't generate messages that fail to comply with protocol specs,
00628   // but we will accept them when it's clear how to do so.
00629 
00630   continue_append = dest->append_string (*src);
00631   if (continue_append == 1)
00632     return CORBA::TypeCode::TRAVERSE_CONTINUE;
00633 
00634   if (TAO_debug_level > 0)
00635     ACE_DEBUG ((LM_DEBUG,
00636                 ACE_TEXT ("TAO_Marshal_TypeCode::append detected error")));
00637 
00638   ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
00639                                     CORBA::COMPLETED_MAYBE),
00640                     CORBA::TypeCode::TRAVERSE_STOP);
00641 }
00642 
00643 CORBA::TypeCode::traverse_status
00644 TAO_Marshal_Sequence::append (CORBA::TypeCode_ptr  tc,
00645                               TAO_InputCDR *src,
00646                               TAO_OutputCDR *dest
00647                               ACE_ENV_ARG_DECL)
00648 {
00649   // Size of element.
00650   CORBA::ULong bounds;
00651 
00652   // First unmarshal the sequence length ... we trust it to be right
00653   // here, on the "be gracious in what you accept" principle.  We
00654   // don't generate illegal sequences (i.e. length > bounds).
00655 
00656   CORBA::Boolean continue_append =
00657     (CORBA::Boolean) (src->read_ulong (bounds)
00658                       ? dest->write_ulong (bounds)
00659                       : 0);
00660 
00661   if (!continue_append)
00662     {
00663       ACE_DEBUG ((
00664           LM_DEBUG,
00665           ACE_TEXT ("TAO_Marshal_Sequence::append detected error\n")
00666         ));
00667       ACE_THROW_RETURN (CORBA::MARSHAL (),
00668                         CORBA::TypeCode::TRAVERSE_STOP);
00669     }
00670 
00671   if (bounds == 0)
00672     {
00673       return CORBA::TypeCode::TRAVERSE_CONTINUE;
00674     }
00675 
00676   if (continue_append)
00677     {
00678       // Get element typecode.
00679       CORBA::TypeCode_var tc2 =
00680         tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
00681       ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00682 
00683       CORBA::TypeCode::traverse_status retval =
00684         CORBA::TypeCode::TRAVERSE_CONTINUE;
00685 
00686       CORBA::TCKind kind = tc2->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
00687       ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00688 
00689       switch (kind)
00690         {
00691         case CORBA::tk_octet:
00692           {
00693             char* buf;
00694             if (dest->adjust (ACE_CDR::OCTET_SIZE * bounds,
00695                               ACE_CDR::OCTET_ALIGN, buf) == 0)
00696               {
00697                 if (src->read_octet_array ((ACE_CDR::Octet*)buf, bounds) == 0)
00698                   retval = CORBA::TypeCode::TRAVERSE_STOP;
00699               }
00700           }
00701           break;
00702         case CORBA::tk_boolean:
00703           {
00704             char* buf;
00705             if (dest->adjust (ACE_CDR::OCTET_SIZE * bounds,
00706                               ACE_CDR::OCTET_ALIGN, buf) == 0)
00707               {
00708                 if (src->read_boolean_array ((ACE_CDR::Boolean*)buf, bounds) == 0)
00709                   retval = CORBA::TypeCode::TRAVERSE_STOP;
00710               }
00711           }
00712           break;
00713         case CORBA::tk_char:
00714           {
00715             char* buf;
00716             if (dest->adjust (ACE_CDR::OCTET_SIZE * bounds,
00717                               ACE_CDR::OCTET_ALIGN, buf) == 0)
00718               {
00719                 if (src->read_char_array ((ACE_CDR::Char*)buf, bounds) == 0)
00720                   retval = CORBA::TypeCode::TRAVERSE_STOP;
00721               }
00722           }
00723           break;
00724         case CORBA::tk_short:
00725           {
00726             char* buf;
00727             if (dest->adjust (ACE_CDR::SHORT_SIZE * bounds,
00728                               ACE_CDR::SHORT_ALIGN, buf) == 0)
00729               {
00730                 if (src->read_short_array ((ACE_CDR::Short*)buf, bounds) == 0)
00731                   retval = CORBA::TypeCode::TRAVERSE_STOP;
00732               }
00733           }
00734           break;
00735         case CORBA::tk_ushort:
00736           {
00737             char* buf;
00738             if (dest->adjust (ACE_CDR::SHORT_SIZE * bounds,
00739                               ACE_CDR::SHORT_ALIGN, buf) == 0)
00740               {
00741                 if (src->read_ushort_array ((ACE_CDR::UShort*)buf, bounds) == 0)
00742                   retval = CORBA::TypeCode::TRAVERSE_STOP;
00743               }
00744           }
00745           break;
00746         case CORBA::tk_wchar:
00747           {
00748             char* buf;
00749             if (dest->adjust (ACE_CDR::SHORT_SIZE * bounds,
00750                               ACE_CDR::SHORT_ALIGN, buf) == 0)
00751               {
00752                 if (src->read_wchar_array ((ACE_CDR::WChar*)buf, bounds) == 0)
00753                   retval = CORBA::TypeCode::TRAVERSE_STOP;
00754               }
00755           }
00756           break;
00757         case CORBA::tk_long:
00758           {
00759             char* buf;
00760             if (dest->adjust (ACE_CDR::LONG_SIZE * bounds,
00761                               ACE_CDR::LONG_ALIGN, buf) == 0)
00762               {
00763                 if (src->read_long_array ((ACE_CDR::Long*)buf, bounds) == 0)
00764                   retval = CORBA::TypeCode::TRAVERSE_STOP;
00765               }
00766           }
00767           break;
00768         case CORBA::tk_ulong:
00769           {
00770             char* buf;
00771             if (dest->adjust (ACE_CDR::LONG_SIZE * bounds,
00772                               ACE_CDR::LONG_ALIGN, buf) == 0)
00773               {
00774                 if (src->read_ulong_array ((ACE_CDR::ULong*)buf, bounds) == 0)
00775                   retval = CORBA::TypeCode::TRAVERSE_STOP;
00776               }
00777           }
00778           break;
00779         case CORBA::tk_float:
00780           {
00781             char* buf;
00782             if (dest->adjust (ACE_CDR::LONG_SIZE * bounds,
00783                               ACE_CDR::LONG_ALIGN, buf) == 0)
00784               {
00785                 if (src->read_float_array ((ACE_CDR::Float*)buf, bounds) == 0)
00786                   retval = CORBA::TypeCode::TRAVERSE_STOP;
00787               }
00788           }
00789           break;
00790         case CORBA::tk_double:
00791           {
00792             char* buf;
00793             if (dest->adjust (ACE_CDR::LONGLONG_SIZE * bounds,
00794                               ACE_CDR::LONGLONG_ALIGN, buf) == 0)
00795               {
00796                 if (src->read_double_array ((ACE_CDR::Double*)buf, bounds) == 0)
00797                   retval = CORBA::TypeCode::TRAVERSE_STOP;
00798               }
00799           }
00800           break;
00801         case CORBA::tk_longlong:
00802           {
00803             char* buf;
00804             if (dest->adjust (ACE_CDR::LONGLONG_SIZE * bounds,
00805                               ACE_CDR::LONGLONG_ALIGN, buf) == 0)
00806               {
00807                 if (src->read_longlong_array ((ACE_CDR::LongLong*)buf, bounds) == 0)
00808                   retval = CORBA::TypeCode::TRAVERSE_STOP;
00809               }
00810           }
00811           break;
00812         case CORBA::tk_ulonglong:
00813           {
00814             char* buf;
00815             if (dest->adjust (ACE_CDR::LONGLONG_SIZE * bounds,
00816                               ACE_CDR::LONGLONG_ALIGN, buf) == 0)
00817               {
00818                 if (src->read_ulonglong_array ((ACE_CDR::ULongLong*)buf, bounds) == 0)
00819                   retval = CORBA::TypeCode::TRAVERSE_STOP;
00820               }
00821           }
00822           break;
00823         case CORBA::tk_longdouble:
00824           {
00825             char* buf;
00826             if (dest->adjust (ACE_CDR::LONGDOUBLE_SIZE * bounds,
00827                               ACE_CDR::LONGDOUBLE_ALIGN, buf) == 0)
00828               {
00829                 if (src->read_longdouble_array ((ACE_CDR::LongDouble*)buf, bounds) == 0)
00830                   retval = CORBA::TypeCode::TRAVERSE_STOP;
00831               }
00832           }
00833           break;
00834 
00835         default:
00836           while (bounds-- && retval == CORBA::TypeCode::TRAVERSE_CONTINUE)
00837             {
00838               retval = TAO_Marshal_Object::perform_append (tc2.in (),
00839                                                            src,
00840                                                            dest
00841                                                             ACE_ENV_ARG_PARAMETER);
00842               ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00843             }
00844           break;
00845         }// end of switch
00846 
00847       if (retval == CORBA::TypeCode::TRAVERSE_CONTINUE)
00848         return CORBA::TypeCode::TRAVERSE_CONTINUE;
00849     }
00850   // error exit
00851   if (TAO_debug_level > 0)
00852     ACE_DEBUG ((
00853         LM_DEBUG,
00854         ACE_TEXT ("marshaling TAO_Marshal_Sequence::append detected error\n")
00855       ));
00856 
00857   ACE_THROW_RETURN (CORBA::MARSHAL (),
00858                     CORBA::TypeCode::TRAVERSE_STOP);
00859 }
00860 
00861 CORBA::TypeCode::traverse_status
00862 TAO_Marshal_Array::append (CORBA::TypeCode_ptr  tc,
00863                            TAO_InputCDR *src,
00864                            TAO_OutputCDR *dest
00865                            ACE_ENV_ARG_DECL)
00866 {
00867   // retrieve the bounds of the array
00868   CORBA::ULong bounds = tc->length (ACE_ENV_SINGLE_ARG_PARAMETER);
00869   ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00870 
00871   // get element typecode
00872   CORBA::TypeCode_var tc2 = tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
00873   ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00874 
00875   // For CORBA basic types, the copy can be optimized
00876   CORBA::TCKind kind = tc2->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
00877   ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
00878 
00879   // Return status.
00880   CORBA::TypeCode::traverse_status retval =
00881     CORBA::TypeCode::TRAVERSE_CONTINUE;
00882 
00883   switch (kind)
00884     {
00885     case CORBA::tk_octet:
00886       {
00887         char* buf;
00888         if (dest->adjust (ACE_CDR::OCTET_SIZE * bounds,
00889                           ACE_CDR::OCTET_ALIGN, buf) == 0)
00890           {
00891             if (src->read_octet_array ((ACE_CDR::Octet*)buf, bounds) == 0)
00892               retval = CORBA::TypeCode::TRAVERSE_STOP;
00893           }
00894       }
00895       break;
00896     case CORBA::tk_boolean:
00897       {
00898         char* buf;
00899         if (dest->adjust (ACE_CDR::OCTET_SIZE * bounds,
00900                           ACE_CDR::OCTET_ALIGN, buf) == 0)
00901           {
00902             if (src->read_boolean_array ((ACE_CDR::Boolean*)buf, bounds) == 0)
00903               retval = CORBA::TypeCode::TRAVERSE_STOP;
00904           }
00905       }
00906       break;
00907     case CORBA::tk_char:
00908       {
00909         char* buf;
00910         if (dest->adjust (ACE_CDR::OCTET_SIZE * bounds,
00911                           ACE_CDR::OCTET_ALIGN, buf) == 0)
00912           {
00913             if (src->read_char_array ((ACE_CDR::Char*)buf, bounds) == 0)
00914               retval = CORBA::TypeCode::TRAVERSE_STOP;
00915           }
00916       }
00917       break;
00918     case CORBA::tk_short:
00919       {
00920         char* buf;
00921         if (dest->adjust (ACE_CDR::SHORT_SIZE * bounds,
00922                           ACE_CDR::SHORT_ALIGN, buf) == 0)
00923           {
00924             if (src->read_short_array ((ACE_CDR::Short*)buf, bounds) == 0)
00925               retval = CORBA::TypeCode::TRAVERSE_STOP;
00926           }
00927       }
00928       break;
00929     case CORBA::tk_ushort:
00930       {
00931         char* buf;
00932         if (dest->adjust (ACE_CDR::SHORT_SIZE * bounds,
00933                           ACE_CDR::SHORT_ALIGN, buf) == 0)
00934           {
00935             if (src->read_ushort_array ((ACE_CDR::UShort*)buf, bounds) == 0)
00936               retval = CORBA::TypeCode::TRAVERSE_STOP;
00937           }
00938       }
00939       break;
00940     case CORBA::tk_wchar:
00941       {
00942         char* buf;
00943         if (dest->adjust (ACE_CDR::SHORT_SIZE * bounds,
00944                           ACE_CDR::SHORT_ALIGN, buf) == 0)
00945           {
00946             if (src->read_wchar_array ((ACE_CDR::WChar*)buf, bounds) == 0)
00947               retval = CORBA::TypeCode::TRAVERSE_STOP;
00948           }
00949       }
00950       break;
00951     case CORBA::tk_long:
00952       {
00953         char* buf;
00954         if (dest->adjust (ACE_CDR::LONG_SIZE * bounds,
00955                           ACE_CDR::LONG_ALIGN, buf) == 0)
00956           {
00957             if (src->read_long_array ((ACE_CDR::Long*)buf, bounds) == 0)
00958               retval = CORBA::TypeCode::TRAVERSE_STOP;
00959           }
00960       }
00961       break;
00962     case CORBA::tk_ulong:
00963       {
00964         char* buf;
00965         if (dest->adjust (ACE_CDR::LONG_SIZE * bounds,
00966                           ACE_CDR::LONG_ALIGN, buf) == 0)
00967           {
00968             if (src->read_ulong_array ((ACE_CDR::ULong*)buf, bounds) == 0)
00969               retval = CORBA::TypeCode::TRAVERSE_STOP;
00970           }
00971       }
00972       break;
00973     case CORBA::tk_float:
00974       {
00975         char* buf;
00976         if (dest->adjust (ACE_CDR::LONG_SIZE * bounds,
00977                           ACE_CDR::LONG_ALIGN, buf) == 0)
00978           {
00979             if (src->read_float_array ((ACE_CDR::Float*)buf, bounds) == 0)
00980               retval = CORBA::TypeCode::TRAVERSE_STOP;
00981           }
00982       }
00983       break;
00984     case CORBA::tk_double:
00985       {
00986         char* buf;
00987         if (dest->adjust (ACE_CDR::LONGLONG_SIZE * bounds,
00988                           ACE_CDR::LONGLONG_ALIGN, buf) == 0)
00989           {
00990             if (src->read_double_array ((ACE_CDR::Double*)buf, bounds) == 0)
00991               retval = CORBA::TypeCode::TRAVERSE_STOP;
00992           }
00993       }
00994       break;
00995     case CORBA::tk_longlong:
00996       {
00997         char* buf;
00998         if (dest->adjust (ACE_CDR::LONGLONG_SIZE * bounds,
00999                           ACE_CDR::LONGLONG_ALIGN, buf) == 0)
01000           {
01001             if (src->read_longlong_array ((ACE_CDR::LongLong*)buf, bounds) == 0)
01002               retval = CORBA::TypeCode::TRAVERSE_STOP;
01003           }
01004       }
01005       break;
01006     case CORBA::tk_ulonglong:
01007       {
01008         char* buf;
01009         if (dest->adjust (ACE_CDR::LONGLONG_SIZE * bounds,
01010                           ACE_CDR::LONGLONG_ALIGN, buf) == 0)
01011           {
01012             if (src->read_ulonglong_array ((ACE_CDR::ULongLong*)buf, bounds) == 0)
01013               retval = CORBA::TypeCode::TRAVERSE_STOP;
01014           }
01015       }
01016       break;
01017     case CORBA::tk_longdouble:
01018       {
01019         char* buf;
01020         if (dest->adjust (ACE_CDR::LONGDOUBLE_SIZE * bounds,
01021                           ACE_CDR::LONGDOUBLE_ALIGN, buf) == 0)
01022           {
01023             if (src->read_longdouble_array ((ACE_CDR::LongDouble*)buf, bounds) == 0)
01024               retval = CORBA::TypeCode::TRAVERSE_STOP;
01025           }
01026       }
01027       break;
01028     default:
01029       while (bounds-- && retval == CORBA::TypeCode::TRAVERSE_CONTINUE)
01030         {
01031           retval = TAO_Marshal_Object::perform_append (tc2.in (),
01032                                                        src,
01033                                                        dest
01034                                                         ACE_ENV_ARG_PARAMETER);
01035           ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
01036         }
01037       break;
01038     }// end of switch
01039 
01040   if (retval == CORBA::TypeCode::TRAVERSE_CONTINUE)
01041     return retval;
01042 
01043   // error exit
01044   if (TAO_debug_level > 0)
01045     ACE_DEBUG ((LM_DEBUG,
01046                 ACE_TEXT ("TAO_Marshal_Sequence::append detected error")));
01047 
01048   ACE_THROW_RETURN (CORBA::MARSHAL (),
01049                     CORBA::TypeCode::TRAVERSE_STOP);
01050 }
01051 
01052 CORBA::TypeCode::traverse_status
01053 TAO_Marshal_Alias::append (CORBA::TypeCode_ptr  tc,
01054                            TAO_InputCDR *src,
01055                            TAO_OutputCDR *dest
01056                            ACE_ENV_ARG_DECL)
01057 {
01058   // Typecode of the aliased type.
01059   CORBA::TypeCode_var tc2;
01060   CORBA::Boolean continue_append = 1;
01061 
01062   // Status of decode operation.
01063   CORBA::TypeCode::traverse_status retval =
01064     CORBA::TypeCode::TRAVERSE_CONTINUE;
01065 
01066   tc2 = tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
01067   ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
01068 
01069   retval = TAO_Marshal_Object::perform_append (tc2.in (),
01070                                                src,
01071                                                dest
01072                                                 ACE_ENV_ARG_PARAMETER);
01073   ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
01074 
01075   if (retval == CORBA::TypeCode::TRAVERSE_CONTINUE
01076       && continue_append == 1)
01077     return CORBA::TypeCode::TRAVERSE_CONTINUE;
01078 
01079   if (TAO_debug_level > 0)
01080     ACE_DEBUG ((LM_DEBUG,
01081                 ACE_TEXT ("TAO_Marshal_Alias::append detected error\n")));
01082   ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
01083                                     CORBA::COMPLETED_MAYBE),
01084                     CORBA::TypeCode::TRAVERSE_STOP);
01085 }
01086 
01087 // Decode exception For exceptions, the "hidden" type ID near the
01088 // front of the on-wire representation was previously unmarshaled and
01089 // mapped to the "tc" typcode we're using to traverse the memory ...
01090 // at the same time its vtable, refcount, and other state was
01091 // established.
01092 //
01093 // NOTE: This is asymmetric with respect to encoding exceptions.
01094 CORBA::TypeCode::traverse_status
01095 TAO_Marshal_Except::append (CORBA::TypeCode_ptr  tc,
01096                             TAO_InputCDR *src,
01097                             TAO_OutputCDR *dest
01098                             ACE_ENV_ARG_DECL)
01099 {
01100   CORBA::TypeCode::traverse_status retval =
01101     CORBA::TypeCode::TRAVERSE_CONTINUE;
01102   CORBA::Boolean continue_append = 1;
01103   CORBA::TypeCode_var param;
01104 
01105   // first append the RepositoryID
01106   continue_append = dest->append_string (*src);
01107 
01108   // Number of fields in the struct.
01109   int member_count = tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER);
01110   ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
01111 
01112   for (int i = 0; i < member_count
01113          && retval == CORBA::TypeCode::TRAVERSE_CONTINUE
01114          && continue_append == 1; i++)
01115     {
01116       param = tc->member_type (i ACE_ENV_ARG_PARAMETER);
01117       ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
01118 
01119       retval = TAO_Marshal_Object::perform_append (param.in (),
01120                                                    src,
01121                                                    dest
01122                                                     ACE_ENV_ARG_PARAMETER);
01123     }
01124 
01125   if (retval == CORBA::TypeCode::TRAVERSE_CONTINUE
01126       && continue_append == 1)
01127     return CORBA::TypeCode::TRAVERSE_CONTINUE;
01128 
01129   if (TAO_debug_level > 0)
01130     ACE_DEBUG ((LM_DEBUG,
01131                 ACE_TEXT ("TAO_Marshal_Except::append detected error\n")));
01132   ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
01133                                     CORBA::COMPLETED_MAYBE),
01134                     CORBA::TypeCode::TRAVERSE_STOP);
01135 }
01136 
01137 CORBA::TypeCode::traverse_status
01138 TAO_Marshal_WString::append (CORBA::TypeCode_ptr,
01139                              TAO_InputCDR *src,
01140                              TAO_OutputCDR *dest
01141                              ACE_ENV_ARG_DECL)
01142 {
01143   CORBA::Boolean continue_append = 1;
01144 
01145   // On decode, omit the check against specified wstring bounds, and
01146   // cope with illegal "zero length" strings (all lengths on the wire
01147   // must include a NUL).
01148   //
01149   // This is on the principle of being gracious in what we accept; we
01150   // don't generate messages that fail to comply with protocol specs,
01151   // but we will accept them when it's clear how to do so.
01152 
01153   continue_append = dest->append_wstring (*src);
01154 
01155   if (continue_append == 1)
01156     return CORBA::TypeCode::TRAVERSE_CONTINUE;
01157 
01158   if (TAO_debug_level > 0)
01159     ACE_DEBUG ((LM_DEBUG,
01160                 ACE_TEXT ("TAO_Marshal_WString::append detected error\n")));
01161   ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
01162                                     CORBA::COMPLETED_MAYBE),
01163                     CORBA::TypeCode::TRAVERSE_STOP);
01164 }
01165 
01166 CORBA::TypeCode::traverse_status
01167 TAO_Marshal_Value::append (CORBA::TypeCode_ptr  tc,
01168                            TAO_InputCDR *src,
01169                            TAO_OutputCDR *dest
01170                            ACE_ENV_ARG_DECL)
01171 {
01172   CORBA::TypeCode::traverse_status retval =
01173     CORBA::TypeCode::TRAVERSE_CONTINUE;
01174   CORBA::TypeCode_var param;
01175 
01176   // Use the same method to append our base valuetype.
01177   // To achive this we'll need to distinguish between
01178   // first-time/nested appends so that we won't attempt to
01179   // append rep_id several times.
01180   //
01181   if (nested_processing_ == 0)
01182     {
01183       nested_processing_ = 1;
01184 
01185       CORBA::ULong value_tag;
01186 
01187       if (!src->read_ulong (value_tag) ||
01188           !dest->write_ulong (value_tag))
01189         {
01190           return CORBA::TypeCode::TRAVERSE_STOP;
01191         }
01192 
01193       if (value_tag == 0) // Null value type pointer.
01194         {
01195           //We are done.
01196           return retval;
01197         }
01198       else if (value_tag & TAO_OBV_GIOP_Flags::Type_info_single)
01199         {
01200           // Append repository id which is of type string.
01201           dest->append_string (*src);
01202         }
01203       else
01204         {
01205           //@@ boris: VT CDR
01206           return CORBA::TypeCode::TRAVERSE_STOP;
01207         }
01208     }
01209 
01210   // Handle our base valuetype if any.
01211   param = tc->concrete_base_type (ACE_ENV_SINGLE_ARG_PARAMETER);
01212   ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
01213   if (param->kind () != CORBA::tk_null)
01214     {
01215       retval = this->append (param.in (),
01216                              src,
01217                              dest
01218                              ACE_ENV_ARG_PARAMETER);
01219       ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
01220 
01221       if (retval != CORBA::TypeCode::TRAVERSE_CONTINUE)
01222         {
01223           return retval;
01224         }
01225     }
01226 
01227   // Number of fields in the struct.
01228   int member_count = tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER);
01229   ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
01230 
01231   for (int i = 0;
01232        i < member_count && retval == CORBA::TypeCode::TRAVERSE_CONTINUE;
01233        i++)
01234     {
01235       // get member type
01236       param = tc->member_type (i ACE_ENV_ARG_PARAMETER);
01237       ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
01238 
01239       retval =
01240         TAO_Marshal_Object::perform_append (param.in (),
01241                                             src,
01242                                             dest
01243                                              ACE_ENV_ARG_PARAMETER);
01244       ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP);
01245     }
01246 
01247   if (retval == CORBA::TypeCode::TRAVERSE_CONTINUE)
01248     return CORBA::TypeCode::TRAVERSE_CONTINUE;
01249 
01250   if (TAO_debug_level > 0)
01251     ACE_DEBUG ((LM_DEBUG,
01252                 ACE_TEXT ("TAO_Marshal_Value::append detected error\n")));
01253 
01254   ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
01255                                     CORBA::COMPLETED_MAYBE),
01256                     CORBA::TypeCode::TRAVERSE_STOP);
01257 }

Generated on Mon Jun 16 13:48:01 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002