📄 gistobserver.h
字号:
// -*- 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -