本文整理汇总了C++中TAO_OutputCDR::consolidate方法的典型用法代码示例。如果您正苦于以下问题:C++ TAO_OutputCDR::consolidate方法的具体用法?C++ TAO_OutputCDR::consolidate怎么用?C++ TAO_OutputCDR::consolidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAO_OutputCDR
的用法示例。
在下文中一共展示了TAO_OutputCDR::consolidate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: in
bool
recursive_union_test ()
{
bool rc = true;
ACE_DEBUG ((LM_INFO,
"Executing recursive union test\n"));
ACE_DEBUG ((LM_INFO,
"* Simple marshaling -> demarshaling\n"));
{
CORBA::Any the_any, the_out_any;
static CORBA::Short const test_short = 23901;
Test::RecursiveUnion3 foo3;
foo3.a (test_short);
the_any <<= foo3;
TAO_OutputCDR out;
out << the_any;
out.consolidate ();
if (TAO_debug_level >= 2)
{
if (out.length () > 512)
{
ACE_HEX_DUMP ((LM_INFO, out.buffer (), 512, ACE_TEXT ("Encoded union (1):")));
ACE_HEX_DUMP ((LM_INFO, out.buffer ()+512, out.length ()-512, ACE_TEXT ("Encoded union (2):")));
}
else
{
ACE_HEX_DUMP ((LM_INFO, out.buffer (), out.length (), ACE_TEXT ("Encoded union:")));
}
}
TAO_InputCDR in(out);
if (TAO_debug_level >= 1)
ACE_DEBUG ((LM_INFO,
"> Extracting any\n"));
in >> the_out_any;
if (TAO_debug_level >= 1)
ACE_DEBUG ((LM_INFO,
"> Extracted any\n"));
}
// Any's typecode out of scope
if (TAO_debug_level >= 1)
ACE_DEBUG ((LM_INFO,
"> Any destructed\n"));
ACE_DEBUG ((LM_INFO,
"* Marshaling -> demarshaling with external reference\n"));
{
CORBA::TypeCode_var tc;
{
CORBA::Any the_any, the_out_any;
static CORBA::Short const test_short = 23901;
Test::RecursiveUnion3 foo3;
foo3.a (test_short);
the_any <<= foo3;
TAO_OutputCDR out;
out << the_any;
out.consolidate ();
if (TAO_debug_level >= 2)
{
if (out.length () > 512)
{
ACE_HEX_DUMP ((LM_INFO, out.buffer (), 512, ACE_TEXT ("Encoded union (1):")));
ACE_HEX_DUMP ((LM_INFO, out.buffer ()+512, out.length ()-512, ACE_TEXT ("Encoded union (2):")));
}
else
{
ACE_HEX_DUMP ((LM_INFO, out.buffer (), out.length (), ACE_TEXT ("Encoded union:")));
}
}
TAO_InputCDR in(out);
if (TAO_debug_level >= 1)
ACE_DEBUG ((LM_INFO,
"> Extracting any\n"));
in >> the_out_any;
tc = the_out_any._tao_get_typecode ()->member_type (1); // union case type -> alias
tc = tc->content_type (); // alias content type -> sequence
tc = tc->content_type (); // sequence content type -> recursive struct
//.........这里部分代码省略.........