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);
83  r_GMarray(const r_GMarray &);
85 
88 
90  virtual ~r_GMarray();
91 
93  virtual void r_deactivate();
94 
96  r_GMarray &operator=(const r_GMarray &);
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 
110  const r_Storage_Layout *get_storage_layout() const;
112  const r_Minterval &spatial_domain() const;
114  char *get_array();
116  const char *get_array() const;
120  const r_Set<r_GMarray *> *get_tiled_array() const;
122  r_Bytes get_array_size() const;
124  r_Bytes get_type_length() 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 *);
152  void set_tiled_array(r_Set<r_GMarray *> *newData);
154  void set_array_size(r_Bytes);
156  void set_type_length(r_Bytes);
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
mddtypes.hh
r_GMarray::r_deactivate
virtual void r_deactivate()
it is called when an object leaves transient memory (internal use only)
r_GMarray::get_array_size
r_Bytes get_array_size() const
get size of internal array representation in byets
r_Object::transaction
r_Transaction * transaction
pointer to the transaction this object belongs to.
Definition: object.hh:232
r_Band_Iterator
This class abstracts away iteration over the cells of a (multi-band) array.
Definition: banditerator.hh:46
r_GMarray::insert_obj_into_db
virtual void insert_obj_into_db()
inserts an object into the database
r_GMarray::get_storage_layout
const r_Storage_Layout * get_storage_layout() const
gets a pointer to the storage layout object
r_GMarray::get_type_length
r_Bytes get_type_length() const
get length of cell type in bytes
r_GMarray::get_cell_linearization
r_Cell_Linearization get_cell_linearization() const
r_GMarray::~r_GMarray
virtual ~r_GMarray()
destructor
r_GMarray::get_array
char * get_array()
get the internal representation of the array
r_GMarray::band_linearization
r_Band_Linearization band_linearization
relevant if data has multiple bands (channels) of data
Definition: gmarray.hh:209
minterval.hh
r_GMarray::tiled_data
r_Set< r_GMarray * > * tiled_data
array internally sub-tiled
Definition: gmarray.hh:194
r_GMarray::set_band_linearization
void set_band_linearization(r_Band_Linearization)
set band linearization to pixel-interleaved or channel-interleaved in case of multi-band array
r_GMarray::storage_layout
r_Storage_Layout * storage_layout
pointer to storage layout object
Definition: gmarray.hh:206
r_GMarray::get_base_type_schema
const r_Base_Type * get_base_type_schema()
get base type schema
r_GMarray::set_array_size
void set_array_size(r_Bytes)
set size of internal memory representation in bytes
r_Bytes
size_t r_Bytes
number of bytes in an tile or mdd or type.
Definition: mddtypes.hh:43
r_GMarray::domain
r_Minterval domain
spatial domain
Definition: gmarray.hh:188
r_GMarray::set_cell_linearization
void set_cell_linearization(r_Cell_Linearization)
set cell linearization. Only ColumnMajor is supported currently.
r_Base_Type
This class is the superclass of the types r_Structure_Type and r_Primitive_Type in the representation...
Definition: basetype.hh:39
r_GMarray::set_array
void set_array(char *)
set the internal representation of the array
r_GMarray::spatial_domain
const r_Minterval & spatial_domain() const
getting the spatial domain
r_Data_Format
r_Data_Format
\begin{tabular}{ll} <tt>r_Array</tt> && no compression, row-major memory representation\...
Definition: mddtypes.hh:93
r_GMarray::set_storage_layout
void set_storage_layout(r_Storage_Layout *)
sets the storage layout object and checks compatibility with the domain
r_GMarray::operator=
r_GMarray & operator=(const r_GMarray &)
assignment: cleanup + copy
banditerator.hh
r_GMarray::data_size
r_Bytes data_size
size of internal array representation in bytes
Definition: gmarray.hh:197
set.hh
r_Array
@ r_Array
Definition: mddtypes.hh:95
r_Point
Class r_Point represents an n-dimensional point vector.
Definition: point.hh:42
r_GMarray::set_spatial_domain
void set_spatial_domain(const r_Minterval &domain)
set spatial domain
r_GMarray::current_format
r_Data_Format current_format
store current data format
Definition: gmarray.hh:203
r_Set< r_GMarray * >
r_Transaction
Transactions can be started, committed, aborted, and checkpointed.
Definition: transaction.hh:49
r_GMarray::print_status
virtual void print_status(std::ostream &s)
writes the state of the object to the specified stream
r_GMarray::get_tiled_array
r_Set< r_GMarray * > * get_tiled_array()
get the internal representation of the array
r_Band_Linearization::PixelInterleaved
@ PixelInterleaved
The components of each pixel are layed out one after another, e.g.
r_Object
Through inheritance of this class, the type definer specifies that the subclass is capable of having ...
Definition: object.hh:61
r_Cell_Linearization::ColumnMajor
@ ColumnMajor
Linearize cells of first column, then second column, and so on.
r_GMarray
The class represents a generic MDD in the sense that it is independent of the cell base type.
Definition: gmarray.hh:65
r_GMarray::set_current_format
void set_current_format(r_Data_Format)
set current data format
r_GMarray::cell_linearization
r_Cell_Linearization cell_linearization
cell linearization.
Definition: gmarray.hh:213
r_GMarray::get_band_linearization
r_Band_Linearization get_band_linearization() const
r_Band_Linearization
r_Band_Linearization
Indicate how multiband data is linearized in 1D space.
Definition: mddtypes.hh:397
object.hh
r_Minterval
The spatial domain of an MDD is represented by an object of class r_Minterval.
Definition: minterval.hh:225
r_GMarray::data
char * data
pointer to the internal array representation
Definition: gmarray.hh:191
r_GMarray::intersect
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_GMarray::get_current_format
r_Data_Format get_current_format() const
get current data format
r_GMarray::get_band_iterator
r_Band_Iterator get_band_iterator(unsigned int band)
get a band iterator
r_GMarray::set_tiled_array
void set_tiled_array(r_Set< r_GMarray * > *newData)
set the internal representation of the array
r_Cell_Linearization
r_Cell_Linearization
Linearization of cells from nD to 1D space.
Definition: mddtypes.hh:412
r_Storage_Layout
The r_Storage_Layout class is used to express the storage options for r_Marray objects.
Definition: storagelayout.hh:60
r_GMarray::set_type_length
void set_type_length(r_Bytes)
set length of cell type in bytes
r_GMarray::r_GMarray
r_GMarray(r_Transaction *transaction=NULL)
default constructor (no memory is allocated!)
r_GMarray::type_length
r_Bytes type_length
length of the cell base type in bytes
Definition: gmarray.hh:200
r_GMarray::operator[]
const char * operator[](const r_Point &) const
subscript operator for read access of a cell.