Nebula
|
#include <fixedtable.h>
A fixed-size 2-dimensional array.
Public Member Functions | |
FixedTable () | |
default constructor | |
FixedTable (SizeT w, SizeT h) | |
constructor with size | |
FixedTable (SizeT w, SizeT h, const TYPE &val) | |
constructor with size and initialized contents | |
FixedTable (const FixedTable< TYPE > &rhs) | |
copy constructor | |
FixedTable (FixedTable< TYPE > &&rhs) noexcept | |
move constructor | |
~FixedTable () | |
destructor | |
void | operator= (const FixedTable< TYPE > &rhs) |
assignment operator | |
void | operator= (FixedTable< TYPE > &&rhs) noexcept |
move assignment operator | |
bool | operator== (const FixedTable< TYPE > &rhs) const |
equality operator | |
bool | operator!= (const FixedTable< TYPE > &rhs) const |
inequality operator | |
void | SetSize (SizeT w, SizeT h) |
set width and height (clears existing content) | |
SizeT | Width () const |
get width | |
SizeT | Height () const |
get height | |
void | Clear (const TYPE &val) |
clear the table with value | |
void | Set (IndexT x, IndexT y, const TYPE &val) |
set value at [x,y] position | |
TYPE & | At (IndexT x, IndexT y) const |
access value at [x,y] position | |
Private Member Functions | |
void | Delete () |
delete content | |
void | Allocate (SizeT w, SizeT h) |
allocate for given size | |
void | Copy (const FixedTable< TYPE > &src) |
copy content | |
Private Attributes | |
SizeT | width |
SizeT | height |
TYPE * | elements |
Util::FixedTable< TYPE >::FixedTable | ( | ) |
default constructor
Util::FixedTable< TYPE >::FixedTable | ( | SizeT | w, |
SizeT | h ) |
constructor with size
Util::FixedTable< TYPE >::FixedTable | ( | SizeT | w, |
SizeT | h, | ||
const TYPE & | val ) |
constructor with size and initialized contents
Util::FixedTable< TYPE >::FixedTable | ( | const FixedTable< TYPE > & | rhs | ) |
copy constructor
|
noexcept |
move constructor
Util::FixedTable< TYPE >::~FixedTable | ( | ) |
destructor
|
private |
allocate for given size
TYPE & Util::FixedTable< TYPE >::At | ( | IndexT | x, |
IndexT | y ) const |
access value at [x,y] position
void Util::FixedTable< TYPE >::Clear | ( | const TYPE & | val | ) |
clear the table with value
|
private |
copy content
NOTE: only works on deleted table.
This is intended.
|
private |
delete content
SizeT Util::FixedTable< TYPE >::Height | ( | ) | const |
get height
bool Util::FixedTable< TYPE >::operator!= | ( | const FixedTable< TYPE > & | rhs | ) | const |
inequality operator
void Util::FixedTable< TYPE >::operator= | ( | const FixedTable< TYPE > & | rhs | ) |
assignment operator
|
noexcept |
move assignment operator
bool Util::FixedTable< TYPE >::operator== | ( | const FixedTable< TYPE > & | rhs | ) | const |
equality operator
void Util::FixedTable< TYPE >::Set | ( | IndexT | x, |
IndexT | y, | ||
const TYPE & | val ) |
set value at [x,y] position
void Util::FixedTable< TYPE >::SetSize | ( | SizeT | w, |
SizeT | h ) |
set width and height (clears existing content)
SizeT Util::FixedTable< TYPE >::Width | ( | ) | const |
get width
|
private |
|
private |
|
private |