#include <_src_base_array_2d.hh>
Public Member Functions | |
| Array2D (void) | |
| Array2D (const int sx, const int sy) | |
| (sx,sy) defines 2D size. | |
| ~Array2D () | |
| void | resize (const int sx, const int sy) |
| void | clear (void) |
| uint | size (void) const |
| uint | width (void) const |
| uint | height (void) const |
| bool | empty (void) const |
| uint | Index1D (int x, int y) const |
| void | Set (const int x, const int y, const T &val) |
| T & | Get (const int x, const int y) |
| const T & | Get (const int x, const int y) const |
| R/O access to element by its 2D coordinates. | |
| T & | operator[] (const uint index1D) |
| R/W access to element by its 1D index. | |
| const T & | operator[] (const uint index1D) const |
| R/O access to element by its 1D index. | |
Private Attributes | |
| int | mSx |
| size of X dimension | |
| int | mSy |
| size of Y dimension | |
| int | mSxM1 |
| mSx - 1 | |
| int | mSyM1 |
| mSx - 1 | |
| vector< T > | mVec |
| actual array | |
Indexs are signed, rather than unsigned, to clamp negative indexs at 0.
Array2D is allowed to be initially empty which is defined as sx=sy=0. Methods that access elements become invalid when an array is empty.
| base::Array2D< T, BASE >::Array2D | ( | void | ) | [inline] |
| base::Array2D< T, BASE >::Array2D | ( | const int | sx, | |
| const int | sy | |||
| ) | [inline] |
(sx,sy) defines 2D size.
| base::Array2D< T, BASE >::~Array2D | ( | ) | [inline] |
| void base::Array2D< T, BASE >::resize | ( | const int | sx, | |
| const int | sy | |||
| ) | [inline] |
| void base::Array2D< T, BASE >::clear | ( | void | ) | [inline] |
| uint base::Array2D< T, BASE >::size | ( | void | ) | const [inline] |
| uint base::Array2D< T, BASE >::width | ( | void | ) | const [inline] |
| uint base::Array2D< T, BASE >::height | ( | void | ) | const [inline] |
| bool base::Array2D< T, BASE >::empty | ( | void | ) | const [inline] |
| uint base::Array2D< T, BASE >::Index1D | ( | int | x, | |
| int | y | |||
| ) | const [inline] |
| void base::Array2D< T, BASE >::Set | ( | const int | x, | |
| const int | y, | |||
| const T & | val | |||
| ) | [inline] |
Write to element by its 2D coordinates. The order of args of Set() is similar to: mArray[x][y] = val; mArray.Set( x, y, val );
| T& base::Array2D< T, BASE >::Get | ( | const int | x, | |
| const int | y | |||
| ) | [inline] |
R/W access to element by its 2D coordinates. Can be used to write to element (Set() is more sensible).
| const T& base::Array2D< T, BASE >::Get | ( | const int | x, | |
| const int | y | |||
| ) | const [inline] |
R/O access to element by its 2D coordinates.
| T& base::Array2D< T, BASE >::operator[] | ( | const uint | index1D | ) | [inline] |
R/W access to element by its 1D index.
| const T& base::Array2D< T, BASE >::operator[] | ( | const uint | index1D | ) | const [inline] |
R/O access to element by its 1D index.
int base::Array2D< T, BASE >::mSx [private] |
size of X dimension
int base::Array2D< T, BASE >::mSy [private] |
size of Y dimension
int base::Array2D< T, BASE >::mSxM1 [private] |
mSx - 1
int base::Array2D< T, BASE >::mSyM1 [private] |
mSx - 1
vector<T> base::Array2D< T, BASE >::mVec [private] |
actual array
Palomino Flight Simulator documents generated by doxygen 1.5.6 on Tue Sep 28 11:37:49 2010