rasdaman client API 10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
miter.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 /
18rasdaman GmbH.
19*
20* For more information please see <http://www.rasdaman.org>
21* or contact Peter Baumann via <baumann@rasdaman.com>.
22*/
23
24#ifndef D_MITER_HH
25#define D_MITER_HH
26
27#include "raslib/mddtypes.hh"
28#include "raslib/minterval.hh"
29
30//@ManMemo: Module: {\bf raslib}
48{
49public:
54 r_Miter(const r_Minterval *newAreaIter,
55 const r_Minterval *newAreaTile, r_Bytes newCellSize,
56 const char *newFirstCell);
59 void reset();
61 inline char *nextCell();
63 inline bool isDone();
64
65protected:
66 // structure storing information on iteration for each dimension
67 // (perhaps add dimension for reordering later)
69 {
70 r_Range repeat; // total number of repeats
71 int inc; // increment per repeat
72 int curr; // current repeat
73 };
75 const r_Minterval *areaIter{NULL};
77 const r_Minterval *areaTile{NULL};
79 const char *firstCell{NULL};
83 char *currCell{NULL};
87 int lowCount{};
89 bool done{false};
90};
91
92#include "miter.icc"
93
94#endif
The spatial domain of an MDD is represented by an object of class r_Minterval.
Definition minterval.hh:226
r_Miter is used for iterating through parts of multidimensional intervals.
Definition miter.hh:48
const char * firstCell
offset of first cell in tile.
Definition miter.hh:79
incArrElem * incArrIter
array with increments
Definition miter.hh:81
int lowCount
counter for position in lowest dimension.
Definition miter.hh:87
void reset()
resets iterator to first cell.
r_Bytes cellSize
size of base type.
Definition miter.hh:85
char * nextCell()
returns current cell and sets iterator to next cell.
bool done
flag set if iteration is finished.
Definition miter.hh:89
r_Miter(const r_Minterval *newAreaIter, const r_Minterval *newAreaTile, r_Bytes newCellSize, const char *newFirstCell)
The pointers are stored, do not delete the objects as long as the iterator is used!
const r_Minterval * areaTile
area of tile.
Definition miter.hh:77
char * currCell
current cell for iteration;
Definition miter.hh:83
bool isDone()
returns TRUE if iteration is finished.
const r_Minterval * areaIter
area to be iterated through
Definition miter.hh:75
std::int64_t r_Range
for axis indexing, e.g.
Definition mddtypes.hh:53
size_t r_Bytes
number of bytes in an tile or mdd or type.
Definition mddtypes.hh:43
Definition miter.hh:69
int inc
Definition miter.hh:71
int curr
Definition miter.hh:72
r_Range repeat
Definition miter.hh:70