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

References CORBA::Octet.

00069   : ACE_InputCDR (buf,
00070                   bufsiz,
00071                   byte_order,
00072                   major_version,
00073                   minor_version),
00074     orb_core_ (orb_core)
00075 {
00076 }

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

References CORBA::Octet.

00084   : ACE_InputCDR (bufsiz,
00085                   byte_order,
00086                   major_version,
00087                   minor_version),
00088     orb_core_ (orb_core)
00089 {
00090 }

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

References CORBA::Octet.

00098   : ACE_InputCDR (data,
00099                   byte_order,
00100                   major_version,
00101                   minor_version),
00102     orb_core_ (orb_core)
00103 {
00104 }

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

References CORBA::Octet.

00113   : ACE_InputCDR (data,
00114                   byte_order,
00115                   major_version,
00116                   minor_version,
00117                   lock),
00118     orb_core_ (orb_core)
00119 {
00120 }

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

References CORBA::Octet.

00129   : ACE_InputCDR (data,
00130                   flag,
00131                   byte_order,
00132                   major_version,
00133                   minor_version),
00134     orb_core_ (orb_core)
00135 {
00136 }

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

References CORBA::Octet.

00148   : ACE_InputCDR (data,
00149                   flag,
00150                   rd_pos,
00151                   wr_pos,
00152                   byte_order,
00153                   major_version,
00154                   minor_version),
00155     orb_core_ (orb_core)
00156 {
00157 }

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

00182   : ACE_InputCDR (rhs),
00183     orb_core_ (rhs.orb_core_)
00184 {
00185 }

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

References CORBA::Long.

00164   : ACE_InputCDR (rhs,
00165                   size,
00166                   offset),
00167     orb_core_ (rhs.orb_core_)
00168 {
00169 }

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

00174   : ACE_InputCDR (rhs,
00175                   size),
00176     orb_core_ (rhs.orb_core_)
00177 {
00178 }

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

00233   : ACE_InputCDR (rhs,
00234                   buffer_allocator
00235                   ? buffer_allocator
00236                   : (orb_core ? orb_core->output_cdr_buffer_allocator () : 0),
00237                   data_block_allocator
00238                   ? data_block_allocator
00239                   : (orb_core ? orb_core->output_cdr_dblock_allocator () :
00240                      0),
00241                   message_block_allocator
00242                   ? message_block_allocator
00243                   : (orb_core ?
00244                      orb_core->output_cdr_msgblock_allocator () : 0)),
00245   orb_core_ (orb_core)
00246 {
00247 }

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

00190   : ACE_InputCDR (rhs),
00191     orb_core_ (orb_core)
00192 {
00193 }

ACE_INLINE TAO_InputCDR::~TAO_InputCDR void   ) 
 

destructor

Definition at line 196 of file CDR.i.

00197 {
00198 }


Member Function Documentation

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

Definition at line 301 of file CDR.cpp.

References ACE_Message_Block::clr_self_flags().

Referenced by TAO_Synch_Reply_Dispatcher::dispatch_reply().

00302 {
00303   return start_.clr_self_flags( less_flags );
00304 }

ACE_INLINE TAO_ORB_Core * TAO_InputCDR::orb_core void   )  const
 

Accessor.

Definition at line 201 of file CDR.i.

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

00202 {
00203   return this->orb_core_;
00204 }

void TAO_InputCDR::throw_skel_exception int  error_num  )  [static]
 

Definition at line 274 of file CDR.cpp.

References ACE_THROW.

00275 {
00276   switch (error_num)
00277     {
00278     case 0 :
00279       break;
00280     case EINVAL : // wchar from a GIOP 1.0
00281       ACE_THROW (CORBA::MARSHAL(CORBA::OMGVMCID | 5, CORBA::COMPLETED_NO));
00282       ACE_NOTREACHED(break);
00283 
00284     case EACCES : // wchar but no codeset
00285       ACE_THROW (CORBA::BAD_PARAM(CORBA::OMGVMCID | 23, CORBA::COMPLETED_NO));
00286       ACE_NOTREACHED(break);
00287 
00288 #if (ERANGE != EINVAL)
00289     case ERANGE : // untranslatable character
00290       ACE_THROW (CORBA::DATA_CONVERSION(CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO));
00291       ACE_NOTREACHED(break);
00292 #endif
00293 
00294     default :
00295       ACE_THROW (CORBA::MARSHAL());
00296 
00297     }
00298 }

void TAO_InputCDR::throw_stub_exception int  error_num  )  [static]
 

Definition at line 251 of file CDR.cpp.

References ACE_THROW.

00252 {
00253   switch (error_num)
00254     {
00255     case 0 :
00256       break;
00257     case EINVAL : // wchar from a GIOP 1.0
00258       ACE_THROW (CORBA::MARSHAL (CORBA::OMGVMCID | 6, CORBA::COMPLETED_YES));
00259       ACE_NOTREACHED(break);
00260 #if (ERANGE != EINVAL)
00261     case ERANGE : // untranslatable character
00262       ACE_THROW (CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 1, CORBA::COMPLETED_YES));
00263       ACE_NOTREACHED(break);
00264 #endif
00265     case EACCES : // wchar but no codeset
00266       ACE_THROW (CORBA::INV_OBJREF (CORBA::OMGVMCID | 2, CORBA::COMPLETED_YES));
00267       ACE_NOTREACHED(break);
00268     default :
00269       ACE_THROW (CORBA::MARSHAL (0, CORBA::COMPLETED_YES));
00270     }
00271 }


Member Data Documentation

TAO_ORB_Core* TAO_InputCDR::orb_core_ [private]
 

The ORB_Core, required to extract object references.

Definition at line 381 of file CDR.h.

Referenced by TAO_GIOP_Message_Lite::process_locate_request(), and TAO_GIOP_Message_Base::process_locate_request().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:14:58 2006 for TAO by doxygen 1.3.6