Loading...
Searching...
No Matches
casacore::ArrayAccessor< T, AxisN > Class Template Reference
casa package (libcasa_casa) » Arrays_module

Specialization for run-time axes. More...

`#include <ArrayAccessor.h>`

## Public Member Functions

| ArrayAccessor (const AxisN ax=AxisN(0))
| Constructors.
| ArrayAccessor (Array< T > &arr, const AxisN ax=AxisN(0))
| ArrayAccessor (ArrayAccessor< T, AxisN > &other)
| ArrayAccessor (ArrayAccessor< T, AxisN > &other, const AxisN ax)
template<size_t X>
| ArrayAccessor (ArrayAccessor< T, Axis< X > > &other, const AxisN ax=AxisN(0))
ArrayAccessor & | operator= (const ArrayAccessor< T, AxisN > &other)
template<size_t X>
ArrayAccessor & | operator= (const ArrayAccessor< T, Axis< X > > &other)
| ~ArrayAccessor ()
| Destructor.
void | init (const Array< T > &arr, const AxisN ax)
| (Re-)initialization to start of array (i.e.
void | init (const AxisN ax)
void | reset ()
| Reset to start of dimension or to specified pointer.
void | reset (const T *p)
template<class X>
const T & | next () const
| Indexing operations along another axis than the one of the current object.
template<class X>
T & | next ()
template<class X>
const T & | prev () const
template<class X>
T & | prev ()
const T & | next (const AxisN ax) const
T & | next (const AxisN ax)
const T & | prev (const AxisN ax) const
T & | prev (const AxisN ax)
template<class X>
const T & | index (const int ix) const
template<class X>
T & | index (const int ix)
const T & | index (const int ix, const AxisN(ax)) const
T & | index (const int ix, const AxisN(ax))
bool | operator== (const ArrayAccessor< T, AxisN > &other) const
| Comparisons.
bool | operator!= (const ArrayAccessor< T, AxisN > &other) const
bool | operator== (const T *other) const
bool | operator!= (const T *other) const
Public Member Functions inherited from casacore::ArrayBaseAccessor< T >
void | operator+= (const size_t ix)
| Iterator-like operations.
void | operator-= (const size_t ix)
void | operator++ ()
void | operator++ (int)
void | operator-- ()
void | operator-- (int)
const T & | operator* () const
| Dereferencing.
T & | operator* ()
T * | data ()
const Array< T > & | baseArray ()
size_t | step ()
const T & | operator[] (const int ix) const
| Index along current axis.
T & | operator[] (const int ix)
const T * | end ()
| End of index on line.
const T * | end (const int n)
const T * | begin ()
| Start of index on line.
const T * | begin (const int n)
const T * | rend ()
| End when reverse indexing.
const T * | rend (const int n)
const T * | rbegin ()
| Begin when reverse indexing.
const T * | rbegin (const int n)

## Private Member Functions

int | initOff (int x, size_t ax)
| Get proper offset.
void | initStep ()
| Initialize some internal values.

## Additional Inherited Members

Protected Member Functions inherited from casacore::ArrayBaseAccessor< T >
| ArrayBaseAccessor ()
| Default constructor (for use in e.g.
| ArrayBaseAccessor (const Array< T > &arr)
| Construct from an Array.
| ArrayBaseAccessor (const Array< T > &arr, const size_t ax)
| ArrayBaseAccessor (const ArrayBaseAccessor< T > &other)
| Copy constructor (copy semantics).
| ArrayBaseAccessor (const ArrayBaseAccessor< T > &other, const size_t ax)
| ~ArrayBaseAccessor ()
| Destructor.
ArrayBaseAccessor & | operator= (const ArrayBaseAccessor< T > &other)
| Assignment (copy semantics).
void | init (const Array< T > &arr)
| (Re-)initialize from Array
void | init (const Array< T > &arr, const size_t ax)
void | init (const size_t ax)
Protected Attributes inherited from casacore::ArrayBaseAccessor< T >
const Array< T > * | arrayPtr_p
| The pointer to belonging array.
size_t | axis_p
| Current run-time axis.
T * | ptr_p
| Current access pointer.
int | step_p
| The increment to go from one point along an axis, to the next.
const T * | begin_p
| The start element of array.
const T * | end_p
| The one element beyond last on line.

## Detailed Description

template<class T>
class casacore::ArrayAccessor< T, AxisN >

Specialization for run-time axes.

### Intended use:

Public interface

### Synopsis

This class is a specialization for run-time axis selection within the array accessor. The axis is specified in the constructors and in the special indexing operators (prev, next, index) with a parameter AxisN(n) in stead of a template parameter <Axis<n> >.

See also
  ArrayAccessor

Definition at line 496 of file ArrayAccessor.h.

## Constructor & Destructor Documentation

## ArrayAccessor() [1/5]

template<class T>

casacore::ArrayAccessor< T, AxisN >::ArrayAccessor | ( | const AxisN | ax = AxisN(0) | ) |

inline explicit

Constructors.

Definition at line 501 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::ArrayBaseAccessor(), and casacore::ArrayBaseAccessor< T >::axis_p.

Referenced by ArrayAccessor(), ArrayAccessor(), ArrayAccessor(), operator!=(), operator=(), operator=(), and operator==().

## ArrayAccessor() [2/5]

template<class T>

casacore::ArrayAccessor< T, AxisN >::ArrayAccessor | ( | Array< T > & | arr,
|  | const AxisN | ax = AxisN(0) )

inline explicit

Definition at line 503 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::ArrayBaseAccessor(), and initStep().

## ArrayAccessor() [3/5]

template<class T>

casacore::ArrayAccessor< T, AxisN >::ArrayAccessor | ( | ArrayAccessor< T, AxisN > & | other | ) |

inline

Definition at line 505 of file ArrayAccessor.h.

References ArrayAccessor(), and casacore::ArrayBaseAccessor< T >::ArrayBaseAccessor().

## ArrayAccessor() [4/5]

template<class T>

casacore::ArrayAccessor< T, AxisN >::ArrayAccessor | ( | ArrayAccessor< T, AxisN > & | other,
|  | const AxisN | ax )

inline explicit

Definition at line 507 of file ArrayAccessor.h.

References ArrayAccessor(), casacore::ArrayBaseAccessor< T >::ArrayBaseAccessor(), and initStep().

## ArrayAccessor() [5/5]

template<class T>
template<size_t X>

casacore::ArrayAccessor< T, AxisN >::ArrayAccessor | ( | ArrayAccessor< T, Axis< X > > & | other,
|  | const AxisN | ax = AxisN(0) )

inline explicit

Definition at line 511 of file ArrayAccessor.h.

References ArrayAccessor(), casacore::ArrayBaseAccessor< T >::ArrayBaseAccessor(), and initStep().

## ~ArrayAccessor()

template<class T>

casacore::ArrayAccessor< T, AxisN >::~ArrayAccessor | ( |  | ) |

inline

Destructor.

Definition at line 526 of file ArrayAccessor.h.

## Member Function Documentation

## index() [1/4]

template<class T>
template<class X>

T & casacore::ArrayAccessor< T, AxisN >::index | ( | const int | ix | ) |

inline

Definition at line 569 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::arrayPtr_p, and casacore::ArrayBaseAccessor< T >::ptr_p.

## index() [2/4]

template<class T>
template<class X>

const T & casacore::ArrayAccessor< T, AxisN >::index | ( | const int | ix | ) | const

inline

Definition at line 566 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::arrayPtr_p, and casacore::ArrayBaseAccessor< T >::ptr_p.

## index() [3/4]

template<class T>

T & casacore::ArrayAccessor< T, AxisN >::index | ( | const int | ix,
|  | const | AxisNax )

inline

Definition at line 573 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::arrayPtr_p, and casacore::ArrayBaseAccessor< T >::ptr_p.

## index() [4/4]

template<class T>

const T & casacore::ArrayAccessor< T, AxisN >::index | ( | const int | ix,
|  | const | AxisNax ) const

inline

Definition at line 571 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::arrayPtr_p, and casacore::ArrayBaseAccessor< T >::ptr_p.

## init() [1/2]

template<class T>

void casacore::ArrayAccessor< T, AxisN >::init | ( | const Array< T > & | arr,
|  | const AxisN | ax )

inline

(Re-)initialization to start of array (i.e.

element (0,0,0,...)) or re-initialize to an axis.

Definition at line 531 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::init(), and initStep().

## init() [2/2]

template<class T>

void casacore::ArrayAccessor< T, AxisN >::init | ( | const AxisN | ax | ) |

inline

Definition at line 533 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::init().

## initOff()

template<class T>

int casacore::ArrayAccessor< T, AxisN >::initOff | ( | int | x,
|  | size_t | ax )

inline private

Get proper offset.

Definition at line 589 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::arrayPtr_p, casacore::ArrayBaseAccessor< T >::axis_p, and initOff().

Referenced by initOff(), and initStep().

## initStep()

template<class T>

void casacore::ArrayAccessor< T, AxisN >::initStep | ( |  | ) |

inline private

Initialize some internal values.

Definition at line 593 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::arrayPtr_p, casacore::ArrayBaseAccessor< T >::axis_p, casacore::ArrayBaseAccessor< T >::begin_p, casacore::ArrayBaseAccessor< T >::end_p, initOff(), casacore::ArrayBaseAccessor< T >::ptr_p, and casacore::ArrayBaseAccessor< T >::step_p.

Referenced by ArrayAccessor(), ArrayAccessor(), ArrayAccessor(), init(), operator=(), operator=(), and reset().

## next() [1/4]

template<class T>
template<class X>

T & casacore::ArrayAccessor< T, AxisN >::next | ( |  | ) |

inline

Definition at line 551 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::arrayPtr_p, and casacore::ArrayBaseAccessor< T >::ptr_p.

## next() [2/4]

template<class T>
template<class X>

const T & casacore::ArrayAccessor< T, AxisN >::next | ( |  | ) | const

inline

Indexing operations along another axis than the one of the current object.

See for the indexing and iterator operations along the object's axis ArrayBaseAccessor

Definition at line 548 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::arrayPtr_p, and casacore::ArrayBaseAccessor< T >::ptr_p.

## next() [3/4]

template<class T>

T & casacore::ArrayAccessor< T, AxisN >::next | ( | const AxisN | ax | ) |

inline

Definition at line 559 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::arrayPtr_p, and casacore::ArrayBaseAccessor< T >::ptr_p.

## next() [4/4]

template<class T>

const T & casacore::ArrayAccessor< T, AxisN >::next | ( | const AxisN | ax | ) | const

inline

Definition at line 557 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::arrayPtr_p, and casacore::ArrayBaseAccessor< T >::ptr_p.

## operator!=() [1/2]

template<class T>

bool casacore::ArrayAccessor< T, AxisN >::operator!= | ( | const ArrayAccessor< T, AxisN > & | other | ) | const

inline

Definition at line 581 of file ArrayAccessor.h.

References ArrayAccessor(), and casacore::ArrayBaseAccessor< T >::ptr_p.

## operator!=() [2/2]

template<class T>

bool casacore::ArrayAccessor< T, AxisN >::operator!= | ( | const T * | other | ) | const

inline

Definition at line 584 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::ptr_p.

## operator=() [1/2]

template<class T>
template<size_t X>

ArrayAccessor & casacore::ArrayAccessor< T, AxisN >::operator= | ( | const ArrayAccessor< T, Axis< X > > & | other | ) |

inline

Definition at line 520 of file ArrayAccessor.h.

References ArrayAccessor(), initStep(), and casacore::ArrayBaseAccessor< T >::operator=().

## operator=() [2/2]

template<class T>

ArrayAccessor & casacore::ArrayAccessor< T, AxisN >::operator= | ( | const ArrayAccessor< T, AxisN > & | other | ) |

inline

Definition at line 514 of file ArrayAccessor.h.

References ArrayAccessor(), initStep(), and casacore::ArrayBaseAccessor< T >::operator=().

## operator==() [1/2]

template<class T>

bool casacore::ArrayAccessor< T, AxisN >::operator== | ( | const ArrayAccessor< T, AxisN > & | other | ) | const

inline

Comparisons.

Definition at line 579 of file ArrayAccessor.h.

References ArrayAccessor(), and casacore::ArrayBaseAccessor< T >::ptr_p.

## operator==() [2/2]

template<class T>

bool casacore::ArrayAccessor< T, AxisN >::operator== | ( | const T * | other | ) | const

inline

Definition at line 583 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::ptr_p.

## prev() [1/4]

template<class T>
template<class X>

T & casacore::ArrayAccessor< T, AxisN >::prev | ( |  | ) |

inline

Definition at line 556 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::arrayPtr_p, and casacore::ArrayBaseAccessor< T >::ptr_p.

## prev() [2/4]

template<class T>
template<class X>

const T & casacore::ArrayAccessor< T, AxisN >::prev | ( |  | ) | const

inline

Definition at line 553 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::arrayPtr_p, and casacore::ArrayBaseAccessor< T >::ptr_p.

## prev() [3/4]

template<class T>

T & casacore::ArrayAccessor< T, AxisN >::prev | ( | const AxisN | ax | ) |

inline

Definition at line 563 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::arrayPtr_p, and casacore::ArrayBaseAccessor< T >::ptr_p.

## prev() [4/4]

template<class T>

const T & casacore::ArrayAccessor< T, AxisN >::prev | ( | const AxisN | ax | ) | const

inline

Definition at line 561 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::arrayPtr_p, and casacore::ArrayBaseAccessor< T >::ptr_p.

## reset() [1/2]

template<class T>

void casacore::ArrayAccessor< T, AxisN >::reset | ( |  | ) |

inline

Reset to start of dimension or to specified pointer.

Definition at line 539 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::begin_p, and casacore::ArrayBaseAccessor< T >::ptr_p.

## reset() [2/2]

template<class T>

void casacore::ArrayAccessor< T, AxisN >::reset | ( | const T * | p | ) |

inline

Definition at line 540 of file ArrayAccessor.h.

References initStep(), and casacore::ArrayBaseAccessor< T >::ptr_p.

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

- casa/Arrays/ArrayAccessor.h