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

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 Methods

 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)
 Create an empty input stream. The caller is responsible for putting the right data and providing the right alignment. More...

 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. More...

 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. More...

 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. More...

 TAO_InputCDR (const TAO_InputCDR &rhs)
 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. More...

 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. More...

 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. More...

 ~TAO_InputCDR (void)
 destructor. More...

TAO_ORB_Coreorb_core (void) const
 Accessor. More...


Static Public Methods

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

Private Attributes

TAO_ORB_Coreorb_core_
 The ORB_Core, required to extract object references. More...


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 157 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 10 of file CDR.i.

References ACE_CDR::Octet.

00016   : ACE_InputCDR (buf,
00017                   bufsiz,
00018                   byte_order,
00019                   major_version,
00020                   minor_version),
00021     orb_core_ (orb_core)
00022 {
00023 }

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 26 of file CDR.i.

References ACE_CDR::Octet.

00031   : ACE_InputCDR (bufsiz,
00032                   byte_order,
00033                   major_version,
00034                   minor_version),
00035     orb_core_ (orb_core)
00036 {
00037 }

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 40 of file CDR.i.

References ACE_CDR::Octet.

00045   : ACE_InputCDR (data,
00046                   byte_order,
00047                   major_version,
00048                   minor_version),
00049     orb_core_ (orb_core)
00050 {
00051 }

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 54 of file CDR.i.

References ACE_Message_Block::Message_Flags, and ACE_CDR::Octet.

00060   : ACE_InputCDR (data,
00061                   flag,
00062                   byte_order,
00063                   major_version,
00064                   minor_version),
00065     orb_core_ (orb_core)
00066 {
00067 }

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 71 of file CDR.i.

References ACE_Message_Block::Message_Flags, and ACE_CDR::Octet.

00079   : ACE_InputCDR (data,
00080                   flag,
00081                   rd_pos,
00082                   wr_pos,
00083                   byte_order,
00084                   major_version,
00085                   minor_version),
00086     orb_core_ (orb_core)
00087 {
00088 }

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 112 of file CDR.i.

00113   : ACE_InputCDR (rhs),
00114     orb_core_ (rhs.orb_core_)
00115 {
00116 }

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 92 of file CDR.i.

References ACE_CDR::Long.

00095   : ACE_InputCDR (rhs,
00096                   size,
00097                   offset),
00098     orb_core_ (rhs.orb_core_)
00099 {
00100 }

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 103 of file CDR.i.

00105   : ACE_InputCDR (rhs,
00106                   size),
00107     orb_core_ (rhs.orb_core_)
00108 {
00109 }

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 182 of file CDR.cpp.

00187   : ACE_InputCDR (rhs,
00188                   buffer_allocator
00189                   ? buffer_allocator
00190                   : (orb_core ? orb_core->output_cdr_buffer_allocator () : 0),
00191                   data_block_allocator
00192                   ? data_block_allocator
00193                   : (orb_core ? orb_core->output_cdr_dblock_allocator () :
00194                      0),
00195                   message_block_allocator
00196                   ? message_block_allocator
00197                   : (orb_core ?
00198                      orb_core->output_cdr_msgblock_allocator () : 0)),
00199   orb_core_ (orb_core)
00200 {
00201 }

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 119 of file CDR.i.

00121   : ACE_InputCDR (rhs),
00122     orb_core_ (orb_core)
00123 {
00124 }

ACE_INLINE TAO_InputCDR::~TAO_InputCDR void   
 

destructor.

Definition at line 127 of file CDR.i.

00128 {
00129 }


Member Function Documentation

ACE_INLINE TAO_ORB_Core * TAO_InputCDR::orb_core void    const
 

Accessor.

Definition at line 132 of file CDR.i.

References orb_core_.

Referenced by CORBA_ValueBase::_tao_unmarshal_pre, TAO_Connector_Registry::create_profile, and operator>>.

00133 {
00134   return this->orb_core_;
00135 }

void TAO_InputCDR::throw_skel_exception int error_num    ACE_ENV_ARG_DECL [static]
 

Definition at line 226 of file CDR.cpp.

References ACE_ENV_ARG_DECL, and ACE_THROW.

00227 {
00228   switch (error_num)
00229     {
00230     case 0 :
00231       break;
00232     case EINVAL : // wchar from a GIOP 1.0
00233       ACE_THROW (CORBA::MARSHAL(CORBA::OMGVMCID | 5, CORBA::COMPLETED_NO));
00234       ACE_NOTREACHED(break);
00235 
00236     case EACCES : // wchar but no codeset
00237       ACE_THROW (CORBA::BAD_PARAM(CORBA::OMGVMCID | 23, CORBA::COMPLETED_NO));
00238       ACE_NOTREACHED(break);
00239 
00240     case ERANGE : // untranslatable character
00241       ACE_THROW (CORBA::DATA_CONVERSION(CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO));
00242       ACE_NOTREACHED(break);
00243 
00244     default :
00245       ACE_THROW (CORBA::MARSHAL());
00246 
00247     }
00248 }

void TAO_InputCDR::throw_stub_exception int error_num    ACE_ENV_ARG_DECL [static]
 

Definition at line 205 of file CDR.cpp.

References ACE_ENV_ARG_DECL, ACE_THROW, and TAO_DEFAULT_MINOR_CODE.

00206 {
00207   switch (error_num)
00208     {
00209     case 0 :
00210       break;
00211     case EINVAL : // wchar from a GIOP 1.0
00212       ACE_THROW (CORBA::MARSHAL (CORBA::OMGVMCID | 6, CORBA::COMPLETED_YES));
00213       ACE_NOTREACHED(break);
00214     case ERANGE : // untranslatable character
00215       ACE_THROW (CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 1, CORBA::COMPLETED_YES));
00216       ACE_NOTREACHED(break);
00217     case EACCES : // wchar but no codeset
00218       ACE_THROW (CORBA::INV_OBJREF (CORBA::OMGVMCID | 2, CORBA::COMPLETED_YES));
00219       ACE_NOTREACHED(break);
00220     default :
00221       ACE_THROW (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES));
00222     }
00223 }


Member Data Documentation

TAO_ORB_Core* TAO_InputCDR::orb_core_ [private]
 

The ORB_Core, required to extract object references.

Definition at line 265 of file CDR.h.

Referenced by orb_core.


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