TAO_InputCDR Class Reference

A CDR stream for reading, i.e. for demarshalling. More...

#include <CDR.h>

Inheritance diagram for TAO_InputCDR:

Inheritance graph
[legend]
Collaboration diagram for TAO_InputCDR:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_InputCDR (const char *buf, size_t bufsiz, int byte_order=ACE_CDR_BYTE_ORDER, ACE_CDR::Octet major_version=TAO_DEF_GIOP_MAJOR, ACE_CDR::Octet minor_version=TAO_DEF_GIOP_MINOR, TAO_ORB_Core *orb_core=0)
 TAO_InputCDR (size_t bufsiz, int byte_order=ACE_CDR_BYTE_ORDER, ACE_CDR::Octet major_version=TAO_DEF_GIOP_MAJOR, ACE_CDR::Octet minor_version=TAO_DEF_GIOP_MINOR, TAO_ORB_Core *orb_core=0)
 TAO_InputCDR (const ACE_Message_Block *data, int byte_order=ACE_CDR_BYTE_ORDER, ACE_CDR::Octet major_version=TAO_DEF_GIOP_MAJOR, ACE_CDR::Octet minor_version=TAO_DEF_GIOP_MINOR, TAO_ORB_Core *orb_core=0)
 Create an input stream from an ACE_Message_Block.

 TAO_InputCDR (const ACE_Message_Block *data, ACE_Lock *lock, int byte_order=ACE_CDR_BYTE_ORDER, ACE_CDR::Octet major_version=TAO_DEF_GIOP_MAJOR, ACE_CDR::Octet minor_version=TAO_DEF_GIOP_MINOR, TAO_ORB_Core *orb_core=0)
 TAO_InputCDR (ACE_Data_Block *data, ACE_Message_Block::Message_Flags flag=0, int byte_order=ACE_CDR_BYTE_ORDER, ACE_CDR::Octet major_version=TAO_DEF_GIOP_MAJOR, ACE_CDR::Octet minor_version=TAO_DEF_GIOP_MINOR, TAO_ORB_Core *orb_core=0)
 Create an input stream from an ACE_Data_Block.

 TAO_InputCDR (ACE_Data_Block *data, ACE_Message_Block::Message_Flags flag, size_t read_pointer_position, size_t write_pointer_position, int byte_order=ACE_CDR_BYTE_ORDER, ACE_CDR::Octet major_version=TAO_DEF_GIOP_MAJOR, ACE_CDR::Octet minor_version=TAO_DEF_GIOP_MINOR, TAO_ORB_Core *orb_core=0)
 Create an input stream from an ACE_Data_Block.

 TAO_InputCDR (const TAO_InputCDR &rhs)
 TAO_InputCDR (const TAO_InputCDR &rhs, size_t size, ACE_CDR::Long offset)
 TAO_InputCDR (const TAO_InputCDR &rhs, size_t size)
 TAO_InputCDR (const TAO_OutputCDR &rhs, ACE_Allocator *buffer_allocator=0, ACE_Allocator *data_block_allocator=0, ACE_Allocator *message_block_allocator=0, TAO_ORB_Core *orb_core=0)
 Create an input CDR from an output CDR.

 TAO_InputCDR (ACE_InputCDR::Transfer_Contents rhs, TAO_ORB_Core *orb_core=0)
 ~TAO_InputCDR (void)
 destructor

TAO_ORB_Coreorb_core (void) const
 Accessor.

ACE_Message_Block::Message_Flags clr_mb_flags (ACE_Message_Block::Message_Flags less_flags)

Static Public Member Functions

void throw_stub_exception (int error_num)
void throw_skel_exception (int error_num)

Private Attributes

TAO_ORB_Coreorb_core_
 The ORB_Core, required to extract object references.


Detailed Description

A CDR stream for reading, i.e. for demarshalling.

This class is based on the the CORBA spec for Java (98-02-29), java class omg.org.CORBA.portable.InputStream. It diverts in a few ways: + Operations to retrieve basic types take parameters by reference. + Operations taking arrays don't have offsets, because in C++ it is easier to describe an array starting from x+offset. + Operations return an error status, because exceptions are not widely available in C++ (yet). A particularly useful static member function for this buffer is an interpretive encoding routine, usable as a typecode interpreter callback. Ditto for decoding. These are used to support all OMG-IDL datatypes, even those not supported directly by put/get primitives.

Definition at line 262 of file CDR.h.


Constructor & Destructor Documentation

ACE_INLINE TAO_InputCDR::TAO_InputCDR const char *  buf,
size_t  bufsiz,
int  byte_order = ACE_CDR_BYTE_ORDER,
ACE_CDR::Octet  major_version = TAO_DEF_GIOP_MAJOR,
ACE_CDR::Octet  minor_version = TAO_DEF_GIOP_MINOR,
TAO_ORB_Core orb_core = 0
 

Create an input stream from an arbitrary buffer, care must be exercised wrt alignment, because this contructor will *not* work if the buffer is unproperly aligned.

Definition at line 69 of file CDR.inl.

References CORBA::Octet.

00075   : ACE_InputCDR (buf,
00076                   bufsiz,
00077                   byte_order,
00078                   major_version,
00079                   minor_version),
00080     orb_core_ (orb_core)
00081 {
00082 }

ACE_INLINE TAO_InputCDR::TAO_InputCDR size_t  bufsiz,
int  byte_order = ACE_CDR_BYTE_ORDER,
ACE_CDR::Octet  major_version = TAO_DEF_GIOP_MAJOR,
ACE_CDR::Octet  minor_version = TAO_DEF_GIOP_MINOR,
TAO_ORB_Core orb_core = 0
 

Create an empty input stream. The caller is responsible for putting the right data and providing the right alignment.

Definition at line 85 of file CDR.inl.

References CORBA::Octet.

00090   : ACE_InputCDR (bufsiz,
00091                   byte_order,
00092                   major_version,
00093                   minor_version),
00094     orb_core_ (orb_core)
00095 {
00096 }

ACE_INLINE TAO_InputCDR::TAO_InputCDR const ACE_Message_Block data,
int  byte_order = ACE_CDR_BYTE_ORDER,
ACE_CDR::Octet  major_version = TAO_DEF_GIOP_MAJOR,
ACE_CDR::Octet  minor_version = TAO_DEF_GIOP_MINOR,
TAO_ORB_Core orb_core = 0
 

Create an input stream from an ACE_Message_Block.

Definition at line 99 of file CDR.inl.

References CORBA::Octet.

00104   : ACE_InputCDR (data,
00105                   byte_order,
00106                   major_version,
00107                   minor_version),
00108     orb_core_ (orb_core)
00109 {
00110 }

ACE_INLINE TAO_InputCDR::TAO_InputCDR const ACE_Message_Block data,
ACE_Lock lock,
int  byte_order = ACE_CDR_BYTE_ORDER,
ACE_CDR::Octet  major_version = TAO_DEF_GIOP_MAJOR,
ACE_CDR::Octet  minor_version = TAO_DEF_GIOP_MINOR,
TAO_ORB_Core orb_core = 0
 

Create an input stream from an ACE_Message_Block with an optional lock used to protect the data.

Definition at line 113 of file CDR.inl.

References CORBA::Octet.

00119   : ACE_InputCDR (data,
00120                   byte_order,
00121                   major_version,
00122                   minor_version,
00123                   lock),
00124     orb_core_ (orb_core)
00125 {
00126 }

ACE_INLINE TAO_InputCDR::TAO_InputCDR ACE_Data_Block data,
ACE_Message_Block::Message_Flags  flag = 0,
int  byte_order = ACE_CDR_BYTE_ORDER,
ACE_CDR::Octet  major_version = TAO_DEF_GIOP_MAJOR,
ACE_CDR::Octet  minor_version = TAO_DEF_GIOP_MINOR,
TAO_ORB_Core orb_core = 0
 

Create an input stream from an ACE_Data_Block.

Definition at line 129 of file CDR.inl.

References CORBA::Octet.

00135   : ACE_InputCDR (data,
00136                   flag,
00137                   byte_order,
00138                   major_version,
00139                   minor_version),
00140     orb_core_ (orb_core)
00141 {
00142 }

ACE_INLINE TAO_InputCDR::TAO_InputCDR ACE_Data_Block data,
ACE_Message_Block::Message_Flags  flag,
size_t  read_pointer_position,
size_t  write_pointer_position,
int  byte_order = ACE_CDR_BYTE_ORDER,
ACE_CDR::Octet  major_version = TAO_DEF_GIOP_MAJOR,
ACE_CDR::Octet  minor_version = TAO_DEF_GIOP_MINOR,
TAO_ORB_Core orb_core = 0
 

Create an input stream from an ACE_Data_Block.

Definition at line 146 of file CDR.inl.

References CORBA::Octet.

00154   : ACE_InputCDR (data,
00155                   flag,
00156                   rd_pos,
00157                   wr_pos,
00158                   byte_order,
00159                   major_version,
00160                   minor_version),
00161     orb_core_ (orb_core)
00162 {
00163 }

ACE_INLINE TAO_InputCDR::TAO_InputCDR const TAO_InputCDR rhs  ) 
 

Make a copy of the current stream state, but does not copy the internal buffer; so the same stream can be read multiple times efficiently.

Definition at line 187 of file CDR.inl.

00188   : ACE_InputCDR (rhs),
00189     orb_core_ (rhs.orb_core_)
00190 {
00191 }

ACE_INLINE TAO_InputCDR::TAO_InputCDR const TAO_InputCDR rhs,
size_t  size,
ACE_CDR::Long  offset
 

When interpreting indirected TypeCodes it is useful to make a "copy" of the stream starting in the new position.

Definition at line 167 of file CDR.inl.

References CORBA::Long.

00170   : ACE_InputCDR (rhs,
00171                   size,
00172                   offset),
00173     orb_core_ (rhs.orb_core_)
00174 {
00175 }

ACE_INLINE TAO_InputCDR::TAO_InputCDR const TAO_InputCDR rhs,
size_t  size
 

This creates an encapsulated stream, the first byte must be (per the spec) the byte order of the encapsulation. The default values for the allocators in this constructor are not 0, but are generated by the ORB. Refer to the constructor body in CDR.cpp for the code that supplies these values to the base class constructor.

Definition at line 178 of file CDR.inl.

00180   : ACE_InputCDR (rhs,
00181                   size),
00182     orb_core_ (rhs.orb_core_)
00183 {
00184 }

TAO_InputCDR::TAO_InputCDR const TAO_OutputCDR rhs,
ACE_Allocator buffer_allocator = 0,
ACE_Allocator data_block_allocator = 0,
ACE_Allocator message_block_allocator = 0,
TAO_ORB_Core orb_core = 0
 

Create an input CDR from an output CDR.

Definition at line 262 of file CDR.cpp.

00267   : ACE_InputCDR (rhs,
00268                   buffer_allocator
00269                   ? buffer_allocator
00270                   : (orb_core ? orb_core->output_cdr_buffer_allocator () : 0),
00271                   data_block_allocator
00272                   ? data_block_allocator
00273                   : (orb_core ? orb_core->output_cdr_dblock_allocator () :
00274                      0),
00275                   message_block_allocator
00276                   ? message_block_allocator
00277                   : (orb_core ?
00278                      orb_core->output_cdr_msgblock_allocator () : 0)),
00279   orb_core_ (orb_core)
00280 {
00281 }

ACE_INLINE TAO_InputCDR::TAO_InputCDR ACE_InputCDR::Transfer_Contents  rhs,
TAO_ORB_Core orb_core = 0
 

Initialize the contents of one CDR from another, without data copying and with minimimum locking overhead.

Definition at line 194 of file CDR.inl.

00196   : ACE_InputCDR (rhs),
00197     orb_core_ (orb_core)
00198 {
00199 }

ACE_INLINE TAO_InputCDR::~TAO_InputCDR void   ) 
 

destructor

Definition at line 202 of file CDR.inl.

00203 {
00204 }


Member Function Documentation

ACE_Message_Block::Message_Flags TAO_InputCDR::clr_mb_flags ACE_Message_Block::Message_Flags  less_flags  ) 
 

Definition at line 334 of file CDR.cpp.

References ACE_Message_Block::clr_self_flags().

Referenced by TAO_Synch_Reply_Dispatcher::dispatch_reply().

00335 {
00336   return start_.clr_self_flags( less_flags );
00337 }

ACE_INLINE TAO_ORB_Core * TAO_InputCDR::orb_core void   )  const
 

Accessor.

Definition at line 207 of file CDR.inl.

Referenced by TAO_Connector_Registry::create_profile(), and operator>>().

00208 {
00209   return this->orb_core_;
00210 }

void TAO_InputCDR::throw_skel_exception int  error_num  )  [static]
 

Definition at line 307 of file CDR.cpp.

00308 {
00309   switch (error_num)
00310     {
00311     case 0 :
00312       break;
00313     case EINVAL : // wchar from a GIOP 1.0
00314       throw ::CORBA::MARSHAL(CORBA::OMGVMCID | 5, CORBA::COMPLETED_NO);
00315       ACE_NOTREACHED(break);
00316 
00317     case EACCES : // wchar but no codeset
00318       throw ::CORBA::BAD_PARAM(CORBA::OMGVMCID | 23, CORBA::COMPLETED_NO);
00319       ACE_NOTREACHED(break);
00320 
00321 #if (ERANGE != EINVAL)
00322     case ERANGE : // untranslatable character
00323       throw ::CORBA::DATA_CONVERSION(CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO);
00324       ACE_NOTREACHED(break);
00325 #endif
00326 
00327     default :
00328       throw ::CORBA::MARSHAL();
00329 
00330     }
00331 }

void TAO_InputCDR::throw_stub_exception int  error_num  )  [static]
 

Definition at line 284 of file CDR.cpp.

00285 {
00286   switch (error_num)
00287     {
00288     case 0 :
00289       break;
00290     case EINVAL : // wchar from a GIOP 1.0
00291       throw ::CORBA::MARSHAL (CORBA::OMGVMCID | 6, CORBA::COMPLETED_YES);
00292       ACE_NOTREACHED(break);
00293 #if (ERANGE != EINVAL)
00294     case ERANGE : // untranslatable character
00295       throw ::CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 1, CORBA::COMPLETED_YES);
00296       ACE_NOTREACHED(break);
00297 #endif
00298     case EACCES : // wchar but no codeset
00299       throw ::CORBA::INV_OBJREF (CORBA::OMGVMCID | 2, CORBA::COMPLETED_YES);
00300       ACE_NOTREACHED(break);
00301     default :
00302       throw ::CORBA::MARSHAL (0, CORBA::COMPLETED_YES);
00303     }
00304 }


Member Data Documentation

TAO_ORB_Core* TAO_InputCDR::orb_core_ [private]
 

The ORB_Core, required to extract object references.

Definition at line 372 of file CDR.h.

Referenced by TAO_GIOP_Message_Base::process_locate_request().


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 13:15:00 2008 for TAO by doxygen 1.3.6