rasdaman complete source
storagelayout.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 _R_STORAGELAYOUT_HH_
34 #define _R_STORAGELAYOUT_HH_
35 
36 
37 #include <iostream>
38 using std::cout;
39 
40 #include "raslib/mddtypes.hh"
41 #include "rasodmg/set.hh"
42 
43 // forward declarations
44 class r_Storage_Layout;
45 class r_GMarray;
46 class ClientComm;
47 class r_Tiling;
48 class r_Minterval;
49 
50 //@ManMemo: Module: {\bf rasodmg}
51 
52 /*@Doc:
53 
54  The {\tt r_Storage_Layout} class is used to express the storage options
55  for {\tt r_Marray} objects. This is the superclass of different storage
56  layout classes which may be used for different types of storage layout
57  schemes. It is also used directly by the rasdaman client for
58  default storage layout, i.e., for the storage layout for objects for
59  which absolutely none has been defined.
60 
61  Notice: the tiling options are invalid if the rasdaman client is running
62  with the option notiling. In that case, no tiling is done,
63  independently of the storage layout chosen.
64  For the time being, compression does not work.
65 */
66 
70 class r_Storage_Layout
71 {
72 public:
73 
75  r_Storage_Layout(r_Data_Format init_format = r_Array, const char* formatParams = NULL);
76 
78  r_Storage_Layout(r_Tiling* ts, r_Data_Format init_format = r_Array, const char* formatParams = NULL);
79 
81  r_Storage_Layout(const r_Storage_Layout& sl);
82 
84  virtual r_Storage_Layout* clone() const;
85 
87  virtual ~r_Storage_Layout();
88 
90  const r_Tiling* get_tiling() const;
91 
93  r_Data_Format get_storage_format() const;
94 
96  const char* get_storage_format_params() const;
97 
99  virtual r_Set< r_GMarray* >* decomposeMDD(const r_GMarray* mar) const throw (r_Error);
100 
102  void print_status(std::ostream& s = cout) const;
103 
105  virtual bool is_compatible(const r_Minterval& obj_domain, r_Bytes celltypesize) const;
106 
107 protected:
108 
109  friend class ClientComm;
110  friend class r_GMArray;
111 
112  char* storage_params;
113 
115  r_Data_Format storage_format;
116 
118  r_Tiling* til;
119 
120 };
121 
122 //@ManMemo: Module: {\bf rasodmg }
126 extern std::ostream& operator<<(std::ostream& s, const r_Storage_Layout& sl);
127 
128 #if (defined(__VISUALC__) && !defined(__EXECUTABLE__))
129 #define __EXECUTABLE__
130 #include "raslib/dlist.hh"
131 #undef __EXECUTABLE__
132 #else
133 #include "raslib/dlist.hh"
134 #endif
135 #endif
template std::ostream & operator<<(const vector< KeyObject > &, std::ostream &)