Public Member Functions | Protected Attributes | List of all members
grid_map::GridMapIterator Class Reference

#include <GridMapIterator.hpp>

Inheritance diagram for grid_map::GridMapIterator:
Inheritance graph
[legend]

Public Member Functions

GridMapIterator end () const
 
const size_t & getLinearIndex () const
 
Index getUnwrappedIndex () const
 
 GridMapIterator (const grid_map::GridMap &gridMap)
 
 GridMapIterator (const GridMapIterator *other)
 
bool isPastEnd () const
 
bool operator!= (const GridMapIterator &other) const
 
Index operator* () const
 
virtual GridMapIteratoroperator++ ()
 

Protected Attributes

bool isPastEnd_
 Is iterator out of scope. More...
 
size_t linearIndex_
 Linear index. More...
 
size_t linearSize_
 Linear size of the data. More...
 
Size size_
 Size of the buffer. More...
 
Index startIndex_
 Start index of the circular buffer. More...
 

Detailed Description

Iterator class to iterate trough the entire grid map.

Definition at line 21 of file GridMapIterator.hpp.

Constructor & Destructor Documentation

◆ GridMapIterator() [1/2]

grid_map::GridMapIterator::GridMapIterator ( const grid_map::GridMap gridMap)

Constructor.

Parameters
gridMapthe grid map to iterate on.

Definition at line 14 of file GridMapIterator.cpp.

◆ GridMapIterator() [2/2]

grid_map::GridMapIterator::GridMapIterator ( const GridMapIterator other)

Copy constructor.

Parameters
otherthe object to copy.

Definition at line 23 of file GridMapIterator.cpp.

Member Function Documentation

◆ end()

GridMapIterator grid_map::GridMapIterator::end ( ) const

Return the end iterator

Returns
the end iterator (useful when performing normal iterator processing with ++).

Definition at line 63 of file GridMapIterator.cpp.

◆ getLinearIndex()

const size_t & grid_map::GridMapIterator::getLinearIndex ( ) const

Returns the the linear (1-dim.) index of the cell the iterator is pointing at. Note: Use this access for improved efficiency when working with large maps. Example: See runGridMapIteratorVersion3() of grid_map_demos/src/iterator_benchmark.cpp.

Returns
the 1d linear index.

Definition at line 42 of file GridMapIterator.cpp.

◆ getUnwrappedIndex()

Index grid_map::GridMapIterator::getUnwrappedIndex ( ) const

Retrieve the index as unwrapped index, i.e., as the corresponding index of a grid map with no circular buffer offset.

Definition at line 47 of file GridMapIterator.cpp.

◆ isPastEnd()

bool grid_map::GridMapIterator::isPastEnd ( ) const

Indicates if iterator is past end.

Returns
true if iterator is out of scope, false if end has not been reached.

Definition at line 70 of file GridMapIterator.cpp.

◆ operator!=()

bool grid_map::GridMapIterator::operator!= ( const GridMapIterator other) const

Compare to another iterator.

Returns
whether the current iterator points to a different address than the other one.

Definition at line 32 of file GridMapIterator.cpp.

◆ operator*()

Index grid_map::GridMapIterator::operator* ( ) const

Dereference the iterator to return the regular index (2-dim.) of the cell to which the iterator is pointing at.

Returns
the regular index (2-dim.) of the cell on which the iterator is pointing.

Definition at line 37 of file GridMapIterator.cpp.

◆ operator++()

GridMapIterator & grid_map::GridMapIterator::operator++ ( )
virtual

Increase the iterator to the next element.

Returns
a reference to the updated iterator.

Reimplemented in grid_map::SlidingWindowIterator.

Definition at line 52 of file GridMapIterator.cpp.

Member Data Documentation

◆ isPastEnd_

bool grid_map::GridMapIterator::isPastEnd_
protected

Is iterator out of scope.

Definition at line 97 of file GridMapIterator.hpp.

◆ linearIndex_

size_t grid_map::GridMapIterator::linearIndex_
protected

Linear index.

Definition at line 94 of file GridMapIterator.hpp.

◆ linearSize_

size_t grid_map::GridMapIterator::linearSize_
protected

Linear size of the data.

Definition at line 91 of file GridMapIterator.hpp.

◆ size_

Size grid_map::GridMapIterator::size_
protected

Size of the buffer.

Definition at line 85 of file GridMapIterator.hpp.

◆ startIndex_

Index grid_map::GridMapIterator::startIndex_
protected

Start index of the circular buffer.

Definition at line 88 of file GridMapIterator.hpp.


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


grid_map_core
Author(s): Péter Fankhauser
autogenerated on Wed Jul 5 2023 02:23:35