rasdaman complete source
transdirix.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 _TRANSDIRIX_HH_
34 #define _TRANSDIRIX_HH_
35 
36 #include "indexmgr/indexds.hh"
37 #include "reladminif/lists.h"
38 
45 /*@Doc:
46 
47 A TransDirIx object is the data structure for an index of a transient MDD
48 object. It is to be used with DirIndexLogic.
49 A transient directory index keeps track of the current domain of the object.
50 It is a very simple structure, consisting of the current domain of the object
51 and a set of entries, one for each object belonging to the mdd object.
52 
53 For documentation on methods see IndexDS.
54 */
55 
56 class TransDirIx : public IndexDS
57 {
58 
59 public:
60 
61  TransDirIx(r_Dimension dim);
62  /*@Doc:
63  Creates a new transient index for an object with dimensionality
64  {\tt dim}.
65  */
66 
67  void printStatus(unsigned int level = 0, std::ostream& stream = std::cout) const;
68 
69  void insertObject(const KeyObject& newKeyObject, unsigned int pos);
70  /*@Doc:
71  Inserts a new tile in the index at position {\tt pos}, which must be
72  between 0 and {\tt getNumberElems()} (that is, {\tt pos } is
73  interpreted as an index in the new list. If {\tt pos} is getNumberElems(),
74  the element is put at the end of the list. All elements at following
75  positions are shifted to the right. The new tile to insert ({\tt newKeyObject})
76  must be transient (of type TransKeyObject). The current domain is updated.
77  */
78 
79  virtual void setObject(const KeyObject& theKey, unsigned int pos);
80 
81  virtual void setObjectDomain(const r_Minterval& dom, unsigned int pos);
82 
83  bool removeObject(unsigned int pos);
84 
85  bool removeObject(const KeyObject& theKey);
86 
87  virtual bool isValid() const;
88 
89  virtual bool isUnderFull() const;
90 
91  virtual bool isOverFull() const;
92 
93  virtual bool isSameAs(const IndexDS* pix) const;
94 
95  const KeyObject& getObject(unsigned int pos) const;
96 
97  r_Minterval getObjectDomain(unsigned int pos) const;
98 
99  DomainPVector* getObjectDomains() const;
100 
101  void getObjects(KeyObjectVector&) const;
102 
103  r_Minterval getCoveredDomain() const;
104 
105  r_Minterval getAssignedDomain() const;
106 
107  r_Dimension getDimension() const;
108 
109  void setAssignedDomain(const r_Minterval& domain);
110 
111  unsigned int getSize() const;
112 
113  r_Bytes getTotalStorageSize() const;
114 
115  bool isPersistent() const;
116 
117  virtual ~TransDirIx();
118  /*@Doc:
119  Destructor - deletes tiles from main memory.
120  */
121 
122  virtual unsigned int getOptimalSize() const;
123 
124  virtual void freeDS();
125  /*@Doc:
126  does not do anything - there is no persistent data structure
127  */
128 
129  virtual OId::OIdPrimitive getIdentifier() const;
130 
131  virtual IndexDS* getNewInstance() const;
132 private:
133 
134  r_Minterval currDomain;
142  KeyObjectVector tiles;
143 };
144 
145 
146 #endif
std::vector< KeyObject > KeyObjectVector
Definition: lists.h:79
Definition: keyobject.hh:43
std::vector< r_Minterval * > DomainPVector
Definition: lists.h:83
double OIdPrimitive
Definition: oidif.hh:102