Class to iterate through the GridContainer cells.
More...
#include <GridContainer.h>
template<typename GridCellManager, typename... AxesTypes>
template<typename CellType, typename PointerType, typename ReferenceType>
class Euclid::GridContainer::GridContainer< GridCellManager, AxesTypes >::iter< CellType, PointerType, ReferenceType >
Class to iterate through the GridContainer cells.
The GridContainer iterator provides efficient iteration through the cells of a GridContainer. If the axis information is not accessed, the iteration is almost as efficient as directly iterating through the GridCellManager. At any moment, the methods axisIndex() and axisValue() can be used to access the axes information. Slicing can be achieved by using the fixAxisByIndex() and fixAxisByValue() methods.
Definition at line 433 of file GridContainer.h.
◆ iter() [1/3]
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
Constructs a new iterator for the given grid.
The cell on which the iterator points is controlled by the data_iter parameter, which is an iterator to the GridCellManager of the grid.
- Parameters
-
owner | The grid to iterate through |
data_iter | The GridCellManager iterator indicating the cell position |
◆ iter() [2/3]
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
◆ iter() [3/3]
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
◆ axisIndex()
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
template<int I>
Returns the index (coordinate) of the axis with index I, for the cell the iterator points
◆ axisValue()
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
template<int I>
Returns the value of the axis with index I, for the cell the iterator points
◆ fixAllAxes()
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
template<typename OtherIter >
Fixes all the axes of this iterator to the values of the axes of the given iterator. The given iterator is assumed to be an iterator of a grid with the same number of axes, with the same names. It is the responsibility of the caller to guarantee that.
- Template Parameters
-
OtherIter | The type of the other iterator |
- Parameters
-
other | The iterator to get the axes values from |
- Returns
- the iterator with all its axes fixed
◆ fixAxisByIndex()
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
template<int I>
Modifies the iterator to navigate only through cells with the given axis index. If the current cell does not fulfil this requirement the iterator will be forward to the first that does.
- Template Parameters
-
I | the index of the axis to fix |
- Parameters
-
index | the index to fix the axis to |
- Returns
- the iterator over the grid slice
- Exceptions
-
◆ fixAxisByValue()
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
template<int I>
Modifies the iterator to navigate only through cells with the given axis value. If the current cell does not fulfill this requirement the iterator will be forward to the first that does.
Note that this method will search in the values of the axis, so it implies an overhead when compared with the fixAxisByIndex() method. For this reason the use of fixAxisByIndex() should be favored.
- Template Parameters
-
I | the index of the axis to fix |
- Parameters
-
value | the value to fix the axis to |
- Returns
- the iterator over the grid slice
- Exceptions
-
◆ forwardToIndex()
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
◆ operator!=()
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
Compares two iterators for inequality. Should be used only for iterators of the same grid.
◆ operator*() [1/2]
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
Returns a reference to the cell value.
◆ operator*() [2/2]
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
Returns a reference to the cell value (const version)
◆ operator++()
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
Moves the iterator to the next grid cell.
◆ operator->() [1/2]
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
Returns a pointer to the cell value.
◆ operator->() [2/2]
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
Returns a pointer to the cell value (const version)
◆ operator=()
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
Copy operator of the iterator.
◆ operator==()
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
Compares two iterators for equality. Should be used only for iterators of the same grid.
◆ m_data_iter
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
◆ m_fixed_indices
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
◆ m_owner
template<typename GridCellManager , typename... AxesTypes>
template<typename CellType , typename PointerType , typename ReferenceType >
The documentation for this class was generated from the following file: