Nebula
Loading...
Searching...
No Matches
Util::FixedTable< TYPE > Class Template Reference

#include <fixedtable.h>

Detailed Description

template<class TYPE>
class Util::FixedTable< TYPE >

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

Constructor & Destructor Documentation

◆ FixedTable() [1/5]

template<class TYPE>
Util::FixedTable< TYPE >::FixedTable ( )

default constructor

◆ FixedTable() [2/5]

template<class TYPE>
Util::FixedTable< TYPE >::FixedTable ( SizeT w,
SizeT h )

constructor with size

◆ FixedTable() [3/5]

template<class TYPE>
Util::FixedTable< TYPE >::FixedTable ( SizeT w,
SizeT h,
const TYPE & val )

constructor with size and initialized contents

◆ FixedTable() [4/5]

template<class TYPE>
Util::FixedTable< TYPE >::FixedTable ( const FixedTable< TYPE > & rhs)

copy constructor

◆ FixedTable() [5/5]

template<class TYPE>
Util::FixedTable< TYPE >::FixedTable ( FixedTable< TYPE > && rhs)
noexcept

move constructor

◆ ~FixedTable()

template<class TYPE>
Util::FixedTable< TYPE >::~FixedTable ( )

destructor

Member Function Documentation

◆ Allocate()

template<class TYPE>
void Util::FixedTable< TYPE >::Allocate ( SizeT w,
SizeT h )
private

allocate for given size

◆ At()

template<class TYPE>
TYPE & Util::FixedTable< TYPE >::At ( IndexT x,
IndexT y ) const

access value at [x,y] position

◆ Clear()

template<class TYPE>
void Util::FixedTable< TYPE >::Clear ( const TYPE & val)

clear the table with value

◆ Copy()

template<class TYPE>
void Util::FixedTable< TYPE >::Copy ( const FixedTable< TYPE > & rhs)
private

copy content

NOTE: only works on deleted table.

This is intended.

◆ Delete()

template<class TYPE>
void Util::FixedTable< TYPE >::Delete ( )
private

delete content

◆ Height()

template<class TYPE>
SizeT Util::FixedTable< TYPE >::Height ( ) const

get height

◆ operator!=()

template<class TYPE>
bool Util::FixedTable< TYPE >::operator!= ( const FixedTable< TYPE > & rhs) const

inequality operator

◆ operator=() [1/2]

template<class TYPE>
void Util::FixedTable< TYPE >::operator= ( const FixedTable< TYPE > & rhs)

assignment operator

◆ operator=() [2/2]

template<class TYPE>
void Util::FixedTable< TYPE >::operator= ( FixedTable< TYPE > && rhs)
noexcept

move assignment operator

◆ operator==()

template<class TYPE>
bool Util::FixedTable< TYPE >::operator== ( const FixedTable< TYPE > & rhs) const

equality operator

◆ Set()

template<class TYPE>
void Util::FixedTable< TYPE >::Set ( IndexT x,
IndexT y,
const TYPE & val )

set value at [x,y] position

◆ SetSize()

template<class TYPE>
void Util::FixedTable< TYPE >::SetSize ( SizeT w,
SizeT h )

set width and height (clears existing content)

◆ Width()

template<class TYPE>
SizeT Util::FixedTable< TYPE >::Width ( ) const

get width

Member Data Documentation

◆ elements

template<class TYPE>
TYPE* Util::FixedTable< TYPE >::elements
private

◆ height

template<class TYPE>
SizeT Util::FixedTable< TYPE >::height
private

◆ width

template<class TYPE>
SizeT Util::FixedTable< TYPE >::width
private

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