rasdaman client API 10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
Public Member Functions | Public Attributes | List of all members
r_MiterDirect Class Reference

r_MiterDirect is similar to r_Miter, but allows stepping by more than one cell in each direction, arbitrary order of dimensions in the iteration and has a lot of its internal state variables as public members. More...

#include <miterd.hh>

Public Member Functions

 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 number of steps per iteration.
 
 ~r_MiterDirect (void)
 
r_MiterDirectoperator++ (void)
 increment the iterator in the default order, i.e. last dimension first
 
r_MiterDirectiterateUserOrder (const r_Dimension *order, const unsigned int *step)
 increment the iterator in a user-specified order.
 
r_MiterDirectiterateUserOrder (const unsigned int *order, const int *step)
 see the other incrementUserOrder method for more details
 
bool isDone (void) const
 
void * getData (void)
 
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_Range getDimBaseStep (r_Dimension d) const
 returns number of bytes to step in dimension d when pos changes by 1.
 
r_Range getExtent (r_Dimension d) const
 returns extent in dimension d
 
void posChanged (void)
 notify that the position was changed and internal variables need to be recalculated
 
void reset (void)
 reset the iterator (pos to low and data to baseAddress + offset)
 
void print_pos (std::ostream &str) const
 print the position
 

Public Attributes

r_miter_direct_dataid {NULL}
 
const void * baseAddress {NULL}
 
bool done {false}
 

Detailed Description

r_MiterDirect is similar to r_Miter, but allows stepping by more than one cell in each direction, arbitrary order of dimensions in the iteration and has a lot of its internal state variables as public members.

It should be used in low-level, very time-critical code like folding operations which would otherwise require construction of a new iterator for each cell when only position and base address need to change.

Constructor & Destructor Documentation

◆ r_MiterDirect()

r_MiterDirect::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 number of steps per iteration.

◆ ~r_MiterDirect()

r_MiterDirect::~r_MiterDirect ( void  )

Member Function Documentation

◆ getData() [1/2]

void * r_MiterDirect::getData ( unsigned int *  order)
inline
Returns
pointer to data during user-defined iteration; order is as defined in iterateUserOrder().

◆ getData() [2/2]

void * r_MiterDirect::getData ( void  )
inline
Returns
pointer to data during normal iteration.

◆ getDimBaseStep()

r_Range r_MiterDirect::getDimBaseStep ( r_Dimension  d) const
inline

returns number of bytes to step in dimension d when pos changes by 1.

◆ getDimStep()

r_Range r_MiterDirect::getDimStep ( r_Dimension  d) const
inline

returns number of bytes to step in dimension d in one iteration

◆ getExtent()

r_Range r_MiterDirect::getExtent ( r_Dimension  d) const
inline

returns extent in dimension d

◆ isDone()

bool r_MiterDirect::isDone ( void  ) const
inline
Returns
true if iteration is finished.

◆ iterateUserOrder() [1/2]

r_MiterDirect & r_MiterDirect::iterateUserOrder ( const r_Dimension order,
const unsigned int *  step 
)
inline

increment the iterator in a user-specified order.

order points to an array defining the order of the dimensions during iteration, e.g. for a 3D iteration 0,1,2 would iterate over the first dimension first and the last dimension last wheres 2,1,0 is equivalent to operator++(). step is the number of steps to do in each dimension.

◆ iterateUserOrder() [2/2]

r_MiterDirect & r_MiterDirect::iterateUserOrder ( const unsigned int *  order,
const int *  step 
)
inline

see the other incrementUserOrder method for more details

◆ operator++()

r_MiterDirect & r_MiterDirect::operator++ ( void  )
inline

increment the iterator in the default order, i.e. last dimension first

◆ posChanged()

void r_MiterDirect::posChanged ( void  )
inline

notify that the position was changed and internal variables need to be recalculated

◆ print_pos()

void r_MiterDirect::print_pos ( std::ostream &  str) const

print the position

◆ reset()

void r_MiterDirect::reset ( void  )

reset the iterator (pos to low and data to baseAddress + offset)

Member Data Documentation

◆ baseAddress

const void* r_MiterDirect::baseAddress {NULL}

◆ done

bool r_MiterDirect::done {false}

◆ id

r_miter_direct_data* r_MiterDirect::id {NULL}

The documentation for this class was generated from the following file: