Bridges-C++
3.4.4
Bridges(C++ API)
|
#include <Grid.h>
This is a class in BRIDGES for representing an (n x n) grid.
This class will be useful in applications such as image processing, board games, etc.
E | There is a tutorial about Grid : https://bridgesuncc.github.io/tutorials/Grid.html |
Classes | |
class | BracketHelper |
This BracketHelper is a helper class to get the [] operators to work. It is not intended to be used by bridges users. More... | |
class | BracketHelperConst |
This BracketHelperConst is a helper class to get the [] operators to work. More... | |
Public Member Functions | |
virtual const string | getDStype () const override |
Return the data structure type. More... | |
Grid (int rows, int cols) | |
Grid constructor. More... | |
Grid () | |
Grid (int *size) | |
Grid constructor given size. More... | |
Grid (const Grid &g) | |
Grid constructor given an input grid. More... | |
virtual | ~Grid () |
Grid & | operator= (const Grid &g) |
void | setDimensions (int rows, int cols) |
Construct the grid given the dimensions. More... | |
int const * | getDimensions () |
Get dimenions of the grid. More... | |
E const & | get (int row, int col) const |
Get the (row, col) element in the grid. More... | |
void | set (int row, int col, E val) |
Set the grid value for the (row, col) element. More... | |
BracketHelperConst | operator[] (int row) const |
provides the necessary abstraction to do something = grid[x][y]; More... | |
BracketHelper | operator[] (int row) |
provides the necessary abstraction to do grid[x][y] = something; More... | |
Public Member Functions inherited from bridges::datastructure::DataStructure | |
virtual | ~DataStructure ()=default |
Protected Attributes | |
E ** | grid = nullptr |
int | gridSize [2] |
int | maxGridSize [2] = {1080, 1920} |
|
inline |
Grid constructor.
rows | height of grid |
cols | width of grid |
|
inline |
default constructor
|
inlineexplicit |
Grid constructor given size.
size | size of grid |
|
inline |
|
inlinevirtual |
Destructor
|
inline |
Get the (row, col) element in the grid.
row | height of grid |
col | width of grid |
|
inline |
Get dimenions of the grid.
|
inlineoverridevirtual |
Return the data structure type.
Implements bridges::datastructure::DataStructure.
Reimplemented in bridges::game::GameGrid, and bridges::datastructure::ColorGrid.
|
inline |
copy constructor
|
inline |
provides the necessary abstraction to do grid[x][y] = something;
|
inline |
provides the necessary abstraction to do something = grid[x][y];
|
inline |
Set the grid value for the (row, col) element.
row | height of grid |
col | width of grid |
val | value to be set |
|
inline |
Construct the grid given the dimensions.
rows | height of grid |
cols | width of grid |
|
protected |
|
protected |
|
protected |