本文整理汇总了C++中TAO_InputCDR::read_char_array方法的典型用法代码示例。如果您正苦于以下问题:C++ TAO_InputCDR::read_char_array方法的具体用法?C++ TAO_InputCDR::read_char_array怎么用?C++ TAO_InputCDR::read_char_array使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAO_InputCDR
的用法示例。
在下文中一共展示了TAO_InputCDR::read_char_array方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ACE_TMAIN
int ACE_TMAIN (int, ACE_TCHAR *[])
{
int status = 0;
for (CORBA::ULong i = 16; i != 64; ++i)
{
ACE_Message_Block mb (i + ACE_CDR::MAX_ALIGNMENT);
ACE_CDR::mb_align (&mb);
mb.wr_ptr (i);
CORBA::Double dbl = i;
TAO_OutputCDR cdr;
cdr.write_ulong (i); // length
cdr.write_octet_array_mb (&mb);
cdr.write_double (dbl);
cdr.write_double (dbl);
TAO_InputCDR input (cdr);
CORBA::ULong len;
input.read_ulong (len);
if (len != i)
{
ACE_DEBUG ((LM_DEBUG,
"ERROR: mismatched lengths,"
" got %d, expected %d\n",
len, i));
}
ACE_Message_Block read_mb (len + ACE_CDR::MAX_ALIGNMENT);
ACE_CDR::mb_align (&mb);
mb.wr_ptr (len);
input.read_char_array (mb.rd_ptr (), len);
CORBA::Double read_dbl;
if (input.read_double (read_dbl) == 0)
ACE_DEBUG ((LM_DEBUG, "Failure reading double...\n"));
if (!ACE::is_equal (read_dbl, dbl))
{
status = 1;
ACE_DEBUG ((LM_DEBUG,
"ERROR: mismatched doubles,"
" got %f, expected %f\n",
read_dbl, dbl));
for (const ACE_Message_Block *j = cdr.begin ();
j != cdr.end ();
j = j->cont ())
{
ACE_HEX_DUMP ((LM_DEBUG,
j->rd_ptr (),
j->length (),
ACE_TEXT("Output CDR stream")));
}
TAO_InputCDR debug (cdr);
ACE_HEX_DUMP ((LM_DEBUG,
debug.rd_ptr (),
debug.length (),
ACE_TEXT("Input CDR stream")));
}
}
return status;
}