LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
ndarray::detail::NestedIterator< T, N, C > Class Template Reference

#include <NestedIterator.h>

Inheritance diagram for ndarray::detail::NestedIterator< T, N, C >:

Public Types

typedef ArrayTraits< T, N, C >
::Value 
Value
 
typedef ArrayTraits< T, N, C >
::Reference 
Reference
 

Public Member Functions

Reference operator[] (int n) const
 
Reference const & operator* () const
 
Reference const * operator-> ()
 
 NestedIterator ()
 
 NestedIterator (Reference const &ref, int stride)
 
 NestedIterator (NestedIterator const &other)
 
template<typename T_ , int C_>
 NestedIterator (NestedIterator< T_, N, C_ > const &other)
 
NestedIteratoroperator= (NestedIterator const &other)
 
template<typename T_ , int C_>
NestedIteratoroperator= (NestedIterator< T_, N, C_ > const &other)
 

Private Member Functions

Reference const & dereference () const
 
void increment ()
 
void decrement ()
 
void advance (int n)
 
template<typename T_ , int C_>
int distance_to (NestedIterator< T_, N, C_ > const &other) const
 
template<typename T_ , int C_>
bool equal (NestedIterator< T_, N, C_ > const &other) const
 

Private Attributes

Reference _ref
 
int _stride
 

Friends

class boost::iterator_core_access
 
template<typename T_ , int N_, int C_>
class NestedIterator
 

Detailed Description

template<typename T, int N, int C>
class ndarray::detail::NestedIterator< T, N, C >

Definition at line 52 of file NestedIterator.h.

Member Typedef Documentation

template<typename T, int N, int C>
typedef ArrayTraits<T,N,C>::Reference ndarray::detail::NestedIterator< T, N, C >::Reference

Definition at line 61 of file NestedIterator.h.

template<typename T, int N, int C>
typedef ArrayTraits<T,N,C>::Value ndarray::detail::NestedIterator< T, N, C >::Value

Definition at line 60 of file NestedIterator.h.

Constructor & Destructor Documentation

template<typename T, int N, int C>
ndarray::detail::NestedIterator< T, N, C >::NestedIterator ( )
inline

Definition at line 73 of file NestedIterator.h.

template<typename T, int N, int C>
ndarray::detail::NestedIterator< T, N, C >::NestedIterator ( Reference const &  ref,
int  stride 
)
inline

Definition at line 75 of file NestedIterator.h.

template<typename T, int N, int C>
ndarray::detail::NestedIterator< T, N, C >::NestedIterator ( NestedIterator< T, N, C > const &  other)
inline

Definition at line 77 of file NestedIterator.h.

77 : _ref(other._ref), _stride(other._stride) {}
template<typename T, int N, int C>
template<typename T_ , int C_>
ndarray::detail::NestedIterator< T, N, C >::NestedIterator ( NestedIterator< T_, N, C_ > const &  other)
inline

Definition at line 80 of file NestedIterator.h.

80 : _ref(other._ref), _stride(other._stride) {}

Member Function Documentation

template<typename T, int N, int C>
void ndarray::detail::NestedIterator< T, N, C >::advance ( int  n)
inlineprivate

Definition at line 109 of file NestedIterator.h.

template<typename T, int N, int C>
void ndarray::detail::NestedIterator< T, N, C >::decrement ( )
inlineprivate
template<typename T, int N, int C>
Reference const& ndarray::detail::NestedIterator< T, N, C >::dereference ( ) const
inlineprivate

Definition at line 105 of file NestedIterator.h.

105 { return _ref; }
template<typename T, int N, int C>
template<typename T_ , int C_>
int ndarray::detail::NestedIterator< T, N, C >::distance_to ( NestedIterator< T_, N, C_ > const &  other) const
inlineprivate

Definition at line 112 of file NestedIterator.h.

112  {
113  return std::distance(_ref._data, other._ref._data) / _stride;
114  }
Element * _data
Definition: ArrayBase.h:227
template<typename T, int N, int C>
template<typename T_ , int C_>
bool ndarray::detail::NestedIterator< T, N, C >::equal ( NestedIterator< T_, N, C_ > const &  other) const
inlineprivate

Definition at line 117 of file NestedIterator.h.

117  {
118  return _ref._data == other._ref._data;
119  }
Element * _data
Definition: ArrayBase.h:227
template<typename T, int N, int C>
void ndarray::detail::NestedIterator< T, N, C >::increment ( )
inlineprivate
template<typename T, int N, int C>
Reference const& ndarray::detail::NestedIterator< T, N, C >::operator* ( ) const
inline

Definition at line 69 of file NestedIterator.h.

69 { return _ref; }
template<typename T, int N, int C>
Reference const* ndarray::detail::NestedIterator< T, N, C >::operator-> ( )
inline

Definition at line 71 of file NestedIterator.h.

71 { return &_ref; }
template<typename T, int N, int C>
NestedIterator& ndarray::detail::NestedIterator< T, N, C >::operator= ( NestedIterator< T, N, C > const &  other)
inline

Definition at line 82 of file NestedIterator.h.

82  {
83  if (&other != this) {
84  _ref._data = other._ref._data;
85  _ref._core = other._ref._core;
86  _stride = other._stride;
87  }
88  return *this;
89  }
Element * _data
Definition: ArrayBase.h:227
template<typename T, int N, int C>
template<typename T_ , int C_>
NestedIterator& ndarray::detail::NestedIterator< T, N, C >::operator= ( NestedIterator< T_, N, C_ > const &  other)
inline

Definition at line 92 of file NestedIterator.h.

92  {
93  _ref._data = other._ref._data;
94  _ref._core = other._ref._core;
95  _stride = other._stride;
96  return *this;
97  }
Element * _data
Definition: ArrayBase.h:227
template<typename T, int N, int C>
Reference ndarray::detail::NestedIterator< T, N, C >::operator[] ( int  n) const
inline

Definition at line 63 of file NestedIterator.h.

63  {
64  Reference r(_ref);
65  r._data += n * _stride;
66  return r;
67  }
ArrayTraits< T, N, C >::Reference Reference

Friends And Related Function Documentation

template<typename T, int N, int C>
template<typename T_ , int N_, int C_>
friend class NestedIterator
friend

Definition at line 103 of file NestedIterator.h.

template<typename T, int N, int C>
friend class boost::iterator_core_access
friend

Definition at line 101 of file NestedIterator.h.

Member Data Documentation

template<typename T, int N, int C>
Reference ndarray::detail::NestedIterator< T, N, C >::_ref
private

Definition at line 121 of file NestedIterator.h.

template<typename T, int N, int C>
int ndarray::detail::NestedIterator< T, N, C >::_stride
private

Definition at line 122 of file NestedIterator.h.


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