本文整理汇总了C++中TAO_InputCDR::steal_contents方法的典型用法代码示例。如果您正苦于以下问题:C++ TAO_InputCDR::steal_contents方法的具体用法?C++ TAO_InputCDR::steal_contents怎么用?C++ TAO_InputCDR::steal_contents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAO_InputCDR
的用法示例。
在下文中一共展示了TAO_InputCDR::steal_contents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: in
void
TAO_ConstantDef_i::value_i (const CORBA::Any &value)
{
CORBA::TypeCode_var my_tc =
this->type_i ();
CORBA::TypeCode_var val_tc = value.type ();
CORBA::Boolean const equal_tc =
my_tc.in ()->equal (val_tc.in ());
if (!equal_tc)
{
return;
}
ACE_Message_Block *mb = 0;
TAO::Any_Impl *impl = value.impl ();
if (impl->encoded ())
{
TAO::Unknown_IDL_Type *unk =
dynamic_cast<TAO::Unknown_IDL_Type *> (impl);
mb = unk->_tao_get_cdr ().steal_contents ();
}
else
{
TAO_OutputCDR out;
impl->marshal_value (out);
TAO_InputCDR in (out);
mb = in.steal_contents ();
}
ACE_Auto_Ptr<ACE_Message_Block> safe (mb);
CORBA::TCKind kind = val_tc->kind ();
switch (kind)
{
// The data for these types will be aligned to an 8-byte
// boundary, while the rd_ptr may not.
case CORBA::tk_double:
case CORBA::tk_ulonglong:
case CORBA::tk_longlong:
case CORBA::tk_longdouble:
mb->rd_ptr (ACE_ptr_align_binary (mb->rd_ptr (),
ACE_CDR::MAX_ALIGNMENT));
break;
default:
break;
}
mb->crunch ();
this->repo_->config ()->set_binary_value (this->section_key_,
"value",
mb->base (),
mb->length ());
}