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

ACE_CDR Class Reference

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

#include <CDR_Base.h>

List of all members.

Public Types

typedef u_char Boolean
typedef u_char Octet
typedef char Char
typedef ACE_OS::WChar WChar
typedef ACE_INT16 Short
typedef ACE_UINT16 UShort
typedef ACE_INT32 Long
typedef ACE_UINT32 ULong
typedef ACE_UINT64 ULongLong
typedef long long LongLong
enum  {
  OCTET_SIZE = 1, SHORT_SIZE = 2, LONG_SIZE = 4, LONGLONG_SIZE = 8,
  LONGDOUBLE_SIZE = 16, OCTET_ALIGN = 1, SHORT_ALIGN = 2, LONG_ALIGN = 4,
  LONGLONG_ALIGN = 8, LONGDOUBLE_ALIGN = 8, MAX_ALIGNMENT = 8, DEFAULT_BUFSIZE = ACE_DEFAULT_CDR_BUFSIZE,
  EXP_GROWTH_MAX = ACE_DEFAULT_CDR_EXP_GROWTH_MAX, LINEAR_GROWTH_CHUNK = ACE_DEFAULT_CDR_LINEAR_GROWTH_CHUNK
}

Static Public Methods

void swap_2 (const char *orig, char *target)
void swap_4 (const char *orig, char *target)
void swap_8 (const char *orig, char *target)
void swap_16 (const char *orig, char *target)
void swap_2_array (const char *orig, char *target, size_t length)
void swap_4_array (const char *orig, char *target, size_t length)
void swap_8_array (const char *orig, char *target, size_t length)
void swap_16_array (const char *orig, char *target, size_t length)
void mb_align (ACE_Message_Block *mb)
 Align the message block to ACE_CDR::MAX_ALIGNMENT, set by the CORBA spec at 8 bytes.

size_t first_size (size_t minsize)
size_t next_size (size_t minsize)
 Compute not the smallest, but the second smallest buffer that will fir <minsize> bytes.

int grow (ACE_Message_Block *mb, size_t minsize)
void consolidate (ACE_Message_Block *dst, const ACE_Message_Block *src)
 Copy a message block chain into a single message block, preserving the alignment of the original stream.

size_t total_length (const ACE_Message_Block *begin, const ACE_Message_Block *end)


Detailed Description

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


Member Typedef Documentation

typedef u_char ACE_CDR::Boolean
 

typedef char ACE_CDR::Char
 

typedef ACE_INT32 ACE_CDR::Long
 

typedef long long ACE_CDR::LongLong
 

typedef u_char ACE_CDR::Octet
 

typedef ACE_INT16 ACE_CDR::Short
 

typedef ACE_UINT32 ACE_CDR::ULong
 

typedef ACE_UINT64 ACE_CDR::ULongLong
 

typedef ACE_UINT16 ACE_CDR::UShort
 

typedef ACE_OS::WChar ACE_CDR::WChar
 


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
OCTET_SIZE  
SHORT_SIZE  
LONG_SIZE  
LONGLONG_SIZE  
LONGDOUBLE_SIZE  
OCTET_ALIGN  
SHORT_ALIGN  
LONG_ALIGN  
LONGLONG_ALIGN  
LONGDOUBLE_ALIGN  
Note:
the CORBA LongDouble alignment requirements do not match its size...
MAX_ALIGNMENT   Maximal CDR 1.1 alignment: "quad precision" FP (i.e. "CDR::Long double", size as above).
DEFAULT_BUFSIZE   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   The buffer size grows exponentially until it reaches this size; afterwards it grows linearly using the next constant.
LINEAR_GROWTH_CHUNK   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.


Member Function Documentation

void 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 original stream.

ACE_INLINE size_t ACE_CDR::first_size ( size_t minsize ) [static]
 

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.

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 -1 on failure, 0 on success.

ACE_INLINE 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.

ACE_INLINE size_t ACE_CDR::next_size ( size_t minsize ) [static]
 

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

ACE_INLINE void ACE_CDR::swap_16 ( const char * orig,
char * target ) [static]
 

void ACE_CDR::swap_16_array ( const char * orig,
char * target,
size_t n ) [static]
 

ACE_INLINE void ACE_CDR::swap_2 ( const char * orig,
char * target ) [static]
 

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.

const char *get_rcsid_ace _ void ACE_CDR::swap_2_array ( const char * orig,
char * target,
size_t n ) [inline, static]
 

ACE_INLINE void ACE_CDR::swap_4 ( const char * orig,
char * target ) [static]
 

void ACE_CDR::swap_4_array ( const char * orig,
char * target,
size_t n ) [static]
 

ACE_INLINE void ACE_CDR::swap_8 ( const char * orig,
char * target ) [static]
 

void ACE_CDR::swap_8_array ( const char * orig,
char * target,
size_t n ) [static]
 

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


The documentation for this class was generated from the following files:
Generated at Fri Oct 5 07:01:34 2001 for ACE by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000