当前位置: 首页>>代码示例>>C++>>正文


C++ GiSTentry::IsLeaf方法代码示例

本文整理汇总了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;
    }
  }
}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:49,代码来源:RTpredicate.cpp

示例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;
}
开发者ID:VoR0220,项目名称:fastdb,代码行数:43,代码来源:GiSTcursor.cpp

示例3: Consistent

int PtrPredicate::Consistent (const GiSTentry& entry) const
{
	return !entry.IsLeaf() || entry.Ptr()==page;
}
开发者ID:jsc0218,项目名称:MxTree,代码行数:4,代码来源:GiSTpredicate.cpp


注:本文中的GiSTentry::IsLeaf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。