TAO_Marshal_Primitive Class Reference

TAO_Marshal_Primitive. More...

#include <Marshal.h>

Inheritance diagram for TAO_Marshal_Primitive:

Inheritance graph
[legend]
Collaboration diagram for TAO_Marshal_Primitive:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_Marshal_Primitive (void)
virtual TAO::traverse_status skip (CORBA::TypeCode_ptr tc, TAO_InputCDR *context)
 skip operation

virtual TAO::traverse_status append (CORBA::TypeCode_ptr tc, TAO_InputCDR *src, TAO_OutputCDR *dest)
 append operation


Detailed Description

TAO_Marshal_Primitive.

marshaling primitives

Definition at line 114 of file Marshal.h.


Constructor & Destructor Documentation

ACE_INLINE TAO_Marshal_Primitive::TAO_Marshal_Primitive void   ) 
 

Definition at line 13 of file Marshal.inl.

00014 {
00015 }


Member Function Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO::traverse_status TAO_Marshal_Primitive::append CORBA::TypeCode_ptr  tc,
TAO_InputCDR src,
TAO_OutputCDR dest
[virtual]
 

append operation

Implements TAO_Marshal_Object.

Definition at line 45 of file append.cpp.

References ACE_DEBUG, ACE_TEXT, ACE_OutputCDR::append_boolean(), ACE_OutputCDR::append_double(), ACE_OutputCDR::append_long(), ACE_OutputCDR::append_longdouble(), ACE_OutputCDR::append_octet(), ACE_OutputCDR::append_short(), ACE_OutputCDR::append_wchar(), LM_DEBUG, and TAO_debug_level.

00048 {
00049   CORBA::Boolean continue_append = true;
00050   TAO::traverse_status retval =
00051     TAO::TRAVERSE_CONTINUE; // status of encode operation
00052 
00053   CORBA::TCKind const k = tc->kind ();
00054 
00055   switch (k)
00056     {
00057     case CORBA::tk_null:
00058     case CORBA::tk_void:
00059       break;
00060     case CORBA::tk_short:
00061     case CORBA::tk_ushort:
00062       continue_append = dest->append_short (*src);
00063       break;
00064     case CORBA::tk_long:
00065     case CORBA::tk_ulong:
00066     case CORBA::tk_float:
00067     case CORBA::tk_enum:
00068       continue_append = dest->append_long (*src);
00069       break;
00070     case CORBA::tk_double:
00071     case CORBA::tk_longlong:
00072     case CORBA::tk_ulonglong:
00073       continue_append = dest->append_double (*src);
00074       break;
00075     case CORBA::tk_boolean:
00076       continue_append = dest->append_boolean (*src);
00077       break;
00078     case CORBA::tk_char:
00079     case CORBA::tk_octet:
00080       continue_append = dest->append_octet (*src);
00081       break;
00082     case CORBA::tk_longdouble:
00083       continue_append = dest->append_longdouble (*src);
00084       break;
00085     case CORBA::tk_wchar:
00086       continue_append = dest->append_wchar (*src);
00087       break;
00088     default:
00089       retval = TAO::TRAVERSE_STOP;
00090       // we are not a primitive type
00091     }
00092 
00093   if (retval == TAO::TRAVERSE_CONTINUE
00094       && continue_append == 1)
00095     return TAO::TRAVERSE_CONTINUE;
00096 
00097   if (TAO_debug_level > 0)
00098     ACE_DEBUG ((
00099         LM_DEBUG,
00100         ACE_TEXT ("TAO_Marshal_Primitive::append detected error\n")
00101       ));
00102 
00103   throw ::CORBA::MARSHAL (0, CORBA::COMPLETED_MAYBE);
00104 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO::traverse_status TAO_Marshal_Primitive::skip CORBA::TypeCode_ptr  tc,
TAO_InputCDR context
[virtual]
 

skip operation

Implements TAO_Marshal_Object.

Definition at line 39 of file skip.cpp.

References ACE_DEBUG, ACE_TEXT, LM_DEBUG, ACE_InputCDR::skip_boolean(), ACE_InputCDR::skip_char(), ACE_InputCDR::skip_long(), ACE_InputCDR::skip_longdouble(), ACE_InputCDR::skip_longlong(), ACE_InputCDR::skip_short(), ACE_InputCDR::skip_wchar(), and TAO_debug_level.

00040 {
00041   CORBA::Boolean continue_skipping = true;
00042 
00043   // Status of skip operation.
00044   TAO::traverse_status retval = TAO::TRAVERSE_CONTINUE;
00045 
00046   CORBA::TCKind const k = tc->kind ();
00047 
00048   switch (k)
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_skipping = stream->skip_short ();
00056       break;
00057     case CORBA::tk_long:
00058     case CORBA::tk_ulong:
00059     case CORBA::tk_float:
00060     case CORBA::tk_enum:
00061       continue_skipping = stream->skip_long ();
00062       break;
00063     case CORBA::tk_double:
00064     case CORBA::tk_longlong:
00065     case CORBA::tk_ulonglong:
00066       continue_skipping = stream->skip_longlong ();
00067       break;
00068     case CORBA::tk_boolean:
00069       continue_skipping = stream->skip_boolean ();
00070       break;
00071     case CORBA::tk_char:
00072     case CORBA::tk_octet:
00073       continue_skipping = stream->skip_char ();
00074       break;
00075     case CORBA::tk_longdouble:
00076       continue_skipping = stream->skip_longdouble ();
00077       break;
00078     case CORBA::tk_wchar:
00079       continue_skipping = stream->skip_wchar ();
00080       break;
00081     default:
00082       retval = TAO::TRAVERSE_STOP;
00083       // we are not a primitive type
00084     }
00085   if (retval == TAO::TRAVERSE_CONTINUE && continue_skipping)
00086     return TAO::TRAVERSE_CONTINUE;
00087   else
00088     {
00089       if (TAO_debug_level > 0)
00090         ACE_DEBUG ((
00091             LM_DEBUG,
00092             ACE_TEXT ("TAO_Marshal_Primitive::skip detected error\n")
00093           ));
00094       throw ::CORBA::MARSHAL (0, CORBA::COMPLETED_MAYBE);
00095     }
00096 }


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 13:21:56 2008 for TAO_AnyTypeCode by doxygen 1.3.6