… | |
… | |
76 | BAL_G_HYPERPL=1, |
76 | BAL_G_HYPERPL=1, |
77 | BALANCED=2 |
77 | BALANCED=2 |
78 | } s_function; // split functions |
78 | } s_function; // split functions |
79 | |
79 | |
80 | class MT : public GiST { |
80 | class MT : public GiST { |
|
|
81 | unsigned int page; |
81 | public: |
82 | public: |
|
|
83 | MT(unsigned int pagesize) : page(pagesize) {}; |
82 | // optional, for debugging support |
84 | // optional, for debugging support |
83 | GiSTobjid IsA() { return MT_CLASS; } |
85 | GiSTobjid IsA() { return MT_CLASS; } |
84 | |
86 | |
85 | int IsOrdered() const { return 1; } // the children of each node are ordered on increasing distances from the parent |
87 | int IsOrdered() const { return 1; } // the children of each node are ordered on increasing distances from the parent |
86 | int MaxLevel() const; // height of the M-tree |
88 | int MaxLevel() const; // height of the M-tree |
… | |
… | |
97 | friend MTentry *MTcursor::FetchNode(); |
99 | friend MTentry *MTcursor::FetchNode(); |
98 | |
100 | |
99 | protected: |
101 | protected: |
100 | // Required members |
102 | // Required members |
101 | GiSTnode *CreateNode() const { return new MTnode; } |
103 | GiSTnode *CreateNode() const { return new MTnode; } |
102 | GiSTstore *CreateStore() const { return new MTfile; } |
104 | GiSTstore *CreateStore() const { return new MTfile(page); } |
103 | |
105 | |
104 | // Service methods for Bulk Load |
106 | // Service methods for Bulk Load |
105 | GiSTlist<char *> *SplitTree(int *ncreated, int level, GiSTlist<MTentry *> *children, char *name); // split this M-tree into a list of M-trees whose names are returned |
107 | GiSTlist<char *> *SplitTree(int *ncreated, int level, GiSTlist<MTentry *> *children, char *name); // split this M-tree into a list of M-trees whose names are returned |
106 | void Append(MTnode *to, MTnode *from); // append the sub-tree of node from to node to |
108 | void Append(MTnode *to, MTnode *from); // append the sub-tree of node from to node to |
107 | private: |
109 | private: |