casacore
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 386 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 392 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)
inlineexplicit

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 396 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 399 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)
inlineexplicit

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 405 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)
inlineexplicit

◆ ~ArrayAccessor()

template<class T, size_t U>
casacore::ArrayAccessor< T, Axis< U > >::~ArrayAccessor ( )
inline

Destructor.

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

◆ 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 501 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

◆ 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

◆ 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 445 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 )
inlineprivate

Get proper offset.

Definition at line 532 of file ArrayAccessor.h.

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

Referenced by initOff(), and initStep().

◆ initStep()

◆ next() [1/4]

template<class T, size_t U>
template<class X>
T & casacore::ArrayAccessor< T, Axis< U > >::next ( )
inline

◆ 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 467 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

◆ 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 490 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 523 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 527 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 420 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 431 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 437 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 520 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 526 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

◆ 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 479 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

◆ prev() [4/4]

template<class T, size_t U>
const T & casacore::ArrayAccessor< T, Axis< U > >::prev ( const AxisN ax) const
inline

◆ 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 452 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 453 of file ArrayAccessor.h.

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


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