Bridges-C++
3.4.4
Bridges(C++ API)
|
#include <Array2D.h>
A BRIDGES array type.
This class can be used to create 2D arrays of any type.
The access to the values stored are done directly using bracket operators such as
Entries in the array can be styled by showing a label and changing the color of an entry. This is achieved by styling the underlying element to a particular entry of the array such as:
E | the application data type |
Classes | |
struct | Bracket_helper |
helper class to make [][] operators work on array 2d. You should never use it directly More... | |
struct | Bracket_helper_const |
helper class to make [][] operators work on array 2d. You should never use it directly More... | |
Public Member Functions | |
virtual | ~Array2D () |
Array2D (int rows, int cols) | |
builds an array of given dimensions More... | |
int | getNumRows () |
int | getNumColumns () |
Gets the number of columns of the 2D array. More... | |
Element< E > & | getElement (int row, int col) |
void | setElement (int row, int col, Element< E > el) |
Bracket_helper | operator[] (int index) |
enables using the bracket [] operator More... | |
Bracket_helper_const | operator[] (int index) const |
enables using the bracket [] operator More... | |
Public Member Functions inherited from bridges::datastructure::Array< E > | |
virtual const string | getDStype () const override |
virtual const string | getDataStructureRepresentation () const override final |
Array (const Array &)=delete | |
Array & | operator= (const Array &)=delete |
Public Member Functions inherited from bridges::datastructure::DataStructure | |
virtual | ~DataStructure ()=default |
Additional Inherited Members | |
Protected Member Functions inherited from bridges::datastructure::Array< E > | |
Array () | |
virtual | ~Array () |
Array (int sz) | |
builds an array given the size More... | |
void | setSize (int nd, int *dim) |
Set the size of the array. More... | |
void | getDimensions (int *dim) |
Get the dimensions of the array. More... | |
int const * | getDimensions () const |
Element< E > & | getElement (int index) |
Element< E > const & | getElement (int index) const |
Get the object at index index - 1D array. More... | |
void | setElement (int ind, Element< E > el) |
Set the Element at index ind - 1D array. More... | |
|
inlinevirtual |
|
inline |
builds an array of given dimensions
rows | number of rows |
cols | number of cols |
|
inline |
Get the object at (row, col)
row | - row index |
col | - column index |
|
inline |
Gets the number of columns of the 2D array.
|
inline |
Gets the number of rows of the 2D array
|
inline |
enables using the bracket [] operator
|
inline |
enables using the bracket [] operator
|
inline |
Set the object at index row, col - 2D array
row | - row index into the array |
col | - column index into the array |
el | - Element object |