rasdaman client API  10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
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 #include "rasodmg/set.hh"
38 #include "raslib/minterval.hh"
39 #include "raslib/mddtypes.hh"
40 #include "raslib/banditerator.hh"
41 #include <iosfwd>
42 #include <vector>
43 
44 // forward declarations
45 class r_Storage_Layout;
46 class r_Point;
47 class r_Base_Type;
48 class r_Transaction;
49 
50 //@ManMemo: Module: {\bf rasodmg}
51 
65 class r_GMarray : public r_Object
66 {
67 public:
70 
72  r_GMarray(const r_Minterval &init_domain, r_Bytes type_length, r_Storage_Layout *stl = 0,
73  r_Transaction *transaction = NULL, bool initialize = true);
84  r_GMarray(const r_GMarray &);
85 
88 
90  virtual ~r_GMarray();
91 
93  virtual void r_deactivate();
94 
97 
100  const char *operator[](const r_Point &) const;
101 
103  r_GMarray *intersect(const r_Minterval &where) const;
104 
105  //@Man: Read methods
107 
112  const r_Minterval &spatial_domain() const;
114  char *get_array();
116  const char *get_array() const;
127 
130 
132  r_Band_Iterator get_band_iterator(unsigned int band);
133 
138 
140 
141 
142  //@Man: Write methods
150  void set_array(char *);
164 
166 
167 
168  //@Man: Methods for database communication (internal use only)
170 
173  virtual void insert_obj_into_db();
175  void insert_obj_into_db(const char *collName);
176 
178 
179 
181  virtual void print_status(std::ostream &s);
182 
184  void print_status(std::ostream &s, int hexoutput);
185 
186 protected:
189 
191  char *data{NULL};
192 
195 
198 
201 
204 
207 
210 
214 };
215 
216 #endif
This class abstracts away iteration over the cells of a (multi-band) array.
Definition: banditerator.hh:47
This class is the superclass of the types r_Structure_Type and r_Primitive_Type in the representation...
Definition: basetype.hh:40
The class represents a generic MDD in the sense that it is independent of the cell base type.
Definition: gmarray.hh:66
r_Band_Linearization band_linearization
relevant if data has multiple bands (channels) of data
Definition: gmarray.hh:209
const char * get_array() const
get the internal representation of the array for reading
r_Bytes get_type_length() const
get length of cell type in bytes
r_Bytes get_array_size() const
get size of internal array representation in byets
r_Storage_Layout * storage_layout
pointer to storage layout object
Definition: gmarray.hh:206
const r_Minterval & spatial_domain() const
getting the spatial domain
r_GMarray & operator=(const r_GMarray &)
assignment: cleanup + copy
virtual ~r_GMarray()
destructor
void set_cell_linearization(r_Cell_Linearization)
set cell linearization. Only ColumnMajor is supported currently.
void set_spatial_domain(const r_Minterval &domain)
set spatial domain
r_Bytes data_size
size of internal array representation in bytes
Definition: gmarray.hh:197
void set_type_length(r_Bytes)
set length of cell type in bytes
r_Data_Format current_format
store current data format
Definition: gmarray.hh:203
r_GMarray(const r_Minterval &init_domain, r_Bytes type_length, r_Storage_Layout *stl=0, r_Transaction *transaction=NULL, bool initialize=true)
constructor for uninitialized MDD objects
r_Bytes type_length
length of the cell base type in bytes
Definition: gmarray.hh:200
char * get_array()
get the internal representation of the array
char * data
pointer to the internal array representation
Definition: gmarray.hh:191
void print_status(std::ostream &s, int hexoutput)
writes the state of the object to the specified stream
const r_Base_Type * get_base_type_schema()
get base type schema
const r_Set< r_GMarray * > * get_tiled_array() const
get the internal representation of the array for reading
const char * operator[](const r_Point &) const
subscript operator for read access of a cell.
r_Data_Format get_current_format() const
get current data format
r_Minterval domain
spatial domain
Definition: gmarray.hh:188
virtual void r_deactivate()
it is called when an object leaves transient memory (internal use only)
void set_array_size(r_Bytes)
set size of internal memory representation in bytes
r_Set< r_GMarray * > * get_tiled_array()
get the internal representation of the array
void insert_obj_into_db(const char *collName)
insert myself into a specific collection in the database
r_GMarray(r_Transaction *transaction=NULL)
default constructor (no memory is allocated!)
r_GMarray(r_GMarray &)
constructor which doesn't copy the data
virtual void insert_obj_into_db()
inserts an object into the database
void set_current_format(r_Data_Format)
set current data format
r_Band_Linearization get_band_linearization() const
void set_band_linearization(r_Band_Linearization)
set band linearization to pixel-interleaved or channel-interleaved in case of multi-band array
r_Set< r_GMarray * > * tiled_data
array internally sub-tiled
Definition: gmarray.hh:194
virtual void print_status(std::ostream &s)
writes the state of the object to the specified stream
void set_storage_layout(r_Storage_Layout *)
sets the storage layout object and checks compatibility with the domain
r_Band_Iterator get_band_iterator(unsigned int band)
get a band iterator
r_GMarray(const r_GMarray &)
If a storage layout pointer is provided, the object refered to is taken and memory control moves to t...
r_Cell_Linearization get_cell_linearization() const
void set_tiled_array(r_Set< r_GMarray * > *newData)
set the internal representation of the array
const r_Storage_Layout * get_storage_layout() const
gets a pointer to the storage layout object
r_GMarray * intersect(const r_Minterval &where) const
Returns a r_GMarray that is the intersection of the current domain with the specified interval.
r_Cell_Linearization cell_linearization
cell linearization.
Definition: gmarray.hh:213
void set_array(char *)
set the internal representation of the array
The spatial domain of an MDD is represented by an object of class r_Minterval.
Definition: minterval.hh:226
Through inheritance of this class, the type definer specifies that the subclass is capable of having ...
Definition: object.hh:62
r_Transaction * transaction
pointer to the transaction this object belongs to.
Definition: object.hh:232
Class r_Point represents an n-dimensional point vector.
Definition: point.hh:43
The r_Storage_Layout class is used to express the storage options for r_Marray objects.
Definition: storagelayout.hh:61
Transactions can be started, committed, aborted, and checkpointed.
Definition: transaction.hh:50
r_Band_Linearization
Indicate how multiband data is linearized in 1D space.
Definition: mddtypes.hh:398
@ PixelInterleaved
The components of each pixel are layed out one after another, e.g.
size_t r_Bytes
number of bytes in an tile or mdd or type.
Definition: mddtypes.hh:43
r_Data_Format
\begin{tabular}{ll} <tt>r_Array</tt> && no compression, row-major memory representation\...
Definition: mddtypes.hh:94
@ r_Array
Definition: mddtypes.hh:95
r_Cell_Linearization
Linearization of cells from nD to 1D space.
Definition: mddtypes.hh:413
@ ColumnMajor
Linearize cells of first column, then second column, and so on.