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


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

本文整理汇总了C++中GiSTentry::SetLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ GiSTentry::SetLevel方法的具体用法?C++ GiSTentry::SetLevel怎么用?C++ GiSTentry::SetLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GiSTentry的用法示例。


在下文中一共展示了GiSTentry::SetLevel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Reset

void 
GiSTnode::Unpack(const char *page)
{
    const GiSTheader *h = (const GiSTheader *) page;

    Reset();

    SetLevel(h->level);
    SetSibling(h->sibling);

    if (!packedNode)
	packedNode = new char[tree->Store()->PageSize()];
    memcpy(packedNode, page, tree->Store()->PageSize());

    Expand(h->numEntries);
    SetNumEntries(h->numEntries);

    for (int i=0; i<h->numEntries; i++) {
        GiSTcompressedEntry tmpentry = Entry(i);
	GiSTentry *e = CreateEntry();
	e->SetLevel(Level());
	e->SetPosition(i);
	e->SetNode(this);
	e->Decompress(tmpentry);
	// be tidy
	if (tmpentry.key)
	  delete tmpentry.key;

	// Append the body with the entry
	entries[i] = e;
    }
}
开发者ID:VoR0220,项目名称:fastdb,代码行数:32,代码来源:GiSTnode.cpp

示例2: NumEntries

// insert before the original number according to the sequence instead of index
void
MTnode::InsertBefore (const GiSTentry& newEntry, int index)
{
	int n = NumEntries ();
	assert (index>=0 && index<=n);

	BOOL bOrder = TRUE;
	if (index > 0) {
		bOrder = (*this)[index-1]->Compare(newEntry) <= 0;
	}
	if (index < n) {
		bOrder = bOrder && (*this)[index]->Compare(newEntry) >= 0;
	}

	if (bOrder) {  // yes, the position is right for this entry
		GiSTentry *entry = (GiSTentry *) newEntry.Copy ();
		entry->SetLevel(Level());
		entry->SetPosition(index);
		entry->SetNode(this);
		// Move everything else over
		for (int i=n; i>index; i--) {
			GiSTentry *e = (*this)[i-1];
			e->SetPosition(i);
			(*this)[i] = e;
		}
		// Stick the entry in
		(*this)[index] = entry;
		// Bump up the count
		SetNumEntries (n+1);
	} else {
		Insert (newEntry);  // find the right place
	}
}
开发者ID:jsc0218,项目名称:MxTree,代码行数:34,代码来源:MTnode.cpp

示例3: NumEntries

void 
GiSTnode::InsertBefore (const GiSTentry& entry, int index)
{
	assert (index <= NumEntries());
	GiSTentry *e = (GiSTentry*)entry.Copy();

	e->SetLevel (Level());
	e->SetPosition (index);
	e->SetNode (this);
	// Move everything else over
	for (int i=NumEntries(); i>index; i--) {
		GiSTentry *e = (*this)[i-1];
		e->SetPosition (i);
		(*this)[i] = e;
	}
	// Stick the entry in
	(*this)[index] = e;
	// Bump up the count
	numEntries++;
}
开发者ID:jsc0218,项目名称:MxTree,代码行数:20,代码来源:GiSTnode.cpp


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