gistobserver.h
来自「此文件包含了在linux下实现tpr-tree索引的源代码」· C头文件 代码 · 共 91 行
H
91 行
// -*- Mode: C++ -*-//--------------------------------------------------------------------// GiSTobserver.h// --------------//// GiST - Generalized Search Tree // June 2001 release, Aalborg University// // This file is a revised version of a part of the original // libGiST release (version 0.9beta1) // Copyright (c) 1996, Regents of the University of California//#ifndef GISTOBSERVER_H#define GISTOBSERVER_H#include "GiSTdefs.h"#include "GiSTentry.h"#include "GiSTnode.h"#include "GiSTpredicate.h"//------------------------------------------------// Observer notification codes (parameters of Inform in comments)//enum TNotification{ ON_CREATE, ON_OPEN, ON_CLOSE, ON_INSERTSTART, ON_INSERTEND, ON_WRITENODE, // node ON_OVERFLOWTSTART, ON_OVERFLOWTEND, ON_REMOVETOP, // entry list ON_DELETESTART, ON_DELETEEND, ON_SHORTENTREE, // node (new root, the child of the old) ON_DEALOCATE, // node ON_CONDENSETREESTART, ON_CONDENSETREEEND, ON_CHOOSESUBTREESTART, ON_CHOOSENODE, // entry1, entry2, page ON_CHOOSESUBTREEEND, ON_SPLIT, // node1, node2 ON_SPLITSTART, // node ON_NEWROOT, // node (new root, one level higher) ON_SEARCH, // predicate ON_SEARCHEND, ON_SEARCHNODE = 75, // number of qualifying entries, number of all entries, level ON_SEARCHMINPENALTY // entry};class GiST;//------------------------------------------------// GiSTobserverclass GiSTobserver : public GiSTobject{public: GiSTobjid IsA () const { return GISTOBSERVER_CLASS; } void SetGiST(GiST* gist) { tree = gist; } GiST* GetGiST() { return tree; } // GiST calls Inform when something is going on virtual void Inform (TNotification nc) {} virtual void Inform (TNotification nc, const GiSTentry& entry) {} virtual void Inform (TNotification nc, const GiSTentry& entry1, const GiSTentry& entry2, GiSTpage page) {} virtual void Inform (TNotification nc, GiSTlist<GiSTentry*>& elist) {} virtual void Inform (TNotification nc, const GiSTnode& node) {} virtual void Inform (TNotification nc, const GiSTnode& node1, const GiSTnode& node2) {} virtual void Inform (TNotification nc, int qual, int total, int level) {} virtual void Inform (TNotification nc, GiSTpage page, int level) {} virtual void Inform (TNotification nc, const GiSTpredicate& pred) {}protected: // Giving the ability for the derived classes to access the arbitrary // part of the tree being observed GiSTnode *ReadNode (const GiSTpath& path) const; GiSTnode *CreateNode() const;private: GiST* tree; // tree being observed};#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?