OSFI-C++  3.9.2
OpenSF Integration Library
DynamicArray< T > Class Template Reference

#include <DynamicArray.h>

Public Member Functions

 DynamicArray ()
 
 DynamicArray (int rows, int columns)
 
const std::vector< T > & operator[] (int i) const
 
std::vector< T >::reference operator() (int i, int j)
 
std::vector< T >::const_reference operator() (int i, int j) const
 
std::vector< T >::reference at (int i, int j)
 
std::vector< T >::const_reference at (int i, int j) const
 
void resize (int rows, int columns)
 
int getRows () const
 
int getColumns () const
 

Detailed Description

template<typename T>
class DynamicArray< T >

An implementation of a generic and dynamic bi-dimensional matrix.

Constructor & Destructor Documentation

◆ DynamicArray() [1/2]

template<typename T >
DynamicArray< T >::DynamicArray ( )
inline

Class default constructor.

◆ DynamicArray() [2/2]

template<typename T >
DynamicArray< T >::DynamicArray ( int  rows,
int  columns 
)
inline

Class "size" constructor. Creates an instance of the class, specifying the number of rows and columns.

Parameters
rowsnumber of rows
columnsnumber of columns

Member Function Documentation

◆ at() [1/2]

template<typename T >
std::vector<T>::reference DynamicArray< T >::at ( int  i,
int  j 
)
inline

Returns a reference to the element in row i and column j

Parameters
irows
jcolumns
Exceptions
std::out_of_rangeIf the row or column are not in range

◆ at() [2/2]

template<typename T >
std::vector<T>::const_reference DynamicArray< T >::at ( int  i,
int  j 
) const
inline

Returns a reference to the element in row i and column j

Parameters
irows
jcolumns
Exceptions
std::out_of_rangeIf the row or column are not in range

◆ getColumns()

template<typename T >
int DynamicArray< T >::getColumns ( ) const
inline

Gets the number of columns.

Returns
number of columns.

◆ getRows()

template<typename T >
int DynamicArray< T >::getRows ( ) const
inline

Gets the number of rows.

Returns
numner of rows

◆ operator()() [1/2]

template<typename T >
std::vector<T>::reference DynamicArray< T >::operator() ( int  i,
int  j 
)
inline

Indexing operator.

Parameters
irows
jcolumns
Returns
T&

◆ operator()() [2/2]

template<typename T >
std::vector<T>::const_reference DynamicArray< T >::operator() ( int  i,
int  j 
) const
inline

Constant indexing operator.

Parameters
irows
jcolumns
Returns
const T&

◆ operator[]()

template<typename T >
const std::vector<T>& DynamicArray< T >::operator[] ( int  i) const
inline

Constant indexing operator.

Parameters
ielement number
Returns
element address

◆ resize()

template<typename T >
void DynamicArray< T >::resize ( int  rows,
int  columns 
)
inline

Changes the size of the instance.

Parameters
rows- new number of rows
columns- new number of columns

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