ACE 8.0.1
Loading...
Searching...
No Matches
Classes | Public Member Functions | Friends | List of all members
ACE_OutputCDR Class Reference

A CDR stream for marshalling data, most often for transmission to another system which may or may not have the same byte order. More...

#include <CDR_Stream.h>

Collaboration diagram for ACE_OutputCDR:
Collaboration graph
[legend]

Classes

struct  from_boolean
 
struct  from_char
 
struct  from_int8
 
struct  from_octet
 
struct  from_std_string
 
struct  from_std_wstring
 
struct  from_string
 
struct  from_uint8
 
struct  from_wchar
 
struct  from_wstring
 

Public Member Functions

 ACE_OutputCDR (size_t size=0, int byte_order=ACE_CDR::BYTE_ORDER_NATIVE, ACE_Allocator *buffer_allocator=0, ACE_Allocator *data_block_allocator=0, ACE_Allocator *message_block_allocator=0, size_t memcpy_tradeoff=ACE_DEFAULT_CDR_MEMCPY_TRADEOFF, ACE_CDR::Octet major_version=ACE_CDR_GIOP_MAJOR_VERSION, ACE_CDR::Octet minor_version=ACE_CDR_GIOP_MINOR_VERSION)
 
 ACE_OutputCDR (char *data, size_t size, int byte_order=ACE_CDR::BYTE_ORDER_NATIVE, ACE_Allocator *buffer_allocator=0, ACE_Allocator *data_block_allocator=0, ACE_Allocator *message_block_allocator=0, size_t memcpy_tradeoff=ACE_DEFAULT_CDR_MEMCPY_TRADEOFF, ACE_CDR::Octet giop_major_version=ACE_CDR_GIOP_MAJOR_VERSION, ACE_CDR::Octet giop_minor_version=ACE_CDR_GIOP_MINOR_VERSION)
 
 ACE_OutputCDR (ACE_Data_Block *data_block, int byte_order=ACE_CDR::BYTE_ORDER_NATIVE, ACE_Allocator *message_block_allocator=0, size_t memcpy_tradeoff=ACE_DEFAULT_CDR_MEMCPY_TRADEOFF, ACE_CDR::Octet giop_major_version=ACE_CDR_GIOP_MAJOR_VERSION, ACE_CDR::Octet giop_minor_version=ACE_CDR_GIOP_MINOR_VERSION)
 
 ACE_OutputCDR (ACE_Message_Block *data, int byte_order=ACE_CDR::BYTE_ORDER_NATIVE, size_t memcpy_tradeoff=ACE_DEFAULT_CDR_MEMCPY_TRADEOFF, ACE_CDR::Octet giop_major_version=ACE_CDR_GIOP_MAJOR_VERSION, ACE_CDR::Octet giop_minor_version=ACE_CDR_GIOP_MINOR_VERSION)
 
 ~ACE_OutputCDR ()
 destructor
 
Write operations

Return 0 on failure and 1 on success.

ACE_CDR::Boolean write_boolean (ACE_CDR::Boolean x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_char (ACE_CDR::Char x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_wchar (ACE_CDR::WChar x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_octet (ACE_CDR::Octet x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_short (ACE_CDR::Short x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_ushort (ACE_CDR::UShort x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_long (ACE_CDR::Long x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_ulong (ACE_CDR::ULong x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_longlong (const ACE_CDR::LongLong &x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_ulonglong (const ACE_CDR::ULongLong &x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_float (ACE_CDR::Float x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_double (const ACE_CDR::Double &x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_longdouble (const ACE_CDR::LongDouble &x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_fixed (const ACE_CDR::Fixed &x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_int8 (ACE_CDR::Int8 x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_uint8 (ACE_CDR::UInt8 x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_string (const ACE_CDR::Char *x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_string (ACE_CDR::ULong len, const ACE_CDR::Char *x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_string (const ACE_CString &x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_wstring (const ACE_CDR::WChar *x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_wstring (ACE_CDR::ULong length, const ACE_CDR::WChar *x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_string (const std::string &x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_wstring (const std::wstring &x)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_boolean_array (const ACE_CDR::Boolean *x, ACE_CDR::ULong length)
 
ACE_CDR::Boolean write_char_array (const ACE_CDR::Char *x, ACE_CDR::ULong length)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_wchar_array (const ACE_CDR::WChar *x, ACE_CDR::ULong length)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_octet_array (const ACE_CDR::Octet *x, ACE_CDR::ULong length)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_short_array (const ACE_CDR::Short *x, ACE_CDR::ULong length)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_ushort_array (const ACE_CDR::UShort *x, ACE_CDR::ULong length)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_long_array (const ACE_CDR::Long *x, ACE_CDR::ULong length)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_ulong_array (const ACE_CDR::ULong *x, ACE_CDR::ULong length)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_longlong_array (const ACE_CDR::LongLong *x, ACE_CDR::ULong length)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_ulonglong_array (const ACE_CDR::ULongLong *x, ACE_CDR::ULong length)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_float_array (const ACE_CDR::Float *x, ACE_CDR::ULong length)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_double_array (const ACE_CDR::Double *x, ACE_CDR::ULong length)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_longdouble_array (const ACE_CDR::LongDouble *x, ACE_CDR::ULong length)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_int8_array (const ACE_CDR::Int8 *x, ACE_CDR::ULong length)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_uint8_array (const ACE_CDR::UInt8 *x, ACE_CDR::ULong length)
 For string we offer methods that accept a precomputed length.
 
ACE_CDR::Boolean write_octet_array_mb (const ACE_Message_Block *mb)
 

Friends

class ACE_Char_Codeset_Translator
 
class ACE_WChar_Codeset_Translator
 
class ACE_InputCDR
 

Placeholder/replace operations

Facilitates writing a placeholder into a CDR stream to be replaced later with a different value.

Note
An example use for this facility is:
... // insert values...
char *pos = strm.write_long_placeholder ();
... // insert more values
ACE_CDR::Long real_val; // Somehow assign the "correct" value
strm.replace (real_val, pos); // Replace earlier placeholder
ACE_INT32 Long
Definition CDR_Base.h:206
A CDR stream for marshalling data, most often for transmission to another system which may or may not...
Definition CDR_Stream.h:83
This class inherits the interface of the abstract ACE_Dumpable class and is instantiated with the imp...
Definition Dump_T.h:39
ACE_Message_Block start_
 The start of the chain of message blocks.
 
ACE_Message_Blockcurrent_
 The current block in the chain where we are writing.
 
size_t current_alignment_
 
bool current_is_writable_
 
bool do_byte_swap_
 
bool good_bit_
 Set to false when an error ocurrs.
 
size_t const memcpy_tradeoff_
 Break-even point for copying.
 
ACE_CDR::Octet major_version_
 GIOP version information.
 
ACE_CDR::Octet minor_version_
 The start of the chain of message blocks.
 
ACE_Char_Codeset_Translatorchar_translator_
 If not nil, invoke for translation of character and string data.
 
ACE_WChar_Codeset_Translatorwchar_translator_
 The start of the chain of message blocks.
 
static size_t wchar_maxbytes_ = sizeof (ACE_CDR::WChar)
 
charwrite_long_placeholder ()
 
charwrite_short_placeholder ()
 The start of the chain of message blocks.
 
charwrite_boolean_placeholder ()
 The start of the chain of message blocks.
 
charwrite_char_placeholder ()
 The start of the chain of message blocks.
 
charwrite_longlong_placeholder ()
 The start of the chain of message blocks.
 
charwrite_octet_placeholder ()
 The start of the chain of message blocks.
 
charwrite_float_placeholder ()
 The start of the chain of message blocks.
 
charwrite_double_placeholder ()
 The start of the chain of message blocks.
 
ACE_CDR::Boolean replace (ACE_CDR::Long x, char *loc)
 
ACE_CDR::Boolean replace (ACE_CDR::ULong x, char *loc)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean replace (ACE_CDR::Short x, char *loc)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean replace (ACE_CDR::UShort x, char *loc)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean replace (ACE_CDR::Boolean x, char *loc)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean replace (ACE_CDR::Char x, char *loc)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean replace (ACE_CDR::LongLong x, char *loc)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean replace (ACE_CDR::ULongLong x, char *loc)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean replace (ACE_CDR::Octet x, char *loc)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean replace (ACE_CDR::Float x, char *loc)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean replace (ACE_CDR::Double x, char *loc)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean append_boolean (ACE_InputCDR &)
 
ACE_CDR::Boolean append_char (ACE_InputCDR &)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean append_wchar (ACE_InputCDR &)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean append_octet (ACE_InputCDR &)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean append_short (ACE_InputCDR &)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean append_ushort (ACE_InputCDR &)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean append_long (ACE_InputCDR &)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean append_ulong (ACE_InputCDR &)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean append_longlong (ACE_InputCDR &)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean append_ulonglong (ACE_InputCDR &)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean append_float (ACE_InputCDR &)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean append_double (ACE_InputCDR &)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean append_longdouble (ACE_InputCDR &)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean append_fixed (ACE_InputCDR &)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean append_wstring (ACE_InputCDR &)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean append_string (ACE_InputCDR &)
 The start of the chain of message blocks.
 
bool good_bit () const
 Returns false if an error has occurred.
 
void reset ()
 Reuse the CDR stream to write on the old buffer.
 
size_t total_length () const
 Add the length of each message block in the chain.
 
const ACE_Message_Blockbegin () const
 
const ACE_Message_Blockend () const
 Return the last message in the chain that is is use.
 
const ACE_Message_Blockcurrent () const
 Return the <current_> message block in chain.
 
int consolidate ()
 Replace the message block chain with a single message block.
 
const charbuffer () const
 
size_t length () const
 
int align_write_ptr (size_t alignment)
 
ACE_Char_Codeset_Translatorchar_translator () const
 Access the codeset translators. They can be null!
 
ACE_WChar_Codeset_Translatorwchar_translator () const
 The start of the chain of message blocks.
 
void char_translator (ACE_Char_Codeset_Translator *)
 Set the char codeset translator.
 
void wchar_translator (ACE_WChar_Codeset_Translator *)
 Set the wchar codeset translator.
 
size_t current_alignment () const
 
void current_alignment (size_t current_alignment)
 The start of the chain of message blocks.
 
int adjust (size_t size, char *&buf)
 
int adjust (size_t size, size_t align, char *&buf)
 
bool do_byte_swap () const
 
int byte_order () const
 
void reset_byte_order (int byte_order)
 
void set_version (ACE_CDR::Octet major, ACE_CDR::Octet minor)
 Set GIOP version info.
 
void get_version (ACE_CDR::Octet &major, ACE_CDR::Octet &minor)
 Set the underlying GIOP version..
 
static void wchar_maxbytes (size_t max_bytes)
 
static size_t wchar_maxbytes ()
 access the serialized size of wchars.
 
ACE_Message_Blockfind (char *loc)
 The start of the chain of message blocks.
 
 ACE_OutputCDR (const ACE_OutputCDR &)=delete
 The start of the chain of message blocks.
 
ACE_OutputCDRoperator= (const ACE_OutputCDR &)=delete
 The start of the chain of message blocks.
 
 ACE_OutputCDR (ACE_OutputCDR &&)=delete
 The start of the chain of message blocks.
 
ACE_OutputCDRoperator= (ACE_OutputCDR &&)=delete
 The start of the chain of message blocks.
 
ACE_CDR::Boolean write_1 (const ACE_CDR::Octet *x)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean write_2 (const ACE_CDR::UShort *x)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean write_4 (const ACE_CDR::ULong *x)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean write_8 (const ACE_CDR::ULongLong *x)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean write_16 (const ACE_CDR::LongDouble *x)
 The start of the chain of message blocks.
 
ACE_CDR::Boolean write_array (const void *x, size_t size, size_t align, ACE_CDR::ULong length)
 
ACE_CDR::Boolean write_wchar_array_i (const ACE_CDR::WChar *x, ACE_CDR::ULong length)
 The start of the chain of message blocks.
 
int grow_and_adjust (size_t size, size_t align, char *&buf)
 

Detailed Description

A CDR stream for marshalling data, most often for transmission to another system which may or may not have the same byte order.

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:

Constructor & Destructor Documentation

◆ ACE_OutputCDR() [1/6]

ACE_OutputCDR::ACE_OutputCDR ( size_t size = 0,
int byte_order = ACE_CDR::BYTE_ORDER_NATIVE,
ACE_Allocator * buffer_allocator = 0,
ACE_Allocator * data_block_allocator = 0,
ACE_Allocator * message_block_allocator = 0,
size_t memcpy_tradeoff = ACE_DEFAULT_CDR_MEMCPY_TRADEOFF,
ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION,
ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION )

Default constructor; allows one to set byte ordering, allocators, and tuning information.

Parameters
sizeCauses constructor to preallocate size bytes; if size is 0 it allocates the default size.
byte_orderThe byte order that data will have within this object. Unless otherwise specified, the byte order will be the order native to the hardware this is executed on. To force the marshalled data to have a specific order, specify one of the values defined in ACE_CDR::Byte_Order.
Note
The ACE_ENABLE_SWAP_ON_WRITE config macro must be set for any local byte swapping to occur as data is inserted into an ACE_OutputCDR object.

◆ ACE_OutputCDR() [2/6]

ACE_OutputCDR::ACE_OutputCDR ( char * data,
size_t size,
int byte_order = ACE_CDR::BYTE_ORDER_NATIVE,
ACE_Allocator * buffer_allocator = 0,
ACE_Allocator * data_block_allocator = 0,
ACE_Allocator * message_block_allocator = 0,
size_t memcpy_tradeoff = ACE_DEFAULT_CDR_MEMCPY_TRADEOFF,
ACE_CDR::Octet giop_major_version = ACE_CDR_GIOP_MAJOR_VERSION,
ACE_CDR::Octet giop_minor_version = ACE_CDR_GIOP_MINOR_VERSION )

Build a CDR stream with an initial buffer, it will not remove data, since it did not allocated it. It's important to be careful with the alignment of data. Create an output stream from an arbitrary buffer, care must be exercised with alignment, because this constructor will align if needed. In this case data will not point to the start of the output stream. begin()->rd_ptr() points to the start of the output stream. See ACE_ptr_align_binary() to properly align a pointer and use ACE_CDR::MAX_ALIGNMENT for the correct alignment.

◆ ACE_OutputCDR() [3/6]

ACE_OutputCDR::ACE_OutputCDR ( ACE_Data_Block * data_block,
int byte_order = ACE_CDR::BYTE_ORDER_NATIVE,
ACE_Allocator * message_block_allocator = 0,
size_t memcpy_tradeoff = ACE_DEFAULT_CDR_MEMCPY_TRADEOFF,
ACE_CDR::Octet giop_major_version = ACE_CDR_GIOP_MAJOR_VERSION,
ACE_CDR::Octet giop_minor_version = ACE_CDR_GIOP_MINOR_VERSION )

Build a CDR stream with an initial data block, it will not remove data_block, since it did not allocated it. It's important to be careful with the alignment of data_block. Create an output stream from an arbitrary data block, care must be exercised with alignment, because this constructor will align if needed. In this case data_block will not point to the start of the output stream. begin()->rd_ptr() points to the start off the output stream. See ACE_ptr_align_binary() to properly align a pointer and use ACE_CDR::MAX_ALIGNMENT for the correct alignment.

◆ ACE_OutputCDR() [4/6]

ACE_OutputCDR::ACE_OutputCDR ( ACE_Message_Block * data,
int byte_order = ACE_CDR::BYTE_ORDER_NATIVE,
size_t memcpy_tradeoff = ACE_DEFAULT_CDR_MEMCPY_TRADEOFF,
ACE_CDR::Octet giop_major_version = ACE_CDR_GIOP_MAJOR_VERSION,
ACE_CDR::Octet giop_minor_version = ACE_CDR_GIOP_MINOR_VERSION )

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

◆ ~ACE_OutputCDR()

ACE_OutputCDR::~ACE_OutputCDR ( )
inline

destructor

◆ ACE_OutputCDR() [5/6]

ACE_OutputCDR::ACE_OutputCDR ( const ACE_OutputCDR & )
privatedelete

The start of the chain of message blocks.

◆ ACE_OutputCDR() [6/6]

ACE_OutputCDR::ACE_OutputCDR ( ACE_OutputCDR && )
privatedelete

The start of the chain of message blocks.

Member Function Documentation

◆ adjust() [1/2]

int ACE_OutputCDR::adjust ( size_t size,
char *& buf )
inline

Returns (in buf) the next position in the buffer aligned to size, it advances the Message_Block wr_ptr past the data (i.e., buf + size). If necessary it grows the Message_Block buffer. Sets the good_bit to false and returns a -1 on failure.

◆ adjust() [2/2]

int ACE_OutputCDR::adjust ( size_t size,
size_t align,
char *& buf )
inline

As above, but now the size and alignment requirements may be different.

◆ align_write_ptr()

int ACE_OutputCDR::align_write_ptr ( size_t alignment)
inline

Utility function to allow the user more flexibility. Pads the stream up to the nearest alignment byte boundary. Argument MUST be a power of 2. Returns 0 on success and -1 on failure.

◆ append_boolean()

ACE_CDR::Boolean ACE_OutputCDR::append_boolean ( ACE_InputCDR & stream)
inline

Return 0 on failure and 1 on success.

◆ append_char()

ACE_CDR::Boolean ACE_OutputCDR::append_char ( ACE_InputCDR & stream)
inline

The start of the chain of message blocks.

◆ append_double()

ACE_CDR::Boolean ACE_OutputCDR::append_double ( ACE_InputCDR & stream)
inline

The start of the chain of message blocks.

◆ append_fixed()

ACE_CDR::Boolean ACE_OutputCDR::append_fixed ( ACE_InputCDR & stream)
inline

The start of the chain of message blocks.

◆ append_float()

ACE_CDR::Boolean ACE_OutputCDR::append_float ( ACE_InputCDR & stream)
inline

The start of the chain of message blocks.

◆ append_long()

ACE_CDR::Boolean ACE_OutputCDR::append_long ( ACE_InputCDR & stream)
inline

The start of the chain of message blocks.

◆ append_longdouble()

ACE_CDR::Boolean ACE_OutputCDR::append_longdouble ( ACE_InputCDR & stream)
inline

The start of the chain of message blocks.

◆ append_longlong()

ACE_CDR::Boolean ACE_OutputCDR::append_longlong ( ACE_InputCDR & stream)
inline

The start of the chain of message blocks.

◆ append_octet()

ACE_CDR::Boolean ACE_OutputCDR::append_octet ( ACE_InputCDR & stream)
inline

The start of the chain of message blocks.

◆ append_short()

ACE_CDR::Boolean ACE_OutputCDR::append_short ( ACE_InputCDR & stream)
inline

The start of the chain of message blocks.

◆ append_string()

ACE_CDR::Boolean ACE_OutputCDR::append_string ( ACE_InputCDR & stream)
inline

The start of the chain of message blocks.

◆ append_ulong()

ACE_CDR::Boolean ACE_OutputCDR::append_ulong ( ACE_InputCDR & stream)
inline

The start of the chain of message blocks.

◆ append_ulonglong()

ACE_CDR::Boolean ACE_OutputCDR::append_ulonglong ( ACE_InputCDR & stream)
inline

The start of the chain of message blocks.

◆ append_ushort()

ACE_CDR::Boolean ACE_OutputCDR::append_ushort ( ACE_InputCDR & stream)
inline

The start of the chain of message blocks.

◆ append_wchar()

ACE_CDR::Boolean ACE_OutputCDR::append_wchar ( ACE_InputCDR & stream)
inline

The start of the chain of message blocks.

◆ append_wstring()

ACE_CDR::Boolean ACE_OutputCDR::append_wstring ( ACE_InputCDR & stream)
inline

The start of the chain of message blocks.

◆ begin()

const ACE_Message_Block * ACE_OutputCDR::begin ( ) const
inline

Return the start of the message block chain for this CDR stream.

Note
The complete CDR stream is represented by a chain of message blocks.

◆ buffer()

const char * ACE_OutputCDR::buffer ( ) const
inline

Access the underlying buffer (read only).

Note
This method only returns a pointer to the first block in the chain.

◆ byte_order()

int ACE_OutputCDR::byte_order ( ) const
inline

Returns the byte order this stream is marshaling data in. Will be one of the values in ACE_CDR::Byte_Order.

◆ char_translator() [1/2]

ACE_Char_Codeset_Translator * ACE_OutputCDR::char_translator ( ) const
inline

Access the codeset translators. They can be null!

◆ char_translator() [2/2]

void ACE_OutputCDR::char_translator ( ACE_Char_Codeset_Translator * ctran)
inline

Set the char codeset translator.

◆ consolidate()

int ACE_OutputCDR::consolidate ( )

Replace the message block chain with a single message block.

Upon successful completion, there will be a single message block containing the data from the complete message block chain.

Note
The only expected error is to run out of memory.

◆ current()

const ACE_Message_Block * ACE_OutputCDR::current ( ) const
inline

Return the <current_> message block in chain.

◆ current_alignment() [1/2]

size_t ACE_OutputCDR::current_alignment ( ) const
inline

Return alignment of the wr_ptr(), with respect to the start of the CDR stream. This is not the same as the alignment of current->wr_ptr()!

◆ current_alignment() [2/2]

void ACE_OutputCDR::current_alignment ( size_t current_alignment)
inline

The start of the chain of message blocks.

◆ do_byte_swap()

bool ACE_OutputCDR::do_byte_swap ( ) const
inline

Returns true if this stream is writing in non-native byte order and false otherwise. For example, it would be true if either ACE_ENABLE_SWAP_ON_WRITE is defined or a specific byte order was specified for this stream.

◆ end()

const ACE_Message_Block * ACE_OutputCDR::end ( ) const
inline

Return the last message in the chain that is is use.

◆ find()

ACE_Message_Block * ACE_OutputCDR::find ( char * loc)
private

The start of the chain of message blocks.

◆ get_version()

void ACE_OutputCDR::get_version ( ACE_CDR::Octet & major,
ACE_CDR::Octet & minor )
inline

Set the underlying GIOP version..

◆ good_bit()

bool ACE_OutputCDR::good_bit ( ) const
inline

Returns false if an error has occurred.

Note
The only expected error is to run out of memory.

◆ grow_and_adjust()

int ACE_OutputCDR::grow_and_adjust ( size_t size,
size_t align,
char *& buf )
private

Grow the CDR stream. When it returns buf contains a pointer to memory in the CDR stream, with at least size bytes ahead of it and aligned to an align boundary. It moved the <wr_ptr> to <buf

  • size>.

◆ length()

size_t ACE_OutputCDR::length ( ) const
inline

Return the size of first message block in the block chain.

Note
This method only returns information about the first block in the chain.

◆ operator=() [1/2]

ACE_OutputCDR & ACE_OutputCDR::operator= ( ACE_OutputCDR && )
privatedelete

The start of the chain of message blocks.

◆ operator=() [2/2]

ACE_OutputCDR & ACE_OutputCDR::operator= ( const ACE_OutputCDR & )
privatedelete

The start of the chain of message blocks.

◆ replace() [1/11]

ACE_CDR::Boolean ACE_OutputCDR::replace ( ACE_CDR::Boolean x,
char * loc )

The start of the chain of message blocks.

◆ replace() [2/11]

ACE_CDR::Boolean ACE_OutputCDR::replace ( ACE_CDR::Char x,
char * loc )

The start of the chain of message blocks.

◆ replace() [3/11]

ACE_CDR::Boolean ACE_OutputCDR::replace ( ACE_CDR::Double x,
char * loc )

The start of the chain of message blocks.

◆ replace() [4/11]

ACE_CDR::Boolean ACE_OutputCDR::replace ( ACE_CDR::Float x,
char * loc )

The start of the chain of message blocks.

◆ replace() [5/11]

ACE_CDR::Boolean ACE_OutputCDR::replace ( ACE_CDR::Long x,
char * loc )

Writes a new value into a specific location. This is commonly used to update a prior "placeholder" location in the stream. The specified location is assumed to have proper CDR alignment for the type to insert. This requirement is satisfied by using one of the placeholder-writing methods to align the stream for the anticipated value and obtain the correct location. Treatment of x with respect to byte swapping is the same as for when any value is inserted.

Parameters
xThe value to insert into the specified location.
locThe location at which to insert x. loc must be a valid position within the stream's current set of message blocks.
See also
write_long_placeholder(), write_short_placeholder ()

◆ replace() [6/11]

ACE_CDR::Boolean ACE_OutputCDR::replace ( ACE_CDR::LongLong x,
char * loc )

The start of the chain of message blocks.

◆ replace() [7/11]

ACE_CDR::Boolean ACE_OutputCDR::replace ( ACE_CDR::Octet x,
char * loc )

The start of the chain of message blocks.

◆ replace() [8/11]

ACE_CDR::Boolean ACE_OutputCDR::replace ( ACE_CDR::Short x,
char * loc )

The start of the chain of message blocks.

◆ replace() [9/11]

ACE_CDR::Boolean ACE_OutputCDR::replace ( ACE_CDR::ULong x,
char * loc )

The start of the chain of message blocks.

◆ replace() [10/11]

ACE_CDR::Boolean ACE_OutputCDR::replace ( ACE_CDR::ULongLong x,
char * loc )

The start of the chain of message blocks.

◆ replace() [11/11]

ACE_CDR::Boolean ACE_OutputCDR::replace ( ACE_CDR::UShort x,
char * loc )

The start of the chain of message blocks.

◆ reset()

void ACE_OutputCDR::reset ( )
inline

Reuse the CDR stream to write on the old buffer.

◆ reset_byte_order()

void ACE_OutputCDR::reset_byte_order ( int byte_order)
inline

For use by a gateway, which creates the output stream for the reply to the client in its native byte order, but which must send the reply in the byte order of the target's reply to the gateway.

◆ set_version()

void ACE_OutputCDR::set_version ( ACE_CDR::Octet major,
ACE_CDR::Octet minor )
inline

Set GIOP version info.

◆ total_length()

size_t ACE_OutputCDR::total_length ( ) const
inline

Add the length of each message block in the chain.

◆ wchar_maxbytes() [1/2]

size_t ACE_OutputCDR::wchar_maxbytes ( )
static

access the serialized size of wchars.

◆ wchar_maxbytes() [2/2]

void ACE_OutputCDR::wchar_maxbytes ( size_t max_bytes)
static

set the global size of serialized wchars. This may be different than the size of a wchar_t.

◆ wchar_translator() [1/2]

ACE_WChar_Codeset_Translator * ACE_OutputCDR::wchar_translator ( ) const
inline

The start of the chain of message blocks.

◆ wchar_translator() [2/2]

void ACE_OutputCDR::wchar_translator ( ACE_WChar_Codeset_Translator * wctran)
inline

Set the wchar codeset translator.

◆ write_1()

ACE_CDR::Boolean ACE_OutputCDR::write_1 ( const ACE_CDR::Octet * x)
private

The start of the chain of message blocks.

◆ write_16()

ACE_CDR::Boolean ACE_OutputCDR::write_16 ( const ACE_CDR::LongDouble * x)
private

The start of the chain of message blocks.

◆ write_2()

ACE_CDR::Boolean ACE_OutputCDR::write_2 ( const ACE_CDR::UShort * x)
private

The start of the chain of message blocks.

◆ write_4()

ACE_CDR::Boolean ACE_OutputCDR::write_4 ( const ACE_CDR::ULong * x)
private

The start of the chain of message blocks.

◆ write_8()

ACE_CDR::Boolean ACE_OutputCDR::write_8 ( const ACE_CDR::ULongLong * x)
private

The start of the chain of message blocks.

◆ write_array()

ACE_CDR::Boolean ACE_OutputCDR::write_array ( const void * x,
size_t size,
size_t align,
ACE_CDR::ULong length )
private

write an array of length elements, each of size bytes and the start aligned at a multiple of align. The elements are assumed to be packed with the right alignment restrictions. It is mostly designed for buffers of the basic types.

This operation uses memcpy; as explained above it is expected that using assignment is faster that memcpy for one element, but for several elements memcpy should be more efficient, it could be interesting to find the break even point and optimize for that case, but that would be too platform dependent.

◆ write_boolean()

ACE_CDR::Boolean ACE_OutputCDR::write_boolean ( ACE_CDR::Boolean x)
inline

For string we offer methods that accept a precomputed length.

◆ write_boolean_array()

ACE_CDR::Boolean ACE_OutputCDR::write_boolean_array ( const ACE_CDR::Boolean * x,
ACE_CDR::ULong length )
Note
the portion written starts at x and ends at x + length. The length is NOT stored into the CDR stream.

◆ write_boolean_placeholder()

char * ACE_OutputCDR::write_boolean_placeholder ( )

The start of the chain of message blocks.

◆ write_char()

ACE_CDR::Boolean ACE_OutputCDR::write_char ( ACE_CDR::Char x)
inline

For string we offer methods that accept a precomputed length.

◆ write_char_array()

ACE_CDR::Boolean ACE_OutputCDR::write_char_array ( const ACE_CDR::Char * x,
ACE_CDR::ULong length )
inline

For string we offer methods that accept a precomputed length.

◆ write_char_placeholder()

char * ACE_OutputCDR::write_char_placeholder ( )

The start of the chain of message blocks.

◆ write_double()

ACE_CDR::Boolean ACE_OutputCDR::write_double ( const ACE_CDR::Double & x)
inline

For string we offer methods that accept a precomputed length.

◆ write_double_array()

ACE_CDR::Boolean ACE_OutputCDR::write_double_array ( const ACE_CDR::Double * x,
ACE_CDR::ULong length )
inline

For string we offer methods that accept a precomputed length.

◆ write_double_placeholder()

char * ACE_OutputCDR::write_double_placeholder ( )

The start of the chain of message blocks.

◆ write_fixed()

ACE_CDR::Boolean ACE_OutputCDR::write_fixed ( const ACE_CDR::Fixed & x)
inline

For string we offer methods that accept a precomputed length.

◆ write_float()

ACE_CDR::Boolean ACE_OutputCDR::write_float ( ACE_CDR::Float x)
inline

For string we offer methods that accept a precomputed length.

◆ write_float_array()

ACE_CDR::Boolean ACE_OutputCDR::write_float_array ( const ACE_CDR::Float * x,
ACE_CDR::ULong length )
inline

For string we offer methods that accept a precomputed length.

◆ write_float_placeholder()

char * ACE_OutputCDR::write_float_placeholder ( )

The start of the chain of message blocks.

◆ write_int8()

ACE_CDR::Boolean ACE_OutputCDR::write_int8 ( ACE_CDR::Int8 x)
inline

For string we offer methods that accept a precomputed length.

◆ write_int8_array()

ACE_CDR::Boolean ACE_OutputCDR::write_int8_array ( const ACE_CDR::Int8 * x,
ACE_CDR::ULong length )
inline

For string we offer methods that accept a precomputed length.

◆ write_long()

ACE_CDR::Boolean ACE_OutputCDR::write_long ( ACE_CDR::Long x)
inline

For string we offer methods that accept a precomputed length.

◆ write_long_array()

ACE_CDR::Boolean ACE_OutputCDR::write_long_array ( const ACE_CDR::Long * x,
ACE_CDR::ULong length )
inline

For string we offer methods that accept a precomputed length.

◆ write_long_placeholder()

char * ACE_OutputCDR::write_long_placeholder ( )

Write a placeholder into the stream. The placeholder's pointer is returned so it may later be passed as the loc argument to replace (). These methods align the stream's write pointer properly prior to writing the placeholder.

Return values
Pointerto the placeholder; 0 if there is not enough space in the stream and memory could not be allocated.

◆ write_longdouble()

ACE_CDR::Boolean ACE_OutputCDR::write_longdouble ( const ACE_CDR::LongDouble & x)
inline

For string we offer methods that accept a precomputed length.

◆ write_longdouble_array()

ACE_CDR::Boolean ACE_OutputCDR::write_longdouble_array ( const ACE_CDR::LongDouble * x,
ACE_CDR::ULong length )
inline

For string we offer methods that accept a precomputed length.

◆ write_longlong()

ACE_CDR::Boolean ACE_OutputCDR::write_longlong ( const ACE_CDR::LongLong & x)
inline

For string we offer methods that accept a precomputed length.

◆ write_longlong_array()

ACE_CDR::Boolean ACE_OutputCDR::write_longlong_array ( const ACE_CDR::LongLong * x,
ACE_CDR::ULong length )
inline

For string we offer methods that accept a precomputed length.

◆ write_longlong_placeholder()

char * ACE_OutputCDR::write_longlong_placeholder ( )

The start of the chain of message blocks.

◆ write_octet()

ACE_CDR::Boolean ACE_OutputCDR::write_octet ( ACE_CDR::Octet x)
inline

For string we offer methods that accept a precomputed length.

◆ write_octet_array()

ACE_CDR::Boolean ACE_OutputCDR::write_octet_array ( const ACE_CDR::Octet * x,
ACE_CDR::ULong length )
inline

For string we offer methods that accept a precomputed length.

◆ write_octet_array_mb()

ACE_CDR::Boolean ACE_OutputCDR::write_octet_array_mb ( const ACE_Message_Block * mb)

Write an octet array contained inside a MB, this can be optimized to minimize copies.

◆ write_octet_placeholder()

char * ACE_OutputCDR::write_octet_placeholder ( )

The start of the chain of message blocks.

◆ write_short()

ACE_CDR::Boolean ACE_OutputCDR::write_short ( ACE_CDR::Short x)
inline

For string we offer methods that accept a precomputed length.

◆ write_short_array()

ACE_CDR::Boolean ACE_OutputCDR::write_short_array ( const ACE_CDR::Short * x,
ACE_CDR::ULong length )
inline

For string we offer methods that accept a precomputed length.

◆ write_short_placeholder()

char * ACE_OutputCDR::write_short_placeholder ( )

The start of the chain of message blocks.

◆ write_string() [1/4]

ACE_CDR::Boolean ACE_OutputCDR::write_string ( ACE_CDR::ULong len,
const ACE_CDR::Char * x )

For string we offer methods that accept a precomputed length.

◆ write_string() [2/4]

ACE_CDR::Boolean ACE_OutputCDR::write_string ( const ACE_CDR::Char * x)
inline

For string we offer methods that accept a precomputed length.

◆ write_string() [3/4]

ACE_CDR::Boolean ACE_OutputCDR::write_string ( const ACE_CString & x)

For string we offer methods that accept a precomputed length.

◆ write_string() [4/4]

ACE_CDR::Boolean ACE_OutputCDR::write_string ( const std::string & x)
inline

For string we offer methods that accept a precomputed length.

◆ write_uint8()

ACE_CDR::Boolean ACE_OutputCDR::write_uint8 ( ACE_CDR::UInt8 x)
inline

For string we offer methods that accept a precomputed length.

◆ write_uint8_array()

ACE_CDR::Boolean ACE_OutputCDR::write_uint8_array ( const ACE_CDR::UInt8 * x,
ACE_CDR::ULong length )
inline

For string we offer methods that accept a precomputed length.

◆ write_ulong()

ACE_CDR::Boolean ACE_OutputCDR::write_ulong ( ACE_CDR::ULong x)
inline

For string we offer methods that accept a precomputed length.

◆ write_ulong_array()

ACE_CDR::Boolean ACE_OutputCDR::write_ulong_array ( const ACE_CDR::ULong * x,
ACE_CDR::ULong length )
inline

For string we offer methods that accept a precomputed length.

◆ write_ulonglong()

ACE_CDR::Boolean ACE_OutputCDR::write_ulonglong ( const ACE_CDR::ULongLong & x)
inline

For string we offer methods that accept a precomputed length.

◆ write_ulonglong_array()

ACE_CDR::Boolean ACE_OutputCDR::write_ulonglong_array ( const ACE_CDR::ULongLong * x,
ACE_CDR::ULong length )
inline

For string we offer methods that accept a precomputed length.

◆ write_ushort()

ACE_CDR::Boolean ACE_OutputCDR::write_ushort ( ACE_CDR::UShort x)
inline

For string we offer methods that accept a precomputed length.

◆ write_ushort_array()

ACE_CDR::Boolean ACE_OutputCDR::write_ushort_array ( const ACE_CDR::UShort * x,
ACE_CDR::ULong length )
inline

For string we offer methods that accept a precomputed length.

◆ write_wchar()

ACE_CDR::Boolean ACE_OutputCDR::write_wchar ( ACE_CDR::WChar x)

For string we offer methods that accept a precomputed length.

◆ write_wchar_array()

ACE_CDR::Boolean ACE_OutputCDR::write_wchar_array ( const ACE_CDR::WChar * x,
ACE_CDR::ULong length )
inline

For string we offer methods that accept a precomputed length.

◆ write_wchar_array_i()

ACE_CDR::Boolean ACE_OutputCDR::write_wchar_array_i ( const ACE_CDR::WChar * x,
ACE_CDR::ULong length )
private

The start of the chain of message blocks.

◆ write_wstring() [1/3]

ACE_CDR::Boolean ACE_OutputCDR::write_wstring ( ACE_CDR::ULong length,
const ACE_CDR::WChar * x )

For string we offer methods that accept a precomputed length.

◆ write_wstring() [2/3]

ACE_CDR::Boolean ACE_OutputCDR::write_wstring ( const ACE_CDR::WChar * x)
inline

For string we offer methods that accept a precomputed length.

◆ write_wstring() [3/3]

ACE_CDR::Boolean ACE_OutputCDR::write_wstring ( const std::wstring & x)
inline

For string we offer methods that accept a precomputed length.

Friends And Related Symbol Documentation

◆ ACE_Char_Codeset_Translator

The Codeset translators need access to some private members to efficiently marshal arrays For reading from an output CDR stream.

◆ ACE_InputCDR

◆ ACE_WChar_Codeset_Translator

Member Data Documentation

◆ char_translator_

ACE_Char_Codeset_Translator* ACE_OutputCDR::char_translator_
protected

If not nil, invoke for translation of character and string data.

◆ current_

ACE_Message_Block* ACE_OutputCDR::current_
private

The current block in the chain where we are writing.

◆ current_alignment_

size_t ACE_OutputCDR::current_alignment_
private

The current alignment as measured from the start of the buffer. Usually this coincides with the alignment of the buffer in memory, but, when we chain another buffer this "quasi invariant" is broken. The current_alignment is used to readjust the buffer following the stolen message block.

◆ current_is_writable_

bool ACE_OutputCDR::current_is_writable_
private

Is the current block writable. When we steal a buffer from the user and just chain it into the message block we are not supposed to write on it, even if it is past the start and end of the buffer.

◆ do_byte_swap_

bool ACE_OutputCDR::do_byte_swap_
private

If not zero swap bytes at writing so the created CDR stream byte order does not match the machine byte order. The motivation for such a beast is that in some setting a few (fast) machines can be serving hundreds of slow machines with the opposite byte order, so it makes sense (as a load balancing device) to put the responsibility in the writers.

Warning
THIS IS NOT A STANDARD IN CORBA, USE AT YOUR OWN RISK

◆ good_bit_

bool ACE_OutputCDR::good_bit_
private

Set to false when an error ocurrs.

◆ major_version_

ACE_CDR::Octet ACE_OutputCDR::major_version_
protected

GIOP version information.

◆ memcpy_tradeoff_

size_t const ACE_OutputCDR::memcpy_tradeoff_
private

Break-even point for copying.

◆ minor_version_

ACE_CDR::Octet ACE_OutputCDR::minor_version_
protected

The start of the chain of message blocks.

◆ start_

ACE_Message_Block ACE_OutputCDR::start_
private

The start of the chain of message blocks.

◆ wchar_maxbytes_

size_t ACE_OutputCDR::wchar_maxbytes_ = sizeof (ACE_CDR::WChar)
staticprotected

Some wide char codesets may be defined with a maximum number of bytes that is smaller than the size of a wchar_t. This means that the CDR cannot simply memcpy a block of wchars to and from the stream, but must instead realign the bytes appropriately. In cases when wchar i/o is not allowed, such as with GIOP 1.0, or not having a native wchar codeset defined, the maxbytes is set to zero, indicating no wchar data is allowed.

◆ wchar_translator_

ACE_WChar_Codeset_Translator* ACE_OutputCDR::wchar_translator_
protected

The start of the chain of message blocks.


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