Public Methods |
| ACE_InputCDR (const char *buf, size_t bufsiz, int byte_order = ACE_CDR_BYTE_ORDER, ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION, ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION) |
| ACE_InputCDR (size_t bufsiz, int byte_order = ACE_CDR_BYTE_ORDER, ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION, ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION) |
| Create an empty input stream. The caller is responsible for putting the right data and providing the right alignment.
|
| ACE_InputCDR (const ACE_Message_Block *data, int byte_order = ACE_CDR_BYTE_ORDER, ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION, ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION) |
| Create an input stream from an ACE_Message_Block.
|
| ACE_InputCDR (ACE_Data_Block *data, ACE_Message_Block::Message_Flags flag = 0, int byte_order = ACE_CDR_BYTE_ORDER, ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION, ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION) |
| Create an input stream from an ACE_Data_Block. The <flag> indicates whether the <data> can be deleted by the CDR stream or not.
|
| ACE_InputCDR (ACE_Data_Block *data, ACE_Message_Block::Message_Flags flag, size_t read_pointer_position, size_t write_pointer_position, int byte_order = ACE_CDR_BYTE_ORDER, ACE_CDR::Octet major_version = ACE_CDR_GIOP_MAJOR_VERSION, ACE_CDR::Octet minor_version = ACE_CDR_GIOP_MINOR_VERSION) |
| Create an input stream from an ACE_Data_Block. It also sets the read and write pointers at the desired positions. This would be helpful if the applications desires to create a new CDR stream from a semi-processed datablock.
|
| ACE_InputCDR (const ACE_InputCDR& rhs) |
ACE_InputCDR& | operator= (const ACE_InputCDR& rhs) |
| ACE_InputCDR (const ACE_InputCDR& rhs, size_t size, ACE_CDR::Long offset) |
| When interpreting indirected TypeCodes it is useful to make a "copy" of the stream starting in the new position.
|
| ACE_InputCDR (const ACE_InputCDR& rhs, size_t size) |
| This creates an encapsulated stream, the first byte must be (per the spec) the byte order of the encapsulation.
|
| ACE_InputCDR (const ACE_OutputCDR& rhs, ACE_Allocator* buffer_allocator = 0, ACE_Allocator* data_block_allocator = 0, ACE_Allocator* message_block_allocator = 0) |
| Create an input CDR from an output CDR.
|
| ACE_InputCDR (Transfer_Contents rhs) |
| Transfer the contents from <rhs> to a new CDR.
|
| ~ACE_InputCDR (void) |
| Destructor.
|
ACE_CDR::Boolean | skip_wstring (void) |
ACE_CDR::Boolean | skip_string (void) |
ACE_CDR::Boolean | skip_bytes (size_t n) |
| Skip <n> bytes in the CDR stream. Return 0 on failure and 1 on success.
|
int | good_bit (void) const |
| returns zero if a problem has been detected.
|
const ACE_Message_Block* | start (void) const |
int | grow (size_t newsize) |
void | reset_byte_order (int byte_order) |
void | reset (const ACE_Message_Block *data, int byte_order) |
| Re-initialize the CDR stream, copying the contents of the chain of message_blocks starting from <data>.
|
ACE_Message_Block* | steal_contents (void) |
| Steal the contents from the current CDR.
|
void | steal_from (ACE_InputCDR &cdr) |
| Steal the contents of <cdr> and make a shallow copy into this stream.
|
void | exchange_data_blocks (ACE_InputCDR &cdr) |
| Exchange data blocks with the caller of this method. The read and write pointers are also exchanged. Note: We now do only with the start_ message block.
|
ACE_Data_Block* | clone_from (ACE_InputCDR &cdr) |
| Copy the data portion from the <cdr> to this cdr and return the data content (ie. the ACE_Data_Block) from this CDR to the caller. The caller is responsible for managing the memory of the returned ACE_Data_Block.
|
void | reset_contents (void) |
| Re-initialize the CDR stream, forgetting about the old contents of the stream and allocating a new buffer (from the allocators).
|
char* | rd_ptr (void) |
| Returns the current position for the rd_ptr....
|
char* | wr_ptr (void) |
| Returns the current position for the wr_ptr....
|
size_t | length (void) const |
| Return how many bytes are left in the stream.
|
int | align_read_ptr (size_t alignment) |
int | do_byte_swap (void) const |
| If non-zero then this stream is writing in non-native byte order, this is only meaningful if ACE_ENABLE_SWAP_ON_WRITE is defined.
|
int | byte_order (void) const |
| If <do_byte_swap> returns 0, this returns ACE_CDR_BYTE_ORDER else it returns !ACE_CDR_BYTE_ORDER.
|
ACE_Char_Codeset_Translator* | char_translator (void) const |
| Access the codeset translators. They can be nil!
|
ACE_WChar_Codeset_Translator* | wchar_translator (void) const |
int | adjust (size_t size, char *&buf) |
int | adjust (size_t size, size_t align, char *&buf) |
| As above, but now the size and alignment requirements may be different.
|
|
ACE_CDR::Boolean | read_boolean (ACE_CDR::Boolean& x) |
ACE_CDR::Boolean | read_char (ACE_CDR::Char &x) |
ACE_CDR::Boolean | read_wchar (ACE_CDR::WChar& x) |
ACE_CDR::Boolean | read_octet (ACE_CDR::Octet& x) |
ACE_CDR::Boolean | read_short (ACE_CDR::Short &x) |
ACE_CDR::Boolean | read_ushort (ACE_CDR::UShort &x) |
ACE_CDR::Boolean | read_long (ACE_CDR::Long &x) |
ACE_CDR::Boolean | read_ulong (ACE_CDR::ULong &x) |
ACE_CDR::Boolean | read_longlong (ACE_CDR::LongLong& x) |
ACE_CDR::Boolean | read_ulonglong (ACE_CDR::ULongLong& x) |
ACE_CDR::Boolean | read_float (ACE_CDR::Float &x) |
ACE_CDR::Boolean | read_double (ACE_CDR::Double &x) |
ACE_CDR::Boolean | read_longdouble (ACE_CDR::LongDouble &x) |
ACE_CDR::Boolean | read_string (ACE_CDR::Char *&x) |
ACE_CDR::Boolean | read_string (ACE_CString &x) |
ACE_CDR::Boolean | read_wstring (ACE_CDR::WChar*& x) |
|
ACE_CDR::Boolean | read_boolean_array (ACE_CDR::Boolean* x, ACE_CDR::ULong length) |
ACE_CDR::Boolean | read_char_array (ACE_CDR::Char *x, ACE_CDR::ULong length) |
ACE_CDR::Boolean | read_wchar_array (ACE_CDR::WChar* x, ACE_CDR::ULong length) |
ACE_CDR::Boolean | read_octet_array (ACE_CDR::Octet* x, ACE_CDR::ULong length) |
ACE_CDR::Boolean | read_short_array (ACE_CDR::Short *x, ACE_CDR::ULong length) |
ACE_CDR::Boolean | read_ushort_array (ACE_CDR::UShort *x, ACE_CDR::ULong length) |
ACE_CDR::Boolean | read_long_array (ACE_CDR::Long *x, ACE_CDR::ULong length) |
ACE_CDR::Boolean | read_ulong_array (ACE_CDR::ULong *x, ACE_CDR::ULong length) |
ACE_CDR::Boolean | read_longlong_array (ACE_CDR::LongLong* x, ACE_CDR::ULong length) |
ACE_CDR::Boolean | read_ulonglong_array (ACE_CDR::ULongLong* x, ACE_CDR::ULong length) |
ACE_CDR::Boolean | read_float_array (ACE_CDR::Float *x, ACE_CDR::ULong length) |
ACE_CDR::Boolean | read_double_array (ACE_CDR::Double *x, ACE_CDR::ULong length) |
ACE_CDR::Boolean | read_longdouble_array (ACE_CDR::LongDouble* x, ACE_CDR::ULong length) |
|
ACE_CDR::Boolean | skip_boolean (void) |
ACE_CDR::Boolean | skip_char (void) |
ACE_CDR::Boolean | skip_wchar (void) |
ACE_CDR::Boolean | skip_octet (void) |
ACE_CDR::Boolean | skip_short (void) |
ACE_CDR::Boolean | skip_ushort (void) |
ACE_CDR::Boolean | skip_long (void) |
ACE_CDR::Boolean | skip_ulong (void) |
ACE_CDR::Boolean | skip_longlong (void) |
ACE_CDR::Boolean | skip_ulonglong (void) |
ACE_CDR::Boolean | skip_float (void) |
ACE_CDR::Boolean | skip_double (void) |
ACE_CDR::Boolean | skip_longdouble (void) |
Protected Attributes |
ACE_Message_Block | start_ |
| The start of the chain of message blocks, even though in the current version the chain always has length 1.
|
int | do_byte_swap_ |
| The CDR stream byte order does not match the one on the machine, swapping is needed while reading.
|
int | good_bit_ |
| set to 0 when an error occurs.
|
ACE_Char_Codeset_Translator* | char_translator_ |
| If not nil, invoke for translation of character and string data.
|
ACE_WChar_Codeset_Translator* | wchar_translator_ |
Private Methods |
ACE_CDR::Boolean | read_1 (ACE_CDR::Octet *x) |
ACE_CDR::Boolean | read_2 (ACE_CDR::UShort *x) |
ACE_CDR::Boolean | read_4 (ACE_CDR::ULong *x) |
ACE_CDR::Boolean | read_8 (ACE_CDR::ULongLong *x) |
ACE_CDR::Boolean | read_16 (ACE_CDR::LongDouble *x) |
ACE_CDR::Boolean | read_array (void* x, size_t size, size_t align, ACE_CDR::ULong length) |
void | rd_ptr (size_t offset) |
| Move the rd_ptr ahead by <offset> bytes.
|
char* | end (void) |
| Points to the continuation field of the current message block.
|
Private Attributes |
ACE_CDR::Octet | major_version_ |
ACE_CDR::Octet | minor_version_ |
Friends |
class | ACE_Char_Codeset_Translator |
class | ACE_WChar_Codeset_Translator |
This class is based on the the CORBA spec for Java (98-02-29), java class omg.org.CORBA.portable.InputStream. It diverts in a few ways: + Operations to retrieve basic types take parameters by reference. + 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).