rasdaman client API 10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
miterd.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 R_MITERD_HH
25#define R_MITERD_HH
26
27#include "raslib/mddtypes.hh"
28#include "raslib/odmgtypes.hh"
29
30#include <iosfwd>
31
32class r_Minterval;
34
35//@ManMemo: Module {\bf raslib}
52{
53public:
59 r_MiterDirect(const void *data, const r_Minterval &total, const r_Minterval &iter,
60 r_Bytes tlen, unsigned int step = 1);
62
72 inline r_MiterDirect &iterateUserOrder(const r_Dimension *order, const unsigned int *step);
76 inline r_MiterDirect &iterateUserOrder(const unsigned int *order, const int *step);
77
79 inline bool isDone(void) const;
81 inline void *getData(void);
86 inline void *getData(unsigned int *order);
92 inline r_Range getExtent(r_Dimension d) const;
94 inline void posChanged(void);
96 void reset(void);
98 void print_pos(std::ostream &str) const;
99
101 const void *baseAddress{NULL};
102
103private:
105 r_ULong length{};
106 r_Dimension dim{};
107
108public:
109 bool done{false};
110};
111
112/*@Doc:
113 r_miter_direct_data encapsulates data for each dimension.
114 It's an auxiliary class for r_MiterDirect. The only reason
115 not to make it a simple struct was data protection.
116 */
117
119{
120 friend class r_MiterDirect;
121
122public:
125
128 const void *data{NULL};
132
133private:
136 r_Range step{};
137 r_Range baseStep{};
138 r_Range extent{};
139 r_Range origin{};
140};
141
143extern std::ostream &operator<<(std::ostream &str, const r_MiterDirect &iter);
144
145#include "raslib/miterd.icc"
146
147#endif
The spatial domain of an MDD is represented by an object of class r_Minterval.
Definition minterval.hh:226
r_MiterDirect is similar to r_Miter, but allows stepping by more than one cell in each direction,...
Definition miterd.hh:52
void print_pos(std::ostream &str) const
print the position
r_MiterDirect & iterateUserOrder(const unsigned int *order, const int *step)
see the other incrementUserOrder method for more details
~r_MiterDirect(void)
r_Range getExtent(r_Dimension d) const
returns extent in dimension d
void * getData(void)
bool isDone(void) const
void reset(void)
reset the iterator (pos to low and data to baseAddress + offset)
bool done
Definition miterd.hh:109
r_MiterDirect(const void *data, const r_Minterval &total, const r_Minterval &iter, r_Bytes tlen, unsigned int step=1)
constructor getting the data, the total domain, the iteration domain, the base type length and the nu...
const void * baseAddress
Definition miterd.hh:101
r_Range getDimBaseStep(r_Dimension d) const
returns number of bytes to step in dimension d when pos changes by 1.
r_MiterDirect & iterateUserOrder(const r_Dimension *order, const unsigned int *step)
increment the iterator in a user-specified order.
void posChanged(void)
notify that the position was changed and internal variables need to be recalculated
void * getData(unsigned int *order)
r_Range getDimStep(r_Dimension d) const
returns number of bytes to step in dimension d in one iteration
r_MiterDirect & operator++(void)
increment the iterator in the default order, i.e. last dimension first
Definition miterd.hh:119
const void * data
Data concerning the iteration position and domain.
Definition miterd.hh:128
r_Range low
Definition miterd.hh:130
r_Range high
Definition miterd.hh:131
r_Range pos
Definition miterd.hh:129
r_miter_direct_data()=default
~r_miter_direct_data()=default
std::int64_t r_Range
for axis indexing, e.g.
Definition mddtypes.hh:53
std::uint32_t r_Dimension
number of dimensions in r_Point and r_Minterval.
Definition mddtypes.hh:56
size_t r_Bytes
number of bytes in an tile or mdd or type.
Definition mddtypes.hh:43
std::ostream & operator<<(std::ostream &str, const r_MiterDirect &iter)
overloaded stream operator
std::uint32_t r_ULong
Definition odmgtypes.hh:38