#ifndef MTPREDICATE_H #define MTPREDICATE_H #include "MTobject.h" //class GiSTentry; typedef enum { FUZZY_STANDARD, FUZZY_ALGEBRAIC } language; typedef enum { LINEAR, EXPONENTIAL, DISTR } dist2sim; extern language query_language; double Dist2Sim(double dist); double Sim2Dist(double sim); class MTpred: public GiSTobject { // the base class for predicates public: virtual GiSTobjid IsA() { return MTPREDICATE_CLASS; } ... }; class Pred: public MTpred { // a simple predicate public: ... GiSTobjid IsA() { return MTPREDICATE_CLASS; } ... }; class AndPred: public MTpred { // a conjunction of two predicates public: ... GiSTobjid IsA() { return MTPREDICATE_AND_CLASS; } ... }; class OrPred: public MTpred { // a disjunction of two predicates public: ... GiSTobjid IsA() { return MTPREDICATE_OR_CLASS; } ... }; class NotPred: public MTpred { // a negated predicate public: ... GiSTobjid IsA() { return MTPREDICATE_NOT_CLASS; } ... }; |
#ifndef GISTDEFS_H #define GISTDEFS_H #include <assert.h> #include <stdlib.h> #include <math.h> #ifdef PRINTING_OBJECTS #include <iostream.h> #endif typedef unsigned long GiSTpage; typedef enum { GISTOBJECT_CLASS, GIST_CLASS, BT_CLASS, RT_CLASS, MT_CLASS, GISTENTRY_CLASS, GISTNODE_CLASS, BTNODE_CLASS, BTENTRY_CLASS, BTKEY_CLASS, RTNODE_CLASS, RTENTRY_CLASS, RTKEY_CLASS, MTNODE_CLASS, MTENTRY_CLASS, MTKEY_CLASS, GISTPREDICATE_CLASS, BTPREDICATE_CLASS, RTPREDICATE_CLASS, MTPREDICATE_CLASS, MTPREDICATE_AND_CLASS, MTPREDICATE_OR_CLASS, MTPREDICATE_NOT_CLASS, GISTCURSOR_CLASS } GiSTobjid; // GiSTobject is the base class for all GiST classes // It provides identity, equality tests and display of objects class GiSTobject { ...}; |
virtual GiSTobjid IsA() { return GiSTobjid::MTPREDICATE_CLASS; }
#ifndef MTOBJECT_H #define MTOBJECT_H extern int compdists; extern int dimension; #ifndef MIN #define MIN(x, y) ((x<y)? (x): (y)) #define MAX(x, y) ((x>y)? (x): (y)) #endif #include <stdio.h> #include "GiSTdefs.h" class Object : public GiSTobject // the DB object class { public: ... #ifdef PRINTING_OBJECTS void Print(ostream& os) const; #endif }; ... #endif |
|
|