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 Member Functions

 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)
 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)
 TAO_OutputCDR (char *data, size_t size, int byte_order, ACE_Allocator *buffer_allocator, ACE_Allocator *data_block_allocator, ACE_Allocator *message_block_allocator, size_t memcpy_tradeoff, TAO_GIOP_Fragmentation_Strategy *fs, ACE_CDR::Octet major_version, ACE_CDR::Octet minor_version)
 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)
 TAO_OutputCDR (ACE_Data_Block *data, int byte_order=ACE_CDR_BYTE_ORDER, ACE_Allocator *message_block_allocator=0, size_t memcpy_tradeoff=0, TAO_GIOP_Fragmentation_Strategy *fs=0, ACE_CDR::Octet major_version=TAO_DEF_GIOP_MAJOR, ACE_CDR::Octet minor_version=TAO_DEF_GIOP_MINOR)
 ~TAO_OutputCDR (void)
 Destructor.
void get_version (TAO_GIOP_Message_Version &giop_version)
Outgoing GIOP Fragment Related Methods
These methods are only used when fragmenting outgoing GIOP requests and replies.

bool fragment_stream (ACE_CDR::ULong pending_alignment, ACE_CDR::ULong pending_length)
 Fragment this output CDR stream if necessary.
bool more_fragments (void) const
 Are there more data fragments to come?
void more_fragments (bool more)
 Specify whether there are more data fragments to come.
void message_attributes (CORBA::ULong request_id, TAO_Stub *stub, TAO_Message_Semantics message_semantics, ACE_Time_Value *timeout)
 Set fragmented message attributes.
CORBA::ULong request_id (void) const
 Fragmented message request ID.
TAO_Stubstub (void) const
 Stub object associated with the request.
TAO_Message_Semantics message_semantics (void) const
 Message semantics (twoway, oneway, reply).
ACE_Time_Valuetimeout (void) const
 Maximum time to wait for outgoing message to be sent.

Static Public Member Functions

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

Private Member Functions

 TAO_OutputCDR (const TAO_OutputCDR &rhs)
TAO_OutputCDRoperator= (const TAO_OutputCDR &rhs)

Private Attributes

Outgoing GIOP Fragment Related Attributes
These attributes are only used when fragmenting outgoing GIOP requests and replies.

TAO_GIOP_Fragmentation_Strategy
*const 
fragmentation_strategy_
bool more_fragments_
 Are there more data fragments to come?
CORBA::ULong request_id_
 Request ID for the request currently being marshaled.
TAO_Stubstub_
 Stub object associated with the request.
TAO_Message_Semantics message_semantics_
 Twoway, oneway, reply?
ACE_Time_Valuetimeout_
 Request/reply send timeout.

Friends

class TAO_InputCDR
 For reading from a output CDR stream.


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.


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.

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.

TAO_OutputCDR::TAO_OutputCDR ( char *  data,
size_t  size,
int  byte_order,
ACE_Allocator buffer_allocator,
ACE_Allocator data_block_allocator,
ACE_Allocator message_block_allocator,
size_t  memcpy_tradeoff,
TAO_GIOP_Fragmentation_Strategy fs,
ACE_CDR::Octet  major_version,
ACE_CDR::Octet  minor_version 
)

Build a CDR stream with an initial buffer, it will *not* remove data since it did not allocated it, and enable fragmentation support.

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.

TAO_OutputCDR::TAO_OutputCDR ( ACE_Data_Block data,
int  byte_order = ACE_CDR_BYTE_ORDER,
ACE_Allocator message_block_allocator = 0,
size_t  memcpy_tradeoff = 0,
TAO_GIOP_Fragmentation_Strategy fs = 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 data block, it will *not* remove data, since it did not allocated it.

TAO_OutputCDR::~TAO_OutputCDR ( void   )  [inline]

Destructor.

TAO_OutputCDR::TAO_OutputCDR ( const TAO_OutputCDR rhs  )  [private]


Member Function Documentation

bool TAO_OutputCDR::fragment_stream ( ACE_CDR::ULong  pending_alignment,
ACE_CDR::ULong  pending_length 
)

Fragment this output CDR stream if necessary.

Fragmentation will done through GIOP fragments when the length of the CDR stream length will exceed the configured threshold.

void TAO_OutputCDR::get_version ( TAO_GIOP_Message_Version giop_version  )  [inline]

void TAO_OutputCDR::message_attributes ( CORBA::ULong  request_id,
TAO_Stub stub,
TAO_Message_Semantics  message_semantics,
ACE_Time_Value timeout 
) [inline]

Set fragmented message attributes.

TAO_Message_Semantics TAO_OutputCDR::message_semantics ( void   )  const [inline]

Message semantics (twoway, oneway, reply).

void TAO_OutputCDR::more_fragments ( bool  more  )  [inline]

Specify whether there are more data fragments to come.

bool TAO_OutputCDR::more_fragments ( void   )  const [inline]

Are there more data fragments to come?

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

CORBA::ULong TAO_OutputCDR::request_id ( void   )  const [inline]

Fragmented message request ID.

TAO_Stub * TAO_OutputCDR::stub ( void   )  const [inline]

Stub object associated with the request.

void TAO_OutputCDR::throw_skel_exception ( int  error_num  )  [static]

void TAO_OutputCDR::throw_stub_exception ( int  error_num  )  [static]

ACE_Time_Value * TAO_OutputCDR::timeout ( void   )  const [inline]

Maximum time to wait for outgoing message to be sent.


Friends And Related Function Documentation

friend class TAO_InputCDR [friend]

For reading from a output CDR stream.


Member Data Documentation

Strategy that sends data currently marshaled into this TAO_OutputCDR stream if necessary.

Twoway, oneway, reply?

See also:
TAO_Transport

Are there more data fragments to come?

Request ID for the request currently being marshaled.

Stub object associated with the request.

Request/reply send timeout.


The documentation for this class was generated from the following files:

Generated on Mon Jul 13 16:26:37 2009 for TAO by  doxygen 1.5.8