Mech-Eye API 2.3.3
API reference documentation for Mech-Eye 3D Laser Profiler
Loading...
Searching...
No Matches
Public Member Functions | List of all members
mmind::eye::Array2D< ElementData > Class Template Reference

Represents a 2D container of data. More...

#include <Array2D.h>

Public Member Functions

 Array2D ()
 Constructor.
 
 ~Array2D ()
 Describes a destructor.
 
size_t width () const
 Returns the width of the Array2D object.
 
size_t height () const
 Returns the height of the Array2D object.
 
bool isEmpty () const
 Returns true if the Array2D object has no elements.
 
const ElementData * data () const
 Returns the pointer to an element in the Array2D object. The returned pointer will be invalidated after resize or release is called.
 
ElementData * data ()
 Returns the pointer to an element in the Array2D object. The returned pointer will be invalidated after resize or release is called.
 
const ElementData & operator[] (std::size_t n) const
 Returns a reference to the constant element with the specified index in the Array2D object using the operator [].
 
ElementData & operator[] (std::size_t n)
 Returns a reference to the constant element with the specified index in the Array2D object using the operator [].
 
const ElementData & at (uint32_t row, uint32_t col) const
 Returns a reference to the constant element at the specified row and column in the Array2D object.
 
ElementData & at (uint32_t row, uint32_t col)
 Returns a reference to the element at the specified row and column in the Array2D object.
 
Array2D< ElementData > clone () const
 Creates a deep copy of the Array2D object.
 
void resize (size_t width, size_t height)
 Changes the size of the Array2D object. It destroys the existing data and reallocates memory according to the new size, if the new size is different from the old size.
 
void release ()
 Deallocates the data in the Array2D object.
 

Detailed Description

template<typename ElementData>
class mmind::eye::Array2D< ElementData >

Represents a 2D container of data.

Definition at line 16 of file Array2D.h.

Constructor & Destructor Documentation

◆ Array2D()

template<typename ElementData >
mmind::eye::Array2D< ElementData >::Array2D ( )
inline

Constructor.

Definition at line 22 of file Array2D.h.

◆ ~Array2D()

template<typename ElementData >
mmind::eye::Array2D< ElementData >::~Array2D ( )
inline

Describes a destructor.

Definition at line 26 of file Array2D.h.

Member Function Documentation

◆ at() [1/2]

template<typename ElementData >
ElementData & mmind::eye::Array2D< ElementData >::at ( uint32_t row,
uint32_t col )
inline

Returns a reference to the element at the specified row and column in the Array2D object.

Parameters
rowThe index along the height dimension. An exception is thrown if the input row is greater than width.
colThe index along the width dimension. An exception is thrown if the input col is greater than height.

Definition at line 109 of file Array2D.h.

◆ at() [2/2]

template<typename ElementData >
const ElementData & mmind::eye::Array2D< ElementData >::at ( uint32_t row,
uint32_t col ) const
inline

Returns a reference to the constant element at the specified row and column in the Array2D object.

Parameters
[in]rowThe index along the height dimension. An exception is thrown if the input row is greater than width.
[in]colThe index along the width dimension. An exception is thrown if the input col is greater than height.

Definition at line 93 of file Array2D.h.

◆ clone()

template<typename ElementData >
Array2D< ElementData > mmind::eye::Array2D< ElementData >::clone ( ) const
inline

Creates a deep copy of the Array2D object.

Definition at line 118 of file Array2D.h.

◆ data() [1/2]

template<typename ElementData >
ElementData * mmind::eye::Array2D< ElementData >::data ( )
inline

Returns the pointer to an element in the Array2D object. The returned pointer will be invalidated after resize or release is called.

Definition at line 55 of file Array2D.h.

◆ data() [2/2]

template<typename ElementData >
const ElementData * mmind::eye::Array2D< ElementData >::data ( ) const
inline

Returns the pointer to an element in the Array2D object. The returned pointer will be invalidated after resize or release is called.

Definition at line 48 of file Array2D.h.

◆ height()

template<typename ElementData >
size_t mmind::eye::Array2D< ElementData >::height ( ) const
inline

Returns the height of the Array2D object.

Definition at line 36 of file Array2D.h.

◆ isEmpty()

template<typename ElementData >
bool mmind::eye::Array2D< ElementData >::isEmpty ( ) const
inline

Returns true if the Array2D object has no elements.

Definition at line 41 of file Array2D.h.

◆ operator[]() [1/2]

template<typename ElementData >
ElementData & mmind::eye::Array2D< ElementData >::operator[] ( std::size_t n)
inline

Returns a reference to the constant element with the specified index in the Array2D object using the operator [].

Parameters
[in]nThe index of an element. An exception is thrown if the input n is greater than width * height.

Definition at line 80 of file Array2D.h.

◆ operator[]() [2/2]

template<typename ElementData >
const ElementData & mmind::eye::Array2D< ElementData >::operator[] ( std::size_t n) const
inline

Returns a reference to the constant element with the specified index in the Array2D object using the operator [].

Parameters
[in]nThe index of an element. An exception is thrown if the input n is greater than width * height.

Definition at line 66 of file Array2D.h.

◆ release()

template<typename ElementData >
void mmind::eye::Array2D< ElementData >::release ( )
inline

Deallocates the data in the Array2D object.

Definition at line 147 of file Array2D.h.

◆ resize()

template<typename ElementData >
void mmind::eye::Array2D< ElementData >::resize ( size_t width,
size_t height )
inline

Changes the size of the Array2D object. It destroys the existing data and reallocates memory according to the new size, if the new size is different from the old size.

Parameters
[in]widthThe new width of the Array2D object.
[in]heightThe new height of the Array2D object.

Definition at line 131 of file Array2D.h.

◆ width()

template<typename ElementData >
size_t mmind::eye::Array2D< ElementData >::width ( ) const
inline

Returns the width of the Array2D object.

Definition at line 31 of file Array2D.h.


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