本文整理汇总了C++中GiSTentry::IsLeaf方法的典型用法代码示例。如果您正苦于以下问题:C++ GiSTentry::IsLeaf方法的具体用法?C++ GiSTentry::IsLeaf怎么用?C++ GiSTentry::IsLeaf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GiSTentry
的用法示例。
在下文中一共展示了GiSTentry::IsLeaf方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
int
RTpredicate::Consistent(const GiSTentry& entry) const
{
RTentry &rtentry = (RTentry &)entry;
if (entry.IsLeaf()) {
switch (oper) {
case RToverlap:
return(rtentry.Key().overlap((RTkey)value));
break;
case RTcontains:
return(rtentry.Key().contain((RTkey)value));
break;
case RTcontained:
return(rtentry.Key().contained((RTkey)value));
break;
case RTEqual:
return(rtentry.Key() == ((RTkey)value));
break;
case RTNotDisjoint:
return(!rtentry.Key().disjoint((RTkey)value));
break;
default:
assert(0);
return (0);
break;
}
}
else {
switch (oper) {
case RToverlap:
case RTcontained:
return(rtentry.Key().overlap((RTkey)value));
break;
case RTcontains:
case RTEqual:
return(rtentry.Key().contain(((RTkey)value)));
break;
case RTNotDisjoint:
return(!rtentry.Key().disjoint((RTkey)value));
break;
default:
assert(0);
return (0);
break;
}
}
}
示例2: while
GiSTentry*
GiSTcursor::Next()
{
GiSTpage page;
while (first || !stack.IsEmpty()) {
if (first) {
page = GiSTRootPage;
first = 0;
} else {
assert(lastlevel >= 0);
GiSTentry *entry = stack.RemoveFront();
if (entry->IsLeaf())
return entry;
// Pop off the stack
for (int i=0; i < entry->Level() - lastlevel; i++)
path.MakeParent();
page = entry->Ptr();
delete entry;
}
// Entry was a pointer to another node
path.MakeChild(page);
GiSTnode *node = gist.ReadNode(path);
lastlevel = node->Level();
GiSTlist<GiSTentry*> list = node->Search(*query);
while (!list.IsEmpty()) {
GiSTentry *entry = list.RemoveRear();
stack.Prepend(entry);
}
delete node;
}
// The search is over...
return NULL;
}
示例3: Consistent
int PtrPredicate::Consistent (const GiSTentry& entry) const
{
return !entry.IsLeaf() || entry.Ptr()==page;
}