ACE 8.0.5
Loading...
Searching...
No Matches
ACE_CDR Class Reference

Keep constants and some routines common to both Output and Input CDR streams. More...

#include <CDR_Base.h>

Classes

struct  Float
struct  Double
struct  LongDouble
class  Fixed

Public Types

enum  Byte_Order { BYTE_ORDER_BIG_ENDIAN = 0 , BYTE_ORDER_LITTLE_ENDIAN = 1 , BYTE_ORDER_NATIVE = ACE_CDR_BYTE_ORDER }
Basic OMG IDL Types

These types are for use in the CDR classes. The cleanest way to avoid complaints from all compilers is to define them all.

typedef bool Boolean
typedef ACE_Byte Octet
typedef char Char
typedef ACE_WCHAR_T WChar
typedef ACE_INT16 Short
typedef ACE_UINT16 UShort
typedef ACE_INT32 Long
typedef ACE_UINT32 ULong
typedef ACE_INT64 LongLong
typedef ACE_UINT64 ULongLong
typedef ACE_INT8 Int8
typedef ACE_UINT8 UInt8
typedef Short Int16
typedef UShort UInt16
typedef Long Int32
typedef ULong UInt32
typedef LongLong Int64
typedef ULongLong UInt64

Static Public Member Functions

static void swap_2 (char const *orig, char *target)
static void swap_4 (char const *orig, char *target)
static void swap_8 (char const *orig, char *target)
static void swap_16 (char const *orig, char *target)
static void swap_2_array (char const *orig, char *target, size_t length)
static void swap_4_array (char const *orig, char *target, size_t length)
static void swap_8_array (char const *orig, char *target, size_t length)
static void swap_16_array (char const *orig, char *target, size_t length)
static void mb_align (ACE_Message_Block *mb)
static size_t first_size (size_t minsize)
static size_t next_size (size_t minsize)
static int grow (ACE_Message_Block *mb, size_t minsize)
static int consolidate (ACE_Message_Block *dst, const ACE_Message_Block *src)
static size_t total_length (const ACE_Message_Block *begin, const ACE_Message_Block *end)

Static Public Attributes

static constexpr size_t OCTET_SIZE = 1
static constexpr size_t SHORT_SIZE = 2
static constexpr size_t LONG_SIZE = 4
static constexpr size_t LONGLONG_SIZE = 8
static constexpr size_t LONGDOUBLE_SIZE = 16
static constexpr size_t OCTET_ALIGN = 1
static constexpr size_t SHORT_ALIGN = 2
static constexpr size_t LONG_ALIGN = 4
static constexpr size_t LONGLONG_ALIGN = 8
static constexpr size_t LONGDOUBLE_ALIGN = 8
static constexpr size_t MAX_ALIGNMENT = 8
static constexpr size_t DEFAULT_BUFSIZE = ACE_DEFAULT_CDR_BUFSIZE
 The default buffer size.
static constexpr size_t EXP_GROWTH_MAX = ACE_DEFAULT_CDR_EXP_GROWTH_MAX
static constexpr size_t LINEAR_GROWTH_CHUNK = ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK

Detailed Description

Keep constants and some routines common to both Output and Input CDR streams.

Member Typedef Documentation

◆ Boolean

typedef bool ACE_CDR::Boolean

◆ Char

typedef char ACE_CDR::Char

◆ Int16

◆ Int32

◆ Int64

◆ Int8

◆ Long

◆ LongLong

◆ Octet

◆ Short

◆ UInt16

◆ UInt32

◆ UInt64

◆ UInt8

◆ ULong

◆ ULongLong

◆ UShort

◆ WChar

Member Enumeration Documentation

◆ Byte_Order

Enumerator
BYTE_ORDER_BIG_ENDIAN 

Use big-endian order (also known as network byte order).

BYTE_ORDER_LITTLE_ENDIAN 

Use little-endian order.

BYTE_ORDER_NATIVE 

Use whichever byte order is native to this machine.

Member Function Documentation

◆ consolidate()

int ACE_CDR::consolidate ( ACE_Message_Block * dst,
const ACE_Message_Block * src )
static

Copy a message block chain into a single message block, preserving the alignment of the first message block of the original stream, not the following message blocks.

Return values
-1Failure
0Success.

◆ first_size()

size_t ACE_CDR::first_size ( size_t minsize)
inlinestatic

Compute the size of the smallest buffer that can contain at least minsize bytes. To understand how a "best fit" is computed look at the algorithm in the code. Basically the buffers grow exponentially, up to a certain point, then the buffer size grows linearly. The advantage of this algorithm is that is rapidly grows to a large value, but does not explode at the end.

◆ grow()

int ACE_CDR::grow ( ACE_Message_Block * mb,
size_t minsize )
static

Increase the capacity of mb to contain at least minsize bytes. If minsize is zero the size is increased by an amount at least large enough to contain any of the basic IDL types.

Return values
-1Failure
0Success.

◆ mb_align()

void ACE_CDR::mb_align ( ACE_Message_Block * mb)
static

Align the message block to ACE_CDR::MAX_ALIGNMENT, set by the CORBA spec at 8 bytes.

◆ next_size()

size_t ACE_CDR::next_size ( size_t minsize)
inlinestatic

Compute not the smallest, but the second smallest buffer that will fir minsize bytes.

◆ swap_16()

void ACE_CDR::swap_16 ( char const * orig,
char * target )
inlinestatic

◆ swap_16_array()

void ACE_CDR::swap_16_array ( char const * orig,
char * target,
size_t length )
static

◆ swap_2()

void ACE_CDR::swap_2 ( char const * orig,
char * target )
inlinestatic

Do byte swapping for each basic IDL type size. There exist only routines to put byte, halfword (2 bytes), word (4 bytes), doubleword (8 bytes) and quadword (16 byte); because those are the IDL basic type sizes.

◆ swap_2_array()

void ACE_CDR::swap_2_array ( char const * orig,
char * target,
size_t length )
static

◆ swap_4()

void ACE_CDR::swap_4 ( char const * orig,
char * target )
inlinestatic

◆ swap_4_array()

void ACE_CDR::swap_4_array ( char const * orig,
char * target,
size_t length )
static

◆ swap_8()

void ACE_CDR::swap_8 ( char const * orig,
char * target )
inlinestatic

◆ swap_8_array()

void ACE_CDR::swap_8_array ( char const * orig,
char * target,
size_t length )
static

◆ total_length()

size_t ACE_CDR::total_length ( const ACE_Message_Block * begin,
const ACE_Message_Block * end )
static

Member Data Documentation

◆ DEFAULT_BUFSIZE

size_t ACE_CDR::DEFAULT_BUFSIZE = ACE_DEFAULT_CDR_BUFSIZE
staticconstexpr

The default buffer size.

Todo
We want to add options to control this default value, so this constant should be read as the default default value ;-)

◆ EXP_GROWTH_MAX

size_t ACE_CDR::EXP_GROWTH_MAX = ACE_DEFAULT_CDR_EXP_GROWTH_MAX
staticconstexpr

The buffer size grows exponentially until it reaches this size; afterwards it grows linearly using the next constant

◆ LINEAR_GROWTH_CHUNK

size_t ACE_CDR::LINEAR_GROWTH_CHUNK = ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK
staticconstexpr

Once exponential growth is ruled out the buffer size increases in chunks of this size, note that this constants have the same value right now, but it does not need to be so.

◆ LONG_ALIGN

size_t ACE_CDR::LONG_ALIGN = 4
staticconstexpr

◆ LONG_SIZE

size_t ACE_CDR::LONG_SIZE = 4
staticconstexpr

◆ LONGDOUBLE_ALIGN

size_t ACE_CDR::LONGDOUBLE_ALIGN = 8
staticconstexpr
Note
the CORBA LongDouble alignment requirements do not match its size...

◆ LONGDOUBLE_SIZE

size_t ACE_CDR::LONGDOUBLE_SIZE = 16
staticconstexpr

◆ LONGLONG_ALIGN

size_t ACE_CDR::LONGLONG_ALIGN = 8
staticconstexpr

◆ LONGLONG_SIZE

size_t ACE_CDR::LONGLONG_SIZE = 8
staticconstexpr

◆ MAX_ALIGNMENT

size_t ACE_CDR::MAX_ALIGNMENT = 8
staticconstexpr

Maximal CDR 1.1 alignment: "quad precision" FP (i.e. "CDR::Long double", size as above).

◆ OCTET_ALIGN

size_t ACE_CDR::OCTET_ALIGN = 1
staticconstexpr

◆ OCTET_SIZE

size_t ACE_CDR::OCTET_SIZE = 1
staticconstexpr

◆ SHORT_ALIGN

size_t ACE_CDR::SHORT_ALIGN = 2
staticconstexpr

◆ SHORT_SIZE

size_t ACE_CDR::SHORT_SIZE = 2
staticconstexpr

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