Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Member Functions | List of all members
BIAS::Array2D< T > Class Template Reference

generic two dimensional rectangular array holding arbitrary data types More...

#include <Base/Common/Array2D.hh>

Classes

class  const_iterator
 for const_iterator access todo: derive from std::iterator class(es) More...
 
class  iterator
 for iterator access todo: derive from std::iterator class(es) More...
 

Public Member Functions

 Array2D ()
 
 Array2D (const unsigned nrows, const unsigned ncols)
 
 Array2D (const Array2D< T > &m)
 
const_iterator begin () const
 
iterator begin ()
 
void clear ()
 frees the memory More...
 
bool empty () const
 
const_iterator end () const
 
iterator end ()
 
void fill (const T &val)
 fills the array with val More...
 
unsigned ncols () const
 
unsigned nrows () const
 
T & operator() (const unsigned row, const unsigned col)
 checked element access More...
 
const T & operator() (const unsigned row, const unsigned col) const
 
Array2D< T > & operator= (const Array2D< T > &m)
 copy operator More...
 
T * operator[] (const unsigned row)
 unchecked element access More...
 
const T * operator[] (const unsigned row) const
 
void resize (const unsigned nrows, const unsigned ncols)
 preserves the content More...
 
unsigned size () const
 
 ~Array2D ()
 

Detailed Description

template<class T>
class BIAS::Array2D< T >

generic two dimensional rectangular array holding arbitrary data types

Test:
tested with TestArray2D.cpp The syntax of the access functions is kept similar to the stl:: classes
Author
woelk 09/2007 (c) www.vision-n.de
Examples:
ExampleArray2D.cpp.

Definition at line 31 of file Array2D.hh.

Constructor & Destructor Documentation

template<class T >
BIAS::Array2D< T >::Array2D ( )

Definition at line 152 of file Array2D.hh.

template<class T >
BIAS::Array2D< T >::Array2D ( const unsigned  nrows,
const unsigned  ncols 
)

Definition at line 158 of file Array2D.hh.

template<class T >
BIAS::Array2D< T >::Array2D ( const Array2D< T > &  m)

Definition at line 167 of file Array2D.hh.

template<class T >
BIAS::Array2D< T >::~Array2D ( )

Definition at line 173 of file Array2D.hh.

Member Function Documentation

template<class T>
const_iterator BIAS::Array2D< T >::begin ( ) const
inline

Definition at line 136 of file Array2D.hh.

template<class T>
iterator BIAS::Array2D< T >::begin ( )
inline

Definition at line 139 of file Array2D.hh.

template<class T >
void BIAS::Array2D< T >::clear ( )

frees the memory

Definition at line 198 of file Array2D.hh.

template<class T>
bool BIAS::Array2D< T >::empty ( ) const
inline

Definition at line 65 of file Array2D.hh.

template<class T>
const_iterator BIAS::Array2D< T >::end ( ) const
inline

Definition at line 137 of file Array2D.hh.

template<class T>
iterator BIAS::Array2D< T >::end ( )
inline

Definition at line 140 of file Array2D.hh.

template<class T >
void BIAS::Array2D< T >::fill ( const T &  val)

fills the array with val

Definition at line 227 of file Array2D.hh.

template<class T>
unsigned BIAS::Array2D< T >::ncols ( ) const
inline

Definition at line 71 of file Array2D.hh.

template<class T>
unsigned BIAS::Array2D< T >::nrows ( ) const
inline

Definition at line 73 of file Array2D.hh.

template<class T >
T & BIAS::Array2D< T >::operator() ( const unsigned  row,
const unsigned  col 
)

checked element access

Definition at line 241 of file Array2D.hh.

template<class T >
const T & BIAS::Array2D< T >::operator() ( const unsigned  row,
const unsigned  col 
) const

Definition at line 251 of file Array2D.hh.

template<class T >
Array2D< T > & BIAS::Array2D< T >::operator= ( const Array2D< T > &  m)

copy operator

Definition at line 178 of file Array2D.hh.

template<class T>
T* BIAS::Array2D< T >::operator[] ( const unsigned  row)
inline

unchecked element access

Definition at line 82 of file Array2D.hh.

template<class T>
const T* BIAS::Array2D< T >::operator[] ( const unsigned  row) const
inline

Definition at line 83 of file Array2D.hh.

template<class T >
void BIAS::Array2D< T >::resize ( const unsigned  nrows,
const unsigned  ncols 
)

preserves the content

Definition at line 203 of file Array2D.hh.

template<class T>
unsigned BIAS::Array2D< T >::size ( ) const
inline

Definition at line 75 of file Array2D.hh.


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