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

TAO_OutputCDR Class Reference

A CDR stream for writing, i.e. for marshalling. More...

#include <CDR.h>

Inheritance diagram for TAO_OutputCDR:

Inheritance graph
[legend]
Collaboration diagram for TAO_OutputCDR:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_OutputCDR (size_t size=0, int byte_order=ACE_CDR_BYTE_ORDER, ACE_Allocator *buffer_allocator=0, ACE_Allocator *data_block_allocator=0, ACE_Allocator *message_block_allocator=0, size_t memcpy_tradeoff=0, ACE_CDR::Octet major_version=TAO_DEF_GIOP_MAJOR, ACE_CDR::Octet minor_version=TAO_DEF_GIOP_MINOR)
 Default constructor, allocates <size> bytes in the internal buffer, if <size> == 0 it allocates the default size. More...

 TAO_OutputCDR (char *data, size_t size, int byte_order=ACE_CDR_BYTE_ORDER, ACE_Allocator *buffer_allocator=0, ACE_Allocator *data_block_allocator=0, ACE_Allocator *message_block_allocator=0, size_t memcpy_tradeoff=0, ACE_CDR::Octet major_version=TAO_DEF_GIOP_MAJOR, ACE_CDR::Octet minor_version=TAO_DEF_GIOP_MINOR)
 Build a CDR stream with an initial buffer, it will *not* remove <data>, since it did not allocated it. More...

 TAO_OutputCDR (ACE_Message_Block *data, int byte_order=ACE_CDR_BYTE_ORDER, size_t memcpy_tradeoff=0, ACE_CDR::Octet major_version=TAO_DEF_GIOP_MAJOR, ACE_CDR::Octet minor_version=TAO_DEF_GIOP_MINOR)
 Build a CDR stream with an initial Message_Block chain, it will *not* remove <data>, since it did not allocate it. More...

 ~TAO_OutputCDR (void)
 Destructor. 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 Methods

 TAO_OutputCDR (const TAO_OutputCDR &rhs)
 disallow copying... More...

TAO_OutputCDR & operator= (const TAO_OutputCDR &rhs)

Friends

class TAO_InputCDR
 For reading from a output CDR stream. More...


Detailed Description

A CDR stream for writing, i.e. for marshalling.

This class is based on the the CORBA spec for Java (98-02-29), java class omg.org.CORBA.portable.OutputStream. It diverts in a few ways: + 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 73 of file CDR.h.


Constructor & Destructor Documentation

TAO_OutputCDR::TAO_OutputCDR size_t    size = 0,
int    byte_order = ACE_CDR_BYTE_ORDER,
ACE_Allocator   buffer_allocator = 0,
ACE_Allocator   data_block_allocator = 0,
ACE_Allocator   message_block_allocator = 0,
size_t    memcpy_tradeoff = 0,
ACE_CDR::Octet    major_version = TAO_DEF_GIOP_MAJOR,
ACE_CDR::Octet    minor_version = TAO_DEF_GIOP_MINOR
 

Default constructor, allocates <size> bytes in the internal buffer, if <size> == 0 it allocates the default size.

Definition at line 75 of file CDR.cpp.

References ACE_FUNCTION_TIMEPROBE, and ACE_CDR::Octet.

00083   :  ACE_OutputCDR (size,
00084                     byte_order,
00085                     buffer_allocator,
00086                     data_block_allocator,
00087                     message_block_allocator,
00088                     memcpy_tradeoff,
00089                     major_version,
00090                     minor_version)
00091 {
00092   ACE_FUNCTION_TIMEPROBE (TAO_OUTPUT_CDR_CTOR1_ENTER);
00093 }

TAO_OutputCDR::TAO_OutputCDR char *    data,
size_t    size,
int    byte_order = ACE_CDR_BYTE_ORDER,
ACE_Allocator   buffer_allocator = 0,
ACE_Allocator   data_block_allocator = 0,
ACE_Allocator   message_block_allocator = 0,
size_t    memcpy_tradeoff = 0,
ACE_CDR::Octet    major_version = TAO_DEF_GIOP_MAJOR,
ACE_CDR::Octet    minor_version = TAO_DEF_GIOP_MINOR
 

Build a CDR stream with an initial buffer, it will *not* remove <data>, since it did not allocated it.

Definition at line 95 of file CDR.cpp.

References ACE_FUNCTION_TIMEPROBE, and ACE_CDR::Octet.

00104   :  ACE_OutputCDR (data,
00105                     size,
00106                     byte_order,
00107                     buffer_allocator,
00108                     data_block_allocator,
00109                     message_block_allocator,
00110                     memcpy_tradeoff,
00111                     major_version,
00112                     minor_version)
00113 {
00114   ACE_FUNCTION_TIMEPROBE (TAO_OUTPUT_CDR_CTOR2_ENTER);
00115 }

TAO_OutputCDR::TAO_OutputCDR ACE_Message_Block   data,
int    byte_order = ACE_CDR_BYTE_ORDER,
size_t    memcpy_tradeoff = 0,
ACE_CDR::Octet    major_version = TAO_DEF_GIOP_MAJOR,
ACE_CDR::Octet    minor_version = TAO_DEF_GIOP_MINOR
 

Build a CDR stream with an initial Message_Block chain, it will *not* remove <data>, since it did not allocate it.

Definition at line 117 of file CDR.cpp.

References ACE_FUNCTION_TIMEPROBE, and ACE_CDR::Octet.

00122   :  ACE_OutputCDR (data,
00123                     byte_order,
00124                     memcpy_tradeoff,
00125                     major_version,
00126                     minor_version)
00127 {
00128   ACE_FUNCTION_TIMEPROBE (TAO_OUTPUT_CDR_CTOR3_ENTER);
00129 }

ACE_INLINE TAO_OutputCDR::~TAO_OutputCDR void   
 

Destructor.

Definition at line 5 of file CDR.i.

00006 {
00007 }

TAO_OutputCDR::TAO_OutputCDR const TAO_OutputCDR &    rhs [private]
 

disallow copying...


Member Function Documentation

TAO_OutputCDR& TAO_OutputCDR::operator= const TAO_OutputCDR &    rhs [private]
 

void TAO_OutputCDR::throw_skel_exception int error_num    ACE_ENV_ARG_DECL [static]
 

Definition at line 154 of file CDR.cpp.

References ACE_ENV_ARG_DECL, ACE_THROW, and TAO_DEFAULT_MINOR_CODE.

00155 {
00156   switch (error_num)
00157     {
00158     case 0 :
00159       break;
00160     case EINVAL : // wchar from a GIOP 1.0
00161       ACE_THROW (CORBA::MARSHAL(CORBA::OMGVMCID | 5, CORBA::COMPLETED_YES));
00162       ACE_NOTREACHED(break);
00163 
00164     case EACCES : // wchar but no codeset
00165       ACE_THROW (CORBA::BAD_PARAM(CORBA::OMGVMCID | 23, CORBA::COMPLETED_YES));
00166       ACE_NOTREACHED(break);
00167 
00168     case ERANGE : // untranslatable character
00169       ACE_THROW (CORBA::DATA_CONVERSION(CORBA::OMGVMCID | 1, CORBA::COMPLETED_YES));
00170       ACE_NOTREACHED(break);
00171 
00172     default :
00173       ACE_THROW (CORBA::MARSHAL(TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES));
00174 
00175     }
00176 }

void TAO_OutputCDR::throw_stub_exception int error_num    ACE_ENV_ARG_DECL [static]
 

Definition at line 133 of file CDR.cpp.

References ACE_ENV_ARG_DECL, and ACE_THROW.

00134 {
00135   switch (error_num)
00136     {
00137     case 0 :
00138       break;
00139     case EINVAL : // wchar from a GIOP 1.0
00140       ACE_THROW (CORBA::MARSHAL (CORBA::OMGVMCID | 5, CORBA::COMPLETED_NO));
00141       ACE_NOTREACHED(break);
00142     case ERANGE : // untranslatable character
00143       ACE_THROW (CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO));
00144       ACE_NOTREACHED(break);
00145     case EACCES : // wchar but no codeset
00146       ACE_THROW(CORBA::INV_OBJREF (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO));
00147       ACE_NOTREACHED(break);
00148     default :
00149       ACE_THROW (CORBA::MARSHAL ());
00150     }
00151 }


Friends And Related Function Documentation

friend class TAO_InputCDR [friend]
 

For reading from a output CDR stream.

Definition at line 77 of file CDR.h.


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