本文整理汇总了C++中corba::TypeCode_var::equivalent方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeCode_var::equivalent方法的具体用法?C++ TypeCode_var::equivalent怎么用?C++ TypeCode_var::equivalent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::TypeCode_var
的用法示例。
在下文中一共展示了TypeCode_var::equivalent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_wchar_seq
CORBA::WCharSeq* DynArrayImpl::get_wchar_seq()
throw(DynamicAny::DynAny::TypeMismatch,
DynamicAny::DynAny::InvalidValue, CORBA::SystemException)
{
if (_destroyed)
{
throw CORBA::OBJECT_NOT_EXIST("DynAny destroyed");
}
CORBA::TypeCode_var type = get_component_type(0);
if (type->equivalent(CORBA::_tc_wchar))
{
return DynComposite::get_wchar_members();
}
else
{
return DynComposite::get_wchar_seq();
}
}
示例2:
CORBA::Boolean
TAO_DynSequence_i::equal (DynamicAny::DynAny_ptr rhs)
{
if (this->destroyed_)
{
throw ::CORBA::OBJECT_NOT_EXIST ();
}
CORBA::TypeCode_var tc = rhs->type ();
CORBA::Boolean equivalent = tc->equivalent (this->type_.in ());
if (!equivalent)
{
return false;
}
if (rhs->component_count () != this->component_count_)
{
return false;
}
DynamicAny::DynAny_var tmp;
CORBA::Boolean member_equal;
for (CORBA::ULong i = 0; i < this->component_count_; ++i)
{
rhs->seek (static_cast<CORBA::Long> (i));
tmp = rhs->current_component ();
// Recursive step.
member_equal = tmp->equal (this->da_members_[i].in ());
if (!member_equal)
{
return false;
}
}
return true;
}
示例3: INTERNAL
CORBA::Boolean
TAO_DynEnum_i::equal (DynamicAny::DynAny_ptr rhs)
{
CORBA::TypeCode_var tc = rhs->type ();
CORBA::Boolean equivalent = tc->equivalent (this->type_.in ());
if (!equivalent)
{
return false;
}
CORBA::Any_var any = rhs->to_any ();
TAO::Any_Impl *impl = any->impl ();
CORBA::ULong value;
if (impl->encoded ())
{
TAO::Unknown_IDL_Type * const unk =
dynamic_cast<TAO::Unknown_IDL_Type *> (impl);
if (!unk)
throw CORBA::INTERNAL ();
// We don't want unk's rd_ptr to move, in case we are shared by
// another Any, so we use this to copy the state, not the buffer.
TAO_InputCDR for_reading (unk->_tao_get_cdr ());
for_reading.read_ulong (value);
}
else
{
TAO_OutputCDR out;
impl->marshal_value (out);
TAO_InputCDR in (out);
in.read_ulong (value);
}
return value == this->value_;
}