本文整理汇总了C++中corba::TypeCode_var::member_label方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeCode_var::member_label方法的具体用法?C++ TypeCode_var::member_label怎么用?C++ TypeCode_var::member_label使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::TypeCode_var
的用法示例。
在下文中一共展示了TypeCode_var::member_label方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: in_cdr
//.........这里部分代码省略.........
break;
case CORBA::tk_enum:
{
TAO_OutputCDR cdr;
cdr.write_ulong ((CORBA::ULong) disc_val);
TAO_InputCDR in_cdr (cdr);
TAO::Unknown_IDL_Type *unk = 0;
ACE_NEW_RETURN (unk,
TAO::Unknown_IDL_Type (disc_tc.in (),
in_cdr),
-1);
disc_any.replace (unk);
break;
}
// @@@ (JP) I don't think ETCL handles 64-bit
// integers at this point, and I also think that
// chars and/or wchars will just come out in the
// constraint as (w)strings of length 1.
case CORBA::tk_longlong:
case CORBA::tk_ulonglong:
case CORBA::tk_char:
case CORBA::tk_wchar:
default:
return -1;
}
DynamicAny::DynAny_var dyn_any =
TAO::MakeDynAnyUtils::make_dyn_any_t<const CORBA::Any &> (
disc_tc.in (),
disc_any);
dyn_union.set_discriminator (dyn_any.in ());
DynamicAny::DynAny_var u_member =
dyn_union.member ();
this->current_member_ =
u_member->to_any ();
break;
}
case ETCL_STRING:
{
const char *name = (const char *) disc_val;
CORBA::ULong count =
tc->member_count ();
const char *member_name = 0;
CORBA::ULong i = 0;
for (i = 0; i < count; ++i)
{
member_name = tc->member_name (i);
if (ACE_OS::strcmp (name, member_name) == 0)
{
break;
}
}
// If there's no match, member_label will throw
// CORBA::TypeCode::Bounds and the catch block will
// return -1;
this->current_member_ = tc->member_label (i);
break;
}
// The TAO_ETCL_Union_Value that was put on the queue
// shouldn't have any other type.
default:
return -1;
}
ETCL_Constraint *nested = union_pos->component ();
// If there's no nested component, then we just want the
// union member value on the queue. Otherwise, we want
// the member value in current_member_ while we visit
// the nested component.
if (nested == 0)
{
TAO_ETCL_Literal_Constraint lit (this->current_member_.ptr ());
this->queue_.enqueue_head (lit);
return 0;
}
else
{
return nested->accept (this);
}
}
else
{
return -1;
}
}
catch (const CORBA::Exception&)
{
return -1;
}
}