Public Member Functions | Protected Attributes
nav_grid_iterators::SubGrid Class Reference

Iterator for looping through every index within an aligned rectangular portion of the grid. More...

#include <sub_grid.h>

Inheritance diagram for nav_grid_iterators::SubGrid:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 SubGrid (const nav_grid::NavGridInfo *info, unsigned int min_x, unsigned int min_y, unsigned int width, unsigned int height)
 Public Constructor.
 SubGrid (const nav_grid::NavGridInfo *info, const nav_core2::UIntBounds &bounds)
 Public Constructor using UIntBounds object.
 SubGrid (const nav_grid::NavGridInfo *info, const nav_grid::Index &index, unsigned int min_x, unsigned int min_y, unsigned int width, unsigned int height)
 Public constructor that takes in an arbitrary index.
Standard BaseIterator Interface
SubGrid begin () const override
 Helper function for range-style iteration Equivalent to the above constructor.
SubGrid end () const override
 Helper function for range-style iteration.
void increment () override
 Increase the iterator to the next element.
bool fieldsEqual (const SubGrid &other) override
 Additional check for whether fields of derived iterators are equal.

Protected Attributes

unsigned int height_
unsigned int min_x_
unsigned int min_y_
unsigned int width_

Detailed Description

Iterator for looping through every index within an aligned rectangular portion of the grid.

Definition at line 47 of file sub_grid.h.


Constructor & Destructor Documentation

nav_grid_iterators::SubGrid::SubGrid ( const nav_grid::NavGridInfo info,
unsigned int  min_x,
unsigned int  min_y,
unsigned int  width,
unsigned int  height 
) [inline]

Public Constructor.

Parameters:
infoNavGridInfo for the grid to iterate over
min_xMinimum index (x coordinate)
min_yMinimum index (y coordinate)
widthNumber of indexes in the x direction
heightNumber of indexes in the y direction
Note:
No bounds checking is done for any of the coordinates. Assumes (min_x, min_y) and (min_x + width - 1, min_y + height - 1) are valid in the grid.

Definition at line 61 of file sub_grid.h.

nav_grid_iterators::SubGrid::SubGrid ( const nav_grid::NavGridInfo info,
const nav_core2::UIntBounds bounds 
) [inline]

Public Constructor using UIntBounds object.

Parameters:
infoNavGridInfo for the grid to iterate over
boundsUIntBounds

Definition at line 70 of file sub_grid.h.

nav_grid_iterators::SubGrid::SubGrid ( const nav_grid::NavGridInfo info,
const nav_grid::Index &  index,
unsigned int  min_x,
unsigned int  min_y,
unsigned int  width,
unsigned int  height 
) [inline]

Public constructor that takes in an arbitrary index.

Parameters:
infoNavGridInfo for the grid to iterate over
indexInitial index
min_xMinimum index (x coordinate)
min_yMinimum index (y coordinate)
widthNumber of indexes in the x direction
heightNumber of indexes in the y direction
Note:
No bounds checking is done for any of the coordinates. Assumes (min_x, min_y) and (min_x + width - 1, min_y + height - 1) are valid in the grid.

Definition at line 85 of file sub_grid.h.


Member Function Documentation

SubGrid nav_grid_iterators::SubGrid::begin ( ) const [override, virtual]

Helper function for range-style iteration Equivalent to the above constructor.

Returns:
Iterator representing beginning of the iteration

Implements nav_grid_iterators::BaseIterator< SubGrid >.

Definition at line 39 of file sub_grid.cpp.

SubGrid nav_grid_iterators::SubGrid::end ( ) const [override, virtual]

Helper function for range-style iteration.

Returns:
Iterator representing end of the iteration, with an invalid index

Implements nav_grid_iterators::BaseIterator< SubGrid >.

Definition at line 44 of file sub_grid.cpp.

bool nav_grid_iterators::SubGrid::fieldsEqual ( const SubGrid other) [override, virtual]

Additional check for whether fields of derived iterators are equal.

Helps make overriding the == operator easy.

Reimplemented from nav_grid_iterators::BaseIterator< SubGrid >.

Definition at line 59 of file sub_grid.cpp.

void nav_grid_iterators::SubGrid::increment ( ) [override, virtual]

Increase the iterator to the next element.

Implements nav_grid_iterators::BaseIterator< SubGrid >.

Definition at line 49 of file sub_grid.cpp.


Member Data Documentation

unsigned int nav_grid_iterators::SubGrid::height_ [protected]

Definition at line 98 of file sub_grid.h.

unsigned int nav_grid_iterators::SubGrid::min_x_ [protected]

Definition at line 98 of file sub_grid.h.

unsigned int nav_grid_iterators::SubGrid::min_y_ [protected]

Definition at line 98 of file sub_grid.h.

unsigned int nav_grid_iterators::SubGrid::width_ [protected]

Definition at line 98 of file sub_grid.h.


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


nav_grid_iterators
Author(s):
autogenerated on Wed Jun 26 2019 20:09:45