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
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 
125 
127 
128 
129  //@Man: Write methods
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:
169 
171  char* data;
172 
175 
178 
181 
184 };
185 
186 #include "rasodmg/gmarray.icc"
187 
188 #endif
const r_GMarray & operator=(const r_GMarray &)
assignment: cleanup + copy
void set_spatial_domain(const r_Minterval &domain)
set spatial domain
Definition: error.hh:312
Definition: basetype.hh:47
Definition: point.hh:59
Definition: error.hh:88
const char * operator[](const r_Point &) const
subscript operator for read access of a cell
virtual void print_status(std::ostream &s=std::cout) const
writes the state of the object to the specified stream
Definition: error.hh:281
void set_current_format(r_Data_Format)
set current data format
r_Bytes type_length
length of the cell base type in bytes
Definition: gmarray.hh:177
r_GMarray * intersect(r_Minterval where) const
Returns a r_GMarray that is the intersection of the current domain with the specified interval...
char * data
pointer to the internal array representation
Definition: gmarray.hh:171
const r_Minterval & spatial_domain() const
getting the spatial domain
const r_Storage_Layout * get_storage_layout() const
gets a pointer to the storage layout object
void set_type_length(r_Bytes)
set length of cell type in bytes
r_Data_Format get_current_format() const
get current data format
r_Bytes get_type_length() const
get length of cell type in bytes
Definition: object.hh:64
r_Data_Format
Definition: mddtypes.hh:133
Definition: gmarray.hh:66
r_GMarray()
default constructor (no memory is allocated!)
virtual void insert_obj_into_db()
inserts an object into the database
Definition: storagelayout.hh:70
r_Bytes get_array_size() const
get size of internal array representation in byets
virtual void r_deactivate()
it is called when an object leaves transient memory (internal use only)
virtual ~r_GMarray()
destructor
unsigned int r_Bytes
Definition: mddtypes.hh:56
char * get_array()
get the internal representation of the array
r_Storage_Layout * storage_layout
pointer to storage layout object
Definition: gmarray.hh:183
void set_array_size(r_Bytes)
set size of internal memory representation in bytes
r_Minterval domain
spatial domain
Definition: gmarray.hh:168
void set_array(char *)
set the internal representation of the array
const r_Base_Type * get_base_type_schema()
get base type schema
r_Bytes data_size
size of internal array representation in bytes
Definition: gmarray.hh:174
void set_storage_layout(r_Storage_Layout *)
sets the storage layout object and checks compatibility with the domain
r_Data_Format current_format
store current data format
Definition: gmarray.hh:180
Definition: minterval.hh:249