本文整理汇总了C++中TAO_InputCDR::get_version方法的典型用法代码示例。如果您正苦于以下问题:C++ TAO_InputCDR::get_version方法的具体用法?C++ TAO_InputCDR::get_version怎么用?C++ TAO_InputCDR::get_version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAO_InputCDR
的用法示例。
在下文中一共展示了TAO_InputCDR::get_version方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new_mb
void
TAO::Unknown_IDL_Type::_tao_decode (TAO_InputCDR & cdr)
{
// @@ (JP) The following code depends on the fact that
// TAO_InputCDR does not contain chained message blocks,
// otherwise <begin> and <end> could be part of
// different buffers!
// This will be the start of a new message block.
char const * const begin = cdr.rd_ptr ();
// Skip over the next argument.
TAO::traverse_status const status =
TAO_Marshal_Object::perform_skip (this->type_, &cdr);
if (status != TAO::TRAVERSE_CONTINUE)
{
throw ::CORBA::MARSHAL ();
}
// This will be the end of the new message block.
char const * const end = cdr.rd_ptr ();
// The ACE_CDR::mb_align() call can shift the rd_ptr by up to
// ACE_CDR::MAX_ALIGNMENT - 1 bytes. Similarly, the offset adjustment
// can move the rd_ptr by up to the same amount. We accommodate
// this by including 2 * ACE_CDR::MAX_ALIGNMENT bytes of additional
// space in the message block.
size_t const size = end - begin;
ACE_Message_Block new_mb (size + 2 * ACE_CDR::MAX_ALIGNMENT);
ACE_CDR::mb_align (&new_mb);
ptrdiff_t offset = ptrdiff_t (begin) % ACE_CDR::MAX_ALIGNMENT;
if (offset < 0)
{
offset += ACE_CDR::MAX_ALIGNMENT;
}
new_mb.rd_ptr (offset);
new_mb.wr_ptr (offset + size);
ACE_OS::memcpy (new_mb.rd_ptr (), begin, size);
this->cdr_.reset (&new_mb, cdr.byte_order ());
this->cdr_.char_translator (cdr.char_translator ());
this->cdr_.wchar_translator (cdr.wchar_translator ());
this->cdr_.set_repo_id_map (cdr.get_repo_id_map ());
this->cdr_.set_codebase_url_map (cdr.get_codebase_url_map ());
this->cdr_.set_value_map (cdr.get_value_map ());
// Take over the GIOP version, the input cdr can have a different
// version then our current GIOP version.
ACE_CDR::Octet major_version;
ACE_CDR::Octet minor_version;
cdr.get_version (major_version, minor_version);
this->cdr_.set_version (major_version, minor_version);
}