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

TAO_Marshal_Value Class Reference

TAO_Marshal_Value. More...

#include <Marshal.h>

Inheritance diagram for TAO_Marshal_Value:

Inheritance graph
[legend]
Collaboration diagram for TAO_Marshal_Value:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_Marshal_Value (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...


Private Attributes

CORBA::Boolean nested_processing_

Detailed Description

TAO_Marshal_Value.

marshal a valuetype

Definition at line 430 of file Marshal.h.


Constructor & Destructor Documentation

ACE_INLINE TAO_Marshal_Value::TAO_Marshal_Value void   
 

Definition at line 74 of file Marshal.i.

00075         : nested_processing_ (0)
00076 {
00077 }


Member Function Documentation

CORBA::TypeCode::traverse_status TAO_Marshal_Value::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 1167 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, LM_DEBUG, nested_processing_, TAO_Marshal_Object::perform_append, ACE_InputCDR::read_ulong, TAO_DEFAULT_MINOR_CODE, and TAO_OBV_GIOP_Flags::Type_info_single.

Referenced by TAO_Marshal_Object::perform_append.

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 }

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

skip operation.

Implements TAO_Marshal_Object.


Member Data Documentation

CORBA::Boolean TAO_Marshal_Value::nested_processing_ [private]
 

Definition at line 447 of file Marshal.h.

Referenced by append.


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