rasdaman base DBMS
dbstoragelayout.hh
Go to the documentation of this file.
1 #ifndef _DBSTORAGELAYOUT_HH_
2 #define _DBSTORAGELAYOUT_HH_
3 
4 #include <string>
5 #include <vector>
7 #include "reladminif/dbobject.hh"
8 #include "reladminif/dbref.hh"
9 
10 class DBStorageLayout;
11 template<class T> class DBRef;
13 
14 /*
15 * This file is part of rasdaman community.
16 *
17 * Rasdaman community is free software: you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation, either version 3 of the License, or
20 * (at your option) any later version.
21 *
22 * Rasdaman community is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
29 *
30 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
31 rasdaman GmbH.
32 *
33 * For more information please see <http://www.rasdaman.org>
34 * or contact Peter Baumann via <baumann@rasdaman.com>.
35 */
36 
37 /****************************************************************************
38  *
39  *
40  * COMMENTS:
41  *
42  ****************************************************************************/
43 
44 //@ManMemo: Module: {\bf relstorageif}
45 /*@Doc:
46  Each instance of the {\tt DBStorageLayout} class describes a physical
47  storage layout for an MDD object or collection.
48  Every storage parameter which is not defined using the proper set* methods will result in a default value to be returned. the supports* methods will tell if the value is a default value defined at instantiation time through the static storagemgr/StorageLayout attributes or an explicitly defined value.
49  For information on the meaning of these attributes refere to storagemgr/storagelayout
50 */
59 class DBStorageLayout : public DBObject
60 {
61 public:
62  //@Man: Creation
64 
67 
69 
70  void printStatus(unsigned int level = 0,std::ostream& stream = std::cout) const;
71 
72  //@Man: check operations
74  bool supportsTileSize() const;
75 
76  bool supportsPCTMin() const;
77 
78  bool supportsPCTMax() const;
79 
80  bool supportsIndexSize() const;
81 
82  bool supportsIndexType() const;
83 
84  bool supportsTilingScheme() const;
85 
86  //is checked by OId::INVALID on tilingConfiguration
87  bool supportsTileConfiguration() const;
88 
89  bool supportsDataFormat() const;
91 
92  //@Man: Get operations
94 
95  r_Bytes getPCTMin() const;
96 
97  r_Bytes getPCTMax() const;
98 
99  unsigned int getIndexSize() const;
100 
101  r_Index_Type getIndexType() const;
102 
103  r_Tiling_Scheme getTilingScheme() const;
104 
105  r_Bytes getTileSize() const;
106 
107  r_Minterval getTileConfiguration() const;
108 
109  r_Data_Format getDataFormat() const;
110 
112 
113  //@Man: Set operations
115 
116  void setPCTMin(r_Bytes bytes);
117 
118  void setPCTMax(r_Bytes bytes);
119 
120  void setIndexSize(unsigned int entries);
121 
122  void setIndexType(r_Index_Type it);
123 
124  void setTilingScheme(r_Tiling_Scheme ts);
125 
126  void setTileSize(r_Bytes ts);
127 
128  void setTileConfiguration(const r_Minterval& tc);
129 
130  void setDataFormat(r_Data_Format df);
131 
133 
134 
135  //@Man: Destruction
140 
141 protected:
142  DBStorageLayout(const OId& id) throw (r_Error);
143 
144  friend class ObjectBroker;
145 
146  //@Man: Operations
148 
149  virtual void readFromDb() throw (r_Error);
150 
151  virtual void insertInDb() throw (r_Error);
152 
153  virtual void deleteFromDb() throw (r_Error);
154 
155  virtual void updateInDb() throw (r_Error);
156 
157 
159 
160 private:
161 
162  //@Man: Actual Parameters:
164 
166  // char* stName;
167 
168  //@Man: Index Structure:
170  r_Index_Type indexType;
172 
173  unsigned int indexSize;
175 
176  //@Man: Tiling:
178  r_Tiling_Scheme tilingScheme;
180 
181  r_Bytes pctMin;
182 
183  r_Bytes pctMax;
184 
186  r_Bytes tileSize;
187 
189  DBMintervalId tileConfiguration;
196 
197  //@Man: DataFormat
199  r_Data_Format dataFormat;
202 
204  bool _supportsTileSize;
205 
206  bool _supportsPCTMin;
207 
208  bool _supportsPCTMax;
209 
210  bool _supportsIndexSize;
211 
212  bool _supportsIndexType;
213 
214  bool _supportsTiling;
215 
216  bool _supportsDataFormat;
217 
218  bool _supportsTileConfiguration;
219 };
220 
221 #endif
Definition: dbstoragelayout.hh:59
void setPCTMax(r_Bytes bytes)
bool supportsIndexSize() const
void setTileSize(r_Bytes ts)
bool supportsTilingScheme() const
void printStatus(unsigned int level=0, std::ostream &stream=std::cout) const
r_Bytes getPCTMin() const
virtual void updateInDb()
bool supportsPCTMax() const
bool supportsTileConfiguration() const
r_Index_Type getIndexType() const
r_Data_Format getDataFormat() const
r_Bytes getPCTMax() const
Definition: objectbroker.hh:71
bool supportsPCTMin() const
r_Tiling_Scheme getTilingScheme() const
Definition: oidif.hh:67
virtual void readFromDb()
bool supportsTileSize() const
void setTilingScheme(r_Tiling_Scheme ts)
void setDataFormat(r_Data_Format df)
void setPCTMin(r_Bytes bytes)
bool supportsIndexType() const
unsigned int getIndexSize() const
DBStorageLayout()
Construct object that uses system defaults.
r_Bytes getTileSize() const
virtual void insertInDb()
bool supportsDataFormat() const
void setIndexType(r_Index_Type it)
void setTileConfiguration(const r_Minterval &tc)
DBRef< DBStorageLayout > DBStorageLayoutId
Definition: dbstoragelayout.hh:11
void setIndexSize(unsigned int entries)
virtual void deleteFromDb()
Definition: dbobject.hh:29
Definition: dbobject.hh:54
r_Minterval getTileConfiguration() const