Beispiel #1
0
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;
}
Beispiel #2
0
void 
GiST::DumpNode (ostream& os, GiSTpath path) const
{
	GiSTnode *node = ReadNode(path);
	node->Print(os);

	if (!node->IsLeaf()) {
		TruePredicate truePredicate;
		GiSTlist<GiSTentry*> list = node->Search(truePredicate);

		while (!list.IsEmpty()) {
			GiSTentry *e = list.RemoveFront();
			path.MakeChild(e->Ptr());
			DumpNode (os, path);
			path.MakeParent();
			delete e;
		}
	}
	delete node;
}