本文整理汇总了C++中corba::Policy_var::length方法的典型用法代码示例。如果您正苦于以下问题:C++ Policy_var::length方法的具体用法?C++ Policy_var::length怎么用?C++ Policy_var::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::Policy_var
的用法示例。
在下文中一共展示了Policy_var::length方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
TAO_RT_POA::validate_priority (RTCORBA::Priority priority)
{
if (priority < RTCORBA::minPriority
// The line below will always be false unless the value of
// RTCORBA::maxPriority, which is now assigned the value of
// 32767, is changed in RTCORBA.pidl.
// || priority > RTCORBA::maxPriority
)
{
throw ::CORBA::BAD_PARAM ();
}
// If this POA is using a thread pool with lanes, make sure the
// priority matches one of the thread lanes. Note that in this
// case, bands do not matter since matching the lanes priority is a
// stricter condition than meeting the band ranges. In addition,
// when the POA was created, the bands had to match the lanes.
if (this->thread_pool_ != 0 && this->thread_pool_->with_lanes ())
{
TAO_Thread_Lane **lanes = this->thread_pool_->lanes ();
for (CORBA::ULong i = 0;
i != this->thread_pool_->number_of_lanes ();
++i)
{
if (lanes[i]->lane_priority () == priority)
return;
}
throw ::CORBA::BAD_PARAM ();
}
else
// Else we are dealing with a thread pool without lanes.
{
// Check if we have bands.
CORBA::Policy_var bands =
this->policies ().get_cached_policy (
TAO_CACHED_POLICY_RT_PRIORITY_BANDED_CONNECTION);
RTCORBA::PriorityBandedConnectionPolicy_var priority_bands
= RTCORBA::PriorityBandedConnectionPolicy::_narrow (bands.in ());
TAO_PriorityBandedConnectionPolicy *priority_bands_i =
dynamic_cast <TAO_PriorityBandedConnectionPolicy *>
(priority_bands.in ());
if (priority_bands_i)
{
// If we do have bands, make sure that the priority is
// matching one of the bands.
RTCORBA::PriorityBands &bands =
priority_bands_i->priority_bands_rep ();
for (CORBA::ULong i = 0;
i < bands.length ();
++i)
{
if (bands[i].low <= priority &&
bands[i].high >= priority)
return;
}
throw ::CORBA::BAD_PARAM ();
}
}
}