rasdaman API
gmarray.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 _D_GMARRAY_
34 #define _D_GMARRAY_
35 
36 #include "rasodmg/object.hh"
37 
38 #include "raslib/error.hh"
39 #include "raslib/minterval.hh"
40 #include "raslib/point.hh"
41 #include "raslib/type.hh"
42 #include "raslib/mddtypes.hh"
43 
44 #include <iostream>
45 
46 // forward declarations
47 class r_Storage_Layout;
48 
49 
50 //@ManMemo: Module: {\bf rasodmg}
51 
52 /*@Doc:
53 
54  The class represents a generic MDD in the sense that it
55  is independent of the cell base type. The only information
56  available is the length in bytes of the base type.
57  More specific MDDs including base type information for more
58  type safety are represented by the template subclass \Ref{r_Marray}.
59  Class \Ref{r_Marray} provides a constructor to convert to the base
60  type specific class.
61 */
62 
66 class r_GMarray : public r_Object
67 {
68 public:
70  r_GMarray() throw(r_Error);
71 
73  r_GMarray(const r_Minterval& init_domain, r_Bytes type_length, r_Storage_Layout* stl = 0) throw (r_Error);
82  r_GMarray(const r_GMarray&) throw(r_Error);
84 
86  r_GMarray(r_GMarray&) throw(r_Error);
87 
89  virtual ~r_GMarray();
90 
92  virtual void r_deactivate();
93 
95  const r_GMarray& operator= (const r_GMarray&);
96 
98  const char* operator[](const r_Point&) const
99  throw(r_Edim_mismatch, r_Eindex_violation);
100 
102  r_GMarray* intersect(r_Minterval where) const;
103 
104  //@Man: Read methods
106 
109  const r_Storage_Layout* get_storage_layout() const;
111  inline const r_Minterval& spatial_domain() const;
113  inline char* get_array();
115  inline const char* get_array() const;
117  inline r_Bytes get_array_size() const;
119  inline r_Bytes get_type_length() const;
121  inline r_Data_Format get_current_format() const;
122 
124  const r_Base_Type* get_base_type_schema();
125 
127 
128 
129  //@Man: Write methods
131  void set_storage_layout(r_Storage_Layout *) throw (r_Error);
135  inline void set_spatial_domain(const r_Minterval& domain);
137  inline void set_array(char*);
139  inline void set_array_size(r_Bytes);
141  inline void set_type_length(r_Bytes);
143  inline void set_current_format(r_Data_Format);
144 
146 
147 
148  //@Man: Methods for database communication (internal use only)
150 
153  virtual void insert_obj_into_db();
155  void insert_obj_into_db(const char* collName);
156 
158 
159 
161  virtual void print_status(std::ostream& s = std::cout) const;
162 
164  void print_status(std::ostream& s, int hexoutput) const;
165 
166 protected:
168  r_Minterval domain;
169 
171  char* data;
172 
174  r_Bytes data_size;
175 
177  r_Bytes type_length;
178 
180  r_Data_Format current_format;
181 
183  r_Storage_Layout* storage_layout;
184 };
185 
186 #include "rasodmg/gmarray.icc"
187 
188 #endif