Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
vbl_array_2d< T > Class Template Reference

simple 2D array. More...

#include <vbl_array_2d.h>

Public Types

typedef std::size_t size_type
 
typedef T element_type
 
typedef T * iterator
 
typedef T const * const_iterator
 
typedef T & reference
 
typedef T const & const_reference
 

Public Member Functions

 vbl_array_2d ()
 Default constructor. More...
 
 vbl_array_2d (size_type m, size_type n)
 Construct m-by-n array. More...
 
 vbl_array_2d (size_type m, size_type n, const T &v)
 Construct and fill an m-by-n array. More...
 
 vbl_array_2d (vbl_array_2d< T > const &that)
 Construct from a 2d array. More...
 
 ~vbl_array_2d ()
 Destructor. More...
 
vbl_array_2d< T > & operator= (vbl_array_2d< T > const &that)
 Assignment. More...
 
bool operator== (vbl_array_2d< T > const &that) const
 Comparison. More...
 
bool operator!= (vbl_array_2d< T > const &that) const
 
void fill (T value)
 fill with ‘value’. More...
 
void resize (size_type m, size_type n)
 change size. More...
 
void clear ()
 make as if default-constructed. More...
 
const_reference operator() (size_type i, size_type j) const
 
reference operator() (size_type i, size_type j)
 
void put (size_type i, size_type j, T const &x)
 
get (size_type i, size_type j) const
 
T const * operator[] (size_type i) const
 
T * operator[] (size_type i)
 
size_type rows () const
 Return number of rows. More...
 
size_type cols () const
 Return number of columns. More...
 
size_type columns () const
 Return number of columns. More...
 
size_type size () const
 Return size = (number of rows) * (number of columns). More...
 
size_type capacity () const
 
T ** get_rows ()
 
T const *const * get_rows () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 

Private Member Functions

void construct ()
 
void construct (size_type m, size_type n)
 
void destruct ()
 

Private Attributes

element_type ** rows_
 
size_type num_rows_
 
size_type num_cols_
 

Detailed Description

template<class T>
class vbl_array_2d< T >

simple 2D array.

Definition at line 25 of file vbl_array_2d.h.

Member Typedef Documentation

◆ const_iterator

template<class T>
typedef T const* vbl_array_2d< T >::const_iterator

Definition at line 38 of file vbl_array_2d.h.

◆ const_reference

template<class T>
typedef T const& vbl_array_2d< T >::const_reference

Definition at line 41 of file vbl_array_2d.h.

◆ element_type

template<class T>
typedef T vbl_array_2d< T >::element_type

Definition at line 29 of file vbl_array_2d.h.

◆ iterator

template<class T>
typedef T* vbl_array_2d< T >::iterator

Definition at line 37 of file vbl_array_2d.h.

◆ reference

template<class T>
typedef T& vbl_array_2d< T >::reference

Definition at line 40 of file vbl_array_2d.h.

◆ size_type

template<class T>
typedef std::size_t vbl_array_2d< T >::size_type

Definition at line 28 of file vbl_array_2d.h.

Constructor & Destructor Documentation

◆ vbl_array_2d() [1/4]

template<class T>
vbl_array_2d< T >::vbl_array_2d ( )
inline

Default constructor.

Definition at line 45 of file vbl_array_2d.h.

◆ vbl_array_2d() [2/4]

template<class T>
vbl_array_2d< T >::vbl_array_2d ( size_type  m,
size_type  n 
)
inline

Construct m-by-n array.

Definition at line 48 of file vbl_array_2d.h.

◆ vbl_array_2d() [3/4]

template<class T>
vbl_array_2d< T >::vbl_array_2d ( size_type  m,
size_type  n,
const T &  v 
)
inline

Construct and fill an m-by-n array.

Definition at line 51 of file vbl_array_2d.h.

◆ vbl_array_2d() [4/4]

template<class T>
vbl_array_2d< T >::vbl_array_2d ( vbl_array_2d< T > const &  that)
inline

Construct from a 2d array.

Definition at line 54 of file vbl_array_2d.h.

◆ ~vbl_array_2d()

template<class T>
vbl_array_2d< T >::~vbl_array_2d ( )
inline

Destructor.

Definition at line 60 of file vbl_array_2d.h.

Member Function Documentation

◆ begin() [1/2]

template<class T>
iterator vbl_array_2d< T >::begin ( )
inline

Definition at line 138 of file vbl_array_2d.h.

◆ begin() [2/2]

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

Definition at line 141 of file vbl_array_2d.h.

◆ capacity()

template<class T>
size_type vbl_array_2d< T >::capacity ( ) const
inline

Definition at line 132 of file vbl_array_2d.h.

◆ clear()

template<class T>
void vbl_array_2d< T >::clear ( )
inline

make as if default-constructed.

Definition at line 103 of file vbl_array_2d.h.

◆ cols()

template<class T>
size_type vbl_array_2d< T >::cols ( ) const
inline

Return number of columns.

Definition at line 125 of file vbl_array_2d.h.

◆ columns()

template<class T>
size_type vbl_array_2d< T >::columns ( ) const
inline

Return number of columns.

Definition at line 128 of file vbl_array_2d.h.

◆ construct() [1/2]

template<class T>
void vbl_array_2d< T >::construct ( )
inlineprivate

Definition at line 145 of file vbl_array_2d.h.

◆ construct() [2/2]

template<class T>
void vbl_array_2d< T >::construct ( size_type  m,
size_type  n 
)
inlineprivate

Definition at line 151 of file vbl_array_2d.h.

◆ destruct()

template<class T>
void vbl_array_2d< T >::destruct ( )
inlineprivate

Definition at line 165 of file vbl_array_2d.h.

◆ end() [1/2]

template<class T>
iterator vbl_array_2d< T >::end ( )
inline

Definition at line 139 of file vbl_array_2d.h.

◆ end() [2/2]

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

Definition at line 142 of file vbl_array_2d.h.

◆ fill()

template<class T>
void vbl_array_2d< T >::fill ( value)
inline

fill with ‘value’.

Definition at line 88 of file vbl_array_2d.h.

◆ get()

template<class T>
T vbl_array_2d< T >::get ( size_type  i,
size_type  j 
) const
inline

Definition at line 115 of file vbl_array_2d.h.

◆ get_rows() [1/2]

template<class T>
T* * vbl_array_2d< T >::get_rows ( )
inline

Definition at line 134 of file vbl_array_2d.h.

◆ get_rows() [2/2]

template<class T>
T const* const* vbl_array_2d< T >::get_rows ( ) const
inline

Definition at line 135 of file vbl_array_2d.h.

◆ operator!=()

template<class T>
bool vbl_array_2d< T >::operator!= ( vbl_array_2d< T > const &  that) const
inline

Definition at line 83 of file vbl_array_2d.h.

◆ operator()() [1/2]

template<class T>
const_reference vbl_array_2d< T >::operator() ( size_type  i,
size_type  j 
) const
inline

Definition at line 111 of file vbl_array_2d.h.

◆ operator()() [2/2]

template<class T>
reference vbl_array_2d< T >::operator() ( size_type  i,
size_type  j 
)
inline

Definition at line 112 of file vbl_array_2d.h.

◆ operator=()

template<class T>
vbl_array_2d<T>& vbl_array_2d< T >::operator= ( vbl_array_2d< T > const &  that)
inline

Assignment.

Definition at line 63 of file vbl_array_2d.h.

◆ operator==()

template<class T>
bool vbl_array_2d< T >::operator== ( vbl_array_2d< T > const &  that) const
inline

Comparison.

Definition at line 72 of file vbl_array_2d.h.

◆ operator[]() [1/2]

template<class T>
T const* vbl_array_2d< T >::operator[] ( size_type  i) const
inline

Definition at line 117 of file vbl_array_2d.h.

◆ operator[]() [2/2]

template<class T>
T* vbl_array_2d< T >::operator[] ( size_type  i)
inline

Definition at line 118 of file vbl_array_2d.h.

◆ put()

template<class T>
void vbl_array_2d< T >::put ( size_type  i,
size_type  j,
T const &  x 
)
inline

Definition at line 114 of file vbl_array_2d.h.

◆ resize()

template<class T>
void vbl_array_2d< T >::resize ( size_type  m,
size_type  n 
)
inline

change size.

Definition at line 95 of file vbl_array_2d.h.

◆ rows()

template<class T>
size_type vbl_array_2d< T >::rows ( ) const
inline

Return number of rows.

Definition at line 122 of file vbl_array_2d.h.

◆ size()

template<class T>
size_type vbl_array_2d< T >::size ( ) const
inline

Return size = (number of rows) * (number of columns).

Definition at line 131 of file vbl_array_2d.h.

Member Data Documentation

◆ num_cols_

template<class T>
size_type vbl_array_2d< T >::num_cols_
private

Definition at line 34 of file vbl_array_2d.h.

◆ num_rows_

template<class T>
size_type vbl_array_2d< T >::num_rows_
private

Definition at line 33 of file vbl_array_2d.h.

◆ rows_

template<class T>
element_type** vbl_array_2d< T >::rows_
private

Definition at line 32 of file vbl_array_2d.h.


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