rasdaman complete source
hierindexds.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 /
33 #ifndef _HIERINDEXDS_HH_
34 #define _HIERINDEXDS_HH_
35 
36 #include "indexmgr/indexds.hh"
37 
50 class HierIndexDS : public IndexDS
51 {
52 public:
53  HierIndexDS():IndexDS() {}
54 
55  HierIndexDS(const OId& id):IndexDS(id) {}
56 
57  virtual double getOccupancy() const = 0;
58  /*@Doc:
59  Return the relative occupancy of this index.
60  For flat indexes return 0.
61  Not implemented.
62  */
63 
64  virtual HierIndexDS* getParent() const = 0;
65  /*@Doc:
66  Returns a newly constructed HierIndexDS pointer to this
67  object`s parent.
68  */
69 
70  virtual void setParent(const HierIndexDS* newPa) = 0;
71  /*@Doc:
72  Sets the parent node of this object to newPa.
73  */
74 
75  virtual void setIsNode(bool beNode) = 0;
76  /*@Doc:
77  When set to false, this index will behave as a leaf.
78  When set to true, this index will behave as a node.
79  */
80 
81  virtual bool isLeaf() const = 0;
82  /*@Doc:
83  If true this index contains objects which are stored in the index.
84  If false this index contains index nodes.
85  */
86 
87  virtual bool isRoot() const = 0;
88  /*@Doc:
89  If true this object is the root node.
90  */
91 
92  virtual unsigned int getHeight() const = 0;
93  /*@Doc:
94  Returns the height of this subtree.
95  Returns the complete height when called by the root node.
96  */
97 
98  virtual unsigned int getTotalEntryCount() const = 0;
99  /*@Doc:
100  Get number of entries in leafs of the subtree.
101  Returns the number of all entries in the tree
102  when called by the root node.
103  */
104 
105  virtual unsigned int getTotalNodeCount() const = 0;
106  /*@Doc:
107  Get number of nodes in the tree.
108  Returns the number of all nodes in the tree
109  when called by the root node.
110  I do not count myself.
111  */
112 
113  virtual unsigned int getTotalLeafCount() const = 0;
114  /*@Doc:
115  Get number of leafs in this subtree.
116  Returns the number of all leafes in the tree
117  when called by the root node.
118  I do count myself -> I am a leaf, I return 1.
119  */
120 
121 };
122 
123 #endif
Definition: hierindexds.hh:50