A CDR stream for reading, i.e. for demarshalling. More...
#include <CDR.h>
A CDR stream for reading, i.e. for demarshalling.
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). 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.
Definition at line 311 of file CDR.h.
typedef ACE_Hash_Map_Manager<void*, ACE_CString, ACE_Null_Mutex> TAO_InputCDR::Repo_Id_Map |
typedef ACE_Hash_Map_Manager<void*, void*, ACE_Null_Mutex> TAO_InputCDR::Value_Map |
TAO_InputCDR::TAO_InputCDR | ( | const char * | buf, | |
size_t | bufsiz, | |||
int | byte_order = ACE_CDR_BYTE_ORDER , |
|||
ACE_CDR::Octet | major_version = TAO_DEF_GIOP_MAJOR , |
|||
ACE_CDR::Octet | minor_version = TAO_DEF_GIOP_MINOR , |
|||
TAO_ORB_Core * | orb_core = 0 | |||
) |
Create an input stream from an arbitrary buffer, care must be exercised wrt alignment, because this contructor will *not* work if the buffer is unproperly aligned.
Definition at line 131 of file CDR.inl.
: ACE_InputCDR (buf, bufsiz, byte_order, major_version, minor_version), orb_core_ (orb_core) { }
TAO_InputCDR::TAO_InputCDR | ( | size_t | bufsiz, | |
int | byte_order = ACE_CDR_BYTE_ORDER , |
|||
ACE_CDR::Octet | major_version = TAO_DEF_GIOP_MAJOR , |
|||
ACE_CDR::Octet | minor_version = TAO_DEF_GIOP_MINOR , |
|||
TAO_ORB_Core * | orb_core = 0 | |||
) |
Create an empty input stream. The caller is responsible for putting the right data and providing the right alignment.
Definition at line 147 of file CDR.inl.
: ACE_InputCDR (bufsiz, byte_order, major_version, minor_version), orb_core_ (orb_core) { }
TAO_InputCDR::TAO_InputCDR | ( | const ACE_Message_Block * | data, | |
int | byte_order = ACE_CDR_BYTE_ORDER , |
|||
ACE_CDR::Octet | major_version = TAO_DEF_GIOP_MAJOR , |
|||
ACE_CDR::Octet | minor_version = TAO_DEF_GIOP_MINOR , |
|||
TAO_ORB_Core * | orb_core = 0 | |||
) |
Create an input stream from an ACE_Message_Block.
Definition at line 161 of file CDR.inl.
: ACE_InputCDR (data, byte_order, major_version, minor_version), orb_core_ (orb_core) { }
TAO_InputCDR::TAO_InputCDR | ( | const ACE_Message_Block * | data, | |
ACE_Lock * | lock, | |||
int | byte_order = ACE_CDR_BYTE_ORDER , |
|||
ACE_CDR::Octet | major_version = TAO_DEF_GIOP_MAJOR , |
|||
ACE_CDR::Octet | minor_version = TAO_DEF_GIOP_MINOR , |
|||
TAO_ORB_Core * | orb_core = 0 | |||
) |
Create an input stream from an ACE_Message_Block with an optional lock used to protect the data.
Definition at line 175 of file CDR.inl.
: ACE_InputCDR (data, byte_order, major_version, minor_version, lock), orb_core_ (orb_core) { }
TAO_InputCDR::TAO_InputCDR | ( | ACE_Data_Block * | data, | |
ACE_Message_Block::Message_Flags | flag = 0 , |
|||
int | byte_order = ACE_CDR_BYTE_ORDER , |
|||
ACE_CDR::Octet | major_version = TAO_DEF_GIOP_MAJOR , |
|||
ACE_CDR::Octet | minor_version = TAO_DEF_GIOP_MINOR , |
|||
TAO_ORB_Core * | orb_core = 0 | |||
) |
Create an input stream from an ACE_Data_Block.
Definition at line 191 of file CDR.inl.
: ACE_InputCDR (data, flag, byte_order, major_version, minor_version), orb_core_ (orb_core) { }
TAO_InputCDR::TAO_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 = TAO_DEF_GIOP_MAJOR , |
|||
ACE_CDR::Octet | minor_version = TAO_DEF_GIOP_MINOR , |
|||
TAO_ORB_Core * | orb_core = 0 | |||
) |
Create an input stream from an ACE_Data_Block.
Definition at line 208 of file CDR.inl.
: ACE_InputCDR (data, flag, rd_pos, wr_pos, byte_order, major_version, minor_version), orb_core_ (orb_core) { }
TAO_InputCDR::TAO_InputCDR | ( | const TAO_InputCDR & | rhs | ) |
Make a copy of the current stream state, but does not copy the internal buffer; so the same stream can be read multiple times efficiently.
Definition at line 249 of file CDR.inl.
: ACE_InputCDR (rhs), orb_core_ (rhs.orb_core_), repo_id_map_ (rhs.repo_id_map_), codebase_map_ (rhs.codebase_map_), value_map_ (rhs.value_map_) { }
TAO_InputCDR::TAO_InputCDR | ( | const TAO_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.
Definition at line 229 of file CDR.inl.
: ACE_InputCDR (rhs, size, offset), orb_core_ (rhs.orb_core_) { }
TAO_InputCDR::TAO_InputCDR | ( | const TAO_InputCDR & | rhs, | |
size_t | size | |||
) |
This creates an encapsulated stream, the first byte must be (per the spec) the byte order of the encapsulation. The default values for the allocators in this constructor are not 0, but are generated by the ORB. Refer to the constructor body in CDR.cpp for the code that supplies these values to the base class constructor.
Definition at line 240 of file CDR.inl.
: ACE_InputCDR (rhs, size), orb_core_ (rhs.orb_core_) { }
TAO_InputCDR::TAO_InputCDR | ( | const TAO_OutputCDR & | rhs, | |
ACE_Allocator * | buffer_allocator = 0 , |
|||
ACE_Allocator * | data_block_allocator = 0 , |
|||
ACE_Allocator * | message_block_allocator = 0 , |
|||
TAO_ORB_Core * | orb_core = 0 | |||
) |
Create an input CDR from an output CDR.
Definition at line 298 of file CDR.cpp.
: ACE_InputCDR (rhs, buffer_allocator ? buffer_allocator : (orb_core ? orb_core->output_cdr_buffer_allocator () : 0), data_block_allocator ? data_block_allocator : (orb_core ? orb_core->output_cdr_dblock_allocator () : 0), message_block_allocator ? message_block_allocator : (orb_core ? orb_core->output_cdr_msgblock_allocator () : 0)), orb_core_ (orb_core) { }
TAO_InputCDR::TAO_InputCDR | ( | ACE_InputCDR::Transfer_Contents | rhs, | |
TAO_ORB_Core * | orb_core = 0 | |||
) |
Initialize the contents of one CDR from another, without data copying and with minimimum locking overhead.
Definition at line 259 of file CDR.inl.
: ACE_InputCDR (rhs), orb_core_ (orb_core) { }
ACE_Message_Block::Message_Flags TAO_InputCDR::clr_mb_flags | ( | ACE_Message_Block::Message_Flags | less_flags | ) |
Definition at line 370 of file CDR.cpp.
{ return start_.clr_self_flags( less_flags ); }
TAO_InputCDR::Codebase_URL_Map_Handle & TAO_InputCDR::get_codebase_url_map | ( | ) |
Definition at line 286 of file CDR.inl.
{ return this->codebase_map_; }
TAO_InputCDR::Repo_Id_Map_Handle & TAO_InputCDR::get_repo_id_map | ( | ) |
These methods are used by valuetype indirection support. Accessor to the indirect maps.
Definition at line 280 of file CDR.inl.
{ return this->repo_id_map_; }
TAO_InputCDR::Value_Map_Handle & TAO_InputCDR::get_value_map | ( | ) |
Definition at line 292 of file CDR.inl.
{ return this->value_map_; }
TAO_ORB_Core * TAO_InputCDR::orb_core | ( | void | ) | const |
void TAO_InputCDR::reset_vt_indirect_maps | ( | ) |
If indirect map is not nil and not empty, unbind all entries. Called after demarshalling.
Definition at line 316 of file CDR.inl.
{ if (! this->repo_id_map_.is_nil () && this->repo_id_map_->get()->current_size () != 0) { this->repo_id_map_->get()->unbind_all (); } if (! this->codebase_map_.is_nil () && this->codebase_map_->get()->current_size () != 0) { this->codebase_map_->get()->unbind_all (); } if (! this->value_map_.is_nil () && this->value_map_->get()->current_size () != 0) { this->value_map_->get()->unbind_all (); } }
void TAO_InputCDR::set_codebase_url_map | ( | TAO_InputCDR::Codebase_URL_Map_Handle & | map | ) |
Definition at line 304 of file CDR.inl.
{ this->codebase_map_ = map; }
void TAO_InputCDR::set_repo_id_map | ( | TAO_InputCDR::Repo_Id_Map_Handle & | map | ) |
Updater of the maps. These updaters are used to make indirect maps in original stream take effect even during marshalling/demarshalling a redirected stream.
Definition at line 298 of file CDR.inl.
{ this->repo_id_map_ = map; }
void TAO_InputCDR::set_value_map | ( | TAO_InputCDR::Value_Map_Handle & | map | ) |
Definition at line 310 of file CDR.inl.
{ this->value_map_ = map; }
void TAO_InputCDR::throw_skel_exception | ( | int | error_num | ) | [static] |
Definition at line 343 of file CDR.cpp.
{ switch (error_num) { case 0 : break; case EINVAL : // wchar from a GIOP 1.0 throw ::CORBA::MARSHAL(CORBA::OMGVMCID | 5, CORBA::COMPLETED_NO); ACE_NOTREACHED(break); case EACCES : // wchar but no codeset throw ::CORBA::BAD_PARAM(CORBA::OMGVMCID | 23, CORBA::COMPLETED_NO); ACE_NOTREACHED(break); #if (ERANGE != EINVAL) case ERANGE : // untranslatable character throw ::CORBA::DATA_CONVERSION(CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO); ACE_NOTREACHED(break); #endif default : throw ::CORBA::MARSHAL(); } }
void TAO_InputCDR::throw_stub_exception | ( | int | error_num | ) | [static] |
Definition at line 320 of file CDR.cpp.
{ switch (error_num) { case 0 : break; case EINVAL : // wchar from a GIOP 1.0 throw ::CORBA::MARSHAL (CORBA::OMGVMCID | 6, CORBA::COMPLETED_YES); ACE_NOTREACHED(break); #if (ERANGE != EINVAL) case ERANGE : // untranslatable character throw ::CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 1, CORBA::COMPLETED_YES); ACE_NOTREACHED(break); #endif case EACCES : // wchar but no codeset throw ::CORBA::INV_OBJREF (CORBA::OMGVMCID | 2, CORBA::COMPLETED_YES); ACE_NOTREACHED(break); default : throw ::CORBA::MARSHAL (0, CORBA::COMPLETED_YES); } }
TAO_ORB_Core* TAO_InputCDR::orb_core_ [private] |
Repo_Id_Map_Handle TAO_InputCDR::repo_id_map_ [private] |
Value_Map_Handle TAO_InputCDR::value_map_ [private] |