本文整理汇总了C++中GiSTnode::Unpack方法的典型用法代码示例。如果您正苦于以下问题:C++ GiSTnode::Unpack方法的具体用法?C++ GiSTnode::Unpack怎么用?C++ GiSTnode::Unpack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GiSTnode
的用法示例。
在下文中一共展示了GiSTnode::Unpack方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadNode
GiSTnode* MXTree::ReadNode(const GiSTpath& path) const
{
char *firstBuffer = new char[store->PageSize()];
int startPage = (path.IsRoot() ? rootPage : path.Page());
store->Read(startPage, firstBuffer);
int pageNum = ceil((float)(((MXTnodeHeader *)firstBuffer)->numEntries*(EntrySize()+sizeof(GiSTpage))+sizeof(MXTnodeHeader))/(float)PAGE_SIZE);
GiSTnode *node = new MXTnode(pageNum);
node->SetTree((GiST *)this);
node->Path() = path;
if (pageNum > 1) {
char *buffer = new char[store->PageSize()*pageNum];
memset(buffer, 0, store->PageSize()*pageNum);
memcpy(buffer, firstBuffer, store->PageSize());
((MXTfile *)store)->Read(startPage+1, buffer+store->PageSize(), pageNum-1); // do the deed
node->Unpack(buffer);
delete[] buffer;
} else {
node->Unpack(firstBuffer);
}
delete[] firstBuffer;
return node;
}
示例2: NewNode
GiSTnode*
GiST::ReadNode (const GiSTpath& path) const
{
char *buf = new char[store->PageSize()];
GiSTnode *node = NewNode((GiST *)this);
store->Read(path.Page(), buf); // do the deed
node->Unpack(buf);
#ifdef PRINTING_OBJECTS
if (debug) {
cout << "READ PAGE " << path.Page() << ":\n";
node->Print(cout);
}
#endif
node->Path() = path;
delete []buf;
return node;
}