本文整理汇总了C++中TAO_OutputCDR::align_write_ptr方法的典型用法代码示例。如果您正苦于以下问题:C++ TAO_OutputCDR::align_write_ptr方法的具体用法?C++ TAO_OutputCDR::align_write_ptr怎么用?C++ TAO_OutputCDR::align_write_ptr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAO_OutputCDR
的用法示例。
在下文中一共展示了TAO_OutputCDR::align_write_ptr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
CORBA::Boolean
TAO_ChunkInfo::reserve_chunk_size(TAO_OutputCDR &strm)
{
// This is called in the start_chunk().
// Reserve the chunk size the first time the start_chunk () is called
// if there are several start_chunk () called continuously without
// calling end_chunk (). This could happen in the _tao_marshal_state()
// in the most derived valuetype.
if (this->chunk_size_pos_ == 0)
{
// Align the wr_ptr before we reserve the space for chunk size.
strm.align_write_ptr (ACE_CDR::LONG_SIZE);
// Remember begin of the chunk (at chunk size position) that is needed
// when we write back actual chunk size to the stream.
this->chunk_size_pos_ = strm.current ()->wr_ptr ();
// Insert four bytes here as a place-holder, we need to go back
// later and write the actual size.
if (! strm.write_long (0))
{
return 0;
}
// Remember length before writing chunk data. This is used to calculate
// the actual size of the chunk.
this->length_to_chunk_octets_pos_ = strm.total_length ();
}
return 1;
}
示例2: INTERNAL
CORBA::Boolean
CORBA::ValueBase::_tao_write_repository_id (TAO_OutputCDR &strm,
ACE_CString& id)
{
#ifdef TAO_HAS_VALUETYPE_OUT_INDIRECTION
VERIFY_MAP (TAO_OutputCDR, repo_id_map, Repo_Id_Map);
char* pos = 0;
if (strm.get_repo_id_map ()->get()->find (id, pos) == 0)
{
if (!strm.write_long (TAO_OBV_GIOP_Flags::Indirection_tag))
{
return false;
}
CORBA::Long offset= -strm.offset (pos);
if (TAO_debug_level)
{
TAOLIB_DEBUG ((LM_DEBUG,
ACE_TEXT ("TAO (%P|%t) - %N:%l ValueBase::_tao_write_repository_id, id %C indirection %d\n"),
id.c_str(), offset));
}
if (!strm.write_long (offset))
{
return false;
}
}
else
{
if (strm.align_write_ptr (ACE_CDR::LONG_SIZE) != 0)
{
throw CORBA::INTERNAL ();
}
if (strm.get_repo_id_map ()->get ()->bind (id, strm.current()->wr_ptr ()) != 0)
{
throw CORBA::INTERNAL ();
}
if (TAO_debug_level)
{
TAOLIB_DEBUG ((LM_DEBUG,
ACE_TEXT ("TAO (%P|%t) - %N:%l ValueBase::_tao_write_repository_id, bound %C - %x\n"),
id.c_str (), strm.current()->wr_ptr ()));
}
if (! strm.write_string (id.c_str ()))
{
return false;
}
}
#else
if (! strm.write_string (id.c_str ()))
{
return 0;
}
#endif
return 1;
}