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

TAO_Marshal_Sequence Class Reference

TAO_Marshal_Sequence. More...

#include <Marshal.h>

Inheritance diagram for TAO_Marshal_Sequence:

Inheritance graph
[legend]
Collaboration diagram for TAO_Marshal_Sequence:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_Marshal_Sequence (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_Sequence.

marshal a sequence

Definition at line 305 of file Marshal.h.


Constructor & Destructor Documentation

ACE_INLINE TAO_Marshal_Sequence::TAO_Marshal_Sequence void   
 

Definition at line 49 of file Marshal.i.

00050 {
00051 }


Member Function Documentation

CORBA::TypeCode::traverse_status TAO_Marshal_Sequence::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 644 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, 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.

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 }

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