本文整理汇总了C++中corba::Any::delegate方法的典型用法代码示例。如果您正苦于以下问题:C++ Any::delegate方法的具体用法?C++ Any::delegate怎么用?C++ Any::delegate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::Any
的用法示例。
在下文中一共展示了Any::delegate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dump_value
bool UnionTypeCode::dump_value (TIDorb::core::cdr::CDRInputStream& input,
ostream& output) const
{
CORBA::Any discriminator;
discriminator.delegate().read_value(input, m_discriminator_type, true);
output << "[VALUE]{union " << m_name << " discriminator: ";
discriminator.delegate().dump(output);
CORBA::Long index = search_member_index(discriminator);
if (index == -1) {
return true; // default constructed union
}
if ((index < 0) || (index >= m_members->length())) {
throw CORBA::MARSHAL();
}
TypeCodeImpl* tc = (TypeCodeImpl*)((CORBA::TypeCode_ptr)(*m_members)[index].type);
if(index == m_default_used)
output << " /default/ ";
output << ((*m_members)[index]).name << " -> " ;
if (!tc->dump_value(input, output))
return false;
output << '}';
return true;
}
示例2:
CORBA::Long UnionTypeCode::search_member_index
(const CORBA::Any& discriminator) const
{
CORBA::ULong length = m_members->length();
CORBA::Any* disc;
for (CORBA::ULong i = 0; i < length; i++) {
disc = &(((*m_members)[i]).label);
if( discriminator.delegate() == disc->delegate())
return i;
}
return m_default_used;
}
示例3: MARSHAL
void UnionTypeCode::remarshal_value
(TIDorb::core::cdr::CDRInputStream& input,
TIDorb::core::cdr::CDROutputStream& output) const
{
CORBA::Any discriminator;
discriminator.delegate().read_value(input, m_discriminator_type, true);
discriminator.delegate().write_value(output);
CORBA::Long index = search_member_index(discriminator);
if (index == -1) {
return; // default constructed union
}
if ((index < 0) || (index >= m_members->length())) {
throw CORBA::MARSHAL();
}
TypeCodeImpl* tc = (TypeCodeImpl*)((CORBA::TypeCode_ptr)(*m_members)[index].type);
tc->remarshal_value(input, output);
}