本文整理汇总了C++中GiSTentry::IsA方法的典型用法代码示例。如果您正苦于以下问题:C++ GiSTentry::IsA方法的具体用法?C++ GiSTentry::IsA怎么用?C++ GiSTentry::IsA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GiSTentry
的用法示例。
在下文中一共展示了GiSTentry::IsA方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: e
void
BTnode::InsertBefore(const GiSTentry& entry, int index)
{
// Only BTentry's can be inserted into BTnodes.
assert(entry.IsA() == BTENTRY_CLASS);
BTentry e((const BTentry&) entry);
// If this is an internal node, adjust the lower/upper bounds
if (!IsLeaf()) {
// If not leftmost entry...
if (index != 0) {
// -inf changes to the upper bound of previous item
BTentry *prev = (BTentry*) (*this)[index-1].Ptr();
if (e.LowerBound() == NegInf)
e.SetLowerBound(prev->UpperBound());
}
// If not rightmost entry...
if (index != NumEntries()) {
// +inf changes to the lower bound of next item
BTentry *next = (BTentry*) (*this)[index].Ptr();
if (e.UpperBound() == PosInf)
e.SetUpperBound(next->LowerBound());
}
}
// Insert it into the node
GiSTnode::InsertBefore(e, index);
}
示例2: assert
void
BTnode::Insert(const GiSTentry &entry)
{
// Only BTentry's can be inserted into BTnode's.
assert(entry.IsA() == BTENTRY_CLASS);
// This doesn't work for internal nodes. For internal nodes,
// the caller must know exactly where to insert.
assert(IsLeaf());
GiSTnode::Insert(entry);
}