casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | List of all members
casacore::ArrayAccessor< T, Axis< U > > Class Template Reference

Specialization for compile-time axes. More...

#include <ArrayAccessor.h>

Inheritance diagram for casacore::ArrayAccessor< T, Axis< U > >:
casacore::ArrayBaseAccessor< T >

Public Member Functions

 ArrayAccessor ()
 Constructors. More...
 
 ArrayAccessor (const Array< T > &arr)
 Construct an accessor from specified Array along the selected axis. More...
 
 ArrayAccessor (const ArrayAccessor< T, Axis< U > > &other)
 Construct from an ArrayAccessor along same axis. More...
 
template<size_t X>
 ArrayAccessor (const ArrayAccessor< T, Axis< X > > &other)
 Construct from accessor along another (or run-time) axis. More...
 
 ArrayAccessor (const ArrayAccessor< T, AxisN > &other)
 
 ~ArrayAccessor ()
 Destructor. More...
 
ArrayAccessoroperator= (const ArrayAccessor< T, Axis< U > > &other)
 Assignment (copy semantics) More...
 
template<size_t X>
ArrayAccessoroperator= (const ArrayAccessor< T, Axis< X > > &other)
 Assign from other compile-time accessor along another axis. More...
 
ArrayAccessoroperator= (const ArrayAccessor< T, AxisN > &other)
 Assign from run-time accessor along any axis. More...
 
void init (const Array< T > &arr)
 (Re-)initialization to start of array (i.e. More...
 
void reset ()
 Reset to start of dimension or to specified pointer. More...
 
void reset (const T *p)
 
template<class X >
const T & next () const
 Indexing operations along another axis than the one of the current object. More...
 
template<class X >
T & next ()
 
template<class X >
const T & prev () const
 Get the value 'previous' along the specified axis (e.g. More...
 
template<class X >
T & prev ()
 
const T & next (const AxisN ax) const
 Get the next or previous along the specified run-time axis. More...
 
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. More...
 
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. More...
 
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. More...
 
void operator-= (const size_t ix)
 
void operator++ ()
 
void operator++ (int)
 
void operator-- ()
 
void operator-- (int)
 
const T & operator* () const
 Dereferencing. More...
 
T & operator* ()
 
T * data ()
 
const Array< T > & baseArray ()
 
size_t step ()
 
const T & operator[] (const int ix) const
 Index along current axis. More...
 
T & operator[] (const int ix)
 
const T * end ()
 End of index on line. More...
 
const T * end (const int n)
 
const T * begin ()
 Start of index on line. More...
 
const T * begin (const int n)
 
const T * rend ()
 End when reverse indexing. More...
 
const T * rend (const int n)
 
const T * rbegin ()
 Begin when reverse indexing. More...
 
const T * rbegin (const int n)
 

Private Member Functions

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

Additional Inherited Members

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

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 350 of file ArrayAccessor.h.

Constructor & Destructor Documentation

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 357 of file ArrayAccessor.h.

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 361 of file ArrayAccessor.h.

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 365 of file ArrayAccessor.h.

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 372 of file ArrayAccessor.h.

template<class T , size_t U>
casacore::ArrayAccessor< T, Axis< U > >::ArrayAccessor ( const ArrayAccessor< T, AxisN > &  other)
inlineexplicit

Definition at line 374 of file ArrayAccessor.h.

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

Destructor.

Definition at line 379 of file ArrayAccessor.h.

Member Function Documentation

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 450 of file ArrayAccessor.h.

References N, and casacore::ptr_p.

template<class T , size_t U>
template<class X >
T& casacore::ArrayAccessor< T, Axis< U > >::index ( const int  ix)
inline

Definition at line 453 of file ArrayAccessor.h.

References N, and casacore::ptr_p.

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 455 of file ArrayAccessor.h.

References casacore::ptr_p.

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

Definition at line 457 of file ArrayAccessor.h.

References casacore::ptr_p.

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 401 of file ArrayAccessor.h.

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

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 475 of file ArrayAccessor.h.

References N.

template<class T , size_t U>
void casacore::ArrayAccessor< T, Axis< U > >::initStep ( )
inlineprivate

Initialize some internal values.

Definition at line 479 of file ArrayAccessor.h.

References N, and casacore::ptr_p.

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 418 of file ArrayAccessor.h.

References N, and casacore::ptr_p.

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

Definition at line 421 of file ArrayAccessor.h.

References N, and casacore::ptr_p.

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 435 of file ArrayAccessor.h.

References casacore::ptr_p.

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

Definition at line 437 of file ArrayAccessor.h.

References casacore::ptr_p.

template<class T , size_t U>
bool casacore::ArrayAccessor< T, Axis< U > >::operator!= ( const ArrayAccessor< T, Axis< U > > &  other) const
inline

Definition at line 467 of file ArrayAccessor.h.

References casacore::ptr_p.

template<class T , size_t U>
bool casacore::ArrayAccessor< T, Axis< U > >::operator!= ( const T *  other) const
inline

Definition at line 470 of file ArrayAccessor.h.

References casacore::ptr_p.

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 385 of file ArrayAccessor.h.

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

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 392 of file ArrayAccessor.h.

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

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 396 of file ArrayAccessor.h.

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

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 465 of file ArrayAccessor.h.

References casacore::ptr_p.

template<class T , size_t U>
bool casacore::ArrayAccessor< T, Axis< U > >::operator== ( const T *  other) const
inline

Definition at line 469 of file ArrayAccessor.h.

References casacore::ptr_p.

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 427 of file ArrayAccessor.h.

References N, and casacore::ptr_p.

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

Definition at line 430 of file ArrayAccessor.h.

References N, and casacore::ptr_p.

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

Definition at line 439 of file ArrayAccessor.h.

References casacore::ptr_p.

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

Definition at line 441 of file ArrayAccessor.h.

References casacore::ptr_p.

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 406 of file ArrayAccessor.h.

References casacore::ptr_p.

template<class T , size_t U>
void casacore::ArrayAccessor< T, Axis< U > >::reset ( const T *  p)
inline

Definition at line 407 of file ArrayAccessor.h.

References casacore::ptr_p.


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