本文整理汇总了C++中CConstraint::IsConstraintUnbounded方法的典型用法代码示例。如果您正苦于以下问题:C++ CConstraint::IsConstraintUnbounded方法的具体用法?C++ CConstraint::IsConstraintUnbounded怎么用?C++ CConstraint::IsConstraintUnbounded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConstraint
的用法示例。
在下文中一共展示了CConstraint::IsConstraintUnbounded方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PcnstrConjunction
//---------------------------------------------------------------------------
// @function:
// CConstraintConjunction::Pcnstr
//
// @doc:
// Return constraint on a given column
//
//---------------------------------------------------------------------------
CConstraint *
CConstraintConjunction::Pcnstr
(
IMemoryPool *mp,
const CColRef *colref
)
{
// all children referencing given column
CConstraintArray *pdrgpcnstrCol = m_phmcolconstr->Find(colref);
if (NULL == pdrgpcnstrCol)
{
return NULL;
}
CConstraintArray *pdrgpcnstr = GPOS_NEW(mp) CConstraintArray(mp);
const ULONG length = pdrgpcnstrCol->Size();
for (ULONG ul = 0; ul < length; ul++)
{
// the part of the child that references this column
CConstraint *pcnstrCol = (*pdrgpcnstrCol)[ul]->Pcnstr(mp, colref);
if (NULL == pcnstrCol || pcnstrCol->IsConstraintUnbounded())
{
CRefCount::SafeRelease(pcnstrCol);
continue;
}
pdrgpcnstr->Append(pcnstrCol);
}
return CConstraint::PcnstrConjunction(mp, pdrgpcnstr);
}
示例2: Pcnstr
//---------------------------------------------------------------------------
// @function:
// CPartConstraint::FCanNegate
//
// @doc:
// Check whether or not the current part constraint can be negated. A part
// constraint can be negated only if it has constraints on the first level
//
//---------------------------------------------------------------------------
BOOL
CPartConstraint::FCanNegate() const
{
// first level cannot be NULL
if (NULL == Pcnstr(0))
{
return false;
}
// all levels after the first must be unconstrained
for (ULONG ul = 1; ul < m_num_of_part_levels; ul++)
{
CConstraint *pcnstr = Pcnstr(ul);
if (NULL == pcnstr || !pcnstr->IsConstraintUnbounded())
{
return false;
}
}
return true;
}