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

TAO_Marshal_Array Class Reference

TAO_Marshal_Array. More...

#include <Marshal.h>

Inheritance diagram for TAO_Marshal_Array:

Inheritance graph
[legend]
Collaboration diagram for TAO_Marshal_Array:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_Marshal_Array (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_Array.

marshal an array

Definition at line 330 of file Marshal.h.


Constructor & Destructor Documentation

ACE_INLINE TAO_Marshal_Array::TAO_Marshal_Array void   
 

Definition at line 54 of file Marshal.i.

00055 {
00056 }


Member Function Documentation

CORBA::TypeCode::traverse_status TAO_Marshal_Array::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 862 of file append.cpp.

References ACE_CHECK_RETURN, ACE_DEBUG, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_TEXT, ACE_THROW_RETURN, ACE_CDR::Boolean, ACE_CDR::Char, LM_DEBUG, ACE_CDR::Long, ACE_CDR::LONG_ALIGN, ACE_CDR::LONG_SIZE, ACE_CDR::LONGDOUBLE_ALIGN, ACE_CDR::LONGDOUBLE_SIZE, ACE_CDR::LongLong, ACE_CDR::LONGLONG_ALIGN, ACE_CDR::LONGLONG_SIZE, ACE_CDR::Octet, ACE_CDR::OCTET_ALIGN, ACE_CDR::OCTET_SIZE, TAO_Marshal_Object::perform_append, ACE_InputCDR::read_boolean_array, ACE_InputCDR::read_char_array, ACE_InputCDR::read_double_array, ACE_InputCDR::read_float_array, ACE_InputCDR::read_long_array, ACE_InputCDR::read_longdouble_array, ACE_InputCDR::read_longlong_array, ACE_InputCDR::read_octet_array, ACE_InputCDR::read_short_array, ACE_InputCDR::read_ulong_array, ACE_InputCDR::read_ulonglong_array, ACE_InputCDR::read_ushort_array, ACE_InputCDR::read_wchar_array, ACE_CDR::Short, ACE_CDR::SHORT_ALIGN, ACE_CDR::SHORT_SIZE, ACE_CDR::ULong, ACE_CDR::ULongLong, ACE_CDR::UShort, and ACE_CDR::WChar.

Referenced by TAO_Marshal_Object::perform_append.

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 }

virtual CORBA::TypeCode::traverse_status TAO_Marshal_Array::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:15 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002