本文整理汇总了C++中corba::TypeCode_var::length方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeCode_var::length方法的具体用法?C++ TypeCode_var::length怎么用?C++ TypeCode_var::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::TypeCode_var
的用法示例。
在下文中一共展示了TypeCode_var::length方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
// Get the length from the (possibly aliased) typecode.
CORBA::ULong
TAO_DynArray_i::get_tc_length (CORBA::TypeCode_ptr tc)
{
CORBA::TypeCode_var tctmp = CORBA::TypeCode::_duplicate (tc);
CORBA::TCKind kind = tctmp->kind ();
while (kind == CORBA::tk_alias)
{
tctmp = tctmp->content_type ();
kind = tctmp->kind ();
}
return tctmp->length ();
}
示例2: lit
int
TAO_Log_Constraint_Visitor::visit_special (ETCL_Special *special)
{
try
{
CORBA::TypeCode_var tc = this->current_member_->type ();
switch (special->type ())
{
case ETCL_LENGTH:
{
// If the TCKind is not a sequence or an array, the
// call to length() will raise an exception, and the
// catch block will return -1;
CORBA::ULong length = tc->length ();
TAO_ETCL_Literal_Constraint lit (length);
this->queue_.enqueue_head (lit);
return 0;
}
case ETCL_DISCRIMINANT:
{
// If the TCKind is not a union, the
// call to init() will raise an exception, and the
// catch block will return -1;
TAO_DynUnion_i dyn_union;
dyn_union.init (this->current_member_.in ());
DynamicAny::DynAny_var disc =
dyn_union.get_discriminator ();
CORBA::Any_var disc_any = disc->to_any ();
TAO_ETCL_Literal_Constraint lit (disc_any.ptr ());
this->queue_.enqueue_head (lit);
return 0;
}
case ETCL_TYPE_ID:
{
const char *name = tc->name ();
TAO_ETCL_Literal_Constraint lit (name);
this->queue_.enqueue_head (lit);
return 0;
}
case ETCL_REPOS_ID:
{
const char *id = tc->id ();
TAO_ETCL_Literal_Constraint lit (id);
this->queue_.enqueue_head (lit);
return 0;
}
default:
return -1;
}
}
catch (const CORBA::Exception&)
{
return -1;
}
}
示例3: analyze
//.........这里部分代码省略.........
if (debug_)
ACE_DEBUG ((LM_DEBUG,
"[%d]\n", i));
DynamicAny::DynAny_var cc (ds->current_component ());
if (!CORBA::is_nil (cc.in ()))
{
analyze (cc.in ());
}
i++;
} while (da->next ());
level_--;
}
}
}
break; // end tk_sequence
case CORBA::tk_array:
{
tab (level_);
if (debug_)
{
ACE_DEBUG ((LM_DEBUG,
"ARRAY\n"));
}
level_++;
CORBA::ULong const len =
dup->length ();
for (CORBA::ULong i = 0 ; i < len; ++i)
{
tab (level_);
if (debug_)
{
ACE_DEBUG ((LM_DEBUG, "[%d]\n", i));
}
DynamicAny::DynAny_var cc = da->current_component();
if (!CORBA::is_nil (cc.in ()))
{
analyze (cc.in ());
}
da->next ();
}
level_--;
}
break;
case CORBA::tk_union:
{
DynamicAny::DynUnion_var value =
DynamicAny::DynUnion::_narrow (da);
if (!value->has_no_active_member ())
{
DynamicAny::DynAny_var disc = value->member ();