Loading...
Searching...
No Matches
casacore::ArrayAccessor< T, Axis< U > > Class Template Reference

Specialization for compile-time axes. More...

`#include <ArrayAccessor.h>`

## Public Member Functions

| ArrayAccessor ()
| Constructors.
| ArrayAccessor (const Array< T > &arr)
| Construct an accessor from specified Array along the selected axis.
| ArrayAccessor (const ArrayAccessor< T, Axis< U > > &other)
| Construct from an ArrayAccessor along same axis.
template<size_t X>
| ArrayAccessor (const ArrayAccessor< T, Axis< X > > &other)
| Construct from accessor along another (or run-time) axis.
| ArrayAccessor (const ArrayAccessor< T, AxisN > &other)
| ~ArrayAccessor ()
| Destructor.
ArrayAccessor & | operator= (const ArrayAccessor< T, Axis< U > > &other)
| Assignment (copy semantics).
template<size_t X>
ArrayAccessor & | operator= (const ArrayAccessor< T, Axis< X > > &other)
| Assign from other compile-time accessor along another axis.
ArrayAccessor & | operator= (const ArrayAccessor< T, AxisN > &other)
| Assign from run-time accessor along any axis.
void | init (const Array< T > &arr)
| (Re-)initialization to start of array (i.e.
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
| Get the value 'previous' along the specified axis (e.g.
template<class X>
T & | prev ()
const T & | next (const AxisN ax) const
| Get the next or previous along the specified run-time axis.
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
| Give the value indexed with respect to the current accessor value along the axis specified as either a compile-time or a run-time axis.
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, Axis< U > > &other) const
| Comparison.
bool | operator!= (const ArrayAccessor< T, Axis< U > > &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, size_t U>
class casacore::ArrayAccessor< T, Axis< U > >

Specialization for compile-time axes.

See also
  ArrayAccessor

Definition at line 347 of file ArrayAccessor.h.

## Constructor & Destructor Documentation

## ArrayAccessor() [1/5]

template<class T, size_t U>

casacore::ArrayAccessor< T, Axis< U > >::ArrayAccessor | ( |  | ) |

inline

Constructors.

Default ctor. Note only available to accommodate containers of ArrayAccessors. Use init() to initialize.

Definition at line 354 of file ArrayAccessor.h.

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

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

## ArrayAccessor() [2/5]

template<class T, size_t U>

casacore::ArrayAccessor< T, Axis< U > >::ArrayAccessor | ( | const Array< T > & | arr | ) |

inline explicit

Construct an accessor from specified Array along the selected axis.

The accessor will point to the first element along the axis (i.e. at (0,0,...)).

Definition at line 358 of file ArrayAccessor.h.

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

## ArrayAccessor() [3/5]

template<class T, size_t U>

casacore::ArrayAccessor< T, Axis< U > >::ArrayAccessor | ( | const ArrayAccessor< T, Axis< U > > & | other | ) |

inline

Construct from an ArrayAccessor along same axis.

The accessor will point at the same element as the originator.

Definition at line 362 of file ArrayAccessor.h.

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

## ArrayAccessor() [4/5]

template<class T, size_t U>
template<size_t X>

casacore::ArrayAccessor< T, Axis< U > >::ArrayAccessor | ( | const ArrayAccessor< T, Axis< X > > & | other | ) |

inline explicit

Construct from accessor along another (or run-time) axis.

The accessor will point to the same element (but will be oriented along another axis).

Definition at line 369 of file ArrayAccessor.h.

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

## ArrayAccessor() [5/5]

template<class T, size_t U>

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

inline explicit

Definition at line 371 of file ArrayAccessor.h.

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

## ~ArrayAccessor()

template<class T, size_t U>

casacore::ArrayAccessor< T, Axis< U > >::~ArrayAccessor | ( |  | ) |

inline

Destructor.

Definition at line 376 of file ArrayAccessor.h.

## Member Function Documentation

## index() [1/4]

template<class T, size_t U>
template<class X>

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

inline

Definition at line 450 of file ArrayAccessor.h.

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

## index() [2/4]

template<class T, size_t U>
template<class X>

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

inline

Give the value indexed with respect to the current accessor value along the axis specified as either a compile-time or a run-time axis.

E.g. a.index<Axis<3> >(5) or a.index(5, AxisN(3)).

Definition at line 447 of file ArrayAccessor.h.

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

## index() [3/4]

template<class T, size_t U>

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

inline

Definition at line 454 of file ArrayAccessor.h.

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

## index() [4/4]

template<class T, size_t U>

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

inline

Definition at line 452 of file ArrayAccessor.h.

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

## init()

template<class T, size_t U>

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

inline

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

element (0,0,0,...))

Definition at line 398 of file ArrayAccessor.h.

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

## initOff()

template<class T, size_t U>

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

inline private

Get proper offset.

Definition at line 472 of file ArrayAccessor.h.

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

Referenced by initOff(), and initStep().

## initStep()

template<class T, size_t U>

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

inline private

Initialize some internal values.

Definition at line 476 of file ArrayAccessor.h.

References casacore::ArrayBaseAccessor< T >::arrayPtr_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, size_t U>
template<class X>

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

inline

Definition at line 418 of file ArrayAccessor.h.

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

## next() [2/4]

template<class T, size_t U>
template<class X>

const T & casacore::ArrayAccessor< T, Axis< U > >::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

Get the value 'next' along the specified axis (e.g. with a.next<Axis<2> >())

Definition at line 415 of file ArrayAccessor.h.

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

## next() [3/4]

template<class T, size_t U>

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

inline

Definition at line 434 of file ArrayAccessor.h.

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

## next() [4/4]

template<class T, size_t U>

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

inline

Get the next or previous along the specified run-time axis.

E.g. a.prev(AxisN(2)).

Definition at line 432 of file ArrayAccessor.h.

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

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

template<class T, size_t U>

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

inline

Definition at line 464 of file ArrayAccessor.h.

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

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

template<class T, size_t U>

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

inline

Definition at line 467 of file ArrayAccessor.h.

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

## operator=() [1/3]

template<class T, size_t U>

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

inline

Assignment (copy semantics).

Assign from other compile-time accessor along same axis

Definition at line 382 of file ArrayAccessor.h.

References ArrayAccessor(), casacore::ArrayBaseAccessor< T >::begin_p, casacore::ArrayBaseAccessor< T >::end_p, casacore::ArrayBaseAccessor< T >::operator=(), and casacore::ArrayBaseAccessor< T >::step_p.

## operator=() [2/3]

template<class T, size_t U>
template<size_t X>

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

inline

Assign from other compile-time accessor along another axis.

Definition at line 389 of file ArrayAccessor.h.

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

## operator=() [3/3]

template<class T, size_t U>

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

inline

Assign from run-time accessor along any axis.

Definition at line 393 of file ArrayAccessor.h.

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

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

template<class T, size_t U>

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

inline

Comparison.

The comparisons are done for the accessor pointer value. They can be used to control loops.

Definition at line 462 of file ArrayAccessor.h.

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

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

template<class T, size_t U>

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

inline

Definition at line 466 of file ArrayAccessor.h.

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

## prev() [1/4]

template<class T, size_t U>
template<class X>

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

inline

Definition at line 427 of file ArrayAccessor.h.

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

## prev() [2/4]

template<class T, size_t U>
template<class X>

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

inline

Get the value 'previous' along the specified axis (e.g.

with a.prev<Axis<2> >())

Definition at line 424 of file ArrayAccessor.h.

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

## prev() [3/4]

template<class T, size_t U>

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

inline

Definition at line 438 of file ArrayAccessor.h.

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

## prev() [4/4]

template<class T, size_t U>

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

inline

Definition at line 436 of file ArrayAccessor.h.

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

## reset() [1/2]

template<class T, size_t U>

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

inline

Reset to start of dimension or to specified pointer.

Definition at line 403 of file ArrayAccessor.h.

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

## reset() [2/2]

template<class T, size_t U>

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

inline

Definition at line 404 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